@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.
Files changed (128) hide show
  1. package/dist/10509781610555453368.hot-update-url-map.json +1 -0
  2. package/dist/10509781610555453368.hot-update.json +1 -0
  3. package/dist/11977476592833392720.hot-update-url-map.json +1 -0
  4. package/dist/11977476592833392720.hot-update.json +1 -0
  5. package/dist/14397576132152343869.hot-update-url-map.json +1 -0
  6. package/dist/14397576132152343869.hot-update.json +1 -0
  7. package/dist/14597408625395534096.hot-update-url-map.json +1 -0
  8. package/dist/14597408625395534096.hot-update.json +1 -0
  9. package/dist/15104553912779929595.hot-update-url-map.json +1 -0
  10. package/dist/15104553912779929595.hot-update.json +1 -0
  11. package/dist/4361192314875393955.hot-update-url-map.json +1 -0
  12. package/dist/4361192314875393955.hot-update.json +1 -0
  13. package/dist/4704580574928883170.hot-update-url-map.json +1 -0
  14. package/dist/4704580574928883170.hot-update.json +1 -0
  15. package/dist/5496443382647786649.hot-update-url-map.json +1 -0
  16. package/dist/5496443382647786649.hot-update.json +1 -0
  17. package/dist/7338948553039754745.hot-update-url-map.json +1 -0
  18. package/dist/7338948553039754745.hot-update.json +1 -0
  19. package/dist/7441995189917427860.hot-update-url-map.json +1 -0
  20. package/dist/7441995189917427860.hot-update.json +1 -0
  21. package/dist/8425845753817463333.hot-update-url-map.json +1 -0
  22. package/dist/8425845753817463333.hot-update.json +1 -0
  23. package/dist/8742625841545363477.hot-update-url-map.json +1 -0
  24. package/dist/8742625841545363477.hot-update.json +1 -0
  25. package/dist/960384830459946830.hot-update-url-map.json +1 -0
  26. package/dist/960384830459946830.hot-update.json +1 -0
  27. package/dist/9707589364653732454.hot-update-url-map.json +1 -0
  28. package/dist/9707589364653732454.hot-update.json +1 -0
  29. package/dist/common-async.10509781610555453368.hot-update.js +268 -0
  30. package/dist/common-async.10509781610555453368.hot-update.js.map +1 -0
  31. package/dist/common-async.11977476592833392720.hot-update.js +395 -0
  32. package/dist/common-async.11977476592833392720.hot-update.js.map +1 -0
  33. package/dist/common-async.14397576132152343869.hot-update.js +395 -0
  34. package/dist/common-async.14397576132152343869.hot-update.js.map +1 -0
  35. package/dist/common-async.14597408625395534096.hot-update.js +268 -0
  36. package/dist/common-async.14597408625395534096.hot-update.js.map +1 -0
  37. package/dist/common-async.15104553912779929595.hot-update.js +268 -0
  38. package/dist/common-async.15104553912779929595.hot-update.js.map +1 -0
  39. package/dist/common-async.4361192314875393955.hot-update.js +268 -0
  40. package/dist/common-async.4361192314875393955.hot-update.js.map +1 -0
  41. package/dist/common-async.4704580574928883170.hot-update.js +268 -0
  42. package/dist/common-async.4704580574928883170.hot-update.js.map +1 -0
  43. package/dist/common-async.5496443382647786649.hot-update.js +391 -0
  44. package/dist/common-async.5496443382647786649.hot-update.js.map +1 -0
  45. package/dist/common-async.7338948553039754745.hot-update.js +395 -0
  46. package/dist/common-async.7338948553039754745.hot-update.js.map +1 -0
  47. package/dist/common-async.7441995189917427860.hot-update.js +394 -0
  48. package/dist/common-async.7441995189917427860.hot-update.js.map +1 -0
  49. package/dist/common-async.8425845753817463333.hot-update.js +268 -0
  50. package/dist/common-async.8425845753817463333.hot-update.js.map +1 -0
  51. package/dist/common-async.8742625841545363477.hot-update.js +268 -0
  52. package/dist/common-async.8742625841545363477.hot-update.js.map +1 -0
  53. package/dist/common-async.960384830459946830.hot-update.js +268 -0
  54. package/dist/common-async.960384830459946830.hot-update.js.map +1 -0
  55. package/dist/common-async.9707589364653732454.hot-update.js +268 -0
  56. package/dist/common-async.9707589364653732454.hot-update.js.map +1 -0
  57. package/dist/common-async.js +1180 -0
  58. package/dist/common-async.js.map +1 -0
  59. package/dist/demos-async.7338948553039754745.hot-update.js +395 -0
  60. package/dist/demos-async.7338948553039754745.hot-update.js.map +1 -0
  61. package/dist/demos-async.css +396 -0
  62. package/dist/demos-async.css.map +1 -0
  63. package/dist/demos-async.js +1242 -0
  64. package/dist/demos-async.js.map +1 -0
  65. package/dist/docs_changelog_md-async.js +2159 -0
  66. package/dist/docs_changelog_md-async.js.map +1 -0
  67. package/dist/docs_demo_ant-design_md-async.js +119 -0
  68. package/dist/docs_demo_ant-design_md-async.js.map +1 -0
  69. package/dist/docs_demo_bootstrap_md-async.js +119 -0
  70. package/dist/docs_demo_bootstrap_md-async.js.map +1 -0
  71. package/dist/docs_demo_draggable_md-async.js +119 -0
  72. package/dist/docs_demo_draggable_md-async.js.map +1 -0
  73. package/dist/docs_demo_multiple-Portal_md-async.js +119 -0
  74. package/dist/docs_demo_multiple-Portal_md-async.js.map +1 -0
  75. package/dist/docs_demo_pure_md-async.js +119 -0
  76. package/dist/docs_demo_pure_md-async.js.map +1 -0
  77. package/dist/docs_index_md-async.js +1717 -0
  78. package/dist/docs_index_md-async.js.map +1 -0
  79. package/dist/dumi__tmp__dumi__theme__ContextWrapper-async.js +201 -0
  80. package/dist/dumi__tmp__dumi__theme__ContextWrapper-async.js.map +1 -0
  81. package/dist/meta__docs-async.7338948553039754745.hot-update.js +395 -0
  82. package/dist/meta__docs-async.7338948553039754745.hot-update.js.map +1 -0
  83. package/dist/meta__docs-async.css +396 -0
  84. package/dist/meta__docs-async.css.map +1 -0
  85. package/dist/meta__docs-async.js +2391 -0
  86. package/dist/meta__docs-async.js.map +1 -0
  87. package/dist/nm__dumi__dist__client__pages__404-async.js +69 -0
  88. package/dist/nm__dumi__dist__client__pages__404-async.js.map +1 -0
  89. package/dist/nm__dumi__dist__client__pages__Demo__index-async.js +63 -0
  90. package/dist/nm__dumi__dist__client__pages__Demo__index-async.js.map +1 -0
  91. package/dist/node_modules__dumi_2_4_17_dumi_dist_client_misc_reactDemoCompiler_js-async.js +368 -0
  92. package/dist/node_modules__dumi_2_4_17_dumi_dist_client_misc_reactDemoCompiler_js-async.js.map +1 -0
  93. package/dist/node_modules__dumi_2_4_17_dumi_theme-default_layouts_DocLayout_index_js-async.js +1077 -0
  94. package/dist/node_modules__dumi_2_4_17_dumi_theme-default_layouts_DocLayout_index_js-async.js.map +1 -0
  95. package/dist/node_modules__react-dom_18_3_1_react-dom_server_browser_js-async.js +18 -0
  96. package/dist/node_modules__react-dom_18_3_1_react-dom_server_browser_js-async.js.map +1 -0
  97. package/dist/umi.css +1302 -0
  98. package/dist/umi.css.map +1 -0
  99. package/dist/umi.js +80442 -0
  100. package/dist/umi.js.map +1 -0
  101. package/dist/vendors-async.css +22545 -0
  102. package/dist/vendors-async.css.map +1 -0
  103. package/dist/vendors-async.js +53289 -0
  104. package/dist/vendors-async.js.map +1 -0
  105. package/es/Dialog/Content/MemoChildren.js +5 -7
  106. package/es/Dialog/Content/Panel.d.ts +2 -2
  107. package/es/Dialog/Content/Panel.js +89 -78
  108. package/es/Dialog/Content/index.d.ts +4 -1
  109. package/es/Dialog/Content/index.js +45 -37
  110. package/es/Dialog/Mask.js +23 -20
  111. package/es/Dialog/index.js +97 -93
  112. package/es/DialogWrap.js +17 -22
  113. package/es/IDialogPropTypes.d.ts +2 -1
  114. package/es/context.js +1 -1
  115. package/es/util.js +9 -9
  116. package/lib/Dialog/Content/MemoChildren.js +7 -10
  117. package/lib/Dialog/Content/Panel.d.ts +2 -2
  118. package/lib/Dialog/Content/Panel.js +93 -83
  119. package/lib/Dialog/Content/index.d.ts +4 -1
  120. package/lib/Dialog/Content/index.js +49 -42
  121. package/lib/Dialog/Mask.js +27 -25
  122. package/lib/Dialog/index.js +103 -100
  123. package/lib/DialogWrap.js +21 -27
  124. package/lib/IDialogPropTypes.d.ts +2 -1
  125. package/lib/context.js +3 -4
  126. package/lib/index.js +2 -2
  127. package/lib/util.js +9 -9
  128. package/package.json +11 -16
@@ -1,8 +1,6 @@
1
1
  import * as React from 'react';
2
- export default /*#__PURE__*/React.memo(function (_ref) {
3
- var children = _ref.children;
4
- return children;
5
- }, function (_, _ref2) {
6
- var shouldUpdate = _ref2.shouldUpdate;
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 ContentRef = {
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<ContentRef>>;
14
+ declare const Panel: React.ForwardRefExoticComponent<PanelProps & React.RefAttributes<PanelRef>>;
15
15
  export default Panel;
@@ -1,77 +1,76 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
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
- var sentinelStyle = {
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
- var entityStyle = {
14
+ const entityStyle = {
17
15
  outline: 'none'
18
16
  };
19
- var Panel = /*#__PURE__*/React.forwardRef(function (props, ref) {
20
- var prefixCls = props.prefixCls,
21
- className = props.className,
22
- style = props.style,
23
- title = props.title,
24
- ariaId = props.ariaId,
25
- footer = props.footer,
26
- closable = props.closable,
27
- closeIcon = props.closeIcon,
28
- onClose = props.onClose,
29
- children = props.children,
30
- bodyStyle = props.bodyStyle,
31
- bodyProps = props.bodyProps,
32
- modalRender = props.modalRender,
33
- onMouseDown = props.onMouseDown,
34
- onMouseUp = props.onMouseUp,
35
- holderRef = props.holderRef,
36
- visible = props.visible,
37
- forceRender = props.forceRender,
38
- width = props.width,
39
- height = props.height,
40
- modalClassNames = props.classNames,
41
- modalStyles = props.styles;
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
- var _React$useContext = React.useContext(RefContext),
45
- panelRef = _React$useContext.panel;
46
- var mergedRef = useComposeRef(holderRef, panelRef);
47
- var sentinelStartRef = useRef();
48
- var sentinelEndRef = useRef();
49
- React.useImperativeHandle(ref, function () {
50
- return {
51
- focus: function focus() {
52
- var _sentinelStartRef$cur;
53
- (_sentinelStartRef$cur = sentinelStartRef.current) === null || _sentinelStartRef$cur === void 0 || _sentinelStartRef$cur.focus({
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
- var contentStyle = {};
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
- var footerNode = footer ? /*#__PURE__*/React.createElement("div", {
83
- className: classNames("".concat(prefixCls, "-footer"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.footer),
84
- style: _objectSpread({}, modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.footer)
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
- var headerNode = title ? /*#__PURE__*/React.createElement("div", {
87
- className: classNames("".concat(prefixCls, "-header"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.header),
88
- style: _objectSpread({}, modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.header)
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("".concat(prefixCls, "-title"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.title),
93
+ className: classNames(`${prefixCls}-title`, modalClassNames?.title),
91
94
  id: ariaId,
92
- style: _objectSpread({}, modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.title)
95
+ style: {
96
+ ...modalStyles?.title
97
+ }
93
98
  }, title)) : null;
94
- var closableObj = useMemo(function () {
95
- if (_typeof(closable) === 'object' && closable !== null) {
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 !== null && closeIcon !== void 0 ? closeIcon : /*#__PURE__*/React.createElement("span", {
101
- className: "".concat(prefixCls, "-close-x")
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
- var ariaProps = pickAttrs(closableObj, true);
108
- var closeBtnIsDisabled = _typeof(closable) === 'object' && closable.disabled;
109
- var closerNode = closable ? /*#__PURE__*/React.createElement("button", _extends({
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: "".concat(prefixCls, "-close"),
119
+ className: `${prefixCls}-close`,
115
120
  disabled: closeBtnIsDisabled
116
121
  }), closableObj.closeIcon) : null;
117
- var content = /*#__PURE__*/React.createElement("div", {
118
- className: classNames("".concat(prefixCls, "-section"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.section),
119
- style: modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.section
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("".concat(prefixCls, "-body"), modalClassNames === null || modalClassNames === void 0 ? void 0 : modalClassNames.body),
122
- style: _objectSpread(_objectSpread({}, bodyStyle), modalStyles === null || modalStyles === void 0 ? void 0 : modalStyles.body)
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: _objectSpread(_objectSpread({}, style), contentStyle),
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, ContentRef } from './Panel';
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
- import _extends from "@babel/runtime/helpers/esm/extends";
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
- var Content = /*#__PURE__*/React.forwardRef(function (props, ref) {
11
- var prefixCls = props.prefixCls,
12
- title = props.title,
13
- style = props.style,
14
- className = props.className,
15
- visible = props.visible,
16
- forceRender = props.forceRender,
17
- destroyOnClose = props.destroyOnClose,
18
- motionName = props.motionName,
19
- ariaId = props.ariaId,
20
- onVisibleChanged = props.onVisibleChanged,
21
- mousePosition = props.mousePosition;
22
- var dialogRef = useRef();
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
- var _React$useState = React.useState(),
26
- _React$useState2 = _slicedToArray(_React$useState, 2),
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
- var elementOffset = offset(dialogRef.current);
35
- setTransformOrigin(mousePosition && (mousePosition.x || mousePosition.y) ? "".concat(mousePosition.x - elementOffset.left, "px ").concat(mousePosition.y - elementOffset.top, "px") : '');
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
- }, function (_ref, motionRef) {
49
- var motionClassName = _ref.className,
50
- motionStyle = _ref.style;
51
- return /*#__PURE__*/React.createElement(Panel, _extends({}, props, {
52
- ref: ref,
53
- title: title,
54
- ariaId: ariaId,
55
- prefixCls: prefixCls,
56
- holderRef: motionRef,
57
- style: _objectSpread(_objectSpread(_objectSpread({}, motionStyle), style), contentStyle),
58
- className: classNames(className, motionClassName)
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
- import _extends from "@babel/runtime/helpers/esm/extends";
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
- var Mask = function Mask(props) {
7
- var prefixCls = props.prefixCls,
8
- style = props.style,
9
- visible = props.visible,
10
- maskProps = props.maskProps,
11
- motionName = props.motionName,
12
- className = props.className;
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: "".concat(prefixCls, "-mask-hidden")
18
- }, function (_ref, ref) {
19
- var motionClassName = _ref.className,
20
- motionStyle = _ref.style;
21
- return /*#__PURE__*/React.createElement("div", _extends({
22
- ref: ref,
23
- style: _objectSpread(_objectSpread({}, motionStyle), style),
24
- className: classNames("".concat(prefixCls, "-mask"), motionClassName, className)
25
- }, maskProps));
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;