update 0.5.0

This commit is contained in:
hufeixiong
2021-07-16 20:30:47 +08:00
parent 601ebbbc43
commit 4808062d79
7 changed files with 36 additions and 25 deletions

View File

@@ -3,6 +3,12 @@ title: CHANGELOG
order: 1
---
## 0.5.0
修复control组件宽度不够问题。
移除antd自定义icon容器底部icon可配置。
## 0.4.2
修复animate错误初始值。

View File

@@ -2,13 +2,19 @@
* @Author: yehuozhili
* @Date: 2021-01-31 20:44:16
* @LastEditors: yehuozhili
* @LastEditTime: 2021-07-13 21:09:41
* @LastEditTime: 2021-07-16 20:28:26
* @FilePath: \dooringx\packages\dooringx-lib\README.md
-->
## Dooringx-lib
## changelog
## 0.5.0
修复control组件宽度不够问题。
移除antd自定义icon容器底部icon可配置。
## 0.4.2
修复animate错误初始值。

View File

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

View File

@@ -11,7 +11,6 @@ import React from 'react';
import UserConfig from '../config';
import styles from '../index.less';
import { getRealHeight } from '../core/transfer';
import { IconFont } from '../core/utils/icon';
interface ContainerProps {
state: IStoreData;
context: 'edit' | 'preview';
@@ -90,11 +89,12 @@ function Container(props: PropsWithChildren<ContainerProps>) {
width: `${props.state.container.width}px`,
}}
>
<IconFont
type="icon-suofang"
onMouseDown={(e) => containerResizer.onMousedown(e, props.config)}
<div
style={{ fontSize: '20px', cursor: 's-resize' }}
></IconFont>
onMouseDown={(e) => containerResizer.onMousedown(e, props.config)}
>
{props.config.getConfig().containerIcon}
</div>
</div>
</div>
</>

View File

@@ -40,7 +40,7 @@ const SortableItem = SortableElement(
{value.config.getComponentRegister().getMap()[value.value.name].display}
</div>
<Divider type="vertical"></Divider>
<div style={{ width: 50, textAlign: 'center' }}>{value.value.id.slice(-6)}</div>
<div style={{ width: 80, textAlign: 'center' }}>{value.value.id.slice(-6)}</div>
<Divider type="vertical"></Divider>
<div style={{ width: 50, textAlign: 'center' }}>{value.value.position}</div>
<Divider type="vertical"></Divider>

View File

@@ -2,9 +2,10 @@
* @Author: yehuozhili
* @Date: 2021-02-25 21:16:58
* @LastEditors: yehuozhili
* @LastEditTime: 2021-07-13 14:57:06
* @LastEditTime: 2021-07-16 20:22:47
* @FilePath: \dooringx\packages\dooringx-lib\src\config\index.tsx
*/
import React from 'react';
import { IBlockType, IStoreData } from '../core/store/storetype';
import { ComponentClass, FunctionComponent, ReactNode } from 'react';
import { ComponentItemFactory } from '../core/components/abstract';
@@ -29,6 +30,7 @@ import { focusState } from '../core/focusHandler/state';
import ComponentRegister from '../core/components';
import { StoreChanger } from '../core/storeChanger';
import Store from '../core/store';
import { VerticalAlignMiddleOutlined } from '@ant-design/icons';
// 组件部分
@@ -145,6 +147,14 @@ export interface InitConfig {
* @memberof InitConfig
*/
initFormComponents: Record<string, FunctionComponent<any> | ComponentClass<any, any>>;
/**
*
* 容器拉伸图标
* @type {ReactNode}
* @memberof InitConfig
*/
containerIcon: ReactNode;
}
export const defaultStore: IStoreData = {
@@ -217,6 +227,7 @@ export const defaultConfig: InitConfig = {
initDataCenterMap: {},
initCommandModule: [],
initFormComponents: {},
containerIcon: <VerticalAlignMiddleOutlined />,
};
/**
@@ -232,6 +243,7 @@ export const defaultConfig: InitConfig = {
* initDataCenterMap合并
* initCommandModule合并
* initFormComponents合并
* containerIcon不合并
*
* @export InitConfig
*/
@@ -247,6 +259,7 @@ export function userConfigMerge(a: Partial<InitConfig>, b?: Partial<InitConfig>)
initCommandModule: [],
rightGlobalCustom: null,
initFormComponents: {},
containerIcon: null,
};
if (!b) {
return userConfigMerge(mergeConfig, a);
@@ -257,6 +270,8 @@ export function userConfigMerge(a: Partial<InitConfig>, b?: Partial<InitConfig>)
? [...a.initStoreData]
: [defaultStore];
mergeConfig.containerIcon = b.containerIcon ? b.containerIcon : a.containerIcon;
mergeConfig.rightGlobalCustom = b.rightGlobalCustom ? b.rightGlobalCustom : a.rightGlobalCustom;
mergeConfig.leftAllRegistMap = b.leftAllRegistMap

View File

@@ -1,16 +0,0 @@
/*
* @Author: yehuozhili
* @Date: 2021-07-10 16:52:41
* @LastEditors: yehuozhili
* @LastEditTime: 2021-07-10 18:28:18
* @FilePath: \dooringx\packages\dooringx-lib\src\core\utils\icon.ts
*/
import { createFromIconfontCN } from '@ant-design/icons';
export const IconFont = createFromIconfontCN({
scriptUrl: '//at.alicdn.com/t/font_2607370_zx7pglxj1m.js', // 在 iconfont.cn 上生成
extraCommonProps: {
fill: 'currentColor',
stroke: 'currentColor',
},
});