@byteluck-fe/model-driven-settings 3.0.0-beta.6 → 3.0.0-beta.9
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 +65 -0
- package/dist/esm/default/createFormBaseFields.js +131 -0
- package/dist/esm/default/index.js +2 -0
- package/dist/esm/defineInstance.js +3 -0
- package/dist/esm/index.js +4 -0
- package/dist/esm/initSettings.js +116 -0
- package/dist/esm/props/base.js +63 -0
- package/dist/esm/props/checkbox.js +88 -0
- package/dist/esm/props/custom.js +126 -0
- package/dist/esm/props/input-number.js +92 -0
- package/dist/esm/props/input.js +94 -0
- package/dist/esm/props/radio.js +90 -0
- package/dist/esm/props/select.js +90 -0
- package/dist/esm/props/switch.js +92 -0
- package/dist/esm/props/textarea.js +98 -0
- package/dist/esm/schema/group.js +39 -0
- package/dist/esm/schema/index.js +3 -0
- package/dist/esm/schema/setting.js +119 -0
- package/dist/esm/schema/tab.js +30 -0
- package/dist/index.umd.js +2 -0
- package/dist/types/default/createBaseFields.d.ts +2 -0
- package/dist/types/default/createFormBaseFields.d.ts +3 -0
- package/dist/types/default/index.d.ts +2 -0
- package/dist/types/defineInstance.d.ts +83 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/initSettings.d.ts +14 -0
- package/dist/types/props/base.d.ts +21 -0
- package/dist/types/props/checkbox.d.ts +5 -0
- package/dist/types/props/custom.d.ts +5 -0
- package/dist/types/props/input-number.d.ts +7 -0
- package/dist/types/props/input.d.ts +8 -0
- package/dist/types/props/radio.d.ts +6 -0
- package/dist/types/props/select.d.ts +6 -0
- package/dist/types/props/switch.d.ts +7 -0
- package/dist/types/props/textarea.d.ts +10 -0
- package/dist/types/schema/group.d.ts +19 -0
- package/dist/types/schema/index.d.ts +3 -0
- package/dist/types/schema/setting.d.ts +69 -0
- package/dist/types/schema/tab.d.ts +15 -0
- package/package.json +4 -4
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
2
|
+
export function createBaseFields() {
|
|
3
|
+
return [
|
|
4
|
+
{
|
|
5
|
+
label: getLocaleText('CMD.hide', null, '隐藏'),
|
|
6
|
+
key: 'isHide',
|
|
7
|
+
type: 'boolean',
|
|
8
|
+
component: 'switch'
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
key: 'superSetting',
|
|
12
|
+
component: 'super-setting'
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
key: 'style.width',
|
|
16
|
+
component: 'styleComponent',
|
|
17
|
+
props: {
|
|
18
|
+
configKey: 'style.widthConfig',
|
|
19
|
+
options: [
|
|
20
|
+
'px',
|
|
21
|
+
'%',
|
|
22
|
+
'fill',
|
|
23
|
+
'hug'
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
scopeEffect: function scopeEffect(driven, payload) {
|
|
27
|
+
var oldParent = payload.oldParent, newParent = payload.newParent, instance = payload.instance;
|
|
28
|
+
if ((oldParent === null || oldParent === void 0 ? void 0 : oldParent.type) === 'advanced-container' && newParent.type === 'positioning-container') {
|
|
29
|
+
driven.setInstance(instance, 'style.width', '');
|
|
30
|
+
driven.setInstance(instance, 'style.widthConfig', 'fill');
|
|
31
|
+
}
|
|
32
|
+
if (newParent) {
|
|
33
|
+
return {
|
|
34
|
+
visible: newParent.type === 'advanced-container'
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: 'style.height',
|
|
41
|
+
component: 'styleComponent',
|
|
42
|
+
props: {
|
|
43
|
+
configKey: 'style.heightConfig',
|
|
44
|
+
options: [
|
|
45
|
+
'px',
|
|
46
|
+
'%',
|
|
47
|
+
'fill',
|
|
48
|
+
'hug'
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
scopeEffect: function scopeEffect(driven, payload) {
|
|
52
|
+
var oldParent = payload.oldParent, newParent = payload.newParent, instance = payload.instance;
|
|
53
|
+
if ((oldParent === null || oldParent === void 0 ? void 0 : oldParent.type) === 'advanced-container' && newParent.type === 'positioning-container') {
|
|
54
|
+
driven.setInstance(instance, 'style.height', '');
|
|
55
|
+
driven.setInstance(instance, 'style.heightConfig', 'fill');
|
|
56
|
+
}
|
|
57
|
+
if (payload.newParent) {
|
|
58
|
+
return {
|
|
59
|
+
visible: payload.newParent.type === 'advanced-container'
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
function _array_like_to_array(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 _array_without_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return _array_like_to_array(arr);
|
|
8
|
+
}
|
|
9
|
+
function _iterable_to_array(iter) {
|
|
10
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
11
|
+
}
|
|
12
|
+
function _non_iterable_spread() {
|
|
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 _to_consumable_array(arr) {
|
|
16
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
|
|
17
|
+
}
|
|
18
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
19
|
+
if (!o) return;
|
|
20
|
+
if (typeof o === "string") return _array_like_to_array(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 _array_like_to_array(o, minLen);
|
|
25
|
+
}
|
|
26
|
+
import { createBaseFields } from './createBaseFields';
|
|
27
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
28
|
+
export function createFormBaseFields(defaultValues) {
|
|
29
|
+
return _to_consumable_array(createBaseFields()).concat([
|
|
30
|
+
{
|
|
31
|
+
type: 'DataBind',
|
|
32
|
+
key: 'dataBind',
|
|
33
|
+
component: 'data-bind',
|
|
34
|
+
defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.dataBind
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: 'caption',
|
|
38
|
+
type: 'string',
|
|
39
|
+
component: 'input',
|
|
40
|
+
props: {
|
|
41
|
+
maxLength: 80,
|
|
42
|
+
i18n: true
|
|
43
|
+
},
|
|
44
|
+
defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.caption,
|
|
45
|
+
validator: function validator(value) {
|
|
46
|
+
if (!value) {
|
|
47
|
+
return getLocaleText('CMD.titleRequired', null, '标题必填');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
label: getLocaleText('CMD.hideCaption', null, '隐藏标题'),
|
|
53
|
+
key: 'isHideCaption',
|
|
54
|
+
type: 'boolean',
|
|
55
|
+
component: 'switch',
|
|
56
|
+
defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.isHideCaption,
|
|
57
|
+
props: {
|
|
58
|
+
showType: 'checkbox'
|
|
59
|
+
},
|
|
60
|
+
// 在明细表内隐藏
|
|
61
|
+
scopeEffect: function scopeEffect(driven, payload) {
|
|
62
|
+
var _payload_current, _payload_from;
|
|
63
|
+
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)) {
|
|
64
|
+
//明细子表内默认开启
|
|
65
|
+
if (payload.current.type === 'subtable') {
|
|
66
|
+
driven.setInstance(payload.control, 'isHideCaption', true);
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
visible: payload.current.type !== 'subtable'
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
key: 'labelPosition',
|
|
76
|
+
type: 'string',
|
|
77
|
+
component: 'radio',
|
|
78
|
+
defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.labelPosition,
|
|
79
|
+
props: {
|
|
80
|
+
showType: 'solid',
|
|
81
|
+
options: [
|
|
82
|
+
{
|
|
83
|
+
label: getLocaleText('CMD.top', null, '上下布局'),
|
|
84
|
+
value: 'top'
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
label: getLocaleText('CMD.left', null, '左右布局'),
|
|
88
|
+
value: 'left'
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
key: 'defaultState',
|
|
95
|
+
type: 'string',
|
|
96
|
+
component: 'radio',
|
|
97
|
+
defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.defaultState,
|
|
98
|
+
props: {
|
|
99
|
+
showType: 'solid',
|
|
100
|
+
options: [
|
|
101
|
+
{
|
|
102
|
+
label: getLocaleText('CMD.default', null, '普通'),
|
|
103
|
+
value: 'default'
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
label: getLocaleText('CMD.readonly', null, '只读'),
|
|
107
|
+
value: 'readonly'
|
|
108
|
+
}
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
label: getLocaleText('CMD.required', null, '必填'),
|
|
114
|
+
key: 'required',
|
|
115
|
+
type: 'boolean',
|
|
116
|
+
component: 'switch',
|
|
117
|
+
defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.required
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
label: getLocaleText('CMD.textTip', null, '提示文字'),
|
|
121
|
+
key: 'placeholder',
|
|
122
|
+
type: 'string',
|
|
123
|
+
component: 'input',
|
|
124
|
+
defaultValue: defaultValues === null || defaultValues === void 0 ? void 0 : defaultValues.placeholder,
|
|
125
|
+
props: {
|
|
126
|
+
maxLength: 80,
|
|
127
|
+
i18n: true
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
]);
|
|
131
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
function _define_property(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 _object_spread(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
|
+
_define_property(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 _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';
|
|
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(_object_spread_props(_object_spread({}, schema), {
|
|
90
|
+
props: propsFactory(schema.component, 'props' in schema ? schema.props : undefined)
|
|
91
|
+
}));
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export function initSettings(params) {
|
|
95
|
+
var settingMap = params.fields.reduce(function(map, current) {
|
|
96
|
+
map.set(current.key, current);
|
|
97
|
+
return map;
|
|
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
|
+
}
|
|
107
|
+
return params.groups.map(function(item) {
|
|
108
|
+
if (isTabSchema(item)) {
|
|
109
|
+
return new Tab(_object_spread_props(_object_spread({}, item), {
|
|
110
|
+
items: generatorGroups(item.items)
|
|
111
|
+
}));
|
|
112
|
+
} else {
|
|
113
|
+
return generatorGroup(item);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
function _class_call_check(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 _create_class(Constructor, protoProps, staticProps) {
|
|
16
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
17
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
18
|
+
return Constructor;
|
|
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
|
+
}
|
|
33
|
+
export var BaseProps = /*#__PURE__*/ function() {
|
|
34
|
+
"use strict";
|
|
35
|
+
function BaseProps(props) {
|
|
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
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* 是否改变父属性
|
|
46
|
+
*/ _define_property(this, "updateParent", void 0);
|
|
47
|
+
var _props_visible;
|
|
48
|
+
this.visible = (_props_visible = props === null || props === void 0 ? void 0 : props.visible) !== null && _props_visible !== void 0 ? _props_visible : true;
|
|
49
|
+
var _props_expression;
|
|
50
|
+
this.expression = (_props_expression = props === null || props === void 0 ? void 0 : props.expression) !== null && _props_expression !== void 0 ? _props_expression : false;
|
|
51
|
+
var _props_updateParent;
|
|
52
|
+
this.updateParent = (_props_updateParent = props === null || props === void 0 ? void 0 : props.updateParent) !== null && _props_updateParent !== void 0 ? _props_updateParent : false;
|
|
53
|
+
}
|
|
54
|
+
_create_class(BaseProps, [
|
|
55
|
+
{
|
|
56
|
+
key: "isAtomicComponent",
|
|
57
|
+
get: function get() {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
]);
|
|
62
|
+
return BaseProps;
|
|
63
|
+
}();
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
function _assert_this_initialized(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 _call_super(_this, derived, args) {
|
|
8
|
+
derived = _get_prototype_of(derived);
|
|
9
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
|
+
}
|
|
11
|
+
function _class_call_check(instance, Constructor) {
|
|
12
|
+
if (!(instance instanceof Constructor)) {
|
|
13
|
+
throw new TypeError("Cannot call a class as a function");
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function _define_property(obj, key, value) {
|
|
17
|
+
if (key in obj) {
|
|
18
|
+
Object.defineProperty(obj, key, {
|
|
19
|
+
value: value,
|
|
20
|
+
enumerable: true,
|
|
21
|
+
configurable: true,
|
|
22
|
+
writable: true
|
|
23
|
+
});
|
|
24
|
+
} else {
|
|
25
|
+
obj[key] = value;
|
|
26
|
+
}
|
|
27
|
+
return obj;
|
|
28
|
+
}
|
|
29
|
+
function _get_prototype_of(o) {
|
|
30
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
31
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
32
|
+
};
|
|
33
|
+
return _get_prototype_of(o);
|
|
34
|
+
}
|
|
35
|
+
function _inherits(subClass, superClass) {
|
|
36
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
37
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
38
|
+
}
|
|
39
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
40
|
+
constructor: {
|
|
41
|
+
value: subClass,
|
|
42
|
+
writable: true,
|
|
43
|
+
configurable: true
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
47
|
+
}
|
|
48
|
+
function _possible_constructor_return(self, call) {
|
|
49
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
50
|
+
return call;
|
|
51
|
+
}
|
|
52
|
+
return _assert_this_initialized(self);
|
|
53
|
+
}
|
|
54
|
+
function _set_prototype_of(o, p) {
|
|
55
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
56
|
+
o.__proto__ = p;
|
|
57
|
+
return o;
|
|
58
|
+
};
|
|
59
|
+
return _set_prototype_of(o, p);
|
|
60
|
+
}
|
|
61
|
+
function _type_of(obj) {
|
|
62
|
+
"@swc/helpers - typeof";
|
|
63
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
64
|
+
}
|
|
65
|
+
function _is_native_reflect_construct() {
|
|
66
|
+
try {
|
|
67
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
68
|
+
} catch (_) {}
|
|
69
|
+
return (_is_native_reflect_construct = function() {
|
|
70
|
+
return !!result;
|
|
71
|
+
})();
|
|
72
|
+
}
|
|
73
|
+
import { BaseProps } from './base';
|
|
74
|
+
export var CheckboxProps = /*#__PURE__*/ function(BaseProps) {
|
|
75
|
+
"use strict";
|
|
76
|
+
_inherits(CheckboxProps, BaseProps);
|
|
77
|
+
function CheckboxProps(props) {
|
|
78
|
+
_class_call_check(this, CheckboxProps);
|
|
79
|
+
var _this;
|
|
80
|
+
_this = _call_super(this, CheckboxProps, [
|
|
81
|
+
props
|
|
82
|
+
]), _define_property(_this, "options", void 0);
|
|
83
|
+
var _props_options;
|
|
84
|
+
_this.options = (_props_options = props === null || props === void 0 ? void 0 : props.options) !== null && _props_options !== void 0 ? _props_options : [];
|
|
85
|
+
return _this;
|
|
86
|
+
}
|
|
87
|
+
return CheckboxProps;
|
|
88
|
+
}(BaseProps);
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
function _array_like_to_array(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 _array_with_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return arr;
|
|
8
|
+
}
|
|
9
|
+
function _assert_this_initialized(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 _call_super(_this, derived, args) {
|
|
16
|
+
derived = _get_prototype_of(derived);
|
|
17
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
18
|
+
}
|
|
19
|
+
function _class_call_check(instance, Constructor) {
|
|
20
|
+
if (!(instance instanceof Constructor)) {
|
|
21
|
+
throw new TypeError("Cannot call a class as a function");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function _get_prototype_of(o) {
|
|
25
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
26
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
27
|
+
};
|
|
28
|
+
return _get_prototype_of(o);
|
|
29
|
+
}
|
|
30
|
+
function _inherits(subClass, superClass) {
|
|
31
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
32
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
33
|
+
}
|
|
34
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
35
|
+
constructor: {
|
|
36
|
+
value: subClass,
|
|
37
|
+
writable: true,
|
|
38
|
+
configurable: true
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
42
|
+
}
|
|
43
|
+
function _iterable_to_array_limit(arr, i) {
|
|
44
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
45
|
+
if (_i == null) return;
|
|
46
|
+
var _arr = [];
|
|
47
|
+
var _n = true;
|
|
48
|
+
var _d = false;
|
|
49
|
+
var _s, _e;
|
|
50
|
+
try {
|
|
51
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
52
|
+
_arr.push(_s.value);
|
|
53
|
+
if (i && _arr.length === i) break;
|
|
54
|
+
}
|
|
55
|
+
} catch (err) {
|
|
56
|
+
_d = true;
|
|
57
|
+
_e = err;
|
|
58
|
+
} finally{
|
|
59
|
+
try {
|
|
60
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
61
|
+
} finally{
|
|
62
|
+
if (_d) throw _e;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return _arr;
|
|
66
|
+
}
|
|
67
|
+
function _non_iterable_rest() {
|
|
68
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
69
|
+
}
|
|
70
|
+
function _possible_constructor_return(self, call) {
|
|
71
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
72
|
+
return call;
|
|
73
|
+
}
|
|
74
|
+
return _assert_this_initialized(self);
|
|
75
|
+
}
|
|
76
|
+
function _set_prototype_of(o, p) {
|
|
77
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
78
|
+
o.__proto__ = p;
|
|
79
|
+
return o;
|
|
80
|
+
};
|
|
81
|
+
return _set_prototype_of(o, p);
|
|
82
|
+
}
|
|
83
|
+
function _sliced_to_array(arr, i) {
|
|
84
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
85
|
+
}
|
|
86
|
+
function _type_of(obj) {
|
|
87
|
+
"@swc/helpers - typeof";
|
|
88
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
89
|
+
}
|
|
90
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
91
|
+
if (!o) return;
|
|
92
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
93
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
94
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
95
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
96
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
97
|
+
}
|
|
98
|
+
function _is_native_reflect_construct() {
|
|
99
|
+
try {
|
|
100
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
101
|
+
} catch (_) {}
|
|
102
|
+
return (_is_native_reflect_construct = function() {
|
|
103
|
+
return !!result;
|
|
104
|
+
})();
|
|
105
|
+
}
|
|
106
|
+
import { isPlainObject } from '@byteluck-fe/model-driven-shared';
|
|
107
|
+
import { BaseProps } from './base';
|
|
108
|
+
export var CustomProps = /*#__PURE__*/ function(BaseProps) {
|
|
109
|
+
"use strict";
|
|
110
|
+
_inherits(CustomProps, BaseProps);
|
|
111
|
+
function CustomProps(props) {
|
|
112
|
+
_class_call_check(this, CustomProps);
|
|
113
|
+
var _this;
|
|
114
|
+
_this = _call_super(this, CustomProps, [
|
|
115
|
+
props
|
|
116
|
+
]);
|
|
117
|
+
if (isPlainObject(props)) {
|
|
118
|
+
Object.entries(props).forEach(function(param) {
|
|
119
|
+
var _param = _sliced_to_array(param, 2), key = _param[0], value = _param[1];
|
|
120
|
+
_this[key] = value;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return _this;
|
|
124
|
+
}
|
|
125
|
+
return CustomProps;
|
|
126
|
+
}(BaseProps);
|