@byteluck-fe/model-driven-controls 7.0.0-props.43 → 7.0.0-props.45

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.
@@ -126,7 +126,7 @@ _define_property(SwitchControl, "controlEventKeys", [
126
126
  'on_change',
127
127
  'on_click'
128
128
  ]);
129
- _define_property(SwitchControl, "controlFieldType", FieldTypes.VARCHAR);
129
+ _define_property(SwitchControl, "controlFieldType", FieldTypes.DECIMAL);
130
130
  _define_property(SwitchControl, "setting", [
131
131
  {
132
132
  key: 'data-bind',
@@ -159,14 +159,14 @@ _define_property(SwitchControl, "setting", [
159
159
  visible: true,
160
160
  name: 'defaultValue',
161
161
  label: getLocaleText('CMD.defaultStatus', null, '默认状态'),
162
- default: false,
162
+ default: 0,
163
163
  options: [
164
164
  {
165
- value: true,
165
+ value: 1,
166
166
  label: getLocaleText('CMD.on', null, '开启')
167
167
  },
168
168
  {
169
- value: false,
169
+ value: 0,
170
170
  label: getLocaleText('CMD.off', null, '关闭')
171
171
  }
172
172
  ]
@@ -72,7 +72,7 @@ function _is_native_reflect_construct() {
72
72
  }
73
73
  /**
74
74
  * name: rok_switch
75
- * description: 开关组件,用于快速切换布尔状态。支持开关内外文字展示、默认状态、开启/关闭文案与颜色、国际化配置,适合状态控制与流程开关场景。
75
+ * description: 开关组件,用于快速切换数值状态(0/1)。支持开关内外文字展示、默认状态、开启/关闭文案与颜色配置,适合状态控制与流程开关场景。
76
76
  */ import SwitchControl from './designer';
77
77
  import { BaseControlProperty, BaseControlPropertyRules, BaseControlPropertyRuntimeRules } from '@byteluck-fe/model-driven-core';
78
78
  var SwitchPropertyRules = /*#__PURE__*/ function(BaseControlPropertyRules) {
@@ -96,7 +96,9 @@ var SwitchPropertyRuntimeRules = /*#__PURE__*/ function(BaseControlPropertyRunti
96
96
  props
97
97
  ]);
98
98
  if (_this[0] !== undefined) {
99
- _this[0].type = 'boolean';
99
+ _this[0].type = 'number';
100
+ _this[0].min = 0;
101
+ _this[0].max = 1;
100
102
  }
101
103
  return _this;
102
104
  }
@@ -113,14 +115,14 @@ var SwitchProperty = /*#__PURE__*/ function(BaseControlProperty) {
113
115
  props
114
116
  ]), _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
117
  _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;
118
+ _this.defaultValue = (_ref1 = props === null || props === void 0 ? void 0 : props.defaultValue) !== null && _ref1 !== void 0 ? _ref1 : 1;
117
119
  _this.textDisplayStyle = (_ref2 = props === null || props === void 0 ? void 0 : props.textDisplayStyle) !== null && _ref2 !== void 0 ? _ref2 : 'inside';
118
120
  _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 : '';
121
+ _this.checkedTextColor = (_ref4 = props === null || props === void 0 ? void 0 : props.checkedTextColor) !== null && _ref4 !== void 0 ? _ref4 : '#ffffff';
120
122
  _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 : '';
123
+ _this.uncheckedText = (_ref6 = props === null || props === void 0 ? void 0 : props.uncheckedText) !== null && _ref6 !== void 0 ? _ref6 : '关闭';
124
+ _this.uncheckedTextColor = (_ref7 = props === null || props === void 0 ? void 0 : props.uncheckedTextColor) !== null && _ref7 !== void 0 ? _ref7 : '#ffffff';
125
+ _this.uncheckedBackgroundColor = (_ref8 = props === null || props === void 0 ? void 0 : props.uncheckedBackgroundColor) !== null && _ref8 !== void 0 ? _ref8 : 'rgba(0, 0, 0, 0.25)';
124
126
  return _this;
125
127
  }
126
128
  return SwitchProperty;
@@ -109,6 +109,6 @@ var SwitchControl = /*#__PURE__*/ function(RuntimeFormControl) {
109
109
  ]);
110
110
  return SwitchControl;
111
111
  }(RuntimeFormControl);
112
- _define_property(SwitchControl, "controlFieldType", FieldTypes.ANY);
112
+ _define_property(SwitchControl, "controlFieldType", FieldTypes.DECIMAL);
113
113
  export default SwitchControl;
114
114
  export { SwitchControl as RuntimeSwitchControl };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rok_switch",
3
- "description": "开关组件,用于快速切换布尔状态。支持开关内外文字展示、默认状态、开启/关闭文案与颜色、国际化配置,适合状态控制与流程开关场景。",
3
+ "description": "开关组件,用于快速切换数值状态(0/1)。支持开关内外文字展示、默认状态、开启/关闭文案与颜色配置,适合状态控制与流程开关场景。",
4
4
  "parameters": {
5
5
  "type": "object",
6
6
  "properties": {
@@ -127,9 +127,17 @@
127
127
  "description": "绑定数据项"
128
128
  },
129
129
  "defaultValue": {
130
- "type": "boolean",
131
- "description": "默认值",
132
- "default": false
130
+ "type": "integer",
131
+ "enum": [
132
+ 0,
133
+ 1
134
+ ],
135
+ "description": "默认值;",
136
+ "default": 0,
137
+ "enumDescription": [
138
+ "关闭",
139
+ "开启"
140
+ ]
133
141
  },
134
142
  "placeholder": {
135
143
  "type": "string",
@@ -174,11 +182,6 @@
174
182
  "description": "开启背景颜色",
175
183
  "default": ""
176
184
  },
177
- "checkedInternational": {
178
- "type": "boolean",
179
- "description": "开启国际化",
180
- "default": false
181
- },
182
185
  "uncheckedText": {
183
186
  "type": "string",
184
187
  "description": "关闭文字",
@@ -193,11 +196,6 @@
193
196
  "type": "string",
194
197
  "description": "关闭背景颜色",
195
198
  "default": ""
196
- },
197
- "uncheckedInternational": {
198
- "type": "boolean",
199
- "description": "关闭国际化",
200
- "default": false
201
199
  }
202
200
  },
203
201
  "required": []