remove runtime

This commit is contained in:
hufeixiong
2021-07-13 15:15:19 +08:00
parent a687b1b42c
commit 4367633ec2
19 changed files with 158 additions and 111 deletions

View File

@@ -159,7 +159,7 @@ function Blocks(props: PropsWithChildren<BlockProps>) {
{props.data.position === 'static' && props.data.display === 'inline' && (
<span style={{ pointerEvents: 'none' }}>{state}</span>
)}
<BlockResizer data={props.data} rect={ref}></BlockResizer>
<BlockResizer data={props.data} config={props.config} rect={ref}></BlockResizer>
</div>
);
} else {

View File

@@ -92,14 +92,9 @@ function Container(props: PropsWithChildren<ContainerProps>) {
>
<IconFont
type="icon-suofang"
onMouseDown={containerResizer.onMousedown}
onMouseDown={(e) => containerResizer.onMousedown(e, props.config)}
style={{ fontSize: '20px', cursor: 's-resize' }}
></IconFont>
{/* <BoxPlotFilled
onMouseDown={containerResizer.onMousedown}
style={{ fontSize: '20px', cursor: 's-resize' }}
rotate={90}
/> */}
</div>
</div>
</>

View File

@@ -2,7 +2,7 @@
* @Author: yehuozhili
* @Date: 2021-02-21 22:17:29
* @LastEditors: yehuozhili
* @LastEditTime: 2021-07-12 20:33:14
* @LastEditTime: 2021-07-13 14:29:36
* @FilePath: \dooringx\packages\dooringx-lib\src\components\wrapperMove\event.ts
*/
import { RefObject } from 'react';
@@ -58,14 +58,14 @@ export const wrapperEvent = (ref: RefObject<HTMLDivElement>, config: UserConfig)
store.forceUpdate();
}
containerResizer.onMouseMove(e);
containerResizer.onMouseMove(e, config);
},
};
};
export const wrapperMoveMouseUp = () => {
export const wrapperMoveMouseUp = (config: UserConfig) => {
if (wrapperMoveState.ref && wrapperMoveState.ref.current) {
wrapperMoveState.ref.current.style.cursor = 'default';
}
containerResizer.onMouseUp();
containerResizer.onMouseUp(config);
wrapperMoveState.isDrag = false;
};

View File

@@ -2,7 +2,7 @@
* @Author: yehuozhili
* @Date: 2021-03-14 04:29:09
* @LastEditors: yehuozhili
* @LastEditTime: 2021-07-13 10:49:33
* @LastEditTime: 2021-07-13 14:34:00
* @FilePath: \dooringx\packages\dooringx-lib\src\components\wrapperMove\index.tsx
*/
import { AllHTMLAttributes, CSSProperties, PropsWithChildren, useRef } from 'react';
@@ -19,7 +19,7 @@ export interface ContainerWrapperProps extends AllHTMLAttributes<HTMLDivElement>
}
function ContainerWrapper(props: PropsWithChildren<ContainerWrapperProps>) {
const { children, style, classNames, ...rest } = props;
const { children, style, classNames, config, ...rest } = props;
const ref = useRef<HTMLDivElement>(null);
const ticker = props.config.ticker;
return (