update 0.13.3
This commit is contained in:
		| @@ -2,7 +2,7 @@ | ||||
|  * @Author: yehuozhili | ||||
|  * @Date: 2021-03-14 05:40:37 | ||||
|  * @LastEditors: yehuozhili | ||||
|  * @LastEditTime: 2022-04-01 14:29:39 | ||||
|  * @LastEditTime: 2022-04-06 22:07:33 | ||||
|  * @FilePath: \dooringx\packages\dooringx-lib\src\components\preview.tsx | ||||
|  */ | ||||
| import Container from './container'; | ||||
| @@ -64,6 +64,10 @@ function Preview(props: PreviewProps): ReactElement { | ||||
| 				// 设置全局 | ||||
| 				const global = props.config.getStore().getData().globalState; | ||||
| 				const bodyColor = global?.bodyColor; | ||||
| 				const title = global?.title; | ||||
| 				if (title) { | ||||
| 					document.title = title; | ||||
| 				} | ||||
| 				if (bodyColor) { | ||||
| 					document.body.style.backgroundColor = bodyColor; | ||||
| 				} | ||||
|   | ||||
| @@ -2,12 +2,12 @@ | ||||
|  * @Author: yehuozhili | ||||
|  * @Date: 2021-03-14 05:42:13 | ||||
|  * @LastEditors: yehuozhili | ||||
|  * @LastEditTime: 2022-01-20 12:21:48 | ||||
|  * @LastEditTime: 2022-04-06 22:59:57 | ||||
|  * @FilePath: \dooringx\packages\dooringx-lib\src\components\rightConfig.tsx | ||||
|  */ | ||||
| import { CreateOptionsRes } from '../core/components/formTypes'; | ||||
| import { IBlockType, IStoreData } from '../core/store/storetype'; | ||||
| import { CSSProperties, PropsWithChildren, useEffect, useMemo, useState } from 'react'; | ||||
| import { CSSProperties, PropsWithChildren, ReactNode, useEffect, useMemo, useState } from 'react'; | ||||
| import React from 'react'; | ||||
| import { Tabs, Input, Row, Col, Checkbox, InputNumber } from 'antd'; | ||||
| import UserConfig from '../config'; | ||||
| @@ -24,6 +24,8 @@ const colStyle: CSSProperties = { | ||||
| interface RightConfigProps { | ||||
| 	state: IStoreData; | ||||
| 	config: UserConfig; | ||||
| 	globalExtra?: ReactNode; | ||||
| 	modalExtra?: ReactNode; | ||||
| } | ||||
|  | ||||
| /** | ||||
| @@ -261,6 +263,7 @@ function RightConfig(props: PropsWithChildren<RightConfigProps>) { | ||||
| 							></ColorPicker> | ||||
| 						</Col> | ||||
| 					</Row> | ||||
| 					{props.globalExtra && props.globalExtra} | ||||
| 				</div> | ||||
| 			)} | ||||
| 			{!current && !isEdit && customGlobal && customGlobal(props.config)} | ||||
| @@ -288,6 +291,7 @@ function RightConfig(props: PropsWithChildren<RightConfigProps>) { | ||||
| 							></Checkbox> | ||||
| 						</Col> | ||||
| 					</Row> | ||||
| 					{props.modalExtra && props.modalExtra} | ||||
| 				</div> | ||||
| 			)} | ||||
| 		</div> | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * @Author: yehuozhili | ||||
|  * @Date: 2021-02-25 21:16:58 | ||||
|  * @LastEditors: yehuozhili | ||||
|  * @LastEditTime: 2022-04-04 20:17:55 | ||||
|  * @LastEditTime: 2022-04-06 22:27:51 | ||||
|  * @FilePath: \dooringx\packages\dooringx-lib\src\config\index.tsx | ||||
|  */ | ||||
| import React from 'react'; | ||||
| @@ -171,7 +171,7 @@ export const defaultStore: IMainStoreData = { | ||||
| 	}, | ||||
| 	globalState: { | ||||
| 		containerColor: 'rgba(255,255,255,1)', | ||||
| 		title: 'dooring', | ||||
| 		title: 'Dooringx', | ||||
| 		bodyColor: 'rgba(255,255,255,1)', | ||||
| 		script: [], | ||||
| 		customAnimate: [], | ||||
| @@ -507,6 +507,23 @@ export class UserConfig { | ||||
| 		return this.commanderRegister; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * 用于获取当前store数据,已判断弹窗编辑 不会储存正在编辑的内容 | ||||
| 	 * @returns | ||||
| 	 * @memberof UserConfig | ||||
| 	 */ | ||||
| 	getCurrentData() { | ||||
| 		let data: IStoreData; | ||||
| 		const isEdit = this.storeChanger.isEdit(); | ||||
| 		if (isEdit) { | ||||
| 			data = this.storeChanger.getOrigin()!.now; | ||||
| 		} else { | ||||
| 			data = this.store.getData(); | ||||
| 		} | ||||
| 		return data; | ||||
| 	} | ||||
|  | ||||
| 	/** | ||||
| 	 * | ||||
| 	 * 以默认设置重置配置项 | ||||
|   | ||||
| @@ -2,9 +2,10 @@ | ||||
|  * @Author: yehuozhili | ||||
|  * @Date: 2021-03-14 04:29:09 | ||||
|  * @LastEditors: yehuozhili | ||||
|  * @LastEditTime: 2021-07-10 18:34:34 | ||||
|  * @LastEditTime: 2022-04-06 22:21:00 | ||||
|  * @FilePath: \dooringx\packages\dooringx-lib\src\core\components\index.ts | ||||
|  */ | ||||
| import { ComponentItemFactory } from './abstract'; | ||||
| import { ComponentItem } from './componentItem'; | ||||
|  | ||||
| /** | ||||
| @@ -58,6 +59,10 @@ class ComponentRegister { | ||||
| 			// console.error(`${item.name} component has registed`); | ||||
| 			return; | ||||
| 		} | ||||
| 		if (!(item instanceof ComponentItemFactory)) { | ||||
| 			console.error(item, 'may be a problem in register'); | ||||
| 		} | ||||
|  | ||||
| 		this.componentMap[item.name] = item; | ||||
| 		this.componentList.push(item); | ||||
| 		this.emit(); | ||||
|   | ||||
| @@ -2,8 +2,8 @@ | ||||
|  * @Author: yehuozhili | ||||
|  * @Date: 2021-04-06 19:33:17 | ||||
|  * @LastEditors: yehuozhili | ||||
|  * @LastEditTime: 2021-07-09 16:33:22 | ||||
|  * @FilePath: \DooringV2\packages\dooringx-lib\src\core\eventCenter\index.ts | ||||
|  * @LastEditTime: 2022-04-06 17:23:54 | ||||
|  * @FilePath: \dooringx\packages\dooringx-lib\src\core\eventCenter\index.ts | ||||
|  */ | ||||
| import UserConfig from '../../config'; | ||||
| import { FunctionCenter, FunctionCenterType } from '../functionCenter'; | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * @Author: yehuozhili | ||||
|  * @Date: 2021-03-14 04:29:09 | ||||
|  * @LastEditors: yehuozhili | ||||
|  * @LastEditTime: 2021-08-16 11:18:41 | ||||
|  * @LastEditTime: 2022-04-05 17:08:35 | ||||
|  * @FilePath: \dooringx\packages\dooringx-lib\src\core\store\index.ts | ||||
|  */ | ||||
| import { IStoreData } from './storetype'; | ||||
| @@ -47,7 +47,7 @@ class Store { | ||||
| 	 * | ||||
| 	 * 重置需要注册事件 | ||||
| 	 * @param {IStoreData[]} initData | ||||
| 	 * @param {boolean} [check=false] 检查编辑弹窗状态 | ||||
| 	 * @param {boolean} [check=false] 清空编辑弹窗状态 | ||||
| 	 * @memberof Store | ||||
| 	 */ | ||||
| 	resetToInitData(initData: IStoreData[], check = false) { | ||||
|   | ||||
| @@ -2,7 +2,7 @@ | ||||
|  * @Author: yehuozhili | ||||
|  * @Date: 2021-04-05 14:55:31 | ||||
|  * @LastEditors: yehuozhili | ||||
|  * @LastEditTime: 2021-08-27 10:38:58 | ||||
|  * @LastEditTime: 2022-04-05 17:02:34 | ||||
|  * @FilePath: \dooringx\packages\dooringx-lib\src\core\storeChanger\index.ts | ||||
|  */ | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 yehuozhili
					yehuozhili