@bchr/bchr-front-lib 0.3.146 → 0.3.149

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.
@@ -41,7 +41,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
41
41
 
42
42
  var ButtonGroup = _antd.Button.Group;
43
43
 
44
- var FormModifyModal = function FormModifyModal(props) {
44
+ var FormModifyModal = function FormModifyModal(props, ref) {
45
+ (0, _react.useImperativeHandle)(ref, function () {
46
+ return {
47
+ closeLoading: closeLoading
48
+ };
49
+ });
45
50
  var formref = props.formref,
46
51
  onOk = props.onOk,
47
52
  data = props.data,
@@ -92,6 +97,10 @@ var FormModifyModal = function FormModifyModal(props) {
92
97
  });
93
98
  };
94
99
 
100
+ var closeLoading = function closeLoading() {
101
+ setLoading(false);
102
+ };
103
+
95
104
  return /*#__PURE__*/_react["default"].createElement(_SModal["default"], {
96
105
  className: "form-modify-modal my-fix-auto-height",
97
106
  width: 1000,
@@ -126,5 +135,6 @@ var FormModifyModal = function FormModifyModal(props) {
126
135
  })))));
127
136
  };
128
137
 
129
- var _default = FormModifyModal;
138
+ var _default = /*#__PURE__*/(0, _react.forwardRef)(FormModifyModal);
139
+
130
140
  exports["default"] = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bchr/bchr-front-lib",
3
- "version": "0.3.146",
3
+ "version": "0.3.149",
4
4
  "description": "bchr front lib",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -1,11 +1,16 @@
1
- import React, {useEffect, useState} from 'react';
1
+ import React, {useEffect, useState, forwardRef, useImperativeHandle} from 'react';
2
2
  import SModal from "../../modal/SModal";
3
3
  import {Button, message, Spin} from "antd";
4
4
  import FormForModify from "../form/FormForModify";
5
5
  import $ from 'jquery';
6
6
 
7
7
  const ButtonGroup = Button.Group;
8
- const FormModifyModal = (props) => {
8
+ const FormModifyModal = (props, ref) => {
9
+
10
+ useImperativeHandle(ref, () => ({
11
+ closeLoading
12
+ }));
13
+
9
14
  let {
10
15
  formref,
11
16
  onOk,
@@ -42,6 +47,10 @@ const FormModifyModal = (props) => {
42
47
  });
43
48
  };
44
49
 
50
+ const closeLoading = () => {
51
+ setLoading(false);
52
+ }
53
+
45
54
  return (
46
55
  <SModal
47
56
  className="form-modify-modal my-fix-auto-height"
@@ -73,4 +82,4 @@ const FormModifyModal = (props) => {
73
82
  )
74
83
  }
75
84
 
76
- export default FormModifyModal;
85
+ export default forwardRef(FormModifyModal);