@byteluck-fe/model-driven-settings 2.5.0-beta.9 → 2.5.3
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/default/createBaseFields.js +29 -29
- package/dist/esm/default/createFormBaseFields.js +56 -56
- package/dist/esm/default/index.js +2 -2
- package/dist/esm/index.js +4 -4
- package/dist/esm/initSettings.js +55 -31
- package/dist/esm/props/base.js +27 -8
- package/dist/esm/props/checkbox.js +41 -27
- package/dist/esm/props/custom.js +36 -36
- package/dist/esm/props/input-number.js +47 -31
- package/dist/esm/props/input.js +50 -33
- package/dist/esm/props/radio.js +44 -29
- package/dist/esm/props/select.js +44 -29
- package/dist/esm/props/switch.js +47 -31
- package/dist/esm/props/textarea.js +56 -37
- package/dist/esm/schema/group.js +25 -7
- package/dist/esm/schema/index.js +3 -3
- package/dist/esm/schema/setting.js +36 -13
- package/dist/esm/schema/tab.js +19 -4
- package/dist/index.umd.js +2 -2
- package/dist/types/defineInstance.d.ts +3 -3
- package/dist/types/initSettings.d.ts +2 -2
- package/dist/types/schema/setting.d.ts +2 -2
- package/package.json +4 -4
|
@@ -1,64 +1,64 @@
|
|
|
1
1
|
export function createBaseFields() {
|
|
2
2
|
return [
|
|
3
3
|
{
|
|
4
|
-
label:
|
|
5
|
-
key:
|
|
6
|
-
type:
|
|
7
|
-
component:
|
|
4
|
+
label: "隐藏",
|
|
5
|
+
key: "isHide",
|
|
6
|
+
type: "boolean",
|
|
7
|
+
component: "switch"
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
|
-
key:
|
|
11
|
-
component:
|
|
10
|
+
key: "superSetting",
|
|
11
|
+
component: "super-setting"
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
key:
|
|
15
|
-
component:
|
|
14
|
+
key: "style.width",
|
|
15
|
+
component: "styleComponent",
|
|
16
16
|
props: {
|
|
17
|
-
configKey:
|
|
17
|
+
configKey: "style.widthConfig",
|
|
18
18
|
options: [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
"px",
|
|
20
|
+
"%",
|
|
21
|
+
"fill",
|
|
22
|
+
"hug"
|
|
23
23
|
]
|
|
24
24
|
},
|
|
25
25
|
scopeEffect: function scopeEffect(driven, payload) {
|
|
26
26
|
var oldParent = payload.oldParent, newParent = payload.newParent, instance = payload.instance;
|
|
27
|
-
if ((oldParent === null || oldParent === void 0 ? void 0 : oldParent.type) ===
|
|
28
|
-
driven.setInstance(instance,
|
|
29
|
-
driven.setInstance(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
30
|
}
|
|
31
31
|
if (newParent) {
|
|
32
32
|
return {
|
|
33
|
-
visible: newParent.type ===
|
|
33
|
+
visible: newParent.type === "advanced-container"
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
key:
|
|
40
|
-
component:
|
|
39
|
+
key: "style.height",
|
|
40
|
+
component: "styleComponent",
|
|
41
41
|
props: {
|
|
42
|
-
configKey:
|
|
42
|
+
configKey: "style.heightConfig",
|
|
43
43
|
options: [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
"px",
|
|
45
|
+
"%",
|
|
46
|
+
"fill",
|
|
47
|
+
"hug"
|
|
48
48
|
]
|
|
49
49
|
},
|
|
50
50
|
scopeEffect: function scopeEffect(driven, payload) {
|
|
51
51
|
var oldParent = payload.oldParent, newParent = payload.newParent, instance = payload.instance;
|
|
52
|
-
if ((oldParent === null || oldParent === void 0 ? void 0 : oldParent.type) ===
|
|
53
|
-
driven.setInstance(instance,
|
|
54
|
-
driven.setInstance(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
55
|
}
|
|
56
56
|
if (payload.newParent) {
|
|
57
57
|
return {
|
|
58
|
-
visible: payload.newParent.type ===
|
|
58
|
+
visible: payload.newParent.type === "advanced-container"
|
|
59
59
|
};
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
}
|
|
62
|
+
}
|
|
63
63
|
];
|
|
64
64
|
}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
3
3
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
4
|
return arr2;
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
if (Array.isArray(arr)) return
|
|
6
|
+
function _array_without_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
8
|
}
|
|
9
|
-
function
|
|
9
|
+
function _iterable_to_array(iter) {
|
|
10
10
|
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function _non_iterable_spread() {
|
|
13
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
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return
|
|
15
|
+
function _to_consumable_array(arr) {
|
|
16
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
19
19
|
if (!o) return;
|
|
20
|
-
if (typeof o === "string") return
|
|
20
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
21
21
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
22
22
|
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
23
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
|
|
24
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
25
25
|
}
|
|
26
|
-
import { createBaseFields } from
|
|
26
|
+
import { createBaseFields } from "./createBaseFields";
|
|
27
27
|
export function createFormBaseFields(defaultValues) {
|
|
28
|
-
return
|
|
28
|
+
return _to_consumable_array(createBaseFields()).concat([
|
|
29
29
|
{
|
|
30
|
-
type:
|
|
31
|
-
key:
|
|
32
|
-
component:
|
|
30
|
+
type: "DataBind",
|
|
31
|
+
key: "dataBind",
|
|
32
|
+
component: "data-bind",
|
|
33
33
|
defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.dataBind
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
|
-
key:
|
|
37
|
-
type:
|
|
38
|
-
component:
|
|
36
|
+
key: "caption",
|
|
37
|
+
type: "string",
|
|
38
|
+
component: "input",
|
|
39
39
|
props: {
|
|
40
40
|
maxLength: 80,
|
|
41
41
|
i18n: true
|
|
@@ -43,88 +43,88 @@ export function createFormBaseFields(defaultValues) {
|
|
|
43
43
|
defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.caption,
|
|
44
44
|
validator: function validator(value) {
|
|
45
45
|
if (!value) {
|
|
46
|
-
return
|
|
46
|
+
return "标题必填";
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
|
-
label:
|
|
52
|
-
key:
|
|
53
|
-
type:
|
|
54
|
-
component:
|
|
51
|
+
label: "隐藏标题",
|
|
52
|
+
key: "isHideCaption",
|
|
53
|
+
type: "boolean",
|
|
54
|
+
component: "switch",
|
|
55
55
|
defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.isHideCaption,
|
|
56
56
|
props: {
|
|
57
|
-
showType:
|
|
57
|
+
showType: "checkbox"
|
|
58
58
|
},
|
|
59
59
|
// 在明细表内隐藏
|
|
60
60
|
scopeEffect: function scopeEffect(driven, payload) {
|
|
61
|
-
var
|
|
62
|
-
if (((
|
|
61
|
+
var _payload_current, _payload_from;
|
|
62
|
+
if (((_payload_current = payload.current) === null || _payload_current === void 0 ? void 0 : _payload_current.type) !== ((_payload_from = payload.from) === null || _payload_from === void 0 ? void 0 : _payload_from.type)) {
|
|
63
63
|
//明细子表内默认开启
|
|
64
|
-
if (payload.current.type ===
|
|
65
|
-
driven.setInstance(payload.control,
|
|
64
|
+
if (payload.current.type === "subtable") {
|
|
65
|
+
driven.setInstance(payload.control, "isHideCaption", true);
|
|
66
66
|
}
|
|
67
67
|
return {
|
|
68
|
-
visible: payload.current.type !==
|
|
68
|
+
visible: payload.current.type !== "subtable"
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
|
-
key:
|
|
75
|
-
type:
|
|
76
|
-
component:
|
|
74
|
+
key: "labelPosition",
|
|
75
|
+
type: "string",
|
|
76
|
+
component: "radio",
|
|
77
77
|
defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.labelPosition,
|
|
78
78
|
props: {
|
|
79
|
-
showType:
|
|
79
|
+
showType: "solid",
|
|
80
80
|
options: [
|
|
81
81
|
{
|
|
82
|
-
label:
|
|
83
|
-
value:
|
|
82
|
+
label: "上下布局",
|
|
83
|
+
value: "top"
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
|
-
label:
|
|
87
|
-
value:
|
|
88
|
-
}
|
|
86
|
+
label: "左右布局",
|
|
87
|
+
value: "left"
|
|
88
|
+
}
|
|
89
89
|
]
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
|
-
key:
|
|
94
|
-
type:
|
|
95
|
-
component:
|
|
93
|
+
key: "defaultState",
|
|
94
|
+
type: "string",
|
|
95
|
+
component: "radio",
|
|
96
96
|
defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.defaultState,
|
|
97
97
|
props: {
|
|
98
|
-
showType:
|
|
98
|
+
showType: "solid",
|
|
99
99
|
options: [
|
|
100
100
|
{
|
|
101
|
-
label:
|
|
102
|
-
value:
|
|
101
|
+
label: "普通",
|
|
102
|
+
value: "default"
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
|
-
label:
|
|
106
|
-
value:
|
|
107
|
-
}
|
|
105
|
+
label: "只读",
|
|
106
|
+
value: "readonly"
|
|
107
|
+
}
|
|
108
108
|
]
|
|
109
109
|
}
|
|
110
110
|
},
|
|
111
111
|
{
|
|
112
|
-
label:
|
|
113
|
-
key:
|
|
114
|
-
type:
|
|
115
|
-
component:
|
|
112
|
+
label: "必填",
|
|
113
|
+
key: "required",
|
|
114
|
+
type: "boolean",
|
|
115
|
+
component: "switch",
|
|
116
116
|
defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.required
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
|
-
label:
|
|
120
|
-
key:
|
|
121
|
-
type:
|
|
122
|
-
component:
|
|
119
|
+
label: "提示文字",
|
|
120
|
+
key: "placeholder",
|
|
121
|
+
type: "string",
|
|
122
|
+
component: "input",
|
|
123
123
|
defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.placeholder,
|
|
124
124
|
props: {
|
|
125
125
|
maxLength: 80,
|
|
126
126
|
i18n: true
|
|
127
127
|
}
|
|
128
|
-
}
|
|
128
|
+
}
|
|
129
129
|
]);
|
|
130
130
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./createBaseFields";
|
|
2
|
+
export * from "./createFormBaseFields";
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from "./defineInstance";
|
|
2
|
+
export * from "./initSettings";
|
|
3
|
+
export * from "./schema";
|
|
4
|
+
export * from "./default";
|
package/dist/esm/initSettings.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
2
|
if (key in obj) {
|
|
3
3
|
Object.defineProperty(obj, key, {
|
|
4
4
|
value: value,
|
|
@@ -11,7 +11,7 @@ function _defineProperty(obj, key, value) {
|
|
|
11
11
|
}
|
|
12
12
|
return obj;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function _object_spread(target) {
|
|
15
15
|
for(var i = 1; i < arguments.length; i++){
|
|
16
16
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
17
|
var ownKeys = Object.keys(source);
|
|
@@ -21,36 +21,60 @@ function _objectSpread(target) {
|
|
|
21
21
|
}));
|
|
22
22
|
}
|
|
23
23
|
ownKeys.forEach(function(key) {
|
|
24
|
-
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
return target;
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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 _object_spread_props(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";
|
|
39
63
|
function propsFactory(component, props) {
|
|
40
64
|
switch(component){
|
|
41
|
-
case
|
|
65
|
+
case "input":
|
|
42
66
|
return new InputProps(props);
|
|
43
|
-
case
|
|
67
|
+
case "textarea":
|
|
44
68
|
return new TextareaProps(props);
|
|
45
|
-
case
|
|
69
|
+
case "input-number":
|
|
46
70
|
return new InputNumberProps(props);
|
|
47
|
-
case
|
|
71
|
+
case "switch":
|
|
48
72
|
return new SwitchProps(props);
|
|
49
|
-
case
|
|
73
|
+
case "radio":
|
|
50
74
|
return new RadioProps(props);
|
|
51
|
-
case
|
|
75
|
+
case "checkbox":
|
|
52
76
|
return new CheckboxProps(props);
|
|
53
|
-
case
|
|
77
|
+
case "select":
|
|
54
78
|
return new SelectProps(props);
|
|
55
79
|
default:
|
|
56
80
|
return new CustomProps(props);
|
|
@@ -62,27 +86,27 @@ function buildSettingItem(settingMap) {
|
|
|
62
86
|
if (!schema) {
|
|
63
87
|
return;
|
|
64
88
|
}
|
|
65
|
-
return new Setting(
|
|
66
|
-
props: propsFactory(schema.component,
|
|
89
|
+
return new Setting(_object_spread_props(_object_spread({}, schema), {
|
|
90
|
+
props: propsFactory(schema.component, "props" in schema ? schema.props : undefined)
|
|
67
91
|
}));
|
|
68
92
|
};
|
|
69
93
|
}
|
|
70
94
|
export function initSettings(params) {
|
|
71
|
-
var generatorGroup = function generatorGroup(group) {
|
|
72
|
-
return new Group(_objectSpread({}, group, {
|
|
73
|
-
items: group.items.map(buildSettingItem(settingMap)).filter(Boolean)
|
|
74
|
-
}));
|
|
75
|
-
};
|
|
76
|
-
var generatorGroups = function generatorGroups(groups) {
|
|
77
|
-
return groups.map(generatorGroup);
|
|
78
|
-
};
|
|
79
95
|
var settingMap = params.fields.reduce(function(map, current) {
|
|
80
96
|
map.set(current.key, current);
|
|
81
97
|
return map;
|
|
82
98
|
}, new Map());
|
|
99
|
+
function generatorGroup(group) {
|
|
100
|
+
return new Group(_object_spread_props(_object_spread({}, group), {
|
|
101
|
+
items: group.items.map(buildSettingItem(settingMap)).filter(Boolean)
|
|
102
|
+
}));
|
|
103
|
+
}
|
|
104
|
+
function generatorGroups(groups) {
|
|
105
|
+
return groups.map(generatorGroup);
|
|
106
|
+
}
|
|
83
107
|
return params.groups.map(function(item) {
|
|
84
108
|
if (isTabSchema(item)) {
|
|
85
|
-
return new Tab(
|
|
109
|
+
return new Tab(_object_spread_props(_object_spread({}, item), {
|
|
86
110
|
items: generatorGroups(item.items)
|
|
87
111
|
}));
|
|
88
112
|
} else {
|
package/dist/esm/props/base.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _class_call_check(instance, Constructor) {
|
|
2
2
|
if (!(instance instanceof Constructor)) {
|
|
3
3
|
throw new TypeError("Cannot call a class as a function");
|
|
4
4
|
}
|
|
@@ -12,21 +12,40 @@ function _defineProperties(target, props) {
|
|
|
12
12
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
16
16
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
17
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
18
|
return Constructor;
|
|
19
19
|
}
|
|
20
|
+
function _define_property(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
|
export var BaseProps = /*#__PURE__*/ function() {
|
|
21
34
|
"use strict";
|
|
22
35
|
function BaseProps(props) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
36
|
+
_class_call_check(this, BaseProps);
|
|
37
|
+
/**
|
|
38
|
+
* 显示隐藏
|
|
39
|
+
* */ _define_property(this, "visible", void 0);
|
|
40
|
+
/**
|
|
41
|
+
* 开启表达式
|
|
42
|
+
* */ _define_property(this, "expression", void 0);
|
|
43
|
+
var _props_visible;
|
|
44
|
+
this.visible = (_props_visible = props === null || props === void 0 ? void 0 : props.visible) !== null && _props_visible !== void 0 ? _props_visible : true;
|
|
45
|
+
var _props_expression;
|
|
46
|
+
this.expression = (_props_expression = props === null || props === void 0 ? void 0 : props.expression) !== null && _props_expression !== void 0 ? _props_expression : false;
|
|
28
47
|
}
|
|
29
|
-
|
|
48
|
+
_create_class(BaseProps, [
|
|
30
49
|
{
|
|
31
50
|
key: "isAtomicComponent",
|
|
32
51
|
get: function get() {
|
|
@@ -1,19 +1,32 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _assert_this_initialized(self) {
|
|
2
2
|
if (self === void 0) {
|
|
3
3
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
4
|
}
|
|
5
5
|
return self;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function _class_call_check(instance, Constructor) {
|
|
8
8
|
if (!(instance instanceof Constructor)) {
|
|
9
9
|
throw new TypeError("Cannot call a class as a function");
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
12
|
+
function _define_property(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
|
+
}
|
|
25
|
+
function _get_prototype_of(o) {
|
|
26
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
14
27
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
15
28
|
};
|
|
16
|
-
return
|
|
29
|
+
return _get_prototype_of(o);
|
|
17
30
|
}
|
|
18
31
|
function _inherits(subClass, superClass) {
|
|
19
32
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
@@ -26,26 +39,26 @@ function _inherits(subClass, superClass) {
|
|
|
26
39
|
configurable: true
|
|
27
40
|
}
|
|
28
41
|
});
|
|
29
|
-
if (superClass)
|
|
42
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
30
43
|
}
|
|
31
|
-
function
|
|
32
|
-
if (call && (
|
|
44
|
+
function _possible_constructor_return(self, call) {
|
|
45
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
33
46
|
return call;
|
|
34
47
|
}
|
|
35
|
-
return
|
|
48
|
+
return _assert_this_initialized(self);
|
|
36
49
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
50
|
+
function _set_prototype_of(o, p) {
|
|
51
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
39
52
|
o.__proto__ = p;
|
|
40
53
|
return o;
|
|
41
54
|
};
|
|
42
|
-
return
|
|
55
|
+
return _set_prototype_of(o, p);
|
|
43
56
|
}
|
|
44
|
-
|
|
57
|
+
function _type_of(obj) {
|
|
45
58
|
"@swc/helpers - typeof";
|
|
46
59
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
47
|
-
}
|
|
48
|
-
function
|
|
60
|
+
}
|
|
61
|
+
function _is_native_reflect_construct() {
|
|
49
62
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
50
63
|
if (Reflect.construct.sham) return false;
|
|
51
64
|
if (typeof Proxy === "function") return true;
|
|
@@ -56,30 +69,31 @@ function _isNativeReflectConstruct() {
|
|
|
56
69
|
return false;
|
|
57
70
|
}
|
|
58
71
|
}
|
|
59
|
-
function
|
|
60
|
-
var hasNativeReflectConstruct =
|
|
72
|
+
function _create_super(Derived) {
|
|
73
|
+
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
61
74
|
return function _createSuperInternal() {
|
|
62
|
-
var Super =
|
|
75
|
+
var Super = _get_prototype_of(Derived), result;
|
|
63
76
|
if (hasNativeReflectConstruct) {
|
|
64
|
-
var NewTarget =
|
|
77
|
+
var NewTarget = _get_prototype_of(this).constructor;
|
|
65
78
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
66
79
|
} else {
|
|
67
80
|
result = Super.apply(this, arguments);
|
|
68
81
|
}
|
|
69
|
-
return
|
|
82
|
+
return _possible_constructor_return(this, result);
|
|
70
83
|
};
|
|
71
84
|
}
|
|
72
|
-
import { BaseProps } from
|
|
73
|
-
export var CheckboxProps = /*#__PURE__*/ function(
|
|
85
|
+
import { BaseProps } from "./base";
|
|
86
|
+
export var CheckboxProps = /*#__PURE__*/ function(BaseProps) {
|
|
74
87
|
"use strict";
|
|
75
|
-
_inherits(CheckboxProps,
|
|
76
|
-
var _super =
|
|
88
|
+
_inherits(CheckboxProps, BaseProps);
|
|
89
|
+
var _super = _create_super(CheckboxProps);
|
|
77
90
|
function CheckboxProps(props) {
|
|
78
|
-
|
|
91
|
+
_class_call_check(this, CheckboxProps);
|
|
79
92
|
var _this;
|
|
80
93
|
_this = _super.call(this, props);
|
|
81
|
-
|
|
82
|
-
|
|
94
|
+
_define_property(_assert_this_initialized(_this), "options", void 0);
|
|
95
|
+
var _props_options;
|
|
96
|
+
_this.options = (_props_options = props === null || props === void 0 ? void 0 : props.options) !== null && _props_options !== void 0 ? _props_options : [];
|
|
83
97
|
return _this;
|
|
84
98
|
}
|
|
85
99
|
return CheckboxProps;
|