Skip to content

Commit 0edac5c

Browse files
committed
rotation fixed
1 parent 17ed925 commit 0edac5c

File tree

7 files changed

+15
-6
lines changed

7 files changed

+15
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ let CarouselBasicComp = (function () {
4747
dotPosition: withDefault(PositionControl, "bottom"),
4848
style: styleControl(CarouselStyle),
4949
animationStyle: styleControl(AnimationStyle),
50-
50+
restrictPaddingOnRotation:withDefault(BoolControl, true),
5151
...formDataChildren,
5252
};
5353
return new UICompBuilder(childrenMap, (props) => {

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@ 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";
1313

1414
import { useContext } from "react";
1515
import { EditorContext } from "comps/editorState";
16+
import { BoolControl } from "../controls/boolControl";
1617

1718
const getStyle = (style: FileViewerStyleType) => {
1819
return css`
@@ -69,7 +70,8 @@ let FileViewerBasicComp = (function () {
6970
const childrenMap = {
7071
src: StringControl,
7172
style: styleControl(FileViewerStyle),
72-
animationStyle:styleControl(AnimationStyle)
73+
animationStyle: styleControl(AnimationStyle),
74+
restrictPaddingOnRotation: withDefault(BoolControl, true),
7375
};
7476
return new UICompBuilder(childrenMap, (props) => {
7577
if (isEmpty(props.src)) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ const childrenMap = {
169169
animationStyle: styleControl(AnimationStyle),
170170
autoHeight: withDefault(AutoHeightControl, "fixed"),
171171
supportPreview: BoolControl,
172+
restrictPaddingOnRotation:withDefault(BoolControl, true)
172173
};
173174

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

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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(BoolControl, true),
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(BoolControl, true)
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(BoolControl, true),
3537
};
3638

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

client/packages/lowcoder/src/comps/generators/uiCompBuilder.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ function UIView(props: {
248248

249249
let defaultChildren = comp.children;
250250
const isNotContainer = defaultChildren.hasOwnProperty('style');
251+
const restrictPaddingOnRotation = defaultChildren.hasOwnProperty('restrictPaddingOnRotation');
251252
let rotationVal = null
252253
let boxShadowVal = null;
253254
if (isNotContainer) {
@@ -265,7 +266,7 @@ function UIView(props: {
265266
margin: '0px',
266267
// padding:'0px',
267268
padding: (
268-
rotationVal === null || rotationVal === undefined
269+
rotationVal === null || rotationVal === undefined || restrictPaddingOnRotation
269270
? '0px'
270271
: (
271272
boxShadowVal === null || boxShadowVal === undefined

0 commit comments

Comments
 (0)