@byteluck-fe/model-driven-core 2.22.2-beta.8 → 2.22.3-beta.11

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.
Files changed (69) hide show
  1. package/README.md +69 -69
  2. package/dist/esm/common/BaseControl/designer.js +25 -30
  3. package/dist/esm/common/BaseControl/property.js +25 -38
  4. package/dist/esm/common/ColumnControl/designer.js +13 -27
  5. package/dist/esm/common/ColumnControl/property.js +56 -81
  6. package/dist/esm/common/ColumnControl/runtime.js +13 -27
  7. package/dist/esm/common/FormControl/designer.js +12 -25
  8. package/dist/esm/common/FormControl/property.js +90 -117
  9. package/dist/esm/common/FormControl/runtime.js +12 -26
  10. package/dist/esm/common/LayoutControl/designer.js +19 -39
  11. package/dist/esm/common/LayoutControl/property.js +12 -23
  12. package/dist/esm/common/LayoutControl/runtime.js +13 -27
  13. package/dist/esm/common/ListControl/designer.js +19 -36
  14. package/dist/esm/common/ListControl/property.js +14 -31
  15. package/dist/esm/common/ListControl/runtime.js +14 -28
  16. package/dist/esm/common/SearchViewControl/designer.js +12 -25
  17. package/dist/esm/common/SearchViewControl/property.js +12 -24
  18. package/dist/esm/common/SearchViewControl/runtime.js +12 -25
  19. package/dist/esm/common/Validator.js +5 -4
  20. package/dist/esm/common/WrapControl/designer.js +12 -25
  21. package/dist/esm/common/WrapControl/property.js +12 -23
  22. package/dist/esm/common/WrapControl/runtime.js +12 -25
  23. package/dist/esm/common/initLinkOperationRules.js +2 -2
  24. package/dist/esm/common/initOptionAndDataSourceRules.js +31 -30
  25. package/dist/esm/framework/RegisterControls.js +1 -0
  26. package/dist/esm/framework/index.js +424 -444
  27. package/dist/index.umd.js +1 -45
  28. package/dist/types/api-doc-index.d.ts +4 -4
  29. package/dist/types/common/BaseControl/designer.d.ts +71 -71
  30. package/dist/types/common/BaseControl/index.d.ts +13 -13
  31. package/dist/types/common/BaseControl/property.d.ts +44 -44
  32. package/dist/types/common/BaseControl/runtime.d.ts +23 -23
  33. package/dist/types/common/BaseControl/types.d.ts +35 -35
  34. package/dist/types/common/ColumnControl/designer.d.ts +20 -20
  35. package/dist/types/common/ColumnControl/index.d.ts +12 -12
  36. package/dist/types/common/ColumnControl/property.d.ts +74 -74
  37. package/dist/types/common/ColumnControl/runtime.d.ts +11 -11
  38. package/dist/types/common/ControlArray.d.ts +9 -9
  39. package/dist/types/common/FormControl/designer.d.ts +13 -13
  40. package/dist/types/common/FormControl/index.d.ts +12 -12
  41. package/dist/types/common/FormControl/property.d.ts +100 -100
  42. package/dist/types/common/FormControl/runtime.d.ts +11 -11
  43. package/dist/types/common/LayoutControl/designer.d.ts +21 -21
  44. package/dist/types/common/LayoutControl/index.d.ts +12 -12
  45. package/dist/types/common/LayoutControl/property.d.ts +6 -6
  46. package/dist/types/common/LayoutControl/runtime.d.ts +11 -11
  47. package/dist/types/common/ListControl/designer.d.ts +16 -16
  48. package/dist/types/common/ListControl/index.d.ts +12 -12
  49. package/dist/types/common/ListControl/property.d.ts +18 -18
  50. package/dist/types/common/ListControl/runtime.d.ts +12 -12
  51. package/dist/types/common/SearchViewControl/designer.d.ts +11 -11
  52. package/dist/types/common/SearchViewControl/index.d.ts +12 -12
  53. package/dist/types/common/SearchViewControl/property.d.ts +8 -8
  54. package/dist/types/common/SearchViewControl/runtime.d.ts +11 -11
  55. package/dist/types/common/Validator.d.ts +15 -15
  56. package/dist/types/common/WrapControl/designer.d.ts +11 -11
  57. package/dist/types/common/WrapControl/index.d.ts +12 -12
  58. package/dist/types/common/WrapControl/property.d.ts +6 -6
  59. package/dist/types/common/WrapControl/runtime.d.ts +11 -11
  60. package/dist/types/common/controlHooksEmitter.d.ts +4 -4
  61. package/dist/types/common/index.d.ts +12 -12
  62. package/dist/types/common/initLinkOperationRules.d.ts +6 -6
  63. package/dist/types/common/initOptionAndDataSourceRules.d.ts +10 -10
  64. package/dist/types/framework/RegisterControls.d.ts +37 -37
  65. package/dist/types/framework/index.d.ts +925 -923
  66. package/dist/types/framework/isDataBind.d.ts +2 -2
  67. package/dist/types/index.d.ts +4 -4
  68. package/dist/types/type.d.ts +91 -91
  69. package/package.json +3 -3
package/README.md CHANGED
@@ -1,69 +1,69 @@
1
- # Core
2
- 引擎控件核心定义
3
-
4
- 定义了控件的基类和一些工具类的实现
5
-
6
- ```
7
- │ index.ts // 入口文件
8
- │ type.ts // 类型
9
-
10
- ├─common // 基础类
11
- │ │ ControlArray.ts // 控件数组,管理设计态和运行态的children和headers数组
12
- │ │ controlHooksEmitter.ts // 旧版设计态的控件事件发布,暂时不可废弃
13
- │ │ index.ts
14
- │ │ initOptionAndDataSourceRules.ts // 关联数据源和自定义选项的校验规则
15
- │ │ Validator.ts // 校验
16
- │ │
17
- │ ├─BaseControl // 基础控件
18
- │ │ designer.ts
19
- │ │ index.ts
20
- │ │ property.ts
21
- │ │ runtime.ts
22
- │ │ types.ts
23
- │ │
24
- │ ├─ColumnControl // 列控件
25
- │ │ designer.ts
26
- │ │ index.ts
27
- │ │ property.ts
28
- │ │ runtime.ts
29
- │ │ types.ts
30
- │ │
31
- │ ├─FormControl // 表单控件
32
- │ │ designer.ts
33
- │ │ index.ts
34
- │ │ property.ts
35
- │ │ runtime.ts
36
- │ │ types.ts
37
- │ │
38
- │ ├─LayoutControl // 布局控件
39
- │ │ designer.ts
40
- │ │ index.ts
41
- │ │ property.ts
42
- │ │ runtime.ts
43
- │ │ types.ts
44
- │ │
45
- │ ├─ListControl // 列表控件
46
- │ │ designer.ts
47
- │ │ index.ts
48
- │ │ property.ts
49
- │ │ runtime.ts
50
- │ │ types.ts
51
- │ │
52
- │ ├─SearchViewControl // 查询容器控件
53
- │ │ designer.ts
54
- │ │ index.ts
55
- │ │ property.ts
56
- │ │ runtime.ts
57
- │ │ types.ts
58
- │ │
59
- │ └─WrapControl // 容器控件
60
- │ designer.ts
61
- │ index.ts
62
- │ property.ts
63
- │ runtime.ts
64
- │ types.ts
65
-
66
- └─framework // 工具类
67
- index.ts // 很多工具类
68
- RegisterControls.ts // 注册和管理控件类,被Runtime和Designer继承
69
- ```
1
+ # Core
2
+ 引擎控件核心定义
3
+
4
+ 定义了控件的基类和一些工具类的实现
5
+
6
+ ```
7
+ │ index.ts // 入口文件
8
+ │ type.ts // 类型
9
+
10
+ ├─common // 基础类
11
+ │ │ ControlArray.ts // 控件数组,管理设计态和运行态的children和headers数组
12
+ │ │ controlHooksEmitter.ts // 旧版设计态的控件事件发布,暂时不可废弃
13
+ │ │ index.ts
14
+ │ │ initOptionAndDataSourceRules.ts // 关联数据源和自定义选项的校验规则
15
+ │ │ Validator.ts // 校验
16
+ │ │
17
+ │ ├─BaseControl // 基础控件
18
+ │ │ designer.ts
19
+ │ │ index.ts
20
+ │ │ property.ts
21
+ │ │ runtime.ts
22
+ │ │ types.ts
23
+ │ │
24
+ │ ├─ColumnControl // 列控件
25
+ │ │ designer.ts
26
+ │ │ index.ts
27
+ │ │ property.ts
28
+ │ │ runtime.ts
29
+ │ │ types.ts
30
+ │ │
31
+ │ ├─FormControl // 表单控件
32
+ │ │ designer.ts
33
+ │ │ index.ts
34
+ │ │ property.ts
35
+ │ │ runtime.ts
36
+ │ │ types.ts
37
+ │ │
38
+ │ ├─LayoutControl // 布局控件
39
+ │ │ designer.ts
40
+ │ │ index.ts
41
+ │ │ property.ts
42
+ │ │ runtime.ts
43
+ │ │ types.ts
44
+ │ │
45
+ │ ├─ListControl // 列表控件
46
+ │ │ designer.ts
47
+ │ │ index.ts
48
+ │ │ property.ts
49
+ │ │ runtime.ts
50
+ │ │ types.ts
51
+ │ │
52
+ │ ├─SearchViewControl // 查询容器控件
53
+ │ │ designer.ts
54
+ │ │ index.ts
55
+ │ │ property.ts
56
+ │ │ runtime.ts
57
+ │ │ types.ts
58
+ │ │
59
+ │ └─WrapControl // 容器控件
60
+ │ designer.ts
61
+ │ index.ts
62
+ │ property.ts
63
+ │ runtime.ts
64
+ │ types.ts
65
+
66
+ └─framework // 工具类
67
+ index.ts // 很多工具类
68
+ RegisterControls.ts // 注册和管理控件类,被Runtime和Designer继承
69
+ ```
@@ -120,7 +120,7 @@ function _unsupported_iterable_to_array(o, minLen) {
120
120
  if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
121
121
  }
122
122
  function _ts_generator(thisArg, body) {
123
- var f, y, t, g, _ = {
123
+ var f, y, t, _ = {
124
124
  label: 0,
125
125
  sent: function() {
126
126
  if (t[0] & 1) throw t[1];
@@ -128,12 +128,8 @@ function _ts_generator(thisArg, body) {
128
128
  },
129
129
  trys: [],
130
130
  ops: []
131
- };
132
- return g = {
133
- next: verb(0),
134
- "throw": verb(1),
135
- "return": verb(2)
136
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
131
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
132
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
137
133
  return this;
138
134
  }), g;
139
135
  function verb(n) {
@@ -146,7 +142,7 @@ function _ts_generator(thisArg, body) {
146
142
  }
147
143
  function step(op) {
148
144
  if (f) throw new TypeError("Generator is already executing.");
149
- while(_)try {
145
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
150
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;
151
147
  if (y = 0, t) op = [
152
148
  op[0] & 2,
@@ -214,6 +210,7 @@ function _ts_generator(thisArg, body) {
214
210
  };
215
211
  }
216
212
  }
213
+ import { getLocaleText } from '@byteluck-fe/locale-message';
217
214
  import Property from './property';
218
215
  import { genNonDuplicateId, JSONCopy, referenceError, updateValueFromKeys } from '@byteluck-fe/model-driven-shared';
219
216
  import { createValidator } from '../Validator';
@@ -315,17 +312,16 @@ var Control = /*#__PURE__*/ function _target() {
315
312
  {
316
313
  key: "preValidate",
317
314
  value: function preValidate() {
318
- var _this = this;
319
315
  return _async_to_generator(function() {
320
316
  var rules, results, result;
321
317
  return _ts_generator(this, function(_state) {
322
318
  switch(_state.label){
323
319
  case 0:
324
320
  // 在处理validate之前,预留的钩子函数,允许在validate之前处理一些数据
325
- rules = _object_spread({}, _this.rules);
321
+ rules = _object_spread({}, this.rules);
326
322
  return [
327
323
  4,
328
- _this._callControlHooks('preValidate', rules)
324
+ this._callControlHooks('preValidate', rules)
329
325
  ];
330
326
  case 1:
331
327
  results = _state.sent();
@@ -336,14 +332,13 @@ var Control = /*#__PURE__*/ function _target() {
336
332
  ];
337
333
  }
338
334
  });
339
- })();
335
+ }).call(this);
340
336
  }
341
337
  },
342
338
  {
343
339
  key: "validate",
344
340
  value: // property校验
345
341
  function validate(messages, ignore) {
346
- var _this = this;
347
342
  return _async_to_generator(function() {
348
343
  var result, rules, validator, err;
349
344
  return _ts_generator(this, function(_state) {
@@ -351,11 +346,11 @@ var Control = /*#__PURE__*/ function _target() {
351
346
  case 0:
352
347
  return [
353
348
  4,
354
- _this.preValidate()
349
+ this.preValidate()
355
350
  ];
356
351
  case 1:
357
352
  result = _state.sent();
358
- rules = result !== undefined ? result : _object_spread({}, _this.rules);
353
+ rules = result !== undefined ? result : _object_spread({}, this.rules);
359
354
  if (Array.isArray(ignore)) {
360
355
  ignore.forEach(function(key) {
361
356
  if (rules.hasOwnProperty(key)) {
@@ -374,7 +369,7 @@ var Control = /*#__PURE__*/ function _target() {
374
369
  ]);
375
370
  return [
376
371
  4,
377
- validator.validate(_this.props)
372
+ validator.validate(this.props)
378
373
  ];
379
374
  case 3:
380
375
  _state.sent();
@@ -385,7 +380,7 @@ var Control = /*#__PURE__*/ function _target() {
385
380
  case 4:
386
381
  err = _state.sent();
387
382
  if (!err.control) {
388
- err.control = _this;
383
+ err.control = this;
389
384
  }
390
385
  throw err;
391
386
  case 5:
@@ -394,7 +389,7 @@ var Control = /*#__PURE__*/ function _target() {
394
389
  ];
395
390
  }
396
391
  });
397
- })();
392
+ }).call(this);
398
393
  }
399
394
  },
400
395
  {
@@ -486,7 +481,7 @@ var Control = /*#__PURE__*/ function _target() {
486
481
  _define_property(Control, "mode", 'Designer');
487
482
  _define_property(Control, "slots", void 0);
488
483
  _define_property(Control, "slotPosition", void 0);
489
- _define_property(Control, "controlName", '控件');
484
+ _define_property(Control, "controlName", getLocaleText('CMD.7baf1751712168384'));
490
485
  _define_property(Control, "controlIcon", 'icon');
491
486
  _define_property(Control, "controlType", 'control');
492
487
  _define_property(Control, "controlFieldType", void 0);
@@ -502,10 +497,10 @@ _define_property(Control, "removeSettingItem", removeSetting);
502
497
  _define_property(Control, "updateSettingItem", updateSetting);
503
498
  export default Control;
504
499
  export { Control as DesignerControl };
505
- /**
506
- * @function 删除控件或者实例上的setting的方法
507
- * @description 其中的this可能是DesignerControl的类,也可以是实例
508
- * @param keys 需要删除的key或key组成的数组
500
+ /**
501
+ * @function 删除控件或者实例上的setting的方法
502
+ * @description 其中的this可能是DesignerControl的类,也可以是实例
503
+ * @param keys 需要删除的key或key组成的数组
509
504
  * */ function removeSetting(keys) {
510
505
  var _this = this;
511
506
  var deleteKeys = Array.isArray(keys) ? keys : [
@@ -533,13 +528,13 @@ export { Control as DesignerControl };
533
528
  }
534
529
  });
535
530
  }
536
- /**
537
- * @function 修改控件或者实例上的setting的方法
538
- * @description 其中的this可能是DesignerControl的类,也可以是实例
539
- * @param settingKey 需要修改的key或者key组成的数组
540
- * @param value 修改之后的visible值
541
- * @param value.showItems 需要添加或替换的showItems
542
- * @param value.type 默认是replace替换,可以更改为push新增
531
+ /**
532
+ * @function 修改控件或者实例上的setting的方法
533
+ * @description 其中的this可能是DesignerControl的类,也可以是实例
534
+ * @param settingKey 需要修改的key或者key组成的数组
535
+ * @param value 修改之后的visible值
536
+ * @param value.showItems 需要添加或替换的showItems
537
+ * @param value.type 默认是replace替换,可以更改为push新增
543
538
  * */ function updateSetting(settingKey, value) {
544
539
  var _this = this;
545
540
  var keys = typeof settingKey === 'string' ? [
@@ -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");
@@ -105,28 +109,12 @@ function _wrap_native_super(Class) {
105
109
  return _wrap_native_super(Class);
106
110
  }
107
111
  function _is_native_reflect_construct() {
108
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
109
- if (Reflect.construct.sham) return false;
110
- if (typeof Proxy === "function") return true;
111
112
  try {
112
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
113
- return true;
114
- } catch (e) {
115
- return false;
116
- }
117
- }
118
- function _create_super(Derived) {
119
- var hasNativeReflectConstruct = _is_native_reflect_construct();
120
- return function _createSuperInternal() {
121
- var Super = _get_prototype_of(Derived), result;
122
- if (hasNativeReflectConstruct) {
123
- var NewTarget = _get_prototype_of(this).constructor;
124
- result = Reflect.construct(Super, arguments, NewTarget);
125
- } else {
126
- result = Super.apply(this, arguments);
127
- }
128
- return _possible_constructor_return(this, result);
129
- };
113
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
114
+ } catch (_) {}
115
+ return (_is_native_reflect_construct = function() {
116
+ return !!result;
117
+ })();
130
118
  }
131
119
  import { BaseStyle } from '../../framework';
132
120
  var PropertyRules = function PropertyRules(props) {
@@ -139,36 +127,35 @@ var PropertyRules = function PropertyRules(props) {
139
127
  var PropertyRuntimeRules = /*#__PURE__*/ function(Array1) {
140
128
  "use strict";
141
129
  _inherits(PropertyRuntimeRules, Array1);
142
- var _super = _create_super(PropertyRuntimeRules);
143
130
  function PropertyRuntimeRules(props) {
144
131
  _class_call_check(this, PropertyRuntimeRules);
145
- return _super.call(this);
132
+ return _call_super(this, PropertyRuntimeRules);
146
133
  }
147
134
  return PropertyRuntimeRules;
148
135
  }(_wrap_native_super(Array));
149
- /**
150
- * 全局属性
151
- * @public
136
+ /**
137
+ * 全局属性
138
+ * @public
152
139
  */ var Property = function Property(props) {
153
140
  "use strict";
154
141
  var caption = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';
155
142
  _class_call_check(this, Property);
156
- /**
157
- * 是否隐藏
158
- * @public
159
- * @defaultValue false
143
+ /**
144
+ * 是否隐藏
145
+ * @public
146
+ * @defaultValue false
160
147
  */ _define_property(this, "isHide", void 0);
161
148
  _define_property(this, "className", void 0);
162
149
  _define_property(this, "style", void 0);
163
- /**
164
- * 标题
165
- * @public
166
- * @defaultValue ''
150
+ /**
151
+ * 标题
152
+ * @public
153
+ * @defaultValue ''
167
154
  */ _define_property(this, "caption", void 0);
168
- /**
169
- * 标题
170
- * @public
171
- * @defaultValue ''
155
+ /**
156
+ * 标题
157
+ * @public
158
+ * @defaultValue ''
172
159
  */ _define_property(this, "defaultState", void 0);
173
160
  var _props_isHide;
174
161
  this.isHide = (_props_isHide = props === null || props === void 0 ? void 0 : props.isHide) !== null && _props_isHide !== void 0 ? _props_isHide : false;
@@ -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");
@@ -135,28 +139,12 @@ function _type_of(obj) {
135
139
  return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
136
140
  }
137
141
  function _is_native_reflect_construct() {
138
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
139
- if (Reflect.construct.sham) return false;
140
- if (typeof Proxy === "function") return true;
141
142
  try {
142
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
143
- return true;
144
- } catch (e) {
145
- return false;
146
- }
147
- }
148
- function _create_super(Derived) {
149
- var hasNativeReflectConstruct = _is_native_reflect_construct();
150
- return function _createSuperInternal() {
151
- var Super = _get_prototype_of(Derived), result;
152
- if (hasNativeReflectConstruct) {
153
- var NewTarget = _get_prototype_of(this).constructor;
154
- result = Reflect.construct(Super, arguments, NewTarget);
155
- } else {
156
- result = Super.apply(this, arguments);
157
- }
158
- return _possible_constructor_return(this, result);
159
- };
143
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
144
+ } catch (_) {}
145
+ return (_is_native_reflect_construct = function() {
146
+ return !!result;
147
+ })();
160
148
  }
161
149
  import { defineControlArrayToProperty } from '../ControlArray';
162
150
  import { DesignerControl } from '../BaseControl';
@@ -164,16 +152,14 @@ import ColumnControlProperty from './property';
164
152
  var ColumnControl = /*#__PURE__*/ function(DesignerControl) {
165
153
  "use strict";
166
154
  _inherits(ColumnControl, DesignerControl);
167
- var _super = _create_super(ColumnControl);
168
155
  function ColumnControl(props) {
169
156
  _class_call_check(this, ColumnControl);
170
157
  var _this;
171
- _this = _super.call(this, props);
172
- _define_property(_assert_this_initialized(_this), "controlType", 'column');
173
- _define_property(_assert_this_initialized(_this), "props", void 0);
174
- _define_property(_assert_this_initialized(_this), "children", void 0);
158
+ _this = _call_super(this, ColumnControl, [
159
+ props
160
+ ]), _define_property(_this, "controlType", 'column'), _define_property(_this, "props", void 0), _define_property(_this, "children", void 0);
175
161
  _this.props = new ColumnControlProperty(props === null || props === void 0 ? void 0 : props.props);
176
- defineControlArrayToProperty(_assert_this_initialized(_this), 'children', props === null || props === void 0 ? void 0 : props.children, undefined, 'Designer');
162
+ defineControlArrayToProperty(_this, 'children', props === null || props === void 0 ? void 0 : props.children, undefined, 'Designer');
177
163
  return _this;
178
164
  }
179
165
  _create_class(ColumnControl, [
@@ -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,103 +63,76 @@ 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
- return true;
68
- } catch (e) {
69
- return false;
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
73
  import { Property, PropertyRules } from '../BaseControl';
86
- import { RulesMessage } from '@byteluck-fe/model-driven-shared';
87
74
  import { initOptionAndDataSourceRules } from '../initOptionAndDataSourceRules';
88
75
  import { DataBind, AutoWidth } from '../../framework';
76
+ import { getLocaleText } from '@byteluck-fe/locale-message';
89
77
  var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
90
78
  "use strict";
91
79
  _inherits(ColumnControlPropertyRules, PropertyRules);
92
- var _super = _create_super(ColumnControlPropertyRules);
93
80
  function ColumnControlPropertyRules(props) {
94
81
  _class_call_check(this, ColumnControlPropertyRules);
95
82
  var _this;
96
- _this = _super.call(this, props);
97
- _define_property(_assert_this_initialized(_this), "caption", {
83
+ _this = _call_super(this, ColumnControlPropertyRules, [
84
+ props
85
+ ]), _define_property(_this, "caption", {
98
86
  type: 'string',
99
87
  required: true,
100
- message: RulesMessage.getMessage('pleaseEnterCaption')
101
- });
102
- _define_property(_assert_this_initialized(_this), "width", {
88
+ message: getLocaleText('CMD.pleaseEnterCaption', null, '请输入标题')
89
+ }), _define_property(_this, "width", {
103
90
  type: 'number',
104
91
  required: false,
105
- message: RulesMessage.getMessage('pleaseEnterColumnWidth')
92
+ message: getLocaleText('CMD.pleaseEnterColumnWidth', null, '请输入列宽')
106
93
  });
107
94
  _this.width.required = props.widthType === 'px';
108
95
  return _this;
109
96
  }
110
97
  return ColumnControlPropertyRules;
111
98
  }(PropertyRules);
112
- /**
113
- * 列基本属性
114
- * @public
99
+ /**
100
+ * 列基本属性
101
+ * @public
115
102
  */ var ColumnControlProperty = /*#__PURE__*/ function(Property) {
116
103
  "use strict";
117
104
  _inherits(ColumnControlProperty, Property);
118
- var _super = _create_super(ColumnControlProperty);
119
105
  function ColumnControlProperty(props) {
120
106
  _class_call_check(this, ColumnControlProperty);
121
107
  var _this;
122
- _this = _super.call(this, props);
123
- /**
124
- * 宽度类型
125
- * @defaultValue 'auto'
126
- */ _define_property(_assert_this_initialized(_this), "widthType", void 0);
127
- /**
128
- * 宽度
129
- * @defaultValue 150
130
- */ _define_property(_assert_this_initialized(_this), "width", void 0);
131
- /**
132
- * 标题
133
- */ _define_property(_assert_this_initialized(_this), "caption", void 0);
134
- /**
135
- * 绑定数据项
136
- */ _define_property(_assert_this_initialized(_this), "dataBind", void 0);
137
- /**
138
- * 自适应页面宽度
139
- */ _define_property(_assert_this_initialized(_this), "autoWidth", void 0);
140
- /**
141
- * 冻结
142
- * @defaultValue 'none'
143
- */ _define_property(_assert_this_initialized(_this), "fixed", void 0);
144
- /**
145
- * 表头排序
146
- * @defaultValue true
147
- */ _define_property(_assert_this_initialized(_this), "sort", void 0);
148
- /**
149
- * 对齐
150
- */ _define_property(_assert_this_initialized(_this), "align", void 0);
151
- /**
152
- * @internal
153
- */ _define_property(_assert_this_initialized(_this), "colSpan", void 0);
154
- /**
155
- * 自动高度
156
- * @defaultValue false
157
- */ _define_property(_assert_this_initialized(_this), "autoHeight", void 0);
158
- _define_property(_assert_this_initialized(_this), "children", void 0);
108
+ _this = _call_super(this, ColumnControlProperty, [
109
+ props
110
+ ]), /**
111
+ * 宽度类型
112
+ * @defaultValue 'auto'
113
+ */ _define_property(_this, "widthType", void 0), /**
114
+ * 宽度
115
+ * @defaultValue 150
116
+ */ _define_property(_this, "width", void 0), /**
117
+ * 标题
118
+ */ _define_property(_this, "caption", void 0), /**
119
+ * 绑定数据项
120
+ */ _define_property(_this, "dataBind", void 0), /**
121
+ * 自适应页面宽度
122
+ */ _define_property(_this, "autoWidth", void 0), /**
123
+ * 冻结
124
+ * @defaultValue 'none'
125
+ */ _define_property(_this, "fixed", void 0), /**
126
+ * 表头排序
127
+ * @defaultValue true
128
+ */ _define_property(_this, "sort", void 0), /**
129
+ * 对齐
130
+ */ _define_property(_this, "align", void 0), /**
131
+ * @internal
132
+ */ _define_property(_this, "colSpan", void 0), /**
133
+ * 自动高度
134
+ * @defaultValue false
135
+ */ _define_property(_this, "autoHeight", void 0), _define_property(_this, "children", void 0);
159
136
  var _props_width;
160
137
  _this.width = (_props_width = props === null || props === void 0 ? void 0 : props.width) !== null && _props_width !== void 0 ? _props_width : 150;
161
138
  _this.widthType = (props === null || props === void 0 ? void 0 : props.widthType) || 'auto';
@@ -179,33 +156,31 @@ _define_property(ColumnControlProperty, "Rules", ColumnControlPropertyRules);
179
156
  var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnControlPropertyRules) {
180
157
  "use strict";
181
158
  _inherits(ColumnOptionAndDataSourcePropertyRules, ColumnControlPropertyRules);
182
- var _super = _create_super(ColumnOptionAndDataSourcePropertyRules);
183
159
  function ColumnOptionAndDataSourcePropertyRules(props) {
184
160
  _class_call_check(this, ColumnOptionAndDataSourcePropertyRules);
185
161
  var _this;
186
- _this = _super.call(this, props);
187
- _define_property(_assert_this_initialized(_this), "optionConfig", {
162
+ _this = _call_super(this, ColumnOptionAndDataSourcePropertyRules, [
163
+ props
164
+ ]), _define_property(_this, "optionConfig", {
188
165
  type: 'enum',
189
166
  enum: [
190
167
  'custom',
191
168
  'datasource',
192
169
  'none'
193
170
  ],
194
- message: RulesMessage.getMessage('PleaseSelectTheCorrectOptionSettings')
195
- });
196
- _define_property(_assert_this_initialized(_this), "options", [
171
+ message: getLocaleText('CMD.PleaseSelectTheCorrectOptionSettings', null, '请选择正确的选项设置')
172
+ }), _define_property(_this, "options", [
197
173
  {
198
174
  type: 'array',
199
- message: RulesMessage.getMessage('isNotArray')
175
+ message: getLocaleText('CMD.isNotArray', null, '请输入一个数组')
200
176
  }
201
- ]);
202
- _define_property(_assert_this_initialized(_this), "datasourceBind", [
177
+ ]), _define_property(_this, "datasourceBind", [
203
178
  {
204
179
  type: 'object',
205
- message: RulesMessage.getMessage('isNotObject')
180
+ message: getLocaleText('CMD.isNotObject', null, '请输入一个对象')
206
181
  }
207
182
  ]);
208
- initOptionAndDataSourceRules.call(_assert_this_initialized(_this), props);
183
+ initOptionAndDataSourceRules.call(_this, props);
209
184
  return _this;
210
185
  }
211
186
  return ColumnOptionAndDataSourcePropertyRules;