@unicom-cloud/ui 0.8.98 → 0.8.100

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 (180) hide show
  1. package/Anchor.js +3 -1
  2. package/Badge.js +54 -7
  3. package/Copy.js +49 -2
  4. package/Flex.js +12 -0
  5. package/Grid.js +1 -1
  6. package/LiquidFill.js +60 -2
  7. package/Marquee.js +62 -0
  8. package/QrCode.js +14 -9
  9. package/Segmented.js +11 -0
  10. package/Space.js +14 -6
  11. package/Splitter.js +6 -0
  12. package/Tag.js +3 -2
  13. package/Tour.js +14 -9
  14. package/alert/index.js +38 -39
  15. package/anchor/index.js +5 -3
  16. package/badge/index.js +174 -80
  17. package/collapse/Collapse.js +54 -48
  18. package/components/common/space/index.js +90 -106
  19. package/copy/index.js +83 -35
  20. package/flex/index.js +59 -0
  21. package/flex/interface.js +34 -0
  22. package/flex/utils.js +13 -0
  23. package/grid/{GridItem.js → Item.js} +15 -15
  24. package/grid/index.js +1 -1
  25. package/index.js +490 -477
  26. package/input/Button.js +39 -34
  27. package/input/Textarea.js +108 -104
  28. package/liquid-fill/index.js +256 -2
  29. package/marquee/index.js +283 -0
  30. package/menu/Item.js +17 -16
  31. package/package.json +1 -1
  32. package/qr-code/index.js +54 -36
  33. package/rate/index.js +8 -8
  34. package/segmented/index.js +225 -0
  35. package/space/index.js +28 -29
  36. package/spin/index.js +75 -62
  37. package/splitter/Panel.js +39 -0
  38. package/splitter/SplitBar.js +157 -0
  39. package/splitter/Splitter.js +139 -0
  40. package/splitter/hooks/useEvent.js +12 -0
  41. package/splitter/hooks/useItems.js +26 -0
  42. package/splitter/hooks/useResizable.js +26 -0
  43. package/splitter/hooks/useResize.js +68 -0
  44. package/splitter/hooks/useSizes.js +60 -0
  45. package/splitter/index.js +7 -0
  46. package/splitter/interface.js +1 -0
  47. package/style.css +1 -1
  48. package/table/Table.js +1 -1
  49. package/table/hook/useThResizable.js +72 -26
  50. package/table/tbody/Td.js +80 -77
  51. package/table/th-resizable/index.js +92 -35
  52. package/tag/index.js +42 -41
  53. package/tooltip/index.js +89 -82
  54. package/tour/index.js +110 -89
  55. package/types/common/hooks/useMergeProps.d.ts +1 -1
  56. package/types/common/space/index.d.ts +7 -5
  57. package/types/common/space/interface.d.ts +29 -16
  58. package/types/pc/affix/interface.d.ts +0 -2
  59. package/types/pc/alert/index.d.ts +2 -2
  60. package/types/pc/anchor/index.d.ts +2 -1
  61. package/types/pc/anchor/interface.d.ts +0 -2
  62. package/types/pc/auto-complete/interface.d.ts +0 -6
  63. package/types/pc/avatar/interface.d.ts +0 -4
  64. package/types/pc/badge/index.d.ts +4 -4
  65. package/types/pc/badge/interface.d.ts +26 -0
  66. package/types/pc/breadcrumb/interface.d.ts +0 -3
  67. package/types/pc/carousel/interface.d.ts +2 -6
  68. package/types/pc/cascader/interface.d.ts +6 -18
  69. package/types/pc/checkbox/interface.d.ts +0 -1
  70. package/types/pc/collapse/interface.d.ts +4 -2
  71. package/types/pc/color-picker/interface.d.ts +0 -2
  72. package/types/pc/config-provider/interface.d.ts +16 -14
  73. package/types/pc/copy/interface.d.ts +2 -1
  74. package/types/pc/date-picker/RangePicker.d.ts +1 -1
  75. package/types/pc/date-picker/interface.d.ts +0 -17
  76. package/types/pc/descriptions/interface.d.ts +0 -1
  77. package/types/pc/drawer/interface.d.ts +0 -7
  78. package/types/pc/dropdown/interface.d.ts +0 -1
  79. package/types/pc/flex/index.d.ts +9 -0
  80. package/types/pc/flex/interface.d.ts +61 -0
  81. package/types/pc/flex/utils.d.ts +9 -0
  82. package/types/pc/form/interface.d.ts +9 -22
  83. package/types/pc/form/util.d.ts +1 -1
  84. package/types/pc/grid/index.d.ts +3 -3
  85. package/types/pc/grid/interface.d.ts +1 -6
  86. package/types/pc/image/interface.d.ts +0 -13
  87. package/types/pc/index.d.ts +16 -6
  88. package/types/pc/input/Textarea.d.ts +2 -6
  89. package/types/pc/input/interface.d.ts +5 -13
  90. package/types/pc/input-number/interface.d.ts +0 -4
  91. package/types/pc/input-tag/interface.d.ts +0 -13
  92. package/types/pc/layout/interface.d.ts +0 -1
  93. package/types/pc/link/interface.d.ts +0 -1
  94. package/types/pc/liquid-fill/index.d.ts +114 -1
  95. package/types/pc/list/interface.d.ts +0 -4
  96. package/types/pc/marquee/index.d.ts +61 -0
  97. package/types/pc/menu/context.d.ts +1 -1
  98. package/types/pc/menu/interface.d.ts +0 -8
  99. package/types/pc/message/interface.d.ts +0 -2
  100. package/types/pc/modal/interface.d.ts +0 -5
  101. package/types/pc/notification/interface.d.ts +0 -1
  102. package/types/pc/pagination/interface.d.ts +0 -2
  103. package/types/pc/popconfirm/interface.d.ts +8 -10
  104. package/types/pc/popover/interface.d.ts +0 -1
  105. package/types/pc/progress/interface.d.ts +0 -3
  106. package/types/pc/qr-code/index.d.ts +1 -1
  107. package/types/pc/rate/index.d.ts +2 -2
  108. package/types/pc/resize-box/interface.d.ts +1 -7
  109. package/types/pc/segmented/index.d.ts +8 -0
  110. package/types/pc/segmented/interface.d.ts +88 -0
  111. package/types/pc/select/interface.d.ts +0 -12
  112. package/types/pc/select-view/interface.d.ts +0 -7
  113. package/types/pc/slider/interface.d.ts +0 -4
  114. package/types/pc/space/index.d.ts +4 -1
  115. package/types/pc/space/interface.d.ts +6 -10
  116. package/types/pc/spin/interface.d.ts +4 -1
  117. package/types/pc/splitter/Panel.d.ts +8 -0
  118. package/types/pc/splitter/SplitBar.d.ts +21 -0
  119. package/types/pc/splitter/Splitter.d.ts +4 -0
  120. package/types/pc/splitter/hooks/useEvent.d.ts +3 -0
  121. package/types/pc/splitter/hooks/useItems.d.ts +10 -0
  122. package/types/pc/splitter/hooks/useResizable.d.ts +8 -0
  123. package/types/pc/splitter/hooks/useResize.d.ts +4 -0
  124. package/types/pc/splitter/hooks/useSizes.d.ts +5 -0
  125. package/types/pc/splitter/index.d.ts +8 -0
  126. package/types/pc/splitter/interface.d.ts +213 -0
  127. package/types/pc/statistic/interface.d.ts +0 -4
  128. package/types/pc/steps/interface.d.ts +0 -3
  129. package/types/pc/table/hook/useThResizable.d.ts +2 -2
  130. package/types/pc/table/interface.d.ts +4 -15
  131. package/types/pc/tabs/interface.d.ts +0 -7
  132. package/types/pc/tag/index.d.ts +2 -0
  133. package/types/pc/tag/interface.d.ts +0 -1
  134. package/types/pc/time-picker/interface.d.ts +0 -7
  135. package/types/pc/tooltip/interface.d.ts +4 -1
  136. package/types/pc/tour/index.d.ts +6 -1
  137. package/types/pc/transfer/interface.d.ts +2 -9
  138. package/types/pc/tree/interface.d.ts +2 -8
  139. package/types/pc/tree-select/interface.d.ts +0 -8
  140. package/types/pc/trigger/interface.d.ts +0 -5
  141. package/types/pc/typography/EditContent.d.ts +2 -1
  142. package/types/pc/typography/interface.d.ts +45 -30
  143. package/types/pc/upload/interface.d.ts +6 -11
  144. package/types/pc/utils/index.d.ts +1 -0
  145. package/types/pc/utils/names.d.ts +24 -0
  146. package/types/pc/utils/toArray.d.ts +7 -0
  147. package/types/pc/verification-code/interface.d.ts +0 -2
  148. package/types/pc/watermark/interface.d.ts +0 -2
  149. package/typography/Base.js +73 -73
  150. package/typography/EditContent.js +43 -33
  151. package/typography/Ellipsis.js +117 -184
  152. package/typography/Operations.js +97 -49
  153. package/typography/useCssEllipsis.js +7 -6
  154. package/utils/index.js +117 -115
  155. package/utils/names.js +16 -0
  156. package/utils/toArray.js +12 -0
  157. package/version/index.js +1 -1
  158. package/_virtual/_commonjsHelpers.js +0 -6
  159. package/_virtual/index.js +0 -7
  160. package/_virtual/index2.js +0 -4
  161. package/liquid-fill/LiquidFill.js +0 -226
  162. package/liquid-fill/LiquidFill2.js +0 -3
  163. package/space-/index.js +0 -93
  164. package/types/common/utils/color.d.ts +0 -1
  165. package/types/common/utils/computeScrollIntoView.d.ts +0 -1
  166. package/types/common/utils/index.d.ts +0 -45
  167. package/types/common/utils/math.d.ts +0 -1
  168. package/types/common/utils/reactTransitionGroup.d.ts +0 -1
  169. package/types/common/utils/tree.d.ts +0 -1
  170. package/types/common/utils/tween.d.ts +0 -1
  171. package/types/common/utils/uuid.d.ts +0 -1
  172. package/types/common/utils/validate.d.ts +0 -1
  173. package/types/pc/liquid-fill/LiquidFill.d.ts +0 -115
  174. package/types/pc/liquid-fill/LiquidFill2.d.ts +0 -1
  175. package/types/pc/space-/index.d.ts +0 -6
  176. package/types/pc/space-/interface.d.ts +0 -38
  177. /package/{space- → components/common/space}/toArray.js +0 -0
  178. /package/{space- → segmented}/interface.js +0 -0
  179. /package/types/{pc/space- → common/space}/toArray.d.ts +0 -0
  180. /package/types/pc/grid/{GridItem.d.ts → Item.d.ts} +0 -0
package/input/Button.js CHANGED
@@ -1,67 +1,72 @@
1
1
  import { jsx as u } from "react/jsx-runtime";
2
- import d from "lodash/isPlainObject";
2
+ import m from "lodash/isPlainObject";
3
3
  import A, { useContext as B } from "react";
4
- import M from "../button/index.js";
4
+ import P from "../button/index.js";
5
5
  import "../config-provider/ConfigProvider.js";
6
- import P from "../components/common/hooks/useMergeValue.js";
7
- import s from "@unicom-cloud/utils/class-name";
8
- import $, { formatValue as f } from "./Input.js";
9
- import j from "../config-provider/context.js";
10
- const z = A.forwardRef(
11
- (e, c) => {
12
- const { getPrefixCls: g } = B(j), {
6
+ import $ from "../components/common/hooks/useMergeValue.js";
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(
11
+ (t, f) => {
12
+ const { getPrefixCls: g } = B(z), {
13
13
  className: h,
14
14
  style: x,
15
15
  placeholder: C,
16
16
  disabled: o,
17
- loading: I,
18
- defaultValue: b,
17
+ loading: O,
18
+ defaultValue: v,
19
19
  addAfter: l,
20
20
  buttonProps: a,
21
- label: v,
21
+ label: b,
22
22
  onCallback: L,
23
- ...i
24
- } = e, n = g?.("input-button"), m = l === void 0 ? /* @__PURE__ */ u(
25
- M,
23
+ ...s
24
+ } = t, n = g?.("input-button"), N = {
25
+ error: "danger",
26
+ warning: "warning",
27
+ success: "success"
28
+ }, V = t.status ? N[t.status] : void 0, i = l === void 0 ? /* @__PURE__ */ u(
29
+ P,
26
30
  {
27
31
  type: "primary",
28
32
  disabled: o,
29
- size: i.size,
33
+ size: s.size,
30
34
  loadingFixedWidth: !0,
35
+ status: V,
31
36
  ...a,
32
- className: s(`${n}-btn`, a?.className),
33
- onClick: (t) => {
34
- L?.(V), e.onClick?.(t), a?.onClick?.(t);
37
+ className: c(`${n}-btn`, a?.className),
38
+ onClick: (e) => {
39
+ L?.(k), t.onClick?.(e), a?.onClick?.(e);
35
40
  },
36
- children: v ?? "确定"
41
+ children: b ?? "确定"
37
42
  }
38
- ) : l, N = d(e.maxLength) ? e.maxLength.length : e.maxLength, r = d(e.maxLength) && e.maxLength.errorOnly ? void 0 : N, [V, y] = P("", {
39
- defaultValue: "defaultValue" in e ? f(e.defaultValue, r) : void 0,
40
- value: "value" in e ? f(e.value, r) : void 0
43
+ ) : l, y = m(t.maxLength) ? t.maxLength.length : t.maxLength, r = m(t.maxLength) && t.maxLength.errorOnly ? void 0 : y, [k, M] = $("", {
44
+ defaultValue: "defaultValue" in t ? d(t.defaultValue, r) : void 0,
45
+ value: "value" in t ? d(t.value, r) : void 0
41
46
  });
42
47
  return /* @__PURE__ */ u(
43
- $,
48
+ j,
44
49
  {
45
- ...i,
46
- className: s(
50
+ ...s,
51
+ className: c(
47
52
  n,
48
- m && `${n}-has-after`,
53
+ i && `${n}-has-after`,
49
54
  h
50
55
  ),
51
56
  style: x,
52
- ref: c,
53
- defaultValue: b,
57
+ ref: f,
58
+ defaultValue: v,
54
59
  placeholder: C,
55
- addAfter: m,
60
+ addAfter: i,
56
61
  disabled: o,
57
- onChange: (t, k) => {
58
- y(t), e.onChange?.(t, k);
62
+ onChange: (e, w) => {
63
+ M(e), t.onChange?.(e, w);
59
64
  }
60
65
  }
61
66
  );
62
67
  }
63
68
  );
64
- z.displayName = "Input.Button";
69
+ I.displayName = "Input.Button";
65
70
  export {
66
- z as default
71
+ I as default
67
72
  };
package/input/Textarea.js CHANGED
@@ -1,157 +1,161 @@
1
- import { jsx as u, jsxs as V } from "react/jsx-runtime";
2
- import Z from "@unicom-cloud/icons/IconUiClose";
3
- import _, { useRef as ee, useState as te, useContext as oe, useImperativeHandle as re, useMemo as ne } from "react";
1
+ import { jsx as u, jsxs as D } from "react/jsx-runtime";
2
+ import ee from "@unicom-cloud/icons/IconUiClose";
3
+ import te, { useRef as oe, useState as re, useContext as ne, useImperativeHandle as ae, useMemo as ie } from "react";
4
4
  import "../config-provider/ConfigProvider.js";
5
- import ae from "../components/common/hooks/useIsomorphicLayoutEffect.js";
6
- import le from "../components/common/hooks/useMergeValue.js";
7
- import se from "../icon-hover/index.js";
8
- import g from "@unicom-cloud/utils/class-name";
5
+ import le from "../components/common/hooks/useIsomorphicLayoutEffect.js";
6
+ import se from "../components/common/hooks/useMergeValue.js";
7
+ import ce from "../icon-hover/index.js";
8
+ import x from "@unicom-cloud/utils/class-name";
9
9
  import "../components/common/utils/is.js";
10
- import { omit as ie } from "../components/common/utils/omit.js";
11
- import { formatValue as D } from "./Input.js";
12
- import ce from "./autoSizeTextAreaHeight.js";
13
- import ue from "./useComposition.js";
14
- import me from "../config-provider/context.js";
15
- import { isPlainObject as b } from "@unicom-cloud/utils/is";
16
- const fe = (n, A) => {
10
+ import { omit as ue } from "../components/common/utils/omit.js";
11
+ import { formatValue as b } from "./Input.js";
12
+ import me from "./autoSizeTextAreaHeight.js";
13
+ import fe from "./useComposition.js";
14
+ import de from "../config-provider/context.js";
15
+ import { isPlainObject as C, isNil as w } from "@unicom-cloud/utils/is";
16
+ const ge = (e, A) => {
17
17
  const {
18
18
  className: L,
19
19
  style: T,
20
20
  wrapperStyle: H,
21
21
  placeholder: M,
22
- disabled: i,
23
- error: R,
22
+ disabled: s,
23
+ error: k,
24
24
  maxLength: a,
25
- showWordLimit: h,
25
+ showWordLimit: v,
26
26
  allowClear: m,
27
- onChange: k,
28
- onClear: I,
29
- onKeyDown: z,
30
- onPressEnter: E,
31
- status: P,
32
- clearIcon: C,
33
- ...W
34
- } = n, l = b(a) ? a.length : a, r = b(a) ? a.errorOnly ? void 0 : a.length : a, t = ee(), [x, j] = te({}), [s, O] = le("", {
35
- defaultValue: "defaultValue" in n ? D(n.defaultValue, r) : void 0,
36
- value: "value" in n ? D(n.value, r) : void 0
27
+ onChange: I,
28
+ onClear: E,
29
+ onKeyDown: P,
30
+ onPressEnter: W,
31
+ status: j,
32
+ clearIcon: p,
33
+ ...O
34
+ } = e, i = C(a) ? a.length : a, n = C(a) ? a.errorOnly ? void 0 : a.length : a, r = oe(), [f, K] = re({}), [l, U] = se("", {
35
+ defaultValue: "defaultValue" in e ? b(e.defaultValue, n) : void 0,
36
+ value: "value" in e ? b(e.value, n) : void 0
37
37
  }), {
38
- compositionValue: K,
39
- compositionHandler: f,
40
- valueChangeHandler: U,
41
- keyDownHandler: F,
42
- triggerValueChangeCallback: q
43
- } = ue({
44
- value: s,
45
- maxLength: r,
46
- onChange: k,
47
- onKeyDown: z,
48
- onPressEnter: E,
49
- beforeTriggerValueChangeCallback: (e) => {
50
- !("value" in n) && (r === void 0 || e.length <= r) && O(e);
38
+ compositionValue: F,
39
+ compositionHandler: d,
40
+ valueChangeHandler: q,
41
+ keyDownHandler: B,
42
+ triggerValueChangeCallback: G
43
+ } = fe({
44
+ value: l,
45
+ maxLength: n,
46
+ onChange: I,
47
+ onKeyDown: P,
48
+ onPressEnter: W,
49
+ beforeTriggerValueChangeCallback: (t) => {
50
+ !("value" in e) && (n === void 0 || t.length <= n) && U(t);
51
51
  }
52
- }), v = K || s || "", { getPrefixCls: B, rtl: d } = oe(me), o = B?.("textarea");
53
- i && (x.resize = "none");
54
- const w = () => {
55
- if (t.current && t.current.focus) {
56
- if (t.current.setSelectionRange) {
57
- const e = t.current.textContent.length;
58
- t.current.setSelectionRange(e, e);
52
+ }), S = F || l || "", { getPrefixCls: J, rtl: g } = ne(de), o = J?.("textarea"), z = s || e.resize === "none" || C(e.autoSize) && !w(e.autoSize.minRows) && !w(e.autoSize.maxRows) && e.autoSize?.minRows === e.autoSize?.maxRows || !w(e.rows);
53
+ z ? f.resize = "none" : e.resize && (f.resize = e.resize);
54
+ const y = () => {
55
+ if (r.current && r.current.focus) {
56
+ if (r.current.setSelectionRange) {
57
+ const t = r.current.textContent.length;
58
+ r.current.setSelectionRange(t, t);
59
59
  }
60
- t.current.focus();
60
+ r.current.focus();
61
61
  }
62
- }, G = () => {
63
- const e = ce(
64
- n.autoSize,
65
- t.current
62
+ }, Q = () => {
63
+ if (e.rows)
64
+ return;
65
+ const t = me(
66
+ e.autoSize,
67
+ r.current
66
68
  );
67
- e && j(e);
68
- }, y = (e) => {
69
- e.stopPropagation(), w(), q("", e), I?.();
69
+ t && K(t);
70
+ }, N = (t) => {
71
+ t.stopPropagation(), y(), G("", t), E?.();
70
72
  };
71
- ae(() => {
72
- G();
73
- }, [v]), re(
73
+ le(() => {
74
+ Q();
75
+ }, [S]), ae(
74
76
  A,
75
77
  () => ({
76
- dom: t.current,
78
+ dom: r.current,
77
79
  focus: () => {
78
- w();
80
+ y();
79
81
  },
80
82
  blur: () => {
81
- t.current?.blur?.();
83
+ r.current?.blur?.();
82
84
  },
83
- getRootDOMNode: () => t.current
85
+ getRootDOMNode: () => r.current
84
86
  }),
85
87
  []
86
88
  );
87
- const c = s ? s.length : 0, J = l && h || m, S = ne(() => !r && l ? c > l : !1, [c, l, r]), $ = P || (R || S ? "error" : void 0), Q = g(
89
+ const c = l ? l.length : 0, X = i && v || m, $ = ie(() => !n && i ? c > i : !1, [c, i, n]), R = j || (k || $ ? "error" : void 0), Y = x(
88
90
  o,
89
91
  {
90
- [`${o}-${$}`]: $,
92
+ [`${o}-${R}`]: R,
91
93
  // [`${prefixCls}-error`]: error || lengthError || status === 'error',
92
- [`${o}-disabled`]: i,
93
- [`${o}-rtl`]: d
94
+ [`${o}-disabled`]: s,
95
+ [`${o}-rtl`]: g,
96
+ [`${o}-resize-none`]: z
97
+ // 潘启宝添加
94
98
  },
95
99
  L
96
- ), N = /* @__PURE__ */ u(
100
+ ), V = /* @__PURE__ */ u(
97
101
  "textarea",
98
102
  {
99
- ...ie(W, ["autoSize", "defaultValue"]),
100
- maxLength: r,
101
- ref: t,
102
- style: { ...T, ...x },
103
- className: Q,
103
+ ...ue(O, ["autoSize", "defaultValue"]),
104
+ maxLength: n,
105
+ ref: r,
106
+ style: { ...T, ...f },
107
+ className: Y,
104
108
  placeholder: M,
105
- disabled: i,
106
- value: v,
107
- onChange: U,
108
- onKeyDown: F,
109
- onCompositionStart: f,
110
- onCompositionUpdate: f,
111
- onCompositionEnd: f
109
+ disabled: s,
110
+ value: S,
111
+ onChange: q,
112
+ onKeyDown: B,
113
+ onCompositionStart: d,
114
+ onCompositionUpdate: d,
115
+ onCompositionEnd: d
112
116
  }
113
117
  );
114
- if (J) {
115
- const e = !i && m && s, [X, Y] = d ? [l, c] : [c, l];
116
- return /* @__PURE__ */ V(
118
+ if (X) {
119
+ const t = !s && m && l, [Z, _] = g ? [i, c] : [c, i];
120
+ return /* @__PURE__ */ D(
117
121
  "div",
118
122
  {
119
- className: g(`${o}-wrapper`, {
123
+ className: x(`${o}-wrapper`, {
120
124
  [`${o}-clear-wrapper`]: m,
121
- [`${o}-wrapper-rtl`]: d
125
+ [`${o}-wrapper-rtl`]: g
122
126
  }),
123
127
  style: H,
124
128
  children: [
125
- N,
126
- e ? C !== void 0 ? /* @__PURE__ */ u(
129
+ V,
130
+ t ? p !== void 0 ? /* @__PURE__ */ u(
127
131
  "span",
128
132
  {
129
133
  className: `${o}-clear-icon`,
130
- onClick: y,
131
- onMouseDown: (p) => {
132
- p.preventDefault();
134
+ onClick: N,
135
+ onMouseDown: (h) => {
136
+ h.preventDefault();
133
137
  },
134
- children: C
138
+ children: p
135
139
  }
136
- ) : /* @__PURE__ */ u(se, { className: `${o}-clear-icon`, children: /* @__PURE__ */ u(
137
- Z,
140
+ ) : /* @__PURE__ */ u(ce, { className: `${o}-clear-icon`, children: /* @__PURE__ */ u(
141
+ ee,
138
142
  {
139
- onClick: y,
140
- onMouseDown: (p) => {
141
- p.preventDefault();
143
+ onClick: N,
144
+ onMouseDown: (h) => {
145
+ h.preventDefault();
142
146
  }
143
147
  }
144
148
  ) }) : null,
145
- l && h && /* @__PURE__ */ V(
149
+ i && v && /* @__PURE__ */ D(
146
150
  "span",
147
151
  {
148
- className: g(`${o}-word-limit`, {
149
- [`${o}-word-limit-error`]: S
152
+ className: x(`${o}-word-limit`, {
153
+ [`${o}-word-limit-error`]: $
150
154
  }),
151
155
  children: [
152
- X,
156
+ Z,
153
157
  "/",
154
- Y
158
+ _
155
159
  ]
156
160
  }
157
161
  )
@@ -159,9 +163,9 @@ const fe = (n, A) => {
159
163
  }
160
164
  );
161
165
  }
162
- return N;
163
- }, de = _.forwardRef(fe);
164
- de.displayName = "TextArea";
166
+ return V;
167
+ }, he = te.forwardRef(ge);
168
+ he.displayName = "TextArea";
165
169
  export {
166
- de as default
170
+ he as default
167
171
  };
@@ -1,4 +1,258 @@
1
- import l from "./LiquidFill.js";
1
+ import { jsx as n, jsxs as x } from "react/jsx-runtime";
2
+ import { useContext as at, useRef as $, useState as V, useEffect as D } from "react";
3
+ import "../config-provider/ConfigProvider.js";
4
+ import "lodash/isEqualWith";
5
+ import "../components/common/utils/is.js";
6
+ import "@unicom-cloud/utils/constant/keyboardCode";
7
+ import "lodash/isNumber";
8
+ import "lodash/merge";
9
+ import "../components/common/utils/dom.js";
10
+ import "../components/common/hooks/useIntersectionObserver.js";
11
+ import st from "../components/common/hooks/useMergeProps.js";
12
+ import "../components/common/utils/reactDOM.js";
13
+ import "@unicom-cloud/utils/constant";
14
+ import mt from "../components/common/hooks/useUpdateEffect.js";
15
+ import "lodash/debounce";
16
+ import "@unicom-cloud/utils/case-name";
17
+ import lt from "@unicom-cloud/utils/class-name";
18
+ import "../dist/tinycolor/chunk/BOzCVdr0.js";
19
+ import "@unicom-cloud/utils/constant/ui";
20
+ import "../utils/contextHolder.js";
21
+ import "@unicom-cloud/utils/dayjs";
22
+ import "@unicom-cloud/utils/clipboard-copy";
23
+ import "../components/common/utils/dayjs.js";
24
+ import "@unicom-cloud/utils/file/fileToURL";
25
+ import "lodash/escapeRegExp";
26
+ import "lodash/isArray";
27
+ import "lodash/isString";
28
+ import "lodash/isFunction";
29
+ import "lodash/throttle";
30
+ import "lodash/camelCase";
31
+ import "lodash/capitalize";
32
+ import "lodash/cloneDeep";
33
+ import "lodash/get";
34
+ import "lodash/has";
35
+ import "lodash/kebabCase";
36
+ import "lodash/mergeWith";
37
+ import "lodash/set";
38
+ import "lodash/setWith";
39
+ import "lodash/snakeCase";
40
+ import "lodash/startCase";
41
+ import "lodash/uniq";
42
+ import "lodash/upperFirst";
43
+ import "@unicom-cloud/utils/math";
44
+ import "lodash/isPlainObject";
45
+ import "../dist/react-transition-group/src/CSSTransition.js";
46
+ import "../dist/react-transition-group/src/ReplaceTransition.js";
47
+ import "../dist/react-transition-group/src/SwitchTransition.js";
48
+ import "../dist/react-transition-group/chunk/CPfP7aNL.js";
49
+ import "../dist/react-transition-group/src/TransitionGroup.js";
50
+ import "@unicom-cloud/utils/file/saveAs";
51
+ import "@unicom-cloud/utils/screenfull";
52
+ import "@unicom-cloud/utils/constant/ui.js";
53
+ import "react-is";
54
+ import "@unicom-cloud/utils/tree";
55
+ import { isNumber as ct } from "@unicom-cloud/utils/is";
56
+ import { v4 as A } from "uuid";
57
+ import "../dist/validate/src/index.js";
58
+ import pt from "../config-provider/context.js";
59
+ const dt = {
60
+ value: 0.5,
61
+ size: 200,
62
+ waveColor: "rgb(var(--pqb-blue-6))",
63
+ backgroundColor: "var(--pqb-color-neutral-1)",
64
+ textColor: "var(--pqb-color-neutral-8)",
65
+ showPercent: !0,
66
+ duration: 2e3,
67
+ waveCount: 3,
68
+ waveAmplitude: 10,
69
+ borderColor: "var(--pqb-color-neutral-4)",
70
+ borderWidth: 2,
71
+ outerBorderWidth: 0,
72
+ borderGap: 2,
73
+ decimalPlaces: 0,
74
+ percentFontScale: 0.5,
75
+ waveSpeedVariation: 0.5
76
+ }, ge = (E) => {
77
+ const { getPrefixCls: I, componentConfig: _ } = at(pt), i = I?.("liquid-fill"), H = st(
78
+ E,
79
+ dt,
80
+ _?.LiquidFill
81
+ ), {
82
+ style: U,
83
+ className: Y,
84
+ value: F,
85
+ size: a,
86
+ fontSize: h = `${a * 0.15}px`,
87
+ waveColor: N,
88
+ backgroundColor: q,
89
+ textColor: J,
90
+ showPercent: K,
91
+ duration: y,
92
+ waveCount: c,
93
+ waveAmplitude: Q,
94
+ borderColor: G,
95
+ borderWidth: v,
96
+ outerBorderColor: W,
97
+ outerBorderWidth: g,
98
+ borderGap: X,
99
+ decimalPlaces: Z,
100
+ percentFontScale: tt,
101
+ waveSpeedVariation: B
102
+ } = H, d = $({
103
+ clipPath: A(),
104
+ // 裁剪路径ID
105
+ waveGradient: A(),
106
+ // 波浪渐变ID
107
+ bgGradient: A()
108
+ // 背景渐变ID
109
+ }).current, et = $(null), e = $({
110
+ fill: 0,
111
+ // 填充动画ID
112
+ wave: 0,
113
+ // 波浪动画ID
114
+ startTime: 0
115
+ // 动画开始时间
116
+ }).current, [C, M] = V(0), [rt, z] = V([]), S = a / 2 - g / 2, k = S - g / 2 - X - v / 2, m = k - v / 2, r = a / 2, R = m * 2, ot = R * (C / 100) + v / 2, T = (o, t) => {
117
+ if (typeof t == "string") return null;
118
+ const { from: s, to: l, direction: p = "vertical" } = t;
119
+ return /* @__PURE__ */ x("linearGradient", { id: o, x1: "0%", y1: "0%", x2: p === "horizontal" ? "100%" : "0%", y2: p === "horizontal" ? "0%" : "100%", children: [
120
+ /* @__PURE__ */ n("stop", { offset: "0%", stopColor: s }),
121
+ /* @__PURE__ */ n("stop", { offset: "100%", stopColor: l })
122
+ ] });
123
+ }, L = (o, t) => typeof o == "string" ? o : `url(#${t})`, it = (o, t, s) => {
124
+ const l = [], w = r - m, j = r + m;
125
+ for (let u = 0; u <= 30; u++) {
126
+ const f = w + u / 30 * R, P = Math.min(
127
+ r + m - ot + // 这里原来是减去 waterHeight,现在直接使用 waterHeight
128
+ o * Math.sin((f - w) * t + s),
129
+ r + m
130
+ );
131
+ l.push([f, P]);
132
+ }
133
+ return l.push([j, r + m]), l.push([w, r + m]), l.map(([u, f], P) => `${P === 0 ? "M" : "L"}${u} ${f}`).join(" ");
134
+ }, nt = () => Array.from({ length: c }).map((o, t) => {
135
+ const s = Q * (c - t) / c, l = 0.02 * (t + 1), p = rt[t] || 0;
136
+ return /* @__PURE__ */ n(
137
+ "path",
138
+ {
139
+ className: `${i}-path`,
140
+ d: it(s, l, p),
141
+ fill: L(N, d.waveGradient),
142
+ fillOpacity: 0.3 + 0.7 / c * t
143
+ },
144
+ t
145
+ );
146
+ }), b = () => {
147
+ z(
148
+ (o) => o.map(
149
+ (t, s) => t + 0.02 * (s + 1) * (1 + B * Math.random())
150
+ )
151
+ ), C < 100 && (e.wave = requestAnimationFrame(b));
152
+ }, O = (o) => {
153
+ e.startTime || (e.startTime = o);
154
+ const t = o - e.startTime, s = Math.min(t / y, 1) * F * 100;
155
+ M(s), t < y && (e.fill = requestAnimationFrame(O));
156
+ };
157
+ return D(() => {
158
+ z(Array.from({ length: c }, (o, t) => t * Math.PI));
159
+ }, [c]), D(() => (cancelAnimationFrame(e.fill), cancelAnimationFrame(e.wave), e.startTime = 0, M(0), e.fill = requestAnimationFrame(O), e.wave = requestAnimationFrame(b), () => {
160
+ cancelAnimationFrame(e.fill), cancelAnimationFrame(e.wave);
161
+ }), [F, y, c]), mt(() => (cancelAnimationFrame(e.wave), e.wave = requestAnimationFrame(b), () => {
162
+ cancelAnimationFrame(e.wave);
163
+ }), [B]), /* @__PURE__ */ n(
164
+ "div",
165
+ {
166
+ className: lt(i, Y),
167
+ style: {
168
+ width: a,
169
+ height: a,
170
+ ...U
171
+ },
172
+ children: /* @__PURE__ */ x(
173
+ "svg",
174
+ {
175
+ className: `${i}-svg`,
176
+ ref: et,
177
+ width: a,
178
+ height: a,
179
+ viewBox: `0 0 ${a} ${a}`,
180
+ preserveAspectRatio: "xMidYMid meet",
181
+ children: [
182
+ /* @__PURE__ */ x("defs", { children: [
183
+ T(d.waveGradient, N),
184
+ T(d.bgGradient, q),
185
+ /* @__PURE__ */ n("clipPath", { id: d.clipPath, className: `${i}-clipPath`, children: /* @__PURE__ */ n(
186
+ "circle",
187
+ {
188
+ className: `${i}-clipPath-circle`,
189
+ cx: r,
190
+ cy: r,
191
+ r: m
192
+ }
193
+ ) })
194
+ ] }),
195
+ g > 0 && /* @__PURE__ */ n(
196
+ "circle",
197
+ {
198
+ className: `${i}-outerBorder`,
199
+ cx: r,
200
+ cy: r,
201
+ r: S,
202
+ fill: "none",
203
+ stroke: W || G,
204
+ strokeWidth: g,
205
+ strokeOpacity: W ? 1 : 0.5
206
+ }
207
+ ),
208
+ /* @__PURE__ */ n(
209
+ "circle",
210
+ {
211
+ className: `${i}-border`,
212
+ cx: r,
213
+ cy: r,
214
+ r: k,
215
+ fill: L(q, d.bgGradient),
216
+ stroke: G,
217
+ strokeWidth: v
218
+ }
219
+ ),
220
+ /* @__PURE__ */ n("g", { className: `${i}-g`, clipPath: `url(#${d.clipPath})`, children: nt() }),
221
+ K && /* @__PURE__ */ x(
222
+ "text",
223
+ {
224
+ style: {},
225
+ className: `${i}-text`,
226
+ x: r,
227
+ y: r,
228
+ fill: J,
229
+ fontSize: h,
230
+ textAnchor: "middle",
231
+ dominantBaseline: "middle",
232
+ alignmentBaseline: "middle",
233
+ children: [
234
+ C.toFixed(Z),
235
+ /* @__PURE__ */ n(
236
+ "tspan",
237
+ {
238
+ style: {
239
+ fontSize: `calc(${ct(h) ? h + "px" : h} * ${tt})`
240
+ },
241
+ className: `${i}-text-tspan`,
242
+ alignmentBaseline: "middle",
243
+ dominantBaseline: "middle",
244
+ children: "%"
245
+ }
246
+ )
247
+ ]
248
+ }
249
+ )
250
+ ]
251
+ }
252
+ )
253
+ }
254
+ );
255
+ };
2
256
  export {
3
- l as default
257
+ ge as default
4
258
  };