@etsoo/toolpad 1.0.19 → 1.0.21

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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2004-2024 ETSOO ® (亿速思维 ®), https://etsoo.com, https://etsoo.nz
3
+ Copyright (c) 2004-2025 ETSOO ® (亿速思维 ®), https://etsoo.com, https://etsoo.nz
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -25,6 +25,8 @@ export type PageData = {
25
25
  title?: string;
26
26
  page?: string;
27
27
  breadcrumbs?: Breadcrumb[];
28
+ noBreadcrumbs?: boolean;
29
+ noPageHeader?: boolean;
28
30
  };
29
31
  type PageDataAction = PageData | true;
30
32
  export declare const PageDataContext: React.Context<{
@@ -103,6 +103,7 @@ function PageContainer(props) {
103
103
  const activePage = (0, useActivePage_1.useActivePage)();
104
104
  React.useLayoutEffect(() => {
105
105
  if (loaded.current) {
106
+ // Reset the page data state
106
107
  dispatch(true);
107
108
  }
108
109
  else {
@@ -124,9 +125,9 @@ function PageContainer(props) {
124
125
  externalSlotProps: props?.slotProps?.toolbar,
125
126
  additionalProps: {}
126
127
  });
127
- return ((0, jsx_runtime_1.jsxs)(Stack_1.default, { sx: { mx: 3, my: 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
+ return ((0, jsx_runtime_1.jsxs)(Stack_1.default, { sx: { mx: 3, my: 2 }, spacing: 2, ...rest, children: [state.noPageHeader !== false && ((0, jsx_runtime_1.jsxs)(Stack_1.default, { children: [state.noBreadcrumbs !== false && ((0, jsx_runtime_1.jsx)(Breadcrumbs_1.default, { "aria-label": "breadcrumb", children: resolvedBreadcrumbs
128
129
  ? resolvedBreadcrumbs.map((item, index) => {
129
130
  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
  })
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] }));
132
+ : 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] }));
132
133
  }
@@ -25,6 +25,8 @@ export type PageData = {
25
25
  title?: string;
26
26
  page?: string;
27
27
  breadcrumbs?: Breadcrumb[];
28
+ noBreadcrumbs?: boolean;
29
+ noPageHeader?: boolean;
28
30
  };
29
31
  type PageDataAction = PageData | true;
30
32
  export declare const PageDataContext: React.Context<{
@@ -62,6 +62,7 @@ function PageContainer(props) {
62
62
  const activePage = useActivePage();
63
63
  React.useLayoutEffect(() => {
64
64
  if (loaded.current) {
65
+ // Reset the page data state
65
66
  dispatch(true);
66
67
  }
67
68
  else {
@@ -83,10 +84,10 @@ function PageContainer(props) {
83
84
  externalSlotProps: props?.slotProps?.toolbar,
84
85
  additionalProps: {}
85
86
  });
86
- return (_jsxs(Stack, { sx: { mx: 3, my: 2 }, spacing: 2, ...rest, children: [_jsxs(Stack, { children: [_jsx(Breadcrumbs, { "aria-label": "breadcrumb", children: resolvedBreadcrumbs
87
+ return (_jsxs(Stack, { sx: { mx: 3, my: 2 }, spacing: 2, ...rest, children: [state.noPageHeader !== false && (_jsxs(Stack, { children: [state.noBreadcrumbs !== false && (_jsx(Breadcrumbs, { "aria-label": "breadcrumb", children: resolvedBreadcrumbs
87
88
  ? resolvedBreadcrumbs.map((item, index) => {
88
89
  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
  })
90
- : null }), _jsxs(PageContentHeader, { children: [title ? _jsx(Typography, { variant: "h4", children: title }) : null, _jsx(ToolbarComponent, { ...toolbarSlotProps })] })] }), children] }));
91
+ : null })), _jsxs(PageContentHeader, { children: [title ? _jsx(Typography, { variant: "h4", children: title }) : null, _jsx(ToolbarComponent, { ...toolbarSlotProps })] })] })), children] }));
91
92
  }
92
93
  export { PageContainer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/toolpad",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "author": "ETSOO",
5
5
  "description": "Dashboard framework extention based on Toolpad Core",
6
6
  "main": "build/cjs/index.js",
@@ -47,32 +47,32 @@
47
47
  "dependencies": {
48
48
  "@emotion/react": "^11.14.0",
49
49
  "@emotion/styled": "^11.14.0",
50
- "@mui/icons-material": "6.4.6",
51
- "@mui/material": "6.4.6",
52
- "@mui/utils": "6.4.6",
50
+ "@mui/icons-material": "6.4.8",
51
+ "@mui/material": "6.4.8",
52
+ "@mui/utils": "6.4.8",
53
53
  "invariant": "2.2.4",
54
54
  "path-to-regexp": "6.3.0",
55
55
  "react": "^19.0.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@babel/cli": "^7.26.4",
59
- "@babel/core": "^7.26.9",
60
- "@babel/plugin-transform-runtime": "^7.26.9",
59
+ "@babel/core": "^7.26.10",
60
+ "@babel/plugin-transform-runtime": "^7.26.10",
61
61
  "@babel/preset-env": "^7.26.9",
62
- "@babel/runtime-corejs3": "^7.26.9",
62
+ "@babel/runtime-corejs3": "^7.26.10",
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.10",
66
+ "@types/react": "19.0.12",
67
67
  "@types/react-dom": "19.0.4",
68
68
  "@vitejs/plugin-react": "4.3.4",
69
- "@vitest/browser": "3.0.7",
69
+ "@vitest/browser": "3.0.9",
70
70
  "jsdom": "^26.0.0",
71
- "next": "^15.2.0",
71
+ "next": "^15.2.3",
72
72
  "next-router-mock": "^0.9.13",
73
- "playwright": "^1.50.1",
74
- "react-router-dom": "7.2.0",
75
- "vitest": "3.0.7"
73
+ "playwright": "^1.51.1",
74
+ "react-router-dom": "7.4.0",
75
+ "vitest": "3.0.9"
76
76
  },
77
77
  "peerDependenciesMeta": {
78
78
  "next": {
@@ -48,6 +48,8 @@ export type PageData = {
48
48
  title?: string;
49
49
  page?: string;
50
50
  breadcrumbs?: Breadcrumb[];
51
+ noBreadcrumbs?: boolean;
52
+ noPageHeader?: boolean;
51
53
  };
52
54
 
53
55
  type PageDataAction = PageData | true;
@@ -129,6 +131,7 @@ function PageContainer(props: PageContainerProps) {
129
131
 
130
132
  React.useLayoutEffect(() => {
131
133
  if (loaded.current) {
134
+ // Reset the page data state
132
135
  dispatch(true);
133
136
  } else {
134
137
  loaded.current = true;
@@ -155,33 +158,37 @@ function PageContainer(props: PageContainerProps) {
155
158
 
156
159
  return (
157
160
  <Stack sx={{ mx: 3, my: 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>
184
- </Stack>
161
+ {state.noPageHeader !== false && (
162
+ <Stack>
163
+ {state.noBreadcrumbs !== false && (
164
+ <Breadcrumbs aria-label="breadcrumb">
165
+ {resolvedBreadcrumbs
166
+ ? resolvedBreadcrumbs.map((item, index) => {
167
+ return index < resolvedBreadcrumbs.length - 1 ? (
168
+ <Link
169
+ key={item.path}
170
+ component={ToolpadLink}
171
+ underline="hover"
172
+ color="inherit"
173
+ href={item.path}
174
+ >
175
+ {getItemTitle(item)}
176
+ </Link>
177
+ ) : (
178
+ <Typography key={item.path} color="text.primary">
179
+ {getItemTitle(item)}
180
+ </Typography>
181
+ );
182
+ })
183
+ : null}
184
+ </Breadcrumbs>
185
+ )}
186
+ <PageContentHeader>
187
+ {title ? <Typography variant="h4">{title}</Typography> : null}
188
+ <ToolbarComponent {...toolbarSlotProps} />
189
+ </PageContentHeader>
190
+ </Stack>
191
+ )}
185
192
  {children}
186
193
  </Stack>
187
194
  );