@para-ui/core 5.0.0-beta.13 → 5.0.0-beta.14
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/codemods/modal-onCancel-to-onDismiss.js +69 -0
- package/es/Cascader/Cascader.js +188 -180
- package/es/Collapse/index.js +45 -38
- package/es/ComboSelect/index.js +297 -290
- package/es/ComboSelect/interface.d.ts +4 -1
- package/es/DatePicker/generatePicker/generateRangePicker.d.ts +0 -8
- package/es/DatePicker/generatePicker/generateRangePicker.js +76 -68
- package/es/DatePicker/generatePicker/index.d.ts +11 -4
- package/es/Modal/Confirm/index.js +81 -75
- package/es/Modal/index.d.ts +12 -1
- package/es/Modal/index.js +156 -141
- package/es/Tooltip/index.js +67 -61
- package/lib/Cascader/Cascader.js +1 -1
- package/lib/Collapse/index.js +1 -1
- package/lib/ComboSelect/index.js +1 -1
- package/lib/ComboSelect/interface.d.ts +4 -1
- package/lib/DatePicker/generatePicker/generateRangePicker.d.ts +0 -8
- package/lib/DatePicker/generatePicker/generateRangePicker.js +1 -1
- package/lib/DatePicker/generatePicker/index.d.ts +11 -4
- package/lib/Modal/Confirm/index.js +1 -1
- package/lib/Modal/index.d.ts +12 -1
- package/lib/Modal/index.js +1 -1
- package/lib/Tooltip/index.js +1 -1
- package/package.json +3 -2
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* jscodeshift codemod · modal-onCancel-to-onDismiss
|
|
3
|
+
*
|
|
4
|
+
* 为 v5.0.0-beta.14 提供:把 `<Modal onCancel={fn}>` v4 写法
|
|
5
|
+
* 自动改成 `<Modal onCancel={fn} onDismiss={fn}>`,解决 X/ESC/蒙层
|
|
6
|
+
* 在 v6.0(2026 Q3)起 silently 失效的迁移问题。
|
|
7
|
+
*
|
|
8
|
+
* 用法(业务方):
|
|
9
|
+
* npx jscodeshift -t node_modules/@para-ui/core/codemods/modal-onCancel-to-onDismiss.js \
|
|
10
|
+
* --parser=tsx --extensions=tsx,jsx src/
|
|
11
|
+
*
|
|
12
|
+
* 规则:
|
|
13
|
+
* - 仅处理 <Modal> JSX(不处理 <NS.Modal>;不处理命令式 Modal.Confirm)
|
|
14
|
+
* - 已有 onDismiss / onClose → skip(避免破坏 legacy 双触发或 γ 单触发)
|
|
15
|
+
* - 含 JSX spread `{...rest}` → skip(无法静态判定)
|
|
16
|
+
* - onCancel 表达式直接复用作 onDismiss 值(同回调,与 dev throw / ESLint rule 一致)
|
|
17
|
+
*
|
|
18
|
+
* 详见:
|
|
19
|
+
* - docs/UPGRADE_v4_to_v5.md §3.D.0
|
|
20
|
+
* - BREAKING-CHANGES §B-Modal-props-rework 子条 #5
|
|
21
|
+
*/
|
|
22
|
+
module.exports = function transformer(file, api) {
|
|
23
|
+
const j = api.jscodeshift;
|
|
24
|
+
const root = j(file.source);
|
|
25
|
+
let touched = 0;
|
|
26
|
+
|
|
27
|
+
root.find(j.JSXOpeningElement)
|
|
28
|
+
.filter(path => {
|
|
29
|
+
const name = path.node.name;
|
|
30
|
+
return name && name.type === 'JSXIdentifier' && name.name === 'Modal';
|
|
31
|
+
})
|
|
32
|
+
.forEach(path => {
|
|
33
|
+
const attrs = path.node.attributes || [];
|
|
34
|
+
let onCancelAttr = null;
|
|
35
|
+
let hasOnDismiss = false;
|
|
36
|
+
let hasOnClose = false;
|
|
37
|
+
let hasSpread = false;
|
|
38
|
+
|
|
39
|
+
for (const attr of attrs) {
|
|
40
|
+
if (attr.type === 'JSXSpreadAttribute') {
|
|
41
|
+
hasSpread = true;
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (attr.type !== 'JSXAttribute') continue;
|
|
45
|
+
if (!attr.name || attr.name.type !== 'JSXIdentifier') continue;
|
|
46
|
+
if (attr.name.name === 'onCancel') onCancelAttr = attr;
|
|
47
|
+
else if (attr.name.name === 'onDismiss') hasOnDismiss = true;
|
|
48
|
+
else if (attr.name.name === 'onClose') hasOnClose = true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (hasSpread || !onCancelAttr || hasOnDismiss || hasOnClose) return;
|
|
52
|
+
if (!onCancelAttr.value) return;
|
|
53
|
+
|
|
54
|
+
const dismissAttr = j.jsxAttribute(
|
|
55
|
+
j.jsxIdentifier('onDismiss'),
|
|
56
|
+
onCancelAttr.value
|
|
57
|
+
);
|
|
58
|
+
path.node.attributes.push(dismissAttr);
|
|
59
|
+
touched += 1;
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
if (touched > 0) {
|
|
63
|
+
// 仅在有改动时输出,避免 dirty toSource 触发空 diff
|
|
64
|
+
return root.toSource({ quote: 'single', reuseWhitespace: true });
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
module.exports.parser = 'tsx';
|
package/es/Cascader/Cascader.js
CHANGED
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as o } from "../_virtual/jsx-runtime.js";
|
|
2
2
|
import { BaseSelect as Fe } from "rc-select";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { conductCheck as
|
|
6
|
-
import { Right as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { Down as
|
|
10
|
-
import { CloseCircleF as
|
|
11
|
-
import * as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import { SHOW_PARENT as
|
|
18
|
-
import { formatStrategyValues as
|
|
19
|
-
import { UUID as
|
|
20
|
-
import { $prefixCls as
|
|
21
|
-
import { Tooltip as
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
function
|
|
3
|
+
import re from "clsx";
|
|
4
|
+
import Be from "rc-select/lib/hooks/useId";
|
|
5
|
+
import { conductCheck as Je } from "rc-tree/lib/utils/conductUtil";
|
|
6
|
+
import { Right as ze } from "../node_modules/@para-ui/icons/Right/index.js";
|
|
7
|
+
import ae from "rc-util/lib/hooks/useEvent";
|
|
8
|
+
import Ue from "rc-util/lib/hooks/useMergedState";
|
|
9
|
+
import { Down as qe } from "../node_modules/@para-ui/icons/Down/index.js";
|
|
10
|
+
import { CloseCircleF as Ge } from "../node_modules/@para-ui/icons/CloseCircleF/index.js";
|
|
11
|
+
import * as s from "react";
|
|
12
|
+
import Qe from "./context.js";
|
|
13
|
+
import Xe from "./hooks/useDisplayValues.js";
|
|
14
|
+
import Ye from "./hooks/useEntities.js";
|
|
15
|
+
import Ze from "./hooks/useMissingValues.js";
|
|
16
|
+
import et from "./OptionList/index.js";
|
|
17
|
+
import { SHOW_PARENT as pe, fillFieldNames as tt, toPathKeys as le, SHOW_CHILD as st } from "./utils/commonUtil.js";
|
|
18
|
+
import { formatStrategyValues as ot, toPathOptions as ie } from "./utils/treeUtil.js";
|
|
19
|
+
import { UUID as nt } from "@snack-kit/lib";
|
|
20
|
+
import { $prefixCls as C } from "../GlobalContext/constant.js";
|
|
21
|
+
import { Tooltip as ce } from "../Tooltip/index.js";
|
|
22
|
+
import rt from "./lang/index.js";
|
|
23
|
+
import at from "../GlobalContext/useFormatMessage.js";
|
|
24
|
+
import lt from "../HelperText/index.js";
|
|
25
|
+
function it(l) {
|
|
26
26
|
return Array.isArray(l) && Array.isArray(l[0]);
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return l ?
|
|
28
|
+
function T(l) {
|
|
29
|
+
return l ? it(l) ? l : (l.length === 0 ? [] : [l]).map((h) => Array.isArray(h) ? h : [h]) : [];
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
const
|
|
31
|
+
const A = s.forwardRef((l, h) => {
|
|
32
|
+
const de = at("Cascader", rt), {
|
|
33
33
|
// MISC
|
|
34
|
-
id:
|
|
35
|
-
prefixCls:
|
|
36
|
-
fieldNames:
|
|
37
|
-
className:
|
|
34
|
+
id: ue,
|
|
35
|
+
prefixCls: me = `${C}-cascader`,
|
|
36
|
+
fieldNames: H,
|
|
37
|
+
className: ct,
|
|
38
38
|
// Value
|
|
39
|
-
defaultValue:
|
|
40
|
-
value:
|
|
41
|
-
changeOnSelect:
|
|
39
|
+
defaultValue: he,
|
|
40
|
+
value: x,
|
|
41
|
+
changeOnSelect: L,
|
|
42
42
|
onChange: V,
|
|
43
|
-
displayRender:
|
|
43
|
+
displayRender: fe,
|
|
44
44
|
// Trigger
|
|
45
|
-
expandTrigger:
|
|
45
|
+
expandTrigger: $,
|
|
46
46
|
// Options
|
|
47
47
|
options: f,
|
|
48
|
-
optionsTitle:
|
|
49
|
-
dropdownPrefixCls:
|
|
50
|
-
loadData:
|
|
48
|
+
optionsTitle: K = [],
|
|
49
|
+
dropdownPrefixCls: _,
|
|
50
|
+
loadData: F,
|
|
51
51
|
// Open
|
|
52
|
-
popupVisible:
|
|
53
|
-
open:
|
|
54
|
-
popupClassName:
|
|
55
|
-
dropdownClassName:
|
|
56
|
-
dropdownMenuColumnStyle:
|
|
57
|
-
popupPlacement:
|
|
58
|
-
placement:
|
|
59
|
-
onDropdownVisibleChange:
|
|
60
|
-
onPopupVisibleChange:
|
|
52
|
+
popupVisible: w,
|
|
53
|
+
open: E,
|
|
54
|
+
popupClassName: M,
|
|
55
|
+
dropdownClassName: ge,
|
|
56
|
+
dropdownMenuColumnStyle: B,
|
|
57
|
+
popupPlacement: O,
|
|
58
|
+
placement: Ce,
|
|
59
|
+
onDropdownVisibleChange: xe,
|
|
60
|
+
onPopupVisibleChange: S,
|
|
61
61
|
// Icon
|
|
62
|
-
expandIcon:
|
|
63
|
-
loadingIcon:
|
|
62
|
+
expandIcon: J = /* @__PURE__ */ o.jsx(ze, {}),
|
|
63
|
+
loadingIcon: z,
|
|
64
64
|
// Placeholder
|
|
65
|
-
placeholder:
|
|
65
|
+
placeholder: j = de({ id: "placeholder" }),
|
|
66
66
|
// Clear
|
|
67
|
-
allClear:
|
|
67
|
+
allClear: Ve = !0,
|
|
68
68
|
//MenuStlye
|
|
69
|
-
menuMaxHight:
|
|
69
|
+
menuMaxHight: we = 158,
|
|
70
70
|
//Other
|
|
71
71
|
expandJoin: ye = "/",
|
|
72
72
|
disabled: y = !1,
|
|
73
|
-
loading:
|
|
74
|
-
disabledTooltip:
|
|
73
|
+
loading: v,
|
|
74
|
+
disabledTooltip: D,
|
|
75
75
|
// error
|
|
76
|
-
error:
|
|
77
|
-
hideErrorDom:
|
|
76
|
+
error: U = !1,
|
|
77
|
+
hideErrorDom: ve,
|
|
78
78
|
helperText: Ne = "",
|
|
79
79
|
// Children
|
|
80
|
-
children:
|
|
81
|
-
dropdownMatchSelectWidth:
|
|
82
|
-
showCheckedStrategy:
|
|
83
|
-
...
|
|
84
|
-
} = l,
|
|
85
|
-
value:
|
|
86
|
-
postState:
|
|
87
|
-
}), i =
|
|
88
|
-
() =>
|
|
80
|
+
children: q,
|
|
81
|
+
dropdownMatchSelectWidth: be = !1,
|
|
82
|
+
showCheckedStrategy: G = pe,
|
|
83
|
+
...Ee
|
|
84
|
+
} = l, Me = Be(ue), [P, Oe] = Ue(he, {
|
|
85
|
+
value: x,
|
|
86
|
+
postState: T
|
|
87
|
+
}), i = s.useMemo(
|
|
88
|
+
() => tt(H),
|
|
89
89
|
/* eslint-disable react-hooks/exhaustive-deps */
|
|
90
|
-
[JSON.stringify(
|
|
90
|
+
[JSON.stringify(H)]
|
|
91
91
|
/* eslint-enable react-hooks/exhaustive-deps */
|
|
92
|
-
), c =
|
|
92
|
+
), c = s.useMemo(() => f || [], [f]), d = Ye(c, i), g = s.useCallback(
|
|
93
93
|
(e) => {
|
|
94
94
|
const t = d();
|
|
95
95
|
return e.map((n) => {
|
|
@@ -98,198 +98,206 @@ const k = o.forwardRef((l, h) => {
|
|
|
98
98
|
});
|
|
99
99
|
},
|
|
100
100
|
[d, i]
|
|
101
|
-
), [u,
|
|
102
|
-
id:
|
|
101
|
+
), [u, Q] = s.useState(), [R, k] = s.useState(!1), [X, Se] = s.useState("auto"), m = s.useRef({
|
|
102
|
+
id: nt(),
|
|
103
103
|
level: 1
|
|
104
|
-
}),
|
|
105
|
-
(a) =>
|
|
104
|
+
}), je = (e) => T(e).map(
|
|
105
|
+
(a) => ie(a, c, i).map((r) => r.option)
|
|
106
106
|
);
|
|
107
|
-
|
|
108
|
-
if (!
|
|
109
|
-
const t =
|
|
110
|
-
t &&
|
|
111
|
-
}, [
|
|
112
|
-
const
|
|
113
|
-
const [e, t] =
|
|
114
|
-
if (!
|
|
107
|
+
s.useEffect(() => {
|
|
108
|
+
if (!x) return;
|
|
109
|
+
const t = je(x)[0];
|
|
110
|
+
t && Q(t.map((n) => n?.label).join(ye));
|
|
111
|
+
}, [x]);
|
|
112
|
+
const Y = Ze(c, i), [N, Z, ee] = s.useMemo(() => {
|
|
113
|
+
const [e, t] = Y(P);
|
|
114
|
+
if (!P.length)
|
|
115
115
|
return [e, [], t];
|
|
116
|
-
const n =
|
|
116
|
+
const n = le(e), a = d(), { checkedKeys: r, halfCheckedKeys: p } = Je(n, !0, a);
|
|
117
117
|
return [g(r), g(p), t];
|
|
118
|
-
}, [
|
|
119
|
-
const e =
|
|
120
|
-
return [...
|
|
121
|
-
}, [N, d, g,
|
|
122
|
-
|
|
123
|
-
const t =
|
|
124
|
-
(p) =>
|
|
118
|
+
}, [P, d, g, Y]), De = s.useMemo(() => {
|
|
119
|
+
const e = le(N), t = ot(e, d, G);
|
|
120
|
+
return [...ee, ...g(t)];
|
|
121
|
+
}, [N, d, g, ee, G]), Pe = Xe(De, c, i, !1, fe), te = ae((e) => {
|
|
122
|
+
Oe(e);
|
|
123
|
+
const t = T(e), n = t.map(
|
|
124
|
+
(p) => ie(p, c, i).map((b) => b.option)
|
|
125
125
|
), a = t[0], r = n[0];
|
|
126
126
|
V && V(a, r || []);
|
|
127
|
-
}),
|
|
128
|
-
|
|
127
|
+
}), I = ae((e) => {
|
|
128
|
+
te(e);
|
|
129
129
|
}), Re = (e, t) => {
|
|
130
130
|
if (t.type === "clear") {
|
|
131
|
-
|
|
131
|
+
te([]);
|
|
132
132
|
return;
|
|
133
133
|
}
|
|
134
134
|
const { valueCells: n } = t.values[0];
|
|
135
|
-
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
},
|
|
135
|
+
I(n);
|
|
136
|
+
}, ke = ge || M, Ie = Ce || O, We = (e) => {
|
|
137
|
+
k(e), xe?.(e), S?.(e);
|
|
138
|
+
}, se = s.useRef(!1);
|
|
139
|
+
s.useEffect(() => {
|
|
140
|
+
if (process.env.NODE_ENV === "production" || se.current) return;
|
|
141
|
+
const e = [];
|
|
142
|
+
w !== void 0 && e.push("popupVisible → open"), M !== void 0 && e.push("popupClassName → dropdownClassName"), O !== void 0 && e.push("popupPlacement → placement"), S !== void 0 && e.push("onPopupVisibleChange → onDropdownVisibleChange"), e.length !== 0 && (se.current = !0, console.warn(
|
|
143
|
+
`[Cascader] 检测到已 @deprecated 的 popup* 命名 prop:${e.join("、")}。v5.x 仍 fallback 兼容,v6.0 移除。请按箭头右侧迁移。`
|
|
144
|
+
));
|
|
145
|
+
}, [w, M, O, S]);
|
|
146
|
+
const oe = s.useMemo(
|
|
139
147
|
() => ({
|
|
140
148
|
options: c,
|
|
141
|
-
optionsTitle:
|
|
149
|
+
optionsTitle: K,
|
|
142
150
|
fieldNames: i,
|
|
143
151
|
values: N,
|
|
144
|
-
menuMaxHight:
|
|
145
|
-
halfValues:
|
|
146
|
-
changeOnSelect:
|
|
147
|
-
onSelect:
|
|
148
|
-
menuWidth:
|
|
149
|
-
dropdownPrefixCls:
|
|
150
|
-
loadData:
|
|
151
|
-
expandTrigger:
|
|
152
|
-
expandIcon:
|
|
153
|
-
loadingIcon:
|
|
154
|
-
dropdownMenuColumnStyle:
|
|
155
|
-
loading:
|
|
152
|
+
menuMaxHight: we,
|
|
153
|
+
halfValues: Z,
|
|
154
|
+
changeOnSelect: L,
|
|
155
|
+
onSelect: I,
|
|
156
|
+
menuWidth: X,
|
|
157
|
+
dropdownPrefixCls: _,
|
|
158
|
+
loadData: F,
|
|
159
|
+
expandTrigger: $,
|
|
160
|
+
expandIcon: J,
|
|
161
|
+
loadingIcon: z,
|
|
162
|
+
dropdownMenuColumnStyle: B,
|
|
163
|
+
loading: v
|
|
156
164
|
}),
|
|
157
165
|
[
|
|
158
|
-
|
|
166
|
+
X,
|
|
159
167
|
c,
|
|
160
168
|
m,
|
|
161
|
-
|
|
169
|
+
K,
|
|
162
170
|
i,
|
|
163
171
|
N,
|
|
164
|
-
|
|
165
|
-
W,
|
|
166
|
-
D,
|
|
167
|
-
H,
|
|
172
|
+
Z,
|
|
168
173
|
L,
|
|
169
|
-
|
|
170
|
-
F,
|
|
174
|
+
I,
|
|
171
175
|
_,
|
|
176
|
+
F,
|
|
172
177
|
$,
|
|
173
|
-
|
|
178
|
+
J,
|
|
179
|
+
z,
|
|
180
|
+
B,
|
|
181
|
+
v
|
|
174
182
|
]
|
|
175
|
-
),
|
|
183
|
+
), ne = !c.length, Te = (e, t = 1) => {
|
|
176
184
|
let n = t;
|
|
177
185
|
const a = [...e.map((r) => ({ option: r, depth: 1 }))];
|
|
178
186
|
for (; a.length > 0 && n < 3; ) {
|
|
179
187
|
const r = a.pop();
|
|
180
188
|
if (!r) break;
|
|
181
|
-
const { option: p, depth:
|
|
182
|
-
n = Math.max(n,
|
|
183
|
-
...p.children.map((
|
|
184
|
-
option:
|
|
185
|
-
depth:
|
|
189
|
+
const { option: p, depth: b } = r;
|
|
190
|
+
n = Math.max(n, b), p.children && p.children.length > 0 && a.push(
|
|
191
|
+
...p.children.map((_e) => ({
|
|
192
|
+
option: _e,
|
|
193
|
+
depth: b + 1
|
|
186
194
|
}))
|
|
187
195
|
);
|
|
188
196
|
}
|
|
189
197
|
return n;
|
|
190
198
|
};
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}, [
|
|
194
|
-
window.removeEventListener("resize",
|
|
195
|
-
}), []),
|
|
199
|
+
s.useEffect(() => {
|
|
200
|
+
k(!!(E !== void 0 ? E : w));
|
|
201
|
+
}, [E, w]), s.useEffect(() => (window.addEventListener("resize", W), () => {
|
|
202
|
+
window.removeEventListener("resize", W);
|
|
203
|
+
}), []), s.useEffect(() => {
|
|
196
204
|
const t = f?.[0]?.children;
|
|
197
|
-
m.current.level = !t || t.length < 1 ||
|
|
198
|
-
}, [f,
|
|
199
|
-
const
|
|
200
|
-
e.stopPropagation(),
|
|
201
|
-
},
|
|
205
|
+
m.current.level = !t || t.length < 1 || v ? 1 : Te(f || []), W();
|
|
206
|
+
}, [f, v]);
|
|
207
|
+
const Ae = (e) => {
|
|
208
|
+
e.stopPropagation(), Q(""), V && V([], []), k(!1), oe.values = [];
|
|
209
|
+
}, W = () => {
|
|
202
210
|
const e = document.getElementById(`${m.current.id}`);
|
|
203
211
|
if (!e) return;
|
|
204
212
|
const { clientWidth: t } = e;
|
|
205
|
-
|
|
206
|
-
},
|
|
207
|
-
|
|
213
|
+
Se((t / m.current.level).toFixed(2));
|
|
214
|
+
}, He = s.useMemo(() => /* @__PURE__ */ o.jsx(o.Fragment, { children: u ? y && D ? /* @__PURE__ */ o.jsx(ce, { disabled: !0, children: /* @__PURE__ */ o.jsx("span", { className: "select-label-text", children: u }) }) : /* @__PURE__ */ o.jsx("span", { className: "select-label-text", children: u }) : y && D ? /* @__PURE__ */ o.jsx(
|
|
215
|
+
ce,
|
|
208
216
|
{
|
|
209
217
|
disabled: !0,
|
|
210
|
-
...
|
|
211
|
-
children: /* @__PURE__ */
|
|
218
|
+
...D,
|
|
219
|
+
children: /* @__PURE__ */ o.jsx("span", { className: "select-label-placeholder", children: j })
|
|
212
220
|
}
|
|
213
|
-
) : /* @__PURE__ */
|
|
214
|
-
if (
|
|
215
|
-
return /* @__PURE__ */
|
|
221
|
+
) : /* @__PURE__ */ o.jsx("span", { className: "select-label-placeholder", children: j }) }), [u, j]), Le = () => {
|
|
222
|
+
if (Ve)
|
|
223
|
+
return /* @__PURE__ */ o.jsx(
|
|
216
224
|
"span",
|
|
217
225
|
{
|
|
218
226
|
className: "clean-up-icon",
|
|
219
|
-
onClick:
|
|
220
|
-
children: /* @__PURE__ */
|
|
227
|
+
onClick: Ae,
|
|
228
|
+
children: /* @__PURE__ */ o.jsx(Ge, {})
|
|
221
229
|
}
|
|
222
230
|
);
|
|
223
|
-
},
|
|
224
|
-
const e =
|
|
225
|
-
[`${
|
|
226
|
-
[`${
|
|
227
|
-
[`${
|
|
228
|
-
}), t =
|
|
229
|
-
"select-svg-open":
|
|
231
|
+
}, $e = s.useMemo(() => {
|
|
232
|
+
const e = re(`${C}-cascader-select-content`, {
|
|
233
|
+
[`${C}-cascader-select-value`]: u,
|
|
234
|
+
[`${C}-cascader-select-disabled`]: y,
|
|
235
|
+
[`${C}-cascader-error`]: U
|
|
236
|
+
}), t = re("select-svg", {
|
|
237
|
+
"select-svg-open": R
|
|
230
238
|
});
|
|
231
|
-
return
|
|
239
|
+
return q || /* @__PURE__ */ o.jsxs(
|
|
232
240
|
"div",
|
|
233
241
|
{
|
|
234
242
|
className: e,
|
|
235
243
|
id: m.current.id,
|
|
236
244
|
children: [
|
|
237
|
-
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
-
|
|
245
|
+
He,
|
|
246
|
+
/* @__PURE__ */ o.jsxs("span", { className: t, children: [
|
|
247
|
+
/* @__PURE__ */ o.jsx(qe, {}),
|
|
248
|
+
Le()
|
|
241
249
|
] })
|
|
242
250
|
]
|
|
243
251
|
}
|
|
244
252
|
);
|
|
245
|
-
}, [u,
|
|
253
|
+
}, [u, R, m]), Ke = (
|
|
246
254
|
// Empty keep the width
|
|
247
|
-
|
|
255
|
+
ne ? {} : {
|
|
248
256
|
minWidth: "auto"
|
|
249
257
|
}
|
|
250
258
|
);
|
|
251
|
-
return /* @__PURE__ */
|
|
252
|
-
/* @__PURE__ */
|
|
259
|
+
return /* @__PURE__ */ o.jsxs(Qe.Provider, { value: oe, children: [
|
|
260
|
+
/* @__PURE__ */ o.jsx(
|
|
253
261
|
Fe,
|
|
254
262
|
{
|
|
255
|
-
...
|
|
263
|
+
...Ee,
|
|
256
264
|
ref: h,
|
|
257
265
|
disabled: y,
|
|
258
|
-
id:
|
|
259
|
-
prefixCls:
|
|
260
|
-
dropdownMatchSelectWidth:
|
|
266
|
+
id: Me,
|
|
267
|
+
prefixCls: me,
|
|
268
|
+
dropdownMatchSelectWidth: be,
|
|
261
269
|
dropdownStyle: Ke,
|
|
262
270
|
showSearch: !1,
|
|
263
271
|
searchValue: "",
|
|
264
272
|
onSearch: () => {
|
|
265
273
|
console.log("not search");
|
|
266
274
|
},
|
|
267
|
-
displayValues:
|
|
275
|
+
displayValues: Pe,
|
|
268
276
|
onDisplayValuesChange: Re,
|
|
269
|
-
OptionList:
|
|
270
|
-
emptyOptions:
|
|
271
|
-
open:
|
|
272
|
-
dropdownClassName:
|
|
273
|
-
placement:
|
|
274
|
-
onDropdownVisibleChange:
|
|
275
|
-
getRawInputElement: () =>
|
|
277
|
+
OptionList: et,
|
|
278
|
+
emptyOptions: ne,
|
|
279
|
+
open: R,
|
|
280
|
+
dropdownClassName: ke,
|
|
281
|
+
placement: Ie,
|
|
282
|
+
onDropdownVisibleChange: We,
|
|
283
|
+
getRawInputElement: () => $e
|
|
276
284
|
}
|
|
277
285
|
),
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
-
|
|
286
|
+
/* @__PURE__ */ o.jsx(
|
|
287
|
+
lt,
|
|
280
288
|
{
|
|
281
289
|
className: "text-field-error-text",
|
|
282
|
-
error:
|
|
290
|
+
error: U,
|
|
283
291
|
helperText: Ne,
|
|
284
|
-
hideErrorDom:
|
|
292
|
+
hideErrorDom: ve
|
|
285
293
|
}
|
|
286
294
|
)
|
|
287
295
|
] });
|
|
288
296
|
});
|
|
289
|
-
process.env.NODE_ENV !== "production" && (
|
|
290
|
-
|
|
291
|
-
|
|
297
|
+
process.env.NODE_ENV !== "production" && (A.displayName = "Cascader");
|
|
298
|
+
A.SHOW_PARENT = pe;
|
|
299
|
+
A.SHOW_CHILD = st;
|
|
292
300
|
export {
|
|
293
|
-
|
|
301
|
+
A as default
|
|
294
302
|
};
|
|
295
303
|
//# sourceMappingURL=Cascader.js.map
|
package/es/Collapse/index.js
CHANGED
|
@@ -1,52 +1,59 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { j as n } from "../_virtual/jsx-runtime.js";
|
|
2
|
+
import i from "react";
|
|
3
|
+
import N from "rc-collapse";
|
|
4
|
+
import { CollapsePanelProps as P } from "./collapsePanel.js";
|
|
5
|
+
import { toArray as d, omit as $, cloneElement as g } from "./util.js";
|
|
6
|
+
import { Right as E } from "../node_modules/@para-ui/icons/Right/index.js";
|
|
7
|
+
import R from "./motion.js";
|
|
8
|
+
import { $rcPrefixCls as j, $prefixCls as p } from "../GlobalContext/constant.js";
|
|
8
9
|
import './index.css';/* empty css */
|
|
9
|
-
const
|
|
10
|
-
const { className: r = "", expandIconPosition:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
const I = (l) => {
|
|
11
|
+
const { className: r = "", expandIconPosition: t = "left" } = l, c = i.useRef(!1);
|
|
12
|
+
i.useEffect(() => {
|
|
13
|
+
process.env.NODE_ENV === "production" || c.current || !d(l.children).some((s) => s?.props?.disabled !== void 0) || (c.current = !0, console.warn(
|
|
14
|
+
'[Collapse] CollapsePanel.disabled 已 @deprecated。v5.x 仍 fallback 兼容(自动映射 collapsible="disabled"),v6.0 移除。请直接传 collapsible="disabled"。'
|
|
15
|
+
));
|
|
16
|
+
}, [l.children]);
|
|
17
|
+
const m = () => {
|
|
18
|
+
const { children: e } = l;
|
|
19
|
+
return d(e).map((s, a) => {
|
|
20
|
+
const o = s;
|
|
21
|
+
if (o.props?.disabled) {
|
|
22
|
+
const x = o.key || String(a), { disabled: h, collapsible: C } = o.props, v = {
|
|
23
|
+
...$(o.props, ["disabled"]),
|
|
24
|
+
key: x,
|
|
25
|
+
collapsible: C ?? (h ? "disabled" : void 0)
|
|
19
26
|
};
|
|
20
|
-
return
|
|
27
|
+
return g(o, v);
|
|
21
28
|
}
|
|
22
|
-
return
|
|
29
|
+
return o;
|
|
23
30
|
});
|
|
24
|
-
},
|
|
25
|
-
const { expandIcon:
|
|
26
|
-
return /* @__PURE__ */
|
|
27
|
-
},
|
|
28
|
-
let
|
|
29
|
-
return r && (
|
|
30
|
-
},
|
|
31
|
-
...
|
|
31
|
+
}, f = (e = {}) => {
|
|
32
|
+
const { expandIcon: s } = l, a = s ? s(e) : /* @__PURE__ */ n.jsx(E, { className: "collapse-expand-svg" });
|
|
33
|
+
return /* @__PURE__ */ n.jsx("div", { className: "collapse-svg-box", children: a });
|
|
34
|
+
}, u = () => {
|
|
35
|
+
let e = `${p}-collapse`;
|
|
36
|
+
return r && (e += ` ${r}`), t && (e += ` ${p}-collapse-svg-${t}`), e;
|
|
37
|
+
}, b = {
|
|
38
|
+
...R,
|
|
32
39
|
motionAppear: !1,
|
|
33
40
|
leavedClassName: "collapse-content-hidden"
|
|
34
41
|
};
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
|
|
42
|
+
return /* @__PURE__ */ n.jsx(
|
|
43
|
+
N,
|
|
37
44
|
{
|
|
38
|
-
openMotion:
|
|
39
|
-
...
|
|
40
|
-
expandIcon:
|
|
41
|
-
prefixCls: `${
|
|
42
|
-
className:
|
|
43
|
-
children:
|
|
45
|
+
openMotion: b,
|
|
46
|
+
...l,
|
|
47
|
+
expandIcon: f,
|
|
48
|
+
prefixCls: `${j}-collapse`,
|
|
49
|
+
className: u(),
|
|
50
|
+
children: m()
|
|
44
51
|
}
|
|
45
52
|
);
|
|
46
53
|
};
|
|
47
|
-
|
|
54
|
+
I.Panel = P;
|
|
48
55
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
56
|
+
I as Collapse,
|
|
57
|
+
I as default
|
|
51
58
|
};
|
|
52
59
|
//# sourceMappingURL=index.js.map
|