- Notifications
You must be signed in to change notification settings - Fork278
Fix/component wrapper on rotation#919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
raheeliftikhar5 merged 22 commits intolowcoder-org:devfromMenamAfzal:fix/component-wrapper-on-rotationJun 1, 2024
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
22 commits Select commitHold shift + click to select a range
38311f7
container padding updated
MenamAfzal7b1215d
Merge branch 'dev' into fix/component-wrapper-on-rotation
MenamAfzal3cedced
rotation improved
MenamAfzald766a34
designed formula to calculate padding dynamically
MenamAfzaala9070fa
childrenMap updated
MenamAfzald4997ee
pull from dev
MenamAfzaalce81b47
rotation edited
MenamAfzal6b75817
Merge branch 'fix/component-wrapper-on-rotation' of https://github.co…
MenamAfzal790d04d
formatting removed
MenamAfzal36d4f06
formatting removed -1
MenamAfzalc8ba492
formatting removed -2
MenamAfzal17ed925
unused variable removed
MenamAfzal0edac5c
rotation fixed
MenamAfzale3f2144
rotation and boxshadow conflict resolved
MenamAfzal1facfbc
condition updated
MenamAfzalc7ed2c3
condition updated
MenamAfzalc984e21
condition updated
MenamAfzalaf215e7
padding on rotation
MenamAfzal380b47e
padding updated
MenamAfzal3d0daee
function created
MenamAfzal15b4b84
types added
MenamAfzalf1ef6f5
padding updated
MenamAfzalFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
1 change: 0 additions & 1 deletionclient/packages/lowcoder/src/comps/comps/autoCompleteComp/autoCompleteComp.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletionsclient/packages/lowcoder/src/comps/comps/carouselComp.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletionsclient/packages/lowcoder/src/comps/comps/containerComp/cardComp.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletionsclient/packages/lowcoder/src/comps/comps/containerComp/textContainerComp.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletionsclient/packages/lowcoder/src/comps/comps/fileViewerComp.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletionsclient/packages/lowcoder/src/comps/comps/imageComp.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletionclient/packages/lowcoder/src/comps/comps/mediaComp/videoComp.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletionsclient/packages/lowcoder/src/comps/comps/meetingComp/controlButton.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletionsclient/packages/lowcoder/src/comps/comps/qrCodeComp.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletionsclient/packages/lowcoder/src/comps/comps/responsiveLayout/responsiveLayout.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 4 additions & 5 deletionsclient/packages/lowcoder/src/comps/comps/triContainerComp/triFloatTextContainer.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletionsclient/packages/lowcoder/src/comps/controls/styleControlConstants.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
70 changes: 57 additions & 13 deletionsclient/packages/lowcoder/src/comps/generators/uiCompBuilder.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -221,14 +221,14 @@ function UIView(props: { | ||
const comp = props.comp; | ||
const childrenProps = childrenToProps(comp.children); | ||
const parentDisabled = useContext(DisabledContext); | ||
const disabled = childrenProps['disabled']; | ||
if (disabled !== undefined && typeof disabled ==='boolean') { | ||
childrenProps['disabled'] = disabled || parentDisabled; | ||
} | ||
//ADDED BY FRED | ||
if (childrenProps.events) { | ||
const events = childrenProps.events as {value?: any[]}; | ||
if (!events.value || events.value.length === 0) { | ||
events.value = []; | ||
} | ||
@@ -246,22 +246,66 @@ function UIView(props: { | ||
); | ||
} | ||
let defaultChildren = comp.children; | ||
const isNotContainer = defaultChildren.hasOwnProperty('style'); | ||
const restrictPaddingOnRotation = defaultChildren.hasOwnProperty('restrictPaddingOnRotation'); | ||
let rotationVal:any = null | ||
let boxShadowVal:any = null; | ||
let restrictPaddingOnRotationVal:any=null; | ||
if (isNotContainer) { | ||
rotationVal = defaultChildren.style.children?.rotation?.valueAndMsg.value; | ||
boxShadowVal = defaultChildren.style?.children?.boxShadow?.valueAndMsg?.value; | ||
restrictPaddingOnRotationVal = defaultChildren?.restrictPaddingOnRotation?.valueAndMsg?.value; | ||
} | ||
const getPadding = () =>(rotationVal === null || | ||
rotationVal === undefined || | ||
restrictPaddingOnRotation) && | ||
(boxShadowVal === null || | ||
boxShadowVal === undefined || | ||
boxShadowVal === '0px') | ||
? restrictPaddingOnRotationVal === 'qrCode' | ||
? rotationVal !== '' && rotationVal !== '0deg'?'35% 0px':'0px' | ||
: restrictPaddingOnRotationVal === 'image' | ||
? rotationVal !== '' && rotationVal !== '0deg'?'10% 0px':'0px' | ||
: restrictPaddingOnRotationVal === 'imageCarousel' | ||
? rotationVal !== '' && rotationVal !== '0deg'?'35% 0px':'0px' | ||
: restrictPaddingOnRotationVal === 'fileViewer' | ||
? rotationVal !== '' && rotationVal !== '0deg'?'65% 0px':'0px' | ||
: restrictPaddingOnRotationVal === 'controlButton' | ||
? rotationVal !== '' && rotationVal !== '0deg'?'10% 0px':'0px' | ||
: restrictPaddingOnRotationVal === 'video' | ||
? rotationVal !== '' && rotationVal !== '0deg'?'26% 0px':'0px' | ||
: '0px' // Both rotation and box-shadow are empty or restricted | ||
: rotationVal !== '' && rotationVal !== '0deg' // Rotation applied | ||
? boxShadowVal === null || | ||
boxShadowVal === undefined || | ||
boxShadowVal === '0px' | ||
? `calc(min(50%, ${Math.abs(rotationVal.replace('deg', '')) / 90} * 100%)) 0px` | ||
: boxShadowVal !== '' && boxShadowVal !== '0px' // Both rotation and box-shadow applied | ||
? `calc(min(50%, ${Math.abs(rotationVal.replace('deg', '') + parseFloat(boxShadowVal.replace('px', ''))) / 90} * 100%)) 0px` | ||
: `calc(min(50%, ${Math.abs(rotationVal.replace('deg', '')) / 90} * 100%)) 0px` // Only rotation applied | ||
: boxShadowVal === null || | ||
boxShadowVal === undefined || | ||
boxShadowVal === '0px' | ||
? '0px' | ||
: boxShadowVal !== '' && boxShadowVal !== '0px' // Box-shadow applied | ||
? `calc(min(50%, ${Math.abs(parseFloat(boxShadowVal.replace('px', ''))) / 90} * 100%)) 0px` | ||
: '0px' // Default value if neither rotation nor box-shadow is applied | ||
raheeliftikhar5 marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
return ( | ||
<div | ||
ref={props.innerRef} | ||
className={childrenProps.className as string} | ||
data-testid={childrenProps.dataTestId as string} | ||
style={{ | ||
width: '100%', | ||
height: '100%', | ||
margin: '0px', | ||
padding:getPadding() | ||
}} | ||
> | ||
<HidableView hidden={childrenProps.hidden as boolean}> | ||
{props.viewFn(childrenProps, comp.dispatch)} | ||
</HidableView> | ||
</div> | ||
); | ||
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.