@byteluck-fe/model-driven-core 2.21.0-beta.3 → 2.21.0-beta.7
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/api-doc-index.js +4 -4
- package/dist/esm/common/BaseControl/designer.js +24 -24
- package/dist/esm/common/BaseControl/index.js +7 -7
- package/dist/esm/common/BaseControl/property.js +3 -3
- package/dist/esm/common/BaseControl/runtime.js +6 -6
- package/dist/esm/common/ColumnControl/designer.js +94 -5
- package/dist/esm/common/ColumnControl/index.js +6 -6
- package/dist/esm/common/ColumnControl/property.js +21 -21
- package/dist/esm/common/ColumnControl/runtime.js +5 -5
- package/dist/esm/common/ControlArray.js +5 -5
- package/dist/esm/common/FormControl/designer.js +6 -6
- package/dist/esm/common/FormControl/index.js +6 -6
- package/dist/esm/common/FormControl/property.js +44 -44
- package/dist/esm/common/FormControl/runtime.js +3 -3
- package/dist/esm/common/LayoutControl/designer.js +6 -6
- package/dist/esm/common/LayoutControl/index.js +6 -6
- package/dist/esm/common/LayoutControl/property.js +1 -1
- package/dist/esm/common/LayoutControl/runtime.js +5 -5
- package/dist/esm/common/ListControl/designer.js +5 -5
- package/dist/esm/common/ListControl/index.js +6 -6
- package/dist/esm/common/ListControl/property.js +4 -4
- package/dist/esm/common/ListControl/runtime.js +6 -6
- package/dist/esm/common/SearchViewControl/designer.js +3 -3
- package/dist/esm/common/SearchViewControl/index.js +6 -6
- package/dist/esm/common/SearchViewControl/property.js +2 -2
- package/dist/esm/common/SearchViewControl/runtime.js +3 -3
- package/dist/esm/common/Validator.js +5 -5
- package/dist/esm/common/WrapControl/designer.js +3 -3
- package/dist/esm/common/WrapControl/index.js +6 -6
- package/dist/esm/common/WrapControl/property.js +1 -1
- package/dist/esm/common/WrapControl/runtime.js +3 -3
- package/dist/esm/common/controlHooksEmitter.js +1 -1
- package/dist/esm/common/index.js +12 -12
- package/dist/esm/common/initLinkOperationRules.js +5 -5
- package/dist/esm/common/initOptionAndDataSourceRules.js +74 -74
- package/dist/esm/framework/RegisterControls.js +8 -8
- package/dist/esm/framework/index.js +93 -93
- package/dist/esm/index.js +4 -4
- package/dist/index.umd.js +1 -1
- package/dist/types/common/ColumnControl/designer.d.ts +9 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export { default as BaseControlProperty } from
|
|
3
|
-
export { default as ColumnControlProperty } from
|
|
4
|
-
export { default as FormControlProperty } from
|
|
1
|
+
export * from './framework/index';
|
|
2
|
+
export { default as BaseControlProperty } from './common/BaseControl/property';
|
|
3
|
+
export { default as ColumnControlProperty } from './common/ColumnControl/property';
|
|
4
|
+
export { default as FormControlProperty } from './common/FormControl/property';
|
|
@@ -210,10 +210,10 @@ function _ts_generator(thisArg, body) {
|
|
|
210
210
|
};
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
|
-
import Property from
|
|
214
|
-
import { genNonDuplicateId, JSONCopy, referenceError, updateValueFromKeys } from
|
|
215
|
-
import { createValidator } from
|
|
216
|
-
import { controlHooksEmitter } from
|
|
213
|
+
import Property from './property';
|
|
214
|
+
import { genNonDuplicateId, JSONCopy, referenceError, updateValueFromKeys } from '@byteluck-fe/model-driven-shared';
|
|
215
|
+
import { createValidator } from '../Validator';
|
|
216
|
+
import { controlHooksEmitter } from '../controlHooksEmitter';
|
|
217
217
|
var Control = /*#__PURE__*/ function _target() {
|
|
218
218
|
"use strict";
|
|
219
219
|
function Control(props) {
|
|
@@ -235,7 +235,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
235
235
|
_define_property(this, "slotPosition", void 0);
|
|
236
236
|
_define_property(this, "updateSetting", updateSetting);
|
|
237
237
|
_define_property(this, "removeSetting", removeSetting);
|
|
238
|
-
this._callControlHooks(
|
|
238
|
+
this._callControlHooks('preInstance', props);
|
|
239
239
|
var _ref = _instanceof(this, Control) ? this.constructor : void 0, controlName = _ref.controlName, controlIcon = _ref.controlIcon, controlType = _ref.controlType, controlFieldType = _ref.controlFieldType, controlEventKeys = _ref.controlEventKeys, controlCustomEvents = _ref.controlCustomEvents, name = _ref.name, setting = _ref.setting, slots = _ref.slots, slotPosition = _ref.slotPosition;
|
|
240
240
|
if (!(controlName && controlIcon && controlType)) {
|
|
241
241
|
referenceError("The ".concat(name, " controlName,controlIcon,controlType is not define"));
|
|
@@ -248,7 +248,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
248
248
|
this.type = (_props_type = props === null || props === void 0 ? void 0 : props.type) !== null && _props_type !== void 0 ? _props_type : controlType;
|
|
249
249
|
this.props = new Property(props === null || props === void 0 ? void 0 : props.props, (_instanceof(this, Control) ? this.constructor : void 0).controlName);
|
|
250
250
|
var _props_controlType;
|
|
251
|
-
this.controlType = (_props_controlType = props === null || props === void 0 ? void 0 : props.controlType) !== null && _props_controlType !== void 0 ? _props_controlType :
|
|
251
|
+
this.controlType = (_props_controlType = props === null || props === void 0 ? void 0 : props.controlType) !== null && _props_controlType !== void 0 ? _props_controlType : 'base';
|
|
252
252
|
this.setting = JSONCopy(setting);
|
|
253
253
|
var _props_fieldType;
|
|
254
254
|
this.fieldType = (_props_fieldType = props === null || props === void 0 ? void 0 : props.fieldType) !== null && _props_fieldType !== void 0 ? _props_fieldType : controlFieldType;
|
|
@@ -257,7 +257,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
257
257
|
this.slots = JSONCopy(slots);
|
|
258
258
|
this.slotPosition = JSONCopy(slotPosition);
|
|
259
259
|
Promise.resolve().then(function() {
|
|
260
|
-
_this._callControlHooks(
|
|
260
|
+
_this._callControlHooks('postInstance', props);
|
|
261
261
|
});
|
|
262
262
|
}
|
|
263
263
|
_create_class(Control, [
|
|
@@ -289,14 +289,14 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
289
289
|
key: "preUpdate",
|
|
290
290
|
value: function preUpdate(key, value) {
|
|
291
291
|
// 在修改props之前
|
|
292
|
-
this._callControlHooks(
|
|
292
|
+
this._callControlHooks('preUpdateProps', key, value);
|
|
293
293
|
}
|
|
294
294
|
},
|
|
295
295
|
{
|
|
296
296
|
key: "postUpdate",
|
|
297
297
|
value: function postUpdate(key, value) {
|
|
298
298
|
// 在修改props之后
|
|
299
|
-
this._callControlHooks(
|
|
299
|
+
this._callControlHooks('postUpdateProps', key, value);
|
|
300
300
|
}
|
|
301
301
|
},
|
|
302
302
|
{
|
|
@@ -321,7 +321,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
321
321
|
rules = _object_spread({}, _this.rules);
|
|
322
322
|
return [
|
|
323
323
|
4,
|
|
324
|
-
_this._callControlHooks(
|
|
324
|
+
_this._callControlHooks('preValidate', rules)
|
|
325
325
|
];
|
|
326
326
|
case 1:
|
|
327
327
|
results = _state.sent();
|
|
@@ -414,13 +414,13 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
414
414
|
dataBindModelType.dataBind = dataBind;
|
|
415
415
|
}
|
|
416
416
|
switch(optionConfig){
|
|
417
|
-
case
|
|
417
|
+
case 'datasource':
|
|
418
418
|
case undefined:
|
|
419
419
|
if (datasourceBind) {
|
|
420
420
|
dataBindModelType.datasourceBind = datasourceBind;
|
|
421
421
|
}
|
|
422
422
|
break;
|
|
423
|
-
case
|
|
423
|
+
case 'custom':
|
|
424
424
|
dataBindModelType.props.options = options;
|
|
425
425
|
break;
|
|
426
426
|
}
|
|
@@ -443,7 +443,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
443
443
|
key: "preToSchema",
|
|
444
444
|
value: function preToSchema() {
|
|
445
445
|
// 在处理Schema之前,预留的钩子函数,允许在toSchema之前处理一些数据
|
|
446
|
-
this._callControlHooks(
|
|
446
|
+
this._callControlHooks('preToSchema', this);
|
|
447
447
|
}
|
|
448
448
|
},
|
|
449
449
|
{
|
|
@@ -463,7 +463,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
463
463
|
{
|
|
464
464
|
key: "updateBasicControl",
|
|
465
465
|
value: function updateBasicControl(key, setting) {
|
|
466
|
-
if (key !==
|
|
466
|
+
if (key !== 'setting') return;
|
|
467
467
|
if (setting.add) {
|
|
468
468
|
var _this_setting;
|
|
469
469
|
(_this_setting = this.setting).push.apply(_this_setting, _to_consumable_array(setting.add));
|
|
@@ -479,12 +479,12 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
479
479
|
]);
|
|
480
480
|
return Control;
|
|
481
481
|
}();
|
|
482
|
-
_define_property(Control, "mode",
|
|
482
|
+
_define_property(Control, "mode", 'Designer');
|
|
483
483
|
_define_property(Control, "slots", void 0);
|
|
484
484
|
_define_property(Control, "slotPosition", void 0);
|
|
485
|
-
_define_property(Control, "controlName",
|
|
486
|
-
_define_property(Control, "controlIcon",
|
|
487
|
-
_define_property(Control, "controlType",
|
|
485
|
+
_define_property(Control, "controlName", '控件');
|
|
486
|
+
_define_property(Control, "controlIcon", 'icon');
|
|
487
|
+
_define_property(Control, "controlType", 'control');
|
|
488
488
|
_define_property(Control, "controlFieldType", void 0);
|
|
489
489
|
// 控件可以触发的事件key
|
|
490
490
|
_define_property(Control, "controlEventKeys", []);
|
|
@@ -510,7 +510,7 @@ export { Control as DesignerControl };
|
|
|
510
510
|
deleteKeys.forEach(function(deleteKey) {
|
|
511
511
|
var _this_setting;
|
|
512
512
|
// 是否存在子项
|
|
513
|
-
var isHasItem = typeof deleteKey !==
|
|
513
|
+
var isHasItem = typeof deleteKey !== 'string';
|
|
514
514
|
// 判断setting是否是自定义控件setting项
|
|
515
515
|
// @ts-ignore
|
|
516
516
|
var settingIndex = (_this_setting = _this.setting) === null || _this_setting === void 0 ? void 0 : _this_setting.findIndex(function(option) {
|
|
@@ -538,7 +538,7 @@ export { Control as DesignerControl };
|
|
|
538
538
|
* @param value.type 默认是replace替换,可以更改为push新增
|
|
539
539
|
* */ function updateSetting(settingKey, value) {
|
|
540
540
|
var _this = this;
|
|
541
|
-
var keys = typeof settingKey ===
|
|
541
|
+
var keys = typeof settingKey === 'string' ? [
|
|
542
542
|
settingKey
|
|
543
543
|
] : settingKey;
|
|
544
544
|
keys.forEach(function(key) {
|
|
@@ -547,12 +547,12 @@ export { Control as DesignerControl };
|
|
|
547
547
|
return item.key === key;
|
|
548
548
|
});
|
|
549
549
|
if (settingItem) {
|
|
550
|
-
if (typeof value ===
|
|
550
|
+
if (typeof value === 'boolean') {
|
|
551
551
|
settingItem.visible = value;
|
|
552
|
-
} else if (typeof value ===
|
|
552
|
+
} else if (typeof value === 'object') {
|
|
553
553
|
var _value_type;
|
|
554
|
-
var type = (_value_type = value.type) !== null && _value_type !== void 0 ? _value_type :
|
|
555
|
-
if (type ===
|
|
554
|
+
var type = (_value_type = value.type) !== null && _value_type !== void 0 ? _value_type : 'replace';
|
|
555
|
+
if (type === 'replace') {
|
|
556
556
|
settingItem.showItems = value.showItems;
|
|
557
557
|
} else {
|
|
558
558
|
var _settingItem_showItems;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import Designer from
|
|
2
|
-
import Runtime from
|
|
3
|
-
import Property from
|
|
1
|
+
import Designer from './designer';
|
|
2
|
+
import Runtime from './runtime';
|
|
3
|
+
import Property from './property';
|
|
4
4
|
export default {
|
|
5
5
|
Designer: Designer,
|
|
6
6
|
Runtime: Runtime,
|
|
7
7
|
Property: Property
|
|
8
8
|
};
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
9
|
+
export * from './designer';
|
|
10
|
+
export * from './runtime';
|
|
11
|
+
export * from './property';
|
|
12
|
+
export * from './types';
|
|
@@ -128,12 +128,12 @@ function _create_super(Derived) {
|
|
|
128
128
|
return _possible_constructor_return(this, result);
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
import { BaseStyle } from
|
|
131
|
+
import { BaseStyle } from '../../framework';
|
|
132
132
|
var PropertyRules = function PropertyRules(props) {
|
|
133
133
|
"use strict";
|
|
134
134
|
_class_call_check(this, PropertyRules);
|
|
135
135
|
_define_property(this, "isHide", {
|
|
136
|
-
type:
|
|
136
|
+
type: 'boolean'
|
|
137
137
|
});
|
|
138
138
|
};
|
|
139
139
|
var PropertyRuntimeRules = /*#__PURE__*/ function(Array1) {
|
|
@@ -151,7 +151,7 @@ var PropertyRuntimeRules = /*#__PURE__*/ function(Array1) {
|
|
|
151
151
|
* @public
|
|
152
152
|
*/ var Property = function Property(props) {
|
|
153
153
|
"use strict";
|
|
154
|
-
var caption = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] :
|
|
154
|
+
var caption = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';
|
|
155
155
|
_class_call_check(this, Property);
|
|
156
156
|
/**
|
|
157
157
|
* 是否隐藏
|
|
@@ -37,9 +37,9 @@ function _instanceof(left, right) {
|
|
|
37
37
|
return left instanceof right;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
import Property from
|
|
41
|
-
import { genNonDuplicateId, referenceError } from
|
|
42
|
-
import { PAGE_STATUS } from
|
|
40
|
+
import Property from './property';
|
|
41
|
+
import { genNonDuplicateId, referenceError } from '@byteluck-fe/model-driven-shared';
|
|
42
|
+
import { PAGE_STATUS } from '../../framework';
|
|
43
43
|
var Control = /*#__PURE__*/ function _target() {
|
|
44
44
|
"use strict";
|
|
45
45
|
function Control(props) {
|
|
@@ -64,7 +64,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
64
64
|
this.props = new Property(props === null || props === void 0 ? void 0 : props.props);
|
|
65
65
|
this.customEvents = controlCustomEvents;
|
|
66
66
|
var _props_controlType;
|
|
67
|
-
this.controlType = (_props_controlType = props === null || props === void 0 ? void 0 : props.controlType) !== null && _props_controlType !== void 0 ? _props_controlType :
|
|
67
|
+
this.controlType = (_props_controlType = props === null || props === void 0 ? void 0 : props.controlType) !== null && _props_controlType !== void 0 ? _props_controlType : 'base';
|
|
68
68
|
var _props_fieldType;
|
|
69
69
|
this.fieldType = (_props_fieldType = props === null || props === void 0 ? void 0 : props.fieldType) !== null && _props_fieldType !== void 0 ? _props_fieldType : controlFieldType;
|
|
70
70
|
var _props_pageStatus;
|
|
@@ -85,8 +85,8 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
85
85
|
]);
|
|
86
86
|
return Control;
|
|
87
87
|
}();
|
|
88
|
-
_define_property(Control, "mode",
|
|
89
|
-
_define_property(Control, "controlType",
|
|
88
|
+
_define_property(Control, "mode", 'Runtime');
|
|
89
|
+
_define_property(Control, "controlType", 'control');
|
|
90
90
|
_define_property(Control, "controlFieldType", void 0);
|
|
91
91
|
_define_property(Control, "__is_control__", true);
|
|
92
92
|
_define_property(Control, "controlCustomEvents", []);
|
|
@@ -9,6 +9,20 @@ function _class_call_check(instance, Constructor) {
|
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
+
function _defineProperties(target, props) {
|
|
13
|
+
for(var i = 0; i < props.length; i++){
|
|
14
|
+
var descriptor = props[i];
|
|
15
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
16
|
+
descriptor.configurable = true;
|
|
17
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
18
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
22
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
23
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
24
|
+
return Constructor;
|
|
25
|
+
}
|
|
12
26
|
function _define_property(obj, key, value) {
|
|
13
27
|
if (key in obj) {
|
|
14
28
|
Object.defineProperty(obj, key, {
|
|
@@ -22,6 +36,22 @@ function _define_property(obj, key, value) {
|
|
|
22
36
|
}
|
|
23
37
|
return obj;
|
|
24
38
|
}
|
|
39
|
+
function _get(target, property, receiver) {
|
|
40
|
+
if (typeof Reflect !== "undefined" && Reflect.get) {
|
|
41
|
+
_get = Reflect.get;
|
|
42
|
+
} else {
|
|
43
|
+
_get = function get(target, property, receiver) {
|
|
44
|
+
var base = _super_prop_base(target, property);
|
|
45
|
+
if (!base) return;
|
|
46
|
+
var desc = Object.getOwnPropertyDescriptor(base, property);
|
|
47
|
+
if (desc.get) {
|
|
48
|
+
return desc.get.call(receiver || target);
|
|
49
|
+
}
|
|
50
|
+
return desc.value;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return _get(target, property, receiver || target);
|
|
54
|
+
}
|
|
25
55
|
function _get_prototype_of(o) {
|
|
26
56
|
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
27
57
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -41,6 +71,45 @@ function _inherits(subClass, superClass) {
|
|
|
41
71
|
});
|
|
42
72
|
if (superClass) _set_prototype_of(subClass, superClass);
|
|
43
73
|
}
|
|
74
|
+
function _object_spread(target) {
|
|
75
|
+
for(var i = 1; i < arguments.length; i++){
|
|
76
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
77
|
+
var ownKeys = Object.keys(source);
|
|
78
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
79
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
80
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
ownKeys.forEach(function(key) {
|
|
84
|
+
_define_property(target, key, source[key]);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
return target;
|
|
88
|
+
}
|
|
89
|
+
function ownKeys(object, enumerableOnly) {
|
|
90
|
+
var keys = Object.keys(object);
|
|
91
|
+
if (Object.getOwnPropertySymbols) {
|
|
92
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
93
|
+
if (enumerableOnly) {
|
|
94
|
+
symbols = symbols.filter(function(sym) {
|
|
95
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
keys.push.apply(keys, symbols);
|
|
99
|
+
}
|
|
100
|
+
return keys;
|
|
101
|
+
}
|
|
102
|
+
function _object_spread_props(target, source) {
|
|
103
|
+
source = source != null ? source : {};
|
|
104
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
105
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
106
|
+
} else {
|
|
107
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
108
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return target;
|
|
112
|
+
}
|
|
44
113
|
function _possible_constructor_return(self, call) {
|
|
45
114
|
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
46
115
|
return call;
|
|
@@ -54,6 +123,13 @@ function _set_prototype_of(o, p) {
|
|
|
54
123
|
};
|
|
55
124
|
return _set_prototype_of(o, p);
|
|
56
125
|
}
|
|
126
|
+
function _super_prop_base(object, property) {
|
|
127
|
+
while(!Object.prototype.hasOwnProperty.call(object, property)){
|
|
128
|
+
object = _get_prototype_of(object);
|
|
129
|
+
if (object === null) break;
|
|
130
|
+
}
|
|
131
|
+
return object;
|
|
132
|
+
}
|
|
57
133
|
function _type_of(obj) {
|
|
58
134
|
"@swc/helpers - typeof";
|
|
59
135
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
@@ -82,9 +158,9 @@ function _create_super(Derived) {
|
|
|
82
158
|
return _possible_constructor_return(this, result);
|
|
83
159
|
};
|
|
84
160
|
}
|
|
85
|
-
import { defineControlArrayToProperty } from
|
|
86
|
-
import { DesignerControl } from
|
|
87
|
-
import ColumnControlProperty from
|
|
161
|
+
import { defineControlArrayToProperty } from '../ControlArray';
|
|
162
|
+
import { DesignerControl } from '../BaseControl';
|
|
163
|
+
import ColumnControlProperty from './property';
|
|
88
164
|
var ColumnControl = /*#__PURE__*/ function(DesignerControl) {
|
|
89
165
|
"use strict";
|
|
90
166
|
_inherits(ColumnControl, DesignerControl);
|
|
@@ -93,13 +169,26 @@ var ColumnControl = /*#__PURE__*/ function(DesignerControl) {
|
|
|
93
169
|
_class_call_check(this, ColumnControl);
|
|
94
170
|
var _this;
|
|
95
171
|
_this = _super.call(this, props);
|
|
96
|
-
_define_property(_assert_this_initialized(_this), "controlType",
|
|
172
|
+
_define_property(_assert_this_initialized(_this), "controlType", 'column');
|
|
97
173
|
_define_property(_assert_this_initialized(_this), "props", void 0);
|
|
98
174
|
_define_property(_assert_this_initialized(_this), "children", void 0);
|
|
99
175
|
_this.props = new ColumnControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
100
|
-
defineControlArrayToProperty(_assert_this_initialized(_this),
|
|
176
|
+
defineControlArrayToProperty(_assert_this_initialized(_this), 'children', props === null || props === void 0 ? void 0 : props.children, undefined, 'Designer');
|
|
101
177
|
return _this;
|
|
102
178
|
}
|
|
179
|
+
_create_class(ColumnControl, [
|
|
180
|
+
{
|
|
181
|
+
key: "toSchema",
|
|
182
|
+
value: function toSchema() {
|
|
183
|
+
var superSchema = _get(_get_prototype_of(ColumnControl.prototype), "toSchema", this).call(this);
|
|
184
|
+
return _object_spread_props(_object_spread({}, superSchema), {
|
|
185
|
+
children: this.children.map(function(item) {
|
|
186
|
+
return item.toSchema();
|
|
187
|
+
})
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
]);
|
|
103
192
|
return ColumnControl;
|
|
104
193
|
}(DesignerControl);
|
|
105
194
|
export default ColumnControl;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Designer from
|
|
2
|
-
import Runtime from
|
|
3
|
-
import Property from
|
|
1
|
+
import Designer from './designer';
|
|
2
|
+
import Runtime from './runtime';
|
|
3
|
+
import Property from './property';
|
|
4
4
|
export default {
|
|
5
5
|
Designer: Designer,
|
|
6
6
|
Runtime: Runtime,
|
|
7
7
|
Property: Property
|
|
8
8
|
};
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
9
|
+
export * from './designer';
|
|
10
|
+
export * from './runtime';
|
|
11
|
+
export * from './property';
|
|
@@ -82,10 +82,10 @@ function _create_super(Derived) {
|
|
|
82
82
|
return _possible_constructor_return(this, result);
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
import { Property, PropertyRules } from
|
|
86
|
-
import { RulesMessage } from
|
|
87
|
-
import { initOptionAndDataSourceRules } from
|
|
88
|
-
import { DataBind, AutoWidth } from
|
|
85
|
+
import { Property, PropertyRules } from '../BaseControl';
|
|
86
|
+
import { RulesMessage } from '@byteluck-fe/model-driven-shared';
|
|
87
|
+
import { initOptionAndDataSourceRules } from '../initOptionAndDataSourceRules';
|
|
88
|
+
import { DataBind, AutoWidth } from '../../framework';
|
|
89
89
|
var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
90
90
|
"use strict";
|
|
91
91
|
_inherits(ColumnControlPropertyRules, PropertyRules);
|
|
@@ -95,16 +95,16 @@ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
95
95
|
var _this;
|
|
96
96
|
_this = _super.call(this, props);
|
|
97
97
|
_define_property(_assert_this_initialized(_this), "caption", {
|
|
98
|
-
type:
|
|
98
|
+
type: 'string',
|
|
99
99
|
required: true,
|
|
100
|
-
message: RulesMessage.getMessage(
|
|
100
|
+
message: RulesMessage.getMessage('pleaseEnterCaption')
|
|
101
101
|
});
|
|
102
102
|
_define_property(_assert_this_initialized(_this), "width", {
|
|
103
|
-
type:
|
|
103
|
+
type: 'number',
|
|
104
104
|
required: false,
|
|
105
|
-
message: RulesMessage.getMessage(
|
|
105
|
+
message: RulesMessage.getMessage('pleaseEnterColumnWidth')
|
|
106
106
|
});
|
|
107
|
-
_this.width.required = props.widthType ===
|
|
107
|
+
_this.width.required = props.widthType === 'px';
|
|
108
108
|
return _this;
|
|
109
109
|
}
|
|
110
110
|
return ColumnControlPropertyRules;
|
|
@@ -158,11 +158,11 @@ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
158
158
|
_define_property(_assert_this_initialized(_this), "children", void 0);
|
|
159
159
|
var _props_width;
|
|
160
160
|
_this.width = (_props_width = props === null || props === void 0 ? void 0 : props.width) !== null && _props_width !== void 0 ? _props_width : 150;
|
|
161
|
-
_this.widthType = (props === null || props === void 0 ? void 0 : props.widthType) ||
|
|
161
|
+
_this.widthType = (props === null || props === void 0 ? void 0 : props.widthType) || 'auto';
|
|
162
162
|
var _props_caption;
|
|
163
|
-
_this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption :
|
|
163
|
+
_this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : '';
|
|
164
164
|
var _props_fixed;
|
|
165
|
-
_this.fixed = (_props_fixed = props === null || props === void 0 ? void 0 : props.fixed) !== null && _props_fixed !== void 0 ? _props_fixed :
|
|
165
|
+
_this.fixed = (_props_fixed = props === null || props === void 0 ? void 0 : props.fixed) !== null && _props_fixed !== void 0 ? _props_fixed : 'none';
|
|
166
166
|
_this.autoWidth = new AutoWidth(props === null || props === void 0 ? void 0 : props.autoWidth);
|
|
167
167
|
_this.dataBind = new DataBind(props === null || props === void 0 ? void 0 : props.dataBind);
|
|
168
168
|
var _props_sort;
|
|
@@ -185,24 +185,24 @@ var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnContro
|
|
|
185
185
|
var _this;
|
|
186
186
|
_this = _super.call(this, props);
|
|
187
187
|
_define_property(_assert_this_initialized(_this), "optionConfig", {
|
|
188
|
-
type:
|
|
188
|
+
type: 'enum',
|
|
189
189
|
enum: [
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
190
|
+
'custom',
|
|
191
|
+
'datasource',
|
|
192
|
+
'none'
|
|
193
193
|
],
|
|
194
|
-
message: RulesMessage.getMessage(
|
|
194
|
+
message: RulesMessage.getMessage('PleaseSelectTheCorrectOptionSettings')
|
|
195
195
|
});
|
|
196
196
|
_define_property(_assert_this_initialized(_this), "options", [
|
|
197
197
|
{
|
|
198
|
-
type:
|
|
199
|
-
message: RulesMessage.getMessage(
|
|
198
|
+
type: 'array',
|
|
199
|
+
message: RulesMessage.getMessage('isNotArray')
|
|
200
200
|
}
|
|
201
201
|
]);
|
|
202
202
|
_define_property(_assert_this_initialized(_this), "datasourceBind", [
|
|
203
203
|
{
|
|
204
|
-
type:
|
|
205
|
-
message: RulesMessage.getMessage(
|
|
204
|
+
type: 'object',
|
|
205
|
+
message: RulesMessage.getMessage('isNotObject')
|
|
206
206
|
}
|
|
207
207
|
]);
|
|
208
208
|
initOptionAndDataSourceRules.call(_assert_this_initialized(_this), props);
|
|
@@ -82,9 +82,9 @@ function _create_super(Derived) {
|
|
|
82
82
|
return _possible_constructor_return(this, result);
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
import { defineControlArrayToProperty } from
|
|
86
|
-
import { RuntimeControl } from
|
|
87
|
-
import ColumnControlProperty from
|
|
85
|
+
import { defineControlArrayToProperty } from '../ControlArray';
|
|
86
|
+
import { RuntimeControl } from '../BaseControl';
|
|
87
|
+
import ColumnControlProperty from './property';
|
|
88
88
|
var ColumnControl = /*#__PURE__*/ function(RuntimeControl) {
|
|
89
89
|
"use strict";
|
|
90
90
|
_inherits(ColumnControl, RuntimeControl);
|
|
@@ -93,11 +93,11 @@ var ColumnControl = /*#__PURE__*/ function(RuntimeControl) {
|
|
|
93
93
|
_class_call_check(this, ColumnControl);
|
|
94
94
|
var _this;
|
|
95
95
|
_this = _super.call(this, props);
|
|
96
|
-
_define_property(_assert_this_initialized(_this), "controlType",
|
|
96
|
+
_define_property(_assert_this_initialized(_this), "controlType", 'column');
|
|
97
97
|
_define_property(_assert_this_initialized(_this), "props", void 0);
|
|
98
98
|
_define_property(_assert_this_initialized(_this), "children", void 0);
|
|
99
99
|
_this.props = new ColumnControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
100
|
-
defineControlArrayToProperty(_assert_this_initialized(_this),
|
|
100
|
+
defineControlArrayToProperty(_assert_this_initialized(_this), 'children', props === null || props === void 0 ? void 0 : props.children, undefined, 'Runtime');
|
|
101
101
|
return _this;
|
|
102
102
|
}
|
|
103
103
|
return ColumnControl;
|
|
@@ -23,7 +23,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
23
23
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
24
24
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
25
25
|
}
|
|
26
|
-
import { isArray, isPlainObject } from
|
|
26
|
+
import { isArray, isPlainObject } from '@byteluck-fe/model-driven-shared';
|
|
27
27
|
export function setPropertyDontEnum(obj, property) {
|
|
28
28
|
var _Object_getOwnPropertyDescriptors_property;
|
|
29
29
|
//如果没有被设置过不允许枚举的话,说明是第一次被设置,需要设置属性不允许枚举
|
|
@@ -34,10 +34,10 @@ export function setPropertyDontEnum(obj, property) {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
export function defineParent(control, parent, mode) {
|
|
37
|
-
if (mode !==
|
|
37
|
+
if (mode !== 'Runtime') {
|
|
38
38
|
control.parent = parent;
|
|
39
39
|
// 如果没有被设置过不允许枚举的话,说明是第一次被代理,需要设置parent属性不允许枚举
|
|
40
|
-
setPropertyDontEnum(control,
|
|
40
|
+
setPropertyDontEnum(control, 'parent');
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
export function defineArrayParent(controls, parent, mode) {
|
|
@@ -45,7 +45,7 @@ export function defineArrayParent(controls, parent, mode) {
|
|
|
45
45
|
defineParent(item, parent, mode);
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
-
var targetKey = Symbol(
|
|
48
|
+
var targetKey = Symbol('targetKey');
|
|
49
49
|
function getTargetValue(value) {
|
|
50
50
|
var _value_targetKey;
|
|
51
51
|
return (_value_targetKey = value[targetKey]) !== null && _value_targetKey !== void 0 ? _value_targetKey : value;
|
|
@@ -72,7 +72,7 @@ function proxyState(target, parent, mode) {
|
|
|
72
72
|
}
|
|
73
73
|
var _Reflect;
|
|
74
74
|
// 更改长度为当前长度,代表没变,直接返回true,否则在safari 13.x版本的严格模式会引起页面崩溃
|
|
75
|
-
if (isArray(target) && property ===
|
|
75
|
+
if (isArray(target) && property === 'length' && value === target.length) {
|
|
76
76
|
return true;
|
|
77
77
|
}
|
|
78
78
|
var result = (_Reflect = Reflect).set.apply(_Reflect, [
|
|
@@ -82,8 +82,8 @@ function _create_super(Derived) {
|
|
|
82
82
|
return _possible_constructor_return(this, result);
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
-
import { DesignerControl } from
|
|
86
|
-
import BaseControlProperty from
|
|
85
|
+
import { DesignerControl } from '../BaseControl';
|
|
86
|
+
import BaseControlProperty from './property';
|
|
87
87
|
var FormControl = /*#__PURE__*/ function(DesignerControl) {
|
|
88
88
|
"use strict";
|
|
89
89
|
_inherits(FormControl, DesignerControl);
|
|
@@ -92,7 +92,7 @@ var FormControl = /*#__PURE__*/ function(DesignerControl) {
|
|
|
92
92
|
_class_call_check(this, FormControl);
|
|
93
93
|
var _this;
|
|
94
94
|
_this = _super.call(this, props);
|
|
95
|
-
_define_property(_assert_this_initialized(_this), "controlType",
|
|
95
|
+
_define_property(_assert_this_initialized(_this), "controlType", 'form');
|
|
96
96
|
_define_property(_assert_this_initialized(_this), "props", void 0);
|
|
97
97
|
_this.props = new BaseControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
98
98
|
return _this;
|
|
@@ -100,9 +100,9 @@ var FormControl = /*#__PURE__*/ function(DesignerControl) {
|
|
|
100
100
|
return FormControl;
|
|
101
101
|
}(DesignerControl);
|
|
102
102
|
_define_property(FormControl, "controlEventKeys", [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
'on_change',
|
|
104
|
+
'on_focus',
|
|
105
|
+
'on_blur'
|
|
106
106
|
]);
|
|
107
107
|
_define_property(FormControl, "controlCustomAttributes", void 0);
|
|
108
108
|
export default FormControl;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Designer from
|
|
2
|
-
import Runtime from
|
|
3
|
-
import Property from
|
|
1
|
+
import Designer from './designer';
|
|
2
|
+
import Runtime from './runtime';
|
|
3
|
+
import Property from './property';
|
|
4
4
|
export default {
|
|
5
5
|
Designer: Designer,
|
|
6
6
|
Runtime: Runtime,
|
|
7
7
|
Property: Property
|
|
8
8
|
};
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
9
|
+
export * from './designer';
|
|
10
|
+
export * from './runtime';
|
|
11
|
+
export * from './property';
|