diff --git a/README.md b/README.md index 4351ab8..93526b7 100644 --- a/README.md +++ b/README.md @@ -429,6 +429,7 @@ export default ThemeTest; - 访问控制:用于权限管理 - 微前端动态组件:支持动态加载和卸载组件 - 网络请求:封装了 HttpClient,支持 GET、POST、PUT、DELETE 等请求方式 +- 主题控制:支持动态修改主题和字体大小 ## 开发 diff --git a/package.json b/package.json index 2263ade..67e14b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@codingapi/ui-framework", - "version": "0.0.37", + "version": "0.0.41", "description": "A UI Framework built with React and Typescript", "keywords": [ "ui", diff --git a/src/Flow/types.ts b/src/Flow/types.ts index b688d38..b4c360c 100644 --- a/src/Flow/types.ts +++ b/src/Flow/types.ts @@ -180,3 +180,53 @@ export interface FlowViewProps { // 表单参数,参数仅当在发起节点时才会传递 formParams?: FlowFormParams; } + + +// 流程节点标题配置界面 +export const FlowNodeTitleFormPropsKey = "FlowNodeTitleFormPropsKey"; +export interface FlowNodeTitleFormProps { + visible: boolean; + setVisible: (visible: boolean) => void; + onFinish: (script: string) => void; + currentScript: string; +} + +// 流程节点异常处理配置界面 +export const FlowNodeErrorTriggerFormPropsKey = "FlowNodeErrorTriggerFormPropsKey"; +export interface FlowNodeErrorTriggerFormProps { + visible: boolean; + setVisible: (visible: boolean) => void; + onFinish: (script: string) => void; + currentScript: string; +} + +// 流程按钮自定义接口配置界面 +export const FlowButtonCustomApiFormPropsKey = "FlowButtonCustomApiPropsKey"; +export interface FlowButtonCustomApiFormProps { + visible: boolean; + setVisible: (visible: boolean) => void; + onFinish: (script: string) => void; + currentScript: string; +} + +// 流程关系出口设置配置界面 +export const FlowEdgeOutTriggerFormPropsKey = "FlowEdgeOutTriggerPropsKey"; +export interface FlowEdgeOutTriggerFormProps { + visible: boolean; + setVisible: (visible: boolean) => void; + onFinish: (script: string) => void; + currentScript: string; +} + +// 流程记录流程详情展示界面 +export const FlowViewRecordPropsKey = "FlowViewRecordPropsKey"; +export interface FlowViewRecordProps {} + +// 流程记录流程图展示界面 +export const FlowViewChartPropsKey = "FlowViewChartPropsKey"; +export interface FlowViewChartProps {} + +// 流程记录流程意见框展示界面 +export const FlowViewOpinionPropsKey = "FlowViewOpinionPropsKey"; +export interface FlowViewOpinionProps {} + diff --git a/src/ThemeProvider/component.tsx b/src/ThemeProvider/component.tsx index 85580f1..b74a754 100644 --- a/src/ThemeProvider/component.tsx +++ b/src/ThemeProvider/component.tsx @@ -4,7 +4,7 @@ import {ThemeConfig} from "./types"; interface ThemeProviderProps { children: React.ReactNode; - theme: ThemeConfig + theme?: ThemeConfig } export const ThemeProviderContext = React.createContext(null); @@ -13,9 +13,11 @@ export const ThemeProvider: React.FC = (props) => { const currentTheme = React.useContext(ThemeProviderContext) || {}; + const propsTheme = props.theme || {} as ThemeConfig; + const [theme, dispatch] = React.useState({ ...currentTheme, - ...props.theme + ...propsTheme }); const themeContextRef = React.useRef(null);