@byteluck-fe/model-driven-core 2.23.0-beta.14 → 2.23.0-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/common/BaseControl/property.js +10 -23
- package/dist/esm/common/ColumnControl/designer.js +13 -27
- package/dist/esm/common/ColumnControl/property.js +32 -57
- package/dist/esm/common/ColumnControl/runtime.js +13 -27
- package/dist/esm/common/FormControl/designer.js +12 -25
- package/dist/esm/common/FormControl/property.js +42 -70
- package/dist/esm/common/FormControl/runtime.js +12 -26
- package/dist/esm/common/LayoutControl/designer.js +13 -29
- package/dist/esm/common/LayoutControl/property.js +12 -23
- package/dist/esm/common/LayoutControl/runtime.js +13 -27
- package/dist/esm/common/ListControl/designer.js +13 -26
- package/dist/esm/common/ListControl/property.js +14 -31
- package/dist/esm/common/ListControl/runtime.js +14 -28
- package/dist/esm/common/SearchViewControl/designer.js +12 -25
- package/dist/esm/common/SearchViewControl/property.js +12 -24
- package/dist/esm/common/SearchViewControl/runtime.js +12 -25
- package/dist/esm/common/WrapControl/designer.js +12 -25
- package/dist/esm/common/WrapControl/property.js +12 -23
- package/dist/esm/common/WrapControl/runtime.js +12 -25
- package/dist/esm/framework/RegisterControls.js +1 -0
- package/dist/esm/framework/index.js +51 -82
- package/dist/index.umd.js +1 -1
- package/package.json +3 -3
|
@@ -4,6 +4,10 @@ function _assert_this_initialized(self) {
|
|
|
4
4
|
}
|
|
5
5
|
return self;
|
|
6
6
|
}
|
|
7
|
+
function _call_super(_this, derived, args) {
|
|
8
|
+
derived = _get_prototype_of(derived);
|
|
9
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
|
+
}
|
|
7
11
|
function _class_call_check(instance, Constructor) {
|
|
8
12
|
if (!(instance instanceof Constructor)) {
|
|
9
13
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -105,28 +109,12 @@ function _wrap_native_super(Class) {
|
|
|
105
109
|
return _wrap_native_super(Class);
|
|
106
110
|
}
|
|
107
111
|
function _is_native_reflect_construct() {
|
|
108
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
109
|
-
if (Reflect.construct.sham) return false;
|
|
110
|
-
if (typeof Proxy === "function") return true;
|
|
111
112
|
try {
|
|
112
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
function _create_super(Derived) {
|
|
119
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
120
|
-
return function _createSuperInternal() {
|
|
121
|
-
var Super = _get_prototype_of(Derived), result;
|
|
122
|
-
if (hasNativeReflectConstruct) {
|
|
123
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
124
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
125
|
-
} else {
|
|
126
|
-
result = Super.apply(this, arguments);
|
|
127
|
-
}
|
|
128
|
-
return _possible_constructor_return(this, result);
|
|
129
|
-
};
|
|
113
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
114
|
+
} catch (_) {}
|
|
115
|
+
return (_is_native_reflect_construct = function() {
|
|
116
|
+
return !!result;
|
|
117
|
+
})();
|
|
130
118
|
}
|
|
131
119
|
import { BaseStyle } from '../../framework';
|
|
132
120
|
var PropertyRules = function PropertyRules(props) {
|
|
@@ -139,10 +127,9 @@ var PropertyRules = function PropertyRules(props) {
|
|
|
139
127
|
var PropertyRuntimeRules = /*#__PURE__*/ function(Array1) {
|
|
140
128
|
"use strict";
|
|
141
129
|
_inherits(PropertyRuntimeRules, Array1);
|
|
142
|
-
var _super = _create_super(PropertyRuntimeRules);
|
|
143
130
|
function PropertyRuntimeRules(props) {
|
|
144
131
|
_class_call_check(this, PropertyRuntimeRules);
|
|
145
|
-
return
|
|
132
|
+
return _call_super(this, PropertyRuntimeRules);
|
|
146
133
|
}
|
|
147
134
|
return PropertyRuntimeRules;
|
|
148
135
|
}(_wrap_native_super(Array));
|
|
@@ -4,6 +4,10 @@ function _assert_this_initialized(self) {
|
|
|
4
4
|
}
|
|
5
5
|
return self;
|
|
6
6
|
}
|
|
7
|
+
function _call_super(_this, derived, args) {
|
|
8
|
+
derived = _get_prototype_of(derived);
|
|
9
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
|
+
}
|
|
7
11
|
function _class_call_check(instance, Constructor) {
|
|
8
12
|
if (!(instance instanceof Constructor)) {
|
|
9
13
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -135,28 +139,12 @@ function _type_of(obj) {
|
|
|
135
139
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
136
140
|
}
|
|
137
141
|
function _is_native_reflect_construct() {
|
|
138
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
139
|
-
if (Reflect.construct.sham) return false;
|
|
140
|
-
if (typeof Proxy === "function") return true;
|
|
141
142
|
try {
|
|
142
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
return
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
function _create_super(Derived) {
|
|
149
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
150
|
-
return function _createSuperInternal() {
|
|
151
|
-
var Super = _get_prototype_of(Derived), result;
|
|
152
|
-
if (hasNativeReflectConstruct) {
|
|
153
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
154
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
155
|
-
} else {
|
|
156
|
-
result = Super.apply(this, arguments);
|
|
157
|
-
}
|
|
158
|
-
return _possible_constructor_return(this, result);
|
|
159
|
-
};
|
|
143
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
144
|
+
} catch (_) {}
|
|
145
|
+
return (_is_native_reflect_construct = function() {
|
|
146
|
+
return !!result;
|
|
147
|
+
})();
|
|
160
148
|
}
|
|
161
149
|
import { defineControlArrayToProperty } from '../ControlArray';
|
|
162
150
|
import { DesignerControl } from '../BaseControl';
|
|
@@ -164,16 +152,14 @@ import ColumnControlProperty from './property';
|
|
|
164
152
|
var ColumnControl = /*#__PURE__*/ function(DesignerControl) {
|
|
165
153
|
"use strict";
|
|
166
154
|
_inherits(ColumnControl, DesignerControl);
|
|
167
|
-
var _super = _create_super(ColumnControl);
|
|
168
155
|
function ColumnControl(props) {
|
|
169
156
|
_class_call_check(this, ColumnControl);
|
|
170
157
|
var _this;
|
|
171
|
-
_this =
|
|
172
|
-
|
|
173
|
-
_define_property(
|
|
174
|
-
_define_property(_assert_this_initialized(_this), "children", void 0);
|
|
158
|
+
_this = _call_super(this, ColumnControl, [
|
|
159
|
+
props
|
|
160
|
+
]), _define_property(_this, "controlType", 'column'), _define_property(_this, "props", void 0), _define_property(_this, "children", void 0);
|
|
175
161
|
_this.props = new ColumnControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
176
|
-
defineControlArrayToProperty(
|
|
162
|
+
defineControlArrayToProperty(_this, 'children', props === null || props === void 0 ? void 0 : props.children, undefined, 'Designer');
|
|
177
163
|
return _this;
|
|
178
164
|
}
|
|
179
165
|
_create_class(ColumnControl, [
|
|
@@ -4,6 +4,10 @@ function _assert_this_initialized(self) {
|
|
|
4
4
|
}
|
|
5
5
|
return self;
|
|
6
6
|
}
|
|
7
|
+
function _call_super(_this, derived, args) {
|
|
8
|
+
derived = _get_prototype_of(derived);
|
|
9
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
|
+
}
|
|
7
11
|
function _class_call_check(instance, Constructor) {
|
|
8
12
|
if (!(instance instanceof Constructor)) {
|
|
9
13
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -59,28 +63,12 @@ function _type_of(obj) {
|
|
|
59
63
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
60
64
|
}
|
|
61
65
|
function _is_native_reflect_construct() {
|
|
62
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
63
|
-
if (Reflect.construct.sham) return false;
|
|
64
|
-
if (typeof Proxy === "function") return true;
|
|
65
66
|
try {
|
|
66
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function _create_super(Derived) {
|
|
73
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
74
|
-
return function _createSuperInternal() {
|
|
75
|
-
var Super = _get_prototype_of(Derived), result;
|
|
76
|
-
if (hasNativeReflectConstruct) {
|
|
77
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
78
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
79
|
-
} else {
|
|
80
|
-
result = Super.apply(this, arguments);
|
|
81
|
-
}
|
|
82
|
-
return _possible_constructor_return(this, result);
|
|
83
|
-
};
|
|
67
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
68
|
+
} catch (_) {}
|
|
69
|
+
return (_is_native_reflect_construct = function() {
|
|
70
|
+
return !!result;
|
|
71
|
+
})();
|
|
84
72
|
}
|
|
85
73
|
import { Property, PropertyRules } from '../BaseControl';
|
|
86
74
|
import { initOptionAndDataSourceRules } from '../initOptionAndDataSourceRules';
|
|
@@ -89,17 +77,16 @@ import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
|
89
77
|
var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
90
78
|
"use strict";
|
|
91
79
|
_inherits(ColumnControlPropertyRules, PropertyRules);
|
|
92
|
-
var _super = _create_super(ColumnControlPropertyRules);
|
|
93
80
|
function ColumnControlPropertyRules(props) {
|
|
94
81
|
_class_call_check(this, ColumnControlPropertyRules);
|
|
95
82
|
var _this;
|
|
96
|
-
_this =
|
|
97
|
-
|
|
83
|
+
_this = _call_super(this, ColumnControlPropertyRules, [
|
|
84
|
+
props
|
|
85
|
+
]), _define_property(_this, "caption", {
|
|
98
86
|
type: 'string',
|
|
99
87
|
required: true,
|
|
100
88
|
message: getLocaleText('CMD.pleaseEnterCaption', null, '请输入标题')
|
|
101
|
-
})
|
|
102
|
-
_define_property(_assert_this_initialized(_this), "width", {
|
|
89
|
+
}), _define_property(_this, "width", {
|
|
103
90
|
type: 'number',
|
|
104
91
|
required: false,
|
|
105
92
|
message: getLocaleText('CMD.pleaseEnterColumnWidth', null, '请输入列宽')
|
|
@@ -115,47 +102,37 @@ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
115
102
|
*/ var ColumnControlProperty = /*#__PURE__*/ function(Property) {
|
|
116
103
|
"use strict";
|
|
117
104
|
_inherits(ColumnControlProperty, Property);
|
|
118
|
-
var _super = _create_super(ColumnControlProperty);
|
|
119
105
|
function ColumnControlProperty(props) {
|
|
120
106
|
_class_call_check(this, ColumnControlProperty);
|
|
121
107
|
var _this;
|
|
122
|
-
_this =
|
|
123
|
-
|
|
108
|
+
_this = _call_super(this, ColumnControlProperty, [
|
|
109
|
+
props
|
|
110
|
+
]), /**
|
|
124
111
|
* 宽度类型
|
|
125
112
|
* @defaultValue 'auto'
|
|
126
|
-
*/ _define_property(
|
|
127
|
-
/**
|
|
113
|
+
*/ _define_property(_this, "widthType", void 0), /**
|
|
128
114
|
* 宽度
|
|
129
115
|
* @defaultValue 150
|
|
130
|
-
*/ _define_property(
|
|
131
|
-
/**
|
|
116
|
+
*/ _define_property(_this, "width", void 0), /**
|
|
132
117
|
* 标题
|
|
133
|
-
*/ _define_property(
|
|
134
|
-
/**
|
|
118
|
+
*/ _define_property(_this, "caption", void 0), /**
|
|
135
119
|
* 绑定数据项
|
|
136
|
-
*/ _define_property(
|
|
137
|
-
/**
|
|
120
|
+
*/ _define_property(_this, "dataBind", void 0), /**
|
|
138
121
|
* 自适应页面宽度
|
|
139
|
-
*/ _define_property(
|
|
140
|
-
/**
|
|
122
|
+
*/ _define_property(_this, "autoWidth", void 0), /**
|
|
141
123
|
* 冻结
|
|
142
124
|
* @defaultValue 'none'
|
|
143
|
-
*/ _define_property(
|
|
144
|
-
/**
|
|
125
|
+
*/ _define_property(_this, "fixed", void 0), /**
|
|
145
126
|
* 表头排序
|
|
146
127
|
* @defaultValue true
|
|
147
|
-
*/ _define_property(
|
|
148
|
-
/**
|
|
128
|
+
*/ _define_property(_this, "sort", void 0), /**
|
|
149
129
|
* 对齐
|
|
150
|
-
*/ _define_property(
|
|
151
|
-
/**
|
|
130
|
+
*/ _define_property(_this, "align", void 0), /**
|
|
152
131
|
* @internal
|
|
153
|
-
*/ _define_property(
|
|
154
|
-
/**
|
|
132
|
+
*/ _define_property(_this, "colSpan", void 0), /**
|
|
155
133
|
* 自动高度
|
|
156
134
|
* @defaultValue false
|
|
157
|
-
*/ _define_property(
|
|
158
|
-
_define_property(_assert_this_initialized(_this), "children", void 0);
|
|
135
|
+
*/ _define_property(_this, "autoHeight", void 0), _define_property(_this, "children", void 0);
|
|
159
136
|
var _props_width;
|
|
160
137
|
_this.width = (_props_width = props === null || props === void 0 ? void 0 : props.width) !== null && _props_width !== void 0 ? _props_width : 150;
|
|
161
138
|
_this.widthType = (props === null || props === void 0 ? void 0 : props.widthType) || 'auto';
|
|
@@ -179,12 +156,12 @@ _define_property(ColumnControlProperty, "Rules", ColumnControlPropertyRules);
|
|
|
179
156
|
var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnControlPropertyRules) {
|
|
180
157
|
"use strict";
|
|
181
158
|
_inherits(ColumnOptionAndDataSourcePropertyRules, ColumnControlPropertyRules);
|
|
182
|
-
var _super = _create_super(ColumnOptionAndDataSourcePropertyRules);
|
|
183
159
|
function ColumnOptionAndDataSourcePropertyRules(props) {
|
|
184
160
|
_class_call_check(this, ColumnOptionAndDataSourcePropertyRules);
|
|
185
161
|
var _this;
|
|
186
|
-
_this =
|
|
187
|
-
|
|
162
|
+
_this = _call_super(this, ColumnOptionAndDataSourcePropertyRules, [
|
|
163
|
+
props
|
|
164
|
+
]), _define_property(_this, "optionConfig", {
|
|
188
165
|
type: 'enum',
|
|
189
166
|
enum: [
|
|
190
167
|
'custom',
|
|
@@ -192,20 +169,18 @@ var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnContro
|
|
|
192
169
|
'none'
|
|
193
170
|
],
|
|
194
171
|
message: getLocaleText('CMD.PleaseSelectTheCorrectOptionSettings', null, '请选择正确的选项设置')
|
|
195
|
-
})
|
|
196
|
-
_define_property(_assert_this_initialized(_this), "options", [
|
|
172
|
+
}), _define_property(_this, "options", [
|
|
197
173
|
{
|
|
198
174
|
type: 'array',
|
|
199
175
|
message: getLocaleText('CMD.isNotArray', null, '请输入一个数组')
|
|
200
176
|
}
|
|
201
|
-
])
|
|
202
|
-
_define_property(_assert_this_initialized(_this), "datasourceBind", [
|
|
177
|
+
]), _define_property(_this, "datasourceBind", [
|
|
203
178
|
{
|
|
204
179
|
type: 'object',
|
|
205
180
|
message: getLocaleText('CMD.isNotObject', null, '请输入一个对象')
|
|
206
181
|
}
|
|
207
182
|
]);
|
|
208
|
-
initOptionAndDataSourceRules.call(
|
|
183
|
+
initOptionAndDataSourceRules.call(_this, props);
|
|
209
184
|
return _this;
|
|
210
185
|
}
|
|
211
186
|
return ColumnOptionAndDataSourcePropertyRules;
|
|
@@ -4,6 +4,10 @@ function _assert_this_initialized(self) {
|
|
|
4
4
|
}
|
|
5
5
|
return self;
|
|
6
6
|
}
|
|
7
|
+
function _call_super(_this, derived, args) {
|
|
8
|
+
derived = _get_prototype_of(derived);
|
|
9
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
|
+
}
|
|
7
11
|
function _class_call_check(instance, Constructor) {
|
|
8
12
|
if (!(instance instanceof Constructor)) {
|
|
9
13
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -59,28 +63,12 @@ function _type_of(obj) {
|
|
|
59
63
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
60
64
|
}
|
|
61
65
|
function _is_native_reflect_construct() {
|
|
62
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
63
|
-
if (Reflect.construct.sham) return false;
|
|
64
|
-
if (typeof Proxy === "function") return true;
|
|
65
66
|
try {
|
|
66
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function _create_super(Derived) {
|
|
73
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
74
|
-
return function _createSuperInternal() {
|
|
75
|
-
var Super = _get_prototype_of(Derived), result;
|
|
76
|
-
if (hasNativeReflectConstruct) {
|
|
77
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
78
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
79
|
-
} else {
|
|
80
|
-
result = Super.apply(this, arguments);
|
|
81
|
-
}
|
|
82
|
-
return _possible_constructor_return(this, result);
|
|
83
|
-
};
|
|
67
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
68
|
+
} catch (_) {}
|
|
69
|
+
return (_is_native_reflect_construct = function() {
|
|
70
|
+
return !!result;
|
|
71
|
+
})();
|
|
84
72
|
}
|
|
85
73
|
import { defineControlArrayToProperty } from '../ControlArray';
|
|
86
74
|
import { RuntimeControl } from '../BaseControl';
|
|
@@ -88,16 +76,14 @@ import ColumnControlProperty from './property';
|
|
|
88
76
|
var ColumnControl = /*#__PURE__*/ function(RuntimeControl) {
|
|
89
77
|
"use strict";
|
|
90
78
|
_inherits(ColumnControl, RuntimeControl);
|
|
91
|
-
var _super = _create_super(ColumnControl);
|
|
92
79
|
function ColumnControl(props) {
|
|
93
80
|
_class_call_check(this, ColumnControl);
|
|
94
81
|
var _this;
|
|
95
|
-
_this =
|
|
96
|
-
|
|
97
|
-
_define_property(
|
|
98
|
-
_define_property(_assert_this_initialized(_this), "children", void 0);
|
|
82
|
+
_this = _call_super(this, ColumnControl, [
|
|
83
|
+
props
|
|
84
|
+
]), _define_property(_this, "controlType", 'column'), _define_property(_this, "props", void 0), _define_property(_this, "children", void 0);
|
|
99
85
|
_this.props = new ColumnControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
100
|
-
defineControlArrayToProperty(
|
|
86
|
+
defineControlArrayToProperty(_this, 'children', props === null || props === void 0 ? void 0 : props.children, undefined, 'Runtime');
|
|
101
87
|
return _this;
|
|
102
88
|
}
|
|
103
89
|
return ColumnControl;
|
|
@@ -4,6 +4,10 @@ function _assert_this_initialized(self) {
|
|
|
4
4
|
}
|
|
5
5
|
return self;
|
|
6
6
|
}
|
|
7
|
+
function _call_super(_this, derived, args) {
|
|
8
|
+
derived = _get_prototype_of(derived);
|
|
9
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
|
+
}
|
|
7
11
|
function _class_call_check(instance, Constructor) {
|
|
8
12
|
if (!(instance instanceof Constructor)) {
|
|
9
13
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -59,41 +63,24 @@ function _type_of(obj) {
|
|
|
59
63
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
60
64
|
}
|
|
61
65
|
function _is_native_reflect_construct() {
|
|
62
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
63
|
-
if (Reflect.construct.sham) return false;
|
|
64
|
-
if (typeof Proxy === "function") return true;
|
|
65
66
|
try {
|
|
66
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function _create_super(Derived) {
|
|
73
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
74
|
-
return function _createSuperInternal() {
|
|
75
|
-
var Super = _get_prototype_of(Derived), result;
|
|
76
|
-
if (hasNativeReflectConstruct) {
|
|
77
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
78
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
79
|
-
} else {
|
|
80
|
-
result = Super.apply(this, arguments);
|
|
81
|
-
}
|
|
82
|
-
return _possible_constructor_return(this, result);
|
|
83
|
-
};
|
|
67
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
68
|
+
} catch (_) {}
|
|
69
|
+
return (_is_native_reflect_construct = function() {
|
|
70
|
+
return !!result;
|
|
71
|
+
})();
|
|
84
72
|
}
|
|
85
73
|
import { DesignerControl } from '../BaseControl';
|
|
86
74
|
import BaseControlProperty from './property';
|
|
87
75
|
var FormControl = /*#__PURE__*/ function(DesignerControl) {
|
|
88
76
|
"use strict";
|
|
89
77
|
_inherits(FormControl, DesignerControl);
|
|
90
|
-
var _super = _create_super(FormControl);
|
|
91
78
|
function FormControl(props) {
|
|
92
79
|
_class_call_check(this, FormControl);
|
|
93
80
|
var _this;
|
|
94
|
-
_this =
|
|
95
|
-
|
|
96
|
-
_define_property(
|
|
81
|
+
_this = _call_super(this, FormControl, [
|
|
82
|
+
props
|
|
83
|
+
]), _define_property(_this, "controlType", 'form'), _define_property(_this, "props", void 0);
|
|
97
84
|
_this.props = new BaseControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
98
85
|
return _this;
|
|
99
86
|
}
|
|
@@ -4,6 +4,10 @@ function _assert_this_initialized(self) {
|
|
|
4
4
|
}
|
|
5
5
|
return self;
|
|
6
6
|
}
|
|
7
|
+
function _call_super(_this, derived, args) {
|
|
8
|
+
derived = _get_prototype_of(derived);
|
|
9
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
|
+
}
|
|
7
11
|
function _class_call_check(instance, Constructor) {
|
|
8
12
|
if (!(instance instanceof Constructor)) {
|
|
9
13
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -59,28 +63,12 @@ function _type_of(obj) {
|
|
|
59
63
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
60
64
|
}
|
|
61
65
|
function _is_native_reflect_construct() {
|
|
62
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
63
|
-
if (Reflect.construct.sham) return false;
|
|
64
|
-
if (typeof Proxy === "function") return true;
|
|
65
66
|
try {
|
|
66
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
function _create_super(Derived) {
|
|
73
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
74
|
-
return function _createSuperInternal() {
|
|
75
|
-
var Super = _get_prototype_of(Derived), result;
|
|
76
|
-
if (hasNativeReflectConstruct) {
|
|
77
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
78
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
79
|
-
} else {
|
|
80
|
-
result = Super.apply(this, arguments);
|
|
81
|
-
}
|
|
82
|
-
return _possible_constructor_return(this, result);
|
|
83
|
-
};
|
|
67
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
68
|
+
} catch (_) {}
|
|
69
|
+
return (_is_native_reflect_construct = function() {
|
|
70
|
+
return !!result;
|
|
71
|
+
})();
|
|
84
72
|
}
|
|
85
73
|
import { JSONCopy } from '@byteluck-fe/model-driven-shared';
|
|
86
74
|
import { Property, PropertyRules, PropertyRuntimeRules } from '../BaseControl';
|
|
@@ -91,44 +79,38 @@ import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
|
91
79
|
var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
92
80
|
"use strict";
|
|
93
81
|
_inherits(BaseControlPropertyRules, PropertyRules);
|
|
94
|
-
var _super = _create_super(BaseControlPropertyRules);
|
|
95
82
|
function BaseControlPropertyRules(props) {
|
|
96
83
|
_class_call_check(this, BaseControlPropertyRules);
|
|
97
84
|
var _this;
|
|
98
|
-
_this =
|
|
99
|
-
|
|
100
|
-
_define_property(
|
|
85
|
+
_this = _call_super(this, BaseControlPropertyRules, [
|
|
86
|
+
props
|
|
87
|
+
]), _define_property(_this, "dataBind", {}), _define_property(_this, "caption", {
|
|
101
88
|
type: 'string',
|
|
102
89
|
required: true,
|
|
103
90
|
message: getLocaleText('CMD.pleaseEnterCaption', null, '请输入标题')
|
|
104
|
-
})
|
|
105
|
-
_define_property(_assert_this_initialized(_this), "isHideCaption", {
|
|
91
|
+
}), _define_property(_this, "isHideCaption", {
|
|
106
92
|
type: 'boolean'
|
|
107
|
-
})
|
|
108
|
-
_define_property(_assert_this_initialized(_this), "labelPosition", {
|
|
93
|
+
}), _define_property(_this, "labelPosition", {
|
|
109
94
|
type: 'enum',
|
|
110
95
|
enum: [
|
|
111
96
|
'top',
|
|
112
97
|
'left'
|
|
113
98
|
]
|
|
114
|
-
})
|
|
115
|
-
// 去掉placeholder必填校验
|
|
99
|
+
}), // 去掉placeholder必填校验
|
|
116
100
|
// public placeholder: RuleItem = {
|
|
117
101
|
// required: true,
|
|
118
102
|
// type: 'string',
|
|
119
103
|
// message: getLocaleText('CMD.pleaseEnterPlaceholder',null,'请输入提示文字'),
|
|
120
104
|
// }
|
|
121
|
-
_define_property(
|
|
105
|
+
_define_property(_this, "defaultState", {
|
|
122
106
|
type: 'enum',
|
|
123
107
|
enum: [
|
|
124
108
|
'default',
|
|
125
109
|
'readonly'
|
|
126
110
|
]
|
|
127
|
-
})
|
|
128
|
-
_define_property(_assert_this_initialized(_this), "required", {
|
|
111
|
+
}), _define_property(_this, "required", {
|
|
129
112
|
type: 'boolean'
|
|
130
|
-
})
|
|
131
|
-
_define_property(_assert_this_initialized(_this), "captionTip", {
|
|
113
|
+
}), _define_property(_this, "captionTip", {
|
|
132
114
|
type: 'string',
|
|
133
115
|
required: false,
|
|
134
116
|
message: getLocaleText('CMD.pleaseEnterCaptionTip', null, '请输入气泡提示语')
|
|
@@ -162,6 +144,7 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
162
144
|
message: getLocaleText('CMD.pleaseEnterFieldCode', null, '请绑定数据项')
|
|
163
145
|
};
|
|
164
146
|
Object.keys(props.dataBind).forEach(function(key) {
|
|
147
|
+
;
|
|
165
148
|
dataBind.fields[key] = {
|
|
166
149
|
type: 'object',
|
|
167
150
|
required: true,
|
|
@@ -181,11 +164,12 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
181
164
|
var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRules) {
|
|
182
165
|
"use strict";
|
|
183
166
|
_inherits(BaseControlPropertyRuntimeRules, PropertyRuntimeRules);
|
|
184
|
-
var _super = _create_super(BaseControlPropertyRuntimeRules);
|
|
185
167
|
function BaseControlPropertyRuntimeRules(props) {
|
|
186
168
|
_class_call_check(this, BaseControlPropertyRuntimeRules);
|
|
187
169
|
var _this;
|
|
188
|
-
_this =
|
|
170
|
+
_this = _call_super(this, BaseControlPropertyRuntimeRules, [
|
|
171
|
+
props
|
|
172
|
+
]);
|
|
189
173
|
var isRequired = props.isHide ? false : props.required;
|
|
190
174
|
if (isRequired) {
|
|
191
175
|
_this.push({
|
|
@@ -206,63 +190,53 @@ var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRule
|
|
|
206
190
|
*/ var BaseControlProperty = /*#__PURE__*/ function(Property) {
|
|
207
191
|
"use strict";
|
|
208
192
|
_inherits(BaseControlProperty, Property);
|
|
209
|
-
var _super = _create_super(BaseControlProperty);
|
|
210
193
|
function BaseControlProperty(props) {
|
|
211
194
|
_class_call_check(this, BaseControlProperty);
|
|
212
195
|
var _this;
|
|
213
|
-
_this =
|
|
214
|
-
|
|
196
|
+
_this = _call_super(this, BaseControlProperty, [
|
|
197
|
+
props
|
|
198
|
+
]), /**
|
|
215
199
|
* 标题
|
|
216
200
|
* @defaultValue ''
|
|
217
201
|
* @public
|
|
218
|
-
*/ _define_property(
|
|
219
|
-
/**
|
|
202
|
+
*/ _define_property(_this, "caption", void 0), /**
|
|
220
203
|
* 隐藏标题
|
|
221
204
|
* @defaultValue false
|
|
222
205
|
* @public
|
|
223
|
-
*/ _define_property(
|
|
224
|
-
/**
|
|
206
|
+
*/ _define_property(_this, "isHideCaption", void 0), /**
|
|
225
207
|
* 显示气泡提示
|
|
226
208
|
* @defaultValue false
|
|
227
209
|
* @public
|
|
228
|
-
*/ _define_property(
|
|
229
|
-
/**
|
|
210
|
+
*/ _define_property(_this, "isShowCaptionTip", void 0), /**
|
|
230
211
|
* 气泡提示语
|
|
231
212
|
* @defaultValue ''
|
|
232
213
|
* @public
|
|
233
|
-
*/ _define_property(
|
|
234
|
-
/**
|
|
214
|
+
*/ _define_property(_this, "captionTip", void 0), /**
|
|
235
215
|
* 标题布局
|
|
236
216
|
* @defaultValue ''
|
|
237
217
|
* @public
|
|
238
|
-
*/ _define_property(
|
|
239
|
-
/**
|
|
218
|
+
*/ _define_property(_this, "labelPosition", void 0), /**
|
|
240
219
|
* 绑定数据项
|
|
241
220
|
* @public
|
|
242
|
-
*/ _define_property(
|
|
243
|
-
/**
|
|
221
|
+
*/ _define_property(_this, "dataBind", void 0), /**
|
|
244
222
|
* 默认值
|
|
245
223
|
* @public
|
|
246
|
-
*/ _define_property(
|
|
247
|
-
/**
|
|
224
|
+
*/ _define_property(_this, "defaultValue", void 0), /**
|
|
248
225
|
* 提示文字
|
|
249
226
|
* @defaultValue ''
|
|
250
227
|
* @public
|
|
251
|
-
*/ _define_property(
|
|
252
|
-
/**
|
|
228
|
+
*/ _define_property(_this, "placeholder", void 0), /**
|
|
253
229
|
* 默认状态
|
|
254
230
|
* @defaultValue 'default'
|
|
255
231
|
* @public
|
|
256
|
-
*/ _define_property(
|
|
257
|
-
/**
|
|
232
|
+
*/ _define_property(_this, "defaultState", void 0), /**
|
|
258
233
|
* 必填
|
|
259
234
|
* @defaultValue false
|
|
260
235
|
* @public
|
|
261
|
-
*/ _define_property(
|
|
262
|
-
/**
|
|
236
|
+
*/ _define_property(_this, "required", void 0), /**
|
|
263
237
|
* 必填提示文案
|
|
264
238
|
* @defaultValue ''
|
|
265
|
-
*/ _define_property(
|
|
239
|
+
*/ _define_property(_this, "requiredMessage", void 0);
|
|
266
240
|
var _props_caption;
|
|
267
241
|
_this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : '';
|
|
268
242
|
var _props_isHideCaption;
|
|
@@ -294,32 +268,30 @@ _define_property(BaseControlProperty, "RuntimeRules", BaseControlPropertyRuntime
|
|
|
294
268
|
var OptionAndDataSourcePropertyRules = /*#__PURE__*/ function(BaseControlPropertyRules) {
|
|
295
269
|
"use strict";
|
|
296
270
|
_inherits(OptionAndDataSourcePropertyRules, BaseControlPropertyRules);
|
|
297
|
-
var _super = _create_super(OptionAndDataSourcePropertyRules);
|
|
298
271
|
function OptionAndDataSourcePropertyRules(props) {
|
|
299
272
|
_class_call_check(this, OptionAndDataSourcePropertyRules);
|
|
300
273
|
var _this;
|
|
301
|
-
_this =
|
|
302
|
-
|
|
274
|
+
_this = _call_super(this, OptionAndDataSourcePropertyRules, [
|
|
275
|
+
props
|
|
276
|
+
]), _define_property(_this, "optionConfig", {
|
|
303
277
|
type: 'enum',
|
|
304
278
|
enum: [
|
|
305
279
|
'custom',
|
|
306
280
|
'datasource'
|
|
307
281
|
],
|
|
308
282
|
message: getLocaleText('CMD.PleaseSelectTheCorrectOptionSettings', null, '请选择正确的选项设置')
|
|
309
|
-
})
|
|
310
|
-
_define_property(_assert_this_initialized(_this), "options", [
|
|
283
|
+
}), _define_property(_this, "options", [
|
|
311
284
|
{
|
|
312
285
|
type: 'array',
|
|
313
286
|
message: getLocaleText('CMD.isNotArray', null, '请输入一个数组')
|
|
314
287
|
}
|
|
315
|
-
])
|
|
316
|
-
_define_property(_assert_this_initialized(_this), "datasourceBind", [
|
|
288
|
+
]), _define_property(_this, "datasourceBind", [
|
|
317
289
|
{
|
|
318
290
|
type: 'object',
|
|
319
291
|
message: getLocaleText('CMD.isNotObject', null, '请输入一个对象')
|
|
320
292
|
}
|
|
321
293
|
]);
|
|
322
|
-
initOptionAndDataSourceRules.call(
|
|
294
|
+
initOptionAndDataSourceRules.call(_this, props);
|
|
323
295
|
return _this;
|
|
324
296
|
}
|
|
325
297
|
return OptionAndDataSourcePropertyRules;
|