@@ -251,9 +251,11 @@ function UIView(props: {
251251 const restrictPaddingOnRotation = defaultChildren . hasOwnProperty ( 'restrictPaddingOnRotation' ) ;
252252 let rotationVal = null
253253 let boxShadowVal = null ;
254+ let restrictPaddingOnRotationVal = null ;
254255 if ( isNotContainer ) {
255256 rotationVal = defaultChildren . style . children ?. rotation ?. valueAndMsg . value ;
256257 boxShadowVal = defaultChildren . style ?. children ?. boxShadow ?. valueAndMsg ?. value ;
258+ restrictPaddingOnRotationVal = defaultChildren ?. restrictPaddingOnRotation ?. valueAndMsg ?. value ;
257259 }
258260 return (
259261 < div
@@ -264,17 +266,41 @@ function UIView(props: {
264266 width : '100%' ,
265267 height : '100%' ,
266268 margin : '0px' ,
267- padding : (
268- ( rotationVal === null || rotationVal === undefined || restrictPaddingOnRotation ) &&
269- ( boxShadowVal === null || boxShadowVal === undefined || boxShadowVal === '0px' )
270- ) ? '0px' // Both rotation and box-shadow are empty or restricted
271- : rotationVal !== '' && rotationVal !== '0deg' // Rotation applied
272- ? ( 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
273- ? `calc(min(50%, ${ Math . abs ( rotationVal . replace ( 'deg' , '' ) + parseFloat ( boxShadowVal . replace ( 'px' , '' ) ) ) / 90 } * 100%)) 0px`
274- : `calc(min(50%, ${ Math . abs ( rotationVal . replace ( 'deg' , '' ) ) / 90 } * 100%)) 0px` // Only rotation applied
275- : ( boxShadowVal === null || boxShadowVal === undefined || boxShadowVal === '0px' ) ?'0px' :( boxShadowVal !== '' && boxShadowVal !== '0px' ) // Box-shadow applied
276- ? `calc(min(50%, ${ Math . abs ( parseFloat ( boxShadowVal . replace ( 'px' , '' ) ) ) / 90 } * 100%)) 0px`
277- : '0px' // Default value if neither rotation nor box-shadow is applied
269+ padding :
270+ ( rotationVal === null ||
271+ rotationVal === undefined ||
272+ restrictPaddingOnRotation ) &&
273+ ( boxShadowVal === null ||
274+ boxShadowVal === undefined ||
275+ boxShadowVal === '0px' )
276+ ? restrictPaddingOnRotationVal === 'qrCode'
277+ ? '50% 0px'
278+ : restrictPaddingOnRotationVal === 'image'
279+ ? '10% 0px'
280+ : restrictPaddingOnRotationVal === 'imageCarousel'
281+ ? '35% 0px'
282+ : restrictPaddingOnRotationVal === 'fileViewer'
283+ ? '65% 0px'
284+ : restrictPaddingOnRotationVal === 'controlButton'
285+ ? '50% 0px'
286+ : restrictPaddingOnRotationVal === 'video'
287+ ? '26% 0px'
288+ : '0px' // Both rotation and box-shadow are empty or restricted
289+ : rotationVal !== '' && rotationVal !== '0deg' // Rotation applied
290+ ? boxShadowVal === null ||
291+ boxShadowVal === undefined ||
292+ boxShadowVal === '0px'
293+ ? `calc(min(50%, ${ Math . abs ( rotationVal . replace ( 'deg' , '' ) ) / 90 } * 100%)) 0px`
294+ : boxShadowVal !== '' && boxShadowVal !== '0px' // Both rotation and box-shadow applied
295+ ? `calc(min(50%, ${ Math . abs ( rotationVal . replace ( 'deg' , '' ) + parseFloat ( boxShadowVal . replace ( 'px' , '' ) ) ) / 90 } * 100%)) 0px`
296+ : `calc(min(50%, ${ Math . abs ( rotationVal . replace ( 'deg' , '' ) ) / 90 } * 100%)) 0px` // Only rotation applied
297+ : boxShadowVal === null ||
298+ boxShadowVal === undefined ||
299+ boxShadowVal === '0px'
300+ ? '0px'
301+ : boxShadowVal !== '' && boxShadowVal !== '0px' // Box-shadow applied
302+ ? `calc(min(50%, ${ Math . abs ( parseFloat ( boxShadowVal . replace ( 'px' , '' ) ) ) / 90 } * 100%)) 0px`
303+ : '0px' , // Default value if neither rotation nor box-shadow is applied
278304 } }
279305 >
280306 < HidableView hidden = { childrenProps . hidden as boolean } >
0 commit comments