listpage-next 0.0.170 → 0.0.172
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/dist/components/PageLayout/components/PageContent/index.d.ts +5 -0
- package/dist/components/PageLayout/components/PageContent/index.js +15 -0
- package/dist/components/PageLayout/components/PageHeader/index.d.ts +5 -0
- package/dist/components/PageLayout/components/PageHeader/index.js +5 -0
- package/dist/components/PageLayout/components/PageLayout/index.d.ts +11 -0
- package/dist/components/PageLayout/components/PageLayout/index.js +44 -0
- package/dist/components/{Page/components/Loading → PageLayout/components/PageLoading}/index.js +16 -6
- package/dist/components/PageLayout/components/PageLogo/index.d.ts +7 -0
- package/dist/components/PageLayout/components/PageLogo/index.js +37 -0
- package/dist/components/PageLayout/components/PageProvider/float.d.ts +20 -0
- package/dist/components/PageLayout/components/PageProvider/float.js +64 -0
- package/dist/components/PageLayout/components/PageProvider/index.d.ts +17 -0
- package/dist/components/PageLayout/components/PageProvider/index.js +31 -0
- package/dist/components/PageLayout/components/PageSider/index.d.ts +8 -0
- package/dist/components/PageLayout/components/PageSider/index.js +42 -0
- package/dist/components/PageLayout/index.d.ts +4 -0
- package/dist/components/PageLayout/index.js +4 -0
- package/dist/context/index.d.ts +1 -1
- package/dist/demos/demo2.js +2 -2
- package/dist/demos/demo5.js +1 -1
- package/dist/features/ChatClient/components/ChatContent/index.js +1 -1
- package/dist/features/ChatClient/ui/Bubble/BubbleList.js +1 -1
- package/dist/features/ListPage/components/DataTable/index.d.ts +4 -0
- package/dist/{components/Page/components/ListPage/DataTable.js → features/ListPage/components/DataTable/index.js} +3 -3
- package/dist/features/ListPage/components/DataTable/renders/index.d.ts +7 -0
- package/dist/features/ListPage/components/DataTable/renders/index.js +13 -0
- package/dist/features/ListPage/components/DataTable/renders/link.d.ts +2 -0
- package/dist/features/ListPage/components/DataTable/renders/link.js +27 -0
- package/dist/features/ListPage/components/DataTable/renders/switch.d.ts +2 -0
- package/dist/features/ListPage/components/DataTable/renders/switch.js +10 -0
- package/dist/features/ListPage/components/DataTable/renders/tag.d.ts +2 -0
- package/dist/features/ListPage/components/DataTable/renders/tag.js +7 -0
- package/dist/features/ListPage/components/DataTable/renders/text.d.ts +2 -0
- package/dist/features/ListPage/components/DataTable/renders/text.js +10 -0
- package/dist/features/ListPage/components/DataTable/renders/time.d.ts +2 -0
- package/dist/features/ListPage/components/DataTable/renders/time.js +15 -0
- package/dist/features/ListPage/components/DataTable/types.d.ts +34 -0
- package/dist/features/ListPage/components/DataTable/types.js +0 -0
- package/dist/features/ListPage/components/DataTable/utils/render.d.ts +2 -0
- package/dist/features/ListPage/components/DataTable/utils/render.js +25 -0
- package/dist/features/ListPage/components/ListPageContainer/index.d.ts +17 -0
- package/dist/{components/Page/components/ListPage/v2.js → features/ListPage/components/ListPageContainer/index.js} +10 -24
- package/dist/features/ListPage/context/context.d.ts +4 -0
- package/dist/features/ListPage/context/context.js +22 -0
- package/dist/features/ListPage/context/index.d.ts +2 -0
- package/dist/features/ListPage/context/index.js +3 -0
- package/dist/features/ListPage/context/store.d.ts +37 -0
- package/dist/{components/Page/context/listpage.js → features/ListPage/context/store.js} +2 -42
- package/dist/features/ListPage/context/types.d.ts +12 -0
- package/dist/features/ListPage/context/types.js +0 -0
- package/dist/features/ListPage/hooks/useColumns.d.ts +3 -0
- package/dist/features/ListPage/hooks/useColumns.js +20 -0
- package/dist/{components/Page → features/ListPage}/hooks/useFloat.js +1 -1
- package/dist/features/ListPage/hooks/useHeader.d.ts +2 -0
- package/dist/{components/Page → features/ListPage}/hooks/useHeader.js +2 -2
- package/dist/{components/Page → features/ListPage}/hooks/usePagination.js +2 -2
- package/dist/{components/Page → features/ListPage}/hooks/useSelectionTools.js +1 -1
- package/dist/features/ListPage/index.d.ts +3 -0
- package/dist/features/ListPage/index.js +4 -0
- package/dist/{components/Page/components → features}/ListPage/styles.d.ts +3 -1
- package/dist/{components/Page/components → features}/ListPage/styles.js +15 -2
- package/dist/features/ListPage/types.d.ts +26 -0
- package/dist/features/ListPage/types.js +0 -0
- package/dist/features/ListPage/utils/index.d.ts +10 -0
- package/dist/features/ListPage/utils/index.js +23 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/components/Page/components/ListPage/DataTable.d.ts +0 -20
- package/dist/components/Page/components/ListPage/index.d.ts +0 -16
- package/dist/components/Page/components/ListPage/index.js +0 -51
- package/dist/components/Page/components/ListPage/v2.d.ts +0 -43
- package/dist/components/Page/components/PageContainer/index.d.ts +0 -10
- package/dist/components/Page/components/PageContainer/index.js +0 -82
- package/dist/components/Page/context/listpage.d.ts +0 -80
- package/dist/components/Page/context/page.d.ts +0 -13
- package/dist/components/Page/context/page.js +0 -15
- package/dist/components/Page/hooks/useColumns.d.ts +0 -3
- package/dist/components/Page/hooks/useColumns.js +0 -10
- package/dist/components/Page/hooks/useHeader.d.ts +0 -7
- package/dist/components/Page/index.d.ts +0 -8
- package/dist/components/Page/index.js +0 -7
- /package/dist/components/{Page/components/Loading → PageLayout/components/PageLoading}/index.d.ts +0 -0
- /package/dist/{components/Page → features/ListPage}/hooks/useFloat.d.ts +0 -0
- /package/dist/{components/Page → features/ListPage}/hooks/usePagination.d.ts +0 -0
- /package/dist/{components/Page → features/ListPage}/hooks/useSelectionTools.d.ts +0 -0
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import styled_components from "styled-components";
|
|
4
|
-
import { Layout } from "antd";
|
|
5
|
-
import { useControllableValue } from "ahooks";
|
|
6
|
-
import { PageContextProvider } from "../../context/page.js";
|
|
7
|
-
const { Sider, Content } = Layout;
|
|
8
|
-
const LayoutStyled = styled_components(Layout)`
|
|
9
|
-
height: 100vh;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
`;
|
|
12
|
-
const SiderStyled = styled_components(Sider)`
|
|
13
|
-
background-color: #fff;
|
|
14
|
-
border-right: 1px solid #e5e5e5;
|
|
15
|
-
display: flex;
|
|
16
|
-
flex-direction: column;
|
|
17
|
-
`;
|
|
18
|
-
const ContentStyled = styled_components(Content)`
|
|
19
|
-
background-color: #fff;
|
|
20
|
-
overflow: auto;
|
|
21
|
-
`;
|
|
22
|
-
const SiderContentWrapper = styled_components.div`
|
|
23
|
-
flex: 1;
|
|
24
|
-
overflow: auto;
|
|
25
|
-
`;
|
|
26
|
-
const SiderContent = styled_components.div`
|
|
27
|
-
display: flex;
|
|
28
|
-
flex-direction: column;
|
|
29
|
-
overflow: hidden;
|
|
30
|
-
`;
|
|
31
|
-
const LogoContentWrapper = styled_components.div`
|
|
32
|
-
flex: 0;
|
|
33
|
-
`;
|
|
34
|
-
const PageContainer = ({ logo, sider, header, content, siderProps })=>{
|
|
35
|
-
const [collapsed, setCollapsed] = useControllableValue({
|
|
36
|
-
value: siderProps?.collapsed,
|
|
37
|
-
defaultValue: false,
|
|
38
|
-
onChange: (collapsed)=>{
|
|
39
|
-
siderProps?.onCollapse?.(collapsed, 'clickTrigger');
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
return /*#__PURE__*/ jsx(PageContextProvider, {
|
|
43
|
-
collapsed: collapsed,
|
|
44
|
-
setCollapsed: setCollapsed,
|
|
45
|
-
children: /*#__PURE__*/ jsxs(LayoutStyled, {
|
|
46
|
-
children: [
|
|
47
|
-
/*#__PURE__*/ jsx(SiderStyled, {
|
|
48
|
-
trigger: null,
|
|
49
|
-
width: 256,
|
|
50
|
-
collapsedWidth: 80,
|
|
51
|
-
breakpoint: "lg",
|
|
52
|
-
...siderProps,
|
|
53
|
-
collapsible: true,
|
|
54
|
-
collapsed: collapsed,
|
|
55
|
-
onCollapse: (collapsed)=>{
|
|
56
|
-
setCollapsed(collapsed);
|
|
57
|
-
},
|
|
58
|
-
children: /*#__PURE__*/ jsxs(SiderContent, {
|
|
59
|
-
children: [
|
|
60
|
-
logo && /*#__PURE__*/ jsx(LogoContentWrapper, {
|
|
61
|
-
children: logo
|
|
62
|
-
}),
|
|
63
|
-
/*#__PURE__*/ jsx(SiderContentWrapper, {
|
|
64
|
-
children: sider
|
|
65
|
-
})
|
|
66
|
-
]
|
|
67
|
-
})
|
|
68
|
-
}),
|
|
69
|
-
/*#__PURE__*/ jsxs(Layout, {
|
|
70
|
-
hasSider: false,
|
|
71
|
-
children: [
|
|
72
|
-
header,
|
|
73
|
-
/*#__PURE__*/ jsx(ContentStyled, {
|
|
74
|
-
children: content
|
|
75
|
-
})
|
|
76
|
-
]
|
|
77
|
-
})
|
|
78
|
-
]
|
|
79
|
-
})
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
export { PageContainer };
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { JSX, Key, ReactNode } from 'react';
|
|
2
|
-
import { FloatComponentProps } from '../../../context';
|
|
3
|
-
import { BaseQueryParams, PaginationData } from '../../../http-client/types';
|
|
4
|
-
export type TableRequest<FilterValue = any, RecordValue = any> = (pageParams: BaseQueryParams, filterValues: FilterValue) => Promise<PaginationData<RecordValue>>;
|
|
5
|
-
export type FloatRender<RecordValue extends Record<string, any> = any> = (props: FloatComponentProps<RecordValue>) => JSX.Element;
|
|
6
|
-
export type ListPageStorageOption<FilterValue = any, RecordValue extends Record<string, any> = any> = {
|
|
7
|
-
storageKey?: string;
|
|
8
|
-
initialValues?: {
|
|
9
|
-
filterValues?: FilterValue;
|
|
10
|
-
pageSize?: number;
|
|
11
|
-
currentPage?: number;
|
|
12
|
-
};
|
|
13
|
-
state?: {
|
|
14
|
-
currentPage?: number;
|
|
15
|
-
pageSize?: number;
|
|
16
|
-
filterValues?: FilterValue;
|
|
17
|
-
};
|
|
18
|
-
request: TableRequest<FilterValue, RecordValue>;
|
|
19
|
-
floats: {
|
|
20
|
-
key: string;
|
|
21
|
-
render: FloatRender<RecordValue>;
|
|
22
|
-
}[];
|
|
23
|
-
};
|
|
24
|
-
export declare class ListPageStore<FilterValue = any, RecordValue extends Record<string, any> = any> {
|
|
25
|
-
storageKey?: string;
|
|
26
|
-
filters: FilterValue;
|
|
27
|
-
tableDataRequest: TableRequest<FilterValue, RecordValue>;
|
|
28
|
-
floats: {
|
|
29
|
-
key: string;
|
|
30
|
-
render: FloatRender<RecordValue>;
|
|
31
|
-
}[];
|
|
32
|
-
visibleFloat?: {
|
|
33
|
-
key: string;
|
|
34
|
-
record: RecordValue;
|
|
35
|
-
onCloseCallback?: true | (() => void);
|
|
36
|
-
};
|
|
37
|
-
loadingData: boolean;
|
|
38
|
-
dataSource: RecordValue[];
|
|
39
|
-
pagination: {
|
|
40
|
-
current: number;
|
|
41
|
-
pageSize: number;
|
|
42
|
-
total: number;
|
|
43
|
-
};
|
|
44
|
-
selection: {
|
|
45
|
-
selectedRowKeys: Key[];
|
|
46
|
-
selectedRows: RecordValue[];
|
|
47
|
-
};
|
|
48
|
-
listeners: Record<string, Function>;
|
|
49
|
-
constructor(options: ListPageStorageOption<FilterValue, RecordValue>);
|
|
50
|
-
submitFiltersChange(value?: FilterValue): void;
|
|
51
|
-
showFloat(key: string, record: any, onCloseCallback?: true | (() => void)): void;
|
|
52
|
-
hideFloat(): void;
|
|
53
|
-
updatePage(page: number, pageSize: number): void;
|
|
54
|
-
fetchTableData(): Promise<void>;
|
|
55
|
-
onSelectChange: (selectedRowKeys: Key[], selectedRows: RecordValue[]) => void;
|
|
56
|
-
clearSelection(): void;
|
|
57
|
-
refreshTable(): void;
|
|
58
|
-
listen(name: string, callback: (data: any) => void): void;
|
|
59
|
-
emit(name: string, data: any): void;
|
|
60
|
-
}
|
|
61
|
-
export declare const ListPageProvider: ({ children, initialValues, state, request, storageKey, floats, }: {
|
|
62
|
-
children: ReactNode;
|
|
63
|
-
state?: {
|
|
64
|
-
filterValues?: any;
|
|
65
|
-
pageSize?: number;
|
|
66
|
-
currentPage?: number;
|
|
67
|
-
};
|
|
68
|
-
initialValues?: {
|
|
69
|
-
filterValues?: any;
|
|
70
|
-
pageSize?: number;
|
|
71
|
-
currentPage?: number;
|
|
72
|
-
};
|
|
73
|
-
storageKey?: string;
|
|
74
|
-
floats?: {
|
|
75
|
-
key: string;
|
|
76
|
-
render: FloatRender<any>;
|
|
77
|
-
}[];
|
|
78
|
-
request: TableRequest<any, any>;
|
|
79
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
80
|
-
export declare function useListPageStore(): ListPageStore<any, any>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export declare const PageContext: import("react").Context<{
|
|
2
|
-
collapsed: boolean;
|
|
3
|
-
setCollapsed: (collapsed: boolean) => void;
|
|
4
|
-
}>;
|
|
5
|
-
export declare const PageContextProvider: ({ children, collapsed, setCollapsed, }: {
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
collapsed: boolean;
|
|
8
|
-
setCollapsed: (collapsed: boolean) => void;
|
|
9
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export declare const usePageContext: () => {
|
|
11
|
-
collapsed: boolean;
|
|
12
|
-
setCollapsed: (collapsed: boolean) => void;
|
|
13
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, useContext } from "react";
|
|
3
|
-
const PageContext = /*#__PURE__*/ createContext({
|
|
4
|
-
collapsed: false,
|
|
5
|
-
setCollapsed: ()=>{}
|
|
6
|
-
});
|
|
7
|
-
const PageContextProvider = ({ children, collapsed, setCollapsed })=>/*#__PURE__*/ jsx(PageContext.Provider, {
|
|
8
|
-
value: {
|
|
9
|
-
collapsed,
|
|
10
|
-
setCollapsed
|
|
11
|
-
},
|
|
12
|
-
children: children
|
|
13
|
-
});
|
|
14
|
-
const usePageContext = ()=>useContext(PageContext);
|
|
15
|
-
export { PageContext, PageContextProvider, usePageContext };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { useListPageStore } from "../context/listpage.js";
|
|
2
|
-
import { createColumnRender } from "../../DataTable/utils/render.js";
|
|
3
|
-
function useColumns(columns) {
|
|
4
|
-
const ctx = useListPageStore();
|
|
5
|
-
return columns.map((column)=>({
|
|
6
|
-
...column,
|
|
7
|
-
render: createColumnRender(ctx, column)
|
|
8
|
-
}));
|
|
9
|
-
}
|
|
10
|
-
export { useColumns };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { ListPageStore } from '../context/listpage';
|
|
3
|
-
export type HeaderProps = {
|
|
4
|
-
title?: ReactNode;
|
|
5
|
-
extra?: ReactNode | ((ctx: ListPageStore) => ReactNode);
|
|
6
|
-
};
|
|
7
|
-
export declare function useHeader(props?: HeaderProps): false | import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { PageContainer } from './components/PageContainer';
|
|
2
|
-
export { ListPage, type ListPageProps } from './components/ListPage';
|
|
3
|
-
export { PageLoading } from './components/Loading';
|
|
4
|
-
export { usePageContext } from './context/page';
|
|
5
|
-
export { ListPage as ListPagePro, type ListPageProps as ListPageProProps, } from './components/ListPage/v2';
|
|
6
|
-
export { type ListPageTableColumn } from './components/ListPage/DataTable';
|
|
7
|
-
export { type TableRequest } from './context/listpage';
|
|
8
|
-
export { ListPageStore as ListPageContext } from './context/listpage';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PageContainer } from "./components/PageContainer/index.js";
|
|
2
|
-
import { ListPage } from "./components/ListPage/index.js";
|
|
3
|
-
import { PageLoading } from "./components/Loading/index.js";
|
|
4
|
-
import { usePageContext } from "./context/page.js";
|
|
5
|
-
import { ListPage as v2_js_ListPage } from "./components/ListPage/v2.js";
|
|
6
|
-
import { ListPageStore } from "./context/listpage.js";
|
|
7
|
-
export { ListPage, ListPageStore as ListPageContext, v2_js_ListPage as ListPagePro, PageContainer, PageLoading, usePageContext };
|
/package/dist/components/{Page/components/Loading → PageLayout/components/PageLoading}/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|