@byteluck-fe/model-driven-core 2.7.0-alpha.28a → 2.7.0-alpha.31b
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/README.md +69 -69
- package/dist/esm/api-doc-index.js +4 -4
- package/dist/esm/common/BaseControl/designer.js +136 -257
- package/dist/esm/common/BaseControl/index.js +7 -7
- package/dist/esm/common/BaseControl/property.js +61 -80
- package/dist/esm/common/BaseControl/runtime.js +26 -48
- package/dist/esm/common/ColumnControl/designer.js +28 -43
- package/dist/esm/common/ColumnControl/index.js +6 -6
- package/dist/esm/common/ColumnControl/property.js +80 -129
- package/dist/esm/common/ColumnControl/runtime.js +28 -43
- package/dist/esm/common/ControlArray.js +21 -21
- package/dist/esm/common/FormControl/designer.js +33 -49
- package/dist/esm/common/FormControl/index.js +6 -6
- package/dist/esm/common/FormControl/property.js +119 -185
- package/dist/esm/common/FormControl/runtime.js +28 -44
- package/dist/esm/common/LayoutControl/designer.js +78 -207
- package/dist/esm/common/LayoutControl/index.js +6 -6
- package/dist/esm/common/LayoutControl/property.js +25 -25
- package/dist/esm/common/LayoutControl/runtime.js +30 -46
- package/dist/esm/common/ListControl/designer.js +76 -202
- package/dist/esm/common/ListControl/index.js +6 -6
- package/dist/esm/common/ListControl/property.js +28 -44
- package/dist/esm/common/ListControl/runtime.js +32 -48
- package/dist/esm/common/SearchViewControl/designer.js +28 -43
- package/dist/esm/common/SearchViewControl/index.js +6 -6
- package/dist/esm/common/SearchViewControl/property.js +27 -42
- package/dist/esm/common/SearchViewControl/runtime.js +28 -43
- package/dist/esm/common/Validator.js +5 -5
- package/dist/esm/common/WrapControl/designer.js +28 -43
- package/dist/esm/common/WrapControl/index.js +6 -6
- package/dist/esm/common/WrapControl/property.js +25 -25
- package/dist/esm/common/WrapControl/runtime.js +28 -43
- package/dist/esm/common/controlHooksEmitter.js +1 -1
- package/dist/esm/common/index.js +12 -12
- package/dist/esm/common/initLinkOperationRules.js +6 -6
- package/dist/esm/common/initOptionAndDataSourceRules.js +82 -82
- package/dist/esm/framework/RegisterControls.js +41 -37
- package/dist/esm/framework/index.js +515 -993
- package/dist/esm/framework/isDataBind.js +1 -2
- package/dist/esm/index.js +4 -4
- package/dist/index.umd.js +1 -1
- package/dist/types/api-doc-index.d.ts +4 -4
- package/dist/types/common/BaseControl/designer.d.ts +63 -63
- package/dist/types/common/BaseControl/index.d.ts +13 -13
- package/dist/types/common/BaseControl/property.d.ts +38 -38
- package/dist/types/common/BaseControl/runtime.d.ts +23 -23
- package/dist/types/common/BaseControl/types.d.ts +35 -35
- package/dist/types/common/ColumnControl/designer.d.ts +10 -10
- package/dist/types/common/ColumnControl/index.d.ts +12 -12
- package/dist/types/common/ColumnControl/property.d.ts +73 -73
- package/dist/types/common/ColumnControl/runtime.d.ts +10 -10
- package/dist/types/common/ControlArray.d.ts +9 -9
- package/dist/types/common/FormControl/designer.d.ts +13 -13
- package/dist/types/common/FormControl/index.d.ts +12 -12
- package/dist/types/common/FormControl/property.d.ts +100 -100
- package/dist/types/common/FormControl/runtime.d.ts +11 -11
- package/dist/types/common/LayoutControl/designer.d.ts +21 -21
- package/dist/types/common/LayoutControl/index.d.ts +12 -12
- package/dist/types/common/LayoutControl/property.d.ts +6 -6
- package/dist/types/common/LayoutControl/runtime.d.ts +11 -11
- package/dist/types/common/ListControl/designer.d.ts +16 -16
- package/dist/types/common/ListControl/index.d.ts +12 -12
- package/dist/types/common/ListControl/property.d.ts +14 -14
- package/dist/types/common/ListControl/runtime.d.ts +12 -12
- package/dist/types/common/SearchViewControl/designer.d.ts +11 -11
- package/dist/types/common/SearchViewControl/index.d.ts +12 -12
- package/dist/types/common/SearchViewControl/property.d.ts +8 -8
- package/dist/types/common/SearchViewControl/runtime.d.ts +11 -11
- package/dist/types/common/Validator.d.ts +15 -15
- package/dist/types/common/WrapControl/designer.d.ts +11 -11
- package/dist/types/common/WrapControl/index.d.ts +12 -12
- package/dist/types/common/WrapControl/property.d.ts +6 -6
- package/dist/types/common/WrapControl/runtime.d.ts +11 -11
- package/dist/types/common/controlHooksEmitter.d.ts +4 -4
- package/dist/types/common/index.d.ts +12 -12
- package/dist/types/common/initLinkOperationRules.d.ts +6 -6
- package/dist/types/common/initOptionAndDataSourceRules.d.ts +10 -10
- package/dist/types/framework/RegisterControls.d.ts +37 -36
- package/dist/types/framework/index.d.ts +844 -844
- package/dist/types/framework/isDataBind.d.ts +2 -2
- package/dist/types/index.d.ts +4 -4
- package/dist/types/type.d.ts +91 -91
- package/package.json +2 -2
|
@@ -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';
|
|
@@ -1,32 +1,19 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _assertThisInitialized(self) {
|
|
2
2
|
if (self === void 0) {
|
|
3
3
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
4
|
}
|
|
5
5
|
return self;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function _classCallCheck(instance, Constructor) {
|
|
8
8
|
if (!(instance instanceof Constructor)) {
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
Object.defineProperty(obj, key, {
|
|
15
|
-
value: value,
|
|
16
|
-
enumerable: true,
|
|
17
|
-
configurable: true,
|
|
18
|
-
writable: true
|
|
19
|
-
});
|
|
20
|
-
} else {
|
|
21
|
-
obj[key] = value;
|
|
22
|
-
}
|
|
23
|
-
return obj;
|
|
24
|
-
}
|
|
25
|
-
function _get_prototype_of(o) {
|
|
26
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
12
|
+
function _getPrototypeOf(o) {
|
|
13
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
27
14
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
28
15
|
};
|
|
29
|
-
return
|
|
16
|
+
return _getPrototypeOf(o);
|
|
30
17
|
}
|
|
31
18
|
function _inherits(subClass, superClass) {
|
|
32
19
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -39,26 +26,26 @@ function _inherits(subClass, superClass) {
|
|
|
39
26
|
configurable: true
|
|
40
27
|
}
|
|
41
28
|
});
|
|
42
|
-
if (superClass)
|
|
29
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
43
30
|
}
|
|
44
|
-
function
|
|
45
|
-
if (call && (
|
|
31
|
+
function _possibleConstructorReturn(self, call) {
|
|
32
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
46
33
|
return call;
|
|
47
34
|
}
|
|
48
|
-
return
|
|
35
|
+
return _assertThisInitialized(self);
|
|
49
36
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
37
|
+
function _setPrototypeOf(o, p) {
|
|
38
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
52
39
|
o.__proto__ = p;
|
|
53
40
|
return o;
|
|
54
41
|
};
|
|
55
|
-
return
|
|
42
|
+
return _setPrototypeOf(o, p);
|
|
56
43
|
}
|
|
57
|
-
function
|
|
44
|
+
var _typeof = function(obj) {
|
|
58
45
|
"@swc/helpers - typeof";
|
|
59
46
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
60
|
-
}
|
|
61
|
-
function
|
|
47
|
+
};
|
|
48
|
+
function _isNativeReflectConstruct() {
|
|
62
49
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
63
50
|
if (Reflect.construct.sham) return false;
|
|
64
51
|
if (typeof Proxy === "function") return true;
|
|
@@ -69,103 +56,103 @@ function _is_native_reflect_construct() {
|
|
|
69
56
|
return false;
|
|
70
57
|
}
|
|
71
58
|
}
|
|
72
|
-
function
|
|
73
|
-
var hasNativeReflectConstruct =
|
|
59
|
+
function _createSuper(Derived) {
|
|
60
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
74
61
|
return function _createSuperInternal() {
|
|
75
|
-
var Super =
|
|
62
|
+
var Super = _getPrototypeOf(Derived), result;
|
|
76
63
|
if (hasNativeReflectConstruct) {
|
|
77
|
-
var NewTarget =
|
|
64
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
78
65
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
79
66
|
} else {
|
|
80
67
|
result = Super.apply(this, arguments);
|
|
81
68
|
}
|
|
82
|
-
return
|
|
69
|
+
return _possibleConstructorReturn(this, result);
|
|
83
70
|
};
|
|
84
71
|
}
|
|
85
|
-
import { RulesMessage, JSONCopy } from
|
|
86
|
-
import { Property, PropertyRules, PropertyRuntimeRules } from
|
|
87
|
-
import { initOptionAndDataSourceRules } from
|
|
88
|
-
import { DataBind } from
|
|
89
|
-
import { isDataBind } from
|
|
90
|
-
var BaseControlPropertyRules = /*#__PURE__*/ function(
|
|
72
|
+
import { RulesMessage, JSONCopy } from '@byteluck-fe/model-driven-shared';
|
|
73
|
+
import { Property, PropertyRules, PropertyRuntimeRules } from '../BaseControl';
|
|
74
|
+
import { initOptionAndDataSourceRules } from '../initOptionAndDataSourceRules';
|
|
75
|
+
import { DataBind } from '../../framework';
|
|
76
|
+
import { isDataBind } from '../../framework/isDataBind';
|
|
77
|
+
var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules1) {
|
|
91
78
|
"use strict";
|
|
92
|
-
_inherits(BaseControlPropertyRules,
|
|
93
|
-
var _super =
|
|
79
|
+
_inherits(BaseControlPropertyRules, PropertyRules1);
|
|
80
|
+
var _super = _createSuper(BaseControlPropertyRules);
|
|
94
81
|
function BaseControlPropertyRules(props) {
|
|
95
|
-
|
|
82
|
+
_classCallCheck(this, BaseControlPropertyRules);
|
|
96
83
|
var _this;
|
|
97
84
|
_this = _super.call(this, props);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
type:
|
|
85
|
+
_this.dataBind = {};
|
|
86
|
+
_this.caption = {
|
|
87
|
+
type: 'string',
|
|
101
88
|
required: true,
|
|
102
|
-
message: RulesMessage.getMessage(
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
type:
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
type:
|
|
89
|
+
message: RulesMessage.getMessage('pleaseEnterCaption')
|
|
90
|
+
};
|
|
91
|
+
_this.isHideCaption = {
|
|
92
|
+
type: 'boolean'
|
|
93
|
+
};
|
|
94
|
+
_this.labelPosition = {
|
|
95
|
+
type: 'enum',
|
|
109
96
|
enum: [
|
|
110
|
-
|
|
111
|
-
|
|
97
|
+
'top',
|
|
98
|
+
'left'
|
|
112
99
|
]
|
|
113
|
-
}
|
|
100
|
+
};
|
|
114
101
|
// 去掉placeholder必填校验
|
|
115
102
|
// public placeholder: RuleItem = {
|
|
116
103
|
// required: true,
|
|
117
104
|
// type: 'string',
|
|
118
105
|
// message: RulesMessage.getMessage('pleaseEnterPlaceholder'),
|
|
119
106
|
// }
|
|
120
|
-
|
|
121
|
-
type:
|
|
107
|
+
_this.defaultState = {
|
|
108
|
+
type: 'enum',
|
|
122
109
|
enum: [
|
|
123
|
-
|
|
124
|
-
|
|
110
|
+
'default',
|
|
111
|
+
'readonly'
|
|
125
112
|
]
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
type:
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
type:
|
|
113
|
+
};
|
|
114
|
+
_this.required = {
|
|
115
|
+
type: 'boolean'
|
|
116
|
+
};
|
|
117
|
+
_this.captionTip = {
|
|
118
|
+
type: 'string',
|
|
132
119
|
required: false,
|
|
133
|
-
message: RulesMessage.getMessage(
|
|
134
|
-
}
|
|
120
|
+
message: RulesMessage.getMessage('pleaseEnterCaptionTip')
|
|
121
|
+
};
|
|
135
122
|
// 初始化dataBind的校验规则
|
|
136
123
|
var validateFields = {
|
|
137
124
|
fieldCode: {
|
|
138
|
-
type:
|
|
125
|
+
type: 'string',
|
|
139
126
|
required: true,
|
|
140
|
-
message: RulesMessage.getMessage(
|
|
127
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
141
128
|
},
|
|
142
129
|
dataCode: {
|
|
143
|
-
type:
|
|
130
|
+
type: 'string',
|
|
144
131
|
required: true,
|
|
145
|
-
message: RulesMessage.getMessage(
|
|
132
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
146
133
|
}
|
|
147
134
|
};
|
|
148
135
|
// if (props.dataBind instanceof DataBind) {
|
|
149
136
|
if (isDataBind(props.dataBind)) {
|
|
150
137
|
_this.dataBind = {
|
|
151
|
-
type:
|
|
138
|
+
type: 'object',
|
|
152
139
|
required: true,
|
|
153
140
|
fields: JSONCopy(validateFields),
|
|
154
|
-
message: RulesMessage.getMessage(
|
|
141
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
155
142
|
};
|
|
156
143
|
} else {
|
|
157
144
|
var dataBind = {
|
|
158
|
-
type:
|
|
145
|
+
type: 'object',
|
|
159
146
|
required: true,
|
|
160
147
|
fields: {},
|
|
161
|
-
message: RulesMessage.getMessage(
|
|
148
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
162
149
|
};
|
|
163
150
|
Object.keys(props.dataBind).forEach(function(key) {
|
|
164
151
|
dataBind.fields[key] = {
|
|
165
|
-
type:
|
|
152
|
+
type: 'object',
|
|
166
153
|
required: true,
|
|
167
154
|
fields: JSONCopy(validateFields),
|
|
168
|
-
message: RulesMessage.getMessage(
|
|
155
|
+
message: RulesMessage.getMessage('pleaseEnterFieldCode')
|
|
169
156
|
};
|
|
170
157
|
});
|
|
171
158
|
_this.dataBind = dataBind;
|
|
@@ -177,20 +164,20 @@ var BaseControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
177
164
|
}
|
|
178
165
|
return BaseControlPropertyRules;
|
|
179
166
|
}(PropertyRules);
|
|
180
|
-
var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(
|
|
167
|
+
var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRules1) {
|
|
181
168
|
"use strict";
|
|
182
|
-
_inherits(BaseControlPropertyRuntimeRules,
|
|
183
|
-
var _super =
|
|
169
|
+
_inherits(BaseControlPropertyRuntimeRules, PropertyRuntimeRules1);
|
|
170
|
+
var _super = _createSuper(BaseControlPropertyRuntimeRules);
|
|
184
171
|
function BaseControlPropertyRuntimeRules(props) {
|
|
185
|
-
|
|
172
|
+
_classCallCheck(this, BaseControlPropertyRuntimeRules);
|
|
186
173
|
var _this;
|
|
187
174
|
_this = _super.call(this, props);
|
|
188
175
|
var isRequired = props.isHide ? false : props.required;
|
|
189
176
|
if (isRequired) {
|
|
190
177
|
_this.push({
|
|
191
|
-
type:
|
|
178
|
+
type: 'string',
|
|
192
179
|
required: isRequired,
|
|
193
|
-
message: props.requiredMessage !==
|
|
180
|
+
message: props.requiredMessage !== '' ? props.requiredMessage : RulesMessage.getMessage('runtimeRequired', {
|
|
194
181
|
caption: props.caption
|
|
195
182
|
})
|
|
196
183
|
});
|
|
@@ -199,127 +186,74 @@ var BaseControlPropertyRuntimeRules = /*#__PURE__*/ function(PropertyRuntimeRule
|
|
|
199
186
|
}
|
|
200
187
|
return BaseControlPropertyRuntimeRules;
|
|
201
188
|
}(PropertyRuntimeRules);
|
|
202
|
-
/**
|
|
203
|
-
* 表单控件公共属性
|
|
204
|
-
* @public
|
|
205
|
-
*/
|
|
189
|
+
var BaseControlProperty = /**
|
|
190
|
+
* 表单控件公共属性
|
|
191
|
+
* @public
|
|
192
|
+
*/ /*#__PURE__*/ function(Property1) {
|
|
206
193
|
"use strict";
|
|
207
|
-
_inherits(BaseControlProperty,
|
|
208
|
-
var _super =
|
|
194
|
+
_inherits(BaseControlProperty, Property1);
|
|
195
|
+
var _super = _createSuper(BaseControlProperty);
|
|
209
196
|
function BaseControlProperty(props) {
|
|
210
|
-
|
|
197
|
+
_classCallCheck(this, BaseControlProperty);
|
|
211
198
|
var _this;
|
|
212
|
-
var _props, _props1, _props2, _props3, _props4, _props5, _props6, _props7, _props8, _props9, _props10;
|
|
213
199
|
_this = _super.call(this, props);
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
* @public
|
|
233
|
-
*/ _define_property(_assert_this_initialized(_this), "captionTip", void 0);
|
|
234
|
-
/**
|
|
235
|
-
* 标题布局
|
|
236
|
-
* @defaultValue ''
|
|
237
|
-
* @public
|
|
238
|
-
*/ _define_property(_assert_this_initialized(_this), "labelPosition", void 0);
|
|
239
|
-
/**
|
|
240
|
-
* 绑定数据项
|
|
241
|
-
* @public
|
|
242
|
-
*/ _define_property(_assert_this_initialized(_this), "dataBind", void 0);
|
|
243
|
-
/**
|
|
244
|
-
* 默认值
|
|
245
|
-
* @public
|
|
246
|
-
*/ _define_property(_assert_this_initialized(_this), "defaultValue", void 0);
|
|
247
|
-
/**
|
|
248
|
-
* 提示文字
|
|
249
|
-
* @defaultValue ''
|
|
250
|
-
* @public
|
|
251
|
-
*/ _define_property(_assert_this_initialized(_this), "placeholder", void 0);
|
|
252
|
-
/**
|
|
253
|
-
* 默认状态
|
|
254
|
-
* @defaultValue 'default'
|
|
255
|
-
* @public
|
|
256
|
-
*/ _define_property(_assert_this_initialized(_this), "defaultState", void 0);
|
|
257
|
-
/**
|
|
258
|
-
* 必填
|
|
259
|
-
* @defaultValue false
|
|
260
|
-
* @public
|
|
261
|
-
*/ _define_property(_assert_this_initialized(_this), "required", void 0);
|
|
262
|
-
/**
|
|
263
|
-
* 必填提示文案
|
|
264
|
-
* @defaultValue ''
|
|
265
|
-
*/ _define_property(_assert_this_initialized(_this), "requiredMessage", void 0);
|
|
266
|
-
var _props_caption;
|
|
267
|
-
_this.caption = (_props_caption = (_props = props) === null || _props === void 0 ? void 0 : _props.caption) !== null && _props_caption !== void 0 ? _props_caption : "";
|
|
268
|
-
var _props_isHideCaption;
|
|
269
|
-
_this.isHideCaption = (_props_isHideCaption = (_props1 = props) === null || _props1 === void 0 ? void 0 : _props1.isHideCaption) !== null && _props_isHideCaption !== void 0 ? _props_isHideCaption : false;
|
|
270
|
-
var _props_isShowCaptionTip;
|
|
271
|
-
_this.isShowCaptionTip = (_props_isShowCaptionTip = (_props2 = props) === null || _props2 === void 0 ? void 0 : _props2.isShowCaptionTip) !== null && _props_isShowCaptionTip !== void 0 ? _props_isShowCaptionTip : false;
|
|
272
|
-
var _props_captionTip;
|
|
273
|
-
_this.captionTip = (_props_captionTip = (_props3 = props) === null || _props3 === void 0 ? void 0 : _props3.captionTip) !== null && _props_captionTip !== void 0 ? _props_captionTip : "";
|
|
274
|
-
var _props_defaultState;
|
|
275
|
-
_this.defaultState = (_props_defaultState = (_props4 = props) === null || _props4 === void 0 ? void 0 : _props4.defaultState) !== null && _props_defaultState !== void 0 ? _props_defaultState : "default";
|
|
276
|
-
var _props_labelPosition;
|
|
277
|
-
_this.labelPosition = (_props_labelPosition = (_props5 = props) === null || _props5 === void 0 ? void 0 : _props5.labelPosition) !== null && _props_labelPosition !== void 0 ? _props_labelPosition : "top";
|
|
278
|
-
var _props_placeholder;
|
|
279
|
-
_this.placeholder = (_props_placeholder = (_props6 = props) === null || _props6 === void 0 ? void 0 : _props6.placeholder) !== null && _props_placeholder !== void 0 ? _props_placeholder : "";
|
|
280
|
-
var _props_required;
|
|
281
|
-
_this.required = (_props_required = (_props7 = props) === null || _props7 === void 0 ? void 0 : _props7.required) !== null && _props_required !== void 0 ? _props_required : false;
|
|
282
|
-
var _props_requiredMessage;
|
|
283
|
-
_this.requiredMessage = (_props_requiredMessage = (_props8 = props) === null || _props8 === void 0 ? void 0 : _props8.requiredMessage) !== null && _props_requiredMessage !== void 0 ? _props_requiredMessage : "";
|
|
200
|
+
var ref;
|
|
201
|
+
_this.caption = (ref = props === null || props === void 0 ? void 0 : props.caption) !== null && ref !== void 0 ? ref : '';
|
|
202
|
+
var ref1;
|
|
203
|
+
_this.isHideCaption = (ref1 = props === null || props === void 0 ? void 0 : props.isHideCaption) !== null && ref1 !== void 0 ? ref1 : false;
|
|
204
|
+
var ref2;
|
|
205
|
+
_this.isShowCaptionTip = (ref2 = props === null || props === void 0 ? void 0 : props.isShowCaptionTip) !== null && ref2 !== void 0 ? ref2 : false;
|
|
206
|
+
var ref3;
|
|
207
|
+
_this.captionTip = (ref3 = props === null || props === void 0 ? void 0 : props.captionTip) !== null && ref3 !== void 0 ? ref3 : '';
|
|
208
|
+
var ref4;
|
|
209
|
+
_this.defaultState = (ref4 = props === null || props === void 0 ? void 0 : props.defaultState) !== null && ref4 !== void 0 ? ref4 : 'default';
|
|
210
|
+
var ref5;
|
|
211
|
+
_this.labelPosition = (ref5 = props === null || props === void 0 ? void 0 : props.labelPosition) !== null && ref5 !== void 0 ? ref5 : 'top';
|
|
212
|
+
var ref6;
|
|
213
|
+
_this.placeholder = (ref6 = props === null || props === void 0 ? void 0 : props.placeholder) !== null && ref6 !== void 0 ? ref6 : '';
|
|
214
|
+
var ref7;
|
|
215
|
+
_this.required = (ref7 = props === null || props === void 0 ? void 0 : props.required) !== null && ref7 !== void 0 ? ref7 : false;
|
|
216
|
+
var ref8;
|
|
217
|
+
_this.requiredMessage = (ref8 = props === null || props === void 0 ? void 0 : props.requiredMessage) !== null && ref8 !== void 0 ? ref8 : '';
|
|
284
218
|
//form 组件优先初始化DataBind
|
|
285
|
-
_this.dataBind = new DataBind(
|
|
286
|
-
var
|
|
287
|
-
_this.defaultValue = (
|
|
219
|
+
_this.dataBind = new DataBind(props === null || props === void 0 ? void 0 : props.dataBind);
|
|
220
|
+
var ref9;
|
|
221
|
+
_this.defaultValue = (ref9 = props === null || props === void 0 ? void 0 : props.defaultValue) !== null && ref9 !== void 0 ? ref9 : '';
|
|
288
222
|
return _this;
|
|
289
223
|
}
|
|
290
224
|
return BaseControlProperty;
|
|
291
225
|
}(Property);
|
|
292
|
-
|
|
293
|
-
|
|
226
|
+
BaseControlProperty.Rules = BaseControlPropertyRules;
|
|
227
|
+
BaseControlProperty.RuntimeRules = BaseControlPropertyRuntimeRules;
|
|
294
228
|
var OptionAndDataSourcePropertyRules = /*#__PURE__*/ function(BaseControlPropertyRules) {
|
|
295
229
|
"use strict";
|
|
296
230
|
_inherits(OptionAndDataSourcePropertyRules, BaseControlPropertyRules);
|
|
297
|
-
var _super =
|
|
231
|
+
var _super = _createSuper(OptionAndDataSourcePropertyRules);
|
|
298
232
|
function OptionAndDataSourcePropertyRules(props) {
|
|
299
|
-
|
|
233
|
+
_classCallCheck(this, OptionAndDataSourcePropertyRules);
|
|
300
234
|
var _this;
|
|
301
235
|
_this = _super.call(this, props);
|
|
302
|
-
|
|
303
|
-
type:
|
|
236
|
+
_this.optionConfig = {
|
|
237
|
+
type: 'enum',
|
|
304
238
|
enum: [
|
|
305
|
-
|
|
306
|
-
|
|
239
|
+
'custom',
|
|
240
|
+
'datasource'
|
|
307
241
|
],
|
|
308
|
-
message: RulesMessage.getMessage(
|
|
309
|
-
}
|
|
310
|
-
|
|
242
|
+
message: RulesMessage.getMessage('PleaseSelectTheCorrectOptionSettings')
|
|
243
|
+
};
|
|
244
|
+
_this.options = [
|
|
311
245
|
{
|
|
312
|
-
type:
|
|
313
|
-
message: RulesMessage.getMessage(
|
|
314
|
-
}
|
|
315
|
-
]
|
|
316
|
-
|
|
246
|
+
type: 'array',
|
|
247
|
+
message: RulesMessage.getMessage('isNotArray')
|
|
248
|
+
},
|
|
249
|
+
];
|
|
250
|
+
_this.datasourceBind = [
|
|
317
251
|
{
|
|
318
|
-
type:
|
|
319
|
-
message: RulesMessage.getMessage(
|
|
320
|
-
}
|
|
321
|
-
]
|
|
322
|
-
initOptionAndDataSourceRules.call(
|
|
252
|
+
type: 'object',
|
|
253
|
+
message: RulesMessage.getMessage('isNotObject')
|
|
254
|
+
},
|
|
255
|
+
];
|
|
256
|
+
initOptionAndDataSourceRules.call(_assertThisInitialized(_this), props);
|
|
323
257
|
return _this;
|
|
324
258
|
}
|
|
325
259
|
return OptionAndDataSourcePropertyRules;
|
|
@@ -1,32 +1,19 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _assertThisInitialized(self) {
|
|
2
2
|
if (self === void 0) {
|
|
3
3
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
4
|
}
|
|
5
5
|
return self;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function _classCallCheck(instance, Constructor) {
|
|
8
8
|
if (!(instance instanceof Constructor)) {
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
Object.defineProperty(obj, key, {
|
|
15
|
-
value: value,
|
|
16
|
-
enumerable: true,
|
|
17
|
-
configurable: true,
|
|
18
|
-
writable: true
|
|
19
|
-
});
|
|
20
|
-
} else {
|
|
21
|
-
obj[key] = value;
|
|
22
|
-
}
|
|
23
|
-
return obj;
|
|
24
|
-
}
|
|
25
|
-
function _get_prototype_of(o) {
|
|
26
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
12
|
+
function _getPrototypeOf(o) {
|
|
13
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
27
14
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
28
15
|
};
|
|
29
|
-
return
|
|
16
|
+
return _getPrototypeOf(o);
|
|
30
17
|
}
|
|
31
18
|
function _inherits(subClass, superClass) {
|
|
32
19
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -39,26 +26,26 @@ function _inherits(subClass, superClass) {
|
|
|
39
26
|
configurable: true
|
|
40
27
|
}
|
|
41
28
|
});
|
|
42
|
-
if (superClass)
|
|
29
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
43
30
|
}
|
|
44
|
-
function
|
|
45
|
-
if (call && (
|
|
31
|
+
function _possibleConstructorReturn(self, call) {
|
|
32
|
+
if (call && (_typeof(call) === "object" || typeof call === "function")) {
|
|
46
33
|
return call;
|
|
47
34
|
}
|
|
48
|
-
return
|
|
35
|
+
return _assertThisInitialized(self);
|
|
49
36
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
37
|
+
function _setPrototypeOf(o, p) {
|
|
38
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
52
39
|
o.__proto__ = p;
|
|
53
40
|
return o;
|
|
54
41
|
};
|
|
55
|
-
return
|
|
42
|
+
return _setPrototypeOf(o, p);
|
|
56
43
|
}
|
|
57
|
-
function
|
|
44
|
+
var _typeof = function(obj) {
|
|
58
45
|
"@swc/helpers - typeof";
|
|
59
46
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
60
|
-
}
|
|
61
|
-
function
|
|
47
|
+
};
|
|
48
|
+
function _isNativeReflectConstruct() {
|
|
62
49
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
63
50
|
if (Reflect.construct.sham) return false;
|
|
64
51
|
if (typeof Proxy === "function") return true;
|
|
@@ -69,34 +56,31 @@ function _is_native_reflect_construct() {
|
|
|
69
56
|
return false;
|
|
70
57
|
}
|
|
71
58
|
}
|
|
72
|
-
function
|
|
73
|
-
var hasNativeReflectConstruct =
|
|
59
|
+
function _createSuper(Derived) {
|
|
60
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
74
61
|
return function _createSuperInternal() {
|
|
75
|
-
var Super =
|
|
62
|
+
var Super = _getPrototypeOf(Derived), result;
|
|
76
63
|
if (hasNativeReflectConstruct) {
|
|
77
|
-
var NewTarget =
|
|
64
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
78
65
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
79
66
|
} else {
|
|
80
67
|
result = Super.apply(this, arguments);
|
|
81
68
|
}
|
|
82
|
-
return
|
|
69
|
+
return _possibleConstructorReturn(this, result);
|
|
83
70
|
};
|
|
84
71
|
}
|
|
85
|
-
import { RuntimeControl } from
|
|
86
|
-
import BaseControlProperty from
|
|
87
|
-
var FormControl = /*#__PURE__*/ function(
|
|
72
|
+
import { RuntimeControl } from '../BaseControl';
|
|
73
|
+
import BaseControlProperty from './property';
|
|
74
|
+
var FormControl = /*#__PURE__*/ function(RuntimeControl1) {
|
|
88
75
|
"use strict";
|
|
89
|
-
_inherits(FormControl,
|
|
90
|
-
var _super =
|
|
76
|
+
_inherits(FormControl, RuntimeControl1);
|
|
77
|
+
var _super = _createSuper(FormControl);
|
|
91
78
|
function FormControl(props) {
|
|
92
|
-
|
|
79
|
+
_classCallCheck(this, FormControl);
|
|
93
80
|
var _this;
|
|
94
|
-
var _props;
|
|
95
81
|
_this = _super.call(this, props);
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
_define_property(_assert_this_initialized(_this), "value", void 0);
|
|
99
|
-
_this.props = new BaseControlProperty((_props = props) === null || _props === void 0 ? void 0 : _props.props);
|
|
82
|
+
_this.controlType = 'form';
|
|
83
|
+
_this.props = new BaseControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
100
84
|
return _this;
|
|
101
85
|
}
|
|
102
86
|
return FormControl;
|