@iowas/toolpad 1.0.4 → 1.0.5
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/chunk-3JWXE2JW.mjs +5 -16
- package/dist/chunk-5B2NQDIH.js +145 -0
- package/dist/chunk-BN55HN4U.js +12 -0
- package/dist/chunk-F6JD4MSY.mjs +1 -3
- package/dist/chunk-LUTZBKSG.mjs +64 -138
- package/dist/chunk-PMIWCP25.mjs +4 -19
- package/dist/chunk-SITC3EZQ.js +2225 -0
- package/dist/chunk-SWAF5R4Y.js +686 -0
- package/dist/chunk-VMBNHIHN.js +84 -0
- package/dist/chunk-ZXM3V5SD.mjs +367 -552
- package/dist/core.js +126 -3100
- package/dist/core.mjs +4 -72
- package/dist/index.js +195 -3260
- package/dist/index.mjs +5 -110
- package/dist/nextjs.js +38 -771
- package/dist/nextjs.mjs +9 -19
- package/dist/utils.js +71 -213
- package/dist/utils.mjs +3 -42
- package/package.json +1 -1
package/dist/core.js
CHANGED
|
@@ -1,3111 +1,137 @@
|
|
|
1
|
-
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defProps = Object.defineProperties;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
|
-
var __objRest = (source, exclude) => {
|
|
26
|
-
var target = {};
|
|
27
|
-
for (var prop in source)
|
|
28
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
if (source != null && __getOwnPropSymbols)
|
|
31
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
32
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
33
|
-
target[prop] = source[prop];
|
|
34
|
-
}
|
|
35
|
-
return target;
|
|
36
|
-
};
|
|
37
|
-
var __export = (target, all) => {
|
|
38
|
-
for (var name in all)
|
|
39
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
40
|
-
};
|
|
41
|
-
var __copyProps = (to, from, except, desc) => {
|
|
42
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
43
|
-
for (let key of __getOwnPropNames(from))
|
|
44
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
45
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
46
|
-
}
|
|
47
|
-
return to;
|
|
48
|
-
};
|
|
49
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
50
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
51
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
52
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
53
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
54
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
55
|
-
mod
|
|
56
|
-
));
|
|
57
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
'use strict';
|
|
58
2
|
|
|
59
|
-
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
AccountPopoverFooter: () => AccountPopoverFooter,
|
|
64
|
-
AccountPopoverHeader: () => AccountPopoverHeader,
|
|
65
|
-
AccountPreview: () => AccountPreview,
|
|
66
|
-
AlertDialog: () => AlertDialog,
|
|
67
|
-
AppProvider: () => AppProvider,
|
|
68
|
-
AuthenticationContext: () => AuthenticationContext,
|
|
69
|
-
ConfirmDialog: () => ConfirmDialog,
|
|
70
|
-
DashboardHeader: () => DashboardHeader,
|
|
71
|
-
DashboardLayout: () => DashboardLayout,
|
|
72
|
-
DashboardSidebarPageItem: () => DashboardSidebarPageItem,
|
|
73
|
-
DialogsProvider: () => DialogsProvider,
|
|
74
|
-
LocalizationContext: () => LocalizationContext,
|
|
75
|
-
LocalizationProvider: () => LocalizationProvider,
|
|
76
|
-
NotificationsProvider: () => NotificationsProvider,
|
|
77
|
-
PageContainer: () => PageContainer,
|
|
78
|
-
PageHeader: () => PageHeader,
|
|
79
|
-
PageHeaderToolbar: () => PageHeaderToolbar,
|
|
80
|
-
PromptDialog: () => PromptDialog,
|
|
81
|
-
SessionContext: () => SessionContext,
|
|
82
|
-
SignInButton: () => SignInButton,
|
|
83
|
-
SignOutButton: () => SignOutButton,
|
|
84
|
-
ThemeSwitcher: () => ThemeSwitcher,
|
|
85
|
-
ToolbarActions: () => ToolbarActions,
|
|
86
|
-
en: () => en_default,
|
|
87
|
-
useActivePage: () => useActivePage,
|
|
88
|
-
useDialogs: () => useDialogs,
|
|
89
|
-
useLocalStorageState: () => useLocalStorageState,
|
|
90
|
-
useLocaleText: () => useLocaleText,
|
|
91
|
-
useNotifications: () => useNotifications,
|
|
92
|
-
useStorageState: () => useStorageState,
|
|
93
|
-
useStorageStateServer: () => useStorageStateServer
|
|
94
|
-
});
|
|
95
|
-
module.exports = __toCommonJS(core_exports);
|
|
96
|
-
|
|
97
|
-
// src/toolpad-core/Account/Account.tsx
|
|
98
|
-
var React17 = __toESM(require("react"));
|
|
99
|
-
var import_prop_types8 = __toESM(require("prop-types"));
|
|
100
|
-
var import_Popover = __toESM(require("@mui/material/Popover"));
|
|
101
|
-
var import_Divider = __toESM(require("@mui/material/Divider"));
|
|
102
|
-
var import_Stack3 = __toESM(require("@mui/material/Stack"));
|
|
103
|
-
|
|
104
|
-
// src/toolpad-core/Account/SignInButton.tsx
|
|
105
|
-
var React14 = __toESM(require("react"));
|
|
106
|
-
var import_prop_types3 = __toESM(require("prop-types"));
|
|
107
|
-
var import_Button2 = __toESM(require("@mui/material/Button"));
|
|
108
|
-
|
|
109
|
-
// src/toolpad-core/AppProvider/AppProvider.tsx
|
|
110
|
-
var React12 = __toESM(require("react"));
|
|
111
|
-
var import_prop_types2 = __toESM(require("prop-types"));
|
|
112
|
-
var import_styles3 = require("@mui/material/styles");
|
|
113
|
-
|
|
114
|
-
// src/toolpad-core/useNotifications/useNotifications.tsx
|
|
115
|
-
var React2 = __toESM(require("react"));
|
|
116
|
-
|
|
117
|
-
// src/toolpad-core/useNotifications/NotificationsContext.ts
|
|
118
|
-
var React = __toESM(require("react"));
|
|
119
|
-
var NotificationsContext = React.createContext(null);
|
|
120
|
-
|
|
121
|
-
// src/toolpad-core/useNotifications/useNotifications.tsx
|
|
122
|
-
var serverNotifications = {
|
|
123
|
-
show: () => {
|
|
124
|
-
throw new Error("Not supported on server side");
|
|
125
|
-
},
|
|
126
|
-
close: () => {
|
|
127
|
-
throw new Error("Not supported on server side");
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
function useNotifications() {
|
|
131
|
-
const context = React2.useContext(NotificationsContext);
|
|
132
|
-
if (context) {
|
|
133
|
-
return context;
|
|
134
|
-
}
|
|
135
|
-
return serverNotifications;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// src/toolpad-core/useNotifications/NotificationsProvider.tsx
|
|
139
|
-
var React5 = __toESM(require("react"));
|
|
140
|
-
var import_material = require("@mui/material");
|
|
141
|
-
var import_Close = __toESM(require("@mui/icons-material/Close"));
|
|
142
|
-
var import_useSlotProps = __toESM(require("@mui/utils/useSlotProps"));
|
|
143
|
-
|
|
144
|
-
// src/toolpad-core/AppProvider/LocalizationProvider.tsx
|
|
145
|
-
var React3 = __toESM(require("react"));
|
|
146
|
-
var import_prop_types = __toESM(require("prop-types"));
|
|
147
|
-
var import_styles = require("@mui/material/styles");
|
|
148
|
-
|
|
149
|
-
// src/toolpad-core/locales/getLocalization.ts
|
|
150
|
-
var getLocalization = (translations) => {
|
|
151
|
-
return {
|
|
152
|
-
components: {
|
|
153
|
-
MuiLocalizationProvider: {
|
|
154
|
-
defaultProps: {
|
|
155
|
-
localeText: __spreadValues({}, translations)
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
// src/toolpad-core/locales/en.tsx
|
|
163
|
-
var enLabels = {
|
|
164
|
-
// Account
|
|
165
|
-
accountSignInLabel: "Sign In",
|
|
166
|
-
accountSignOutLabel: "Sign Out",
|
|
167
|
-
// AccountPreview
|
|
168
|
-
accountPreviewTitle: "Account",
|
|
169
|
-
accountPreviewIconButtonLabel: "Current User",
|
|
170
|
-
// SignInPage
|
|
171
|
-
signInTitle: (brandingTitle) => brandingTitle ? `Sign in to ${brandingTitle}` : "Sign in",
|
|
172
|
-
signInSubtitle: "Welcome user, please sign in to continue",
|
|
173
|
-
signInRememberMe: "Remember Me",
|
|
174
|
-
providerSignInTitle: (provider) => `Sign in with ${provider}`,
|
|
175
|
-
// Common authentication labels
|
|
176
|
-
email: "Email",
|
|
177
|
-
password: "Password",
|
|
178
|
-
username: "Username",
|
|
179
|
-
passkey: "Passkey",
|
|
180
|
-
// Common action labels
|
|
181
|
-
save: "Save",
|
|
182
|
-
cancel: "Cancel",
|
|
183
|
-
ok: "Ok",
|
|
184
|
-
or: "Or",
|
|
185
|
-
to: "To",
|
|
186
|
-
with: "With",
|
|
187
|
-
close: "Close",
|
|
188
|
-
delete: "Delete",
|
|
189
|
-
alert: "Alert",
|
|
190
|
-
confirm: "Confirm",
|
|
191
|
-
loading: "Loading...",
|
|
192
|
-
// CRUD
|
|
193
|
-
createNewButtonLabel: "Create new",
|
|
194
|
-
reloadButtonLabel: "Reload data",
|
|
195
|
-
createLabel: "Create",
|
|
196
|
-
createSuccessMessage: "Item created successfully.",
|
|
197
|
-
createErrorMessage: "Failed to create item. Reason:",
|
|
198
|
-
editLabel: "Edit",
|
|
199
|
-
editSuccessMessage: "Item edited successfully.",
|
|
200
|
-
editErrorMessage: "Failed to edit item. Reason:",
|
|
201
|
-
deleteLabel: "Delete",
|
|
202
|
-
deleteConfirmTitle: "Delete item?",
|
|
203
|
-
deleteConfirmMessage: "Do you wish to delete this item?",
|
|
204
|
-
deleteConfirmLabel: "Delete",
|
|
205
|
-
deleteCancelLabel: "Cancel",
|
|
206
|
-
deleteSuccessMessage: "Item deleted successfully.",
|
|
207
|
-
deleteErrorMessage: "Failed to delete item. Reason:",
|
|
208
|
-
deletedItemMessage: "This item has been deleted."
|
|
209
|
-
};
|
|
210
|
-
var en_default = getLocalization(enLabels);
|
|
3
|
+
var chunkSITC3EZQ_js = require('./chunk-SITC3EZQ.js');
|
|
4
|
+
var chunkSWAF5R4Y_js = require('./chunk-SWAF5R4Y.js');
|
|
5
|
+
require('./chunk-BN55HN4U.js');
|
|
6
|
+
require('./chunk-5B2NQDIH.js');
|
|
211
7
|
|
|
212
|
-
// src/toolpad-core/AppProvider/LocalizationProvider.tsx
|
|
213
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
214
|
-
var LocalizationContext = React3.createContext({});
|
|
215
|
-
var LocalizationProvider = function LocalizationProvider2(props) {
|
|
216
|
-
var _a, _b, _c;
|
|
217
|
-
const { localeText: propsLocaleText, children } = props;
|
|
218
|
-
const theme = (0, import_styles.useTheme)();
|
|
219
|
-
const themeLocaleText = (_c = (_b = (_a = theme == null ? void 0 : theme.components) == null ? void 0 : _a.MuiLocalizationProvider) == null ? void 0 : _b.defaultProps) == null ? void 0 : _c.localeText;
|
|
220
|
-
const defaultLocaleText3 = en_default.components.MuiLocalizationProvider.defaultProps.localeText;
|
|
221
|
-
const localeText = React3.useMemo(
|
|
222
|
-
() => __spreadValues(__spreadValues(__spreadValues({}, defaultLocaleText3), themeLocaleText), propsLocaleText),
|
|
223
|
-
[defaultLocaleText3, themeLocaleText, propsLocaleText]
|
|
224
|
-
);
|
|
225
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LocalizationContext.Provider, { value: localeText, children });
|
|
226
|
-
};
|
|
227
|
-
LocalizationProvider.propTypes = {
|
|
228
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
229
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
230
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
231
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
232
|
-
/**
|
|
233
|
-
* @ignore
|
|
234
|
-
*/
|
|
235
|
-
children: import_prop_types.default.node,
|
|
236
|
-
/**
|
|
237
|
-
* Locale for components texts
|
|
238
|
-
*/
|
|
239
|
-
localeText: import_prop_types.default.object
|
|
240
|
-
};
|
|
241
|
-
function useLocaleText() {
|
|
242
|
-
return React3.useContext(LocalizationContext);
|
|
243
|
-
}
|
|
244
8
|
|
|
245
|
-
// src/toolpad-utils/react.tsx
|
|
246
|
-
var React4 = __toESM(require("react"));
|
|
247
|
-
var ReactIs = __toESM(require("react-is"));
|
|
248
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
249
|
-
function useNonNullableContext(context, name) {
|
|
250
|
-
const maybeContext = React4.useContext(context);
|
|
251
|
-
if (maybeContext === null || maybeContext === void 0) {
|
|
252
|
-
throw new Error(`context "${name}" was used without a Provider`);
|
|
253
|
-
}
|
|
254
|
-
return maybeContext;
|
|
255
|
-
}
|
|
256
9
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
var defaultLocaleText = {
|
|
261
|
-
close: "Close"
|
|
262
|
-
};
|
|
263
|
-
function Notification({ notificationKey, open, message, options, badge }) {
|
|
264
|
-
var _a, _b, _c;
|
|
265
|
-
const globalLocaleText = useLocaleText();
|
|
266
|
-
const localeText = __spreadValues(__spreadValues({}, defaultLocaleText), globalLocaleText);
|
|
267
|
-
const { close } = useNonNullableContext(NotificationsContext);
|
|
268
|
-
const { severity, actionText, onAction, autoHideDuration } = options;
|
|
269
|
-
const handleClose = React5.useCallback(
|
|
270
|
-
(event, reason) => {
|
|
271
|
-
if (reason === "clickaway") {
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
close(notificationKey);
|
|
275
|
-
},
|
|
276
|
-
[notificationKey, close]
|
|
277
|
-
);
|
|
278
|
-
const action = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(React5.Fragment, { children: [
|
|
279
|
-
onAction ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material.Button, { color: "inherit", size: "small", onClick: onAction, children: actionText != null ? actionText : "Action" }) : null,
|
|
280
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
281
|
-
import_material.IconButton,
|
|
282
|
-
{
|
|
283
|
-
size: "small",
|
|
284
|
-
"aria-label": localeText == null ? void 0 : localeText.close,
|
|
285
|
-
title: localeText == null ? void 0 : localeText.close,
|
|
286
|
-
color: "inherit",
|
|
287
|
-
onClick: handleClose,
|
|
288
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_Close.default, { fontSize: "small" })
|
|
289
|
-
}
|
|
290
|
-
)
|
|
291
|
-
] });
|
|
292
|
-
const props = React5.useContext(RootPropsContext);
|
|
293
|
-
const SnackbarComponent = (_b = (_a = props == null ? void 0 : props.slots) == null ? void 0 : _a.snackbar) != null ? _b : import_material.Snackbar;
|
|
294
|
-
const snackbarSlotProps = (0, import_useSlotProps.default)({
|
|
295
|
-
elementType: SnackbarComponent,
|
|
296
|
-
ownerState: props,
|
|
297
|
-
externalSlotProps: (_c = props == null ? void 0 : props.slotProps) == null ? void 0 : _c.snackbar,
|
|
298
|
-
additionalProps: {
|
|
299
|
-
open,
|
|
300
|
-
autoHideDuration,
|
|
301
|
-
onClose: handleClose,
|
|
302
|
-
action
|
|
303
|
-
}
|
|
304
|
-
});
|
|
305
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(SnackbarComponent, __spreadProps(__spreadValues({}, snackbarSlotProps), { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material.Badge, { badgeContent: badge, color: "primary", sx: { width: "100%" }, children: severity ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material.Alert, { severity, sx: { width: "100%" }, action, children: message }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material.SnackbarContent, { message, action }) }) }), notificationKey);
|
|
306
|
-
}
|
|
307
|
-
function Notifications({ state }) {
|
|
308
|
-
var _a;
|
|
309
|
-
const currentNotification = (_a = state.queue[0]) != null ? _a : null;
|
|
310
|
-
return currentNotification ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
311
|
-
Notification,
|
|
312
|
-
__spreadProps(__spreadValues({}, currentNotification), {
|
|
313
|
-
badge: state.queue.length > 1 ? String(state.queue.length) : null
|
|
314
|
-
})
|
|
315
|
-
) : null;
|
|
316
|
-
}
|
|
317
|
-
var nextId = 0;
|
|
318
|
-
var generateId = () => {
|
|
319
|
-
const id = nextId;
|
|
320
|
-
nextId += 1;
|
|
321
|
-
return id;
|
|
322
|
-
};
|
|
323
|
-
function NotificationsProvider(props) {
|
|
324
|
-
const { children } = props;
|
|
325
|
-
const [state, setState] = React5.useState({ queue: [] });
|
|
326
|
-
const show = React5.useCallback((message, options = {}) => {
|
|
327
|
-
var _a;
|
|
328
|
-
const notificationKey = (_a = options.key) != null ? _a : `::toolpad-internal::notification::${generateId()}`;
|
|
329
|
-
setState((prev) => {
|
|
330
|
-
if (prev.queue.some((n) => n.notificationKey === notificationKey)) {
|
|
331
|
-
return prev;
|
|
332
|
-
}
|
|
333
|
-
return __spreadProps(__spreadValues({}, prev), {
|
|
334
|
-
queue: [...prev.queue, { message, options, notificationKey, open: true }]
|
|
335
|
-
});
|
|
336
|
-
});
|
|
337
|
-
return notificationKey;
|
|
338
|
-
}, []);
|
|
339
|
-
const close = React5.useCallback((key) => {
|
|
340
|
-
setState((prev) => __spreadProps(__spreadValues({}, prev), {
|
|
341
|
-
queue: prev.queue.filter((n) => n.notificationKey !== key)
|
|
342
|
-
}));
|
|
343
|
-
}, []);
|
|
344
|
-
const contextValue = React5.useMemo(() => ({ show, close }), [show, close]);
|
|
345
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(RootPropsContext.Provider, { value: props, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(NotificationsContext.Provider, { value: contextValue, children: [
|
|
346
|
-
children,
|
|
347
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Notifications, { state })
|
|
348
|
-
] }) });
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
// src/toolpad-core/useDialogs/useDialogs.tsx
|
|
352
|
-
var import_Button = __toESM(require("@mui/material/Button"));
|
|
353
|
-
var import_Dialog = __toESM(require("@mui/material/Dialog"));
|
|
354
|
-
var import_DialogTitle = __toESM(require("@mui/material/DialogTitle"));
|
|
355
|
-
var import_DialogContent = __toESM(require("@mui/material/DialogContent"));
|
|
356
|
-
var import_DialogActions = __toESM(require("@mui/material/DialogActions"));
|
|
357
|
-
var import_TextField = __toESM(require("@mui/material/TextField"));
|
|
358
|
-
var import_DialogContentText = __toESM(require("@mui/material/DialogContentText"));
|
|
359
|
-
var import_invariant = __toESM(require("invariant"));
|
|
360
|
-
var React8 = __toESM(require("react"));
|
|
361
|
-
var import_useEventCallback = __toESM(require("@mui/utils/useEventCallback"));
|
|
362
|
-
|
|
363
|
-
// src/toolpad-core/useDialogs/DialogsContext.tsx
|
|
364
|
-
var React6 = __toESM(require("react"));
|
|
365
|
-
var DialogsContext = React6.createContext(null);
|
|
366
|
-
|
|
367
|
-
// src/toolpad-core/shared/context.ts
|
|
368
|
-
var React7 = __toESM(require("react"));
|
|
369
|
-
var BrandingContext = React7.createContext(null);
|
|
370
|
-
var NavigationContext = React7.createContext([]);
|
|
371
|
-
var PaletteModeContext = React7.createContext({
|
|
372
|
-
paletteMode: "light",
|
|
373
|
-
setPaletteMode: () => {
|
|
374
|
-
},
|
|
375
|
-
isDualTheme: false
|
|
10
|
+
Object.defineProperty(exports, "Account", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return chunkSITC3EZQ_js.Account; }
|
|
376
13
|
});
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
// src/toolpad-core/useDialogs/useDialogs.tsx
|
|
382
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
383
|
-
var defaultLocaleText2 = {
|
|
384
|
-
alert: "Alert",
|
|
385
|
-
confirm: "Confirm",
|
|
386
|
-
cancel: "Cancel",
|
|
387
|
-
ok: "Ok"
|
|
388
|
-
};
|
|
389
|
-
function useDialogLoadingButton(onClose) {
|
|
390
|
-
const [loading, setLoading] = React8.useState(false);
|
|
391
|
-
const handleClick = async () => {
|
|
392
|
-
try {
|
|
393
|
-
setLoading(true);
|
|
394
|
-
await onClose();
|
|
395
|
-
} finally {
|
|
396
|
-
setLoading(false);
|
|
397
|
-
}
|
|
398
|
-
};
|
|
399
|
-
return {
|
|
400
|
-
onClick: handleClick,
|
|
401
|
-
loading
|
|
402
|
-
};
|
|
403
|
-
}
|
|
404
|
-
function AlertDialog({ open, payload, onClose }) {
|
|
405
|
-
var _a, _b;
|
|
406
|
-
const appWindowContext = React8.useContext(WindowContext);
|
|
407
|
-
const globalLocaleText = useLocaleText();
|
|
408
|
-
const localeText = __spreadValues(__spreadValues({}, defaultLocaleText2), globalLocaleText);
|
|
409
|
-
const okButtonProps = useDialogLoadingButton(() => onClose());
|
|
410
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
411
|
-
import_Dialog.default,
|
|
412
|
-
{
|
|
413
|
-
maxWidth: "xs",
|
|
414
|
-
fullWidth: true,
|
|
415
|
-
open,
|
|
416
|
-
onClose: () => onClose(),
|
|
417
|
-
container: appWindowContext == null ? void 0 : appWindowContext.document.body,
|
|
418
|
-
children: [
|
|
419
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_DialogTitle.default, { children: (_a = payload.title) != null ? _a : localeText.alert }),
|
|
420
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_DialogContent.default, { children: payload.msg }),
|
|
421
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_DialogActions.default, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_Button.default, __spreadProps(__spreadValues({ disabled: !open }, okButtonProps), { children: (_b = payload.okText) != null ? _b : localeText.ok })) })
|
|
422
|
-
]
|
|
423
|
-
}
|
|
424
|
-
);
|
|
425
|
-
}
|
|
426
|
-
function ConfirmDialog({ open, payload, onClose }) {
|
|
427
|
-
var _a, _b, _c;
|
|
428
|
-
const appWindowContext = React8.useContext(WindowContext);
|
|
429
|
-
const globalLocaleText = useLocaleText();
|
|
430
|
-
const localeText = __spreadValues(__spreadValues({}, defaultLocaleText2), globalLocaleText);
|
|
431
|
-
const cancelButtonProps = useDialogLoadingButton(() => onClose(false));
|
|
432
|
-
const okButtonProps = useDialogLoadingButton(() => onClose(true));
|
|
433
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
434
|
-
import_Dialog.default,
|
|
435
|
-
{
|
|
436
|
-
maxWidth: "xs",
|
|
437
|
-
fullWidth: true,
|
|
438
|
-
open,
|
|
439
|
-
onClose: () => onClose(false),
|
|
440
|
-
container: appWindowContext == null ? void 0 : appWindowContext.document.body,
|
|
441
|
-
children: [
|
|
442
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_DialogTitle.default, { children: (_a = payload.title) != null ? _a : localeText.confirm }),
|
|
443
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_DialogContent.default, { children: payload.msg }),
|
|
444
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_DialogActions.default, { children: [
|
|
445
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_Button.default, __spreadProps(__spreadValues({ autoFocus: true, disabled: !open }, cancelButtonProps), { children: (_b = payload.cancelText) != null ? _b : localeText.cancel })),
|
|
446
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_Button.default, __spreadProps(__spreadValues({ color: payload.severity, disabled: !open }, okButtonProps), { children: (_c = payload.okText) != null ? _c : localeText.ok }))
|
|
447
|
-
] })
|
|
448
|
-
]
|
|
449
|
-
}
|
|
450
|
-
);
|
|
451
|
-
}
|
|
452
|
-
function PromptDialog({ open, payload, onClose }) {
|
|
453
|
-
var _a, _b, _c;
|
|
454
|
-
const appWindowContext = React8.useContext(WindowContext);
|
|
455
|
-
const globalLocaleText = useLocaleText();
|
|
456
|
-
const localeText = __spreadValues(__spreadValues({}, defaultLocaleText2), globalLocaleText);
|
|
457
|
-
const [input, setInput] = React8.useState("");
|
|
458
|
-
const cancelButtonProps = useDialogLoadingButton(() => onClose(null));
|
|
459
|
-
const [loading, setLoading] = React8.useState(false);
|
|
460
|
-
const name = "input";
|
|
461
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
462
|
-
import_Dialog.default,
|
|
463
|
-
{
|
|
464
|
-
maxWidth: "xs",
|
|
465
|
-
fullWidth: true,
|
|
466
|
-
open,
|
|
467
|
-
onClose: () => onClose(null),
|
|
468
|
-
PaperProps: {
|
|
469
|
-
component: "form",
|
|
470
|
-
onSubmit: async (event) => {
|
|
471
|
-
var _a2;
|
|
472
|
-
event.preventDefault();
|
|
473
|
-
try {
|
|
474
|
-
setLoading(true);
|
|
475
|
-
const formData = new FormData(event.currentTarget);
|
|
476
|
-
const value = (_a2 = formData.get(name)) != null ? _a2 : "";
|
|
477
|
-
(0, import_invariant.default)(typeof value === "string", "Value must come from a text input");
|
|
478
|
-
await onClose(value);
|
|
479
|
-
} finally {
|
|
480
|
-
setLoading(false);
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
},
|
|
484
|
-
container: appWindowContext == null ? void 0 : appWindowContext.document.body,
|
|
485
|
-
children: [
|
|
486
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_DialogTitle.default, { children: (_a = payload.title) != null ? _a : localeText.confirm }),
|
|
487
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_DialogContent.default, { children: [
|
|
488
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_DialogContentText.default, { children: [
|
|
489
|
-
payload.msg,
|
|
490
|
-
" "
|
|
491
|
-
] }),
|
|
492
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
493
|
-
import_TextField.default,
|
|
494
|
-
{
|
|
495
|
-
autoFocus: true,
|
|
496
|
-
required: true,
|
|
497
|
-
margin: "dense",
|
|
498
|
-
id: "name",
|
|
499
|
-
name,
|
|
500
|
-
type: "text",
|
|
501
|
-
fullWidth: true,
|
|
502
|
-
variant: "standard",
|
|
503
|
-
value: input,
|
|
504
|
-
onChange: (event) => setInput(event.target.value)
|
|
505
|
-
}
|
|
506
|
-
)
|
|
507
|
-
] }),
|
|
508
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_DialogActions.default, { children: [
|
|
509
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_Button.default, __spreadProps(__spreadValues({ disabled: !open }, cancelButtonProps), { children: (_b = payload.cancelText) != null ? _b : localeText.cancel })),
|
|
510
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_Button.default, { disabled: !open, loading, type: "submit", children: (_c = payload.okText) != null ? _c : localeText.ok })
|
|
511
|
-
] })
|
|
512
|
-
]
|
|
513
|
-
}
|
|
514
|
-
);
|
|
515
|
-
}
|
|
516
|
-
function useDialogs() {
|
|
517
|
-
const { open, close } = useNonNullableContext(DialogsContext);
|
|
518
|
-
const alert = (0, import_useEventCallback.default)(
|
|
519
|
-
(msg, _a = {}) => {
|
|
520
|
-
var _b = _a, { onClose } = _b, options = __objRest(_b, ["onClose"]);
|
|
521
|
-
return open(AlertDialog, __spreadProps(__spreadValues({}, options), { msg }), { onClose });
|
|
522
|
-
}
|
|
523
|
-
);
|
|
524
|
-
const confirm = (0, import_useEventCallback.default)(
|
|
525
|
-
(msg, _c = {}) => {
|
|
526
|
-
var _d = _c, { onClose } = _d, options = __objRest(_d, ["onClose"]);
|
|
527
|
-
return open(ConfirmDialog, __spreadProps(__spreadValues({}, options), { msg }), { onClose });
|
|
528
|
-
}
|
|
529
|
-
);
|
|
530
|
-
const prompt = (0, import_useEventCallback.default)(
|
|
531
|
-
(msg, _e = {}) => {
|
|
532
|
-
var _f = _e, { onClose } = _f, options = __objRest(_f, ["onClose"]);
|
|
533
|
-
return open(PromptDialog, __spreadProps(__spreadValues({}, options), { msg }), { onClose });
|
|
534
|
-
}
|
|
535
|
-
);
|
|
536
|
-
return React8.useMemo(
|
|
537
|
-
() => ({
|
|
538
|
-
alert,
|
|
539
|
-
confirm,
|
|
540
|
-
prompt,
|
|
541
|
-
open,
|
|
542
|
-
close
|
|
543
|
-
}),
|
|
544
|
-
[alert, close, confirm, open, prompt]
|
|
545
|
-
);
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
// src/toolpad-core/useDialogs/DialogsProvider.tsx
|
|
549
|
-
var import_invariant2 = __toESM(require("invariant"));
|
|
550
|
-
var React9 = __toESM(require("react"));
|
|
551
|
-
var import_useEventCallback2 = __toESM(require("@mui/utils/useEventCallback"));
|
|
552
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
553
|
-
function DialogsProvider(props) {
|
|
554
|
-
const { children, unmountAfter = 1e3 } = props;
|
|
555
|
-
const [stack, setStack] = React9.useState([]);
|
|
556
|
-
const keyPrefix = React9.useId();
|
|
557
|
-
const nextId2 = React9.useRef(0);
|
|
558
|
-
const dialogMetadata = React9.useRef(/* @__PURE__ */ new WeakMap());
|
|
559
|
-
const requestDialog = (0, import_useEventCallback2.default)(function open(Component, payload, options = {}) {
|
|
560
|
-
const { onClose = async () => {
|
|
561
|
-
} } = options;
|
|
562
|
-
let resolve;
|
|
563
|
-
const promise = new Promise((resolveImpl) => {
|
|
564
|
-
resolve = resolveImpl;
|
|
565
|
-
});
|
|
566
|
-
(0, import_invariant2.default)(resolve, "resolve not set");
|
|
567
|
-
const key = `${keyPrefix}-${nextId2.current}`;
|
|
568
|
-
nextId2.current += 1;
|
|
569
|
-
const newEntry = {
|
|
570
|
-
key,
|
|
571
|
-
open: true,
|
|
572
|
-
promise,
|
|
573
|
-
Component,
|
|
574
|
-
payload,
|
|
575
|
-
onClose,
|
|
576
|
-
resolve
|
|
577
|
-
};
|
|
578
|
-
dialogMetadata.current.set(promise, newEntry);
|
|
579
|
-
setStack((prevStack) => [...prevStack, newEntry]);
|
|
580
|
-
return promise;
|
|
581
|
-
});
|
|
582
|
-
const closeDialogUi = (0, import_useEventCallback2.default)(function closeDialogUi2(dialog) {
|
|
583
|
-
setStack(
|
|
584
|
-
(prevStack) => prevStack.map((entry) => entry.promise === dialog ? __spreadProps(__spreadValues({}, entry), { open: false }) : entry)
|
|
585
|
-
);
|
|
586
|
-
setTimeout(() => {
|
|
587
|
-
setStack((prevStack) => prevStack.filter((entry) => entry.promise !== dialog));
|
|
588
|
-
}, unmountAfter);
|
|
589
|
-
});
|
|
590
|
-
const closeDialog = (0, import_useEventCallback2.default)(async function closeDialog2(dialog, result) {
|
|
591
|
-
const entryToClose = dialogMetadata.current.get(dialog);
|
|
592
|
-
(0, import_invariant2.default)(entryToClose, "dialog not found");
|
|
593
|
-
try {
|
|
594
|
-
await entryToClose.onClose(result);
|
|
595
|
-
} finally {
|
|
596
|
-
entryToClose.resolve(result);
|
|
597
|
-
closeDialogUi(dialog);
|
|
598
|
-
}
|
|
599
|
-
return dialog;
|
|
600
|
-
});
|
|
601
|
-
const contextValue = React9.useMemo(
|
|
602
|
-
() => ({ open: requestDialog, close: closeDialog }),
|
|
603
|
-
[requestDialog, closeDialog]
|
|
604
|
-
);
|
|
605
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(DialogsContext.Provider, { value: contextValue, children: [
|
|
606
|
-
children,
|
|
607
|
-
stack.map(({ key, open, Component, payload, promise }) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
608
|
-
Component,
|
|
609
|
-
{
|
|
610
|
-
payload,
|
|
611
|
-
open,
|
|
612
|
-
onClose: async (result) => {
|
|
613
|
-
await closeDialog(promise, result);
|
|
614
|
-
}
|
|
615
|
-
},
|
|
616
|
-
key
|
|
617
|
-
))
|
|
618
|
-
] });
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
// src/toolpad-core/AppProvider/AppThemeProvider.tsx
|
|
622
|
-
var React11 = __toESM(require("react"));
|
|
623
|
-
var import_material2 = require("@mui/material");
|
|
624
|
-
var import_styles2 = require("@mui/material/styles");
|
|
625
|
-
var import_InitColorSchemeScript = __toESM(require("@mui/material/InitColorSchemeScript"));
|
|
626
|
-
var import_CssBaseline = __toESM(require("@mui/material/CssBaseline"));
|
|
627
|
-
var import_invariant3 = __toESM(require("invariant"));
|
|
628
|
-
|
|
629
|
-
// src/toolpad-core/persistence/useStorageState.tsx
|
|
630
|
-
var React10 = __toESM(require("react"));
|
|
631
|
-
|
|
632
|
-
// src/toolpad-core/persistence/codec.tsx
|
|
633
|
-
var CODEC_STRING = {
|
|
634
|
-
parse: (value) => value,
|
|
635
|
-
stringify: (value) => value
|
|
636
|
-
};
|
|
637
|
-
|
|
638
|
-
// src/toolpad-core/persistence/useStorageState.tsx
|
|
639
|
-
var currentTabChangeListeners = /* @__PURE__ */ new Map();
|
|
640
|
-
function onCurrentTabStorageChange(key, handler) {
|
|
641
|
-
let listeners = currentTabChangeListeners.get(key);
|
|
642
|
-
if (!listeners) {
|
|
643
|
-
listeners = /* @__PURE__ */ new Set();
|
|
644
|
-
currentTabChangeListeners.set(key, listeners);
|
|
645
|
-
}
|
|
646
|
-
listeners.add(handler);
|
|
647
|
-
}
|
|
648
|
-
function offCurrentTabStorageChange(key, handler) {
|
|
649
|
-
const listeners = currentTabChangeListeners.get(key);
|
|
650
|
-
if (!listeners) {
|
|
651
|
-
return;
|
|
652
|
-
}
|
|
653
|
-
listeners.delete(handler);
|
|
654
|
-
if (listeners.size === 0) {
|
|
655
|
-
currentTabChangeListeners.delete(key);
|
|
656
|
-
}
|
|
657
|
-
}
|
|
658
|
-
function emitCurrentTabStorageChange(key) {
|
|
659
|
-
const listeners = currentTabChangeListeners.get(key);
|
|
660
|
-
if (listeners) {
|
|
661
|
-
listeners.forEach((listener) => listener());
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
if (typeof window !== "undefined") {
|
|
665
|
-
const origSetItem = window.localStorage.setItem;
|
|
666
|
-
window.localStorage.setItem = function setItem(key, value) {
|
|
667
|
-
const result = origSetItem.call(this, key, value);
|
|
668
|
-
emitCurrentTabStorageChange(key);
|
|
669
|
-
return result;
|
|
670
|
-
};
|
|
671
|
-
}
|
|
672
|
-
function subscribe(area, key, callback) {
|
|
673
|
-
if (!key) {
|
|
674
|
-
return () => {
|
|
675
|
-
};
|
|
676
|
-
}
|
|
677
|
-
const storageHandler = (event) => {
|
|
678
|
-
if (event.storageArea === area && event.key === key) {
|
|
679
|
-
callback();
|
|
680
|
-
}
|
|
681
|
-
};
|
|
682
|
-
window.addEventListener("storage", storageHandler);
|
|
683
|
-
onCurrentTabStorageChange(key, callback);
|
|
684
|
-
return () => {
|
|
685
|
-
window.removeEventListener("storage", storageHandler);
|
|
686
|
-
offCurrentTabStorageChange(key, callback);
|
|
687
|
-
};
|
|
688
|
-
}
|
|
689
|
-
function getSnapshot(area, key) {
|
|
690
|
-
if (!key) {
|
|
691
|
-
return null;
|
|
692
|
-
}
|
|
693
|
-
try {
|
|
694
|
-
return area.getItem(key);
|
|
695
|
-
} catch (e) {
|
|
696
|
-
return null;
|
|
697
|
-
}
|
|
698
|
-
}
|
|
699
|
-
function setValue(area, key, value) {
|
|
700
|
-
if (!key) {
|
|
701
|
-
return;
|
|
702
|
-
}
|
|
703
|
-
try {
|
|
704
|
-
if (value === null) {
|
|
705
|
-
area.removeItem(key);
|
|
706
|
-
} else {
|
|
707
|
-
area.setItem(key, String(value));
|
|
708
|
-
}
|
|
709
|
-
} catch (e) {
|
|
710
|
-
return;
|
|
711
|
-
}
|
|
712
|
-
emitCurrentTabStorageChange(key);
|
|
713
|
-
}
|
|
714
|
-
var serverValue = [null, () => {
|
|
715
|
-
}];
|
|
716
|
-
function useStorageStateServer() {
|
|
717
|
-
return serverValue;
|
|
718
|
-
}
|
|
719
|
-
function encode(codec, value) {
|
|
720
|
-
return value === null ? null : codec.stringify(value);
|
|
721
|
-
}
|
|
722
|
-
function decode(codec, value) {
|
|
723
|
-
return value === null ? null : codec.parse(value);
|
|
724
|
-
}
|
|
725
|
-
var getKeyServerSnapshot = () => null;
|
|
726
|
-
function useStorageState(area, key, initializer = null, options) {
|
|
727
|
-
var _a;
|
|
728
|
-
const codec = (_a = options == null ? void 0 : options.codec) != null ? _a : CODEC_STRING;
|
|
729
|
-
const [initialValue] = React10.useState(initializer);
|
|
730
|
-
const encodedInitialValue = React10.useMemo(
|
|
731
|
-
() => encode(codec, initialValue),
|
|
732
|
-
[codec, initialValue]
|
|
733
|
-
);
|
|
734
|
-
const subscribeKey = React10.useCallback(
|
|
735
|
-
(callback) => subscribe(area, key, callback),
|
|
736
|
-
[area, key]
|
|
737
|
-
);
|
|
738
|
-
const getKeySnapshot = React10.useCallback(
|
|
739
|
-
() => {
|
|
740
|
-
var _a2;
|
|
741
|
-
return (_a2 = getSnapshot(area, key)) != null ? _a2 : encodedInitialValue;
|
|
742
|
-
},
|
|
743
|
-
[area, encodedInitialValue, key]
|
|
744
|
-
);
|
|
745
|
-
const encodedStoredValue = React10.useSyncExternalStore(
|
|
746
|
-
subscribeKey,
|
|
747
|
-
getKeySnapshot,
|
|
748
|
-
getKeyServerSnapshot
|
|
749
|
-
);
|
|
750
|
-
const storedValue = React10.useMemo(
|
|
751
|
-
() => decode(codec, encodedStoredValue),
|
|
752
|
-
[codec, encodedStoredValue]
|
|
753
|
-
);
|
|
754
|
-
const setStoredValue = React10.useCallback(
|
|
755
|
-
(value) => {
|
|
756
|
-
const valueToStore = value instanceof Function ? value(storedValue) : value;
|
|
757
|
-
const encodedValueToStore = encode(codec, valueToStore);
|
|
758
|
-
setValue(area, key, encodedValueToStore);
|
|
759
|
-
},
|
|
760
|
-
[area, codec, storedValue, key]
|
|
761
|
-
);
|
|
762
|
-
const [nonStoredValue, setNonStoredValue] = React10.useState(initialValue);
|
|
763
|
-
if (!key) {
|
|
764
|
-
return [nonStoredValue, setNonStoredValue];
|
|
765
|
-
}
|
|
766
|
-
return [storedValue, setStoredValue];
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
// src/toolpad-core/useLocalStorageState/useLocalStorageState.tsx
|
|
770
|
-
var useLocalStorageStateBrowser = (...args) => useStorageState(window.localStorage, ...args);
|
|
771
|
-
var useLocalStorageState = typeof window === "undefined" ? useStorageStateServer : useLocalStorageStateBrowser;
|
|
772
|
-
|
|
773
|
-
// src/toolpad-core/AppProvider/AppThemeProvider.tsx
|
|
774
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
775
|
-
var COLOR_SCHEME_STORAGE_KEY = "toolpad-color-scheme";
|
|
776
|
-
var MODE_STORAGE_KEY = "toolpad-mode";
|
|
777
|
-
function usePreferredMode(window2) {
|
|
778
|
-
const prefersDarkMode = (0, import_material2.useMediaQuery)(
|
|
779
|
-
"(prefers-color-scheme: dark)",
|
|
780
|
-
window2 && {
|
|
781
|
-
matchMedia: window2.matchMedia
|
|
782
|
-
}
|
|
783
|
-
);
|
|
784
|
-
return prefersDarkMode ? "dark" : "light";
|
|
785
|
-
}
|
|
786
|
-
function isCssVarsTheme(theme) {
|
|
787
|
-
return "vars" in theme;
|
|
788
|
-
}
|
|
789
|
-
function LegacyThemeProvider(props) {
|
|
790
|
-
const { children, theme, window: appWindow } = props;
|
|
791
|
-
(0, import_invariant3.default)(!isCssVarsTheme(theme), "This provider only accepts legacy themes.");
|
|
792
|
-
const isDualTheme = "light" in theme || "dark" in theme;
|
|
793
|
-
const preferredMode = usePreferredMode(appWindow);
|
|
794
|
-
const [userMode, setUserMode] = useLocalStorageState(MODE_STORAGE_KEY, "system");
|
|
795
|
-
const paletteMode = !userMode || userMode === "system" ? preferredMode : userMode;
|
|
796
|
-
const dualAwareTheme = React11.useMemo(
|
|
797
|
-
() => {
|
|
798
|
-
var _a;
|
|
799
|
-
return isDualTheme ? (_a = theme[paletteMode === "dark" ? "dark" : "light"]) != null ? _a : theme[paletteMode === "dark" ? "light" : "dark"] : theme;
|
|
800
|
-
},
|
|
801
|
-
[isDualTheme, paletteMode, theme]
|
|
802
|
-
);
|
|
803
|
-
const paletteModeContextValue = React11.useMemo(
|
|
804
|
-
() => ({
|
|
805
|
-
paletteMode,
|
|
806
|
-
setPaletteMode: setUserMode,
|
|
807
|
-
isDualTheme
|
|
808
|
-
}),
|
|
809
|
-
[isDualTheme, paletteMode, setUserMode]
|
|
810
|
-
);
|
|
811
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_styles2.ThemeProvider, { theme: dualAwareTheme, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(PaletteModeContext.Provider, { value: paletteModeContextValue, children: [
|
|
812
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_CssBaseline.default, { enableColorScheme: true }),
|
|
813
|
-
children
|
|
814
|
-
] }) });
|
|
815
|
-
}
|
|
816
|
-
function CssVarsPaletteModeProvider(props) {
|
|
817
|
-
const { children, window: appWindow } = props;
|
|
818
|
-
const preferredMode = usePreferredMode(appWindow);
|
|
819
|
-
const { mode, setMode, allColorSchemes } = (0, import_styles2.useColorScheme)();
|
|
820
|
-
const paletteModeContextValue = React11.useMemo(() => {
|
|
821
|
-
return {
|
|
822
|
-
paletteMode: !mode || mode === "system" ? preferredMode : mode,
|
|
823
|
-
setPaletteMode: setMode,
|
|
824
|
-
isDualTheme: allColorSchemes.length > 1
|
|
825
|
-
};
|
|
826
|
-
}, [allColorSchemes, mode, preferredMode, setMode]);
|
|
827
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PaletteModeContext.Provider, { value: paletteModeContextValue, children });
|
|
828
|
-
}
|
|
829
|
-
function CssVarsThemeProvider(props) {
|
|
830
|
-
const { children, theme, window: appWindow, nonce } = props;
|
|
831
|
-
(0, import_invariant3.default)(isCssVarsTheme(theme), "This provider only accepts CSS vars themes.");
|
|
832
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
833
|
-
import_styles2.ThemeProvider,
|
|
834
|
-
{
|
|
835
|
-
theme,
|
|
836
|
-
documentNode: appWindow == null ? void 0 : appWindow.document,
|
|
837
|
-
colorSchemeNode: appWindow == null ? void 0 : appWindow.document.documentElement,
|
|
838
|
-
disableNestedContext: true,
|
|
839
|
-
colorSchemeStorageKey: COLOR_SCHEME_STORAGE_KEY,
|
|
840
|
-
modeStorageKey: MODE_STORAGE_KEY,
|
|
841
|
-
children: [
|
|
842
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
843
|
-
import_InitColorSchemeScript.default,
|
|
844
|
-
{
|
|
845
|
-
attribute: theme.colorSchemeSelector,
|
|
846
|
-
colorSchemeStorageKey: COLOR_SCHEME_STORAGE_KEY,
|
|
847
|
-
modeStorageKey: MODE_STORAGE_KEY,
|
|
848
|
-
nonce
|
|
849
|
-
}
|
|
850
|
-
),
|
|
851
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(CssVarsPaletteModeProvider, { window: appWindow, children: [
|
|
852
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_CssBaseline.default, { enableColorScheme: true }),
|
|
853
|
-
children
|
|
854
|
-
] })
|
|
855
|
-
]
|
|
856
|
-
}
|
|
857
|
-
);
|
|
858
|
-
}
|
|
859
|
-
function AppThemeProvider(props) {
|
|
860
|
-
const _a = props, { children, theme } = _a, rest = __objRest(_a, ["children", "theme"]);
|
|
861
|
-
const useCssVarsProvider = isCssVarsTheme(theme);
|
|
862
|
-
return useCssVarsProvider ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(CssVarsThemeProvider, __spreadProps(__spreadValues({ theme }, rest), { children })) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(LegacyThemeProvider, __spreadProps(__spreadValues({ theme }, rest), { children }));
|
|
863
|
-
}
|
|
864
|
-
|
|
865
|
-
// src/toolpad-core/AppProvider/AppProvider.tsx
|
|
866
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
867
|
-
var AuthenticationContext = React12.createContext(null);
|
|
868
|
-
var SessionContext = React12.createContext(null);
|
|
869
|
-
function createDefaultTheme() {
|
|
870
|
-
return (0, import_styles3.createTheme)({
|
|
871
|
-
cssVariables: {
|
|
872
|
-
colorSchemeSelector: "data-toolpad-color-scheme"
|
|
873
|
-
},
|
|
874
|
-
colorSchemes: { dark: true }
|
|
875
|
-
});
|
|
876
|
-
}
|
|
877
|
-
function AppProvider(props) {
|
|
878
|
-
const {
|
|
879
|
-
children,
|
|
880
|
-
theme = createDefaultTheme(),
|
|
881
|
-
branding = null,
|
|
882
|
-
navigation = [],
|
|
883
|
-
localeText,
|
|
884
|
-
router = null,
|
|
885
|
-
authentication = null,
|
|
886
|
-
session = null,
|
|
887
|
-
window: appWindow,
|
|
888
|
-
nonce
|
|
889
|
-
} = props;
|
|
890
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(WindowContext.Provider, { value: appWindow, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AuthenticationContext.Provider, { value: authentication, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SessionContext.Provider, { value: session, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RouterContext.Provider, { value: router, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(AppThemeProvider, { theme, window: appWindow, nonce, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(LocalizationProvider, { localeText, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(NotificationsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DialogsProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(BrandingContext.Provider, { value: branding, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(NavigationContext.Provider, { value: navigation, children }) }) }) }) }) }) }) }) }) });
|
|
891
|
-
}
|
|
892
|
-
AppProvider.propTypes = {
|
|
893
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
894
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
895
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
896
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
897
|
-
/**
|
|
898
|
-
* Authentication methods.
|
|
899
|
-
* @default null
|
|
900
|
-
*/
|
|
901
|
-
authentication: import_prop_types2.default.shape({
|
|
902
|
-
signIn: import_prop_types2.default.func.isRequired,
|
|
903
|
-
signOut: import_prop_types2.default.func.isRequired
|
|
904
|
-
}),
|
|
905
|
-
/**
|
|
906
|
-
* Branding options for the app.
|
|
907
|
-
* @default null
|
|
908
|
-
*/
|
|
909
|
-
branding: import_prop_types2.default.shape({
|
|
910
|
-
homeUrl: import_prop_types2.default.string,
|
|
911
|
-
logo: import_prop_types2.default.node,
|
|
912
|
-
title: import_prop_types2.default.string
|
|
913
|
-
}),
|
|
914
|
-
/**
|
|
915
|
-
* The content of the app provider.
|
|
916
|
-
*/
|
|
917
|
-
children: import_prop_types2.default.node,
|
|
918
|
-
/**
|
|
919
|
-
* Locale text for components
|
|
920
|
-
*/
|
|
921
|
-
localeText: import_prop_types2.default.object,
|
|
922
|
-
/**
|
|
923
|
-
* Navigation definition for the app. [Find out more](https://mui.com/toolpad/core/react-app-provider/#navigation).
|
|
924
|
-
* @default []
|
|
925
|
-
*/
|
|
926
|
-
navigation: import_prop_types2.default.arrayOf(
|
|
927
|
-
import_prop_types2.default.oneOfType([
|
|
928
|
-
import_prop_types2.default.shape({
|
|
929
|
-
action: import_prop_types2.default.node,
|
|
930
|
-
children: import_prop_types2.default.arrayOf(
|
|
931
|
-
import_prop_types2.default.oneOfType([
|
|
932
|
-
import_prop_types2.default.object,
|
|
933
|
-
import_prop_types2.default.shape({
|
|
934
|
-
kind: import_prop_types2.default.oneOf(["header"]).isRequired,
|
|
935
|
-
title: import_prop_types2.default.string.isRequired
|
|
936
|
-
}),
|
|
937
|
-
import_prop_types2.default.shape({
|
|
938
|
-
kind: import_prop_types2.default.oneOf(["divider"]).isRequired
|
|
939
|
-
})
|
|
940
|
-
]).isRequired
|
|
941
|
-
),
|
|
942
|
-
icon: import_prop_types2.default.node,
|
|
943
|
-
kind: import_prop_types2.default.oneOf(["page"]),
|
|
944
|
-
pattern: import_prop_types2.default.string,
|
|
945
|
-
segment: import_prop_types2.default.string,
|
|
946
|
-
title: import_prop_types2.default.string
|
|
947
|
-
}),
|
|
948
|
-
import_prop_types2.default.shape({
|
|
949
|
-
kind: import_prop_types2.default.oneOf(["header"]).isRequired,
|
|
950
|
-
title: import_prop_types2.default.string.isRequired
|
|
951
|
-
}),
|
|
952
|
-
import_prop_types2.default.shape({
|
|
953
|
-
kind: import_prop_types2.default.oneOf(["divider"]).isRequired
|
|
954
|
-
})
|
|
955
|
-
]).isRequired
|
|
956
|
-
),
|
|
957
|
-
/**
|
|
958
|
-
* The nonce to be used for inline scripts.
|
|
959
|
-
*/
|
|
960
|
-
nonce: import_prop_types2.default.string,
|
|
961
|
-
/**
|
|
962
|
-
* Router implementation used inside Toolpad components.
|
|
963
|
-
* @default null
|
|
964
|
-
*/
|
|
965
|
-
router: import_prop_types2.default.shape({
|
|
966
|
-
Link: import_prop_types2.default.elementType,
|
|
967
|
-
navigate: import_prop_types2.default.func.isRequired,
|
|
968
|
-
pathname: import_prop_types2.default.string.isRequired,
|
|
969
|
-
searchParams: import_prop_types2.default.instanceOf(URLSearchParams).isRequired
|
|
970
|
-
}),
|
|
971
|
-
/**
|
|
972
|
-
* Session info about the current user.
|
|
973
|
-
* @default null
|
|
974
|
-
*/
|
|
975
|
-
session: import_prop_types2.default.shape({
|
|
976
|
-
user: import_prop_types2.default.shape({
|
|
977
|
-
email: import_prop_types2.default.string,
|
|
978
|
-
id: import_prop_types2.default.string,
|
|
979
|
-
image: import_prop_types2.default.string,
|
|
980
|
-
name: import_prop_types2.default.string
|
|
981
|
-
})
|
|
982
|
-
}),
|
|
983
|
-
/**
|
|
984
|
-
* [Theme or themes](https://mui.com/toolpad/core/react-app-provider/#theming) to be used by the app in light/dark mode. A [CSS variables theme](https://mui.com/material-ui/customization/css-theme-variables/overview/) is recommended.
|
|
985
|
-
* @default createDefaultTheme()
|
|
986
|
-
*/
|
|
987
|
-
theme: import_prop_types2.default.object,
|
|
988
|
-
/**
|
|
989
|
-
* The window where the application is rendered.
|
|
990
|
-
* This is needed when rendering the app inside an iframe, for example.
|
|
991
|
-
* @default window
|
|
992
|
-
*/
|
|
993
|
-
window: import_prop_types2.default.object
|
|
994
|
-
};
|
|
995
|
-
|
|
996
|
-
// src/toolpad-core/Account/AccountLocaleContext.tsx
|
|
997
|
-
var React13 = __toESM(require("react"));
|
|
998
|
-
var AccountLocaleContext = React13.createContext(null);
|
|
999
|
-
|
|
1000
|
-
// src/toolpad-core/Account/SignInButton.tsx
|
|
1001
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1002
|
-
function SignInButton(props) {
|
|
1003
|
-
const authentication = React14.useContext(AuthenticationContext);
|
|
1004
|
-
const globalLocaleText = useLocaleText();
|
|
1005
|
-
const accountLocaleText = React14.useContext(AccountLocaleContext);
|
|
1006
|
-
const localeText = __spreadValues(__spreadValues({}, globalLocaleText), accountLocaleText);
|
|
1007
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1008
|
-
import_Button2.default,
|
|
1009
|
-
__spreadProps(__spreadValues({
|
|
1010
|
-
disableElevation: true,
|
|
1011
|
-
variant: "contained",
|
|
1012
|
-
size: "small",
|
|
1013
|
-
onClick: authentication == null ? void 0 : authentication.signIn,
|
|
1014
|
-
sx: {
|
|
1015
|
-
textTransform: "capitalize",
|
|
1016
|
-
filter: "opacity(0.9)",
|
|
1017
|
-
width: "50%",
|
|
1018
|
-
margin: (theme) => `${theme.spacing(1)} auto`,
|
|
1019
|
-
transition: "filter 0.2s ease-in",
|
|
1020
|
-
"&:hover": {
|
|
1021
|
-
filter: "opacity(1)"
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
}, props), {
|
|
1025
|
-
children: localeText == null ? void 0 : localeText.accountSignInLabel
|
|
1026
|
-
})
|
|
1027
|
-
);
|
|
1028
|
-
}
|
|
1029
|
-
SignInButton.propTypes = {
|
|
1030
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
1031
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
1032
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
1033
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
1034
|
-
/**
|
|
1035
|
-
* The content of the component.
|
|
1036
|
-
*/
|
|
1037
|
-
children: import_prop_types3.default.node
|
|
1038
|
-
};
|
|
1039
|
-
|
|
1040
|
-
// src/toolpad-core/Account/SignOutButton.tsx
|
|
1041
|
-
var React15 = __toESM(require("react"));
|
|
1042
|
-
var import_prop_types4 = __toESM(require("prop-types"));
|
|
1043
|
-
var import_Button3 = __toESM(require("@mui/material/Button"));
|
|
1044
|
-
var import_Logout = __toESM(require("@mui/icons-material/Logout"));
|
|
1045
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1046
|
-
function SignOutButton(props) {
|
|
1047
|
-
const authentication = React15.useContext(AuthenticationContext);
|
|
1048
|
-
const globalLocaleText = useLocaleText();
|
|
1049
|
-
const accountLocaleText = React15.useContext(AccountLocaleContext);
|
|
1050
|
-
const localeText = __spreadValues(__spreadValues({}, globalLocaleText), accountLocaleText);
|
|
1051
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1052
|
-
import_Button3.default,
|
|
1053
|
-
__spreadProps(__spreadValues({
|
|
1054
|
-
disabled: !authentication,
|
|
1055
|
-
variant: "outlined",
|
|
1056
|
-
size: "small",
|
|
1057
|
-
disableElevation: true,
|
|
1058
|
-
onClick: authentication == null ? void 0 : authentication.signOut,
|
|
1059
|
-
sx: {
|
|
1060
|
-
textTransform: "capitalize",
|
|
1061
|
-
fontWeight: "normal",
|
|
1062
|
-
filter: "opacity(0.9)",
|
|
1063
|
-
transition: "filter 0.2s ease-in",
|
|
1064
|
-
"&:hover": {
|
|
1065
|
-
filter: "opacity(1)"
|
|
1066
|
-
}
|
|
1067
|
-
},
|
|
1068
|
-
startIcon: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_Logout.default, {})
|
|
1069
|
-
}, props), {
|
|
1070
|
-
children: localeText == null ? void 0 : localeText.accountSignOutLabel
|
|
1071
|
-
})
|
|
1072
|
-
);
|
|
1073
|
-
}
|
|
1074
|
-
SignOutButton.propTypes = {
|
|
1075
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
1076
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
1077
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
1078
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
1079
|
-
/**
|
|
1080
|
-
* The content of the component.
|
|
1081
|
-
*/
|
|
1082
|
-
children: import_prop_types4.default.node
|
|
1083
|
-
};
|
|
1084
|
-
|
|
1085
|
-
// src/toolpad-core/Account/AccountPreview.tsx
|
|
1086
|
-
var React16 = __toESM(require("react"));
|
|
1087
|
-
var import_prop_types5 = __toESM(require("prop-types"));
|
|
1088
|
-
var import_Avatar = __toESM(require("@mui/material/Avatar"));
|
|
1089
|
-
var import_Typography = __toESM(require("@mui/material/Typography"));
|
|
1090
|
-
var import_Tooltip = __toESM(require("@mui/material/Tooltip"));
|
|
1091
|
-
var import_Stack = __toESM(require("@mui/material/Stack"));
|
|
1092
|
-
var import_IconButton = __toESM(require("@mui/material/IconButton"));
|
|
1093
|
-
var import_MoreVert = __toESM(require("@mui/icons-material/MoreVert"));
|
|
1094
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1095
|
-
function AccountPreview(props) {
|
|
1096
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1097
|
-
const { slots, variant = "condensed", slotProps, open, handleClick, sx } = props;
|
|
1098
|
-
const session = React16.useContext(SessionContext);
|
|
1099
|
-
const globalLocaleText = useLocaleText();
|
|
1100
|
-
const accountLocaleText = React16.useContext(AccountLocaleContext);
|
|
1101
|
-
const localeText = __spreadValues(__spreadValues({}, globalLocaleText), accountLocaleText);
|
|
1102
|
-
if (!session || !session.user) {
|
|
1103
|
-
return null;
|
|
1104
|
-
}
|
|
1105
|
-
const avatarContent = (slots == null ? void 0 : slots.avatar) ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(slots.avatar, {}) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1106
|
-
import_Avatar.default,
|
|
1107
|
-
__spreadValues({
|
|
1108
|
-
src: ((_a = session.user) == null ? void 0 : _a.image) || "",
|
|
1109
|
-
alt: ((_b = session.user) == null ? void 0 : _b.name) || ((_c = session.user) == null ? void 0 : _c.email) || "",
|
|
1110
|
-
sx: { height: variant === "expanded" ? 48 : 32, width: variant === "expanded" ? 48 : 32 }
|
|
1111
|
-
}, slotProps == null ? void 0 : slotProps.avatar)
|
|
1112
|
-
);
|
|
1113
|
-
if (variant === "expanded") {
|
|
1114
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_Stack.default, { direction: "row", justifyContent: "space-between", sx: __spreadValues({ py: 1, px: 2, gap: 2 }, sx), children: [
|
|
1115
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_Stack.default, { direction: "row", justifyContent: "flex-start", spacing: 2, overflow: "hidden", children: [
|
|
1116
|
-
avatarContent,
|
|
1117
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_Stack.default, { direction: "column", justifyContent: "space-evenly", overflow: "hidden", children: [
|
|
1118
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_Typography.default, { variant: "body2", fontWeight: "bolder", noWrap: true, children: (_d = session.user) == null ? void 0 : _d.name }),
|
|
1119
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_Typography.default, { variant: "caption", noWrap: true, children: (_e = session.user) == null ? void 0 : _e.email })
|
|
1120
|
-
] })
|
|
1121
|
-
] }),
|
|
1122
|
-
handleClick && ((slots == null ? void 0 : slots.moreIconButton) ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(slots.moreIconButton, {}) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1123
|
-
import_IconButton.default,
|
|
1124
|
-
__spreadProps(__spreadValues({
|
|
1125
|
-
size: "small",
|
|
1126
|
-
onClick: handleClick
|
|
1127
|
-
}, slotProps == null ? void 0 : slotProps.moreIconButton), {
|
|
1128
|
-
sx: __spreadValues({ alignSelf: "center" }, (_f = slotProps == null ? void 0 : slotProps.moreIconButton) == null ? void 0 : _f.sx),
|
|
1129
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_MoreVert.default, { fontSize: "small" })
|
|
1130
|
-
})
|
|
1131
|
-
))
|
|
1132
|
-
] });
|
|
1133
|
-
}
|
|
1134
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_Tooltip.default, { title: (_g = session.user.name) != null ? _g : accountLocaleText == null ? void 0 : accountLocaleText.accountPreviewTitle, children: (slots == null ? void 0 : slots.avatarIconButton) ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(slots.avatarIconButton, __spreadValues({}, slotProps == null ? void 0 : slotProps.avatarIconButton)) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_Stack.default, { sx: __spreadValues({ py: 0.5 }, sx), children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
1135
|
-
import_IconButton.default,
|
|
1136
|
-
__spreadProps(__spreadValues({
|
|
1137
|
-
onClick: handleClick,
|
|
1138
|
-
"aria-label": localeText == null ? void 0 : localeText.accountPreviewIconButtonLabel,
|
|
1139
|
-
size: "small",
|
|
1140
|
-
"aria-controls": open ? "account-menu" : void 0,
|
|
1141
|
-
"aria-haspopup": "true",
|
|
1142
|
-
"aria-expanded": open ? "true" : void 0
|
|
1143
|
-
}, slotProps == null ? void 0 : slotProps.avatarIconButton), {
|
|
1144
|
-
sx: __spreadValues({ width: "fit-content", margin: "0 auto" }, (_h = slotProps == null ? void 0 : slotProps.avatarIconButton) == null ? void 0 : _h.sx),
|
|
1145
|
-
children: avatarContent
|
|
1146
|
-
})
|
|
1147
|
-
) }) });
|
|
1148
|
-
}
|
|
1149
|
-
AccountPreview.propTypes = {
|
|
1150
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
1151
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
1152
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
1153
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
1154
|
-
/**
|
|
1155
|
-
* The handler used when the preview is expanded
|
|
1156
|
-
*/
|
|
1157
|
-
handleClick: import_prop_types5.default.func,
|
|
1158
|
-
/**
|
|
1159
|
-
* The state of the Account popover
|
|
1160
|
-
* @default false
|
|
1161
|
-
*/
|
|
1162
|
-
open: import_prop_types5.default.bool,
|
|
1163
|
-
/**
|
|
1164
|
-
* The props used for each slot inside.
|
|
1165
|
-
*/
|
|
1166
|
-
slotProps: import_prop_types5.default.shape({
|
|
1167
|
-
avatar: import_prop_types5.default.object,
|
|
1168
|
-
avatarIconButton: import_prop_types5.default.object,
|
|
1169
|
-
moreIconButton: import_prop_types5.default.object
|
|
1170
|
-
}),
|
|
1171
|
-
/**
|
|
1172
|
-
* The components used for each slot inside.
|
|
1173
|
-
*/
|
|
1174
|
-
slots: import_prop_types5.default.shape({
|
|
1175
|
-
avatar: import_prop_types5.default.elementType,
|
|
1176
|
-
avatarIconButton: import_prop_types5.default.elementType,
|
|
1177
|
-
moreIconButton: import_prop_types5.default.elementType
|
|
1178
|
-
}),
|
|
1179
|
-
/**
|
|
1180
|
-
* The prop used to customize the styling of the preview
|
|
1181
|
-
*/
|
|
1182
|
-
sx: import_prop_types5.default.oneOfType([
|
|
1183
|
-
import_prop_types5.default.arrayOf(import_prop_types5.default.oneOfType([import_prop_types5.default.func, import_prop_types5.default.object, import_prop_types5.default.bool])),
|
|
1184
|
-
import_prop_types5.default.func,
|
|
1185
|
-
import_prop_types5.default.object
|
|
1186
|
-
]),
|
|
1187
|
-
/**
|
|
1188
|
-
* The type of account details to display.
|
|
1189
|
-
* @property {'condensed'} condensed - Shows only the user's avatar.
|
|
1190
|
-
* @property {'expanded'} expanded - Displays the user's avatar, name, and email if available.
|
|
1191
|
-
* @default 'condensed'
|
|
1192
|
-
*/
|
|
1193
|
-
variant: import_prop_types5.default.oneOf(["condensed", "expanded"])
|
|
1194
|
-
};
|
|
1195
|
-
|
|
1196
|
-
// src/toolpad-core/Account/AccountPopoverHeader.tsx
|
|
1197
|
-
var import_prop_types6 = __toESM(require("prop-types"));
|
|
1198
|
-
var import_Stack2 = __toESM(require("@mui/material/Stack"));
|
|
1199
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
1200
|
-
function AccountPopoverHeader(props) {
|
|
1201
|
-
const _a = props, { children } = _a, rest = __objRest(_a, ["children"]);
|
|
1202
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Stack2.default, __spreadProps(__spreadValues({}, rest), { children }));
|
|
1203
|
-
}
|
|
1204
|
-
AccountPopoverHeader.propTypes = {
|
|
1205
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
1206
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
1207
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
1208
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
1209
|
-
/**
|
|
1210
|
-
* The content of the component.
|
|
1211
|
-
*/
|
|
1212
|
-
children: import_prop_types6.default.node
|
|
1213
|
-
};
|
|
1214
|
-
|
|
1215
|
-
// src/toolpad-core/Account/AccountPopoverFooter.tsx
|
|
1216
|
-
var import_prop_types7 = __toESM(require("prop-types"));
|
|
1217
|
-
var import_Box = __toESM(require("@mui/material/Box"));
|
|
1218
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1219
|
-
function AccountPopoverFooter(props) {
|
|
1220
|
-
const _a = props, { children } = _a, rest = __objRest(_a, ["children"]);
|
|
1221
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1222
|
-
import_Box.default,
|
|
1223
|
-
__spreadProps(__spreadValues({}, rest), {
|
|
1224
|
-
sx: __spreadValues({ display: "flex", flexDirection: "row", p: 1, justifyContent: "flex-end" }, rest.sx),
|
|
1225
|
-
children
|
|
1226
|
-
})
|
|
1227
|
-
);
|
|
1228
|
-
}
|
|
1229
|
-
AccountPopoverFooter.propTypes = {
|
|
1230
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
1231
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
1232
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
1233
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
1234
|
-
/**
|
|
1235
|
-
* @ignore
|
|
1236
|
-
*/
|
|
1237
|
-
children: import_prop_types7.default.node,
|
|
1238
|
-
/**
|
|
1239
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
1240
|
-
*/
|
|
1241
|
-
sx: import_prop_types7.default.oneOfType([
|
|
1242
|
-
import_prop_types7.default.arrayOf(import_prop_types7.default.oneOfType([import_prop_types7.default.func, import_prop_types7.default.object, import_prop_types7.default.bool])),
|
|
1243
|
-
import_prop_types7.default.func,
|
|
1244
|
-
import_prop_types7.default.object
|
|
1245
|
-
])
|
|
1246
|
-
};
|
|
1247
|
-
|
|
1248
|
-
// src/toolpad-core/Account/Account.tsx
|
|
1249
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
1250
|
-
var defaultAccountLocaleText = {
|
|
1251
|
-
accountPreviewIconButtonLabel: "Current User",
|
|
1252
|
-
accountPreviewTitle: "Account",
|
|
1253
|
-
accountSignInLabel: "Sign in",
|
|
1254
|
-
accountSignOutLabel: "Sign out"
|
|
1255
|
-
};
|
|
1256
|
-
function Account(props) {
|
|
1257
|
-
var _a;
|
|
1258
|
-
const { localeText: propsLocaleText } = props;
|
|
1259
|
-
const globalLocaleText = useLocaleText();
|
|
1260
|
-
const localeText = React17.useMemo(
|
|
1261
|
-
() => __spreadValues(__spreadValues(__spreadValues({}, defaultAccountLocaleText), globalLocaleText), propsLocaleText),
|
|
1262
|
-
[globalLocaleText, propsLocaleText]
|
|
1263
|
-
);
|
|
1264
|
-
const { slots, slotProps } = props;
|
|
1265
|
-
const [anchorEl, setAnchorEl] = React17.useState(null);
|
|
1266
|
-
const session = React17.useContext(SessionContext);
|
|
1267
|
-
const authentication = React17.useContext(AuthenticationContext);
|
|
1268
|
-
const open = Boolean(anchorEl);
|
|
1269
|
-
const handleClick = (event) => {
|
|
1270
|
-
setAnchorEl(event.currentTarget);
|
|
1271
|
-
};
|
|
1272
|
-
const handleClose = () => {
|
|
1273
|
-
setAnchorEl(null);
|
|
1274
|
-
};
|
|
1275
|
-
if (!authentication) {
|
|
1276
|
-
return null;
|
|
1277
|
-
}
|
|
1278
|
-
let accountContent = null;
|
|
1279
|
-
if (!(session == null ? void 0 : session.user)) {
|
|
1280
|
-
accountContent = (slots == null ? void 0 : slots.signInButton) ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(slots.signInButton, { onClick: authentication.signIn }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SignInButton, __spreadValues({}, slotProps == null ? void 0 : slotProps.signInButton));
|
|
1281
|
-
} else {
|
|
1282
|
-
accountContent = /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(React17.Fragment, { children: [
|
|
1283
|
-
(slots == null ? void 0 : slots.preview) ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(slots.preview, { handleClick, open }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1284
|
-
AccountPreview,
|
|
1285
|
-
__spreadValues({
|
|
1286
|
-
variant: "condensed",
|
|
1287
|
-
handleClick,
|
|
1288
|
-
open
|
|
1289
|
-
}, slotProps == null ? void 0 : slotProps.preview)
|
|
1290
|
-
),
|
|
1291
|
-
(slots == null ? void 0 : slots.popover) ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1292
|
-
slots.popover,
|
|
1293
|
-
__spreadValues({
|
|
1294
|
-
open,
|
|
1295
|
-
onClick: handleClick,
|
|
1296
|
-
onClose: handleClose
|
|
1297
|
-
}, slotProps == null ? void 0 : slotProps.popover)
|
|
1298
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1299
|
-
import_Popover.default,
|
|
1300
|
-
__spreadProps(__spreadValues({
|
|
1301
|
-
anchorEl,
|
|
1302
|
-
id: "account-menu",
|
|
1303
|
-
open,
|
|
1304
|
-
onClose: handleClose,
|
|
1305
|
-
onClick: handleClose,
|
|
1306
|
-
transformOrigin: { horizontal: "right", vertical: "top" },
|
|
1307
|
-
anchorOrigin: { horizontal: "right", vertical: "bottom" }
|
|
1308
|
-
}, slotProps == null ? void 0 : slotProps.popover), {
|
|
1309
|
-
slotProps: __spreadValues({
|
|
1310
|
-
paper: {
|
|
1311
|
-
elevation: 0,
|
|
1312
|
-
sx: {
|
|
1313
|
-
overflow: "visible",
|
|
1314
|
-
filter: (theme) => `drop-shadow(0px 2px 8px ${theme.palette.mode === "dark" ? "rgba(255,255,255,0.10)" : "rgba(0,0,0,0.32)"})`,
|
|
1315
|
-
mt: 1,
|
|
1316
|
-
"&::before": {
|
|
1317
|
-
content: '""',
|
|
1318
|
-
display: "block",
|
|
1319
|
-
position: "absolute",
|
|
1320
|
-
top: 0,
|
|
1321
|
-
right: 14,
|
|
1322
|
-
width: 10,
|
|
1323
|
-
height: 10,
|
|
1324
|
-
bgcolor: "background.paper",
|
|
1325
|
-
transform: "translateY(-50%) rotate(45deg)",
|
|
1326
|
-
zIndex: 0
|
|
1327
|
-
}
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
}, (_a = slotProps == null ? void 0 : slotProps.popover) == null ? void 0 : _a.slotProps),
|
|
1331
|
-
children: (slots == null ? void 0 : slots.popoverContent) ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(slots.popoverContent, __spreadValues({}, slotProps == null ? void 0 : slotProps.popoverContent)) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_Stack3.default, __spreadProps(__spreadValues({ direction: "column" }, slotProps == null ? void 0 : slotProps.popoverContent), { children: [
|
|
1332
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AccountPopoverHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AccountPreview, { variant: "expanded" }) }),
|
|
1333
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_Divider.default, {}),
|
|
1334
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AccountPopoverFooter, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(SignOutButton, __spreadValues({}, slotProps == null ? void 0 : slotProps.signOutButton)) })
|
|
1335
|
-
] }))
|
|
1336
|
-
})
|
|
1337
|
-
)
|
|
1338
|
-
] });
|
|
1339
|
-
}
|
|
1340
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(AccountLocaleContext.Provider, { value: localeText, children: accountContent });
|
|
1341
|
-
}
|
|
1342
|
-
Account.propTypes = {
|
|
1343
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
1344
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
1345
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
1346
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
1347
|
-
/**
|
|
1348
|
-
* The labels for the account component.
|
|
1349
|
-
*/
|
|
1350
|
-
localeText: import_prop_types8.default.object,
|
|
1351
|
-
/**
|
|
1352
|
-
* The props used for each slot inside.
|
|
1353
|
-
*/
|
|
1354
|
-
slotProps: import_prop_types8.default.shape({
|
|
1355
|
-
popover: import_prop_types8.default.object,
|
|
1356
|
-
popoverContent: import_prop_types8.default.object,
|
|
1357
|
-
preview: import_prop_types8.default.shape({
|
|
1358
|
-
handleClick: import_prop_types8.default.func,
|
|
1359
|
-
open: import_prop_types8.default.bool,
|
|
1360
|
-
slotProps: import_prop_types8.default.shape({
|
|
1361
|
-
avatar: import_prop_types8.default.object,
|
|
1362
|
-
avatarIconButton: import_prop_types8.default.object,
|
|
1363
|
-
moreIconButton: import_prop_types8.default.object
|
|
1364
|
-
}),
|
|
1365
|
-
slots: import_prop_types8.default.shape({
|
|
1366
|
-
avatar: import_prop_types8.default.elementType,
|
|
1367
|
-
avatarIconButton: import_prop_types8.default.elementType,
|
|
1368
|
-
moreIconButton: import_prop_types8.default.elementType
|
|
1369
|
-
}),
|
|
1370
|
-
sx: import_prop_types8.default.oneOfType([
|
|
1371
|
-
import_prop_types8.default.arrayOf(import_prop_types8.default.oneOfType([import_prop_types8.default.func, import_prop_types8.default.object, import_prop_types8.default.bool])),
|
|
1372
|
-
import_prop_types8.default.func,
|
|
1373
|
-
import_prop_types8.default.object
|
|
1374
|
-
]),
|
|
1375
|
-
variant: import_prop_types8.default.oneOf(["condensed", "expanded"])
|
|
1376
|
-
}),
|
|
1377
|
-
signInButton: import_prop_types8.default.object,
|
|
1378
|
-
signOutButton: import_prop_types8.default.object
|
|
1379
|
-
}),
|
|
1380
|
-
/**
|
|
1381
|
-
* The components used for each slot inside.
|
|
1382
|
-
*/
|
|
1383
|
-
slots: import_prop_types8.default.shape({
|
|
1384
|
-
popover: import_prop_types8.default.elementType,
|
|
1385
|
-
popoverContent: import_prop_types8.default.elementType,
|
|
1386
|
-
preview: import_prop_types8.default.elementType,
|
|
1387
|
-
signInButton: import_prop_types8.default.elementType,
|
|
1388
|
-
signOutButton: import_prop_types8.default.elementType
|
|
1389
|
-
})
|
|
1390
|
-
};
|
|
1391
|
-
|
|
1392
|
-
// src/toolpad-core/DashboardLayout/DashboardLayout.tsx
|
|
1393
|
-
var React26 = __toESM(require("react"));
|
|
1394
|
-
var import_prop_types11 = __toESM(require("prop-types"));
|
|
1395
|
-
var import_styles5 = require("@mui/material/styles");
|
|
1396
|
-
var import_useMediaQuery = __toESM(require("@mui/material/useMediaQuery"));
|
|
1397
|
-
var import_Box4 = __toESM(require("@mui/material/Box"));
|
|
1398
|
-
var import_Drawer = __toESM(require("@mui/material/Drawer"));
|
|
1399
|
-
var import_Toolbar2 = __toESM(require("@mui/material/Toolbar"));
|
|
1400
|
-
|
|
1401
|
-
// src/toolpad-core/DashboardLayout/DashboardHeader.tsx
|
|
1402
|
-
var React22 = __toESM(require("react"));
|
|
1403
|
-
var import_prop_types9 = __toESM(require("prop-types"));
|
|
1404
|
-
var import_styles4 = require("@mui/material/styles");
|
|
1405
|
-
var import_Box2 = __toESM(require("@mui/material/Box"));
|
|
1406
|
-
var import_AppBar = __toESM(require("@mui/material/AppBar"));
|
|
1407
|
-
var import_IconButton3 = __toESM(require("@mui/material/IconButton"));
|
|
1408
|
-
var import_Toolbar = __toESM(require("@mui/material/Toolbar"));
|
|
1409
|
-
var import_Tooltip3 = __toESM(require("@mui/material/Tooltip"));
|
|
1410
|
-
var import_Menu = __toESM(require("@mui/icons-material/Menu"));
|
|
1411
|
-
var import_MenuOpen = __toESM(require("@mui/icons-material/MenuOpen"));
|
|
1412
|
-
var import_Stack6 = __toESM(require("@mui/material/Stack"));
|
|
1413
|
-
|
|
1414
|
-
// src/toolpad-core/DashboardLayout/AppTitle.tsx
|
|
1415
|
-
var import_Typography2 = __toESM(require("@mui/material/Typography"));
|
|
1416
|
-
var import_Stack4 = __toESM(require("@mui/material/Stack"));
|
|
1417
|
-
var import_material3 = require("@mui/material");
|
|
1418
|
-
|
|
1419
|
-
// src/toolpad-core/shared/Link.tsx
|
|
1420
|
-
var React18 = __toESM(require("react"));
|
|
1421
|
-
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1422
|
-
var DefaultLink = React18.forwardRef(function Link(props, ref) {
|
|
1423
|
-
const _a = props, { children, href, onClick, history: history2 } = _a, rest = __objRest(_a, ["children", "href", "onClick", "history"]);
|
|
1424
|
-
const routerContext = React18.useContext(RouterContext);
|
|
1425
|
-
const handleLinkClick = React18.useMemo(() => {
|
|
1426
|
-
if (!routerContext) {
|
|
1427
|
-
return onClick;
|
|
1428
|
-
}
|
|
1429
|
-
return (event) => {
|
|
1430
|
-
event.preventDefault();
|
|
1431
|
-
const url = new URL(event.currentTarget.href);
|
|
1432
|
-
routerContext.navigate(url.pathname, { history: history2 });
|
|
1433
|
-
onClick == null ? void 0 : onClick(event);
|
|
1434
|
-
};
|
|
1435
|
-
}, [routerContext, onClick, history2]);
|
|
1436
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("a", __spreadProps(__spreadValues({ ref, href }, rest), { onClick: handleLinkClick, children }));
|
|
14
|
+
Object.defineProperty(exports, "AccountPopoverFooter", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return chunkSITC3EZQ_js.AccountPopoverFooter; }
|
|
1437
17
|
});
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
const LinkComponent = (_a = routerContext == null ? void 0 : routerContext.Link) != null ? _a : DefaultLink;
|
|
1442
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(LinkComponent, __spreadProps(__spreadValues({ ref }, props), { children: props.children }));
|
|
18
|
+
Object.defineProperty(exports, "AccountPopoverHeader", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return chunkSITC3EZQ_js.AccountPopoverHeader; }
|
|
1443
21
|
});
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
function ToolpadLogo({ size = 40 }) {
|
|
1448
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("svg", { width: size, height: size, fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
1449
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("g", { mask: "url(#a)", children: [
|
|
1450
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M22.74 27.73v-7.6l6.64-3.79v7.6l-6.64 3.79Z", fill: "#007FFF" }),
|
|
1451
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M16.1 23.93v-7.59l6.64 3.8v7.59l-6.65-3.8Z", fill: "#39F" }),
|
|
1452
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "m16.1 16.34 6.64-3.8 6.64 3.8-6.64 3.8-6.65-3.8Z", fill: "#A5D8FF" })
|
|
1453
|
-
] }),
|
|
1454
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1455
|
-
"mask",
|
|
1456
|
-
{
|
|
1457
|
-
id: "b",
|
|
1458
|
-
style: {
|
|
1459
|
-
maskType: "alpha"
|
|
1460
|
-
},
|
|
1461
|
-
maskUnits: "userSpaceOnUse",
|
|
1462
|
-
x: "8",
|
|
1463
|
-
y: "17",
|
|
1464
|
-
width: "14",
|
|
1465
|
-
height: "15",
|
|
1466
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1467
|
-
"path",
|
|
1468
|
-
{
|
|
1469
|
-
d: "M8.5 22.3c0-1.05.56-2 1.46-2.53l3.75-2.14c.89-.5 1.98-.5 2.87 0l3.75 2.14a2.9 2.9 0 0 1 1.46 2.52v4.23c0 1.04-.56 2-1.46 2.52l-3.75 2.14c-.89.5-1.98.5-2.87 0l-3.75-2.14a2.9 2.9 0 0 1-1.46-2.52v-4.23Z",
|
|
1470
|
-
fill: "#D7DCE1"
|
|
1471
|
-
}
|
|
1472
|
-
)
|
|
1473
|
-
}
|
|
1474
|
-
),
|
|
1475
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("g", { mask: "url(#b)", children: [
|
|
1476
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M15.14 32v-7.6l6.65-3.8v7.6L15.14 32Z", fill: "#007FFF" }),
|
|
1477
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M8.5 28.2v-7.6l6.64 3.8V32L8.5 28.2Z", fill: "#39F" }),
|
|
1478
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "m8.5 20.6 6.64-3.79 6.65 3.8-6.65 3.8-6.64-3.8Z", fill: "#A5D8FF" })
|
|
1479
|
-
] }),
|
|
1480
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1481
|
-
"mask",
|
|
1482
|
-
{
|
|
1483
|
-
id: "c",
|
|
1484
|
-
style: {
|
|
1485
|
-
maskType: "alpha"
|
|
1486
|
-
},
|
|
1487
|
-
maskUnits: "userSpaceOnUse",
|
|
1488
|
-
x: "8",
|
|
1489
|
-
y: "4",
|
|
1490
|
-
width: "22",
|
|
1491
|
-
height: "20",
|
|
1492
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1493
|
-
"path",
|
|
1494
|
-
{
|
|
1495
|
-
d: "M24.17 4.82a2.9 2.9 0 0 0-2.87 0L9.97 11.22a2.9 2.9 0 0 0-1.47 2.53v4.22c0 1.04.56 2 1.46 2.52l3.75 2.14c.89.5 1.98.5 2.87 0l11.33-6.42a2.9 2.9 0 0 0 1.47-2.52V9.48c0-1.04-.56-2-1.46-2.52l-3.75-2.14Z",
|
|
1496
|
-
fill: "#D7DCE1"
|
|
1497
|
-
}
|
|
1498
|
-
)
|
|
1499
|
-
}
|
|
1500
|
-
),
|
|
1501
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("g", { mask: "url(#c)", children: [
|
|
1502
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M15.14 23.46v-7.6L29.38 7.8v7.59l-14.24 8.07Z", fill: "#007FFF" }),
|
|
1503
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M8.5 19.66v-7.6l6.64 3.8v7.6l-6.64-3.8Z", fill: "#39F" }),
|
|
1504
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)("path", { d: "M8.5 12.07 22.74 4l6.64 3.8-14.24 8.06-6.64-3.8Z", fill: "#A5D8FF" })
|
|
1505
|
-
] })
|
|
1506
|
-
] });
|
|
1507
|
-
}
|
|
1508
|
-
|
|
1509
|
-
// src/toolpad-core/shared/branding.ts
|
|
1510
|
-
var React19 = __toESM(require("react"));
|
|
1511
|
-
function useApplicationTitle() {
|
|
1512
|
-
var _a;
|
|
1513
|
-
const branding = React19.useContext(BrandingContext);
|
|
1514
|
-
return (_a = branding == null ? void 0 : branding.title) != null ? _a : "Toolpad";
|
|
1515
|
-
}
|
|
1516
|
-
|
|
1517
|
-
// src/toolpad-core/DashboardLayout/AppTitle.tsx
|
|
1518
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1519
|
-
var LogoContainer = (0, import_material3.styled)("div")({
|
|
1520
|
-
position: "relative",
|
|
1521
|
-
height: 40,
|
|
1522
|
-
display: "flex",
|
|
1523
|
-
alignItems: "center",
|
|
1524
|
-
"& img": {
|
|
1525
|
-
maxHeight: 40
|
|
1526
|
-
}
|
|
22
|
+
Object.defineProperty(exports, "AccountPreview", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return chunkSITC3EZQ_js.AccountPreview; }
|
|
1527
25
|
});
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
const defaultTitle = useApplicationTitle();
|
|
1532
|
-
const title = (_b = (_a = props == null ? void 0 : props.branding) == null ? void 0 : _a.title) != null ? _b : defaultTitle;
|
|
1533
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(Link2, { href: (_d = (_c = props == null ? void 0 : props.branding) == null ? void 0 : _c.homeUrl) != null ? _d : "/", style: { textDecoration: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_Stack4.default, { direction: "row", alignItems: "center", children: [
|
|
1534
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(LogoContainer, { children: (_f = (_e = props == null ? void 0 : props.branding) == null ? void 0 : _e.logo) != null ? _f : /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(ToolpadLogo, { size: 40 }) }),
|
|
1535
|
-
/* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1536
|
-
import_Typography2.default,
|
|
1537
|
-
{
|
|
1538
|
-
variant: "h6",
|
|
1539
|
-
sx: {
|
|
1540
|
-
color: ((_g = theme.vars) != null ? _g : theme).palette.primary.main,
|
|
1541
|
-
fontWeight: "700",
|
|
1542
|
-
ml: 1,
|
|
1543
|
-
whiteSpace: "nowrap",
|
|
1544
|
-
lineHeight: 1
|
|
1545
|
-
},
|
|
1546
|
-
children: title
|
|
1547
|
-
}
|
|
1548
|
-
)
|
|
1549
|
-
] }) });
|
|
1550
|
-
}
|
|
1551
|
-
|
|
1552
|
-
// src/toolpad-core/DashboardLayout/ToolbarActions.tsx
|
|
1553
|
-
var import_Stack5 = __toESM(require("@mui/material/Stack"));
|
|
1554
|
-
|
|
1555
|
-
// src/toolpad-core/DashboardLayout/ThemeSwitcher.tsx
|
|
1556
|
-
var React21 = __toESM(require("react"));
|
|
1557
|
-
var import_material4 = require("@mui/material");
|
|
1558
|
-
var import_IconButton2 = __toESM(require("@mui/material/IconButton"));
|
|
1559
|
-
var import_Tooltip2 = __toESM(require("@mui/material/Tooltip"));
|
|
1560
|
-
var import_DarkMode = __toESM(require("@mui/icons-material/DarkMode"));
|
|
1561
|
-
var import_LightMode = __toESM(require("@mui/icons-material/LightMode"));
|
|
1562
|
-
|
|
1563
|
-
// src/toolpad-utils/hooks/useSsr.ts
|
|
1564
|
-
var React20 = __toESM(require("react"));
|
|
1565
|
-
function subscribe2() {
|
|
1566
|
-
return () => {
|
|
1567
|
-
};
|
|
1568
|
-
}
|
|
1569
|
-
function getSnapshot2() {
|
|
1570
|
-
return false;
|
|
1571
|
-
}
|
|
1572
|
-
function getServerSnapshot() {
|
|
1573
|
-
return true;
|
|
1574
|
-
}
|
|
1575
|
-
function useSsr() {
|
|
1576
|
-
return React20.useSyncExternalStore(subscribe2, getSnapshot2, getServerSnapshot);
|
|
1577
|
-
}
|
|
1578
|
-
|
|
1579
|
-
// src/toolpad-core/DashboardLayout/ThemeSwitcher.tsx
|
|
1580
|
-
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1581
|
-
function ThemeSwitcher() {
|
|
1582
|
-
var _a;
|
|
1583
|
-
const isSsr = useSsr();
|
|
1584
|
-
const theme = (0, import_material4.useTheme)();
|
|
1585
|
-
const { paletteMode, setPaletteMode, isDualTheme } = React21.useContext(PaletteModeContext);
|
|
1586
|
-
const toggleMode = React21.useCallback(() => {
|
|
1587
|
-
setPaletteMode(paletteMode === "dark" ? "light" : "dark");
|
|
1588
|
-
}, [paletteMode, setPaletteMode]);
|
|
1589
|
-
return isDualTheme ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1590
|
-
import_Tooltip2.default,
|
|
1591
|
-
{
|
|
1592
|
-
title: isSsr ? "Switch mode" : `${paletteMode === "dark" ? "Light" : "Dark"} mode`,
|
|
1593
|
-
enterDelay: 1e3,
|
|
1594
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1595
|
-
import_IconButton2.default,
|
|
1596
|
-
{
|
|
1597
|
-
"aria-label": isSsr ? "Switch theme mode" : `Switch to ${paletteMode === "dark" ? "light" : "dark"} mode`,
|
|
1598
|
-
onClick: toggleMode,
|
|
1599
|
-
sx: {
|
|
1600
|
-
color: ((_a = theme.vars) != null ? _a : theme).palette.primary.dark
|
|
1601
|
-
},
|
|
1602
|
-
children: theme.getColorSchemeSelector ? /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(React21.Fragment, { children: [
|
|
1603
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1604
|
-
import_DarkMode.default,
|
|
1605
|
-
{
|
|
1606
|
-
sx: {
|
|
1607
|
-
display: "inline",
|
|
1608
|
-
[theme.getColorSchemeSelector("dark")]: {
|
|
1609
|
-
display: "none"
|
|
1610
|
-
}
|
|
1611
|
-
}
|
|
1612
|
-
}
|
|
1613
|
-
),
|
|
1614
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1615
|
-
import_LightMode.default,
|
|
1616
|
-
{
|
|
1617
|
-
sx: {
|
|
1618
|
-
display: "none",
|
|
1619
|
-
[theme.getColorSchemeSelector("dark")]: {
|
|
1620
|
-
display: "inline"
|
|
1621
|
-
}
|
|
1622
|
-
}
|
|
1623
|
-
}
|
|
1624
|
-
)
|
|
1625
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(React21.Fragment, { children: isSsr || paletteMode !== "dark" ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_DarkMode.default, {}) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_LightMode.default, {}) })
|
|
1626
|
-
}
|
|
1627
|
-
) })
|
|
1628
|
-
}
|
|
1629
|
-
) : null;
|
|
1630
|
-
}
|
|
1631
|
-
|
|
1632
|
-
// src/toolpad-core/DashboardLayout/ToolbarActions.tsx
|
|
1633
|
-
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1634
|
-
function ToolbarActions() {
|
|
1635
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_Stack5.default, { direction: "row", alignItems: "center", children: [
|
|
1636
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ThemeSwitcher, {}),
|
|
1637
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Account, {})
|
|
1638
|
-
] });
|
|
1639
|
-
}
|
|
1640
|
-
|
|
1641
|
-
// src/toolpad-core/DashboardLayout/DashboardHeader.tsx
|
|
1642
|
-
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1643
|
-
var AppBar = (0, import_styles4.styled)(import_AppBar.default)(({ theme }) => {
|
|
1644
|
-
var _a;
|
|
1645
|
-
return {
|
|
1646
|
-
borderWidth: 0,
|
|
1647
|
-
borderBottomWidth: 1,
|
|
1648
|
-
borderStyle: "solid",
|
|
1649
|
-
borderColor: ((_a = theme.vars) != null ? _a : theme).palette.divider,
|
|
1650
|
-
boxShadow: "none",
|
|
1651
|
-
zIndex: theme.zIndex.drawer + 1
|
|
1652
|
-
};
|
|
26
|
+
Object.defineProperty(exports, "AlertDialog", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () { return chunkSITC3EZQ_js.AlertDialog; }
|
|
1653
29
|
});
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
branding: brandingProp,
|
|
1658
|
-
menuOpen,
|
|
1659
|
-
onToggleMenu,
|
|
1660
|
-
hideMenuButton,
|
|
1661
|
-
slots,
|
|
1662
|
-
slotProps
|
|
1663
|
-
} = props;
|
|
1664
|
-
const brandingContext = React22.useContext(BrandingContext);
|
|
1665
|
-
const branding = __spreadValues(__spreadValues({}, brandingContext), brandingProp);
|
|
1666
|
-
const handleMenuOpen = React22.useCallback(() => {
|
|
1667
|
-
onToggleMenu(!menuOpen);
|
|
1668
|
-
}, [menuOpen, onToggleMenu]);
|
|
1669
|
-
const getMenuIcon = React22.useCallback(
|
|
1670
|
-
(isExpanded) => {
|
|
1671
|
-
const expandMenuActionText = "Expand";
|
|
1672
|
-
const collapseMenuActionText = "Collapse";
|
|
1673
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1674
|
-
import_Tooltip3.default,
|
|
1675
|
-
{
|
|
1676
|
-
title: `${isExpanded ? collapseMenuActionText : expandMenuActionText} menu`,
|
|
1677
|
-
enterDelay: 1e3,
|
|
1678
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1679
|
-
import_IconButton3.default,
|
|
1680
|
-
{
|
|
1681
|
-
"aria-label": `${isExpanded ? collapseMenuActionText : expandMenuActionText} navigation menu`,
|
|
1682
|
-
onClick: handleMenuOpen,
|
|
1683
|
-
children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_MenuOpen.default, {}) : /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_Menu.default, {})
|
|
1684
|
-
}
|
|
1685
|
-
) })
|
|
1686
|
-
}
|
|
1687
|
-
);
|
|
1688
|
-
},
|
|
1689
|
-
[handleMenuOpen]
|
|
1690
|
-
);
|
|
1691
|
-
const ToolbarActionsSlot = (_a = slots == null ? void 0 : slots.toolbarActions) != null ? _a : ToolbarActions;
|
|
1692
|
-
const ToolbarAccountSlot = (_b = slots == null ? void 0 : slots.toolbarAccount) != null ? _b : (() => null);
|
|
1693
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AppBar, { color: "inherit", position: "absolute", sx: { displayPrint: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_Toolbar.default, { sx: { backgroundColor: "inherit", mx: { xs: -0.75, sm: -1 } }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
1694
|
-
import_Stack6.default,
|
|
1695
|
-
{
|
|
1696
|
-
direction: "row",
|
|
1697
|
-
justifyContent: "space-between",
|
|
1698
|
-
alignItems: "center",
|
|
1699
|
-
sx: {
|
|
1700
|
-
flexWrap: "wrap",
|
|
1701
|
-
width: "100%"
|
|
1702
|
-
},
|
|
1703
|
-
children: [
|
|
1704
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_Stack6.default, { direction: "row", children: [
|
|
1705
|
-
!hideMenuButton ? /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(React22.Fragment, { children: [
|
|
1706
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1707
|
-
import_Box2.default,
|
|
1708
|
-
{
|
|
1709
|
-
sx: {
|
|
1710
|
-
display: { xs: "block", md: "none" },
|
|
1711
|
-
mr: { sm: 1 }
|
|
1712
|
-
},
|
|
1713
|
-
children: getMenuIcon(menuOpen)
|
|
1714
|
-
}
|
|
1715
|
-
),
|
|
1716
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1717
|
-
import_Box2.default,
|
|
1718
|
-
{
|
|
1719
|
-
sx: {
|
|
1720
|
-
display: { xs: "none", md: "block" },
|
|
1721
|
-
mr: 1
|
|
1722
|
-
},
|
|
1723
|
-
children: getMenuIcon(menuOpen)
|
|
1724
|
-
}
|
|
1725
|
-
)
|
|
1726
|
-
] }) : null,
|
|
1727
|
-
(slots == null ? void 0 : slots.appTitle) ? /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(slots.appTitle, __spreadValues({}, slotProps == null ? void 0 : slotProps.appTitle)) : (
|
|
1728
|
-
/* Hierarchy of application of `branding`
|
|
1729
|
-
* 1. Branding prop passed in the `slotProps.appTitle`
|
|
1730
|
-
* 2. Branding prop passed to the `DashboardLayout`
|
|
1731
|
-
* 3. Branding prop passed to the `AppProvider`
|
|
1732
|
-
*/
|
|
1733
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AppTitle, __spreadValues({ branding }, slotProps == null ? void 0 : slotProps.appTitle))
|
|
1734
|
-
)
|
|
1735
|
-
] }),
|
|
1736
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_Stack6.default, { direction: "row", alignItems: "center", spacing: 1, sx: { marginLeft: "auto" }, children: [
|
|
1737
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ToolbarActionsSlot, __spreadValues({}, slotProps == null ? void 0 : slotProps.toolbarActions)),
|
|
1738
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(ToolbarAccountSlot, __spreadValues({}, slotProps == null ? void 0 : slotProps.toolbarAccount))
|
|
1739
|
-
] })
|
|
1740
|
-
]
|
|
1741
|
-
}
|
|
1742
|
-
) }) });
|
|
1743
|
-
}
|
|
1744
|
-
DashboardHeader.propTypes = {
|
|
1745
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
1746
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
1747
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
1748
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
1749
|
-
/**
|
|
1750
|
-
* Branding options for the header.
|
|
1751
|
-
* @default null
|
|
1752
|
-
*/
|
|
1753
|
-
branding: import_prop_types9.default.shape({
|
|
1754
|
-
homeUrl: import_prop_types9.default.string,
|
|
1755
|
-
logo: import_prop_types9.default.node,
|
|
1756
|
-
title: import_prop_types9.default.string
|
|
1757
|
-
}),
|
|
1758
|
-
/**
|
|
1759
|
-
* Whether the menu icon should always be hidden.
|
|
1760
|
-
* @default false
|
|
1761
|
-
*/
|
|
1762
|
-
hideMenuButton: import_prop_types9.default.bool,
|
|
1763
|
-
/**
|
|
1764
|
-
* If `true`, show menu button as if menu is expanded, otherwise show it as if menu is collapsed.
|
|
1765
|
-
*/
|
|
1766
|
-
menuOpen: import_prop_types9.default.bool.isRequired,
|
|
1767
|
-
/**
|
|
1768
|
-
* Callback fired when the menu button is clicked.
|
|
1769
|
-
*/
|
|
1770
|
-
onToggleMenu: import_prop_types9.default.func.isRequired,
|
|
1771
|
-
/**
|
|
1772
|
-
* The props used for each slot inside.
|
|
1773
|
-
* @default {}
|
|
1774
|
-
*/
|
|
1775
|
-
slotProps: import_prop_types9.default.shape({
|
|
1776
|
-
appTitle: import_prop_types9.default.shape({
|
|
1777
|
-
branding: import_prop_types9.default.shape({
|
|
1778
|
-
homeUrl: import_prop_types9.default.string,
|
|
1779
|
-
logo: import_prop_types9.default.node,
|
|
1780
|
-
title: import_prop_types9.default.string
|
|
1781
|
-
})
|
|
1782
|
-
}),
|
|
1783
|
-
toolbarAccount: import_prop_types9.default.shape({
|
|
1784
|
-
localeText: import_prop_types9.default.object,
|
|
1785
|
-
slotProps: import_prop_types9.default.shape({
|
|
1786
|
-
popover: import_prop_types9.default.object,
|
|
1787
|
-
popoverContent: import_prop_types9.default.object,
|
|
1788
|
-
preview: import_prop_types9.default.object,
|
|
1789
|
-
signInButton: import_prop_types9.default.object,
|
|
1790
|
-
signOutButton: import_prop_types9.default.object
|
|
1791
|
-
}),
|
|
1792
|
-
slots: import_prop_types9.default.shape({
|
|
1793
|
-
popover: import_prop_types9.default.elementType,
|
|
1794
|
-
popoverContent: import_prop_types9.default.elementType,
|
|
1795
|
-
preview: import_prop_types9.default.elementType,
|
|
1796
|
-
signInButton: import_prop_types9.default.elementType,
|
|
1797
|
-
signOutButton: import_prop_types9.default.elementType
|
|
1798
|
-
})
|
|
1799
|
-
}),
|
|
1800
|
-
toolbarActions: import_prop_types9.default.object
|
|
1801
|
-
}),
|
|
1802
|
-
/**
|
|
1803
|
-
* The components used for each slot inside.
|
|
1804
|
-
* @default {}
|
|
1805
|
-
*/
|
|
1806
|
-
slots: import_prop_types9.default.shape({
|
|
1807
|
-
appTitle: import_prop_types9.default.elementType,
|
|
1808
|
-
toolbarAccount: import_prop_types9.default.elementType,
|
|
1809
|
-
toolbarActions: import_prop_types9.default.elementType
|
|
1810
|
-
})
|
|
1811
|
-
};
|
|
1812
|
-
|
|
1813
|
-
// src/toolpad-core/DashboardLayout/DashboardSidebarSubNavigation.tsx
|
|
1814
|
-
var React25 = __toESM(require("react"));
|
|
1815
|
-
var import_Divider2 = __toESM(require("@mui/material/Divider"));
|
|
1816
|
-
var import_List = __toESM(require("@mui/material/List"));
|
|
1817
|
-
var import_ListSubheader = __toESM(require("@mui/material/ListSubheader"));
|
|
1818
|
-
|
|
1819
|
-
// src/toolpad-core/shared/navigation.tsx
|
|
1820
|
-
var import_path_to_regexp = require("path-to-regexp");
|
|
1821
|
-
var import_invariant4 = __toESM(require("invariant"));
|
|
1822
|
-
var getItemKind = (item) => {
|
|
1823
|
-
var _a;
|
|
1824
|
-
return (_a = item.kind) != null ? _a : "page";
|
|
1825
|
-
};
|
|
1826
|
-
var isPageItem = (item) => getItemKind(item) === "page";
|
|
1827
|
-
var getItemTitle = (item) => {
|
|
1828
|
-
var _a, _b;
|
|
1829
|
-
return isPageItem(item) ? (_b = (_a = item.title) != null ? _a : item.segment) != null ? _b : "" : item.title;
|
|
1830
|
-
};
|
|
1831
|
-
function buildItemToPathMap(navigation) {
|
|
1832
|
-
const map = /* @__PURE__ */ new Map();
|
|
1833
|
-
const visit = (item, base) => {
|
|
1834
|
-
if (isPageItem(item)) {
|
|
1835
|
-
const path = `${base.startsWith("/") ? base : `/${base}`}${base && base !== "/" && item.segment ? "/" : ""}${item.segment || ""}` || "/";
|
|
1836
|
-
map.set(item, path);
|
|
1837
|
-
if (item.children) {
|
|
1838
|
-
for (const child of item.children) {
|
|
1839
|
-
visit(child, path);
|
|
1840
|
-
}
|
|
1841
|
-
}
|
|
1842
|
-
}
|
|
1843
|
-
};
|
|
1844
|
-
for (const item of navigation) {
|
|
1845
|
-
visit(item, "");
|
|
1846
|
-
}
|
|
1847
|
-
return map;
|
|
1848
|
-
}
|
|
1849
|
-
var itemToPathMapCache = /* @__PURE__ */ new WeakMap();
|
|
1850
|
-
function getItemToPathMap(navigation) {
|
|
1851
|
-
let map = itemToPathMapCache.get(navigation);
|
|
1852
|
-
if (!map) {
|
|
1853
|
-
map = buildItemToPathMap(navigation);
|
|
1854
|
-
itemToPathMapCache.set(navigation, map);
|
|
1855
|
-
}
|
|
1856
|
-
return map;
|
|
1857
|
-
}
|
|
1858
|
-
function buildItemLookup(navigation) {
|
|
1859
|
-
const map = /* @__PURE__ */ new Map();
|
|
1860
|
-
const visit = (item) => {
|
|
1861
|
-
if (isPageItem(item)) {
|
|
1862
|
-
const path = getItemPath(navigation, item);
|
|
1863
|
-
if (map.has(path)) {
|
|
1864
|
-
console.warn(`Duplicate path in navigation: ${path}`);
|
|
1865
|
-
}
|
|
1866
|
-
map.set(path, item);
|
|
1867
|
-
if (item.pattern) {
|
|
1868
|
-
const basePath = item.segment ? path.slice(0, -item.segment.length) : path;
|
|
1869
|
-
map.set((0, import_path_to_regexp.pathToRegexp)(basePath + item.pattern).regexp, item);
|
|
1870
|
-
}
|
|
1871
|
-
if (item.children) {
|
|
1872
|
-
for (const child of item.children) {
|
|
1873
|
-
visit(child);
|
|
1874
|
-
}
|
|
1875
|
-
}
|
|
1876
|
-
}
|
|
1877
|
-
};
|
|
1878
|
-
for (const item of navigation) {
|
|
1879
|
-
visit(item);
|
|
1880
|
-
}
|
|
1881
|
-
return map;
|
|
1882
|
-
}
|
|
1883
|
-
var itemLookupMapCache = /* @__PURE__ */ new WeakMap();
|
|
1884
|
-
function getItemLookup(navigation) {
|
|
1885
|
-
let map = itemLookupMapCache.get(navigation);
|
|
1886
|
-
if (!map) {
|
|
1887
|
-
map = buildItemLookup(navigation);
|
|
1888
|
-
itemLookupMapCache.set(navigation, map);
|
|
1889
|
-
}
|
|
1890
|
-
return map;
|
|
1891
|
-
}
|
|
1892
|
-
function matchPath(navigation, path) {
|
|
1893
|
-
const lookup = getItemLookup(navigation);
|
|
1894
|
-
for (const [key, item] of lookup.entries()) {
|
|
1895
|
-
if (typeof key === "string" && key === path) {
|
|
1896
|
-
return item;
|
|
1897
|
-
}
|
|
1898
|
-
if (key instanceof RegExp && key.test(path)) {
|
|
1899
|
-
return item;
|
|
1900
|
-
}
|
|
1901
|
-
}
|
|
1902
|
-
return null;
|
|
1903
|
-
}
|
|
1904
|
-
function getItemPath(navigation, item) {
|
|
1905
|
-
const map = getItemToPathMap(navigation);
|
|
1906
|
-
const path = map.get(item);
|
|
1907
|
-
(0, import_invariant4.default)(path, `Item not found in navigation: ${item.title}`);
|
|
1908
|
-
return path;
|
|
1909
|
-
}
|
|
1910
|
-
function hasSelectedNavigationChildren(navigation, item, activePagePath) {
|
|
1911
|
-
if (item.children) {
|
|
1912
|
-
return item.children.some((nestedItem) => {
|
|
1913
|
-
if (!isPageItem(nestedItem)) {
|
|
1914
|
-
return false;
|
|
1915
|
-
}
|
|
1916
|
-
if (nestedItem.children) {
|
|
1917
|
-
return hasSelectedNavigationChildren(navigation, nestedItem, activePagePath);
|
|
1918
|
-
}
|
|
1919
|
-
return activePagePath === getItemPath(navigation, nestedItem);
|
|
1920
|
-
});
|
|
1921
|
-
}
|
|
1922
|
-
return false;
|
|
1923
|
-
}
|
|
1924
|
-
|
|
1925
|
-
// src/toolpad-core/DashboardLayout/utils.ts
|
|
1926
|
-
function getDrawerSxTransitionMixin(isExpanded, property) {
|
|
1927
|
-
return {
|
|
1928
|
-
transition: (theme) => theme.transitions.create(property, {
|
|
1929
|
-
easing: theme.transitions.easing.sharp,
|
|
1930
|
-
duration: isExpanded ? theme.transitions.duration.enteringScreen : theme.transitions.duration.leavingScreen
|
|
1931
|
-
})
|
|
1932
|
-
};
|
|
1933
|
-
}
|
|
1934
|
-
function getDrawerWidthTransitionMixin(isExpanded) {
|
|
1935
|
-
return __spreadProps(__spreadValues({}, getDrawerSxTransitionMixin(isExpanded, "width")), {
|
|
1936
|
-
overflowX: "hidden"
|
|
1937
|
-
});
|
|
1938
|
-
}
|
|
1939
|
-
|
|
1940
|
-
// src/toolpad-core/useActivePage/useActivePage.ts
|
|
1941
|
-
var React23 = __toESM(require("react"));
|
|
1942
|
-
function useActivePage() {
|
|
1943
|
-
var _a;
|
|
1944
|
-
const navigationContext = React23.useContext(NavigationContext);
|
|
1945
|
-
const routerContext = React23.useContext(RouterContext);
|
|
1946
|
-
const pathname = (_a = routerContext == null ? void 0 : routerContext.pathname) != null ? _a : "/";
|
|
1947
|
-
const activeItem = matchPath(navigationContext, pathname);
|
|
1948
|
-
const rootItem = matchPath(navigationContext, "/");
|
|
1949
|
-
return React23.useMemo(() => {
|
|
1950
|
-
if (!activeItem) {
|
|
1951
|
-
return null;
|
|
1952
|
-
}
|
|
1953
|
-
const breadcrumbs = [];
|
|
1954
|
-
if (rootItem) {
|
|
1955
|
-
breadcrumbs.push({
|
|
1956
|
-
title: getItemTitle(rootItem),
|
|
1957
|
-
path: "/"
|
|
1958
|
-
});
|
|
1959
|
-
}
|
|
1960
|
-
const segments = pathname.split("/").filter(Boolean);
|
|
1961
|
-
let prefix = "";
|
|
1962
|
-
for (const segment of segments) {
|
|
1963
|
-
const path = `${prefix}/${segment}`;
|
|
1964
|
-
prefix = path;
|
|
1965
|
-
const item = matchPath(navigationContext, path);
|
|
1966
|
-
if (!item) {
|
|
1967
|
-
continue;
|
|
1968
|
-
}
|
|
1969
|
-
const itemPath = getItemPath(navigationContext, item);
|
|
1970
|
-
const lastCrumb = breadcrumbs[breadcrumbs.length - 1];
|
|
1971
|
-
if ((lastCrumb == null ? void 0 : lastCrumb.path) !== itemPath) {
|
|
1972
|
-
breadcrumbs.push({
|
|
1973
|
-
title: getItemTitle(item),
|
|
1974
|
-
path: itemPath
|
|
1975
|
-
});
|
|
1976
|
-
}
|
|
1977
|
-
}
|
|
1978
|
-
return {
|
|
1979
|
-
title: getItemTitle(activeItem),
|
|
1980
|
-
path: getItemPath(navigationContext, activeItem),
|
|
1981
|
-
breadcrumbs
|
|
1982
|
-
};
|
|
1983
|
-
}, [activeItem, rootItem, pathname, navigationContext]);
|
|
1984
|
-
}
|
|
1985
|
-
|
|
1986
|
-
// src/toolpad-core/DashboardLayout/DashboardSidebarPageItem.tsx
|
|
1987
|
-
var React24 = __toESM(require("react"));
|
|
1988
|
-
var import_prop_types10 = __toESM(require("prop-types"));
|
|
1989
|
-
var import_material5 = require("@mui/material");
|
|
1990
|
-
var import_Avatar2 = __toESM(require("@mui/material/Avatar"));
|
|
1991
|
-
var import_Box3 = __toESM(require("@mui/material/Box"));
|
|
1992
|
-
var import_Collapse = __toESM(require("@mui/material/Collapse"));
|
|
1993
|
-
var import_Grow = __toESM(require("@mui/material/Grow"));
|
|
1994
|
-
var import_ListItem = __toESM(require("@mui/material/ListItem"));
|
|
1995
|
-
var import_ListItemButton = __toESM(require("@mui/material/ListItemButton"));
|
|
1996
|
-
var import_ListItemIcon = __toESM(require("@mui/material/ListItemIcon"));
|
|
1997
|
-
var import_ListItemText = __toESM(require("@mui/material/ListItemText"));
|
|
1998
|
-
var import_Paper = __toESM(require("@mui/material/Paper"));
|
|
1999
|
-
var import_Typography3 = __toESM(require("@mui/material/Typography"));
|
|
2000
|
-
var import_ExpandMore = __toESM(require("@mui/icons-material/ExpandMore"));
|
|
2001
|
-
var import_invariant5 = __toESM(require("invariant"));
|
|
2002
|
-
|
|
2003
|
-
// src/toolpad-core/DashboardLayout/shared.ts
|
|
2004
|
-
var MINI_DRAWER_WIDTH = 84;
|
|
2005
|
-
|
|
2006
|
-
// src/toolpad-core/DashboardLayout/DashboardSidebarPageItem.tsx
|
|
2007
|
-
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
2008
|
-
var NavigationListItemButton = (0, import_material5.styled)(import_ListItemButton.default)(({ theme }) => {
|
|
2009
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
2010
|
-
return {
|
|
2011
|
-
borderRadius: 8,
|
|
2012
|
-
"&.Mui-selected": {
|
|
2013
|
-
"& .MuiListItemIcon-root": {
|
|
2014
|
-
color: ((_a = theme.vars) != null ? _a : theme).palette.primary.dark
|
|
2015
|
-
},
|
|
2016
|
-
"& .MuiTypography-root": {
|
|
2017
|
-
color: ((_b = theme.vars) != null ? _b : theme).palette.primary.dark
|
|
2018
|
-
},
|
|
2019
|
-
"& .MuiSvgIcon-root": {
|
|
2020
|
-
color: ((_c = theme.vars) != null ? _c : theme).palette.primary.dark
|
|
2021
|
-
},
|
|
2022
|
-
"& .MuiAvatar-root": {
|
|
2023
|
-
backgroundColor: ((_d = theme.vars) != null ? _d : theme).palette.primary.dark
|
|
2024
|
-
},
|
|
2025
|
-
"& .MuiTouchRipple-child": {
|
|
2026
|
-
backgroundColor: ((_e = theme.vars) != null ? _e : theme).palette.primary.dark
|
|
2027
|
-
}
|
|
2028
|
-
},
|
|
2029
|
-
"& .MuiSvgIcon-root": {
|
|
2030
|
-
color: ((_f = theme.vars) != null ? _f : theme).palette.action.active
|
|
2031
|
-
},
|
|
2032
|
-
"& .MuiAvatar-root": {
|
|
2033
|
-
backgroundColor: ((_g = theme.vars) != null ? _g : theme).palette.action.active
|
|
2034
|
-
}
|
|
2035
|
-
};
|
|
30
|
+
Object.defineProperty(exports, "ConfirmDialog", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () { return chunkSITC3EZQ_js.ConfirmDialog; }
|
|
2036
33
|
});
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
minWidth: LIST_ITEM_ICON_SIZE
|
|
2141
|
-
},
|
|
2142
|
-
children: [
|
|
2143
|
-
(_a = item.icon) != null ? _a : null,
|
|
2144
|
-
!item.icon && isMini ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2145
|
-
import_Avatar2.default,
|
|
2146
|
-
{
|
|
2147
|
-
sx: {
|
|
2148
|
-
width: LIST_ITEM_ICON_SIZE - 7,
|
|
2149
|
-
height: LIST_ITEM_ICON_SIZE - 7,
|
|
2150
|
-
fontSize: 12
|
|
2151
|
-
},
|
|
2152
|
-
children: title.split(" ").slice(0, 2).map((titleWord) => titleWord.charAt(0).toUpperCase())
|
|
2153
|
-
}
|
|
2154
|
-
) : null
|
|
2155
|
-
]
|
|
2156
|
-
}
|
|
2157
|
-
),
|
|
2158
|
-
isMini ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2159
|
-
import_Typography3.default,
|
|
2160
|
-
{
|
|
2161
|
-
variant: "caption",
|
|
2162
|
-
sx: {
|
|
2163
|
-
position: "absolute",
|
|
2164
|
-
bottom: -18,
|
|
2165
|
-
left: "50%",
|
|
2166
|
-
transform: "translateX(-50%)",
|
|
2167
|
-
fontSize: 10,
|
|
2168
|
-
fontWeight: 500,
|
|
2169
|
-
textAlign: "center",
|
|
2170
|
-
whiteSpace: "nowrap",
|
|
2171
|
-
overflow: "hidden",
|
|
2172
|
-
textOverflow: "ellipsis",
|
|
2173
|
-
maxWidth: MINI_DRAWER_WIDTH - 28
|
|
2174
|
-
},
|
|
2175
|
-
children: title
|
|
2176
|
-
}
|
|
2177
|
-
) : null
|
|
2178
|
-
]
|
|
2179
|
-
}
|
|
2180
|
-
) : null,
|
|
2181
|
-
!isMini ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2182
|
-
import_ListItemText.default,
|
|
2183
|
-
{
|
|
2184
|
-
primary: title,
|
|
2185
|
-
sx: {
|
|
2186
|
-
ml: 1.2,
|
|
2187
|
-
whiteSpace: "nowrap",
|
|
2188
|
-
zIndex: 1
|
|
2189
|
-
}
|
|
2190
|
-
}
|
|
2191
|
-
) : null,
|
|
2192
|
-
item.action && !isMini && isSidebarFullyExpanded ? item.action : null,
|
|
2193
|
-
item.children ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_ExpandMore.default, { sx: nestedNavigationCollapseSx }) : null
|
|
2194
|
-
]
|
|
2195
|
-
})
|
|
2196
|
-
),
|
|
2197
|
-
item.children && isMini ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_Grow.default, { in: id === hoveredMiniSidebarItemId, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2198
|
-
import_Box3.default,
|
|
2199
|
-
{
|
|
2200
|
-
sx: {
|
|
2201
|
-
position: "fixed",
|
|
2202
|
-
left: MINI_DRAWER_WIDTH - 2,
|
|
2203
|
-
pl: "6px"
|
|
2204
|
-
},
|
|
2205
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
2206
|
-
import_Paper.default,
|
|
2207
|
-
{
|
|
2208
|
-
sx: {
|
|
2209
|
-
pt: 0.5,
|
|
2210
|
-
pb: 0.5,
|
|
2211
|
-
transform: "translateY(calc(50% - 30px))"
|
|
2212
|
-
},
|
|
2213
|
-
children: renderNestedNavigation(item.children)
|
|
2214
|
-
}
|
|
2215
|
-
)
|
|
2216
|
-
}
|
|
2217
|
-
) }) : null
|
|
2218
|
-
]
|
|
2219
|
-
})
|
|
2220
|
-
);
|
|
2221
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(React24.Fragment, { children: [
|
|
2222
|
-
listItem,
|
|
2223
|
-
item.children && !isMini ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_Collapse.default, { in: expanded, timeout: "auto", unmountOnExit: true, children: renderNestedNavigation(item.children) }) : null
|
|
2224
|
-
] }, id);
|
|
2225
|
-
}
|
|
2226
|
-
DashboardSidebarPageItem.propTypes = {
|
|
2227
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
2228
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
2229
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
2230
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
2231
|
-
/**
|
|
2232
|
-
* If `true`, the item is disabled.
|
|
2233
|
-
* @default false
|
|
2234
|
-
*/
|
|
2235
|
-
disabled: import_prop_types10.default.bool,
|
|
2236
|
-
/**
|
|
2237
|
-
* If `true`, expands any nested navigation in the item, otherwise collapse it.
|
|
2238
|
-
* @default false
|
|
2239
|
-
*/
|
|
2240
|
-
expanded: import_prop_types10.default.bool,
|
|
2241
|
-
/**
|
|
2242
|
-
* Link `href` for when the item is rendered as a link.
|
|
2243
|
-
* @default getItemPath(navigationContext, item)
|
|
2244
|
-
*/
|
|
2245
|
-
href: import_prop_types10.default.string,
|
|
2246
|
-
/**
|
|
2247
|
-
* Navigation page item definition.
|
|
2248
|
-
*/
|
|
2249
|
-
item: import_prop_types10.default.shape({
|
|
2250
|
-
action: import_prop_types10.default.node,
|
|
2251
|
-
children: import_prop_types10.default.arrayOf(
|
|
2252
|
-
import_prop_types10.default.oneOfType([
|
|
2253
|
-
import_prop_types10.default.object,
|
|
2254
|
-
import_prop_types10.default.shape({
|
|
2255
|
-
kind: import_prop_types10.default.oneOf(["header"]).isRequired,
|
|
2256
|
-
title: import_prop_types10.default.string.isRequired
|
|
2257
|
-
}),
|
|
2258
|
-
import_prop_types10.default.shape({
|
|
2259
|
-
kind: import_prop_types10.default.oneOf(["divider"]).isRequired
|
|
2260
|
-
})
|
|
2261
|
-
]).isRequired
|
|
2262
|
-
),
|
|
2263
|
-
icon: import_prop_types10.default.node,
|
|
2264
|
-
kind: import_prop_types10.default.oneOf(["page"]),
|
|
2265
|
-
pattern: import_prop_types10.default.string,
|
|
2266
|
-
segment: import_prop_types10.default.string,
|
|
2267
|
-
title: import_prop_types10.default.string
|
|
2268
|
-
}).isRequired,
|
|
2269
|
-
/**
|
|
2270
|
-
* The component used to render the item as a link.
|
|
2271
|
-
* @default Link
|
|
2272
|
-
*/
|
|
2273
|
-
LinkComponent: import_prop_types10.default.elementType,
|
|
2274
|
-
/**
|
|
2275
|
-
* Use to apply selected styling.
|
|
2276
|
-
* @default false
|
|
2277
|
-
*/
|
|
2278
|
-
selected: import_prop_types10.default.bool
|
|
2279
|
-
};
|
|
2280
|
-
|
|
2281
|
-
// src/toolpad-core/DashboardLayout/DashboardSidebarSubNavigation.tsx
|
|
2282
|
-
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
2283
|
-
function DashboardSidebarSubNavigationPageItem({
|
|
2284
|
-
id,
|
|
2285
|
-
item,
|
|
2286
|
-
isExpanded,
|
|
2287
|
-
onClick,
|
|
2288
|
-
depth,
|
|
2289
|
-
onLinkClick,
|
|
2290
|
-
isMini,
|
|
2291
|
-
isFullyExpanded,
|
|
2292
|
-
isFullyCollapsed,
|
|
2293
|
-
sidebarExpandedWidth,
|
|
2294
|
-
renderPageItem
|
|
2295
|
-
}) {
|
|
2296
|
-
const navigationContext = React25.useContext(NavigationContext);
|
|
2297
|
-
const activePage = useActivePage();
|
|
2298
|
-
const isActive = !!activePage && activePage.path === getItemPath(navigationContext, item);
|
|
2299
|
-
const isSelected = activePage && item.children && isMini ? hasSelectedNavigationChildren(navigationContext, item, activePage.path) : isActive && !item.children;
|
|
2300
|
-
const pageItemContextProps = React25.useMemo(
|
|
2301
|
-
() => ({
|
|
2302
|
-
expanded: isExpanded,
|
|
2303
|
-
selected: isSelected,
|
|
2304
|
-
id,
|
|
2305
|
-
onClick,
|
|
2306
|
-
isMini,
|
|
2307
|
-
isSidebarFullyExpanded: isFullyExpanded,
|
|
2308
|
-
isSidebarFullyCollapsed: isFullyCollapsed,
|
|
2309
|
-
renderNestedNavigation: () => {
|
|
2310
|
-
var _a;
|
|
2311
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2312
|
-
DashboardSidebarSubNavigation,
|
|
2313
|
-
{
|
|
2314
|
-
subNavigation: (_a = item.children) != null ? _a : [],
|
|
2315
|
-
depth: depth + 1,
|
|
2316
|
-
onLinkClick,
|
|
2317
|
-
isPopover: isMini,
|
|
2318
|
-
sidebarExpandedWidth
|
|
2319
|
-
}
|
|
2320
|
-
);
|
|
2321
|
-
}
|
|
2322
|
-
}),
|
|
2323
|
-
[
|
|
2324
|
-
depth,
|
|
2325
|
-
id,
|
|
2326
|
-
isExpanded,
|
|
2327
|
-
isFullyCollapsed,
|
|
2328
|
-
isFullyExpanded,
|
|
2329
|
-
isMini,
|
|
2330
|
-
isSelected,
|
|
2331
|
-
item.children,
|
|
2332
|
-
onClick,
|
|
2333
|
-
onLinkClick,
|
|
2334
|
-
sidebarExpandedWidth
|
|
2335
|
-
]
|
|
2336
|
-
);
|
|
2337
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DashboardSidebarPageItemContext.Provider, { value: pageItemContextProps, children: renderPageItem ? renderPageItem(item, { mini: isMini }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DashboardSidebarPageItem, { item }) });
|
|
2338
|
-
}
|
|
2339
|
-
function DashboardSidebarSubNavigation({
|
|
2340
|
-
subNavigation,
|
|
2341
|
-
depth = 0,
|
|
2342
|
-
onLinkClick,
|
|
2343
|
-
isMini = false,
|
|
2344
|
-
isPopover = false,
|
|
2345
|
-
isFullyExpanded = true,
|
|
2346
|
-
isFullyCollapsed = false,
|
|
2347
|
-
hasDrawerTransitions = false,
|
|
2348
|
-
sidebarExpandedWidth,
|
|
2349
|
-
renderPageItem
|
|
2350
|
-
}) {
|
|
2351
|
-
const navigationContext = React25.useContext(NavigationContext);
|
|
2352
|
-
const activePage = useActivePage();
|
|
2353
|
-
const initialExpandedItemIds = React25.useMemo(
|
|
2354
|
-
() => subNavigation.map((navigationItem, navigationItemIndex) => ({
|
|
2355
|
-
navigationItem,
|
|
2356
|
-
originalIndex: navigationItemIndex
|
|
2357
|
-
})).filter(
|
|
2358
|
-
({ navigationItem }) => isPageItem(navigationItem) && !!activePage && hasSelectedNavigationChildren(navigationContext, navigationItem, activePage.path)
|
|
2359
|
-
).map(({ originalIndex }) => `page-${depth}-${originalIndex}`),
|
|
2360
|
-
[activePage, depth, navigationContext, subNavigation]
|
|
2361
|
-
);
|
|
2362
|
-
const [expandedItemIds, setExpandedItemIds] = React25.useState(initialExpandedItemIds);
|
|
2363
|
-
const handlePageItemClick = React25.useCallback(
|
|
2364
|
-
(itemId, item) => {
|
|
2365
|
-
if (item.children && !isMini) {
|
|
2366
|
-
setExpandedItemIds(
|
|
2367
|
-
(previousValue) => previousValue.includes(itemId) ? previousValue.filter((previousValueItemId) => previousValueItemId !== itemId) : [...previousValue, itemId]
|
|
2368
|
-
);
|
|
2369
|
-
} else if (!item.children) {
|
|
2370
|
-
onLinkClick();
|
|
2371
|
-
}
|
|
2372
|
-
},
|
|
2373
|
-
[isMini, onLinkClick]
|
|
2374
|
-
);
|
|
2375
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2376
|
-
import_List.default,
|
|
2377
|
-
{
|
|
2378
|
-
sx: {
|
|
2379
|
-
padding: 0,
|
|
2380
|
-
mt: isPopover && depth === 1 ? 0.5 : 0,
|
|
2381
|
-
mb: depth === 0 && !isPopover ? 4 : 0.5,
|
|
2382
|
-
pl: (isPopover ? 1 : 2) * (isPopover ? depth - 1 : depth),
|
|
2383
|
-
minWidth: isPopover && depth === 1 ? 240 : "auto",
|
|
2384
|
-
width: isMini ? MINI_DRAWER_WIDTH : "auto"
|
|
2385
|
-
},
|
|
2386
|
-
children: subNavigation.map((navigationItem, navigationItemIndex) => {
|
|
2387
|
-
if (navigationItem.kind === "header") {
|
|
2388
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2389
|
-
import_ListSubheader.default,
|
|
2390
|
-
{
|
|
2391
|
-
sx: __spreadProps(__spreadValues({
|
|
2392
|
-
fontSize: 12,
|
|
2393
|
-
fontWeight: "700",
|
|
2394
|
-
height: isMini ? 0 : 40
|
|
2395
|
-
}, hasDrawerTransitions ? getDrawerSxTransitionMixin(isFullyExpanded, "height") : {}), {
|
|
2396
|
-
px: 2,
|
|
2397
|
-
minWidth: sidebarExpandedWidth,
|
|
2398
|
-
overflow: "hidden",
|
|
2399
|
-
textOverflow: "ellipsis",
|
|
2400
|
-
whiteSpace: "nowrap",
|
|
2401
|
-
zIndex: 2
|
|
2402
|
-
}),
|
|
2403
|
-
children: getItemTitle(navigationItem)
|
|
2404
|
-
},
|
|
2405
|
-
`subheader-${depth}-${navigationItemIndex}`
|
|
2406
|
-
);
|
|
2407
|
-
}
|
|
2408
|
-
if (navigationItem.kind === "divider") {
|
|
2409
|
-
const nextItem = subNavigation[navigationItemIndex + 1];
|
|
2410
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2411
|
-
import_Divider2.default,
|
|
2412
|
-
{
|
|
2413
|
-
sx: __spreadValues({
|
|
2414
|
-
borderBottomWidth: 2,
|
|
2415
|
-
mx: 1,
|
|
2416
|
-
mt: 1,
|
|
2417
|
-
mb: (nextItem == null ? void 0 : nextItem.kind) === "header" && !isMini ? 0 : 1
|
|
2418
|
-
}, hasDrawerTransitions ? getDrawerSxTransitionMixin(isFullyExpanded, "margin") : {})
|
|
2419
|
-
}
|
|
2420
|
-
) }, `divider-${depth}-${navigationItemIndex}`);
|
|
2421
|
-
}
|
|
2422
|
-
const pageItemId = `page-${depth}-${navigationItemIndex}`;
|
|
2423
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
2424
|
-
DashboardSidebarSubNavigationPageItem,
|
|
2425
|
-
{
|
|
2426
|
-
id: pageItemId,
|
|
2427
|
-
item: navigationItem,
|
|
2428
|
-
isExpanded: expandedItemIds.includes(pageItemId),
|
|
2429
|
-
onClick: handlePageItemClick,
|
|
2430
|
-
depth,
|
|
2431
|
-
onLinkClick,
|
|
2432
|
-
isMini,
|
|
2433
|
-
isFullyExpanded,
|
|
2434
|
-
isFullyCollapsed,
|
|
2435
|
-
sidebarExpandedWidth,
|
|
2436
|
-
renderPageItem
|
|
2437
|
-
},
|
|
2438
|
-
pageItemId
|
|
2439
|
-
);
|
|
2440
|
-
})
|
|
2441
|
-
}
|
|
2442
|
-
);
|
|
2443
|
-
}
|
|
2444
|
-
|
|
2445
|
-
// src/toolpad-utils/warnOnce.ts
|
|
2446
|
-
var history = /* @__PURE__ */ new Set();
|
|
2447
|
-
function warnOnce(msg) {
|
|
2448
|
-
if (!history.has(msg)) {
|
|
2449
|
-
history.add(msg);
|
|
2450
|
-
console.warn(msg);
|
|
2451
|
-
}
|
|
2452
|
-
}
|
|
2453
|
-
|
|
2454
|
-
// src/toolpad-core/DashboardLayout/DashboardLayout.tsx
|
|
2455
|
-
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
2456
|
-
function DashboardLayout(props) {
|
|
2457
|
-
var _a, _b;
|
|
2458
|
-
const {
|
|
2459
|
-
children,
|
|
2460
|
-
branding,
|
|
2461
|
-
navigation: navigationProp,
|
|
2462
|
-
defaultSidebarCollapsed = false,
|
|
2463
|
-
disableCollapsibleSidebar = false,
|
|
2464
|
-
hideNavigation = false,
|
|
2465
|
-
sidebarExpandedWidth = 320,
|
|
2466
|
-
renderPageItem,
|
|
2467
|
-
slots,
|
|
2468
|
-
slotProps,
|
|
2469
|
-
sx
|
|
2470
|
-
} = props;
|
|
2471
|
-
if (navigationProp && process.env.NODE_ENV !== "production") {
|
|
2472
|
-
warnOnce(
|
|
2473
|
-
"The navigation prop in the DashboardLayout component is deprecated and will eventually be removed. Set the navigation prop in the AppProvider instead (https://mui.com/toolpad/core/react-app-provider/#navigation)."
|
|
2474
|
-
);
|
|
2475
|
-
}
|
|
2476
|
-
const theme = (0, import_styles5.useTheme)();
|
|
2477
|
-
const navigationContext = React26.useContext(NavigationContext);
|
|
2478
|
-
const appWindowContext = React26.useContext(WindowContext);
|
|
2479
|
-
const navigation = navigationProp != null ? navigationProp : navigationContext;
|
|
2480
|
-
const [isDesktopNavigationExpanded, setIsDesktopNavigationExpanded] = React26.useState(!defaultSidebarCollapsed);
|
|
2481
|
-
const [isMobileNavigationExpanded, setIsMobileNavigationExpanded] = React26.useState(false);
|
|
2482
|
-
const isOverSmViewport = (0, import_useMediaQuery.default)(
|
|
2483
|
-
theme.breakpoints.up("sm"),
|
|
2484
|
-
appWindowContext && {
|
|
2485
|
-
matchMedia: appWindowContext.matchMedia
|
|
2486
|
-
}
|
|
2487
|
-
);
|
|
2488
|
-
const isOverMdViewport = (0, import_useMediaQuery.default)(
|
|
2489
|
-
theme.breakpoints.up("md"),
|
|
2490
|
-
appWindowContext && {
|
|
2491
|
-
matchMedia: appWindowContext.matchMedia
|
|
2492
|
-
}
|
|
2493
|
-
);
|
|
2494
|
-
const isNavigationExpanded = isOverMdViewport ? isDesktopNavigationExpanded : isMobileNavigationExpanded;
|
|
2495
|
-
const setIsNavigationExpanded = React26.useCallback(
|
|
2496
|
-
(newExpanded) => {
|
|
2497
|
-
if (isOverMdViewport) {
|
|
2498
|
-
setIsDesktopNavigationExpanded(newExpanded);
|
|
2499
|
-
} else {
|
|
2500
|
-
setIsMobileNavigationExpanded(newExpanded);
|
|
2501
|
-
}
|
|
2502
|
-
},
|
|
2503
|
-
[isOverMdViewport]
|
|
2504
|
-
);
|
|
2505
|
-
const [isNavigationFullyExpanded, setIsNavigationFullyExpanded] = React26.useState(isNavigationExpanded);
|
|
2506
|
-
const [isNavigationFullyCollapsed, setIsNavigationFullyCollapsed] = React26.useState(!isNavigationExpanded);
|
|
2507
|
-
React26.useEffect(() => {
|
|
2508
|
-
if (isNavigationExpanded) {
|
|
2509
|
-
const drawerWidthTransitionTimeout = setTimeout(() => {
|
|
2510
|
-
setIsNavigationFullyExpanded(true);
|
|
2511
|
-
}, theme.transitions.duration.enteringScreen);
|
|
2512
|
-
return () => clearTimeout(drawerWidthTransitionTimeout);
|
|
2513
|
-
}
|
|
2514
|
-
setIsNavigationFullyExpanded(false);
|
|
2515
|
-
return () => {
|
|
2516
|
-
};
|
|
2517
|
-
}, [isNavigationExpanded, theme]);
|
|
2518
|
-
React26.useEffect(() => {
|
|
2519
|
-
if (!isNavigationExpanded) {
|
|
2520
|
-
const drawerWidthTransitionTimeout = setTimeout(() => {
|
|
2521
|
-
setIsNavigationFullyCollapsed(true);
|
|
2522
|
-
}, theme.transitions.duration.leavingScreen);
|
|
2523
|
-
return () => clearTimeout(drawerWidthTransitionTimeout);
|
|
2524
|
-
}
|
|
2525
|
-
setIsNavigationFullyCollapsed(false);
|
|
2526
|
-
return () => {
|
|
2527
|
-
};
|
|
2528
|
-
}, [isNavigationExpanded, theme]);
|
|
2529
|
-
const handleSetNavigationExpanded = React26.useCallback(
|
|
2530
|
-
(newExpanded) => () => {
|
|
2531
|
-
setIsNavigationExpanded(newExpanded);
|
|
2532
|
-
},
|
|
2533
|
-
[setIsNavigationExpanded]
|
|
2534
|
-
);
|
|
2535
|
-
const handleToggleHeaderMenu = React26.useCallback(
|
|
2536
|
-
(isExpanded) => {
|
|
2537
|
-
setIsNavigationExpanded(isExpanded);
|
|
2538
|
-
},
|
|
2539
|
-
[setIsNavigationExpanded]
|
|
2540
|
-
);
|
|
2541
|
-
const handleNavigationLinkClick = React26.useCallback(() => {
|
|
2542
|
-
setIsMobileNavigationExpanded(false);
|
|
2543
|
-
}, [setIsMobileNavigationExpanded]);
|
|
2544
|
-
const isDesktopMini = !disableCollapsibleSidebar && !isDesktopNavigationExpanded;
|
|
2545
|
-
const isMobileMini = !disableCollapsibleSidebar && !isMobileNavigationExpanded;
|
|
2546
|
-
const hasDrawerTransitions = isOverSmViewport && (!disableCollapsibleSidebar || isOverMdViewport);
|
|
2547
|
-
const SidebarFooterSlot = (_a = slots == null ? void 0 : slots.sidebarFooter) != null ? _a : null;
|
|
2548
|
-
const HeaderSlot = (_b = slots == null ? void 0 : slots.header) != null ? _b : DashboardHeader;
|
|
2549
|
-
const headerSlotProps = React26.useMemo(
|
|
2550
|
-
() => __spreadValues({
|
|
2551
|
-
branding,
|
|
2552
|
-
menuOpen: isNavigationExpanded,
|
|
2553
|
-
onToggleMenu: handleToggleHeaderMenu,
|
|
2554
|
-
hideMenuButton: hideNavigation || isOverMdViewport && disableCollapsibleSidebar,
|
|
2555
|
-
slots: {
|
|
2556
|
-
appTitle: slots == null ? void 0 : slots.appTitle,
|
|
2557
|
-
toolbarActions: slots == null ? void 0 : slots.toolbarActions,
|
|
2558
|
-
toolbarAccount: slots == null ? void 0 : slots.toolbarAccount
|
|
2559
|
-
},
|
|
2560
|
-
slotProps: {
|
|
2561
|
-
appTitle: slotProps == null ? void 0 : slotProps.appTitle,
|
|
2562
|
-
toolbarActions: slotProps == null ? void 0 : slotProps.toolbarActions,
|
|
2563
|
-
toolbarAccount: slotProps == null ? void 0 : slotProps.toolbarAccount
|
|
2564
|
-
}
|
|
2565
|
-
}, slotProps == null ? void 0 : slotProps.header),
|
|
2566
|
-
[
|
|
2567
|
-
branding,
|
|
2568
|
-
isNavigationExpanded,
|
|
2569
|
-
handleToggleHeaderMenu,
|
|
2570
|
-
hideNavigation,
|
|
2571
|
-
isOverMdViewport,
|
|
2572
|
-
disableCollapsibleSidebar,
|
|
2573
|
-
slotProps,
|
|
2574
|
-
slots
|
|
2575
|
-
]
|
|
2576
|
-
);
|
|
2577
|
-
const getDrawerContent = React26.useCallback(
|
|
2578
|
-
(isMini, viewport) => {
|
|
2579
|
-
var _a2;
|
|
2580
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(React26.Fragment, { children: [
|
|
2581
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_Toolbar2.default, {}),
|
|
2582
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2583
|
-
import_Box4.default,
|
|
2584
|
-
{
|
|
2585
|
-
component: "nav",
|
|
2586
|
-
"aria-label": `${viewport.charAt(0).toUpperCase()}${viewport.slice(1)}`,
|
|
2587
|
-
sx: __spreadValues({
|
|
2588
|
-
height: "100%",
|
|
2589
|
-
display: "flex",
|
|
2590
|
-
flexDirection: "column",
|
|
2591
|
-
justifyContent: "space-between",
|
|
2592
|
-
overflow: "auto",
|
|
2593
|
-
scrollbarGutter: isMini ? "stable" : "auto",
|
|
2594
|
-
overflowX: "hidden",
|
|
2595
|
-
pt: ((_a2 = navigation[0]) == null ? void 0 : _a2.kind) === "header" && !isMini ? 0 : 2
|
|
2596
|
-
}, hasDrawerTransitions ? getDrawerSxTransitionMixin(isNavigationFullyExpanded, "padding") : {}),
|
|
2597
|
-
children: [
|
|
2598
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2599
|
-
DashboardSidebarSubNavigation,
|
|
2600
|
-
{
|
|
2601
|
-
subNavigation: navigation,
|
|
2602
|
-
onLinkClick: handleNavigationLinkClick,
|
|
2603
|
-
isMini,
|
|
2604
|
-
isFullyExpanded: isNavigationFullyExpanded,
|
|
2605
|
-
isFullyCollapsed: isNavigationFullyCollapsed,
|
|
2606
|
-
hasDrawerTransitions,
|
|
2607
|
-
sidebarExpandedWidth,
|
|
2608
|
-
renderPageItem
|
|
2609
|
-
}
|
|
2610
|
-
),
|
|
2611
|
-
SidebarFooterSlot ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SidebarFooterSlot, __spreadValues({ mini: isMini }, slotProps == null ? void 0 : slotProps.sidebarFooter)) : null
|
|
2612
|
-
]
|
|
2613
|
-
}
|
|
2614
|
-
)
|
|
2615
|
-
] });
|
|
2616
|
-
},
|
|
2617
|
-
[
|
|
2618
|
-
SidebarFooterSlot,
|
|
2619
|
-
handleNavigationLinkClick,
|
|
2620
|
-
hasDrawerTransitions,
|
|
2621
|
-
isNavigationFullyCollapsed,
|
|
2622
|
-
isNavigationFullyExpanded,
|
|
2623
|
-
navigation,
|
|
2624
|
-
sidebarExpandedWidth,
|
|
2625
|
-
renderPageItem,
|
|
2626
|
-
slotProps == null ? void 0 : slotProps.sidebarFooter
|
|
2627
|
-
]
|
|
2628
|
-
);
|
|
2629
|
-
const getDrawerSharedSx = React26.useCallback(
|
|
2630
|
-
(isMini, isTemporary) => {
|
|
2631
|
-
const drawerWidth = isMini ? MINI_DRAWER_WIDTH : sidebarExpandedWidth;
|
|
2632
|
-
return __spreadProps(__spreadValues(__spreadValues({
|
|
2633
|
-
displayPrint: "none",
|
|
2634
|
-
width: drawerWidth,
|
|
2635
|
-
flexShrink: 0
|
|
2636
|
-
}, getDrawerWidthTransitionMixin(isNavigationExpanded)), isTemporary ? { position: "absolute" } : {}), {
|
|
2637
|
-
[`& .MuiDrawer-paper`]: __spreadValues({
|
|
2638
|
-
position: "absolute",
|
|
2639
|
-
width: drawerWidth,
|
|
2640
|
-
boxSizing: "border-box",
|
|
2641
|
-
backgroundImage: "none"
|
|
2642
|
-
}, getDrawerWidthTransitionMixin(isNavigationExpanded))
|
|
2643
|
-
});
|
|
2644
|
-
},
|
|
2645
|
-
[isNavigationExpanded, sidebarExpandedWidth]
|
|
2646
|
-
);
|
|
2647
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2648
|
-
import_Box4.default,
|
|
2649
|
-
{
|
|
2650
|
-
sx: __spreadValues({
|
|
2651
|
-
position: "relative",
|
|
2652
|
-
display: "flex",
|
|
2653
|
-
overflow: "hidden",
|
|
2654
|
-
height: "100vh",
|
|
2655
|
-
width: "100vw"
|
|
2656
|
-
}, sx),
|
|
2657
|
-
children: [
|
|
2658
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(HeaderSlot, __spreadValues({}, headerSlotProps)),
|
|
2659
|
-
!hideNavigation ? /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(React26.Fragment, { children: [
|
|
2660
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2661
|
-
import_Drawer.default,
|
|
2662
|
-
{
|
|
2663
|
-
container: appWindowContext == null ? void 0 : appWindowContext.document.body,
|
|
2664
|
-
variant: "temporary",
|
|
2665
|
-
open: isMobileNavigationExpanded,
|
|
2666
|
-
onClose: handleSetNavigationExpanded(false),
|
|
2667
|
-
ModalProps: {
|
|
2668
|
-
keepMounted: true
|
|
2669
|
-
// Better open performance on mobile.
|
|
2670
|
-
},
|
|
2671
|
-
sx: __spreadValues({
|
|
2672
|
-
display: {
|
|
2673
|
-
xs: "block",
|
|
2674
|
-
sm: disableCollapsibleSidebar ? "block" : "none",
|
|
2675
|
-
md: "none"
|
|
2676
|
-
}
|
|
2677
|
-
}, getDrawerSharedSx(false, true)),
|
|
2678
|
-
children: getDrawerContent(false, "phone")
|
|
2679
|
-
}
|
|
2680
|
-
),
|
|
2681
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2682
|
-
import_Drawer.default,
|
|
2683
|
-
{
|
|
2684
|
-
variant: "permanent",
|
|
2685
|
-
sx: __spreadValues({
|
|
2686
|
-
display: {
|
|
2687
|
-
xs: "none",
|
|
2688
|
-
sm: disableCollapsibleSidebar ? "none" : "block",
|
|
2689
|
-
md: "none"
|
|
2690
|
-
}
|
|
2691
|
-
}, getDrawerSharedSx(isMobileMini, false)),
|
|
2692
|
-
children: getDrawerContent(isMobileMini, "tablet")
|
|
2693
|
-
}
|
|
2694
|
-
),
|
|
2695
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2696
|
-
import_Drawer.default,
|
|
2697
|
-
{
|
|
2698
|
-
variant: "permanent",
|
|
2699
|
-
sx: __spreadValues({
|
|
2700
|
-
display: { xs: "none", md: "block" }
|
|
2701
|
-
}, getDrawerSharedSx(isDesktopMini, false)),
|
|
2702
|
-
children: getDrawerContent(isDesktopMini, "desktop")
|
|
2703
|
-
}
|
|
2704
|
-
)
|
|
2705
|
-
] }) : null,
|
|
2706
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
2707
|
-
import_Box4.default,
|
|
2708
|
-
{
|
|
2709
|
-
sx: {
|
|
2710
|
-
display: "flex",
|
|
2711
|
-
flexDirection: "column",
|
|
2712
|
-
flex: 1,
|
|
2713
|
-
minWidth: 0
|
|
2714
|
-
},
|
|
2715
|
-
children: [
|
|
2716
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_Toolbar2.default, { sx: { displayPrint: "none" } }),
|
|
2717
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
2718
|
-
import_Box4.default,
|
|
2719
|
-
{
|
|
2720
|
-
component: "main",
|
|
2721
|
-
sx: {
|
|
2722
|
-
display: "flex",
|
|
2723
|
-
flexDirection: "column",
|
|
2724
|
-
flex: 1,
|
|
2725
|
-
overflow: "auto"
|
|
2726
|
-
},
|
|
2727
|
-
children
|
|
2728
|
-
}
|
|
2729
|
-
)
|
|
2730
|
-
]
|
|
2731
|
-
}
|
|
2732
|
-
)
|
|
2733
|
-
]
|
|
2734
|
-
}
|
|
2735
|
-
);
|
|
2736
|
-
}
|
|
2737
|
-
DashboardLayout.propTypes = {
|
|
2738
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
2739
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
2740
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
2741
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
2742
|
-
/**
|
|
2743
|
-
* Branding options for the dashboard.
|
|
2744
|
-
* @default null
|
|
2745
|
-
*/
|
|
2746
|
-
branding: import_prop_types11.default.shape({
|
|
2747
|
-
homeUrl: import_prop_types11.default.string,
|
|
2748
|
-
logo: import_prop_types11.default.node,
|
|
2749
|
-
title: import_prop_types11.default.string
|
|
2750
|
-
}),
|
|
2751
|
-
/**
|
|
2752
|
-
* The content of the dashboard.
|
|
2753
|
-
*/
|
|
2754
|
-
children: import_prop_types11.default.node,
|
|
2755
|
-
/**
|
|
2756
|
-
* Whether the sidebar should start collapsed in desktop size screens.
|
|
2757
|
-
* @default false
|
|
2758
|
-
*/
|
|
2759
|
-
defaultSidebarCollapsed: import_prop_types11.default.bool,
|
|
2760
|
-
/**
|
|
2761
|
-
* Whether the sidebar should not be collapsible to a mini variant in desktop and tablet viewports.
|
|
2762
|
-
* @default false
|
|
2763
|
-
*/
|
|
2764
|
-
disableCollapsibleSidebar: import_prop_types11.default.bool,
|
|
2765
|
-
/**
|
|
2766
|
-
* Whether the navigation bar and menu icon should be hidden.
|
|
2767
|
-
* @default false
|
|
2768
|
-
*/
|
|
2769
|
-
hideNavigation: import_prop_types11.default.bool,
|
|
2770
|
-
/**
|
|
2771
|
-
* Navigation definition for the dashboard. [Find out more](https://mui.com/toolpad/core/react-dashboard-layout/#navigation).
|
|
2772
|
-
* @default []
|
|
2773
|
-
* @deprecated Set the navigation in the [AppProvider](https://mui.com/toolpad/core/react-app-provider/#navigation) instead.
|
|
2774
|
-
*/
|
|
2775
|
-
navigation: import_prop_types11.default.arrayOf(
|
|
2776
|
-
import_prop_types11.default.oneOfType([
|
|
2777
|
-
import_prop_types11.default.shape({
|
|
2778
|
-
action: import_prop_types11.default.node,
|
|
2779
|
-
children: import_prop_types11.default.arrayOf(
|
|
2780
|
-
import_prop_types11.default.oneOfType([
|
|
2781
|
-
import_prop_types11.default.object,
|
|
2782
|
-
import_prop_types11.default.shape({
|
|
2783
|
-
kind: import_prop_types11.default.oneOf(["header"]).isRequired,
|
|
2784
|
-
title: import_prop_types11.default.string.isRequired
|
|
2785
|
-
}),
|
|
2786
|
-
import_prop_types11.default.shape({
|
|
2787
|
-
kind: import_prop_types11.default.oneOf(["divider"]).isRequired
|
|
2788
|
-
})
|
|
2789
|
-
]).isRequired
|
|
2790
|
-
),
|
|
2791
|
-
icon: import_prop_types11.default.node,
|
|
2792
|
-
kind: import_prop_types11.default.oneOf(["page"]),
|
|
2793
|
-
pattern: import_prop_types11.default.string,
|
|
2794
|
-
segment: import_prop_types11.default.string,
|
|
2795
|
-
title: import_prop_types11.default.string
|
|
2796
|
-
}),
|
|
2797
|
-
import_prop_types11.default.shape({
|
|
2798
|
-
kind: import_prop_types11.default.oneOf(["header"]).isRequired,
|
|
2799
|
-
title: import_prop_types11.default.string.isRequired
|
|
2800
|
-
}),
|
|
2801
|
-
import_prop_types11.default.shape({
|
|
2802
|
-
kind: import_prop_types11.default.oneOf(["divider"]).isRequired
|
|
2803
|
-
})
|
|
2804
|
-
]).isRequired
|
|
2805
|
-
),
|
|
2806
|
-
/**
|
|
2807
|
-
* Render each page item.
|
|
2808
|
-
*
|
|
2809
|
-
* @param {NavigationPageItem} item
|
|
2810
|
-
* @param {{ mini: boolean }} params
|
|
2811
|
-
* @returns {ReactNode}
|
|
2812
|
-
*/
|
|
2813
|
-
renderPageItem: import_prop_types11.default.func,
|
|
2814
|
-
/**
|
|
2815
|
-
* Width of the sidebar when expanded.
|
|
2816
|
-
* @default 320
|
|
2817
|
-
*/
|
|
2818
|
-
sidebarExpandedWidth: import_prop_types11.default.oneOfType([import_prop_types11.default.number, import_prop_types11.default.string]),
|
|
2819
|
-
/**
|
|
2820
|
-
* The props used for each slot inside.
|
|
2821
|
-
* @default {}
|
|
2822
|
-
*/
|
|
2823
|
-
slotProps: import_prop_types11.default.shape({
|
|
2824
|
-
appTitle: import_prop_types11.default.shape({
|
|
2825
|
-
branding: import_prop_types11.default.shape({
|
|
2826
|
-
homeUrl: import_prop_types11.default.string,
|
|
2827
|
-
logo: import_prop_types11.default.node,
|
|
2828
|
-
title: import_prop_types11.default.string
|
|
2829
|
-
})
|
|
2830
|
-
}),
|
|
2831
|
-
header: import_prop_types11.default.shape({
|
|
2832
|
-
branding: import_prop_types11.default.shape({
|
|
2833
|
-
homeUrl: import_prop_types11.default.string,
|
|
2834
|
-
logo: import_prop_types11.default.node,
|
|
2835
|
-
title: import_prop_types11.default.string
|
|
2836
|
-
}),
|
|
2837
|
-
hideMenuButton: import_prop_types11.default.bool,
|
|
2838
|
-
menuOpen: import_prop_types11.default.bool.isRequired,
|
|
2839
|
-
onToggleMenu: import_prop_types11.default.func.isRequired,
|
|
2840
|
-
slotProps: import_prop_types11.default.shape({
|
|
2841
|
-
appTitle: import_prop_types11.default.object,
|
|
2842
|
-
toolbarAccount: import_prop_types11.default.object,
|
|
2843
|
-
toolbarActions: import_prop_types11.default.object
|
|
2844
|
-
}),
|
|
2845
|
-
slots: import_prop_types11.default.shape({
|
|
2846
|
-
appTitle: import_prop_types11.default.elementType,
|
|
2847
|
-
toolbarAccount: import_prop_types11.default.elementType,
|
|
2848
|
-
toolbarActions: import_prop_types11.default.elementType
|
|
2849
|
-
})
|
|
2850
|
-
}),
|
|
2851
|
-
sidebarFooter: import_prop_types11.default.shape({
|
|
2852
|
-
mini: import_prop_types11.default.bool.isRequired
|
|
2853
|
-
}),
|
|
2854
|
-
toolbarAccount: import_prop_types11.default.shape({
|
|
2855
|
-
localeText: import_prop_types11.default.object,
|
|
2856
|
-
slotProps: import_prop_types11.default.shape({
|
|
2857
|
-
popover: import_prop_types11.default.object,
|
|
2858
|
-
popoverContent: import_prop_types11.default.object,
|
|
2859
|
-
preview: import_prop_types11.default.object,
|
|
2860
|
-
signInButton: import_prop_types11.default.object,
|
|
2861
|
-
signOutButton: import_prop_types11.default.object
|
|
2862
|
-
}),
|
|
2863
|
-
slots: import_prop_types11.default.shape({
|
|
2864
|
-
popover: import_prop_types11.default.elementType,
|
|
2865
|
-
popoverContent: import_prop_types11.default.elementType,
|
|
2866
|
-
preview: import_prop_types11.default.elementType,
|
|
2867
|
-
signInButton: import_prop_types11.default.elementType,
|
|
2868
|
-
signOutButton: import_prop_types11.default.elementType
|
|
2869
|
-
})
|
|
2870
|
-
}),
|
|
2871
|
-
toolbarActions: import_prop_types11.default.object
|
|
2872
|
-
}),
|
|
2873
|
-
/**
|
|
2874
|
-
* The components used for each slot inside.
|
|
2875
|
-
* @default {}
|
|
2876
|
-
*/
|
|
2877
|
-
slots: import_prop_types11.default.shape({
|
|
2878
|
-
appTitle: import_prop_types11.default.elementType,
|
|
2879
|
-
header: import_prop_types11.default.elementType,
|
|
2880
|
-
sidebarFooter: import_prop_types11.default.elementType,
|
|
2881
|
-
toolbarAccount: import_prop_types11.default.elementType,
|
|
2882
|
-
toolbarActions: import_prop_types11.default.elementType
|
|
2883
|
-
}),
|
|
2884
|
-
/**
|
|
2885
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
2886
|
-
*/
|
|
2887
|
-
sx: import_prop_types11.default.oneOfType([
|
|
2888
|
-
import_prop_types11.default.arrayOf(import_prop_types11.default.oneOfType([import_prop_types11.default.func, import_prop_types11.default.object, import_prop_types11.default.bool])),
|
|
2889
|
-
import_prop_types11.default.func,
|
|
2890
|
-
import_prop_types11.default.object
|
|
2891
|
-
])
|
|
2892
|
-
};
|
|
2893
|
-
|
|
2894
|
-
// src/toolpad-core/PageContainer/PageContainer.tsx
|
|
2895
|
-
var import_prop_types14 = __toESM(require("prop-types"));
|
|
2896
|
-
var import_Box5 = __toESM(require("@mui/material/Box"));
|
|
2897
|
-
var import_Container = __toESM(require("@mui/material/Container"));
|
|
2898
|
-
var import_Stack8 = __toESM(require("@mui/material/Stack"));
|
|
2899
|
-
|
|
2900
|
-
// src/toolpad-core/PageContainer/PageHeader.tsx
|
|
2901
|
-
var import_prop_types13 = __toESM(require("prop-types"));
|
|
2902
|
-
var import_Breadcrumbs = __toESM(require("@mui/material/Breadcrumbs"));
|
|
2903
|
-
var import_Link3 = __toESM(require("@mui/material/Link"));
|
|
2904
|
-
var import_Stack7 = __toESM(require("@mui/material/Stack"));
|
|
2905
|
-
var import_Typography4 = __toESM(require("@mui/material/Typography"));
|
|
2906
|
-
var import_useSlotProps2 = __toESM(require("@mui/utils/useSlotProps"));
|
|
2907
|
-
var import_material7 = require("@mui/material");
|
|
2908
|
-
|
|
2909
|
-
// src/toolpad-core/PageContainer/PageHeaderToolbar.tsx
|
|
2910
|
-
var import_prop_types12 = __toESM(require("prop-types"));
|
|
2911
|
-
var import_material6 = require("@mui/material");
|
|
2912
|
-
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
2913
|
-
var PageHeaderToolbarRoot = (0, import_material6.styled)("div")(({ theme }) => ({
|
|
2914
|
-
display: "flex",
|
|
2915
|
-
flexDirection: "row",
|
|
2916
|
-
gap: theme.spacing(1),
|
|
2917
|
-
// Ensure the toolbar is always on the right side, even after wrapping
|
|
2918
|
-
marginLeft: "auto"
|
|
2919
|
-
}));
|
|
2920
|
-
function PageHeaderToolbar(props) {
|
|
2921
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PageHeaderToolbarRoot, __spreadValues({}, props));
|
|
2922
|
-
}
|
|
2923
|
-
PageHeaderToolbar.propTypes = {
|
|
2924
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
2925
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
2926
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
2927
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
2928
|
-
/**
|
|
2929
|
-
* @ignore
|
|
2930
|
-
*/
|
|
2931
|
-
children: import_prop_types12.default.node
|
|
2932
|
-
};
|
|
2933
|
-
|
|
2934
|
-
// src/toolpad-core/PageContainer/PageHeader.tsx
|
|
2935
|
-
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
2936
|
-
var PageContentHeader = (0, import_material7.styled)("div")(({ theme }) => ({
|
|
2937
|
-
display: "flex",
|
|
2938
|
-
flexDirection: "row",
|
|
2939
|
-
justifyContent: "space-between",
|
|
2940
|
-
gap: theme.spacing(2)
|
|
2941
|
-
}));
|
|
2942
|
-
function PageHeader(props) {
|
|
2943
|
-
var _a, _b, _c, _d, _e;
|
|
2944
|
-
const { breadcrumbs, title } = props;
|
|
2945
|
-
const activePage = useActivePage();
|
|
2946
|
-
const resolvedBreadcrumbs = (_a = breadcrumbs != null ? breadcrumbs : activePage == null ? void 0 : activePage.breadcrumbs) != null ? _a : [];
|
|
2947
|
-
const resolvedTitle = (_b = title != null ? title : activePage == null ? void 0 : activePage.title) != null ? _b : "";
|
|
2948
|
-
const ToolbarComponent = (_d = (_c = props == null ? void 0 : props.slots) == null ? void 0 : _c.toolbar) != null ? _d : PageHeaderToolbar;
|
|
2949
|
-
const toolbarSlotProps = (0, import_useSlotProps2.default)({
|
|
2950
|
-
elementType: ToolbarComponent,
|
|
2951
|
-
ownerState: props,
|
|
2952
|
-
externalSlotProps: (_e = props == null ? void 0 : props.slotProps) == null ? void 0 : _e.toolbar,
|
|
2953
|
-
additionalProps: {}
|
|
2954
|
-
});
|
|
2955
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_Stack7.default, { children: [
|
|
2956
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_Breadcrumbs.default, { "aria-label": "breadcrumb", children: resolvedBreadcrumbs ? resolvedBreadcrumbs.map((item, index) => {
|
|
2957
|
-
return item.path ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
2958
|
-
import_Link3.default,
|
|
2959
|
-
{
|
|
2960
|
-
component: Link2,
|
|
2961
|
-
underline: "hover",
|
|
2962
|
-
color: "inherit",
|
|
2963
|
-
href: item.path,
|
|
2964
|
-
children: getItemTitle(item)
|
|
2965
|
-
},
|
|
2966
|
-
index
|
|
2967
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_Typography4.default, { color: "text.primary", children: getItemTitle(item) }, index);
|
|
2968
|
-
}) : null }),
|
|
2969
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(PageContentHeader, { children: [
|
|
2970
|
-
resolvedTitle ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_Typography4.default, { variant: "h4", children: resolvedTitle }) : null,
|
|
2971
|
-
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ToolbarComponent, __spreadValues({}, toolbarSlotProps))
|
|
2972
|
-
] })
|
|
2973
|
-
] });
|
|
2974
|
-
}
|
|
2975
|
-
PageHeader.propTypes = {
|
|
2976
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
2977
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
2978
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
2979
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
2980
|
-
/**
|
|
2981
|
-
* The breadcrumbs of the page. Leave blank to use the active page breadcrumbs.
|
|
2982
|
-
*/
|
|
2983
|
-
breadcrumbs: import_prop_types13.default.arrayOf(
|
|
2984
|
-
import_prop_types13.default.shape({
|
|
2985
|
-
path: import_prop_types13.default.string,
|
|
2986
|
-
title: import_prop_types13.default.string.isRequired
|
|
2987
|
-
})
|
|
2988
|
-
),
|
|
2989
|
-
/**
|
|
2990
|
-
* The props used for each slot inside.
|
|
2991
|
-
*/
|
|
2992
|
-
slotProps: import_prop_types13.default.shape({
|
|
2993
|
-
toolbar: import_prop_types13.default.shape({
|
|
2994
|
-
children: import_prop_types13.default.node
|
|
2995
|
-
}).isRequired
|
|
2996
|
-
}),
|
|
2997
|
-
/**
|
|
2998
|
-
* The components used for each slot inside.
|
|
2999
|
-
*/
|
|
3000
|
-
slots: import_prop_types13.default.shape({
|
|
3001
|
-
toolbar: import_prop_types13.default.elementType
|
|
3002
|
-
}),
|
|
3003
|
-
/**
|
|
3004
|
-
* The title of the page. Leave blank to use the active page title.
|
|
3005
|
-
*/
|
|
3006
|
-
title: import_prop_types13.default.string
|
|
3007
|
-
};
|
|
3008
|
-
|
|
3009
|
-
// src/toolpad-core/PageContainer/PageContainer.tsx
|
|
3010
|
-
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3011
|
-
function PageContainer(props) {
|
|
3012
|
-
var _b;
|
|
3013
|
-
const _a = props, { children, breadcrumbs, slots, slotProps, title } = _a, rest = __objRest(_a, ["children", "breadcrumbs", "slots", "slotProps", "title"]);
|
|
3014
|
-
const PageHeaderSlot = (_b = slots == null ? void 0 : slots.header) != null ? _b : PageHeader;
|
|
3015
|
-
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_Container.default, __spreadProps(__spreadValues({}, rest), { sx: __spreadValues({ flex: 1, display: "flex", flexDirection: "column" }, rest.sx), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_Stack8.default, { sx: { flex: 1, my: 2 }, spacing: 2, children: [
|
|
3016
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(PageHeaderSlot, __spreadValues({ title, breadcrumbs }, slotProps == null ? void 0 : slotProps.header)),
|
|
3017
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_Box5.default, { sx: { flex: 1, display: "flex", flexDirection: "column" }, children })
|
|
3018
|
-
] }) }));
|
|
3019
|
-
}
|
|
3020
|
-
PageContainer.propTypes = {
|
|
3021
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
3022
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
3023
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
3024
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
3025
|
-
/**
|
|
3026
|
-
* The breadcrumbs of the page. Leave blank to use the active page breadcrumbs.
|
|
3027
|
-
*/
|
|
3028
|
-
breadcrumbs: import_prop_types14.default.arrayOf(
|
|
3029
|
-
import_prop_types14.default.shape({
|
|
3030
|
-
path: import_prop_types14.default.string,
|
|
3031
|
-
title: import_prop_types14.default.string.isRequired
|
|
3032
|
-
})
|
|
3033
|
-
),
|
|
3034
|
-
/**
|
|
3035
|
-
* @ignore
|
|
3036
|
-
*/
|
|
3037
|
-
children: import_prop_types14.default.node,
|
|
3038
|
-
/**
|
|
3039
|
-
* The props used for each slot inside.
|
|
3040
|
-
*/
|
|
3041
|
-
slotProps: import_prop_types14.default.shape({
|
|
3042
|
-
header: import_prop_types14.default.shape({
|
|
3043
|
-
breadcrumbs: import_prop_types14.default.arrayOf(
|
|
3044
|
-
import_prop_types14.default.shape({
|
|
3045
|
-
path: import_prop_types14.default.string,
|
|
3046
|
-
title: import_prop_types14.default.string.isRequired
|
|
3047
|
-
})
|
|
3048
|
-
),
|
|
3049
|
-
slotProps: import_prop_types14.default.shape({
|
|
3050
|
-
toolbar: import_prop_types14.default.object.isRequired
|
|
3051
|
-
}),
|
|
3052
|
-
slots: import_prop_types14.default.shape({
|
|
3053
|
-
toolbar: import_prop_types14.default.elementType
|
|
3054
|
-
}),
|
|
3055
|
-
title: import_prop_types14.default.string
|
|
3056
|
-
}).isRequired
|
|
3057
|
-
}),
|
|
3058
|
-
/**
|
|
3059
|
-
* The components used for each slot inside.
|
|
3060
|
-
*/
|
|
3061
|
-
slots: import_prop_types14.default.shape({
|
|
3062
|
-
header: import_prop_types14.default.elementType
|
|
3063
|
-
}),
|
|
3064
|
-
/**
|
|
3065
|
-
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
3066
|
-
*/
|
|
3067
|
-
sx: import_prop_types14.default.oneOfType([
|
|
3068
|
-
import_prop_types14.default.arrayOf(import_prop_types14.default.oneOfType([import_prop_types14.default.func, import_prop_types14.default.object, import_prop_types14.default.bool])),
|
|
3069
|
-
import_prop_types14.default.func,
|
|
3070
|
-
import_prop_types14.default.object
|
|
3071
|
-
]),
|
|
3072
|
-
/**
|
|
3073
|
-
* The title of the page. Leave blank to use the active page title.
|
|
3074
|
-
*/
|
|
3075
|
-
title: import_prop_types14.default.string
|
|
3076
|
-
};
|
|
3077
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
3078
|
-
0 && (module.exports = {
|
|
3079
|
-
Account,
|
|
3080
|
-
AccountPopoverFooter,
|
|
3081
|
-
AccountPopoverHeader,
|
|
3082
|
-
AccountPreview,
|
|
3083
|
-
AlertDialog,
|
|
3084
|
-
AppProvider,
|
|
3085
|
-
AuthenticationContext,
|
|
3086
|
-
ConfirmDialog,
|
|
3087
|
-
DashboardHeader,
|
|
3088
|
-
DashboardLayout,
|
|
3089
|
-
DashboardSidebarPageItem,
|
|
3090
|
-
DialogsProvider,
|
|
3091
|
-
LocalizationContext,
|
|
3092
|
-
LocalizationProvider,
|
|
3093
|
-
NotificationsProvider,
|
|
3094
|
-
PageContainer,
|
|
3095
|
-
PageHeader,
|
|
3096
|
-
PageHeaderToolbar,
|
|
3097
|
-
PromptDialog,
|
|
3098
|
-
SessionContext,
|
|
3099
|
-
SignInButton,
|
|
3100
|
-
SignOutButton,
|
|
3101
|
-
ThemeSwitcher,
|
|
3102
|
-
ToolbarActions,
|
|
3103
|
-
en,
|
|
3104
|
-
useActivePage,
|
|
3105
|
-
useDialogs,
|
|
3106
|
-
useLocalStorageState,
|
|
3107
|
-
useLocaleText,
|
|
3108
|
-
useNotifications,
|
|
3109
|
-
useStorageState,
|
|
3110
|
-
useStorageStateServer
|
|
34
|
+
Object.defineProperty(exports, "DashboardHeader", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () { return chunkSITC3EZQ_js.DashboardHeader; }
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "DashboardLayout", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () { return chunkSITC3EZQ_js.DashboardLayout; }
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "DashboardSidebarPageItem", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () { return chunkSITC3EZQ_js.DashboardSidebarPageItem; }
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(exports, "PageContainer", {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () { return chunkSITC3EZQ_js.PageContainer; }
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(exports, "PageHeader", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function () { return chunkSITC3EZQ_js.PageHeader; }
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "PageHeaderToolbar", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () { return chunkSITC3EZQ_js.PageHeaderToolbar; }
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(exports, "PromptDialog", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function () { return chunkSITC3EZQ_js.PromptDialog; }
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(exports, "SignInButton", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function () { return chunkSITC3EZQ_js.SignInButton; }
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "SignOutButton", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () { return chunkSITC3EZQ_js.SignOutButton; }
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(exports, "ThemeSwitcher", {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
get: function () { return chunkSITC3EZQ_js.ThemeSwitcher; }
|
|
73
|
+
});
|
|
74
|
+
Object.defineProperty(exports, "ToolbarActions", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
get: function () { return chunkSITC3EZQ_js.ToolbarActions; }
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "useActivePage", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () { return chunkSITC3EZQ_js.useActivePage; }
|
|
81
|
+
});
|
|
82
|
+
Object.defineProperty(exports, "useDialogs", {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function () { return chunkSITC3EZQ_js.useDialogs; }
|
|
85
|
+
});
|
|
86
|
+
Object.defineProperty(exports, "useNotifications", {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
get: function () { return chunkSITC3EZQ_js.useNotifications; }
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "AppProvider", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () { return chunkSWAF5R4Y_js.AppProvider; }
|
|
93
|
+
});
|
|
94
|
+
Object.defineProperty(exports, "AuthenticationContext", {
|
|
95
|
+
enumerable: true,
|
|
96
|
+
get: function () { return chunkSWAF5R4Y_js.AuthenticationContext; }
|
|
97
|
+
});
|
|
98
|
+
Object.defineProperty(exports, "DialogsProvider", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function () { return chunkSWAF5R4Y_js.DialogsProvider; }
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "LocalizationContext", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () { return chunkSWAF5R4Y_js.LocalizationContext; }
|
|
105
|
+
});
|
|
106
|
+
Object.defineProperty(exports, "LocalizationProvider", {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function () { return chunkSWAF5R4Y_js.LocalizationProvider; }
|
|
109
|
+
});
|
|
110
|
+
Object.defineProperty(exports, "NotificationsProvider", {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
get: function () { return chunkSWAF5R4Y_js.NotificationsProvider; }
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "SessionContext", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () { return chunkSWAF5R4Y_js.SessionContext; }
|
|
117
|
+
});
|
|
118
|
+
Object.defineProperty(exports, "en", {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function () { return chunkSWAF5R4Y_js.en_default; }
|
|
121
|
+
});
|
|
122
|
+
Object.defineProperty(exports, "useLocalStorageState", {
|
|
123
|
+
enumerable: true,
|
|
124
|
+
get: function () { return chunkSWAF5R4Y_js.useLocalStorageState; }
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "useLocaleText", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () { return chunkSWAF5R4Y_js.useLocaleText; }
|
|
129
|
+
});
|
|
130
|
+
Object.defineProperty(exports, "useStorageState", {
|
|
131
|
+
enumerable: true,
|
|
132
|
+
get: function () { return chunkSWAF5R4Y_js.useStorageState; }
|
|
133
|
+
});
|
|
134
|
+
Object.defineProperty(exports, "useStorageStateServer", {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
get: function () { return chunkSWAF5R4Y_js.useStorageStateServer; }
|
|
3111
137
|
});
|