@zhubangyun/lowcode-core 5.3.131 → 5.3.181
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/react-render/index.d.ts +5 -8
- package/es/components/react-render/index.js +12 -19
- package/es/components/react-render/react-render-factory.d.ts +3 -0
- package/es/components/react-render/react-render-factory.js +50 -0
- package/es/components/schema-render/components/schema-render-base.js +1 -1
- package/es/index.d.ts +2 -3
- package/es/index.js +2 -3
- package/es/utils/{common → api}/RestApi.d.ts +10 -8
- package/es/utils/{common → api}/RestApi.js +142 -85
- package/es/utils/api/index.d.ts +2 -0
- package/es/utils/api/index.js +49 -2
- package/es/utils/cache/index.d.ts +9 -0
- package/es/utils/cache/index.js +75 -0
- package/es/utils/common/SingletonInstanceMap.d.ts +7 -0
- package/es/utils/common/SingletonInstanceMap.js +73 -0
- package/es/utils/common/index.d.ts +0 -2
- package/es/utils/common/index.js +1 -30
- package/es/utils/{common/RestFormApi.d.ts → form/form.api.d.ts} +9 -4
- package/es/utils/{common/RestFormApi.js → form/form.api.js} +85 -36
- package/es/utils/form/form.handler.js +0 -0
- package/es/utils/form/form.instance.d.ts +26 -0
- package/es/utils/form/form.instance.js +100 -0
- package/es/utils/form/form.process.js +0 -0
- package/es/utils/index.d.ts +2 -0
- package/es/utils/index.js +2 -0
- package/lib/components/react-render/index.d.ts +5 -8
- package/lib/components/react-render/index.js +12 -21
- package/lib/components/react-render/react-render-factory.d.ts +3 -0
- package/lib/components/react-render/react-render-factory.js +55 -0
- package/lib/components/schema-render/components/schema-render-base.js +1 -1
- package/lib/index.d.ts +2 -3
- package/lib/index.js +4 -6
- package/lib/utils/{common → api}/RestApi.d.ts +10 -8
- package/lib/utils/{common → api}/RestApi.js +142 -85
- package/lib/utils/api/index.d.ts +2 -0
- package/lib/utils/api/index.js +51 -2
- package/lib/utils/cache/index.d.ts +9 -0
- package/lib/utils/cache/index.js +80 -0
- package/lib/utils/common/SingletonInstanceMap.d.ts +7 -0
- package/lib/utils/common/SingletonInstanceMap.js +78 -0
- package/lib/utils/common/index.d.ts +0 -2
- package/lib/utils/common/index.js +2 -32
- package/lib/utils/{common/RestFormApi.d.ts → form/form.api.d.ts} +9 -4
- package/lib/utils/{common/RestFormApi.js → form/form.api.js} +85 -36
- package/lib/utils/form/form.handler.js +1 -0
- package/lib/utils/form/form.instance.d.ts +26 -0
- package/lib/utils/form/form.instance.js +105 -0
- package/lib/utils/form/form.process.js +1 -0
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.js +2 -0
- package/package.json +1 -1
- package/es/utils/common/ClientCache.d.ts +0 -36
- package/es/utils/common/ClientCache.js +0 -120
- package/lib/utils/common/ClientCache.d.ts +0 -36
- package/lib/utils/common/ClientCache.js +0 -125
- /package/es/utils/{common → api}/Request.d.ts +0 -0
- /package/es/utils/{common → api}/Request.js +0 -0
- /package/lib/utils/{common → api}/Request.d.ts +0 -0
- /package/lib/utils/{common → api}/Request.js +0 -0
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
|
-
export var ClientCache = /*#__PURE__*/function () {
|
|
4
|
-
function ClientCache(options) {
|
|
5
|
-
this.cacheMap = void 0;
|
|
6
|
-
this.name = void 0;
|
|
7
|
-
this.loadData = void 0;
|
|
8
|
-
this.cacheMap = new Map();
|
|
9
|
-
this.name = options.name;
|
|
10
|
-
if (typeof options.loadData == "function") {
|
|
11
|
-
this.loadData = options.loadData;
|
|
12
|
-
} else {
|
|
13
|
-
this.loadData = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
14
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
15
|
-
while (1) switch (_context.prev = _context.next) {
|
|
16
|
-
case 0:
|
|
17
|
-
return _context.abrupt("return", null);
|
|
18
|
-
case 1:
|
|
19
|
-
case "end":
|
|
20
|
-
return _context.stop();
|
|
21
|
-
}
|
|
22
|
-
}, _callee);
|
|
23
|
-
}));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* 获取值
|
|
29
|
-
* @param key
|
|
30
|
-
* @param cache 是否从缓存中获取
|
|
31
|
-
*/
|
|
32
|
-
var _proto = ClientCache.prototype;
|
|
33
|
-
_proto.get =
|
|
34
|
-
/*#__PURE__*/
|
|
35
|
-
function () {
|
|
36
|
-
var _get = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(key, cache) {
|
|
37
|
-
var value;
|
|
38
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
39
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
40
|
-
case 0:
|
|
41
|
-
if (!(!cache && this.cacheMap.has(key))) {
|
|
42
|
-
_context2.next = 2;
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
return _context2.abrupt("return", this.cacheMap.get(key));
|
|
46
|
-
case 2:
|
|
47
|
-
_context2.prev = 2;
|
|
48
|
-
_context2.next = 5;
|
|
49
|
-
return this.loadData(key);
|
|
50
|
-
case 5:
|
|
51
|
-
value = _context2.sent;
|
|
52
|
-
this.cacheMap.set(key, value);
|
|
53
|
-
return _context2.abrupt("return", value);
|
|
54
|
-
case 10:
|
|
55
|
-
_context2.prev = 10;
|
|
56
|
-
_context2.t0 = _context2["catch"](2);
|
|
57
|
-
console.log("\u7F13\u5B58 {" + this.name + "} \u83B7\u53D6\u503C\u5931\u8D25!\u5C06\u8FD4\u56DEnull", _context2.t0);
|
|
58
|
-
this.cacheMap.set(key, null);
|
|
59
|
-
return _context2.abrupt("return", null);
|
|
60
|
-
case 15:
|
|
61
|
-
case "end":
|
|
62
|
-
return _context2.stop();
|
|
63
|
-
}
|
|
64
|
-
}, _callee2, this, [[2, 10]]);
|
|
65
|
-
}));
|
|
66
|
-
function get(_x, _x2) {
|
|
67
|
-
return _get.apply(this, arguments);
|
|
68
|
-
}
|
|
69
|
-
return get;
|
|
70
|
-
}()
|
|
71
|
-
/**
|
|
72
|
-
* 重新加载
|
|
73
|
-
* @param key
|
|
74
|
-
*/
|
|
75
|
-
;
|
|
76
|
-
_proto.reload =
|
|
77
|
-
/*#__PURE__*/
|
|
78
|
-
function () {
|
|
79
|
-
var _reload = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(key) {
|
|
80
|
-
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
81
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
82
|
-
case 0:
|
|
83
|
-
return _context3.abrupt("return", this.get(key, false));
|
|
84
|
-
case 1:
|
|
85
|
-
case "end":
|
|
86
|
-
return _context3.stop();
|
|
87
|
-
}
|
|
88
|
-
}, _callee3, this);
|
|
89
|
-
}));
|
|
90
|
-
function reload(_x3) {
|
|
91
|
-
return _reload.apply(this, arguments);
|
|
92
|
-
}
|
|
93
|
-
return reload;
|
|
94
|
-
}()
|
|
95
|
-
/**
|
|
96
|
-
* 手动设置
|
|
97
|
-
* @param key
|
|
98
|
-
* @param value
|
|
99
|
-
*/
|
|
100
|
-
;
|
|
101
|
-
_proto.set = function set(key, value) {
|
|
102
|
-
this.cacheMap.set(key, value);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* 删除某个缓存
|
|
107
|
-
* @param key
|
|
108
|
-
*/;
|
|
109
|
-
_proto["delete"] = function _delete(key) {
|
|
110
|
-
this.cacheMap["delete"](key);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* 删除全部缓存
|
|
115
|
-
*/;
|
|
116
|
-
_proto.clear = function clear() {
|
|
117
|
-
this.cacheMap.clear();
|
|
118
|
-
};
|
|
119
|
-
return ClientCache;
|
|
120
|
-
}();
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export declare type LoadData = (key: string) => Promise<any>;
|
|
2
|
-
export declare class ClientCache {
|
|
3
|
-
private cacheMap;
|
|
4
|
-
name: string;
|
|
5
|
-
loadData: LoadData;
|
|
6
|
-
constructor(options: {
|
|
7
|
-
name: string;
|
|
8
|
-
loadData: LoadData;
|
|
9
|
-
});
|
|
10
|
-
/**
|
|
11
|
-
* 获取值
|
|
12
|
-
* @param key
|
|
13
|
-
* @param cache 是否从缓存中获取
|
|
14
|
-
*/
|
|
15
|
-
get(key: string, cache?: boolean): Promise<any>;
|
|
16
|
-
/**
|
|
17
|
-
* 重新加载
|
|
18
|
-
* @param key
|
|
19
|
-
*/
|
|
20
|
-
reload(key: string): Promise<any>;
|
|
21
|
-
/**
|
|
22
|
-
* 手动设置
|
|
23
|
-
* @param key
|
|
24
|
-
* @param value
|
|
25
|
-
*/
|
|
26
|
-
set(key: string, value: any): void;
|
|
27
|
-
/**
|
|
28
|
-
* 删除某个缓存
|
|
29
|
-
* @param key
|
|
30
|
-
*/
|
|
31
|
-
delete(key: string): void;
|
|
32
|
-
/**
|
|
33
|
-
* 删除全部缓存
|
|
34
|
-
*/
|
|
35
|
-
clear(): void;
|
|
36
|
-
}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
exports.__esModule = true;
|
|
5
|
-
exports.ClientCache = void 0;
|
|
6
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
7
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
|
-
var ClientCache = exports.ClientCache = /*#__PURE__*/function () {
|
|
9
|
-
function ClientCache(options) {
|
|
10
|
-
this.cacheMap = void 0;
|
|
11
|
-
this.name = void 0;
|
|
12
|
-
this.loadData = void 0;
|
|
13
|
-
this.cacheMap = new Map();
|
|
14
|
-
this.name = options.name;
|
|
15
|
-
if (typeof options.loadData == "function") {
|
|
16
|
-
this.loadData = options.loadData;
|
|
17
|
-
} else {
|
|
18
|
-
this.loadData = /*#__PURE__*/(0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
19
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
20
|
-
while (1) switch (_context.prev = _context.next) {
|
|
21
|
-
case 0:
|
|
22
|
-
return _context.abrupt("return", null);
|
|
23
|
-
case 1:
|
|
24
|
-
case "end":
|
|
25
|
-
return _context.stop();
|
|
26
|
-
}
|
|
27
|
-
}, _callee);
|
|
28
|
-
}));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* 获取值
|
|
34
|
-
* @param key
|
|
35
|
-
* @param cache 是否从缓存中获取
|
|
36
|
-
*/
|
|
37
|
-
var _proto = ClientCache.prototype;
|
|
38
|
-
_proto.get =
|
|
39
|
-
/*#__PURE__*/
|
|
40
|
-
function () {
|
|
41
|
-
var _get = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(key, cache) {
|
|
42
|
-
var value;
|
|
43
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
44
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
45
|
-
case 0:
|
|
46
|
-
if (!(!cache && this.cacheMap.has(key))) {
|
|
47
|
-
_context2.next = 2;
|
|
48
|
-
break;
|
|
49
|
-
}
|
|
50
|
-
return _context2.abrupt("return", this.cacheMap.get(key));
|
|
51
|
-
case 2:
|
|
52
|
-
_context2.prev = 2;
|
|
53
|
-
_context2.next = 5;
|
|
54
|
-
return this.loadData(key);
|
|
55
|
-
case 5:
|
|
56
|
-
value = _context2.sent;
|
|
57
|
-
this.cacheMap.set(key, value);
|
|
58
|
-
return _context2.abrupt("return", value);
|
|
59
|
-
case 10:
|
|
60
|
-
_context2.prev = 10;
|
|
61
|
-
_context2.t0 = _context2["catch"](2);
|
|
62
|
-
console.log("\u7F13\u5B58 {" + this.name + "} \u83B7\u53D6\u503C\u5931\u8D25!\u5C06\u8FD4\u56DEnull", _context2.t0);
|
|
63
|
-
this.cacheMap.set(key, null);
|
|
64
|
-
return _context2.abrupt("return", null);
|
|
65
|
-
case 15:
|
|
66
|
-
case "end":
|
|
67
|
-
return _context2.stop();
|
|
68
|
-
}
|
|
69
|
-
}, _callee2, this, [[2, 10]]);
|
|
70
|
-
}));
|
|
71
|
-
function get(_x, _x2) {
|
|
72
|
-
return _get.apply(this, arguments);
|
|
73
|
-
}
|
|
74
|
-
return get;
|
|
75
|
-
}()
|
|
76
|
-
/**
|
|
77
|
-
* 重新加载
|
|
78
|
-
* @param key
|
|
79
|
-
*/
|
|
80
|
-
;
|
|
81
|
-
_proto.reload =
|
|
82
|
-
/*#__PURE__*/
|
|
83
|
-
function () {
|
|
84
|
-
var _reload = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(key) {
|
|
85
|
-
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
86
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
87
|
-
case 0:
|
|
88
|
-
return _context3.abrupt("return", this.get(key, false));
|
|
89
|
-
case 1:
|
|
90
|
-
case "end":
|
|
91
|
-
return _context3.stop();
|
|
92
|
-
}
|
|
93
|
-
}, _callee3, this);
|
|
94
|
-
}));
|
|
95
|
-
function reload(_x3) {
|
|
96
|
-
return _reload.apply(this, arguments);
|
|
97
|
-
}
|
|
98
|
-
return reload;
|
|
99
|
-
}()
|
|
100
|
-
/**
|
|
101
|
-
* 手动设置
|
|
102
|
-
* @param key
|
|
103
|
-
* @param value
|
|
104
|
-
*/
|
|
105
|
-
;
|
|
106
|
-
_proto.set = function set(key, value) {
|
|
107
|
-
this.cacheMap.set(key, value);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* 删除某个缓存
|
|
112
|
-
* @param key
|
|
113
|
-
*/;
|
|
114
|
-
_proto["delete"] = function _delete(key) {
|
|
115
|
-
this.cacheMap["delete"](key);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* 删除全部缓存
|
|
120
|
-
*/;
|
|
121
|
-
_proto.clear = function clear() {
|
|
122
|
-
this.cacheMap.clear();
|
|
123
|
-
};
|
|
124
|
-
return ClientCache;
|
|
125
|
-
}();
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|