@byteluck-fe/model-driven-core 1.3.0-beta.28 → 1.5.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/esm/common/BaseControl/designer.js +409 -0
  2. package/dist/esm/common/BaseControl/index.js +12 -0
  3. package/dist/esm/common/BaseControl/property.js +160 -0
  4. package/dist/esm/common/BaseControl/runtime.js +72 -0
  5. package/dist/esm/common/BaseControl/types.js +1 -0
  6. package/dist/esm/common/ColumnControl/designer.js +89 -0
  7. package/dist/esm/common/ColumnControl/index.js +11 -0
  8. package/dist/esm/common/ColumnControl/property.js +157 -0
  9. package/dist/esm/common/ColumnControl/runtime.js +89 -0
  10. package/dist/esm/common/ColumnControl/types.js +0 -0
  11. package/dist/esm/common/ControlArray.js +100 -0
  12. package/dist/esm/common/FormControl/designer.js +94 -0
  13. package/dist/esm/common/FormControl/index.js +11 -0
  14. package/dist/esm/common/FormControl/property.js +262 -0
  15. package/dist/esm/common/FormControl/runtime.js +89 -0
  16. package/dist/esm/common/FormControl/types.js +0 -0
  17. package/dist/esm/common/LayoutControl/designer.js +300 -0
  18. package/dist/esm/common/LayoutControl/index.js +11 -0
  19. package/dist/esm/common/LayoutControl/property.js +84 -0
  20. package/dist/esm/common/LayoutControl/runtime.js +91 -0
  21. package/dist/esm/common/LayoutControl/types.js +0 -0
  22. package/dist/esm/common/ListControl/designer.js +276 -0
  23. package/dist/esm/common/ListControl/index.js +11 -0
  24. package/dist/esm/common/ListControl/property.js +88 -0
  25. package/dist/esm/common/ListControl/runtime.js +113 -0
  26. package/dist/esm/common/ListControl/types.js +0 -0
  27. package/dist/esm/common/SearchViewControl/designer.js +89 -0
  28. package/dist/esm/common/SearchViewControl/index.js +11 -0
  29. package/dist/esm/common/SearchViewControl/property.js +88 -0
  30. package/dist/esm/common/SearchViewControl/runtime.js +89 -0
  31. package/dist/esm/common/SearchViewControl/types.js +0 -0
  32. package/dist/esm/common/Validator.js +16 -0
  33. package/dist/esm/common/WrapControl/designer.js +89 -0
  34. package/dist/esm/common/WrapControl/index.js +11 -0
  35. package/dist/esm/common/WrapControl/property.js +84 -0
  36. package/dist/esm/common/WrapControl/runtime.js +89 -0
  37. package/dist/esm/common/WrapControl/types.js +0 -0
  38. package/dist/esm/common/controlHooksEmitter.js +3 -0
  39. package/dist/esm/common/index.js +11 -0
  40. package/dist/esm/common/initOptionAndDataSourceRules.js +227 -0
  41. package/dist/esm/framework/RegisterControls.js +149 -0
  42. package/dist/esm/framework/index.js +690 -0
  43. package/dist/esm/index.js +3 -0
  44. package/dist/esm/type.js +1 -0
  45. package/dist/index.umd.js +1 -0
  46. package/dist/types/common/BaseControl/designer.d.ts +62 -0
  47. package/dist/types/common/BaseControl/index.d.ts +13 -0
  48. package/dist/types/common/BaseControl/property.d.ts +22 -0
  49. package/dist/types/common/BaseControl/runtime.d.ts +22 -0
  50. package/dist/types/common/BaseControl/types.d.ts +35 -0
  51. package/dist/types/common/ColumnControl/designer.d.ts +10 -0
  52. package/dist/types/common/ColumnControl/index.d.ts +12 -0
  53. package/dist/types/common/ColumnControl/property.d.ts +30 -0
  54. package/dist/types/common/ColumnControl/runtime.d.ts +10 -0
  55. package/dist/types/common/ColumnControl/types.d.ts +0 -0
  56. package/dist/types/common/ControlArray.d.ts +8 -0
  57. package/dist/types/common/FormControl/designer.d.ts +13 -0
  58. package/dist/types/common/FormControl/index.d.ts +12 -0
  59. package/dist/types/common/FormControl/property.d.ts +44 -0
  60. package/dist/types/common/FormControl/runtime.d.ts +11 -0
  61. package/dist/types/common/FormControl/types.d.ts +0 -0
  62. package/dist/types/common/LayoutControl/designer.d.ts +21 -0
  63. package/dist/types/common/LayoutControl/index.d.ts +12 -0
  64. package/dist/types/common/LayoutControl/property.d.ts +6 -0
  65. package/dist/types/common/LayoutControl/runtime.d.ts +11 -0
  66. package/dist/types/common/LayoutControl/types.d.ts +0 -0
  67. package/dist/types/common/ListControl/designer.d.ts +16 -0
  68. package/dist/types/common/ListControl/index.d.ts +12 -0
  69. package/dist/types/common/ListControl/property.d.ts +12 -0
  70. package/dist/types/common/ListControl/runtime.d.ts +12 -0
  71. package/dist/types/common/ListControl/types.d.ts +0 -0
  72. package/dist/types/common/SearchViewControl/designer.d.ts +11 -0
  73. package/dist/types/common/SearchViewControl/index.d.ts +12 -0
  74. package/dist/types/common/SearchViewControl/property.d.ts +8 -0
  75. package/dist/types/common/SearchViewControl/runtime.d.ts +11 -0
  76. package/dist/types/common/SearchViewControl/types.d.ts +0 -0
  77. package/dist/types/common/Validator.d.ts +15 -0
  78. package/dist/types/common/WrapControl/designer.d.ts +11 -0
  79. package/dist/types/common/WrapControl/index.d.ts +12 -0
  80. package/dist/types/common/WrapControl/property.d.ts +6 -0
  81. package/dist/types/common/WrapControl/runtime.d.ts +11 -0
  82. package/dist/types/common/WrapControl/types.d.ts +0 -0
  83. package/dist/types/common/controlHooksEmitter.d.ts +4 -0
  84. package/dist/types/common/index.d.ts +11 -0
  85. package/dist/types/common/initOptionAndDataSourceRules.d.ts +10 -0
  86. package/dist/types/framework/RegisterControls.d.ts +33 -0
  87. package/dist/types/framework/index.d.ts +349 -0
  88. package/dist/types/index.d.ts +3 -0
  89. package/dist/types/type.d.ts +91 -0
  90. package/package.json +4 -4
@@ -0,0 +1,89 @@
1
+ function _assertThisInitialized(self) {
2
+ if (self === void 0) {
3
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4
+ }
5
+ return self;
6
+ }
7
+ function _classCallCheck(instance, Constructor) {
8
+ if (!(instance instanceof Constructor)) {
9
+ throw new TypeError("Cannot call a class as a function");
10
+ }
11
+ }
12
+ function _getPrototypeOf(o) {
13
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
14
+ return o.__proto__ || Object.getPrototypeOf(o);
15
+ };
16
+ return _getPrototypeOf(o);
17
+ }
18
+ function _inherits(subClass, superClass) {
19
+ if (typeof superClass !== "function" && superClass !== null) {
20
+ throw new TypeError("Super expression must either be null or a function");
21
+ }
22
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
23
+ constructor: {
24
+ value: subClass,
25
+ writable: true,
26
+ configurable: true
27
+ }
28
+ });
29
+ if (superClass) _setPrototypeOf(subClass, superClass);
30
+ }
31
+ function _possibleConstructorReturn(self, call) {
32
+ if (call && (_typeof(call) === "object" || typeof call === "function")) {
33
+ return call;
34
+ }
35
+ return _assertThisInitialized(self);
36
+ }
37
+ function _setPrototypeOf(o, p) {
38
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
39
+ o.__proto__ = p;
40
+ return o;
41
+ };
42
+ return _setPrototypeOf(o, p);
43
+ }
44
+ var _typeof = function(obj) {
45
+ "@swc/helpers - typeof";
46
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
47
+ };
48
+ function _isNativeReflectConstruct() {
49
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
50
+ if (Reflect.construct.sham) return false;
51
+ if (typeof Proxy === "function") return true;
52
+ try {
53
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
54
+ return true;
55
+ } catch (e) {
56
+ return false;
57
+ }
58
+ }
59
+ function _createSuper(Derived) {
60
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
61
+ return function _createSuperInternal() {
62
+ var Super = _getPrototypeOf(Derived), result;
63
+ if (hasNativeReflectConstruct) {
64
+ var NewTarget = _getPrototypeOf(this).constructor;
65
+ result = Reflect.construct(Super, arguments, NewTarget);
66
+ } else {
67
+ result = Super.apply(this, arguments);
68
+ }
69
+ return _possibleConstructorReturn(this, result);
70
+ };
71
+ }
72
+ import { DesignerControl } from "../BaseControl";
73
+ import ColumnControlProperty from "./property";
74
+ var ColumnControl = /*#__PURE__*/ function(DesignerControl) {
75
+ "use strict";
76
+ _inherits(ColumnControl, DesignerControl);
77
+ var _super = _createSuper(ColumnControl);
78
+ function ColumnControl(props) {
79
+ _classCallCheck(this, ColumnControl);
80
+ var _this;
81
+ _this = _super.call(this, props);
82
+ _this.controlType = "column";
83
+ _this.props = new ColumnControlProperty(props === null || props === void 0 ? void 0 : props.props);
84
+ return _this;
85
+ }
86
+ return ColumnControl;
87
+ }(DesignerControl);
88
+ export default ColumnControl;
89
+ export { ColumnControl as DesignerColumnControl };
@@ -0,0 +1,11 @@
1
+ import Designer from "./designer";
2
+ import Runtime from "./runtime";
3
+ import Property from "./property";
4
+ export default {
5
+ Designer: Designer,
6
+ Runtime: Runtime,
7
+ Property: Property
8
+ };
9
+ export * from "./designer";
10
+ export * from "./runtime";
11
+ export * from "./property";
@@ -0,0 +1,157 @@
1
+ function _assertThisInitialized(self) {
2
+ if (self === void 0) {
3
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4
+ }
5
+ return self;
6
+ }
7
+ function _classCallCheck(instance, Constructor) {
8
+ if (!(instance instanceof Constructor)) {
9
+ throw new TypeError("Cannot call a class as a function");
10
+ }
11
+ }
12
+ function _getPrototypeOf(o) {
13
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
14
+ return o.__proto__ || Object.getPrototypeOf(o);
15
+ };
16
+ return _getPrototypeOf(o);
17
+ }
18
+ function _inherits(subClass, superClass) {
19
+ if (typeof superClass !== "function" && superClass !== null) {
20
+ throw new TypeError("Super expression must either be null or a function");
21
+ }
22
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
23
+ constructor: {
24
+ value: subClass,
25
+ writable: true,
26
+ configurable: true
27
+ }
28
+ });
29
+ if (superClass) _setPrototypeOf(subClass, superClass);
30
+ }
31
+ function _possibleConstructorReturn(self, call) {
32
+ if (call && (_typeof(call) === "object" || typeof call === "function")) {
33
+ return call;
34
+ }
35
+ return _assertThisInitialized(self);
36
+ }
37
+ function _setPrototypeOf(o, p) {
38
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
39
+ o.__proto__ = p;
40
+ return o;
41
+ };
42
+ return _setPrototypeOf(o, p);
43
+ }
44
+ var _typeof = function(obj) {
45
+ "@swc/helpers - typeof";
46
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
47
+ };
48
+ function _isNativeReflectConstruct() {
49
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
50
+ if (Reflect.construct.sham) return false;
51
+ if (typeof Proxy === "function") return true;
52
+ try {
53
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
54
+ return true;
55
+ } catch (e) {
56
+ return false;
57
+ }
58
+ }
59
+ function _createSuper(Derived) {
60
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
61
+ return function _createSuperInternal() {
62
+ var Super = _getPrototypeOf(Derived), result;
63
+ if (hasNativeReflectConstruct) {
64
+ var NewTarget = _getPrototypeOf(this).constructor;
65
+ result = Reflect.construct(Super, arguments, NewTarget);
66
+ } else {
67
+ result = Super.apply(this, arguments);
68
+ }
69
+ return _possibleConstructorReturn(this, result);
70
+ };
71
+ }
72
+ import { Property, PropertyRules } from "../BaseControl";
73
+ import { RulesMessage } from "@byteluck-fe/model-driven-shared";
74
+ import { initOptionAndDataSourceRules } from "../initOptionAndDataSourceRules";
75
+ import { DataBind } from "../../framework";
76
+ var ColumnControlPropertyRules = /*#__PURE__*/ function(PropertyRules) {
77
+ "use strict";
78
+ _inherits(ColumnControlPropertyRules, PropertyRules);
79
+ var _super = _createSuper(ColumnControlPropertyRules);
80
+ function ColumnControlPropertyRules(props) {
81
+ _classCallCheck(this, ColumnControlPropertyRules);
82
+ var _this;
83
+ _this = _super.call(this, props);
84
+ _this.caption = {
85
+ type: "string",
86
+ required: true,
87
+ message: RulesMessage.getMessage("pleaseEnterCaption")
88
+ };
89
+ _this.width = {
90
+ type: "number",
91
+ required: false,
92
+ message: RulesMessage.getMessage("pleaseEnterColumnWidth")
93
+ };
94
+ _this.width.required = props.widthType === "px";
95
+ return _this;
96
+ }
97
+ return ColumnControlPropertyRules;
98
+ }(PropertyRules);
99
+ var ColumnControlProperty = /*#__PURE__*/ function(Property) {
100
+ "use strict";
101
+ _inherits(ColumnControlProperty, Property);
102
+ var _super = _createSuper(ColumnControlProperty);
103
+ function ColumnControlProperty(props) {
104
+ _classCallCheck(this, ColumnControlProperty);
105
+ var _this;
106
+ _this = _super.call(this, props);
107
+ var ref;
108
+ _this.width = (ref = props === null || props === void 0 ? void 0 : props.width) !== null && ref !== void 0 ? ref : 150;
109
+ _this.widthType = (props === null || props === void 0 ? void 0 : props.widthType) || "auto";
110
+ var ref1;
111
+ _this.caption = (ref1 = props === null || props === void 0 ? void 0 : props.caption) !== null && ref1 !== void 0 ? ref1 : "";
112
+ var ref2;
113
+ _this.fixed = (ref2 = props === null || props === void 0 ? void 0 : props.fixed) !== null && ref2 !== void 0 ? ref2 : "none";
114
+ _this.dataBind = new DataBind(props === null || props === void 0 ? void 0 : props.dataBind);
115
+ var ref3;
116
+ _this.sort = (ref3 = props === null || props === void 0 ? void 0 : props.sort) !== null && ref3 !== void 0 ? ref3 : true;
117
+ return _this;
118
+ }
119
+ return ColumnControlProperty;
120
+ }(Property);
121
+ ColumnControlProperty.Rules = ColumnControlPropertyRules;
122
+ var ColumnOptionAndDataSourcePropertyRules = /*#__PURE__*/ function(ColumnControlPropertyRules) {
123
+ "use strict";
124
+ _inherits(ColumnOptionAndDataSourcePropertyRules, ColumnControlPropertyRules);
125
+ var _super = _createSuper(ColumnOptionAndDataSourcePropertyRules);
126
+ function ColumnOptionAndDataSourcePropertyRules(props) {
127
+ _classCallCheck(this, ColumnOptionAndDataSourcePropertyRules);
128
+ var _this;
129
+ _this = _super.call(this, props);
130
+ _this.optionConfig = {
131
+ type: "enum",
132
+ enum: [
133
+ "custom",
134
+ "datasource",
135
+ "none"
136
+ ],
137
+ message: RulesMessage.getMessage("PleaseSelectTheCorrectOptionSettings")
138
+ };
139
+ _this.options = [
140
+ {
141
+ type: "array",
142
+ message: RulesMessage.getMessage("isNotArray")
143
+ },
144
+ ];
145
+ _this.datasourceBind = [
146
+ {
147
+ type: "object",
148
+ message: RulesMessage.getMessage("isNotObject")
149
+ },
150
+ ];
151
+ initOptionAndDataSourceRules.call(_assertThisInitialized(_this), props);
152
+ return _this;
153
+ }
154
+ return ColumnOptionAndDataSourcePropertyRules;
155
+ }(ColumnControlPropertyRules);
156
+ export default ColumnControlProperty;
157
+ export { ColumnControlProperty, ColumnControlPropertyRules, ColumnOptionAndDataSourcePropertyRules, };
@@ -0,0 +1,89 @@
1
+ function _assertThisInitialized(self) {
2
+ if (self === void 0) {
3
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4
+ }
5
+ return self;
6
+ }
7
+ function _classCallCheck(instance, Constructor) {
8
+ if (!(instance instanceof Constructor)) {
9
+ throw new TypeError("Cannot call a class as a function");
10
+ }
11
+ }
12
+ function _getPrototypeOf(o) {
13
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
14
+ return o.__proto__ || Object.getPrototypeOf(o);
15
+ };
16
+ return _getPrototypeOf(o);
17
+ }
18
+ function _inherits(subClass, superClass) {
19
+ if (typeof superClass !== "function" && superClass !== null) {
20
+ throw new TypeError("Super expression must either be null or a function");
21
+ }
22
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
23
+ constructor: {
24
+ value: subClass,
25
+ writable: true,
26
+ configurable: true
27
+ }
28
+ });
29
+ if (superClass) _setPrototypeOf(subClass, superClass);
30
+ }
31
+ function _possibleConstructorReturn(self, call) {
32
+ if (call && (_typeof(call) === "object" || typeof call === "function")) {
33
+ return call;
34
+ }
35
+ return _assertThisInitialized(self);
36
+ }
37
+ function _setPrototypeOf(o, p) {
38
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
39
+ o.__proto__ = p;
40
+ return o;
41
+ };
42
+ return _setPrototypeOf(o, p);
43
+ }
44
+ var _typeof = function(obj) {
45
+ "@swc/helpers - typeof";
46
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
47
+ };
48
+ function _isNativeReflectConstruct() {
49
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
50
+ if (Reflect.construct.sham) return false;
51
+ if (typeof Proxy === "function") return true;
52
+ try {
53
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
54
+ return true;
55
+ } catch (e) {
56
+ return false;
57
+ }
58
+ }
59
+ function _createSuper(Derived) {
60
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
61
+ return function _createSuperInternal() {
62
+ var Super = _getPrototypeOf(Derived), result;
63
+ if (hasNativeReflectConstruct) {
64
+ var NewTarget = _getPrototypeOf(this).constructor;
65
+ result = Reflect.construct(Super, arguments, NewTarget);
66
+ } else {
67
+ result = Super.apply(this, arguments);
68
+ }
69
+ return _possibleConstructorReturn(this, result);
70
+ };
71
+ }
72
+ import { RuntimeControl } from "../BaseControl";
73
+ import ColumnControlProperty from "./property";
74
+ var ColumnControl = /*#__PURE__*/ function(RuntimeControl) {
75
+ "use strict";
76
+ _inherits(ColumnControl, RuntimeControl);
77
+ var _super = _createSuper(ColumnControl);
78
+ function ColumnControl(props) {
79
+ _classCallCheck(this, ColumnControl);
80
+ var _this;
81
+ _this = _super.call(this, props);
82
+ _this.controlType = "column";
83
+ _this.props = new ColumnControlProperty(props === null || props === void 0 ? void 0 : props.props);
84
+ return _this;
85
+ }
86
+ return ColumnControl;
87
+ }(RuntimeControl);
88
+ export default ColumnControl;
89
+ export { ColumnControl as RuntimeColumnControl };
File without changes
@@ -0,0 +1,100 @@
1
+ function _arrayLikeToArray(arr, len) {
2
+ if (len == null || len > arr.length) len = arr.length;
3
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
4
+ return arr2;
5
+ }
6
+ function _arrayWithoutHoles(arr) {
7
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
8
+ }
9
+ function _iterableToArray(iter) {
10
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
11
+ }
12
+ function _nonIterableSpread() {
13
+ 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
+ }
15
+ function _toConsumableArray(arr) {
16
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
17
+ }
18
+ function _unsupportedIterableToArray(o, minLen) {
19
+ if (!o) return;
20
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
21
+ var n = Object.prototype.toString.call(o).slice(8, -1);
22
+ if (n === "Object" && o.constructor) n = o.constructor.name;
23
+ if (n === "Map" || n === "Set") return Array.from(n);
24
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
25
+ }
26
+ import { isArray, isPlainObject } from "@byteluck-fe/model-driven-shared";
27
+ export function setPropertyDontEnum(obj, property) {
28
+ var ref;
29
+ // 如果没有被设置过不允许枚举的话,说明是第一次被设置,需要设置属性不允许枚举
30
+ if ((ref = Object.getOwnPropertyDescriptors(obj)[property]) === null || ref === void 0 ? void 0 : ref.enumerable) {
31
+ Object.defineProperty(obj, property, {
32
+ enumerable: false
33
+ });
34
+ }
35
+ }
36
+ export function defineParent(control, parent) {
37
+ control.parent = parent;
38
+ // 如果没有被设置过不允许枚举的话,说明是第一次被代理,需要设置parent属性不允许枚举
39
+ setPropertyDontEnum(control, "parent");
40
+ }
41
+ export function defineArrayParent(controls, parent) {
42
+ controls.forEach(function(item) {
43
+ defineParent(item, parent);
44
+ });
45
+ }
46
+ var targetKey = Symbol("targetKey");
47
+ function getTargetValue(value) {
48
+ var _targetKey;
49
+ return (_targetKey = value[targetKey]) !== null && _targetKey !== void 0 ? _targetKey : value;
50
+ }
51
+ function proxyState(target, parent) {
52
+ defineArrayParent(target, parent);
53
+ return new Proxy(target, {
54
+ get: function get(t, p) {
55
+ for(var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
56
+ args[_key - 2] = arguments[_key];
57
+ }
58
+ var _Reflect;
59
+ if (p === targetKey) {
60
+ return t;
61
+ }
62
+ return (_Reflect = Reflect).get.apply(_Reflect, [
63
+ t,
64
+ p
65
+ ].concat(_toConsumableArray(args)));
66
+ },
67
+ set: function set(t, property, value) {
68
+ for(var _len = arguments.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++){
69
+ args[_key - 3] = arguments[_key];
70
+ }
71
+ var _Reflect;
72
+ // 更改长度为当前长度,代表没变,直接返回true,否则在safari 13.x版本的严格模式会引起页面崩溃
73
+ if (isArray(target) && property === "length" && value === target.length) {
74
+ return true;
75
+ }
76
+ var result = (_Reflect = Reflect).set.apply(_Reflect, [
77
+ t,
78
+ property,
79
+ value
80
+ ].concat(_toConsumableArray(args)));
81
+ if (isPlainObject(value)) {
82
+ defineParent(value, parent);
83
+ }
84
+ return result;
85
+ }
86
+ });
87
+ }
88
+ export function defineControlArrayToProperty(obj, property, initialValue, parent) {
89
+ var _parent = parent !== null && parent !== void 0 ? parent : obj;
90
+ var value = proxyState(getTargetValue(initialValue !== null && initialValue !== void 0 ? initialValue : []), _parent);
91
+ Object.defineProperty(obj, property, {
92
+ get: function get() {
93
+ return value;
94
+ },
95
+ set: function set(newValue) {
96
+ value = proxyState(getTargetValue(newValue), _parent);
97
+ },
98
+ enumerable: true
99
+ });
100
+ }
@@ -0,0 +1,94 @@
1
+ function _assertThisInitialized(self) {
2
+ if (self === void 0) {
3
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4
+ }
5
+ return self;
6
+ }
7
+ function _classCallCheck(instance, Constructor) {
8
+ if (!(instance instanceof Constructor)) {
9
+ throw new TypeError("Cannot call a class as a function");
10
+ }
11
+ }
12
+ function _getPrototypeOf(o) {
13
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
14
+ return o.__proto__ || Object.getPrototypeOf(o);
15
+ };
16
+ return _getPrototypeOf(o);
17
+ }
18
+ function _inherits(subClass, superClass) {
19
+ if (typeof superClass !== "function" && superClass !== null) {
20
+ throw new TypeError("Super expression must either be null or a function");
21
+ }
22
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
23
+ constructor: {
24
+ value: subClass,
25
+ writable: true,
26
+ configurable: true
27
+ }
28
+ });
29
+ if (superClass) _setPrototypeOf(subClass, superClass);
30
+ }
31
+ function _possibleConstructorReturn(self, call) {
32
+ if (call && (_typeof(call) === "object" || typeof call === "function")) {
33
+ return call;
34
+ }
35
+ return _assertThisInitialized(self);
36
+ }
37
+ function _setPrototypeOf(o, p) {
38
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
39
+ o.__proto__ = p;
40
+ return o;
41
+ };
42
+ return _setPrototypeOf(o, p);
43
+ }
44
+ var _typeof = function(obj) {
45
+ "@swc/helpers - typeof";
46
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
47
+ };
48
+ function _isNativeReflectConstruct() {
49
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
50
+ if (Reflect.construct.sham) return false;
51
+ if (typeof Proxy === "function") return true;
52
+ try {
53
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
54
+ return true;
55
+ } catch (e) {
56
+ return false;
57
+ }
58
+ }
59
+ function _createSuper(Derived) {
60
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
61
+ return function _createSuperInternal() {
62
+ var Super = _getPrototypeOf(Derived), result;
63
+ if (hasNativeReflectConstruct) {
64
+ var NewTarget = _getPrototypeOf(this).constructor;
65
+ result = Reflect.construct(Super, arguments, NewTarget);
66
+ } else {
67
+ result = Super.apply(this, arguments);
68
+ }
69
+ return _possibleConstructorReturn(this, result);
70
+ };
71
+ }
72
+ import { DesignerControl } from "../BaseControl";
73
+ import BaseControlProperty from "./property";
74
+ var FormControl = /*#__PURE__*/ function(DesignerControl) {
75
+ "use strict";
76
+ _inherits(FormControl, DesignerControl);
77
+ var _super = _createSuper(FormControl);
78
+ function FormControl(props) {
79
+ _classCallCheck(this, FormControl);
80
+ var _this;
81
+ _this = _super.call(this, props);
82
+ _this.controlType = "form";
83
+ _this.props = new BaseControlProperty(props === null || props === void 0 ? void 0 : props.props);
84
+ return _this;
85
+ }
86
+ return FormControl;
87
+ }(DesignerControl);
88
+ FormControl.controlEventKeys = [
89
+ "on_change",
90
+ "on_focus",
91
+ "on_blur",
92
+ ];
93
+ export default FormControl;
94
+ export { FormControl as DesignerFormControl };
@@ -0,0 +1,11 @@
1
+ import Designer from "./designer";
2
+ import Runtime from "./runtime";
3
+ import Property from "./property";
4
+ export default {
5
+ Designer: Designer,
6
+ Runtime: Runtime,
7
+ Property: Property
8
+ };
9
+ export * from "./designer";
10
+ export * from "./runtime";
11
+ export * from "./property";