Skip to content

Commit fc7c125

Browse files
committed
formating removed-62
1 parent 0bdf34f commit fc7c125

File tree

1 file changed

+56
-69
lines changed

1 file changed

+56
-69
lines changed
Lines changed: 56 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,29 @@
1-
import {default as AntdCheckboxGroup} from 'antd/es/checkbox/Group';
2-
import {SelectInputOptionControl} from 'comps/controls/optionsControl';
3-
import {BoolCodeControl} from '../../controls/codeControl';
4-
import {arrayStringExposingStateControl} from '../../controls/codeStateControl';
5-
import {LabelControl} from '../../controls/labelControl';
6-
import {ChangeEventHandlerControl} from '../../controls/eventHandlerControl';
7-
import {UICompBuilder} from '../../generators';
8-
import {
9-
CommonNameConfig,
10-
NameConfig,
11-
withExposingConfigs,
12-
} from '../../generators/withExposing';
13-
import styled, {css} from 'styled-components';
1+
import { default as AntdCheckboxGroup } from "antd/es/checkbox/Group";
2+
import { SelectInputOptionControl } from "comps/controls/optionsControl";
3+
import { BoolCodeControl } from "../../controls/codeControl";
4+
import { arrayStringExposingStateControl } from "../../controls/codeStateControl";
5+
import { LabelControl } from "../../controls/labelControl";
6+
import { ChangeEventHandlerControl } from "../../controls/eventHandlerControl";
7+
import { UICompBuilder } from "../../generators";
8+
import { CommonNameConfig, NameConfig, withExposingConfigs } from "../../generators/withExposing";
9+
import styled, { css } from "styled-components";
1410
import {
1511
selectDivRefMethods,
1612
SelectInputInvalidConfig,
1713
SelectInputValidationChildren,
1814
useSelectInputValidate,
19-
} from './selectInputConstants';
20-
import {formDataChildren} from '../formComp/formDataConstants';
21-
import {styleControl} from 'comps/controls/styleControl';
22-
import {
23-
AnimationStyle,
24-
CheckboxStyle,
25-
CheckboxStyleType,
26-
InputFieldStyle,
27-
LabelStyle,
28-
} from 'comps/controls/styleControlConstants';
29-
import {RadioLayoutOptions, RadioPropertyView} from './radioCompConstants';
30-
import {dropdownControl} from '../../controls/dropdownControl';
31-
import {ValueFromOption} from 'lowcoder-design';
32-
import {EllipsisTextCss} from 'lowcoder-design';
33-
import {trans} from 'i18n';
34-
import {RefControl} from 'comps/controls/refControl';
35-
import {migrateOldData} from 'comps/generators/simpleGenerators';
36-
import {fixOldInputCompData} from '../textInputComp/textInputConstants';
15+
} from "./selectInputConstants";
16+
import { formDataChildren } from "../formComp/formDataConstants";
17+
import { styleControl } from "comps/controls/styleControl";
18+
import { AnimationStyle, CheckboxStyle, CheckboxStyleType, InputFieldStyle, LabelStyle } from "comps/controls/styleControlConstants";
19+
import { RadioLayoutOptions, RadioPropertyView } from "./radioCompConstants";
20+
import { dropdownControl } from "../../controls/dropdownControl";
21+
import { ValueFromOption } from "lowcoder-design";
22+
import { EllipsisTextCss } from "lowcoder-design";
23+
import { trans } from "i18n";
24+
import { RefControl } from "comps/controls/refControl";
25+
import { migrateOldData } from "comps/generators/simpleGenerators";
26+
import { fixOldInputCompData } from "../textInputComp/textInputConstants";
3727

3828
export const getStyle = (style: CheckboxStyleType) => {
3929
return css`
@@ -50,7 +40,7 @@ export const getStyle = (style: CheckboxStyleType) => {
5040
.ant-checkbox-inner {
5141
background-color: ${style.checkedBackground};
5242
border-color: ${style.checkedBackground};
53-
border-width: ${!!style.borderWidth ? style.borderWidth : '2px'};
43+
border-width:${!!style.borderWidth ? style.borderWidth : '2px'};
5444
5545
&::after {
5646
border-color: ${style.checked};
@@ -59,49 +49,47 @@ export const getStyle = (style: CheckboxStyleType) => {
5949
6050
&::after {
6151
border-color: ${style.checkedBackground};
62-
border-width: ${!!style.borderWidth ? style.borderWidth : '2px'};
52+
border-width:${!!style.borderWidth ? style.borderWidth : '2px'};
6353
border-radius: ${style.radius};
6454
}
6555
}
66-
56+
6757
.ant-checkbox-inner {
6858
border-radius: ${style.radius};
6959
background-color: ${style.uncheckedBackground};
7060
border-color: ${style.uncheckedBorder};
71-
border-width: ${!!style.borderWidth ? style.borderWidth : '2px'};
61+
border-width:${!!style.borderWidth ? style.borderWidth : '2px'};
7262
}
73-
74-
&:hover .ant-checkbox-inner,
63+
64+
&:hover .ant-checkbox-inner,
7565
.ant-checkbox:hover .ant-checkbox-inner,
7666
.ant-checkbox-input + ant-checkbox-inner {
77-
background-color: ${style.hoverBackground
78-
? style.hoverBackground
79-
: '#fff'};
67+
background-color:${style.hoverBackground ? style.hoverBackground : '#fff'};
8068
}
8169
82-
&:hover .ant-checkbox-checked .ant-checkbox-inner,
70+
&:hover .ant-checkbox-checked .ant-checkbox-inner,
8371
.ant-checkbox:hover .ant-checkbox-inner,
8472
.ant-checkbox-input + ant-checkbox-inner {
85-
background-color: ${style.hoverBackground
86-
? style.hoverBackground
87-
: '#ffff'};
73+
background-color:${style.hoverBackground ? style.hoverBackground : '#ffff'};
8874
}
8975
9076
&:hover .ant-checkbox-inner,
9177
.ant-checkbox:hover .ant-checkbox-inner,
9278
.ant-checkbox-input:focus + .ant-checkbox-inner {
9379
border-color: ${style.checkedBackground};
94-
border-width: ${!!style.borderWidth ? style.borderWidth : '2px'};
80+
border-width:${!!style.borderWidth ? style.borderWidth : '2px'};
9581
}
9682
}
9783
84+
85+
9886
.ant-checkbox-group-item {
99-
font-family: ${style.fontFamily};
100-
font-size: ${style.textSize};
101-
font-weight: ${style.textWeight};
102-
font-style: ${style.fontStyle};
103-
text-transform: ${style.textTransform};
104-
text-decoration: ${style.textDecoration};
87+
font-family:${style.fontFamily};
88+
font-size:${style.textSize};
89+
font-weight:${style.textWeight};
90+
font-style:${style.fontStyle};
91+
text-transform:${style.textTransform};
92+
text-decoration:${style.textDecoration};
10593
}
10694
.ant-checkbox-wrapper {
10795
padding: ${style.padding};
@@ -113,25 +101,25 @@ export const getStyle = (style: CheckboxStyleType) => {
113101
`;
114102
};
115103

116-
const CheckboxGroup = styled(AntdCheckboxGroup)<{
104+
const CheckboxGroup = styled(AntdCheckboxGroup) <{
117105
$style: CheckboxStyleType;
118106
$layout: ValueFromOption<typeof RadioLayoutOptions>;
119107
}>`
120108
min-height: 32px;
121109
${(props) => props.$style && getStyle(props.$style)}
122110
${(props) => {
123-
if (props.$layout === 'horizontal') {
111+
if (props.$layout === "horizontal") {
124112
return css`
125113
display: flex;
126114
align-items: center;
127115
flex-wrap: wrap;
128116
`;
129-
} else if (props.$layout === 'vertical') {
117+
} else if (props.$layout === "vertical") {
130118
return css`
131119
display: flex;
132120
flex-direction: column;
133121
`;
134-
} else if (props.$layout === 'auto_columns') {
122+
} else if (props.$layout === "auto_columns") {
135123
return css`
136124
break-inside: avoid;
137125
columns: 160px;
@@ -142,33 +130,32 @@ const CheckboxGroup = styled(AntdCheckboxGroup)<{
142130

143131
let CheckboxBasicComp = (function () {
144132
const childrenMap = {
145-
defaultValue: arrayStringExposingStateControl('defaultValue'),
146-
value: arrayStringExposingStateControl('value'),
133+
defaultValue: arrayStringExposingStateControl("defaultValue"),
134+
value: arrayStringExposingStateControl("value"),
147135
label: LabelControl,
148136
disabled: BoolCodeControl,
149137
onEvent: ChangeEventHandlerControl,
150138
options: SelectInputOptionControl,
151139
style: styleControl(InputFieldStyle),
152-
labelStyle: styleControl(
153-
LabelStyle.filter(
154-
(style) => ['accent', 'validate'].includes(style.name) === false
155-
)
156-
),
157-
layout: dropdownControl(RadioLayoutOptions, 'horizontal'),
140+
labelStyle: styleControl(LabelStyle.filter((style) => ['accent', 'validate'].includes(style.name) === false)),
141+
layout: dropdownControl(RadioLayoutOptions, "horizontal"),
158142
viewRef: RefControl<HTMLDivElement>,
159-
inputFieldStyle: styleControl(CheckboxStyle),
160-
animationStyle: styleControl(AnimationStyle),
143+
inputFieldStyle:styleControl(CheckboxStyle),
144+
animationStyle:styleControl(AnimationStyle),
161145
...SelectInputValidationChildren,
162146
...formDataChildren,
163147
};
164148
return new UICompBuilder(childrenMap, (props) => {
165-
const [validateState, handleChange] = useSelectInputValidate(props);
149+
const [
150+
validateState,
151+
handleChange,
152+
] = useSelectInputValidate(props);
166153
return props.label({
167154
required: props.required,
168155
style: props.style,
169156
labelStyle: props.labelStyle,
170-
inputFieldStyle: props.inputFieldStyle,
171-
animationStyle: props.animationStyle,
157+
inputFieldStyle:props.inputFieldStyle,
158+
animationStyle:props.animationStyle,
172159
children: (
173160
<CheckboxGroup
174161
ref={props.viewRef}
@@ -199,7 +186,7 @@ let CheckboxBasicComp = (function () {
199186
CheckboxBasicComp = migrateOldData(CheckboxBasicComp, fixOldInputCompData);
200187

201188
export const CheckboxComp = withExposingConfigs(CheckboxBasicComp, [
202-
new NameConfig('value', trans('selectInput.valueDesc')),
189+
new NameConfig("value", trans("selectInput.valueDesc")),
203190
SelectInputInvalidConfig,
204191
...CommonNameConfig,
205192
]);

0 commit comments

Comments
 (0)