@byteluck-fe/model-driven-upgrade 2.8.1-beta.15 → 2.8.1-beta.18
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/VersionBuilder.js +7 -7
- package/dist/esm/upgrade/v1_0.js +20 -20
- package/dist/esm/upgrade/v2_6.js +2 -2
- package/dist/esm/upgrade/v2_8.js +1 -1
- package/dist/esm/upgrade/v3_0.js +3 -3
- package/dist/esm/upgrade/v3_1.js +6 -6
- package/dist/esm/upgrade/v3_3.js +1 -7
- package/dist/index.umd.js +1 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _class_call_check(instance, Constructor) {
|
|
2
2
|
if (!(instance instanceof Constructor)) {
|
|
3
3
|
throw new TypeError("Cannot call a class as a function");
|
|
4
4
|
}
|
|
@@ -12,12 +12,12 @@ function _defineProperties(target, props) {
|
|
|
12
12
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
16
16
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
17
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
18
|
return Constructor;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function _define_property(obj, key, value) {
|
|
21
21
|
if (key in obj) {
|
|
22
22
|
Object.defineProperty(obj, key, {
|
|
23
23
|
value: value,
|
|
@@ -50,9 +50,9 @@ export var VersionBuilder = /*#__PURE__*/ function() {
|
|
|
50
50
|
"use strict";
|
|
51
51
|
function VersionBuilder(schemaVersion) {
|
|
52
52
|
var version = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : nowVersion;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
_class_call_check(this, VersionBuilder);
|
|
54
|
+
_define_property(this, "toVersion", void 0);
|
|
55
|
+
_define_property(this, "schemaVersion", void 0);
|
|
56
56
|
this.schemaVersion = schemaVersion;
|
|
57
57
|
this.toVersion = version;
|
|
58
58
|
// if (versionToNumber(version) > versionToNumber(nowVersion)) {
|
|
@@ -62,7 +62,7 @@ export var VersionBuilder = /*#__PURE__*/ function() {
|
|
|
62
62
|
error("Version Builder: Please give me a valid version number, The valid version is: ".concat(versionKeys.join(","), ", But give me a ").concat(schemaVersion));
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
_create_class(VersionBuilder, [
|
|
66
66
|
{
|
|
67
67
|
key: "dataCleaner",
|
|
68
68
|
value: function dataCleaner1(schema, payload) {
|
package/dist/esm/upgrade/v1_0.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
3
3
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
4
|
return arr2;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
6
|
+
function _array_with_holes(arr) {
|
|
7
7
|
if (Array.isArray(arr)) return arr;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
if (Array.isArray(arr)) return
|
|
9
|
+
function _array_without_holes(arr) {
|
|
10
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function _iterable_to_array(iter) {
|
|
13
13
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function _iterable_to_array_limit(arr, i) {
|
|
16
16
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
17
17
|
if (_i == null) return;
|
|
18
18
|
var _arr = [];
|
|
@@ -36,25 +36,25 @@ function _iterableToArrayLimit(arr, i) {
|
|
|
36
36
|
}
|
|
37
37
|
return _arr;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function _non_iterable_rest() {
|
|
40
40
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function _non_iterable_spread() {
|
|
43
43
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
return
|
|
45
|
+
function _sliced_to_array(arr, i) {
|
|
46
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
return
|
|
48
|
+
function _to_consumable_array(arr) {
|
|
49
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
52
52
|
if (!o) return;
|
|
53
|
-
if (typeof o === "string") return
|
|
53
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
54
54
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
55
55
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
56
56
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
57
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return
|
|
57
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
58
58
|
}
|
|
59
59
|
import { loop, toNumberOrEmpty, isLanguageObject, camelizeKeys, decamelizeKeys, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
|
|
60
60
|
import { DataSourceBind } from "@byteluck-fe/model-driven-core";
|
|
@@ -419,7 +419,7 @@ function conversionLayoutControl(schemArray) {
|
|
|
419
419
|
if (!(item && item.children)) return;
|
|
420
420
|
var controlArray = item.children;
|
|
421
421
|
for(var i = 0; i < controlArray.length; i++){
|
|
422
|
-
var
|
|
422
|
+
var _controlArray_i_children, _controlArray_i;
|
|
423
423
|
var control = controlArray[i];
|
|
424
424
|
var child = (_controlArray_i = controlArray[i]) === null || _controlArray_i === void 0 ? void 0 : (_controlArray_i_children = _controlArray_i.children) === null || _controlArray_i_children === void 0 ? void 0 : _controlArray_i_children[0];
|
|
425
425
|
if (control.type === "grid-row" && child && [
|
|
@@ -443,7 +443,7 @@ function conversionListPage(controlArray, payload) {
|
|
|
443
443
|
}
|
|
444
444
|
// children = search + toolbox + table
|
|
445
445
|
var listPageProps = listPage.props, children = listPage.children;
|
|
446
|
-
var _children =
|
|
446
|
+
var _children = _sliced_to_array(children, 3), search = _children[0], toolbox = _children[1], table = _children[2];
|
|
447
447
|
conversionSearch(search);
|
|
448
448
|
table.props.is_fixed_header = listPageProps === null || listPageProps === void 0 ? void 0 : (_listPageProps_source_config = listPageProps.source_config) === null || _listPageProps_source_config === void 0 ? void 0 : _listPageProps_source_config.is_fixed_header;
|
|
449
449
|
// table.props.datasource_bind = new DataSourceBind({
|
|
@@ -488,7 +488,7 @@ function conversionSearch(searchControl) {
|
|
|
488
488
|
item.placeholderEnd = placeholder;
|
|
489
489
|
}
|
|
490
490
|
if (item.type === "date-pick") {
|
|
491
|
-
var
|
|
491
|
+
var _item_dateType_replace, _item_dateType;
|
|
492
492
|
item.type = "search-date-range";
|
|
493
493
|
item.placeholderStart = placeholder;
|
|
494
494
|
item.placeholderEnd = placeholder;
|
|
@@ -631,7 +631,7 @@ function conversionControlEvents(control, controlEvents) {
|
|
|
631
631
|
if (!controlEvents[control.id][eventKey]) {
|
|
632
632
|
controlEvents[control.id][eventKey] = [];
|
|
633
633
|
}
|
|
634
|
-
(_controlEvents_control_id_eventKey = controlEvents[control.id][eventKey]).push.apply(_controlEvents_control_id_eventKey,
|
|
634
|
+
(_controlEvents_control_id_eventKey = controlEvents[control.id][eventKey]).push.apply(_controlEvents_control_id_eventKey, _to_consumable_array(control.props.events[eventKey].map(function(item) {
|
|
635
635
|
return item.name;
|
|
636
636
|
})));
|
|
637
637
|
});
|
|
@@ -641,7 +641,7 @@ function conversionControlEvents(control, controlEvents) {
|
|
|
641
641
|
if (!controlEvents[control.id].on_change) {
|
|
642
642
|
controlEvents[control.id].on_change = [];
|
|
643
643
|
}
|
|
644
|
-
(_controlEvents_control_id_on_change = controlEvents[control.id].on_change).push.apply(_controlEvents_control_id_on_change,
|
|
644
|
+
(_controlEvents_control_id_on_change = controlEvents[control.id].on_change).push.apply(_controlEvents_control_id_on_change, _to_consumable_array(controlEvents[control.id].on_blur));
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
647
|
export { dataCleaner };
|
package/dist/esm/upgrade/v2_6.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
2
|
if (key in obj) {
|
|
3
3
|
Object.defineProperty(obj, key, {
|
|
4
4
|
value: value,
|
|
@@ -29,7 +29,7 @@ function setFieldTypeToDataBind(DataBind, fieldType) {
|
|
|
29
29
|
}
|
|
30
30
|
function conversion(schema, payload) {
|
|
31
31
|
var _obj;
|
|
32
|
-
var fieldTypeMap = (_obj = {},
|
|
32
|
+
var fieldTypeMap = (_obj = {}, _define_property(_obj, CONTROL_TYPE.TITLE, FieldTypes.AUTO_NUMBER), _define_property(_obj, CONTROL_TYPE.ADDRESS, FieldTypes.ADDRESS), _define_property(_obj, CONTROL_TYPE.ATTACHMENT, FieldTypes.FILE), _define_property(_obj, CONTROL_TYPE.AUTO_NUMBER, FieldTypes.AUTO_NUMBER), _define_property(_obj, CONTROL_TYPE.CHECKBOX, FieldTypes.ARRAY), _define_property(_obj, CONTROL_TYPE.DATE_PICKER, FieldTypes.TIMESTAMP), _define_property(_obj, CONTROL_TYPE.DEPARTMENT, FieldTypes.DEPARTMENTS), _define_property(_obj, CONTROL_TYPE.DEPARTMENT2, FieldTypes.DEPARTMENTS), _define_property(_obj, CONTROL_TYPE.EMPLOYEE, FieldTypes.EMPLOYEES), _define_property(_obj, CONTROL_TYPE.EMPLOYEE2, FieldTypes.EMPLOYEES), _define_property(_obj, CONTROL_TYPE.IMAGE, FieldTypes.IMAGE), _define_property(_obj, CONTROL_TYPE.INPUT, FieldTypes.VARCHAR), _define_property(_obj, CONTROL_TYPE.NUMBER, FieldTypes.DECIMAL), _define_property(_obj, CONTROL_TYPE.RADIO, FieldTypes.VARCHAR), _define_property(_obj, CONTROL_TYPE.RICH_TEXT, FieldTypes.TEXT), _define_property(_obj, CONTROL_TYPE.SCORE, FieldTypes.DECIMAL), _define_property(_obj, CONTROL_TYPE.SELECT, FieldTypes.VARCHAR), _define_property(_obj, CONTROL_TYPE.SELECT_MULTIPLE, FieldTypes.ARRAY), _define_property(_obj, CONTROL_TYPE.SELECT_RELATION, FieldTypes.VARCHAR), _define_property(_obj, CONTROL_TYPE.TEXTAREA, FieldTypes.TEXT), _define_property(_obj, CONTROL_TYPE.TREE, FieldTypes.ARRAY), _define_property(_obj, CONTROL_TYPE.SEARCH_DATE_RANGE, FieldTypes.ARRAY), _define_property(_obj, CONTROL_TYPE.SEARCH_INPUT, FieldTypes.VARCHAR), _define_property(_obj, CONTROL_TYPE.SEARCH_NUMBER_RANGE, FieldTypes.ARRAY), _obj);
|
|
33
33
|
if (fieldTypeMap.hasOwnProperty(schema.type)) {
|
|
34
34
|
// @ts-ignore
|
|
35
35
|
setFieldTypeToDataBind(schema.props.data_bind, fieldTypeMap[schema.type]);
|
package/dist/esm/upgrade/v2_8.js
CHANGED
|
@@ -14,7 +14,7 @@ function conversion(schema, payload) {
|
|
|
14
14
|
if (schema.type === CONTROL_TYPE.SIMPLE_SEARCH && schema.children.length) {
|
|
15
15
|
if (!schema.props.query_type_map) schema.props.query_type_map = [];
|
|
16
16
|
schema.children.forEach(function(item) {
|
|
17
|
-
var
|
|
17
|
+
var _item_props_data_bind, _item_props;
|
|
18
18
|
if ([
|
|
19
19
|
FieldTypes.VARCHAR,
|
|
20
20
|
FieldTypes.TEXT,
|
package/dist/esm/upgrade/v3_0.js
CHANGED
|
@@ -60,7 +60,7 @@ function conversion(schema, payload) {
|
|
|
60
60
|
if ((_item_props7 = item.props) === null || _item_props7 === void 0 ? void 0 : _item_props7.check.is_show) {
|
|
61
61
|
item.children.push(optbtn.toSchema());
|
|
62
62
|
}
|
|
63
|
-
(_item_props8 = item.props) === null || _item_props8 === void 0 ?
|
|
63
|
+
(_item_props8 = item.props) === null || _item_props8 === void 0 ? true : delete _item_props8.check;
|
|
64
64
|
}
|
|
65
65
|
if (((_item_props1 = item.props) === null || _item_props1 === void 0 ? void 0 : _item_props1.edit) !== undefined) {
|
|
66
66
|
var _item_props9, _item_props10, _item_props11, _item_props12, _item_props13, _item_props14;
|
|
@@ -78,7 +78,7 @@ function conversion(schema, payload) {
|
|
|
78
78
|
if ((_item_props13 = item.props) === null || _item_props13 === void 0 ? void 0 : _item_props13.edit.is_show) {
|
|
79
79
|
item.children.push(optbtn1.toSchema());
|
|
80
80
|
}
|
|
81
|
-
(_item_props14 = item.props) === null || _item_props14 === void 0 ?
|
|
81
|
+
(_item_props14 = item.props) === null || _item_props14 === void 0 ? true : delete _item_props14.edit;
|
|
82
82
|
}
|
|
83
83
|
if (((_item_props2 = item.props) === null || _item_props2 === void 0 ? void 0 : _item_props2.delete) !== undefined) {
|
|
84
84
|
var _item_props15, _item_props16, _item_props17, _item_props18, _item_props19, _item_props20;
|
|
@@ -98,7 +98,7 @@ function conversion(schema, payload) {
|
|
|
98
98
|
if ((_item_props19 = item.props) === null || _item_props19 === void 0 ? void 0 : _item_props19.delete.is_show) {
|
|
99
99
|
item.children.push(optbtn2.toSchema());
|
|
100
100
|
}
|
|
101
|
-
(_item_props20 = item.props) === null || _item_props20 === void 0 ?
|
|
101
|
+
(_item_props20 = item.props) === null || _item_props20 === void 0 ? true : delete _item_props20.delete;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
});
|
package/dist/esm/upgrade/v3_1.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Date: 2023-02-16 14:45:22
|
|
5
5
|
* @LastEditors: SuperLuckyqi
|
|
6
6
|
* @LastEditTime: 2024-01-11 08:12:17
|
|
7
|
-
*/ function
|
|
7
|
+
*/ function _define_property(obj, key, value) {
|
|
8
8
|
if (key in obj) {
|
|
9
9
|
Object.defineProperty(obj, key, {
|
|
10
10
|
value: value,
|
|
@@ -66,7 +66,7 @@ function conversion(schema, payload) {
|
|
|
66
66
|
}
|
|
67
67
|
var _obj;
|
|
68
68
|
//默认值 赋值
|
|
69
|
-
var addKeysDefaultValueMapping = (_obj = {},
|
|
69
|
+
var addKeysDefaultValueMapping = (_obj = {}, _define_property(_obj, CONTROL_TYPE.SUBTABLE, [
|
|
70
70
|
{
|
|
71
71
|
key: "page_index",
|
|
72
72
|
value: 1
|
|
@@ -88,7 +88,7 @@ function conversion(schema, payload) {
|
|
|
88
88
|
key: "total_count",
|
|
89
89
|
value: 0
|
|
90
90
|
}
|
|
91
|
-
]),
|
|
91
|
+
]), _define_property(_obj, CONTROL_TYPE.GRID_TABLE, [
|
|
92
92
|
{
|
|
93
93
|
key: "page_index",
|
|
94
94
|
value: 1
|
|
@@ -114,7 +114,7 @@ function conversion(schema, payload) {
|
|
|
114
114
|
key: "is_show_selection",
|
|
115
115
|
value: false
|
|
116
116
|
}
|
|
117
|
-
]),
|
|
117
|
+
]), _define_property(_obj, CONTROL_TYPE.LIST_VIEW, [
|
|
118
118
|
{
|
|
119
119
|
key: "selection_type",
|
|
120
120
|
value: "multiple"
|
|
@@ -127,7 +127,7 @@ function conversion(schema, payload) {
|
|
|
127
127
|
key: "is_show_selection",
|
|
128
128
|
value: false
|
|
129
129
|
}
|
|
130
|
-
]),
|
|
130
|
+
]), _define_property(_obj, CONTROL_TYPE.SIMPLE_SEARCH, [
|
|
131
131
|
{
|
|
132
132
|
key: "col-gap",
|
|
133
133
|
value: 24
|
|
@@ -136,7 +136,7 @@ function conversion(schema, payload) {
|
|
|
136
136
|
key: "child-min-width",
|
|
137
137
|
value: 230
|
|
138
138
|
}
|
|
139
|
-
]),
|
|
139
|
+
]), _define_property(_obj, CONTROL_TYPE.IMPORT_RECORD_LIST_BUTTON, [
|
|
140
140
|
{
|
|
141
141
|
key: "template-type",
|
|
142
142
|
value: "system"
|
package/dist/esm/upgrade/v3_3.js
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @Description: subtable-column 数据转换
|
|
3
|
-
* @Autor: SuperLucky-Q
|
|
4
|
-
* @Date: 2023-02-16 14:45:22
|
|
5
|
-
* @LastEditors: SuperLuckyqi
|
|
6
|
-
* @LastEditTime: 2023-12-21 11:12:25
|
|
7
|
-
*/ import { loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
|
|
1
|
+
import { loop, CONTROL_TYPE } from "@byteluck-fe/model-driven-shared";
|
|
8
2
|
var dataCleaner = function(schemaItems, payload) {
|
|
9
3
|
var isArray = Array.isArray(schemaItems);
|
|
10
4
|
var schemaArray = isArray ? schemaItems : [
|