@byteluck-fe/model-driven-core 2.3.1-beta.2 → 2.3.1-beta.23
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/api-doc-index.js +4 -0
- package/dist/esm/common/BaseControl/designer.js +174 -68
- package/dist/esm/common/BaseControl/property.js +4 -4
- package/dist/esm/common/BaseControl/runtime.js +11 -11
- package/dist/esm/common/ColumnControl/property.js +16 -13
- package/dist/esm/common/ControlArray.js +4 -4
- package/dist/esm/common/FormControl/designer.js +1 -1
- package/dist/esm/common/FormControl/property.js +22 -22
- package/dist/esm/common/LayoutControl/designer.js +118 -18
- package/dist/esm/common/ListControl/designer.js +117 -17
- package/dist/esm/common/initOptionAndDataSourceRules.js +8 -8
- package/dist/esm/framework/index.js +279 -261
- package/dist/esm/index.js +0 -1
- package/dist/index.umd.js +1 -1
- package/dist/types/api-doc-index.d.ts +4 -0
- package/dist/types/common/ColumnControl/property.d.ts +39 -0
- package/dist/types/common/FormControl/property.d.ts +52 -0
- package/dist/types/common/Validator.d.ts +1 -1
- package/dist/types/common/controlHooksEmitter.d.ts +1 -1
- package/dist/types/framework/index.d.ts +172 -1
- package/dist/types/type.d.ts +23 -23
- package/package.json +3 -3
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export * from "./framework/index";
|
|
2
|
+
export { default as BaseControlProperty } from "./common/BaseControl/property";
|
|
3
|
+
export { default as ColumnControlProperty } from "./common/ColumnControl/property";
|
|
4
|
+
export { default as FormControlProperty } from "./common/FormControl/property";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _arrayLikeToArray(arr, len) {
|
|
2
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
-
for(var
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
4
|
return arr2;
|
|
5
5
|
}
|
|
6
6
|
function _arrayWithHoles(arr) {
|
|
@@ -44,8 +44,8 @@ function _classCallCheck(instance, Constructor) {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
function _defineProperties(target, props) {
|
|
47
|
-
for(var
|
|
48
|
-
var descriptor = props[
|
|
47
|
+
for(var i = 0; i < props.length; i++){
|
|
48
|
+
var descriptor = props[i];
|
|
49
49
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
50
50
|
descriptor.configurable = true;
|
|
51
51
|
if ("value" in descriptor) descriptor.writable = true;
|
|
@@ -87,8 +87,8 @@ function _nonIterableSpread() {
|
|
|
87
87
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
88
88
|
}
|
|
89
89
|
function _objectSpread(target) {
|
|
90
|
-
for(var
|
|
91
|
-
var source = arguments[
|
|
90
|
+
for(var i = 1; i < arguments.length; i++){
|
|
91
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
92
92
|
var ownKeys = Object.keys(source);
|
|
93
93
|
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
94
94
|
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
@@ -102,7 +102,7 @@ function _objectSpread(target) {
|
|
|
102
102
|
return target;
|
|
103
103
|
}
|
|
104
104
|
function _toArray(arr) {
|
|
105
|
-
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr
|
|
105
|
+
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
|
|
106
106
|
}
|
|
107
107
|
function _toConsumableArray(arr) {
|
|
108
108
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
@@ -115,7 +115,101 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
115
115
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
116
116
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
var __generator = this && this.__generator || function(thisArg, body) {
|
|
119
|
+
var f, y, t, g, _ = {
|
|
120
|
+
label: 0,
|
|
121
|
+
sent: function() {
|
|
122
|
+
if (t[0] & 1) throw t[1];
|
|
123
|
+
return t[1];
|
|
124
|
+
},
|
|
125
|
+
trys: [],
|
|
126
|
+
ops: []
|
|
127
|
+
};
|
|
128
|
+
return g = {
|
|
129
|
+
next: verb(0),
|
|
130
|
+
"throw": verb(1),
|
|
131
|
+
"return": verb(2)
|
|
132
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
133
|
+
return this;
|
|
134
|
+
}), g;
|
|
135
|
+
function verb(n) {
|
|
136
|
+
return function(v) {
|
|
137
|
+
return step([
|
|
138
|
+
n,
|
|
139
|
+
v
|
|
140
|
+
]);
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function step(op) {
|
|
144
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
145
|
+
while(_)try {
|
|
146
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
147
|
+
if (y = 0, t) op = [
|
|
148
|
+
op[0] & 2,
|
|
149
|
+
t.value
|
|
150
|
+
];
|
|
151
|
+
switch(op[0]){
|
|
152
|
+
case 0:
|
|
153
|
+
case 1:
|
|
154
|
+
t = op;
|
|
155
|
+
break;
|
|
156
|
+
case 4:
|
|
157
|
+
_.label++;
|
|
158
|
+
return {
|
|
159
|
+
value: op[1],
|
|
160
|
+
done: false
|
|
161
|
+
};
|
|
162
|
+
case 5:
|
|
163
|
+
_.label++;
|
|
164
|
+
y = op[1];
|
|
165
|
+
op = [
|
|
166
|
+
0
|
|
167
|
+
];
|
|
168
|
+
continue;
|
|
169
|
+
case 7:
|
|
170
|
+
op = _.ops.pop();
|
|
171
|
+
_.trys.pop();
|
|
172
|
+
continue;
|
|
173
|
+
default:
|
|
174
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
175
|
+
_ = 0;
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
179
|
+
_.label = op[1];
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
183
|
+
_.label = t[1];
|
|
184
|
+
t = op;
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
if (t && _.label < t[2]) {
|
|
188
|
+
_.label = t[2];
|
|
189
|
+
_.ops.push(op);
|
|
190
|
+
break;
|
|
191
|
+
}
|
|
192
|
+
if (t[2]) _.ops.pop();
|
|
193
|
+
_.trys.pop();
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
op = body.call(thisArg, _);
|
|
197
|
+
} catch (e) {
|
|
198
|
+
op = [
|
|
199
|
+
6,
|
|
200
|
+
e
|
|
201
|
+
];
|
|
202
|
+
y = 0;
|
|
203
|
+
} finally{
|
|
204
|
+
f = t = 0;
|
|
205
|
+
}
|
|
206
|
+
if (op[0] & 5) throw op[1];
|
|
207
|
+
return {
|
|
208
|
+
value: op[0] ? op[1] : void 0,
|
|
209
|
+
done: true
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
};
|
|
119
213
|
import Property from "./property";
|
|
120
214
|
import { genNonDuplicateId, JSONCopy, referenceError, updateValueFromKeys } from "@byteluck-fe/model-driven-shared";
|
|
121
215
|
import { createValidator } from "../Validator";
|
|
@@ -132,22 +226,22 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
132
226
|
this.updateSetting = updateSetting;
|
|
133
227
|
this.removeSetting = removeSetting;
|
|
134
228
|
this._callControlHooks("preInstance", props);
|
|
135
|
-
var
|
|
229
|
+
var _ref = _instanceof(this, Control) ? this.constructor : void 0, controlName = _ref.controlName, controlIcon = _ref.controlIcon, controlType = _ref.controlType, controlFieldType = _ref.controlFieldType, controlEventKeys = _ref.controlEventKeys, controlCustomEvents = _ref.controlCustomEvents, name = _ref.name, setting = _ref.setting;
|
|
136
230
|
if (!(controlName && controlIcon && controlType)) {
|
|
137
231
|
referenceError("The ".concat(name, " controlName,controlIcon,controlType is not define"));
|
|
138
232
|
}
|
|
139
|
-
var
|
|
140
|
-
this.id = (
|
|
233
|
+
var _props_id;
|
|
234
|
+
this.id = (_props_id = props === null || props === void 0 ? void 0 : props.id) !== null && _props_id !== void 0 ? _props_id : genNonDuplicateId(10);
|
|
141
235
|
this.name = controlName;
|
|
142
236
|
this.icon = controlIcon;
|
|
143
|
-
var
|
|
144
|
-
this.type = (
|
|
237
|
+
var _props_type;
|
|
238
|
+
this.type = (_props_type = props === null || props === void 0 ? void 0 : props.type) !== null && _props_type !== void 0 ? _props_type : controlType;
|
|
145
239
|
this.props = new Property(props === null || props === void 0 ? void 0 : props.props, (_instanceof(this, Control) ? this.constructor : void 0).controlName);
|
|
146
|
-
var
|
|
147
|
-
this.controlType = (
|
|
240
|
+
var _props_controlType;
|
|
241
|
+
this.controlType = (_props_controlType = props === null || props === void 0 ? void 0 : props.controlType) !== null && _props_controlType !== void 0 ? _props_controlType : "base";
|
|
148
242
|
this.setting = JSONCopy(setting);
|
|
149
|
-
var
|
|
150
|
-
this.fieldType = (
|
|
243
|
+
var _props_fieldType;
|
|
244
|
+
this.fieldType = (_props_fieldType = props === null || props === void 0 ? void 0 : props.fieldType) !== null && _props_fieldType !== void 0 ? _props_fieldType : controlFieldType;
|
|
151
245
|
this.eventKeys = JSONCopy(controlEventKeys);
|
|
152
246
|
this.customEvents = JSONCopy(controlCustomEvents);
|
|
153
247
|
Promise.resolve().then(function() {
|
|
@@ -182,37 +276,41 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
182
276
|
};
|
|
183
277
|
_proto.preValidate = function preValidate() {
|
|
184
278
|
var _this = this;
|
|
185
|
-
return _asyncToGenerator(
|
|
279
|
+
return _asyncToGenerator(function() {
|
|
186
280
|
var rules, results, result;
|
|
187
|
-
return
|
|
188
|
-
|
|
281
|
+
return __generator(this, function(_state) {
|
|
282
|
+
switch(_state.label){
|
|
189
283
|
case 0:
|
|
190
284
|
rules = _objectSpread({}, _this.rules);
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
285
|
+
return [
|
|
286
|
+
4,
|
|
287
|
+
_this._callControlHooks("preValidate", rules)
|
|
288
|
+
];
|
|
289
|
+
case 1:
|
|
290
|
+
results = _state.sent();
|
|
195
291
|
result = results[results.length - 1];
|
|
196
|
-
return
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
292
|
+
return [
|
|
293
|
+
2,
|
|
294
|
+
result === false ? undefined : result
|
|
295
|
+
];
|
|
200
296
|
}
|
|
201
|
-
}
|
|
202
|
-
})
|
|
297
|
+
});
|
|
298
|
+
})();
|
|
203
299
|
};
|
|
204
300
|
// property校验
|
|
205
301
|
_proto.validate = function validate(messages, ignore) {
|
|
206
302
|
var _this = this;
|
|
207
|
-
return _asyncToGenerator(
|
|
208
|
-
var result, rules, validator;
|
|
209
|
-
return
|
|
210
|
-
|
|
303
|
+
return _asyncToGenerator(function() {
|
|
304
|
+
var result, rules, validator, err;
|
|
305
|
+
return __generator(this, function(_state) {
|
|
306
|
+
switch(_state.label){
|
|
211
307
|
case 0:
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
308
|
+
return [
|
|
309
|
+
4,
|
|
310
|
+
_this.preValidate()
|
|
311
|
+
];
|
|
312
|
+
case 1:
|
|
313
|
+
result = _state.sent();
|
|
216
314
|
rules = result !== undefined ? result : _objectSpread({}, _this.rules);
|
|
217
315
|
if (Array.isArray(ignore)) {
|
|
218
316
|
ignore.forEach(function(key) {
|
|
@@ -222,36 +320,44 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
222
320
|
});
|
|
223
321
|
}
|
|
224
322
|
validator = createValidator(rules, messages);
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
323
|
+
_state.label = 2;
|
|
324
|
+
case 2:
|
|
325
|
+
_state.trys.push([
|
|
326
|
+
2,
|
|
327
|
+
4,
|
|
328
|
+
,
|
|
329
|
+
5
|
|
330
|
+
]);
|
|
331
|
+
return [
|
|
332
|
+
4,
|
|
333
|
+
validator.validate(_this.props)
|
|
334
|
+
];
|
|
335
|
+
case 3:
|
|
336
|
+
_state.sent();
|
|
337
|
+
return [
|
|
338
|
+
2,
|
|
339
|
+
true
|
|
340
|
+
];
|
|
341
|
+
case 4:
|
|
342
|
+
err = _state.sent();
|
|
343
|
+
if (!err.control) {
|
|
344
|
+
err.control = _this;
|
|
235
345
|
}
|
|
236
|
-
throw
|
|
237
|
-
case
|
|
238
|
-
|
|
239
|
-
|
|
346
|
+
throw err;
|
|
347
|
+
case 5:
|
|
348
|
+
return [
|
|
349
|
+
2
|
|
350
|
+
];
|
|
240
351
|
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
6,
|
|
244
|
-
12
|
|
245
|
-
]
|
|
246
|
-
]);
|
|
247
|
-
}))();
|
|
352
|
+
});
|
|
353
|
+
})();
|
|
248
354
|
};
|
|
249
355
|
_proto.toDataBindModel = function toDataBindModel() {
|
|
250
356
|
var parentId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
|
|
251
357
|
var fieldType = this.fieldType;
|
|
252
358
|
var controlId = this.id;
|
|
253
359
|
var type = this.type;
|
|
254
|
-
var
|
|
360
|
+
var _this_props = this.props, dataBind = _this_props.dataBind, datasourceBind = _this_props.datasourceBind, optionConfig = _this_props.optionConfig, caption = _this_props.caption, required = _this_props.required, maxLength = _this_props.maxLength, options = _this_props.options, encrypted = _this_props.encrypted, encryptedMode = _this_props.encryptedMode;
|
|
255
361
|
if (!fieldType && !dataBind && !datasourceBind) return;
|
|
256
362
|
var dataBindModelType = {
|
|
257
363
|
parentId: parentId,
|
|
@@ -306,8 +412,8 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
306
412
|
Control.updateBasicControl = function updateBasicControl(key, setting) {
|
|
307
413
|
if (key !== "setting") return;
|
|
308
414
|
if (setting.add) {
|
|
309
|
-
var
|
|
310
|
-
(
|
|
415
|
+
var _this_setting;
|
|
416
|
+
(_this_setting = this.setting).push.apply(_this_setting, _toConsumableArray(setting.add));
|
|
311
417
|
}
|
|
312
418
|
if (setting.remove) {
|
|
313
419
|
this.removeSettingItem(setting.remove);
|
|
@@ -363,13 +469,13 @@ export { Control as DesignerControl };
|
|
|
363
469
|
});
|
|
364
470
|
// 移除对应选项
|
|
365
471
|
if (settingIndex !== -1) {
|
|
366
|
-
var
|
|
367
|
-
isHasItem ? _this.setting[settingIndex].showItems = (
|
|
472
|
+
var _this_setting_settingIndex_showItems, _this_setting_settingIndex_showItems1;
|
|
473
|
+
isHasItem ? _this.setting[settingIndex].showItems = (_this_setting_settingIndex_showItems = _this.setting[settingIndex].showItems) === null || _this_setting_settingIndex_showItems === void 0 ? void 0 : _this_setting_settingIndex_showItems.filter(function(item) {
|
|
368
474
|
return !deleteKey.hideItems.includes(item);
|
|
369
475
|
}) : _this.setting.splice(settingIndex, 1);
|
|
370
476
|
// 子项长度为0,自动移除当前设置项
|
|
371
477
|
isHasItem && // @ts-ignore
|
|
372
|
-
!((
|
|
478
|
+
!((_this_setting_settingIndex_showItems1 = _this.setting[settingIndex].showItems) === null || _this_setting_settingIndex_showItems1 === void 0 ? void 0 : _this_setting_settingIndex_showItems1.length) && // @ts-ignore
|
|
373
479
|
_this.setting.splice(settingIndex, 1);
|
|
374
480
|
}
|
|
375
481
|
});
|
|
@@ -395,13 +501,13 @@ export { Control as DesignerControl };
|
|
|
395
501
|
if (typeof value === "boolean") {
|
|
396
502
|
settingItem.visible = value;
|
|
397
503
|
} else if (typeof value === "object") {
|
|
398
|
-
var
|
|
399
|
-
var type = (
|
|
504
|
+
var _value_type;
|
|
505
|
+
var type = (_value_type = value.type) !== null && _value_type !== void 0 ? _value_type : "replace";
|
|
400
506
|
if (type === "replace") {
|
|
401
507
|
settingItem.showItems = value.showItems;
|
|
402
508
|
} else {
|
|
403
|
-
var
|
|
404
|
-
(
|
|
509
|
+
var _settingItem_showItems;
|
|
510
|
+
(_settingItem_showItems = settingItem.showItems).push.apply(_settingItem_showItems, _toConsumableArray(value.showItems));
|
|
405
511
|
}
|
|
406
512
|
}
|
|
407
513
|
}
|
|
@@ -148,11 +148,11 @@ var Property = function Property(props) {
|
|
|
148
148
|
"use strict";
|
|
149
149
|
var caption = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
150
150
|
_classCallCheck(this, Property);
|
|
151
|
-
var
|
|
152
|
-
this.isHide = (
|
|
151
|
+
var _props_isHide;
|
|
152
|
+
this.isHide = (_props_isHide = props === null || props === void 0 ? void 0 : props.isHide) !== null && _props_isHide !== void 0 ? _props_isHide : false;
|
|
153
153
|
this.style = new BaseStyle(props === null || props === void 0 ? void 0 : props.style);
|
|
154
|
-
var
|
|
155
|
-
this.caption = (
|
|
154
|
+
var _props_caption;
|
|
155
|
+
this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : caption;
|
|
156
156
|
};
|
|
157
157
|
Property.Rules = PropertyRules;
|
|
158
158
|
Property.RuntimeRules = PropertyRuntimeRules;
|
|
@@ -33,22 +33,22 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
33
33
|
_classCallCheck(this, Control);
|
|
34
34
|
this.customEvents = [];
|
|
35
35
|
this.parent = null;
|
|
36
|
-
var
|
|
36
|
+
var _ref = _instanceof(this, Control) ? this.constructor : void 0, controlType = _ref.controlType, controlFieldType = _ref.controlFieldType, name = _ref.name, controlCustomEvents = _ref.controlCustomEvents;
|
|
37
37
|
if (!controlType) {
|
|
38
38
|
referenceError("The ".concat(name, " controlType is not define"));
|
|
39
39
|
}
|
|
40
|
-
var
|
|
41
|
-
this.id = (
|
|
42
|
-
var
|
|
43
|
-
this.type = (
|
|
40
|
+
var _props_id;
|
|
41
|
+
this.id = (_props_id = props === null || props === void 0 ? void 0 : props.id) !== null && _props_id !== void 0 ? _props_id : genNonDuplicateId(10);
|
|
42
|
+
var _props_type;
|
|
43
|
+
this.type = (_props_type = props === null || props === void 0 ? void 0 : props.type) !== null && _props_type !== void 0 ? _props_type : controlType;
|
|
44
44
|
this.props = new Property(props === null || props === void 0 ? void 0 : props.props);
|
|
45
45
|
this.customEvents = controlCustomEvents;
|
|
46
|
-
var
|
|
47
|
-
this.controlType = (
|
|
48
|
-
var
|
|
49
|
-
this.fieldType = (
|
|
50
|
-
var
|
|
51
|
-
this.pageStatus = (
|
|
46
|
+
var _props_controlType;
|
|
47
|
+
this.controlType = (_props_controlType = props === null || props === void 0 ? void 0 : props.controlType) !== null && _props_controlType !== void 0 ? _props_controlType : "base";
|
|
48
|
+
var _props_fieldType;
|
|
49
|
+
this.fieldType = (_props_fieldType = props === null || props === void 0 ? void 0 : props.fieldType) !== null && _props_fieldType !== void 0 ? _props_fieldType : controlFieldType;
|
|
50
|
+
var _props_pageStatus;
|
|
51
|
+
this.pageStatus = (_props_pageStatus = props === null || props === void 0 ? void 0 : props.pageStatus) !== null && _props_pageStatus !== void 0 ? _props_pageStatus : PAGE_STATUS.UNKNOWN;
|
|
52
52
|
}
|
|
53
53
|
_createClass(Control, [
|
|
54
54
|
{
|
|
@@ -96,7 +96,10 @@ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
96
96
|
}
|
|
97
97
|
return ColumnControlPropertyRules;
|
|
98
98
|
}(PropertyRules);
|
|
99
|
-
|
|
99
|
+
/**
|
|
100
|
+
* 列基本属性
|
|
101
|
+
* @public
|
|
102
|
+
*/ var ColumnControlProperty = /*#__PURE__*/ function(Property) {
|
|
100
103
|
"use strict";
|
|
101
104
|
_inherits(ColumnControlProperty, Property);
|
|
102
105
|
var _super = _createSuper(ColumnControlProperty);
|
|
@@ -104,21 +107,21 @@ var ColumnControlProperty = /*#__PURE__*/ function(Property) {
|
|
|
104
107
|
_classCallCheck(this, ColumnControlProperty);
|
|
105
108
|
var _this;
|
|
106
109
|
_this = _super.call(this, props);
|
|
107
|
-
var
|
|
108
|
-
_this.width = (
|
|
110
|
+
var _props_width;
|
|
111
|
+
_this.width = (_props_width = props === null || props === void 0 ? void 0 : props.width) !== null && _props_width !== void 0 ? _props_width : 150;
|
|
109
112
|
_this.widthType = (props === null || props === void 0 ? void 0 : props.widthType) || "auto";
|
|
110
|
-
var
|
|
111
|
-
_this.caption = (
|
|
112
|
-
var
|
|
113
|
-
_this.fixed = (
|
|
113
|
+
var _props_caption;
|
|
114
|
+
_this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : "";
|
|
115
|
+
var _props_fixed;
|
|
116
|
+
_this.fixed = (_props_fixed = props === null || props === void 0 ? void 0 : props.fixed) !== null && _props_fixed !== void 0 ? _props_fixed : "none";
|
|
114
117
|
_this.autoWidth = new AutoWidth(props === null || props === void 0 ? void 0 : props.autoWidth);
|
|
115
118
|
_this.dataBind = new DataBind(props === null || props === void 0 ? void 0 : props.dataBind);
|
|
116
|
-
var
|
|
117
|
-
_this.sort = (
|
|
119
|
+
var _props_sort;
|
|
120
|
+
_this.sort = (_props_sort = props === null || props === void 0 ? void 0 : props.sort) !== null && _props_sort !== void 0 ? _props_sort : true;
|
|
118
121
|
_this.align = props === null || props === void 0 ? void 0 : props.align;
|
|
119
122
|
_this.colSpan = props === null || props === void 0 ? void 0 : props.colSpan;
|
|
120
|
-
var
|
|
121
|
-
_this.autoHeight = (
|
|
123
|
+
var _props_autoHeight;
|
|
124
|
+
_this.autoHeight = (_props_autoHeight = props === null || props === void 0 ? void 0 : props.autoHeight) !== null && _props_autoHeight !== void 0 ? _props_autoHeight : false;
|
|
122
125
|
return _this;
|
|
123
126
|
}
|
|
124
127
|
return ColumnControlProperty;
|
|
@@ -145,13 +148,13 @@ var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnContro
|
|
|
145
148
|
{
|
|
146
149
|
type: "array",
|
|
147
150
|
message: RulesMessage.getMessage("isNotArray")
|
|
148
|
-
}
|
|
151
|
+
}
|
|
149
152
|
];
|
|
150
153
|
_this.datasourceBind = [
|
|
151
154
|
{
|
|
152
155
|
type: "object",
|
|
153
156
|
message: RulesMessage.getMessage("isNotObject")
|
|
154
|
-
}
|
|
157
|
+
}
|
|
155
158
|
];
|
|
156
159
|
initOptionAndDataSourceRules.call(_assertThisInitialized(_this), props);
|
|
157
160
|
return _this;
|
|
@@ -25,9 +25,9 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
25
25
|
}
|
|
26
26
|
import { isArray, isPlainObject } from "@byteluck-fe/model-driven-shared";
|
|
27
27
|
export function setPropertyDontEnum(obj, property) {
|
|
28
|
-
var
|
|
28
|
+
var _Object_getOwnPropertyDescriptors_property;
|
|
29
29
|
// 如果没有被设置过不允许枚举的话,说明是第一次被设置,需要设置属性不允许枚举
|
|
30
|
-
if ((
|
|
30
|
+
if ((_Object_getOwnPropertyDescriptors_property = Object.getOwnPropertyDescriptors(obj)[property]) === null || _Object_getOwnPropertyDescriptors_property === void 0 ? void 0 : _Object_getOwnPropertyDescriptors_property.enumerable) {
|
|
31
31
|
Object.defineProperty(obj, property, {
|
|
32
32
|
enumerable: false
|
|
33
33
|
});
|
|
@@ -45,8 +45,8 @@ export function defineArrayParent(controls, parent) {
|
|
|
45
45
|
}
|
|
46
46
|
var targetKey = Symbol("targetKey");
|
|
47
47
|
function getTargetValue(value) {
|
|
48
|
-
var
|
|
49
|
-
return (
|
|
48
|
+
var _value_targetKey;
|
|
49
|
+
return (_value_targetKey = value[targetKey]) !== null && _value_targetKey !== void 0 ? _value_targetKey : value;
|
|
50
50
|
}
|
|
51
51
|
function proxyState(target, parent) {
|
|
52
52
|
defineArrayParent(target, parent);
|
|
@@ -197,28 +197,28 @@ var BaseControlProperty = /*#__PURE__*/ function(Property) {
|
|
|
197
197
|
_classCallCheck(this, BaseControlProperty);
|
|
198
198
|
var _this;
|
|
199
199
|
_this = _super.call(this, props);
|
|
200
|
-
var
|
|
201
|
-
_this.caption = (
|
|
202
|
-
var
|
|
203
|
-
_this.isHideCaption = (
|
|
204
|
-
var
|
|
205
|
-
_this.isShowCaptionTip = (
|
|
206
|
-
var
|
|
207
|
-
_this.captionTip = (
|
|
208
|
-
var
|
|
209
|
-
_this.defaultState = (
|
|
210
|
-
var
|
|
211
|
-
_this.labelPosition = (
|
|
212
|
-
var
|
|
213
|
-
_this.placeholder = (
|
|
214
|
-
var
|
|
215
|
-
_this.required = (
|
|
216
|
-
var
|
|
217
|
-
_this.requiredMessage = (
|
|
200
|
+
var _props_caption;
|
|
201
|
+
_this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : "";
|
|
202
|
+
var _props_isHideCaption;
|
|
203
|
+
_this.isHideCaption = (_props_isHideCaption = props === null || props === void 0 ? void 0 : props.isHideCaption) !== null && _props_isHideCaption !== void 0 ? _props_isHideCaption : false;
|
|
204
|
+
var _props_isShowCaptionTip;
|
|
205
|
+
_this.isShowCaptionTip = (_props_isShowCaptionTip = props === null || props === void 0 ? void 0 : props.isShowCaptionTip) !== null && _props_isShowCaptionTip !== void 0 ? _props_isShowCaptionTip : false;
|
|
206
|
+
var _props_captionTip;
|
|
207
|
+
_this.captionTip = (_props_captionTip = props === null || props === void 0 ? void 0 : props.captionTip) !== null && _props_captionTip !== void 0 ? _props_captionTip : "";
|
|
208
|
+
var _props_defaultState;
|
|
209
|
+
_this.defaultState = (_props_defaultState = props === null || props === void 0 ? void 0 : props.defaultState) !== null && _props_defaultState !== void 0 ? _props_defaultState : "default";
|
|
210
|
+
var _props_labelPosition;
|
|
211
|
+
_this.labelPosition = (_props_labelPosition = props === null || props === void 0 ? void 0 : props.labelPosition) !== null && _props_labelPosition !== void 0 ? _props_labelPosition : "top";
|
|
212
|
+
var _props_placeholder;
|
|
213
|
+
_this.placeholder = (_props_placeholder = props === null || props === void 0 ? void 0 : props.placeholder) !== null && _props_placeholder !== void 0 ? _props_placeholder : "";
|
|
214
|
+
var _props_required;
|
|
215
|
+
_this.required = (_props_required = props === null || props === void 0 ? void 0 : props.required) !== null && _props_required !== void 0 ? _props_required : false;
|
|
216
|
+
var _props_requiredMessage;
|
|
217
|
+
_this.requiredMessage = (_props_requiredMessage = props === null || props === void 0 ? void 0 : props.requiredMessage) !== null && _props_requiredMessage !== void 0 ? _props_requiredMessage : "";
|
|
218
218
|
//form 组件优先初始化DataBind
|
|
219
219
|
_this.dataBind = new DataBind(props === null || props === void 0 ? void 0 : props.dataBind);
|
|
220
|
-
var
|
|
221
|
-
_this.defaultValue = (
|
|
220
|
+
var _props_defaultValue;
|
|
221
|
+
_this.defaultValue = (_props_defaultValue = props === null || props === void 0 ? void 0 : props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_defaultValue : "";
|
|
222
222
|
return _this;
|
|
223
223
|
}
|
|
224
224
|
return BaseControlProperty;
|
|
@@ -245,13 +245,13 @@ var OptionAndDataSourcePropertyRules = /*#__PURE__*/ function(BaseControlPropert
|
|
|
245
245
|
{
|
|
246
246
|
type: "array",
|
|
247
247
|
message: RulesMessage.getMessage("isNotArray")
|
|
248
|
-
}
|
|
248
|
+
}
|
|
249
249
|
];
|
|
250
250
|
_this.datasourceBind = [
|
|
251
251
|
{
|
|
252
252
|
type: "object",
|
|
253
253
|
message: RulesMessage.getMessage("isNotObject")
|
|
254
|
-
}
|
|
254
|
+
}
|
|
255
255
|
];
|
|
256
256
|
initOptionAndDataSourceRules.call(_assertThisInitialized(_this), props);
|
|
257
257
|
return _this;
|