@oceanbase/ui 1.0.0-alpha.10 → 1.0.0-alpha.11

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 (244) hide show
  1. package/dist/ui.min.js +1 -1
  2. package/es/Action/Group.js +1 -0
  3. package/es/Action/Item.js +1 -0
  4. package/es/Action/index.js +1 -0
  5. package/es/BackgroundTaskManager/RefreshMan.js +1 -0
  6. package/es/BackgroundTaskManager/index.js +1 -0
  7. package/es/BasicLayout/Header.js +1 -0
  8. package/es/BasicLayout/index.js +1 -0
  9. package/es/BatchOperationBar/index.js +1 -0
  10. package/es/Boundary/Components/Code.js +1 -0
  11. package/es/Boundary/Components/Exception.js +1 -0
  12. package/es/Boundary/Components/Function.js +1 -0
  13. package/es/Boundary/index.js +1 -0
  14. package/es/ContentWithIcon/index.js +1 -0
  15. package/es/ContentWithQuestion/index.js +1 -0
  16. package/es/DateRanger/PickerPanel.js +1 -0
  17. package/es/DateRanger/Ranger.js +1 -0
  18. package/es/DateRanger/index.js +1 -0
  19. package/es/Dialog/Anchor.js +1 -0
  20. package/es/Dialog/EventProxy.js +1 -0
  21. package/es/Dialog/index.js +1 -0
  22. package/es/DocDialog/index.js +1 -0
  23. package/es/FooterToolbar/index.js +1 -0
  24. package/es/FullscreenBox/index.js +1 -0
  25. package/es/Highlight/DiffView/DiffCells.js +1 -0
  26. package/es/Highlight/DiffView/index.js +1 -0
  27. package/es/Highlight/HighlightCell.js +1 -0
  28. package/es/Highlight/JsonView.js +1 -0
  29. package/es/Highlight/index.js +1 -0
  30. package/es/Highlight/useKeyDownCopyEvent.js +1 -0
  31. package/es/IconFont/index.js +1 -0
  32. package/es/LightFilter/index.js +1 -0
  33. package/es/LocaleDropdown/index.js +1 -0
  34. package/es/Login/ActivateForm.js +1 -0
  35. package/es/Login/LoginForm.js +1 -0
  36. package/es/Login/RegisterForm.js +1 -0
  37. package/es/Login/index.js +1 -0
  38. package/es/Lottie/index.js +1 -0
  39. package/es/NavMenu/index.js +1 -0
  40. package/es/PageContainer/ItemRender.js +1 -0
  41. package/es/PageContainer/index.js +1 -0
  42. package/es/PageLoading/index.js +1 -0
  43. package/es/Password/Content.js +1 -0
  44. package/es/Password/index.js +1 -0
  45. package/es/ProCard/index.js +1 -0
  46. package/es/ProTable/index.js +2 -3
  47. package/es/Ranger/QuickPicker.js +1 -0
  48. package/es/Ranger/Ranger.js +1 -0
  49. package/es/Ranger/index.js +1 -0
  50. package/es/SideTip/Dragger.js +1 -0
  51. package/es/SideTip/IconLoading.js +1 -0
  52. package/es/SideTip/index.js +1 -0
  53. package/es/TagSelect/Group.js +1 -0
  54. package/es/TagSelect/Item.js +1 -0
  55. package/es/TagSelect/index.js +1 -0
  56. package/es/TreeSearch/index.js +1 -0
  57. package/es/Welcome/index.js +1 -0
  58. package/es/Welcome/step.js +1 -0
  59. package/es/_util/index.js +1 -0
  60. package/es/constant/index.js +1 -0
  61. package/es/index.js +1 -0
  62. package/es/locale/LocaleWrapper.js +1 -0
  63. package/es/locale/index.js +1 -0
  64. package/lib/Action/Group.js +189 -162
  65. package/lib/Action/Item.js +47 -65
  66. package/lib/Action/index.js +13 -35
  67. package/lib/Action/style/index.js +25 -43
  68. package/lib/BackgroundTaskManager/RefreshMan.js +34 -50
  69. package/lib/BackgroundTaskManager/constants.js +10 -32
  70. package/lib/BackgroundTaskManager/index.js +118 -126
  71. package/lib/BasicLayout/Header.js +242 -200
  72. package/lib/BasicLayout/index.js +265 -307
  73. package/lib/BasicLayout/locale/en-US.js +16 -34
  74. package/lib/BasicLayout/locale/ja-JP.js +16 -34
  75. package/lib/BasicLayout/locale/zh-CN.js +16 -34
  76. package/lib/BasicLayout/locale/zh-TW.js +16 -34
  77. package/lib/BasicLayout/style/Header.js +41 -60
  78. package/lib/BasicLayout/style/index.js +176 -197
  79. package/lib/BatchOperationBar/index.js +109 -151
  80. package/lib/BatchOperationBar/locale/en-US.js +10 -28
  81. package/lib/BatchOperationBar/locale/ja-JP.js +10 -28
  82. package/lib/BatchOperationBar/locale/zh-CN.js +10 -28
  83. package/lib/BatchOperationBar/locale/zh-TW.js +10 -28
  84. package/lib/BatchOperationBar/style/index.js +30 -46
  85. package/lib/Boundary/Components/Code.js +57 -75
  86. package/lib/Boundary/Components/Exception.js +103 -123
  87. package/lib/Boundary/Components/Function.js +47 -62
  88. package/lib/Boundary/Components/index.js +36 -25
  89. package/lib/Boundary/IBoundary.js +4 -16
  90. package/lib/Boundary/constant.js +16 -38
  91. package/lib/Boundary/index.js +11 -24
  92. package/lib/Boundary/locale/en-US.js +14 -32
  93. package/lib/Boundary/locale/ja-JP.js +14 -32
  94. package/lib/Boundary/locale/zh-CN.js +14 -32
  95. package/lib/Boundary/locale/zh-TW.js +14 -32
  96. package/lib/Boundary/style/index.js +28 -47
  97. package/lib/Boundary/utils.js +9 -31
  98. package/lib/ContentWithIcon/index.js +101 -114
  99. package/lib/ContentWithIcon/style/index.js +17 -36
  100. package/lib/ContentWithQuestion/index.js +40 -52
  101. package/lib/ContentWithQuestion/style/index.js +16 -35
  102. package/lib/DateRanger/PickerPanel.js +343 -325
  103. package/lib/DateRanger/Ranger.js +430 -515
  104. package/lib/DateRanger/constant/index.js +188 -376
  105. package/lib/DateRanger/index.js +45 -64
  106. package/lib/DateRanger/locale/en-US.js +20 -47
  107. package/lib/DateRanger/locale/ja-JP.js +20 -47
  108. package/lib/DateRanger/locale/zh-CN.js +20 -47
  109. package/lib/DateRanger/locale/zh-TW.js +20 -47
  110. package/lib/DateRanger/style/index.js +41 -62
  111. package/lib/DateRanger/typing.js +4 -16
  112. package/lib/Dialog/Anchor.js +70 -95
  113. package/lib/Dialog/Dock.js +14 -36
  114. package/lib/Dialog/EventProxy.js +21 -39
  115. package/lib/Dialog/index.js +327 -370
  116. package/lib/Dialog/locale/en-US.js +8 -26
  117. package/lib/Dialog/locale/ja-JP.js +8 -26
  118. package/lib/Dialog/locale/zh-CN.js +8 -26
  119. package/lib/Dialog/locale/zh-TW.js +8 -26
  120. package/lib/Dialog/style/index.js +58 -76
  121. package/lib/DocDialog/index.js +51 -77
  122. package/lib/DocDialog/locale/en-US.js +5 -23
  123. package/lib/DocDialog/locale/ja-JP.js +5 -23
  124. package/lib/DocDialog/locale/zh-CN.js +5 -23
  125. package/lib/DocDialog/locale/zh-TW.js +5 -23
  126. package/lib/FooterToolbar/index.js +27 -45
  127. package/lib/FooterToolbar/style/index.js +23 -38
  128. package/lib/FullscreenBox/index.js +151 -138
  129. package/lib/FullscreenBox/locale/en-US.js +5 -23
  130. package/lib/FullscreenBox/locale/ja-JP.js +5 -23
  131. package/lib/FullscreenBox/locale/zh-CN.js +5 -23
  132. package/lib/FullscreenBox/locale/zh-TW.js +5 -23
  133. package/lib/FullscreenBox/style/index.js +23 -41
  134. package/lib/Highlight/DiffView/DiffCells.js +34 -54
  135. package/lib/Highlight/DiffView/index.js +165 -163
  136. package/lib/Highlight/HighlightCell.js +28 -47
  137. package/lib/Highlight/JsonView.js +45 -74
  138. package/lib/Highlight/index.js +200 -214
  139. package/lib/Highlight/languages/bash.js +7 -34
  140. package/lib/Highlight/languages/cpp.js +7 -34
  141. package/lib/Highlight/languages/css.js +7 -34
  142. package/lib/Highlight/languages/dockerfile.js +7 -34
  143. package/lib/Highlight/languages/go.js +7 -34
  144. package/lib/Highlight/languages/groovy.js +7 -34
  145. package/lib/Highlight/languages/http.js +7 -34
  146. package/lib/Highlight/languages/java.js +7 -34
  147. package/lib/Highlight/languages/javascript.js +7 -34
  148. package/lib/Highlight/languages/json.js +7 -34
  149. package/lib/Highlight/languages/markdown.js +7 -34
  150. package/lib/Highlight/languages/nginx.js +7 -34
  151. package/lib/Highlight/languages/python.js +7 -34
  152. package/lib/Highlight/languages/ruby.js +7 -34
  153. package/lib/Highlight/languages/solidity.js +7 -34
  154. package/lib/Highlight/languages/sql.js +7 -34
  155. package/lib/Highlight/languages/typescript.js +7 -34
  156. package/lib/Highlight/languages/xml.js +7 -34
  157. package/lib/Highlight/languages/yaml.js +7 -34
  158. package/lib/Highlight/locale/en-US.js +7 -25
  159. package/lib/Highlight/locale/ja-JP.js +7 -25
  160. package/lib/Highlight/locale/zh-CN.js +7 -25
  161. package/lib/Highlight/locale/zh-TW.js +7 -25
  162. package/lib/Highlight/style/index.js +128 -144
  163. package/lib/Highlight/useKeyDownCopyEvent.js +40 -64
  164. package/lib/IconFont/index.js +23 -28
  165. package/lib/LightFilter/index.js +29 -43
  166. package/lib/LightFilter/style/index.js +15 -33
  167. package/lib/LocaleDropdown/index.js +43 -53
  168. package/lib/Login/ActivateForm.js +93 -119
  169. package/lib/Login/LoginForm.js +149 -184
  170. package/lib/Login/RegisterForm.js +122 -163
  171. package/lib/Login/index.js +157 -163
  172. package/lib/Login/locale/en-US.js +31 -49
  173. package/lib/Login/locale/ja-JP.js +31 -49
  174. package/lib/Login/locale/zh-CN.js +31 -49
  175. package/lib/Login/locale/zh-TW.js +30 -48
  176. package/lib/Login/style/index.js +77 -98
  177. package/lib/Lottie/index.js +7 -24
  178. package/lib/NavMenu/index.js +105 -108
  179. package/lib/NavMenu/style/index.js +31 -49
  180. package/lib/PageContainer/ItemRender.js +28 -46
  181. package/lib/PageContainer/index.js +125 -140
  182. package/lib/PageContainer/locale/en-US.js +8 -26
  183. package/lib/PageContainer/locale/ja-JP.js +8 -26
  184. package/lib/PageContainer/locale/zh-CN.js +8 -26
  185. package/lib/PageContainer/locale/zh-TW.js +8 -26
  186. package/lib/PageContainer/style/index.js +19 -40
  187. package/lib/PageLoading/index.js +33 -54
  188. package/lib/Password/Content.js +92 -80
  189. package/lib/Password/index.js +125 -160
  190. package/lib/Password/locale/en-US.js +14 -32
  191. package/lib/Password/locale/ja-JP.js +16 -34
  192. package/lib/Password/locale/zh-CN.js +15 -33
  193. package/lib/Password/locale/zh-TW.js +14 -32
  194. package/lib/ProCard/index.js +77 -98
  195. package/lib/ProCard/style/index.js +21 -39
  196. package/lib/ProTable/index.js +102 -123
  197. package/lib/ProTable/style/index.js +21 -38
  198. package/lib/Ranger/QuickPicker.js +92 -94
  199. package/lib/Ranger/Ranger.js +98 -133
  200. package/lib/Ranger/constant/index.js +115 -266
  201. package/lib/Ranger/index.js +61 -69
  202. package/lib/Ranger/locale/en-US.js +31 -49
  203. package/lib/Ranger/locale/ja-JP.js +31 -49
  204. package/lib/Ranger/locale/zh-CN.js +7 -25
  205. package/lib/Ranger/locale/zh-TW.js +7 -25
  206. package/lib/Ranger/style/index.js +21 -39
  207. package/lib/Ranger/typing.js +4 -16
  208. package/lib/SideTip/Dragger.js +259 -219
  209. package/lib/SideTip/IconLoading.js +43 -74
  210. package/lib/SideTip/index.js +124 -126
  211. package/lib/SideTip/locale/en-US.js +5 -23
  212. package/lib/SideTip/locale/ja-JP.js +5 -23
  213. package/lib/SideTip/locale/zh-CN.js +5 -23
  214. package/lib/SideTip/locale/zh-TW.js +5 -23
  215. package/lib/SideTip/style/index.js +76 -92
  216. package/lib/SideTip/utils.js +40 -61
  217. package/lib/TagSelect/Group.js +64 -83
  218. package/lib/TagSelect/Item.js +68 -91
  219. package/lib/TagSelect/TagSelectContext.js +7 -25
  220. package/lib/TagSelect/index.js +12 -35
  221. package/lib/TagSelect/style/index.js +41 -64
  222. package/lib/TreeSearch/index.js +133 -127
  223. package/lib/TreeSearch/util.js +52 -70
  224. package/lib/Welcome/index.js +142 -117
  225. package/lib/Welcome/locale/en-US.js +8 -26
  226. package/lib/Welcome/locale/ja-JP.js +8 -26
  227. package/lib/Welcome/locale/zh-CN.js +8 -26
  228. package/lib/Welcome/locale/zh-TW.js +8 -26
  229. package/lib/Welcome/step/style/index.js +24 -40
  230. package/lib/Welcome/step.js +63 -59
  231. package/lib/Welcome/style/index.js +58 -70
  232. package/lib/_util/genComponentStyleHook.js +15 -43
  233. package/lib/_util/index.js +38 -43
  234. package/lib/_util/useNavigate.js +11 -26
  235. package/lib/constant/index.js +23 -49
  236. package/lib/index.js +283 -129
  237. package/lib/interface.js +4 -16
  238. package/lib/locale/LocaleWrapper.js +50 -60
  239. package/lib/locale/en-US.js +37 -64
  240. package/lib/locale/index.js +5 -16
  241. package/lib/locale/ja-JP.js +37 -64
  242. package/lib/locale/zh-CN.js +36 -63
  243. package/lib/locale/zh-TW.js +32 -59
  244. package/package.json +3 -3
@@ -1,66 +1,44 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ "use strict";
28
2
 
29
- // src/Dialog/index.tsx
30
- var Dialog_exports = {};
31
- __export(Dialog_exports, {
32
- default: () => Dialog_default
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
33
5
  });
34
- module.exports = __toCommonJS(Dialog_exports);
35
- var import_icons = require("@oceanbase/icons");
36
- var import_react = __toESM(require("react"));
37
- var import_design = require("@oceanbase/design");
38
- var import_react_dom = require("react-dom");
39
- var import_LocaleWrapper = __toESM(require("../locale/LocaleWrapper"));
40
- var import_Anchor = require("./Anchor");
41
- var import_Dock = require("./Dock");
42
- var import_EventProxy = require("./EventProxy");
43
- var import_zh_CN = __toESM(require("./locale/zh-CN"));
44
- var import_style = __toESM(require("./style"));
45
- var import_jsx_runtime = require("react/jsx-runtime");
46
- var DEFAULT_LEFT = 0.1;
47
- var DEFAULT_TOP = 0.1;
48
- var MINIMIZE_HEIGHT = 36;
49
- var MINIMIZE_WIDTH = 320;
50
- var DEFAULT_MIN = [320, 256];
51
- var DEFAULT_WIDTH_MEMBER = 520;
52
- var DEFAULT_HEIGHT_MEMBER = 600;
53
- var DEFAULT_BORDER_WIDTH = 24;
54
- var SCROLL_BAR_WIDTH = 1;
55
- var _container = null;
56
- var getContainer = () => {
6
+ exports.default = void 0;
7
+ var _icons = require("@oceanbase/icons");
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _design = require("@oceanbase/design");
10
+ var _reactDom = require("react-dom");
11
+ var _LocaleWrapper = _interopRequireDefault(require("../locale/LocaleWrapper"));
12
+ var _Anchor = require("./Anchor");
13
+ var _Dock = require("./Dock");
14
+ var _EventProxy = require("./EventProxy");
15
+ var _zhCN = _interopRequireDefault(require("./locale/zh-CN"));
16
+ var _style = _interopRequireDefault(require("./style"));
17
+ var _jsxRuntime = require("react/jsx-runtime");
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
20
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
21
+ "use client";
22
+ const DEFAULT_LEFT = 0.1;
23
+ const DEFAULT_TOP = 0.1;
24
+ const MINIMIZE_HEIGHT = 36;
25
+ const MINIMIZE_WIDTH = 320;
26
+ const DEFAULT_MIN = [320, 256];
27
+ const DEFAULT_WIDTH_MEMBER = 520;
28
+ const DEFAULT_HEIGHT_MEMBER = 600;
29
+ const DEFAULT_BORDER_WIDTH = 24;
30
+ // 预留滚动条宽度
31
+ const SCROLL_BAR_WIDTH = 1;
32
+ // Static container for portal
33
+ let _container = null;
34
+ const getContainer = () => {
57
35
  if (!_container) {
58
- _container = document.createElement("div");
36
+ _container = document.createElement('div');
59
37
  document.body.appendChild(_container);
60
38
  }
61
39
  return _container;
62
40
  };
63
- var DialogComp = (props) => {
41
+ const DialogComp = props => {
64
42
  const {
65
43
  className,
66
44
  visible,
@@ -83,35 +61,40 @@ var DialogComp = (props) => {
83
61
  setRootWidth,
84
62
  isEmbed = false
85
63
  } = props;
86
- const { getPrefixCls } = (0, import_react.useContext)(import_design.ConfigProvider.ConfigContext);
87
- const prefixCls = getPrefixCls("dialog");
88
- const { wrapSSR } = (0, import_style.default)(prefixCls);
89
- const hostRef = (0, import_react.useRef)(null);
90
- const clientXRef = (0, import_react.useRef)(0);
91
- const clientYRef = (0, import_react.useRef)(0);
92
- const isPointDownRef = (0, import_react.useRef)(false);
93
- const originInfoRef = (0, import_react.useRef)({});
94
- const [mask, setMask] = (0, import_react.useState)(true);
95
- const [dialogWidth, setDialogWidth] = (0, import_react.useState)(width ?? DEFAULT_WIDTH_MEMBER);
96
- const [dialogHeight, setDialogHeight] = (0, import_react.useState)(height ?? DEFAULT_HEIGHT_MEMBER);
97
- const [dialogLeft, setDialogLeft] = (0, import_react.useState)(
98
- left ?? clientWidth - (width ?? DEFAULT_WIDTH_MEMBER) - DEFAULT_BORDER_WIDTH
99
- );
100
- const [dialogTop, setDialogTop] = (0, import_react.useState)(
101
- top ?? clientHeight - (height ?? DEFAULT_HEIGHT_MEMBER) - DEFAULT_BORDER_WIDTH
102
- );
103
- const [moveX, setMoveX] = (0, import_react.useState)(0);
104
- const [moveY, setMoveY] = (0, import_react.useState)(0);
105
- const [maximization, setMaximization] = (0, import_react.useState)(isEmbed);
106
- const [minimize, setMinimize] = (0, import_react.useState)(false);
107
- const [headerStyle, setHeaderStyle] = (0, import_react.useState)({});
108
- const maxSize = (0, import_react.useMemo)(() => {
109
- if (max)
110
- return max;
64
+ const {
65
+ getPrefixCls
66
+ } = (0, _react.useContext)(_design.ConfigProvider.ConfigContext);
67
+ const prefixCls = getPrefixCls('dialog');
68
+ const {
69
+ wrapSSR
70
+ } = (0, _style.default)(prefixCls);
71
+
72
+ // Refs for instance properties
73
+ const hostRef = (0, _react.useRef)(null);
74
+ const clientXRef = (0, _react.useRef)(0);
75
+ const clientYRef = (0, _react.useRef)(0);
76
+ const isPointDownRef = (0, _react.useRef)(false);
77
+ const originInfoRef = (0, _react.useRef)({});
78
+
79
+ // State
80
+ const [mask, setMask] = (0, _react.useState)(true);
81
+ const [dialogWidth, setDialogWidth] = (0, _react.useState)(width ?? DEFAULT_WIDTH_MEMBER);
82
+ const [dialogHeight, setDialogHeight] = (0, _react.useState)(height ?? DEFAULT_HEIGHT_MEMBER);
83
+ const [dialogLeft, setDialogLeft] = (0, _react.useState)(left ?? clientWidth - (width ?? DEFAULT_WIDTH_MEMBER) - DEFAULT_BORDER_WIDTH);
84
+ const [dialogTop, setDialogTop] = (0, _react.useState)(top ?? clientHeight - (height ?? DEFAULT_HEIGHT_MEMBER) - DEFAULT_BORDER_WIDTH);
85
+ const [moveX, setMoveX] = (0, _react.useState)(0);
86
+ const [moveY, setMoveY] = (0, _react.useState)(0);
87
+ const [maximization, setMaximization] = (0, _react.useState)(isEmbed);
88
+ const [minimize, setMinimize] = (0, _react.useState)(false);
89
+ const [headerStyle, setHeaderStyle] = (0, _react.useState)({});
90
+
91
+ // Computed values
92
+ const maxSize = (0, _react.useMemo)(() => {
93
+ if (max) return max;
111
94
  return [clientWidth, clientHeight];
112
95
  }, [max, clientWidth, clientHeight]);
113
- const minSize = (0, import_react.useMemo)(() => min, [min]);
114
- const getDefaultEmbedState = (0, import_react.useCallback)(() => {
96
+ const minSize = (0, _react.useMemo)(() => min, [min]);
97
+ const getDefaultEmbedState = (0, _react.useCallback)(() => {
115
98
  return {
116
99
  width: width ?? DEFAULT_WIDTH_MEMBER,
117
100
  height: height ?? DEFAULT_HEIGHT_MEMBER,
@@ -119,28 +102,22 @@ var DialogComp = (props) => {
119
102
  top: top ?? clientHeight - (height ?? DEFAULT_HEIGHT_MEMBER) - DEFAULT_BORDER_WIDTH
120
103
  };
121
104
  }, [width, height, left, top, clientWidth, clientHeight]);
122
- const setRootWidthInEmbedMode = (0, import_react.useCallback)(
123
- (newWidth) => {
124
- const restWidth = !!newWidth ? newWidth + SCROLL_BAR_WIDTH : 0;
125
- const rootWidth = (clientWidth - restWidth) / clientWidth;
126
- setRootWidth == null ? void 0 : setRootWidth(`${rootWidth * 100}%`);
127
- },
128
- [clientWidth, setRootWidth]
129
- );
130
- const compatClonedModel = (0, import_react.useCallback)(
131
- (model) => {
132
- return {
133
- left: DEFAULT_LEFT,
134
- top: DEFAULT_TOP,
135
- width: DEFAULT_WIDTH_MEMBER / clientWidth,
136
- height: DEFAULT_HEIGHT_MEMBER / clientHeight,
137
- minimize: false,
138
- maximization: false,
139
- ...model
140
- };
141
- },
142
- [clientWidth, clientHeight]
143
- );
105
+ const setRootWidthInEmbedMode = (0, _react.useCallback)(newWidth => {
106
+ const restWidth = !!newWidth ? newWidth + SCROLL_BAR_WIDTH : 0;
107
+ const rootWidth = (clientWidth - restWidth) / clientWidth;
108
+ setRootWidth?.(`${rootWidth * 100}%`);
109
+ }, [clientWidth, setRootWidth]);
110
+ const compatClonedModel = (0, _react.useCallback)(model => {
111
+ return {
112
+ left: DEFAULT_LEFT,
113
+ top: DEFAULT_TOP,
114
+ width: DEFAULT_WIDTH_MEMBER / clientWidth,
115
+ height: DEFAULT_HEIGHT_MEMBER / clientHeight,
116
+ minimize: false,
117
+ maximization: false,
118
+ ...model
119
+ };
120
+ }, [clientWidth, clientHeight]);
144
121
  const checkSize = (w, h) => {
145
122
  const newModel = {};
146
123
  const result = {
@@ -165,8 +142,10 @@ var DialogComp = (props) => {
165
142
  }
166
143
  return result;
167
144
  };
168
- (0, import_react.useEffect)(() => {
169
- const host = document.createElement("div");
145
+
146
+ // componentDidMount
147
+ (0, _react.useEffect)(() => {
148
+ const host = document.createElement('div');
170
149
  hostRef.current = host;
171
150
  getContainer().appendChild(host);
172
151
  return () => {
@@ -175,7 +154,9 @@ var DialogComp = (props) => {
175
154
  }
176
155
  };
177
156
  }, []);
178
- (0, import_react.useEffect)(() => {
157
+
158
+ // componentDidUpdate
159
+ (0, _react.useEffect)(() => {
179
160
  if (!visible) {
180
161
  setRootWidthInEmbedMode(0);
181
162
  return;
@@ -187,64 +168,58 @@ var DialogComp = (props) => {
187
168
  setDialogTop(tempState.top);
188
169
  setRootWidthInEmbedMode(tempState.width);
189
170
  }, [visible, clientWidth, clientHeight, getDefaultEmbedState, setRootWidthInEmbedMode]);
190
- (0, import_react.useEffect)(() => {
171
+ (0, _react.useEffect)(() => {
191
172
  if (isEmbed) {
192
173
  setMinimize(false);
193
174
  setMaximization(true);
194
175
  } else {
195
176
  setMinimize(false);
196
177
  setMaximization(false);
197
- if (height)
198
- setDialogHeight(height);
199
- if (width)
200
- setDialogWidth(width);
201
- if (top !== void 0)
202
- setDialogTop(top);
203
- if (left !== void 0)
204
- setDialogLeft(left);
178
+ if (height) setDialogHeight(height);
179
+ if (width) setDialogWidth(width);
180
+ if (top !== undefined) setDialogTop(top);
181
+ if (left !== undefined) setDialogLeft(left);
205
182
  }
206
183
  }, [isEmbed, height, width, top, left]);
207
- const onDragStart = (event) => {
208
- if (!draggable)
209
- return;
210
- if (maximization)
211
- return;
184
+
185
+ // Drag handlers
186
+ const onDragStart = event => {
187
+ if (!draggable) return;
188
+ if (maximization) return;
212
189
  setMask(true);
213
- if (dialogLeft === void 0) {
190
+ if (dialogLeft === undefined) {
214
191
  setDialogLeft(DEFAULT_LEFT);
215
192
  }
216
- if (dialogTop === void 0) {
193
+ if (dialogTop === undefined) {
217
194
  setDialogTop(DEFAULT_TOP);
218
195
  }
219
196
  clientXRef.current = event.clientX;
220
197
  clientYRef.current = event.clientY;
221
198
  isPointDownRef.current = true;
222
199
  };
223
- const onDragMove = (event) => {
224
- if (!draggable || !isPointDownRef.current)
225
- return;
200
+ const onDragMove = event => {
201
+ if (!draggable || !isPointDownRef.current) return;
226
202
  event.preventDefault();
227
203
  setMoveX(event.clientX - clientXRef.current);
228
204
  setMoveY(event.clientY - clientYRef.current);
229
205
  };
230
206
  const onDragEnd = () => {
231
- if (!draggable)
232
- return;
207
+ if (!draggable) return;
233
208
  isPointDownRef.current = false;
234
- if (moveX === 0 && moveY === 0)
235
- return;
209
+ if (moveX === 0 && moveY === 0) return;
236
210
  setMask(false);
237
- setDialogLeft((prev) => (prev ?? 0) + moveX);
238
- setDialogTop((prev) => (prev ?? 0) + moveY);
211
+ setDialogLeft(prev => (prev ?? 0) + moveX);
212
+ setDialogTop(prev => (prev ?? 0) + moveY);
239
213
  setMoveX(0);
240
214
  setMoveY(0);
241
215
  };
242
216
  const detectPointUp = () => {
243
217
  setMask(false);
244
218
  };
219
+
220
+ // Resize handlers
245
221
  const onResizeStart = () => {
246
- if (minimize || !resizable)
247
- return;
222
+ if (minimize || !resizable) return;
248
223
  originInfoRef.current = compatClonedModel({
249
224
  width: dialogWidth,
250
225
  height: dialogHeight,
@@ -255,92 +230,101 @@ var DialogComp = (props) => {
255
230
  });
256
231
  setMask(true);
257
232
  };
258
- const onResizeMove = (event) => {
233
+ const onResizeMove = event => {
259
234
  event.preventDefault();
260
- if (minimize || !resizable)
261
- return;
235
+ if (minimize || !resizable) return;
236
+ // @ts-ignore
262
237
  const newWidth = originInfoRef.current.width + event.moveRight;
238
+ // @ts-ignore
263
239
  const newHeight = originInfoRef.current.height + event.moveBottom;
264
240
  const checkResult = checkSize(newWidth, newHeight);
265
241
  if (checkResult.widthShouldChange) {
266
242
  setRootWidthInEmbedMode(newWidth);
267
243
  }
268
244
  if (checkResult.widthShouldChange) {
245
+ // @ts-ignore
269
246
  setDialogLeft(originInfoRef.current.left + event.moveLeft);
270
247
  setDialogWidth(newWidth);
271
248
  }
272
249
  if (checkResult.heightShouldChange) {
250
+ // @ts-ignore
273
251
  setDialogTop(originInfoRef.current.top + event.moveTop);
274
252
  setDialogHeight(newHeight);
275
253
  }
276
254
  };
277
255
  const onResizeEnd = () => {
278
- if (!mask || !resizable)
279
- return;
256
+ if (!mask || !resizable) return;
280
257
  setMask(false);
281
258
  };
259
+
260
+ // Toggle handlers
282
261
  const toggleMinimize = () => {
283
262
  setMaximization(false);
284
- setMinimize((prev) => !prev);
263
+ setMinimize(prev => !prev);
285
264
  };
286
265
  const toggleMaximization = () => {
287
266
  const enable = resizable && enableMaximization && !isEmbed;
288
- if (!enable)
289
- return;
290
- setMaximization((prev) => !prev);
267
+ if (!enable) return;
268
+ setMaximization(prev => !prev);
291
269
  setMinimize(false);
292
270
  };
293
- const handleClose = (event) => {
271
+ const handleClose = event => {
294
272
  event.stopPropagation();
295
- onClose == null ? void 0 : onClose();
273
+ onClose?.();
296
274
  };
297
- const getBaseStyle = (0, import_react.useCallback)(() => {
275
+
276
+ // Style calculations
277
+ const getBaseStyle = (0, _react.useCallback)(() => {
298
278
  return {
299
- visibility: visible ? "visible" : "hidden",
279
+ visibility: visible ? 'visible' : 'hidden',
300
280
  opacity: visible ? 1 : 0
301
281
  };
302
282
  }, [visible]);
303
- const getCompatAbsPostion = (0, import_react.useCallback)(
304
- (info) => {
305
- const compatInfo = compatClonedModel(info);
306
- const { minimize: isMinimize } = compatInfo;
307
- const ret = {};
308
- ["left", "width", "top", "height"].forEach((key) => {
309
- ret[key] = compatInfo[key];
310
- });
311
- if (maxSize && ret.width > maxSize[0]) {
312
- ret.width = maxSize[0];
313
- }
314
- if (maxSize && ret.height > maxSize[1]) {
315
- ret.height = maxSize[1];
316
- }
317
- if (minSize && ret.width < minSize[0]) {
318
- ret.width = minSize[0];
319
- }
320
- if (minSize && ret.height < minSize[1]) {
321
- ret.height = minSize[1];
322
- }
323
- ret.width = isMinimize ? MINIMIZE_WIDTH : ret.width;
324
- ret.height = isMinimize ? MINIMIZE_HEIGHT : ret.height;
325
- if (ret.left + ret.width > clientWidth) {
326
- ret.left = clientWidth - ret.width;
327
- }
328
- if (ret.left < 0) {
329
- ret.left = 0;
330
- }
331
- if (ret.top < 0) {
332
- ret.top = 0;
333
- }
334
- if (ret.top + ret.height > clientHeight) {
335
- ret.top = clientHeight - ret.height;
336
- }
337
- return ret;
338
- },
339
- [maxSize, minSize, clientWidth, clientHeight, compatClonedModel]
340
- );
341
- (0, import_react.useEffect)(() => {
342
- if (!visible)
343
- return;
283
+ const getCompatAbsPostion = (0, _react.useCallback)(info => {
284
+ const compatInfo = compatClonedModel(info);
285
+ const {
286
+ minimize: isMinimize
287
+ } = compatInfo;
288
+ const ret = {};
289
+ ['left', 'width', 'top', 'height'].forEach(key => {
290
+ ret[key] = compatInfo[key];
291
+ });
292
+
293
+ // Apply min/max constraints
294
+ if (maxSize && ret.width > maxSize[0]) {
295
+ ret.width = maxSize[0];
296
+ }
297
+ if (maxSize && ret.height > maxSize[1]) {
298
+ ret.height = maxSize[1];
299
+ }
300
+ if (minSize && ret.width < minSize[0]) {
301
+ ret.width = minSize[0];
302
+ }
303
+ if (minSize && ret.height < minSize[1]) {
304
+ ret.height = minSize[1];
305
+ }
306
+ ret.width = isMinimize ? MINIMIZE_WIDTH : ret.width;
307
+ ret.height = isMinimize ? MINIMIZE_HEIGHT : ret.height;
308
+
309
+ // Adjust position if out of bounds (calculate but don't setState here)
310
+ if (ret.left + ret.width > clientWidth) {
311
+ ret.left = clientWidth - ret.width;
312
+ }
313
+ if (ret.left < 0) {
314
+ ret.left = 0;
315
+ }
316
+ if (ret.top < 0) {
317
+ ret.top = 0;
318
+ }
319
+ if (ret.top + ret.height > clientHeight) {
320
+ ret.top = clientHeight - ret.height;
321
+ }
322
+ return ret;
323
+ }, [maxSize, minSize, clientWidth, clientHeight, compatClonedModel]);
324
+
325
+ // Adjust position if out of bounds
326
+ (0, _react.useEffect)(() => {
327
+ if (!visible) return;
344
328
  const adjusted = getCompatAbsPostion({
345
329
  width: dialogWidth,
346
330
  height: dialogHeight,
@@ -355,7 +339,7 @@ var DialogComp = (props) => {
355
339
  setDialogTop(adjusted.top);
356
340
  }
357
341
  }, [dialogWidth, dialogHeight, dialogLeft, dialogTop, minimize, visible, getCompatAbsPostion]);
358
- const getStyle = (0, import_react.useMemo)(() => {
342
+ const getStyle = (0, _react.useMemo)(() => {
359
343
  const transform = `translate(${moveX}px, ${moveY}px)`;
360
344
  const baseStyle = getBaseStyle();
361
345
  if (maximization && !isEmbed) {
@@ -365,11 +349,13 @@ var DialogComp = (props) => {
365
349
  bottom: 0,
366
350
  right: 0,
367
351
  width: width || DEFAULT_WIDTH_MEMBER,
368
- height: "auto",
352
+ height: 'auto',
369
353
  borderRadius: 0
370
354
  };
371
355
  } else if (minimize) {
372
- const { height: headerHeight } = headerStyle;
356
+ const {
357
+ height: headerHeight
358
+ } = headerStyle;
373
359
  const position = getCompatAbsPostion({
374
360
  width: dialogWidth,
375
361
  height: dialogHeight,
@@ -397,210 +383,181 @@ var DialogComp = (props) => {
397
383
  transform
398
384
  };
399
385
  }
400
- }, [
401
- maximization,
402
- isEmbed,
403
- minimize,
404
- moveX,
405
- moveY,
406
- width,
407
- headerStyle,
408
- dialogWidth,
409
- dialogHeight,
410
- dialogLeft,
411
- dialogTop,
412
- getCompatAbsPostion,
413
- getBaseStyle
414
- ]);
386
+ }, [maximization, isEmbed, minimize, moveX, moveY, width, headerStyle, dialogWidth, dialogHeight, dialogLeft, dialogTop, getCompatAbsPostion, getBaseStyle]);
387
+
388
+ // Render methods
415
389
  const renderControlLink = () => {
416
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-item`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
417
- "a",
418
- {
390
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
391
+ className: `${prefixCls}-item`,
392
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("a", {
419
393
  className: `${prefixCls}-item-link`,
420
- href: extLink == null ? void 0 : extLink.link,
394
+ href: extLink?.link,
421
395
  target: "_blank",
422
396
  rel: "noopener noreferrer",
423
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
424
- "svg",
425
- {
426
- className: "icon",
427
- viewBox: "0 0 1024 1024",
428
- version: "1.1",
429
- xmlns: "http://www.w3.org/2000/svg",
430
- width: "16",
431
- height: "16",
432
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M880.0256 912.0256H144.0256a31.9488 31.9488 0 0 1-32.0512-32V144.0256c0-17.7152 14.336-32.0512 32.0512-32.0512h359.936c4.4544 0 8.0384 3.584 8.0384 8.0384v56.0128c0 4.352-3.584 7.9872-7.9872 7.9872h-320v655.9744h655.9744v-320c0-4.4032 3.584-7.9872 8.0384-7.9872h55.9616c4.4032 0 8.0384 3.584 8.0384 7.9872v359.9872c0 17.7152-14.336 32-32 32zM770.8672 199.1168l-52.224-52.224a8.0384 8.0384 0 0 1 4.7104-13.568l179.4048-20.992c5.12-0.6144 9.5232 3.6864 8.9088 8.9088l-20.992 179.4048a8.0384 8.0384 0 0 1-13.6192 4.6592L824.6784 252.928l-256.2048 256.2048c-3.072 3.072-8.192 3.072-11.264 0l-42.4448-42.3936a8.0384 8.0384 0 0 1 0-11.264l256.1024-256.3584z" })
433
- }
434
- )
435
- }
436
- ) });
397
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", {
398
+ className: "icon",
399
+ viewBox: "0 0 1024 1024",
400
+ version: "1.1",
401
+ xmlns: "http://www.w3.org/2000/svg",
402
+ width: "16",
403
+ height: "16",
404
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
405
+ d: "M880.0256 912.0256H144.0256a31.9488 31.9488 0 0 1-32.0512-32V144.0256c0-17.7152 14.336-32.0512 32.0512-32.0512h359.936c4.4544 0 8.0384 3.584 8.0384 8.0384v56.0128c0 4.352-3.584 7.9872-7.9872 7.9872h-320v655.9744h655.9744v-320c0-4.4032 3.584-7.9872 8.0384-7.9872h55.9616c4.4032 0 8.0384 3.584 8.0384 7.9872v359.9872c0 17.7152-14.336 32-32 32zM770.8672 199.1168l-52.224-52.224a8.0384 8.0384 0 0 1 4.7104-13.568l179.4048-20.992c5.12-0.6144 9.5232 3.6864 8.9088 8.9088l-20.992 179.4048a8.0384 8.0384 0 0 1-13.6192 4.6592L824.6784 252.928l-256.2048 256.2048c-3.072 3.072-8.192 3.072-11.264 0l-42.4448-42.3936a8.0384 8.0384 0 0 1 0-11.264l256.1024-256.3584z"
406
+ })
407
+ })
408
+ })
409
+ });
437
410
  };
438
411
  const renderControls = () => {
439
412
  if (isEmbed) {
440
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: `${prefixCls}-controls`, children: [
441
- renderControlLink(),
442
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-item`, onClick: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CloseOutlined, {}) })
443
- ] });
413
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
414
+ className: `${prefixCls}-controls`,
415
+ children: [renderControlLink(), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
416
+ className: `${prefixCls}-item`,
417
+ onClick: handleClose,
418
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.CloseOutlined, {})
419
+ })]
420
+ });
444
421
  }
445
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: `${prefixCls}-controls`, children: [
446
- renderControlLink(),
447
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-item`, onClick: toggleMinimize, children: minimize ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ExpandAltOutlined, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.MinusOutlined, {}) }),
448
- enableMaximization && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-item`, onClick: toggleMaximization, children: maximization ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.FullscreenExitOutlined, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.FullscreenOutlined, {}) }),
449
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-item`, onClick: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CloseOutlined, {}) })
450
- ] });
422
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
423
+ className: `${prefixCls}-controls`,
424
+ children: [renderControlLink(), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
425
+ className: `${prefixCls}-item`,
426
+ onClick: toggleMinimize,
427
+ children: minimize ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ExpandAltOutlined, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.MinusOutlined, {})
428
+ }), enableMaximization && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
429
+ className: `${prefixCls}-item`,
430
+ onClick: toggleMaximization,
431
+ children: maximization ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.FullscreenExitOutlined, {}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.FullscreenOutlined, {})
432
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
433
+ className: `${prefixCls}-item`,
434
+ onClick: handleClose,
435
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.CloseOutlined, {})
436
+ })]
437
+ });
451
438
  };
452
439
  const renderHeader = () => {
453
440
  const headerStyleObj = {
454
441
  ...headerStyle,
455
- ...minimize ? { boxShadow: "0 2px 20px 0 rgba(4, 1, 30, 0.07)" } : {},
456
- ...isEmbed ? { cursor: "initial" } : {}
442
+ ...(minimize ? {
443
+ boxShadow: '0 2px 20px 0 rgba(4, 1, 30, 0.07)'
444
+ } : {}),
445
+ ...(isEmbed ? {
446
+ cursor: 'initial'
447
+ } : {})
457
448
  };
458
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
459
- "header",
460
- {
461
- className: `${prefixCls}-header`,
462
- style: headerStyleObj,
463
- onPointerDown: onDragStart,
464
- onDoubleClick: toggleMaximization,
465
- children: [
466
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: `${prefixCls}-title`, children: title || (locale == null ? void 0 : locale.helpDocument) }),
467
- renderControls()
468
- ]
469
- }
470
- );
449
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("header", {
450
+ className: `${prefixCls}-header`,
451
+ style: headerStyleObj,
452
+ onPointerDown: onDragStart,
453
+ onDoubleClick: toggleMaximization,
454
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
455
+ className: `${prefixCls}-title`,
456
+ children: title || locale?.helpDocument
457
+ }), renderControls()]
458
+ });
471
459
  };
472
460
  const renderMask = () => {
473
- if (!mask)
474
- return null;
475
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${prefixCls}-mask` });
461
+ if (!mask) return null;
462
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
463
+ className: `${prefixCls}-mask`
464
+ });
476
465
  };
477
466
  const renderContent = () => {
478
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("main", { className: `${prefixCls}-main`, style: minimize ? { visibility: "hidden" } : {}, children: [
479
- renderMask(),
480
- children
481
- ] });
467
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)("main", {
468
+ className: `${prefixCls}-main`,
469
+ style: minimize ? {
470
+ visibility: 'hidden'
471
+ } : {},
472
+ children: [renderMask(), children]
473
+ });
482
474
  };
483
475
  const renderEmbedBorders = () => {
484
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
485
- import_Anchor.Anchor,
486
- {
487
- prefixCls,
488
- dock: import_Dock.Dock.left,
476
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {
477
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Anchor.Anchor, {
478
+ prefixCls: prefixCls,
479
+ dock: _Dock.Dock.left,
489
480
  onStart: onResizeStart,
490
481
  onMove: onResizeMove,
491
482
  onEnd: onResizeEnd
492
- }
493
- ) });
483
+ })
484
+ });
494
485
  };
495
486
  const renderBorders = () => {
496
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.default.Fragment, { children: [
497
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
498
- import_Anchor.Anchor,
499
- {
500
- prefixCls,
501
- dock: import_Dock.Dock.top,
502
- onStart: onResizeStart,
503
- onMove: onResizeMove,
504
- onEnd: onResizeEnd
505
- }
506
- ),
507
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
508
- import_Anchor.Anchor,
509
- {
510
- prefixCls,
511
- dock: import_Dock.Dock.right,
512
- onStart: onResizeStart,
513
- onMove: onResizeMove,
514
- onEnd: onResizeEnd
515
- }
516
- ),
517
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
518
- import_Anchor.Anchor,
519
- {
520
- prefixCls,
521
- dock: import_Dock.Dock.bottom,
522
- onStart: onResizeStart,
523
- onMove: onResizeMove,
524
- onEnd: onResizeEnd
525
- }
526
- ),
527
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
528
- import_Anchor.Anchor,
529
- {
530
- prefixCls,
531
- dock: import_Dock.Dock.left,
532
- onStart: onResizeStart,
533
- onMove: onResizeMove,
534
- onEnd: onResizeEnd
535
- }
536
- ),
537
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
538
- import_Anchor.Anchor,
539
- {
540
- prefixCls,
541
- dock: import_Dock.Dock.topLeft,
542
- onStart: onResizeStart,
543
- onMove: onResizeMove,
544
- onEnd: onResizeEnd
545
- }
546
- ),
547
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
548
- import_Anchor.Anchor,
549
- {
550
- prefixCls,
551
- dock: import_Dock.Dock.topRight,
552
- onStart: onResizeStart,
553
- onMove: onResizeMove,
554
- onEnd: onResizeEnd
555
- }
556
- ),
557
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
558
- import_Anchor.Anchor,
559
- {
560
- prefixCls,
561
- dock: import_Dock.Dock.bottomLeft,
562
- onStart: onResizeStart,
563
- onMove: onResizeMove,
564
- onEnd: onResizeEnd
565
- }
566
- ),
567
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
568
- import_Anchor.Anchor,
569
- {
570
- prefixCls,
571
- dock: import_Dock.Dock.bottomRight,
572
- onStart: onResizeStart,
573
- onMove: onResizeMove,
574
- onEnd: onResizeEnd
575
- }
576
- )
577
- ] });
487
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_react.default.Fragment, {
488
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Anchor.Anchor, {
489
+ prefixCls: prefixCls,
490
+ dock: _Dock.Dock.top,
491
+ onStart: onResizeStart,
492
+ onMove: onResizeMove,
493
+ onEnd: onResizeEnd
494
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Anchor.Anchor, {
495
+ prefixCls: prefixCls,
496
+ dock: _Dock.Dock.right,
497
+ onStart: onResizeStart,
498
+ onMove: onResizeMove,
499
+ onEnd: onResizeEnd
500
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Anchor.Anchor, {
501
+ prefixCls: prefixCls,
502
+ dock: _Dock.Dock.bottom,
503
+ onStart: onResizeStart,
504
+ onMove: onResizeMove,
505
+ onEnd: onResizeEnd
506
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Anchor.Anchor, {
507
+ prefixCls: prefixCls,
508
+ dock: _Dock.Dock.left,
509
+ onStart: onResizeStart,
510
+ onMove: onResizeMove,
511
+ onEnd: onResizeEnd
512
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Anchor.Anchor, {
513
+ prefixCls: prefixCls,
514
+ dock: _Dock.Dock.topLeft,
515
+ onStart: onResizeStart,
516
+ onMove: onResizeMove,
517
+ onEnd: onResizeEnd
518
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Anchor.Anchor, {
519
+ prefixCls: prefixCls,
520
+ dock: _Dock.Dock.topRight,
521
+ onStart: onResizeStart,
522
+ onMove: onResizeMove,
523
+ onEnd: onResizeEnd
524
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Anchor.Anchor, {
525
+ prefixCls: prefixCls,
526
+ dock: _Dock.Dock.bottomLeft,
527
+ onStart: onResizeStart,
528
+ onMove: onResizeMove,
529
+ onEnd: onResizeEnd
530
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Anchor.Anchor, {
531
+ prefixCls: prefixCls,
532
+ dock: _Dock.Dock.bottomRight,
533
+ onStart: onResizeStart,
534
+ onMove: onResizeMove,
535
+ onEnd: onResizeEnd
536
+ })]
537
+ });
578
538
  };
579
539
  const renderDialog = () => {
580
540
  const style = getStyle;
581
- return wrapSSR(
582
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
583
- "div",
584
- {
585
- className: `${prefixCls}-container ${className || ""} ${isEmbed ? `${prefixCls}-container-embed` : ""}`,
586
- style,
587
- ...minimize ? {} : { tabIndex: 0 },
588
- children: [
589
- renderHeader(),
590
- renderContent(),
591
- isEmbed ? renderEmbedBorders() : renderBorders(),
592
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_EventProxy.EventProxy, { onPointerMove: onDragMove, onPointerUp: onDragEnd }),
593
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_EventProxy.EventProxy, { onPointerUp: detectPointUp })
594
- ]
595
- }
596
- )
597
- );
541
+ return wrapSSR( /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
542
+ className: `${prefixCls}-container ${className || ''} ${isEmbed ? `${prefixCls}-container-embed` : ''}`,
543
+ style: style,
544
+ ...(minimize ? {} : {
545
+ tabIndex: 0
546
+ }),
547
+ children: [renderHeader(), renderContent(), isEmbed ? renderEmbedBorders() : renderBorders(), /*#__PURE__*/(0, _jsxRuntime.jsx)(_EventProxy.EventProxy, {
548
+ onPointerMove: onDragMove,
549
+ onPointerUp: onDragEnd
550
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_EventProxy.EventProxy, {
551
+ onPointerUp: detectPointUp
552
+ })]
553
+ }));
598
554
  };
599
- if (!visible && !isEmbed)
600
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, {});
601
- return (0, import_react_dom.createPortal)(renderDialog(), getContainer());
555
+
556
+ // 嵌入模式通过style控制显隐
557
+ if (!visible && !isEmbed) return /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default.Fragment, {});
558
+ return /*#__PURE__*/(0, _reactDom.createPortal)(renderDialog(), getContainer());
602
559
  };
603
- var Dialog_default = (0, import_LocaleWrapper.default)({
604
- componentName: "Dialog",
605
- defaultLocale: import_zh_CN.default
606
- })(DialogComp);
560
+ var _default = exports.default = (0, _LocaleWrapper.default)({
561
+ componentName: 'Dialog',
562
+ defaultLocale: _zhCN.default
563
+ })(DialogComp);