@byteluck-fe/model-driven-shared 1.8.1-beta.1 → 2.0.1
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 +1 -1
- package/dist/esm/calc.js +12 -12
- package/dist/esm/watcher.js +88 -191
- package/dist/types/EventLogic.d.ts +1 -1
- package/dist/types/RulesMessage.d.ts +3 -3
- package/package.json +2 -2
package/dist/esm/EventLogic.js
CHANGED
package/dist/esm/calc.js
CHANGED
|
@@ -45,16 +45,16 @@ export var CALC_AGGREGATE_TYPE;
|
|
|
45
45
|
export var CalcScriptEchoItem = function CalcScriptEchoItem(props) {
|
|
46
46
|
"use strict";
|
|
47
47
|
_classCallCheck(this, CalcScriptEchoItem);
|
|
48
|
-
var
|
|
49
|
-
this.name = (
|
|
50
|
-
var
|
|
51
|
-
this.id = (
|
|
52
|
-
var
|
|
53
|
-
this.type = (
|
|
54
|
-
var
|
|
55
|
-
this.subTableId = (
|
|
56
|
-
var
|
|
57
|
-
this.subTableName = (
|
|
58
|
-
var
|
|
59
|
-
this.aggregateType = (
|
|
48
|
+
var ref;
|
|
49
|
+
this.name = (ref = props === null || props === void 0 ? void 0 : props.name) !== null && ref !== void 0 ? ref : "";
|
|
50
|
+
var ref1;
|
|
51
|
+
this.id = (ref1 = props === null || props === void 0 ? void 0 : props.id) !== null && ref1 !== void 0 ? ref1 : "";
|
|
52
|
+
var ref2;
|
|
53
|
+
this.type = (ref2 = props === null || props === void 0 ? void 0 : props.type) !== null && ref2 !== void 0 ? ref2 : CALC_TOKEN_TYPE.Number;
|
|
54
|
+
var ref3;
|
|
55
|
+
this.subTableId = (ref3 = props === null || props === void 0 ? void 0 : props.subTableId) !== null && ref3 !== void 0 ? ref3 : undefined;
|
|
56
|
+
var ref4;
|
|
57
|
+
this.subTableName = (ref4 = props === null || props === void 0 ? void 0 : props.subTableId) !== null && ref4 !== void 0 ? ref4 : undefined;
|
|
58
|
+
var ref5;
|
|
59
|
+
this.aggregateType = (ref5 = props === null || props === void 0 ? void 0 : props.aggregateType) !== null && ref5 !== void 0 ? ref5 : undefined;
|
|
60
60
|
};
|
package/dist/esm/watcher.js
CHANGED
|
@@ -57,101 +57,7 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
57
57
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
58
58
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
59
59
|
}
|
|
60
|
-
|
|
61
|
-
var f, y, t, g, _ = {
|
|
62
|
-
label: 0,
|
|
63
|
-
sent: function() {
|
|
64
|
-
if (t[0] & 1) throw t[1];
|
|
65
|
-
return t[1];
|
|
66
|
-
},
|
|
67
|
-
trys: [],
|
|
68
|
-
ops: []
|
|
69
|
-
};
|
|
70
|
-
return g = {
|
|
71
|
-
next: verb(0),
|
|
72
|
-
"throw": verb(1),
|
|
73
|
-
"return": verb(2)
|
|
74
|
-
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
75
|
-
return this;
|
|
76
|
-
}), g;
|
|
77
|
-
function verb(n) {
|
|
78
|
-
return function(v) {
|
|
79
|
-
return step([
|
|
80
|
-
n,
|
|
81
|
-
v
|
|
82
|
-
]);
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
function step(op) {
|
|
86
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
87
|
-
while(_)try {
|
|
88
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
89
|
-
if (y = 0, t) op = [
|
|
90
|
-
op[0] & 2,
|
|
91
|
-
t.value
|
|
92
|
-
];
|
|
93
|
-
switch(op[0]){
|
|
94
|
-
case 0:
|
|
95
|
-
case 1:
|
|
96
|
-
t = op;
|
|
97
|
-
break;
|
|
98
|
-
case 4:
|
|
99
|
-
_.label++;
|
|
100
|
-
return {
|
|
101
|
-
value: op[1],
|
|
102
|
-
done: false
|
|
103
|
-
};
|
|
104
|
-
case 5:
|
|
105
|
-
_.label++;
|
|
106
|
-
y = op[1];
|
|
107
|
-
op = [
|
|
108
|
-
0
|
|
109
|
-
];
|
|
110
|
-
continue;
|
|
111
|
-
case 7:
|
|
112
|
-
op = _.ops.pop();
|
|
113
|
-
_.trys.pop();
|
|
114
|
-
continue;
|
|
115
|
-
default:
|
|
116
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
117
|
-
_ = 0;
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
121
|
-
_.label = op[1];
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
if (op[0] === 6 && _.label < t[1]) {
|
|
125
|
-
_.label = t[1];
|
|
126
|
-
t = op;
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
if (t && _.label < t[2]) {
|
|
130
|
-
_.label = t[2];
|
|
131
|
-
_.ops.push(op);
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
if (t[2]) _.ops.pop();
|
|
135
|
-
_.trys.pop();
|
|
136
|
-
continue;
|
|
137
|
-
}
|
|
138
|
-
op = body.call(thisArg, _);
|
|
139
|
-
} catch (e) {
|
|
140
|
-
op = [
|
|
141
|
-
6,
|
|
142
|
-
e
|
|
143
|
-
];
|
|
144
|
-
y = 0;
|
|
145
|
-
} finally{
|
|
146
|
-
f = t = 0;
|
|
147
|
-
}
|
|
148
|
-
if (op[0] & 5) throw op[1];
|
|
149
|
-
return {
|
|
150
|
-
value: op[0] ? op[1] : void 0,
|
|
151
|
-
done: true
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
};
|
|
60
|
+
import regeneratorRuntime from "regenerator-runtime";
|
|
155
61
|
import { log, logerror } from "./log";
|
|
156
62
|
// 通信总线
|
|
157
63
|
var Watcher = /*#__PURE__*/ function() {
|
|
@@ -169,61 +75,43 @@ var Watcher = /*#__PURE__*/ function() {
|
|
|
169
75
|
payload[_key - 1] = arguments[_key];
|
|
170
76
|
}
|
|
171
77
|
var _this = this;
|
|
172
|
-
return _asyncToGenerator(function() {
|
|
173
|
-
var callbacksOrigin, results, _callbacks, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, callback, result
|
|
174
|
-
return
|
|
175
|
-
switch(
|
|
78
|
+
return _asyncToGenerator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
|
79
|
+
var callbacksOrigin, results, _callbacks, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, callback, result;
|
|
80
|
+
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
|
81
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
|
176
82
|
case 0:
|
|
177
83
|
callbacksOrigin = _this._events.get(key);
|
|
178
84
|
results = [];
|
|
179
|
-
if (!callbacksOrigin)
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
85
|
+
if (!callbacksOrigin) {
|
|
86
|
+
_ctx.next = 42;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
183
89
|
_callbacks = callbacksOrigin.slice();
|
|
184
90
|
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
185
|
-
|
|
186
|
-
case 1:
|
|
187
|
-
_state.trys.push([
|
|
188
|
-
1,
|
|
189
|
-
8,
|
|
190
|
-
9,
|
|
191
|
-
10
|
|
192
|
-
]);
|
|
91
|
+
_ctx.prev = 5;
|
|
193
92
|
_iterator = _callbacks[Symbol.iterator]();
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
];
|
|
93
|
+
case 7:
|
|
94
|
+
if (_iteratorNormalCompletion = (_step = _iterator.next()).done) {
|
|
95
|
+
_ctx.next = 28;
|
|
96
|
+
break;
|
|
97
|
+
}
|
|
200
98
|
callback = _step.value;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
3,
|
|
205
|
-
6
|
|
206
|
-
];
|
|
99
|
+
if (callbacksOrigin.includes(callback)) {
|
|
100
|
+
_ctx.next = 11;
|
|
101
|
+
break;
|
|
207
102
|
}
|
|
208
|
-
|
|
209
|
-
case
|
|
210
|
-
|
|
211
|
-
3,
|
|
212
|
-
5,
|
|
213
|
-
,
|
|
214
|
-
6
|
|
215
|
-
]);
|
|
103
|
+
return _ctx.abrupt("continue", 25);
|
|
104
|
+
case 11:
|
|
105
|
+
_ctx.prev = 11;
|
|
216
106
|
_this.debug && log.apply(void 0, [
|
|
217
107
|
"正在执行 ".concat(key, " 事件: ").concat(callback.applyingPluginName ? "当前执行的插件为:" + callback.applyingPluginName : "", ", 当前执行函数的参数为").concat(payload.map(function() {
|
|
218
108
|
return "%o";
|
|
219
109
|
}).join(","), "。")
|
|
220
110
|
].concat(_toConsumableArray(payload)));
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
case 4:
|
|
226
|
-
result = _state.sent();
|
|
111
|
+
_ctx.next = 15;
|
|
112
|
+
return callback.apply(null, _toConsumableArray(payload));
|
|
113
|
+
case 15:
|
|
114
|
+
result = _ctx.sent;
|
|
227
115
|
_this.debug && log.apply(void 0, [
|
|
228
116
|
"正在执行 ".concat(key, " 事件: ").concat(callback.applyingPluginName ? "当前执行的插件为:" + callback.applyingPluginName : "", ", 当前执行函数的参数为").concat(payload.map(function() {
|
|
229
117
|
return "%o";
|
|
@@ -232,69 +120,78 @@ var Watcher = /*#__PURE__*/ function() {
|
|
|
232
120
|
result
|
|
233
121
|
]));
|
|
234
122
|
results.push(result);
|
|
235
|
-
if (result === false) {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
7
|
|
239
|
-
];
|
|
123
|
+
if (!(result === false)) {
|
|
124
|
+
_ctx.next = 20;
|
|
125
|
+
break;
|
|
240
126
|
}
|
|
241
|
-
return
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
case
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
6
|
|
251
|
-
];
|
|
252
|
-
case 6:
|
|
127
|
+
return _ctx.abrupt("break", 28);
|
|
128
|
+
case 20:
|
|
129
|
+
_ctx.next = 25;
|
|
130
|
+
break;
|
|
131
|
+
case 22:
|
|
132
|
+
_ctx.prev = 22;
|
|
133
|
+
_ctx.t0 = _ctx["catch"](11);
|
|
134
|
+
logerror(String(_ctx.t0));
|
|
135
|
+
case 25:
|
|
253
136
|
_iteratorNormalCompletion = true;
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
];
|
|
263
|
-
case 8:
|
|
264
|
-
err = _state.sent();
|
|
137
|
+
_ctx.next = 7;
|
|
138
|
+
break;
|
|
139
|
+
case 28:
|
|
140
|
+
_ctx.next = 34;
|
|
141
|
+
break;
|
|
142
|
+
case 30:
|
|
143
|
+
_ctx.prev = 30;
|
|
144
|
+
_ctx.t1 = _ctx["catch"](5);
|
|
265
145
|
_didIteratorError = true;
|
|
266
|
-
_iteratorError =
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
try {
|
|
273
|
-
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
274
|
-
_iterator.return();
|
|
275
|
-
}
|
|
276
|
-
} finally{
|
|
277
|
-
if (_didIteratorError) {
|
|
278
|
-
throw _iteratorError;
|
|
279
|
-
}
|
|
146
|
+
_iteratorError = _ctx.t1;
|
|
147
|
+
case 34:
|
|
148
|
+
_ctx.prev = 34;
|
|
149
|
+
_ctx.prev = 35;
|
|
150
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
151
|
+
_iterator.return();
|
|
280
152
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
153
|
+
case 37:
|
|
154
|
+
_ctx.prev = 37;
|
|
155
|
+
if (!_didIteratorError) {
|
|
156
|
+
_ctx.next = 40;
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
throw _iteratorError;
|
|
160
|
+
case 40:
|
|
161
|
+
return _ctx.finish(37);
|
|
162
|
+
case 41:
|
|
163
|
+
return _ctx.finish(34);
|
|
164
|
+
case 42:
|
|
165
|
+
return _ctx.abrupt("return", results);
|
|
166
|
+
case 43:
|
|
167
|
+
case "end":
|
|
168
|
+
return _ctx.stop();
|
|
289
169
|
}
|
|
290
|
-
}
|
|
291
|
-
|
|
170
|
+
}, _callee, null, [
|
|
171
|
+
[
|
|
172
|
+
5,
|
|
173
|
+
30,
|
|
174
|
+
34,
|
|
175
|
+
42
|
|
176
|
+
],
|
|
177
|
+
[
|
|
178
|
+
11,
|
|
179
|
+
22
|
|
180
|
+
],
|
|
181
|
+
[
|
|
182
|
+
35,
|
|
183
|
+
,
|
|
184
|
+
37,
|
|
185
|
+
41
|
|
186
|
+
]
|
|
187
|
+
]);
|
|
188
|
+
}))();
|
|
292
189
|
};
|
|
293
190
|
// 订阅事件
|
|
294
191
|
_proto.on = function on(key, callback) {
|
|
295
192
|
if (this._events.has(key)) {
|
|
296
|
-
var
|
|
297
|
-
(
|
|
193
|
+
var ref;
|
|
194
|
+
(ref = this._events.get(key)) === null || ref === void 0 ? void 0 : ref.push(callback);
|
|
298
195
|
} else {
|
|
299
196
|
this._events.set(key, [
|
|
300
197
|
callback
|
|
@@ -97,7 +97,7 @@ declare const eventMap: readonly [{
|
|
|
97
97
|
readonly name: "行选中时";
|
|
98
98
|
readonly code: "list-rows-checked";
|
|
99
99
|
}];
|
|
100
|
-
export type InnerEventCode = typeof eventMap[number]['code'];
|
|
100
|
+
export declare type InnerEventCode = typeof eventMap[number]['code'];
|
|
101
101
|
export declare class EventLogic {
|
|
102
102
|
static readonly events: readonly [{
|
|
103
103
|
readonly key: "on_click";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import OkI18n from 'ok-i18n';
|
|
2
2
|
import messages from './locales';
|
|
3
|
-
type Message = Partial<typeof messages['zhCN']>;
|
|
4
|
-
type Keys = 'caption' | 'placeholder' | 'max' | 'min';
|
|
5
|
-
type Variable = {
|
|
3
|
+
declare type Message = Partial<typeof messages['zhCN']>;
|
|
4
|
+
declare type Keys = 'caption' | 'placeholder' | 'max' | 'min';
|
|
5
|
+
declare type Variable = {
|
|
6
6
|
[key in Keys]?: string | number;
|
|
7
7
|
};
|
|
8
8
|
export declare class RulesMessage {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@byteluck-fe/model-driven-shared",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "郝晨光 <2293885211@qq.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"humps": "^2.0.1",
|
|
26
26
|
"ok-i18n": "^3.0.0"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "935fe6ee64cd5930493650e92d4eccf03c610966"
|
|
29
29
|
}
|