From c0efe11ac55e9df1b5b7f37c246ae8448a7a20a7 Mon Sep 17 00:00:00 2001 From: mou <10402885@qq.com> Date: Tue, 18 Jul 2023 21:41:01 +0800 Subject: [PATCH] =?UTF-8?q?fix&optimize:=201.move=20svg=20to=20folder=20lo?= =?UTF-8?q?wcoder-design=202.All=20options=20support=20multiple=20language?= =?UTF-8?q?s=203.add=20attribute=20keepLastFrame=EF=BC=8CPrevent=20compone?= =?UTF-8?q?nts=20from=20becoming=20blank=204.change=20backgroundcolor=20fo?= =?UTF-8?q?llow=20the=20canvas=20color=205.delete=20MARGIN=20and=20PADDING?= =?UTF-8?q?=20style?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src}/icons/icon-lottie.svg | 0 .../lowcoder-design/src/icons/index.ts | 5 ++-- .../lowcoder/src/assets/icons/index.ts | 2 -- .../comps/comps/jsonComp/jsonLottieComp.tsx | 27 ++++++++++++++----- .../comps/controls/styleControlConstants.tsx | 7 ++--- client/packages/lowcoder/src/comps/index.tsx | 2 +- .../packages/lowcoder/src/i18n/locales/en.ts | 7 ++++- .../packages/lowcoder/src/i18n/locales/zh.ts | 15 +++++++++++ 8 files changed, 47 insertions(+), 18 deletions(-) rename client/packages/{lowcoder/src/assets => lowcoder-design/src}/icons/icon-lottie.svg (100%) diff --git a/client/packages/lowcoder/src/assets/icons/icon-lottie.svg b/client/packages/lowcoder-design/src/icons/icon-lottie.svg similarity index 100% rename from client/packages/lowcoder/src/assets/icons/icon-lottie.svg rename to client/packages/lowcoder-design/src/icons/icon-lottie.svg diff --git a/client/packages/lowcoder-design/src/icons/index.ts b/client/packages/lowcoder-design/src/icons/index.ts index 4d7591df3..a84c01278 100644 --- a/client/packages/lowcoder-design/src/icons/index.ts +++ b/client/packages/lowcoder-design/src/icons/index.ts @@ -285,5 +285,6 @@ export { ReactComponent as TableCheckedIcon } from "icons/icon-table-checked.svg export { ReactComponent as TableUnCheckedIcon } from "icons/icon-table-boolean-false.svg"; export { ReactComponent as FileFolderIcon } from "icons/icon-editor-folder.svg"; export { ReactComponent as ExpandIcon } from "icons/icon-expand.svg"; -export { ReactComponent as CompressIcon } from "icons/icon-compress.svg" -export { ReactComponent as TableCellsIcon } from "icons/icon-table-cells.svg" // Added By Aqib Mirza +export { ReactComponent as CompressIcon } from "icons/icon-compress.svg"; +export { ReactComponent as TableCellsIcon } from "icons/icon-table-cells.svg"; // Added By Aqib Mirza +export { ReactComponent as LottieIcon } from "icons/icon-lottie.svg"; \ No newline at end of file diff --git a/client/packages/lowcoder/src/assets/icons/index.ts b/client/packages/lowcoder/src/assets/icons/index.ts index df7c3d2bb..409292ab7 100644 --- a/client/packages/lowcoder/src/assets/icons/index.ts +++ b/client/packages/lowcoder/src/assets/icons/index.ts @@ -10,6 +10,4 @@ export { ReactComponent as DocIcon } from "./view-doc.svg"; export { ReactComponent as TutorialIcon } from "./tutorial.svg"; export { ReactComponent as ShortcutIcon } from "./icon-help-shortcut.svg"; -export { ReactComponent as LottieIcon } from "./icon-lottie.svg"; //Added By Aqib Mirza - export { GoogleLoginIcon, GithubLoginIcon, GeneralLoginIcon, EmailLoginIcon }; diff --git a/client/packages/lowcoder/src/comps/comps/jsonComp/jsonLottieComp.tsx b/client/packages/lowcoder/src/comps/comps/jsonComp/jsonLottieComp.tsx index 7e03d89ba..1eb4da69a 100644 --- a/client/packages/lowcoder/src/comps/comps/jsonComp/jsonLottieComp.tsx +++ b/client/packages/lowcoder/src/comps/comps/jsonComp/jsonLottieComp.tsx @@ -5,6 +5,7 @@ import { NumberControl, } from "comps/controls/codeControl"; import { dropdownControl } from "comps/controls/dropdownControl"; +import { BoolControl } from "comps/controls/boolControl"; import { styleControl } from "comps/controls/styleControl"; import { LottieStyle } from "comps/controls/styleControlConstants"; import { trans } from "i18n"; @@ -22,27 +23,35 @@ import { defaultLottie } from "./jsonConstants"; */ const animationStartOptions = [ { - label: "Auto", + label: trans("jsonLottie.auto"), value: "auto", }, { - label: "On Hover", + label: trans("jsonLottie.onHover"), value: "on hover", }, ] as const; const loopOptions = [ { - label: "Single play", + label: trans("jsonLottie.singlePlay"), value: "single", }, { - label: "Endless loop", + label: trans("jsonLottie.endlessLoop"), value: "endless", }, ] as const; const speedOptions = [ + { + label: "0.5x", + value: "0.5", + }, + { + label: "0.75x", + value: "0.75", + }, { label: "1x", value: "1", @@ -81,8 +90,8 @@ let JsonLottieTmpComp = (function () { backgroundColor: styleControl(LottieStyle), animationStart: dropdownControl(animationStartOptions, "auto"), loop: dropdownControl(loopOptions, "single"), + keepLastFrame: BoolControl.DEFAULT_TRUE, }; - return new UICompBuilder(childrenMap, (props) => { return (