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 = {
74
74
size ?: number ; // circle's size
75
75
className ?: string ;
76
76
style ?: CSSProperties ;
77
+ compHeight ?: number ;
77
78
} ;
78
79
79
80
export const Loading = ( props : LoadingProps ) => {
@@ -92,7 +93,11 @@ export const Loading = (props: LoadingProps) => {
92
93
<Load2 {...loadingProps} />
93
94
</Container>
94
95
</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
+ />
96
101
</ LoadingWrapper >
97
102
) ;
98
103
} ;
Original file line number Diff line number Diff line change @@ -55,6 +55,7 @@ const TmpComp = withTypeAndChildren<
55
55
undefined ,
56
56
undefined ,
57
57
manifest . withoutLoading ,
58
+ manifest . layoutInfo ?. h ,
58
59
)
59
60
}
60
61
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 {
49
49
loadComp : ( ) => Promise < void > ;
50
50
loadingElement ?: ( ) => React . ReactNode ;
51
51
errorElement ?: ( error : any ) => React . ReactNode ;
52
+ height ?: number ,
52
53
}
53
54
54
55
const LazyCompView = React . memo ( ( props : React . PropsWithChildren < LazyCompViewProps > ) => {
@@ -82,7 +83,7 @@ const LazyCompView = React.memo((props: React.PropsWithChildren<LazyCompViewProp
82
83
}
83
84
84
85
return (
85
- < WhiteLoading />
86
+ < WhiteLoading compHeight = { props . height } />
86
87
) ;
87
88
} ) ;
88
89
@@ -94,6 +95,7 @@ export function lazyLoadComp(
94
95
loader ?: LazyloadCompLoader ,
95
96
loadingElement ?: ( ) => React . ReactNode ,
96
97
withoutLoading ?: boolean ,
98
+ height ?: number ,
97
99
) {
98
100
class LazyLoadComp extends simpleMultiComp ( { } ) {
99
101
compValue : any ;
@@ -145,7 +147,12 @@ export function lazyLoadComp(
145
147
// const key = `${remoteInfo?.packageName}-${remoteInfo?.packageVersion}-${remoteInfo?.compName}`;
146
148
const key = `${ compName } ` ;
147
149
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
+ />
149
156
) ;
150
157
}
151
158
You can’t perform that action at this time.
0 commit comments