@byteluck-fe/model-driven-core 2.7.0-alpha.11 → 2.7.0-alpha.13
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/api-doc-index.js +4 -4
- package/dist/esm/common/BaseControl/designer.js +222 -103
- package/dist/esm/common/BaseControl/index.js +7 -7
- package/dist/esm/common/BaseControl/property.js +42 -14
- package/dist/esm/common/BaseControl/runtime.js +41 -20
- package/dist/esm/common/ColumnControl/designer.js +19 -5
- package/dist/esm/common/ColumnControl/index.js +6 -6
- package/dist/esm/common/ColumnControl/property.js +95 -47
- package/dist/esm/common/ColumnControl/runtime.js +19 -5
- package/dist/esm/common/ControlArray.js +8 -8
- package/dist/esm/common/FormControl/designer.js +25 -10
- package/dist/esm/common/FormControl/index.js +6 -6
- package/dist/esm/common/FormControl/property.js +152 -87
- package/dist/esm/common/FormControl/runtime.js +20 -5
- package/dist/esm/common/LayoutControl/designer.js +158 -30
- package/dist/esm/common/LayoutControl/index.js +6 -6
- package/dist/esm/common/LayoutControl/property.js +3 -3
- package/dist/esm/common/LayoutControl/runtime.js +22 -7
- package/dist/esm/common/ListControl/designer.js +153 -28
- package/dist/esm/common/ListControl/index.js +6 -6
- package/dist/esm/common/ListControl/property.js +20 -5
- package/dist/esm/common/ListControl/runtime.js +22 -7
- package/dist/esm/common/SearchViewControl/designer.js +19 -5
- package/dist/esm/common/SearchViewControl/index.js +6 -6
- package/dist/esm/common/SearchViewControl/property.js +18 -4
- package/dist/esm/common/SearchViewControl/runtime.js +19 -5
- package/dist/esm/common/Validator.js +5 -5
- package/dist/esm/common/WrapControl/designer.js +19 -5
- package/dist/esm/common/WrapControl/index.js +6 -6
- package/dist/esm/common/WrapControl/property.js +3 -3
- package/dist/esm/common/WrapControl/runtime.js +19 -5
- package/dist/esm/common/controlHooksEmitter.js +1 -1
- package/dist/esm/common/index.js +12 -12
- package/dist/esm/common/initLinkOperationRules.js +6 -6
- package/dist/esm/common/initOptionAndDataSourceRules.js +82 -82
- package/dist/esm/framework/RegisterControls.js +28 -17
- package/dist/esm/framework/index.js +769 -332
- package/dist/esm/framework/isDataBind.js +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/index.umd.js +1 -1
- package/dist/types/common/Validator.d.ts +1 -1
- package/dist/types/common/controlHooksEmitter.d.ts +1 -1
- package/dist/types/type.d.ts +23 -23
- package/package.json +3 -3
|
@@ -17,38 +17,58 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
|
17
17
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
18
|
return Constructor;
|
|
19
19
|
}
|
|
20
|
+
function _defineProperty(obj, key, value) {
|
|
21
|
+
if (key in obj) {
|
|
22
|
+
Object.defineProperty(obj, key, {
|
|
23
|
+
value: value,
|
|
24
|
+
enumerable: true,
|
|
25
|
+
configurable: true,
|
|
26
|
+
writable: true
|
|
27
|
+
});
|
|
28
|
+
} else {
|
|
29
|
+
obj[key] = value;
|
|
30
|
+
}
|
|
31
|
+
return obj;
|
|
32
|
+
}
|
|
20
33
|
function _instanceof(left, right) {
|
|
21
34
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
22
|
-
return right[Symbol.hasInstance](left);
|
|
35
|
+
return !!right[Symbol.hasInstance](left);
|
|
23
36
|
} else {
|
|
24
37
|
return left instanceof right;
|
|
25
38
|
}
|
|
26
39
|
}
|
|
27
|
-
import Property from
|
|
28
|
-
import { genNonDuplicateId, referenceError } from
|
|
29
|
-
import { PAGE_STATUS } from
|
|
40
|
+
import Property from "./property";
|
|
41
|
+
import { genNonDuplicateId, referenceError } from "@byteluck-fe/model-driven-shared";
|
|
42
|
+
import { PAGE_STATUS } from "../../framework";
|
|
30
43
|
var Control = /*#__PURE__*/ function _target() {
|
|
31
44
|
"use strict";
|
|
32
45
|
function Control(props) {
|
|
33
46
|
_classCallCheck(this, Control);
|
|
34
|
-
this
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
_defineProperty(this, "id", void 0 // 唯一标识符
|
|
48
|
+
);
|
|
49
|
+
_defineProperty(this, "type", void 0);
|
|
50
|
+
_defineProperty(this, "controlType", void 0);
|
|
51
|
+
_defineProperty(this, "props", void 0);
|
|
52
|
+
_defineProperty(this, "fieldType", void 0);
|
|
53
|
+
_defineProperty(this, "customEvents", []);
|
|
54
|
+
_defineProperty(this, "pageStatus", void 0);
|
|
55
|
+
_defineProperty(this, "parent", null);
|
|
56
|
+
var _ref = _instanceof(this, Control) ? this.constructor : void 0, controlType = _ref.controlType, controlFieldType = _ref.controlFieldType, name = _ref.name, controlCustomEvents = _ref.controlCustomEvents;
|
|
37
57
|
if (!controlType) {
|
|
38
58
|
referenceError("The ".concat(name, " controlType is not define"));
|
|
39
59
|
}
|
|
40
|
-
var
|
|
41
|
-
this.id = (
|
|
42
|
-
var
|
|
43
|
-
this.type = (
|
|
60
|
+
var _props_id;
|
|
61
|
+
this.id = (_props_id = props === null || props === void 0 ? void 0 : props.id) !== null && _props_id !== void 0 ? _props_id : genNonDuplicateId(10);
|
|
62
|
+
var _props_type;
|
|
63
|
+
this.type = (_props_type = props === null || props === void 0 ? void 0 : props.type) !== null && _props_type !== void 0 ? _props_type : controlType;
|
|
44
64
|
this.props = new Property(props === null || props === void 0 ? void 0 : props.props);
|
|
45
65
|
this.customEvents = controlCustomEvents;
|
|
46
|
-
var
|
|
47
|
-
this.controlType = (
|
|
48
|
-
var
|
|
49
|
-
this.fieldType = (
|
|
50
|
-
var
|
|
51
|
-
this.pageStatus = (
|
|
66
|
+
var _props_controlType;
|
|
67
|
+
this.controlType = (_props_controlType = props === null || props === void 0 ? void 0 : props.controlType) !== null && _props_controlType !== void 0 ? _props_controlType : "base";
|
|
68
|
+
var _props_fieldType;
|
|
69
|
+
this.fieldType = (_props_fieldType = props === null || props === void 0 ? void 0 : props.fieldType) !== null && _props_fieldType !== void 0 ? _props_fieldType : controlFieldType;
|
|
70
|
+
var _props_pageStatus;
|
|
71
|
+
this.pageStatus = (_props_pageStatus = props === null || props === void 0 ? void 0 : props.pageStatus) !== null && _props_pageStatus !== void 0 ? _props_pageStatus : PAGE_STATUS.UNKNOWN;
|
|
52
72
|
}
|
|
53
73
|
_createClass(Control, [
|
|
54
74
|
{
|
|
@@ -65,8 +85,9 @@ var Control = /*#__PURE__*/ function _target() {
|
|
|
65
85
|
]);
|
|
66
86
|
return Control;
|
|
67
87
|
}();
|
|
68
|
-
Control
|
|
69
|
-
Control
|
|
70
|
-
Control
|
|
88
|
+
_defineProperty(Control, "controlType", "control");
|
|
89
|
+
_defineProperty(Control, "controlFieldType", void 0);
|
|
90
|
+
_defineProperty(Control, "__is_control__", true);
|
|
91
|
+
_defineProperty(Control, "controlCustomEvents", []);
|
|
71
92
|
export default Control;
|
|
72
93
|
export { Control as RuntimeControl };
|
|
@@ -9,6 +9,19 @@ function _classCallCheck(instance, Constructor) {
|
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
+
function _defineProperty(obj, key, value) {
|
|
13
|
+
if (key in obj) {
|
|
14
|
+
Object.defineProperty(obj, key, {
|
|
15
|
+
value: value,
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true
|
|
19
|
+
});
|
|
20
|
+
} else {
|
|
21
|
+
obj[key] = value;
|
|
22
|
+
}
|
|
23
|
+
return obj;
|
|
24
|
+
}
|
|
12
25
|
function _getPrototypeOf(o) {
|
|
13
26
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
14
27
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -69,17 +82,18 @@ function _createSuper(Derived) {
|
|
|
69
82
|
return _possibleConstructorReturn(this, result);
|
|
70
83
|
};
|
|
71
84
|
}
|
|
72
|
-
import { DesignerControl } from
|
|
73
|
-
import ColumnControlProperty from
|
|
74
|
-
var ColumnControl = /*#__PURE__*/ function(
|
|
85
|
+
import { DesignerControl } from "../BaseControl";
|
|
86
|
+
import ColumnControlProperty from "./property";
|
|
87
|
+
var ColumnControl = /*#__PURE__*/ function(DesignerControl) {
|
|
75
88
|
"use strict";
|
|
76
|
-
_inherits(ColumnControl,
|
|
89
|
+
_inherits(ColumnControl, DesignerControl);
|
|
77
90
|
var _super = _createSuper(ColumnControl);
|
|
78
91
|
function ColumnControl(props) {
|
|
79
92
|
_classCallCheck(this, ColumnControl);
|
|
80
93
|
var _this;
|
|
81
94
|
_this = _super.call(this, props);
|
|
82
|
-
_this
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "controlType", "column");
|
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
83
97
|
_this.props = new ColumnControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
84
98
|
return _this;
|
|
85
99
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Designer from
|
|
2
|
-
import Runtime from
|
|
3
|
-
import Property from
|
|
1
|
+
import Designer from "./designer";
|
|
2
|
+
import Runtime from "./runtime";
|
|
3
|
+
import Property from "./property";
|
|
4
4
|
export default {
|
|
5
5
|
Designer: Designer,
|
|
6
6
|
Runtime: Runtime,
|
|
7
7
|
Property: Property
|
|
8
8
|
};
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
9
|
+
export * from "./designer";
|
|
10
|
+
export * from "./runtime";
|
|
11
|
+
export * from "./property";
|
|
@@ -9,6 +9,19 @@ function _classCallCheck(instance, Constructor) {
|
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
+
function _defineProperty(obj, key, value) {
|
|
13
|
+
if (key in obj) {
|
|
14
|
+
Object.defineProperty(obj, key, {
|
|
15
|
+
value: value,
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true
|
|
19
|
+
});
|
|
20
|
+
} else {
|
|
21
|
+
obj[key] = value;
|
|
22
|
+
}
|
|
23
|
+
return obj;
|
|
24
|
+
}
|
|
12
25
|
function _getPrototypeOf(o) {
|
|
13
26
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
14
27
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -69,64 +82,99 @@ function _createSuper(Derived) {
|
|
|
69
82
|
return _possibleConstructorReturn(this, result);
|
|
70
83
|
};
|
|
71
84
|
}
|
|
72
|
-
import { Property, PropertyRules } from
|
|
73
|
-
import { RulesMessage } from
|
|
74
|
-
import { initOptionAndDataSourceRules } from
|
|
75
|
-
import { DataBind, AutoWidth } from
|
|
76
|
-
var ColumnControlPropertyRules = /*#__PURE__*/ function(
|
|
85
|
+
import { Property, PropertyRules } from "../BaseControl";
|
|
86
|
+
import { RulesMessage } from "@byteluck-fe/model-driven-shared";
|
|
87
|
+
import { initOptionAndDataSourceRules } from "../initOptionAndDataSourceRules";
|
|
88
|
+
import { DataBind, AutoWidth } from "../../framework";
|
|
89
|
+
var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
|
|
77
90
|
"use strict";
|
|
78
|
-
_inherits(ColumnControlPropertyRules,
|
|
91
|
+
_inherits(ColumnControlPropertyRules, PropertyRules);
|
|
79
92
|
var _super = _createSuper(ColumnControlPropertyRules);
|
|
80
93
|
function ColumnControlPropertyRules(props) {
|
|
81
94
|
_classCallCheck(this, ColumnControlPropertyRules);
|
|
82
95
|
var _this;
|
|
83
96
|
_this = _super.call(this, props);
|
|
84
|
-
_this
|
|
85
|
-
type:
|
|
97
|
+
_defineProperty(_assertThisInitialized(_this), "caption", {
|
|
98
|
+
type: "string",
|
|
86
99
|
required: true,
|
|
87
|
-
message: RulesMessage.getMessage(
|
|
88
|
-
};
|
|
89
|
-
_this
|
|
90
|
-
type:
|
|
100
|
+
message: RulesMessage.getMessage("pleaseEnterCaption")
|
|
101
|
+
});
|
|
102
|
+
_defineProperty(_assertThisInitialized(_this), "width", {
|
|
103
|
+
type: "number",
|
|
91
104
|
required: false,
|
|
92
|
-
message: RulesMessage.getMessage(
|
|
93
|
-
};
|
|
94
|
-
_this.width.required = props.widthType ===
|
|
105
|
+
message: RulesMessage.getMessage("pleaseEnterColumnWidth")
|
|
106
|
+
});
|
|
107
|
+
_this.width.required = props.widthType === "px";
|
|
95
108
|
return _this;
|
|
96
109
|
}
|
|
97
110
|
return ColumnControlPropertyRules;
|
|
98
111
|
}(PropertyRules);
|
|
99
|
-
|
|
112
|
+
/**
|
|
100
113
|
* 列基本属性
|
|
101
114
|
* @public
|
|
102
|
-
*/ /*#__PURE__*/ function(
|
|
115
|
+
*/ var ColumnControlProperty = /*#__PURE__*/ function(Property) {
|
|
103
116
|
"use strict";
|
|
104
|
-
_inherits(ColumnControlProperty,
|
|
117
|
+
_inherits(ColumnControlProperty, Property);
|
|
105
118
|
var _super = _createSuper(ColumnControlProperty);
|
|
106
119
|
function ColumnControlProperty(props) {
|
|
107
120
|
_classCallCheck(this, ColumnControlProperty);
|
|
108
121
|
var _this;
|
|
109
122
|
_this = _super.call(this, props);
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
123
|
+
/**
|
|
124
|
+
* 宽度类型
|
|
125
|
+
* @defaultValue 'auto'
|
|
126
|
+
*/ _defineProperty(_assertThisInitialized(_this), "widthType", void 0);
|
|
127
|
+
/**
|
|
128
|
+
* 宽度
|
|
129
|
+
* @defaultValue 150
|
|
130
|
+
*/ _defineProperty(_assertThisInitialized(_this), "width", void 0);
|
|
131
|
+
/**
|
|
132
|
+
* 标题
|
|
133
|
+
*/ _defineProperty(_assertThisInitialized(_this), "caption", void 0);
|
|
134
|
+
/**
|
|
135
|
+
* 绑定数据项
|
|
136
|
+
*/ _defineProperty(_assertThisInitialized(_this), "dataBind", void 0);
|
|
137
|
+
/**
|
|
138
|
+
* 自适应页面宽度
|
|
139
|
+
*/ _defineProperty(_assertThisInitialized(_this), "autoWidth", void 0);
|
|
140
|
+
/**
|
|
141
|
+
* 冻结
|
|
142
|
+
* @defaultValue 'none'
|
|
143
|
+
*/ _defineProperty(_assertThisInitialized(_this), "fixed", void 0);
|
|
144
|
+
/**
|
|
145
|
+
* 表头排序
|
|
146
|
+
* @defaultValue true
|
|
147
|
+
*/ _defineProperty(_assertThisInitialized(_this), "sort", void 0);
|
|
148
|
+
/**
|
|
149
|
+
* 对齐
|
|
150
|
+
*/ _defineProperty(_assertThisInitialized(_this), "align", void 0);
|
|
151
|
+
/**
|
|
152
|
+
* @internal
|
|
153
|
+
*/ _defineProperty(_assertThisInitialized(_this), "colSpan", void 0);
|
|
154
|
+
/**
|
|
155
|
+
* 自动高度
|
|
156
|
+
* @defaultValue false
|
|
157
|
+
*/ _defineProperty(_assertThisInitialized(_this), "autoHeight", void 0);
|
|
158
|
+
var _props_width;
|
|
159
|
+
_this.width = (_props_width = props === null || props === void 0 ? void 0 : props.width) !== null && _props_width !== void 0 ? _props_width : 150;
|
|
160
|
+
_this.widthType = (props === null || props === void 0 ? void 0 : props.widthType) || "auto";
|
|
161
|
+
var _props_caption;
|
|
162
|
+
_this.caption = (_props_caption = props === null || props === void 0 ? void 0 : props.caption) !== null && _props_caption !== void 0 ? _props_caption : "";
|
|
163
|
+
var _props_fixed;
|
|
164
|
+
_this.fixed = (_props_fixed = props === null || props === void 0 ? void 0 : props.fixed) !== null && _props_fixed !== void 0 ? _props_fixed : "none";
|
|
117
165
|
_this.autoWidth = new AutoWidth(props === null || props === void 0 ? void 0 : props.autoWidth);
|
|
118
166
|
_this.dataBind = new DataBind(props === null || props === void 0 ? void 0 : props.dataBind);
|
|
119
|
-
var
|
|
120
|
-
_this.sort = (
|
|
167
|
+
var _props_sort;
|
|
168
|
+
_this.sort = (_props_sort = props === null || props === void 0 ? void 0 : props.sort) !== null && _props_sort !== void 0 ? _props_sort : true;
|
|
121
169
|
_this.align = props === null || props === void 0 ? void 0 : props.align;
|
|
122
170
|
_this.colSpan = props === null || props === void 0 ? void 0 : props.colSpan;
|
|
123
|
-
var
|
|
124
|
-
_this.autoHeight = (
|
|
171
|
+
var _props_autoHeight;
|
|
172
|
+
_this.autoHeight = (_props_autoHeight = props === null || props === void 0 ? void 0 : props.autoHeight) !== null && _props_autoHeight !== void 0 ? _props_autoHeight : false;
|
|
125
173
|
return _this;
|
|
126
174
|
}
|
|
127
175
|
return ColumnControlProperty;
|
|
128
176
|
}(Property);
|
|
129
|
-
ColumnControlProperty
|
|
177
|
+
_defineProperty(ColumnControlProperty, "Rules", ColumnControlPropertyRules);
|
|
130
178
|
var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnControlPropertyRules) {
|
|
131
179
|
"use strict";
|
|
132
180
|
_inherits(ColumnOptionAndDataSourcePropertyRules, ColumnControlPropertyRules);
|
|
@@ -135,27 +183,27 @@ var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnContro
|
|
|
135
183
|
_classCallCheck(this, ColumnOptionAndDataSourcePropertyRules);
|
|
136
184
|
var _this;
|
|
137
185
|
_this = _super.call(this, props);
|
|
138
|
-
_this
|
|
139
|
-
type:
|
|
186
|
+
_defineProperty(_assertThisInitialized(_this), "optionConfig", {
|
|
187
|
+
type: "enum",
|
|
140
188
|
enum: [
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
189
|
+
"custom",
|
|
190
|
+
"datasource",
|
|
191
|
+
"none"
|
|
144
192
|
],
|
|
145
|
-
message: RulesMessage.getMessage(
|
|
146
|
-
};
|
|
147
|
-
_this
|
|
193
|
+
message: RulesMessage.getMessage("PleaseSelectTheCorrectOptionSettings")
|
|
194
|
+
});
|
|
195
|
+
_defineProperty(_assertThisInitialized(_this), "options", [
|
|
148
196
|
{
|
|
149
|
-
type:
|
|
150
|
-
message: RulesMessage.getMessage(
|
|
151
|
-
}
|
|
152
|
-
];
|
|
153
|
-
_this
|
|
197
|
+
type: "array",
|
|
198
|
+
message: RulesMessage.getMessage("isNotArray")
|
|
199
|
+
}
|
|
200
|
+
]);
|
|
201
|
+
_defineProperty(_assertThisInitialized(_this), "datasourceBind", [
|
|
154
202
|
{
|
|
155
|
-
type:
|
|
156
|
-
message: RulesMessage.getMessage(
|
|
157
|
-
}
|
|
158
|
-
];
|
|
203
|
+
type: "object",
|
|
204
|
+
message: RulesMessage.getMessage("isNotObject")
|
|
205
|
+
}
|
|
206
|
+
]);
|
|
159
207
|
initOptionAndDataSourceRules.call(_assertThisInitialized(_this), props);
|
|
160
208
|
return _this;
|
|
161
209
|
}
|
|
@@ -9,6 +9,19 @@ function _classCallCheck(instance, Constructor) {
|
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
+
function _defineProperty(obj, key, value) {
|
|
13
|
+
if (key in obj) {
|
|
14
|
+
Object.defineProperty(obj, key, {
|
|
15
|
+
value: value,
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true
|
|
19
|
+
});
|
|
20
|
+
} else {
|
|
21
|
+
obj[key] = value;
|
|
22
|
+
}
|
|
23
|
+
return obj;
|
|
24
|
+
}
|
|
12
25
|
function _getPrototypeOf(o) {
|
|
13
26
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
14
27
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -69,17 +82,18 @@ function _createSuper(Derived) {
|
|
|
69
82
|
return _possibleConstructorReturn(this, result);
|
|
70
83
|
};
|
|
71
84
|
}
|
|
72
|
-
import { RuntimeControl } from
|
|
73
|
-
import ColumnControlProperty from
|
|
74
|
-
var ColumnControl = /*#__PURE__*/ function(
|
|
85
|
+
import { RuntimeControl } from "../BaseControl";
|
|
86
|
+
import ColumnControlProperty from "./property";
|
|
87
|
+
var ColumnControl = /*#__PURE__*/ function(RuntimeControl) {
|
|
75
88
|
"use strict";
|
|
76
|
-
_inherits(ColumnControl,
|
|
89
|
+
_inherits(ColumnControl, RuntimeControl);
|
|
77
90
|
var _super = _createSuper(ColumnControl);
|
|
78
91
|
function ColumnControl(props) {
|
|
79
92
|
_classCallCheck(this, ColumnControl);
|
|
80
93
|
var _this;
|
|
81
94
|
_this = _super.call(this, props);
|
|
82
|
-
_this
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "controlType", "column");
|
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
83
97
|
_this.props = new ColumnControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
84
98
|
return _this;
|
|
85
99
|
}
|
|
@@ -23,11 +23,11 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
23
23
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
24
24
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
25
25
|
}
|
|
26
|
-
import { isArray, isPlainObject } from
|
|
26
|
+
import { isArray, isPlainObject } from "@byteluck-fe/model-driven-shared";
|
|
27
27
|
export function setPropertyDontEnum(obj, property) {
|
|
28
|
-
var
|
|
28
|
+
var _Object_getOwnPropertyDescriptors_property;
|
|
29
29
|
// 如果没有被设置过不允许枚举的话,说明是第一次被设置,需要设置属性不允许枚举
|
|
30
|
-
if ((
|
|
30
|
+
if ((_Object_getOwnPropertyDescriptors_property = Object.getOwnPropertyDescriptors(obj)[property]) === null || _Object_getOwnPropertyDescriptors_property === void 0 ? void 0 : _Object_getOwnPropertyDescriptors_property.enumerable) {
|
|
31
31
|
Object.defineProperty(obj, property, {
|
|
32
32
|
enumerable: false
|
|
33
33
|
});
|
|
@@ -36,17 +36,17 @@ export function setPropertyDontEnum(obj, property) {
|
|
|
36
36
|
export function defineParent(control, parent) {
|
|
37
37
|
control.parent = parent;
|
|
38
38
|
// 如果没有被设置过不允许枚举的话,说明是第一次被代理,需要设置parent属性不允许枚举
|
|
39
|
-
setPropertyDontEnum(control,
|
|
39
|
+
setPropertyDontEnum(control, "parent");
|
|
40
40
|
}
|
|
41
41
|
export function defineArrayParent(controls, parent) {
|
|
42
42
|
controls.forEach(function(item) {
|
|
43
43
|
defineParent(item, parent);
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
var targetKey = Symbol(
|
|
46
|
+
var targetKey = Symbol("targetKey");
|
|
47
47
|
function getTargetValue(value) {
|
|
48
|
-
var
|
|
49
|
-
return (
|
|
48
|
+
var _value_targetKey;
|
|
49
|
+
return (_value_targetKey = value[targetKey]) !== null && _value_targetKey !== void 0 ? _value_targetKey : value;
|
|
50
50
|
}
|
|
51
51
|
function proxyState(target, parent) {
|
|
52
52
|
defineArrayParent(target, parent);
|
|
@@ -70,7 +70,7 @@ function proxyState(target, parent) {
|
|
|
70
70
|
}
|
|
71
71
|
var _Reflect;
|
|
72
72
|
// 更改长度为当前长度,代表没变,直接返回true,否则在safari 13.x版本的严格模式会引起页面崩溃
|
|
73
|
-
if (isArray(target) && property ===
|
|
73
|
+
if (isArray(target) && property === "length" && value === target.length) {
|
|
74
74
|
return true;
|
|
75
75
|
}
|
|
76
76
|
var result = (_Reflect = Reflect).set.apply(_Reflect, [
|
|
@@ -9,6 +9,19 @@ function _classCallCheck(instance, Constructor) {
|
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
+
function _defineProperty(obj, key, value) {
|
|
13
|
+
if (key in obj) {
|
|
14
|
+
Object.defineProperty(obj, key, {
|
|
15
|
+
value: value,
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true
|
|
19
|
+
});
|
|
20
|
+
} else {
|
|
21
|
+
obj[key] = value;
|
|
22
|
+
}
|
|
23
|
+
return obj;
|
|
24
|
+
}
|
|
12
25
|
function _getPrototypeOf(o) {
|
|
13
26
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
14
27
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
@@ -69,26 +82,28 @@ function _createSuper(Derived) {
|
|
|
69
82
|
return _possibleConstructorReturn(this, result);
|
|
70
83
|
};
|
|
71
84
|
}
|
|
72
|
-
import { DesignerControl } from
|
|
73
|
-
import BaseControlProperty from
|
|
74
|
-
var FormControl = /*#__PURE__*/ function(
|
|
85
|
+
import { DesignerControl } from "../BaseControl";
|
|
86
|
+
import BaseControlProperty from "./property";
|
|
87
|
+
var FormControl = /*#__PURE__*/ function(DesignerControl) {
|
|
75
88
|
"use strict";
|
|
76
|
-
_inherits(FormControl,
|
|
89
|
+
_inherits(FormControl, DesignerControl);
|
|
77
90
|
var _super = _createSuper(FormControl);
|
|
78
91
|
function FormControl(props) {
|
|
79
92
|
_classCallCheck(this, FormControl);
|
|
80
93
|
var _this;
|
|
81
94
|
_this = _super.call(this, props);
|
|
82
|
-
_this
|
|
95
|
+
_defineProperty(_assertThisInitialized(_this), "controlType", "form");
|
|
96
|
+
_defineProperty(_assertThisInitialized(_this), "props", void 0);
|
|
83
97
|
_this.props = new BaseControlProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
84
98
|
return _this;
|
|
85
99
|
}
|
|
86
100
|
return FormControl;
|
|
87
101
|
}(DesignerControl);
|
|
88
|
-
FormControl
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
];
|
|
102
|
+
_defineProperty(FormControl, "controlEventKeys", [
|
|
103
|
+
"on_change",
|
|
104
|
+
"on_focus",
|
|
105
|
+
"on_blur"
|
|
106
|
+
]);
|
|
107
|
+
_defineProperty(FormControl, "controlCustomAttributes", void 0);
|
|
93
108
|
export default FormControl;
|
|
94
109
|
export { FormControl as DesignerFormControl };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import Designer from
|
|
2
|
-
import Runtime from
|
|
3
|
-
import Property from
|
|
1
|
+
import Designer from "./designer";
|
|
2
|
+
import Runtime from "./runtime";
|
|
3
|
+
import Property from "./property";
|
|
4
4
|
export default {
|
|
5
5
|
Designer: Designer,
|
|
6
6
|
Runtime: Runtime,
|
|
7
7
|
Property: Property
|
|
8
8
|
};
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
9
|
+
export * from "./designer";
|
|
10
|
+
export * from "./runtime";
|
|
11
|
+
export * from "./property";
|