@byteluck-fe/model-driven-driven 2.7.0-alpha.1 → 2.7.0-alpha.11
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/Builder.js +113 -86
- package/dist/esm/Designer.js +128 -177
- package/dist/esm/Driven.js +569 -406
- package/dist/esm/EventLogic.js +1 -1
- package/dist/esm/Store.js +118 -96
- package/dist/esm/constants.js +8 -8
- package/dist/esm/designerUtils.js +9 -5
- package/dist/esm/index.js +6 -6
- package/dist/esm/utils.js +75 -176
- package/dist/index.umd.js +3 -3
- package/dist/types/Driven.d.ts +6 -6
- package/dist/types/Store.d.ts +1 -1
- package/dist/types/designerUtils.d.ts +1 -0
- package/package.json +6 -6
package/dist/esm/Driven.js
CHANGED
|
@@ -20,6 +20,20 @@ function _classCallCheck(instance, Constructor) {
|
|
|
20
20
|
throw new TypeError("Cannot call a class as a function");
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
+
function _defineProperties(target, props) {
|
|
24
|
+
for(var i = 0; i < props.length; i++){
|
|
25
|
+
var descriptor = props[i];
|
|
26
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
27
|
+
descriptor.configurable = true;
|
|
28
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
29
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
33
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
34
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
35
|
+
return Constructor;
|
|
36
|
+
}
|
|
23
37
|
function _defineProperty(obj, key, value) {
|
|
24
38
|
if (key in obj) {
|
|
25
39
|
Object.defineProperty(obj, key, {
|
|
@@ -178,19 +192,19 @@ function _createSuper(Derived) {
|
|
|
178
192
|
return _possibleConstructorReturn(this, result);
|
|
179
193
|
};
|
|
180
194
|
}
|
|
181
|
-
import { CONTROL_BASE_TYPE, error, genNonDuplicateId, isArray, isBuiltInControls, isObject, isString, updateValueFromKeys, warn, Watcher } from
|
|
182
|
-
import { findInstanceDataScopeParent, Store } from
|
|
183
|
-
import { Designer } from
|
|
184
|
-
import EventLogic from
|
|
185
|
-
import { checkSchema, generatePermissions, getModelBindInfoList, toSchema } from
|
|
186
|
-
import { Group, initSettings, Tab } from
|
|
195
|
+
import { CONTROL_BASE_TYPE, error, genNonDuplicateId, isArray, isBuiltInControls, isObject, isString, updateValueFromKeys, warn, Watcher } from '@byteluck-fe/model-driven-shared';
|
|
196
|
+
import { findInstanceDataScopeParent, Store } from './Store';
|
|
197
|
+
import { Designer } from './Designer';
|
|
198
|
+
import EventLogic from './EventLogic';
|
|
199
|
+
import { checkSchema, generatePermissions, getModelBindInfoList, toSchema } from './utils';
|
|
200
|
+
import { Group, initSettings, Tab } from '@byteluck-fe/model-driven-settings';
|
|
187
201
|
// 当前正在注册的插件名称
|
|
188
|
-
var applyingPluginName =
|
|
189
|
-
/**
|
|
202
|
+
var applyingPluginName = '';
|
|
203
|
+
var Driven = /**
|
|
190
204
|
* 设计器驱动
|
|
191
|
-
* */
|
|
205
|
+
* */ /*#__PURE__*/ function(Watcher1) {
|
|
192
206
|
"use strict";
|
|
193
|
-
_inherits(Driven,
|
|
207
|
+
_inherits(Driven, Watcher1);
|
|
194
208
|
var _super = _createSuper(Driven);
|
|
195
209
|
function Driven(options) {
|
|
196
210
|
_classCallCheck(this, Driven);
|
|
@@ -206,7 +220,7 @@ var applyingPluginName = "";
|
|
|
206
220
|
// TODO 拿到permission_controls
|
|
207
221
|
_this.generatePermissions = generatePermissions;
|
|
208
222
|
_this.$options = Object.freeze(options);
|
|
209
|
-
var
|
|
223
|
+
var _$options = _this.$options, _autoMount = _$options.autoMount, autoMount = _autoMount === void 0 ? false : _autoMount, tmp = _$options.Designer, DesignerClass = tmp === void 0 ? Designer : tmp, schema = _$options.schema, _mode = _$options.mode, mode = _mode === void 0 ? 'form' : _mode, tmp1 = _$options.store, storeOptions = tmp1 === void 0 ? {} : tmp1;
|
|
210
224
|
_this.eventLogic = new EventLogic();
|
|
211
225
|
_this.designer = new DesignerClass();
|
|
212
226
|
_this.store = new Store(_objectSpread({
|
|
@@ -218,417 +232,566 @@ var applyingPluginName = "";
|
|
|
218
232
|
autoMount && _this.mount();
|
|
219
233
|
return _this;
|
|
220
234
|
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
if (!this.__pluginsApplied) {
|
|
231
|
-
this.__plugins.push(plugin);
|
|
232
|
-
}
|
|
233
|
-
return this;
|
|
234
|
-
};
|
|
235
|
-
_proto.applyPlugins = function applyPlugins() {
|
|
236
|
-
var _this = this;
|
|
237
|
-
if (this.__pluginsApplied) return;
|
|
238
|
-
this.__plugins.forEach(function(plugin) {
|
|
239
|
-
try {
|
|
240
|
-
var _plugin_pluginName;
|
|
241
|
-
applyingPluginName = (_plugin_pluginName = plugin.pluginName) !== null && _plugin_pluginName !== void 0 ? _plugin_pluginName : plugin.constructor.name;
|
|
242
|
-
plugin.apply(_this);
|
|
243
|
-
applyingPluginName = "";
|
|
244
|
-
} catch (e) {
|
|
245
|
-
error("".concat(applyingPluginName || plugin.constructor.name, " Plugin apply Error \n ").concat(e));
|
|
235
|
+
_createClass(Driven, [
|
|
236
|
+
{
|
|
237
|
+
key: "mount",
|
|
238
|
+
value: // 挂载
|
|
239
|
+
function mount() {
|
|
240
|
+
var _$options = this.$options, _plugins = _$options.plugins, plugins = _plugins === void 0 ? [] : _plugins;
|
|
241
|
+
this.__plugins = plugins;
|
|
242
|
+
this.applyPlugins();
|
|
243
|
+
this.isMounted = true;
|
|
246
244
|
}
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
if (!instance) {
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
this.setSelectedInstanceSetting();
|
|
275
|
-
this.emit("select", {
|
|
276
|
-
instance: instance
|
|
277
|
-
});
|
|
278
|
-
};
|
|
279
|
-
_proto.setSelectedInstanceSetting = function setSelectedInstanceSetting() {
|
|
280
|
-
var _instance_parent;
|
|
281
|
-
var instance = this.store.selected;
|
|
282
|
-
if (!instance) {
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
var setting = this.getControlSetting(instance.type);
|
|
286
|
-
// console.log('iswrap:', instance.parent?.controlType, instance.parent)
|
|
287
|
-
// if (instance.parent instanceof DesignerWrapControl) {
|
|
288
|
-
if (((_instance_parent = instance.parent) === null || _instance_parent === void 0 ? void 0 : _instance_parent.controlType) === CONTROL_BASE_TYPE.WRAP) {
|
|
289
|
-
var _instance_parent1;
|
|
290
|
-
var wrapSetting = this.getControlSetting((_instance_parent1 = instance.parent) === null || _instance_parent1 === void 0 ? void 0 : _instance_parent1.type);
|
|
291
|
-
setting = this.concatSetting(setting, wrapSetting, instance.parent.id);
|
|
292
|
-
}
|
|
293
|
-
this.store.setSelectInstanceSettings(setting);
|
|
294
|
-
this.callSelectedEffect("");
|
|
295
|
-
// 选中触发scopeEffect
|
|
296
|
-
var payload = {
|
|
297
|
-
from: null,
|
|
298
|
-
current: this.store.selectedInstanceDataScopeParent,
|
|
299
|
-
oldParent: null,
|
|
300
|
-
newParent: instance.parent
|
|
301
|
-
};
|
|
302
|
-
this.callSelectedScopeEffect(payload);
|
|
303
|
-
};
|
|
304
|
-
_proto.concatSetting = function concatSetting(settings, otherSettings, settingFromId) {
|
|
305
|
-
var _this = this;
|
|
306
|
-
var _settings_, _otherSettings_, _settings_1, _otherSettings_1;
|
|
307
|
-
var result = settings;
|
|
308
|
-
// tab
|
|
309
|
-
if (((_settings_ = settings[0]) === null || _settings_ === void 0 ? void 0 : _settings_.type) === "tab" && ((_otherSettings_ = otherSettings[0]) === null || _otherSettings_ === void 0 ? void 0 : _otherSettings_.type) === "tab") {
|
|
310
|
-
var tabSettings = settings;
|
|
311
|
-
var otherTabSettings = otherSettings.slice(0);
|
|
312
|
-
result = tabSettings.map(function(tab, index) {
|
|
313
|
-
var result = new Tab(tab);
|
|
314
|
-
var otherTabIndex = otherTabSettings.findIndex(function(item) {
|
|
315
|
-
return item.title === tab.title;
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
key: "use",
|
|
248
|
+
value: function use(plugin) {
|
|
249
|
+
if (!this.__pluginsApplied) {
|
|
250
|
+
this.__plugins.push(plugin);
|
|
251
|
+
}
|
|
252
|
+
return this;
|
|
253
|
+
}
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
key: "applyPlugins",
|
|
257
|
+
value: function applyPlugins() {
|
|
258
|
+
var _this = this;
|
|
259
|
+
if (this.__pluginsApplied) return;
|
|
260
|
+
this.__plugins.forEach(function(plugin) {
|
|
261
|
+
try {
|
|
262
|
+
var _pluginName;
|
|
263
|
+
applyingPluginName = (_pluginName = plugin.pluginName) !== null && _pluginName !== void 0 ? _pluginName : plugin.constructor.name;
|
|
264
|
+
plugin.apply(_this);
|
|
265
|
+
applyingPluginName = '';
|
|
266
|
+
} catch (e) {
|
|
267
|
+
error("".concat(applyingPluginName || plugin.constructor.name, " Plugin apply Error \n ").concat(e));
|
|
268
|
+
}
|
|
316
269
|
});
|
|
317
|
-
|
|
270
|
+
this.__pluginsApplied = true;
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
key: "emit",
|
|
275
|
+
value: function emit(key) {
|
|
276
|
+
for(var _len = arguments.length, payload = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
277
|
+
payload[_key - 1] = arguments[_key];
|
|
278
|
+
}
|
|
279
|
+
return _get(_getPrototypeOf(Driven.prototype), "emit", this).call(this, key, payload);
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
key: "on",
|
|
284
|
+
value: function on(key, callback) {
|
|
285
|
+
return _get(_getPrototypeOf(Driven.prototype), "on", this).call(this, key, callback);
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
key: "setInstances",
|
|
290
|
+
value: function setInstances(schema, beforeCreateInstance) {
|
|
291
|
+
this.store.setInstances(this.designer.createControl(Array.isArray(schema) ? schema : [
|
|
292
|
+
schema
|
|
293
|
+
], beforeCreateInstance));
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
key: "beforeSelectInstance",
|
|
298
|
+
value: function beforeSelectInstance() {
|
|
299
|
+
this.store.setSelectInstance(null);
|
|
300
|
+
this.setSelectedFieldItem(null);
|
|
301
|
+
this.store.setSelectInstanceSettings([]);
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
key: "afterSelectInstance",
|
|
306
|
+
value: function afterSelectInstance() {
|
|
307
|
+
var instance = this.store.selected;
|
|
308
|
+
if (!instance) {
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
this.setSelectedInstanceSetting();
|
|
312
|
+
this.emit('select', {
|
|
313
|
+
instance: instance
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
key: "setSelectedInstanceSetting",
|
|
319
|
+
value: function setSelectedInstanceSetting() {
|
|
320
|
+
var ref;
|
|
321
|
+
var instance = this.store.selected;
|
|
322
|
+
if (!instance) {
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
var setting = this.getControlSetting(instance.type);
|
|
326
|
+
// console.log('iswrap:', instance.parent?.controlType, instance.parent)
|
|
327
|
+
// if (instance.parent instanceof DesignerWrapControl) {
|
|
328
|
+
// 如果父控件为自定义控件wrapper
|
|
329
|
+
if (((ref = instance.parent) === null || ref === void 0 ? void 0 : ref.controlType) === CONTROL_BASE_TYPE.WRAP) {
|
|
330
|
+
var ref1;
|
|
331
|
+
var wrapSetting = this.getControlSetting((ref1 = instance.parent) === null || ref1 === void 0 ? void 0 : ref1.type);
|
|
332
|
+
setting = this.concatSetting(setting, wrapSetting, instance.parent.id);
|
|
333
|
+
}
|
|
334
|
+
this.store.setSelectInstanceSettings(setting);
|
|
335
|
+
this.callSelectedEffect('');
|
|
336
|
+
// 选中触发scopeEffect
|
|
337
|
+
var payload = {
|
|
338
|
+
from: null,
|
|
339
|
+
current: this.store.selectedInstanceDataScopeParent,
|
|
340
|
+
oldParent: null,
|
|
341
|
+
newParent: instance.parent
|
|
342
|
+
};
|
|
343
|
+
this.callSelectedScopeEffect(payload);
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
key: "concatSetting",
|
|
348
|
+
value: function concatSetting(settings, otherSettings, settingFromId) {
|
|
349
|
+
var ref, ref2, ref3, ref4, ref5, ref6, ref7, ref8;
|
|
350
|
+
var result1 = settings;
|
|
351
|
+
// tab
|
|
352
|
+
if (((ref = settings[0]) === null || ref === void 0 ? void 0 : ref.type) === 'tab' && ((ref2 = otherSettings[0]) === null || ref2 === void 0 ? void 0 : ref2.type) === 'tab') {
|
|
353
|
+
var _this = this;
|
|
354
|
+
var tabSettings = settings;
|
|
355
|
+
var otherTabSettings = otherSettings.slice(0);
|
|
356
|
+
result1 = tabSettings.map(function(tab, index) {
|
|
357
|
+
var result = new Tab(tab);
|
|
358
|
+
var otherTabIndex = otherTabSettings.findIndex(function(item) {
|
|
359
|
+
return item.title === tab.title;
|
|
360
|
+
});
|
|
361
|
+
if (otherTabIndex === -1) {
|
|
362
|
+
return result;
|
|
363
|
+
}
|
|
364
|
+
var otherTab = otherTabSettings.splice(otherTabIndex, 1)[0];
|
|
365
|
+
if (otherTab) {
|
|
366
|
+
result.items = _toConsumableArray(_this.formatGroupSetting(otherTab.items, settingFromId)).concat(_toConsumableArray(result.items));
|
|
367
|
+
}
|
|
368
|
+
return result;
|
|
369
|
+
});
|
|
370
|
+
if (otherTabSettings.length) {
|
|
371
|
+
var _this1 = this;
|
|
372
|
+
result1 = _toConsumableArray(result1).concat(_toConsumableArray(otherTabSettings.map(function(item) {
|
|
373
|
+
return _this1.formatGroupSetting(item, settingFromId);
|
|
374
|
+
})));
|
|
375
|
+
}
|
|
376
|
+
// group
|
|
377
|
+
} else if (((ref3 = settings[0]) === null || ref3 === void 0 ? void 0 : ref3.type) === 'group' && ((ref4 = otherSettings[0]) === null || ref4 === void 0 ? void 0 : ref4.type) === 'group') {
|
|
378
|
+
var groupSettings = settings;
|
|
379
|
+
var otherGroupSettings = otherSettings;
|
|
380
|
+
result1 = _toConsumableArray(this.formatGroupSetting(otherGroupSettings, settingFromId)).concat(_toConsumableArray(groupSettings));
|
|
381
|
+
// 当前控件setting是tab,合并控件setting是group
|
|
382
|
+
} else if (((ref5 = settings[0]) === null || ref5 === void 0 ? void 0 : ref5.type) === 'tab' && ((ref6 = otherSettings[0]) === null || ref6 === void 0 ? void 0 : ref6.type) === 'group') {
|
|
383
|
+
var _this2 = this;
|
|
384
|
+
var tabSettings1 = settings;
|
|
385
|
+
var otherGroupSettings1 = otherSettings;
|
|
386
|
+
result1 = tabSettings1.map(function(tab, index) {
|
|
387
|
+
var result = new Tab(tab);
|
|
388
|
+
if (index === 0) {
|
|
389
|
+
result.items = _toConsumableArray(_this2.formatGroupSetting(otherGroupSettings1, settingFromId)).concat(_toConsumableArray(result.items));
|
|
390
|
+
}
|
|
391
|
+
return result;
|
|
392
|
+
});
|
|
393
|
+
} else if (((ref7 = settings[0]) === null || ref7 === void 0 ? void 0 : ref7.type) === 'group' && ((ref8 = otherSettings[0]) === null || ref8 === void 0 ? void 0 : ref8.type) === 'tab') {
|
|
394
|
+
var _this3 = this;
|
|
395
|
+
var groupSettings1 = settings;
|
|
396
|
+
var otherTabSettings1 = otherSettings;
|
|
397
|
+
result1 = otherTabSettings1.map(function(tab, index) {
|
|
398
|
+
var result = new Tab(tab);
|
|
399
|
+
if (index === 0) {
|
|
400
|
+
result.items = _toConsumableArray(result.items).concat(_toConsumableArray(_this3.formatGroupSetting(groupSettings1, settingFromId)));
|
|
401
|
+
}
|
|
402
|
+
return result;
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
return result1;
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
key: "formatGroupSetting",
|
|
410
|
+
value: function formatGroupSetting(tab, fromId) {
|
|
411
|
+
if (isArray(tab)) {
|
|
412
|
+
return tab.map(function(item) {
|
|
413
|
+
var group = new Group(item);
|
|
414
|
+
group.fromId = fromId;
|
|
415
|
+
return group;
|
|
416
|
+
});
|
|
417
|
+
} else {
|
|
418
|
+
var result = new Tab(tab);
|
|
419
|
+
result.items = this.formatGroupSetting(result.items, fromId);
|
|
318
420
|
return result;
|
|
319
421
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
key: "setControlConfig",
|
|
426
|
+
value: function setControlConfig() {
|
|
427
|
+
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
428
|
+
args[_key] = arguments[_key];
|
|
323
429
|
}
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
});
|
|
384
|
-
};
|
|
385
|
-
_proto.moveStart = function moveStart(instance) {
|
|
386
|
-
// 移动之前,记录控件原始的位置和父级
|
|
387
|
-
var _instance = this.getInstance(instance);
|
|
388
|
-
if (_instance) {
|
|
389
|
-
this.store.setMovingInstance(_instance);
|
|
390
|
-
}
|
|
391
|
-
};
|
|
392
|
-
_proto.moveEnd = function moveEnd() {
|
|
393
|
-
var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.store.movingInstance;
|
|
394
|
-
var _this_store_selected;
|
|
395
|
-
if (instance === null) return;
|
|
396
|
-
var _instance = this.getInstance(instance);
|
|
397
|
-
if (!_instance) return;
|
|
398
|
-
/*
|
|
430
|
+
var _designer;
|
|
431
|
+
return (_designer = this.designer).registerControlConfig.apply(_designer, _toConsumableArray(args));
|
|
432
|
+
}
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
key: "getControlConfig",
|
|
436
|
+
value: function getControlConfig(control) {
|
|
437
|
+
return this.designer.getControlConfig(control);
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
key: "getControlSetting",
|
|
442
|
+
value: function getControlSetting(type) {
|
|
443
|
+
var settingInit = this.designer.getControlSetting(type);
|
|
444
|
+
if (!settingInit) {
|
|
445
|
+
return [];
|
|
446
|
+
}
|
|
447
|
+
return initSettings(settingInit);
|
|
448
|
+
}
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
key: "selectInstance",
|
|
452
|
+
value: function selectInstance(instance) {
|
|
453
|
+
// 先清空上一次的store
|
|
454
|
+
this.beforeSelectInstance();
|
|
455
|
+
// 选中一个控件
|
|
456
|
+
this.store.setSelectInstance(instance);
|
|
457
|
+
// 针对这一次选中的控件初始化一些内容,并触发事件
|
|
458
|
+
this.afterSelectInstance();
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
key: "setSelectedFieldItem",
|
|
463
|
+
value: function setSelectedFieldItem(fieldItem) {
|
|
464
|
+
this.store.setSelectedFieldItem(fieldItem);
|
|
465
|
+
this.callSelectedEffect('dataBind', {
|
|
466
|
+
fieldItem: fieldItem
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
key: "moveStart",
|
|
472
|
+
value: function moveStart(instance) {
|
|
473
|
+
// 移动之前,记录控件原始的位置和父级
|
|
474
|
+
var _instance = this.getInstance(instance);
|
|
475
|
+
if (_instance) {
|
|
476
|
+
this.store.setMovingInstance(_instance);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
key: "moveEnd",
|
|
482
|
+
value: function moveEnd() {
|
|
483
|
+
var instance = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.store.movingInstance;
|
|
484
|
+
var ref;
|
|
485
|
+
if (instance === null) return;
|
|
486
|
+
var _instance = this.getInstance(instance);
|
|
487
|
+
if (!_instance) return;
|
|
488
|
+
/*
|
|
399
489
|
移动之后,拿到控件新的位置,并触发事件, 如果是新增的控件的话,就没有原始位置和父级,
|
|
400
490
|
事件是否区分move和add
|
|
401
491
|
move是从主表移动到子表或子表移动到主表才触发,还是所有移动都触发
|
|
402
492
|
*/ var oldDataScopeParent = this.store.movingInstanceOldDataScopeParent;
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
};
|
|
428
|
-
_proto.createInstance = function createInstance(type, initSchema) {
|
|
429
|
-
return this.designer.createControlInstance(type, initSchema);
|
|
430
|
-
};
|
|
431
|
-
_proto.getInstance = function getInstance(instanceId) {
|
|
432
|
-
// if (instanceId instanceof DesignerControl) {
|
|
433
|
-
// return instanceId
|
|
434
|
-
// }
|
|
435
|
-
// return this.store.instanceIdMap.get(instanceId)
|
|
436
|
-
if (typeof instanceId === "string") {
|
|
437
|
-
return this.store.instanceIdMap.get(instanceId);
|
|
438
|
-
}
|
|
439
|
-
return instanceId;
|
|
440
|
-
};
|
|
441
|
-
_proto.getInstances = function getInstances() {
|
|
442
|
-
return this.store.flatInstances;
|
|
443
|
-
};
|
|
444
|
-
_proto.getInstancesFromType = function getInstancesFromType(type) {
|
|
445
|
-
return this.getInstances().filter(function(item) {
|
|
446
|
-
return item.type === type;
|
|
447
|
-
});
|
|
448
|
-
};
|
|
449
|
-
_proto.getDataScopeInstances = function getDataScopeInstances() {
|
|
450
|
-
return this.store.selectedDataScopeFlatInstances;
|
|
451
|
-
};
|
|
452
|
-
_proto.getDataScopeInstancesFromType = function getDataScopeInstancesFromType(type) {
|
|
453
|
-
return this.getDataScopeInstances().filter(function(item) {
|
|
454
|
-
return item.type === type;
|
|
455
|
-
});
|
|
456
|
-
};
|
|
457
|
-
_proto.updateInstancePropValue = function updateInstancePropValue(instance, propName, value, payload) {
|
|
458
|
-
var _this_store_selected;
|
|
459
|
-
var result = updateValueFromKeys(instance.props, propName, value);
|
|
460
|
-
if (!result) {
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
// 修改dataBind的时候要更新 fieldCodeMap
|
|
464
|
-
if (propName.startsWith("dataBind")) {
|
|
465
|
-
this.store.updateDataFieldCodeMap(instance);
|
|
466
|
-
}
|
|
467
|
-
if (instance.id === ((_this_store_selected = this.store.selected) === null || _this_store_selected === void 0 ? void 0 : _this_store_selected.id)) {
|
|
468
|
-
this.callSelectedEffect(propName, payload);
|
|
469
|
-
}
|
|
470
|
-
this.emit("updated", {
|
|
471
|
-
instance: instance,
|
|
472
|
-
propName: propName,
|
|
473
|
-
value: value
|
|
474
|
-
});
|
|
475
|
-
};
|
|
476
|
-
_proto.updateInstanceProps = function updateInstanceProps(instance, props, payload) {
|
|
477
|
-
var prevKey = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "";
|
|
478
|
-
var _this = this;
|
|
479
|
-
Object.entries(props).forEach(function(param) {
|
|
480
|
-
var _param = _slicedToArray(param, 2), key = _param[0], value = _param[1];
|
|
481
|
-
var propName = "".concat(prevKey ? prevKey + "." : "").concat(key);
|
|
482
|
-
if (isObject(value)) {
|
|
483
|
-
_this.updateInstanceProps(instance, value, payload, propName);
|
|
484
|
-
} else {
|
|
485
|
-
_this.updateInstancePropValue(instance, propName, value, payload);
|
|
493
|
+
var newDataScopeParent = findInstanceDataScopeParent(_instance);
|
|
494
|
+
var oldParent = this.store.movingInstanceOldParent;
|
|
495
|
+
var newParent = _instance.parent;
|
|
496
|
+
// 移动之后清空movingInstance
|
|
497
|
+
this.store.setMovingInstance(null);
|
|
498
|
+
if (_instance.id !== ((ref = this.store.selected) === null || ref === void 0 ? void 0 : ref.id)) {
|
|
499
|
+
this.selectInstance(_instance);
|
|
500
|
+
} else {
|
|
501
|
+
this.store.setSelectInstance(_instance);
|
|
502
|
+
}
|
|
503
|
+
this.store.getFlatInstances();
|
|
504
|
+
// 结束以后
|
|
505
|
+
var payload = {
|
|
506
|
+
from: oldDataScopeParent,
|
|
507
|
+
current: newDataScopeParent,
|
|
508
|
+
oldParent: oldParent,
|
|
509
|
+
newParent: newParent
|
|
510
|
+
};
|
|
511
|
+
this.callSelectedScopeEffect(payload);
|
|
512
|
+
if (oldParent) {
|
|
513
|
+
this.emit('moved', _objectSpread({}, payload));
|
|
514
|
+
} else {
|
|
515
|
+
this.emit('joined', _objectSpread({}, payload));
|
|
516
|
+
}
|
|
486
517
|
}
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
518
|
+
},
|
|
519
|
+
{
|
|
520
|
+
key: "createInstance",
|
|
521
|
+
value: function createInstance(type, initSchema) {
|
|
522
|
+
return this.designer.createControlInstance(type, initSchema);
|
|
523
|
+
}
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
key: "getInstance",
|
|
527
|
+
value: function getInstance(instanceId) {
|
|
528
|
+
// if (instanceId instanceof DesignerControl) {
|
|
529
|
+
// return instanceId
|
|
530
|
+
// }
|
|
531
|
+
// return this.store.instanceIdMap.get(instanceId)
|
|
532
|
+
if (typeof instanceId === 'string') {
|
|
533
|
+
return this.store.instanceIdMap.get(instanceId);
|
|
534
|
+
}
|
|
535
|
+
return instanceId;
|
|
536
|
+
}
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
key: "getInstances",
|
|
540
|
+
value: function getInstances() {
|
|
541
|
+
return this.store.flatInstances;
|
|
542
|
+
}
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
key: "getInstancesFromType",
|
|
546
|
+
value: function getInstancesFromType(type) {
|
|
547
|
+
return this.getInstances().filter(function(item) {
|
|
548
|
+
return item.type === type;
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
key: "getDataScopeInstances",
|
|
554
|
+
value: function getDataScopeInstances() {
|
|
555
|
+
return this.store.selectedDataScopeFlatInstances;
|
|
556
|
+
}
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
key: "getDataScopeInstancesFromType",
|
|
560
|
+
value: function getDataScopeInstancesFromType(type) {
|
|
561
|
+
return this.getDataScopeInstances().filter(function(item) {
|
|
562
|
+
return item.type === type;
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
key: "updateInstancePropValue",
|
|
568
|
+
value: function updateInstancePropValue(instance, propName, value, payload) {
|
|
569
|
+
var ref;
|
|
570
|
+
var result = updateValueFromKeys(instance.props, propName, value);
|
|
571
|
+
if (!result) {
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
// 修改dataBind的时候要更新 fieldCodeMap
|
|
575
|
+
if (propName.startsWith('dataBind')) {
|
|
576
|
+
this.store.updateDataFieldCodeMap(instance);
|
|
577
|
+
}
|
|
578
|
+
if (instance.id === ((ref = this.store.selected) === null || ref === void 0 ? void 0 : ref.id)) {
|
|
579
|
+
this.callSelectedEffect(propName, payload);
|
|
580
|
+
}
|
|
581
|
+
this.emit('updated', {
|
|
582
|
+
instance: instance,
|
|
583
|
+
propName: propName,
|
|
584
|
+
value: value
|
|
585
|
+
});
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
key: "updateInstanceProps",
|
|
590
|
+
value: function updateInstanceProps(instance, props, payload) {
|
|
591
|
+
var prevKey = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : '';
|
|
592
|
+
var _this = this;
|
|
593
|
+
Object.entries(props).forEach(function(param) {
|
|
594
|
+
var _param = _slicedToArray(param, 2), key = _param[0], value = _param[1];
|
|
595
|
+
var propName = "".concat(prevKey ? prevKey + '.' : '').concat(key);
|
|
596
|
+
if (isObject(value)) {
|
|
597
|
+
_this.updateInstanceProps(instance, value, payload, propName);
|
|
598
|
+
} else {
|
|
599
|
+
_this.updateInstancePropValue(instance, propName, value, payload);
|
|
600
|
+
}
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
key: "setInstance",
|
|
606
|
+
value: function setInstance(instance, propName, value, payload) {
|
|
607
|
+
if (isString(propName)) {
|
|
608
|
+
this.updateInstancePropValue(instance, String(propName), value, payload);
|
|
609
|
+
} else {
|
|
610
|
+
this.updateInstanceProps(instance, propName, value);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
key: "removeInstance",
|
|
616
|
+
value: /**
|
|
497
617
|
* 删除控件
|
|
498
|
-
* */
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
618
|
+
* */ function removeInstance(instance) {
|
|
619
|
+
// 删除实例,并触发事件 removed
|
|
620
|
+
var parent = instance.parent;
|
|
621
|
+
if (!parent) {
|
|
622
|
+
return;
|
|
623
|
+
}
|
|
624
|
+
var parentList = // parent instanceof DesignerListControl &&
|
|
625
|
+
parent.controlType === CONTROL_BASE_TYPE.LIST && parent.props.headers.includes(instance) ? parent.props.headers : parent.children;
|
|
626
|
+
var index = parentList.findIndex(function(item) {
|
|
627
|
+
return item === instance;
|
|
628
|
+
});
|
|
629
|
+
index > -1 && parentList.splice(index, 1);
|
|
630
|
+
this.store.getFlatInstances();
|
|
631
|
+
this.emit('removed', {
|
|
632
|
+
instance: instance,
|
|
633
|
+
index: index,
|
|
634
|
+
parent: parent
|
|
635
|
+
});
|
|
636
|
+
}
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
key: "replaceInstance",
|
|
640
|
+
value: function replaceInstance(oldInstance, newInstance) {
|
|
641
|
+
var parent = oldInstance.parent;
|
|
642
|
+
if (!parent) {
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
var parentList = // parent instanceof DesignerListControl &&
|
|
646
|
+
parent.controlType === CONTROL_BASE_TYPE.LIST && parent.props.headers.includes(oldInstance) ? parent.props.headers : parent.children;
|
|
647
|
+
var index = parentList.findIndex(function(item) {
|
|
648
|
+
return item === oldInstance;
|
|
649
|
+
});
|
|
650
|
+
index > -1 && parentList.splice(index, 1, newInstance);
|
|
651
|
+
this.store.getFlatInstances();
|
|
652
|
+
}
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
key: "updateInstanceType",
|
|
656
|
+
value: /**
|
|
531
657
|
* 修改控件类型
|
|
532
|
-
* */
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
658
|
+
* */ function updateInstanceType(instance, type) {
|
|
659
|
+
var schema = instance.toSchema();
|
|
660
|
+
var newInstance = this.createInstance(type, {
|
|
661
|
+
id: schema.id,
|
|
662
|
+
props: schema.props
|
|
663
|
+
});
|
|
664
|
+
if (!newInstance) {
|
|
665
|
+
warn("can‘t update instance type to ".concat(type));
|
|
666
|
+
return;
|
|
667
|
+
}
|
|
668
|
+
return newInstance;
|
|
669
|
+
}
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
key: "validate",
|
|
673
|
+
value: function validate(messages, ignore) {
|
|
674
|
+
//TODO 校验实例属性,并触发事件 before-validate 和 validated
|
|
675
|
+
return checkSchema(this.store.instance, messages, ignore);
|
|
676
|
+
}
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
key: "getCustomControlsInUse",
|
|
680
|
+
value: // 获取使用到的自定义控件
|
|
681
|
+
function getCustomControlsInUse() {
|
|
682
|
+
return this.getInstances().filter(this.assertInstanceIsCustomControl).reduce(function(result, item) {
|
|
683
|
+
if (!result.includes(item.type)) {
|
|
684
|
+
result.push(item.type);
|
|
685
|
+
}
|
|
686
|
+
return result;
|
|
687
|
+
}, []);
|
|
688
|
+
}
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
key: "assertInstanceIsCustomControl",
|
|
692
|
+
value: // 判断控件或控件类型是一个自定义控件
|
|
693
|
+
function assertInstanceIsCustomControl(instance) {
|
|
694
|
+
return !isBuiltInControls(isString(instance) ? instance : instance.type);
|
|
695
|
+
}
|
|
696
|
+
},
|
|
697
|
+
{
|
|
698
|
+
key: "judgeControlIsRegistered",
|
|
699
|
+
value: function judgeControlIsRegistered(control) {
|
|
700
|
+
return this.designer.registeredControlTypes.has(control.Designer.controlType);
|
|
701
|
+
}
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
key: "register",
|
|
705
|
+
value: function register() {
|
|
706
|
+
for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
|
|
707
|
+
arg[_key] = arguments[_key];
|
|
708
|
+
}
|
|
709
|
+
var _designer;
|
|
710
|
+
(_designer = this.designer).registerControl.apply(_designer, _toConsumableArray(arg));
|
|
711
|
+
return this;
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
key: "assertInstance",
|
|
716
|
+
value: /**
|
|
573
717
|
* 判断控件的类型,返回当前控件的正确类型
|
|
574
|
-
* */
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
718
|
+
* */ function assertInstance(instance, types) {
|
|
719
|
+
return isString(types) ? instance.type === types : types.includes(instance.type);
|
|
720
|
+
}
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
key: "getInstanceInListControl",
|
|
724
|
+
value: /**
|
|
578
725
|
* 控件在列表控件内,如明细子表或列表控件
|
|
579
|
-
* */
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
726
|
+
* */ function getInstanceInListControl(instance) {
|
|
727
|
+
var _instance = instance;
|
|
728
|
+
while(_instance){
|
|
729
|
+
// if (_instance instanceof DesignerListControl) {
|
|
730
|
+
if (_instance.controlType === CONTROL_BASE_TYPE.LIST) {
|
|
731
|
+
return true;
|
|
732
|
+
}
|
|
733
|
+
_instance = _instance.parent;
|
|
734
|
+
}
|
|
735
|
+
return false;
|
|
736
|
+
}
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
key: "getInstanceParentControl",
|
|
740
|
+
value: function getInstanceParentControl(instance, controlType) {
|
|
741
|
+
if (!instance.parent) {
|
|
742
|
+
return;
|
|
743
|
+
}
|
|
744
|
+
if (this.assertInstance(instance.parent, controlType)) {
|
|
745
|
+
return instance.parent;
|
|
746
|
+
}
|
|
747
|
+
return this.getInstanceParentControl(instance.parent, controlType);
|
|
748
|
+
}
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
key: "callSelectedEffect",
|
|
752
|
+
value: function callSelectedEffect(effectKey) {
|
|
753
|
+
var payload = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
754
|
+
var _this = this;
|
|
755
|
+
this.store.selectedInstanceSettingItems.forEach(function(setting) {
|
|
756
|
+
setting.callEffect(effectKey, _this, _objectSpread({
|
|
757
|
+
control: _this.store.selected
|
|
758
|
+
}, payload));
|
|
759
|
+
});
|
|
760
|
+
}
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
key: "callSelectedScopeEffect",
|
|
764
|
+
value: function callSelectedScopeEffect() {
|
|
765
|
+
var payload = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
766
|
+
var _this = this;
|
|
767
|
+
this.store.selectedInstanceSettingItems.forEach(function(setting) {
|
|
768
|
+
setting.callScopeEffect(_this, _objectSpread({
|
|
769
|
+
control: _this.store.selected
|
|
770
|
+
}, payload));
|
|
771
|
+
});
|
|
772
|
+
}
|
|
596
773
|
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
}
|
|
615
|
-
});
|
|
616
|
-
};
|
|
617
|
-
// 注册外部控件
|
|
618
|
-
Driven.register = function register() {
|
|
619
|
-
for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
|
|
620
|
-
arg[_key] = arguments[_key];
|
|
774
|
+
], [
|
|
775
|
+
{
|
|
776
|
+
key: "register",
|
|
777
|
+
value: // 注册外部控件
|
|
778
|
+
function register() {
|
|
779
|
+
for(var _len = arguments.length, arg = new Array(_len), _key = 0; _key < _len; _key++){
|
|
780
|
+
arg[_key] = arguments[_key];
|
|
781
|
+
}
|
|
782
|
+
var _Designer;
|
|
783
|
+
(_Designer = Designer).register.apply(_Designer, _toConsumableArray(arg));
|
|
784
|
+
return this;
|
|
785
|
+
}
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
key: "judgeControlIsRegistered",
|
|
789
|
+
value: function judgeControlIsRegistered(control) {
|
|
790
|
+
return Designer.staticRegisteredTypes.has(control.Designer.controlType);
|
|
791
|
+
}
|
|
621
792
|
}
|
|
622
|
-
|
|
623
|
-
(_Designer = Designer).register.apply(_Designer, _toConsumableArray(arg));
|
|
624
|
-
return this;
|
|
625
|
-
};
|
|
626
|
-
Driven.judgeControlIsRegistered = function judgeControlIsRegistered(control) {
|
|
627
|
-
return Designer.staticRegisteredTypes.has(control.Designer.controlType);
|
|
628
|
-
};
|
|
793
|
+
]);
|
|
629
794
|
return Driven;
|
|
630
795
|
}(Watcher);
|
|
631
|
-
|
|
632
|
-
* 控件事件定义
|
|
633
|
-
* */ Driven.EventLogic = EventLogic;
|
|
796
|
+
Driven.EventLogic = EventLogic;
|
|
634
797
|
export { Driven };
|