Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcf11e80

Browse files
added autoHeight and aspectRatio options in json lottie
1 parentba10433 commitcf11e80

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

‎client/packages/lowcoder/src/comps/comps/jsonComp/jsonLottieComp.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { hiddenPropertyView, showDataLoadingIndicatorsPropertyView } from "comps
22
import{
33
ArrayOrJSONObjectControl,
44
NumberControl,
5+
StringControl,
56
}from"comps/controls/codeControl";
67
import{dropdownControl}from"comps/controls/dropdownControl";
78
import{BoolControl}from"comps/controls/boolControl";
@@ -20,6 +21,7 @@ import { defaultLottie } from "./jsonConstants";
2021
import{EditorContext}from"comps/editorState";
2122
import{AssetType,IconscoutControl}from"@lowcoder-ee/comps/controls/iconscoutControl";
2223
import{DotLottie}from"@lottiefiles/dotlottie-react";
24+
import{AutoHeightControl}from"@lowcoder-ee/comps/controls/autoHeightControl";
2325

2426
// const Player = lazy(
2527
// () => import('@lottiefiles/react-lottie-player')
@@ -112,6 +114,8 @@ let JsonLottieTmpComp = (function () {
112114
animationStart:dropdownControl(animationStartOptions,"auto"),
113115
loop:dropdownControl(loopOptions,"single"),
114116
keepLastFrame:BoolControl.DEFAULT_TRUE,
117+
autoHeight:withDefault(AutoHeightControl,"fixed"),
118+
aspectRatio:withDefault(StringControl,"16 / 9"),
115119
};
116120
returnnewUICompBuilder(childrenMap,(props,dispatch)=>{
117121
const[dotLottie,setDotLottie]=useState<DotLottie|null>(null);
@@ -151,6 +155,7 @@ let JsonLottieTmpComp = (function () {
151155
background:`${props.container.background}`,
152156
padding:`${props.container.padding}`,
153157
rotate:props.container.rotation,
158+
aspectRatio:props.aspectRatio,
154159
}}
155160
>
156161
<DotLottiePlayer
@@ -171,6 +176,9 @@ let JsonLottieTmpComp = (function () {
171176
}}
172177
onMouseEnter={()=>props.animationStart==="hover"&&dotLottie?.play()}
173178
onMouseLeave={()=>props.animationStart==="hover"&&dotLottie?.pause()}
179+
renderConfig={{
180+
autoResize:props.autoHeight,
181+
}}
174182
/>
175183
</div>
176184
</div>
@@ -204,6 +212,15 @@ let JsonLottieTmpComp = (function () {
204212
</>
205213
)}
206214

215+
{["layout","both"].includes(useContext(EditorContext).editorModeStatus)&&(
216+
<Sectionname={sectionNames.layout}>
217+
{children.autoHeight.getPropertyView()}
218+
{children.aspectRatio.propertyView({
219+
label:trans("style.aspectRatio"),
220+
})}
221+
</Section>
222+
)}
223+
207224
{(useContext(EditorContext).editorModeStatus==="layout"||useContext(EditorContext).editorModeStatus==="both")&&(
208225
<>
209226
<Sectionname={sectionNames.style}>
@@ -221,7 +238,7 @@ let JsonLottieTmpComp = (function () {
221238
})();
222239
JsonLottieTmpComp=classextendsJsonLottieTmpComp{
223240
overrideautoHeight():boolean{
224-
returnfalse;
241+
returnthis.children.autoHeight.getView();
225242
}
226243
};
227244
exportconstJsonLottieComp=withExposingConfigs(JsonLottieTmpComp,[

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp