wargerm 0.3.19 → 0.3.20
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 +1 -0
- package/dist/index.css +1 -1
- package/dist/index.esm.css +1 -1
- package/dist/index.esm.js +35 -9
- package/dist/index.js +35 -9
- package/package.json +1 -1
package/dist/index.css
CHANGED
package/dist/index.esm.css
CHANGED
package/dist/index.esm.js
CHANGED
@@ -9506,6 +9506,7 @@ var controlShow = function controlShow(f1, f2, value, timer) {
|
|
9506
9506
|
function DialogModel(props) {
|
9507
9507
|
var width = props.width,
|
9508
9508
|
visible = props.visible,
|
9509
|
+
destroyOnClose = props.destroyOnClose,
|
9509
9510
|
closeCb = props.closeCb,
|
9510
9511
|
onClose = props.onClose,
|
9511
9512
|
_props$className = props.className,
|
@@ -9527,6 +9528,16 @@ function DialogModel(props) {
|
|
9527
9528
|
flag = _useState6[0],
|
9528
9529
|
setFlag = _useState6[1];
|
9529
9530
|
|
9531
|
+
var _useState7 = useState(false),
|
9532
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
9533
|
+
hasVisit = _useState8[0],
|
9534
|
+
setHasVisit = _useState8[1];
|
9535
|
+
|
9536
|
+
var _useState9 = useState(false),
|
9537
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
9538
|
+
isDesChild = _useState10[0],
|
9539
|
+
setIsDesChild = _useState10[1];
|
9540
|
+
|
9530
9541
|
var renderChildren = useMemo(function () {
|
9531
9542
|
var _classNames;
|
9532
9543
|
|
@@ -9552,16 +9563,16 @@ function DialogModel(props) {
|
|
9552
9563
|
height: '100%',
|
9553
9564
|
position: 'relative'
|
9554
9565
|
}
|
9555
|
-
}, props.children))), /*#__PURE__*/React.createElement("div", {
|
9566
|
+
}, isDesChild ? null : props.children))), /*#__PURE__*/React.createElement("div", {
|
9556
9567
|
className: 'mask',
|
9557
9568
|
onClick: function onClick() {
|
9558
|
-
|
9569
|
+
onClose && onClose();
|
9559
9570
|
},
|
9560
9571
|
style: {
|
9561
9572
|
opacity: modelShowAync ? 0.6 : 0
|
9562
9573
|
}
|
9563
9574
|
})), document.body);
|
9564
|
-
}, [modelShowAync, modelShow, props]);
|
9575
|
+
}, [modelShowAync, modelShow, props, isDesChild]);
|
9565
9576
|
useEffect(function () {
|
9566
9577
|
var timer;
|
9567
9578
|
setFlag(visible);
|
@@ -9577,12 +9588,25 @@ function DialogModel(props) {
|
|
9577
9588
|
};
|
9578
9589
|
}, [visible]);
|
9579
9590
|
useEffect(function () {
|
9591
|
+
if (modelShow) {
|
9592
|
+
setHasVisit(true);
|
9593
|
+
}
|
9594
|
+
|
9595
|
+
if (destroyOnClose && hasVisit) {
|
9596
|
+
if (!modelShow) {
|
9597
|
+
setIsDesChild(true);
|
9598
|
+
} else {
|
9599
|
+
setIsDesChild(false);
|
9600
|
+
}
|
9601
|
+
}
|
9602
|
+
|
9580
9603
|
!modelShow && typeof closeCb === 'function' && closeCb();
|
9581
|
-
}, [modelShow]);
|
9604
|
+
}, [modelShow, hasVisit, destroyOnClose]);
|
9582
9605
|
return renderChildren;
|
9583
9606
|
}
|
9584
9607
|
|
9585
|
-
var _excluded$e = ["visible"]
|
9608
|
+
var _excluded$e = ["visible", "width", "closeCb", "onClose", "className", "style"],
|
9609
|
+
_excluded2$3 = ["visible"];
|
9586
9610
|
|
9587
9611
|
var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
9588
9612
|
_inherits(Modal, _React$PureComponent);
|
@@ -9661,15 +9685,17 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
9661
9685
|
closeCb = _this$props4.closeCb,
|
9662
9686
|
onClose = _this$props4.onClose,
|
9663
9687
|
className = _this$props4.className,
|
9664
|
-
style = _this$props4.style
|
9665
|
-
|
9688
|
+
style = _this$props4.style,
|
9689
|
+
other = _objectWithoutProperties(_this$props4, _excluded$e);
|
9690
|
+
|
9691
|
+
return /*#__PURE__*/React.createElement(DialogModel, _objectSpread2({
|
9666
9692
|
closeCb: closeCb,
|
9667
9693
|
onClose: onClose,
|
9668
9694
|
visible: visible,
|
9669
9695
|
width: width,
|
9670
9696
|
className: className,
|
9671
9697
|
style: style
|
9672
|
-
}, this.renderTop(), /*#__PURE__*/React.createElement("div", {
|
9698
|
+
}, other), this.renderTop(), /*#__PURE__*/React.createElement("div", {
|
9673
9699
|
className: "model-content"
|
9674
9700
|
}, /*#__PURE__*/React.createElement("div", {
|
9675
9701
|
className: "model-content-in"
|
@@ -9716,7 +9742,7 @@ Modal.show = function (config) {
|
|
9716
9742
|
manager.setShow = setShow;
|
9717
9743
|
|
9718
9744
|
var visible = props.visible,
|
9719
|
-
trueProps = _objectWithoutProperties(props,
|
9745
|
+
trueProps = _objectWithoutProperties(props, _excluded2$3);
|
9720
9746
|
|
9721
9747
|
useEffect(function () {
|
9722
9748
|
manager.mounted = true;
|
package/dist/index.js
CHANGED
@@ -9540,6 +9540,7 @@ var controlShow = function controlShow(f1, f2, value, timer) {
|
|
9540
9540
|
function DialogModel(props) {
|
9541
9541
|
var width = props.width,
|
9542
9542
|
visible = props.visible,
|
9543
|
+
destroyOnClose = props.destroyOnClose,
|
9543
9544
|
closeCb = props.closeCb,
|
9544
9545
|
onClose = props.onClose,
|
9545
9546
|
_props$className = props.className,
|
@@ -9561,6 +9562,16 @@ function DialogModel(props) {
|
|
9561
9562
|
flag = _useState6[0],
|
9562
9563
|
setFlag = _useState6[1];
|
9563
9564
|
|
9565
|
+
var _useState7 = React.useState(false),
|
9566
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
9567
|
+
hasVisit = _useState8[0],
|
9568
|
+
setHasVisit = _useState8[1];
|
9569
|
+
|
9570
|
+
var _useState9 = React.useState(false),
|
9571
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
9572
|
+
isDesChild = _useState10[0],
|
9573
|
+
setIsDesChild = _useState10[1];
|
9574
|
+
|
9564
9575
|
var renderChildren = React.useMemo(function () {
|
9565
9576
|
var _classNames;
|
9566
9577
|
|
@@ -9586,16 +9597,16 @@ function DialogModel(props) {
|
|
9586
9597
|
height: '100%',
|
9587
9598
|
position: 'relative'
|
9588
9599
|
}
|
9589
|
-
}, props.children))), /*#__PURE__*/React__default['default'].createElement("div", {
|
9600
|
+
}, isDesChild ? null : props.children))), /*#__PURE__*/React__default['default'].createElement("div", {
|
9590
9601
|
className: 'mask',
|
9591
9602
|
onClick: function onClick() {
|
9592
|
-
|
9603
|
+
onClose && onClose();
|
9593
9604
|
},
|
9594
9605
|
style: {
|
9595
9606
|
opacity: modelShowAync ? 0.6 : 0
|
9596
9607
|
}
|
9597
9608
|
})), document.body);
|
9598
|
-
}, [modelShowAync, modelShow, props]);
|
9609
|
+
}, [modelShowAync, modelShow, props, isDesChild]);
|
9599
9610
|
React.useEffect(function () {
|
9600
9611
|
var timer;
|
9601
9612
|
setFlag(visible);
|
@@ -9611,12 +9622,25 @@ function DialogModel(props) {
|
|
9611
9622
|
};
|
9612
9623
|
}, [visible]);
|
9613
9624
|
React.useEffect(function () {
|
9625
|
+
if (modelShow) {
|
9626
|
+
setHasVisit(true);
|
9627
|
+
}
|
9628
|
+
|
9629
|
+
if (destroyOnClose && hasVisit) {
|
9630
|
+
if (!modelShow) {
|
9631
|
+
setIsDesChild(true);
|
9632
|
+
} else {
|
9633
|
+
setIsDesChild(false);
|
9634
|
+
}
|
9635
|
+
}
|
9636
|
+
|
9614
9637
|
!modelShow && typeof closeCb === 'function' && closeCb();
|
9615
|
-
}, [modelShow]);
|
9638
|
+
}, [modelShow, hasVisit, destroyOnClose]);
|
9616
9639
|
return renderChildren;
|
9617
9640
|
}
|
9618
9641
|
|
9619
|
-
var _excluded$e = ["visible"]
|
9642
|
+
var _excluded$e = ["visible", "width", "closeCb", "onClose", "className", "style"],
|
9643
|
+
_excluded2$3 = ["visible"];
|
9620
9644
|
|
9621
9645
|
var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
9622
9646
|
_inherits(Modal, _React$PureComponent);
|
@@ -9695,15 +9719,17 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
|
|
9695
9719
|
closeCb = _this$props4.closeCb,
|
9696
9720
|
onClose = _this$props4.onClose,
|
9697
9721
|
className = _this$props4.className,
|
9698
|
-
style = _this$props4.style
|
9699
|
-
|
9722
|
+
style = _this$props4.style,
|
9723
|
+
other = _objectWithoutProperties(_this$props4, _excluded$e);
|
9724
|
+
|
9725
|
+
return /*#__PURE__*/React__default['default'].createElement(DialogModel, _objectSpread2({
|
9700
9726
|
closeCb: closeCb,
|
9701
9727
|
onClose: onClose,
|
9702
9728
|
visible: visible,
|
9703
9729
|
width: width,
|
9704
9730
|
className: className,
|
9705
9731
|
style: style
|
9706
|
-
}, this.renderTop(), /*#__PURE__*/React__default['default'].createElement("div", {
|
9732
|
+
}, other), this.renderTop(), /*#__PURE__*/React__default['default'].createElement("div", {
|
9707
9733
|
className: "model-content"
|
9708
9734
|
}, /*#__PURE__*/React__default['default'].createElement("div", {
|
9709
9735
|
className: "model-content-in"
|
@@ -9750,7 +9776,7 @@ Modal.show = function (config) {
|
|
9750
9776
|
manager.setShow = setShow;
|
9751
9777
|
|
9752
9778
|
var visible = props.visible,
|
9753
|
-
trueProps = _objectWithoutProperties(props,
|
9779
|
+
trueProps = _objectWithoutProperties(props, _excluded2$3);
|
9754
9780
|
|
9755
9781
|
React.useEffect(function () {
|
9756
9782
|
manager.mounted = true;
|