@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.
@@ -1,6 +1,6 @@
1
1
  function _arrayLikeToArray(arr, len) {
2
2
  if (len == null || len > arr.length) len = arr.length;
3
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
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 i = 0; i < props.length; i++){
48
- var descriptor = props[i];
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 i = 1; i < arguments.length; i++){
91
- var source = arguments[i] != null ? arguments[i] : {};
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
- 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
- };
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 _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;
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 _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);
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 _props_type;
238
- this.type = (_props_type = props === null || props === void 0 ? void 0 : props.type) !== null && _props_type !== void 0 ? _props_type : controlType;
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 _props_controlType;
241
- this.controlType = (_props_controlType = props === null || props === void 0 ? void 0 : props.controlType) !== null && _props_controlType !== void 0 ? _props_controlType : "base";
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 _props_fieldType;
244
- this.fieldType = (_props_fieldType = props === null || props === void 0 ? void 0 : props.fieldType) !== null && _props_fieldType !== void 0 ? _props_fieldType : controlFieldType;
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 __generator(this, function(_state) {
282
- switch(_state.label){
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
- return [
286
- 4,
287
- _this._callControlHooks("preValidate", rules)
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
- 2,
294
- result === false ? undefined : result
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, err;
305
- return __generator(this, function(_state) {
306
- switch(_state.label){
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
- return [
309
- 4,
310
- _this.preValidate()
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
- _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;
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 err;
347
- case 5:
348
- return [
349
- 2
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 _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;
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 _this_setting;
416
- (_this_setting = this.setting).push.apply(_this_setting, _toConsumableArray(setting.add));
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 _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) {
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
- !((_this_setting_settingIndex_showItems1 = _this.setting[settingIndex].showItems) === null || _this_setting_settingIndex_showItems1 === void 0 ? void 0 : _this_setting_settingIndex_showItems1.length) && // @ts-ignore
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 _value_type;
505
- var type = (_value_type = value.type) !== null && _value_type !== void 0 ? _value_type : "replace";
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 _settingItem_showItems;
510
- (_settingItem_showItems = settingItem.showItems).push.apply(_settingItem_showItems, _toConsumableArray(value.showItems));
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 _props_isHide;
152
- this.isHide = (_props_isHide = props === null || props === void 0 ? void 0 : props.isHide) !== null && _props_isHide !== void 0 ? _props_isHide : false;
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 _props_caption;
155
- this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : 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 _ref = _instanceof(this, Control) ? this.constructor : void 0, controlType = _ref.controlType, controlFieldType = _ref.controlFieldType, name = _ref.name, controlCustomEvents = _ref.controlCustomEvents;
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 _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;
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 _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;
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 _props_width;
108
- _this.width = (_props_width = props === null || props === void 0 ? void 0 : props.width) !== null && _props_width !== void 0 ? _props_width : 150;
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 _props_caption;
111
- _this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : "";
112
- var _props_fixed;
113
- _this.fixed = (_props_fixed = props === null || props === void 0 ? void 0 : props.fixed) !== null && _props_fixed !== void 0 ? _props_fixed : "none";
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 _props_sort;
117
- _this.sort = (_props_sort = props === null || props === void 0 ? void 0 : props.sort) !== null && _props_sort !== void 0 ? _props_sort : true;
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 _props_adaptiveRowHeight;
121
- _this.adaptiveRowHeight = (_props_adaptiveRowHeight = props === null || props === void 0 ? void 0 : props.adaptiveRowHeight) !== null && _props_adaptiveRowHeight !== void 0 ? _props_adaptiveRowHeight : false;
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 _Object_getOwnPropertyDescriptors_property;
28
+ var ref;
29
29
  // 如果没有被设置过不允许枚举的话,说明是第一次被设置,需要设置属性不允许枚举
30
- if ((_Object_getOwnPropertyDescriptors_property = Object.getOwnPropertyDescriptors(obj)[property]) === null || _Object_getOwnPropertyDescriptors_property === void 0 ? void 0 : _Object_getOwnPropertyDescriptors_property.enumerable) {
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 _value_targetKey;
49
- return (_value_targetKey = value[targetKey]) !== null && _value_targetKey !== void 0 ? _value_targetKey : value;
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);
@@ -88,7 +88,7 @@ var FormControl = /*#__PURE__*/ function(DesignerControl) {
88
88
  FormControl.controlEventKeys = [
89
89
  "on_change",
90
90
  "on_focus",
91
- "on_blur"
91
+ "on_blur",
92
92
  ];
93
93
  export default FormControl;
94
94
  export { FormControl as DesignerFormControl };
@@ -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 _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 : "";
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 _props_defaultValue;
221
- _this.defaultValue = (_props_defaultValue = props === null || props === void 0 ? void 0 : props.defaultValue) !== null && _props_defaultValue !== void 0 ? _props_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;