@byteluck-fe/model-driven-settings 1.3.0-beta.25

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 (41) hide show
  1. package/README.md +30 -0
  2. package/dist/esm/default/createBaseFields.js +64 -0
  3. package/dist/esm/default/createFormBaseFields.js +130 -0
  4. package/dist/esm/default/index.js +2 -0
  5. package/dist/esm/defineInstance.js +3 -0
  6. package/dist/esm/index.js +4 -0
  7. package/dist/esm/initSettings.js +116 -0
  8. package/dist/esm/props/base.js +38 -0
  9. package/dist/esm/props/checkbox.js +86 -0
  10. package/dist/esm/props/custom.js +137 -0
  11. package/dist/esm/props/input-number.js +90 -0
  12. package/dist/esm/props/input.js +92 -0
  13. package/dist/esm/props/radio.js +88 -0
  14. package/dist/esm/props/select.js +88 -0
  15. package/dist/esm/props/switch.js +90 -0
  16. package/dist/esm/props/textarea.js +96 -0
  17. package/dist/esm/schema/group.js +16 -0
  18. package/dist/esm/schema/index.js +3 -0
  19. package/dist/esm/schema/setting.js +69 -0
  20. package/dist/esm/schema/tab.js +15 -0
  21. package/dist/types/default/createBaseFields.d.ts +2 -0
  22. package/dist/types/default/createFormBaseFields.d.ts +3 -0
  23. package/dist/types/default/index.d.ts +2 -0
  24. package/dist/types/defineInstance.d.ts +79 -0
  25. package/dist/types/index.d.ts +4 -0
  26. package/dist/types/initSettings.d.ts +14 -0
  27. package/dist/types/props/base.d.ts +16 -0
  28. package/dist/types/props/checkbox.d.ts +5 -0
  29. package/dist/types/props/custom.d.ts +5 -0
  30. package/dist/types/props/input-number.d.ts +7 -0
  31. package/dist/types/props/input.d.ts +8 -0
  32. package/dist/types/props/radio.d.ts +6 -0
  33. package/dist/types/props/select.d.ts +6 -0
  34. package/dist/types/props/switch.d.ts +7 -0
  35. package/dist/types/props/textarea.d.ts +10 -0
  36. package/dist/types/schema/group.d.ts +18 -0
  37. package/dist/types/schema/index.d.ts +3 -0
  38. package/dist/types/schema/setting.d.ts +69 -0
  39. package/dist/types/schema/tab.d.ts +15 -0
  40. package/package.json +30 -0
  41. package/src/index.ts +4 -0
@@ -0,0 +1,90 @@
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 { BaseProps } from "./base";
73
+ export var InputNumberProps = /*#__PURE__*/ function(BaseProps) {
74
+ "use strict";
75
+ _inherits(InputNumberProps, BaseProps);
76
+ var _super = _createSuper(InputNumberProps);
77
+ function InputNumberProps(props) {
78
+ _classCallCheck(this, InputNumberProps);
79
+ var _this;
80
+ _this = _super.call(this, props);
81
+ var ref;
82
+ _this.max = (ref = props === null || props === void 0 ? void 0 : props.max) !== null && ref !== void 0 ? ref : "";
83
+ var ref1;
84
+ _this.min = (ref1 = props === null || props === void 0 ? void 0 : props.min) !== null && ref1 !== void 0 ? ref1 : "";
85
+ var ref2;
86
+ _this.placeholder = (ref2 = props === null || props === void 0 ? void 0 : props.placeholder) !== null && ref2 !== void 0 ? ref2 : "";
87
+ return _this;
88
+ }
89
+ return InputNumberProps;
90
+ }(BaseProps);
@@ -0,0 +1,92 @@
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 { BaseProps } from "./base";
73
+ export var InputProps = /*#__PURE__*/ function(BaseProps) {
74
+ "use strict";
75
+ _inherits(InputProps, BaseProps);
76
+ var _super = _createSuper(InputProps);
77
+ function InputProps(props) {
78
+ _classCallCheck(this, InputProps);
79
+ var _this;
80
+ _this = _super.call(this, props);
81
+ var ref;
82
+ _this.maxLength = (ref = props === null || props === void 0 ? void 0 : props.maxLength) !== null && ref !== void 0 ? ref : "";
83
+ var ref1;
84
+ _this.minLength = (ref1 = props === null || props === void 0 ? void 0 : props.minLength) !== null && ref1 !== void 0 ? ref1 : "";
85
+ var ref2;
86
+ _this.placeholder = (ref2 = props === null || props === void 0 ? void 0 : props.placeholder) !== null && ref2 !== void 0 ? ref2 : "";
87
+ var ref3;
88
+ _this.i18n = (ref3 = props === null || props === void 0 ? void 0 : props.i18n) !== null && ref3 !== void 0 ? ref3 : false;
89
+ return _this;
90
+ }
91
+ return InputProps;
92
+ }(BaseProps);
@@ -0,0 +1,88 @@
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 { BaseProps } from "./base";
73
+ export var RadioProps = /*#__PURE__*/ function(BaseProps) {
74
+ "use strict";
75
+ _inherits(RadioProps, BaseProps);
76
+ var _super = _createSuper(RadioProps);
77
+ function RadioProps(props) {
78
+ _classCallCheck(this, RadioProps);
79
+ var _this;
80
+ _this = _super.call(this, props);
81
+ var ref;
82
+ _this.options = (ref = props === null || props === void 0 ? void 0 : props.options) !== null && ref !== void 0 ? ref : [];
83
+ var ref1;
84
+ _this.showType = (ref1 = props === null || props === void 0 ? void 0 : props.showType) !== null && ref1 !== void 0 ? ref1 : "outline";
85
+ return _this;
86
+ }
87
+ return RadioProps;
88
+ }(BaseProps);
@@ -0,0 +1,88 @@
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 { BaseProps } from "./base";
73
+ export var SelectProps = /*#__PURE__*/ function(BaseProps) {
74
+ "use strict";
75
+ _inherits(SelectProps, BaseProps);
76
+ var _super = _createSuper(SelectProps);
77
+ function SelectProps(props) {
78
+ _classCallCheck(this, SelectProps);
79
+ var _this;
80
+ _this = _super.call(this, props);
81
+ var ref;
82
+ _this.placeholder = (ref = props === null || props === void 0 ? void 0 : props.placeholder) !== null && ref !== void 0 ? ref : "";
83
+ var ref1;
84
+ _this.options = (ref1 = props === null || props === void 0 ? void 0 : props.options) !== null && ref1 !== void 0 ? ref1 : [];
85
+ return _this;
86
+ }
87
+ return SelectProps;
88
+ }(BaseProps);
@@ -0,0 +1,90 @@
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 { BaseProps } from "./base";
73
+ export var SwitchProps = /*#__PURE__*/ function(BaseProps) {
74
+ "use strict";
75
+ _inherits(SwitchProps, BaseProps);
76
+ var _super = _createSuper(SwitchProps);
77
+ function SwitchProps(props) {
78
+ _classCallCheck(this, SwitchProps);
79
+ var _this;
80
+ _this = _super.call(this, props);
81
+ var ref;
82
+ _this.showType = (ref = props === null || props === void 0 ? void 0 : props.showType) !== null && ref !== void 0 ? ref : "switch";
83
+ var ref1;
84
+ _this.tips = (ref1 = props === null || props === void 0 ? void 0 : props.tips) !== null && ref1 !== void 0 ? ref1 : "";
85
+ var ref2;
86
+ _this.disabled = (ref2 = props === null || props === void 0 ? void 0 : props.disabled) !== null && ref2 !== void 0 ? ref2 : false;
87
+ return _this;
88
+ }
89
+ return SwitchProps;
90
+ }(BaseProps);
@@ -0,0 +1,96 @@
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 { BaseProps } from "./base";
73
+ export var TextareaProps = /*#__PURE__*/ function(BaseProps) {
74
+ "use strict";
75
+ _inherits(TextareaProps, BaseProps);
76
+ var _super = _createSuper(TextareaProps);
77
+ function TextareaProps(props) {
78
+ _classCallCheck(this, TextareaProps);
79
+ var _this;
80
+ _this = _super.call(this, props);
81
+ var ref;
82
+ _this.maxLength = (ref = props === null || props === void 0 ? void 0 : props.maxLength) !== null && ref !== void 0 ? ref : "";
83
+ var ref1;
84
+ _this.minLength = (ref1 = props === null || props === void 0 ? void 0 : props.minLength) !== null && ref1 !== void 0 ? ref1 : "";
85
+ var ref2;
86
+ _this.placeholder = (ref2 = props === null || props === void 0 ? void 0 : props.placeholder) !== null && ref2 !== void 0 ? ref2 : "";
87
+ var ref3;
88
+ _this.maxRows = (ref3 = props === null || props === void 0 ? void 0 : props.maxRows) !== null && ref3 !== void 0 ? ref3 : "";
89
+ var ref4;
90
+ _this.minRows = (ref4 = props === null || props === void 0 ? void 0 : props.minRows) !== null && ref4 !== void 0 ? ref4 : "";
91
+ var ref5;
92
+ _this.i18n = (ref5 = props === null || props === void 0 ? void 0 : props.i18n) !== null && ref5 !== void 0 ? ref5 : false;
93
+ return _this;
94
+ }
95
+ return TextareaProps;
96
+ }(BaseProps);
@@ -0,0 +1,16 @@
1
+ function _classCallCheck(instance, Constructor) {
2
+ if (!(instance instanceof Constructor)) {
3
+ throw new TypeError("Cannot call a class as a function");
4
+ }
5
+ }
6
+ export var Group = function Group(schema) {
7
+ "use strict";
8
+ _classCallCheck(this, Group);
9
+ this.type = "group";
10
+ var _title;
11
+ this.title = (_title = schema.title) !== null && _title !== void 0 ? _title : "";
12
+ var _required;
13
+ this.required = (_required = schema.required) !== null && _required !== void 0 ? _required : false;
14
+ this.items = schema.items;
15
+ this.tips = schema.tips;
16
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./setting";
2
+ export * from "./group";
3
+ export * from "./tab";
@@ -0,0 +1,69 @@
1
+ function _classCallCheck(instance, Constructor) {
2
+ if (!(instance instanceof Constructor)) {
3
+ throw new TypeError("Cannot call a class as a function");
4
+ }
5
+ }
6
+ import { BaseProps } from "../props/base";
7
+ import { error, isPlainObject, noop } from "@byteluck-fe/model-driven-shared";
8
+ export var Setting = /*#__PURE__*/ function() {
9
+ "use strict";
10
+ function Setting(schema) {
11
+ _classCallCheck(this, Setting);
12
+ this.type = schema.type;
13
+ this.label = schema.label;
14
+ this.key = schema.key;
15
+ this.component = schema.component;
16
+ var _effect;
17
+ this.effect = (_effect = schema.effect) !== null && _effect !== void 0 ? _effect : {};
18
+ var _scopeEffect;
19
+ this.scopeEffect = (_scopeEffect = schema.scopeEffect) !== null && _scopeEffect !== void 0 ? _scopeEffect : noop;
20
+ this.defaultValue = schema.defaultValue;
21
+ this.validator = schema.validator;
22
+ var _props;
23
+ this.props = (_props = schema.props) !== null && _props !== void 0 ? _props : new BaseProps();
24
+ // private init
25
+ this.effectKeys = Object.keys(this.effect);
26
+ }
27
+ var _proto = Setting.prototype;
28
+ _proto.filterEffects = function filterEffects(effectKey) {
29
+ var _this = this;
30
+ if (effectKey === "") {
31
+ return Object.values(this.effect);
32
+ }
33
+ return this.effectKeys.filter(function(key) {
34
+ // 触发规则:effectKeys => effectFns
35
+ // dataBind => dataBind
36
+ // dataBind.fieldCode => dataBind、dataBind.fieldCode
37
+ var regexp = new RegExp("^".concat(key, "(\\.\\w+)*$"));
38
+ return regexp.test(effectKey);
39
+ }).map(function(key) {
40
+ return _this.effect[key];
41
+ });
42
+ };
43
+ _proto.callEffectFn = function callEffectFn(effectFn, args) {
44
+ try {
45
+ var result = effectFn.apply(null, args);
46
+ if (isPlainObject(result)) {
47
+ Object.assign(this.props, result);
48
+ }
49
+ } catch (e) {
50
+ error("effect error \n ".concat(e));
51
+ }
52
+ };
53
+ _proto.callEffect = function callEffect(effectKey) {
54
+ for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
55
+ args[_key - 1] = arguments[_key];
56
+ }
57
+ var _this = this;
58
+ this.filterEffects(effectKey).forEach(function(fn) {
59
+ return _this.callEffectFn(fn, args);
60
+ });
61
+ };
62
+ _proto.callScopeEffect = function callScopeEffect() {
63
+ for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
64
+ args[_key] = arguments[_key];
65
+ }
66
+ this.callEffectFn(this.scopeEffect, args);
67
+ };
68
+ return Setting;
69
+ }();
@@ -0,0 +1,15 @@
1
+ function _classCallCheck(instance, Constructor) {
2
+ if (!(instance instanceof Constructor)) {
3
+ throw new TypeError("Cannot call a class as a function");
4
+ }
5
+ }
6
+ export function isTabSchema(schema) {
7
+ return "type" in schema && schema.type === "tab";
8
+ }
9
+ export var Tab = function Tab(schema) {
10
+ "use strict";
11
+ _classCallCheck(this, Tab);
12
+ this.type = "tab";
13
+ this.title = schema.title;
14
+ this.items = schema.items;
15
+ };
@@ -0,0 +1,2 @@
1
+ import { FieldSchema } from '../defineInstance';
2
+ export declare function createBaseFields(): FieldSchema[];
@@ -0,0 +1,3 @@
1
+ import { BaseControlProperty, DeepPartial } from '@byteluck-fe/model-driven-core';
2
+ import { FieldSchema } from '../defineInstance';
3
+ export declare function createFormBaseFields(defaultValues?: DeepPartial<BaseControlProperty>): FieldSchema[];
@@ -0,0 +1,2 @@
1
+ export * from './createBaseFields';
2
+ export * from './createFormBaseFields';