Skip to content

Commit 6b8a497

Browse files
committed
Fixes and introduction of text-decoration and text transform property with css control
1 parent 50f87fc commit 6b8a497

File tree

15 files changed

+72
-3
lines changed

15 files changed

+72
-3
lines changed

client/packages/lowcoder/src/comps/comps/buttonComp/buttonCompConstants.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export function getButtonStyle(buttonStyle: ButtonStyleType) {
2424
font-weight: ${buttonStyle.textWeight};
2525
font-family: ${buttonStyle.fontFamily};
2626
font-style: ${buttonStyle.fontStyle};
27+
text-transform:${buttonStyle.textTransform};
28+
text-decoration:${buttonStyle.textDecoration};
2729
background-color: ${buttonStyle.background};
2830
border-radius: ${buttonStyle.radius};
2931
margin: ${buttonStyle.margin};

client/packages/lowcoder/src/comps/comps/buttonComp/dropdownComp.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,41 @@ import {
2525

2626
const StyledDropdownButton = styled(DropdownButton)`
2727
width: 100%;
28+
2829
.ant-btn-group {
2930
width: 100%;
31+
3032
}
3133
`;
3234

3335
const LeftButtonWrapper = styled.div<{ $buttonStyle: ButtonStyleType }>`
3436
width: calc(100%);
3537
${(props) => `margin: ${props.$buttonStyle.margin};`}
3638
margin-right: 0;
39+
.ant-btn span {
40+
${(props) => `text-decoration: ${props.$buttonStyle.textDecoration};`}
41+
${(props) => `font-family: ${props.$buttonStyle.fontFamily};`}
42+
}
43+
3744
.ant-btn {
3845
${(props) => getButtonStyle(props.$buttonStyle)}
3946
margin: 0 !important;
4047
height: 100%;
4148
&.ant-btn-default {
4249
margin: 0 !important;
4350
${(props) => `border-radius: ${props.$buttonStyle.radius} 0 0 ${props.$buttonStyle.radius};`}
51+
${(props) => `text-transform: ${props.$buttonStyle.textTransform};`}
52+
${(props) => `font-weight: ${props.$buttonStyle.textWeight};`}
4453
}
4554
${(props) => `background-color: ${props.$buttonStyle.background};`}
4655
${(props) => `color: ${props.$buttonStyle.text};`}
4756
${(props) => `padding: ${props.$buttonStyle.padding};`}
4857
${(props) => `font-size: ${props.$buttonStyle.textSize};`}
4958
${(props) => `font-style: ${props.$buttonStyle.fontStyle};`}
59+
5060
width: 100%;
5161
}
62+
5263
`;
5364

5465
const RightButtonWrapper = styled.div<{ $buttonStyle: ButtonStyleType }>`

client/packages/lowcoder/src/comps/comps/buttonComp/linkComp.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ const Link = styled(Button) <{ $style: LinkStyleType }>`
3434
font-weight:${props.$style.textWeight};
3535
border: ${props.$style.borderWidth} solid ${props.$style.border};
3636
border-radius:${props.$style.radius ? props.$style.radius:'0px'};
37+
text-transform:${props.$style.textTransform ? props.$style.textTransform:''};
38+
text-decoration:${props.$style.textDecoration ? props.$style.textDecoration:''} !important;
3739
background-color: ${props.$style.background};
3840
&:hover {
3941
color: ${props.$style.hoverText} !important;

client/packages/lowcoder/src/comps/comps/dividerComp.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const StyledDivider = styled(Divider) <IProps>`
3030
font-size: ${(props) => props.$style.textSize};
3131
font-weight: ${(props) => props.$style.textWeight};
3232
font-family: ${(props) => props.$style.fontFamily};
33+
text-transform:${(props)=>props.$style.textTransform};
34+
text-decoration:${(props)=>props.$style.textDecoration};
3335
font-style:${(props) => props.$style.fontStyle}
3436
}
3537
min-width: 0;

client/packages/lowcoder/src/comps/comps/navComp/navComp.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ const Item = styled.div<{
5252
$textSize: string;
5353
$margin: string;
5454
$padding: string;
55+
$textTransform:string;
56+
$textDecoration:string;
5557
}>`
5658
height: 30px;
5759
line-height: 30px;
@@ -61,6 +63,8 @@ const Item = styled.div<{
6163
font-family:${(props) => (props.$fontFamily ? props.$fontFamily : 'sans-serif')};
6264
font-style:${(props) => (props.$fontStyle ? props.$fontStyle : 'normal')};
6365
font-size:${(props) => (props.$textSize ? props.$textSize : '14px')};
66+
text-transform:${(props) => (props.$textTransform ? props.$textTransform : '')};
67+
text-decoration:${(props) => (props.$textDecoration ? props.$textDecoration : '')};
6468
margin:${(props) => props.$margin ? props.$margin : '0px'};
6569
6670
&:hover {
@@ -161,6 +165,8 @@ const NavCompBase = new UICompBuilder(childrenMap, (props) => {
161165
$textWeight={props.style.textWeight}
162166
$textSize={props.style.textSize}
163167
$padding={props.style.padding}
168+
$textTransform={props.style.textTransform}
169+
$textDecoration={props.style.textDecoration}
164170
$margin={props.style.margin}
165171
onClick={() => onEvent("click")}
166172
>

client/packages/lowcoder/src/comps/comps/selectInputComp/checkboxComp.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ export const getStyle = (style: CheckboxStyleType) => {
8686
font-size:${style.textSize};
8787
font-weight:${style.textWeight};
8888
font-style:${style.fontStyle};
89+
text-transform:${style.textTransform};
90+
text-decoration:${style.textDecoration};
8991
}
9092
.ant-checkbox-wrapper {
9193
padding: ${style.padding};

client/packages/lowcoder/src/comps/comps/selectInputComp/radioComp.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ const getStyle = (style: RadioStyleType) => {
2525
font-size:${style.textSize};
2626
font-weight:${style.textWeight};
2727
font-style:${style.fontStyle};
28+
text-transform:${style.textTransform};
29+
text-decoration:${style.textDecoration};
2830
}
2931
3032
.ant-radio-checked {
@@ -47,6 +49,12 @@ const getStyle = (style: RadioStyleType) => {
4749
}
4850
}
4951
52+
&:hover .ant-radio-inner,
53+
.ant-radio:hover .ant-radio-inner,
54+
.ant-radio-input + ant-radio-inner {
55+
background-color:${style.hoverBackground ? style.hoverBackground:'#ffff'};
56+
}
57+
5058
&:hover .ant-radio-inner,
5159
.ant-radio:hover .ant-radio-inner,
5260
.ant-radio-input:focus + .ant-radio-inner {

client/packages/lowcoder/src/comps/comps/textComp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ const getStyle = (style: TextStyleType) => {
3030
font-weight: ${style.textWeight} !important;
3131
font-family: ${style.fontFamily} !important;
3232
font-style:${style.fontStyle} !important;
33+
text-transform:${style.textTransform} !important;
34+
text-decoration:${style.textDecoration} !important;
3335
background-color: ${style.background};
3436
.markdown-body a {
3537
color: ${style.links};
@@ -146,7 +148,6 @@ let TextTmpComp = (function () {
146148
.setPropertyViewFn((children) => {
147149
return (
148150
<>
149-
150151
<Section name={sectionNames.basic}>
151152
{children.type.propertyView({
152153
label: trans("value"),

client/packages/lowcoder/src/comps/comps/textInputComp/mentionComp.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ const Wrapper = styled.div<{
6262
.rc-textarea {
6363
background-color:${(props) => props.$style.background};
6464
padding:${(props) => props.$style.padding};
65+
text-transform:${(props)=>props.$style.textTransform};
66+
text-decoration:${(props)=>props.$style.textDecoration};
6567
margin: 0px 3px 0px 3px !important;
6668
}
6769

client/packages/lowcoder/src/comps/comps/textInputComp/textInputConstants.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ export function getStyle(style: InputLikeStyleType) {
230230
font-weight: ${style.textWeight};
231231
font-family: ${style.fontFamily};
232232
font-style:${style.fontStyle};
233+
text-transform:${style.textTransform};
234+
text-decoration:${style.textDecoration};
233235
background-color: ${style.background};
234236
border-color: ${style.border};
235237

client/packages/lowcoder/src/comps/controls/styleControl.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,8 @@ export function styleControl<T extends readonly SingleColorConfig[]>(colorConfig
547547
name === "cardRadius" ||
548548
name === "textSize" ||
549549
name === "textWeight" ||
550+
name === "textTransform" ||
551+
name === "textDecoration" ||
550552
name === "fontFamily" ||
551553
name === "fontStyle" ||
552554
name === "backgroundImage" ||

client/packages/lowcoder/src/comps/controls/styleControlConstants.tsx

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,21 @@ export type PaddingConfig = CommonColorConfig & {
7474
readonly padding: string;
7575
};
7676

77+
export type TextTransformConfig = CommonColorConfig & {
78+
readonly textTransform: string;
79+
}
80+
81+
export type TextDecorationConfig = CommonColorConfig & {
82+
readonly textDecoration: string;
83+
}
84+
7785
export type DepColorConfig = CommonColorConfig & {
7886
readonly depName?: string;
7987
readonly depTheme?: keyof ThemeDetail;
8088
readonly depType?: DEP_TYPE;
8189
transformer: (color: string, ...rest: string[]) => string;
8290
};
83-
export type SingleColorConfig = SimpleColorConfig | DepColorConfig | RadiusConfig | BorderWidthConfig | BackgroundImageConfig | BackgroundImageRepeatConfig | BackgroundImageSizeConfig | BackgroundImagePositionConfig | BackgroundImageOriginConfig | TextSizeConfig | TextWeightConfig | FontFamilyConfig | FontStyleConfig | MarginConfig | PaddingConfig | ContainerHeaderPaddigConfig | ContainerFooterPaddigConfig | ContainerBodyPaddigConfig | HeaderBackgroundImageConfig | HeaderBackgroundImageRepeatConfig | HeaderBackgroundImageSizeConfig | HeaderBackgroundImagePositionConfig | HeaderBackgroundImageOriginConfig | FooterBackgroundImageConfig | FooterBackgroundImageRepeatConfig | FooterBackgroundImageSizeConfig | FooterBackgroundImagePositionConfig | FooterBackgroundImageOriginConfig;
91+
export type SingleColorConfig = SimpleColorConfig | DepColorConfig | RadiusConfig | BorderWidthConfig | BackgroundImageConfig | BackgroundImageRepeatConfig | BackgroundImageSizeConfig | BackgroundImagePositionConfig | BackgroundImageOriginConfig | TextSizeConfig | TextWeightConfig | TextTransformConfig | TextDecorationConfig | FontFamilyConfig | FontStyleConfig | MarginConfig | PaddingConfig | ContainerHeaderPaddigConfig | ContainerFooterPaddigConfig | ContainerBodyPaddigConfig | HeaderBackgroundImageConfig | HeaderBackgroundImageRepeatConfig | HeaderBackgroundImageSizeConfig | HeaderBackgroundImagePositionConfig | HeaderBackgroundImageOriginConfig | FooterBackgroundImageConfig | FooterBackgroundImageRepeatConfig | FooterBackgroundImageSizeConfig | FooterBackgroundImagePositionConfig | FooterBackgroundImageOriginConfig;
8492

8593
export const defaultTheme: ThemeDetail = {
8694
primary: "#3377FF",
@@ -387,6 +395,18 @@ const CONTAINERBODYPADDING = {
387395
containerbodypadding: "padding",
388396
} as const;
389397

398+
const TEXT_TRANSFORM = {
399+
name: "textTransform",
400+
label: trans("style.textTransform"),
401+
textTransform: "textTransform"
402+
}
403+
404+
const TEXT_DECORATION = {
405+
name: "textDecoration",
406+
label: trans("style.textDecoration"),
407+
textDecoration: "textDecoration"
408+
}
409+
390410
const getStaticBorder = (color: string = SECOND_SURFACE_COLOR) =>
391411
({
392412
name: "border",
@@ -405,6 +425,8 @@ const HEADER_BACKGROUND = {
405425
const BG_STATIC_BORDER_RADIUS = [getBackground(), getStaticBorder(), RADIUS] as const;
406426
const STYLING_FIELDS_SEQUENCE = [
407427
TEXT,
428+
TEXT_TRANSFORM,
429+
TEXT_DECORATION,
408430
TEXT_SIZE,
409431
TEXT_WEIGHT,
410432
FONT_FAMILY,
@@ -860,6 +882,7 @@ export const RadioStyle = [
860882
depType: DEP_TYPE.SELF,
861883
transformer: toSelf,
862884
},
885+
HOVER_BACKGROUND_COLOR
863886
] as const;
864887

865888
export const SegmentStyle = [
@@ -1079,7 +1102,7 @@ export const ProgressStyle = [
10791102
depTheme: "canvas",
10801103
depType: DEP_TYPE.CONTRAST_TEXT,
10811104
transformer: contrastText,
1082-
}]).filter((style) => ['border', 'borderWidth'].includes(style.name) === false),
1105+
}]).filter((style) => ['border', 'borderWidth','textTransform','textDecoration'].includes(style.name) === false),
10831106
TRACK,
10841107
FILL,
10851108
SUCCESS,

client/packages/lowcoder/src/i18n/locales/de.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,8 @@ export const de = {
325325
"selectedRowBackground": "Ausgewählter Zeilenhintergrund",
326326
"hoverRowBackground": "Hover Row Hintergrund",
327327
"hoverBackground":"Hover-Hintergrund",
328+
"textTransform":"Texttransformation",
329+
"textDecoration":"Textdekoration",
328330
"alternateRowBackground": "Alternativer Reihenhintergrund",
329331
"tableHeaderBackground": "Kopfzeile Hintergrund",
330332
"tableHeaderText": "Überschrift Text",

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ export const en = {
340340
"selectedRowBackground": "Selected Row Background",
341341
"hoverRowBackground": "Hover Row Background",
342342
"hoverBackground":"Hover Background",
343+
"textTransform":"Text Transform",
344+
"textDecoration":"Text Decoration",
343345
"alternateRowBackground": "Alternate Row Background",
344346
"tableHeaderBackground": "Header Background",
345347
"tableHeaderText": "Header Text",

client/packages/lowcoder/src/i18n/locales/zh.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ style: {
331331
selectedRowBackground: "选中行背景",
332332
hoverRowBackground: "悬停行背景",
333333
hoverBackground:"悬停背景",
334+
textTransform:"文本变换",
335+
textDecoration:"文字装饰",
334336
alternateRowBackground: "交替行背景",
335337
tableHeaderBackground: "表头背景",
336338
tableHeaderText: "表头文本",

0 commit comments

Comments
 (0)