@byteluck-fe/model-driven-controls 7.0.0-props.33 → 7.0.0-props.35
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/formControls/Slider/designer.js +192 -0
- package/dist/esm/formControls/Slider/index.js +11 -0
- package/dist/esm/formControls/Slider/property.js +167 -0
- package/dist/esm/formControls/Slider/runtime.js +114 -0
- package/dist/esm/formControls/Slider/schema.json +186 -0
- package/dist/esm/formControls/index.js +1 -0
- package/dist/index.umd.js +1 -1
- package/dist/types/formControls/Slider/designer.d.ts +15 -0
- package/dist/types/formControls/Slider/index.d.ts +12 -0
- package/dist/types/formControls/Slider/property.d.ts +65 -0
- package/dist/types/formControls/Slider/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
|
@@ -0,0 +1,192 @@
|
|
|
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 SliderProperty from './property';
|
|
90
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
91
|
+
var SliderControl = /*#__PURE__*/ function(DesignerFormControl) {
|
|
92
|
+
"use strict";
|
|
93
|
+
_inherits(SliderControl, DesignerFormControl);
|
|
94
|
+
function SliderControl(props) {
|
|
95
|
+
_class_call_check(this, SliderControl);
|
|
96
|
+
var _this;
|
|
97
|
+
_this = _call_super(this, SliderControl, [
|
|
98
|
+
props
|
|
99
|
+
]), _define_property(_this, "props", void 0);
|
|
100
|
+
_this.props = new SliderProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
101
|
+
return _this;
|
|
102
|
+
}
|
|
103
|
+
_create_class(SliderControl, null, [
|
|
104
|
+
{
|
|
105
|
+
key: "controlName",
|
|
106
|
+
get: function get() {
|
|
107
|
+
return getLocaleText('CMD.slider', null, '滑块');
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
key: "controlType",
|
|
112
|
+
get: function get() {
|
|
113
|
+
return 'slider';
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
key: "controlIcon",
|
|
118
|
+
get: function get() {
|
|
119
|
+
return 'iconjishuqi';
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
]);
|
|
123
|
+
return SliderControl;
|
|
124
|
+
}(DesignerFormControl);
|
|
125
|
+
_define_property(SliderControl, "controlEventKeys", [
|
|
126
|
+
'on_change',
|
|
127
|
+
'on_focus',
|
|
128
|
+
'on_blur'
|
|
129
|
+
]);
|
|
130
|
+
_define_property(SliderControl, "controlFieldType", FieldTypes.DECIMAL);
|
|
131
|
+
_define_property(SliderControl, "setting", [
|
|
132
|
+
{
|
|
133
|
+
key: 'data-bind',
|
|
134
|
+
visible: true
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
key: 'caption',
|
|
138
|
+
showItems: [
|
|
139
|
+
COMMON_SETTING_TYPE.CAPTION,
|
|
140
|
+
COMMON_SETTING_TYPE.IS_HIDE_CAPTION
|
|
141
|
+
],
|
|
142
|
+
visible: true
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
key: 'caption-style',
|
|
146
|
+
showItems: [
|
|
147
|
+
COMMON_SETTING_TYPE.CAPTION_SIZE,
|
|
148
|
+
COMMON_SETTING_TYPE.CAPTION_COLOR,
|
|
149
|
+
COMMON_SETTING_TYPE.IS_CAPTION_ITALIC
|
|
150
|
+
],
|
|
151
|
+
visible: true
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
key: 'label-position',
|
|
155
|
+
visible: true
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
key: 'default-state',
|
|
159
|
+
visible: true
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
key: 'common-setting',
|
|
163
|
+
visible: true,
|
|
164
|
+
showItems: [
|
|
165
|
+
COMMON_SETTING_TYPE.REQUIRED,
|
|
166
|
+
COMMON_SETTING_TYPE.IS_HIDE,
|
|
167
|
+
COMMON_SETTING_TYPE.IS_HIDE_CAPTION,
|
|
168
|
+
COMMON_SETTING_TYPE.IS_SHOW_CAPTION_TIP
|
|
169
|
+
]
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
key: 'default-value',
|
|
173
|
+
visible: true
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
key: 'counter-setting',
|
|
177
|
+
visible: true
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
key: 'common-switch',
|
|
181
|
+
visible: true,
|
|
182
|
+
name: 'showTooltip',
|
|
183
|
+
label: getLocaleText('CMD.showPromptLabel', null, '是否显示提示标签'),
|
|
184
|
+
default: true
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
key: 'super-setting',
|
|
188
|
+
visible: true
|
|
189
|
+
}
|
|
190
|
+
]);
|
|
191
|
+
export default SliderControl;
|
|
192
|
+
export { SliderControl as DesignerSliderControl };
|
|
@@ -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,167 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* name: rok_slider
|
|
3
|
+
* description: 滑块组件,用于在连续范围内快速选择数值。适合进度、权重、阈值等场景,支持默认值、最小值、最大值、步长、提示标签和控制按钮配置。
|
|
4
|
+
*/ function _assert_this_initialized(self) {
|
|
5
|
+
if (self === void 0) {
|
|
6
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
7
|
+
}
|
|
8
|
+
return self;
|
|
9
|
+
}
|
|
10
|
+
function _call_super(_this, derived, args) {
|
|
11
|
+
derived = _get_prototype_of(derived);
|
|
12
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
13
|
+
}
|
|
14
|
+
function _class_call_check(instance, Constructor) {
|
|
15
|
+
if (!(instance instanceof Constructor)) {
|
|
16
|
+
throw new TypeError("Cannot call a class as a function");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function _define_property(obj, key, value) {
|
|
20
|
+
if (key in obj) {
|
|
21
|
+
Object.defineProperty(obj, key, {
|
|
22
|
+
value: value,
|
|
23
|
+
enumerable: true,
|
|
24
|
+
configurable: true,
|
|
25
|
+
writable: true
|
|
26
|
+
});
|
|
27
|
+
} else {
|
|
28
|
+
obj[key] = value;
|
|
29
|
+
}
|
|
30
|
+
return obj;
|
|
31
|
+
}
|
|
32
|
+
function _get_prototype_of(o) {
|
|
33
|
+
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
34
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
35
|
+
};
|
|
36
|
+
return _get_prototype_of(o);
|
|
37
|
+
}
|
|
38
|
+
function _inherits(subClass, superClass) {
|
|
39
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
40
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
41
|
+
}
|
|
42
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
43
|
+
constructor: {
|
|
44
|
+
value: subClass,
|
|
45
|
+
writable: true,
|
|
46
|
+
configurable: true
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
if (superClass) _set_prototype_of(subClass, superClass);
|
|
50
|
+
}
|
|
51
|
+
function _possible_constructor_return(self, call) {
|
|
52
|
+
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
53
|
+
return call;
|
|
54
|
+
}
|
|
55
|
+
return _assert_this_initialized(self);
|
|
56
|
+
}
|
|
57
|
+
function _set_prototype_of(o, p) {
|
|
58
|
+
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
59
|
+
o.__proto__ = p;
|
|
60
|
+
return o;
|
|
61
|
+
};
|
|
62
|
+
return _set_prototype_of(o, p);
|
|
63
|
+
}
|
|
64
|
+
function _type_of(obj) {
|
|
65
|
+
"@swc/helpers - typeof";
|
|
66
|
+
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
67
|
+
}
|
|
68
|
+
function _is_native_reflect_construct() {
|
|
69
|
+
try {
|
|
70
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
71
|
+
} catch (_) {}
|
|
72
|
+
return (_is_native_reflect_construct = function() {
|
|
73
|
+
return !!result;
|
|
74
|
+
})();
|
|
75
|
+
}
|
|
76
|
+
import SliderControl from './designer';
|
|
77
|
+
import { BaseControlProperty, BaseControlPropertyRules, BaseControlPropertyRuntimeRules } from '@byteluck-fe/model-driven-core';
|
|
78
|
+
import { getLocaleText } from '@byteluck-fe/locale-message';
|
|
79
|
+
var SliderPropertyRules = /*#__PURE__*/ function(BaseControlPropertyRules) {
|
|
80
|
+
"use strict";
|
|
81
|
+
_inherits(SliderPropertyRules, BaseControlPropertyRules);
|
|
82
|
+
function SliderPropertyRules(props) {
|
|
83
|
+
_class_call_check(this, SliderPropertyRules);
|
|
84
|
+
var _this;
|
|
85
|
+
_this = _call_super(this, SliderPropertyRules, [
|
|
86
|
+
props
|
|
87
|
+
]), _define_property(_this, "defaultValue", [
|
|
88
|
+
{
|
|
89
|
+
type: 'number',
|
|
90
|
+
min: 0,
|
|
91
|
+
max: 100,
|
|
92
|
+
message: getLocaleText('CMD.pleaseEnterNumberRange', null, '请输入大于等于{min}且小于等于{max}的数值')
|
|
93
|
+
}
|
|
94
|
+
]), _define_property(_this, "max", {
|
|
95
|
+
type: 'any'
|
|
96
|
+
});
|
|
97
|
+
var valueMax = props.max === '' ? undefined : props.max;
|
|
98
|
+
var valueMin = props.min === '' ? undefined : props.min;
|
|
99
|
+
_this.defaultValue[0].max = valueMax;
|
|
100
|
+
_this.defaultValue[0].min = valueMin;
|
|
101
|
+
_this.defaultValue[0].message = getLocaleText('CMD.pleaseEnterNumberRange', {
|
|
102
|
+
max: valueMax,
|
|
103
|
+
min: valueMin
|
|
104
|
+
}, '请输入大于等于{min}且小于等于{max}的数值');
|
|
105
|
+
if (valueMin !== undefined && valueMax !== undefined) {
|
|
106
|
+
_this.max = {
|
|
107
|
+
type: 'number',
|
|
108
|
+
min: valueMin,
|
|
109
|
+
message: getLocaleText('CMD.numberRangeSetError', null, '数值范围设置有误')
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
return _this;
|
|
113
|
+
}
|
|
114
|
+
return SliderPropertyRules;
|
|
115
|
+
}(BaseControlPropertyRules);
|
|
116
|
+
var SliderPropertyRuntimeRules = /*#__PURE__*/ function(BaseControlPropertyRuntimeRules) {
|
|
117
|
+
"use strict";
|
|
118
|
+
_inherits(SliderPropertyRuntimeRules, BaseControlPropertyRuntimeRules);
|
|
119
|
+
function SliderPropertyRuntimeRules(props) {
|
|
120
|
+
_class_call_check(this, SliderPropertyRuntimeRules);
|
|
121
|
+
var _this;
|
|
122
|
+
_this = _call_super(this, SliderPropertyRuntimeRules, [
|
|
123
|
+
props
|
|
124
|
+
]);
|
|
125
|
+
if (_this[0] !== undefined) {
|
|
126
|
+
_this[0].type = 'number';
|
|
127
|
+
}
|
|
128
|
+
var valueMax = props.max === '' ? undefined : props.max;
|
|
129
|
+
var valueMin = props.min === '' ? undefined : props.min;
|
|
130
|
+
_this.push({
|
|
131
|
+
type: 'number',
|
|
132
|
+
min: valueMin,
|
|
133
|
+
max: valueMax,
|
|
134
|
+
message: getLocaleText(valueMax === undefined ? 'CMD.pleaseEnterAValueGreaterThanMin' : valueMin === undefined ? 'CMD.pleaseEnterAValueLessThanMax' : 'CMD.pleaseEnterNumberRange', {
|
|
135
|
+
max: valueMax,
|
|
136
|
+
min: valueMin
|
|
137
|
+
}, valueMax === undefined ? getLocaleText('CMD.pleaseEnterAValueGreaterThanMin', null, '请输入大于等于{min}的数值') : valueMin === undefined ? getLocaleText('CMD.pleaseEnterAValueLessThanMax', null, '请输入小于等于{max}的数值') : getLocaleText('CMD.pleaseEnterNumberRange', null, '请输入大于等于{min}且小于等于{max}的数值'))
|
|
138
|
+
});
|
|
139
|
+
return _this;
|
|
140
|
+
}
|
|
141
|
+
return SliderPropertyRuntimeRules;
|
|
142
|
+
}(BaseControlPropertyRuntimeRules);
|
|
143
|
+
var SliderProperty = /*#__PURE__*/ function(BaseControlProperty) {
|
|
144
|
+
"use strict";
|
|
145
|
+
_inherits(SliderProperty, BaseControlProperty);
|
|
146
|
+
function SliderProperty(props) {
|
|
147
|
+
_class_call_check(this, SliderProperty);
|
|
148
|
+
var _this;
|
|
149
|
+
var _ref, _ref1, _ref2, _ref3, _ref4, _ref5, _ref6;
|
|
150
|
+
_this = _call_super(this, SliderProperty, [
|
|
151
|
+
props
|
|
152
|
+
]), _define_property(_this, "defaultValue", void 0), _define_property(_this, "min", void 0), _define_property(_this, "max", void 0), _define_property(_this, "step", void 0), _define_property(_this, "showTooltip", void 0), _define_property(_this, "controls", void 0);
|
|
153
|
+
_this.caption = (_ref = props === null || props === void 0 ? void 0 : props.caption) !== null && _ref !== void 0 ? _ref : SliderControl.controlName;
|
|
154
|
+
_this.defaultValue = (_ref1 = props === null || props === void 0 ? void 0 : props.defaultValue) !== null && _ref1 !== void 0 ? _ref1 : '';
|
|
155
|
+
_this.min = (_ref2 = props === null || props === void 0 ? void 0 : props.min) !== null && _ref2 !== void 0 ? _ref2 : 0;
|
|
156
|
+
_this.max = (_ref3 = props === null || props === void 0 ? void 0 : props.max) !== null && _ref3 !== void 0 ? _ref3 : 100;
|
|
157
|
+
_this.step = (_ref4 = props === null || props === void 0 ? void 0 : props.step) !== null && _ref4 !== void 0 ? _ref4 : 1;
|
|
158
|
+
_this.showTooltip = (_ref5 = props === null || props === void 0 ? void 0 : props.showTooltip) !== null && _ref5 !== void 0 ? _ref5 : true;
|
|
159
|
+
_this.controls = (_ref6 = props === null || props === void 0 ? void 0 : props.controls) !== null && _ref6 !== void 0 ? _ref6 : true;
|
|
160
|
+
return _this;
|
|
161
|
+
}
|
|
162
|
+
return SliderProperty;
|
|
163
|
+
}(BaseControlProperty);
|
|
164
|
+
_define_property(SliderProperty, "Rules", SliderPropertyRules);
|
|
165
|
+
_define_property(SliderProperty, "RuntimeRules", SliderPropertyRuntimeRules);
|
|
166
|
+
export default SliderProperty;
|
|
167
|
+
export { SliderProperty, SliderPropertyRules, SliderPropertyRuntimeRules, };
|
|
@@ -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 SliderProperty from './property';
|
|
90
|
+
var SliderControl = /*#__PURE__*/ function(RuntimeFormControl) {
|
|
91
|
+
"use strict";
|
|
92
|
+
_inherits(SliderControl, RuntimeFormControl);
|
|
93
|
+
function SliderControl(props) {
|
|
94
|
+
_class_call_check(this, SliderControl);
|
|
95
|
+
var _this;
|
|
96
|
+
_this = _call_super(this, SliderControl, [
|
|
97
|
+
props
|
|
98
|
+
]), _define_property(_this, "props", void 0);
|
|
99
|
+
_this.props = new SliderProperty(props === null || props === void 0 ? void 0 : props.props);
|
|
100
|
+
return _this;
|
|
101
|
+
}
|
|
102
|
+
_create_class(SliderControl, null, [
|
|
103
|
+
{
|
|
104
|
+
key: "controlType",
|
|
105
|
+
get: function get() {
|
|
106
|
+
return 'slider';
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
]);
|
|
110
|
+
return SliderControl;
|
|
111
|
+
}(RuntimeFormControl);
|
|
112
|
+
_define_property(SliderControl, "controlFieldType", FieldTypes.DECIMAL);
|
|
113
|
+
export default SliderControl;
|
|
114
|
+
export { SliderControl as RuntimeSliderControl };
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rok_slider",
|
|
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": [
|
|
131
|
+
"integer",
|
|
132
|
+
"string"
|
|
133
|
+
],
|
|
134
|
+
"description": "默认值",
|
|
135
|
+
"default": ""
|
|
136
|
+
},
|
|
137
|
+
"placeholder": {
|
|
138
|
+
"type": "string",
|
|
139
|
+
"description": "提示文字",
|
|
140
|
+
"default": ""
|
|
141
|
+
},
|
|
142
|
+
"required": {
|
|
143
|
+
"type": "boolean",
|
|
144
|
+
"description": "必填",
|
|
145
|
+
"default": false
|
|
146
|
+
},
|
|
147
|
+
"requiredMessage": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"description": "必填提示文案",
|
|
150
|
+
"default": ""
|
|
151
|
+
},
|
|
152
|
+
"min": {
|
|
153
|
+
"type": [
|
|
154
|
+
"integer",
|
|
155
|
+
"string"
|
|
156
|
+
],
|
|
157
|
+
"description": "最小值",
|
|
158
|
+
"default": 0
|
|
159
|
+
},
|
|
160
|
+
"max": {
|
|
161
|
+
"type": [
|
|
162
|
+
"integer",
|
|
163
|
+
"string"
|
|
164
|
+
],
|
|
165
|
+
"description": "最大值",
|
|
166
|
+
"default": 100
|
|
167
|
+
},
|
|
168
|
+
"step": {
|
|
169
|
+
"type": "integer",
|
|
170
|
+
"description": "步长",
|
|
171
|
+
"default": 1
|
|
172
|
+
},
|
|
173
|
+
"showTooltip": {
|
|
174
|
+
"type": "boolean",
|
|
175
|
+
"description": "是否显示提示标签",
|
|
176
|
+
"default": true
|
|
177
|
+
},
|
|
178
|
+
"controls": {
|
|
179
|
+
"type": "boolean",
|
|
180
|
+
"description": "是否使用控制按钮(左右+-按钮)",
|
|
181
|
+
"default": true
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"required": []
|
|
185
|
+
}
|
|
186
|
+
}
|
|
@@ -4,6 +4,7 @@ export { default as Cascader } from './Cascader';
|
|
|
4
4
|
export { default as Counter } from './Counter';
|
|
5
5
|
export { default as Radio } from './Radio';
|
|
6
6
|
export { default as Number } from './Number';
|
|
7
|
+
export { default as Slider } from './Slider';
|
|
7
8
|
export { default as DatePicker } from './DatePicker';
|
|
8
9
|
export { default as DateRange } from './DateRange';
|
|
9
10
|
export { default as TimePicker } from './TimePicker';
|