wargerm 0.3.19 → 0.3.22

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.
@@ -9,6 +9,7 @@ declare type Props = {
9
9
  onClose?: () => void;
10
10
  okText?: string;
11
11
  cancelText?: string;
12
+ destroyOnClose?: boolean;
12
13
  visible?: boolean;
13
14
  width?: number;
14
15
  className?: string;
@@ -10,6 +10,7 @@ declare type Props = {
10
10
  okText?: string;
11
11
  cancelText?: string;
12
12
  visible?: boolean;
13
+ destroyOnClose?: boolean;
13
14
  width?: number;
14
15
  className?: string;
15
16
  style?: React.CSSProperties;
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { FormProps } from 'antd';
4
+ import { Isearch } from '../WForm';
4
5
  interface ColumnProps {
5
6
  title: string;
6
7
  dataIndex: string;
@@ -57,23 +58,6 @@ interface Iscroll {
57
58
  */
58
59
  y?: string | number;
59
60
  }
60
- declare type defaultColConfig = {
61
- xs: 24;
62
- sm: 24;
63
- md: 12;
64
- lg: 12;
65
- xl: 8;
66
- xxl: 6;
67
- };
68
- interface Isearch {
69
- labelWidth?: number | 'auto';
70
- span?: number | defaultColConfig;
71
- filterType?: 'query' | 'light';
72
- searchText?: string;
73
- resetText?: string;
74
- submitText?: string;
75
- optionRender?: ((searchConfig: any, formProps: any, dom: any) => ReactNode[]) | false;
76
- }
77
61
  declare type Props = {
78
62
  className?: string;
79
63
  rowClassName?: (record: Record<string, any>, index: number) => string;
@@ -43,6 +43,7 @@ export interface Isearch {
43
43
  submitText?: string;
44
44
  hideSubmit?: boolean;
45
45
  transform?: (value: any) => any;
46
+ optionDomReverse?: boolean;
46
47
  optionRender?: ((searchConfig: any, formProps: any, dom: any) => ReactNode[]) | false;
47
48
  }
48
49
  export interface WFormProps extends FormProps {
package/dist/index.css CHANGED
@@ -1211,7 +1211,7 @@ div.ant-picker.ant-picker-focused {
1211
1211
  align-items: baseline;
1212
1212
  }
1213
1213
  .autoScroll-outer {
1214
- overflow: hidden;
1214
+ overflow: auto;
1215
1215
  height: 100px;
1216
1216
  }
1217
1217
  @font-face {
@@ -1211,7 +1211,7 @@ div.ant-picker.ant-picker-focused {
1211
1211
  align-items: baseline;
1212
1212
  }
1213
1213
  .autoScroll-outer {
1214
- overflow: hidden;
1214
+ overflow: auto;
1215
1215
  height: 100px;
1216
1216
  }
1217
1217
  @font-face {
package/dist/index.esm.js CHANGED
@@ -8346,7 +8346,8 @@ function Table(_ref) {
8346
8346
  span: 6
8347
8347
  }, search), {}, {
8348
8348
  optionRender: function optionRender(searchConfig, formProps, dom) {
8349
- return _toConsumableArray(dom.reverse());
8349
+ // return [...dom.reverse()];
8350
+ return _toConsumableArray((search === null || search === void 0 ? void 0 : search.optionDomReverse) ? dom.reverse() : dom);
8350
8351
  }
8351
8352
  }),
8352
8353
  onSubmit: onFormSubmit,
@@ -9506,6 +9507,7 @@ var controlShow = function controlShow(f1, f2, value, timer) {
9506
9507
  function DialogModel(props) {
9507
9508
  var width = props.width,
9508
9509
  visible = props.visible,
9510
+ destroyOnClose = props.destroyOnClose,
9509
9511
  closeCb = props.closeCb,
9510
9512
  onClose = props.onClose,
9511
9513
  _props$className = props.className,
@@ -9527,6 +9529,16 @@ function DialogModel(props) {
9527
9529
  flag = _useState6[0],
9528
9530
  setFlag = _useState6[1];
9529
9531
 
9532
+ var _useState7 = useState(false),
9533
+ _useState8 = _slicedToArray(_useState7, 2),
9534
+ hasVisit = _useState8[0],
9535
+ setHasVisit = _useState8[1];
9536
+
9537
+ var _useState9 = useState(false),
9538
+ _useState10 = _slicedToArray(_useState9, 2),
9539
+ isDesChild = _useState10[0],
9540
+ setIsDesChild = _useState10[1];
9541
+
9530
9542
  var renderChildren = useMemo(function () {
9531
9543
  var _classNames;
9532
9544
 
@@ -9552,16 +9564,16 @@ function DialogModel(props) {
9552
9564
  height: '100%',
9553
9565
  position: 'relative'
9554
9566
  }
9555
- }, props.children))), /*#__PURE__*/React.createElement("div", {
9567
+ }, isDesChild ? null : props.children))), /*#__PURE__*/React.createElement("div", {
9556
9568
  className: 'mask',
9557
9569
  onClick: function onClick() {
9558
- return onClose && onClose();
9570
+ onClose && onClose();
9559
9571
  },
9560
9572
  style: {
9561
9573
  opacity: modelShowAync ? 0.6 : 0
9562
9574
  }
9563
9575
  })), document.body);
9564
- }, [modelShowAync, modelShow, props]);
9576
+ }, [modelShowAync, modelShow, props, isDesChild]);
9565
9577
  useEffect(function () {
9566
9578
  var timer;
9567
9579
  setFlag(visible);
@@ -9577,12 +9589,25 @@ function DialogModel(props) {
9577
9589
  };
9578
9590
  }, [visible]);
9579
9591
  useEffect(function () {
9592
+ if (modelShow) {
9593
+ setHasVisit(true);
9594
+ }
9595
+
9596
+ if (destroyOnClose && hasVisit) {
9597
+ if (!modelShow) {
9598
+ setIsDesChild(true);
9599
+ } else {
9600
+ setIsDesChild(false);
9601
+ }
9602
+ }
9603
+
9580
9604
  !modelShow && typeof closeCb === 'function' && closeCb();
9581
- }, [modelShow]);
9605
+ }, [modelShow, hasVisit, destroyOnClose]);
9582
9606
  return renderChildren;
9583
9607
  }
9584
9608
 
9585
- var _excluded$e = ["visible"];
9609
+ var _excluded$e = ["visible", "width", "closeCb", "onClose", "className", "style"],
9610
+ _excluded2$3 = ["visible"];
9586
9611
 
9587
9612
  var Modal = /*#__PURE__*/function (_React$PureComponent) {
9588
9613
  _inherits(Modal, _React$PureComponent);
@@ -9661,15 +9686,17 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
9661
9686
  closeCb = _this$props4.closeCb,
9662
9687
  onClose = _this$props4.onClose,
9663
9688
  className = _this$props4.className,
9664
- style = _this$props4.style;
9665
- return /*#__PURE__*/React.createElement(DialogModel, {
9689
+ style = _this$props4.style,
9690
+ other = _objectWithoutProperties(_this$props4, _excluded$e);
9691
+
9692
+ return /*#__PURE__*/React.createElement(DialogModel, _objectSpread2({
9666
9693
  closeCb: closeCb,
9667
9694
  onClose: onClose,
9668
9695
  visible: visible,
9669
9696
  width: width,
9670
9697
  className: className,
9671
9698
  style: style
9672
- }, this.renderTop(), /*#__PURE__*/React.createElement("div", {
9699
+ }, other), this.renderTop(), /*#__PURE__*/React.createElement("div", {
9673
9700
  className: "model-content"
9674
9701
  }, /*#__PURE__*/React.createElement("div", {
9675
9702
  className: "model-content-in"
@@ -9716,7 +9743,7 @@ Modal.show = function (config) {
9716
9743
  manager.setShow = setShow;
9717
9744
 
9718
9745
  var visible = props.visible,
9719
- trueProps = _objectWithoutProperties(props, _excluded$e);
9746
+ trueProps = _objectWithoutProperties(props, _excluded2$3);
9720
9747
 
9721
9748
  useEffect(function () {
9722
9749
  manager.mounted = true;
@@ -10565,7 +10592,8 @@ var TabelCard = function TabelCard(props, ref) {
10565
10592
  span: 6
10566
10593
  }, search), {}, {
10567
10594
  optionRender: function optionRender(searchConfig, formProps, dom) {
10568
- return [].concat(_toConsumableArray(dom.reverse()), [tableBarDom]);
10595
+ // return [...dom.reverse(), tableBarDom];
10596
+ return [].concat(_toConsumableArray((search === null || search === void 0 ? void 0 : search.optionDomReverse) ? dom.reverse() : dom), [tableBarDom]);
10569
10597
  }
10570
10598
  }),
10571
10599
  onSubmit: onSubmit,
package/dist/index.js CHANGED
@@ -8380,7 +8380,8 @@ function Table(_ref) {
8380
8380
  span: 6
8381
8381
  }, search), {}, {
8382
8382
  optionRender: function optionRender(searchConfig, formProps, dom) {
8383
- return _toConsumableArray(dom.reverse());
8383
+ // return [...dom.reverse()];
8384
+ return _toConsumableArray((search === null || search === void 0 ? void 0 : search.optionDomReverse) ? dom.reverse() : dom);
8384
8385
  }
8385
8386
  }),
8386
8387
  onSubmit: onFormSubmit,
@@ -9540,6 +9541,7 @@ var controlShow = function controlShow(f1, f2, value, timer) {
9540
9541
  function DialogModel(props) {
9541
9542
  var width = props.width,
9542
9543
  visible = props.visible,
9544
+ destroyOnClose = props.destroyOnClose,
9543
9545
  closeCb = props.closeCb,
9544
9546
  onClose = props.onClose,
9545
9547
  _props$className = props.className,
@@ -9561,6 +9563,16 @@ function DialogModel(props) {
9561
9563
  flag = _useState6[0],
9562
9564
  setFlag = _useState6[1];
9563
9565
 
9566
+ var _useState7 = React.useState(false),
9567
+ _useState8 = _slicedToArray(_useState7, 2),
9568
+ hasVisit = _useState8[0],
9569
+ setHasVisit = _useState8[1];
9570
+
9571
+ var _useState9 = React.useState(false),
9572
+ _useState10 = _slicedToArray(_useState9, 2),
9573
+ isDesChild = _useState10[0],
9574
+ setIsDesChild = _useState10[1];
9575
+
9564
9576
  var renderChildren = React.useMemo(function () {
9565
9577
  var _classNames;
9566
9578
 
@@ -9586,16 +9598,16 @@ function DialogModel(props) {
9586
9598
  height: '100%',
9587
9599
  position: 'relative'
9588
9600
  }
9589
- }, props.children))), /*#__PURE__*/React__default['default'].createElement("div", {
9601
+ }, isDesChild ? null : props.children))), /*#__PURE__*/React__default['default'].createElement("div", {
9590
9602
  className: 'mask',
9591
9603
  onClick: function onClick() {
9592
- return onClose && onClose();
9604
+ onClose && onClose();
9593
9605
  },
9594
9606
  style: {
9595
9607
  opacity: modelShowAync ? 0.6 : 0
9596
9608
  }
9597
9609
  })), document.body);
9598
- }, [modelShowAync, modelShow, props]);
9610
+ }, [modelShowAync, modelShow, props, isDesChild]);
9599
9611
  React.useEffect(function () {
9600
9612
  var timer;
9601
9613
  setFlag(visible);
@@ -9611,12 +9623,25 @@ function DialogModel(props) {
9611
9623
  };
9612
9624
  }, [visible]);
9613
9625
  React.useEffect(function () {
9626
+ if (modelShow) {
9627
+ setHasVisit(true);
9628
+ }
9629
+
9630
+ if (destroyOnClose && hasVisit) {
9631
+ if (!modelShow) {
9632
+ setIsDesChild(true);
9633
+ } else {
9634
+ setIsDesChild(false);
9635
+ }
9636
+ }
9637
+
9614
9638
  !modelShow && typeof closeCb === 'function' && closeCb();
9615
- }, [modelShow]);
9639
+ }, [modelShow, hasVisit, destroyOnClose]);
9616
9640
  return renderChildren;
9617
9641
  }
9618
9642
 
9619
- var _excluded$e = ["visible"];
9643
+ var _excluded$e = ["visible", "width", "closeCb", "onClose", "className", "style"],
9644
+ _excluded2$3 = ["visible"];
9620
9645
 
9621
9646
  var Modal = /*#__PURE__*/function (_React$PureComponent) {
9622
9647
  _inherits(Modal, _React$PureComponent);
@@ -9695,15 +9720,17 @@ var Modal = /*#__PURE__*/function (_React$PureComponent) {
9695
9720
  closeCb = _this$props4.closeCb,
9696
9721
  onClose = _this$props4.onClose,
9697
9722
  className = _this$props4.className,
9698
- style = _this$props4.style;
9699
- return /*#__PURE__*/React__default['default'].createElement(DialogModel, {
9723
+ style = _this$props4.style,
9724
+ other = _objectWithoutProperties(_this$props4, _excluded$e);
9725
+
9726
+ return /*#__PURE__*/React__default['default'].createElement(DialogModel, _objectSpread2({
9700
9727
  closeCb: closeCb,
9701
9728
  onClose: onClose,
9702
9729
  visible: visible,
9703
9730
  width: width,
9704
9731
  className: className,
9705
9732
  style: style
9706
- }, this.renderTop(), /*#__PURE__*/React__default['default'].createElement("div", {
9733
+ }, other), this.renderTop(), /*#__PURE__*/React__default['default'].createElement("div", {
9707
9734
  className: "model-content"
9708
9735
  }, /*#__PURE__*/React__default['default'].createElement("div", {
9709
9736
  className: "model-content-in"
@@ -9750,7 +9777,7 @@ Modal.show = function (config) {
9750
9777
  manager.setShow = setShow;
9751
9778
 
9752
9779
  var visible = props.visible,
9753
- trueProps = _objectWithoutProperties(props, _excluded$e);
9780
+ trueProps = _objectWithoutProperties(props, _excluded2$3);
9754
9781
 
9755
9782
  React.useEffect(function () {
9756
9783
  manager.mounted = true;
@@ -10599,7 +10626,8 @@ var TabelCard = function TabelCard(props, ref) {
10599
10626
  span: 6
10600
10627
  }, search), {}, {
10601
10628
  optionRender: function optionRender(searchConfig, formProps, dom) {
10602
- return [].concat(_toConsumableArray(dom.reverse()), [tableBarDom]);
10629
+ // return [...dom.reverse(), tableBarDom];
10630
+ return [].concat(_toConsumableArray((search === null || search === void 0 ? void 0 : search.optionDomReverse) ? dom.reverse() : dom), [tableBarDom]);
10603
10631
  }
10604
10632
  }),
10605
10633
  onSubmit: onSubmit,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "wargerm",
4
- "version": "0.3.19",
4
+ "version": "0.3.22",
5
5
  "scripts": {
6
6
  "dev": "dumi dev",
7
7
  "docs:build": "dumi build",