wcz-test 6.7.7 → 6.8.0
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/ApprovalStatus-C9HPyMiS.js +24 -0
- package/dist/ApprovalStatus-C9HPyMiS.js.map +1 -0
- package/dist/{chunk-4UULRYGW.js → DialogsHooks-BlUsVlfv.js} +7 -14
- package/dist/DialogsHooks-BlUsVlfv.js.map +1 -0
- package/dist/{chunk-MIVD2XWB.js → FileHooks-hWKTwLCr.js} +36 -46
- package/dist/FileHooks-hWKTwLCr.js.map +1 -0
- package/dist/{chunk-TME53DAF.js → FileMeta-G1oT3mYK.js} +3 -5
- package/dist/FileMeta-G1oT3mYK.js.map +1 -0
- package/dist/{chunk-ZMWQQXZT.js → RouterListItemButton-Cx7rXEfm.js} +6 -8
- package/dist/RouterListItemButton-Cx7rXEfm.js.map +1 -0
- package/dist/android-chrome-192x192.png +0 -0
- package/dist/android-chrome-512x512.png +0 -0
- package/dist/apple-touch-icon.png +0 -0
- package/dist/auth-client-D9snEe6B.js +79 -0
- package/dist/auth-client-D9snEe6B.js.map +1 -0
- package/dist/client-utils.d.ts +3 -702
- package/dist/client-utils.js +7 -17
- package/dist/client-utils.js.map +1 -1
- package/dist/components/core/AppTitle.d.ts +2 -0
- package/dist/components/core/Fullscreen.d.ts +3 -0
- package/dist/components/core/Layout.d.ts +8 -0
- package/dist/components/core/ToolbarAccount.d.ts +2 -0
- package/dist/components/core/TypographyWithIcon.d.ts +7 -0
- package/dist/components/core/navigation/NavigationList.d.ts +22 -0
- package/dist/components/core/navigation/NavigationListItem.d.ts +16 -0
- package/dist/components/core/navigation/NavigationRail.d.ts +12 -0
- package/dist/components/data-grid/ChipInputCell.d.ts +9 -0
- package/dist/components/data-grid/EditableColumnHeader.d.ts +2 -0
- package/dist/components/file/Dropzone.d.ts +8 -0
- package/dist/components/file/FileViewer.d.ts +20 -0
- package/dist/components/file/fileViewer/FileViewerGrid.d.ts +17 -0
- package/dist/components/file/fileViewer/FileViewerList.d.ts +12 -0
- package/dist/components/file/fileViewer/ImageViewer.d.ts +6 -0
- package/dist/components/file/fileViewer/common/ActionsMenu.d.ts +15 -0
- package/dist/components/form/FormAutocomplete.d.ts +7 -0
- package/dist/components/form/FormCheckbox.d.ts +7 -0
- package/dist/components/form/FormDatePicker.d.ts +8 -0
- package/dist/components/form/FormDateRangePicker.d.ts +8 -0
- package/dist/components/form/FormDateTimePicker.d.ts +8 -0
- package/dist/components/form/FormDateTimeRangePicker.d.ts +8 -0
- package/dist/components/form/FormNumberField.d.ts +9 -0
- package/dist/components/form/FormRadioGroup.d.ts +13 -0
- package/dist/components/form/FormSlider.d.ts +7 -0
- package/dist/components/form/FormSubmitButton.d.ts +4 -0
- package/dist/components/form/FormSwitch.d.ts +7 -0
- package/dist/components/form/FormTextField.d.ts +7 -0
- package/dist/components/form/FormTimePicker.d.ts +8 -0
- package/dist/components/form/FormTimeRangePicker.d.ts +8 -0
- package/dist/components/router/RouterButton.d.ts +6 -0
- package/dist/components/router/RouterError.d.ts +7 -0
- package/dist/components/router/RouterGridActionsCellItem.d.ts +6 -0
- package/dist/components/router/RouterIconButton.d.ts +6 -0
- package/dist/components/router/RouterLink.d.ts +6 -0
- package/dist/components/router/RouterListItemButton.d.ts +6 -0
- package/dist/components/router/RouterNotFound.d.ts +1 -0
- package/dist/components/router/RouterTab.d.ts +6 -0
- package/dist/components.d.ts +14 -89
- package/dist/components.js +124 -227
- package/dist/components.js.map +1 -1
- package/dist/contexts/DialogsContext.d.ts +6 -0
- package/dist/contexts/FileContext.d.ts +13 -0
- package/dist/env-CoxTjaDr.js +27 -0
- package/dist/env-CoxTjaDr.js.map +1 -0
- package/dist/env.d.ts +10 -0
- package/dist/favicon-16x16.png +0 -0
- package/dist/favicon-32x32.png +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/favicon.png +0 -0
- package/dist/hooks/DialogsHooks.d.ts +42 -0
- package/dist/hooks/FormHooks.d.ts +52 -0
- package/dist/hooks/ThemeHook.d.ts +4 -0
- package/dist/hooks.d.ts +3 -159
- package/dist/hooks.js +56 -121
- package/dist/hooks.js.map +1 -1
- package/dist/index.d.ts +3 -36
- package/dist/index.js +173 -1882
- package/dist/index.js.map +1 -1
- package/dist/{client-utils.d.cts → lib/auth/auth-client.d.ts} +110 -126
- package/dist/lib/auth/auth.d.ts +24 -0
- package/dist/lib/db/index.d.ts +4 -0
- package/dist/lib/db/schemas/auth.d.ts +606 -0
- package/dist/{utils-ChipkRJ9.d.ts → lib/utils.d.ts} +11 -10
- package/dist/lib/vite-plugin.d.ts +2 -0
- package/dist/manifest.webmanifest +18 -0
- package/dist/models/Navigation.d.ts +18 -0
- package/dist/models/User.d.ts +8 -0
- package/dist/models/approval/Approval.d.ts +177 -0
- package/dist/models/approval/ApprovalEmployee.d.ts +7 -0
- package/dist/models/approval/ApprovalFlow.d.ts +49 -0
- package/dist/models/approval/ApprovalFlowStep.d.ts +29 -0
- package/dist/models/approval/ApprovalRequestType.d.ts +5 -0
- package/dist/models/approval/ApprovalStatus.d.ts +9 -0
- package/dist/models/approval/ApprovalStepResult.d.ts +11 -0
- package/dist/models/approval/StepApprovalOrder.d.ts +6 -0
- package/dist/models/email/Email.d.ts +13 -0
- package/dist/models/email/EmailAttachment.d.ts +6 -0
- package/dist/models/file/FileActions.d.ts +6 -0
- package/dist/{FileMeta-CC014fnB.d.cts → models/file/FileMeta.d.ts} +3 -6
- package/dist/models/peoplesoft/Department.d.ts +58 -0
- package/dist/models/peoplesoft/Employee.d.ts +46 -0
- package/dist/models/peoplesoft/EmployeeCategoryGroup.d.ts +6 -0
- package/dist/models/peoplesoft/EmployeeStatus.d.ts +6 -0
- package/dist/models.d.ts +25 -161
- package/dist/models.js +109 -160
- package/dist/models.js.map +1 -1
- package/dist/providers/DialogsProvider.d.ts +6 -0
- package/dist/providers/LayoutProvider.d.ts +11 -0
- package/dist/queries/Approval.d.ts +585 -0
- package/dist/queries/ApprovalHooks.d.ts +315 -0
- package/dist/queries/FileHooks.d.ts +151 -0
- package/dist/queries/PeopleSoftHooks.d.ts +537 -0
- package/dist/queries.d.ts +4 -1585
- package/dist/queries.js +59 -86
- package/dist/queries.js.map +1 -1
- package/dist/robots.txt +3 -0
- package/dist/server-utils.d.ts +2 -35
- package/dist/server-utils.js +13 -26
- package/dist/server-utils.js.map +1 -1
- package/dist/{chunk-2ROTNT7W.js → utils-DKyKGba7.js} +13 -18
- package/dist/utils-DKyKGba7.js.map +1 -0
- package/dist/utils.d.ts +1 -2
- package/dist/utils.js +3 -9
- package/dist/utils.js.map +1 -1
- package/dist/vite.d.ts +1 -5
- package/dist/vite.js +3 -6
- package/dist/vite.js.map +1 -1
- package/package.json +15 -23
- package/dist/Approval-CWQn-kah.d.cts +0 -284
- package/dist/Approval-CWQn-kah.d.ts +0 -284
- package/dist/FileMeta-CC014fnB.d.ts +0 -18
- package/dist/chunk-2ROTNT7W.js.map +0 -1
- package/dist/chunk-4FRZRIAO.js +0 -29
- package/dist/chunk-4FRZRIAO.js.map +0 -1
- package/dist/chunk-4UULRYGW.js.map +0 -1
- package/dist/chunk-5WRI5ZAA.js +0 -31
- package/dist/chunk-5WRI5ZAA.js.map +0 -1
- package/dist/chunk-CNDRHYQK.js +0 -883
- package/dist/chunk-CNDRHYQK.js.map +0 -1
- package/dist/chunk-DXXZZHAK.js +0 -28
- package/dist/chunk-DXXZZHAK.js.map +0 -1
- package/dist/chunk-MIVD2XWB.js.map +0 -1
- package/dist/chunk-TME53DAF.js.map +0 -1
- package/dist/chunk-ZMWQQXZT.js.map +0 -1
- package/dist/client-utils.cjs +0 -118
- package/dist/client-utils.cjs.map +0 -1
- package/dist/components.cjs +0 -802
- package/dist/components.cjs.map +0 -1
- package/dist/components.d.cts +0 -89
- package/dist/hooks.cjs +0 -534
- package/dist/hooks.cjs.map +0 -1
- package/dist/hooks.d.cts +0 -160
- package/dist/index.cjs +0 -3373
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -36
- package/dist/models.cjs +0 -330
- package/dist/models.cjs.map +0 -1
- package/dist/models.d.cts +0 -161
- package/dist/queries.cjs +0 -706
- package/dist/queries.cjs.map +0 -1
- package/dist/queries.d.cts +0 -1585
- package/dist/server-utils.cjs +0 -145
- package/dist/server-utils.cjs.map +0 -1
- package/dist/server-utils.d.cts +0 -36
- package/dist/utils-ChipkRJ9.d.cts +0 -49
- package/dist/utils.cjs +0 -81
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.d.cts +0 -4
- package/dist/vite.cjs +0 -94
- package/dist/vite.cjs.map +0 -1
- package/dist/vite.d.cts +0 -5
package/dist/components.cjs
DELETED
|
@@ -1,802 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/components.ts
|
|
31
|
-
var components_exports = {};
|
|
32
|
-
__export(components_exports, {
|
|
33
|
-
ChipInputCell: () => ChipInputCell,
|
|
34
|
-
Dropzone: () => Dropzone,
|
|
35
|
-
EditableColumnHeader: () => EditableColumnHeader,
|
|
36
|
-
FileViewer: () => FileViewer,
|
|
37
|
-
Fullscreen: () => Fullscreen,
|
|
38
|
-
RouterButton: () => RouterButton,
|
|
39
|
-
RouterError: () => RouterError,
|
|
40
|
-
RouterGridActionsCellItem: () => RouterGridActionsCellItem,
|
|
41
|
-
RouterIconButton: () => RouterIconButton,
|
|
42
|
-
RouterLink: () => RouterLink,
|
|
43
|
-
RouterListItemButton: () => RouterListItemButton,
|
|
44
|
-
RouterNotFound: () => RouterNotFound,
|
|
45
|
-
RouterTab: () => RouterTab,
|
|
46
|
-
TypographyWithIcon: () => TypographyWithIcon
|
|
47
|
-
});
|
|
48
|
-
module.exports = __toCommonJS(components_exports);
|
|
49
|
-
|
|
50
|
-
// src/components/core/TypographyWithIcon.tsx
|
|
51
|
-
var import_material = require("@mui/material");
|
|
52
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
53
|
-
var TypographyWithIcon = ({ startIcon, endIcon, children, sx, ...props }) => {
|
|
54
|
-
const iconSx = {
|
|
55
|
-
display: "inline-flex",
|
|
56
|
-
alignItems: "center",
|
|
57
|
-
justifyContent: "center",
|
|
58
|
-
flexShrink: 0,
|
|
59
|
-
lineHeight: 0,
|
|
60
|
-
"& > svg": {
|
|
61
|
-
display: "block"
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
65
|
-
import_material.Typography,
|
|
66
|
-
{
|
|
67
|
-
component: "span",
|
|
68
|
-
sx: {
|
|
69
|
-
display: "inline-flex",
|
|
70
|
-
alignItems: "center",
|
|
71
|
-
verticalAlign: "middle",
|
|
72
|
-
...sx
|
|
73
|
-
},
|
|
74
|
-
gap: 1,
|
|
75
|
-
...props,
|
|
76
|
-
children: [
|
|
77
|
-
startIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Stack, { component: "span", sx: iconSx, children: startIcon }),
|
|
78
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Stack, { component: "span", sx: { display: "inline", lineHeight: "inherit" }, children }),
|
|
79
|
-
endIcon && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_material.Stack, { component: "span", sx: iconSx, children: endIcon })
|
|
80
|
-
]
|
|
81
|
-
}
|
|
82
|
-
);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
// src/components/core/Fullscreen.tsx
|
|
86
|
-
var import_material2 = require("@mui/material");
|
|
87
|
-
var import_react = require("react");
|
|
88
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
89
|
-
var Fullscreen = ({ children, sx, ...props }) => {
|
|
90
|
-
const reference = (0, import_react.useRef)(null);
|
|
91
|
-
const [height, setHeight] = (0, import_react.useState)();
|
|
92
|
-
const recompute = (0, import_react.useEffectEvent)(() => {
|
|
93
|
-
if (!reference.current) return;
|
|
94
|
-
const top = Math.ceil(reference.current.getBoundingClientRect().top);
|
|
95
|
-
const avail = Math.max(0, window.innerHeight - top);
|
|
96
|
-
setHeight(avail);
|
|
97
|
-
});
|
|
98
|
-
(0, import_react.useEffect)(() => {
|
|
99
|
-
const element = reference.current;
|
|
100
|
-
if (!element) return;
|
|
101
|
-
recompute();
|
|
102
|
-
window.addEventListener("resize", recompute);
|
|
103
|
-
const ro = new ResizeObserver(recompute);
|
|
104
|
-
ro.observe(document.documentElement);
|
|
105
|
-
ro.observe(document.body);
|
|
106
|
-
ro.observe(element);
|
|
107
|
-
return () => {
|
|
108
|
-
window.removeEventListener("resize", recompute);
|
|
109
|
-
ro.disconnect();
|
|
110
|
-
};
|
|
111
|
-
}, []);
|
|
112
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
113
|
-
import_material2.Box,
|
|
114
|
-
{
|
|
115
|
-
ref: reference,
|
|
116
|
-
sx: {
|
|
117
|
-
display: "flex",
|
|
118
|
-
flexDirection: "column",
|
|
119
|
-
minHeight: 0,
|
|
120
|
-
width: "100%",
|
|
121
|
-
overflow: "auto",
|
|
122
|
-
...sx
|
|
123
|
-
},
|
|
124
|
-
height,
|
|
125
|
-
...props,
|
|
126
|
-
children
|
|
127
|
-
}
|
|
128
|
-
);
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
// src/components/file/Dropzone.tsx
|
|
132
|
-
var import_CloudUpload = __toESM(require("@mui/icons-material/CloudUpload"), 1);
|
|
133
|
-
var import_material3 = require("@mui/material");
|
|
134
|
-
var import_react_dropzone = require("react-dropzone");
|
|
135
|
-
var import_react_i18next = require("react-i18next");
|
|
136
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
137
|
-
var baseStyle = {
|
|
138
|
-
flex: 1,
|
|
139
|
-
display: "flex",
|
|
140
|
-
flexDirection: "column",
|
|
141
|
-
alignItems: "center",
|
|
142
|
-
padding: "20px",
|
|
143
|
-
borderWidth: 2,
|
|
144
|
-
borderRadius: 2,
|
|
145
|
-
borderStyle: "dashed",
|
|
146
|
-
outline: "none",
|
|
147
|
-
transition: "border .24s ease-in-out",
|
|
148
|
-
cursor: "pointer"
|
|
149
|
-
};
|
|
150
|
-
var Dropzone = ({ sx, ...props }) => {
|
|
151
|
-
const { getRootProps, getInputProps, isFocused, isDragAccept, isDragReject } = (0, import_react_dropzone.useDropzone)(props);
|
|
152
|
-
const { t } = (0, import_react_i18next.useTranslation)();
|
|
153
|
-
const theme = (0, import_material3.useTheme)();
|
|
154
|
-
const style = {
|
|
155
|
-
...baseStyle,
|
|
156
|
-
...isFocused ? { borderColor: theme.palette.primary.main } : {},
|
|
157
|
-
...isDragAccept ? { borderColor: theme.palette.success.main } : {},
|
|
158
|
-
...isDragReject ? { borderColor: theme.palette.error.main } : {}
|
|
159
|
-
};
|
|
160
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_material3.Paper, { variant: "outlined", ...getRootProps({ style }), sx, children: [
|
|
161
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("input", { ...getInputProps(), style: { display: "none" } }),
|
|
162
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_CloudUpload.default, {}),
|
|
163
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_material3.Typography, { children: t("Layout.File.DragSomeFilesHereOrClickToSelectThem") })
|
|
164
|
-
] });
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
// src/components/file/FileViewer.tsx
|
|
168
|
-
var import_react9 = require("react");
|
|
169
|
-
|
|
170
|
-
// src/components/file/fileViewer/FileViewerGrid.tsx
|
|
171
|
-
var import_MoreVert = __toESM(require("@mui/icons-material/MoreVert"), 1);
|
|
172
|
-
var import_material6 = require("@mui/material");
|
|
173
|
-
var import_colors = require("@mui/material/colors");
|
|
174
|
-
var import_react6 = require("react");
|
|
175
|
-
var import_react_intersection_observer = require("react-intersection-observer");
|
|
176
|
-
|
|
177
|
-
// src/components/file/fileViewer/common/ActionsMenu.tsx
|
|
178
|
-
var import_Delete = __toESM(require("@mui/icons-material/Delete"), 1);
|
|
179
|
-
var import_FileDownload = __toESM(require("@mui/icons-material/FileDownload"), 1);
|
|
180
|
-
var import_material5 = require("@mui/material");
|
|
181
|
-
var import_react_i18next3 = require("react-i18next");
|
|
182
|
-
|
|
183
|
-
// src/contexts/FileContext.ts
|
|
184
|
-
var import_react2 = require("react");
|
|
185
|
-
var FileContext = (0, import_react2.createContext)(null);
|
|
186
|
-
var useFile = () => {
|
|
187
|
-
const context = (0, import_react2.useContext)(FileContext);
|
|
188
|
-
if (!context) {
|
|
189
|
-
throw new Error("FileViewer components must be used within FileViewer");
|
|
190
|
-
}
|
|
191
|
-
return context;
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
// src/hooks/DialogsHooks.tsx
|
|
195
|
-
var import_material4 = require("@mui/material");
|
|
196
|
-
var import_react4 = require("react");
|
|
197
|
-
var import_react_i18next2 = require("react-i18next");
|
|
198
|
-
|
|
199
|
-
// src/contexts/DialogsContext.ts
|
|
200
|
-
var import_react3 = require("react");
|
|
201
|
-
var DialogsContext = (0, import_react3.createContext)({});
|
|
202
|
-
|
|
203
|
-
// src/hooks/DialogsHooks.tsx
|
|
204
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
205
|
-
function AlertDialog({ open, payload, onClose }) {
|
|
206
|
-
const { t } = (0, import_react_i18next2.useTranslation)();
|
|
207
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_material4.Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(), disableRestoreFocus: true, children: [
|
|
208
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material4.DialogTitle, { children: payload.title ?? t("Layout.Dialog.Alert") }),
|
|
209
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material4.DialogContent, { children: payload.message }),
|
|
210
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material4.DialogActions, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material4.Button, { onClick: () => onClose(), autoFocus: true, children: t("Layout.Dialog.Confirm") }) })
|
|
211
|
-
] });
|
|
212
|
-
}
|
|
213
|
-
function ConfirmDialog({ open, payload, onClose }) {
|
|
214
|
-
const { t } = (0, import_react_i18next2.useTranslation)();
|
|
215
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_material4.Dialog, { maxWidth: "xs", fullWidth: true, open, onClose: () => onClose(false), disableRestoreFocus: true, children: [
|
|
216
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material4.DialogTitle, { children: payload.title ?? t("Layout.Dialog.Confirm") }),
|
|
217
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material4.DialogContent, { children: payload.message }),
|
|
218
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_material4.DialogActions, { children: [
|
|
219
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material4.Button, { onClick: () => onClose(false), children: payload.cancelText ?? t("Layout.Dialog.Cancel") }),
|
|
220
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_material4.Button, { onClick: () => onClose(true), autoFocus: true, children: t("Layout.Dialog.Confirm") })
|
|
221
|
-
] })
|
|
222
|
-
] });
|
|
223
|
-
}
|
|
224
|
-
function useDialogs() {
|
|
225
|
-
const { open, close } = (0, import_react4.useContext)(DialogsContext);
|
|
226
|
-
const alert = (0, import_material4.useEventCallback)(
|
|
227
|
-
(message, { ...options } = {}) => open(AlertDialog, { ...options, message })
|
|
228
|
-
);
|
|
229
|
-
const confirm = (0, import_material4.useEventCallback)(
|
|
230
|
-
(message, { ...options } = {}) => open(ConfirmDialog, { ...options, message })
|
|
231
|
-
);
|
|
232
|
-
return { alert, confirm, open, close };
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
// src/queries/FileHooks.ts
|
|
236
|
-
var import_react_query = require("@tanstack/react-query");
|
|
237
|
-
var import_file_saver = __toESM(require("file-saver"), 1);
|
|
238
|
-
var import_react5 = require("react");
|
|
239
|
-
var import_tus_js_client = require("tus-js-client");
|
|
240
|
-
var import_uuidv7 = require("uuidv7");
|
|
241
|
-
var import_zod2 = __toESM(require("zod"), 1);
|
|
242
|
-
|
|
243
|
-
// src/models/file/FileMeta.ts
|
|
244
|
-
var z = __toESM(require("zod"), 1);
|
|
245
|
-
var FileMetaSchema = z.object({
|
|
246
|
-
id: z.uuid(),
|
|
247
|
-
subId: z.uuid(),
|
|
248
|
-
appName: z.string().trim().min(1).max(255),
|
|
249
|
-
fileName: z.string().trim().min(1).max(255),
|
|
250
|
-
fileExtension: z.string().trim().min(1).max(255),
|
|
251
|
-
fileSize: z.number().min(0),
|
|
252
|
-
mediaSubType: z.string().trim().min(1).max(255),
|
|
253
|
-
mediaType: z.string().trim().min(1).max(255),
|
|
254
|
-
mimeType: z.string().trim().min(1).max(255),
|
|
255
|
-
createdBy: z.string().trim().min(1).max(255),
|
|
256
|
-
createdDate: z.date()
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
// src/lib/utils.ts
|
|
260
|
-
var import_axios = __toESM(require("axios"), 1);
|
|
261
|
-
|
|
262
|
-
// src/env.ts
|
|
263
|
-
var import_env_core = require("@t3-oss/env-core");
|
|
264
|
-
var import_zod = require("zod");
|
|
265
|
-
var import_meta = {};
|
|
266
|
-
var clientEnv = (0, import_env_core.createEnv)({
|
|
267
|
-
clientPrefix: "VITE_",
|
|
268
|
-
client: {
|
|
269
|
-
VITE_APP_TITLE: import_zod.z.string(),
|
|
270
|
-
VITE_MUI_LICENSE_KEY: import_zod.z.string(),
|
|
271
|
-
VITE_API_URL: import_zod.z.url()
|
|
272
|
-
},
|
|
273
|
-
runtimeEnv: import_meta.env,
|
|
274
|
-
emptyStringAsUndefined: true
|
|
275
|
-
});
|
|
276
|
-
var serverEnv = (0, import_env_core.createEnv)({
|
|
277
|
-
server: {
|
|
278
|
-
DATABASE_URL: import_zod.z.string(),
|
|
279
|
-
MICROSOFT_CLIENT_ID: import_zod.z.string(),
|
|
280
|
-
MICROSOFT_CLIENT_SECRET: import_zod.z.string()
|
|
281
|
-
},
|
|
282
|
-
runtimeEnv: process.env,
|
|
283
|
-
emptyStringAsUndefined: true
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
// src/lib/utils.ts
|
|
287
|
-
var httpClient = import_axios.default.create({
|
|
288
|
-
baseURL: clientEnv.VITE_API_URL
|
|
289
|
-
// TODO: Not working in children projects
|
|
290
|
-
});
|
|
291
|
-
var toKebabCase = (str) => {
|
|
292
|
-
return str.replaceAll(/([a-z])([A-Z])/g, "$1-$2").replaceAll(/[\s_]+/g, "-").replaceAll(/[^a-zA-Z0-9-]/g, "").toLowerCase().replaceAll(/-+/g, "-").replaceAll(/(^-|-$)/g, "");
|
|
293
|
-
};
|
|
294
|
-
|
|
295
|
-
// src/queries/FileHooks.ts
|
|
296
|
-
var QUERY_KEY = "file";
|
|
297
|
-
var HOUR = 1e3 * 60 * 60;
|
|
298
|
-
var APP_NAME = toKebabCase(clientEnv.VITE_APP_TITLE);
|
|
299
|
-
var GetFileMetasParamsSchema = import_zod2.default.object({
|
|
300
|
-
appName: import_zod2.default.string().min(1).max(255).default(APP_NAME).optional(),
|
|
301
|
-
subId: import_zod2.default.uuid()
|
|
302
|
-
});
|
|
303
|
-
var useGetFileMetas = (params, options) => {
|
|
304
|
-
const queryParams = new URLSearchParams();
|
|
305
|
-
queryParams.append("appName", params.appName ?? APP_NAME);
|
|
306
|
-
queryParams.append("subId", params.subId);
|
|
307
|
-
return (0, import_react_query.useQuery)({
|
|
308
|
-
...options,
|
|
309
|
-
queryKey: [QUERY_KEY, "meta", params.appName ?? APP_NAME, params.subId],
|
|
310
|
-
queryFn: ({ signal }) => httpClient.request({
|
|
311
|
-
url: `/${QUERY_KEY}/v1/meta?${queryParams.toString()}`,
|
|
312
|
-
method: "GET",
|
|
313
|
-
signal
|
|
314
|
-
}),
|
|
315
|
-
staleTime: HOUR,
|
|
316
|
-
gcTime: HOUR,
|
|
317
|
-
refetchOnWindowFocus: false
|
|
318
|
-
});
|
|
319
|
-
};
|
|
320
|
-
var GetFileThumbnailParamsSchema = import_zod2.default.object({
|
|
321
|
-
appName: import_zod2.default.string().min(1).max(255).default(APP_NAME).optional(),
|
|
322
|
-
meta: FileMetaSchema.nullish()
|
|
323
|
-
});
|
|
324
|
-
var useGetFileThumbnail = (params, options) => {
|
|
325
|
-
const queryParams = new URLSearchParams();
|
|
326
|
-
queryParams.append("appName", params.appName ?? APP_NAME);
|
|
327
|
-
queryParams.append("id", params.meta?.id ?? "");
|
|
328
|
-
return (0, import_react_query.useQuery)({
|
|
329
|
-
...options,
|
|
330
|
-
queryKey: [QUERY_KEY, "thumbnail", params.appName ?? APP_NAME, params.meta?.id],
|
|
331
|
-
queryFn: ({ signal }) => httpClient.request({
|
|
332
|
-
url: `/${QUERY_KEY}/v1/thumbnail?${queryParams.toString()}`,
|
|
333
|
-
method: "GET",
|
|
334
|
-
signal,
|
|
335
|
-
responseType: "blob"
|
|
336
|
-
}),
|
|
337
|
-
select: (data) => URL.createObjectURL(data),
|
|
338
|
-
staleTime: HOUR,
|
|
339
|
-
gcTime: HOUR,
|
|
340
|
-
refetchOnWindowFocus: false,
|
|
341
|
-
enabled: !!params.meta && options?.enabled !== false
|
|
342
|
-
});
|
|
343
|
-
};
|
|
344
|
-
var GetFileParamsSchema = import_zod2.default.object({
|
|
345
|
-
appName: import_zod2.default.string().min(1).max(255).default(APP_NAME).optional(),
|
|
346
|
-
meta: FileMetaSchema.nullish()
|
|
347
|
-
});
|
|
348
|
-
var useGetFile = (params, options) => {
|
|
349
|
-
const queryParams = new URLSearchParams();
|
|
350
|
-
queryParams.append("appName", params.appName ?? APP_NAME);
|
|
351
|
-
queryParams.append("id", params.meta?.id ?? "");
|
|
352
|
-
return (0, import_react_query.useQuery)({
|
|
353
|
-
...options,
|
|
354
|
-
queryKey: [QUERY_KEY, params.appName ?? APP_NAME, params.meta?.id],
|
|
355
|
-
queryFn: ({ signal }) => httpClient.request({
|
|
356
|
-
url: `/${QUERY_KEY}/v1?${queryParams.toString()}`,
|
|
357
|
-
method: "GET",
|
|
358
|
-
signal,
|
|
359
|
-
responseType: "blob"
|
|
360
|
-
}),
|
|
361
|
-
select: (data) => URL.createObjectURL(data),
|
|
362
|
-
staleTime: HOUR,
|
|
363
|
-
gcTime: HOUR,
|
|
364
|
-
refetchOnWindowFocus: false,
|
|
365
|
-
enabled: !!params.meta && options?.enabled !== false
|
|
366
|
-
});
|
|
367
|
-
};
|
|
368
|
-
var useDownloadFile = (options) => {
|
|
369
|
-
return (0, import_react_query.useMutation)({
|
|
370
|
-
...options,
|
|
371
|
-
mutationFn: (meta) => httpClient.request({
|
|
372
|
-
url: `/${QUERY_KEY}/v1/download?appName=${APP_NAME}&id=${meta.id}`,
|
|
373
|
-
method: "GET",
|
|
374
|
-
responseType: "blob"
|
|
375
|
-
}),
|
|
376
|
-
onSuccess: (data, variables) => (0, import_file_saver.default)(data, `${variables.fileName}.${variables.fileExtension}`)
|
|
377
|
-
});
|
|
378
|
-
};
|
|
379
|
-
var useOpenFile = (options) => {
|
|
380
|
-
return (0, import_react_query.useMutation)({
|
|
381
|
-
...options,
|
|
382
|
-
mutationFn: (meta) => httpClient.request({
|
|
383
|
-
url: `/${QUERY_KEY}/v1?appName=${APP_NAME}&id=${meta.id}`,
|
|
384
|
-
method: "GET",
|
|
385
|
-
responseType: "blob"
|
|
386
|
-
}),
|
|
387
|
-
onSuccess: (data) => {
|
|
388
|
-
window.open(URL.createObjectURL(data));
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
};
|
|
392
|
-
var useDeleteFile = (options) => {
|
|
393
|
-
const queryClient = (0, import_react_query.useQueryClient)();
|
|
394
|
-
return (0, import_react_query.useMutation)({
|
|
395
|
-
...options,
|
|
396
|
-
mutationFn: (meta) => httpClient.request({
|
|
397
|
-
url: `/${QUERY_KEY}/v1?appName=${APP_NAME}&id=${meta.id}`,
|
|
398
|
-
method: "DELETE"
|
|
399
|
-
}),
|
|
400
|
-
onSettled: () => queryClient.invalidateQueries({ queryKey: [QUERY_KEY, "meta"], exact: false })
|
|
401
|
-
});
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
// src/components/file/fileViewer/common/ActionsMenu.tsx
|
|
405
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
406
|
-
var ActionsMenu = ({ meta, menu, setMenu }) => {
|
|
407
|
-
const { t } = (0, import_react_i18next3.useTranslation)();
|
|
408
|
-
const { fileMetas, onDelete, actions } = useFile();
|
|
409
|
-
const { confirm } = useDialogs();
|
|
410
|
-
const handleMenuClose = () => {
|
|
411
|
-
setMenu(null);
|
|
412
|
-
};
|
|
413
|
-
const { mutate: download, isPending: isDownloading } = useDownloadFile();
|
|
414
|
-
const { mutate: deleteFile, isPending: isDeleting } = useDeleteFile();
|
|
415
|
-
const handleOnDownload = () => {
|
|
416
|
-
handleMenuClose();
|
|
417
|
-
download(meta);
|
|
418
|
-
};
|
|
419
|
-
const handleOnDelete = async () => {
|
|
420
|
-
if (!await confirm(t("Layout.File.AreYouSureYouWantToDelete", { fileName: meta.fileName })))
|
|
421
|
-
return;
|
|
422
|
-
deleteFile(meta);
|
|
423
|
-
handleMenuClose();
|
|
424
|
-
if (onDelete) {
|
|
425
|
-
const remainingFileMetas = fileMetas.filter((m) => m.id !== meta.id);
|
|
426
|
-
onDelete({ remainingFileMetas, deletedFileMeta: meta });
|
|
427
|
-
}
|
|
428
|
-
};
|
|
429
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
430
|
-
import_material5.Menu,
|
|
431
|
-
{
|
|
432
|
-
open: menu !== null,
|
|
433
|
-
onClose: handleMenuClose,
|
|
434
|
-
anchorReference: "anchorPosition",
|
|
435
|
-
variant: "menu",
|
|
436
|
-
anchorPosition: menu === null ? void 0 : { top: menu.mouseY, left: menu.mouseX },
|
|
437
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material5.List, { disablePadding: true, children: [
|
|
438
|
-
actions?.download !== false && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material5.ListItemButton, { onClick: handleOnDownload, disabled: isDownloading, children: [
|
|
439
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_FileDownload.default, {}) }),
|
|
440
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.ListItemText, { children: t("Layout.File.Download") })
|
|
441
|
-
] }),
|
|
442
|
-
actions?.delete !== false && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_material5.ListItemButton, { onClick: handleOnDelete, disabled: isDeleting, children: [
|
|
443
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.ListItemIcon, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_Delete.default, {}) }),
|
|
444
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_material5.ListItemText, { children: t("Layout.File.Delete") })
|
|
445
|
-
] })
|
|
446
|
-
] })
|
|
447
|
-
}
|
|
448
|
-
);
|
|
449
|
-
};
|
|
450
|
-
|
|
451
|
-
// src/components/file/fileViewer/FileViewerGrid.tsx
|
|
452
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
453
|
-
var IMAGE_SIZE = 150;
|
|
454
|
-
var FileViewerGrid = ({ sx, size, itemBar }) => {
|
|
455
|
-
const { fileMetas } = useFile();
|
|
456
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material6.Stack, { direction: "row", spacing: 1, sx: { overflow: "auto", ...sx }, children: fileMetas.map((fileMeta) => /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
457
|
-
GridFileViewerItem,
|
|
458
|
-
{
|
|
459
|
-
meta: fileMeta,
|
|
460
|
-
size,
|
|
461
|
-
itemBar
|
|
462
|
-
},
|
|
463
|
-
fileMeta.id
|
|
464
|
-
)) });
|
|
465
|
-
};
|
|
466
|
-
var GridFileViewerItem = ({ meta, size, itemBar }) => {
|
|
467
|
-
const { setImageId, actions } = useFile();
|
|
468
|
-
const [showItemBar, setShowItemBar] = (0, import_react6.useState)(itemBar === "always");
|
|
469
|
-
const [menu, setMenu] = (0, import_react6.useState)(null);
|
|
470
|
-
const { ref, inView } = (0, import_react_intersection_observer.useInView)();
|
|
471
|
-
(0, import_react6.useEffect)(() => {
|
|
472
|
-
setShowItemBar(itemBar === "always");
|
|
473
|
-
}, [itemBar]);
|
|
474
|
-
const { data: source } = useGetFileThumbnail({ meta }, { enabled: inView });
|
|
475
|
-
const handleOnMouseEnter = () => setShowItemBar(true);
|
|
476
|
-
const handleOnMouseLeave = () => itemBar !== "always" && setShowItemBar(false);
|
|
477
|
-
const openMenu = (event) => {
|
|
478
|
-
setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY } : null);
|
|
479
|
-
setTimeout(() => setShowItemBar(true));
|
|
480
|
-
};
|
|
481
|
-
const { mutate: openFile } = useOpenFile();
|
|
482
|
-
const { mutate: download } = useDownloadFile();
|
|
483
|
-
const onClick = () => {
|
|
484
|
-
switch (meta.mediaType) {
|
|
485
|
-
case "image": {
|
|
486
|
-
return setImageId(meta.id);
|
|
487
|
-
}
|
|
488
|
-
case "application": {
|
|
489
|
-
return openFile(meta);
|
|
490
|
-
}
|
|
491
|
-
case "video": {
|
|
492
|
-
return openFile(meta);
|
|
493
|
-
}
|
|
494
|
-
default: {
|
|
495
|
-
return download(meta);
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
};
|
|
499
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react6.Fragment, { children: [
|
|
500
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_material6.ImageListItem, { sx: { width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }, onMouseEnter: handleOnMouseEnter, onMouseLeave: handleOnMouseLeave, ref, children: [
|
|
501
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
502
|
-
import_material6.Box,
|
|
503
|
-
{
|
|
504
|
-
component: "img",
|
|
505
|
-
src: source,
|
|
506
|
-
loading: "lazy",
|
|
507
|
-
alt: "thumbnail-" + meta.id,
|
|
508
|
-
onClick,
|
|
509
|
-
sx: { cursor: "pointer", objectFit: "contain", width: size ?? IMAGE_SIZE, height: size ?? IMAGE_SIZE }
|
|
510
|
-
}
|
|
511
|
-
),
|
|
512
|
-
itemBar !== "hidden" && showItemBar && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
513
|
-
import_material6.ImageListItemBar,
|
|
514
|
-
{
|
|
515
|
-
title: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material6.Tooltip, { title: meta.fileName, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material6.Box, { children: meta.fileName }) }),
|
|
516
|
-
actionIcon: (actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_material6.IconButton, { sx: { color: import_colors.grey[100] }, onClick: openMenu, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_MoreVert.default, {}) })
|
|
517
|
-
}
|
|
518
|
-
)
|
|
519
|
-
] }),
|
|
520
|
-
(actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ActionsMenu, { meta, menu, setMenu })
|
|
521
|
-
] });
|
|
522
|
-
};
|
|
523
|
-
|
|
524
|
-
// src/components/file/fileViewer/FileViewerList.tsx
|
|
525
|
-
var import_AttachFile = __toESM(require("@mui/icons-material/AttachFile"), 1);
|
|
526
|
-
var import_Image = __toESM(require("@mui/icons-material/Image"), 1);
|
|
527
|
-
var import_MoreVert2 = __toESM(require("@mui/icons-material/MoreVert"), 1);
|
|
528
|
-
var import_SmartDisplay = __toESM(require("@mui/icons-material/SmartDisplay"), 1);
|
|
529
|
-
var import_material7 = require("@mui/material");
|
|
530
|
-
var import_react7 = require("react");
|
|
531
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
532
|
-
var FileViewerList = ({ sx }) => {
|
|
533
|
-
const { fileMetas } = useFile();
|
|
534
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material7.List, { dense: true, sx, children: fileMetas.map(
|
|
535
|
-
(fileMeta) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
536
|
-
ListFileViewerItem,
|
|
537
|
-
{
|
|
538
|
-
meta: fileMeta
|
|
539
|
-
},
|
|
540
|
-
fileMeta.id
|
|
541
|
-
)
|
|
542
|
-
) });
|
|
543
|
-
};
|
|
544
|
-
var ListFileViewerItem = ({ meta }) => {
|
|
545
|
-
const { setImageId, actions } = useFile();
|
|
546
|
-
const [menu, setMenu] = (0, import_react7.useState)(null);
|
|
547
|
-
const openMenu = (event) => {
|
|
548
|
-
event.stopPropagation();
|
|
549
|
-
setMenu(menu === null ? { mouseX: event.clientX, mouseY: event.clientY } : null);
|
|
550
|
-
};
|
|
551
|
-
const { mutate: openFile } = useOpenFile();
|
|
552
|
-
const { mutate: download } = useDownloadFile();
|
|
553
|
-
const onClick = () => {
|
|
554
|
-
switch (meta.mediaType) {
|
|
555
|
-
case "image": {
|
|
556
|
-
return setImageId(meta.id);
|
|
557
|
-
}
|
|
558
|
-
case "application": {
|
|
559
|
-
return openFile(meta);
|
|
560
|
-
}
|
|
561
|
-
case "video": {
|
|
562
|
-
return openFile(meta);
|
|
563
|
-
}
|
|
564
|
-
default: {
|
|
565
|
-
return download(meta);
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
};
|
|
569
|
-
const icon = () => {
|
|
570
|
-
switch (meta.mediaType) {
|
|
571
|
-
case "image": {
|
|
572
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_Image.default, {});
|
|
573
|
-
}
|
|
574
|
-
case "video": {
|
|
575
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_SmartDisplay.default, {});
|
|
576
|
-
}
|
|
577
|
-
default: {
|
|
578
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_AttachFile.default, {});
|
|
579
|
-
}
|
|
580
|
-
}
|
|
581
|
-
};
|
|
582
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react7.Fragment, { children: [
|
|
583
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_material7.ListItemButton, { onClick, children: [
|
|
584
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material7.ListItemIcon, { children: icon() }),
|
|
585
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material7.ListItemText, { primary: `${meta.fileName}.${meta.fileExtension}` }),
|
|
586
|
-
(actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_material7.IconButton, { edge: "end", onClick: openMenu, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_MoreVert2.default, {}) })
|
|
587
|
-
] }, meta.id),
|
|
588
|
-
(actions?.download !== false || actions.delete !== false) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ActionsMenu, { meta, menu, setMenu })
|
|
589
|
-
] });
|
|
590
|
-
};
|
|
591
|
-
|
|
592
|
-
// src/components/file/fileViewer/ImageViewer.tsx
|
|
593
|
-
var import_Close = __toESM(require("@mui/icons-material/Close"), 1);
|
|
594
|
-
var import_material8 = require("@mui/material");
|
|
595
|
-
var import_react8 = require("react");
|
|
596
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
597
|
-
var ImageViewer = ({ metaId }) => {
|
|
598
|
-
const { fileMetas, setImageId } = useFile();
|
|
599
|
-
const meta = fileMetas.find((m) => m.id === metaId);
|
|
600
|
-
const { data: source } = useGetFile({ meta });
|
|
601
|
-
(0, import_react8.useEffect)(() => {
|
|
602
|
-
if (metaId)
|
|
603
|
-
globalThis.addEventListener("keydown", handleOnKeydown);
|
|
604
|
-
return () => {
|
|
605
|
-
globalThis.removeEventListener("keydown", handleOnKeydown);
|
|
606
|
-
};
|
|
607
|
-
}, [metaId]);
|
|
608
|
-
const handleOnKeydown = (event) => {
|
|
609
|
-
const images = fileMetas.filter((m) => m.mediaType === "image");
|
|
610
|
-
const imageIndex = images.findIndex((m) => m.id === metaId);
|
|
611
|
-
switch (event.key) {
|
|
612
|
-
case "ArrowLeft": {
|
|
613
|
-
return handleOnArrowLeft(images, imageIndex);
|
|
614
|
-
}
|
|
615
|
-
case "ArrowRight": {
|
|
616
|
-
return handleOnArrowRight(images, imageIndex);
|
|
617
|
-
}
|
|
618
|
-
case "Backspace":
|
|
619
|
-
case "Escape": {
|
|
620
|
-
event.preventDefault();
|
|
621
|
-
return onClose();
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
};
|
|
625
|
-
const handleOnArrowLeft = (images, index) => {
|
|
626
|
-
if (index > 0) {
|
|
627
|
-
const previousFile = images[index - 1];
|
|
628
|
-
setImageId(previousFile.id);
|
|
629
|
-
}
|
|
630
|
-
};
|
|
631
|
-
const handleOnArrowRight = (images, index) => {
|
|
632
|
-
if (index < images.length - 1) {
|
|
633
|
-
const nextFile = images[index + 1];
|
|
634
|
-
setImageId(nextFile.id);
|
|
635
|
-
}
|
|
636
|
-
};
|
|
637
|
-
const onClose = () => setImageId("");
|
|
638
|
-
if (!metaId) return null;
|
|
639
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_material8.Dialog, { open: true, onClose, maxWidth: "xl", children: [
|
|
640
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material8.Box, { component: "img", src: source, alt: metaId, sx: { maxWidth: "100vw", maxHeight: { xs: "calc(100vh - 56px)", sm: "calc(100vh - 64px)" } } }),
|
|
641
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_material8.Fab, { size: "medium", onClick: onClose, sx: { position: "fixed", top: 8, right: 8 }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_Close.default, {}) })
|
|
642
|
-
] });
|
|
643
|
-
};
|
|
644
|
-
|
|
645
|
-
// src/components/file/FileViewer.tsx
|
|
646
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
647
|
-
var FileViewer = ({ subId, onDelete, actions, children }) => {
|
|
648
|
-
const { data: fileMetas = [] } = useGetFileMetas({ subId }, { enabled: !!subId });
|
|
649
|
-
const [imageId, setImageId] = (0, import_react9.useState)("");
|
|
650
|
-
const components = { Grid: FileViewerGrid, List: FileViewerList };
|
|
651
|
-
if (fileMetas.length === 0) return null;
|
|
652
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(FileContext.Provider, { value: { fileMetas, onDelete, actions, setImageId }, children: [
|
|
653
|
-
children(components),
|
|
654
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ImageViewer, { metaId: imageId })
|
|
655
|
-
] });
|
|
656
|
-
};
|
|
657
|
-
|
|
658
|
-
// src/components/data-grid/ChipInputCell.tsx
|
|
659
|
-
var import_material9 = require("@mui/material");
|
|
660
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
661
|
-
var isArray = (value) => Array.isArray(value);
|
|
662
|
-
var ChipInputCell = ({ params, slotProps, getLabel }) => {
|
|
663
|
-
if (!params.value) return null;
|
|
664
|
-
const getLabelValue = (value) => {
|
|
665
|
-
if (getLabel) return getLabel(value);
|
|
666
|
-
return value;
|
|
667
|
-
};
|
|
668
|
-
if (isArray(params.value))
|
|
669
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Stack, { direction: "row", alignItems: "center", gap: 1, sx: { overflowX: "auto", height: "100%", width: params.colDef.computedWidth }, children: params.value.map(
|
|
670
|
-
(value, index) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Chip, { label: getLabelValue(value), ...slotProps }, `${index + 1}-chip-input-cell`)
|
|
671
|
-
) });
|
|
672
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_material9.Chip, { label: getLabelValue(params.value), ...slotProps });
|
|
673
|
-
};
|
|
674
|
-
|
|
675
|
-
// src/components/data-grid/EditableColumnHeader.tsx
|
|
676
|
-
var import_Edit = __toESM(require("@mui/icons-material/Edit"), 1);
|
|
677
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
678
|
-
var EditableColumnHeader = ({ colDef }) => {
|
|
679
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TypographyWithIcon, { endIcon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_Edit.default, { color: "disabled", fontSize: "small" }), variant: "body2", className: "MuiDataGrid-columnHeaderTitle", children: colDef.headerName });
|
|
680
|
-
};
|
|
681
|
-
|
|
682
|
-
// src/components/router/RouterButton.tsx
|
|
683
|
-
var import_material10 = require("@mui/material");
|
|
684
|
-
var import_react_router = require("@tanstack/react-router");
|
|
685
|
-
var import_react10 = __toESM(require("react"), 1);
|
|
686
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
687
|
-
var Component = import_react10.default.forwardRef(function ButtonComponent(props, reference) {
|
|
688
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_material10.Button, { ref: reference, component: "a", ...props });
|
|
689
|
-
});
|
|
690
|
-
var CreatedComponent = (0, import_react_router.createLink)(Component);
|
|
691
|
-
var RouterButton = (props) => {
|
|
692
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CreatedComponent, { ...props });
|
|
693
|
-
};
|
|
694
|
-
|
|
695
|
-
// src/components/router/RouterGridActionsCellItem.tsx
|
|
696
|
-
var import_x_data_grid_premium = require("@mui/x-data-grid-premium");
|
|
697
|
-
var import_react_router2 = require("@tanstack/react-router");
|
|
698
|
-
var import_react11 = __toESM(require("react"), 1);
|
|
699
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
700
|
-
var Component2 = import_react11.default.forwardRef(
|
|
701
|
-
function GridActionsCellItemComponent(props, reference) {
|
|
702
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_x_data_grid_premium.GridActionsCellItem, { ref: reference, component: "a", ...props });
|
|
703
|
-
}
|
|
704
|
-
);
|
|
705
|
-
var CreatedComponent2 = (0, import_react_router2.createLink)(Component2);
|
|
706
|
-
var RouterGridActionsCellItem = (props) => {
|
|
707
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CreatedComponent2, { ...props });
|
|
708
|
-
};
|
|
709
|
-
|
|
710
|
-
// src/components/router/RouterIconButton.tsx
|
|
711
|
-
var import_material11 = require("@mui/material");
|
|
712
|
-
var import_react_router3 = require("@tanstack/react-router");
|
|
713
|
-
var import_react12 = __toESM(require("react"), 1);
|
|
714
|
-
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
715
|
-
var Component3 = import_react12.default.forwardRef(function IconButtonComponent(props, reference) {
|
|
716
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_material11.IconButton, { ref: reference, component: "a", ...props });
|
|
717
|
-
});
|
|
718
|
-
var CreatedComponent3 = (0, import_react_router3.createLink)(Component3);
|
|
719
|
-
var RouterIconButton = (props) => {
|
|
720
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CreatedComponent3, { ...props });
|
|
721
|
-
};
|
|
722
|
-
|
|
723
|
-
// src/components/router/RouterLink.tsx
|
|
724
|
-
var import_material12 = require("@mui/material");
|
|
725
|
-
var import_react_router4 = require("@tanstack/react-router");
|
|
726
|
-
var import_react13 = __toESM(require("react"), 1);
|
|
727
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
728
|
-
var Component4 = import_react13.default.forwardRef(function LinkComponent(props, reference) {
|
|
729
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_material12.Link, { ref: reference, ...props });
|
|
730
|
-
});
|
|
731
|
-
var CreatedComponent4 = (0, import_react_router4.createLink)(Component4);
|
|
732
|
-
var RouterLink = (props) => {
|
|
733
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(CreatedComponent4, { ...props });
|
|
734
|
-
};
|
|
735
|
-
|
|
736
|
-
// src/components/router/RouterTab.tsx
|
|
737
|
-
var import_material13 = require("@mui/material");
|
|
738
|
-
var import_react_router5 = require("@tanstack/react-router");
|
|
739
|
-
var import_react14 = __toESM(require("react"), 1);
|
|
740
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
741
|
-
var Component5 = import_react14.default.forwardRef(function TabComponent(props, reference) {
|
|
742
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_material13.Tab, { ref: reference, component: "a", ...props });
|
|
743
|
-
});
|
|
744
|
-
var CreatedComponent5 = (0, import_react_router5.createLink)(Component5);
|
|
745
|
-
var RouterTab = (props) => {
|
|
746
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(CreatedComponent5, { ...props });
|
|
747
|
-
};
|
|
748
|
-
|
|
749
|
-
// src/components/router/RouterListItemButton.tsx
|
|
750
|
-
var import_material14 = require("@mui/material");
|
|
751
|
-
var import_react_router6 = require("@tanstack/react-router");
|
|
752
|
-
var import_react15 = __toESM(require("react"), 1);
|
|
753
|
-
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
754
|
-
var Component6 = import_react15.default.forwardRef(function ButtonComponent2(props, reference) {
|
|
755
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_material14.ListItemButton, { ref: reference, component: "a", ...props });
|
|
756
|
-
});
|
|
757
|
-
var CreatedComponent6 = (0, import_react_router6.createLink)(Component6);
|
|
758
|
-
var RouterListItemButton = (props) => {
|
|
759
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CreatedComponent6, { ...props });
|
|
760
|
-
};
|
|
761
|
-
|
|
762
|
-
// src/components/router/RouterNotFound.tsx
|
|
763
|
-
var import_material15 = require("@mui/material");
|
|
764
|
-
var import_react_i18next4 = require("react-i18next");
|
|
765
|
-
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
766
|
-
function RouterNotFound() {
|
|
767
|
-
const { t } = (0, import_react_i18next4.useTranslation)();
|
|
768
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_material15.Box, { height: "100vh", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", textAlign: "center", px: 2, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_material15.Box, { display: "flex", alignItems: "center", mb: 4, children: [
|
|
769
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_material15.Typography, { variant: "h3", component: "span", fontWeight: 500, sx: { lineHeight: 1 }, children: "404" }),
|
|
770
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_material15.Divider, { orientation: "vertical", flexItem: true, sx: { mx: 3 } }),
|
|
771
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_material15.Typography, { variant: "h5", component: "span", children: t("Layout.ThisPageCouldNotBeFound") })
|
|
772
|
-
] }) });
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
// src/components/router/RouterError.tsx
|
|
776
|
-
var import_material16 = require("@mui/material");
|
|
777
|
-
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
778
|
-
var RouterError = ({ error }) => {
|
|
779
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_material16.Box, { height: "100vh", display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", textAlign: "center", px: 2, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_material16.Box, { display: "flex", alignItems: "center", mb: 4, children: [
|
|
780
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_material16.Typography, { variant: "h3", component: "span", fontWeight: 500, sx: { lineHeight: 1 }, children: error.name || "500" }),
|
|
781
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_material16.Divider, { orientation: "vertical", flexItem: true, sx: { mx: 3 } }),
|
|
782
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_material16.Typography, { variant: "h5", component: "span", children: error.message })
|
|
783
|
-
] }) });
|
|
784
|
-
};
|
|
785
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
786
|
-
0 && (module.exports = {
|
|
787
|
-
ChipInputCell,
|
|
788
|
-
Dropzone,
|
|
789
|
-
EditableColumnHeader,
|
|
790
|
-
FileViewer,
|
|
791
|
-
Fullscreen,
|
|
792
|
-
RouterButton,
|
|
793
|
-
RouterError,
|
|
794
|
-
RouterGridActionsCellItem,
|
|
795
|
-
RouterIconButton,
|
|
796
|
-
RouterLink,
|
|
797
|
-
RouterListItemButton,
|
|
798
|
-
RouterNotFound,
|
|
799
|
-
RouterTab,
|
|
800
|
-
TypographyWithIcon
|
|
801
|
-
});
|
|
802
|
-
//# sourceMappingURL=components.cjs.map
|