@@ -2,6 +2,7 @@ import { hiddenPropertyView, showDataLoadingIndicatorsPropertyView } from "comps
2
2
import {
3
3
ArrayOrJSONObjectControl ,
4
4
NumberControl ,
5
+ StringControl ,
5
6
} from "comps/controls/codeControl" ;
6
7
import { dropdownControl } from "comps/controls/dropdownControl" ;
7
8
import { BoolControl } from "comps/controls/boolControl" ;
@@ -20,6 +21,7 @@ import { defaultLottie } from "./jsonConstants";
20
21
import { EditorContext } from "comps/editorState" ;
21
22
import { AssetType , IconscoutControl } from "@lowcoder-ee/comps/controls/iconscoutControl" ;
22
23
import { DotLottie } from "@lottiefiles/dotlottie-react" ;
24
+ import { AutoHeightControl } from "@lowcoder-ee/comps/controls/autoHeightControl" ;
23
25
24
26
// const Player = lazy(
25
27
// () => import('@lottiefiles/react-lottie-player')
@@ -112,6 +114,8 @@ let JsonLottieTmpComp = (function () {
112
114
animationStart : dropdownControl ( animationStartOptions , "auto" ) ,
113
115
loop : dropdownControl ( loopOptions , "single" ) ,
114
116
keepLastFrame : BoolControl . DEFAULT_TRUE ,
117
+ autoHeight : withDefault ( AutoHeightControl , "fixed" ) ,
118
+ aspectRatio : withDefault ( StringControl , "16 / 9" ) ,
115
119
} ;
116
120
return new UICompBuilder ( childrenMap , ( props , dispatch ) => {
117
121
const [ dotLottie , setDotLottie ] = useState < DotLottie | null > ( null ) ;
@@ -151,6 +155,7 @@ let JsonLottieTmpComp = (function () {
151
155
background : `${ props . container . background } ` ,
152
156
padding : `${ props . container . padding } ` ,
153
157
rotate : props . container . rotation ,
158
+ aspectRatio : props . aspectRatio ,
154
159
} }
155
160
>
156
161
< DotLottiePlayer
@@ -171,6 +176,9 @@ let JsonLottieTmpComp = (function () {
171
176
} }
172
177
onMouseEnter = { ( ) => props . animationStart === "hover" && dotLottie ?. play ( ) }
173
178
onMouseLeave = { ( ) => props . animationStart === "hover" && dotLottie ?. pause ( ) }
179
+ renderConfig = { {
180
+ autoResize : props . autoHeight ,
181
+ } }
174
182
/>
175
183
</ div >
176
184
</ div >
@@ -204,6 +212,15 @@ let JsonLottieTmpComp = (function () {
204
212
</ >
205
213
) }
206
214
215
+ { [ "layout" , "both" ] . includes ( useContext ( EditorContext ) . editorModeStatus ) && (
216
+ < Section name = { sectionNames . layout } >
217
+ { children . autoHeight . getPropertyView ( ) }
218
+ { children . aspectRatio . propertyView ( {
219
+ label : trans ( "style.aspectRatio" ) ,
220
+ } ) }
221
+ </ Section >
222
+ ) }
223
+
207
224
{ ( useContext ( EditorContext ) . editorModeStatus === "layout" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
208
225
< >
209
226
< Section name = { sectionNames . style } >
@@ -221,7 +238,7 @@ let JsonLottieTmpComp = (function () {
221
238
} ) ( ) ;
222
239
JsonLottieTmpComp = class extends JsonLottieTmpComp {
223
240
override autoHeight ( ) : boolean {
224
- return false ;
241
+ return this . children . autoHeight . getView ( ) ;
225
242
}
226
243
} ;
227
244
export const JsonLottieComp = withExposingConfigs ( JsonLottieTmpComp , [
0 commit comments