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