update 0.8.0

This commit is contained in:
hufeixiong
2021-08-09 14:39:49 +08:00
parent d744c9a80f
commit 28992dcff2
7 changed files with 197 additions and 60 deletions

View File

@@ -1,5 +1,5 @@
{
"version": "0.7.7",
"version": "0.8.0",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/dooringx-lib.esm.js",

View File

@@ -95,7 +95,40 @@ function Blocks(props: PropsWithChildren<BlockProps>) {
props.data.fixed,
]);
console.log(props.data.animate);
const animateProps: CSSProperties = useMemo(() => {
const select: CSSProperties = {
animationName: '',
animationDelay: '',
animationDuration: '',
animationIterationCount: '',
animationFillMode: 'forwards',
animationTimingFunction: '',
};
props.data.animate.forEach((v) => {
select.animationName =
select.animationName === ''
? v.animationName
: select.animationName + ',' + v.animationName;
select.animationDelay =
select.animationDelay === ''
? v.animationDelay + 's'
: select.animationDelay + ',' + v.animationDelay + 's';
select.animationDuration =
select.animationDuration === ''
? v.animationDuration + 's'
: select.animationDuration + ',' + v.animationDuration + 's';
select.animationIterationCount =
select.animationIterationCount === ''
? v.animationIterationCount
: select.animationIterationCount + ',' + v.animationIterationCount;
select.animationTimingFunction =
select.animationTimingFunction === ''
? v.animationTimingFunction
: select.animationTimingFunction + ',' + v.animationTimingFunction;
});
return select;
}, [props.data.animate]);
console.log(animateProps);
const render = useMemo(() => {
// 如果是编辑模式下,则需要包裹不能选中层,位移层,缩放控制层,平面移动层。
@@ -126,7 +159,9 @@ function Blocks(props: PropsWithChildren<BlockProps>) {
}}
>
{/* 绝对定位元素 */}
{props.data.position !== 'static' && <div style={{ ...style }}>{state}</div>}
{props.data.position !== 'static' && (
<div style={{ ...style, ...animateProps }}>{state}</div>
)}
{/* 静态定位 非行内 这里暂不考虑布局影响 */}
{props.data.position === 'static' && props.data.display !== 'inline' && (
<div
@@ -134,6 +169,7 @@ function Blocks(props: PropsWithChildren<BlockProps>) {
pointerEvents: 'none',
width: '100%',
height: '100%',
...animateProps,
}}
>
{state}
@@ -141,7 +177,7 @@ function Blocks(props: PropsWithChildren<BlockProps>) {
)}
{/* 静态定位 行内 这里暂不考虑布局影响 */}
{props.data.position === 'static' && props.data.display === 'inline' && (
<span style={{ pointerEvents: 'none' }}>{state}</span>
<span style={{ pointerEvents: 'none', ...animateProps }}>{state}</span>
)}
<BlockResizer data={props.data} config={props.config} rect={ref}></BlockResizer>
<RotateResizer data={props.data} config={props.config} rect={ref}></RotateResizer>
@@ -159,6 +195,7 @@ function Blocks(props: PropsWithChildren<BlockProps>) {
zIndex: props.data.zIndex,
display: props.data.display,
transform: `rotate(${props.data.rotate.value}deg)`,
...animateProps,
}}
>
{state}
@@ -172,6 +209,7 @@ function Blocks(props: PropsWithChildren<BlockProps>) {
props.iframe,
props.config,
innerDragData,
animateProps,
previewState.top,
previewState.left,
previewState.width,

View File

@@ -2,7 +2,7 @@
* @Author: yehuozhili
* @Date: 2021-03-14 05:42:13
* @LastEditors: yehuozhili
* @LastEditTime: 2021-08-03 23:17:54
* @LastEditTime: 2021-08-09 14:37:24
* @FilePath: \dooringx\packages\dooringx-lib\src\components\rightConfig.tsx
*/
import { CreateOptionsRes } from '../core/components/formTypes';
@@ -186,11 +186,10 @@ function RightConfig(props: PropsWithChildren<RightConfigProps>) {
</Col>
<Col span={18}>
<InputNumber
min={667}
min={0}
value={props.config.getStore().getData().container.height}
onChange={(e) => {
const val = e;
console.log(val, 'kkkk');
const isEdit = props.config.getStoreChanger().isEdit();
if (isEdit) {
const originData: IStoreData = deepcopy(

View File

@@ -2,7 +2,7 @@
* @Author: yehuozhili
* @Date: 2021-03-09 15:19:36
* @LastEditors: yehuozhili
* @LastEditTime: 2021-07-27 10:18:34
* @LastEditTime: 2021-08-09 14:37:55
* @FilePath: \dooringx\packages\dooringx-lib\src\core\resizeHandler\containerResizer.ts
*/
@@ -14,7 +14,7 @@ export const containerState = {
isDrag: false,
startY: 0,
startIndex: 0,
minHeight: 667,
minHeight: 0,
};
export const containerResizer = {

View File

@@ -2,7 +2,7 @@
* @Author: yehuozhili
* @Date: 2021-03-14 04:29:09
* @LastEditors: yehuozhili
* @LastEditTime: 2021-08-06 21:27:19
* @LastEditTime: 2021-08-09 11:30:52
* @FilePath: \dooringx\packages\dooringx-lib\src\core\store\storetype.ts
*/
@@ -20,9 +20,10 @@ export interface IStoreData {
modalConfig: Record<string, any>;
}
export interface AnimateItem {
uid: string;
animationName: string;
animationDuration: string;
animationDelay: string;
animationDuration: number;
animationDelay: number;
animationIterationCount: string;
animationTimingFunction: string;
}