@byteluck-fe/model-driven-controls 7.0.0-props.40 → 7.0.0-props.42

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.
@@ -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,246 @@
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.VARCHAR);
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
+ key: 'color',
212
+ visible: true,
213
+ name: 'checkedBackgroundColor',
214
+ layout: 'horizontal',
215
+ label: getLocaleText('CMD.checkedBgColor', null, '开启背景颜色')
216
+ },
217
+ {
218
+ key: 'common-input',
219
+ visible: true,
220
+ name: 'uncheckedText',
221
+ layout: 'horizontal',
222
+ label: getLocaleText('CMD.checkedText', null, '关闭文字')
223
+ },
224
+ {
225
+ key: 'color',
226
+ visible: true,
227
+ name: 'uncheckedTextColor',
228
+ layout: 'horizontal',
229
+ label: getLocaleText('CMD.uncheckedTextColor', null, '关闭文字颜色')
230
+ },
231
+ {
232
+ key: 'color',
233
+ visible: true,
234
+ name: 'uncheckedBackgroundColor',
235
+ layout: 'horizontal',
236
+ label: getLocaleText('CMD.uncheckedBackgroundColor', null, '关闭背景颜色')
237
+ }
238
+ ]
239
+ },
240
+ {
241
+ key: 'super-setting',
242
+ visible: true
243
+ }
244
+ ]);
245
+ export default SwitchControl;
246
+ 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 };