1
- import { RecordConstructorToComp } from ' lowcoder-core' ;
2
- import { BoolCodeControl } from ' ../../controls/codeControl' ;
3
- import { LabelControl } from ' ../../controls/labelControl' ;
1
+ import { RecordConstructorToComp } from " lowcoder-core" ;
2
+ import { BoolCodeControl } from " ../../controls/codeControl" ;
3
+ import { LabelControl } from " ../../controls/labelControl" ;
4
4
import {
5
5
arrayStringExposingStateControl ,
6
6
stringExposingStateControl ,
7
- } from ' ../../controls/codeStateControl' ;
8
- import { Section , sectionNames } from ' lowcoder-design' ;
9
- import { SelectInputOptionControl } from ' ../../controls/optionsControl' ;
10
- import { ChangeEventHandlerControl } from ' ../../controls/eventHandlerControl' ;
7
+ } from " ../../controls/codeStateControl" ;
8
+ import { Section , sectionNames } from " lowcoder-design" ;
9
+ import { SelectInputOptionControl } from " ../../controls/optionsControl" ;
10
+ import { ChangeEventHandlerControl } from " ../../controls/eventHandlerControl" ;
11
11
import {
12
12
SelectInputValidationChildren ,
13
13
SelectInputValidationSection ,
14
- } from './selectInputConstants' ;
15
- import {
16
- formDataChildren ,
17
- FormDataPropertyView ,
18
- } from '../formComp/formDataConstants' ;
19
- import { styleControl } from 'comps/controls/styleControl' ;
20
- import {
21
- AnimationStyle ,
22
- InputFieldStyle ,
23
- LabelStyle ,
24
- RadioStyle ,
25
- } from 'comps/controls/styleControlConstants' ;
26
- import { dropdownControl } from '../../controls/dropdownControl' ;
27
- import {
28
- hiddenPropertyView ,
29
- disabledPropertyView ,
30
- } from 'comps/utils/propertyUtils' ;
31
- import { trans } from 'i18n' ;
32
- import { RefControl } from 'comps/controls/refControl' ;
14
+ } from "./selectInputConstants" ;
15
+ import { formDataChildren , FormDataPropertyView } from "../formComp/formDataConstants" ;
16
+ import { styleControl } from "comps/controls/styleControl" ;
17
+ import { AnimationStyle , InputFieldStyle , LabelStyle , RadioStyle } from "comps/controls/styleControlConstants" ;
18
+ import { dropdownControl } from "../../controls/dropdownControl" ;
19
+ import { hiddenPropertyView , disabledPropertyView } from "comps/utils/propertyUtils" ;
20
+ import { trans } from "i18n" ;
21
+ import { RefControl } from "comps/controls/refControl" ;
33
22
34
- import { useContext } from ' react' ;
35
- import { EditorContext } from ' comps/editorState' ;
23
+ import { useContext } from " react" ;
24
+ import { EditorContext } from " comps/editorState" ;
36
25
37
26
export const RadioLayoutOptions = [
38
- { label : trans ( ' radio.horizontal' ) , value : ' horizontal' } ,
39
- { label : trans ( ' radio.vertical' ) , value : ' vertical' } ,
40
- { label : trans ( ' radio.autoColumns' ) , value : ' auto_columns' } ,
27
+ { label : trans ( " radio.horizontal" ) , value : " horizontal" } ,
28
+ { label : trans ( " radio.vertical" ) , value : " vertical" } ,
29
+ { label : trans ( " radio.autoColumns" ) , value : " auto_columns" } ,
41
30
] as const ;
42
31
43
32
export const RadioChildrenMap = {
@@ -59,7 +48,7 @@ export const RadioChildrenMap = {
59
48
60
49
export const RadioPropertyView = (
61
50
children : RecordConstructorToComp <
62
- typeof RadioChildrenMap & { hidden : typeof BoolCodeControl } & {
51
+ typeof RadioChildrenMap & { hidden : typeof BoolCodeControl } & {
63
52
defaultValue :
64
53
| ReturnType < typeof stringExposingStateControl >
65
54
| ReturnType < typeof arrayStringExposingStateControl > ;
@@ -72,57 +61,44 @@ export const RadioPropertyView = (
72
61
< >
73
62
< Section name = { sectionNames . basic } >
74
63
{ children . options . propertyView ( { } ) }
75
- { children . defaultValue . propertyView ( { label : trans ( ' prop.defaultValue' ) } ) }
64
+ { children . defaultValue . propertyView ( { label : trans ( " prop.defaultValue" ) } ) }
76
65
</ Section >
77
66
78
- { [ 'logic' , 'both' ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
79
- < >
80
- < SelectInputValidationSection { ...children } />
81
- < FormDataPropertyView { ...children } />
82
- < Section name = { sectionNames . interaction } >
83
- { children . onEvent . getPropertyView ( ) }
84
- { disabledPropertyView ( children ) }
85
- { hiddenPropertyView ( children ) }
86
- </ Section >
87
- </ >
67
+ { [ "logic" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
68
+ < > < SelectInputValidationSection { ...children } />
69
+ < FormDataPropertyView { ...children } />
70
+ < Section name = { sectionNames . interaction } >
71
+ { children . onEvent . getPropertyView ( ) }
72
+ { disabledPropertyView ( children ) }
73
+ { hiddenPropertyView ( children ) }
74
+ </ Section > </ >
88
75
) }
89
76
90
- { [ 'layout' , 'both' ] . includes (
91
- useContext ( EditorContext ) . editorModeStatus
92
- ) && (
77
+ { [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
93
78
< Section name = { sectionNames . layout } >
94
79
{ children . layout . propertyView ( {
95
- label : trans ( ' radio.options' ) ,
80
+ label : trans ( " radio.options" ) ,
96
81
tooltip : (
97
- < div style = { { display : ' flex' , flexDirection : ' column' , gap : ' 8px' } } >
98
- < div > { trans ( ' radio.horizontalTooltip' ) } </ div >
99
- < div > { trans ( ' radio.verticalTooltip' ) } </ div >
100
- < div > { trans ( ' radio.autoColumnsTooltip' ) } </ div >
82
+ < div style = { { display : " flex" , flexDirection : " column" , gap : " 8px" } } >
83
+ < div > { trans ( " radio.horizontalTooltip" ) } </ div >
84
+ < div > { trans ( " radio.verticalTooltip" ) } </ div >
85
+ < div > { trans ( " radio.autoColumnsTooltip" ) } </ div >
101
86
</ div >
102
87
) ,
103
88
} ) }
104
89
</ Section >
105
90
) }
106
91
107
- { [ 'layout' , 'both' ] . includes ( useContext ( EditorContext ) . editorModeStatus ) &&
108
- children . label . getPropertyView ( ) }
92
+ { [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
93
+ children . label . getPropertyView ( )
94
+ ) }
109
95
110
- { [ 'layout' , 'both' ] . includes (
111
- useContext ( EditorContext ) . editorModeStatus
112
- ) && (
96
+ { [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
113
97
< >
114
- < Section name = { sectionNames . style } >
115
- { children . style . getPropertyView ( ) }
116
- </ Section >
117
- < Section name = { sectionNames . labelStyle } >
118
- { children . labelStyle . getPropertyView ( ) }
119
- </ Section >
120
- < Section name = { sectionNames . inputFieldStyle } >
121
- { children . inputFieldStyle . getPropertyView ( ) }
122
- </ Section >
123
- < Section name = { sectionNames . animationStyle } >
124
- { children . animationStyle . getPropertyView ( ) }
125
- </ Section >
98
+ < Section name = { sectionNames . style } > { children . style . getPropertyView ( ) } </ Section >
99
+ < Section name = { sectionNames . labelStyle } > { children . labelStyle . getPropertyView ( ) } </ Section >
100
+ < Section name = { sectionNames . inputFieldStyle } > { children . inputFieldStyle . getPropertyView ( ) } </ Section >
101
+ < Section name = { sectionNames . animationStyle } > { children . animationStyle . getPropertyView ( ) } </ Section >
126
102
</ >
127
103
) }
128
104
</ >
0 commit comments