@unicom-cloud/ui 0.8.105 → 0.8.107
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/Modal.js +4 -2
- package/Segmented.js +4 -2
- 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/back-top/index.js +44 -56
- package/calendar/Lunar.js +71 -0
- package/calendar/index.js +11 -11
- package/color-picker/index.js +34 -34
- package/components/common/flex/index.js +4 -4
- package/components/common/icons/file/index.js +13 -11
- package/components/common/utils/dayjs.js +99 -124
- 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/config-provider/ConfigProvider.js +32 -30
- package/descriptions/index.js +32 -32
- package/divider/index.js +28 -20
- package/empty/index.js +1 -1
- package/grid/Grid.js +55 -88
- package/grid/Item.js +40 -61
- package/grid/context.js +1 -4
- package/grid/hook/useResponsiveState.js +22 -25
- package/grid/util.js +6 -44
- package/index.js +462 -457
- package/input/Button.js +12 -12
- package/input/Group.js +11 -12
- package/input/Input.js +112 -102
- package/input/Search.js +24 -24
- 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/segmented/index.js +93 -90
- package/select-view/Core.js +31 -28
- package/splitter/SplitBar.js +44 -46
- package/style.css +1 -1
- package/table/Table.js +198 -210
- package/table/th-resizable/index.js +9 -10
- package/time-picker/util.js +20 -30
- package/types/common/development/interface.d.ts +3 -3
- 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/calendar/Lunar.d.ts +17 -0
- package/types/pc/calendar/index.d.ts +1 -1
- package/types/pc/config-provider/interface.d.ts +1 -1
- package/types/pc/divider/interface.d.ts +1 -0
- package/types/pc/grid/Grid.d.ts +1 -2
- package/types/pc/grid/Item.d.ts +2 -5
- package/types/pc/grid/context.d.ts +4 -10
- package/types/pc/grid/hook/useResponsiveState.d.ts +2 -2
- package/types/pc/grid/interface.d.ts +9 -19
- package/types/pc/grid/util.d.ts +1 -10
- package/types/pc/index.d.ts +3 -1
- package/types/pc/input/Button.d.ts +2 -2
- 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/segmented/interface.d.ts +6 -0
- 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/utils/is.d.ts +1 -1
- package/types/pc/utils/names.d.ts +303 -0
- package/utils/index.js +58 -59
- package/utils/is.js +65 -66
- package/utils/names.js +298 -144
- package/version/index.js +1 -1
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/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/modal/Confirm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsx as r, jsxs as P } from "react/jsx-runtime";
|
|
2
|
+
import x from "@unicom-cloud/icons/IconUiCheckCircleFill";
|
|
3
3
|
import y from "@unicom-cloud/icons/IconUiCloseCircleFill";
|
|
4
4
|
import u from "@unicom-cloud/icons/IconUiExclamationCircleFill";
|
|
5
5
|
import F from "@unicom-cloud/icons/IconUiInfoCircleFill";
|
|
@@ -8,42 +8,42 @@ import M from "../config-provider/ConfigProvider.js";
|
|
|
8
8
|
import N from "./Modal.js";
|
|
9
9
|
import { destroyList as f, getConfigProviderProps as O, getModalConfig as U } from "./config.js";
|
|
10
10
|
function w(e) {
|
|
11
|
-
const {
|
|
12
|
-
return /* @__PURE__ */
|
|
11
|
+
const { simple: n } = U();
|
|
12
|
+
return /* @__PURE__ */ r(N, { simple: n, ...e, children: e.content });
|
|
13
13
|
}
|
|
14
14
|
const p = (e) => {
|
|
15
|
-
let
|
|
16
|
-
if (!
|
|
17
|
-
if (
|
|
18
|
-
if (
|
|
15
|
+
let n = e.icon;
|
|
16
|
+
if (!n) {
|
|
17
|
+
if (n !== null) {
|
|
18
|
+
if (n = /* @__PURE__ */ r(u, {}), e.isNotice)
|
|
19
19
|
switch (e.noticeType) {
|
|
20
20
|
case "info":
|
|
21
|
-
|
|
21
|
+
n = /* @__PURE__ */ r(F, {});
|
|
22
22
|
break;
|
|
23
23
|
case "success":
|
|
24
|
-
|
|
24
|
+
n = /* @__PURE__ */ r(x, {});
|
|
25
25
|
break;
|
|
26
26
|
case "warning":
|
|
27
|
-
|
|
27
|
+
n = /* @__PURE__ */ r(u, {});
|
|
28
28
|
break;
|
|
29
29
|
case "error":
|
|
30
|
-
|
|
30
|
+
n = /* @__PURE__ */ r(y, {});
|
|
31
31
|
break;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
|
-
return e.noticeType === "show" && (
|
|
36
|
-
|
|
35
|
+
return e.noticeType === "show" && (n = e.icon), e.isNotice && (e.hideCancel = !0), e.title = n === null && e.title === null ? null : /* @__PURE__ */ P("span", { children: [
|
|
36
|
+
n,
|
|
37
37
|
e.title
|
|
38
38
|
] }), e;
|
|
39
39
|
};
|
|
40
|
-
function D(e,
|
|
40
|
+
function D(e, n) {
|
|
41
41
|
let i;
|
|
42
42
|
const l = document.createElement("div");
|
|
43
43
|
l.className = "pqb-modal-root", document.body.appendChild(l);
|
|
44
44
|
const C = O();
|
|
45
45
|
function h(t) {
|
|
46
|
-
const c = /* @__PURE__ */
|
|
46
|
+
const c = /* @__PURE__ */ r(M, { ...C, childrenName: "ModalConfirm", children: /* @__PURE__ */ r(
|
|
47
47
|
w,
|
|
48
48
|
{
|
|
49
49
|
getPopupContainer: () => l,
|
|
@@ -53,7 +53,7 @@ function D(e, r) {
|
|
|
53
53
|
) });
|
|
54
54
|
i ||= I(l), i.render(c);
|
|
55
55
|
}
|
|
56
|
-
const s =
|
|
56
|
+
const s = n || h;
|
|
57
57
|
let o = {
|
|
58
58
|
...e,
|
|
59
59
|
visible: !1
|