Skip to content

Commit 0a8842a

Browse files
Merge pull request #919 from MenamAfzal/fix/component-wrapper-on-rotation
Fix/component wrapper on rotation
2 parents 19defb6 + f1ef6f5 commit 0a8842a

File tree

13 files changed

+104
-34
lines changed

13 files changed

+104
-34
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ const InputStyle = styled(Input)<{ $style: InputLikeStyleType }>`
6363
${getStyle(props.$style)}
6464
input {
6565
padding: ${props.style?.padding};
66-
rotate: ${props?.$style?.rotation};
6766
}
6867
.ant-select-single {
6968
width: 100% !important;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { formDataChildren, FormDataPropertyView } from "./formComp/formDataConst
1111
import { PositionControl } from "comps/controls/dropdownControl";
1212
import { useRef, useState } from "react";
1313
import ReactResizeDetector from "react-resize-detector";
14-
import { ArrayStringControl } from "comps/controls/codeControl";
14+
import { ArrayStringControl, StringControl } from "comps/controls/codeControl";
1515
import { styleControl } from "comps/controls/styleControl";
1616
import { AnimationStyle, AnimationStyleType, CarouselStyle } from "comps/controls/styleControlConstants";
1717

@@ -47,7 +47,7 @@ let CarouselBasicComp = (function () {
4747
dotPosition: withDefault(PositionControl, "bottom"),
4848
style: styleControl(CarouselStyle),
4949
animationStyle: styleControl(AnimationStyle),
50-
50+
restrictPaddingOnRotation:withDefault(StringControl, 'imageCarousel'),
5151
...formDataChildren,
5252
};
5353
return new UICompBuilder(childrenMap, (props) => {

client/packages/lowcoder/src/comps/comps/containerComp/cardComp.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ const Wrapper = styled.div<{
7878
border-style: ${props => props.$style?.borderStyle};
7979
border-radius: ${props => props.$style?.radius};
8080
border-width: ${props => props.$style?.borderWidth};
81+
box-shadow: ${props=>`${props.$style?.boxShadow} ${props.$style?.boxShadowColor}`};
8182
${props=>props.$animationStyle}
8283
}
8384
.ant-card-body {

client/packages/lowcoder/src/comps/comps/containerComp/textContainerComp.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { TriContainer } from "../triContainerComp/triFloatTextContainer";
2020
import { dropdownControl } from "comps/controls/dropdownControl";
2121
import { withDefault } from "comps/generators/simpleGenerators";
2222
import { styleControl } from "comps/controls/styleControl";
23-
import { AnimationStyle, TextStyle } from "comps/controls/styleControlConstants";
23+
import { AnimationStyle, TextContainerStyle } from "comps/controls/styleControlConstants";
2424
import { useContext } from "react";
2525
import { EditorContext } from "comps/editorState";
2626
import { alignWithJustifyControl } from "comps/controls/alignControl";
@@ -62,7 +62,7 @@ export const ContainerBaseComp = (function () {
6262
float: dropdownControl(floatOptions, "left"),
6363
horizontalAlignment: alignWithJustifyControl(),
6464
width: withDefault(StringControl, "40"),
65-
style: styleControl(TextStyle),
65+
style: styleControl(TextContainerStyle),
6666
animationStyle: styleControl(AnimationStyle),
6767
};
6868
return new ContainerCompBuilder(childrenMap, (props, dispatch) => {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { DocumentViewer } from "react-documents";
66
import styled, { css } from "styled-components";
77
import { Section, sectionNames } from "lowcoder-design";
88
import { StringControl } from "../controls/codeControl";
9-
import { UICompBuilder } from "../generators";
9+
import { UICompBuilder, withDefault } from "../generators";
1010
import { NameConfig, NameConfigHidden, withExposingConfigs } from "../generators/withExposing";
1111
import { hiddenPropertyView } from "comps/utils/propertyUtils";
1212
import { trans } from "i18n";
@@ -69,7 +69,8 @@ let FileViewerBasicComp = (function () {
6969
const childrenMap = {
7070
src: StringControl,
7171
style: styleControl(FileViewerStyle),
72-
animationStyle:styleControl(AnimationStyle)
72+
animationStyle: styleControl(AnimationStyle),
73+
restrictPaddingOnRotation: withDefault(StringControl, 'fileViewer'),
7374
};
7475
return new UICompBuilder(childrenMap, (props) => {
7576
if (isEmpty(props.src)) {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import { DEFAULT_IMG_URL } from "util/stringUtils";
3333

3434
import { useContext } from "react";
3535
import { EditorContext } from "comps/editorState";
36+
import { StringControl } from "../controls/codeControl";
3637

3738
const Container = styled.div<{ $style: ImageStyleType | undefined,$animationStyle:AnimationStyleType }>`
3839
height: 100%;
@@ -169,6 +170,7 @@ const childrenMap = {
169170
animationStyle: styleControl(AnimationStyle),
170171
autoHeight: withDefault(AutoHeightControl, "fixed"),
171172
supportPreview: BoolControl,
173+
restrictPaddingOnRotation:withDefault(StringControl, 'image')
172174
};
173175

174176
let ImageBasicComp = new UICompBuilder(childrenMap, (props) => {

client/packages/lowcoder/src/comps/comps/mediaComp/videoComp.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { AnimationStyle, AnimationStyleType, AudioStyle, ImageStyle, ImageStyleT
1010
import { BoolControl } from "comps/controls/boolControl";
1111
import { withDefault } from "../../generators/simpleGenerators";
1212
import { playIcon } from "lowcoder-design";
13-
import { RangeControl } from "../../controls/codeControl";
13+
import { RangeControl, StringControl } from "../../controls/codeControl";
1414
import { hiddenPropertyView } from "comps/utils/propertyUtils";
1515
import { trans } from "i18n";
1616
import { Video } from "lowcoder-design";
@@ -120,6 +120,7 @@ const childrenMap = {
120120
playbackRate: RangeControl.closed(1, 2, 1),
121121
currentTimeStamp: numberExposingStateControl("currentTimeStamp", 0),
122122
duration: numberExposingStateControl("duration"),
123+
restrictPaddingOnRotation:withDefault(StringControl, 'video'),
123124
...mediaCommonChildren,
124125
};
125126

client/packages/lowcoder/src/comps/comps/meetingComp/controlButton.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { useEffect, useRef, useState } from "react";
3939
import ReactResizeDetector from "react-resize-detector";
4040

4141
import { useContext } from "react";
42+
import { BoolControl } from "@lowcoder-ee/index.sdk";
4243

4344
const Container = styled.div<{ $style: any }>`
4445
height: 100%;
@@ -186,6 +187,7 @@ const childrenMap = {
186187
prefixIcon: IconControl,
187188
style: ButtonStyleControl,
188189
viewRef: RefControl<HTMLElement>,
190+
restrictPaddingOnRotation:withDefault(StringControl, 'controlButton')
189191
};
190192

191193
let ButtonTmpComp = (function () {

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { StringControl } from "comps/controls/codeControl";
1414

1515
import { useContext } from "react";
1616
import { EditorContext } from "comps/editorState";
17+
import { withDefault } from "../generators";
1718

1819
// TODO: add styling for image (size)
1920
// TODO: add styling for bouding box (individual backround)
@@ -26,12 +27,13 @@ const levelOptions = [
2627
] as const;
2728

2829
const childrenMap = {
29-
value: stringExposingStateControl("value"),
30-
level: dropdownControl(levelOptions, "L"),
30+
value: stringExposingStateControl('value'),
31+
level: dropdownControl(levelOptions, 'L'),
3132
includeMargin: BoolControl.DEFAULT_TRUE,
3233
image: StringControl,
3334
style: styleControl(QRCodeStyle),
3435
animationStyle: styleControl(AnimationStyle),
36+
restrictPaddingOnRotation: withDefault(StringControl, 'qrCode'),
3537
};
3638

3739
const QRCodeView = (props: RecordConstructorToView<typeof childrenMap>) => {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const childrenMap = {
9191
autoHeight: AutoHeightControl,
9292
rowBreak: withDefault(BoolControl, false),
9393
matchColumnsHeight: withDefault(BoolControl, true),
94-
rowStyle: withDefault(styleControl(ResponsiveLayoutRowStyle), {}),
94+
style: withDefault(styleControl(ResponsiveLayoutRowStyle), {}),
9595
columnStyle: withDefault(styleControl(ResponsiveLayoutColStyle), {}),
9696
animationStyle:styleControl(AnimationStyle),
9797
columnPerRowLG: withDefault(NumberControl, 4),
@@ -127,7 +127,7 @@ const ResponsiveLayout = (props: ResponsiveLayoutProps) => {
127127
dispatch,
128128
rowBreak,
129129
matchColumnsHeight,
130-
rowStyle,
130+
style,
131131
columnStyle,
132132
columnPerRowLG,
133133
columnPerRowMD,
@@ -138,11 +138,11 @@ const ResponsiveLayout = (props: ResponsiveLayoutProps) => {
138138
} = props;
139139

140140
return (
141-
<BackgroundColorContext.Provider value={props.rowStyle.background}>
141+
<BackgroundColorContext.Provider value={props.style.background}>
142142
<DisabledContext.Provider value={props.disabled}>
143-
<div style={{padding: rowStyle.margin, height: '100%'}}>
143+
<div style={{padding: style.margin, height: '100%'}}>
144144
<RowWrapper
145-
$style={rowStyle}
145+
$style={style}
146146
$animationStyle={animationStyle}
147147
wrap={rowBreak}
148148
gutter={[horizontalSpacing, verticalSpacing]}
@@ -247,7 +247,7 @@ export const ResponsiveLayoutBaseComp = (function () {
247247
})}
248248
</Section>
249249
<Section name={trans("responsiveLayout.rowStyle")}>
250-
{children.rowStyle.getPropertyView()}
250+
{children.style.getPropertyView()}
251251
</Section>
252252
<Section name={trans("responsiveLayout.columnStyle")}>
253253
{children.columnStyle.getPropertyView()}

0 commit comments

Comments
 (0)