@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/es/Modal/index.js CHANGED
@@ -1,17 +1,17 @@
1
1
  import { j as t } from "../_virtual/jsx-runtime.js";
2
- import s from "react";
3
- import Me from "rc-dialog";
4
- import { Button as C } from "../Button/index.js";
5
- import { Close as Ae } from "../node_modules/@para-ui/icons/Close/index.js";
6
- import $e from "../GlobalContext/useFormatMessage.js";
7
- import Re from "./lang/index.js";
8
- import { Confirm as qe } from "./Confirm/index.js";
9
- import H from "clsx";
10
- import { $prefixCls as F } from "../GlobalContext/constant.js";
11
- import je from "../AutoTips/index.js";
2
+ import n from "react";
3
+ import _e from "rc-dialog";
4
+ import { Button as k } from "../Button/index.js";
5
+ import { Close as ze } from "../node_modules/@para-ui/icons/Close/index.js";
6
+ import Fe from "../GlobalContext/useFormatMessage.js";
7
+ import Te from "./lang/index.js";
8
+ import { Confirm as to } from "./Confirm/index.js";
9
+ import P from "clsx";
10
+ import { $prefixCls as W } from "../GlobalContext/constant.js";
11
+ import Ie from "../AutoTips/index.js";
12
12
  import './index.css';/* empty css */
13
13
  let h;
14
- const ze = (e) => {
14
+ const Ke = (e) => {
15
15
  h = {
16
16
  x: e.pageX,
17
17
  y: e.pageY
@@ -19,89 +19,104 @@ const ze = (e) => {
19
19
  h = null;
20
20
  }, 100);
21
21
  };
22
- window.document.documentElement && document.documentElement.addEventListener("click", ze, !0);
23
- const Le = (e) => {
22
+ window.document.documentElement && document.documentElement.addEventListener("click", Ke, !0);
23
+ const oo = (e) => {
24
24
  const {
25
- open: u,
26
- visible: f,
27
- defaultOpen: k,
28
- closeIcon: G,
29
- centered: I = !0,
30
- focusTriggerAfterClose: T = !0,
31
- title: _,
32
- footer: V,
33
- showActions: K = !0,
34
- actions: P,
35
- header: p,
36
- hideHeader: W = !1,
37
- showCancel: X = !0,
38
- maskClosable: L = !1,
39
- disableBackdropClick: J = !0,
40
- closeOnBackdrop: x,
41
- keyboard: Y = !1,
42
- disableEscapeKeyDown: q = !0,
43
- closeOnEsc: v,
25
+ open: f,
26
+ visible: m,
27
+ defaultOpen: v,
28
+ closeIcon: X,
29
+ centered: L = !0,
30
+ focusTriggerAfterClose: J = !0,
31
+ title: Q,
32
+ footer: U,
33
+ showActions: Y = !0,
34
+ actions: q,
35
+ header: E,
36
+ hideHeader: Z = !1,
37
+ showCancel: ee = !0,
38
+ maskClosable: oe = !1,
39
+ disableBackdropClick: ne = !0,
40
+ closeOnBackdrop: p,
41
+ keyboard: se = !1,
42
+ disableEscapeKeyDown: te = !0,
43
+ closeOnEsc: x,
44
44
  restoreFocusOnClose: g,
45
- fullScreen: Q,
46
- customizeSize: U,
47
- style: Z,
48
- bodyStyle: ee,
49
- contentWidth: oe,
50
- contentHeight: E,
51
- contentStyle: N,
52
- size: r = "md",
53
- children: ne,
54
- closable: te = !0,
55
- mask: O = !0,
56
- ...se
57
- } = e, w = $e("Modal", Re), S = e.onClose !== void 0, b = s.useRef(!1);
58
- s.useEffect(() => {
59
- process.env.NODE_ENV !== "production" && S && !b.current && (b.current = !0, console.warn(
45
+ fullScreen: le,
46
+ customizeSize: ae,
47
+ style: re,
48
+ bodyStyle: ce,
49
+ contentWidth: ie,
50
+ contentHeight: N,
51
+ contentStyle: b,
52
+ size: a = "md",
53
+ children: de,
54
+ closable: ue = !0,
55
+ mask: w = !0,
56
+ ...fe
57
+ } = e, O = Fe("Modal", Te), i = e.onClose !== void 0, S = n.useRef(!1);
58
+ n.useEffect(() => {
59
+ process.env.NODE_ENV !== "production" && i && !S.current && (S.current = !0, console.warn(
60
60
  "[Modal] onClose 已在 v5.x.next 标记为 @deprecated,将在 v6.0 移除。请迁移到 onDismiss(处理 X/ESC/mask 关闭)+ onOk(确定按钮)+ onCancel(取消按钮)三回调模式。详见 BREAKING-CHANGES §B-Modal-props-rework。"
61
61
  ));
62
- }, [S]);
63
- const y = f !== void 0, B = s.useRef(!1);
64
- s.useEffect(() => {
65
- process.env.NODE_ENV !== "production" && y && !B.current && (B.current = !0, console.warn(
62
+ }, [i]);
63
+ const B = m !== void 0, D = n.useRef(!1);
64
+ n.useEffect(() => {
65
+ process.env.NODE_ENV !== "production" && B && !D.current && (D.current = !0, console.warn(
66
66
  "[Modal] visible 已在 v5.x.next 标记为 @deprecated,将在 v6.0 移除。请改用 open prop。详见 BREAKING-CHANGES §B-Modal-props-rework 子条 #3-A"
67
67
  ));
68
- }, [y]);
69
- const M = e.onOk !== void 0, A = e.onSubmit !== void 0, $ = s.useRef(!1);
70
- s.useEffect(() => {
71
- process.env.NODE_ENV !== "production" && M && !A && !$.current && ($.current = !0, console.warn(
68
+ }, [B]);
69
+ const A = e.onOk !== void 0, M = e.onSubmit !== void 0, y = n.useRef(!1);
70
+ n.useEffect(() => {
71
+ process.env.NODE_ENV !== "production" && A && !M && !y.current && (y.current = !0, console.warn(
72
72
  "[Modal] onOk 已在 v5.x.next 标记为 @deprecated,将在 v6.0 移除。请改用 onSubmit prop(语义更清晰)。详见 BREAKING-CHANGES §B-Modal-props-rework"
73
73
  ));
74
- }, [M, A]);
75
- const l = u !== void 0 || f !== void 0, [le, i] = s.useState(k ?? !1), re = l ? u ?? f ?? !1 : le, R = k !== void 0, j = u !== void 0;
76
- s.useEffect(() => {
77
- process.env.NODE_ENV !== "production" && j && R && console.warn(
74
+ }, [A, M]);
75
+ const R = e.onCancel !== void 0, $ = e.onDismiss !== void 0, j = n.useRef(!1);
76
+ n.useEffect(() => {
77
+ if (process.env.NODE_ENV !== "production" && R && !$ && !i && !j.current)
78
+ throw j.current = !0, new Error(
79
+ "[Modal] v5.0.0-beta.14 起 X / ESC / 蒙层关闭路径主职责已交给 onDismiss(γ 互斥语义)。当前仅传 onCancel 而未传 onDismiss/onClose,prod 走 fallback 兼容,dev 抛 Error 强制迁移。一键迁移:`npx jscodeshift -t node_modules/@para-ui/core/codemods/modal-onCancel-to-onDismiss.js --parser=tsx src/`。v6.0(2026 Q3)起 fallback 删除,届时 X/ESC/mask 静默失效。详见 docs/UPGRADE_v4_to_v5.md §3.D.0 + BREAKING-CHANGES §B-Modal-props-rework 子条 #5。"
80
+ );
81
+ }, [R, $, i]);
82
+ const H = e.maskClosable !== void 0, G = e.disableBackdropClick !== void 0, _ = e.disableEscapeKeyDown !== void 0, z = e.focusTriggerAfterClose !== void 0, F = n.useRef(!1);
83
+ n.useEffect(() => {
84
+ if (process.env.NODE_ENV === "production" || F.current) return;
85
+ const o = [];
86
+ H && o.push("maskClosable → closeOnBackdrop"), G && o.push("disableBackdropClick → closeOnBackdrop"), _ && o.push("disableEscapeKeyDown → closeOnEsc"), z && o.push("focusTriggerAfterClose → restoreFocusOnClose"), o.length !== 0 && (F.current = !0, console.warn(
87
+ `[Modal] 检测到 v5.x.next 已 @deprecated 的反向命名 prop:${o.join("、")}。v5.x 仍 fallback 兼容,v6.0 移除。请按箭头右侧迁移到正向命名(对齐业界 antd/chakra/mui)。详见 BREAKING-CHANGES §B-Modal-props-rework + §B6。`
88
+ ));
89
+ }, [H, G, _, z]);
90
+ const l = f !== void 0 || m !== void 0, [me, d] = n.useState(v ?? !1), Ce = l ? f ?? m ?? !1 : me, T = v !== void 0, I = f !== void 0;
91
+ n.useEffect(() => {
92
+ process.env.NODE_ENV !== "production" && I && T && console.warn(
78
93
  "[Modal] 同时传 open + defaultOpen,defaultOpen 被忽略(open 优先,受控模式)。详见 BREAKING-CHANGES §B-Modal-props-rework 子条 #2"
79
94
  );
80
- }, [j, R]);
81
- const z = s.useRef(l);
82
- s.useEffect(() => {
83
- z.current !== l && (process.env.NODE_ENV !== "production" && console.warn("[Modal] open 受控/非受控状态运行时切换,React 不支持此模式,请保持一致。"), z.current = l);
95
+ }, [I, T]);
96
+ const K = n.useRef(l);
97
+ n.useEffect(() => {
98
+ K.current !== l && (process.env.NODE_ENV !== "production" && console.warn("[Modal] open 受控/非受控状态运行时切换,React 不支持此模式,请保持一致。"), K.current = l);
84
99
  }, [l]);
85
- const ae = Q || r === "fullScreen", n = `${F}-modal`, ce = v !== void 0 ? v : !q, ie = x !== void 0 ? x : !J, de = g !== void 0 ? g : T, ue = (o) => {
86
- e.onCancel?.(o), e.onClose?.("cancel"), l || i(!1);
87
- }, fe = (o) => {
88
- e.onClose !== void 0 ? (e.onCancel?.(o), e.onClose("x")) : e.onDismiss?.("x"), l || i(!1);
89
- }, me = (o) => {
90
- const a = o && o.type === "keydown" ? "esc" : "mask";
91
- e.onClose !== void 0 ? (e.onCancel?.(o), e.onClose(a)) : e.onDismiss?.(a), l || i(!1);
92
- }, Ce = (o) => {
93
- e.onSubmit ? e.onSubmit(o) : e.onOk?.(o), e.onClose?.("ok"), l || i(!1);
94
- }, he = () => {
100
+ const ke = le || a === "fullScreen", s = `${W}-modal`, he = x !== void 0 ? x : !te, ve = p !== void 0 ? p : !ne, Ee = g !== void 0 ? g : J, pe = (o) => {
101
+ e.onCancel?.(o), e.onClose?.("cancel"), l || d(!1);
102
+ }, xe = (o) => {
103
+ e.onClose !== void 0 ? (e.onCancel?.(o), e.onClose("x")) : e.onDismiss !== void 0 ? e.onDismiss("x") : e.onCancel?.(o), l || d(!1);
104
+ }, ge = (o) => {
105
+ const r = o && o.type === "keydown" ? "esc" : "mask";
106
+ e.onClose !== void 0 ? (e.onCancel?.(o), e.onClose(r)) : e.onDismiss !== void 0 ? e.onDismiss(r) : e.onCancel?.(o), l || d(!1);
107
+ }, Ne = (o) => {
108
+ e.onSubmit ? e.onSubmit(o) : e.onOk?.(o), e.onClose?.("ok"), l || d(!1);
109
+ }, be = () => {
95
110
  const o = {
96
- sm: `${n}-sm`,
97
- md: `${n}-md`,
98
- lg: `${n}-lg`,
99
- auto: `${n}-auto`,
100
- fullScreen: `${n}-fullscreen`
111
+ sm: `${s}-sm`,
112
+ md: `${s}-md`,
113
+ lg: `${s}-lg`,
114
+ auto: `${s}-auto`,
115
+ fullScreen: `${s}-fullscreen`
101
116
  };
102
- if (!N)
103
- return ae ? o.fullScreen : o[r];
104
- }, ke = () => !r || r === "fullScreen" || r === "auto" ? void 0 : {
117
+ if (!b)
118
+ return ke ? o.fullScreen : o[a];
119
+ }, we = () => !a || a === "fullScreen" || a === "auto" ? void 0 : {
105
120
  sm: {
106
121
  width: 430,
107
122
  maxHeight: 118
@@ -114,94 +129,94 @@ const Le = (e) => {
114
129
  width: 948,
115
130
  maxHeight: 478
116
131
  }
117
- }[r], pe = () => O ? `${n}-with-mask` : `${n}-without-mask`, xe = () => ({ ...U, ...Z }), ve = () => {
118
- const { maxHeight: o, width: a } = ke() || {};
132
+ }[a], Oe = () => w ? `${s}-with-mask` : `${s}-without-mask`, Se = () => ({ ...ae, ...re }), Be = () => {
133
+ const { maxHeight: o, width: r } = we() || {};
119
134
  return {
120
135
  // contentWidth 和 contentHeight 优先级总是最高
121
- maxHeight: E || o || "calc(100vh - 142px)",
122
- width: oe || a,
123
- height: E,
136
+ maxHeight: N || o || "calc(100vh - 142px)",
137
+ width: ie || r,
138
+ height: N,
124
139
  // minHeight: contentHeight || 118,
125
- ...ee,
126
- ...N
140
+ ...ce,
141
+ ...b
127
142
  };
128
- }, ge = () => {
129
- if (W) return null;
130
- if (p) return p;
131
- const o = te && /* @__PURE__ */ t.jsx(
132
- C.IconButton,
143
+ }, De = () => {
144
+ if (Z) return null;
145
+ if (E) return E;
146
+ const o = ue && /* @__PURE__ */ t.jsx(
147
+ k.IconButton,
133
148
  {
134
- onClick: fe,
135
- className: `${n}-close`,
149
+ onClick: xe,
150
+ className: `${s}-close`,
136
151
  variant: "outlined",
137
152
  size: "small",
138
- children: G || /* @__PURE__ */ t.jsx(Ae, { className: `${n}-close-icon` })
153
+ children: X || /* @__PURE__ */ t.jsx(ze, { className: `${s}-close-icon` })
139
154
  }
140
155
  );
141
156
  return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
142
- /* @__PURE__ */ t.jsx(je, { className: `${n}-title-text`, children: _ }),
157
+ /* @__PURE__ */ t.jsx(Ie, { className: `${s}-title-text`, children: Q }),
143
158
  o
144
159
  ] });
145
- }, Ee = () => {
146
- if (!K) return null;
147
- const { okText: o, cancelText: a, okButtonProps: we, cancelButtonProps: Se, confirmLoading: be = !1 } = e, ye = /* @__PURE__ */ t.jsx(
148
- C,
160
+ }, Ae = () => {
161
+ if (!Y) return null;
162
+ const { okText: o, cancelText: r, okButtonProps: Re, cancelButtonProps: $e, confirmLoading: je = !1 } = e, He = /* @__PURE__ */ t.jsx(
163
+ k,
149
164
  {
150
165
  variant: "contained",
151
166
  size: "large",
152
- loading: be,
153
- onClick: Ce,
154
- ...we,
155
- children: o ?? w({ id: "ok" })
167
+ loading: je,
168
+ onClick: Ne,
169
+ ...Re,
170
+ children: o ?? O({ id: "ok" })
156
171
  }
157
- ), D = [X && /* @__PURE__ */ t.jsx(
158
- C,
172
+ ), V = [ee && /* @__PURE__ */ t.jsx(
173
+ k,
159
174
  {
160
175
  variant: "outlined",
161
176
  size: "large",
162
- onClick: ue,
163
- ...Se,
164
- children: a ?? w({ id: "cancel" })
177
+ onClick: pe,
178
+ ...$e,
179
+ children: r ?? O({ id: "cancel" })
165
180
  }
166
- ), ye], d = P ?? V;
167
- if (typeof d == "function") {
168
- const c = d(D);
169
- return /* @__PURE__ */ t.jsx(t.Fragment, { children: Array.isArray(c) ? c.map((m, Be) => /* @__PURE__ */ t.jsx(s.Fragment, { children: m }, Be)) : c });
170
- } else if (d)
171
- return d;
172
- return /* @__PURE__ */ t.jsx(t.Fragment, { children: D.map((c, m) => /* @__PURE__ */ t.jsx(s.Fragment, { children: c }, m)) });
173
- }, Ne = H(e.wrapClassName, {
174
- [`${n}-centered`]: I
175
- }), Oe = H(e.className, `${F}-scrollbar-small`, he(), pe());
181
+ ), He], u = q ?? U;
182
+ if (typeof u == "function") {
183
+ const c = u(V);
184
+ return /* @__PURE__ */ t.jsx(t.Fragment, { children: Array.isArray(c) ? c.map((C, Ge) => /* @__PURE__ */ t.jsx(n.Fragment, { children: C }, Ge)) : c });
185
+ } else if (u)
186
+ return u;
187
+ return /* @__PURE__ */ t.jsx(t.Fragment, { children: V.map((c, C) => /* @__PURE__ */ t.jsx(n.Fragment, { children: c }, C)) });
188
+ }, Me = P(e.wrapClassName, {
189
+ [`${s}-centered`]: L
190
+ }), ye = P(e.className, `${W}-scrollbar-small`, be(), Oe());
176
191
  return /* @__PURE__ */ t.jsx(
177
- Me,
192
+ _e,
178
193
  {
179
- ...se,
180
- mask: O,
181
- visible: re,
182
- title: ge(),
183
- footer: Ee(),
184
- style: xe(),
185
- bodyStyle: ve(),
186
- prefixCls: n,
187
- className: Oe,
188
- wrapClassName: Ne,
194
+ ...fe,
195
+ mask: w,
196
+ visible: Ce,
197
+ title: De(),
198
+ footer: Ae(),
199
+ style: Se(),
200
+ bodyStyle: Be(),
201
+ prefixCls: s,
202
+ className: ye,
203
+ wrapClassName: Me,
189
204
  mousePosition: h,
190
- onClose: me,
205
+ onClose: ge,
191
206
  closable: !1,
192
207
  closeIcon: null,
193
- maskClosable: ie || L,
194
- keyboard: ce || Y,
195
- focusTriggerAfterClose: de,
196
- transitionName: `${n}-zoom`,
197
- maskTransitionName: `${n}-fade`,
198
- children: ne
208
+ maskClosable: ve || oe,
209
+ keyboard: he || se,
210
+ focusTriggerAfterClose: Ee,
211
+ transitionName: `${s}-zoom`,
212
+ maskTransitionName: `${s}-fade`,
213
+ children: de
199
214
  }
200
215
  );
201
216
  };
202
217
  export {
203
- qe as Confirm,
204
- Le as Modal,
205
- Le as default
218
+ to as Confirm,
219
+ oo as Modal,
220
+ oo as default
206
221
  };
207
222
  //# sourceMappingURL=index.js.map
@@ -1,106 +1,112 @@
1
1
  import { j as r } from "../_virtual/jsx-runtime.js";
2
- import l from "react";
3
- import k from "rc-tooltip";
4
- import z, { getDisabledCompatibleChildren as O, mapLegacyPlacement as U } from "./utils.js";
5
- import q from "clsx";
6
- import { $rcPrefixCls as R, $prefixCls as G } from "../GlobalContext/constant.js";
7
- import { Forbid as J } from "../node_modules/@para-ui/icons/Forbid/index.js";
2
+ import n from "react";
3
+ import z from "rc-tooltip";
4
+ import U, { getDisabledCompatibleChildren as w, mapLegacyPlacement as q } from "./utils.js";
5
+ import G from "clsx";
6
+ import { $rcPrefixCls as E, $prefixCls as J } from "../GlobalContext/constant.js";
7
+ import { Forbid as K } from "../node_modules/@para-ui/icons/Forbid/index.js";
8
8
  import './index.css';/* empty css */
9
- const w = l.forwardRef((e, P) => {
10
- const [$, u] = l.useState(e.defaultVisible), c = l.useRef(null), d = l.useRef(null), [j, T] = l.useState([0, 0]), g = l.useRef(!1);
11
- l.useEffect(() => {
12
- ("visible" in e || "open" in e) && u(!!(e.visible ?? e.open));
13
- }, [e.visible ?? e.open]), l.useEffect(() => {
9
+ const P = n.forwardRef((e, $) => {
10
+ const [T, m] = n.useState(e.defaultVisible), c = n.useRef(null), p = n.useRef(null), [j, N] = n.useState([0, 0]), g = n.useRef(!1);
11
+ n.useEffect(() => {
12
+ ("visible" in e || "open" in e) && m(!!(e.visible ?? e.open));
13
+ }, [e.visible ?? e.open]), n.useEffect(() => {
14
14
  process.env.NODE_ENV !== "production" && !g.current && Array.isArray(e.trigger) && e.trigger.length === 0 && (g.current = !0, console.warn(
15
15
  "[Tooltip] `trigger=[]` 受控屏蔽写法已 deprecated,请改用 `visible={false}`(语义更清晰);v6 可能收紧 trigger 类型,提前迁移。"
16
16
  ));
17
17
  }, [e.trigger]);
18
- const m = () => {
18
+ const u = () => {
19
19
  const { title: t } = e;
20
20
  return !t && t !== 0;
21
- }, E = (t) => {
22
- "visible" in e || "open" in e || u(m() ? !1 : t), m() || e.onVisibleChange?.(t);
23
- }, p = () => {
21
+ }, V = (t) => {
22
+ "visible" in e || "open" in e || m(u() ? !1 : t), u() || e.onVisibleChange?.(t);
23
+ }, b = () => {
24
24
  const { builtinPlacements: t, autoAdjustOverflow: i } = e;
25
- return t || z({ autoAdjustOverflow: i });
25
+ return t || U({ autoAdjustOverflow: i });
26
26
  }, S = (t, i) => {
27
- const s = p(), o = Object.keys(s).find(
27
+ const s = b(), o = Object.keys(s).find(
28
28
  (a) => s[a].points[0] === i.points[0] && s[a].points[1] === i.points[1]
29
29
  );
30
30
  if (!o)
31
31
  return;
32
- const f = t.getBoundingClientRect(), n = {
32
+ const f = t.getBoundingClientRect(), l = {
33
33
  top: "50%",
34
34
  left: "50%"
35
35
  };
36
- o.indexOf("top") >= 0 || o.indexOf("Bottom") >= 0 ? n.top = `${f.height - (i.offset?.[1] || 0)}px` : (o.indexOf("Top") >= 0 || o.indexOf("bottom") >= 0) && (n.top = `${-(i.offset?.[1] || 0)}px`), o.indexOf("left") >= 0 || o.indexOf("Right") >= 0 ? n.left = `${f.width - (i.offset?.[0] || 0)}px` : (o.indexOf("right") >= 0 || o.indexOf("Left") >= 0) && (n.left = `${-(i.offset?.[0] || 0)}px`), t.style.transformOrigin = `${n.left} ${n.top}`;
37
- }, V = (t) => {
36
+ o.indexOf("top") >= 0 || o.indexOf("Bottom") >= 0 ? l.top = `${f.height - (i.offset?.[1] || 0)}px` : (o.indexOf("Top") >= 0 || o.indexOf("bottom") >= 0) && (l.top = `${-(i.offset?.[1] || 0)}px`), o.indexOf("left") >= 0 || o.indexOf("Right") >= 0 ? l.left = `${f.width - (i.offset?.[0] || 0)}px` : (o.indexOf("right") >= 0 || o.indexOf("Left") >= 0) && (l.left = `${-(i.offset?.[0] || 0)}px`), t.style.transformOrigin = `${l.left} ${l.top}`;
37
+ }, D = (t) => {
38
38
  if (c.current) {
39
- const i = d.current?.popupRef?.current?.getElement()?.offsetHeight || 0, s = i === 0 ? 60 : 30, { x: o, y: f, width: n } = c.current.getBoundingClientRect(), a = t.clientX - (o + n / 2), Y = t.clientY - f + i + s;
39
+ const i = p.current?.popupRef?.current?.getElement()?.offsetHeight || 0, s = i === 0 ? 60 : 30, { x: o, y: f, width: l } = c.current.getBoundingClientRect(), a = t.clientX - (o + l / 2), Y = t.clientY - f + i + s;
40
40
  setTimeout(() => {
41
- T([-a, -Y]);
41
+ N([-a, -Y]);
42
42
  });
43
43
  }
44
44
  }, {
45
- prefixCls: N = `${R}-tooltip`,
46
- getPopupContainer: A,
47
- overlayClassName: D,
45
+ prefixCls: A = `${E}-tooltip`,
46
+ getPopupContainer: W,
47
+ overlayClassName: F,
48
48
  overlayInnerStyle: L,
49
49
  overlayStyle: M,
50
- children: x,
51
- title: W,
50
+ children: v,
51
+ title: _,
52
52
  placement: B,
53
- isPopover: F,
54
- followCursor: b,
55
- maxWidth: v,
56
- disabled: _,
57
- showForbidIcon: H,
58
- ...I
53
+ isPopover: I,
54
+ followCursor: x,
55
+ maxWidth: y,
56
+ disabled: d,
57
+ showForbidIcon: k,
58
+ ...H
59
59
  } = e;
60
- let y = $;
61
- !("visible" in e || "open" in e) && m() && (y = !1);
62
- const X = q(!F && `${G}-tooltip`, D), h = { ...M };
63
- v && (h.maxWidth = v);
64
- const C = { targetOffset: j };
65
- return e.offset && (C.offset = e.offset), /* @__PURE__ */ r.jsx(
66
- k,
60
+ let h = T;
61
+ !("visible" in e || "open" in e) && u() && (h = !1);
62
+ const O = n.useRef(!1);
63
+ n.useEffect(() => {
64
+ process.env.NODE_ENV !== "production" && d !== void 0 && !O.current && (O.current = !0, console.warn(
65
+ "[Tooltip] disabled @deprecated 请改用 showForbidIcon(自描述命名,对齐业界)。v5.x fallback 兼容,v6.0 移除。"
66
+ ));
67
+ }, [d]);
68
+ const X = G(!I && `${J}-tooltip`, F), C = { ...M };
69
+ y && (C.maxWidth = y);
70
+ const R = { targetOffset: j };
71
+ return e.offset && (R.offset = e.offset), /* @__PURE__ */ r.jsx(
72
+ z,
67
73
  {
68
- ...I,
69
- prefixCls: N,
70
- placement: b ? "top" : U(B),
74
+ ...H,
75
+ prefixCls: A,
76
+ placement: x ? "top" : q(B),
71
77
  overlayClassName: X,
72
- getTooltipContainer: A,
73
- ref: P || d,
74
- builtinPlacements: p(),
78
+ getTooltipContainer: W,
79
+ ref: $ || p,
80
+ builtinPlacements: b(),
75
81
  overlay: /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
76
- (_ || H) && /* @__PURE__ */ r.jsx(J, { className: "disabled-svg" }),
77
- W
82
+ (d || k) && /* @__PURE__ */ r.jsx(K, { className: "disabled-svg" }),
83
+ _
78
84
  ] }),
79
- visible: y,
80
- align: C,
81
- onVisibleChange: E,
85
+ visible: h,
86
+ align: R,
87
+ onVisibleChange: V,
82
88
  onPopupAlign: S,
83
- overlayStyle: h,
89
+ overlayStyle: C,
84
90
  overlayInnerStyle: L,
85
91
  arrowContent: null,
86
92
  motion: {
87
- motionName: `${R}-tooltip-zoom-big-fast`,
93
+ motionName: `${E}-tooltip-zoom-big-fast`,
88
94
  motionDeadline: 1e3
89
95
  },
90
- children: b ? /* @__PURE__ */ r.jsx(
96
+ children: x ? /* @__PURE__ */ r.jsx(
91
97
  "div",
92
98
  {
93
99
  style: { display: "inline-block" },
94
100
  ref: c,
95
- onMouseMove: V,
96
- children: O(x)
101
+ onMouseMove: D,
102
+ children: w(v)
97
103
  }
98
- ) : O(x)
104
+ ) : w(v)
99
105
  }
100
106
  );
101
107
  });
102
- w.displayName = "Tooltip";
103
- w.defaultProps = {
108
+ P.displayName = "Tooltip";
109
+ P.defaultProps = {
104
110
  placement: "topLeft",
105
111
  mouseEnterDelay: 0.1,
106
112
  mouseLeaveDelay: 0.1,
@@ -110,7 +116,7 @@ w.defaultProps = {
110
116
  maxWidth: 500
111
117
  };
112
118
  export {
113
- w as Tooltip,
114
- w as default
119
+ P as Tooltip,
120
+ P as default
115
121
  };
116
122
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("../_virtual/jsx-runtime.js"),He=require("rc-select"),re=require("clsx"),Ke=require("rc-select/lib/hooks/useId"),Le=require("rc-tree/lib/utils/conductUtil"),Fe=require("../node_modules/@para-ui/icons/Right/index.js"),ae=require("rc-util/lib/hooks/useEvent"),Ue=require("rc-util/lib/hooks/useMergedState"),ze=require("../node_modules/@para-ui/icons/Down/index.js"),Be=require("../node_modules/@para-ui/icons/CloseCircleF/index.js"),Je=require("react"),Ge=require("./context.js"),Qe=require("./hooks/useDisplayValues.js"),Xe=require("./hooks/useEntities.js"),Ye=require("./hooks/useMissingValues.js"),Ze=require("./OptionList/index.js"),f=require("./utils/commonUtil.js"),T=require("./utils/treeUtil.js"),et=require("@snack-kit/lib"),j=require("../GlobalContext/constant.js"),ie=require("../Tooltip/index.js"),tt=require("./lang/index.js"),st=require("../GlobalContext/useFormatMessage.js"),nt=require("../HelperText/index.js");function ot(o){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const p in o)if(p!=="default"){const E=Object.getOwnPropertyDescriptor(o,p);Object.defineProperty(l,p,E.get?E:{enumerable:!0,get:()=>o[p]})}}return l.default=o,Object.freeze(l)}const n=ot(Je);function rt(o){return Array.isArray(o)&&Array.isArray(o[0])}function _(o){return o?rt(o)?o:(o.length===0?[]:[o]).map(l=>Array.isArray(l)?l:[l]):[]}const S=n.forwardRef((o,l)=>{const p=st.default("Cascader",tt.default),{id:E,prefixCls:le=`${j.$prefixCls}-cascader`,fieldNames:I,className:at,defaultValue:ce,value:y,changeOnSelect:W,onChange:R,displayRender:ue,expandTrigger:A,options:g,optionsTitle:H=[],dropdownPrefixCls:K,loadData:L,popupVisible:F,open:N,popupClassName:de,dropdownClassName:pe,dropdownMenuColumnStyle:U,popupPlacement:me,placement:he,onDropdownVisibleChange:xe,onPopupVisibleChange:fe,expandIcon:z=s.jsxRuntimeExports.jsx(Fe.Right,{}),loadingIcon:B,placeholder:q=p({id:"placeholder"}),allClear:ge=!0,menuMaxHight:Ce=158,expandJoin:je="/",disabled:V=!1,loading:w,disabledTooltip:M,error:J=!1,hideErrorDom:Ee,helperText:ye="",children:G,dropdownMatchSelectWidth:Re=!1,showCheckedStrategy:Q=f.SHOW_PARENT,...Ve}=o,we=Ke(E),[v,be]=Ue(ce,{value:y,postState:_}),c=n.useMemo(()=>f.fillFieldNames(I),[JSON.stringify(I)]),u=n.useMemo(()=>g||[],[g]),m=Xe.default(u,c),C=n.useCallback(e=>{const t=m();return e.map(r=>{const{nodes:i}=t[r];return i.map(a=>a[c.value])})},[m,c]),[h,X]=n.useState(),[P,D]=n.useState(!1),[Y,Oe]=n.useState("auto"),x=n.useRef({id:et.UUID(),level:1}),Se=e=>_(e).map(i=>T.toPathOptions(i,u,c).map(a=>a.option));n.useEffect(()=>{if(!y)return;const t=Se(y)[0];t&&X(t.map(r=>r?.label).join(je))},[y]);const Z=Ye.default(u,c),[b,ee,te]=n.useMemo(()=>{const[e,t]=Z(v);if(!v.length)return[e,[],t];const r=f.toPathKeys(e),i=m(),{checkedKeys:a,halfCheckedKeys:d}=Le.conductCheck(r,!0,i);return[C(a),C(d),t]},[v,m,C,Z]),Ne=n.useMemo(()=>{const e=f.toPathKeys(b),t=T.formatStrategyValues(e,m,Q);return[...te,...C(t)]},[b,m,C,te,Q]),qe=Qe.default(Ne,u,c,!1,ue),se=ae(e=>{be(e);const t=_(e),r=t.map(d=>T.toPathOptions(d,u,c).map(O=>O.option)),i=t[0],a=r[0];R&&R(i,a||[])}),k=ae(e=>{se(e)}),Me=(e,t)=>{if(t.type==="clear"){se([]);return}const{valueCells:r}=t.values[0];k(r)},ve=pe||de,Pe=he||me,De=e=>{D(e),xe?.(e),fe?.(e)},ne=n.useMemo(()=>({options:u,optionsTitle:H,fieldNames:c,values:b,menuMaxHight:Ce,halfValues:ee,changeOnSelect:W,onSelect:k,menuWidth:Y,dropdownPrefixCls:K,loadData:L,expandTrigger:A,expandIcon:z,loadingIcon:B,dropdownMenuColumnStyle:U,loading:w}),[Y,u,x,H,c,b,ee,W,k,K,L,A,z,B,U,w]),oe=!u.length,ke=(e,t=1)=>{let r=t;const i=[...e.map(a=>({option:a,depth:1}))];for(;i.length>0&&r<3;){const a=i.pop();if(!a)break;const{option:d,depth:O}=a;r=Math.max(r,O),d.children&&d.children.length>0&&i.push(...d.children.map(Ae=>({option:Ae,depth:O+1})))}return r};n.useEffect(()=>{D(!!(N!==void 0?N:F))},[N,F]),n.useEffect(()=>(window.addEventListener("resize",$),()=>{window.removeEventListener("resize",$)}),[]),n.useEffect(()=>{const t=g?.[0]?.children;x.current.level=!t||t.length<1||w?1:ke(g||[]),$()},[g,w]);const $e=e=>{e.stopPropagation(),X(""),R&&R([],[]),D(!1),ne.values=[]},$=()=>{const e=document.getElementById(`${x.current.id}`);if(!e)return;const{clientWidth:t}=e;Oe((t/x.current.level).toFixed(2))},Te=n.useMemo(()=>s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:h?V&&M?s.jsxRuntimeExports.jsx(ie.Tooltip,{disabled:!0,children:s.jsxRuntimeExports.jsx("span",{className:"select-label-text",children:h})}):s.jsxRuntimeExports.jsx("span",{className:"select-label-text",children:h}):V&&M?s.jsxRuntimeExports.jsx(ie.Tooltip,{disabled:!0,...M,children:s.jsxRuntimeExports.jsx("span",{className:"select-label-placeholder",children:q})}):s.jsxRuntimeExports.jsx("span",{className:"select-label-placeholder",children:q})}),[h,q]),_e=()=>{if(ge)return s.jsxRuntimeExports.jsx("span",{className:"clean-up-icon",onClick:$e,children:s.jsxRuntimeExports.jsx(Be.CloseCircleF,{})})},Ie=n.useMemo(()=>{const e=re(`${j.$prefixCls}-cascader-select-content`,{[`${j.$prefixCls}-cascader-select-value`]:h,[`${j.$prefixCls}-cascader-select-disabled`]:V,[`${j.$prefixCls}-cascader-error`]:J}),t=re("select-svg",{"select-svg-open":P});return G||s.jsxRuntimeExports.jsxs("div",{className:e,id:x.current.id,children:[Te,s.jsxRuntimeExports.jsxs("span",{className:t,children:[s.jsxRuntimeExports.jsx(ze.Down,{}),_e()]})]})},[h,P,x]),We=oe?{}:{minWidth:"auto"};return s.jsxRuntimeExports.jsxs(Ge.default.Provider,{value:ne,children:[s.jsxRuntimeExports.jsx(He.BaseSelect,{...Ve,ref:l,disabled:V,id:we,prefixCls:le,dropdownMatchSelectWidth:Re,dropdownStyle:We,showSearch:!1,searchValue:"",onSearch:()=>{console.log("not search")},displayValues:qe,onDisplayValuesChange:Me,OptionList:Ze.default,emptyOptions:oe,open:P,dropdownClassName:ve,placement:Pe,onDropdownVisibleChange:De,getRawInputElement:()=>Ie}),s.jsxRuntimeExports.jsx(nt.default,{className:"text-field-error-text",error:J,helperText:ye,hideErrorDom:Ee})]})});process.env.NODE_ENV!=="production"&&(S.displayName="Cascader");S.SHOW_PARENT=f.SHOW_PARENT;S.SHOW_CHILD=f.SHOW_CHILD;exports.default=S;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("../_virtual/jsx-runtime.js"),Ke=require("rc-select"),ce=require("clsx"),Le=require("rc-select/lib/hooks/useId"),Fe=require("rc-tree/lib/utils/conductUtil"),Ue=require("../node_modules/@para-ui/icons/Right/index.js"),ue=require("rc-util/lib/hooks/useEvent"),ze=require("rc-util/lib/hooks/useMergedState"),Be=require("../node_modules/@para-ui/icons/Down/index.js"),Je=require("../node_modules/@para-ui/icons/CloseCircleF/index.js"),Ge=require("react"),Qe=require("./context.js"),Xe=require("./hooks/useDisplayValues.js"),Ye=require("./hooks/useEntities.js"),Ze=require("./hooks/useMissingValues.js"),et=require("./OptionList/index.js"),f=require("./utils/commonUtil.js"),A=require("./utils/treeUtil.js"),tt=require("@snack-kit/lib"),j=require("../GlobalContext/constant.js"),de=require("../Tooltip/index.js"),st=require("./lang/index.js"),nt=require("../GlobalContext/useFormatMessage.js"),ot=require("../HelperText/index.js");function rt(o){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const p in o)if(p!=="default"){const E=Object.getOwnPropertyDescriptor(o,p);Object.defineProperty(l,p,E.get?E:{enumerable:!0,get:()=>o[p]})}}return l.default=o,Object.freeze(l)}const s=rt(Ge);function at(o){return Array.isArray(o)&&Array.isArray(o[0])}function H(o){return o?at(o)?o:(o.length===0?[]:[o]).map(l=>Array.isArray(l)?l:[l]):[]}const O=s.forwardRef((o,l)=>{const p=nt.default("Cascader",st.default),{id:E,prefixCls:pe=`${j.$prefixCls}-cascader`,fieldNames:K,className:it,defaultValue:me,value:R,changeOnSelect:L,onChange:y,displayRender:he,expandTrigger:F,options:g,optionsTitle:U=[],dropdownPrefixCls:z,loadData:B,popupVisible:V,open:S,popupClassName:P,dropdownClassName:xe,dropdownMenuColumnStyle:J,popupPlacement:q,placement:fe,onDropdownVisibleChange:ge,onPopupVisibleChange:M,expandIcon:G=n.jsxRuntimeExports.jsx(Ue.Right,{}),loadingIcon:Q,placeholder:D=p({id:"placeholder"}),allClear:Ce=!0,menuMaxHight:je=158,expandJoin:Ee="/",disabled:b=!1,loading:w,disabledTooltip:k,error:X=!1,hideErrorDom:Re,helperText:ye="",children:Y,dropdownMatchSelectWidth:Ve=!1,showCheckedStrategy:Z=f.SHOW_PARENT,...be}=o,we=Le(E),[$,ve]=ze(me,{value:R,postState:H}),c=s.useMemo(()=>f.fillFieldNames(K),[JSON.stringify(K)]),u=s.useMemo(()=>g||[],[g]),m=Ye.default(u,c),C=s.useCallback(e=>{const t=m();return e.map(r=>{const{nodes:i}=t[r];return i.map(a=>a[c.value])})},[m,c]),[h,ee]=s.useState(),[_,T]=s.useState(!1),[te,Ne]=s.useState("auto"),x=s.useRef({id:tt.UUID(),level:1}),Oe=e=>H(e).map(i=>A.toPathOptions(i,u,c).map(a=>a.option));s.useEffect(()=>{if(!R)return;const t=Oe(R)[0];t&&ee(t.map(r=>r?.label).join(Ee))},[R]);const se=Ze.default(u,c),[v,ne,oe]=s.useMemo(()=>{const[e,t]=se($);if(!$.length)return[e,[],t];const r=f.toPathKeys(e),i=m(),{checkedKeys:a,halfCheckedKeys:d}=Fe.conductCheck(r,!0,i);return[C(a),C(d),t]},[$,m,C,se]),Se=s.useMemo(()=>{const e=f.toPathKeys(v),t=A.formatStrategyValues(e,m,Z);return[...oe,...C(t)]},[v,m,C,oe,Z]),Pe=Xe.default(Se,u,c,!1,he),re=ue(e=>{ve(e);const t=H(e),r=t.map(d=>A.toPathOptions(d,u,c).map(N=>N.option)),i=t[0],a=r[0];y&&y(i,a||[])}),I=ue(e=>{re(e)}),qe=(e,t)=>{if(t.type==="clear"){re([]);return}const{valueCells:r}=t.values[0];I(r)},Me=xe||P,De=fe||q,ke=e=>{T(e),ge?.(e),M?.(e)},ae=s.useRef(!1);s.useEffect(()=>{if(process.env.NODE_ENV==="production"||ae.current)return;const e=[];V!==void 0&&e.push("popupVisible → open"),P!==void 0&&e.push("popupClassName → dropdownClassName"),q!==void 0&&e.push("popupPlacement → placement"),M!==void 0&&e.push("onPopupVisibleChange → onDropdownVisibleChange"),e.length!==0&&(ae.current=!0,console.warn(`[Cascader] 检测到已 @deprecated 的 popup* 命名 prop:${e.join("、")}。v5.x 仍 fallback 兼容,v6.0 移除。请按箭头右侧迁移。`))},[V,P,q,M]);const ie=s.useMemo(()=>({options:u,optionsTitle:U,fieldNames:c,values:v,menuMaxHight:je,halfValues:ne,changeOnSelect:L,onSelect:I,menuWidth:te,dropdownPrefixCls:z,loadData:B,expandTrigger:F,expandIcon:G,loadingIcon:Q,dropdownMenuColumnStyle:J,loading:w}),[te,u,x,U,c,v,ne,L,I,z,B,F,G,Q,J,w]),le=!u.length,$e=(e,t=1)=>{let r=t;const i=[...e.map(a=>({option:a,depth:1}))];for(;i.length>0&&r<3;){const a=i.pop();if(!a)break;const{option:d,depth:N}=a;r=Math.max(r,N),d.children&&d.children.length>0&&i.push(...d.children.map(He=>({option:He,depth:N+1})))}return r};s.useEffect(()=>{T(!!(S!==void 0?S:V))},[S,V]),s.useEffect(()=>(window.addEventListener("resize",W),()=>{window.removeEventListener("resize",W)}),[]),s.useEffect(()=>{const t=g?.[0]?.children;x.current.level=!t||t.length<1||w?1:$e(g||[]),W()},[g,w]);const _e=e=>{e.stopPropagation(),ee(""),y&&y([],[]),T(!1),ie.values=[]},W=()=>{const e=document.getElementById(`${x.current.id}`);if(!e)return;const{clientWidth:t}=e;Ne((t/x.current.level).toFixed(2))},Te=s.useMemo(()=>n.jsxRuntimeExports.jsx(n.jsxRuntimeExports.Fragment,{children:h?b&&k?n.jsxRuntimeExports.jsx(de.Tooltip,{disabled:!0,children:n.jsxRuntimeExports.jsx("span",{className:"select-label-text",children:h})}):n.jsxRuntimeExports.jsx("span",{className:"select-label-text",children:h}):b&&k?n.jsxRuntimeExports.jsx(de.Tooltip,{disabled:!0,...k,children:n.jsxRuntimeExports.jsx("span",{className:"select-label-placeholder",children:D})}):n.jsxRuntimeExports.jsx("span",{className:"select-label-placeholder",children:D})}),[h,D]),Ie=()=>{if(Ce)return n.jsxRuntimeExports.jsx("span",{className:"clean-up-icon",onClick:_e,children:n.jsxRuntimeExports.jsx(Je.CloseCircleF,{})})},We=s.useMemo(()=>{const e=ce(`${j.$prefixCls}-cascader-select-content`,{[`${j.$prefixCls}-cascader-select-value`]:h,[`${j.$prefixCls}-cascader-select-disabled`]:b,[`${j.$prefixCls}-cascader-error`]:X}),t=ce("select-svg",{"select-svg-open":_});return Y||n.jsxRuntimeExports.jsxs("div",{className:e,id:x.current.id,children:[Te,n.jsxRuntimeExports.jsxs("span",{className:t,children:[n.jsxRuntimeExports.jsx(Be.Down,{}),Ie()]})]})},[h,_,x]),Ae=le?{}:{minWidth:"auto"};return n.jsxRuntimeExports.jsxs(Qe.default.Provider,{value:ie,children:[n.jsxRuntimeExports.jsx(Ke.BaseSelect,{...be,ref:l,disabled:b,id:we,prefixCls:pe,dropdownMatchSelectWidth:Ve,dropdownStyle:Ae,showSearch:!1,searchValue:"",onSearch:()=>{console.log("not search")},displayValues:Pe,onDisplayValuesChange:qe,OptionList:et.default,emptyOptions:le,open:_,dropdownClassName:Me,placement:De,onDropdownVisibleChange:ke,getRawInputElement:()=>We}),n.jsxRuntimeExports.jsx(ot.default,{className:"text-field-error-text",error:X,helperText:ye,hideErrorDom:Re})]})});process.env.NODE_ENV!=="production"&&(O.displayName="Cascader");O.SHOW_PARENT=f.SHOW_PARENT;O.SHOW_CHILD=f.SHOW_CHILD;exports.default=O;
2
2
  //# sourceMappingURL=Cascader.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const t=require("../_virtual/jsx-runtime.js"),h=require("rc-collapse"),j=require("./collapsePanel.js"),r=require("./util.js"),q=require("../node_modules/@para-ui/icons/Right/index.js"),v=require("./motion.js"),c=require("../GlobalContext/constant.js");;/* empty css */const a=l=>{const{className:i="",expandIconPosition:d="left"}=l,p=()=>{const{children:e}=l;return r.toArray(e).map((n,o)=>{const s=n;if(s.props?.disabled){const f=s.key||String(o),{disabled:C,collapsible:b}=s.props,g={...r.omit(s.props,["disabled"]),key:f,collapsible:b??(C?"disabled":void 0)};return r.cloneElement(s,g)}return s})},u=(e={})=>{const{expandIcon:n}=l,o=n?n(e):t.jsxRuntimeExports.jsx(q.Right,{className:"collapse-expand-svg"});return t.jsxRuntimeExports.jsx("div",{className:"collapse-svg-box",children:o})},x=()=>{let e=`${c.$prefixCls}-collapse`;return i&&(e+=` ${i}`),d&&(e+=` ${c.$prefixCls}-collapse-svg-${d}`),e},m={...v.default,motionAppear:!1,leavedClassName:"collapse-content-hidden"};return t.jsxRuntimeExports.jsx(h,{openMotion:m,...l,expandIcon:u,prefixCls:`${c.$rcPrefixCls}-collapse`,className:x(),children:p()})};a.Panel=j.CollapsePanelProps;exports.Collapse=a;exports.default=a;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const r=require("../_virtual/jsx-runtime.js"),p=require("react"),P=require("rc-collapse"),R=require("./collapsePanel.js"),t=require("./util.js"),g=require("../node_modules/@para-ui/icons/Right/index.js"),j=require("./motion.js"),a=require("../GlobalContext/constant.js");;/* empty css */const c=s=>{const{className:i="",expandIconPosition:d="left"}=s,u=p.useRef(!1);p.useEffect(()=>{process.env.NODE_ENV==="production"||u.current||!t.toArray(s.children).some(l=>l?.props?.disabled!==void 0)||(u.current=!0,console.warn('[Collapse] CollapsePanel.disabled 已 @deprecated。v5.x 仍 fallback 兼容(自动映射 collapsible="disabled"),v6.0 移除。请直接传 collapsible="disabled"。'))},[s.children]);const x=()=>{const{children:e}=s;return t.toArray(e).map((l,o)=>{const n=l;if(n.props?.disabled){const h=n.key||String(o),{disabled:C,collapsible:v}=n.props,q={...t.omit(n.props,["disabled"]),key:h,collapsible:v??(C?"disabled":void 0)};return t.cloneElement(n,q)}return n})},f=(e={})=>{const{expandIcon:l}=s,o=l?l(e):r.jsxRuntimeExports.jsx(g.Right,{className:"collapse-expand-svg"});return r.jsxRuntimeExports.jsx("div",{className:"collapse-svg-box",children:o})},b=()=>{let e=`${a.$prefixCls}-collapse`;return i&&(e+=` ${i}`),d&&(e+=` ${a.$prefixCls}-collapse-svg-${d}`),e},m={...j.default,motionAppear:!1,leavedClassName:"collapse-content-hidden"};return r.jsxRuntimeExports.jsx(P,{openMotion:m,...s,expandIcon:f,prefixCls:`${a.$rcPrefixCls}-collapse`,className:b(),children:x()})};c.Panel=R.CollapsePanelProps;exports.Collapse=c;exports.default=c;
2
2
  //# sourceMappingURL=index.js.map