1
- import { trans } from 'i18n' ;
2
- import { Section , sectionNames } from 'lowcoder-design' ;
3
- import { numberExposingStateControl } from '../../controls/codeStateControl' ;
4
- import { UICompBuilder } from '../../generators' ;
5
- import {
6
- CommonNameConfig ,
7
- NameConfig ,
8
- withExposingConfigs ,
9
- } from '../../generators/withExposing' ;
10
- import {
11
- SliderChildren ,
12
- SliderPropertyView ,
13
- SliderStyled ,
14
- SliderWrapper ,
15
- } from './sliderCompConstants' ;
16
- import { hasIcon } from 'comps/utils' ;
17
- import { BoolControl } from 'comps/controls/boolControl' ;
1
+ import { trans } from "i18n" ;
2
+ import { Section , sectionNames } from "lowcoder-design" ;
3
+ import { numberExposingStateControl } from "../../controls/codeStateControl" ;
4
+ import { UICompBuilder } from "../../generators" ;
5
+ import { CommonNameConfig , NameConfig , withExposingConfigs } from "../../generators/withExposing" ;
6
+ import { SliderChildren , SliderPropertyView , SliderStyled , SliderWrapper } from "./sliderCompConstants" ;
7
+ import { hasIcon } from "comps/utils" ;
8
+ import { BoolControl } from "comps/controls/boolControl" ;
18
9
19
10
const RangeSliderBasicComp = ( function ( ) {
20
11
const childrenMap = {
21
12
...SliderChildren ,
22
- start : numberExposingStateControl ( ' start' , 10 ) ,
23
- end : numberExposingStateControl ( ' end' , 60 ) ,
13
+ start : numberExposingStateControl ( " start" , 10 ) ,
14
+ end : numberExposingStateControl ( " end" , 60 ) ,
24
15
vertical : BoolControl ,
25
16
} ;
26
17
return new UICompBuilder ( childrenMap , ( props ) => {
27
18
return props . label ( {
28
19
style : props . style ,
29
20
labelStyle : props . labelStyle ,
30
- inputFieldStyle : props . inputFieldStyle ,
31
- animationStyle : props . animationStyle ,
21
+ inputFieldStyle :props . inputFieldStyle ,
22
+ animationStyle :props . animationStyle ,
32
23
children : (
33
24
< SliderWrapper
34
25
vertical = { props . vertical }
@@ -43,12 +34,12 @@ const RangeSliderBasicComp = (function () {
43
34
range = { true }
44
35
value = { [ props . start . value , props . end . value ] }
45
36
$style = { props . inputFieldStyle }
46
- style = { { margin : 0 } }
37
+ style = { { margin : 0 } }
47
38
vertical = { props . vertical || false }
48
39
onChange = { ( [ start , end ] ) => {
49
40
props . start . onChange ( start ) ;
50
41
props . end . onChange ( end ) ;
51
- props . onEvent ( ' change' ) ;
42
+ props . onEvent ( " change" ) ;
52
43
} }
53
44
/>
54
45
{ hasIcon ( props . suffixIcon ) && props . suffixIcon }
@@ -60,15 +51,15 @@ const RangeSliderBasicComp = (function () {
60
51
return (
61
52
< >
62
53
< Section name = { sectionNames . basic } >
63
- { children . start . propertyView ( { label : trans ( ' rangeSlider.start' ) } ) }
64
- { children . end . propertyView ( { label : trans ( ' rangeSlider.end' ) } ) }
65
- { children . max . propertyView ( { label : trans ( ' prop.maximum' ) } ) }
66
- { children . min . propertyView ( { label : trans ( ' prop.minimum' ) } ) }
54
+ { children . start . propertyView ( { label : trans ( " rangeSlider.start" ) } ) }
55
+ { children . end . propertyView ( { label : trans ( " rangeSlider.end" ) } ) }
56
+ { children . max . propertyView ( { label : trans ( " prop.maximum" ) } ) }
57
+ { children . min . propertyView ( { label : trans ( " prop.minimum" ) } ) }
67
58
{ children . step . propertyView ( {
68
- label : trans ( ' rangeSlider.step' ) ,
69
- tooltip : trans ( ' rangeSlider.stepTooltip' ) ,
59
+ label : trans ( " rangeSlider.step" ) ,
60
+ tooltip : trans ( " rangeSlider.stepTooltip" ) ,
70
61
} ) }
71
- { children . vertical . propertyView ( { label : trans ( ' slider.vertical' ) } ) }
62
+ { children . vertical . propertyView ( { label : trans ( " slider.vertical" ) } ) }
72
63
</ Section >
73
64
74
65
< SliderPropertyView { ...children } />
@@ -79,9 +70,9 @@ const RangeSliderBasicComp = (function () {
79
70
} ) ( ) ;
80
71
81
72
export const RangeSliderComp = withExposingConfigs ( RangeSliderBasicComp , [
82
- new NameConfig ( ' start' , trans ( ' export.sliderStartDesc' ) ) ,
83
- new NameConfig ( ' end' , trans ( ' export.sliderEndDesc' ) ) ,
84
- new NameConfig ( ' max' , trans ( ' export.sliderMaxValueDesc' ) ) ,
85
- new NameConfig ( ' min' , trans ( ' export.sliderMinValueDesc' ) ) ,
73
+ new NameConfig ( " start" , trans ( " export.sliderStartDesc" ) ) ,
74
+ new NameConfig ( " end" , trans ( " export.sliderEndDesc" ) ) ,
75
+ new NameConfig ( " max" , trans ( " export.sliderMaxValueDesc" ) ) ,
76
+ new NameConfig ( " min" , trans ( " export.sliderMinValueDesc" ) ) ,
86
77
...CommonNameConfig ,
87
78
] ) ;
0 commit comments