@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.
- package/Anchor.js +3 -1
- package/Badge.js +54 -7
- package/Copy.js +49 -2
- package/Flex.js +12 -0
- package/Grid.js +1 -1
- package/LiquidFill.js +60 -2
- package/Marquee.js +62 -0
- package/QrCode.js +14 -9
- package/Segmented.js +11 -0
- package/Space.js +14 -6
- package/Splitter.js +6 -0
- package/Tag.js +3 -2
- package/Tour.js +14 -9
- package/alert/index.js +38 -39
- package/anchor/index.js +5 -3
- package/badge/index.js +174 -80
- package/collapse/Collapse.js +54 -48
- package/components/common/space/index.js +90 -106
- package/copy/index.js +83 -35
- package/flex/index.js +59 -0
- package/flex/interface.js +34 -0
- package/flex/utils.js +13 -0
- package/grid/{GridItem.js → Item.js} +15 -15
- package/grid/index.js +1 -1
- package/index.js +490 -477
- package/input/Button.js +39 -34
- package/input/Textarea.js +108 -104
- package/liquid-fill/index.js +256 -2
- package/marquee/index.js +283 -0
- package/menu/Item.js +17 -16
- package/package.json +1 -1
- package/qr-code/index.js +54 -36
- package/rate/index.js +8 -8
- package/segmented/index.js +225 -0
- package/space/index.js +28 -29
- package/spin/index.js +75 -62
- package/splitter/Panel.js +39 -0
- package/splitter/SplitBar.js +157 -0
- package/splitter/Splitter.js +139 -0
- package/splitter/hooks/useEvent.js +12 -0
- package/splitter/hooks/useItems.js +26 -0
- package/splitter/hooks/useResizable.js +26 -0
- package/splitter/hooks/useResize.js +68 -0
- package/splitter/hooks/useSizes.js +60 -0
- package/splitter/index.js +7 -0
- package/splitter/interface.js +1 -0
- package/style.css +1 -1
- package/table/Table.js +1 -1
- package/table/hook/useThResizable.js +72 -26
- package/table/tbody/Td.js +80 -77
- package/table/th-resizable/index.js +92 -35
- package/tag/index.js +42 -41
- package/tooltip/index.js +89 -82
- package/tour/index.js +110 -89
- package/types/common/hooks/useMergeProps.d.ts +1 -1
- package/types/common/space/index.d.ts +7 -5
- package/types/common/space/interface.d.ts +29 -16
- package/types/pc/affix/interface.d.ts +0 -2
- package/types/pc/alert/index.d.ts +2 -2
- package/types/pc/anchor/index.d.ts +2 -1
- package/types/pc/anchor/interface.d.ts +0 -2
- package/types/pc/auto-complete/interface.d.ts +0 -6
- package/types/pc/avatar/interface.d.ts +0 -4
- package/types/pc/badge/index.d.ts +4 -4
- package/types/pc/badge/interface.d.ts +26 -0
- package/types/pc/breadcrumb/interface.d.ts +0 -3
- package/types/pc/carousel/interface.d.ts +2 -6
- package/types/pc/cascader/interface.d.ts +6 -18
- package/types/pc/checkbox/interface.d.ts +0 -1
- package/types/pc/collapse/interface.d.ts +4 -2
- package/types/pc/color-picker/interface.d.ts +0 -2
- package/types/pc/config-provider/interface.d.ts +16 -14
- package/types/pc/copy/interface.d.ts +2 -1
- package/types/pc/date-picker/RangePicker.d.ts +1 -1
- package/types/pc/date-picker/interface.d.ts +0 -17
- package/types/pc/descriptions/interface.d.ts +0 -1
- package/types/pc/drawer/interface.d.ts +0 -7
- package/types/pc/dropdown/interface.d.ts +0 -1
- package/types/pc/flex/index.d.ts +9 -0
- package/types/pc/flex/interface.d.ts +61 -0
- package/types/pc/flex/utils.d.ts +9 -0
- package/types/pc/form/interface.d.ts +9 -22
- package/types/pc/form/util.d.ts +1 -1
- package/types/pc/grid/index.d.ts +3 -3
- package/types/pc/grid/interface.d.ts +1 -6
- package/types/pc/image/interface.d.ts +0 -13
- package/types/pc/index.d.ts +16 -6
- package/types/pc/input/Textarea.d.ts +2 -6
- package/types/pc/input/interface.d.ts +5 -13
- package/types/pc/input-number/interface.d.ts +0 -4
- package/types/pc/input-tag/interface.d.ts +0 -13
- package/types/pc/layout/interface.d.ts +0 -1
- package/types/pc/link/interface.d.ts +0 -1
- package/types/pc/liquid-fill/index.d.ts +114 -1
- package/types/pc/list/interface.d.ts +0 -4
- package/types/pc/marquee/index.d.ts +61 -0
- package/types/pc/menu/context.d.ts +1 -1
- package/types/pc/menu/interface.d.ts +0 -8
- package/types/pc/message/interface.d.ts +0 -2
- package/types/pc/modal/interface.d.ts +0 -5
- package/types/pc/notification/interface.d.ts +0 -1
- package/types/pc/pagination/interface.d.ts +0 -2
- package/types/pc/popconfirm/interface.d.ts +8 -10
- package/types/pc/popover/interface.d.ts +0 -1
- package/types/pc/progress/interface.d.ts +0 -3
- package/types/pc/qr-code/index.d.ts +1 -1
- package/types/pc/rate/index.d.ts +2 -2
- package/types/pc/resize-box/interface.d.ts +1 -7
- package/types/pc/segmented/index.d.ts +8 -0
- package/types/pc/segmented/interface.d.ts +88 -0
- package/types/pc/select/interface.d.ts +0 -12
- package/types/pc/select-view/interface.d.ts +0 -7
- package/types/pc/slider/interface.d.ts +0 -4
- package/types/pc/space/index.d.ts +4 -1
- package/types/pc/space/interface.d.ts +6 -10
- package/types/pc/spin/interface.d.ts +4 -1
- package/types/pc/splitter/Panel.d.ts +8 -0
- package/types/pc/splitter/SplitBar.d.ts +21 -0
- package/types/pc/splitter/Splitter.d.ts +4 -0
- package/types/pc/splitter/hooks/useEvent.d.ts +3 -0
- package/types/pc/splitter/hooks/useItems.d.ts +10 -0
- package/types/pc/splitter/hooks/useResizable.d.ts +8 -0
- package/types/pc/splitter/hooks/useResize.d.ts +4 -0
- package/types/pc/splitter/hooks/useSizes.d.ts +5 -0
- package/types/pc/splitter/index.d.ts +8 -0
- package/types/pc/splitter/interface.d.ts +213 -0
- package/types/pc/statistic/interface.d.ts +0 -4
- package/types/pc/steps/interface.d.ts +0 -3
- package/types/pc/table/hook/useThResizable.d.ts +2 -2
- package/types/pc/table/interface.d.ts +4 -15
- package/types/pc/tabs/interface.d.ts +0 -7
- package/types/pc/tag/index.d.ts +2 -0
- package/types/pc/tag/interface.d.ts +0 -1
- package/types/pc/time-picker/interface.d.ts +0 -7
- package/types/pc/tooltip/interface.d.ts +4 -1
- package/types/pc/tour/index.d.ts +6 -1
- package/types/pc/transfer/interface.d.ts +2 -9
- package/types/pc/tree/interface.d.ts +2 -8
- package/types/pc/tree-select/interface.d.ts +0 -8
- package/types/pc/trigger/interface.d.ts +0 -5
- package/types/pc/typography/EditContent.d.ts +2 -1
- package/types/pc/typography/interface.d.ts +45 -30
- package/types/pc/upload/interface.d.ts +6 -11
- package/types/pc/utils/index.d.ts +1 -0
- package/types/pc/utils/names.d.ts +24 -0
- package/types/pc/utils/toArray.d.ts +7 -0
- package/types/pc/verification-code/interface.d.ts +0 -2
- package/types/pc/watermark/interface.d.ts +0 -2
- package/typography/Base.js +73 -73
- package/typography/EditContent.js +43 -33
- package/typography/Ellipsis.js +117 -184
- package/typography/Operations.js +97 -49
- package/typography/useCssEllipsis.js +7 -6
- package/utils/index.js +117 -115
- package/utils/names.js +16 -0
- package/utils/toArray.js +12 -0
- package/version/index.js +1 -1
- package/_virtual/_commonjsHelpers.js +0 -6
- package/_virtual/index.js +0 -7
- package/_virtual/index2.js +0 -4
- package/liquid-fill/LiquidFill.js +0 -226
- package/liquid-fill/LiquidFill2.js +0 -3
- package/space-/index.js +0 -93
- package/types/common/utils/color.d.ts +0 -1
- package/types/common/utils/computeScrollIntoView.d.ts +0 -1
- package/types/common/utils/index.d.ts +0 -45
- package/types/common/utils/math.d.ts +0 -1
- package/types/common/utils/reactTransitionGroup.d.ts +0 -1
- package/types/common/utils/tree.d.ts +0 -1
- package/types/common/utils/tween.d.ts +0 -1
- package/types/common/utils/uuid.d.ts +0 -1
- package/types/common/utils/validate.d.ts +0 -1
- package/types/pc/liquid-fill/LiquidFill.d.ts +0 -115
- package/types/pc/liquid-fill/LiquidFill2.d.ts +0 -1
- package/types/pc/space-/index.d.ts +0 -6
- package/types/pc/space-/interface.d.ts +0 -38
- /package/{space- → components/common/space}/toArray.js +0 -0
- /package/{space- → segmented}/interface.js +0 -0
- /package/types/{pc/space- → common/space}/toArray.d.ts +0 -0
- /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
|
|
2
|
+
import m from "lodash/isPlainObject";
|
|
3
3
|
import A, { useContext as B } from "react";
|
|
4
|
-
import
|
|
4
|
+
import P from "../button/index.js";
|
|
5
5
|
import "../config-provider/ConfigProvider.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
const
|
|
11
|
-
(
|
|
12
|
-
const { getPrefixCls: g } = B(
|
|
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:
|
|
18
|
-
defaultValue:
|
|
17
|
+
loading: O,
|
|
18
|
+
defaultValue: v,
|
|
19
19
|
addAfter: l,
|
|
20
20
|
buttonProps: a,
|
|
21
|
-
label:
|
|
21
|
+
label: b,
|
|
22
22
|
onCallback: L,
|
|
23
|
-
...
|
|
24
|
-
} =
|
|
25
|
-
|
|
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:
|
|
33
|
+
size: s.size,
|
|
30
34
|
loadingFixedWidth: !0,
|
|
35
|
+
status: V,
|
|
31
36
|
...a,
|
|
32
|
-
className:
|
|
33
|
-
onClick: (
|
|
34
|
-
L?.(
|
|
37
|
+
className: c(`${n}-btn`, a?.className),
|
|
38
|
+
onClick: (e) => {
|
|
39
|
+
L?.(k), t.onClick?.(e), a?.onClick?.(e);
|
|
35
40
|
},
|
|
36
|
-
children:
|
|
41
|
+
children: b ?? "确定"
|
|
37
42
|
}
|
|
38
|
-
) : l,
|
|
39
|
-
defaultValue: "defaultValue" in
|
|
40
|
-
value: "value" in
|
|
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
|
-
...
|
|
46
|
-
className:
|
|
50
|
+
...s,
|
|
51
|
+
className: c(
|
|
47
52
|
n,
|
|
48
|
-
|
|
53
|
+
i && `${n}-has-after`,
|
|
49
54
|
h
|
|
50
55
|
),
|
|
51
56
|
style: x,
|
|
52
|
-
ref:
|
|
53
|
-
defaultValue:
|
|
57
|
+
ref: f,
|
|
58
|
+
defaultValue: v,
|
|
54
59
|
placeholder: C,
|
|
55
|
-
addAfter:
|
|
60
|
+
addAfter: i,
|
|
56
61
|
disabled: o,
|
|
57
|
-
onChange: (
|
|
58
|
-
|
|
62
|
+
onChange: (e, w) => {
|
|
63
|
+
M(e), t.onChange?.(e, w);
|
|
59
64
|
}
|
|
60
65
|
}
|
|
61
66
|
);
|
|
62
67
|
}
|
|
63
68
|
);
|
|
64
|
-
|
|
69
|
+
I.displayName = "Input.Button";
|
|
65
70
|
export {
|
|
66
|
-
|
|
71
|
+
I as default
|
|
67
72
|
};
|
package/input/Textarea.js
CHANGED
|
@@ -1,157 +1,161 @@
|
|
|
1
|
-
import { jsx as u, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
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
|
|
11
|
-
import { formatValue as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { isPlainObject as
|
|
16
|
-
const
|
|
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:
|
|
23
|
-
error:
|
|
22
|
+
disabled: s,
|
|
23
|
+
error: k,
|
|
24
24
|
maxLength: a,
|
|
25
|
-
showWordLimit:
|
|
25
|
+
showWordLimit: v,
|
|
26
26
|
allowClear: m,
|
|
27
|
-
onChange:
|
|
28
|
-
onClear:
|
|
29
|
-
onKeyDown:
|
|
30
|
-
onPressEnter:
|
|
31
|
-
status:
|
|
32
|
-
clearIcon:
|
|
33
|
-
...
|
|
34
|
-
} =
|
|
35
|
-
defaultValue: "defaultValue" in
|
|
36
|
-
value: "value" in
|
|
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:
|
|
39
|
-
compositionHandler:
|
|
40
|
-
valueChangeHandler:
|
|
41
|
-
keyDownHandler:
|
|
42
|
-
triggerValueChangeCallback:
|
|
43
|
-
} =
|
|
44
|
-
value:
|
|
45
|
-
maxLength:
|
|
46
|
-
onChange:
|
|
47
|
-
onKeyDown:
|
|
48
|
-
onPressEnter:
|
|
49
|
-
beforeTriggerValueChangeCallback: (
|
|
50
|
-
!("value" in
|
|
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
|
-
}),
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
if (
|
|
56
|
-
if (
|
|
57
|
-
const
|
|
58
|
-
|
|
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
|
-
|
|
60
|
+
r.current.focus();
|
|
61
61
|
}
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
}, Q = () => {
|
|
63
|
+
if (e.rows)
|
|
64
|
+
return;
|
|
65
|
+
const t = me(
|
|
66
|
+
e.autoSize,
|
|
67
|
+
r.current
|
|
66
68
|
);
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
|
|
69
|
+
t && K(t);
|
|
70
|
+
}, N = (t) => {
|
|
71
|
+
t.stopPropagation(), y(), G("", t), E?.();
|
|
70
72
|
};
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}, [
|
|
73
|
+
le(() => {
|
|
74
|
+
Q();
|
|
75
|
+
}, [S]), ae(
|
|
74
76
|
A,
|
|
75
77
|
() => ({
|
|
76
|
-
dom:
|
|
78
|
+
dom: r.current,
|
|
77
79
|
focus: () => {
|
|
78
|
-
|
|
80
|
+
y();
|
|
79
81
|
},
|
|
80
82
|
blur: () => {
|
|
81
|
-
|
|
83
|
+
r.current?.blur?.();
|
|
82
84
|
},
|
|
83
|
-
getRootDOMNode: () =>
|
|
85
|
+
getRootDOMNode: () => r.current
|
|
84
86
|
}),
|
|
85
87
|
[]
|
|
86
88
|
);
|
|
87
|
-
const c =
|
|
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`]:
|
|
93
|
-
[`${o}-rtl`]:
|
|
94
|
+
[`${o}-disabled`]: s,
|
|
95
|
+
[`${o}-rtl`]: g,
|
|
96
|
+
[`${o}-resize-none`]: z
|
|
97
|
+
// 潘启宝添加
|
|
94
98
|
},
|
|
95
99
|
L
|
|
96
|
-
),
|
|
100
|
+
), V = /* @__PURE__ */ u(
|
|
97
101
|
"textarea",
|
|
98
102
|
{
|
|
99
|
-
...
|
|
100
|
-
maxLength:
|
|
101
|
-
ref:
|
|
102
|
-
style: { ...T, ...
|
|
103
|
-
className:
|
|
103
|
+
...ue(O, ["autoSize", "defaultValue"]),
|
|
104
|
+
maxLength: n,
|
|
105
|
+
ref: r,
|
|
106
|
+
style: { ...T, ...f },
|
|
107
|
+
className: Y,
|
|
104
108
|
placeholder: M,
|
|
105
|
-
disabled:
|
|
106
|
-
value:
|
|
107
|
-
onChange:
|
|
108
|
-
onKeyDown:
|
|
109
|
-
onCompositionStart:
|
|
110
|
-
onCompositionUpdate:
|
|
111
|
-
onCompositionEnd:
|
|
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 (
|
|
115
|
-
const
|
|
116
|
-
return /* @__PURE__ */
|
|
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:
|
|
123
|
+
className: x(`${o}-wrapper`, {
|
|
120
124
|
[`${o}-clear-wrapper`]: m,
|
|
121
|
-
[`${o}-wrapper-rtl`]:
|
|
125
|
+
[`${o}-wrapper-rtl`]: g
|
|
122
126
|
}),
|
|
123
127
|
style: H,
|
|
124
128
|
children: [
|
|
125
|
-
|
|
126
|
-
|
|
129
|
+
V,
|
|
130
|
+
t ? p !== void 0 ? /* @__PURE__ */ u(
|
|
127
131
|
"span",
|
|
128
132
|
{
|
|
129
133
|
className: `${o}-clear-icon`,
|
|
130
|
-
onClick:
|
|
131
|
-
onMouseDown: (
|
|
132
|
-
|
|
134
|
+
onClick: N,
|
|
135
|
+
onMouseDown: (h) => {
|
|
136
|
+
h.preventDefault();
|
|
133
137
|
},
|
|
134
|
-
children:
|
|
138
|
+
children: p
|
|
135
139
|
}
|
|
136
|
-
) : /* @__PURE__ */ u(
|
|
137
|
-
|
|
140
|
+
) : /* @__PURE__ */ u(ce, { className: `${o}-clear-icon`, children: /* @__PURE__ */ u(
|
|
141
|
+
ee,
|
|
138
142
|
{
|
|
139
|
-
onClick:
|
|
140
|
-
onMouseDown: (
|
|
141
|
-
|
|
143
|
+
onClick: N,
|
|
144
|
+
onMouseDown: (h) => {
|
|
145
|
+
h.preventDefault();
|
|
142
146
|
}
|
|
143
147
|
}
|
|
144
148
|
) }) : null,
|
|
145
|
-
|
|
149
|
+
i && v && /* @__PURE__ */ D(
|
|
146
150
|
"span",
|
|
147
151
|
{
|
|
148
|
-
className:
|
|
149
|
-
[`${o}-word-limit-error`]:
|
|
152
|
+
className: x(`${o}-word-limit`, {
|
|
153
|
+
[`${o}-word-limit-error`]: $
|
|
150
154
|
}),
|
|
151
155
|
children: [
|
|
152
|
-
|
|
156
|
+
Z,
|
|
153
157
|
"/",
|
|
154
|
-
|
|
158
|
+
_
|
|
155
159
|
]
|
|
156
160
|
}
|
|
157
161
|
)
|
|
@@ -159,9 +163,9 @@ const fe = (n, A) => {
|
|
|
159
163
|
}
|
|
160
164
|
);
|
|
161
165
|
}
|
|
162
|
-
return
|
|
163
|
-
},
|
|
164
|
-
|
|
166
|
+
return V;
|
|
167
|
+
}, he = te.forwardRef(ge);
|
|
168
|
+
he.displayName = "TextArea";
|
|
165
169
|
export {
|
|
166
|
-
|
|
170
|
+
he as default
|
|
167
171
|
};
|
package/liquid-fill/index.js
CHANGED
|
@@ -1,4 +1,258 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
257
|
+
ge as default
|
|
4
258
|
};
|