File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
lowcoder-design/src/components Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ type LoadingProps = {
7474 size ?: number ; // circle's size
7575 className ?: string ;
7676 style ?: CSSProperties ;
77+ compHeight ?: number ;
7778} ;
7879
7980export const Loading = ( props : LoadingProps ) => {
@@ -92,7 +93,11 @@ export const Loading = (props: LoadingProps) => {
9293 <Load2 {...loadingProps} />
9394 </Container>
9495 </ContainerX> */ }
95- < StyledSkeleton active style = { { height : '100%' , animationDuration : '2s' } } />
96+ < StyledSkeleton
97+ active
98+ paragraph = { { rows : props . compHeight ? Math . floor ( ( props . compHeight * 8 ) / 35 ) : 4 } }
99+ style = { { height : '100%' , animationDuration : '2s' } }
100+ />
96101 </ LoadingWrapper >
97102 ) ;
98103} ;
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ const TmpComp = withTypeAndChildren<
5555 undefined ,
5656 undefined ,
5757 manifest . withoutLoading ,
58+ manifest . layoutInfo ?. h ,
5859 )
5960 }
6061 const comp = manifest . withoutLoading ? manifest . comp : withIsLoading ( manifest . comp ! ) ;
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ interface LazyCompViewProps {
4949 loadComp : ( ) => Promise < void > ;
5050 loadingElement ?: ( ) => React . ReactNode ;
5151 errorElement ?: ( error : any ) => React . ReactNode ;
52+ height ?: number ,
5253}
5354
5455const LazyCompView = React . memo ( ( props : React . PropsWithChildren < LazyCompViewProps > ) => {
@@ -82,7 +83,7 @@ const LazyCompView = React.memo((props: React.PropsWithChildren<LazyCompViewProp
8283 }
8384
8485 return (
85- < WhiteLoading />
86+ < WhiteLoading compHeight = { props . height } />
8687 ) ;
8788} ) ;
8889
@@ -94,6 +95,7 @@ export function lazyLoadComp(
9495 loader ?: LazyloadCompLoader ,
9596 loadingElement ?: ( ) => React . ReactNode ,
9697 withoutLoading ?: boolean ,
98+ height ?: number ,
9799) {
98100 class LazyLoadComp extends simpleMultiComp ( { } ) {
99101 compValue : any ;
@@ -145,7 +147,12 @@ export function lazyLoadComp(
145147 // const key = `${remoteInfo?.packageName}-${remoteInfo?.packageVersion}-${remoteInfo?.compName}`;
146148 const key = `${ compName } ` ;
147149 return (
148- < LazyCompView key = { key } loadComp = { ( ) => this . load ( ) } loadingElement = { loadingElement } />
150+ < LazyCompView
151+ key = { key }
152+ loadComp = { ( ) => this . load ( ) }
153+ loadingElement = { loadingElement }
154+ height = { height }
155+ />
149156 ) ;
150157 }
151158
You can’t perform that action at this time.
0 commit comments