@zhubangyun/lowcode-core 5.4.115 → 5.4.116
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/es/index.d.ts +1 -2
- package/es/index.js +1 -2
- package/{lib/utils/form/form.api.d.ts → es/utils/api/form-api.d.ts} +1 -1
- package/es/utils/{form/form.api.js → api/form-api.js} +2 -2
- package/es/utils/api/index.d.ts +5 -3
- package/es/utils/api/index.js +4 -2
- package/es/utils/api/{RestApi.js → rest-api.js} +1 -1
- package/es/utils/cache/index.d.ts +1 -1
- package/es/utils/cache/index.js +1 -1
- package/es/utils/page/index.d.ts +1 -1
- package/es/utils/page/index.js +1 -1
- package/{lib/utils/page/page.form.d.ts → es/utils/page/page-form.d.ts} +1 -1
- package/es/utils/page/{page.form.js → page-form.js} +31 -10
- package/lib/index.d.ts +1 -2
- package/lib/index.js +5 -5
- package/{es/utils/form/form.api.d.ts → lib/utils/api/form-api.d.ts} +1 -1
- package/lib/utils/{form/form.api.js → api/form-api.js} +4 -4
- package/lib/utils/api/index.d.ts +5 -3
- package/lib/utils/api/index.js +9 -5
- package/lib/utils/api/{RestApi.js → rest-api.js} +2 -2
- package/lib/utils/cache/index.d.ts +1 -1
- package/lib/utils/cache/index.js +2 -2
- package/lib/utils/page/index.d.ts +1 -1
- package/lib/utils/page/index.js +2 -2
- package/{es/utils/page/page.form.d.ts → lib/utils/page/page-form.d.ts} +1 -1
- package/lib/utils/page/{page.form.js → page-form.js} +33 -12
- package/package.json +1 -1
- /package/es/utils/{form/form.instance.d.ts → api/form-instance.d.ts} +0 -0
- /package/es/utils/{form/form.instance.js → api/form-instance.js} +0 -0
- /package/es/utils/api/{Request.d.ts → request.d.ts} +0 -0
- /package/es/utils/api/{Request.js → request.js} +0 -0
- /package/es/utils/api/{RestApi.d.ts → rest-api.d.ts} +0 -0
- /package/es/utils/api/{UserInfo.d.ts → user-info.d.ts} +0 -0
- /package/es/utils/api/{UserInfo.js → user-info.js} +0 -0
- /package/es/utils/page/{page.layout.d.ts → page-layout.d.ts} +0 -0
- /package/es/utils/page/{page.layout.js → page-layout.js} +0 -0
- /package/es/utils/page/{page.load-schema.d.ts → page-load-schema.d.ts} +0 -0
- /package/es/utils/page/{page.load-schema.js → page-load-schema.js} +0 -0
- /package/lib/utils/{form/form.instance.d.ts → api/form-instance.d.ts} +0 -0
- /package/lib/utils/{form/form.instance.js → api/form-instance.js} +0 -0
- /package/lib/utils/api/{Request.d.ts → request.d.ts} +0 -0
- /package/lib/utils/api/{Request.js → request.js} +0 -0
- /package/lib/utils/api/{RestApi.d.ts → rest-api.d.ts} +0 -0
- /package/lib/utils/api/{UserInfo.d.ts → user-info.d.ts} +0 -0
- /package/lib/utils/api/{UserInfo.js → user-info.js} +0 -0
- /package/lib/utils/page/{page.layout.d.ts → page-layout.d.ts} +0 -0
- /package/lib/utils/page/{page.layout.js → page-layout.js} +0 -0
- /package/lib/utils/page/{page.load-schema.d.ts → page-load-schema.d.ts} +0 -0
- /package/lib/utils/page/{page.load-schema.js → page-load-schema.js} +0 -0
package/es/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import utils from "./utils";
|
|
2
|
-
export { RestApi } from "./utils/api
|
|
3
|
-
export { RestFormApi } from "./utils/form/form.api";
|
|
2
|
+
export { RestApi, RestFormApi, apiRequest } from "./utils/api";
|
|
4
3
|
export { Layout } from "./components/layout";
|
|
5
4
|
export { ReactRender } from "./components/react-render";
|
|
6
5
|
export { utils };
|
package/es/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import utils from "./utils";
|
|
2
|
-
export { RestApi } from "./utils/api
|
|
3
|
-
export { RestFormApi } from "./utils/form/form.api";
|
|
2
|
+
export { RestApi, RestFormApi, apiRequest } from "./utils/api";
|
|
4
3
|
export { Layout } from "./components/layout";
|
|
5
4
|
export { ReactRender } from "./components/react-render";
|
|
6
5
|
// @ts-ignore
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
|
-
import { RestApi } from "
|
|
5
|
-
import { getSchema } from "
|
|
4
|
+
import { RestApi } from "./rest-api";
|
|
5
|
+
import { getSchema } from "./index";
|
|
6
6
|
export var RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
7
7
|
function RestFormApi(formId, fieldId, mock) {
|
|
8
8
|
var _this;
|
package/es/utils/api/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { OneResult } from "./
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { OneResult } from "./rest-api";
|
|
2
|
+
export { RestApi } from "./rest-api";
|
|
3
|
+
import { RestFormApi } from "./form-api";
|
|
4
|
+
export { loadUserInfo } from "./user-info";
|
|
5
|
+
export { RestFormApi } from "./form-api";
|
|
4
6
|
export declare const apiRequest: import("axios").AxiosInstance;
|
|
5
7
|
export declare function getSchema(pageId: string, mock?: boolean): Promise<OneResult<any>>;
|
|
6
8
|
export declare function getFormApi(formId: string, fieldId?: string, mock?: boolean): Promise<RestFormApi<any>>;
|
package/es/utils/api/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import axios from "axios";
|
|
4
|
-
import { onFulfilled, onRejected } from "./
|
|
4
|
+
import { onFulfilled, onRejected } from "./request";
|
|
5
5
|
import { formApi, schema } from "../cache";
|
|
6
|
-
export {
|
|
6
|
+
export { RestApi } from "./rest-api";
|
|
7
|
+
export { loadUserInfo } from "./user-info";
|
|
8
|
+
export { RestFormApi } from "./form-api";
|
|
7
9
|
export var apiRequest = axios.create({
|
|
8
10
|
baseURL: "/api",
|
|
9
11
|
// 基础URL
|
|
@@ -2,7 +2,7 @@ import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import axios from "axios";
|
|
5
|
-
import { onFulfilled, onRejected } from "./
|
|
5
|
+
import { onFulfilled, onRejected } from "./request";
|
|
6
6
|
export var BaseRestApi = /*#__PURE__*/function () {
|
|
7
7
|
function BaseRestApi(uri, options) {
|
|
8
8
|
this.uri = void 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SingletonInstanceMap } from "../common/SingletonInstanceMap";
|
|
2
|
-
import { RestFormApi } from "../
|
|
2
|
+
import { RestFormApi } from "../api/form-api";
|
|
3
3
|
export declare class SchemaCache extends SingletonInstanceMap<any, {
|
|
4
4
|
mock?: boolean;
|
|
5
5
|
pageId: string;
|
package/es/utils/cache/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import { SingletonInstanceMap } from "../common/SingletonInstanceMap";
|
|
5
|
-
import { RestFormApi } from "../
|
|
5
|
+
import { RestFormApi } from "../api/form-api";
|
|
6
6
|
import { handleFormSchema } from "./schema";
|
|
7
7
|
import { apiRequest } from "../api";
|
|
8
8
|
export var SchemaCache = /*#__PURE__*/function (_SingletonInstanceMap) {
|
package/es/utils/page/index.d.ts
CHANGED
package/es/utils/page/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { showForm } from "./page
|
|
1
|
+
export { showForm } from "./page-form";
|
|
@@ -3,12 +3,12 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
4
4
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
5
5
|
var _excluded = ["container", "onClose"],
|
|
6
|
-
_excluded2 = ["layout", "form"];
|
|
6
|
+
_excluded2 = ["layout", "form", "onClose"];
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
|
-
import { PageLayout } from "./page
|
|
8
|
+
import { PageLayout } from "./page-layout";
|
|
9
9
|
import ReactDOM from "react-dom";
|
|
10
10
|
import { Component } from "react";
|
|
11
|
-
import { PageLoadSchema } from "./page
|
|
11
|
+
import { PageLoadSchema } from "./page-load-schema";
|
|
12
12
|
import { ReactRender } from "../../components/react-render";
|
|
13
13
|
export function showForm(options) {
|
|
14
14
|
var container = options.container,
|
|
@@ -22,15 +22,18 @@ export function showForm(options) {
|
|
|
22
22
|
}
|
|
23
23
|
ReactDOM.render( /*#__PURE__*/React.createElement(FormRender, _extends({}, restProps, {
|
|
24
24
|
onClose: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
25
|
-
var _container;
|
|
26
25
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
27
26
|
while (1) switch (_context.prev = _context.next) {
|
|
28
27
|
case 0:
|
|
29
28
|
if (unmount) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
//等待动画结束
|
|
30
|
+
setTimeout(function () {
|
|
31
|
+
var _container;
|
|
32
|
+
//取消挂载
|
|
33
|
+
ReactDOM.unmountComponentAtNode(container);
|
|
34
|
+
//移除
|
|
35
|
+
(_container = container) === null || _container === void 0 ? void 0 : _container.remove();
|
|
36
|
+
}, 1000);
|
|
34
37
|
}
|
|
35
38
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
36
39
|
case 2:
|
|
@@ -43,19 +46,37 @@ export function showForm(options) {
|
|
|
43
46
|
}
|
|
44
47
|
var FormRender = /*#__PURE__*/function (_Component) {
|
|
45
48
|
function FormRender() {
|
|
46
|
-
|
|
49
|
+
var _this;
|
|
50
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
51
|
+
args[_key] = arguments[_key];
|
|
52
|
+
}
|
|
53
|
+
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
|
|
54
|
+
_this.layoutRef = void 0;
|
|
55
|
+
return _this;
|
|
47
56
|
}
|
|
48
57
|
_inheritsLoose(FormRender, _Component);
|
|
49
58
|
var _proto = FormRender.prototype;
|
|
50
59
|
_proto.render = function render() {
|
|
60
|
+
var _this2 = this;
|
|
61
|
+
var self = this;
|
|
51
62
|
var _this$props = this.props,
|
|
52
63
|
layout = _this$props.layout,
|
|
53
64
|
form = _this$props.form,
|
|
65
|
+
onClose = _this$props.onClose,
|
|
54
66
|
restProps = _objectWithoutPropertiesLoose(_this$props, _excluded2);
|
|
55
67
|
// @ts-ignore
|
|
56
68
|
restProps.layout = layout || "drawer";
|
|
69
|
+
// @ts-ignore
|
|
70
|
+
restProps.onClose = function () {
|
|
71
|
+
var _self$layoutRef;
|
|
72
|
+
(_self$layoutRef = self.layoutRef) === null || _self$layoutRef === void 0 ? void 0 : _self$layoutRef.close();
|
|
73
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
74
|
+
};
|
|
57
75
|
return /*#__PURE__*/React.createElement(PageLayout, {
|
|
58
|
-
layout: layout
|
|
76
|
+
layout: layout,
|
|
77
|
+
ref: function ref(layout) {
|
|
78
|
+
return _this2.layoutRef = layout;
|
|
79
|
+
}
|
|
59
80
|
}, /*#__PURE__*/React.createElement(PageLoadSchema, {
|
|
60
81
|
pageId: form === null || form === void 0 ? void 0 : form.id
|
|
61
82
|
}, function (schema) {
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import utils from "./utils";
|
|
2
|
-
export { RestApi } from "./utils/api
|
|
3
|
-
export { RestFormApi } from "./utils/form/form.api";
|
|
2
|
+
export { RestApi, RestFormApi, apiRequest } from "./utils/api";
|
|
4
3
|
export { Layout } from "./components/layout";
|
|
5
4
|
export { ReactRender } from "./components/react-render";
|
|
6
5
|
export { utils };
|
package/lib/index.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.RestFormApi = exports.RestApi = exports.ReactRender = exports.Layout = void 0;
|
|
5
|
+
exports.apiRequest = exports.RestFormApi = exports.RestApi = exports.ReactRender = exports.Layout = void 0;
|
|
6
6
|
var _utils = _interopRequireDefault(require("./utils"));
|
|
7
7
|
exports.utils = _utils["default"];
|
|
8
|
-
var
|
|
9
|
-
exports.RestApi =
|
|
10
|
-
|
|
11
|
-
exports.
|
|
8
|
+
var _api = require("./utils/api");
|
|
9
|
+
exports.RestApi = _api.RestApi;
|
|
10
|
+
exports.RestFormApi = _api.RestFormApi;
|
|
11
|
+
exports.apiRequest = _api.apiRequest;
|
|
12
12
|
var _layout = require("./components/layout");
|
|
13
13
|
exports.Layout = _layout.Layout;
|
|
14
14
|
var _reactRender = require("./components/react-render");
|
|
@@ -6,8 +6,8 @@ exports.RestFormApi = void 0;
|
|
|
6
6
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
7
7
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
8
|
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var _restApi = require("./rest-api");
|
|
10
|
+
var _index = require("./index");
|
|
11
11
|
var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
12
12
|
function RestFormApi(formId, fieldId, mock) {
|
|
13
13
|
var _this;
|
|
@@ -38,7 +38,7 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
38
38
|
case 4:
|
|
39
39
|
_context.prev = 4;
|
|
40
40
|
_context.next = 7;
|
|
41
|
-
return (0,
|
|
41
|
+
return (0, _index.getSchema)(this.formId, this.mock);
|
|
42
42
|
case 7:
|
|
43
43
|
res = _context.sent;
|
|
44
44
|
this.schema = res.data;
|
|
@@ -91,4 +91,4 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
91
91
|
return handleRequestConfig;
|
|
92
92
|
}();
|
|
93
93
|
return RestFormApi;
|
|
94
|
-
}(
|
|
94
|
+
}(_restApi.RestApi);
|
package/lib/utils/api/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { OneResult } from "./
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { OneResult } from "./rest-api";
|
|
2
|
+
export { RestApi } from "./rest-api";
|
|
3
|
+
import { RestFormApi } from "./form-api";
|
|
4
|
+
export { loadUserInfo } from "./user-info";
|
|
5
|
+
export { RestFormApi } from "./form-api";
|
|
4
6
|
export declare const apiRequest: import("axios").AxiosInstance;
|
|
5
7
|
export declare function getSchema(pageId: string, mock?: boolean): Promise<OneResult<any>>;
|
|
6
8
|
export declare function getFormApi(formId: string, fieldId?: string, mock?: boolean): Promise<RestFormApi<any>>;
|
package/lib/utils/api/index.js
CHANGED
|
@@ -2,17 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.apiRequest = void 0;
|
|
5
|
+
exports.apiRequest = exports.RestFormApi = exports.RestApi = void 0;
|
|
6
6
|
exports.getFormApi = getFormApi;
|
|
7
7
|
exports.getSchema = getSchema;
|
|
8
8
|
exports.loadUserInfo = void 0;
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
11
|
var _axios = _interopRequireDefault(require("axios"));
|
|
12
|
-
var
|
|
12
|
+
var _request = require("./request");
|
|
13
13
|
var _cache = require("../cache");
|
|
14
|
-
var
|
|
15
|
-
exports.
|
|
14
|
+
var _restApi = require("./rest-api");
|
|
15
|
+
exports.RestApi = _restApi.RestApi;
|
|
16
|
+
var _userInfo = require("./user-info");
|
|
17
|
+
exports.loadUserInfo = _userInfo.loadUserInfo;
|
|
18
|
+
var _formApi = require("./form-api");
|
|
19
|
+
exports.RestFormApi = _formApi.RestFormApi;
|
|
16
20
|
var apiRequest = exports.apiRequest = _axios["default"].create({
|
|
17
21
|
baseURL: "/api",
|
|
18
22
|
// 基础URL
|
|
@@ -22,7 +26,7 @@ var apiRequest = exports.apiRequest = _axios["default"].create({
|
|
|
22
26
|
'Content-Type': 'application/json;charset=UTF-8'
|
|
23
27
|
}
|
|
24
28
|
});
|
|
25
|
-
apiRequest.interceptors.response.use(
|
|
29
|
+
apiRequest.interceptors.response.use(_request.onFulfilled, _request.onRejected);
|
|
26
30
|
function getSchema(_x, _x2) {
|
|
27
31
|
return _getSchema.apply(this, arguments);
|
|
28
32
|
}
|
|
@@ -7,7 +7,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
7
7
|
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
8
8
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
9
9
|
var _axios = _interopRequireDefault(require("axios"));
|
|
10
|
-
var
|
|
10
|
+
var _request = require("./request");
|
|
11
11
|
var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
12
12
|
function BaseRestApi(uri, options) {
|
|
13
13
|
this.uri = void 0;
|
|
@@ -24,7 +24,7 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
24
24
|
'Content-Type': 'application/json;charset=UTF-8'
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
|
-
this.request.interceptors.response.use(
|
|
27
|
+
this.request.interceptors.response.use(_request.onFulfilled, _request.onRejected);
|
|
28
28
|
}
|
|
29
29
|
var _proto = BaseRestApi.prototype;
|
|
30
30
|
_proto.search = /*#__PURE__*/function () {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SingletonInstanceMap } from "../common/SingletonInstanceMap";
|
|
2
|
-
import { RestFormApi } from "../
|
|
2
|
+
import { RestFormApi } from "../api/form-api";
|
|
3
3
|
export declare class SchemaCache extends SingletonInstanceMap<any, {
|
|
4
4
|
mock?: boolean;
|
|
5
5
|
pageId: string;
|
package/lib/utils/cache/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
7
7
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
8
|
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
9
9
|
var _SingletonInstanceMap3 = require("../common/SingletonInstanceMap");
|
|
10
|
-
var
|
|
10
|
+
var _formApi = require("../api/form-api");
|
|
11
11
|
var _schema = require("./schema");
|
|
12
12
|
var _api = require("../api");
|
|
13
13
|
var SchemaCache = exports.SchemaCache = /*#__PURE__*/function (_SingletonInstanceMap) {
|
|
@@ -65,7 +65,7 @@ var FormApiCache = exports.FormApiCache = /*#__PURE__*/function (_SingletonInsta
|
|
|
65
65
|
options = {};
|
|
66
66
|
}
|
|
67
67
|
_options = options, formId = _options.formId, fieldId = _options.fieldId, mock = _options.mock;
|
|
68
|
-
formApi = new
|
|
68
|
+
formApi = new _formApi.RestFormApi(formId, fieldId, mock);
|
|
69
69
|
_context2.next = 5;
|
|
70
70
|
return formApi.initialize();
|
|
71
71
|
case 5:
|
package/lib/utils/page/index.js
CHANGED
|
@@ -8,13 +8,13 @@ var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inh
|
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
|
-
var
|
|
11
|
+
var _pageLayout = require("./page-layout");
|
|
12
12
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
13
13
|
var _react = require("react");
|
|
14
|
-
var
|
|
14
|
+
var _pageLoadSchema = require("./page-load-schema");
|
|
15
15
|
var _reactRender = require("../../components/react-render");
|
|
16
16
|
var _excluded = ["container", "onClose"],
|
|
17
|
-
_excluded2 = ["layout", "form"];
|
|
17
|
+
_excluded2 = ["layout", "form", "onClose"];
|
|
18
18
|
function showForm(options) {
|
|
19
19
|
var container = options.container,
|
|
20
20
|
onClose = options.onClose,
|
|
@@ -27,15 +27,18 @@ function showForm(options) {
|
|
|
27
27
|
}
|
|
28
28
|
_reactDom["default"].render( /*#__PURE__*/React.createElement(FormRender, (0, _extends2["default"])({}, restProps, {
|
|
29
29
|
onClose: /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
30
|
-
var _container;
|
|
31
30
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
32
31
|
while (1) switch (_context.prev = _context.next) {
|
|
33
32
|
case 0:
|
|
34
33
|
if (unmount) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
//等待动画结束
|
|
35
|
+
setTimeout(function () {
|
|
36
|
+
var _container;
|
|
37
|
+
//取消挂载
|
|
38
|
+
_reactDom["default"].unmountComponentAtNode(container);
|
|
39
|
+
//移除
|
|
40
|
+
(_container = container) === null || _container === void 0 ? void 0 : _container.remove();
|
|
41
|
+
}, 1000);
|
|
39
42
|
}
|
|
40
43
|
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
41
44
|
case 2:
|
|
@@ -48,20 +51,38 @@ function showForm(options) {
|
|
|
48
51
|
}
|
|
49
52
|
var FormRender = /*#__PURE__*/function (_Component) {
|
|
50
53
|
function FormRender() {
|
|
51
|
-
|
|
54
|
+
var _this;
|
|
55
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
56
|
+
args[_key] = arguments[_key];
|
|
57
|
+
}
|
|
58
|
+
_this = _Component.call.apply(_Component, [this].concat(args)) || this;
|
|
59
|
+
_this.layoutRef = void 0;
|
|
60
|
+
return _this;
|
|
52
61
|
}
|
|
53
62
|
(0, _inheritsLoose2["default"])(FormRender, _Component);
|
|
54
63
|
var _proto = FormRender.prototype;
|
|
55
64
|
_proto.render = function render() {
|
|
65
|
+
var _this2 = this;
|
|
66
|
+
var self = this;
|
|
56
67
|
var _this$props = this.props,
|
|
57
68
|
layout = _this$props.layout,
|
|
58
69
|
form = _this$props.form,
|
|
70
|
+
onClose = _this$props.onClose,
|
|
59
71
|
restProps = (0, _objectWithoutPropertiesLoose2["default"])(_this$props, _excluded2);
|
|
60
72
|
// @ts-ignore
|
|
61
73
|
restProps.layout = layout || "drawer";
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
// @ts-ignore
|
|
75
|
+
restProps.onClose = function () {
|
|
76
|
+
var _self$layoutRef;
|
|
77
|
+
(_self$layoutRef = self.layoutRef) === null || _self$layoutRef === void 0 ? void 0 : _self$layoutRef.close();
|
|
78
|
+
onClose === null || onClose === void 0 ? void 0 : onClose();
|
|
79
|
+
};
|
|
80
|
+
return /*#__PURE__*/React.createElement(_pageLayout.PageLayout, {
|
|
81
|
+
layout: layout,
|
|
82
|
+
ref: function ref(layout) {
|
|
83
|
+
return _this2.layoutRef = layout;
|
|
84
|
+
}
|
|
85
|
+
}, /*#__PURE__*/React.createElement(_pageLoadSchema.PageLoadSchema, {
|
|
65
86
|
pageId: form === null || form === void 0 ? void 0 : form.id
|
|
66
87
|
}, function (schema) {
|
|
67
88
|
return /*#__PURE__*/React.createElement(_reactRender.ReactRender, (0, _extends2["default"])({
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|