v0.7.15
This commit is contained in:
Vendored
+17
-2
@@ -1,9 +1,24 @@
|
|||||||
export { default as Icon } from './iconfont';
|
export { default as Icon } from './iconfont';
|
||||||
export { default as SetPropsWrapper } from './container';
|
|
||||||
import React, { ReactElement, ComponentType, ReactNode, CSSProperties } from 'react';
|
import React, { ReactElement, ComponentType, ReactNode, CSSProperties } from 'react';
|
||||||
import { SlotKey } from './container';
|
import { SlotKey } from './container';
|
||||||
export { Empty, Loading, NotFound, Popup } from './container';
|
export { Empty, Loading, NotFound, Popup } from './container';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 包装一个弹窗内容组件,让它可以通过 $setProps 更新自己的 props(与外部传入的 widgetProps 做浅合并),
|
||||||
|
* 同时注入 $close 用于关闭弹窗
|
||||||
|
* @param {Object} props
|
||||||
|
* @param {ReactElement|ComponentType} props.widget 要渲染的元素或组件
|
||||||
|
* @param {Object} [props.widgetProps] 外部传入的初始 props,变化时会合并进内部状态
|
||||||
|
* @param {(result?: *) => void} props.$close 关闭弹窗的函数,会透传给 widget
|
||||||
|
* @param {(patch: Object) => void} [props.onSetProps] $setProps 被调用时的回调,用于同步外部状态
|
||||||
|
*/
|
||||||
|
declare function SetPropsWrapper({ widget, widgetProps: externalProps, $close, onSetProps }: {
|
||||||
|
widget: React.ReactElement | React.ComponentType;
|
||||||
|
widgetProps?: any;
|
||||||
|
$close: (result?: any) => void;
|
||||||
|
onSetProps?: (patch: any) => void;
|
||||||
|
}): React.ReactElement<any, string | React.JSXElementConstructor<any>> | React.ComponentType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通用错误边界组件
|
* 通用错误边界组件
|
||||||
* @param {Object} props
|
* @param {Object} props
|
||||||
@@ -97,5 +112,5 @@ declare function ImportWidgetComponent({ widget, widgetProps, widgetSetting, the
|
|||||||
onError?: (error: Error, info: null) => void;
|
onError?: (error: Error, info: null) => void;
|
||||||
}): any;
|
}): any;
|
||||||
|
|
||||||
export { ErrorBoundary, ImportWidgetComponent };
|
export { ErrorBoundary, ImportWidgetComponent, SetPropsWrapper };
|
||||||
export type { FallbackOnError, LayoutKey, ThemeContext, ThemeRenderer, WidgetInput };
|
export type { FallbackOnError, LayoutKey, ThemeContext, ThemeRenderer, WidgetInput };
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ff",
|
"name": "ff",
|
||||||
"version": "0.7.14",
|
"version": "0.7.15",
|
||||||
"author": "www.fsdpf.com",
|
"author": "www.fsdpf.com",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
|
|||||||
Reference in New Issue
Block a user