@para-ui/core 5.0.1 → 5.0.3-beta.8
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/FieldForm/component.json +22 -1
- package/FormItemGroup/component.json +72 -0
- package/Menu/component.json +9 -2
- package/es/Checkbox/index.js +26 -24
- package/es/CheckboxGroup/index.css +1 -1
- package/es/CheckboxGroup/style/index.css +1 -1
- package/es/ExpressionInput/Popup.js +11 -4
- package/es/ExpressionInput/useExpressionInput.js +40 -37
- package/es/FieldForm/ErrorList.js +9 -8
- package/es/FieldForm/FieldFormItem/ItemHolder.d.ts +2 -0
- package/es/FieldForm/FieldFormItem/ItemHolder.js +78 -68
- package/es/FieldForm/FieldFormItem/index.d.ts +3 -0
- package/es/FieldForm/FieldFormItem/index.js +131 -120
- package/es/FieldForm/Form.d.ts +3 -1
- package/es/FieldForm/Form.js +54 -50
- package/es/FieldForm/compactControlMarker.d.ts +18 -0
- package/es/FieldForm/compactControlMarker.js +5 -0
- package/es/FieldForm/component.json +22 -1
- package/es/FieldForm/context.d.ts +3 -1
- package/es/FieldForm/context.js +6 -5
- package/es/FieldForm/index.css +1 -1
- package/es/FieldForm/index.d.ts +2 -0
- package/es/FieldForm/index.js +13 -9
- package/es/FieldForm/interface.d.ts +9 -0
- package/es/FieldForm/style/index.css +1 -1
- package/es/FieldForm/util.d.ts +14 -0
- package/es/FieldForm/util.js +41 -17
- package/es/FormItemGroup/component.json +72 -0
- package/es/FormItemGroup/index.css +1 -0
- package/es/FormItemGroup/index.d.ts +14 -0
- package/es/FormItemGroup/index.js +27 -0
- package/es/FormItemGroup/style/css.js +1 -0
- package/es/FormItemGroup/style/index.css +1 -0
- package/es/FormItemGroup/style/index.js +1 -0
- package/es/HelperText/index.js +15 -13
- package/es/Menu/component.json +9 -2
- package/es/Menu/index.css +1 -1
- package/es/Menu/interface.d.ts +2 -0
- package/es/Menu/style/index.css +1 -1
- package/es/Menu/verticalMenuList.js +378 -361
- package/es/RadioGroup/index.css +1 -1
- package/es/RadioGroup/style/index.css +1 -1
- package/es/RangeInput/index.js +60 -60
- package/es/Switch/index.js +30 -28
- package/es/Tag/TagGroup.js +29 -32
- package/es/Tag/index.js +5 -5
- package/es/index.d.ts +2 -0
- package/es/index.js +175 -169
- package/lib/Checkbox/index.js +1 -1
- package/lib/CheckboxGroup/index.css +1 -1
- package/lib/CheckboxGroup/style/index.css +1 -1
- package/lib/ExpressionInput/Popup.js +1 -1
- package/lib/ExpressionInput/useExpressionInput.js +1 -1
- package/lib/FieldForm/ErrorList.js +1 -1
- package/lib/FieldForm/FieldFormItem/ItemHolder.d.ts +2 -0
- package/lib/FieldForm/FieldFormItem/ItemHolder.js +1 -1
- package/lib/FieldForm/FieldFormItem/index.d.ts +3 -0
- package/lib/FieldForm/FieldFormItem/index.js +1 -1
- package/lib/FieldForm/Form.d.ts +3 -1
- package/lib/FieldForm/Form.js +1 -1
- package/lib/FieldForm/compactControlMarker.d.ts +18 -0
- package/lib/FieldForm/compactControlMarker.js +2 -0
- package/lib/FieldForm/component.json +22 -1
- package/lib/FieldForm/context.d.ts +3 -1
- package/lib/FieldForm/context.js +1 -1
- package/lib/FieldForm/index.css +1 -1
- package/lib/FieldForm/index.d.ts +2 -0
- package/lib/FieldForm/index.js +1 -1
- package/lib/FieldForm/interface.d.ts +9 -0
- package/lib/FieldForm/style/index.css +1 -1
- package/lib/FieldForm/util.d.ts +14 -0
- package/lib/FieldForm/util.js +1 -1
- package/lib/FormItemGroup/component.json +72 -0
- package/lib/FormItemGroup/index.css +1 -0
- package/lib/FormItemGroup/index.d.ts +14 -0
- package/lib/FormItemGroup/index.js +2 -0
- package/lib/FormItemGroup/style/css.js +1 -0
- package/lib/FormItemGroup/style/index.css +1 -0
- package/lib/FormItemGroup/style/index.js +1 -0
- package/lib/HelperText/index.js +1 -1
- package/lib/Menu/component.json +9 -2
- package/lib/Menu/index.css +1 -1
- package/lib/Menu/interface.d.ts +2 -0
- package/lib/Menu/style/index.css +1 -1
- package/lib/Menu/verticalMenuList.js +1 -1
- package/lib/RadioGroup/index.css +1 -1
- package/lib/RadioGroup/style/index.css +1 -1
- package/lib/RangeInput/index.js +1 -1
- package/lib/Switch/index.js +1 -1
- package/lib/Tag/TagGroup.js +1 -1
- package/lib/Tag/index.js +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +1 -1
- package/package.json +14 -1
package/es/RadioGroup/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.paraui-v4-radio-group{font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;font-size:14px;font-weight:400
|
|
1
|
+
@charset "UTF-8";.paraui-v4-radio-group{width:100%;font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;font-size:14px;font-weight:400}.paraui-v4-radio-group>.radio-group-label{margin-bottom:6px}.paraui-v4-radio-group>.radio-group-content{line-height:0}.paraui-v4-radio-group>.radio-group-content .radio-item-box{margin-bottom:4px}.paraui-v4-radio-group>.radio-group-content>.radio-group-content-item{margin-bottom:6px}.paraui-v4-radio-group>.radio-group-content>.radio-group-content-item:last-child{margin-bottom:0}.paraui-v4-radio-group:not(.paraui-v4-radio-group-column)>.radio-group-content{margin-bottom:-4px}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content{display:flex;flex-direction:column}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content>span{margin-bottom:10px}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content>span:last-child{margin-bottom:0}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.paraui-v4-radio-group{font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;font-size:14px;font-weight:400
|
|
1
|
+
.paraui-v4-radio-group{width:100%;font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif;font-size:14px;font-weight:400}.paraui-v4-radio-group>.radio-group-label{margin-bottom:6px}.paraui-v4-radio-group>.radio-group-content{line-height:0}.paraui-v4-radio-group>.radio-group-content .radio-item-box{margin-bottom:4px}.paraui-v4-radio-group>.radio-group-content>.radio-group-content-item{margin-bottom:6px}.paraui-v4-radio-group>.radio-group-content>.radio-group-content-item:last-child{margin-bottom:0}.paraui-v4-radio-group:not(.paraui-v4-radio-group-column)>.radio-group-content{margin-bottom:-4px}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content{display:flex;flex-direction:column}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content>span{margin-bottom:10px}.paraui-v4-radio-group.paraui-v4-radio-group-column>.radio-group-content>span:last-child{margin-bottom:0}
|
package/es/RangeInput/index.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { j as n } from "../_virtual/jsx-runtime.js";
|
|
2
|
-
import { useState as b, useRef as
|
|
2
|
+
import { useState as b, useRef as P, useEffect as v } from "react";
|
|
3
3
|
import { $prefixCls as u } from "../GlobalContext/constant.js";
|
|
4
4
|
import ee from "../Label/index.js";
|
|
5
|
-
import { InputNumber as
|
|
6
|
-
import
|
|
5
|
+
import { InputNumber as S } from "../InputNumber/index.js";
|
|
6
|
+
import z from "../HelperText/index.js";
|
|
7
7
|
import re from "clsx";
|
|
8
8
|
import { Tooltip as ne } from "../Tooltip/index.js";
|
|
9
9
|
import { DeepClone as te } from "@snack-kit/lib";
|
|
10
10
|
import './index.css';/* empty css */
|
|
11
11
|
function ge(o) {
|
|
12
12
|
const {
|
|
13
|
-
className:
|
|
14
|
-
style:
|
|
15
|
-
label:
|
|
16
|
-
labelTooltip:
|
|
17
|
-
size:
|
|
18
|
-
required:
|
|
13
|
+
className: L,
|
|
14
|
+
style: k,
|
|
15
|
+
label: w,
|
|
16
|
+
labelTooltip: G,
|
|
17
|
+
size: J = "large",
|
|
18
|
+
required: C = !1,
|
|
19
19
|
disabled: l = !1,
|
|
20
20
|
disabledTooltip: s,
|
|
21
|
-
warningMessage:
|
|
21
|
+
warningMessage: R,
|
|
22
22
|
warnTime: K = 2e3,
|
|
23
23
|
defaultValue: ae,
|
|
24
24
|
value: h,
|
|
25
|
-
error:
|
|
26
|
-
hideErrorDom:
|
|
25
|
+
error: j = !1,
|
|
26
|
+
hideErrorDom: T,
|
|
27
27
|
helperText: O = "",
|
|
28
28
|
separator: Q = "~",
|
|
29
|
-
unit:
|
|
29
|
+
unit: E,
|
|
30
30
|
placeholder: i,
|
|
31
31
|
clearable: oe = !1,
|
|
32
|
-
onFocus:
|
|
33
|
-
onBlur:
|
|
34
|
-
onEnter:
|
|
32
|
+
onFocus: I,
|
|
33
|
+
onBlur: F,
|
|
34
|
+
onEnter: N,
|
|
35
35
|
onChange: c,
|
|
36
36
|
otherProps: d
|
|
37
|
-
} = o, [f, m] = b([null, null]), [U,
|
|
37
|
+
} = o, [f, m] = b([null, null]), [U, $] = b(!1), [X, A] = b(!1), e = P({
|
|
38
38
|
timer: null,
|
|
39
39
|
swapRafId: null
|
|
40
|
-
}),
|
|
40
|
+
}), D = P(null);
|
|
41
41
|
v(() => {
|
|
42
42
|
o.defaultValue !== void 0 && m(o.defaultValue);
|
|
43
43
|
}, []), v(() => {
|
|
@@ -45,106 +45,106 @@ function ge(o) {
|
|
|
45
45
|
}, [h]), v(() => () => {
|
|
46
46
|
e.current.swapRafId !== null && (cancelAnimationFrame(e.current.swapRafId), e.current.swapRafId = null), e.current.timer !== null && (clearTimeout(e.current.timer), e.current.timer = null);
|
|
47
47
|
}, []);
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
|
|
48
|
+
const y = (r) => i && i instanceof Array ? i[r] : i, p = (r) => l && l instanceof Array ? l[r] : l, B = (r) => (t) => {
|
|
49
|
+
$(!0), I && I(t, r);
|
|
50
|
+
}, V = (r) => (t) => {
|
|
51
|
+
$(!1), F && F(t, r), e.current.swapRafId !== null && cancelAnimationFrame(e.current.swapRafId), e.current.swapRafId = requestAnimationFrame(() => {
|
|
52
52
|
e.current.swapRafId = null;
|
|
53
|
-
const a =
|
|
53
|
+
const a = D.current;
|
|
54
54
|
if (a && a.contains(document.activeElement))
|
|
55
55
|
return;
|
|
56
56
|
const [g, x] = f;
|
|
57
57
|
if (g !== null && x !== null && g > x) {
|
|
58
|
-
const
|
|
59
|
-
o.value === void 0 && m(
|
|
58
|
+
const H = [x, g];
|
|
59
|
+
o.value === void 0 && m(H), c && c(H, -1), R && Y();
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
}, Y = () => {
|
|
63
|
-
clearTimeout(e.current.timer ?? void 0),
|
|
64
|
-
|
|
63
|
+
clearTimeout(e.current.timer ?? void 0), A(!0), e.current.timer = setTimeout(() => {
|
|
64
|
+
A(!1);
|
|
65
65
|
}, K);
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
},
|
|
66
|
+
}, M = (r) => (t) => {
|
|
67
|
+
N && N(t, r);
|
|
68
|
+
}, W = (r) => (t) => {
|
|
69
69
|
const a = te(f);
|
|
70
70
|
a[r] = t, o.value === void 0 && m(a), c && c(a, r);
|
|
71
|
-
},
|
|
71
|
+
}, q = () => /* @__PURE__ */ n.jsxs("div", { className: "range-input-content", children: [
|
|
72
72
|
/* @__PURE__ */ n.jsx(
|
|
73
|
-
|
|
73
|
+
S,
|
|
74
74
|
{
|
|
75
75
|
...d && d[0],
|
|
76
76
|
clearable: !0,
|
|
77
77
|
btnMode: "none",
|
|
78
78
|
hideErrorDom: !0,
|
|
79
|
-
placeholder:
|
|
79
|
+
placeholder: y(0),
|
|
80
80
|
disabled: p(0),
|
|
81
81
|
disabledTooltip: s?.[0],
|
|
82
82
|
value: f[0],
|
|
83
|
-
onFocus:
|
|
84
|
-
onBlur:
|
|
85
|
-
onEnter:
|
|
86
|
-
onChange:
|
|
83
|
+
onFocus: B(0),
|
|
84
|
+
onBlur: V(0),
|
|
85
|
+
onEnter: M(0),
|
|
86
|
+
onChange: W(0)
|
|
87
87
|
}
|
|
88
88
|
),
|
|
89
89
|
/* @__PURE__ */ n.jsx("span", { className: "separator", children: Q }),
|
|
90
90
|
/* @__PURE__ */ n.jsx(
|
|
91
|
-
|
|
91
|
+
S,
|
|
92
92
|
{
|
|
93
93
|
...d && d[1],
|
|
94
94
|
clearable: !0,
|
|
95
95
|
btnMode: "none",
|
|
96
96
|
hideErrorDom: !0,
|
|
97
|
-
placeholder:
|
|
97
|
+
placeholder: y(1),
|
|
98
98
|
disabled: p(1),
|
|
99
99
|
disabledTooltip: s?.[1],
|
|
100
100
|
value: f[1],
|
|
101
|
-
onFocus:
|
|
102
|
-
onBlur:
|
|
103
|
-
onEnter:
|
|
104
|
-
onChange:
|
|
101
|
+
onFocus: B(1),
|
|
102
|
+
onBlur: V(1),
|
|
103
|
+
onEnter: M(1),
|
|
104
|
+
onChange: W(1)
|
|
105
105
|
}
|
|
106
106
|
),
|
|
107
|
-
|
|
107
|
+
E && /* @__PURE__ */ n.jsx("span", { className: "unit", children: E })
|
|
108
108
|
] }), Z = () => s && !(s instanceof Array) ? /* @__PURE__ */ n.jsx(
|
|
109
109
|
ne,
|
|
110
110
|
{
|
|
111
111
|
disabled: !0,
|
|
112
112
|
...s,
|
|
113
|
-
children:
|
|
113
|
+
children: q()
|
|
114
114
|
}
|
|
115
|
-
) :
|
|
116
|
-
|
|
115
|
+
) : q(), _ = () => X ? /* @__PURE__ */ n.jsx(
|
|
116
|
+
z,
|
|
117
117
|
{
|
|
118
118
|
className: "range-input-warning-text",
|
|
119
|
-
helperText:
|
|
120
|
-
hideErrorDom:
|
|
119
|
+
helperText: R,
|
|
120
|
+
hideErrorDom: T
|
|
121
121
|
}
|
|
122
122
|
) : /* @__PURE__ */ n.jsx(
|
|
123
|
-
|
|
123
|
+
z,
|
|
124
124
|
{
|
|
125
125
|
className: "range-input-error-text",
|
|
126
|
-
error:
|
|
126
|
+
error: j,
|
|
127
127
|
helperText: O,
|
|
128
|
-
hideErrorDom:
|
|
128
|
+
hideErrorDom: T
|
|
129
129
|
}
|
|
130
130
|
);
|
|
131
131
|
return /* @__PURE__ */ n.jsxs(
|
|
132
132
|
"div",
|
|
133
133
|
{
|
|
134
|
-
ref:
|
|
135
|
-
className: re(
|
|
134
|
+
ref: D,
|
|
135
|
+
className: re(L, `${u}-range-input`, `${u}-range-input-${J}`, {
|
|
136
136
|
[`${u}-range-input-focus`]: U,
|
|
137
137
|
[`${u}-range-input-disabled`]: l === !0 || p(0) && p(1),
|
|
138
|
-
[`${u}-range-input-error`]:
|
|
138
|
+
[`${u}-range-input-error`]: j
|
|
139
139
|
}),
|
|
140
|
-
style:
|
|
140
|
+
style: k,
|
|
141
141
|
children: [
|
|
142
|
-
/* @__PURE__ */ n.jsx(
|
|
142
|
+
(w || C) && /* @__PURE__ */ n.jsx(
|
|
143
143
|
ee,
|
|
144
144
|
{
|
|
145
|
-
label:
|
|
146
|
-
required:
|
|
147
|
-
...
|
|
145
|
+
label: w,
|
|
146
|
+
required: C,
|
|
147
|
+
...G
|
|
148
148
|
}
|
|
149
149
|
),
|
|
150
150
|
Z(),
|
package/es/Switch/index.js
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import { j as s } from "../_virtual/jsx-runtime.js";
|
|
2
|
-
import { LoadingF as
|
|
2
|
+
import { LoadingF as A } from "../para-ui-core/node_modules/@para-ui/icons/LoadingF/index.js";
|
|
3
3
|
import x from "rc-switch";
|
|
4
|
-
import
|
|
4
|
+
import f from "clsx";
|
|
5
5
|
import { $prefixCls as l, $rcPrefixCls as e } from "../GlobalContext/constant.js";
|
|
6
|
-
import
|
|
7
|
-
import { Tooltip as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
6
|
+
import j from "../Label/index.js";
|
|
7
|
+
import { Tooltip as u } from "../Tooltip/index.js";
|
|
8
|
+
import S from "../GlobalContext/useFormatMessage.js";
|
|
9
|
+
import { PARA_UI_COMPACT_CONTROL_MARKER as _ } from "../FieldForm/compactControlMarker.js";
|
|
10
|
+
import F from "./lang/index.js";
|
|
10
11
|
import './index.css';/* empty css */
|
|
11
|
-
const
|
|
12
|
-
const N =
|
|
12
|
+
const L = (w) => {
|
|
13
|
+
const N = S("Switch", F), {
|
|
13
14
|
size: c = "default",
|
|
14
15
|
loading: i,
|
|
15
16
|
disabled: a,
|
|
16
17
|
className: g,
|
|
17
18
|
label: r,
|
|
18
|
-
required:
|
|
19
|
+
required: p = !1,
|
|
19
20
|
desc: d,
|
|
20
21
|
labelTooltip: C,
|
|
21
22
|
descTooltip: T,
|
|
22
|
-
disabledTooltip:
|
|
23
|
+
disabledTooltip: h,
|
|
23
24
|
loadingTitle: $ = N({ id: "ing" }),
|
|
24
|
-
labelPlacement:
|
|
25
|
-
descPlacement:
|
|
25
|
+
labelPlacement: P = "top",
|
|
26
|
+
descPlacement: R = "start",
|
|
26
27
|
supText: t,
|
|
27
|
-
error:
|
|
28
|
+
error: M,
|
|
28
29
|
...o
|
|
29
|
-
} =
|
|
30
|
+
} = w, m = f(
|
|
30
31
|
`${l}-switch`,
|
|
31
32
|
{
|
|
32
33
|
[`${l}-switch-small`]: c === "small",
|
|
@@ -35,15 +36,15 @@ const G = (u) => {
|
|
|
35
36
|
[`${l}-switch-disabled`]: a
|
|
36
37
|
},
|
|
37
38
|
g
|
|
38
|
-
),
|
|
39
|
+
), v = f(
|
|
39
40
|
`${l}-switch-label`,
|
|
40
|
-
`${l}-switch-label-${
|
|
41
|
-
`${l}-switch-desc-${
|
|
42
|
-
), n = /* @__PURE__ */ s.jsx("div", { className: `${e}-switch-handle`, children: i && /* @__PURE__ */ s.jsx(
|
|
43
|
-
|
|
41
|
+
`${l}-switch-label-${P}`,
|
|
42
|
+
`${l}-switch-desc-${R}`
|
|
43
|
+
), n = /* @__PURE__ */ s.jsx("div", { className: `${e}-switch-handle`, children: i && /* @__PURE__ */ s.jsx(A, { className: `${e}-switch-loading-icon` }) }), b = () => a && h ? /* @__PURE__ */ s.jsx(
|
|
44
|
+
u,
|
|
44
45
|
{
|
|
45
46
|
disabled: !0,
|
|
46
|
-
...
|
|
47
|
+
...h,
|
|
47
48
|
children: /* @__PURE__ */ s.jsxs("div", { className: `${e}-label-box`, children: [
|
|
48
49
|
/* @__PURE__ */ s.jsx(
|
|
49
50
|
x,
|
|
@@ -59,7 +60,7 @@ const G = (u) => {
|
|
|
59
60
|
] })
|
|
60
61
|
}
|
|
61
62
|
) : /* @__PURE__ */ s.jsx(s.Fragment, { children: $ && i ? /* @__PURE__ */ s.jsx(
|
|
62
|
-
|
|
63
|
+
u,
|
|
63
64
|
{
|
|
64
65
|
disabled: !0,
|
|
65
66
|
title: $,
|
|
@@ -90,22 +91,22 @@ const G = (u) => {
|
|
|
90
91
|
),
|
|
91
92
|
t && /* @__PURE__ */ s.jsx("span", { className: "sup-text", children: t })
|
|
92
93
|
] }) });
|
|
93
|
-
return r || d ? /* @__PURE__ */ s.jsxs("span", { className:
|
|
94
|
+
return r || d ? /* @__PURE__ */ s.jsxs("span", { className: v, children: [
|
|
94
95
|
d && /* @__PURE__ */ s.jsx(
|
|
95
|
-
|
|
96
|
+
j,
|
|
96
97
|
{
|
|
97
98
|
label: d,
|
|
98
|
-
required:
|
|
99
|
+
required: p,
|
|
99
100
|
...T,
|
|
100
101
|
className: `${e}-desc-text ${a ? `${e}-disabled-text` : ""}`
|
|
101
102
|
}
|
|
102
103
|
),
|
|
103
104
|
/* @__PURE__ */ s.jsxs("span", { className: `${l}-label-text-container`, children: [
|
|
104
105
|
r && /* @__PURE__ */ s.jsx(
|
|
105
|
-
|
|
106
|
+
j,
|
|
106
107
|
{
|
|
107
108
|
label: r,
|
|
108
|
-
required:
|
|
109
|
+
required: p,
|
|
109
110
|
...C,
|
|
110
111
|
className: `${e}-switch-text ${a ? `${e}-disabled-text` : ""}`
|
|
111
112
|
}
|
|
@@ -114,8 +115,9 @@ const G = (u) => {
|
|
|
114
115
|
] })
|
|
115
116
|
] }) : b();
|
|
116
117
|
};
|
|
118
|
+
L[_] = !0;
|
|
117
119
|
export {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
+
L as Switch,
|
|
121
|
+
L as default
|
|
120
122
|
};
|
|
121
123
|
//# sourceMappingURL=index.js.map
|
package/es/Tag/TagGroup.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as o } from "../_virtual/jsx-runtime.js";
|
|
2
2
|
import { useState as u, useRef as z, useEffect as A } from "react";
|
|
3
|
-
import { Tag as
|
|
3
|
+
import { Tag as v } from "./index.js";
|
|
4
4
|
import d from "clsx";
|
|
5
5
|
import "../para-ui-core/node_modules/@para-ui/icons/SvgIcon/index.js";
|
|
6
|
-
import { Plus as
|
|
6
|
+
import { Plus as T } from "../para-ui-core/node_modules/@para-ui/icons/Plus/index.js";
|
|
7
7
|
import { $prefixCls as K } from "../GlobalContext/constant.js";
|
|
8
8
|
import q from "../Hooks/useGlobalProps.js";
|
|
9
9
|
import './index.css';/* empty css */
|
|
@@ -11,16 +11,16 @@ const Z = (l) => {
|
|
|
11
11
|
const {
|
|
12
12
|
className: w,
|
|
13
13
|
size: i = "large",
|
|
14
|
-
style:
|
|
14
|
+
style: j,
|
|
15
15
|
defaultInputValue: f,
|
|
16
|
-
increased:
|
|
17
|
-
increasedTag:
|
|
18
|
-
inputClassName:
|
|
16
|
+
increased: y = !1,
|
|
17
|
+
increasedTag: p,
|
|
18
|
+
inputClassName: N,
|
|
19
19
|
inputWidth: G,
|
|
20
|
-
marginBottom:
|
|
20
|
+
marginBottom: V = "8px",
|
|
21
21
|
marginRight: W = "8px",
|
|
22
|
-
onChange:
|
|
23
|
-
} = q(l, "TagGroup"), [e, r] = u([]), [
|
|
22
|
+
onChange: c
|
|
23
|
+
} = q(l, "TagGroup"), [e, r] = u([]), [m, h] = u(f ?? ""), [E, x] = u(!1), C = z(), [I, R] = u();
|
|
24
24
|
A(() => {
|
|
25
25
|
if (l.data) {
|
|
26
26
|
const t = l.data;
|
|
@@ -35,26 +35,24 @@ const Z = (l) => {
|
|
|
35
35
|
}
|
|
36
36
|
}, [l.data]);
|
|
37
37
|
const g = (t) => t.map((n) => n.value), D = () => {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
x(!0), setTimeout(() => {
|
|
39
|
+
C.current?.focus();
|
|
40
40
|
});
|
|
41
41
|
}, S = (t, n) => {
|
|
42
|
-
e[n].value = t, r([...e]),
|
|
42
|
+
e[n].value = t, r([...e]), c?.(e, g(e));
|
|
43
43
|
}, k = (t) => {
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
const t =
|
|
47
|
-
t !== "" && (e.push({ value: t, label: t, closable: !0 }), r([...e]),
|
|
44
|
+
h(t.target.value);
|
|
45
|
+
}, b = () => {
|
|
46
|
+
const t = m.trim();
|
|
47
|
+
t !== "" && (e.push({ value: t, label: t, closable: !0 }), r([...e]), c?.(e, g(e))), h(f ?? ""), x(!1);
|
|
48
48
|
}, B = (t) => {
|
|
49
|
-
(t.keyCode === 13 || t.which === 13) &&
|
|
49
|
+
(t.keyCode === 13 || t.which === 13) && b();
|
|
50
50
|
}, O = (t) => (n) => {
|
|
51
51
|
const a = e.findIndex((s) => s.value === t.value);
|
|
52
|
-
a > -1 && (e.splice(a, 1), r([...e])), t.onClose && t.onClose(n),
|
|
52
|
+
a > -1 && (e.splice(a, 1), r([...e])), t.onClose && t.onClose(n), c?.(e, g(e));
|
|
53
53
|
}, P = () => e?.length ? e.map((t, n) => /* @__PURE__ */ o.jsx(
|
|
54
|
-
|
|
54
|
+
v,
|
|
55
55
|
{
|
|
56
|
-
marginBottom: m,
|
|
57
|
-
marginRight: W,
|
|
58
56
|
...t,
|
|
59
57
|
size: i,
|
|
60
58
|
visible: !0,
|
|
@@ -70,24 +68,24 @@ const Z = (l) => {
|
|
|
70
68
|
{
|
|
71
69
|
"tag-group-input-large": i === "large"
|
|
72
70
|
},
|
|
73
|
-
|
|
71
|
+
N
|
|
74
72
|
);
|
|
75
73
|
return /* @__PURE__ */ o.jsx(
|
|
76
74
|
"input",
|
|
77
75
|
{
|
|
78
|
-
style: { width: G ||
|
|
76
|
+
style: { width: G || I, minWidth: I },
|
|
79
77
|
type: "text",
|
|
80
|
-
ref:
|
|
78
|
+
ref: C,
|
|
81
79
|
className: s,
|
|
82
|
-
value:
|
|
80
|
+
value: m,
|
|
83
81
|
onChange: k,
|
|
84
|
-
onBlur:
|
|
82
|
+
onBlur: b,
|
|
85
83
|
onKeyDown: B
|
|
86
84
|
}
|
|
87
85
|
);
|
|
88
86
|
}
|
|
89
|
-
let t = /* @__PURE__ */ o.jsx(
|
|
90
|
-
|
|
87
|
+
let t = /* @__PURE__ */ o.jsx(T, {}), n = "New Tag";
|
|
88
|
+
p && (t = p.icon || /* @__PURE__ */ o.jsx(T, {}), n = p.text ?? "New Tag");
|
|
91
89
|
const a = d(
|
|
92
90
|
"tag-group-new",
|
|
93
91
|
{
|
|
@@ -96,14 +94,13 @@ const Z = (l) => {
|
|
|
96
94
|
"tag-group-add-btn"
|
|
97
95
|
);
|
|
98
96
|
return /* @__PURE__ */ o.jsx(
|
|
99
|
-
|
|
97
|
+
v,
|
|
100
98
|
{
|
|
101
99
|
getWidth: (s) => R(s),
|
|
102
100
|
className: a,
|
|
103
101
|
size: i,
|
|
104
102
|
icon: t,
|
|
105
103
|
onClick: D,
|
|
106
|
-
marginBottom: m,
|
|
107
104
|
children: n
|
|
108
105
|
}
|
|
109
106
|
);
|
|
@@ -112,10 +109,10 @@ const Z = (l) => {
|
|
|
112
109
|
"div",
|
|
113
110
|
{
|
|
114
111
|
className: d(`${K}-tag-group`, w),
|
|
115
|
-
style:
|
|
112
|
+
style: { rowGap: V, columnGap: W, ...j },
|
|
116
113
|
children: [
|
|
117
114
|
P(),
|
|
118
|
-
|
|
115
|
+
y && $()
|
|
119
116
|
]
|
|
120
117
|
}
|
|
121
118
|
);
|
package/es/Tag/index.js
CHANGED
|
@@ -13,11 +13,11 @@ import './index.css';/* empty css */
|
|
|
13
13
|
const pe = ["blue", "green", "yellow", "red"], fe = (a) => {
|
|
14
14
|
const {
|
|
15
15
|
type: g = "normal",
|
|
16
|
-
className:
|
|
16
|
+
className: B,
|
|
17
17
|
children: s,
|
|
18
18
|
icon: c,
|
|
19
19
|
color: t,
|
|
20
|
-
onClose:
|
|
20
|
+
onClose: G,
|
|
21
21
|
onEdit: m,
|
|
22
22
|
getWidth: h,
|
|
23
23
|
tagChange: C,
|
|
@@ -34,7 +34,7 @@ const pe = ["blue", "green", "yellow", "red"], fe = (a) => {
|
|
|
34
34
|
marginBottom: I,
|
|
35
35
|
marginRight: y,
|
|
36
36
|
...J
|
|
37
|
-
} = de(a, "
|
|
37
|
+
} = de(a, "Tag"), [Q, j] = r(!0), [$, N] = r(!1), [R, k] = r(""), [M, U] = r(0), [X, u] = r(!1), [Y, d] = r(!1), Z = A(), i = A(null);
|
|
38
38
|
p(() => {
|
|
39
39
|
"visible" in a && j(!!E);
|
|
40
40
|
}, [E]), p(() => {
|
|
@@ -63,14 +63,14 @@ const pe = ["blue", "green", "yellow", "red"], fe = (a) => {
|
|
|
63
63
|
`${n}-tag`,
|
|
64
64
|
`${n}-tag-${g}`,
|
|
65
65
|
`${n}-tag-${b}`,
|
|
66
|
-
|
|
66
|
+
B,
|
|
67
67
|
{
|
|
68
68
|
[`${n}-tag-has-color`]: t,
|
|
69
69
|
[`${n}-tag-hidden`]: !Q,
|
|
70
70
|
[`${n}-tag-${t}`]: l()
|
|
71
71
|
}
|
|
72
72
|
), W = (e) => {
|
|
73
|
-
e.stopPropagation(),
|
|
73
|
+
e.stopPropagation(), G?.(e), u(!1), !e.defaultPrevented && ("visible" in a || j(!1));
|
|
74
74
|
}, S = () => {
|
|
75
75
|
u(!0);
|
|
76
76
|
}, L = () => {
|
package/es/index.d.ts
CHANGED
|
@@ -72,6 +72,8 @@ export { default as Form } from './Form';
|
|
|
72
72
|
export * from './Form';
|
|
73
73
|
export { default as FormItem } from './FormItem';
|
|
74
74
|
export * from './FormItem';
|
|
75
|
+
export { default as FormItemGroup } from './FormItemGroup';
|
|
76
|
+
export * from './FormItemGroup';
|
|
75
77
|
export { default as FunctionModal } from './FunctionModal';
|
|
76
78
|
export * from './FunctionModal';
|
|
77
79
|
export { default as GlobalContext } from './GlobalContext';
|