@byteluck-fe/model-driven-shared 2.7.0-alpha.4 → 2.8.1-alpha.4
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/dist/esm/EventLogic.js +6 -6
- package/dist/esm/RulesMessage.js +6 -6
- package/dist/esm/calc.js +30 -30
- package/dist/esm/entity/Department.js +6 -6
- package/dist/esm/entity/User.js +28 -28
- package/dist/esm/enum.js +76 -76
- package/dist/esm/locales/en-US.json +24 -18
- package/dist/esm/locales/ja-JP.json +24 -18
- package/dist/esm/locales/zh-CN.json +7 -1
- package/dist/esm/log.js +47 -58
- package/dist/esm/loopControls.js +3 -0
- package/dist/esm/utils.js +3 -0
- package/dist/esm/watcher.js +26 -25
- package/dist/index.umd.js +1 -1
- package/dist/types/locales/index.d.ts +18 -0
- package/package.json +2 -2
|
@@ -46,22 +46,28 @@
|
|
|
46
46
|
"pleaseSetTheLogicalRelationshipOfAllRuleConditions": "全ての条件のロジックを設定して下さい",
|
|
47
47
|
"pleaseCompleteAllRulesAndConditions": "全ての条件を完成させて下さい",
|
|
48
48
|
"pleaseSelectControl": "please select control",
|
|
49
|
-
"pleaseSelectDashboard": "
|
|
50
|
-
"theViewNameCannotBeEmpty": "
|
|
51
|
-
"pleaseSelectOcrType": "
|
|
52
|
-
"pleaseSelectAtLeastOneFieldToFillIn": "
|
|
53
|
-
"pleaseChooseAtLeastOne": "
|
|
54
|
-
"pleaseEnterButtonContent": "
|
|
55
|
-
"pleaseEnterDataCodeInDataSetting": "
|
|
56
|
-
"pleaseEnterValueFieldCodeInDataSetting": "
|
|
57
|
-
"pleaseEnterSvcCodeInDataSetting": "
|
|
58
|
-
"pleaseBindAtLeastOneDisplayValueInDataSetting": "
|
|
59
|
-
"rootNodeIsRequiredInDataSetting": "
|
|
60
|
-
"pleaseEnterMaxHeight": "
|
|
61
|
-
"pleaseEnter": "
|
|
62
|
-
"pleaseEnterWatermark": "
|
|
63
|
-
"pleaseEnterFileName": "
|
|
64
|
-
"pleaseUploadAtLeastOnePrintTemplate": "
|
|
65
|
-
"pleaseAssignBusiness":"
|
|
66
|
-
"pleaseAssignExternal":"
|
|
49
|
+
"pleaseSelectDashboard": "ダッシュボードを選択してください",
|
|
50
|
+
"theViewNameCannotBeEmpty": "ビュー名を空白にすることはできません",
|
|
51
|
+
"pleaseSelectOcrType": "識別タイプを選択してください",
|
|
52
|
+
"pleaseSelectAtLeastOneFieldToFillIn": "少なくとも1つのフィールドを選択して入力してください",
|
|
53
|
+
"pleaseChooseAtLeastOne": "少なくとも1つを選択してください",
|
|
54
|
+
"pleaseEnterButtonContent": "ボタンのタイトルを入力してください",
|
|
55
|
+
"pleaseEnterDataCodeInDataSetting": "データ設定でビジネスモデルをバインドしてください",
|
|
56
|
+
"pleaseEnterValueFieldCodeInDataSetting": "データ設定に格納値をバインドしてください",
|
|
57
|
+
"pleaseEnterSvcCodeInDataSetting": "データ設定でサービスをバインドしてください",
|
|
58
|
+
"pleaseBindAtLeastOneDisplayValueInDataSetting": "データ設定に少なくとも1つの表示値をバインドしてください",
|
|
59
|
+
"rootNodeIsRequiredInDataSetting": "データ設定でルートノードを選択してください",
|
|
60
|
+
"pleaseEnterMaxHeight": "最大高さを入力してください",
|
|
61
|
+
"pleaseEnter": "入力内容を空にすることはできません",
|
|
62
|
+
"pleaseEnterWatermark": "透かしを空にすることはできません",
|
|
63
|
+
"pleaseEnterFileName": "ファイル名を空白にすることはできません",
|
|
64
|
+
"pleaseUploadAtLeastOnePrintTemplate": "印刷テンプレートを少なくとも1つアップロードしてください!!",
|
|
65
|
+
"pleaseAssignBusiness":"指定されたビジネス部門を選択してください",
|
|
66
|
+
"pleaseAssignExternal":"外部組織の指定を選択してください",
|
|
67
|
+
"pleaseEnterAliasCode":"サブテーブル別名を入力してください",
|
|
68
|
+
"pleaseSelectDataCode":"関連表を選択してビジネスモデルを設定してください",
|
|
69
|
+
"pleaseSelectSvcCode":"関連テーブル設定バインドサービスを選択してください",
|
|
70
|
+
"pleaseSelectJoinFieldCode":"関連サブテーブルフィールドの選択",
|
|
71
|
+
"pleaseSelectMainFieldCode":"関連マスターテーブルフィールドを選択してください",
|
|
72
|
+
"pleaseSelectSortFieldCode": "ソートフィールドを選択してください"
|
|
67
73
|
}
|
|
@@ -66,5 +66,11 @@
|
|
|
66
66
|
"pleaseEnterFileName": "文件名称不能为空",
|
|
67
67
|
"pleaseUploadAtLeastOnePrintTemplate": "请至少上传一个打印模版!",
|
|
68
68
|
"pleaseAssignBusiness":"请选择指定业务部门",
|
|
69
|
-
"pleaseAssignExternal":"请选择指定外部组织"
|
|
69
|
+
"pleaseAssignExternal":"请选择指定外部组织",
|
|
70
|
+
"pleaseEnterAliasCode":"请输入子表别名",
|
|
71
|
+
"pleaseSelectDataCode":"请选择关联表设置业务模型",
|
|
72
|
+
"pleaseSelectSvcCode":"请选择关联表设置绑定服务",
|
|
73
|
+
"pleaseSelectJoinFieldCode":"请选择关联子表字段",
|
|
74
|
+
"pleaseSelectMainFieldCode":"请选择关联主表字段",
|
|
75
|
+
"pleaseSelectSortFieldCode": "请选择排序字段"
|
|
70
76
|
}
|
package/dist/esm/log.js
CHANGED
|
@@ -1,55 +1,44 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
3
3
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
4
|
return arr2;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
if (Array.isArray(arr)) return
|
|
6
|
+
function _array_without_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function _assert_this_initialized(self) {
|
|
10
10
|
if (self === void 0) {
|
|
11
11
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
12
12
|
}
|
|
13
13
|
return self;
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function _class_call_check(instance, Constructor) {
|
|
16
16
|
if (!(instance instanceof Constructor)) {
|
|
17
17
|
throw new TypeError("Cannot call a class as a function");
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
function isNativeReflectConstruct() {
|
|
21
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
22
|
-
if (Reflect.construct.sham) return false;
|
|
23
|
-
if (typeof Proxy === "function") return true;
|
|
24
|
-
try {
|
|
25
|
-
Date.prototype.toString.call(Reflect.construct(Date, [], function() {}));
|
|
26
|
-
return true;
|
|
27
|
-
} catch (e) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
20
|
function _construct(Parent, args, Class) {
|
|
32
|
-
if (
|
|
21
|
+
if (_is_native_reflect_construct()) {
|
|
33
22
|
_construct = Reflect.construct;
|
|
34
23
|
} else {
|
|
35
|
-
_construct = function
|
|
24
|
+
_construct = function construct(Parent, args, Class) {
|
|
36
25
|
var a = [
|
|
37
26
|
null
|
|
38
27
|
];
|
|
39
28
|
a.push.apply(a, args);
|
|
40
29
|
var Constructor = Function.bind.apply(Parent, a);
|
|
41
30
|
var instance = new Constructor();
|
|
42
|
-
if (Class)
|
|
31
|
+
if (Class) _set_prototype_of(instance, Class.prototype);
|
|
43
32
|
return instance;
|
|
44
33
|
};
|
|
45
34
|
}
|
|
46
35
|
return _construct.apply(null, arguments);
|
|
47
36
|
}
|
|
48
|
-
function
|
|
49
|
-
|
|
37
|
+
function _get_prototype_of(o) {
|
|
38
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
50
39
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
51
40
|
};
|
|
52
|
-
return
|
|
41
|
+
return _get_prototype_of(o);
|
|
53
42
|
}
|
|
54
43
|
function _inherits(subClass, superClass) {
|
|
55
44
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -62,49 +51,49 @@ function _inherits(subClass, superClass) {
|
|
|
62
51
|
configurable: true
|
|
63
52
|
}
|
|
64
53
|
});
|
|
65
|
-
if (superClass)
|
|
54
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
66
55
|
}
|
|
67
|
-
function
|
|
56
|
+
function _is_native_function(fn) {
|
|
68
57
|
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
69
58
|
}
|
|
70
|
-
function
|
|
59
|
+
function _iterable_to_array(iter) {
|
|
71
60
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
72
61
|
}
|
|
73
|
-
function
|
|
62
|
+
function _non_iterable_spread() {
|
|
74
63
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
75
64
|
}
|
|
76
|
-
function
|
|
77
|
-
if (call && (
|
|
65
|
+
function _possible_constructor_return(self, call) {
|
|
66
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
78
67
|
return call;
|
|
79
68
|
}
|
|
80
|
-
return
|
|
69
|
+
return _assert_this_initialized(self);
|
|
81
70
|
}
|
|
82
|
-
function
|
|
83
|
-
|
|
71
|
+
function _set_prototype_of(o, p) {
|
|
72
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
84
73
|
o.__proto__ = p;
|
|
85
74
|
return o;
|
|
86
75
|
};
|
|
87
|
-
return
|
|
76
|
+
return _set_prototype_of(o, p);
|
|
88
77
|
}
|
|
89
|
-
function
|
|
90
|
-
return
|
|
78
|
+
function _to_consumable_array(arr) {
|
|
79
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
91
80
|
}
|
|
92
|
-
|
|
81
|
+
function _type_of(obj) {
|
|
93
82
|
"@swc/helpers - typeof";
|
|
94
83
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
95
|
-
}
|
|
96
|
-
function
|
|
84
|
+
}
|
|
85
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
97
86
|
if (!o) return;
|
|
98
|
-
if (typeof o === "string") return
|
|
87
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
99
88
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
100
89
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
101
90
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
102
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
91
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
103
92
|
}
|
|
104
|
-
function
|
|
93
|
+
function _wrap_native_super(Class) {
|
|
105
94
|
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
106
|
-
|
|
107
|
-
if (Class === null || !
|
|
95
|
+
_wrap_native_super = function wrapNativeSuper(Class) {
|
|
96
|
+
if (Class === null || !_is_native_function(Class)) return Class;
|
|
108
97
|
if (typeof Class !== "function") {
|
|
109
98
|
throw new TypeError("Super expression must either be null or a function");
|
|
110
99
|
}
|
|
@@ -113,7 +102,7 @@ function _wrapNativeSuper(Class) {
|
|
|
113
102
|
_cache.set(Class, Wrapper);
|
|
114
103
|
}
|
|
115
104
|
function Wrapper() {
|
|
116
|
-
return _construct(Class, arguments,
|
|
105
|
+
return _construct(Class, arguments, _get_prototype_of(this).constructor);
|
|
117
106
|
}
|
|
118
107
|
Wrapper.prototype = Object.create(Class.prototype, {
|
|
119
108
|
constructor: {
|
|
@@ -123,11 +112,11 @@ function _wrapNativeSuper(Class) {
|
|
|
123
112
|
configurable: true
|
|
124
113
|
}
|
|
125
114
|
});
|
|
126
|
-
return
|
|
115
|
+
return _set_prototype_of(Wrapper, Class);
|
|
127
116
|
};
|
|
128
|
-
return
|
|
117
|
+
return _wrap_native_super(Class);
|
|
129
118
|
}
|
|
130
|
-
function
|
|
119
|
+
function _is_native_reflect_construct() {
|
|
131
120
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
132
121
|
if (Reflect.construct.sham) return false;
|
|
133
122
|
if (typeof Proxy === "function") return true;
|
|
@@ -138,17 +127,17 @@ function _isNativeReflectConstruct() {
|
|
|
138
127
|
return false;
|
|
139
128
|
}
|
|
140
129
|
}
|
|
141
|
-
function
|
|
142
|
-
var hasNativeReflectConstruct =
|
|
130
|
+
function _create_super(Derived) {
|
|
131
|
+
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
143
132
|
return function _createSuperInternal() {
|
|
144
|
-
var Super =
|
|
133
|
+
var Super = _get_prototype_of(Derived), result;
|
|
145
134
|
if (hasNativeReflectConstruct) {
|
|
146
|
-
var NewTarget =
|
|
135
|
+
var NewTarget = _get_prototype_of(this).constructor;
|
|
147
136
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
148
137
|
} else {
|
|
149
138
|
result = Super.apply(this, arguments);
|
|
150
139
|
}
|
|
151
|
-
return
|
|
140
|
+
return _possible_constructor_return(this, result);
|
|
152
141
|
};
|
|
153
142
|
}
|
|
154
143
|
var logger = console;
|
|
@@ -160,7 +149,7 @@ export function warn() {
|
|
|
160
149
|
var other = data.slice(1);
|
|
161
150
|
(_logger = logger).warn.apply(_logger, [
|
|
162
151
|
"\uD83E\uDDD0 Driven Warning:" + data[0]
|
|
163
|
-
].concat(
|
|
152
|
+
].concat(_to_consumable_array(other)));
|
|
164
153
|
}
|
|
165
154
|
export function log() {
|
|
166
155
|
for(var _len = arguments.length, data = new Array(_len), _key = 0; _key < _len; _key++){
|
|
@@ -170,7 +159,7 @@ export function log() {
|
|
|
170
159
|
var other = data.slice(1);
|
|
171
160
|
(_logger = logger).log.apply(_logger, [
|
|
172
161
|
"\uD83D\uDE80 Driven Log:" + data[0]
|
|
173
|
-
].concat(
|
|
162
|
+
].concat(_to_consumable_array(other)));
|
|
174
163
|
}
|
|
175
164
|
function joinMessage(message) {
|
|
176
165
|
return message + " \uD83D\uDC1B\uD83D\uDC1B\uD83D\uDC1B";
|
|
@@ -179,9 +168,9 @@ function joinMessage(message) {
|
|
|
179
168
|
var DrivenError = /*#__PURE__*/ function(Error1) {
|
|
180
169
|
"use strict";
|
|
181
170
|
_inherits(DrivenError, Error1);
|
|
182
|
-
var _super =
|
|
171
|
+
var _super = _create_super(DrivenError);
|
|
183
172
|
function DrivenError(message) {
|
|
184
|
-
|
|
173
|
+
_class_call_check(this, DrivenError);
|
|
185
174
|
var _this;
|
|
186
175
|
_this = _super.call(this, message);
|
|
187
176
|
_this.name = "\uD83D\uDCA5 Driven Error";
|
|
@@ -189,14 +178,14 @@ var DrivenError = /*#__PURE__*/ function(Error1) {
|
|
|
189
178
|
return _this;
|
|
190
179
|
}
|
|
191
180
|
return DrivenError;
|
|
192
|
-
}(
|
|
181
|
+
}(_wrap_native_super(Error));
|
|
193
182
|
// 驱动语法错误
|
|
194
183
|
var DrivenReferenceError = /*#__PURE__*/ function(DrivenError) {
|
|
195
184
|
"use strict";
|
|
196
185
|
_inherits(DrivenReferenceError, DrivenError);
|
|
197
|
-
var _super =
|
|
186
|
+
var _super = _create_super(DrivenReferenceError);
|
|
198
187
|
function DrivenReferenceError(message) {
|
|
199
|
-
|
|
188
|
+
_class_call_check(this, DrivenReferenceError);
|
|
200
189
|
var _this;
|
|
201
190
|
_this = _super.call(this, message);
|
|
202
191
|
_this.name = "\uD83D\uDEA8 Driven Reference Error";
|
package/dist/esm/loopControls.js
CHANGED
|
@@ -5,6 +5,9 @@ export function loopFormSchema(schema, callback) {
|
|
|
5
5
|
case "layout":
|
|
6
6
|
loopFormSchema(item === null || item === void 0 ? void 0 : item.children, callback);
|
|
7
7
|
break;
|
|
8
|
+
case "wrap":
|
|
9
|
+
loopFormSchema(item === null || item === void 0 ? void 0 : item.children, callback);
|
|
10
|
+
break;
|
|
8
11
|
case "search":
|
|
9
12
|
loopFormSchema(item === null || item === void 0 ? void 0 : item.children, callback);
|
|
10
13
|
break;
|
package/dist/esm/utils.js
CHANGED
|
@@ -109,6 +109,9 @@ export function wait() {
|
|
|
109
109
|
if (Array.isArray(item === null || item === void 0 ? void 0 : item.children)) {
|
|
110
110
|
new_item.children = loop(item.children, convertion);
|
|
111
111
|
}
|
|
112
|
+
if (Array.isArray(item === null || item === void 0 ? void 0 : item.footers)) {
|
|
113
|
+
new_item.footers = loop(item.footers, convertion);
|
|
114
|
+
}
|
|
112
115
|
return convertion(new_item);
|
|
113
116
|
});
|
|
114
117
|
}
|
package/dist/esm/watcher.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
3
3
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
4
|
return arr2;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
if (Array.isArray(arr)) return
|
|
6
|
+
function _array_without_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
8
|
}
|
|
9
9
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
10
10
|
try {
|
|
@@ -20,7 +20,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
20
20
|
Promise.resolve(value).then(_next, _throw);
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function _async_to_generator(fn) {
|
|
24
24
|
return function() {
|
|
25
25
|
var self = this, args = arguments;
|
|
26
26
|
return new Promise(function(resolve, reject) {
|
|
@@ -35,7 +35,7 @@ function _asyncToGenerator(fn) {
|
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
function
|
|
38
|
+
function _class_call_check(instance, Constructor) {
|
|
39
39
|
if (!(instance instanceof Constructor)) {
|
|
40
40
|
throw new TypeError("Cannot call a class as a function");
|
|
41
41
|
}
|
|
@@ -49,12 +49,12 @@ function _defineProperties(target, props) {
|
|
|
49
49
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
53
53
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
54
54
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
55
55
|
return Constructor;
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function _define_property(obj, key, value) {
|
|
58
58
|
if (key in obj) {
|
|
59
59
|
Object.defineProperty(obj, key, {
|
|
60
60
|
value: value,
|
|
@@ -67,24 +67,24 @@ function _defineProperty(obj, key, value) {
|
|
|
67
67
|
}
|
|
68
68
|
return obj;
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function _iterable_to_array(iter) {
|
|
71
71
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function _non_iterable_spread() {
|
|
74
74
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
75
75
|
}
|
|
76
|
-
function
|
|
77
|
-
return
|
|
76
|
+
function _to_consumable_array(arr) {
|
|
77
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
80
80
|
if (!o) return;
|
|
81
|
-
if (typeof o === "string") return
|
|
81
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
82
82
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
83
83
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
84
84
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
85
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
85
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
function _ts_generator(thisArg, body) {
|
|
88
88
|
var f, y, t, g, _ = {
|
|
89
89
|
label: 0,
|
|
90
90
|
sent: function() {
|
|
@@ -178,18 +178,18 @@ var __generator = this && this.__generator || function(thisArg, body) {
|
|
|
178
178
|
done: true
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
|
-
}
|
|
181
|
+
}
|
|
182
182
|
import { log, logerror } from "./log";
|
|
183
183
|
// 通信总线
|
|
184
184
|
var Watcher = /*#__PURE__*/ function() {
|
|
185
185
|
"use strict";
|
|
186
186
|
function Watcher() {
|
|
187
|
-
|
|
187
|
+
_class_call_check(this, Watcher);
|
|
188
188
|
// 全局事件维护
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
_define_property(this, "_events", new Map());
|
|
190
|
+
_define_property(this, "debug", false);
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
_create_class(Watcher, [
|
|
193
193
|
{
|
|
194
194
|
key: "emit",
|
|
195
195
|
value: //发布,触发事件
|
|
@@ -198,9 +198,9 @@ var Watcher = /*#__PURE__*/ function() {
|
|
|
198
198
|
payload[_key - 1] = arguments[_key];
|
|
199
199
|
}
|
|
200
200
|
var _this = this;
|
|
201
|
-
return
|
|
201
|
+
return _async_to_generator(function() {
|
|
202
202
|
var callbacksOrigin, results, _callbacks, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, callback, result, e, err;
|
|
203
|
-
return
|
|
203
|
+
return _ts_generator(this, function(_state) {
|
|
204
204
|
switch(_state.label){
|
|
205
205
|
case 0:
|
|
206
206
|
callbacksOrigin = _this._events.get(key);
|
|
@@ -209,6 +209,7 @@ var Watcher = /*#__PURE__*/ function() {
|
|
|
209
209
|
3,
|
|
210
210
|
10
|
|
211
211
|
];
|
|
212
|
+
// 由于执行回调是异步队列的形式,所以需要复制一份原来的callbacks,确保不会因为循环过程中卸载了一些事件导致的事件执行错误问题
|
|
212
213
|
_callbacks = callbacksOrigin.slice();
|
|
213
214
|
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
214
215
|
_state.label = 1;
|
|
@@ -246,10 +247,10 @@ var Watcher = /*#__PURE__*/ function() {
|
|
|
246
247
|
"正在执行 ".concat(key, " 事件: ").concat(callback.applyingPluginName ? "当前执行的插件为:" + callback.applyingPluginName : "", ", 当前执行函数的参数为").concat(payload.map(function() {
|
|
247
248
|
return "%o";
|
|
248
249
|
}).join(","), "。")
|
|
249
|
-
].concat(
|
|
250
|
+
].concat(_to_consumable_array(payload)));
|
|
250
251
|
return [
|
|
251
252
|
4,
|
|
252
|
-
callback.apply(null,
|
|
253
|
+
callback.apply(null, _to_consumable_array(payload))
|
|
253
254
|
];
|
|
254
255
|
case 4:
|
|
255
256
|
result = _state.sent();
|
|
@@ -257,7 +258,7 @@ var Watcher = /*#__PURE__*/ function() {
|
|
|
257
258
|
"正在执行 ".concat(key, " 事件: ").concat(callback.applyingPluginName ? "当前执行的插件为:" + callback.applyingPluginName : "", ", 当前执行函数的参数为").concat(payload.map(function() {
|
|
258
259
|
return "%o";
|
|
259
260
|
}).join(","), "; 函数的返回结果为%o")
|
|
260
|
-
].concat(
|
|
261
|
+
].concat(_to_consumable_array(payload), [
|
|
261
262
|
result
|
|
262
263
|
]));
|
|
263
264
|
results.push(result);
|