@flatbiz/pro-layout 4.0.12 → 4.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -295,6 +295,40 @@ export interface PageProps {
295
295
  children?: ReactElement | ReactElement[];
296
296
  }
297
297
  export declare const Page: (props: PageProps) => JSX.Element;
298
+ export type TAny = any;
299
+ export type TPlainObject<T = TAny> = Record<string, T>;
300
+ export type PageWrapperServiceConfig = {
301
+ onRequest: (params?: TAny) => Promise<TPlainObject>;
302
+ params?: TPlainObject;
303
+ };
304
+ export interface PageWrapperProps extends Omit<PageProps, "children"> {
305
+ /** 接口数据配置 */
306
+ serviceConfig: PageWrapperServiceConfig;
307
+ /** children 为函数,参数【respData】为接口返回数据 */
308
+ children?: (respData?: TAny) => ReactElement;
309
+ /**
310
+ * 是否异步,默认:false
311
+ * ```
312
+ * true(异步):onRequest、react dom渲染同步执行
313
+ * false(同步):onRequest有结果了才渲染 react dom
314
+ * ```
315
+ */
316
+ isAsync?: boolean;
317
+ /** 自定义异常渲染处理 */
318
+ errorRender?: (error?: TAny) => ReactElement;
319
+ }
320
+ /**
321
+ * 为Page内置接口处理流程组件,如果无全局初始化接口请求场景,请使用Page组件
322
+ * ```
323
+ * 包括
324
+ * 1. loading显示效果
325
+ * 2. error显示效果
326
+ * 3. 正常接口数据渲染
327
+ * ```
328
+ * @param props
329
+ * @returns
330
+ */
331
+ export declare const PageWrapper: (props: PageWrapperProps) => JSX.Element;
298
332
  export type IframeHandler<T = unknown> = (data: T) => void;
299
333
  /**
300
334
  * 使用Iframe通讯的API
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatbiz/pro-layout",
3
- "version": "4.0.12",
3
+ "version": "4.0.14",
4
4
  "description": "WEB菜单布局",
5
5
  "main": "index.js",
6
6
  "typings": "index.d.ts",
@@ -42,7 +42,8 @@
42
42
  "react": ">=18.2.0",
43
43
  "react-dom": ">=18.2.0",
44
44
  "react-router": ">=6.4.5",
45
- "react-router-dom": ">=6.4.5"
45
+ "react-router-dom": ">=6.4.5",
46
+ "react-is": ">=18.2.0"
46
47
  },
47
48
  "devDependencies": {
48
49
  "@ant-design/icons": "^4.8.0",
@@ -55,6 +56,7 @@
55
56
  "react": "18.2.0",
56
57
  "react-dom": "18.2.0",
57
58
  "react-router": "^6.6.1",
58
- "react-router-dom": "^6.6.1"
59
+ "react-router-dom": "^6.6.1",
60
+ "react-is": "^18.2.0"
59
61
  }
60
62
  }