wargerm 0.7.32 → 0.7.34
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/components/Modal/dialog.d.ts +2 -1
- package/dist/components/Modal/index.d.ts +8 -1
- package/dist/index.esm.js +77 -52
- package/dist/index.js +76 -51
- package/package.json +1 -1
@@ -17,9 +17,10 @@ declare type Props = {
|
|
17
17
|
width?: number;
|
18
18
|
className?: string;
|
19
19
|
wrapClassName?: string;
|
20
|
+
fullScreenStyle?: React.CSSProperties;
|
20
21
|
style?: React.CSSProperties;
|
21
22
|
children?: ReactNode;
|
22
23
|
ref?: any;
|
23
24
|
};
|
24
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "width" | "open" | "destroyOnClose" | "closeCb" | "onClose" | "hiddenMask" | "isResize" | "isDrag" | "className" | "wrapClassName" | "style" | "title" | "onOk" | "onCancel" | "footer" | "content" | "okText" | "cancelText" | "children"> & React.RefAttributes<unknown>>;
|
25
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "width" | "open" | "destroyOnClose" | "closeCb" | "onClose" | "hiddenMask" | "isResize" | "isDrag" | "className" | "wrapClassName" | "fullScreenStyle" | "style" | "title" | "onOk" | "onCancel" | "footer" | "content" | "okText" | "cancelText" | "children"> & React.RefAttributes<unknown>>;
|
25
26
|
export default _default;
|
@@ -11,13 +11,17 @@ declare type Props = {
|
|
11
11
|
cancelText?: string;
|
12
12
|
open?: boolean;
|
13
13
|
renderClose?: ReactNode;
|
14
|
+
renderMin?: ReactNode;
|
15
|
+
renderFullScreen?: ReactNode;
|
14
16
|
destroyOnClose?: boolean;
|
15
17
|
hiddenMask?: boolean;
|
16
18
|
isDrag?: boolean;
|
19
|
+
showFullscreen?: boolean;
|
17
20
|
isResize?: boolean;
|
18
21
|
width?: number;
|
19
22
|
className?: string;
|
20
23
|
wrapClassName?: string;
|
24
|
+
fullscreenClassName?: string;
|
21
25
|
ref?: any;
|
22
26
|
style?: React.CSSProperties;
|
23
27
|
};
|
@@ -30,11 +34,14 @@ declare class Modal extends React.PureComponent<Props> {
|
|
30
34
|
} | undefined;
|
31
35
|
static hidden: () => void;
|
32
36
|
static destory: () => void;
|
37
|
+
state: {
|
38
|
+
isFullScreen: boolean;
|
39
|
+
};
|
33
40
|
renderFooter: () => JSX.Element | null;
|
34
41
|
containerRef: React.RefObject<any>;
|
35
42
|
titleRef: React.RefObject<any>;
|
43
|
+
componentDidUpdate(prevProps: Readonly<Props>, prevState: Readonly<{}>, snapshot?: any): void;
|
36
44
|
renderTop: () => JSX.Element;
|
37
|
-
componentDidMount(): void;
|
38
45
|
renderContent: () => any;
|
39
46
|
render(): JSX.Element;
|
40
47
|
}
|
package/dist/index.esm.js
CHANGED
@@ -3,7 +3,7 @@ import React, { useRef, useEffect, useMemo, useState, useCallback, useImperative
|
|
3
3
|
import { cloneDeep, uniqBy, chunk, isEmpty } from 'lodash-es';
|
4
4
|
import { useSyncExternalStore } from 'use-sync-external-store/shim';
|
5
5
|
import { Menu, Dropdown, Button, Input, Upload as Upload$1, Modal as Modal$2, message, InputNumber, DatePicker, Radio, Space, Checkbox, Select, Switch, Tooltip, TreeSelect as TreeSelect$1, Cascader, Form, Row, Col, Spin, Pagination, Breadcrumb, ConfigProvider, notification } from 'antd';
|
6
|
-
import { createFromIconfontCN, PlusOutlined, CloseCircleOutlined, SearchOutlined, ReloadOutlined, EllipsisOutlined, ExclamationCircleOutlined, EyeOutlined, EditOutlined, DeleteOutlined, LeftOutlined, RightOutlined, CloseOutlined } from '@ant-design/icons';
|
6
|
+
import { createFromIconfontCN, PlusOutlined, CloseCircleOutlined, SearchOutlined, ReloadOutlined, MinusOutlined, FullscreenOutlined, EllipsisOutlined, ExclamationCircleOutlined, EyeOutlined, EditOutlined, DeleteOutlined, LeftOutlined, RightOutlined, CloseOutlined } from '@ant-design/icons';
|
7
7
|
import FileViewer from 'react-file-viewer';
|
8
8
|
import classnames from 'classnames';
|
9
9
|
import zhCN from 'antd/es/date-picker/locale/zh_CN';
|
@@ -6085,6 +6085,7 @@ function DialogModel(props, ref) {
|
|
6085
6085
|
_props$className = props.className,
|
6086
6086
|
className = _props$className === void 0 ? 'default-dialog' : _props$className,
|
6087
6087
|
wrapClassName = props.wrapClassName,
|
6088
|
+
fullScreenStyle = props.fullScreenStyle,
|
6088
6089
|
style = props.style;
|
6089
6090
|
|
6090
6091
|
var _useState = useState(open),
|
@@ -6104,13 +6105,8 @@ function DialogModel(props, ref) {
|
|
6104
6105
|
|
6105
6106
|
var _useState7 = useState(false),
|
6106
6107
|
_useState8 = _slicedToArray(_useState7, 2),
|
6107
|
-
|
6108
|
-
|
6109
|
-
|
6110
|
-
var _useState9 = useState(false),
|
6111
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
6112
|
-
isDesChild = _useState10[0],
|
6113
|
-
setIsDesChild = _useState10[1];
|
6108
|
+
isDesChild = _useState8[0],
|
6109
|
+
setIsDesChild = _useState8[1];
|
6114
6110
|
|
6115
6111
|
var containerRef = useRef();
|
6116
6112
|
var ltRef = useRef();
|
@@ -6137,11 +6133,12 @@ function DialogModel(props, ref) {
|
|
6137
6133
|
}, /*#__PURE__*/React.createElement("div", {
|
6138
6134
|
ref: containerRef,
|
6139
6135
|
className: classnames((_classNames = {}, _defineProperty(_classNames, className, true), _defineProperty(_classNames, 'model_container', true), _defineProperty(_classNames, "animate__animated", true), _defineProperty(_classNames, flag ? 'animate__bounceInDown' : 'animate__fadeOutRightBig', true), _classNames)),
|
6140
|
-
style: _objectSpread2({
|
6136
|
+
style: _objectSpread2(_objectSpread2({
|
6141
6137
|
opacity: modelShowAync ? 1 : 0,
|
6142
6138
|
width: typeof width == 'number' ? width + 'px' : width,
|
6139
|
+
// transition: "width,height,left,top ease-in-out 0.3s",
|
6143
6140
|
pointerEvents: 'all'
|
6144
|
-
}, style)
|
6141
|
+
}, style), fullScreenStyle)
|
6145
6142
|
}, /*#__PURE__*/React.createElement("div", {
|
6146
6143
|
className: 'model_wrap'
|
6147
6144
|
}, isResize && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
@@ -6168,14 +6165,14 @@ function DialogModel(props, ref) {
|
|
6168
6165
|
opacity: modelShowAync ? 0.6 : 0
|
6169
6166
|
}
|
6170
6167
|
})), document.body);
|
6171
|
-
}, [modelShowAync, modelShow, props, isDesChild]);
|
6168
|
+
}, [modelShowAync, modelShow, props, isDesChild, fullScreenStyle]);
|
6172
6169
|
useEffect(function () {
|
6173
6170
|
var containerEl = containerRef.current;
|
6174
6171
|
var containerElWidth = containerEl.offsetWidth;
|
6175
6172
|
var containerElHeight = containerEl.offsetHeight;
|
6176
6173
|
containerEl.style.left = "calc(50% - ".concat(containerElWidth / 2, "px)");
|
6177
6174
|
containerEl.style.top = "calc(50% - ".concat(containerElHeight / 2, "px)");
|
6178
|
-
}, [modelShow]);
|
6175
|
+
}, [modelShow, fullScreenStyle]);
|
6179
6176
|
useEffect(function () {
|
6180
6177
|
var containerEl = containerRef.current;
|
6181
6178
|
var rEl = rRef.current;
|
@@ -6251,20 +6248,14 @@ function DialogModel(props, ref) {
|
|
6251
6248
|
};
|
6252
6249
|
}, [open]);
|
6253
6250
|
useEffect(function () {
|
6254
|
-
if (
|
6255
|
-
|
6256
|
-
}
|
6257
|
-
|
6258
|
-
if (destroyOnClose && hasVisit) {
|
6259
|
-
if (!modelShow) {
|
6260
|
-
setIsDesChild(true);
|
6261
|
-
} else {
|
6262
|
-
setIsDesChild(false);
|
6263
|
-
}
|
6251
|
+
if (destroyOnClose) {
|
6252
|
+
setIsDesChild(!modelShow);
|
6253
|
+
} else {
|
6254
|
+
setIsDesChild(false);
|
6264
6255
|
}
|
6265
6256
|
|
6266
6257
|
!modelShow && typeof closeCb === 'function' && closeCb();
|
6267
|
-
}, [modelShow,
|
6258
|
+
}, [modelShow, destroyOnClose]);
|
6268
6259
|
return renderChildren;
|
6269
6260
|
}
|
6270
6261
|
|
@@ -6288,6 +6279,9 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
6288
6279
|
}
|
6289
6280
|
|
6290
6281
|
_this = _super.call.apply(_super, [this].concat(args));
|
6282
|
+
_this.state = {
|
6283
|
+
isFullScreen: false
|
6284
|
+
};
|
6291
6285
|
|
6292
6286
|
_this.renderFooter = function () {
|
6293
6287
|
var _this$props = _this.props,
|
@@ -6324,19 +6318,62 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
6324
6318
|
onClose = _this$props2.onClose,
|
6325
6319
|
closeCb = _this$props2.closeCb,
|
6326
6320
|
renderClose = _this$props2.renderClose,
|
6327
|
-
isDrag = _this$props2.isDrag
|
6321
|
+
isDrag = _this$props2.isDrag,
|
6322
|
+
showFullscreen = _this$props2.showFullscreen,
|
6323
|
+
renderMin = _this$props2.renderMin,
|
6324
|
+
renderFullScreen = _this$props2.renderFullScreen,
|
6325
|
+
fullscreenClassName = _this$props2.fullscreenClassName;
|
6326
|
+
|
6327
|
+
var onMouseDown = function onMouseDown(eventDown) {
|
6328
|
+
if (!isDrag) return;
|
6329
|
+
if (!_this.containerRef.current) return;
|
6330
|
+
var containerEl = _this.containerRef.current.containerRef;
|
6331
|
+
var left = containerEl.offsetLeft;
|
6332
|
+
var top = containerEl.offsetTop;
|
6333
|
+
console.log(left, top);
|
6334
|
+
var downX = eventDown.clientX;
|
6335
|
+
var downY = eventDown.clientY;
|
6336
|
+
|
6337
|
+
document.onmousemove = function (eventMove) {
|
6338
|
+
eventMove.stopPropagation();
|
6339
|
+
eventMove.preventDefault();
|
6340
|
+
var moveX = eventMove.clientX - downX;
|
6341
|
+
var moveY = eventMove.clientY - downY;
|
6342
|
+
containerEl.style.left = "".concat(left + moveX, "px");
|
6343
|
+
containerEl.style.top = "".concat(top + moveY, "px");
|
6344
|
+
};
|
6345
|
+
};
|
6346
|
+
|
6347
|
+
var onMouseUp = function onMouseUp(event) {
|
6348
|
+
document.onmousemove = null;
|
6349
|
+
};
|
6350
|
+
|
6328
6351
|
return /*#__PURE__*/React.createElement("div", {
|
6329
6352
|
className: "model-header"
|
6330
6353
|
}, /*#__PURE__*/React.createElement("div", {
|
6331
6354
|
ref: _this.titleRef,
|
6355
|
+
onMouseDown: onMouseDown,
|
6356
|
+
onMouseUp: onMouseUp,
|
6332
6357
|
className: "model-title ".concat(isDrag ? 'move' : '')
|
6333
6358
|
}, title), /*#__PURE__*/React.createElement("div", {
|
6359
|
+
style: {
|
6360
|
+
display: 'flex',
|
6361
|
+
alignItems: 'center'
|
6362
|
+
},
|
6334
6363
|
className: "model-closeIcon",
|
6335
|
-
onClick: function onClick() {
|
6364
|
+
onClick: function onClick(e) {
|
6365
|
+
e.stopPropagation();
|
6336
6366
|
onClose && onClose();
|
6337
6367
|
closeCb && closeCb();
|
6338
6368
|
}
|
6339
|
-
}, renderClose ? renderClose : /*#__PURE__*/React.createElement(CloseCircleOutlined, null)
|
6369
|
+
}, renderClose ? renderClose : /*#__PURE__*/React.createElement(CloseCircleOutlined, null), showFullscreen && /*#__PURE__*/React.createElement("span", {
|
6370
|
+
className: "mr5 cp fullscreenIcon ".concat(fullscreenClassName),
|
6371
|
+
onClick: function onClick() {
|
6372
|
+
_this.setState({
|
6373
|
+
isFullScreen: !_this.state.isFullScreen
|
6374
|
+
});
|
6375
|
+
}
|
6376
|
+
}, _this.state.isFullScreen ? renderMin || /*#__PURE__*/React.createElement(MinusOutlined, null) : renderFullScreen || /*#__PURE__*/React.createElement(FullscreenOutlined, null))));
|
6340
6377
|
};
|
6341
6378
|
|
6342
6379
|
_this.renderContent = function () {
|
@@ -6350,33 +6387,15 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
6350
6387
|
}
|
6351
6388
|
|
6352
6389
|
_createClass(Modal, [{
|
6353
|
-
key: "
|
6354
|
-
value: function
|
6355
|
-
var
|
6356
|
-
if (!isDrag) return;
|
6357
|
-
var tltleEl = this.titleRef.current;
|
6358
|
-
var containerEl = this.containerRef.current.containerRef;
|
6359
|
-
|
6360
|
-
tltleEl.onmousedown = function (eventDown) {
|
6361
|
-
var left = containerEl.offsetLeft;
|
6362
|
-
var top = containerEl.offsetTop;
|
6363
|
-
console.log(left, top);
|
6364
|
-
var downX = eventDown.clientX;
|
6365
|
-
var downY = eventDown.clientY;
|
6366
|
-
|
6367
|
-
document.onmousemove = function (eventMove) {
|
6368
|
-
eventMove.stopPropagation();
|
6369
|
-
eventMove.preventDefault();
|
6370
|
-
var moveX = eventMove.clientX - downX;
|
6371
|
-
var moveY = eventMove.clientY - downY;
|
6372
|
-
containerEl.style.left = "".concat(left + moveX, "px");
|
6373
|
-
containerEl.style.top = "".concat(top + moveY, "px");
|
6374
|
-
};
|
6375
|
-
};
|
6390
|
+
key: "componentDidUpdate",
|
6391
|
+
value: function componentDidUpdate(prevProps, prevState, snapshot) {
|
6392
|
+
var open = prevProps.open;
|
6376
6393
|
|
6377
|
-
|
6378
|
-
|
6379
|
-
|
6394
|
+
if (!open) {
|
6395
|
+
this.setState({
|
6396
|
+
isFullScreen: false
|
6397
|
+
});
|
6398
|
+
}
|
6380
6399
|
}
|
6381
6400
|
}, {
|
6382
6401
|
key: "render",
|
@@ -6401,6 +6420,12 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
6401
6420
|
className: className,
|
6402
6421
|
isDrag: isDrag,
|
6403
6422
|
wrapClassName: wrapClassName,
|
6423
|
+
fullScreenStyle: this.state.isFullScreen ? {
|
6424
|
+
width: '100%',
|
6425
|
+
height: '100%',
|
6426
|
+
left: 0,
|
6427
|
+
top: 0
|
6428
|
+
} : {},
|
6404
6429
|
style: style
|
6405
6430
|
}, other), this.renderTop(), /*#__PURE__*/React.createElement("div", {
|
6406
6431
|
className: "model-content"
|
package/dist/index.js
CHANGED
@@ -6129,6 +6129,7 @@ function DialogModel(props, ref) {
|
|
6129
6129
|
_props$className = props.className,
|
6130
6130
|
className = _props$className === void 0 ? 'default-dialog' : _props$className,
|
6131
6131
|
wrapClassName = props.wrapClassName,
|
6132
|
+
fullScreenStyle = props.fullScreenStyle,
|
6132
6133
|
style = props.style;
|
6133
6134
|
|
6134
6135
|
var _useState = React.useState(open),
|
@@ -6148,13 +6149,8 @@ function DialogModel(props, ref) {
|
|
6148
6149
|
|
6149
6150
|
var _useState7 = React.useState(false),
|
6150
6151
|
_useState8 = _slicedToArray(_useState7, 2),
|
6151
|
-
|
6152
|
-
|
6153
|
-
|
6154
|
-
var _useState9 = React.useState(false),
|
6155
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
6156
|
-
isDesChild = _useState10[0],
|
6157
|
-
setIsDesChild = _useState10[1];
|
6152
|
+
isDesChild = _useState8[0],
|
6153
|
+
setIsDesChild = _useState8[1];
|
6158
6154
|
|
6159
6155
|
var containerRef = React.useRef();
|
6160
6156
|
var ltRef = React.useRef();
|
@@ -6181,11 +6177,12 @@ function DialogModel(props, ref) {
|
|
6181
6177
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
6182
6178
|
ref: containerRef,
|
6183
6179
|
className: classnames__default['default']((_classNames = {}, _defineProperty(_classNames, className, true), _defineProperty(_classNames, 'model_container', true), _defineProperty(_classNames, "animate__animated", true), _defineProperty(_classNames, flag ? 'animate__bounceInDown' : 'animate__fadeOutRightBig', true), _classNames)),
|
6184
|
-
style: _objectSpread2({
|
6180
|
+
style: _objectSpread2(_objectSpread2({
|
6185
6181
|
opacity: modelShowAync ? 1 : 0,
|
6186
6182
|
width: typeof width == 'number' ? width + 'px' : width,
|
6183
|
+
// transition: "width,height,left,top ease-in-out 0.3s",
|
6187
6184
|
pointerEvents: 'all'
|
6188
|
-
}, style)
|
6185
|
+
}, style), fullScreenStyle)
|
6189
6186
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
6190
6187
|
className: 'model_wrap'
|
6191
6188
|
}, isResize && /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", {
|
@@ -6212,14 +6209,14 @@ function DialogModel(props, ref) {
|
|
6212
6209
|
opacity: modelShowAync ? 0.6 : 0
|
6213
6210
|
}
|
6214
6211
|
})), document.body);
|
6215
|
-
}, [modelShowAync, modelShow, props, isDesChild]);
|
6212
|
+
}, [modelShowAync, modelShow, props, isDesChild, fullScreenStyle]);
|
6216
6213
|
React.useEffect(function () {
|
6217
6214
|
var containerEl = containerRef.current;
|
6218
6215
|
var containerElWidth = containerEl.offsetWidth;
|
6219
6216
|
var containerElHeight = containerEl.offsetHeight;
|
6220
6217
|
containerEl.style.left = "calc(50% - ".concat(containerElWidth / 2, "px)");
|
6221
6218
|
containerEl.style.top = "calc(50% - ".concat(containerElHeight / 2, "px)");
|
6222
|
-
}, [modelShow]);
|
6219
|
+
}, [modelShow, fullScreenStyle]);
|
6223
6220
|
React.useEffect(function () {
|
6224
6221
|
var containerEl = containerRef.current;
|
6225
6222
|
var rEl = rRef.current;
|
@@ -6295,20 +6292,14 @@ function DialogModel(props, ref) {
|
|
6295
6292
|
};
|
6296
6293
|
}, [open]);
|
6297
6294
|
React.useEffect(function () {
|
6298
|
-
if (
|
6299
|
-
|
6300
|
-
}
|
6301
|
-
|
6302
|
-
if (destroyOnClose && hasVisit) {
|
6303
|
-
if (!modelShow) {
|
6304
|
-
setIsDesChild(true);
|
6305
|
-
} else {
|
6306
|
-
setIsDesChild(false);
|
6307
|
-
}
|
6295
|
+
if (destroyOnClose) {
|
6296
|
+
setIsDesChild(!modelShow);
|
6297
|
+
} else {
|
6298
|
+
setIsDesChild(false);
|
6308
6299
|
}
|
6309
6300
|
|
6310
6301
|
!modelShow && typeof closeCb === 'function' && closeCb();
|
6311
|
-
}, [modelShow,
|
6302
|
+
}, [modelShow, destroyOnClose]);
|
6312
6303
|
return renderChildren;
|
6313
6304
|
}
|
6314
6305
|
|
@@ -6332,6 +6323,9 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
6332
6323
|
}
|
6333
6324
|
|
6334
6325
|
_this = _super.call.apply(_super, [this].concat(args));
|
6326
|
+
_this.state = {
|
6327
|
+
isFullScreen: false
|
6328
|
+
};
|
6335
6329
|
|
6336
6330
|
_this.renderFooter = function () {
|
6337
6331
|
var _this$props = _this.props,
|
@@ -6368,19 +6362,62 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
6368
6362
|
onClose = _this$props2.onClose,
|
6369
6363
|
closeCb = _this$props2.closeCb,
|
6370
6364
|
renderClose = _this$props2.renderClose,
|
6371
|
-
isDrag = _this$props2.isDrag
|
6365
|
+
isDrag = _this$props2.isDrag,
|
6366
|
+
showFullscreen = _this$props2.showFullscreen,
|
6367
|
+
renderMin = _this$props2.renderMin,
|
6368
|
+
renderFullScreen = _this$props2.renderFullScreen,
|
6369
|
+
fullscreenClassName = _this$props2.fullscreenClassName;
|
6370
|
+
|
6371
|
+
var onMouseDown = function onMouseDown(eventDown) {
|
6372
|
+
if (!isDrag) return;
|
6373
|
+
if (!_this.containerRef.current) return;
|
6374
|
+
var containerEl = _this.containerRef.current.containerRef;
|
6375
|
+
var left = containerEl.offsetLeft;
|
6376
|
+
var top = containerEl.offsetTop;
|
6377
|
+
console.log(left, top);
|
6378
|
+
var downX = eventDown.clientX;
|
6379
|
+
var downY = eventDown.clientY;
|
6380
|
+
|
6381
|
+
document.onmousemove = function (eventMove) {
|
6382
|
+
eventMove.stopPropagation();
|
6383
|
+
eventMove.preventDefault();
|
6384
|
+
var moveX = eventMove.clientX - downX;
|
6385
|
+
var moveY = eventMove.clientY - downY;
|
6386
|
+
containerEl.style.left = "".concat(left + moveX, "px");
|
6387
|
+
containerEl.style.top = "".concat(top + moveY, "px");
|
6388
|
+
};
|
6389
|
+
};
|
6390
|
+
|
6391
|
+
var onMouseUp = function onMouseUp(event) {
|
6392
|
+
document.onmousemove = null;
|
6393
|
+
};
|
6394
|
+
|
6372
6395
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
6373
6396
|
className: "model-header"
|
6374
6397
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
6375
6398
|
ref: _this.titleRef,
|
6399
|
+
onMouseDown: onMouseDown,
|
6400
|
+
onMouseUp: onMouseUp,
|
6376
6401
|
className: "model-title ".concat(isDrag ? 'move' : '')
|
6377
6402
|
}, title), /*#__PURE__*/React__default['default'].createElement("div", {
|
6403
|
+
style: {
|
6404
|
+
display: 'flex',
|
6405
|
+
alignItems: 'center'
|
6406
|
+
},
|
6378
6407
|
className: "model-closeIcon",
|
6379
|
-
onClick: function onClick() {
|
6408
|
+
onClick: function onClick(e) {
|
6409
|
+
e.stopPropagation();
|
6380
6410
|
onClose && onClose();
|
6381
6411
|
closeCb && closeCb();
|
6382
6412
|
}
|
6383
|
-
}, renderClose ? renderClose : /*#__PURE__*/React__default['default'].createElement(icons.CloseCircleOutlined, null)
|
6413
|
+
}, renderClose ? renderClose : /*#__PURE__*/React__default['default'].createElement(icons.CloseCircleOutlined, null), showFullscreen && /*#__PURE__*/React__default['default'].createElement("span", {
|
6414
|
+
className: "mr5 cp fullscreenIcon ".concat(fullscreenClassName),
|
6415
|
+
onClick: function onClick() {
|
6416
|
+
_this.setState({
|
6417
|
+
isFullScreen: !_this.state.isFullScreen
|
6418
|
+
});
|
6419
|
+
}
|
6420
|
+
}, _this.state.isFullScreen ? renderMin || /*#__PURE__*/React__default['default'].createElement(icons.MinusOutlined, null) : renderFullScreen || /*#__PURE__*/React__default['default'].createElement(icons.FullscreenOutlined, null))));
|
6384
6421
|
};
|
6385
6422
|
|
6386
6423
|
_this.renderContent = function () {
|
@@ -6394,33 +6431,15 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
6394
6431
|
}
|
6395
6432
|
|
6396
6433
|
_createClass(Modal, [{
|
6397
|
-
key: "
|
6398
|
-
value: function
|
6399
|
-
var
|
6400
|
-
if (!isDrag) return;
|
6401
|
-
var tltleEl = this.titleRef.current;
|
6402
|
-
var containerEl = this.containerRef.current.containerRef;
|
6403
|
-
|
6404
|
-
tltleEl.onmousedown = function (eventDown) {
|
6405
|
-
var left = containerEl.offsetLeft;
|
6406
|
-
var top = containerEl.offsetTop;
|
6407
|
-
console.log(left, top);
|
6408
|
-
var downX = eventDown.clientX;
|
6409
|
-
var downY = eventDown.clientY;
|
6410
|
-
|
6411
|
-
document.onmousemove = function (eventMove) {
|
6412
|
-
eventMove.stopPropagation();
|
6413
|
-
eventMove.preventDefault();
|
6414
|
-
var moveX = eventMove.clientX - downX;
|
6415
|
-
var moveY = eventMove.clientY - downY;
|
6416
|
-
containerEl.style.left = "".concat(left + moveX, "px");
|
6417
|
-
containerEl.style.top = "".concat(top + moveY, "px");
|
6418
|
-
};
|
6419
|
-
};
|
6434
|
+
key: "componentDidUpdate",
|
6435
|
+
value: function componentDidUpdate(prevProps, prevState, snapshot) {
|
6436
|
+
var open = prevProps.open;
|
6420
6437
|
|
6421
|
-
|
6422
|
-
|
6423
|
-
|
6438
|
+
if (!open) {
|
6439
|
+
this.setState({
|
6440
|
+
isFullScreen: false
|
6441
|
+
});
|
6442
|
+
}
|
6424
6443
|
}
|
6425
6444
|
}, {
|
6426
6445
|
key: "render",
|
@@ -6445,6 +6464,12 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
6445
6464
|
className: className,
|
6446
6465
|
isDrag: isDrag,
|
6447
6466
|
wrapClassName: wrapClassName,
|
6467
|
+
fullScreenStyle: this.state.isFullScreen ? {
|
6468
|
+
width: '100%',
|
6469
|
+
height: '100%',
|
6470
|
+
left: 0,
|
6471
|
+
top: 0
|
6472
|
+
} : {},
|
6448
6473
|
style: style
|
6449
6474
|
}, other), this.renderTop(), /*#__PURE__*/React__default['default'].createElement("div", {
|
6450
6475
|
className: "model-content"
|