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
- formDataChildren ,
12
- FormDataPropertyView ,
13
- } from '../formComp/formDataConstants' ;
14
- import {
15
- SliderChildren ,
16
- SliderPropertyView ,
17
- SliderStyled ,
18
- SliderWrapper ,
19
- } from './sliderCompConstants' ;
20
- import { hasIcon } from 'comps/utils' ;
21
- 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 { formDataChildren , FormDataPropertyView } from "../formComp/formDataConstants" ;
7
+ import { SliderChildren , SliderPropertyView , SliderStyled , SliderWrapper } from "./sliderCompConstants" ;
8
+ import { hasIcon } from "comps/utils" ;
9
+ import { BoolControl } from "comps/controls/boolControl" ;
22
10
23
11
const SliderBasicComp = ( function ( ) {
24
12
/**
25
13
* FIXME: the range of setValue cannot exceed max
26
14
*/
27
15
const childrenMap = {
28
16
...SliderChildren ,
29
- value : numberExposingStateControl ( ' value' , 60 ) ,
17
+ value : numberExposingStateControl ( " value" , 60 ) ,
30
18
vertical : BoolControl ,
31
19
...formDataChildren ,
32
20
} ;
33
21
return new UICompBuilder ( childrenMap , ( props ) => {
34
22
return props . label ( {
35
23
style : props . style ,
36
24
labelStyle : props . labelStyle ,
37
- inputFieldStyle : props . inputFieldStyle ,
38
- animationStyle : props . animationStyle ,
25
+ inputFieldStyle :props . inputFieldStyle ,
26
+ animationStyle :props . animationStyle ,
39
27
children : (
40
28
< SliderWrapper
41
- $style = { props . inputFieldStyle }
42
29
vertical = { props . vertical }
43
30
onMouseDown = { ( e : any ) => {
44
31
e . stopPropagation ( ) ;
@@ -54,7 +41,7 @@ const SliderBasicComp = (function () {
54
41
vertical = { props . vertical || false }
55
42
onChange = { ( e ) => {
56
43
props . value . onChange ( e ) ;
57
- props . onEvent ( ' change' ) ;
44
+ props . onEvent ( " change" ) ;
58
45
} }
59
46
/>
60
47
{ hasIcon ( props . suffixIcon ) && props . suffixIcon }
@@ -66,14 +53,14 @@ const SliderBasicComp = (function () {
66
53
return (
67
54
< >
68
55
< Section name = { sectionNames . basic } >
69
- { children . value . propertyView ( { label : trans ( ' prop.defaultValue' ) } ) }
70
- { children . max . propertyView ( { label : trans ( ' prop.maximum' ) } ) }
71
- { children . min . propertyView ( { label : trans ( ' prop.minimum' ) } ) }
56
+ { children . value . propertyView ( { label : trans ( " prop.defaultValue" ) } ) }
57
+ { children . max . propertyView ( { label : trans ( " prop.maximum" ) } ) }
58
+ { children . min . propertyView ( { label : trans ( " prop.minimum" ) } ) }
72
59
{ children . step . propertyView ( {
73
- label : trans ( ' slider.step' ) ,
74
- tooltip : trans ( ' slider.stepTooltip' ) ,
60
+ label : trans ( " slider.step" ) ,
61
+ tooltip : trans ( " slider.stepTooltip" ) ,
75
62
} ) }
76
- { children . vertical . propertyView ( { label : trans ( ' slider.vertical' ) } ) }
63
+ { children . vertical . propertyView ( { label : trans ( " slider.vertical" ) } ) }
77
64
</ Section >
78
65
< FormDataPropertyView { ...children } />
79
66
< SliderPropertyView { ...children } />
@@ -84,8 +71,8 @@ const SliderBasicComp = (function () {
84
71
} ) ( ) ;
85
72
86
73
export const SliderComp = withExposingConfigs ( SliderBasicComp , [
87
- new NameConfig ( ' value' , trans ( ' export.sliderValueDesc' ) ) ,
88
- new NameConfig ( ' max' , trans ( ' export.sliderMaxValueDesc' ) ) ,
89
- new NameConfig ( ' min' , trans ( ' export.sliderMinValueDesc' ) ) ,
74
+ new NameConfig ( " value" , trans ( " export.sliderValueDesc" ) ) ,
75
+ new NameConfig ( " max" , trans ( " export.sliderMaxValueDesc" ) ) ,
76
+ new NameConfig ( " min" , trans ( " export.sliderMinValueDesc" ) ) ,
90
77
...CommonNameConfig ,
91
78
] ) ;
0 commit comments