listpage-next 0.0.173 → 0.0.174

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.
@@ -1,7 +1,9 @@
1
1
  import { SiderProps } from 'antd';
2
+ import { usePageContext } from '../PageProvider';
2
3
  import { PageLogoProps } from '../PageLogo';
3
4
  import { PageFloatProps } from '../PageProvider/float';
4
5
  export interface PageLayoutProps {
6
+ pageRef?: React.RefObject<ReturnType<typeof usePageContext>>;
5
7
  sider?: React.ReactNode;
6
8
  header?: React.ReactNode;
7
9
  content?: React.ReactNode;
@@ -5,9 +5,14 @@ import { PageSider } from "../PageSider/index.js";
5
5
  import { PageHeader } from "../PageHeader/index.js";
6
6
  import { PageContent } from "../PageContent/index.js";
7
7
  import { PageProvider, usePageContext } from "../PageProvider/index.js";
8
+ import { useImperativeHandle } from "react";
8
9
  const PageLayoutComponent = (props)=>{
9
- const { siderProps, sider, header, content, logo } = props;
10
- const { collapsed, setCollapsed } = usePageContext();
10
+ const { siderProps, sider, header, content, logo, pageRef } = props;
11
+ const context = usePageContext();
12
+ const { collapsed, setCollapsed } = context;
13
+ useImperativeHandle(pageRef, ()=>context, [
14
+ context
15
+ ]);
11
16
  return /*#__PURE__*/ jsxs(LayoutStyled, {
12
17
  children: [
13
18
  /*#__PURE__*/ jsx(PageSider, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "listpage-next",
3
- "version": "0.0.173",
3
+ "version": "0.0.174",
4
4
  "description": "A React component library for creating filter forms with Ant Design",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",