@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.
- package/App.js +7 -0
- package/BackTop.js +2 -4
- package/Calendar.js +2 -2
- package/ColorPicker.js +15 -14
- package/Constant.js +4 -0
- package/Copy.js +4 -3
- package/Countdown.js +25 -0
- package/Grid.js +8 -10
- package/LiquidFill.js +4 -3
- package/List.js +7 -6
- package/Marquee.js +4 -3
- package/Modal.js +4 -2
- package/PageHeader.js +3 -2
- package/QrCode.js +4 -3
- package/RowCol.js +8 -0
- package/Segmented.js +14 -4
- package/Statistic.js +5 -4
- package/Tour.js +4 -3
- package/Transfer.js +4 -2
- package/anchor/Link.js +1 -1
- package/app/App.js +26 -0
- package/app/context.js +9 -0
- package/app/index.js +9 -0
- package/app/interface.js +1 -0
- package/app/useApp.js +8 -0
- package/avatar/Group.js +1 -1
- package/back-top/index.js +44 -56
- package/button/index.js +52 -51
- package/calendar/Lunar.js +71 -0
- package/calendar/index.js +11 -11
- package/cascader/base/node.js +22 -20
- package/cascader/base/store.js +10 -10
- package/cascader/util.js +29 -27
- package/color-picker/Mode.js +8 -7
- package/color-picker/hooks/useColorPicker.js +56 -55
- package/color-picker/index.js +49 -48
- package/color-picker/utils.js +58 -57
- package/components/common/empty/index.js +2 -2
- package/components/common/flex/index.js +64 -55
- package/components/common/flex/interface.js +6 -6
- package/components/common/hooks/useInterval.js +6 -6
- package/components/common/icons/file/index.js +13 -11
- package/components/common/space/index.js +53 -53
- package/components/common/utils/dayjs.js +114 -126
- package/components/common/utils/is.js +98 -104
- package/components/common/utils/setDir.js +12 -0
- package/components/common/utils/setTheme.js +13 -13
- package/components/common/utils/toArray.js +7 -5
- package/config-provider/ConfigProvider.js +32 -30
- package/constant/index.js +4 -0
- package/copy/index.js +2 -1
- package/countdown/index.js +113 -0
- package/countdown/interface.js +1 -0
- package/countdown/util.js +29 -0
- package/descriptions/index.js +45 -45
- package/divider/index.js +28 -20
- package/dropdown/Button.js +1 -1
- package/empty/index.js +1 -1
- package/flex/index.js +30 -29
- package/form/FormItem.js +126 -122
- package/grid/Grid.js +56 -90
- package/grid/Item.js +44 -65
- package/grid/context.js +2 -6
- package/grid/index.js +6 -8
- package/grid/util.js +6 -44
- package/hooks/useResponsiveState.js +54 -0
- package/index.js +614 -605
- package/input/Button.js +12 -12
- package/input/Group.js +11 -12
- package/input/Input.js +112 -102
- package/input/InputElement.js +25 -24
- package/input/Search.js +24 -24
- package/layout/Sider.js +1 -1
- package/liquid-fill/index.js +4 -3
- package/list/Item.js +21 -21
- package/list/index.js +53 -52
- package/marquee/index.js +20 -19
- package/marquee-/index.js +4 -3
- package/mentions/util.js +9 -8
- package/modal/Confirm.js +17 -17
- package/modal/Modal.js +247 -237
- package/modal/index.js +4 -2
- package/modal/use-modal/index.js +2 -2
- package/package.json +1 -1
- package/page-header/index.js +57 -56
- package/pagination/Pagination.js +89 -92
- package/qr-code/index.js +4 -3
- package/radio/Group.js +1 -1
- package/row-col/Col-.js +88 -0
- package/row-col/Col.js +159 -0
- package/row-col/Row.js +73 -0
- package/row-col/context.js +5 -0
- package/row-col/index.js +11 -0
- package/row-col/interface.js +1 -0
- package/segmented/index.js +257 -206
- package/select/Select.js +191 -191
- package/select/util.js +50 -50
- package/select-view/Core.js +31 -28
- package/space/index.js +15 -13
- package/splitter/SplitBar.js +44 -46
- package/statistic/index.js +56 -55
- package/statistic/interface.js +4 -1
- package/style.css +1 -1
- package/table/Table.js +198 -210
- package/table/hook/useColumns.js +27 -26
- package/table/hook/useStickyClassNames.js +9 -8
- package/table/hook/useThResizable.js +4 -3
- package/table/th-resizable/index.js +2 -2
- package/table/thead/index.js +18 -16
- package/time-picker/util.js +20 -30
- package/timeline/Item.js +1 -1
- package/tour/index.js +4 -3
- package/transfer/index.js +93 -91
- package/trigger/index.js +66 -66
- package/types/common/development/interface.d.ts +3 -3
- package/types/common/flex/index.d.ts +3 -9
- package/types/common/flex/interface.d.ts +15 -4
- package/types/common/space/index.d.ts +3 -5
- package/types/common/space/interface.d.ts +2 -0
- package/types/common/utils/dayjs.d.ts +3 -1
- package/types/common/utils/is.d.ts +3 -4
- package/types/common/utils/setDir.d.ts +2 -0
- package/types/pc/app/App.d.ts +6 -0
- package/types/pc/app/context.d.ts +4 -0
- package/types/pc/app/index.d.ts +5 -0
- package/types/pc/app/interface.d.ts +17 -0
- package/types/pc/app/useApp.d.ts +3 -0
- package/types/pc/back-top/interface.d.ts +4 -17
- package/types/pc/button/interface.d.ts +2 -2
- package/types/pc/calendar/Lunar.d.ts +17 -0
- package/types/pc/calendar/index.d.ts +1 -1
- package/types/pc/config-provider/interface.d.ts +17 -12
- package/types/pc/constant/index.d.ts +1 -0
- package/types/pc/countdown/interface.d.ts +65 -0
- package/types/pc/countdown/util.d.ts +7 -0
- package/types/pc/divider/interface.d.ts +1 -0
- package/types/pc/flex/index.d.ts +8 -6
- package/types/pc/flex/interface.d.ts +3 -10
- package/types/pc/form/FormItem.d.ts +1 -1
- package/types/pc/form/interface.d.ts +1 -1
- package/types/pc/grid/Grid.d.ts +2 -4
- package/types/pc/grid/Item.d.ts +1 -5
- package/types/pc/grid/context.d.ts +4 -15
- package/types/pc/grid/index.d.ts +4 -6
- package/types/pc/grid/interface.d.ts +14 -142
- package/types/pc/grid/util.d.ts +1 -10
- package/types/pc/hooks/useResponsiveState.d.ts +3 -0
- package/types/pc/index.d.ts +10 -4
- package/types/pc/input/Button.d.ts +2 -2
- package/types/pc/list/interface.d.ts +2 -1
- package/types/pc/message/index.d.ts +1 -9
- package/types/pc/message/interface.d.ts +8 -0
- package/types/pc/message/useMessage.d.ts +1 -2
- package/types/pc/modal/Modal.d.ts +1 -0
- package/types/pc/modal/config.d.ts +1 -2
- package/types/pc/modal/index.d.ts +2 -1
- package/types/pc/modal/interface.d.ts +17 -5
- package/types/pc/notification/index.d.ts +2 -9
- package/types/pc/notification/interface.d.ts +7 -0
- package/types/pc/notification/useNotification.d.ts +1 -2
- package/types/pc/pagination/PageOption.d.ts +0 -1
- package/types/pc/pagination/interface.d.ts +5 -6
- package/types/pc/{grid → row-col}/Col-.d.ts +1 -1
- package/types/pc/{grid → row-col}/Col.d.ts +1 -2
- package/types/pc/{grid → row-col}/Row.d.ts +1 -2
- package/types/pc/row-col/context.d.ts +6 -0
- package/types/pc/row-col/index.d.ts +7 -0
- package/types/pc/row-col/interface.d.ts +112 -0
- package/types/pc/segmented/index.d.ts +3 -7
- package/types/pc/segmented/interface.d.ts +38 -5
- package/types/pc/select-view/Core.d.ts +1 -8
- package/types/pc/select-view/index.d.ts +1 -8
- package/types/pc/select-view/interface.d.ts +9 -2
- package/types/pc/space/index.d.ts +5 -7
- package/types/pc/space/interface.d.ts +3 -10
- package/types/pc/statistic/index.d.ts +1 -1
- package/types/pc/statistic/interface.d.ts +1 -49
- package/types/pc/utils/is.d.ts +1 -1
- package/types/pc/utils/names.d.ts +422 -111
- package/types/pc/utils/responsiveObserve.d.ts +8 -8
- package/typography/Ellipsis.js +5 -4
- package/typography/Operations.js +4 -3
- package/utils/dayjs.js +13 -11
- package/utils/index.js +245 -244
- package/utils/is.js +65 -66
- package/utils/names.js +309 -150
- package/utils/responsiveObserve.js +43 -36
- package/version/index.js +1 -1
- package/grid/Col-.js +0 -86
- package/grid/Col.js +0 -169
- package/grid/Row.js +0 -96
- package/grid/hook/useResponsiveState.js +0 -38
- package/statistic/Countdown.js +0 -56
- package/statistic/util.js +0 -33
- package/types/pc/grid/hook/useResponsiveState.d.ts +0 -2
- package/types/pc/statistic/util.d.ts +0 -1
- /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
|
|
4
|
+
import I from "../button/index.js";
|
|
5
5
|
import "../config-provider/ConfigProvider.js";
|
|
6
|
-
import
|
|
6
|
+
import P from "../components/common/hooks/useMergeValue.js";
|
|
7
7
|
import c from "@unicom-cloud/utils/class-name";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
const
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
69
|
+
z.displayName = "Input.Button";
|
|
70
70
|
export {
|
|
71
|
-
|
|
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
|
|
2
|
+
import f, { useContext as u } from "react";
|
|
3
3
|
import "../config-provider/ConfigProvider.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
const { getPrefixCls: r } =
|
|
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
|
-
|
|
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:
|
|
13
|
+
return /* @__PURE__ */ n("div", { ref: s, className: i, style: m, ...l, children: c });
|
|
15
14
|
});
|
|
16
|
-
|
|
15
|
+
d.displayName = "InputGroup";
|
|
17
16
|
export {
|
|
18
|
-
|
|
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
|
|
2
|
+
import sr from "lodash/isNil";
|
|
3
3
|
import B from "lodash/isPlainObject";
|
|
4
|
-
import
|
|
5
|
-
import { forwardRef as
|
|
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
|
|
8
|
+
import mr from "../components/common/hooks/useMergeValue.js";
|
|
9
9
|
import h from "@unicom-cloud/utils/class-name";
|
|
10
|
-
import { contains as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
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
|
|
14
|
+
import K from "../input-number/index.js";
|
|
15
15
|
import gr from "./Password.js";
|
|
16
16
|
import hr from "./Search.js";
|
|
17
|
-
import
|
|
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,
|
|
23
|
-
function
|
|
24
|
-
let
|
|
25
|
-
return
|
|
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,
|
|
27
|
+
function Ir(o, a) {
|
|
28
28
|
const {
|
|
29
|
-
getPrefixCls:
|
|
29
|
+
getPrefixCls: s,
|
|
30
30
|
size: x,
|
|
31
|
-
componentConfig:
|
|
31
|
+
componentConfig: X,
|
|
32
32
|
rtl: I
|
|
33
|
-
} =
|
|
33
|
+
} = ur($r), e = cr(
|
|
34
34
|
o,
|
|
35
35
|
{},
|
|
36
|
-
|
|
36
|
+
X?.Input
|
|
37
37
|
), {
|
|
38
38
|
className: F,
|
|
39
|
-
style:
|
|
39
|
+
style: Y,
|
|
40
40
|
addBefore: V,
|
|
41
41
|
addAfter: D,
|
|
42
|
-
suffix:
|
|
42
|
+
suffix: Z,
|
|
43
43
|
prefix: N,
|
|
44
|
-
beforeStyle:
|
|
45
|
-
afterStyle:
|
|
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,
|
|
52
|
+
} = e, f = W ? {
|
|
53
53
|
minWidth: 0,
|
|
54
54
|
maxWidth: "100%",
|
|
55
55
|
...B(W) ? W : {}
|
|
56
56
|
} : null, b = {
|
|
57
|
-
minWidth:
|
|
58
|
-
maxWidth:
|
|
59
|
-
width:
|
|
60
|
-
...
|
|
61
|
-
},
|
|
62
|
-
defaultValue: "defaultValue" in e ?
|
|
63
|
-
value: "value" in e ?
|
|
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
|
-
|
|
66
|
-
|
|
65
|
+
fr(
|
|
66
|
+
a,
|
|
67
67
|
() => ({
|
|
68
|
-
focus:
|
|
69
|
-
blur:
|
|
70
|
-
dom:
|
|
68
|
+
focus: u.current?.focus,
|
|
69
|
+
blur: u.current?.blur,
|
|
70
|
+
dom: u.current?.dom,
|
|
71
71
|
// 保持之前逻辑
|
|
72
|
-
getRootDOMNode: () => v.current ||
|
|
72
|
+
getRootDOMNode: () => v.current || u.current?.dom
|
|
73
73
|
}),
|
|
74
74
|
[]
|
|
75
75
|
);
|
|
76
|
-
const
|
|
77
|
-
"value" in e ||
|
|
78
|
-
}, r =
|
|
79
|
-
let d =
|
|
80
|
-
const g = S ? S.length : 0,
|
|
81
|
-
if (
|
|
82
|
-
const [t, M] = I ? [
|
|
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`]:
|
|
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
|
|
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`]:
|
|
107
|
+
[`${r}-group-wrapper-autowidth`]: f
|
|
106
108
|
},
|
|
107
109
|
F
|
|
108
|
-
), P = e.status || (e.error ||
|
|
110
|
+
), P = e.status || (e.error || E ? "error" : void 0), G = V || D || d || N, T = /* @__PURE__ */ $(
|
|
109
111
|
dr,
|
|
110
112
|
{
|
|
111
|
-
ref:
|
|
113
|
+
ref: u,
|
|
112
114
|
...e,
|
|
113
|
-
autoFitWidth: !!
|
|
115
|
+
autoFitWidth: !!f,
|
|
114
116
|
style: b,
|
|
115
117
|
status: P,
|
|
116
118
|
onFocus: (t) => {
|
|
117
|
-
|
|
119
|
+
k(!0), e.onFocus?.(t);
|
|
118
120
|
},
|
|
119
121
|
onBlur: (t) => {
|
|
120
|
-
|
|
122
|
+
k(!1), e.onBlur?.(t);
|
|
121
123
|
},
|
|
122
|
-
onChange:
|
|
124
|
+
onChange: or,
|
|
123
125
|
prefixCls: r,
|
|
124
126
|
value: S,
|
|
125
|
-
hasParent: !!
|
|
127
|
+
hasParent: !!G || C,
|
|
126
128
|
size: m
|
|
127
129
|
}
|
|
128
|
-
),
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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:
|
|
146
|
+
className: nr,
|
|
142
147
|
style: { ...b, ...y ? { height: z } : {} },
|
|
143
|
-
children: /* @__PURE__ */ R(
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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,
|
|
180
|
+
className: h(F, O),
|
|
171
181
|
style: { ...b, ...y ? { height: z } : {} },
|
|
172
182
|
onMouseDown: xr,
|
|
173
183
|
onClick: () => {
|
|
174
|
-
|
|
184
|
+
u.current?.focus?.();
|
|
175
185
|
},
|
|
176
186
|
children: T
|
|
177
187
|
}
|
|
178
188
|
) : T;
|
|
179
189
|
}
|
|
180
|
-
const Nr =
|
|
190
|
+
const Nr = ir(Ir), n = Nr;
|
|
181
191
|
n.displayName = "Input";
|
|
182
192
|
n.Search = hr;
|
|
183
|
-
n.Button =
|
|
184
|
-
n.InputButton =
|
|
193
|
+
n.Button = q;
|
|
194
|
+
n.InputButton = q;
|
|
185
195
|
n.TextArea = wr;
|
|
186
196
|
n.Password = gr;
|
|
187
|
-
n.Number =
|
|
188
|
-
n.InputNumber =
|
|
189
|
-
n.Tag =
|
|
190
|
-
n.InputTag =
|
|
191
|
-
n.Group =
|
|
197
|
+
n.Number = K;
|
|
198
|
+
n.InputNumber = K;
|
|
199
|
+
n.Tag = Q;
|
|
200
|
+
n.InputTag = Q;
|
|
201
|
+
n.Group = J;
|
|
192
202
|
export {
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
203
|
+
q as InputButton,
|
|
204
|
+
J as InputGroup,
|
|
205
|
+
K as InputNumber,
|
|
196
206
|
gr as InputPassword,
|
|
197
207
|
hr as InputSearch,
|
|
198
|
-
|
|
208
|
+
Q as InputTag,
|
|
199
209
|
wr as InputTextArea,
|
|
200
210
|
wr as TextArea,
|
|
201
211
|
n as default,
|
|
202
|
-
|
|
212
|
+
U as formatValue
|
|
203
213
|
};
|
package/input/InputElement.js
CHANGED
|
@@ -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/
|
|
4
|
-
import _
|
|
5
|
-
import oe from "
|
|
6
|
-
import re from "../
|
|
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
|
|
9
|
+
import { fillNBSP as ie } from "../components/common/utils/fillNBSP.js";
|
|
9
10
|
import "../components/common/utils/is.js";
|
|
10
|
-
import { omit as
|
|
11
|
-
import { resizeObserver as
|
|
12
|
-
import
|
|
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
|
|
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
|
-
},
|
|
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 =
|
|
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,
|
|
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
|
|
75
|
+
return Z(R) && R.indexOf(e) > -1 && _(o.normalize) && (i = o.normalize), i;
|
|
75
76
|
}, {
|
|
76
|
-
compositionValue:
|
|
77
|
+
compositionValue: A,
|
|
77
78
|
valueChangeHandler: q,
|
|
78
79
|
compositionHandler: v,
|
|
79
80
|
keyDownHandler: G,
|
|
80
81
|
triggerValueChangeCallback: B
|
|
81
|
-
} =
|
|
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:
|
|
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
|
-
|
|
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 +
|
|
137
|
+
r.current.style.width = `${e + ue}px`;
|
|
137
138
|
}
|
|
138
139
|
};
|
|
139
140
|
L(() => {
|
|
140
|
-
t && ((!p(t) || !t.pure) &&
|
|
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 =
|
|
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
|
-
|
|
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:
|
|
219
|
+
children: ie(Q)
|
|
219
220
|
}
|
|
220
221
|
)
|
|
221
222
|
] });
|
|
222
223
|
}
|
|
223
224
|
);
|
|
224
|
-
|
|
225
|
+
de.displayName = "InputComponent";
|
|
225
226
|
export {
|
|
226
|
-
|
|
227
|
+
de as default
|
|
227
228
|
};
|
package/input/Search.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { jsx as
|
|
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
|
|
8
|
-
import
|
|
9
|
-
import { omit as
|
|
10
|
-
import
|
|
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
|
|
13
|
-
const
|
|
12
|
+
import y from "../config-provider/context.js";
|
|
13
|
+
const A = V.forwardRef(
|
|
14
14
|
(e, h) => {
|
|
15
|
-
const { getPrefixCls: g } = k(
|
|
15
|
+
const { getPrefixCls: g } = k(y), {
|
|
16
16
|
className: x,
|
|
17
17
|
disabled: m,
|
|
18
18
|
searchButton: t,
|
|
19
|
-
loading:
|
|
19
|
+
loading: o,
|
|
20
20
|
addAfter: C,
|
|
21
21
|
suffix: l,
|
|
22
|
-
buttonProps:
|
|
22
|
+
buttonProps: u,
|
|
23
23
|
...L
|
|
24
|
-
} = e, r = g?.("input-search"), b = s(e.maxLength) ? e.maxLength.length : e.maxLength,
|
|
25
|
-
defaultValue: "defaultValue" in e ? d(e.defaultValue,
|
|
26
|
-
value: "value" in e ? d(e.value,
|
|
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__ */
|
|
31
|
-
|
|
30
|
+
return /* @__PURE__ */ n(
|
|
31
|
+
j,
|
|
32
32
|
{
|
|
33
|
-
|
|
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 :
|
|
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:
|
|
47
|
-
icon: t === !0 && !
|
|
48
|
-
...
|
|
46
|
+
loading: o,
|
|
47
|
+
icon: t === !0 && !o && /* @__PURE__ */ n(f, {}),
|
|
48
|
+
...u,
|
|
49
49
|
onClick(a) {
|
|
50
|
-
i(),
|
|
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
|
-
|
|
63
|
+
A.displayName = "Search";
|
|
64
64
|
export {
|
|
65
|
-
|
|
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(
|
|
43
|
+
), h = B(), y = B(null);
|
|
44
44
|
y.current = {
|
|
45
45
|
breakpoint: $,
|
|
46
46
|
collapsed: e,
|
package/liquid-fill/index.js
CHANGED
|
@@ -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
|
|
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
|
-
},
|
|
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
|
-
|
|
259
|
+
xe as default
|
|
259
260
|
};
|