@zhubangyun/lowcode-core 1.1.13 → 1.1.14
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/schema-render/components/schema-render-base.d.ts +2 -2
- package/es/components/schema-render/components/schema-render-base.js +17 -55
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/es/utils/designer/engine/index.d.ts +2 -1
- package/es/utils/designer/engine/index.js +2 -0
- package/lib/components/schema-render/components/schema-render-base.d.ts +2 -2
- package/lib/components/schema-render/components/schema-render-base.js +17 -55
- package/lib/index.d.ts +1 -0
- package/lib/index.js +15 -0
- package/lib/utils/designer/engine/index.d.ts +2 -1
- package/lib/utils/designer/engine/index.js +2 -0
- package/package.json +1 -1
|
@@ -23,7 +23,8 @@ export interface FormProps {
|
|
|
23
23
|
onInit?: (values: any, form: FormInstance) => Promise<void>;
|
|
24
24
|
}
|
|
25
25
|
export interface SchemaBaseRenderProps {
|
|
26
|
-
|
|
26
|
+
components: any;
|
|
27
|
+
loadSchema: (props: SchemaBaseRenderProps) => Promise<void>;
|
|
27
28
|
params?: FormProps;
|
|
28
29
|
}
|
|
29
30
|
export interface SchemaBaseRenderState {
|
|
@@ -36,7 +37,6 @@ export declare class SchemaRenderBase extends Component<SchemaBaseRenderProps, S
|
|
|
36
37
|
constructor(props: Readonly<SchemaBaseRenderProps> | SchemaBaseRenderProps);
|
|
37
38
|
componentDidMount(): Promise<void>;
|
|
38
39
|
page: any;
|
|
39
|
-
loadSchema: () => Promise<void>;
|
|
40
40
|
components: any;
|
|
41
41
|
loadComponent: () => Promise<void>;
|
|
42
42
|
render(): JSX.Element;
|
|
@@ -9,7 +9,6 @@ import ReactRenderer, { adapter } from "@zhubangyun/lowcode-renderer-core";
|
|
|
9
9
|
import { createFetchHandler } from "@alilc/lowcode-datasource-fetch-handler";
|
|
10
10
|
import utils from "../../../utils";
|
|
11
11
|
import assets from "./assets";
|
|
12
|
-
import demoSchema from "./demo-schema";
|
|
13
12
|
import zhCN from "antd/locale/zh_CN";
|
|
14
13
|
// @ts-ignore
|
|
15
14
|
adapter.setConfigProvider(((_window$antd = window.antd) === null || _window$antd === void 0 ? void 0 : _window$antd.ConfigProvider) || _ConfigProvider);
|
|
@@ -23,79 +22,42 @@ export var SchemaRenderBase = /*#__PURE__*/function (_Component) {
|
|
|
23
22
|
result: undefined
|
|
24
23
|
};
|
|
25
24
|
_this.page = void 0;
|
|
26
|
-
_this.
|
|
27
|
-
|
|
25
|
+
_this.components = void 0;
|
|
26
|
+
_this.loadComponent = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
27
|
+
var _yield$utils$designer, components;
|
|
28
28
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
29
29
|
while (1) switch (_context.prev = _context.next) {
|
|
30
30
|
case 0:
|
|
31
31
|
_context.next = 2;
|
|
32
|
-
return
|
|
33
|
-
case 2:
|
|
34
|
-
schemaId = _this.props.schemaId;
|
|
35
|
-
if (!(schemaId == "test")) {
|
|
36
|
-
_context.next = 6;
|
|
37
|
-
break;
|
|
38
|
-
}
|
|
39
|
-
_this.setState({
|
|
40
|
-
schema: demoSchema
|
|
41
|
-
});
|
|
42
|
-
return _context.abrupt("return");
|
|
43
|
-
case 6:
|
|
44
|
-
_context.next = 8;
|
|
45
|
-
return utils.schemaCache.get(schemaId);
|
|
46
|
-
case 8:
|
|
47
|
-
schema = _context.sent;
|
|
48
|
-
_this.setState({
|
|
49
|
-
schema: schema,
|
|
50
|
-
result: schema ? undefined : {
|
|
51
|
-
status: 404,
|
|
52
|
-
title: "404",
|
|
53
|
-
subTitle: "\u89C6\u56FE:" + schemaId + "\u4E0D\u5B58\u5728!"
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
case 10:
|
|
57
|
-
case "end":
|
|
58
|
-
return _context.stop();
|
|
59
|
-
}
|
|
60
|
-
}, _callee);
|
|
61
|
-
}));
|
|
62
|
-
_this.components = void 0;
|
|
63
|
-
_this.loadComponent = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
64
|
-
var _yield$utils$lowcode$, components;
|
|
65
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
66
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
67
|
-
case 0:
|
|
68
|
-
_context2.next = 2;
|
|
69
|
-
return utils.lowcode.parseAssets(assets);
|
|
32
|
+
return utils.designer.assetsParse(assets);
|
|
70
33
|
case 2:
|
|
71
|
-
_yield$utils$
|
|
72
|
-
components = _yield$utils$
|
|
34
|
+
_yield$utils$designer = _context.sent;
|
|
35
|
+
components = _yield$utils$designer.components;
|
|
73
36
|
_this.components = components;
|
|
74
37
|
case 5:
|
|
75
38
|
case "end":
|
|
76
|
-
return
|
|
39
|
+
return _context.stop();
|
|
77
40
|
}
|
|
78
|
-
},
|
|
41
|
+
}, _callee);
|
|
79
42
|
}));
|
|
80
43
|
_this.setState({
|
|
81
|
-
key: utils.uuid("key.")
|
|
44
|
+
key: utils.common.uuid("key.")
|
|
82
45
|
});
|
|
83
46
|
return _this;
|
|
84
47
|
}
|
|
85
48
|
_inheritsLoose(SchemaRenderBase, _Component);
|
|
86
49
|
var _proto = SchemaRenderBase.prototype;
|
|
87
50
|
_proto.componentDidMount = /*#__PURE__*/function () {
|
|
88
|
-
var _componentDidMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function
|
|
89
|
-
return _regeneratorRuntime.wrap(function
|
|
90
|
-
while (1) switch (
|
|
51
|
+
var _componentDidMount = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
|
|
52
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
53
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
91
54
|
case 0:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
case 2:
|
|
55
|
+
this.components = this.props.components;
|
|
56
|
+
case 1:
|
|
95
57
|
case "end":
|
|
96
|
-
return
|
|
58
|
+
return _context2.stop();
|
|
97
59
|
}
|
|
98
|
-
},
|
|
60
|
+
}, _callee2, this);
|
|
99
61
|
}));
|
|
100
62
|
function componentDidMount() {
|
|
101
63
|
return _componentDidMount.apply(this, arguments);
|
|
@@ -104,7 +66,7 @@ export var SchemaRenderBase = /*#__PURE__*/function (_Component) {
|
|
|
104
66
|
}();
|
|
105
67
|
_proto.render = function render() {
|
|
106
68
|
var _this2 = this;
|
|
107
|
-
var components = this.components;
|
|
69
|
+
var components = this.props.components;
|
|
108
70
|
var _this$state = this.state,
|
|
109
71
|
key = _this$state.key,
|
|
110
72
|
result = _this$state.result,
|
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Project, Material, Plugins } from "@alilc/lowcode-shell";
|
|
1
|
+
import { Project, Material, Plugins, Skeleton } from "@alilc/lowcode-shell";
|
|
2
2
|
import { DefaultAssertsType, DesignerAssets } from "../assets";
|
|
3
3
|
import { IPublicTypeAssetsJson } from "@alilc/lowcode-utils";
|
|
4
4
|
import { IPublicTypePlugin, IPublicTypePluginRegisterOptions } from "@alilc/lowcode-types";
|
|
@@ -7,6 +7,7 @@ export declare class Engine {
|
|
|
7
7
|
plugins: Plugins;
|
|
8
8
|
assets: DesignerAssets;
|
|
9
9
|
material: Material;
|
|
10
|
+
skeleton: Skeleton;
|
|
10
11
|
_engine: any;
|
|
11
12
|
constructor();
|
|
12
13
|
/**
|
|
@@ -9,6 +9,7 @@ export var Engine = function Engine() {
|
|
|
9
9
|
this.plugins = void 0;
|
|
10
10
|
this.assets = void 0;
|
|
11
11
|
this.material = void 0;
|
|
12
|
+
this.skeleton = void 0;
|
|
12
13
|
this._engine = void 0;
|
|
13
14
|
/**
|
|
14
15
|
* 注入资产
|
|
@@ -134,5 +135,6 @@ export var Engine = function Engine() {
|
|
|
134
135
|
this.project = this._engine.project;
|
|
135
136
|
this.material = this._engine.material;
|
|
136
137
|
this.plugins = this._engine.plugins;
|
|
138
|
+
this.skeleton = this._engine.skeleton;
|
|
137
139
|
this.assets = new DesignerAssets();
|
|
138
140
|
};
|
|
@@ -23,7 +23,8 @@ export interface FormProps {
|
|
|
23
23
|
onInit?: (values: any, form: FormInstance) => Promise<void>;
|
|
24
24
|
}
|
|
25
25
|
export interface SchemaBaseRenderProps {
|
|
26
|
-
|
|
26
|
+
components: any;
|
|
27
|
+
loadSchema: (props: SchemaBaseRenderProps) => Promise<void>;
|
|
27
28
|
params?: FormProps;
|
|
28
29
|
}
|
|
29
30
|
export interface SchemaBaseRenderState {
|
|
@@ -36,7 +37,6 @@ export declare class SchemaRenderBase extends Component<SchemaBaseRenderProps, S
|
|
|
36
37
|
constructor(props: Readonly<SchemaBaseRenderProps> | SchemaBaseRenderProps);
|
|
37
38
|
componentDidMount(): Promise<void>;
|
|
38
39
|
page: any;
|
|
39
|
-
loadSchema: () => Promise<void>;
|
|
40
40
|
components: any;
|
|
41
41
|
loadComponent: () => Promise<void>;
|
|
42
42
|
render(): JSX.Element;
|
|
@@ -13,7 +13,6 @@ var _lowcodeRendererCore = _interopRequireWildcard(require("@zhubangyun/lowcode-
|
|
|
13
13
|
var _lowcodeDatasourceFetchHandler = require("@alilc/lowcode-datasource-fetch-handler");
|
|
14
14
|
var _utils = _interopRequireDefault(require("../../../utils"));
|
|
15
15
|
var _assets = _interopRequireDefault(require("./assets"));
|
|
16
|
-
var _demoSchema = _interopRequireDefault(require("./demo-schema"));
|
|
17
16
|
var _zh_CN = _interopRequireDefault(require("antd/locale/zh_CN"));
|
|
18
17
|
var _window$antd, _window$antd2;
|
|
19
18
|
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); }
|
|
@@ -30,79 +29,42 @@ var SchemaRenderBase = exports.SchemaRenderBase = /*#__PURE__*/function (_Compon
|
|
|
30
29
|
result: undefined
|
|
31
30
|
};
|
|
32
31
|
_this.page = void 0;
|
|
33
|
-
_this.
|
|
34
|
-
|
|
32
|
+
_this.components = void 0;
|
|
33
|
+
_this.loadComponent = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
34
|
+
var _yield$utils$designer, components;
|
|
35
35
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
36
36
|
while (1) switch (_context.prev = _context.next) {
|
|
37
37
|
case 0:
|
|
38
38
|
_context.next = 2;
|
|
39
|
-
return
|
|
40
|
-
case 2:
|
|
41
|
-
schemaId = _this.props.schemaId;
|
|
42
|
-
if (!(schemaId == "test")) {
|
|
43
|
-
_context.next = 6;
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
_this.setState({
|
|
47
|
-
schema: _demoSchema["default"]
|
|
48
|
-
});
|
|
49
|
-
return _context.abrupt("return");
|
|
50
|
-
case 6:
|
|
51
|
-
_context.next = 8;
|
|
52
|
-
return _utils["default"].schemaCache.get(schemaId);
|
|
53
|
-
case 8:
|
|
54
|
-
schema = _context.sent;
|
|
55
|
-
_this.setState({
|
|
56
|
-
schema: schema,
|
|
57
|
-
result: schema ? undefined : {
|
|
58
|
-
status: 404,
|
|
59
|
-
title: "404",
|
|
60
|
-
subTitle: "\u89C6\u56FE:" + schemaId + "\u4E0D\u5B58\u5728!"
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
case 10:
|
|
64
|
-
case "end":
|
|
65
|
-
return _context.stop();
|
|
66
|
-
}
|
|
67
|
-
}, _callee);
|
|
68
|
-
}));
|
|
69
|
-
_this.components = void 0;
|
|
70
|
-
_this.loadComponent = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
71
|
-
var _yield$utils$lowcode$, components;
|
|
72
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
73
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
74
|
-
case 0:
|
|
75
|
-
_context2.next = 2;
|
|
76
|
-
return _utils["default"].lowcode.parseAssets(_assets["default"]);
|
|
39
|
+
return _utils["default"].designer.assetsParse(_assets["default"]);
|
|
77
40
|
case 2:
|
|
78
|
-
_yield$utils$
|
|
79
|
-
components = _yield$utils$
|
|
41
|
+
_yield$utils$designer = _context.sent;
|
|
42
|
+
components = _yield$utils$designer.components;
|
|
80
43
|
_this.components = components;
|
|
81
44
|
case 5:
|
|
82
45
|
case "end":
|
|
83
|
-
return
|
|
46
|
+
return _context.stop();
|
|
84
47
|
}
|
|
85
|
-
},
|
|
48
|
+
}, _callee);
|
|
86
49
|
}));
|
|
87
50
|
_this.setState({
|
|
88
|
-
key: _utils["default"].uuid("key.")
|
|
51
|
+
key: _utils["default"].common.uuid("key.")
|
|
89
52
|
});
|
|
90
53
|
return _this;
|
|
91
54
|
}
|
|
92
55
|
(0, _inheritsLoose2["default"])(SchemaRenderBase, _Component);
|
|
93
56
|
var _proto = SchemaRenderBase.prototype;
|
|
94
57
|
_proto.componentDidMount = /*#__PURE__*/function () {
|
|
95
|
-
var _componentDidMount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function
|
|
96
|
-
return _regenerator["default"].wrap(function
|
|
97
|
-
while (1) switch (
|
|
58
|
+
var _componentDidMount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
|
|
59
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
60
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
98
61
|
case 0:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
case 2:
|
|
62
|
+
this.components = this.props.components;
|
|
63
|
+
case 1:
|
|
102
64
|
case "end":
|
|
103
|
-
return
|
|
65
|
+
return _context2.stop();
|
|
104
66
|
}
|
|
105
|
-
},
|
|
67
|
+
}, _callee2, this);
|
|
106
68
|
}));
|
|
107
69
|
function componentDidMount() {
|
|
108
70
|
return _componentDidMount.apply(this, arguments);
|
|
@@ -111,7 +73,7 @@ var SchemaRenderBase = exports.SchemaRenderBase = /*#__PURE__*/function (_Compon
|
|
|
111
73
|
}();
|
|
112
74
|
_proto.render = function render() {
|
|
113
75
|
var _this2 = this;
|
|
114
|
-
var components = this.components;
|
|
76
|
+
var components = this.props.components;
|
|
115
77
|
var _this$state = this.state,
|
|
116
78
|
key = _this$state.key,
|
|
117
79
|
result = _this$state.result,
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -2,9 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
exports.__esModule = true;
|
|
5
|
+
var _exportNames = {
|
|
6
|
+
RestApi: true,
|
|
7
|
+
RestFormApi: true,
|
|
8
|
+
ClientCache: true,
|
|
9
|
+
Layout: true,
|
|
10
|
+
SchemaRender: true,
|
|
11
|
+
utils: true
|
|
12
|
+
};
|
|
5
13
|
exports.SchemaRender = exports.RestFormApi = exports.RestApi = exports.Layout = exports.ClientCache = void 0;
|
|
6
14
|
var _utils = _interopRequireDefault(require("./utils"));
|
|
7
15
|
exports.utils = _utils["default"];
|
|
16
|
+
var _lowcodeRendererCore = require("@zhubangyun/lowcode-renderer-core");
|
|
17
|
+
Object.keys(_lowcodeRendererCore).forEach(function (key) {
|
|
18
|
+
if (key === "default" || key === "__esModule") return;
|
|
19
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
20
|
+
if (key in exports && exports[key] === _lowcodeRendererCore[key]) return;
|
|
21
|
+
exports[key] = _lowcodeRendererCore[key];
|
|
22
|
+
});
|
|
8
23
|
var _RestApi = require("./utils/common/RestApi");
|
|
9
24
|
exports.RestApi = _RestApi.RestApi;
|
|
10
25
|
var _RestFormApi = require("./utils/common/RestFormApi");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Project, Material, Plugins } from "@alilc/lowcode-shell";
|
|
1
|
+
import { Project, Material, Plugins, Skeleton } from "@alilc/lowcode-shell";
|
|
2
2
|
import { DefaultAssertsType, DesignerAssets } from "../assets";
|
|
3
3
|
import { IPublicTypeAssetsJson } from "@alilc/lowcode-utils";
|
|
4
4
|
import { IPublicTypePlugin, IPublicTypePluginRegisterOptions } from "@alilc/lowcode-types";
|
|
@@ -7,6 +7,7 @@ export declare class Engine {
|
|
|
7
7
|
plugins: Plugins;
|
|
8
8
|
assets: DesignerAssets;
|
|
9
9
|
material: Material;
|
|
10
|
+
skeleton: Skeleton;
|
|
10
11
|
_engine: any;
|
|
11
12
|
constructor();
|
|
12
13
|
/**
|
|
@@ -14,6 +14,7 @@ var Engine = exports.Engine = function Engine() {
|
|
|
14
14
|
this.plugins = void 0;
|
|
15
15
|
this.assets = void 0;
|
|
16
16
|
this.material = void 0;
|
|
17
|
+
this.skeleton = void 0;
|
|
17
18
|
this._engine = void 0;
|
|
18
19
|
/**
|
|
19
20
|
* 注入资产
|
|
@@ -139,5 +140,6 @@ var Engine = exports.Engine = function Engine() {
|
|
|
139
140
|
this.project = this._engine.project;
|
|
140
141
|
this.material = this._engine.material;
|
|
141
142
|
this.plugins = this._engine.plugins;
|
|
143
|
+
this.skeleton = this._engine.skeleton;
|
|
142
144
|
this.assets = new _assets.DesignerAssets();
|
|
143
145
|
};
|