@byteluck-fe/model-driven-core 2.2.2-beta.8 → 2.3.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/common/BaseControl/designer.js +68 -174
- 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 +12 -12
- 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 +18 -118
- package/dist/esm/common/ListControl/designer.js +17 -117
- package/dist/esm/common/initOptionAndDataSourceRules.js +8 -8
- package/dist/esm/framework/index.js +251 -249
- package/dist/index.umd.js +1 -1
- package/dist/types/common/ColumnControl/property.d.ts +1 -1
- 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 +1 -0
- package/dist/types/type.d.ts +23 -23
- package/package.json +3 -3
|
@@ -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 i1 = 0, arr2 = new Array(len); i1 < len; i1++)arr2[i1] = arr[i1];
|
|
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 i1 = 0; i1 < props.length; i1++){
|
|
48
|
+
var descriptor = props[i1];
|
|
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 i1 = 1; i1 < arguments.length; i1++){
|
|
91
|
+
var source = arguments[i1] != null ? arguments[i1] : {};
|
|
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) || _nonIterableRest();
|
|
105
|
+
return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
106
106
|
}
|
|
107
107
|
function _toConsumableArray(arr) {
|
|
108
108
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
@@ -115,101 +115,7 @@ 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
|
-
|
|
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
|
-
};
|
|
118
|
+
import regeneratorRuntime from "regenerator-runtime";
|
|
213
119
|
import Property from "./property";
|
|
214
120
|
import { genNonDuplicateId, JSONCopy, referenceError, updateValueFromKeys } from "@byteluck-fe/model-driven-shared";
|
|
215
121
|
import { createValidator } from "../Validator";
|
|
@@ -226,22 +132,22 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
226
132
|
this.updateSetting = updateSetting;
|
|
227
133
|
this.removeSetting = removeSetting;
|
|
228
134
|
this._callControlHooks("preInstance", props);
|
|
229
|
-
var
|
|
135
|
+
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;
|
|
230
136
|
if (!(controlName && controlIcon && controlType)) {
|
|
231
137
|
referenceError("The ".concat(name, " controlName,controlIcon,controlType is not define"));
|
|
232
138
|
}
|
|
233
|
-
var
|
|
234
|
-
this.id = (
|
|
139
|
+
var ref1;
|
|
140
|
+
this.id = (ref1 = props === null || props === void 0 ? void 0 : props.id) !== null && ref1 !== void 0 ? ref1 : genNonDuplicateId(10);
|
|
235
141
|
this.name = controlName;
|
|
236
142
|
this.icon = controlIcon;
|
|
237
|
-
var
|
|
238
|
-
this.type = (
|
|
143
|
+
var ref2;
|
|
144
|
+
this.type = (ref2 = props === null || props === void 0 ? void 0 : props.type) !== null && ref2 !== void 0 ? ref2 : controlType;
|
|
239
145
|
this.props = new Property(props === null || props === void 0 ? void 0 : props.props, (_instanceof(this, Control) ? this.constructor : void 0).controlName);
|
|
240
|
-
var
|
|
241
|
-
this.controlType = (
|
|
146
|
+
var ref3;
|
|
147
|
+
this.controlType = (ref3 = props === null || props === void 0 ? void 0 : props.controlType) !== null && ref3 !== void 0 ? ref3 : "base";
|
|
242
148
|
this.setting = JSONCopy(setting);
|
|
243
|
-
var
|
|
244
|
-
this.fieldType = (
|
|
149
|
+
var ref4;
|
|
150
|
+
this.fieldType = (ref4 = props === null || props === void 0 ? void 0 : props.fieldType) !== null && ref4 !== void 0 ? ref4 : controlFieldType;
|
|
245
151
|
this.eventKeys = JSONCopy(controlEventKeys);
|
|
246
152
|
this.customEvents = JSONCopy(controlCustomEvents);
|
|
247
153
|
Promise.resolve().then(function() {
|
|
@@ -276,41 +182,37 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
276
182
|
};
|
|
277
183
|
_proto.preValidate = function preValidate() {
|
|
278
184
|
var _this = this;
|
|
279
|
-
return _asyncToGenerator(function() {
|
|
185
|
+
return _asyncToGenerator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
|
280
186
|
var rules, results, result;
|
|
281
|
-
return
|
|
282
|
-
switch(
|
|
187
|
+
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
|
188
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
|
283
189
|
case 0:
|
|
284
190
|
rules = _objectSpread({}, _this.rules);
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
case 1:
|
|
290
|
-
results = _state.sent();
|
|
191
|
+
_ctx.next = 3;
|
|
192
|
+
return _this._callControlHooks("preValidate", rules);
|
|
193
|
+
case 3:
|
|
194
|
+
results = _ctx.sent;
|
|
291
195
|
result = results[results.length - 1];
|
|
292
|
-
return
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
196
|
+
return _ctx.abrupt("return", result === false ? undefined : result);
|
|
197
|
+
case 6:
|
|
198
|
+
case "end":
|
|
199
|
+
return _ctx.stop();
|
|
296
200
|
}
|
|
297
|
-
});
|
|
298
|
-
})();
|
|
201
|
+
}, _callee);
|
|
202
|
+
}))();
|
|
299
203
|
};
|
|
300
204
|
// property校验
|
|
301
205
|
_proto.validate = function validate(messages, ignore) {
|
|
302
206
|
var _this = this;
|
|
303
|
-
return _asyncToGenerator(function() {
|
|
304
|
-
var result, rules, validator
|
|
305
|
-
return
|
|
306
|
-
switch(
|
|
207
|
+
return _asyncToGenerator(/*#__PURE__*/ regeneratorRuntime.mark(function _callee() {
|
|
208
|
+
var result, rules, validator;
|
|
209
|
+
return regeneratorRuntime.wrap(function _callee$(_ctx) {
|
|
210
|
+
while(1)switch(_ctx.prev = _ctx.next){
|
|
307
211
|
case 0:
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
case 1:
|
|
313
|
-
result = _state.sent();
|
|
212
|
+
_ctx.next = 2;
|
|
213
|
+
return _this.preValidate();
|
|
214
|
+
case 2:
|
|
215
|
+
result = _ctx.sent;
|
|
314
216
|
rules = result !== undefined ? result : _objectSpread({}, _this.rules);
|
|
315
217
|
if (Array.isArray(ignore)) {
|
|
316
218
|
ignore.forEach(function(key) {
|
|
@@ -320,44 +222,36 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
320
222
|
});
|
|
321
223
|
}
|
|
322
224
|
validator = createValidator(rules, messages);
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
]);
|
|
331
|
-
|
|
332
|
-
|
|
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;
|
|
225
|
+
_ctx.prev = 6;
|
|
226
|
+
_ctx.next = 9;
|
|
227
|
+
return validator.validate(_this.props);
|
|
228
|
+
case 9:
|
|
229
|
+
return _ctx.abrupt("return", true);
|
|
230
|
+
case 12:
|
|
231
|
+
_ctx.prev = 12;
|
|
232
|
+
_ctx.t0 = _ctx["catch"](6);
|
|
233
|
+
if (!_ctx.t0.control) {
|
|
234
|
+
_ctx.t0.control = _this;
|
|
345
235
|
}
|
|
346
|
-
throw
|
|
347
|
-
case
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
];
|
|
236
|
+
throw _ctx.t0;
|
|
237
|
+
case 16:
|
|
238
|
+
case "end":
|
|
239
|
+
return _ctx.stop();
|
|
351
240
|
}
|
|
352
|
-
}
|
|
353
|
-
|
|
241
|
+
}, _callee, null, [
|
|
242
|
+
[
|
|
243
|
+
6,
|
|
244
|
+
12
|
|
245
|
+
]
|
|
246
|
+
]);
|
|
247
|
+
}))();
|
|
354
248
|
};
|
|
355
249
|
_proto.toDataBindModel = function toDataBindModel() {
|
|
356
250
|
var parentId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
|
|
357
251
|
var fieldType = this.fieldType;
|
|
358
252
|
var controlId = this.id;
|
|
359
253
|
var type = this.type;
|
|
360
|
-
var
|
|
254
|
+
var _props = this.props, dataBind = _props.dataBind, datasourceBind = _props.datasourceBind, optionConfig = _props.optionConfig, caption = _props.caption, required = _props.required, maxLength = _props.maxLength, options = _props.options, encrypted = _props.encrypted, encryptedMode = _props.encryptedMode;
|
|
361
255
|
if (!fieldType && !dataBind && !datasourceBind) return;
|
|
362
256
|
var dataBindModelType = {
|
|
363
257
|
parentId: parentId,
|
|
@@ -412,8 +306,8 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
412
306
|
Control.updateBasicControl = function updateBasicControl(key, setting) {
|
|
413
307
|
if (key !== "setting") return;
|
|
414
308
|
if (setting.add) {
|
|
415
|
-
var
|
|
416
|
-
(
|
|
309
|
+
var _setting;
|
|
310
|
+
(_setting = this.setting).push.apply(_setting, _toConsumableArray(setting.add));
|
|
417
311
|
}
|
|
418
312
|
if (setting.remove) {
|
|
419
313
|
this.removeSettingItem(setting.remove);
|
|
@@ -469,13 +363,13 @@ export { Control as DesignerControl };
|
|
|
469
363
|
});
|
|
470
364
|
// 移除对应选项
|
|
471
365
|
if (settingIndex !== -1) {
|
|
472
|
-
var
|
|
473
|
-
isHasItem ? _this.setting[settingIndex].showItems = (
|
|
366
|
+
var ref, ref1;
|
|
367
|
+
isHasItem ? _this.setting[settingIndex].showItems = (ref = _this.setting[settingIndex].showItems) === null || ref === void 0 ? void 0 : ref.filter(function(item) {
|
|
474
368
|
return !deleteKey.hideItems.includes(item);
|
|
475
369
|
}) : _this.setting.splice(settingIndex, 1);
|
|
476
370
|
// 子项长度为0,自动移除当前设置项
|
|
477
371
|
isHasItem && // @ts-ignore
|
|
478
|
-
!((
|
|
372
|
+
!((ref1 = _this.setting[settingIndex].showItems) === null || ref1 === void 0 ? void 0 : ref1.length) && // @ts-ignore
|
|
479
373
|
_this.setting.splice(settingIndex, 1);
|
|
480
374
|
}
|
|
481
375
|
});
|
|
@@ -501,13 +395,13 @@ export { Control as DesignerControl };
|
|
|
501
395
|
if (typeof value === "boolean") {
|
|
502
396
|
settingItem.visible = value;
|
|
503
397
|
} else if (typeof value === "object") {
|
|
504
|
-
var
|
|
505
|
-
var type = (
|
|
398
|
+
var _type;
|
|
399
|
+
var type = (_type = value.type) !== null && _type !== void 0 ? _type : "replace";
|
|
506
400
|
if (type === "replace") {
|
|
507
401
|
settingItem.showItems = value.showItems;
|
|
508
402
|
} else {
|
|
509
|
-
var
|
|
510
|
-
(
|
|
403
|
+
var _showItems;
|
|
404
|
+
(_showItems = settingItem.showItems).push.apply(_showItems, _toConsumableArray(value.showItems));
|
|
511
405
|
}
|
|
512
406
|
}
|
|
513
407
|
}
|
|
@@ -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 ref;
|
|
152
|
+
this.isHide = (ref = props === null || props === void 0 ? void 0 : props.isHide) !== null && ref !== void 0 ? ref : false;
|
|
153
153
|
this.style = new BaseStyle(props === null || props === void 0 ? void 0 : props.style);
|
|
154
|
-
var
|
|
155
|
-
this.caption = (
|
|
154
|
+
var ref1;
|
|
155
|
+
this.caption = (ref1 = props === null || props === void 0 ? void 0 : props.caption) !== null && ref1 !== void 0 ? ref1 : 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 ref1;
|
|
41
|
+
this.id = (ref1 = props === null || props === void 0 ? void 0 : props.id) !== null && ref1 !== void 0 ? ref1 : genNonDuplicateId(10);
|
|
42
|
+
var ref2;
|
|
43
|
+
this.type = (ref2 = props === null || props === void 0 ? void 0 : props.type) !== null && ref2 !== void 0 ? ref2 : 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 ref3;
|
|
47
|
+
this.controlType = (ref3 = props === null || props === void 0 ? void 0 : props.controlType) !== null && ref3 !== void 0 ? ref3 : "base";
|
|
48
|
+
var ref4;
|
|
49
|
+
this.fieldType = (ref4 = props === null || props === void 0 ? void 0 : props.fieldType) !== null && ref4 !== void 0 ? ref4 : controlFieldType;
|
|
50
|
+
var ref5;
|
|
51
|
+
this.pageStatus = (ref5 = props === null || props === void 0 ? void 0 : props.pageStatus) !== null && ref5 !== void 0 ? ref5 : PAGE_STATUS.UNKNOWN;
|
|
52
52
|
}
|
|
53
53
|
_createClass(Control, [
|
|
54
54
|
{
|
|
@@ -104,21 +104,21 @@ var ColumnControlProperty = /*#__PURE__*/ function(Property) {
|
|
|
104
104
|
_classCallCheck(this, ColumnControlProperty);
|
|
105
105
|
var _this;
|
|
106
106
|
_this = _super.call(this, props);
|
|
107
|
-
var
|
|
108
|
-
_this.width = (
|
|
107
|
+
var ref;
|
|
108
|
+
_this.width = (ref = props === null || props === void 0 ? void 0 : props.width) !== null && ref !== void 0 ? ref : 150;
|
|
109
109
|
_this.widthType = (props === null || props === void 0 ? void 0 : props.widthType) || "auto";
|
|
110
|
-
var
|
|
111
|
-
_this.caption = (
|
|
112
|
-
var
|
|
113
|
-
_this.fixed = (
|
|
110
|
+
var ref1;
|
|
111
|
+
_this.caption = (ref1 = props === null || props === void 0 ? void 0 : props.caption) !== null && ref1 !== void 0 ? ref1 : "";
|
|
112
|
+
var ref2;
|
|
113
|
+
_this.fixed = (ref2 = props === null || props === void 0 ? void 0 : props.fixed) !== null && ref2 !== void 0 ? ref2 : "none";
|
|
114
114
|
_this.autoWidth = new AutoWidth(props === null || props === void 0 ? void 0 : props.autoWidth);
|
|
115
115
|
_this.dataBind = new DataBind(props === null || props === void 0 ? void 0 : props.dataBind);
|
|
116
|
-
var
|
|
117
|
-
_this.sort = (
|
|
116
|
+
var ref3;
|
|
117
|
+
_this.sort = (ref3 = props === null || props === void 0 ? void 0 : props.sort) !== null && ref3 !== void 0 ? ref3 : true;
|
|
118
118
|
_this.align = props === null || props === void 0 ? void 0 : props.align;
|
|
119
119
|
_this.colSpan = props === null || props === void 0 ? void 0 : props.colSpan;
|
|
120
|
-
var
|
|
121
|
-
_this.
|
|
120
|
+
var ref4;
|
|
121
|
+
_this.autoHeight = (ref4 = props === null || props === void 0 ? void 0 : props.autoHeight) !== null && ref4 !== void 0 ? ref4 : false;
|
|
122
122
|
return _this;
|
|
123
123
|
}
|
|
124
124
|
return ColumnControlProperty;
|
|
@@ -145,13 +145,13 @@ var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnContro
|
|
|
145
145
|
{
|
|
146
146
|
type: "array",
|
|
147
147
|
message: RulesMessage.getMessage("isNotArray")
|
|
148
|
-
}
|
|
148
|
+
},
|
|
149
149
|
];
|
|
150
150
|
_this.datasourceBind = [
|
|
151
151
|
{
|
|
152
152
|
type: "object",
|
|
153
153
|
message: RulesMessage.getMessage("isNotObject")
|
|
154
|
-
}
|
|
154
|
+
},
|
|
155
155
|
];
|
|
156
156
|
initOptionAndDataSourceRules.call(_assertThisInitialized(_this), props);
|
|
157
157
|
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 ref;
|
|
29
29
|
// 如果没有被设置过不允许枚举的话,说明是第一次被设置,需要设置属性不允许枚举
|
|
30
|
-
if ((
|
|
30
|
+
if ((ref = Object.getOwnPropertyDescriptors(obj)[property]) === null || ref === void 0 ? void 0 : ref.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 _targetKey;
|
|
49
|
+
return (_targetKey = value[targetKey]) !== null && _targetKey !== void 0 ? _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 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 : "";
|
|
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 ref9;
|
|
221
|
+
_this.defaultValue = (ref9 = props === null || props === void 0 ? void 0 : props.defaultValue) !== null && ref9 !== void 0 ? ref9 : "";
|
|
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;
|