@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.
@@ -30,7 +30,10 @@ export interface ComboSelectProps extends HelperTextDetailProps {
30
30
  /**search 占位符*/
31
31
  searchPlaceholder?: string;
32
32
  /**最大显示数*/
33
- /** @deprecated This attribute has been deprecated */
33
+ /**
34
+ * @deprecated v5.x dead field — 该字段历史遗留,代码内仅解构未引用,runtime 完全不生效。v5.0.0-beta.14 起 dev 模式抛 warn,v6.0 移除字段。
35
+ * 迁移:从 props 中移除 maxCount;tag 换行行为请用 `overLine` 控制。
36
+ */
34
37
  maxCount?: number;
35
38
  /** 超出换行 */
36
39
  overLine?: boolean;
@@ -1,12 +1,6 @@
1
- import { default as React } from 'react';
2
1
  import { GenerateConfig } from 'rc-picker/lib/generate/index';
3
2
  import { RangePickerProps } from '.';
4
- import { RangeValue } from 'rc-picker/lib/interface';
5
3
  import { PickerComponentClass } from './interface';
6
- interface PresetDate<T> {
7
- label: React.ReactNode;
8
- value: T | (() => T);
9
- }
10
4
  export default function generateRangePicker<DateType>(generateConfig: GenerateConfig<DateType>): PickerComponentClass<RangePickerProps<DateType> & {
11
5
  /**
12
6
  * @deprecated `dropdownClassName` is deprecated which will be removed in next major
@@ -14,6 +8,4 @@ export default function generateRangePicker<DateType>(generateConfig: GenerateCo
14
8
  */
15
9
  dropdownClassName?: string;
16
10
  popupClassName?: string;
17
- presets?: PresetDate<Exclude<RangeValue<DateType>, null>>[];
18
11
  }>;
19
- export {};
@@ -1,27 +1,27 @@
1
1
  import { j as r } from "../../_virtual/jsx-runtime.js";
2
- import a, { forwardRef as Z, useImperativeHandle as ee } from "react";
3
- import u from "clsx";
4
- import { CloseCircleF as re } from "../../node_modules/@para-ui/icons/CloseCircleF/index.js";
5
- import { SortRight as oe } from "../../node_modules/@para-ui/icons/SortRight/index.js";
6
- import { Calendar as te } from "../../node_modules/@para-ui/icons/Calendar/index.js";
7
- import { Time as se } from "../../node_modules/@para-ui/icons/Time/index.js";
8
- import { RangePicker as ne } from "rc-picker";
9
- import { mergedLocale as ae, getTimeProps as T, getRangePlaceholder as le, formatPickerValue as ie, getPopupContainer as ce, isolationPopupPollution as pe } from "../util.js";
10
- import { Components as ue, pickerFormatMap as me } from "./index.js";
2
+ import n, { forwardRef as re, useImperativeHandle as oe } from "react";
3
+ import p from "clsx";
4
+ import { CloseCircleF as te } from "../../node_modules/@para-ui/icons/CloseCircleF/index.js";
5
+ import { SortRight as se } from "../../node_modules/@para-ui/icons/SortRight/index.js";
6
+ import { Calendar as ae } from "../../node_modules/@para-ui/icons/Calendar/index.js";
7
+ import { Time as ne } from "../../node_modules/@para-ui/icons/Time/index.js";
8
+ import { RangePicker as le } from "rc-picker";
9
+ import { mergedLocale as ie, getTimeProps as T, getRangePlaceholder as ce, formatPickerValue as pe, getPopupContainer as ue, isolationPopupPollution as me } from "../util.js";
10
+ import { Components as fe, pickerFormatMap as de } from "./index.js";
11
11
  import y from "../lang/index.js";
12
- import fe from "../../GlobalContext/index.js";
13
- import de from "../../Label/index.js";
14
- import xe from "../../HelperText/index.js";
12
+ import xe from "../../GlobalContext/index.js";
13
+ import ge from "../../Label/index.js";
14
+ import Pe from "../../HelperText/index.js";
15
15
  import { $prefixCls as I } from "../../GlobalContext/constant.js";
16
- import { UUID as ge } from "@snack-kit/lib";
16
+ import { UUID as he } from "@snack-kit/lib";
17
17
  import L from "../PickerTag.js";
18
- import { Tooltip as Pe } from "../../Tooltip/index.js";
19
- function Se(z) {
20
- return Z(
18
+ import { Tooltip as Ce } from "../../Tooltip/index.js";
19
+ function _e(z) {
20
+ return re(
21
21
  (l, H) => {
22
22
  const {
23
23
  className: O,
24
- size: be,
24
+ size: je,
25
25
  bordered: V = !0,
26
26
  placeholder: F,
27
27
  error: i = !1,
@@ -29,94 +29,102 @@ function Se(z) {
29
29
  style: D,
30
30
  value: E,
31
31
  defaultValue: M,
32
- label: m = "",
32
+ label: u = "",
33
33
  labelTooltip: S,
34
- required: f = !1,
35
- shortcuts: d,
36
- presets: x,
37
- ranges: Ce,
38
- shortcutsPlacement: g = "left",
34
+ required: m = !1,
35
+ shortcuts: f,
36
+ presets: d,
37
+ ranges: $e,
38
+ shortcutsPlacement: x = "left",
39
39
  getPopupContainer: U,
40
40
  isolationPopupOnHide: _ = !1,
41
- disabled: P,
42
- disabledTooltip: h,
43
- ...c
44
- } = l, { format: p, showTime: b, picker: t, use12Hours: q } = l, n = a.useRef(null), C = a.useRef(null), j = a.useMemo(() => ge(), []), o = `${I}-picker`, { language: $, locale: R } = a.useContext(fe);
41
+ disabled: g,
42
+ disabledTooltip: P,
43
+ dropdownClassName: q,
44
+ popupClassName: B,
45
+ ...h
46
+ } = l, { format: c, showTime: C, picker: t, use12Hours: G } = l, a = n.useRef(null), b = n.useRef(null), j = n.useMemo(() => he(), []), o = `${I}-picker`, { language: $, locale: R } = n.useContext(xe);
45
47
  let k = {};
46
48
  if (R) {
47
49
  const e = R[$ || "zh"];
48
50
  e && (k = e.DatePicker);
49
51
  }
50
- const B = y[$ || "zh"] || y.zh, v = ae(k, B);
52
+ const J = y[$ || "zh"] || y.zh, v = ie(k, J);
51
53
  let s = {};
52
54
  s = {
53
55
  ...s,
54
- ...b ? T({ format: p, picker: t, ...b }) : {},
55
- ...t === "time" ? T({ format: p, ...l, picker: t }) : {}
56
+ ...C ? T({ format: c, picker: t, ...C }) : {},
57
+ ...t === "time" ? T({ format: c, ...l, picker: t }) : {}
56
58
  }, s.style && delete s.style;
57
59
  const N = (e) => {
58
60
  if (!Array.isArray(e)) return e;
59
- const X = p ?? me[t];
60
- return e.map((Y) => ie(Y, X));
61
- }, G = () => m || f ? /* @__PURE__ */ r.jsx(
62
- de,
61
+ const Z = c ?? de[t];
62
+ return e.map((ee) => pe(ee, Z));
63
+ }, K = () => u || m ? /* @__PURE__ */ r.jsx(
64
+ ge,
63
65
  {
64
- label: m,
65
- required: f,
66
+ label: u,
67
+ required: m,
66
68
  ...S
67
69
  }
68
70
  ) : null;
69
- ee(H, () => ({
70
- focus: () => n.current?.focus(),
71
- blur: () => n.current?.blur()
71
+ oe(H, () => ({
72
+ focus: () => a.current?.focus(),
73
+ blur: () => a.current?.blur()
72
74
  }));
73
- const w = x ? x.map((e) => ({
75
+ const w = d ? d.map((e) => ({
74
76
  label: typeof e.label == "string" ? /* @__PURE__ */ r.jsx(L, { children: e.label }) : e.label,
75
77
  value: e.value
76
- })) : d ? d.map((e) => ({
78
+ })) : f ? f.map((e) => ({
77
79
  label: typeof e.text == "string" ? /* @__PURE__ */ r.jsx(L, { children: e.text }) : e.text,
78
80
  value: typeof e.value == "function" ? e.value() : e.value
79
- })) : [], J = !!w?.length, K = u(j, c.dropdownClassName, `${I}-scrollbar-small`, {
80
- [`${o}-use12Hours`]: q,
81
- [`${o}-presets-${g}`]: J
82
- }), Q = (e) => ce(e, U, C), W = (e) => {
83
- c.onOpenChange?.(e), _ && pe(e, j), e || n.current?.blur();
81
+ })) : [], Q = !!w?.length, W = p(
82
+ j,
83
+ q,
84
+ B,
85
+ `${I}-scrollbar-small`,
86
+ {
87
+ [`${o}-use12Hours`]: G,
88
+ [`${o}-presets-${x}`]: Q
89
+ }
90
+ ), X = (e) => ue(e, U, b), Y = (e) => {
91
+ h.onOpenChange?.(e), _ && me(e, j), e || a.current?.blur();
84
92
  };
85
93
  return (() => {
86
94
  const e = /* @__PURE__ */ r.jsxs(
87
95
  "div",
88
96
  {
89
- ref: C,
90
- className: u(`${o}-wrapper`, O),
97
+ ref: b,
98
+ className: p(`${o}-wrapper`, O),
91
99
  style: D,
92
100
  children: [
93
- G(),
101
+ K(),
94
102
  /* @__PURE__ */ r.jsx(
95
- ne,
103
+ le,
96
104
  {
97
105
  separator: /* @__PURE__ */ r.jsx(
98
106
  "span",
99
107
  {
100
108
  "aria-label": "to",
101
109
  className: `${o}-separator`,
102
- children: /* @__PURE__ */ r.jsx(oe, {})
110
+ children: /* @__PURE__ */ r.jsx(se, {})
103
111
  }
104
112
  ),
105
- ref: n,
106
- placeholder: le(t, v, F),
107
- suffixIcon: t === "time" ? /* @__PURE__ */ r.jsx(se, {}) : /* @__PURE__ */ r.jsx(te, { className: "picker-icon" }),
108
- clearIcon: /* @__PURE__ */ r.jsx(re, {}),
113
+ ref: a,
114
+ placeholder: ce(t, v, F),
115
+ suffixIcon: t === "time" ? /* @__PURE__ */ r.jsx(ne, {}) : /* @__PURE__ */ r.jsx(ae, { className: "picker-icon" }),
116
+ clearIcon: /* @__PURE__ */ r.jsx(te, {}),
109
117
  allowClear: !0,
110
- disabled: P,
111
- ...c,
118
+ disabled: g,
119
+ ...h,
112
120
  ...s,
113
121
  defaultValue: N(M),
114
122
  value: N(E),
115
123
  presets: w,
116
- className: u({
124
+ className: p({
117
125
  [`${o}-borderless`]: !V,
118
126
  [`${o}-error`]: i,
119
- [`${o}-shortcuts-${g}`]: i
127
+ [`${o}-shortcuts-${x}`]: i
120
128
  }),
121
129
  locale: v.lang,
122
130
  prefixCls: o,
@@ -125,15 +133,15 @@ function Se(z) {
125
133
  nextIcon: /* @__PURE__ */ r.jsx("span", { className: `${o}-next-icon` }),
126
134
  superPrevIcon: /* @__PURE__ */ r.jsx("span", { className: `${o}-super-prev-icon` }),
127
135
  superNextIcon: /* @__PURE__ */ r.jsx("span", { className: `${o}-super-next-icon` }),
128
- components: ue,
136
+ components: fe,
129
137
  direction: "ltr",
130
- dropdownClassName: K,
131
- getPopupContainer: Q,
132
- onOpenChange: W
138
+ dropdownClassName: W,
139
+ getPopupContainer: X,
140
+ onOpenChange: Y
133
141
  }
134
142
  ),
135
143
  /* @__PURE__ */ r.jsx(
136
- xe,
144
+ Pe,
137
145
  {
138
146
  error: i,
139
147
  helperText: A
@@ -142,11 +150,11 @@ function Se(z) {
142
150
  ]
143
151
  }
144
152
  );
145
- return P && h ? /* @__PURE__ */ r.jsx(
146
- Pe,
153
+ return g && P ? /* @__PURE__ */ r.jsx(
154
+ Ce,
147
155
  {
148
156
  disabled: !0,
149
- ...h,
157
+ ...P,
150
158
  children: e
151
159
  }
152
160
  ) : e;
@@ -155,6 +163,6 @@ function Se(z) {
155
163
  );
156
164
  }
157
165
  export {
158
- Se as default
166
+ _e as default
159
167
  };
160
168
  //# sourceMappingURL=generateRangePicker.js.map
@@ -5,6 +5,7 @@ import { RangePickerBaseProps as RCRangePickerBaseProps, RangePickerDateProps as
5
5
  import { Locale as RcPickerLocale } from 'rc-picker/lib/interface';
6
6
  import { default as PickerButton } from '../PickerButton';
7
7
  import { default as PickerTag } from '../PickerTag';
8
+ import { PresetDate } from './generateSinglePicker';
8
9
  import { Dayjs } from 'dayjs';
9
10
  import { LabelTooltipProps } from '../../Label';
10
11
  import { TooltipProps } from '../../Tooltip';
@@ -89,18 +90,24 @@ export type RangePickerProps<DateType> = (RangePickerBaseProps<DateType> | Range
89
90
  shortcuts?: ShortcutType[];
90
91
  /** 预设范围选择面板位置 */
91
92
  shortcutsPlacement?: 'left' | 'right';
93
+ /**
94
+ * 预设时间范围(v5.x 推荐,替换旧 `shortcuts`)。
95
+ * 修复:v5.0.0-beta.14 起从内部 DateRangePickerProps 提升到导出类型,
96
+ * 解决下游业务方 `<RangePicker presets={...}>` TS2322 报错(PARA_UI_BETA13_FEEDBACK P1)。
97
+ */
98
+ presets?: PresetDate<Exclude<RangeValue<DateType>, null>>[];
92
99
  };
93
100
  declare function generatePicker<DateType>(generateConfig: GenerateConfig<DateType>): import('./interface').PickerComponentClass<PickerProps<DateType> & {
94
- presets?: import('./generateSinglePicker').PresetDate<DateType>[] | undefined;
101
+ presets?: PresetDate<DateType>[] | undefined;
95
102
  }, unknown> & {
96
103
  WeekPicker: import('./interface').PickerComponentClass<Omit<PickerProps<DateType> & {
97
- presets?: import('./generateSinglePicker').PresetDate<DateType>[] | undefined;
104
+ presets?: PresetDate<DateType>[] | undefined;
98
105
  }, "picker">, unknown>;
99
106
  MonthPicker: import('./interface').PickerComponentClass<Omit<PickerProps<DateType> & {
100
- presets?: import('./generateSinglePicker').PresetDate<DateType>[] | undefined;
107
+ presets?: PresetDate<DateType>[] | undefined;
101
108
  }, "picker">, unknown>;
102
109
  YearPicker: import('./interface').PickerComponentClass<Omit<PickerProps<DateType> & {
103
- presets?: import('./generateSinglePicker').PresetDate<DateType>[] | undefined;
110
+ presets?: PresetDate<DateType>[] | undefined;
104
111
  }, "picker">, unknown>;
105
112
  RangePicker: React.ComponentClass<RangePickerProps<DateType>>;
106
113
  TimePicker: import('./interface').PickerComponentClass<PickerTimeProps<DateType>, unknown>;
@@ -1,133 +1,139 @@
1
1
  import { j as n } from "../../_virtual/jsx-runtime.js";
2
- import C from "react-dom";
3
- import { Modal as B } from "../index.js";
4
- import { Close as O } from "../../node_modules/@para-ui/icons/Close/index.js";
5
- import { CheckCircleF as P } from "../../node_modules/@para-ui/icons/CheckCircleF/index.js";
6
- import { WarningCircleF as d } from "../../node_modules/@para-ui/icons/WarningCircleF/index.js";
7
- import { CloseCircleF as R } from "../../node_modules/@para-ui/icons/CloseCircleF/index.js";
8
- import j from "clsx";
9
- import { Button as f } from "../../Button/index.js";
10
- import { UUID as $ } from "@snack-kit/lib";
2
+ import v from "react-dom";
3
+ import { Modal as P } from "../index.js";
4
+ import { Close as z } from "../../node_modules/@para-ui/icons/Close/index.js";
5
+ import { CheckCircleF as R } from "../../node_modules/@para-ui/icons/CheckCircleF/index.js";
6
+ import { WarningCircleF as f } from "../../node_modules/@para-ui/icons/WarningCircleF/index.js";
7
+ import { CloseCircleF as $ } from "../../node_modules/@para-ui/icons/CloseCircleF/index.js";
8
+ import y from "clsx";
9
+ import { Button as u } from "../../Button/index.js";
10
+ import { UUID as H } from "@snack-kit/lib";
11
11
  import "../../GlobalContext/index.js";
12
- import { $prefixCls as D } from "../../GlobalContext/constant.js";
12
+ import { $prefixCls as I } from "../../GlobalContext/constant.js";
13
13
  import './index.css';/* empty css */
14
- import { getConfirmLocale as E } from "../../GlobalContext/confirmLocale.js";
15
- const H = {
16
- success: /* @__PURE__ */ n.jsx(P, {}),
17
- warn: /* @__PURE__ */ n.jsx(d, {}),
18
- warning: /* @__PURE__ */ n.jsx(d, {}),
19
- error: /* @__PURE__ */ n.jsx(R, {}),
20
- info: /* @__PURE__ */ n.jsx(d, {})
21
- }, I = (e) => {
14
+ import { getConfirmLocale as L } from "../../GlobalContext/confirmLocale.js";
15
+ const U = {
16
+ success: /* @__PURE__ */ n.jsx(R, {}),
17
+ warn: /* @__PURE__ */ n.jsx(f, {}),
18
+ warning: /* @__PURE__ */ n.jsx(f, {}),
19
+ error: /* @__PURE__ */ n.jsx($, {}),
20
+ info: /* @__PURE__ */ n.jsx(f, {})
21
+ }, K = (e) => {
22
22
  const {
23
23
  type: o = "warning",
24
- title: r,
24
+ title: s,
25
25
  content: t,
26
- icon: s,
26
+ icon: r,
27
27
  okText: l,
28
28
  cancelText: i,
29
29
  onOk: N,
30
- onCancel: k,
31
- className: y,
32
- showCancel: v = !0,
33
- closable: w = !1,
34
- okButtonProps: b,
35
- cancelButtonProps: A,
36
- resolveFn: u,
37
- callback: T,
38
- destroy: x,
39
- actions: p,
40
- showActions: g = !0,
41
- ...F
42
- } = e, M = `${D}-confirm`, m = () => {
43
- k?.(), u?.(!1), x?.();
44
- }, h = () => {
45
- N?.(), u?.(!0), T?.(), x?.();
46
- }, z = () => g ? p ? /* @__PURE__ */ n.jsx("div", { className: "confirm-content-actions", children: p }) : /* @__PURE__ */ n.jsxs("div", { className: "confirm-content-actions", children: [
47
- v && /* @__PURE__ */ n.jsx(
48
- f,
30
+ onCancel: w,
31
+ className: b,
32
+ showCancel: A = !0,
33
+ closable: B = !1,
34
+ okButtonProps: T,
35
+ cancelButtonProps: g,
36
+ resolveFn: x,
37
+ callback: F,
38
+ destroy: p,
39
+ actions: h,
40
+ showActions: O = !0,
41
+ disableBackdropClick: C,
42
+ disableEscapeKeyDown: j,
43
+ ...D
44
+ } = e, d = {};
45
+ C !== void 0 && (d.closeOnBackdrop = !C), j !== void 0 && (d.closeOnEsc = !j);
46
+ const E = `${I}-confirm`, a = () => {
47
+ w?.(), x?.(!1), p?.();
48
+ }, k = () => {
49
+ N?.(), x?.(!0), F?.(), p?.();
50
+ }, M = () => O ? h ? /* @__PURE__ */ n.jsx("div", { className: "confirm-content-actions", children: h }) : /* @__PURE__ */ n.jsxs("div", { className: "confirm-content-actions", children: [
51
+ A && /* @__PURE__ */ n.jsx(
52
+ u,
49
53
  {
50
54
  variant: "outlined",
51
55
  size: "small",
52
- onClick: m,
53
- ...A,
56
+ onClick: a,
57
+ ...g,
54
58
  children: i
55
59
  }
56
60
  ),
57
61
  /* @__PURE__ */ n.jsx(
58
- f,
62
+ u,
59
63
  {
60
64
  variant: "contained",
61
65
  size: "small",
62
- onClick: h,
63
- ...b,
66
+ onClick: k,
67
+ ...T,
64
68
  children: l
65
69
  }
66
70
  )
67
71
  ] }) : null;
68
72
  return /* @__PURE__ */ n.jsx(
69
- B,
73
+ P,
70
74
  {
71
75
  bodyStyle: { minHeight: "auto" },
72
- ...F,
73
- onOk: h,
74
- onCancel: m,
76
+ ...D,
77
+ ...d,
78
+ onOk: k,
79
+ onCancel: a,
80
+ onDismiss: a,
75
81
  title: "",
76
82
  footer: "",
77
83
  size: "auto",
78
84
  hideHeader: !0,
79
85
  showActions: !1,
80
- className: j(M, y),
86
+ className: y(E, b),
81
87
  children: /* @__PURE__ */ n.jsx("div", { className: "confirm-wrapper", children: /* @__PURE__ */ n.jsxs("div", { className: "confirm-content", children: [
82
- w && /* @__PURE__ */ n.jsx(
83
- f.IconButton,
88
+ B && /* @__PURE__ */ n.jsx(
89
+ u.IconButton,
84
90
  {
85
91
  variant: "outlined",
86
92
  size: "small",
87
93
  className: "confirm-content-close",
88
- onClick: m,
89
- children: /* @__PURE__ */ n.jsx(O, {})
94
+ onClick: a,
95
+ children: /* @__PURE__ */ n.jsx(z, {})
90
96
  }
91
97
  ),
92
- /* @__PURE__ */ n.jsx("span", { className: j("confirm-content-icon", `confirm-content-icon--${o}`), children: s || H[o] }),
98
+ /* @__PURE__ */ n.jsx("span", { className: y("confirm-content-icon", `confirm-content-icon--${o}`), children: r || U[o] }),
93
99
  /* @__PURE__ */ n.jsxs("div", { className: "confirm-content-body", children: [
94
- r && /* @__PURE__ */ n.jsx("span", { className: "confirm-body-title", children: r }),
100
+ s && /* @__PURE__ */ n.jsx("span", { className: "confirm-body-title", children: s }),
95
101
  /* @__PURE__ */ n.jsx("div", { className: "confirm-body-desc", children: t })
96
102
  ] }),
97
- z()
103
+ M()
98
104
  ] }) })
99
105
  }
100
106
  );
101
- }, c = /* @__PURE__ */ new Map(), L = (e, o, r) => {
102
- const t = document.createElement("div"), s = e.uuid || $();
107
+ }, c = /* @__PURE__ */ new Map(), S = (e, o, s) => {
108
+ const t = document.createElement("div"), r = e.uuid || H();
103
109
  e.uuid && t.setAttribute("data-confirm-cid", e.uuid), document.body.appendChild(t);
104
110
  const l = () => {
105
- C.unmountComponentAtNode(t) && t.parentNode && t.parentNode.removeChild(t), c.delete(s);
111
+ v.unmountComponentAtNode(t) && t.parentNode && t.parentNode.removeChild(t), c.delete(r);
106
112
  };
107
- c.set(s, l), setTimeout(() => {
108
- const i = E();
109
- C.render(
113
+ c.set(r, l), setTimeout(() => {
114
+ const i = L();
115
+ v.render(
110
116
  /* @__PURE__ */ n.jsx(
111
- I,
117
+ K,
112
118
  {
113
119
  ...e,
114
120
  okText: e.okText ?? i.ok,
115
121
  cancelText: e.cancelText ?? i.cancel,
116
122
  open: !0,
117
123
  resolveFn: o,
118
- callback: r,
124
+ callback: s,
119
125
  destroy: l
120
126
  }
121
127
  ),
122
128
  t
123
129
  );
124
130
  });
125
- }, a = (e, o, r) => {
131
+ }, m = (e, o, s) => {
126
132
  let t = { type: o };
127
- return typeof e == "string" ? t.content = e : t = { ...e, type: o }, new Promise((s) => {
128
- L(t, s, r);
133
+ return typeof e == "string" ? t.content = e : t = { ...e, type: o }, new Promise((r) => {
134
+ S(t, r, s);
129
135
  });
130
- }, U = (e) => {
136
+ }, W = (e) => {
131
137
  if (e) {
132
138
  const o = c.get(e);
133
139
  o && o(), c.delete(e);
@@ -136,14 +142,14 @@ const H = {
136
142
  c.forEach((o) => {
137
143
  o && o();
138
144
  }), c.clear();
139
- }, ne = {
140
- info: (e, o) => a(e, "info", o),
141
- warn: (e, o) => a(e, "warn", o),
142
- error: (e, o) => a(e, "error", o),
143
- success: (e, o) => a(e, "success", o),
144
- destroyAll: U
145
+ }, re = {
146
+ info: (e, o) => m(e, "info", o),
147
+ warn: (e, o) => m(e, "warn", o),
148
+ error: (e, o) => m(e, "error", o),
149
+ success: (e, o) => m(e, "success", o),
150
+ destroyAll: W
145
151
  };
146
152
  export {
147
- ne as Confirm
153
+ re as Confirm
148
154
  };
149
155
  //# sourceMappingURL=index.js.map
@@ -59,7 +59,18 @@ export interface ModalProps {
59
59
  * 仅传 `onOk` → 旧行为不变(onOk 仍触发)。dev 环境若检测到只传 `onOk` 会 console.warn 1 次提示迁移。
60
60
  */
61
61
  onSubmit?: (e?: React.MouseEvent<HTMLElement>) => void | Promise<void>;
62
- /** 点击模态框右上角叉、取消按钮,return false 不关闭 */
62
+ /**
63
+ * 取消按钮回调(v5.x.next 起为主职责)。
64
+ *
65
+ * **v5.0.0-beta.14(v5.x.next-fix)起兼容性约定**:
66
+ * - 显式传 `onDismiss` → 仅取消按钮触发 onCancel,X / ESC / mask 走 onDismiss(γ 单触发)
67
+ * - 显式传 `onClose` → R6 双触发:onCancel + onClose(legacy)
68
+ * - **未传 onDismiss / onClose**(v4 写法) → onCancel 仍 fallback 兜底 X / ESC / mask 三路;
69
+ * **dev 环境抛 Error 强制业务方迁移到 onDismiss(prod 仍 fallback 不影响线上)**。
70
+ *
71
+ * v6.0(2026 Q3)起 fallback 兜底移除 — 只用 onCancel 接 X / ESC / mask 的写法运行时静默失效。
72
+ * 详见 BREAKING-CHANGES §B-Modal-props-rework 子条 #5。
73
+ */
63
74
  onCancel?: (e?: React.MouseEvent<HTMLElement>) => boolean | void;
64
75
  /**
65
76
  * @deprecated v5.x.next 改用 onDismiss(X/ESC/mask)+ onOk(确定)+ onCancel(取消)三回调职责互斥;v6.0 移除 onClose。详见 BREAKING-CHANGES §B-Modal-props-rework