@byteluck-fe/model-driven-core 7.0.0-props.99 → 7.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/contracts/index.js +1 -0
- package/dist/contracts/index.mjs +1 -0
- package/dist/esm/common/BaseControl/designer.js +47 -29
- package/dist/esm/common/BaseControl/property.js +44 -33
- package/dist/esm/common/BaseControl/runtime.js +3 -9
- package/dist/esm/common/ColumnControl/designer.js +17 -29
- package/dist/esm/common/ColumnControl/property.js +44 -22
- package/dist/esm/common/ColumnControl/runtime.js +12 -20
- package/dist/esm/common/ControlArray.js +4 -2
- package/dist/esm/common/FormControl/designer.js +12 -20
- package/dist/esm/common/FormControl/property.js +16 -21
- package/dist/esm/common/FormControl/runtime.js +12 -20
- package/dist/esm/common/LayoutControl/designer.js +36 -51
- package/dist/esm/common/LayoutControl/property.js +15 -18
- package/dist/esm/common/LayoutControl/runtime.js +12 -20
- package/dist/esm/common/ListControl/designer.js +35 -48
- package/dist/esm/common/ListControl/property.js +29 -22
- package/dist/esm/common/ListControl/runtime.js +12 -20
- package/dist/esm/common/SearchViewControl/designer.js +12 -20
- package/dist/esm/common/SearchViewControl/property.js +19 -22
- package/dist/esm/common/SearchViewControl/runtime.js +12 -20
- package/dist/esm/common/WrapControl/designer.js +12 -20
- package/dist/esm/common/WrapControl/property.js +15 -18
- package/dist/esm/common/WrapControl/runtime.js +12 -20
- package/dist/esm/contracts/build-info.js +36 -0
- package/dist/esm/contracts/diagnostics.js +29 -0
- package/dist/esm/contracts/index.js +4 -0
- package/dist/esm/contracts/page-model.js +1 -0
- package/dist/esm/contracts/versions.js +9 -0
- package/dist/esm/framework/RegisterControls.js +2 -6
- package/dist/esm/framework/index.js +216 -20
- package/dist/index.umd.js +3 -1
- package/dist/types/common/BaseControl/designer.d.ts +14 -0
- package/dist/types/common/BaseControl/property.d.ts +28 -0
- package/dist/types/common/ColumnControl/property.d.ts +42 -0
- package/dist/types/common/LayoutControl/property.d.ts +4 -0
- package/dist/types/common/ListControl/property.d.ts +22 -0
- package/dist/types/common/SearchViewControl/property.d.ts +7 -0
- package/dist/types/common/WrapControl/property.d.ts +4 -0
- package/dist/types/contracts/build-info.d.ts +25 -0
- package/dist/types/contracts/diagnostics.d.ts +22 -0
- package/dist/types/contracts/index.d.ts +4 -0
- package/dist/types/contracts/page-model.d.ts +103 -0
- package/dist/types/contracts/versions.d.ts +16 -0
- package/dist/types/framework/index.d.ts +195 -0
- package/package.json +27 -5
package/README.md
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
# Core
|
|
2
|
+
|
|
2
3
|
引擎控件核心定义
|
|
3
4
|
|
|
4
5
|
定义了控件的基类和一些工具类的实现
|
|
5
6
|
|
|
7
|
+
## 纯契约子入口
|
|
8
|
+
|
|
9
|
+
`@byteluck-fe/model-driven-core/contracts` 只导出版本、诊断和页面模型类型,不引用 Vue、DOM 或接口。Designer、Runtime 与 FDE 应从这里共享 `HeadlessControlNode`、`CompilePageModelInput/Result`、`ValidateSavedPageModelChangeInput` 和 build-info 契约;版本不一致时由编译或页面差分入口返回始终阻断的兼容性诊断。
|
|
10
|
+
|
|
11
|
+
`HeadlessRuntimeOptions.locale` 接受任意非空字符串;调用方可提供当前语言的扁平 `localeMessages` 或同步 `resolveLocaleMessage`,公共层不会读取全局 i18n 或访问接口。
|
|
12
|
+
|
|
6
13
|
```
|
|
7
14
|
│ index.ts // 入口文件
|
|
8
15
|
│ type.ts // 类型
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var E=Object.getOwnPropertySymbols;var O=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;var _=(t,e,o)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,r=(t,e)=>{for(var o in e||(e={}))O.call(e,o)&&_(t,o,e[o]);if(E)for(var o of E(e))s.call(e,o)&&_(t,o,e[o]);return t};Object.defineProperty(exports,"__esModule",{value:!0});const MODEL_DRIVEN_PACKAGE_VERSION="7.1.0-beta.1",CURRENT_PAGE_SCHEMA_VERSION="3.16",HEADLESS_COMPILER_CONTRACT_VERSION="model-driven.headless.v2",CONTROL_CATALOG_SCHEMA_VERSION="model-driven.control-catalog.v1",MODEL_DRIVEN_BUILD_INFO=Object.freeze({packageVersion:MODEL_DRIVEN_PACKAGE_VERSION,pageSchemaVersion:CURRENT_PAGE_SCHEMA_VERSION,compilerContractVersion:HEADLESS_COMPILER_CONTRACT_VERSION,catalogSchemaVersion:CONTROL_CATALOG_SCHEMA_VERSION});function getModelDrivenBuildInfo(){return r({},MODEL_DRIVEN_BUILD_INFO)}function createModelDrivenDiagnostic(t){return r({},t)}exports.CONTROL_CATALOG_SCHEMA_VERSION=CONTROL_CATALOG_SCHEMA_VERSION,exports.CURRENT_PAGE_SCHEMA_VERSION=CURRENT_PAGE_SCHEMA_VERSION,exports.HEADLESS_COMPILER_CONTRACT_VERSION=HEADLESS_COMPILER_CONTRACT_VERSION,exports.MODEL_DRIVEN_BUILD_INFO=MODEL_DRIVEN_BUILD_INFO,exports.MODEL_DRIVEN_PACKAGE_VERSION=MODEL_DRIVEN_PACKAGE_VERSION,exports.createModelDrivenDiagnostic=createModelDrivenDiagnostic,exports.getModelDrivenBuildInfo=getModelDrivenBuildInfo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var c=Object.getOwnPropertySymbols;var R=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable;var r=(n,e,o)=>e in n?s(n,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[e]=o,t=(n,e)=>{for(var o in e||(e={}))R.call(e,o)&&r(n,o,e[o]);if(c)for(var o of c(e))l.call(e,o)&&r(n,o,e[o]);return n};const E="7.1.0-beta.1",_="3.16",a="model-driven.headless.v2",i="model-driven.control-catalog.v1",O=Object.freeze({packageVersion:E,pageSchemaVersion:_,compilerContractVersion:a,catalogSchemaVersion:i});function C(){return t({},O)}function I(n){return t({},n)}export{i as CONTROL_CATALOG_SCHEMA_VERSION,_ as CURRENT_PAGE_SCHEMA_VERSION,a as HEADLESS_COMPILER_CONTRACT_VERSION,O as MODEL_DRIVEN_BUILD_INFO,E as MODEL_DRIVEN_PACKAGE_VERSION,I as createModelDrivenDiagnostic,C as getModelDrivenBuildInfo};
|
|
@@ -17,11 +17,8 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
|
17
17
|
reject(error);
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
if (info.done)
|
|
21
|
-
|
|
22
|
-
} else {
|
|
23
|
-
Promise.resolve(value).then(_next, _throw);
|
|
24
|
-
}
|
|
20
|
+
if (info.done) resolve(value);
|
|
21
|
+
else Promise.resolve(value).then(_next, _throw);
|
|
25
22
|
}
|
|
26
23
|
function _async_to_generator(fn) {
|
|
27
24
|
return function() {
|
|
@@ -39,9 +36,7 @@ function _async_to_generator(fn) {
|
|
|
39
36
|
};
|
|
40
37
|
}
|
|
41
38
|
function _class_call_check(instance, Constructor) {
|
|
42
|
-
if (!(instance instanceof Constructor))
|
|
43
|
-
throw new TypeError("Cannot call a class as a function");
|
|
44
|
-
}
|
|
39
|
+
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
|
|
45
40
|
}
|
|
46
41
|
function _defineProperties(target, props) {
|
|
47
42
|
for(var i = 0; i < props.length; i++){
|
|
@@ -65,27 +60,25 @@ function _define_property(obj, key, value) {
|
|
|
65
60
|
configurable: true,
|
|
66
61
|
writable: true
|
|
67
62
|
});
|
|
68
|
-
} else
|
|
69
|
-
obj[key] = value;
|
|
70
|
-
}
|
|
63
|
+
} else obj[key] = value;
|
|
71
64
|
return obj;
|
|
72
65
|
}
|
|
73
66
|
function _instanceof(left, right) {
|
|
74
67
|
"@swc/helpers - instanceof";
|
|
75
68
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
76
69
|
return !!right[Symbol.hasInstance](left);
|
|
77
|
-
} else
|
|
78
|
-
return left instanceof right;
|
|
79
|
-
}
|
|
70
|
+
} else return left instanceof right;
|
|
80
71
|
}
|
|
81
72
|
function _iterable_to_array(iter) {
|
|
82
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
73
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
|
|
74
|
+
return Array.from(iter);
|
|
75
|
+
}
|
|
83
76
|
}
|
|
84
77
|
function _non_iterable_rest() {
|
|
85
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance
|
|
78
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
86
79
|
}
|
|
87
80
|
function _non_iterable_spread() {
|
|
88
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance
|
|
81
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
89
82
|
}
|
|
90
83
|
function _object_spread(target) {
|
|
91
84
|
for(var i = 1; i < arguments.length; i++){
|
|
@@ -108,18 +101,6 @@ function _to_array(arr) {
|
|
|
108
101
|
function _to_consumable_array(arr) {
|
|
109
102
|
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
110
103
|
}
|
|
111
|
-
function _type_of(obj) {
|
|
112
|
-
"@swc/helpers - typeof";
|
|
113
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
114
|
-
}
|
|
115
|
-
function _unsupported_iterable_to_array(o, minLen) {
|
|
116
|
-
if (!o) return;
|
|
117
|
-
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
118
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
119
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
120
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
121
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
122
|
-
}
|
|
123
104
|
function _ts_generator(thisArg, body) {
|
|
124
105
|
var f, y, t, _ = {
|
|
125
106
|
label: 0,
|
|
@@ -219,6 +200,18 @@ function _ts_generator(thisArg, body) {
|
|
|
219
200
|
};
|
|
220
201
|
}
|
|
221
202
|
}
|
|
203
|
+
function _type_of(obj) {
|
|
204
|
+
"@swc/helpers - typeof";
|
|
205
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
206
|
+
}
|
|
207
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
208
|
+
if (!o) return;
|
|
209
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
210
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
211
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
212
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
213
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
214
|
+
}
|
|
222
215
|
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
223
216
|
import Property from './property';
|
|
224
217
|
import { genNonDuplicateId, JSONCopy, referenceError, updateValueFromKeys } from '@byteluck-fe/model-driven-shared';
|
|
@@ -245,6 +238,7 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
245
238
|
_define_property(this, "slotPosition", void 0);
|
|
246
239
|
_define_property(this, "updateSetting", updateSetting);
|
|
247
240
|
_define_property(this, "removeSetting", removeSetting);
|
|
241
|
+
_define_property(this, "removeSettingByKeyAndName", removeSettingByKeyAndName);
|
|
248
242
|
this._callControlHooks('preInstance', props);
|
|
249
243
|
var _ref4 = _instanceof(this, Control) ? this.constructor : void 0, controlName = _ref4.controlName, controlIcon = _ref4.controlIcon, controlType = _ref4.controlType, controlFieldType = _ref4.controlFieldType, controlEventKeys = _ref4.controlEventKeys, controlCustomEvents = _ref4.controlCustomEvents, name = _ref4.name, setting = _ref4.setting, slots = _ref4.slots, slotPosition = _ref4.slotPosition;
|
|
250
244
|
if (!(controlName && controlIcon && controlType)) {
|
|
@@ -498,6 +492,10 @@ _define_property(Control, "setting", []);
|
|
|
498
492
|
_define_property(Control, "__is_control__", true);
|
|
499
493
|
// 删除指定的settingItem
|
|
500
494
|
_define_property(Control, "removeSettingItem", removeSetting);
|
|
495
|
+
// 根据key和name删除指定的settingItem
|
|
496
|
+
_define_property(Control, "removeSettingByKeyAndName", removeSettingByKeyAndName);
|
|
497
|
+
// 根据key和name删除指定的settingItem
|
|
498
|
+
_define_property(Control, "removeSettingItemByKeyAndName", removeSettingByKeyAndName);
|
|
501
499
|
// 修改指定的settingItem的visible
|
|
502
500
|
_define_property(Control, "updateSettingItem", updateSetting);
|
|
503
501
|
export default Control;
|
|
@@ -533,6 +531,26 @@ export { Control as DesignerControl };
|
|
|
533
531
|
}
|
|
534
532
|
});
|
|
535
533
|
}
|
|
534
|
+
function removeSettingByKeyAndName(keyOrOptions, name) {
|
|
535
|
+
var _this = this;
|
|
536
|
+
var deleteOptions = typeof keyOrOptions === 'string' ? [
|
|
537
|
+
{
|
|
538
|
+
key: keyOrOptions,
|
|
539
|
+
name: name
|
|
540
|
+
}
|
|
541
|
+
] : keyOrOptions;
|
|
542
|
+
deleteOptions.forEach(function(deleteOption) {
|
|
543
|
+
var _this_setting;
|
|
544
|
+
// @ts-ignore
|
|
545
|
+
var settingIndex = (_this_setting = _this.setting) === null || _this_setting === void 0 ? void 0 : _this_setting.findIndex(function(option) {
|
|
546
|
+
return option.key === deleteOption.key && option.name === deleteOption.name;
|
|
547
|
+
});
|
|
548
|
+
if (settingIndex !== -1) {
|
|
549
|
+
// @ts-ignore
|
|
550
|
+
_this.setting.splice(settingIndex, 1);
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
}
|
|
536
554
|
/**
|
|
537
555
|
* @function 修改控件或者实例上的setting的方法
|
|
538
556
|
* @description 其中的this可能是DesignerControl的类,也可以是实例
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* name: base_property
|
|
3
|
+
* description: 基础属性定义。提供控件通用的隐藏状态、类名、样式、标题和默认状态配置,是表单、布局、列表等属性模型的公共基类。
|
|
4
|
+
*/ function _assert_this_initialized(self) {
|
|
5
|
+
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
5
6
|
return self;
|
|
6
7
|
}
|
|
7
8
|
function _call_super(_this, derived, args) {
|
|
@@ -9,14 +10,11 @@ function _call_super(_this, derived, args) {
|
|
|
9
10
|
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
11
|
}
|
|
11
12
|
function _class_call_check(instance, Constructor) {
|
|
12
|
-
if (!(instance instanceof Constructor))
|
|
13
|
-
throw new TypeError("Cannot call a class as a function");
|
|
14
|
-
}
|
|
13
|
+
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
|
|
15
14
|
}
|
|
16
15
|
function _construct(Parent, args, Class) {
|
|
17
|
-
if (_is_native_reflect_construct())
|
|
18
|
-
|
|
19
|
-
} else {
|
|
16
|
+
if (_is_native_reflect_construct()) _construct = Reflect.construct;
|
|
17
|
+
else {
|
|
20
18
|
_construct = function construct(Parent, args, Class) {
|
|
21
19
|
var a = [
|
|
22
20
|
null
|
|
@@ -38,9 +36,7 @@ function _define_property(obj, key, value) {
|
|
|
38
36
|
configurable: true,
|
|
39
37
|
writable: true
|
|
40
38
|
});
|
|
41
|
-
} else
|
|
42
|
-
obj[key] = value;
|
|
43
|
-
}
|
|
39
|
+
} else obj[key] = value;
|
|
44
40
|
return obj;
|
|
45
41
|
}
|
|
46
42
|
function _get_prototype_of(o) {
|
|
@@ -65,10 +61,16 @@ function _inherits(subClass, superClass) {
|
|
|
65
61
|
function _is_native_function(fn) {
|
|
66
62
|
return Function.toString.call(fn).indexOf("[native code]") !== -1;
|
|
67
63
|
}
|
|
64
|
+
function _is_native_reflect_construct() {
|
|
65
|
+
try {
|
|
66
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
67
|
+
} catch (_) {}
|
|
68
|
+
return (_is_native_reflect_construct = function() {
|
|
69
|
+
return !!result;
|
|
70
|
+
})();
|
|
71
|
+
}
|
|
68
72
|
function _possible_constructor_return(self, call) {
|
|
69
|
-
if (call && (_type_of(call) === "object" || typeof call === "function"))
|
|
70
|
-
return call;
|
|
71
|
-
}
|
|
73
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) return call;
|
|
72
74
|
return _assert_this_initialized(self);
|
|
73
75
|
}
|
|
74
76
|
function _set_prototype_of(o, p) {
|
|
@@ -84,11 +86,9 @@ function _type_of(obj) {
|
|
|
84
86
|
}
|
|
85
87
|
function _wrap_native_super(Class) {
|
|
86
88
|
var _cache = typeof Map === "function" ? new Map() : undefined;
|
|
87
|
-
_wrap_native_super = function
|
|
89
|
+
_wrap_native_super = function(Class) {
|
|
88
90
|
if (Class === null || !_is_native_function(Class)) return Class;
|
|
89
|
-
if (typeof Class !== "function")
|
|
90
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
91
|
-
}
|
|
91
|
+
if (typeof Class !== "function") throw new TypeError("Super expression must either be null or a function");
|
|
92
92
|
if (typeof _cache !== "undefined") {
|
|
93
93
|
if (_cache.has(Class)) return _cache.get(Class);
|
|
94
94
|
_cache.set(Class, Wrapper);
|
|
@@ -108,14 +108,6 @@ function _wrap_native_super(Class) {
|
|
|
108
108
|
};
|
|
109
109
|
return _wrap_native_super(Class);
|
|
110
110
|
}
|
|
111
|
-
function _is_native_reflect_construct() {
|
|
112
|
-
try {
|
|
113
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
114
|
-
} catch (_) {}
|
|
115
|
-
return (_is_native_reflect_construct = function() {
|
|
116
|
-
return !!result;
|
|
117
|
-
})();
|
|
118
|
-
}
|
|
119
111
|
import { BaseStyle } from '../../framework';
|
|
120
112
|
var PropertyRules = function PropertyRules(props) {
|
|
121
113
|
"use strict";
|
|
@@ -141,11 +133,30 @@ var PropertyRuntimeRules = /*#__PURE__*/ function(Array1) {
|
|
|
141
133
|
var caption = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';
|
|
142
134
|
_class_call_check(this, Property);
|
|
143
135
|
var _ref, _ref1;
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
136
|
+
/**
|
|
137
|
+
* 是否隐藏
|
|
138
|
+
* @public
|
|
139
|
+
* @defaultValue false
|
|
140
|
+
*/ _define_property(this, "isHide", void 0);
|
|
141
|
+
/**
|
|
142
|
+
* 类名
|
|
143
|
+
* @public
|
|
144
|
+
* @noSchema
|
|
145
|
+
*/ _define_property(this, "className", void 0);
|
|
146
|
+
/**
|
|
147
|
+
* 样式
|
|
148
|
+
* @public
|
|
149
|
+
* @noSchema
|
|
150
|
+
*/ _define_property(this, "style", void 0);
|
|
151
|
+
/**
|
|
152
|
+
* 标题
|
|
153
|
+
* @public
|
|
154
|
+
* @defaultValue ''
|
|
155
|
+
*/ _define_property(this, "caption", void 0);
|
|
156
|
+
/**
|
|
157
|
+
* 默认状态
|
|
158
|
+
* @public
|
|
159
|
+
*/ _define_property(this, "defaultState", void 0);
|
|
149
160
|
this.isHide = (_ref = props === null || props === void 0 ? void 0 : props.isHide) !== null && _ref !== void 0 ? _ref : false;
|
|
150
161
|
this.style = new BaseStyle(props === null || props === void 0 ? void 0 : props.style);
|
|
151
162
|
this.caption = (_ref1 = props === null || props === void 0 ? void 0 : props.caption) !== null && _ref1 !== void 0 ? _ref1 : caption;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
function _class_call_check(instance, Constructor) {
|
|
2
|
-
if (!(instance instanceof Constructor))
|
|
3
|
-
throw new TypeError("Cannot call a class as a function");
|
|
4
|
-
}
|
|
2
|
+
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
|
|
5
3
|
}
|
|
6
4
|
function _defineProperties(target, props) {
|
|
7
5
|
for(var i = 0; i < props.length; i++){
|
|
@@ -25,18 +23,14 @@ function _define_property(obj, key, value) {
|
|
|
25
23
|
configurable: true,
|
|
26
24
|
writable: true
|
|
27
25
|
});
|
|
28
|
-
} else
|
|
29
|
-
obj[key] = value;
|
|
30
|
-
}
|
|
26
|
+
} else obj[key] = value;
|
|
31
27
|
return obj;
|
|
32
28
|
}
|
|
33
29
|
function _instanceof(left, right) {
|
|
34
30
|
"@swc/helpers - instanceof";
|
|
35
31
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
36
32
|
return !!right[Symbol.hasInstance](left);
|
|
37
|
-
} else
|
|
38
|
-
return left instanceof right;
|
|
39
|
-
}
|
|
33
|
+
} else return left instanceof right;
|
|
40
34
|
}
|
|
41
35
|
import Property from './property';
|
|
42
36
|
import { genNonDuplicateId, referenceError } from '@byteluck-fe/model-driven-shared';
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
function _assert_this_initialized(self) {
|
|
2
|
-
if (self === void 0)
|
|
3
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
|
-
}
|
|
2
|
+
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
5
3
|
return self;
|
|
6
4
|
}
|
|
7
5
|
function _call_super(_this, derived, args) {
|
|
@@ -9,9 +7,7 @@ function _call_super(_this, derived, args) {
|
|
|
9
7
|
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
8
|
}
|
|
11
9
|
function _class_call_check(instance, Constructor) {
|
|
12
|
-
if (!(instance instanceof Constructor))
|
|
13
|
-
throw new TypeError("Cannot call a class as a function");
|
|
14
|
-
}
|
|
10
|
+
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
|
|
15
11
|
}
|
|
16
12
|
function _defineProperties(target, props) {
|
|
17
13
|
for(var i = 0; i < props.length; i++){
|
|
@@ -35,22 +31,17 @@ function _define_property(obj, key, value) {
|
|
|
35
31
|
configurable: true,
|
|
36
32
|
writable: true
|
|
37
33
|
});
|
|
38
|
-
} else
|
|
39
|
-
obj[key] = value;
|
|
40
|
-
}
|
|
34
|
+
} else obj[key] = value;
|
|
41
35
|
return obj;
|
|
42
36
|
}
|
|
43
37
|
function _get(target, property, receiver) {
|
|
44
|
-
if (typeof Reflect !== "undefined" && Reflect.get)
|
|
45
|
-
|
|
46
|
-
} else {
|
|
38
|
+
if (typeof Reflect !== "undefined" && Reflect.get) _get = Reflect.get;
|
|
39
|
+
else {
|
|
47
40
|
_get = function get(target, property, receiver) {
|
|
48
41
|
var base = _super_prop_base(target, property);
|
|
49
42
|
if (!base) return;
|
|
50
43
|
var desc = Object.getOwnPropertyDescriptor(base, property);
|
|
51
|
-
if (desc.get)
|
|
52
|
-
return desc.get.call(receiver || target);
|
|
53
|
-
}
|
|
44
|
+
if (desc.get) return desc.get.call(receiver || target);
|
|
54
45
|
return desc.value;
|
|
55
46
|
};
|
|
56
47
|
}
|
|
@@ -75,6 +66,14 @@ function _inherits(subClass, superClass) {
|
|
|
75
66
|
});
|
|
76
67
|
if (superClass) _set_prototype_of(subClass, superClass);
|
|
77
68
|
}
|
|
69
|
+
function _is_native_reflect_construct() {
|
|
70
|
+
try {
|
|
71
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
72
|
+
} catch (_) {}
|
|
73
|
+
return (_is_native_reflect_construct = function() {
|
|
74
|
+
return !!result;
|
|
75
|
+
})();
|
|
76
|
+
}
|
|
78
77
|
function _object_spread(target) {
|
|
79
78
|
for(var i = 1; i < arguments.length; i++){
|
|
80
79
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
@@ -105,9 +104,8 @@ function ownKeys(object, enumerableOnly) {
|
|
|
105
104
|
}
|
|
106
105
|
function _object_spread_props(target, source) {
|
|
107
106
|
source = source != null ? source : {};
|
|
108
|
-
if (Object.getOwnPropertyDescriptors)
|
|
109
|
-
|
|
110
|
-
} else {
|
|
107
|
+
if (Object.getOwnPropertyDescriptors) Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
108
|
+
else {
|
|
111
109
|
ownKeys(Object(source)).forEach(function(key) {
|
|
112
110
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
113
111
|
});
|
|
@@ -115,9 +113,7 @@ function _object_spread_props(target, source) {
|
|
|
115
113
|
return target;
|
|
116
114
|
}
|
|
117
115
|
function _possible_constructor_return(self, call) {
|
|
118
|
-
if (call && (_type_of(call) === "object" || typeof call === "function"))
|
|
119
|
-
return call;
|
|
120
|
-
}
|
|
116
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) return call;
|
|
121
117
|
return _assert_this_initialized(self);
|
|
122
118
|
}
|
|
123
119
|
function _set_prototype_of(o, p) {
|
|
@@ -138,14 +134,6 @@ function _type_of(obj) {
|
|
|
138
134
|
"@swc/helpers - typeof";
|
|
139
135
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
140
136
|
}
|
|
141
|
-
function _is_native_reflect_construct() {
|
|
142
|
-
try {
|
|
143
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
144
|
-
} catch (_) {}
|
|
145
|
-
return (_is_native_reflect_construct = function() {
|
|
146
|
-
return !!result;
|
|
147
|
-
})();
|
|
148
|
-
}
|
|
149
137
|
import { defineControlArrayToProperty } from '../ControlArray';
|
|
150
138
|
import { DesignerControl } from '../BaseControl';
|
|
151
139
|
import ColumnControlProperty from './property';
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
function _assert_this_initialized(self) {
|
|
2
|
-
if (self === void 0)
|
|
3
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
|
-
}
|
|
2
|
+
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
5
3
|
return self;
|
|
6
4
|
}
|
|
7
5
|
function _call_super(_this, derived, args) {
|
|
@@ -9,9 +7,7 @@ function _call_super(_this, derived, args) {
|
|
|
9
7
|
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
8
|
}
|
|
11
9
|
function _class_call_check(instance, Constructor) {
|
|
12
|
-
if (!(instance instanceof Constructor))
|
|
13
|
-
throw new TypeError("Cannot call a class as a function");
|
|
14
|
-
}
|
|
10
|
+
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
|
|
15
11
|
}
|
|
16
12
|
function _define_property(obj, key, value) {
|
|
17
13
|
if (key in obj) {
|
|
@@ -21,9 +17,7 @@ function _define_property(obj, key, value) {
|
|
|
21
17
|
configurable: true,
|
|
22
18
|
writable: true
|
|
23
19
|
});
|
|
24
|
-
} else
|
|
25
|
-
obj[key] = value;
|
|
26
|
-
}
|
|
20
|
+
} else obj[key] = value;
|
|
27
21
|
return obj;
|
|
28
22
|
}
|
|
29
23
|
function _get_prototype_of(o) {
|
|
@@ -45,10 +39,16 @@ function _inherits(subClass, superClass) {
|
|
|
45
39
|
});
|
|
46
40
|
if (superClass) _set_prototype_of(subClass, superClass);
|
|
47
41
|
}
|
|
42
|
+
function _is_native_reflect_construct() {
|
|
43
|
+
try {
|
|
44
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
45
|
+
} catch (_) {}
|
|
46
|
+
return (_is_native_reflect_construct = function() {
|
|
47
|
+
return !!result;
|
|
48
|
+
})();
|
|
49
|
+
}
|
|
48
50
|
function _possible_constructor_return(self, call) {
|
|
49
|
-
if (call && (_type_of(call) === "object" || typeof call === "function"))
|
|
50
|
-
return call;
|
|
51
|
-
}
|
|
51
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) return call;
|
|
52
52
|
return _assert_this_initialized(self);
|
|
53
53
|
}
|
|
54
54
|
function _set_prototype_of(o, p) {
|
|
@@ -62,15 +62,10 @@ function _type_of(obj) {
|
|
|
62
62
|
"@swc/helpers - typeof";
|
|
63
63
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
64
64
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return (_is_native_reflect_construct = function() {
|
|
70
|
-
return !!result;
|
|
71
|
-
})();
|
|
72
|
-
}
|
|
73
|
-
import { Property, PropertyRules } from '../BaseControl';
|
|
65
|
+
/**
|
|
66
|
+
* name: base_column_control_property
|
|
67
|
+
* description: 列控件基础属性定义。提供列宽、标题、数据绑定、自适应宽度、冻结、排序、对齐、跨列、自动高度和子控件配置。
|
|
68
|
+
*/ import { Property, PropertyRules } from '../BaseControl';
|
|
74
69
|
import { initOptionAndDataSourceRules } from '../initOptionAndDataSourceRules';
|
|
75
70
|
import { DataBind, AutoWidth } from '../../framework';
|
|
76
71
|
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
@@ -108,7 +103,34 @@ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
|
108
103
|
var _ref, _ref1, _ref2, _ref3, _ref4;
|
|
109
104
|
_this = _call_super(this, ColumnControlProperty, [
|
|
110
105
|
props
|
|
111
|
-
]),
|
|
106
|
+
]), /**
|
|
107
|
+
* 宽度类型
|
|
108
|
+
* @defaultValue 'auto'
|
|
109
|
+
*/ _define_property(_this, "widthType", void 0), /**
|
|
110
|
+
* 宽度
|
|
111
|
+
* @defaultValue 150
|
|
112
|
+
*/ _define_property(_this, "width", void 0), /**
|
|
113
|
+
* 标题
|
|
114
|
+
*/ _define_property(_this, "caption", void 0), /**
|
|
115
|
+
* 绑定数据项
|
|
116
|
+
*/ _define_property(_this, "dataBind", void 0), /**
|
|
117
|
+
* 自适应页面宽度
|
|
118
|
+
*/ _define_property(_this, "autoWidth", void 0), /**
|
|
119
|
+
* 冻结
|
|
120
|
+
* @defaultValue 'none'
|
|
121
|
+
*/ _define_property(_this, "fixed", void 0), /**
|
|
122
|
+
* 表头排序
|
|
123
|
+
* @defaultValue true
|
|
124
|
+
*/ _define_property(_this, "sort", void 0), /**
|
|
125
|
+
* 对齐
|
|
126
|
+
*/ _define_property(_this, "align", void 0), /**
|
|
127
|
+
* @internal
|
|
128
|
+
*/ _define_property(_this, "colSpan", void 0), /**
|
|
129
|
+
* 自动高度
|
|
130
|
+
* @defaultValue false
|
|
131
|
+
*/ _define_property(_this, "autoHeight", void 0), /**
|
|
132
|
+
* 子控件
|
|
133
|
+
*/ _define_property(_this, "children", void 0);
|
|
112
134
|
_this.width = (_ref = props === null || props === void 0 ? void 0 : props.width) !== null && _ref !== void 0 ? _ref : 150;
|
|
113
135
|
_this.widthType = (props === null || props === void 0 ? void 0 : props.widthType) || 'auto';
|
|
114
136
|
_this.caption = (_ref1 = props === null || props === void 0 ? void 0 : props.caption) !== null && _ref1 !== void 0 ? _ref1 : '';
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
function _assert_this_initialized(self) {
|
|
2
|
-
if (self === void 0)
|
|
3
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
|
-
}
|
|
2
|
+
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
5
3
|
return self;
|
|
6
4
|
}
|
|
7
5
|
function _call_super(_this, derived, args) {
|
|
@@ -9,9 +7,7 @@ function _call_super(_this, derived, args) {
|
|
|
9
7
|
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
8
|
}
|
|
11
9
|
function _class_call_check(instance, Constructor) {
|
|
12
|
-
if (!(instance instanceof Constructor))
|
|
13
|
-
throw new TypeError("Cannot call a class as a function");
|
|
14
|
-
}
|
|
10
|
+
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
|
|
15
11
|
}
|
|
16
12
|
function _define_property(obj, key, value) {
|
|
17
13
|
if (key in obj) {
|
|
@@ -21,9 +17,7 @@ function _define_property(obj, key, value) {
|
|
|
21
17
|
configurable: true,
|
|
22
18
|
writable: true
|
|
23
19
|
});
|
|
24
|
-
} else
|
|
25
|
-
obj[key] = value;
|
|
26
|
-
}
|
|
20
|
+
} else obj[key] = value;
|
|
27
21
|
return obj;
|
|
28
22
|
}
|
|
29
23
|
function _get_prototype_of(o) {
|
|
@@ -45,10 +39,16 @@ function _inherits(subClass, superClass) {
|
|
|
45
39
|
});
|
|
46
40
|
if (superClass) _set_prototype_of(subClass, superClass);
|
|
47
41
|
}
|
|
42
|
+
function _is_native_reflect_construct() {
|
|
43
|
+
try {
|
|
44
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
45
|
+
} catch (_) {}
|
|
46
|
+
return (_is_native_reflect_construct = function() {
|
|
47
|
+
return !!result;
|
|
48
|
+
})();
|
|
49
|
+
}
|
|
48
50
|
function _possible_constructor_return(self, call) {
|
|
49
|
-
if (call && (_type_of(call) === "object" || typeof call === "function"))
|
|
50
|
-
return call;
|
|
51
|
-
}
|
|
51
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) return call;
|
|
52
52
|
return _assert_this_initialized(self);
|
|
53
53
|
}
|
|
54
54
|
function _set_prototype_of(o, p) {
|
|
@@ -62,14 +62,6 @@ function _type_of(obj) {
|
|
|
62
62
|
"@swc/helpers - typeof";
|
|
63
63
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
64
64
|
}
|
|
65
|
-
function _is_native_reflect_construct() {
|
|
66
|
-
try {
|
|
67
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
68
|
-
} catch (_) {}
|
|
69
|
-
return (_is_native_reflect_construct = function() {
|
|
70
|
-
return !!result;
|
|
71
|
-
})();
|
|
72
|
-
}
|
|
73
65
|
import { defineControlArrayToProperty } from '../ControlArray';
|
|
74
66
|
import { RuntimeControl } from '../BaseControl';
|
|
75
67
|
import ColumnControlProperty from './property';
|
|
@@ -7,10 +7,12 @@ function _array_without_holes(arr) {
|
|
|
7
7
|
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
8
|
}
|
|
9
9
|
function _iterable_to_array(iter) {
|
|
10
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
|
|
10
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) {
|
|
11
|
+
return Array.from(iter);
|
|
12
|
+
}
|
|
11
13
|
}
|
|
12
14
|
function _non_iterable_spread() {
|
|
13
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance
|
|
15
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
14
16
|
}
|
|
15
17
|
function _to_consumable_array(arr) {
|
|
16
18
|
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|