update 0.7.4
This commit is contained in:
@@ -1,6 +1,11 @@
|
|||||||
## changelog
|
## changelog
|
||||||
|
|
||||||
|
|
||||||
|
## 0.7.4
|
||||||
|
|
||||||
|
修复框选移动bug。
|
||||||
|
|
||||||
|
|
||||||
## 0.7.3
|
## 0.7.3
|
||||||
|
|
||||||
修复弹窗位置与选中问题。
|
修复弹窗位置与选中问题。
|
||||||
|
@@ -2,10 +2,14 @@
|
|||||||
title: CHANGELOG
|
title: CHANGELOG
|
||||||
order: 1
|
order: 1
|
||||||
---
|
---
|
||||||
|
|
||||||
## changelog
|
## changelog
|
||||||
|
|
||||||
|
|
||||||
|
## 0.7.4
|
||||||
|
|
||||||
|
修复框选移动bug。
|
||||||
|
|
||||||
|
|
||||||
## 0.7.3
|
## 0.7.3
|
||||||
|
|
||||||
修复弹窗位置与选中问题。
|
修复弹窗位置与选中问题。
|
||||||
|
@@ -1,11 +1,51 @@
|
|||||||
<!--
|
<div align=center >
|
||||||
* @Author: yehuozhili
|
<img src="https://img-blog.csdnimg.cn/img_convert/520863a38a93d960862f92c805bc97cc.png#pic_center"/>
|
||||||
* @Date: 2021-01-31 20:44:16
|
</div>
|
||||||
* @LastEditors: yehuozhili
|
|
||||||
* @LastEditTime: 2021-07-28 14:30:45
|
|
||||||
* @FilePath: \dooringx\packages\dooringx-lib\README.md
|
|
||||||
-->
|
|
||||||
|
|
||||||
## Dooringx-lib
|
|
||||||
|
|
||||||
lib主包
|
|
||||||
|
dooringx-lib 是 dooringx 的基座,是移除了 dooringx 插件的可视化拖拽框架。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
dooringx-lib 提供自己的一套数据流事件机制以及弹窗等解决方案,可以让你更快地自己定制开发可视化拖拽平台。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<img src="https://yehuozhili-1259443377.cos.ap-nanjing.myqcloud.com/xxa.jpg"/>
|
||||||
|
|
||||||
|
<img src="https://yehuozhili-1259443377.cos.ap-nanjing.myqcloud.com/xxb.jpg"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
dooringx-lib 在运行时维护一套数据流,主要分为json数据部分,左侧组件部分,右侧配置项部分,快捷键部分,弹窗部分,事件与函数部分,数据源部分。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
其除了提供基础的拖拽、移动、缩放、全选、旋转等功能外,还可以使用暴露的组件。如果觉得组件不够定制化,可以调整样式或者自己重新写。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### 安装
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
使用 npm 或者 yarn 安装
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
npm i dooringx-lib
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### 文档
|
||||||
|
|
||||||
|
详情见文档 https://h5-dooring.github.io/dooringx/
|
||||||
|
|
||||||
|
|
||||||
|
### 问题
|
||||||
|
|
||||||
|
有问题提issue或联系qq:673632758
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "0.7.3",
|
"version": "0.7.4",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"module": "dist/dooringx-lib.esm.js",
|
"module": "dist/dooringx-lib.esm.js",
|
||||||
|
@@ -50,8 +50,8 @@ export const innerDrag = function (
|
|||||||
innerDragState.startX = Math.round(e.clientX);
|
innerDragState.startX = Math.round(e.clientX);
|
||||||
innerDragState.startY = Math.round(e.clientY);
|
innerDragState.startY = Math.round(e.clientY);
|
||||||
innerDragState.item = item;
|
innerDragState.item = item;
|
||||||
innerDragState.itemX = item.left;
|
// innerDragState.itemX = item.left; 会导致框选后移动问题
|
||||||
innerDragState.itemY = item.top;
|
// innerDragState.itemY = item.top;
|
||||||
innerDragState.isDrag = true;
|
innerDragState.isDrag = true;
|
||||||
innerDragState.ref = ref;
|
innerDragState.ref = ref;
|
||||||
innerDragState.current = store.getIndex();
|
innerDragState.current = store.getIndex();
|
||||||
@@ -87,21 +87,23 @@ export const innerContainerDrag = function (config: UserConfig) {
|
|||||||
lastblock = innerDragState.item;
|
lastblock = innerDragState.item;
|
||||||
newblock = cloneblock.map((v) => {
|
newblock = cloneblock.map((v) => {
|
||||||
if (v.focus && v.position !== 'static') {
|
if (v.focus && v.position !== 'static') {
|
||||||
v.left = Math.round(innerDragState.itemX + durX);
|
v.left = Math.round(v.left + durX);
|
||||||
v.top = Math.round(innerDragState.itemY + durY);
|
v.top = Math.round(v.top + durY);
|
||||||
}
|
}
|
||||||
return v;
|
return v;
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
newblock = store.getData().block.map((v) => {
|
newblock = store.getData().block.map((v) => {
|
||||||
if (v.focus && v.position !== 'static') {
|
if (v.focus && v.position !== 'static') {
|
||||||
v.left = Math.round(innerDragState.itemX + durX);
|
v.left = Math.round(v.left + durX);
|
||||||
v.top = Math.round(innerDragState.itemY + durY);
|
v.top = Math.round(v.top + durY);
|
||||||
}
|
}
|
||||||
return v;
|
return v;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
store.setData({ ...store.getData(), block: newblock });
|
store.setData({ ...store.getData(), block: newblock });
|
||||||
|
innerDragState.startX = moveX;
|
||||||
|
innerDragState.startY = moveY;
|
||||||
}
|
}
|
||||||
resizerMouseMove(e, config);
|
resizerMouseMove(e, config);
|
||||||
rotateMouseMove(e, config);
|
rotateMouseMove(e, config);
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* @Author: yehuozhili
|
* @Author: yehuozhili
|
||||||
* @Date: 2021-03-14 12:09:11
|
* @Date: 2021-03-14 12:09:11
|
||||||
* @LastEditors: yehuozhili
|
* @LastEditors: yehuozhili
|
||||||
* @LastEditTime: 2021-07-27 11:40:39
|
* @LastEditTime: 2021-07-29 10:48:29
|
||||||
* @FilePath: \dooringx\packages\dooringx-lib\src\core\innerDrag\state.ts
|
* @FilePath: \dooringx\packages\dooringx-lib\src\core\innerDrag\state.ts
|
||||||
*/
|
*/
|
||||||
import { RefObject } from 'react';
|
import { RefObject } from 'react';
|
||||||
@@ -17,8 +17,8 @@ export interface innerDragStateType {
|
|||||||
ref: RefObject<HTMLDivElement> | null;
|
ref: RefObject<HTMLDivElement> | null;
|
||||||
current: number;
|
current: number;
|
||||||
lastClick: null | IBlockType;
|
lastClick: null | IBlockType;
|
||||||
itemX: number;
|
// itemX: number;
|
||||||
itemY: number;
|
// itemY: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const innerDragState: innerDragStateType = {
|
export const innerDragState: innerDragStateType = {
|
||||||
@@ -29,6 +29,6 @@ export const innerDragState: innerDragStateType = {
|
|||||||
ref: null,
|
ref: null,
|
||||||
current: 0,
|
current: 0,
|
||||||
lastClick: null,
|
lastClick: null,
|
||||||
itemX: 0,
|
// itemX: 0,
|
||||||
itemY: 0,
|
// itemY: 0,
|
||||||
};
|
};
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
* @Author: yehuozhili
|
* @Author: yehuozhili
|
||||||
* @Date: 2021-07-04 10:28:57
|
* @Date: 2021-07-04 10:28:57
|
||||||
* @LastEditors: yehuozhili
|
* @LastEditors: yehuozhili
|
||||||
* @LastEditTime: 2021-07-09 00:07:26
|
* @LastEditTime: 2021-07-29 10:59:24
|
||||||
* @FilePath: \dooringx\script\publish.js
|
* @FilePath: \dooringx\script\publish.js
|
||||||
*/
|
*/
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
@@ -10,6 +10,11 @@ const path = require('path');
|
|||||||
const spawn = require('child_process').spawn;
|
const spawn = require('child_process').spawn;
|
||||||
const root = process.cwd();
|
const root = process.cwd();
|
||||||
const rootPath = path.resolve(root, 'packages', 'dooringx-lib');
|
const rootPath = path.resolve(root, 'packages', 'dooringx-lib');
|
||||||
|
const readme = path.resolve(root, 'README.md');
|
||||||
|
const libreadme = path.resolve(root, 'packages', 'dooringx-lib', 'README.md');
|
||||||
|
fs.removeSync(libreadme);
|
||||||
|
fs.copyFileSync(readme, libreadme);
|
||||||
|
|
||||||
const command = `npm`;
|
const command = `npm`;
|
||||||
const args = [`publish`];
|
const args = [`publish`];
|
||||||
const child = spawn(command, args, {
|
const child = spawn(command, args, {
|
||||||
|
Reference in New Issue
Block a user