@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
package/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # Settings
2
+ 自定义控件设置
3
+
4
+ ```
5
+ │ defineInstance.ts // 定义控件函数
6
+ │ index.ts
7
+ │ initSettings.ts // 初始化setting,被外部引用
8
+
9
+ ├─default // 内部默认值
10
+ │ createBaseFields.ts // 基础控件的默认setting
11
+ │ createFormBaseFields.ts // 表单控件的默认setting
12
+ │ index.ts
13
+
14
+ ├─props // 内置的setting控件
15
+ │ base.ts
16
+ │ checkbox.ts
17
+ │ custom.ts
18
+ │ input-number.ts
19
+ │ input.ts
20
+ │ radio.ts
21
+ │ select.ts
22
+ │ switch.ts
23
+ │ textarea.ts
24
+
25
+ └─schema // setting的容器和schema定义
26
+ group.ts
27
+ index.ts
28
+ setting.ts
29
+ tab.ts
30
+ ```
@@ -0,0 +1,64 @@
1
+ export function createBaseFields() {
2
+ return [
3
+ {
4
+ label: "隐藏",
5
+ key: "isHide",
6
+ type: "boolean",
7
+ component: "switch"
8
+ },
9
+ {
10
+ key: "superSetting",
11
+ component: "super-setting"
12
+ },
13
+ {
14
+ key: "style.width",
15
+ component: "styleComponent",
16
+ props: {
17
+ configKey: "style.widthConfig",
18
+ options: [
19
+ "px",
20
+ "%",
21
+ "fill",
22
+ "hug"
23
+ ]
24
+ },
25
+ scopeEffect: function scopeEffect(driven, payload) {
26
+ var oldParent = payload.oldParent, newParent = payload.newParent, instance = payload.instance;
27
+ if ((oldParent === null || oldParent === void 0 ? void 0 : oldParent.type) === "advanced-container" && newParent.type === "positioning-container") {
28
+ driven.setInstance(instance, "style.width", "");
29
+ driven.setInstance(instance, "style.widthConfig", "fill");
30
+ }
31
+ if (newParent) {
32
+ return {
33
+ visible: newParent.type === "advanced-container"
34
+ };
35
+ }
36
+ }
37
+ },
38
+ {
39
+ key: "style.height",
40
+ component: "styleComponent",
41
+ props: {
42
+ configKey: "style.heightConfig",
43
+ options: [
44
+ "px",
45
+ "%",
46
+ "fill",
47
+ "hug"
48
+ ]
49
+ },
50
+ scopeEffect: function scopeEffect(driven, payload) {
51
+ var oldParent = payload.oldParent, newParent = payload.newParent, instance = payload.instance;
52
+ if ((oldParent === null || oldParent === void 0 ? void 0 : oldParent.type) === "advanced-container" && newParent.type === "positioning-container") {
53
+ driven.setInstance(instance, "style.height", "");
54
+ driven.setInstance(instance, "style.heightConfig", "fill");
55
+ }
56
+ if (payload.newParent) {
57
+ return {
58
+ visible: payload.newParent.type === "advanced-container"
59
+ };
60
+ }
61
+ }
62
+ },
63
+ ];
64
+ }
@@ -0,0 +1,130 @@
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 { createBaseFields } from "./createBaseFields";
27
+ export function createFormBaseFields(defaultValues) {
28
+ return _toConsumableArray(createBaseFields()).concat([
29
+ {
30
+ type: "DataBind",
31
+ key: "dataBind",
32
+ component: "data-bind",
33
+ defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.dataBind
34
+ },
35
+ {
36
+ key: "caption",
37
+ type: "string",
38
+ component: "input",
39
+ props: {
40
+ maxLength: 80,
41
+ i18n: true
42
+ },
43
+ defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.caption,
44
+ validator: function validator(value) {
45
+ if (!value) {
46
+ return "标题必填";
47
+ }
48
+ }
49
+ },
50
+ {
51
+ label: "隐藏标题",
52
+ key: "isHideCaption",
53
+ type: "boolean",
54
+ component: "switch",
55
+ defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.isHideCaption,
56
+ props: {
57
+ showType: "checkbox"
58
+ },
59
+ // 在明细表内隐藏
60
+ scopeEffect: function scopeEffect(driven, payload) {
61
+ var ref, ref1;
62
+ if (((ref = payload.current) === null || ref === void 0 ? void 0 : ref.type) !== ((ref1 = payload.from) === null || ref1 === void 0 ? void 0 : ref1.type)) {
63
+ //明细子表内默认开启
64
+ if (payload.current.type === "subtable") {
65
+ driven.setInstance(payload.control, "isHideCaption", true);
66
+ }
67
+ return {
68
+ visible: payload.current.type !== "subtable"
69
+ };
70
+ }
71
+ }
72
+ },
73
+ {
74
+ key: "labelPosition",
75
+ type: "string",
76
+ component: "radio",
77
+ defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.labelPosition,
78
+ props: {
79
+ showType: "solid",
80
+ options: [
81
+ {
82
+ label: "上下布局",
83
+ value: "top"
84
+ },
85
+ {
86
+ label: "左右布局",
87
+ value: "left"
88
+ },
89
+ ]
90
+ }
91
+ },
92
+ {
93
+ key: "defaultState",
94
+ type: "string",
95
+ component: "radio",
96
+ defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.defaultState,
97
+ props: {
98
+ showType: "solid",
99
+ options: [
100
+ {
101
+ label: "普通",
102
+ value: "default"
103
+ },
104
+ {
105
+ label: "只读",
106
+ value: "readonly"
107
+ },
108
+ ]
109
+ }
110
+ },
111
+ {
112
+ label: "必填",
113
+ key: "required",
114
+ type: "boolean",
115
+ component: "switch",
116
+ defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.required
117
+ },
118
+ {
119
+ label: "提示文字",
120
+ key: "placeholder",
121
+ type: "string",
122
+ component: "input",
123
+ defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.placeholder,
124
+ props: {
125
+ maxLength: 80,
126
+ i18n: true
127
+ }
128
+ },
129
+ ]);
130
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./createBaseFields";
2
+ export * from "./createFormBaseFields";
@@ -0,0 +1,3 @@
1
+ export function defineInstance(params) {
2
+ return params;
3
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./defineInstance";
2
+ export * from "./initSettings";
3
+ export * from "./schema";
4
+ export * from "./default";
@@ -0,0 +1,116 @@
1
+ function _defineProperty(obj, key, value) {
2
+ if (key in obj) {
3
+ Object.defineProperty(obj, key, {
4
+ value: value,
5
+ enumerable: true,
6
+ configurable: true,
7
+ writable: true
8
+ });
9
+ } else {
10
+ obj[key] = value;
11
+ }
12
+ return obj;
13
+ }
14
+ function _objectSpread(target) {
15
+ for(var i = 1; i < arguments.length; i++){
16
+ var source = arguments[i] != null ? arguments[i] : {};
17
+ var ownKeys = Object.keys(source);
18
+ if (typeof Object.getOwnPropertySymbols === "function") {
19
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
20
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
21
+ }));
22
+ }
23
+ ownKeys.forEach(function(key) {
24
+ _defineProperty(target, key, source[key]);
25
+ });
26
+ }
27
+ return target;
28
+ }
29
+ function ownKeys(object, enumerableOnly) {
30
+ var keys = Object.keys(object);
31
+ if (Object.getOwnPropertySymbols) {
32
+ var symbols = Object.getOwnPropertySymbols(object);
33
+ if (enumerableOnly) {
34
+ symbols = symbols.filter(function(sym) {
35
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
36
+ });
37
+ }
38
+ keys.push.apply(keys, symbols);
39
+ }
40
+ return keys;
41
+ }
42
+ function _objectSpreadProps(target, source) {
43
+ source = source != null ? source : {};
44
+ if (Object.getOwnPropertyDescriptors) {
45
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
46
+ } else {
47
+ ownKeys(Object(source)).forEach(function(key) {
48
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
49
+ });
50
+ }
51
+ return target;
52
+ }
53
+ import { Group, Setting } from "./schema";
54
+ import { CustomProps } from "./props/custom";
55
+ import { InputProps } from "./props/input";
56
+ import { InputNumberProps } from "./props/input-number";
57
+ import { SwitchProps } from "./props/switch";
58
+ import { CheckboxProps } from "./props/checkbox";
59
+ import { SelectProps } from "./props/select";
60
+ import { RadioProps } from "./props/radio";
61
+ import { TextareaProps } from "./props/textarea";
62
+ import { isTabSchema, Tab } from "./schema/tab";
63
+ function propsFactory(component, props) {
64
+ switch(component){
65
+ case "input":
66
+ return new InputProps(props);
67
+ case "textarea":
68
+ return new TextareaProps(props);
69
+ case "input-number":
70
+ return new InputNumberProps(props);
71
+ case "switch":
72
+ return new SwitchProps(props);
73
+ case "radio":
74
+ return new RadioProps(props);
75
+ case "checkbox":
76
+ return new CheckboxProps(props);
77
+ case "select":
78
+ return new SelectProps(props);
79
+ default:
80
+ return new CustomProps(props);
81
+ }
82
+ }
83
+ function buildSettingItem(settingMap) {
84
+ return function(schemaKey) {
85
+ var schema = settingMap.get(schemaKey);
86
+ if (!schema) {
87
+ return;
88
+ }
89
+ return new Setting(_objectSpreadProps(_objectSpread({}, schema), {
90
+ props: propsFactory(schema.component, "props" in schema ? schema.props : undefined)
91
+ }));
92
+ };
93
+ }
94
+ export function initSettings(params) {
95
+ var generatorGroup = function generatorGroup(group) {
96
+ return new Group(_objectSpreadProps(_objectSpread({}, group), {
97
+ items: group.items.map(buildSettingItem(settingMap)).filter(Boolean)
98
+ }));
99
+ };
100
+ var generatorGroups = function generatorGroups(groups) {
101
+ return groups.map(generatorGroup);
102
+ };
103
+ var settingMap = params.fields.reduce(function(map, current) {
104
+ map.set(current.key, current);
105
+ return map;
106
+ }, new Map());
107
+ return params.groups.map(function(item) {
108
+ if (isTabSchema(item)) {
109
+ return new Tab(_objectSpreadProps(_objectSpread({}, item), {
110
+ items: generatorGroups(item.items)
111
+ }));
112
+ } else {
113
+ return generatorGroup(item);
114
+ }
115
+ });
116
+ }
@@ -0,0 +1,38 @@
1
+ function _classCallCheck(instance, Constructor) {
2
+ if (!(instance instanceof Constructor)) {
3
+ throw new TypeError("Cannot call a class as a function");
4
+ }
5
+ }
6
+ function _defineProperties(target, props) {
7
+ for(var i = 0; i < props.length; i++){
8
+ var descriptor = props[i];
9
+ descriptor.enumerable = descriptor.enumerable || false;
10
+ descriptor.configurable = true;
11
+ if ("value" in descriptor) descriptor.writable = true;
12
+ Object.defineProperty(target, descriptor.key, descriptor);
13
+ }
14
+ }
15
+ function _createClass(Constructor, protoProps, staticProps) {
16
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
17
+ if (staticProps) _defineProperties(Constructor, staticProps);
18
+ return Constructor;
19
+ }
20
+ export var BaseProps = /*#__PURE__*/ function() {
21
+ "use strict";
22
+ function BaseProps(props) {
23
+ _classCallCheck(this, BaseProps);
24
+ var ref;
25
+ this.visible = (ref = props === null || props === void 0 ? void 0 : props.visible) !== null && ref !== void 0 ? ref : true;
26
+ var ref1;
27
+ this.expression = (ref1 = props === null || props === void 0 ? void 0 : props.expression) !== null && ref1 !== void 0 ? ref1 : false;
28
+ }
29
+ _createClass(BaseProps, [
30
+ {
31
+ key: "isAtomicComponent",
32
+ get: function get() {
33
+ return true;
34
+ }
35
+ }
36
+ ]);
37
+ return BaseProps;
38
+ }();
@@ -0,0 +1,86 @@
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 CheckboxProps = /*#__PURE__*/ function(BaseProps) {
74
+ "use strict";
75
+ _inherits(CheckboxProps, BaseProps);
76
+ var _super = _createSuper(CheckboxProps);
77
+ function CheckboxProps(props) {
78
+ _classCallCheck(this, CheckboxProps);
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
+ return _this;
84
+ }
85
+ return CheckboxProps;
86
+ }(BaseProps);
@@ -0,0 +1,137 @@
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 _arrayWithHoles(arr) {
7
+ if (Array.isArray(arr)) return arr;
8
+ }
9
+ function _assertThisInitialized(self) {
10
+ if (self === void 0) {
11
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
12
+ }
13
+ return self;
14
+ }
15
+ function _classCallCheck(instance, Constructor) {
16
+ if (!(instance instanceof Constructor)) {
17
+ throw new TypeError("Cannot call a class as a function");
18
+ }
19
+ }
20
+ function _getPrototypeOf(o) {
21
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
22
+ return o.__proto__ || Object.getPrototypeOf(o);
23
+ };
24
+ return _getPrototypeOf(o);
25
+ }
26
+ function _inherits(subClass, superClass) {
27
+ if (typeof superClass !== "function" && superClass !== null) {
28
+ throw new TypeError("Super expression must either be null or a function");
29
+ }
30
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
31
+ constructor: {
32
+ value: subClass,
33
+ writable: true,
34
+ configurable: true
35
+ }
36
+ });
37
+ if (superClass) _setPrototypeOf(subClass, superClass);
38
+ }
39
+ function _iterableToArrayLimit(arr, i) {
40
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
41
+ if (_i == null) return;
42
+ var _arr = [];
43
+ var _n = true;
44
+ var _d = false;
45
+ var _s, _e;
46
+ try {
47
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
48
+ _arr.push(_s.value);
49
+ if (i && _arr.length === i) break;
50
+ }
51
+ } catch (err) {
52
+ _d = true;
53
+ _e = err;
54
+ } finally{
55
+ try {
56
+ if (!_n && _i["return"] != null) _i["return"]();
57
+ } finally{
58
+ if (_d) throw _e;
59
+ }
60
+ }
61
+ return _arr;
62
+ }
63
+ function _nonIterableRest() {
64
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
65
+ }
66
+ function _possibleConstructorReturn(self, call) {
67
+ if (call && (_typeof(call) === "object" || typeof call === "function")) {
68
+ return call;
69
+ }
70
+ return _assertThisInitialized(self);
71
+ }
72
+ function _setPrototypeOf(o, p) {
73
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
74
+ o.__proto__ = p;
75
+ return o;
76
+ };
77
+ return _setPrototypeOf(o, p);
78
+ }
79
+ function _slicedToArray(arr, i) {
80
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
81
+ }
82
+ var _typeof = function(obj) {
83
+ "@swc/helpers - typeof";
84
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
85
+ };
86
+ function _unsupportedIterableToArray(o, minLen) {
87
+ if (!o) return;
88
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
89
+ var n = Object.prototype.toString.call(o).slice(8, -1);
90
+ if (n === "Object" && o.constructor) n = o.constructor.name;
91
+ if (n === "Map" || n === "Set") return Array.from(n);
92
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
93
+ }
94
+ function _isNativeReflectConstruct() {
95
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
96
+ if (Reflect.construct.sham) return false;
97
+ if (typeof Proxy === "function") return true;
98
+ try {
99
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
100
+ return true;
101
+ } catch (e) {
102
+ return false;
103
+ }
104
+ }
105
+ function _createSuper(Derived) {
106
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
107
+ return function _createSuperInternal() {
108
+ var Super = _getPrototypeOf(Derived), result;
109
+ if (hasNativeReflectConstruct) {
110
+ var NewTarget = _getPrototypeOf(this).constructor;
111
+ result = Reflect.construct(Super, arguments, NewTarget);
112
+ } else {
113
+ result = Super.apply(this, arguments);
114
+ }
115
+ return _possibleConstructorReturn(this, result);
116
+ };
117
+ }
118
+ import { isPlainObject } from "@byteluck-fe/model-driven-shared";
119
+ import { BaseProps } from "./base";
120
+ export var CustomProps = /*#__PURE__*/ function(BaseProps) {
121
+ "use strict";
122
+ _inherits(CustomProps, BaseProps);
123
+ var _super = _createSuper(CustomProps);
124
+ function CustomProps(props) {
125
+ _classCallCheck(this, CustomProps);
126
+ var _this;
127
+ _this = _super.call(this, props);
128
+ if (isPlainObject(props)) {
129
+ Object.entries(props).forEach(function(param) {
130
+ var _param = _slicedToArray(param, 2), key = _param[0], value = _param[1];
131
+ _this[key] = value;
132
+ });
133
+ }
134
+ return _this;
135
+ }
136
+ return CustomProps;
137
+ }(BaseProps);