@byteluck-fe/model-driven-controls 7.0.0-props.40 → 7.0.0-props.41
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/api-doc-index.js +1 -0
- package/dist/esm/formControls/Switch/designer.js +218 -0
- package/dist/esm/formControls/Switch/index.js +11 -0
- package/dist/esm/formControls/Switch/property.js +131 -0
- package/dist/esm/formControls/Switch/runtime.js +114 -0
- package/dist/esm/formControls/Switch/schema.json +205 -0
- package/dist/esm/formControls/index.js +1 -0
- package/dist/index.umd.js +1 -1
- package/dist/types/api-doc-index.d.ts +1 -0
- package/dist/types/formControls/Switch/designer.d.ts +15 -0
- package/dist/types/formControls/Switch/index.d.ts +12 -0
- package/dist/types/formControls/Switch/property.d.ts +72 -0
- package/dist/types/formControls/Switch/runtime.d.ts +12 -0
- package/dist/types/formControls/index.d.ts +2 -0
- package/dist/types/type.d.ts +2 -1
- package/package.json +5 -5
|
@@ -20,6 +20,7 @@ export { default as BatchPrintListButton } from './baseControls/BatchPrintListBu
|
|
|
20
20
|
export { default as BatchPrintRecordListButton } from './baseControls/BatchPrintRecordListButton/property';
|
|
21
21
|
export { default as OperationButton } from './baseControls/OperationButton/property';
|
|
22
22
|
export { default as BatchDeleteButton } from './baseControls/BatchDeleteButton/property';
|
|
23
|
+
export { default as Switch } from './formControls/Switch/property';
|
|
23
24
|
export { default as Tag } from './formControls/Tag/property';
|
|
24
25
|
export { default as VarcharColumn } from './columnControls/VarcharColumn/property';
|
|
25
26
|
export { default as TextColumn } from './columnControls/TextColumn/property';
|
|
@@ -0,0 +1,218 @@
|
|
|
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 _defineProperties(target, props) {
|
|
17
|
+
for(var i = 0; i < props.length; i++){
|
|
18
|
+
var descriptor = props[i];
|
|
19
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
20
|
+
descriptor.configurable = true;
|
|
21
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
22
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
26
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
27
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
28
|
+
return Constructor;
|
|
29
|
+
}
|
|
30
|
+
function _define_property(obj, key, value) {
|
|
31
|
+
if (key in obj) {
|
|
32
|
+
Object.defineProperty(obj, key, {
|
|
33
|
+
value: value,
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
writable: true
|
|
37
|
+
});
|
|
38
|
+
} else {
|
|
39
|
+
obj[key] = value;
|
|
40
|
+
}
|
|
41
|
+
return obj;
|
|
42
|
+
}
|
|
43
|
+
function _get_prototype_of(o) {
|
|
44
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
45
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
46
|
+
};
|
|
47
|
+
return _get_prototype_of(o);
|
|
48
|
+
}
|
|
49
|
+
function _inherits(subClass, superClass) {
|
|
50
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
51
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
52
|
+
}
|
|
53
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
54
|
+
constructor: {
|
|
55
|
+
value: subClass,
|
|
56
|
+
writable: true,
|
|
57
|
+
configurable: true
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
61
|
+
}
|
|
62
|
+
function _possible_constructor_return(self, call) {
|
|
63
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
64
|
+
return call;
|
|
65
|
+
}
|
|
66
|
+
return _assert_this_initialized(self);
|
|
67
|
+
}
|
|
68
|
+
function _set_prototype_of(o, p) {
|
|
69
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
70
|
+
o.__proto__ = p;
|
|
71
|
+
return o;
|
|
72
|
+
};
|
|
73
|
+
return _set_prototype_of(o, p);
|
|
74
|
+
}
|
|
75
|
+
function _type_of(obj) {
|
|
76
|
+
"@swc/helpers - typeof";
|
|
77
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
78
|
+
}
|
|
79
|
+
function _is_native_reflect_construct() {
|
|
80
|
+
try {
|
|
81
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
82
|
+
} catch (_) {}
|
|
83
|
+
return (_is_native_reflect_construct = function() {
|
|
84
|
+
return !!result;
|
|
85
|
+
})();
|
|
86
|
+
}
|
|
87
|
+
import { DesignerFormControl, COMMON_SETTING_TYPE } from '@byteluck-fe/model-driven-core';
|
|
88
|
+
import { FieldTypes } from '@byteluck-fe/model-driven-shared';
|
|
89
|
+
import SwitchProperty from './property';
|
|
90
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
91
|
+
var SwitchControl = /*#__PURE__*/ function(DesignerFormControl) {
|
|
92
|
+
"use strict";
|
|
93
|
+
_inherits(SwitchControl, DesignerFormControl);
|
|
94
|
+
function SwitchControl(props) {
|
|
95
|
+
_class_call_check(this, SwitchControl);
|
|
96
|
+
var _this;
|
|
97
|
+
_this = _call_super(this, SwitchControl, [
|
|
98
|
+
props
|
|
99
|
+
]), _define_property(_this, "props", void 0);
|
|
100
|
+
_this.props = new SwitchProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
101
|
+
return _this;
|
|
102
|
+
}
|
|
103
|
+
_create_class(SwitchControl, null, [
|
|
104
|
+
{
|
|
105
|
+
key: "controlName",
|
|
106
|
+
get: function get() {
|
|
107
|
+
return getLocaleText('CMD.switch', null, '开关');
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
key: "controlIcon",
|
|
112
|
+
get: function get() {
|
|
113
|
+
return 'iconkaiguan';
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
key: "controlType",
|
|
118
|
+
get: function get() {
|
|
119
|
+
return 'switch';
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
]);
|
|
123
|
+
return SwitchControl;
|
|
124
|
+
}(DesignerFormControl);
|
|
125
|
+
_define_property(SwitchControl, "controlEventKeys", [
|
|
126
|
+
'on_change',
|
|
127
|
+
'on_click'
|
|
128
|
+
]);
|
|
129
|
+
_define_property(SwitchControl, "controlFieldType", FieldTypes.ANY);
|
|
130
|
+
_define_property(SwitchControl, "setting", [
|
|
131
|
+
{
|
|
132
|
+
key: 'data-bind',
|
|
133
|
+
visible: true
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
key: 'caption',
|
|
137
|
+
showItems: [
|
|
138
|
+
COMMON_SETTING_TYPE.CAPTION,
|
|
139
|
+
COMMON_SETTING_TYPE.IS_HIDE_CAPTION
|
|
140
|
+
],
|
|
141
|
+
visible: true
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
key: 'label-position',
|
|
145
|
+
visible: true
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
key: 'common-setting',
|
|
149
|
+
visible: true,
|
|
150
|
+
showItems: [
|
|
151
|
+
COMMON_SETTING_TYPE.REQUIRED,
|
|
152
|
+
COMMON_SETTING_TYPE.IS_HIDE,
|
|
153
|
+
COMMON_SETTING_TYPE.IS_HIDE_CAPTION,
|
|
154
|
+
COMMON_SETTING_TYPE.IS_SHOW_CAPTION_TIP
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
key: 'common-button-radio',
|
|
159
|
+
visible: true,
|
|
160
|
+
name: 'defaultValue',
|
|
161
|
+
label: getLocaleText('CMD.defaultStatus', null, '默认状态'),
|
|
162
|
+
default: false,
|
|
163
|
+
options: [
|
|
164
|
+
{
|
|
165
|
+
value: true,
|
|
166
|
+
label: getLocaleText('CMD.on', null, '开启')
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
value: false,
|
|
170
|
+
label: getLocaleText('CMD.off', null, '关闭')
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
key: 'common-button-radio',
|
|
176
|
+
visible: true,
|
|
177
|
+
name: 'textDisplayStyle',
|
|
178
|
+
label: getLocaleText('CMD.switchTextDisplayStyle', null, '文字展示样式'),
|
|
179
|
+
default: 'inside',
|
|
180
|
+
options: [
|
|
181
|
+
{
|
|
182
|
+
value: 'inside',
|
|
183
|
+
label: getLocaleText('CMD.insideSwitch', null, '开关内')
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
value: 'outside',
|
|
187
|
+
label: getLocaleText('CMD.outsideSwitch', null, '开关外')
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
key: 'common-group',
|
|
193
|
+
visible: true,
|
|
194
|
+
label: getLocaleText('CMD.propsSetting', null, '属性设置'),
|
|
195
|
+
children: [
|
|
196
|
+
{
|
|
197
|
+
key: 'common-input',
|
|
198
|
+
visible: true,
|
|
199
|
+
name: 'checkedText',
|
|
200
|
+
layout: 'horizontal',
|
|
201
|
+
label: getLocaleText('CMD.checkedText', null, '开启文字')
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
key: 'color',
|
|
205
|
+
visible: true,
|
|
206
|
+
name: 'checkedTextColor',
|
|
207
|
+
layout: 'horizontal',
|
|
208
|
+
label: getLocaleText('CMD.checkedTextColor', null, '开启文字颜色')
|
|
209
|
+
}
|
|
210
|
+
]
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
key: 'super-setting',
|
|
214
|
+
visible: true
|
|
215
|
+
}
|
|
216
|
+
]);
|
|
217
|
+
export default SwitchControl;
|
|
218
|
+
export { SwitchControl as DesignerSwitchControl };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Designer from './designer';
|
|
2
|
+
import Runtime from './runtime';
|
|
3
|
+
import Property from './property';
|
|
4
|
+
export default {
|
|
5
|
+
Designer: Designer,
|
|
6
|
+
Runtime: Runtime,
|
|
7
|
+
Property: Property
|
|
8
|
+
};
|
|
9
|
+
export * from './designer';
|
|
10
|
+
export * from './runtime';
|
|
11
|
+
export * from './property';
|
|
@@ -0,0 +1,131 @@
|
|
|
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
|
+
/**
|
|
74
|
+
* name: rok_switch
|
|
75
|
+
* description: 开关组件,用于快速切换布尔状态。支持开关内外文字展示、默认状态、开启/关闭文案与颜色、国际化配置,适合状态控制与流程开关场景。
|
|
76
|
+
*/ import SwitchControl from './designer';
|
|
77
|
+
import { BaseControlProperty, BaseControlPropertyRules, BaseControlPropertyRuntimeRules } from '@byteluck-fe/model-driven-core';
|
|
78
|
+
var SwitchPropertyRules = /*#__PURE__*/ function(BaseControlPropertyRules) {
|
|
79
|
+
"use strict";
|
|
80
|
+
_inherits(SwitchPropertyRules, BaseControlPropertyRules);
|
|
81
|
+
function SwitchPropertyRules(props) {
|
|
82
|
+
_class_call_check(this, SwitchPropertyRules);
|
|
83
|
+
return _call_super(this, SwitchPropertyRules, [
|
|
84
|
+
props
|
|
85
|
+
]);
|
|
86
|
+
}
|
|
87
|
+
return SwitchPropertyRules;
|
|
88
|
+
}(BaseControlPropertyRules);
|
|
89
|
+
var SwitchPropertyRuntimeRules = /*#__PURE__*/ function(BaseControlPropertyRuntimeRules) {
|
|
90
|
+
"use strict";
|
|
91
|
+
_inherits(SwitchPropertyRuntimeRules, BaseControlPropertyRuntimeRules);
|
|
92
|
+
function SwitchPropertyRuntimeRules(props) {
|
|
93
|
+
_class_call_check(this, SwitchPropertyRuntimeRules);
|
|
94
|
+
var _this;
|
|
95
|
+
_this = _call_super(this, SwitchPropertyRuntimeRules, [
|
|
96
|
+
props
|
|
97
|
+
]);
|
|
98
|
+
if (_this[0] !== undefined) {
|
|
99
|
+
_this[0].type = 'boolean';
|
|
100
|
+
}
|
|
101
|
+
return _this;
|
|
102
|
+
}
|
|
103
|
+
return SwitchPropertyRuntimeRules;
|
|
104
|
+
}(BaseControlPropertyRuntimeRules);
|
|
105
|
+
var SwitchProperty = /*#__PURE__*/ function(BaseControlProperty) {
|
|
106
|
+
"use strict";
|
|
107
|
+
_inherits(SwitchProperty, BaseControlProperty);
|
|
108
|
+
function SwitchProperty(props) {
|
|
109
|
+
_class_call_check(this, SwitchProperty);
|
|
110
|
+
var _this;
|
|
111
|
+
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8;
|
|
112
|
+
_this = _call_super(this, SwitchProperty, [
|
|
113
|
+
props
|
|
114
|
+
]), _define_property(_this, "defaultValue", void 0), _define_property(_this, "textDisplayStyle", void 0), _define_property(_this, "checkedText", void 0), _define_property(_this, "checkedTextColor", void 0), _define_property(_this, "checkedBackgroundColor", void 0), _define_property(_this, "uncheckedText", void 0), _define_property(_this, "uncheckedTextColor", void 0), _define_property(_this, "uncheckedBackgroundColor", void 0);
|
|
115
|
+
_this.caption = (_ref = props === null || props === void 0 ? void 0 : props.caption) !== null && _ref !== void 0 ? _ref : SwitchControl.controlName;
|
|
116
|
+
_this.defaultValue = (_ref1 = props === null || props === void 0 ? void 0 : props.defaultValue) !== null && _ref1 !== void 0 ? _ref1 : false;
|
|
117
|
+
_this.textDisplayStyle = (_ref2 = props === null || props === void 0 ? void 0 : props.textDisplayStyle) !== null && _ref2 !== void 0 ? _ref2 : 'inside';
|
|
118
|
+
_this.checkedText = (_ref3 = props === null || props === void 0 ? void 0 : props.checkedText) !== null && _ref3 !== void 0 ? _ref3 : '';
|
|
119
|
+
_this.checkedTextColor = (_ref4 = props === null || props === void 0 ? void 0 : props.checkedTextColor) !== null && _ref4 !== void 0 ? _ref4 : '';
|
|
120
|
+
_this.checkedBackgroundColor = (_ref5 = props === null || props === void 0 ? void 0 : props.checkedBackgroundColor) !== null && _ref5 !== void 0 ? _ref5 : '';
|
|
121
|
+
_this.uncheckedText = (_ref6 = props === null || props === void 0 ? void 0 : props.uncheckedText) !== null && _ref6 !== void 0 ? _ref6 : '';
|
|
122
|
+
_this.uncheckedTextColor = (_ref7 = props === null || props === void 0 ? void 0 : props.uncheckedTextColor) !== null && _ref7 !== void 0 ? _ref7 : '';
|
|
123
|
+
_this.uncheckedBackgroundColor = (_ref8 = props === null || props === void 0 ? void 0 : props.uncheckedBackgroundColor) !== null && _ref8 !== void 0 ? _ref8 : '';
|
|
124
|
+
return _this;
|
|
125
|
+
}
|
|
126
|
+
return SwitchProperty;
|
|
127
|
+
}(BaseControlProperty);
|
|
128
|
+
_define_property(SwitchProperty, "Rules", SwitchPropertyRules);
|
|
129
|
+
_define_property(SwitchProperty, "RuntimeRules", SwitchPropertyRuntimeRules);
|
|
130
|
+
export default SwitchProperty;
|
|
131
|
+
export { SwitchProperty, SwitchPropertyRules, SwitchPropertyRuntimeRules, };
|
|
@@ -0,0 +1,114 @@
|
|
|
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 _defineProperties(target, props) {
|
|
17
|
+
for(var i = 0; i < props.length; i++){
|
|
18
|
+
var descriptor = props[i];
|
|
19
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
20
|
+
descriptor.configurable = true;
|
|
21
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
22
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
26
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
27
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
28
|
+
return Constructor;
|
|
29
|
+
}
|
|
30
|
+
function _define_property(obj, key, value) {
|
|
31
|
+
if (key in obj) {
|
|
32
|
+
Object.defineProperty(obj, key, {
|
|
33
|
+
value: value,
|
|
34
|
+
enumerable: true,
|
|
35
|
+
configurable: true,
|
|
36
|
+
writable: true
|
|
37
|
+
});
|
|
38
|
+
} else {
|
|
39
|
+
obj[key] = value;
|
|
40
|
+
}
|
|
41
|
+
return obj;
|
|
42
|
+
}
|
|
43
|
+
function _get_prototype_of(o) {
|
|
44
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
45
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
46
|
+
};
|
|
47
|
+
return _get_prototype_of(o);
|
|
48
|
+
}
|
|
49
|
+
function _inherits(subClass, superClass) {
|
|
50
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
51
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
52
|
+
}
|
|
53
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
54
|
+
constructor: {
|
|
55
|
+
value: subClass,
|
|
56
|
+
writable: true,
|
|
57
|
+
configurable: true
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
61
|
+
}
|
|
62
|
+
function _possible_constructor_return(self, call) {
|
|
63
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
64
|
+
return call;
|
|
65
|
+
}
|
|
66
|
+
return _assert_this_initialized(self);
|
|
67
|
+
}
|
|
68
|
+
function _set_prototype_of(o, p) {
|
|
69
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
70
|
+
o.__proto__ = p;
|
|
71
|
+
return o;
|
|
72
|
+
};
|
|
73
|
+
return _set_prototype_of(o, p);
|
|
74
|
+
}
|
|
75
|
+
function _type_of(obj) {
|
|
76
|
+
"@swc/helpers - typeof";
|
|
77
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
78
|
+
}
|
|
79
|
+
function _is_native_reflect_construct() {
|
|
80
|
+
try {
|
|
81
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
82
|
+
} catch (_) {}
|
|
83
|
+
return (_is_native_reflect_construct = function() {
|
|
84
|
+
return !!result;
|
|
85
|
+
})();
|
|
86
|
+
}
|
|
87
|
+
import { RuntimeFormControl } from '@byteluck-fe/model-driven-core';
|
|
88
|
+
import { FieldTypes } from '@byteluck-fe/model-driven-shared';
|
|
89
|
+
import SwitchProperty from './property';
|
|
90
|
+
var SwitchControl = /*#__PURE__*/ function(RuntimeFormControl) {
|
|
91
|
+
"use strict";
|
|
92
|
+
_inherits(SwitchControl, RuntimeFormControl);
|
|
93
|
+
function SwitchControl(props) {
|
|
94
|
+
_class_call_check(this, SwitchControl);
|
|
95
|
+
var _this;
|
|
96
|
+
_this = _call_super(this, SwitchControl, [
|
|
97
|
+
props
|
|
98
|
+
]), _define_property(_this, "props", void 0);
|
|
99
|
+
_this.props = new SwitchProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
100
|
+
return _this;
|
|
101
|
+
}
|
|
102
|
+
_create_class(SwitchControl, null, [
|
|
103
|
+
{
|
|
104
|
+
key: "controlType",
|
|
105
|
+
get: function get() {
|
|
106
|
+
return 'switch';
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
]);
|
|
110
|
+
return SwitchControl;
|
|
111
|
+
}(RuntimeFormControl);
|
|
112
|
+
_define_property(SwitchControl, "controlFieldType", FieldTypes.ANY);
|
|
113
|
+
export default SwitchControl;
|
|
114
|
+
export { SwitchControl as RuntimeSwitchControl };
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rok_switch",
|
|
3
|
+
"description": "开关组件,用于快速切换布尔状态。支持开关内外文字展示、默认状态、开启/关闭文案与颜色、国际化配置,适合状态控制与流程开关场景。",
|
|
4
|
+
"parameters": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"isHide": {
|
|
8
|
+
"type": "boolean",
|
|
9
|
+
"description": "是否隐藏",
|
|
10
|
+
"default": false
|
|
11
|
+
},
|
|
12
|
+
"caption": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "标题",
|
|
15
|
+
"default": ""
|
|
16
|
+
},
|
|
17
|
+
"defaultState": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"enum": [
|
|
20
|
+
"default",
|
|
21
|
+
"readonly"
|
|
22
|
+
],
|
|
23
|
+
"description": "默认状态",
|
|
24
|
+
"default": "default",
|
|
25
|
+
"enumDescription": [
|
|
26
|
+
"default",
|
|
27
|
+
"readonly"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"captionSize": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "标题大小",
|
|
33
|
+
"default": ""
|
|
34
|
+
},
|
|
35
|
+
"captionColor": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"description": "标题颜色",
|
|
38
|
+
"default": ""
|
|
39
|
+
},
|
|
40
|
+
"isCaptionItalic": {
|
|
41
|
+
"type": "boolean",
|
|
42
|
+
"description": "标题斜体",
|
|
43
|
+
"default": false
|
|
44
|
+
},
|
|
45
|
+
"isHideCaption": {
|
|
46
|
+
"type": "boolean",
|
|
47
|
+
"description": "隐藏标题",
|
|
48
|
+
"default": false
|
|
49
|
+
},
|
|
50
|
+
"isShowCaptionTip": {
|
|
51
|
+
"type": "boolean",
|
|
52
|
+
"description": "显示气泡提示",
|
|
53
|
+
"default": false
|
|
54
|
+
},
|
|
55
|
+
"captionTip": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"description": "气泡提示语",
|
|
58
|
+
"default": ""
|
|
59
|
+
},
|
|
60
|
+
"labelPosition": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"enum": [
|
|
63
|
+
"top",
|
|
64
|
+
"left"
|
|
65
|
+
],
|
|
66
|
+
"description": "标题布局",
|
|
67
|
+
"default": "",
|
|
68
|
+
"enumDescription": [
|
|
69
|
+
"top",
|
|
70
|
+
"left"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"dataBind": {
|
|
74
|
+
"anyOf": [
|
|
75
|
+
{
|
|
76
|
+
"type": "object",
|
|
77
|
+
"properties": {
|
|
78
|
+
"dataCode": {
|
|
79
|
+
"type": "string",
|
|
80
|
+
"description": "数据模型编码",
|
|
81
|
+
"default": ""
|
|
82
|
+
},
|
|
83
|
+
"fieldCode": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"description": "字段编码",
|
|
86
|
+
"default": ""
|
|
87
|
+
},
|
|
88
|
+
"fieldType": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"description": "字段类型",
|
|
91
|
+
"default": ""
|
|
92
|
+
},
|
|
93
|
+
"aliasCode": {
|
|
94
|
+
"type": "string",
|
|
95
|
+
"description": "表别名"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"type": "object",
|
|
101
|
+
"additionalProperties": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"properties": {
|
|
104
|
+
"dataCode": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"description": "数据模型编码",
|
|
107
|
+
"default": ""
|
|
108
|
+
},
|
|
109
|
+
"fieldCode": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"description": "字段编码",
|
|
112
|
+
"default": ""
|
|
113
|
+
},
|
|
114
|
+
"fieldType": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"description": "字段类型",
|
|
117
|
+
"default": ""
|
|
118
|
+
},
|
|
119
|
+
"aliasCode": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"description": "表别名"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
"description": "绑定数据项"
|
|
128
|
+
},
|
|
129
|
+
"defaultValue": {
|
|
130
|
+
"type": "boolean",
|
|
131
|
+
"description": "默认值",
|
|
132
|
+
"default": false
|
|
133
|
+
},
|
|
134
|
+
"placeholder": {
|
|
135
|
+
"type": "string",
|
|
136
|
+
"description": "提示文字",
|
|
137
|
+
"default": ""
|
|
138
|
+
},
|
|
139
|
+
"required": {
|
|
140
|
+
"type": "boolean",
|
|
141
|
+
"description": "必填",
|
|
142
|
+
"default": false
|
|
143
|
+
},
|
|
144
|
+
"requiredMessage": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"description": "必填提示文案",
|
|
147
|
+
"default": ""
|
|
148
|
+
},
|
|
149
|
+
"textDisplayStyle": {
|
|
150
|
+
"type": "string",
|
|
151
|
+
"enum": [
|
|
152
|
+
"inside",
|
|
153
|
+
"outside"
|
|
154
|
+
],
|
|
155
|
+
"description": "文字展示样式;",
|
|
156
|
+
"default": "inside",
|
|
157
|
+
"enumDescription": [
|
|
158
|
+
"开关内",
|
|
159
|
+
"开关外"
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
"checkedText": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"description": "开启文字",
|
|
165
|
+
"default": ""
|
|
166
|
+
},
|
|
167
|
+
"checkedTextColor": {
|
|
168
|
+
"type": "string",
|
|
169
|
+
"description": "开启文字颜色",
|
|
170
|
+
"default": ""
|
|
171
|
+
},
|
|
172
|
+
"checkedBackgroundColor": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"description": "开启背景颜色",
|
|
175
|
+
"default": ""
|
|
176
|
+
},
|
|
177
|
+
"checkedInternational": {
|
|
178
|
+
"type": "boolean",
|
|
179
|
+
"description": "开启国际化",
|
|
180
|
+
"default": false
|
|
181
|
+
},
|
|
182
|
+
"uncheckedText": {
|
|
183
|
+
"type": "string",
|
|
184
|
+
"description": "关闭文字",
|
|
185
|
+
"default": ""
|
|
186
|
+
},
|
|
187
|
+
"uncheckedTextColor": {
|
|
188
|
+
"type": "string",
|
|
189
|
+
"description": "关闭文字颜色",
|
|
190
|
+
"default": ""
|
|
191
|
+
},
|
|
192
|
+
"uncheckedBackgroundColor": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"description": "关闭背景颜色",
|
|
195
|
+
"default": ""
|
|
196
|
+
},
|
|
197
|
+
"uncheckedInternational": {
|
|
198
|
+
"type": "boolean",
|
|
199
|
+
"description": "关闭国际化",
|
|
200
|
+
"default": false
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"required": []
|
|
204
|
+
}
|
|
205
|
+
}
|