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