@etsoo/toolpad 1.0.15 → 1.0.17
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/build/cjs/PageContainer/PageContainer.d.ts +2 -2
- package/build/cjs/PageContainer/PageContainer.js +5 -6
- package/build/mjs/PageContainer/PageContainer.d.ts +2 -2
- package/build/mjs/PageContainer/PageContainer.js +5 -6
- package/package.json +13 -13
- package/src/PageContainer/PageContainer.tsx +31 -35
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { StackProps } from "@mui/material/Stack";
|
|
3
3
|
import { PageContainerToolbarProps } from "./PageContainerToolbar";
|
|
4
4
|
export interface PageContainerSlotProps {
|
|
5
5
|
toolbar: PageContainerToolbarProps;
|
|
@@ -32,7 +32,7 @@ export declare const PageDataContext: React.Context<{
|
|
|
32
32
|
dispatch: React.Dispatch<PageDataAction>;
|
|
33
33
|
}>;
|
|
34
34
|
export declare function PageDataContextProvider(props: React.PropsWithChildren<PageData>): import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
export type PageContainerProps = React.PropsWithChildren<
|
|
35
|
+
export type PageContainerProps = React.PropsWithChildren<StackProps & {
|
|
36
36
|
/**
|
|
37
37
|
* The default title of the page.
|
|
38
38
|
*/
|
|
@@ -43,7 +43,6 @@ exports.PageContainer = PageContainer;
|
|
|
43
43
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
44
44
|
const React = __importStar(require("react"));
|
|
45
45
|
const Breadcrumbs_1 = __importDefault(require("@mui/material/Breadcrumbs"));
|
|
46
|
-
const Container_1 = __importDefault(require("@mui/material/Container"));
|
|
47
46
|
const Link_1 = __importDefault(require("@mui/material/Link"));
|
|
48
47
|
const Stack_1 = __importDefault(require("@mui/material/Stack"));
|
|
49
48
|
const Typography_1 = __importDefault(require("@mui/material/Typography"));
|
|
@@ -125,9 +124,9 @@ function PageContainer(props) {
|
|
|
125
124
|
externalSlotProps: props?.slotProps?.toolbar,
|
|
126
125
|
additionalProps: {}
|
|
127
126
|
});
|
|
128
|
-
return ((0, jsx_runtime_1.
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
127
|
+
return ((0, jsx_runtime_1.jsxs)(Stack_1.default, { sx: { m: 2 }, spacing: 2, ...rest, children: [(0, jsx_runtime_1.jsxs)(Stack_1.default, { children: [(0, jsx_runtime_1.jsx)(Breadcrumbs_1.default, { "aria-label": "breadcrumb", children: resolvedBreadcrumbs
|
|
128
|
+
? resolvedBreadcrumbs.map((item, index) => {
|
|
129
|
+
return index < resolvedBreadcrumbs.length - 1 ? ((0, jsx_runtime_1.jsx)(Link_1.default, { component: Link_2.Link, underline: "hover", color: "inherit", href: item.path, children: (0, navigation_1.getItemTitle)(item) }, item.path)) : ((0, jsx_runtime_1.jsx)(Typography_1.default, { color: "text.primary", children: (0, navigation_1.getItemTitle)(item) }, item.path));
|
|
130
|
+
})
|
|
131
|
+
: null }), (0, jsx_runtime_1.jsxs)(PageContentHeader, { children: [title ? (0, jsx_runtime_1.jsx)(Typography_1.default, { variant: "h4", children: title }) : null, (0, jsx_runtime_1.jsx)(ToolbarComponent, { ...toolbarSlotProps })] })] }), children] }));
|
|
133
132
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { StackProps } from "@mui/material/Stack";
|
|
3
3
|
import { PageContainerToolbarProps } from "./PageContainerToolbar";
|
|
4
4
|
export interface PageContainerSlotProps {
|
|
5
5
|
toolbar: PageContainerToolbarProps;
|
|
@@ -32,7 +32,7 @@ export declare const PageDataContext: React.Context<{
|
|
|
32
32
|
dispatch: React.Dispatch<PageDataAction>;
|
|
33
33
|
}>;
|
|
34
34
|
export declare function PageDataContextProvider(props: React.PropsWithChildren<PageData>): import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
export type PageContainerProps = React.PropsWithChildren<
|
|
35
|
+
export type PageContainerProps = React.PropsWithChildren<StackProps & {
|
|
36
36
|
/**
|
|
37
37
|
* The default title of the page.
|
|
38
38
|
*/
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import Breadcrumbs from "@mui/material/Breadcrumbs";
|
|
5
|
-
import Container from "@mui/material/Container";
|
|
6
5
|
import Link from "@mui/material/Link";
|
|
7
6
|
import Stack from "@mui/material/Stack";
|
|
8
7
|
import Typography from "@mui/material/Typography";
|
|
@@ -84,10 +83,10 @@ function PageContainer(props) {
|
|
|
84
83
|
externalSlotProps: props?.slotProps?.toolbar,
|
|
85
84
|
additionalProps: {}
|
|
86
85
|
});
|
|
87
|
-
return (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
return (_jsxs(Stack, { sx: { m: 2 }, spacing: 2, ...rest, children: [_jsxs(Stack, { children: [_jsx(Breadcrumbs, { "aria-label": "breadcrumb", children: resolvedBreadcrumbs
|
|
87
|
+
? resolvedBreadcrumbs.map((item, index) => {
|
|
88
|
+
return index < resolvedBreadcrumbs.length - 1 ? (_jsx(Link, { component: ToolpadLink, underline: "hover", color: "inherit", href: item.path, children: getItemTitle(item) }, item.path)) : (_jsx(Typography, { color: "text.primary", children: getItemTitle(item) }, item.path));
|
|
89
|
+
})
|
|
90
|
+
: null }), _jsxs(PageContentHeader, { children: [title ? _jsx(Typography, { variant: "h4", children: title }) : null, _jsx(ToolbarComponent, { ...toolbarSlotProps })] })] }), children] }));
|
|
92
91
|
}
|
|
93
92
|
export { PageContainer };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/toolpad",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"author": "ETSOO",
|
|
5
5
|
"description": "Dashboard framework extention based on Toolpad Core",
|
|
6
6
|
"main": "build/cjs/index.js",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"dependencies": {
|
|
48
48
|
"@emotion/react": "^11.14.0",
|
|
49
49
|
"@emotion/styled": "^11.14.0",
|
|
50
|
-
"@mui/icons-material": "6.4.
|
|
51
|
-
"@mui/material": "6.4.
|
|
50
|
+
"@mui/icons-material": "6.4.5",
|
|
51
|
+
"@mui/material": "6.4.5",
|
|
52
52
|
"@mui/utils": "6.4.3",
|
|
53
53
|
"invariant": "2.2.4",
|
|
54
54
|
"path-to-regexp": "6.3.0",
|
|
@@ -56,23 +56,23 @@
|
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@babel/cli": "^7.26.4",
|
|
59
|
-
"@babel/core": "^7.26.
|
|
60
|
-
"@babel/plugin-transform-runtime": "^7.26.
|
|
61
|
-
"@babel/preset-env": "^7.26.
|
|
62
|
-
"@babel/runtime-corejs3": "^7.26.
|
|
59
|
+
"@babel/core": "^7.26.9",
|
|
60
|
+
"@babel/plugin-transform-runtime": "^7.26.9",
|
|
61
|
+
"@babel/preset-env": "^7.26.9",
|
|
62
|
+
"@babel/runtime-corejs3": "^7.26.9",
|
|
63
63
|
"@testing-library/jest-dom": "^6.6.3",
|
|
64
64
|
"@testing-library/react": "^16.2.0",
|
|
65
65
|
"@types/invariant": "2.2.37",
|
|
66
|
-
"@types/react": "19.0.
|
|
67
|
-
"@types/react-dom": "19.0.
|
|
66
|
+
"@types/react": "19.0.10",
|
|
67
|
+
"@types/react-dom": "19.0.4",
|
|
68
68
|
"@vitejs/plugin-react": "4.3.4",
|
|
69
|
-
"@vitest/browser": "3.0.
|
|
69
|
+
"@vitest/browser": "3.0.6",
|
|
70
70
|
"jsdom": "^26.0.0",
|
|
71
|
-
"next": "^15.1.
|
|
71
|
+
"next": "^15.1.7",
|
|
72
72
|
"next-router-mock": "^0.9.13",
|
|
73
73
|
"playwright": "^1.50.1",
|
|
74
|
-
"react-router-dom": "7.
|
|
75
|
-
"vitest": "3.0.
|
|
74
|
+
"react-router-dom": "7.2.0",
|
|
75
|
+
"vitest": "3.0.6"
|
|
76
76
|
},
|
|
77
77
|
"peerDependenciesMeta": {
|
|
78
78
|
"next": {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import Breadcrumbs from "@mui/material/Breadcrumbs";
|
|
4
|
-
import Container, { ContainerProps } from "@mui/material/Container";
|
|
5
4
|
import Link from "@mui/material/Link";
|
|
6
|
-
import Stack from "@mui/material/Stack";
|
|
5
|
+
import Stack, { StackProps } from "@mui/material/Stack";
|
|
7
6
|
import Typography from "@mui/material/Typography";
|
|
8
7
|
import useSlotProps from "@mui/utils/useSlotProps";
|
|
9
8
|
import { styled } from "@mui/material";
|
|
@@ -93,7 +92,7 @@ export function PageDataContextProvider(
|
|
|
93
92
|
}
|
|
94
93
|
|
|
95
94
|
export type PageContainerProps = React.PropsWithChildren<
|
|
96
|
-
|
|
95
|
+
StackProps & {
|
|
97
96
|
/**
|
|
98
97
|
* The default title of the page.
|
|
99
98
|
*/
|
|
@@ -155,39 +154,36 @@ function PageContainer(props: PageContainerProps) {
|
|
|
155
154
|
});
|
|
156
155
|
|
|
157
156
|
return (
|
|
158
|
-
<
|
|
159
|
-
<Stack
|
|
160
|
-
<
|
|
161
|
-
|
|
162
|
-
{
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
<
|
|
184
|
-
|
|
185
|
-
<ToolbarComponent {...toolbarSlotProps} />
|
|
186
|
-
</PageContentHeader>
|
|
187
|
-
</Stack>
|
|
188
|
-
<div>{children}</div>
|
|
157
|
+
<Stack sx={{ m: 2 }} spacing={2} {...rest}>
|
|
158
|
+
<Stack>
|
|
159
|
+
<Breadcrumbs aria-label="breadcrumb">
|
|
160
|
+
{resolvedBreadcrumbs
|
|
161
|
+
? resolvedBreadcrumbs.map((item, index) => {
|
|
162
|
+
return index < resolvedBreadcrumbs.length - 1 ? (
|
|
163
|
+
<Link
|
|
164
|
+
key={item.path}
|
|
165
|
+
component={ToolpadLink}
|
|
166
|
+
underline="hover"
|
|
167
|
+
color="inherit"
|
|
168
|
+
href={item.path}
|
|
169
|
+
>
|
|
170
|
+
{getItemTitle(item)}
|
|
171
|
+
</Link>
|
|
172
|
+
) : (
|
|
173
|
+
<Typography key={item.path} color="text.primary">
|
|
174
|
+
{getItemTitle(item)}
|
|
175
|
+
</Typography>
|
|
176
|
+
);
|
|
177
|
+
})
|
|
178
|
+
: null}
|
|
179
|
+
</Breadcrumbs>
|
|
180
|
+
<PageContentHeader>
|
|
181
|
+
{title ? <Typography variant="h4">{title}</Typography> : null}
|
|
182
|
+
<ToolbarComponent {...toolbarSlotProps} />
|
|
183
|
+
</PageContentHeader>
|
|
189
184
|
</Stack>
|
|
190
|
-
|
|
185
|
+
{children}
|
|
186
|
+
</Stack>
|
|
191
187
|
);
|
|
192
188
|
}
|
|
193
189
|
|