@rc-component/dialog 1.0.0 → 1.1.0
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/dist/10509781610555453368.hot-update-url-map.json +1 -0
- package/dist/10509781610555453368.hot-update.json +1 -0
- package/dist/11977476592833392720.hot-update-url-map.json +1 -0
- package/dist/11977476592833392720.hot-update.json +1 -0
- package/dist/14397576132152343869.hot-update-url-map.json +1 -0
- package/dist/14397576132152343869.hot-update.json +1 -0
- package/dist/14597408625395534096.hot-update-url-map.json +1 -0
- package/dist/14597408625395534096.hot-update.json +1 -0
- package/dist/15104553912779929595.hot-update-url-map.json +1 -0
- package/dist/15104553912779929595.hot-update.json +1 -0
- package/dist/4361192314875393955.hot-update-url-map.json +1 -0
- package/dist/4361192314875393955.hot-update.json +1 -0
- package/dist/4704580574928883170.hot-update-url-map.json +1 -0
- package/dist/4704580574928883170.hot-update.json +1 -0
- package/dist/5496443382647786649.hot-update-url-map.json +1 -0
- package/dist/5496443382647786649.hot-update.json +1 -0
- package/dist/7338948553039754745.hot-update-url-map.json +1 -0
- package/dist/7338948553039754745.hot-update.json +1 -0
- package/dist/7441995189917427860.hot-update-url-map.json +1 -0
- package/dist/7441995189917427860.hot-update.json +1 -0
- package/dist/8425845753817463333.hot-update-url-map.json +1 -0
- package/dist/8425845753817463333.hot-update.json +1 -0
- package/dist/8742625841545363477.hot-update-url-map.json +1 -0
- package/dist/8742625841545363477.hot-update.json +1 -0
- package/dist/960384830459946830.hot-update-url-map.json +1 -0
- package/dist/960384830459946830.hot-update.json +1 -0
- package/dist/9707589364653732454.hot-update-url-map.json +1 -0
- package/dist/9707589364653732454.hot-update.json +1 -0
- package/dist/common-async.10509781610555453368.hot-update.js +268 -0
- package/dist/common-async.10509781610555453368.hot-update.js.map +1 -0
- package/dist/common-async.11977476592833392720.hot-update.js +395 -0
- package/dist/common-async.11977476592833392720.hot-update.js.map +1 -0
- package/dist/common-async.14397576132152343869.hot-update.js +395 -0
- package/dist/common-async.14397576132152343869.hot-update.js.map +1 -0
- package/dist/common-async.14597408625395534096.hot-update.js +268 -0
- package/dist/common-async.14597408625395534096.hot-update.js.map +1 -0
- package/dist/common-async.15104553912779929595.hot-update.js +268 -0
- package/dist/common-async.15104553912779929595.hot-update.js.map +1 -0
- package/dist/common-async.4361192314875393955.hot-update.js +268 -0
- package/dist/common-async.4361192314875393955.hot-update.js.map +1 -0
- package/dist/common-async.4704580574928883170.hot-update.js +268 -0
- package/dist/common-async.4704580574928883170.hot-update.js.map +1 -0
- package/dist/common-async.5496443382647786649.hot-update.js +391 -0
- package/dist/common-async.5496443382647786649.hot-update.js.map +1 -0
- package/dist/common-async.7338948553039754745.hot-update.js +395 -0
- package/dist/common-async.7338948553039754745.hot-update.js.map +1 -0
- package/dist/common-async.7441995189917427860.hot-update.js +394 -0
- package/dist/common-async.7441995189917427860.hot-update.js.map +1 -0
- package/dist/common-async.8425845753817463333.hot-update.js +268 -0
- package/dist/common-async.8425845753817463333.hot-update.js.map +1 -0
- package/dist/common-async.8742625841545363477.hot-update.js +268 -0
- package/dist/common-async.8742625841545363477.hot-update.js.map +1 -0
- package/dist/common-async.960384830459946830.hot-update.js +268 -0
- package/dist/common-async.960384830459946830.hot-update.js.map +1 -0
- package/dist/common-async.9707589364653732454.hot-update.js +268 -0
- package/dist/common-async.9707589364653732454.hot-update.js.map +1 -0
- package/dist/common-async.js +1180 -0
- package/dist/common-async.js.map +1 -0
- package/dist/demos-async.7338948553039754745.hot-update.js +395 -0
- package/dist/demos-async.7338948553039754745.hot-update.js.map +1 -0
- package/dist/demos-async.css +396 -0
- package/dist/demos-async.css.map +1 -0
- package/dist/demos-async.js +1242 -0
- package/dist/demos-async.js.map +1 -0
- package/dist/docs_changelog_md-async.js +2159 -0
- package/dist/docs_changelog_md-async.js.map +1 -0
- package/dist/docs_demo_ant-design_md-async.js +119 -0
- package/dist/docs_demo_ant-design_md-async.js.map +1 -0
- package/dist/docs_demo_bootstrap_md-async.js +119 -0
- package/dist/docs_demo_bootstrap_md-async.js.map +1 -0
- package/dist/docs_demo_draggable_md-async.js +119 -0
- package/dist/docs_demo_draggable_md-async.js.map +1 -0
- package/dist/docs_demo_multiple-Portal_md-async.js +119 -0
- package/dist/docs_demo_multiple-Portal_md-async.js.map +1 -0
- package/dist/docs_demo_pure_md-async.js +119 -0
- package/dist/docs_demo_pure_md-async.js.map +1 -0
- package/dist/docs_index_md-async.js +1717 -0
- package/dist/docs_index_md-async.js.map +1 -0
- package/dist/dumi__tmp__dumi__theme__ContextWrapper-async.js +201 -0
- package/dist/dumi__tmp__dumi__theme__ContextWrapper-async.js.map +1 -0
- package/dist/meta__docs-async.7338948553039754745.hot-update.js +395 -0
- package/dist/meta__docs-async.7338948553039754745.hot-update.js.map +1 -0
- package/dist/meta__docs-async.css +396 -0
- package/dist/meta__docs-async.css.map +1 -0
- package/dist/meta__docs-async.js +2391 -0
- package/dist/meta__docs-async.js.map +1 -0
- package/dist/nm__dumi__dist__client__pages__404-async.js +69 -0
- package/dist/nm__dumi__dist__client__pages__404-async.js.map +1 -0
- package/dist/nm__dumi__dist__client__pages__Demo__index-async.js +63 -0
- package/dist/nm__dumi__dist__client__pages__Demo__index-async.js.map +1 -0
- package/dist/node_modules__dumi_2_4_17_dumi_dist_client_misc_reactDemoCompiler_js-async.js +368 -0
- package/dist/node_modules__dumi_2_4_17_dumi_dist_client_misc_reactDemoCompiler_js-async.js.map +1 -0
- package/dist/node_modules__dumi_2_4_17_dumi_theme-default_layouts_DocLayout_index_js-async.js +1077 -0
- package/dist/node_modules__dumi_2_4_17_dumi_theme-default_layouts_DocLayout_index_js-async.js.map +1 -0
- package/dist/node_modules__react-dom_18_3_1_react-dom_server_browser_js-async.js +18 -0
- package/dist/node_modules__react-dom_18_3_1_react-dom_server_browser_js-async.js.map +1 -0
- package/dist/umi.css +1302 -0
- package/dist/umi.css.map +1 -0
- package/dist/umi.js +80442 -0
- package/dist/umi.js.map +1 -0
- package/dist/vendors-async.css +22545 -0
- package/dist/vendors-async.css.map +1 -0
- package/dist/vendors-async.js +53289 -0
- package/dist/vendors-async.js.map +1 -0
- package/es/Dialog/Content/MemoChildren.js +5 -7
- package/es/Dialog/Content/Panel.d.ts +2 -2
- package/es/Dialog/Content/Panel.js +89 -78
- package/es/Dialog/Content/index.d.ts +4 -1
- package/es/Dialog/Content/index.js +45 -37
- package/es/Dialog/Mask.js +23 -20
- package/es/Dialog/index.js +97 -93
- package/es/DialogWrap.js +17 -22
- package/es/IDialogPropTypes.d.ts +2 -1
- package/es/context.js +1 -1
- package/es/util.js +9 -9
- package/lib/Dialog/Content/MemoChildren.js +7 -10
- package/lib/Dialog/Content/Panel.d.ts +2 -2
- package/lib/Dialog/Content/Panel.js +93 -83
- package/lib/Dialog/Content/index.d.ts +4 -1
- package/lib/Dialog/Content/index.js +49 -42
- package/lib/Dialog/Mask.js +27 -25
- package/lib/Dialog/index.js +103 -100
- package/lib/DialogWrap.js +21 -27
- package/lib/IDialogPropTypes.d.ts +2 -1
- package/lib/context.js +3 -4
- package/lib/index.js +2 -2
- package/lib/util.js +9 -9
- package/package.json +11 -16
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export default /*#__PURE__*/React.memo(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return !shouldUpdate;
|
|
8
|
-
});
|
|
2
|
+
export default /*#__PURE__*/React.memo(({
|
|
3
|
+
children
|
|
4
|
+
}) => children, (_, {
|
|
5
|
+
shouldUpdate
|
|
6
|
+
}) => !shouldUpdate);
|
|
@@ -7,9 +7,9 @@ export interface PanelProps extends Omit<IDialogPropTypes, 'getOpenCount'> {
|
|
|
7
7
|
onMouseUp?: React.MouseEventHandler;
|
|
8
8
|
holderRef?: React.Ref<HTMLDivElement>;
|
|
9
9
|
}
|
|
10
|
-
export type
|
|
10
|
+
export type PanelRef = {
|
|
11
11
|
focus: () => void;
|
|
12
12
|
changeActive: (next: boolean) => void;
|
|
13
13
|
};
|
|
14
|
-
declare const Panel: React.ForwardRefExoticComponent<PanelProps & React.RefAttributes<
|
|
14
|
+
declare const Panel: React.ForwardRefExoticComponent<PanelProps & React.RefAttributes<PanelRef>>;
|
|
15
15
|
export default Panel;
|
|
@@ -1,77 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
3
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
2
|
import classNames from 'classnames';
|
|
5
|
-
import { useComposeRef } from "rc-util/es/ref";
|
|
3
|
+
import { useComposeRef } from "@rc-component/util/es/ref";
|
|
6
4
|
import React, { useMemo, useRef } from 'react';
|
|
7
5
|
import { RefContext } from "../../context";
|
|
8
6
|
import MemoChildren from "./MemoChildren";
|
|
9
|
-
import pickAttrs from "rc-util/es/pickAttrs";
|
|
10
|
-
|
|
7
|
+
import pickAttrs from "@rc-component/util/es/pickAttrs";
|
|
8
|
+
const sentinelStyle = {
|
|
11
9
|
width: 0,
|
|
12
10
|
height: 0,
|
|
13
11
|
overflow: 'hidden',
|
|
14
12
|
outline: 'none'
|
|
15
13
|
};
|
|
16
|
-
|
|
14
|
+
const entityStyle = {
|
|
17
15
|
outline: 'none'
|
|
18
16
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
17
|
+
const Panel = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
18
|
+
const {
|
|
19
|
+
prefixCls,
|
|
20
|
+
className,
|
|
21
|
+
style,
|
|
22
|
+
title,
|
|
23
|
+
ariaId,
|
|
24
|
+
footer,
|
|
25
|
+
closable,
|
|
26
|
+
closeIcon,
|
|
27
|
+
onClose,
|
|
28
|
+
children,
|
|
29
|
+
bodyStyle,
|
|
30
|
+
bodyProps,
|
|
31
|
+
modalRender,
|
|
32
|
+
onMouseDown,
|
|
33
|
+
onMouseUp,
|
|
34
|
+
holderRef,
|
|
35
|
+
visible,
|
|
36
|
+
forceRender,
|
|
37
|
+
width,
|
|
38
|
+
height,
|
|
39
|
+
classNames: modalClassNames,
|
|
40
|
+
styles: modalStyles
|
|
41
|
+
} = props;
|
|
42
42
|
|
|
43
43
|
// ================================= Refs =================================
|
|
44
|
-
|
|
45
|
-
panelRef
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
const {
|
|
45
|
+
panel: panelRef
|
|
46
|
+
} = React.useContext(RefContext);
|
|
47
|
+
const mergedRef = useComposeRef(holderRef, panelRef);
|
|
48
|
+
const sentinelStartRef = useRef();
|
|
49
|
+
const sentinelEndRef = useRef();
|
|
50
|
+
React.useImperativeHandle(ref, () => ({
|
|
51
|
+
focus: () => {
|
|
52
|
+
sentinelStartRef.current?.focus({
|
|
53
|
+
preventScroll: true
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
changeActive: next => {
|
|
57
|
+
const {
|
|
58
|
+
activeElement
|
|
59
|
+
} = document;
|
|
60
|
+
if (next && activeElement === sentinelEndRef.current) {
|
|
61
|
+
sentinelStartRef.current.focus({
|
|
62
|
+
preventScroll: true
|
|
63
|
+
});
|
|
64
|
+
} else if (!next && activeElement === sentinelStartRef.current) {
|
|
65
|
+
sentinelEndRef.current.focus({
|
|
54
66
|
preventScroll: true
|
|
55
67
|
});
|
|
56
|
-
},
|
|
57
|
-
changeActive: function changeActive(next) {
|
|
58
|
-
var _document = document,
|
|
59
|
-
activeElement = _document.activeElement;
|
|
60
|
-
if (next && activeElement === sentinelEndRef.current) {
|
|
61
|
-
sentinelStartRef.current.focus({
|
|
62
|
-
preventScroll: true
|
|
63
|
-
});
|
|
64
|
-
} else if (!next && activeElement === sentinelStartRef.current) {
|
|
65
|
-
sentinelEndRef.current.focus({
|
|
66
|
-
preventScroll: true
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
68
|
}
|
|
70
|
-
}
|
|
71
|
-
});
|
|
69
|
+
}
|
|
70
|
+
}));
|
|
72
71
|
|
|
73
72
|
// ================================ Style =================================
|
|
74
|
-
|
|
73
|
+
const contentStyle = {};
|
|
75
74
|
if (width !== undefined) {
|
|
76
75
|
contentStyle.width = width;
|
|
77
76
|
}
|
|
@@ -79,47 +78,56 @@ var Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
79
78
|
contentStyle.height = height;
|
|
80
79
|
}
|
|
81
80
|
// ================================ Render ================================
|
|
82
|
-
|
|
83
|
-
className: classNames(
|
|
84
|
-
style:
|
|
81
|
+
const footerNode = footer ? /*#__PURE__*/React.createElement("div", {
|
|
82
|
+
className: classNames(`${prefixCls}-footer`, modalClassNames?.footer),
|
|
83
|
+
style: {
|
|
84
|
+
...modalStyles?.footer
|
|
85
|
+
}
|
|
85
86
|
}, footer) : null;
|
|
86
|
-
|
|
87
|
-
className: classNames(
|
|
88
|
-
style:
|
|
87
|
+
const headerNode = title ? /*#__PURE__*/React.createElement("div", {
|
|
88
|
+
className: classNames(`${prefixCls}-header`, modalClassNames?.header),
|
|
89
|
+
style: {
|
|
90
|
+
...modalStyles?.header
|
|
91
|
+
}
|
|
89
92
|
}, /*#__PURE__*/React.createElement("div", {
|
|
90
|
-
className: classNames(
|
|
93
|
+
className: classNames(`${prefixCls}-title`, modalClassNames?.title),
|
|
91
94
|
id: ariaId,
|
|
92
|
-
style:
|
|
95
|
+
style: {
|
|
96
|
+
...modalStyles?.title
|
|
97
|
+
}
|
|
93
98
|
}, title)) : null;
|
|
94
|
-
|
|
95
|
-
if (
|
|
99
|
+
const closableObj = useMemo(() => {
|
|
100
|
+
if (typeof closable === 'object' && closable !== null) {
|
|
96
101
|
return closable;
|
|
97
102
|
}
|
|
98
103
|
if (closable) {
|
|
99
104
|
return {
|
|
100
|
-
closeIcon: closeIcon
|
|
101
|
-
className:
|
|
105
|
+
closeIcon: closeIcon ?? /*#__PURE__*/React.createElement("span", {
|
|
106
|
+
className: `${prefixCls}-close-x`
|
|
102
107
|
})
|
|
103
108
|
};
|
|
104
109
|
}
|
|
105
110
|
return {};
|
|
106
111
|
}, [closable, closeIcon, prefixCls]);
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
112
|
+
const ariaProps = pickAttrs(closableObj, true);
|
|
113
|
+
const closeBtnIsDisabled = typeof closable === 'object' && closable.disabled;
|
|
114
|
+
const closerNode = closable ? /*#__PURE__*/React.createElement("button", _extends({
|
|
110
115
|
type: "button",
|
|
111
116
|
onClick: onClose,
|
|
112
117
|
"aria-label": "Close"
|
|
113
118
|
}, ariaProps, {
|
|
114
|
-
className:
|
|
119
|
+
className: `${prefixCls}-close`,
|
|
115
120
|
disabled: closeBtnIsDisabled
|
|
116
121
|
}), closableObj.closeIcon) : null;
|
|
117
|
-
|
|
118
|
-
className: classNames(
|
|
119
|
-
style: modalStyles
|
|
122
|
+
const content = /*#__PURE__*/React.createElement("div", {
|
|
123
|
+
className: classNames(`${prefixCls}-section`, modalClassNames?.section),
|
|
124
|
+
style: modalStyles?.section
|
|
120
125
|
}, closerNode, headerNode, /*#__PURE__*/React.createElement("div", _extends({
|
|
121
|
-
className: classNames(
|
|
122
|
-
style:
|
|
126
|
+
className: classNames(`${prefixCls}-body`, modalClassNames?.body),
|
|
127
|
+
style: {
|
|
128
|
+
...bodyStyle,
|
|
129
|
+
...modalStyles?.body
|
|
130
|
+
}
|
|
123
131
|
}, bodyProps), children), footerNode);
|
|
124
132
|
return /*#__PURE__*/React.createElement("div", {
|
|
125
133
|
key: "dialog-element",
|
|
@@ -127,7 +135,10 @@ var Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
127
135
|
"aria-labelledby": title ? ariaId : null,
|
|
128
136
|
"aria-modal": "true",
|
|
129
137
|
ref: mergedRef,
|
|
130
|
-
style:
|
|
138
|
+
style: {
|
|
139
|
+
...style,
|
|
140
|
+
...contentStyle
|
|
141
|
+
},
|
|
131
142
|
className: classNames(prefixCls, className),
|
|
132
143
|
onMouseDown: onMouseDown,
|
|
133
144
|
onMouseUp: onMouseUp
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { PanelProps,
|
|
2
|
+
import type { PanelProps, PanelRef } from './Panel';
|
|
3
|
+
import type { CSSMotionRef } from '@rc-component/motion/es/CSSMotion';
|
|
4
|
+
export type CSSMotionStateRef = Pick<CSSMotionRef, 'inMotion' | 'enableMotion'>;
|
|
5
|
+
export type ContentRef = PanelRef & CSSMotionStateRef;
|
|
3
6
|
export type ContentProps = {
|
|
4
7
|
motionName: string;
|
|
5
8
|
ariaId: string;
|
|
@@ -1,38 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
2
|
import * as React from 'react';
|
|
5
3
|
import { useRef } from 'react';
|
|
6
4
|
import classNames from 'classnames';
|
|
7
|
-
import CSSMotion from 'rc-motion';
|
|
5
|
+
import CSSMotion from '@rc-component/motion';
|
|
8
6
|
import { offset } from "../../util";
|
|
9
7
|
import Panel from "./Panel";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
const Content = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
9
|
+
const {
|
|
10
|
+
prefixCls,
|
|
11
|
+
title,
|
|
12
|
+
style,
|
|
13
|
+
className,
|
|
14
|
+
visible,
|
|
15
|
+
forceRender,
|
|
16
|
+
destroyOnClose,
|
|
17
|
+
motionName,
|
|
18
|
+
ariaId,
|
|
19
|
+
onVisibleChanged,
|
|
20
|
+
mousePosition
|
|
21
|
+
} = props;
|
|
22
|
+
const dialogRef = useRef();
|
|
23
|
+
const panelRef = useRef();
|
|
24
|
+
|
|
25
|
+
// ============================== Refs ==============================
|
|
26
|
+
React.useImperativeHandle(ref, () => ({
|
|
27
|
+
...panelRef.current,
|
|
28
|
+
inMotion: dialogRef.current.inMotion,
|
|
29
|
+
enableMotion: dialogRef.current.enableMotion
|
|
30
|
+
}));
|
|
23
31
|
|
|
24
32
|
// ============================= Style ==============================
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
transformOrigin = _React$useState2[0],
|
|
28
|
-
setTransformOrigin = _React$useState2[1];
|
|
29
|
-
var contentStyle = {};
|
|
33
|
+
const [transformOrigin, setTransformOrigin] = React.useState();
|
|
34
|
+
const contentStyle = {};
|
|
30
35
|
if (transformOrigin) {
|
|
31
36
|
contentStyle.transformOrigin = transformOrigin;
|
|
32
37
|
}
|
|
33
38
|
function onPrepare() {
|
|
34
|
-
|
|
35
|
-
setTransformOrigin(mousePosition && (mousePosition.x || mousePosition.y) ?
|
|
39
|
+
const elementOffset = offset(dialogRef.current.nativeElement);
|
|
40
|
+
setTransformOrigin(mousePosition && (mousePosition.x || mousePosition.y) ? `${mousePosition.x - elementOffset.left}px ${mousePosition.y - elementOffset.top}px` : '');
|
|
36
41
|
}
|
|
37
42
|
|
|
38
43
|
// ============================= Render =============================
|
|
@@ -45,19 +50,22 @@ var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
45
50
|
motionName: motionName,
|
|
46
51
|
removeOnLeave: destroyOnClose,
|
|
47
52
|
ref: dialogRef
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
}, ({
|
|
54
|
+
className: motionClassName,
|
|
55
|
+
style: motionStyle
|
|
56
|
+
}, motionRef) => /*#__PURE__*/React.createElement(Panel, _extends({}, props, {
|
|
57
|
+
ref: panelRef,
|
|
58
|
+
title: title,
|
|
59
|
+
ariaId: ariaId,
|
|
60
|
+
prefixCls: prefixCls,
|
|
61
|
+
holderRef: motionRef,
|
|
62
|
+
style: {
|
|
63
|
+
...motionStyle,
|
|
64
|
+
...style,
|
|
65
|
+
...contentStyle
|
|
66
|
+
},
|
|
67
|
+
className: classNames(className, motionClassName)
|
|
68
|
+
})));
|
|
61
69
|
});
|
|
62
70
|
Content.displayName = 'Content';
|
|
63
71
|
export default Content;
|
package/es/Dialog/Mask.js
CHANGED
|
@@ -1,28 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
2
|
import * as React from 'react';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
|
-
import CSSMotion from 'rc-motion';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
import CSSMotion from '@rc-component/motion';
|
|
5
|
+
const Mask = props => {
|
|
6
|
+
const {
|
|
7
|
+
prefixCls,
|
|
8
|
+
style,
|
|
9
|
+
visible,
|
|
10
|
+
maskProps,
|
|
11
|
+
motionName,
|
|
12
|
+
className
|
|
13
|
+
} = props;
|
|
13
14
|
return /*#__PURE__*/React.createElement(CSSMotion, {
|
|
14
15
|
key: "mask",
|
|
15
16
|
visible: visible,
|
|
16
17
|
motionName: motionName,
|
|
17
|
-
leavedClassName:
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
leavedClassName: `${prefixCls}-mask-hidden`
|
|
19
|
+
}, ({
|
|
20
|
+
className: motionClassName,
|
|
21
|
+
style: motionStyle
|
|
22
|
+
}, ref) => /*#__PURE__*/React.createElement("div", _extends({
|
|
23
|
+
ref: ref,
|
|
24
|
+
style: {
|
|
25
|
+
...motionStyle,
|
|
26
|
+
...style
|
|
27
|
+
},
|
|
28
|
+
className: classNames(`${prefixCls}-mask`, motionClassName, className)
|
|
29
|
+
}, maskProps)));
|
|
27
30
|
};
|
|
28
31
|
export default Mask;
|