@byteluck-fe/model-driven-driven 2.22.2-beta.14 → 2.22.2-beta.16
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/Designer.js +13 -28
- package/dist/esm/Driven.js +18 -44
- package/dist/esm/utils.js +1 -0
- package/dist/index.umd.js +3 -47
- package/package.json +6 -6
package/dist/esm/Designer.js
CHANGED
|
@@ -41,6 +41,10 @@ function _async_to_generator(fn) {
|
|
|
41
41
|
});
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
+
function _call_super(_this, derived, args) {
|
|
45
|
+
derived = _get_prototype_of(derived);
|
|
46
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
47
|
+
}
|
|
44
48
|
function _class_call_check(instance, Constructor) {
|
|
45
49
|
if (!(instance instanceof Constructor)) {
|
|
46
50
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -134,28 +138,12 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
134
138
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
135
139
|
}
|
|
136
140
|
function _is_native_reflect_construct() {
|
|
137
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
138
|
-
if (Reflect.construct.sham) return false;
|
|
139
|
-
if (typeof Proxy === "function") return true;
|
|
140
141
|
try {
|
|
141
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
return
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
function _create_super(Derived) {
|
|
148
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
149
|
-
return function _createSuperInternal() {
|
|
150
|
-
var Super = _get_prototype_of(Derived), result;
|
|
151
|
-
if (hasNativeReflectConstruct) {
|
|
152
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
153
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
154
|
-
} else {
|
|
155
|
-
result = Super.apply(this, arguments);
|
|
156
|
-
}
|
|
157
|
-
return _possible_constructor_return(this, result);
|
|
158
|
-
};
|
|
142
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
143
|
+
} catch (_) {}
|
|
144
|
+
return (_is_native_reflect_construct = function() {
|
|
145
|
+
return !!result;
|
|
146
|
+
})();
|
|
159
147
|
}
|
|
160
148
|
function _ts_generator(thisArg, body) {
|
|
161
149
|
var f, y, t, g, _ = {
|
|
@@ -259,16 +247,12 @@ import { toSchema, getModelBindInfoList, checkSchema } from './utils';
|
|
|
259
247
|
var Designer = /*#__PURE__*/ function _target(RegisterControls) {
|
|
260
248
|
"use strict";
|
|
261
249
|
_inherits(Designer, RegisterControls);
|
|
262
|
-
var _super = _create_super(Designer);
|
|
263
250
|
function Designer() {
|
|
264
251
|
_class_call_check(this, Designer);
|
|
265
252
|
var _this;
|
|
266
|
-
_this =
|
|
267
|
-
|
|
268
|
-
_define_property(
|
|
269
|
-
_define_property(_assert_this_initialized(_this), "eventLogic", new EventLogic());
|
|
270
|
-
_define_property(_assert_this_initialized(_this), "fieldTypes", FieldTypes);
|
|
271
|
-
_define_property(_assert_this_initialized(_this), "controlSettingMap", new Map());
|
|
253
|
+
_this = _call_super(this, Designer, [
|
|
254
|
+
'Designer'
|
|
255
|
+
]), _define_property(_this, "toolbox", []), _define_property(_this, "services", {}), _define_property(_this, "eventLogic", new EventLogic()), _define_property(_this, "fieldTypes", FieldTypes), _define_property(_this, "controlSettingMap", new Map());
|
|
272
256
|
(_instanceof(this, Designer) ? this.constructor : void 0).staticControls.forEach(function(control) {
|
|
273
257
|
var _$Designer = control.Designer, Setting = control.Setting;
|
|
274
258
|
_this.controlSettingMap.set(_$Designer.controlType, Setting);
|
|
@@ -279,6 +263,7 @@ var Designer = /*#__PURE__*/ function _target(RegisterControls) {
|
|
|
279
263
|
{
|
|
280
264
|
key: "registerControl",
|
|
281
265
|
value: function registerControl(control) {
|
|
266
|
+
;
|
|
282
267
|
this.constructor.register(control, 'Designer');
|
|
283
268
|
var DesignerClass = control.Designer, Setting = control.Setting;
|
|
284
269
|
this.register(DesignerClass);
|
package/dist/esm/Driven.js
CHANGED
|
@@ -15,6 +15,10 @@ function _assert_this_initialized(self) {
|
|
|
15
15
|
}
|
|
16
16
|
return self;
|
|
17
17
|
}
|
|
18
|
+
function _call_super(_this, derived, args) {
|
|
19
|
+
derived = _get_prototype_of(derived);
|
|
20
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
21
|
+
}
|
|
18
22
|
function _class_call_check(instance, Constructor) {
|
|
19
23
|
if (!(instance instanceof Constructor)) {
|
|
20
24
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -169,28 +173,12 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
169
173
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
170
174
|
}
|
|
171
175
|
function _is_native_reflect_construct() {
|
|
172
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
173
|
-
if (Reflect.construct.sham) return false;
|
|
174
|
-
if (typeof Proxy === "function") return true;
|
|
175
176
|
try {
|
|
176
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
return
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
function _create_super(Derived) {
|
|
183
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
184
|
-
return function _createSuperInternal() {
|
|
185
|
-
var Super = _get_prototype_of(Derived), result;
|
|
186
|
-
if (hasNativeReflectConstruct) {
|
|
187
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
188
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
189
|
-
} else {
|
|
190
|
-
result = Super.apply(this, arguments);
|
|
191
|
-
}
|
|
192
|
-
return _possible_constructor_return(this, result);
|
|
193
|
-
};
|
|
177
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
178
|
+
} catch (_) {}
|
|
179
|
+
return (_is_native_reflect_construct = function() {
|
|
180
|
+
return !!result;
|
|
181
|
+
})();
|
|
194
182
|
}
|
|
195
183
|
import { CONTROL_BASE_TYPE, error, genNonDuplicateId, isArray, isBuiltInControls, isObject, isString, updateValueFromKeys, warn, Watcher } from '@byteluck-fe/model-driven-shared';
|
|
196
184
|
import { findInstanceDataScopeParent, Store } from './Store';
|
|
@@ -206,37 +194,23 @@ var applyingPluginName = '';
|
|
|
206
194
|
* */ var Driven = /*#__PURE__*/ function(Watcher) {
|
|
207
195
|
"use strict";
|
|
208
196
|
_inherits(Driven, Watcher);
|
|
209
|
-
var _super = _create_super(Driven);
|
|
210
197
|
function Driven(options) {
|
|
211
198
|
_class_call_check(this, Driven);
|
|
212
199
|
var _this;
|
|
213
|
-
_this =
|
|
214
|
-
_define_property(_assert_this_initialized(_this), "mode", void 0);
|
|
215
|
-
_define_property(_assert_this_initialized(_this), "isMounted", false);
|
|
216
|
-
_define_property(_assert_this_initialized(_this), "id", genNonDuplicateId(8));
|
|
217
|
-
/**
|
|
200
|
+
_this = _call_super(this, Driven), _define_property(_this, "mode", void 0), _define_property(_this, "isMounted", false), _define_property(_this, "id", genNonDuplicateId(8)), /**
|
|
218
201
|
* 控件可选的事件
|
|
219
|
-
* */ _define_property(
|
|
220
|
-
/**
|
|
202
|
+
* */ _define_property(_this, "eventLogic", void 0), /**
|
|
221
203
|
* 处理数据存储,存放模型等
|
|
222
|
-
* */ _define_property(
|
|
223
|
-
/**
|
|
204
|
+
* */ _define_property(_this, "store", void 0), /**
|
|
224
205
|
* 额外参数存储
|
|
225
|
-
*/ _define_property(
|
|
226
|
-
/**
|
|
206
|
+
*/ _define_property(_this, "externalParams", void 0), /**
|
|
227
207
|
* 处理instance,和schema存储
|
|
228
|
-
* */ _define_property(
|
|
229
|
-
/**
|
|
208
|
+
* */ _define_property(_this, "designer", void 0), /**
|
|
230
209
|
* 插件数组
|
|
231
|
-
* */ _define_property(
|
|
232
|
-
_define_property(
|
|
233
|
-
_define_property(
|
|
234
|
-
|
|
235
|
-
_define_property(_assert_this_initialized(_this), "getSchema", toSchema);
|
|
236
|
-
// TODO 拿到model_bind_info_list
|
|
237
|
-
_define_property(_assert_this_initialized(_this), "getModelBindInfoList", getModelBindInfoList);
|
|
238
|
-
// TODO 拿到permission_controls
|
|
239
|
-
_define_property(_assert_this_initialized(_this), "generatePermissions", generatePermissions);
|
|
210
|
+
* */ _define_property(_this, "__plugins", void 0), _define_property(_this, "__pluginsApplied", false), _define_property(_this, "$options", void 0), // TODO 拿到schema
|
|
211
|
+
_define_property(_this, "getSchema", toSchema), // TODO 拿到model_bind_info_list
|
|
212
|
+
_define_property(_this, "getModelBindInfoList", getModelBindInfoList), // TODO 拿到permission_controls
|
|
213
|
+
_define_property(_this, "generatePermissions", generatePermissions);
|
|
240
214
|
_this.$options = Object.freeze(options);
|
|
241
215
|
var _this_$options = _this.$options, _this_$options_autoMount = _this_$options.autoMount, autoMount = _this_$options_autoMount === void 0 ? false : _this_$options_autoMount, tmp = _this_$options.Designer, DesignerClass = tmp === void 0 ? Designer : tmp, schema = _this_$options.schema, _this_$options_mode = _this_$options.mode, mode = _this_$options_mode === void 0 ? 'form' : _this_$options_mode, tmp1 = _this_$options.store, storeOptions = tmp1 === void 0 ? {} : tmp1, messagesI18n = _this_$options.messagesI18n, _this_$options_language = _this_$options.language, language = _this_$options_language === void 0 ? DEFAULT_LOCALE : _this_$options_language;
|
|
242
216
|
RulesMessage.setLocale(language, messagesI18n);
|
package/dist/esm/utils.js
CHANGED