wargerm 0.7.32 → 0.7.33
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 +7 -1
- package/dist/index.esm.js +76 -52
- package/dist/index.js +75 -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,9 +11,12 @@ 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;
|
@@ -30,11 +33,14 @@ declare class Modal extends React.PureComponent<Props> {
|
|
30
33
|
} | undefined;
|
31
34
|
static hidden: () => void;
|
32
35
|
static destory: () => void;
|
36
|
+
state: {
|
37
|
+
isFullScreen: boolean;
|
38
|
+
};
|
33
39
|
renderFooter: () => JSX.Element | null;
|
34
40
|
containerRef: React.RefObject<any>;
|
35
41
|
titleRef: React.RefObject<any>;
|
42
|
+
componentDidUpdate(prevProps: Readonly<Props>, prevState: Readonly<{}>, snapshot?: any): void;
|
36
43
|
renderTop: () => JSX.Element;
|
37
|
-
componentDidMount(): void;
|
38
44
|
renderContent: () => any;
|
39
45
|
render(): JSX.Element;
|
40
46
|
}
|
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,61 @@ 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
|
+
|
6326
|
+
var onMouseDown = function onMouseDown(eventDown) {
|
6327
|
+
if (!isDrag) return;
|
6328
|
+
if (!_this.containerRef.current) return;
|
6329
|
+
var containerEl = _this.containerRef.current.containerRef;
|
6330
|
+
var left = containerEl.offsetLeft;
|
6331
|
+
var top = containerEl.offsetTop;
|
6332
|
+
console.log(left, top);
|
6333
|
+
var downX = eventDown.clientX;
|
6334
|
+
var downY = eventDown.clientY;
|
6335
|
+
|
6336
|
+
document.onmousemove = function (eventMove) {
|
6337
|
+
eventMove.stopPropagation();
|
6338
|
+
eventMove.preventDefault();
|
6339
|
+
var moveX = eventMove.clientX - downX;
|
6340
|
+
var moveY = eventMove.clientY - downY;
|
6341
|
+
containerEl.style.left = "".concat(left + moveX, "px");
|
6342
|
+
containerEl.style.top = "".concat(top + moveY, "px");
|
6343
|
+
};
|
6344
|
+
};
|
6345
|
+
|
6346
|
+
var onMouseUp = function onMouseUp(event) {
|
6347
|
+
document.onmousemove = null;
|
6348
|
+
};
|
6349
|
+
|
6328
6350
|
return /*#__PURE__*/React.createElement("div", {
|
6329
6351
|
className: "model-header"
|
6330
6352
|
}, /*#__PURE__*/React.createElement("div", {
|
6331
6353
|
ref: _this.titleRef,
|
6354
|
+
onMouseDown: onMouseDown,
|
6355
|
+
onMouseUp: onMouseUp,
|
6332
6356
|
className: "model-title ".concat(isDrag ? 'move' : '')
|
6333
6357
|
}, title), /*#__PURE__*/React.createElement("div", {
|
6334
|
-
|
6358
|
+
style: {
|
6359
|
+
display: 'flex',
|
6360
|
+
alignItems: 'center'
|
6361
|
+
},
|
6362
|
+
className: "model-closeIcon"
|
6363
|
+
}, showFullscreen && /*#__PURE__*/React.createElement("span", {
|
6364
|
+
className: 'mr5 cp',
|
6365
|
+
onClick: function onClick() {
|
6366
|
+
_this.setState({
|
6367
|
+
isFullScreen: !_this.state.isFullScreen
|
6368
|
+
});
|
6369
|
+
}
|
6370
|
+
}, _this.state.isFullScreen ? renderMin || /*#__PURE__*/React.createElement(MinusOutlined, null) : renderFullScreen || /*#__PURE__*/React.createElement(FullscreenOutlined, null)), /*#__PURE__*/React.createElement("span", {
|
6335
6371
|
onClick: function onClick() {
|
6336
6372
|
onClose && onClose();
|
6337
6373
|
closeCb && closeCb();
|
6338
6374
|
}
|
6339
|
-
}, renderClose ? renderClose : /*#__PURE__*/React.createElement(CloseCircleOutlined, null)));
|
6375
|
+
}, renderClose ? renderClose : /*#__PURE__*/React.createElement(CloseCircleOutlined, null))));
|
6340
6376
|
};
|
6341
6377
|
|
6342
6378
|
_this.renderContent = function () {
|
@@ -6350,33 +6386,15 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
6350
6386
|
}
|
6351
6387
|
|
6352
6388
|
_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;
|
6389
|
+
key: "componentDidUpdate",
|
6390
|
+
value: function componentDidUpdate(prevProps, prevState, snapshot) {
|
6391
|
+
var open = prevProps.open;
|
6366
6392
|
|
6367
|
-
|
6368
|
-
|
6369
|
-
|
6370
|
-
|
6371
|
-
|
6372
|
-
containerEl.style.left = "".concat(left + moveX, "px");
|
6373
|
-
containerEl.style.top = "".concat(top + moveY, "px");
|
6374
|
-
};
|
6375
|
-
};
|
6376
|
-
|
6377
|
-
document.onmouseup = function (eventMove) {
|
6378
|
-
document.onmousemove = null;
|
6379
|
-
};
|
6393
|
+
if (!open) {
|
6394
|
+
this.setState({
|
6395
|
+
isFullScreen: false
|
6396
|
+
});
|
6397
|
+
}
|
6380
6398
|
}
|
6381
6399
|
}, {
|
6382
6400
|
key: "render",
|
@@ -6401,6 +6419,12 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
6401
6419
|
className: className,
|
6402
6420
|
isDrag: isDrag,
|
6403
6421
|
wrapClassName: wrapClassName,
|
6422
|
+
fullScreenStyle: this.state.isFullScreen ? {
|
6423
|
+
width: '100%',
|
6424
|
+
height: '100%',
|
6425
|
+
left: 0,
|
6426
|
+
top: 0
|
6427
|
+
} : {},
|
6404
6428
|
style: style
|
6405
6429
|
}, other), this.renderTop(), /*#__PURE__*/React.createElement("div", {
|
6406
6430
|
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,61 @@ 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
|
+
|
6370
|
+
var onMouseDown = function onMouseDown(eventDown) {
|
6371
|
+
if (!isDrag) return;
|
6372
|
+
if (!_this.containerRef.current) return;
|
6373
|
+
var containerEl = _this.containerRef.current.containerRef;
|
6374
|
+
var left = containerEl.offsetLeft;
|
6375
|
+
var top = containerEl.offsetTop;
|
6376
|
+
console.log(left, top);
|
6377
|
+
var downX = eventDown.clientX;
|
6378
|
+
var downY = eventDown.clientY;
|
6379
|
+
|
6380
|
+
document.onmousemove = function (eventMove) {
|
6381
|
+
eventMove.stopPropagation();
|
6382
|
+
eventMove.preventDefault();
|
6383
|
+
var moveX = eventMove.clientX - downX;
|
6384
|
+
var moveY = eventMove.clientY - downY;
|
6385
|
+
containerEl.style.left = "".concat(left + moveX, "px");
|
6386
|
+
containerEl.style.top = "".concat(top + moveY, "px");
|
6387
|
+
};
|
6388
|
+
};
|
6389
|
+
|
6390
|
+
var onMouseUp = function onMouseUp(event) {
|
6391
|
+
document.onmousemove = null;
|
6392
|
+
};
|
6393
|
+
|
6372
6394
|
return /*#__PURE__*/React__default['default'].createElement("div", {
|
6373
6395
|
className: "model-header"
|
6374
6396
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
6375
6397
|
ref: _this.titleRef,
|
6398
|
+
onMouseDown: onMouseDown,
|
6399
|
+
onMouseUp: onMouseUp,
|
6376
6400
|
className: "model-title ".concat(isDrag ? 'move' : '')
|
6377
6401
|
}, title), /*#__PURE__*/React__default['default'].createElement("div", {
|
6378
|
-
|
6402
|
+
style: {
|
6403
|
+
display: 'flex',
|
6404
|
+
alignItems: 'center'
|
6405
|
+
},
|
6406
|
+
className: "model-closeIcon"
|
6407
|
+
}, showFullscreen && /*#__PURE__*/React__default['default'].createElement("span", {
|
6408
|
+
className: 'mr5 cp',
|
6409
|
+
onClick: function onClick() {
|
6410
|
+
_this.setState({
|
6411
|
+
isFullScreen: !_this.state.isFullScreen
|
6412
|
+
});
|
6413
|
+
}
|
6414
|
+
}, _this.state.isFullScreen ? renderMin || /*#__PURE__*/React__default['default'].createElement(icons.MinusOutlined, null) : renderFullScreen || /*#__PURE__*/React__default['default'].createElement(icons.FullscreenOutlined, null)), /*#__PURE__*/React__default['default'].createElement("span", {
|
6379
6415
|
onClick: function onClick() {
|
6380
6416
|
onClose && onClose();
|
6381
6417
|
closeCb && closeCb();
|
6382
6418
|
}
|
6383
|
-
}, renderClose ? renderClose : /*#__PURE__*/React__default['default'].createElement(icons.CloseCircleOutlined, null)));
|
6419
|
+
}, renderClose ? renderClose : /*#__PURE__*/React__default['default'].createElement(icons.CloseCircleOutlined, null))));
|
6384
6420
|
};
|
6385
6421
|
|
6386
6422
|
_this.renderContent = function () {
|
@@ -6394,33 +6430,15 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
6394
6430
|
}
|
6395
6431
|
|
6396
6432
|
_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;
|
6433
|
+
key: "componentDidUpdate",
|
6434
|
+
value: function componentDidUpdate(prevProps, prevState, snapshot) {
|
6435
|
+
var open = prevProps.open;
|
6410
6436
|
|
6411
|
-
|
6412
|
-
|
6413
|
-
|
6414
|
-
|
6415
|
-
|
6416
|
-
containerEl.style.left = "".concat(left + moveX, "px");
|
6417
|
-
containerEl.style.top = "".concat(top + moveY, "px");
|
6418
|
-
};
|
6419
|
-
};
|
6420
|
-
|
6421
|
-
document.onmouseup = function (eventMove) {
|
6422
|
-
document.onmousemove = null;
|
6423
|
-
};
|
6437
|
+
if (!open) {
|
6438
|
+
this.setState({
|
6439
|
+
isFullScreen: false
|
6440
|
+
});
|
6441
|
+
}
|
6424
6442
|
}
|
6425
6443
|
}, {
|
6426
6444
|
key: "render",
|
@@ -6445,6 +6463,12 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
6445
6463
|
className: className,
|
6446
6464
|
isDrag: isDrag,
|
6447
6465
|
wrapClassName: wrapClassName,
|
6466
|
+
fullScreenStyle: this.state.isFullScreen ? {
|
6467
|
+
width: '100%',
|
6468
|
+
height: '100%',
|
6469
|
+
left: 0,
|
6470
|
+
top: 0
|
6471
|
+
} : {},
|
6448
6472
|
style: style
|
6449
6473
|
}, other), this.renderTop(), /*#__PURE__*/React__default['default'].createElement("div", {
|
6450
6474
|
className: "model-content"
|