@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
|
@@ -30,7 +30,10 @@ export interface ComboSelectProps extends HelperTextDetailProps {
|
|
|
30
30
|
/**search 占位符*/
|
|
31
31
|
searchPlaceholder?: string;
|
|
32
32
|
/**最大显示数*/
|
|
33
|
-
/**
|
|
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
|
|
3
|
-
import
|
|
4
|
-
import { CloseCircleF as
|
|
5
|
-
import { SortRight as
|
|
6
|
-
import { Calendar as
|
|
7
|
-
import { Time as
|
|
8
|
-
import { RangePicker as
|
|
9
|
-
import { mergedLocale as
|
|
10
|
-
import { Components as
|
|
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
|
|
13
|
-
import
|
|
14
|
-
import
|
|
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
|
|
16
|
+
import { UUID as he } from "@snack-kit/lib";
|
|
17
17
|
import L from "../PickerTag.js";
|
|
18
|
-
import { Tooltip as
|
|
19
|
-
function
|
|
20
|
-
return
|
|
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:
|
|
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:
|
|
32
|
+
label: u = "",
|
|
33
33
|
labelTooltip: S,
|
|
34
|
-
required:
|
|
35
|
-
shortcuts:
|
|
36
|
-
presets:
|
|
37
|
-
ranges:
|
|
38
|
-
shortcutsPlacement:
|
|
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:
|
|
42
|
-
disabledTooltip:
|
|
43
|
-
|
|
44
|
-
|
|
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
|
|
52
|
+
const J = y[$ || "zh"] || y.zh, v = ie(k, J);
|
|
51
53
|
let s = {};
|
|
52
54
|
s = {
|
|
53
55
|
...s,
|
|
54
|
-
...
|
|
55
|
-
...t === "time" ? T({ format:
|
|
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
|
|
60
|
-
return e.map((
|
|
61
|
-
},
|
|
62
|
-
|
|
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:
|
|
65
|
-
required:
|
|
66
|
+
label: u,
|
|
67
|
+
required: m,
|
|
66
68
|
...S
|
|
67
69
|
}
|
|
68
70
|
) : null;
|
|
69
|
-
|
|
70
|
-
focus: () =>
|
|
71
|
-
blur: () =>
|
|
71
|
+
oe(H, () => ({
|
|
72
|
+
focus: () => a.current?.focus(),
|
|
73
|
+
blur: () => a.current?.blur()
|
|
72
74
|
}));
|
|
73
|
-
const w =
|
|
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
|
-
})) :
|
|
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
|
-
})) : [],
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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:
|
|
90
|
-
className:
|
|
97
|
+
ref: b,
|
|
98
|
+
className: p(`${o}-wrapper`, O),
|
|
91
99
|
style: D,
|
|
92
100
|
children: [
|
|
93
|
-
|
|
101
|
+
K(),
|
|
94
102
|
/* @__PURE__ */ r.jsx(
|
|
95
|
-
|
|
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(
|
|
110
|
+
children: /* @__PURE__ */ r.jsx(se, {})
|
|
103
111
|
}
|
|
104
112
|
),
|
|
105
|
-
ref:
|
|
106
|
-
placeholder:
|
|
107
|
-
suffixIcon: t === "time" ? /* @__PURE__ */ r.jsx(
|
|
108
|
-
clearIcon: /* @__PURE__ */ r.jsx(
|
|
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:
|
|
111
|
-
...
|
|
118
|
+
disabled: g,
|
|
119
|
+
...h,
|
|
112
120
|
...s,
|
|
113
121
|
defaultValue: N(M),
|
|
114
122
|
value: N(E),
|
|
115
123
|
presets: w,
|
|
116
|
-
className:
|
|
124
|
+
className: p({
|
|
117
125
|
[`${o}-borderless`]: !V,
|
|
118
126
|
[`${o}-error`]: i,
|
|
119
|
-
[`${o}-shortcuts-${
|
|
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:
|
|
136
|
+
components: fe,
|
|
129
137
|
direction: "ltr",
|
|
130
|
-
dropdownClassName:
|
|
131
|
-
getPopupContainer:
|
|
132
|
-
onOpenChange:
|
|
138
|
+
dropdownClassName: W,
|
|
139
|
+
getPopupContainer: X,
|
|
140
|
+
onOpenChange: Y
|
|
133
141
|
}
|
|
134
142
|
),
|
|
135
143
|
/* @__PURE__ */ r.jsx(
|
|
136
|
-
|
|
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
|
|
146
|
-
|
|
153
|
+
return g && P ? /* @__PURE__ */ r.jsx(
|
|
154
|
+
Ce,
|
|
147
155
|
{
|
|
148
156
|
disabled: !0,
|
|
149
|
-
...
|
|
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
|
-
|
|
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?:
|
|
101
|
+
presets?: PresetDate<DateType>[] | undefined;
|
|
95
102
|
}, unknown> & {
|
|
96
103
|
WeekPicker: import('./interface').PickerComponentClass<Omit<PickerProps<DateType> & {
|
|
97
|
-
presets?:
|
|
104
|
+
presets?: PresetDate<DateType>[] | undefined;
|
|
98
105
|
}, "picker">, unknown>;
|
|
99
106
|
MonthPicker: import('./interface').PickerComponentClass<Omit<PickerProps<DateType> & {
|
|
100
|
-
presets?:
|
|
107
|
+
presets?: PresetDate<DateType>[] | undefined;
|
|
101
108
|
}, "picker">, unknown>;
|
|
102
109
|
YearPicker: import('./interface').PickerComponentClass<Omit<PickerProps<DateType> & {
|
|
103
|
-
presets?:
|
|
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
|
|
3
|
-
import { Modal as
|
|
4
|
-
import { Close as
|
|
5
|
-
import { CheckCircleF as
|
|
6
|
-
import { WarningCircleF as
|
|
7
|
-
import { CloseCircleF as
|
|
8
|
-
import
|
|
9
|
-
import { Button as
|
|
10
|
-
import { UUID as
|
|
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
|
|
12
|
+
import { $prefixCls as I } from "../../GlobalContext/constant.js";
|
|
13
13
|
import './index.css';/* empty css */
|
|
14
|
-
import { getConfirmLocale as
|
|
15
|
-
const
|
|
16
|
-
success: /* @__PURE__ */ n.jsx(
|
|
17
|
-
warn: /* @__PURE__ */ n.jsx(
|
|
18
|
-
warning: /* @__PURE__ */ n.jsx(
|
|
19
|
-
error: /* @__PURE__ */ n.jsx(
|
|
20
|
-
info: /* @__PURE__ */ n.jsx(
|
|
21
|
-
},
|
|
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:
|
|
24
|
+
title: s,
|
|
25
25
|
content: t,
|
|
26
|
-
icon:
|
|
26
|
+
icon: r,
|
|
27
27
|
okText: l,
|
|
28
28
|
cancelText: i,
|
|
29
29
|
onOk: N,
|
|
30
|
-
onCancel:
|
|
31
|
-
className:
|
|
32
|
-
showCancel:
|
|
33
|
-
closable:
|
|
34
|
-
okButtonProps:
|
|
35
|
-
cancelButtonProps:
|
|
36
|
-
resolveFn:
|
|
37
|
-
callback:
|
|
38
|
-
destroy:
|
|
39
|
-
actions:
|
|
40
|
-
showActions:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
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:
|
|
53
|
-
...
|
|
56
|
+
onClick: a,
|
|
57
|
+
...g,
|
|
54
58
|
children: i
|
|
55
59
|
}
|
|
56
60
|
),
|
|
57
61
|
/* @__PURE__ */ n.jsx(
|
|
58
|
-
|
|
62
|
+
u,
|
|
59
63
|
{
|
|
60
64
|
variant: "contained",
|
|
61
65
|
size: "small",
|
|
62
|
-
onClick:
|
|
63
|
-
...
|
|
66
|
+
onClick: k,
|
|
67
|
+
...T,
|
|
64
68
|
children: l
|
|
65
69
|
}
|
|
66
70
|
)
|
|
67
71
|
] }) : null;
|
|
68
72
|
return /* @__PURE__ */ n.jsx(
|
|
69
|
-
|
|
73
|
+
P,
|
|
70
74
|
{
|
|
71
75
|
bodyStyle: { minHeight: "auto" },
|
|
72
|
-
...
|
|
73
|
-
|
|
74
|
-
|
|
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:
|
|
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
|
-
|
|
83
|
-
|
|
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:
|
|
89
|
-
children: /* @__PURE__ */ n.jsx(
|
|
94
|
+
onClick: a,
|
|
95
|
+
children: /* @__PURE__ */ n.jsx(z, {})
|
|
90
96
|
}
|
|
91
97
|
),
|
|
92
|
-
/* @__PURE__ */ n.jsx("span", { className:
|
|
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
|
-
|
|
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
|
-
|
|
103
|
+
M()
|
|
98
104
|
] }) })
|
|
99
105
|
}
|
|
100
106
|
);
|
|
101
|
-
}, c = /* @__PURE__ */ new Map(),
|
|
102
|
-
const t = document.createElement("div"),
|
|
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
|
-
|
|
111
|
+
v.unmountComponentAtNode(t) && t.parentNode && t.parentNode.removeChild(t), c.delete(r);
|
|
106
112
|
};
|
|
107
|
-
c.set(
|
|
108
|
-
const i =
|
|
109
|
-
|
|
113
|
+
c.set(r, l), setTimeout(() => {
|
|
114
|
+
const i = L();
|
|
115
|
+
v.render(
|
|
110
116
|
/* @__PURE__ */ n.jsx(
|
|
111
|
-
|
|
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:
|
|
124
|
+
callback: s,
|
|
119
125
|
destroy: l
|
|
120
126
|
}
|
|
121
127
|
),
|
|
122
128
|
t
|
|
123
129
|
);
|
|
124
130
|
});
|
|
125
|
-
},
|
|
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((
|
|
128
|
-
|
|
133
|
+
return typeof e == "string" ? t.content = e : t = { ...e, type: o }, new Promise((r) => {
|
|
134
|
+
S(t, r, s);
|
|
129
135
|
});
|
|
130
|
-
},
|
|
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
|
-
},
|
|
140
|
-
info: (e, o) =>
|
|
141
|
-
warn: (e, o) =>
|
|
142
|
-
error: (e, o) =>
|
|
143
|
-
success: (e, o) =>
|
|
144
|
-
destroyAll:
|
|
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
|
-
|
|
153
|
+
re as Confirm
|
|
148
154
|
};
|
|
149
155
|
//# sourceMappingURL=index.js.map
|
package/es/Modal/index.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
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
|