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