@zhubangyun/lowcode-core 5.4.292 → 5.5.82
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/components/load-materials/index.d.ts +5 -0
- package/es/components/load-materials/index.js +82 -0
- package/es/components/page-loading/index.d.ts +8 -0
- package/es/components/{page-lading → page-loading}/index.js +14 -9
- package/es/components/react-render/react-render-factory.js +2 -9
- package/es/index.d.ts +2 -0
- package/es/index.js +2 -0
- package/es/utils/page/index.js +14 -6
- package/es/utils/page/page-load-schema.js +2 -2
- package/lib/components/load-materials/index.d.ts +5 -0
- package/lib/components/load-materials/index.js +89 -0
- package/lib/components/page-loading/index.d.ts +8 -0
- package/lib/components/{page-lading → page-loading}/index.js +15 -10
- package/lib/components/react-render/react-render-factory.js +0 -7
- package/lib/index.d.ts +2 -0
- package/lib/index.js +5 -1
- package/lib/utils/page/index.js +14 -6
- package/lib/utils/page/page-load-schema.js +2 -2
- package/package.json +1 -1
- package/es/components/page-lading/index.d.ts +0 -7
- package/lib/components/page-lading/index.d.ts +0 -7
- /package/es/components/{page-lading → page-loading}/index.less +0 -0
- /package/lib/components/{page-lading → page-loading}/index.less +0 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
+
import React, { useEffect, useState } from "react";
|
|
4
|
+
import { PageLoading } from "../page-loading";
|
|
5
|
+
import { loadPlugins } from "../../utils/common";
|
|
6
|
+
var __hasLoading = false;
|
|
7
|
+
export function LoadMaterials(props) {
|
|
8
|
+
var _useState = useState(false),
|
|
9
|
+
init = _useState[0],
|
|
10
|
+
setInit = _useState[1];
|
|
11
|
+
useEffect(function () {
|
|
12
|
+
initialize()["finally"](function () {
|
|
13
|
+
return setInit(true);
|
|
14
|
+
});
|
|
15
|
+
}, []);
|
|
16
|
+
function initialize() {
|
|
17
|
+
return _initialize.apply(this, arguments);
|
|
18
|
+
}
|
|
19
|
+
function _initialize() {
|
|
20
|
+
_initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
21
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
22
|
+
while (1) switch (_context.prev = _context.next) {
|
|
23
|
+
case 0:
|
|
24
|
+
__hasLoading = true;
|
|
25
|
+
_context.next = 3;
|
|
26
|
+
return loadMaterials();
|
|
27
|
+
case 3:
|
|
28
|
+
case "end":
|
|
29
|
+
return _context.stop();
|
|
30
|
+
}
|
|
31
|
+
}, _callee);
|
|
32
|
+
}));
|
|
33
|
+
return _initialize.apply(this, arguments);
|
|
34
|
+
}
|
|
35
|
+
if (__hasLoading) {
|
|
36
|
+
return props.children;
|
|
37
|
+
}
|
|
38
|
+
if (init) {
|
|
39
|
+
return props.children;
|
|
40
|
+
} else {
|
|
41
|
+
return /*#__PURE__*/React.createElement(PageLoading, {
|
|
42
|
+
loading: true
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function loadMaterials() {
|
|
47
|
+
return _loadMaterials.apply(this, arguments);
|
|
48
|
+
}
|
|
49
|
+
function _loadMaterials() {
|
|
50
|
+
_loadMaterials = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
51
|
+
var components, urls;
|
|
52
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
53
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
54
|
+
case 0:
|
|
55
|
+
components = {};
|
|
56
|
+
urls = ["prop-types/15.8.1/prop-types.min.js", "lodash/4.6.1/lodash.min.js", "dayjs/dayjs.min.js", "antd/latest/reset.css", "antd/latest/antd.min.js", "antdIcon/1.0.0/antdIcon.min.js", "lowcode/core/index.js", "lowcode/core/index.css", "lowcode/materials/root/view.js", "lowcode/materials/root/view.css", "lowcode/materials/antd/view.js", "lowcode/materials/antd/view.css", "lowcode/materials/antd-pro/view.js", "lowcode/materials/antd-pro/view.css", "lowcode/icon-font/app/iconfont.js"];
|
|
57
|
+
_context2.next = 4;
|
|
58
|
+
return loadPlugins(urls.map(function (url) {
|
|
59
|
+
return "https://cdn.zhiyunhe.com/plugin/" + url;
|
|
60
|
+
}));
|
|
61
|
+
case 4:
|
|
62
|
+
["RootMaterial", "AntdMaterial", "AntdProMaterial"].forEach(function (lib) {
|
|
63
|
+
var data = window[lib];
|
|
64
|
+
if (data) {
|
|
65
|
+
Object.entries(data).forEach(function (_ref) {
|
|
66
|
+
var key = _ref[0],
|
|
67
|
+
value = _ref[1];
|
|
68
|
+
// @ts-ignore
|
|
69
|
+
components[key] = value;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
window._components = components;
|
|
74
|
+
return _context2.abrupt("return", components);
|
|
75
|
+
case 7:
|
|
76
|
+
case "end":
|
|
77
|
+
return _context2.stop();
|
|
78
|
+
}
|
|
79
|
+
}, _callee2);
|
|
80
|
+
}));
|
|
81
|
+
return _loadMaterials.apply(this, arguments);
|
|
82
|
+
}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import "./index.less";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (!loading) {
|
|
7
|
-
return /*#__PURE__*/React.createElement(Fragment, null);
|
|
8
|
-
}
|
|
2
|
+
export function PageLoading(props) {
|
|
3
|
+
var loading = props.loading,
|
|
4
|
+
background = props.background,
|
|
5
|
+
children = props.children;
|
|
9
6
|
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
className: "page-loading-wrapper",
|
|
8
|
+
style: {
|
|
9
|
+
width: "100%",
|
|
10
|
+
height: "100%"
|
|
11
|
+
}
|
|
12
|
+
}, children, loading && /*#__PURE__*/React.createElement("div", {
|
|
10
13
|
className: "page-loading",
|
|
11
|
-
style:
|
|
14
|
+
style: {
|
|
15
|
+
background: background
|
|
16
|
+
}
|
|
12
17
|
}, /*#__PURE__*/React.createElement("div", {
|
|
13
18
|
className: "atom-spinner"
|
|
14
19
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -21,5 +26,5 @@ export function PageLading(props) {
|
|
|
21
26
|
className: "spinner-line"
|
|
22
27
|
}), /*#__PURE__*/React.createElement("div", {
|
|
23
28
|
className: "spinner-circle"
|
|
24
|
-
}))));
|
|
29
|
+
})))));
|
|
25
30
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
2
|
-
import
|
|
3
|
-
var _window$antd;
|
|
4
|
-
import { Component, PureComponent, createElement, createContext, forwardRef } from 'react';
|
|
2
|
+
import { Component, createContext, createElement, forwardRef, PureComponent } from 'react';
|
|
5
3
|
import { findDOMNode } from "react-dom";
|
|
6
|
-
import { adapter,
|
|
4
|
+
import { adapter, addonRendererFactory, blockRendererFactory, componentRendererFactory, pageRendererFactory, rendererFactory, tempRendererFactory } from '@zhubangyun/lowcode-render-core';
|
|
7
5
|
adapter.setRuntime({
|
|
8
6
|
Component: Component,
|
|
9
7
|
PureComponent: PureComponent,
|
|
@@ -20,11 +18,6 @@ adapter.setRenderers({
|
|
|
20
18
|
TempRenderer: tempRendererFactory(),
|
|
21
19
|
DivRenderer: blockRendererFactory()
|
|
22
20
|
});
|
|
23
|
-
// @ts-ignore
|
|
24
|
-
adapter.setConfigProvider(((_window$antd = window.antd) === null || _window$antd === void 0 ? void 0 : _window$antd.ConfigProvider) || _ConfigProvider);
|
|
25
|
-
|
|
26
|
-
// @ts-ignore
|
|
27
|
-
window.___adapter = adapter;
|
|
28
21
|
function factory() {
|
|
29
22
|
var Renderer = rendererFactory();
|
|
30
23
|
return /*#__PURE__*/function (_Renderer) {
|
package/es/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import "./index.less";
|
|
2
2
|
import utils from "./utils";
|
|
3
|
+
export { LoadMaterials } from "./components/load-materials";
|
|
4
|
+
export { PageLoading } from "./components/page-loading";
|
|
3
5
|
export { RestApi, RestFormApi, apiRequest } from "./utils/api";
|
|
4
6
|
export { Layout } from "./components/layout";
|
|
5
7
|
export { ReactRender } from "./components/react-render";
|
package/es/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import "./index.less";
|
|
2
2
|
import utils from "./utils";
|
|
3
3
|
import { ReactRender } from "./components/react-render";
|
|
4
|
+
export { LoadMaterials } from "./components/load-materials";
|
|
5
|
+
export { PageLoading } from "./components/page-loading";
|
|
4
6
|
export { RestApi, RestFormApi, apiRequest } from "./utils/api";
|
|
5
7
|
export { Layout } from "./components/layout";
|
|
6
8
|
export { ReactRender } from "./components/react-render";
|
package/es/utils/page/index.js
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
export { showForm } from "./page-form";
|
|
4
|
+
var timerRef;
|
|
5
|
+
function debounceHide() {
|
|
6
|
+
if (timerRef) {
|
|
7
|
+
clearTimeout(timerRef);
|
|
8
|
+
}
|
|
9
|
+
timerRef = setTimeout(function () {
|
|
10
|
+
var loading = document.getElementById("fullscreen-loading");
|
|
11
|
+
if (loading) {
|
|
12
|
+
loading.style.display = "none";
|
|
13
|
+
}
|
|
14
|
+
}, 40);
|
|
15
|
+
}
|
|
4
16
|
export function showLoading() {
|
|
5
17
|
return _showLoading.apply(this, arguments);
|
|
6
18
|
}
|
|
@@ -32,15 +44,11 @@ export function hideLoading() {
|
|
|
32
44
|
}
|
|
33
45
|
function _hideLoading() {
|
|
34
46
|
_hideLoading = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
35
|
-
var loading;
|
|
36
47
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
37
48
|
while (1) switch (_context2.prev = _context2.next) {
|
|
38
49
|
case 0:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
loading.style.display = "none";
|
|
42
|
-
}
|
|
43
|
-
case 2:
|
|
50
|
+
debounceHide();
|
|
51
|
+
case 1:
|
|
44
52
|
case "end":
|
|
45
53
|
return _context2.stop();
|
|
46
54
|
}
|
|
@@ -2,7 +2,7 @@ import _Result from "antd/es/result";
|
|
|
2
2
|
import _message from "antd/es/message";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { getSchema } from "../api";
|
|
5
|
-
import {
|
|
5
|
+
import { PageLoading } from "../../components/page-loading";
|
|
6
6
|
export function PageLoadSchema(props) {
|
|
7
7
|
var pageId = props.pageId,
|
|
8
8
|
children = props.children;
|
|
@@ -33,7 +33,7 @@ export function PageLoadSchema(props) {
|
|
|
33
33
|
}
|
|
34
34
|
}, []);
|
|
35
35
|
if (loading) {
|
|
36
|
-
return /*#__PURE__*/React.createElement(
|
|
36
|
+
return /*#__PURE__*/React.createElement(PageLoading, {
|
|
37
37
|
loading: true,
|
|
38
38
|
style: {
|
|
39
39
|
background: "white"
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
exports.__esModule = true;
|
|
5
|
+
exports.LoadMaterials = LoadMaterials;
|
|
6
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
7
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _pageLoading = require("../page-loading");
|
|
10
|
+
var _common = require("../../utils/common");
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
13
|
+
var __hasLoading = false;
|
|
14
|
+
function LoadMaterials(props) {
|
|
15
|
+
var _useState = (0, _react.useState)(false),
|
|
16
|
+
init = _useState[0],
|
|
17
|
+
setInit = _useState[1];
|
|
18
|
+
(0, _react.useEffect)(function () {
|
|
19
|
+
initialize()["finally"](function () {
|
|
20
|
+
return setInit(true);
|
|
21
|
+
});
|
|
22
|
+
}, []);
|
|
23
|
+
function initialize() {
|
|
24
|
+
return _initialize.apply(this, arguments);
|
|
25
|
+
}
|
|
26
|
+
function _initialize() {
|
|
27
|
+
_initialize = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
28
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
29
|
+
while (1) switch (_context.prev = _context.next) {
|
|
30
|
+
case 0:
|
|
31
|
+
__hasLoading = true;
|
|
32
|
+
_context.next = 3;
|
|
33
|
+
return loadMaterials();
|
|
34
|
+
case 3:
|
|
35
|
+
case "end":
|
|
36
|
+
return _context.stop();
|
|
37
|
+
}
|
|
38
|
+
}, _callee);
|
|
39
|
+
}));
|
|
40
|
+
return _initialize.apply(this, arguments);
|
|
41
|
+
}
|
|
42
|
+
if (__hasLoading) {
|
|
43
|
+
return props.children;
|
|
44
|
+
}
|
|
45
|
+
if (init) {
|
|
46
|
+
return props.children;
|
|
47
|
+
} else {
|
|
48
|
+
return /*#__PURE__*/_react["default"].createElement(_pageLoading.PageLoading, {
|
|
49
|
+
loading: true
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function loadMaterials() {
|
|
54
|
+
return _loadMaterials.apply(this, arguments);
|
|
55
|
+
}
|
|
56
|
+
function _loadMaterials() {
|
|
57
|
+
_loadMaterials = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
58
|
+
var components, urls;
|
|
59
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
60
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
61
|
+
case 0:
|
|
62
|
+
components = {};
|
|
63
|
+
urls = ["prop-types/15.8.1/prop-types.min.js", "lodash/4.6.1/lodash.min.js", "dayjs/dayjs.min.js", "antd/latest/reset.css", "antd/latest/antd.min.js", "antdIcon/1.0.0/antdIcon.min.js", "lowcode/core/index.js", "lowcode/core/index.css", "lowcode/materials/root/view.js", "lowcode/materials/root/view.css", "lowcode/materials/antd/view.js", "lowcode/materials/antd/view.css", "lowcode/materials/antd-pro/view.js", "lowcode/materials/antd-pro/view.css", "lowcode/icon-font/app/iconfont.js"];
|
|
64
|
+
_context2.next = 4;
|
|
65
|
+
return (0, _common.loadPlugins)(urls.map(function (url) {
|
|
66
|
+
return "https://cdn.zhiyunhe.com/plugin/" + url;
|
|
67
|
+
}));
|
|
68
|
+
case 4:
|
|
69
|
+
["RootMaterial", "AntdMaterial", "AntdProMaterial"].forEach(function (lib) {
|
|
70
|
+
var data = window[lib];
|
|
71
|
+
if (data) {
|
|
72
|
+
Object.entries(data).forEach(function (_ref) {
|
|
73
|
+
var key = _ref[0],
|
|
74
|
+
value = _ref[1];
|
|
75
|
+
// @ts-ignore
|
|
76
|
+
components[key] = value;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
window._components = components;
|
|
81
|
+
return _context2.abrupt("return", components);
|
|
82
|
+
case 7:
|
|
83
|
+
case "end":
|
|
84
|
+
return _context2.stop();
|
|
85
|
+
}
|
|
86
|
+
}, _callee2);
|
|
87
|
+
}));
|
|
88
|
+
return _loadMaterials.apply(this, arguments);
|
|
89
|
+
}
|
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.PageLoading = PageLoading;
|
|
5
5
|
require("./index.less");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if (!loading) {
|
|
11
|
-
return /*#__PURE__*/React.createElement(_react.Fragment, null);
|
|
12
|
-
}
|
|
6
|
+
function PageLoading(props) {
|
|
7
|
+
var loading = props.loading,
|
|
8
|
+
background = props.background,
|
|
9
|
+
children = props.children;
|
|
13
10
|
return /*#__PURE__*/React.createElement("div", {
|
|
11
|
+
className: "page-loading-wrapper",
|
|
12
|
+
style: {
|
|
13
|
+
width: "100%",
|
|
14
|
+
height: "100%"
|
|
15
|
+
}
|
|
16
|
+
}, children, loading && /*#__PURE__*/React.createElement("div", {
|
|
14
17
|
className: "page-loading",
|
|
15
|
-
style:
|
|
18
|
+
style: {
|
|
19
|
+
background: background
|
|
20
|
+
}
|
|
16
21
|
}, /*#__PURE__*/React.createElement("div", {
|
|
17
22
|
className: "atom-spinner"
|
|
18
23
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -25,5 +30,5 @@ function PageLading(props) {
|
|
|
25
30
|
className: "spinner-line"
|
|
26
31
|
}), /*#__PURE__*/React.createElement("div", {
|
|
27
32
|
className: "spinner-circle"
|
|
28
|
-
}))));
|
|
33
|
+
})))));
|
|
29
34
|
}
|
|
@@ -4,11 +4,9 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
exports.__esModule = true;
|
|
5
5
|
exports["default"] = void 0;
|
|
6
6
|
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
7
|
-
var _configProvider = _interopRequireDefault(require("antd/lib/config-provider"));
|
|
8
7
|
var _react = require("react");
|
|
9
8
|
var _reactDom = require("react-dom");
|
|
10
9
|
var _lowcodeRenderCore = require("@zhubangyun/lowcode-render-core");
|
|
11
|
-
var _window$antd;
|
|
12
10
|
_lowcodeRenderCore.adapter.setRuntime({
|
|
13
11
|
Component: _react.Component,
|
|
14
12
|
PureComponent: _react.PureComponent,
|
|
@@ -25,11 +23,6 @@ _lowcodeRenderCore.adapter.setRenderers({
|
|
|
25
23
|
TempRenderer: (0, _lowcodeRenderCore.tempRendererFactory)(),
|
|
26
24
|
DivRenderer: (0, _lowcodeRenderCore.blockRendererFactory)()
|
|
27
25
|
});
|
|
28
|
-
// @ts-ignore
|
|
29
|
-
_lowcodeRenderCore.adapter.setConfigProvider(((_window$antd = window.antd) === null || _window$antd === void 0 ? void 0 : _window$antd.ConfigProvider) || _configProvider["default"]);
|
|
30
|
-
|
|
31
|
-
// @ts-ignore
|
|
32
|
-
window.___adapter = _lowcodeRenderCore.adapter;
|
|
33
26
|
function factory() {
|
|
34
27
|
var Renderer = (0, _lowcodeRenderCore.rendererFactory)();
|
|
35
28
|
return /*#__PURE__*/function (_Renderer) {
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import "./index.less";
|
|
2
2
|
import utils from "./utils";
|
|
3
|
+
export { LoadMaterials } from "./components/load-materials";
|
|
4
|
+
export { PageLoading } from "./components/page-loading";
|
|
3
5
|
export { RestApi, RestFormApi, apiRequest } from "./utils/api";
|
|
4
6
|
export { Layout } from "./components/layout";
|
|
5
7
|
export { ReactRender } from "./components/react-render";
|
package/lib/index.js
CHANGED
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
-
exports.apiRequest = exports.RestFormApi = exports.RestApi = exports.Layout = void 0;
|
|
5
|
+
exports.apiRequest = exports.RestFormApi = exports.RestApi = exports.PageLoading = exports.LoadMaterials = exports.Layout = void 0;
|
|
6
6
|
require("./index.less");
|
|
7
7
|
var _utils = _interopRequireDefault(require("./utils"));
|
|
8
8
|
exports.utils = _utils["default"];
|
|
9
9
|
var _reactRender = require("./components/react-render");
|
|
10
10
|
exports.ReactRender = _reactRender.ReactRender;
|
|
11
|
+
var _loadMaterials = require("./components/load-materials");
|
|
12
|
+
exports.LoadMaterials = _loadMaterials.LoadMaterials;
|
|
13
|
+
var _pageLoading = require("./components/page-loading");
|
|
14
|
+
exports.PageLoading = _pageLoading.PageLoading;
|
|
11
15
|
var _api = require("./utils/api");
|
|
12
16
|
exports.RestApi = _api.RestApi;
|
|
13
17
|
exports.RestFormApi = _api.RestFormApi;
|
package/lib/utils/page/index.js
CHANGED
|
@@ -11,6 +11,18 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
11
11
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
12
|
var _pageForm = require("./page-form");
|
|
13
13
|
exports.showForm = _pageForm.showForm;
|
|
14
|
+
var timerRef;
|
|
15
|
+
function debounceHide() {
|
|
16
|
+
if (timerRef) {
|
|
17
|
+
clearTimeout(timerRef);
|
|
18
|
+
}
|
|
19
|
+
timerRef = setTimeout(function () {
|
|
20
|
+
var loading = document.getElementById("fullscreen-loading");
|
|
21
|
+
if (loading) {
|
|
22
|
+
loading.style.display = "none";
|
|
23
|
+
}
|
|
24
|
+
}, 40);
|
|
25
|
+
}
|
|
14
26
|
function showLoading() {
|
|
15
27
|
return _showLoading.apply(this, arguments);
|
|
16
28
|
}
|
|
@@ -42,15 +54,11 @@ function hideLoading() {
|
|
|
42
54
|
}
|
|
43
55
|
function _hideLoading() {
|
|
44
56
|
_hideLoading = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
45
|
-
var loading;
|
|
46
57
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
47
58
|
while (1) switch (_context2.prev = _context2.next) {
|
|
48
59
|
case 0:
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
loading.style.display = "none";
|
|
52
|
-
}
|
|
53
|
-
case 2:
|
|
60
|
+
debounceHide();
|
|
61
|
+
case 1:
|
|
54
62
|
case "end":
|
|
55
63
|
return _context2.stop();
|
|
56
64
|
}
|
|
@@ -7,7 +7,7 @@ var _result = _interopRequireDefault(require("antd/lib/result"));
|
|
|
7
7
|
var _message2 = _interopRequireDefault(require("antd/lib/message"));
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _api = require("../api");
|
|
10
|
-
var
|
|
10
|
+
var _pageLoading = require("../../components/page-loading");
|
|
11
11
|
function PageLoadSchema(props) {
|
|
12
12
|
var pageId = props.pageId,
|
|
13
13
|
children = props.children;
|
|
@@ -38,7 +38,7 @@ function PageLoadSchema(props) {
|
|
|
38
38
|
}
|
|
39
39
|
}, []);
|
|
40
40
|
if (loading) {
|
|
41
|
-
return /*#__PURE__*/React.createElement(
|
|
41
|
+
return /*#__PURE__*/React.createElement(_pageLoading.PageLoading, {
|
|
42
42
|
loading: true,
|
|
43
43
|
style: {
|
|
44
44
|
background: "white"
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|