@cubone/react-file-manager 1.13.2 → 1.15.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/README.md +64 -32
- package/dist/react-file-manager.es.js +810 -796
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { jsx as e, jsxs as g, Fragment as se } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { useState as b, useRef as re, useEffect as
|
|
4
|
-
import { BsGridFill as ct, BsScissors as dt, BsCopy as ut, BsFolderPlus as ft, BsGrid as
|
|
2
|
+
import lt from "react-loading";
|
|
3
|
+
import Lt, { useState as b, useRef as re, useEffect as V, createContext as ve, useContext as ge, useMemo as $e } from "react";
|
|
4
|
+
import { BsGridFill as ct, BsScissors as dt, BsCopy as ut, BsFolderPlus as ft, BsGrid as Ue } from "react-icons/bs";
|
|
5
5
|
import { FiRefreshCw as ht } from "react-icons/fi";
|
|
6
|
-
import { MdOutlineFileDownload as
|
|
7
|
-
import { BiRename as vt, BiSelectMultiple as
|
|
8
|
-
import { FaCheck as gt, FaListUl as we, FaRegPaste as Ie, FaRegFilePdf as
|
|
9
|
-
import
|
|
10
|
-
import { FaRegFolderOpen as
|
|
11
|
-
import { IoWarningOutline as
|
|
12
|
-
import { PiFolderOpen as
|
|
13
|
-
import { AiOutlineClose as
|
|
14
|
-
import { IoMdRefresh as
|
|
6
|
+
import { MdOutlineFileDownload as je, MdOutlineDelete as pt, MdClear as It, MdOutlineFileUpload as mt, MdKeyboardArrowRight as At, MdHome as $t, MdOutlineNavigateNext as jt, MdMoreHoriz as zt, MdClose as Wt } from "react-icons/md";
|
|
7
|
+
import { BiRename as vt, BiSelectMultiple as Bt } from "react-icons/bi";
|
|
8
|
+
import { FaCheck as gt, FaListUl as we, FaRegPaste as Ie, FaRegFilePdf as Ut, FaRegFileImage as Ee, FaRegFileLines as qt, FaRegFileWord as qe, FaRegFileVideo as He, FaRegFileAudio as _e, FaRegFileZipper as Ht, FaRegFilePowerpoint as Ke, FaRegFileExcel as Ye, FaLaptopFile as _t, FaRegFileCode as J, FaRegFolderOpen as Ve, FaRegFile as be, FaChevronRight as Kt } from "react-icons/fa6";
|
|
9
|
+
import Yt from "react-collapsible";
|
|
10
|
+
import { FaRegFolderOpen as Xe, FaRegFolder as Ge, FaRegCheckCircle as Vt, FaRegFileAlt as Xt } from "react-icons/fa";
|
|
11
|
+
import { IoWarningOutline as Gt } from "react-icons/io5";
|
|
12
|
+
import { PiFolderOpen as Jt } from "react-icons/pi";
|
|
13
|
+
import { AiOutlineClose as Zt, AiOutlineCloudUpload as Qt } from "react-icons/ai";
|
|
14
|
+
import { IoMdRefresh as en } from "react-icons/io";
|
|
15
15
|
import yt from "react-is";
|
|
16
16
|
const Ct = ({ isLoading: t }) => {
|
|
17
17
|
if (t)
|
|
18
|
-
return /* @__PURE__ */ e("div", { className: "fm-loader", children: /* @__PURE__ */ e(
|
|
18
|
+
return /* @__PURE__ */ e("div", { className: "fm-loader", children: /* @__PURE__ */ e(lt, { color: "black", type: "spokes", height: 50, width: 50 }) });
|
|
19
19
|
}, ye = (t = () => {
|
|
20
20
|
}) => {
|
|
21
|
-
const [n, s] = b(!1), r = re(null), o = (
|
|
22
|
-
var
|
|
23
|
-
(
|
|
21
|
+
const [n, s] = b(!1), r = re(null), o = (a) => {
|
|
22
|
+
var i;
|
|
23
|
+
(i = r.current) != null && i.contains(a.target) ? s(!1) : (s(!0), t(a, r));
|
|
24
24
|
};
|
|
25
|
-
return
|
|
25
|
+
return V(() => (document.addEventListener("click", o, !0), document.addEventListener("mousedown", o, !0), () => {
|
|
26
26
|
document.removeEventListener("click", o, !0), document.removeEventListener("mousedown", o, !0);
|
|
27
27
|
}), []), { ref: r, isClicked: n, setIsClicked: s };
|
|
28
|
-
}, wt = ve(),
|
|
28
|
+
}, wt = ve(), tn = ({ children: t, layout: n }) => {
|
|
29
29
|
const [s, r] = b(() => o(n));
|
|
30
|
-
function o(
|
|
31
|
-
return ["list", "grid"].includes(
|
|
30
|
+
function o(a) {
|
|
31
|
+
return ["list", "grid"].includes(a) ? a : "grid";
|
|
32
32
|
}
|
|
33
33
|
return /* @__PURE__ */ e(wt.Provider, { value: { activeLayout: s, setActiveLayout: r }, children: t });
|
|
34
|
-
}, ce = () => ge(wt),
|
|
34
|
+
}, ce = () => ge(wt), nn = ({ setShowToggleViewMenu: t, onLayoutChange: n }) => {
|
|
35
35
|
const s = ye(() => {
|
|
36
36
|
t(!1);
|
|
37
|
-
}), { activeLayout: r, setActiveLayout: o } = ce(),
|
|
37
|
+
}), { activeLayout: r, setActiveLayout: o } = ce(), a = [
|
|
38
38
|
{
|
|
39
39
|
key: "grid",
|
|
40
40
|
name: "Grid",
|
|
@@ -45,15 +45,15 @@ const Ct = ({ isLoading: t }) => {
|
|
|
45
45
|
name: "List",
|
|
46
46
|
icon: /* @__PURE__ */ e(we, { size: 18 })
|
|
47
47
|
}
|
|
48
|
-
],
|
|
48
|
+
], i = (l) => {
|
|
49
49
|
o(l), n(l), t(!1);
|
|
50
50
|
};
|
|
51
|
-
return /* @__PURE__ */ e("div", { ref: s.ref, className: "toggle-view", role: "dropdown", children: /* @__PURE__ */ e("ul", { role: "menu", "aria-orientation": "vertical", children:
|
|
51
|
+
return /* @__PURE__ */ e("div", { ref: s.ref, className: "toggle-view", role: "dropdown", children: /* @__PURE__ */ e("ul", { role: "menu", "aria-orientation": "vertical", children: a.map((l) => /* @__PURE__ */ g(
|
|
52
52
|
"li",
|
|
53
53
|
{
|
|
54
54
|
role: "menuitem",
|
|
55
|
-
onClick: () =>
|
|
56
|
-
onKeyDown: () =>
|
|
55
|
+
onClick: () => i(l.key),
|
|
56
|
+
onKeyDown: () => i(l.key),
|
|
57
57
|
children: [
|
|
58
58
|
/* @__PURE__ */ e("span", { children: l.key === r && /* @__PURE__ */ e(gt, { size: 13 }) }),
|
|
59
59
|
/* @__PURE__ */ e("span", { children: l.icon }),
|
|
@@ -62,29 +62,29 @@ const Ct = ({ isLoading: t }) => {
|
|
|
62
62
|
},
|
|
63
63
|
l.key
|
|
64
64
|
)) }) });
|
|
65
|
-
}, bt = ve(),
|
|
65
|
+
}, bt = ve(), rn = ({ children: t, filesData: n, onError: s }) => {
|
|
66
66
|
const [r, o] = b([]);
|
|
67
|
-
|
|
67
|
+
V(() => {
|
|
68
68
|
o(n);
|
|
69
69
|
}, [n]);
|
|
70
|
-
const
|
|
71
|
-
return /* @__PURE__ */ e(bt.Provider, { value: { files: r, setFiles: o, getChildren:
|
|
72
|
-
}, ke = () => ge(bt), Ft = ve(),
|
|
73
|
-
const { files: s } = ke(), r = re(!1), [o,
|
|
74
|
-
return
|
|
75
|
-
Array.isArray(s) && s.length > 0 && (
|
|
76
|
-
}, [s, o]),
|
|
77
|
-
!r.current && Array.isArray(s) && s.length > 0 && (
|
|
70
|
+
const a = (i) => i.isDirectory ? r.filter((l) => l.path === `${i.path}/${l.name}`) : [];
|
|
71
|
+
return /* @__PURE__ */ e(bt.Provider, { value: { files: r, setFiles: o, getChildren: a, onError: s }, children: t });
|
|
72
|
+
}, ke = () => ge(bt), Ft = ve(), sn = ({ children: t, initialPath: n }) => {
|
|
73
|
+
const { files: s } = ke(), r = re(!1), [o, a] = b(""), [i, l] = b(null), [c, u] = b([]);
|
|
74
|
+
return V(() => {
|
|
75
|
+
Array.isArray(s) && s.length > 0 && (u(() => s.filter((h) => h.path === `${o}/${h.name}`)), l(() => s.find((h) => h.path === o) ?? null));
|
|
76
|
+
}, [s, o]), V(() => {
|
|
77
|
+
!r.current && Array.isArray(s) && s.length > 0 && (a(s.some((h) => h.path === n) ? n : ""), r.current = !0);
|
|
78
78
|
}, [n, s]), /* @__PURE__ */ e(
|
|
79
79
|
Ft.Provider,
|
|
80
80
|
{
|
|
81
81
|
value: {
|
|
82
82
|
currentPath: o,
|
|
83
|
-
setCurrentPath:
|
|
84
|
-
currentFolder:
|
|
83
|
+
setCurrentPath: a,
|
|
84
|
+
currentFolder: i,
|
|
85
85
|
setCurrentFolder: l,
|
|
86
86
|
currentPathFiles: c,
|
|
87
|
-
setCurrentPathFiles:
|
|
87
|
+
setCurrentPathFiles: u
|
|
88
88
|
},
|
|
89
89
|
children: t
|
|
90
90
|
}
|
|
@@ -100,24 +100,24 @@ const Ct = ({ isLoading: t }) => {
|
|
|
100
100
|
} catch (r) {
|
|
101
101
|
console.error(r.message);
|
|
102
102
|
}
|
|
103
|
-
}, kt = ve(),
|
|
103
|
+
}, kt = ve(), on = ({ children: t, onDownload: n }) => {
|
|
104
104
|
const [s, r] = b([]), o = () => {
|
|
105
105
|
fe(n, "onDownload", s);
|
|
106
106
|
};
|
|
107
107
|
return /* @__PURE__ */ e(kt.Provider, { value: { selectedFiles: s, setSelectedFiles: r, handleDownload: o }, children: t });
|
|
108
|
-
}, le = () => ge(kt), Nt = ve(),
|
|
109
|
-
const [s, r] = b(null), { selectedFiles: o, setSelectedFiles:
|
|
108
|
+
}, le = () => ge(kt), Nt = ve(), an = ({ children: t, onPaste: n }) => {
|
|
109
|
+
const [s, r] = b(null), { selectedFiles: o, setSelectedFiles: a } = le(), i = (c) => {
|
|
110
110
|
r({
|
|
111
111
|
files: o,
|
|
112
112
|
isMoving: c
|
|
113
113
|
});
|
|
114
114
|
}, l = (c) => {
|
|
115
115
|
if (c && !c.isDirectory) return;
|
|
116
|
-
const
|
|
117
|
-
fe(n, "onPaste",
|
|
116
|
+
const u = s.files, h = s.isMoving ? "move" : "copy";
|
|
117
|
+
fe(n, "onPaste", u, c, h), s.isMoving && r(null), a([]);
|
|
118
118
|
};
|
|
119
|
-
return /* @__PURE__ */ e(Nt.Provider, { value: { clipBoard: s, setClipBoard: r, handleCutCopy:
|
|
120
|
-
}, Ne = () => ge(Nt),
|
|
119
|
+
return /* @__PURE__ */ e(Nt.Provider, { value: { clipBoard: s, setClipBoard: r, handleCutCopy: i, handlePasting: l }, children: t });
|
|
120
|
+
}, Ne = () => ge(Nt), ln = ({
|
|
121
121
|
allowCreateFolder: t = !0,
|
|
122
122
|
allowUploadFile: n = !0,
|
|
123
123
|
onLayoutChange: s,
|
|
@@ -125,7 +125,7 @@ const Ct = ({ isLoading: t }) => {
|
|
|
125
125
|
triggerAction: o
|
|
126
126
|
}) => {
|
|
127
127
|
var N;
|
|
128
|
-
const [
|
|
128
|
+
const [a, i] = b(!1), { currentFolder: l } = oe(), { selectedFiles: c, setSelectedFiles: u, handleDownload: h } = le(), { clipBoard: f, setClipBoard: w, handleCutCopy: T, handlePasting: R } = Ne(), { activeLayout: O } = ce(), M = [
|
|
129
129
|
{
|
|
130
130
|
icon: /* @__PURE__ */ e(ft, { size: 17, strokeWidth: 0.3 }),
|
|
131
131
|
text: "New folder",
|
|
@@ -141,14 +141,14 @@ const Ct = ({ isLoading: t }) => {
|
|
|
141
141
|
{
|
|
142
142
|
icon: /* @__PURE__ */ e(Ie, { size: 18 }),
|
|
143
143
|
text: "Paste",
|
|
144
|
-
permission: !!
|
|
145
|
-
onClick:
|
|
144
|
+
permission: !!f,
|
|
145
|
+
onClick: E
|
|
146
146
|
}
|
|
147
147
|
], C = [
|
|
148
148
|
{
|
|
149
|
-
icon:
|
|
149
|
+
icon: O === "grid" ? /* @__PURE__ */ e(ct, { size: 16 }) : /* @__PURE__ */ e(we, { size: 16 }),
|
|
150
150
|
title: "Change View",
|
|
151
|
-
onClick: () =>
|
|
151
|
+
onClick: () => i((m) => !m)
|
|
152
152
|
},
|
|
153
153
|
{
|
|
154
154
|
icon: /* @__PURE__ */ e(ht, { size: 16 }),
|
|
@@ -158,27 +158,27 @@ const Ct = ({ isLoading: t }) => {
|
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
];
|
|
161
|
-
function
|
|
162
|
-
|
|
161
|
+
function E() {
|
|
162
|
+
R(l);
|
|
163
163
|
}
|
|
164
164
|
const F = () => {
|
|
165
|
-
h(),
|
|
165
|
+
h(), u([]);
|
|
166
166
|
};
|
|
167
167
|
return c.length > 0 ? /* @__PURE__ */ e("div", { className: "toolbar file-selected", children: /* @__PURE__ */ g("div", { className: "file-action-container", children: [
|
|
168
168
|
/* @__PURE__ */ g("div", { children: [
|
|
169
|
-
/* @__PURE__ */ g("button", { className: "item-action file-action", onClick: () =>
|
|
169
|
+
/* @__PURE__ */ g("button", { className: "item-action file-action", onClick: () => T(!0), children: [
|
|
170
170
|
/* @__PURE__ */ e(dt, { size: 18 }),
|
|
171
171
|
/* @__PURE__ */ e("span", { children: "Cut" })
|
|
172
172
|
] }),
|
|
173
|
-
/* @__PURE__ */ g("button", { className: "item-action file-action", onClick: () =>
|
|
173
|
+
/* @__PURE__ */ g("button", { className: "item-action file-action", onClick: () => T(!1), children: [
|
|
174
174
|
/* @__PURE__ */ e(ut, { strokeWidth: 0.1, size: 17 }),
|
|
175
175
|
/* @__PURE__ */ e("span", { children: "Copy" })
|
|
176
176
|
] }),
|
|
177
|
-
((N =
|
|
177
|
+
((N = f == null ? void 0 : f.files) == null ? void 0 : N.length) > 0 && /* @__PURE__ */ g(
|
|
178
178
|
"button",
|
|
179
179
|
{
|
|
180
180
|
className: "item-action file-action",
|
|
181
|
-
onClick:
|
|
181
|
+
onClick: E,
|
|
182
182
|
children: [
|
|
183
183
|
/* @__PURE__ */ e(Ie, { size: 18 }),
|
|
184
184
|
/* @__PURE__ */ e("span", { children: "Paste" })
|
|
@@ -197,7 +197,7 @@ const Ct = ({ isLoading: t }) => {
|
|
|
197
197
|
}
|
|
198
198
|
),
|
|
199
199
|
!c.isDirectory && /* @__PURE__ */ g("button", { className: "item-action file-action", onClick: F, children: [
|
|
200
|
-
/* @__PURE__ */ e(
|
|
200
|
+
/* @__PURE__ */ e(je, { size: 19 }),
|
|
201
201
|
/* @__PURE__ */ e("span", { children: "Download" })
|
|
202
202
|
] }),
|
|
203
203
|
/* @__PURE__ */ g(
|
|
@@ -217,7 +217,7 @@ const Ct = ({ isLoading: t }) => {
|
|
|
217
217
|
{
|
|
218
218
|
className: "item-action file-action",
|
|
219
219
|
title: "Clear selection",
|
|
220
|
-
onClick: () =>
|
|
220
|
+
onClick: () => u([]),
|
|
221
221
|
children: [
|
|
222
222
|
/* @__PURE__ */ g("span", { children: [
|
|
223
223
|
c.length,
|
|
@@ -225,7 +225,7 @@ const Ct = ({ isLoading: t }) => {
|
|
|
225
225
|
c.length > 1 && "s",
|
|
226
226
|
" selected"
|
|
227
227
|
] }),
|
|
228
|
-
/* @__PURE__ */ e(
|
|
228
|
+
/* @__PURE__ */ e(It, { size: 18 })
|
|
229
229
|
]
|
|
230
230
|
}
|
|
231
231
|
)
|
|
@@ -239,26 +239,26 @@ const Ct = ({ isLoading: t }) => {
|
|
|
239
239
|
/* @__PURE__ */ e("button", { className: "item-action icon-only", title: m.title, onClick: m.onClick, children: m.icon }),
|
|
240
240
|
p !== C.length - 1 && /* @__PURE__ */ e("div", { className: "item-separator" })
|
|
241
241
|
] }, p)),
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
a && /* @__PURE__ */ e(
|
|
243
|
+
nn,
|
|
244
244
|
{
|
|
245
|
-
setShowToggleViewMenu:
|
|
245
|
+
setShowToggleViewMenu: i,
|
|
246
246
|
onLayoutChange: s
|
|
247
247
|
}
|
|
248
248
|
)
|
|
249
249
|
] })
|
|
250
250
|
] }) });
|
|
251
251
|
}, Pt = ({ folder: t }) => {
|
|
252
|
-
const [n, s] = b(!1), [r, o] = b(!1), { currentPath:
|
|
253
|
-
o(!0),
|
|
254
|
-
}, c = (
|
|
255
|
-
|
|
252
|
+
const [n, s] = b(!1), [r, o] = b(!1), { currentPath: a, setCurrentPath: i } = oe(), l = () => {
|
|
253
|
+
o(!0), i(t.path);
|
|
254
|
+
}, c = (u) => {
|
|
255
|
+
u.stopPropagation(), s((h) => !h);
|
|
256
256
|
};
|
|
257
|
-
return
|
|
258
|
-
o(
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
}, [
|
|
257
|
+
return V(() => {
|
|
258
|
+
o(a === t.path);
|
|
259
|
+
const u = a.split("/");
|
|
260
|
+
u.pop(), u.join("/") === t.path && s(!0);
|
|
261
|
+
}, [a]), t.subDirectories.length > 0 ? /* @__PURE__ */ g(se, { children: [
|
|
262
262
|
/* @__PURE__ */ g(
|
|
263
263
|
"div",
|
|
264
264
|
{
|
|
@@ -266,20 +266,20 @@ const Ct = ({ isLoading: t }) => {
|
|
|
266
266
|
onClick: l,
|
|
267
267
|
children: [
|
|
268
268
|
/* @__PURE__ */ e("span", { onClick: c, children: /* @__PURE__ */ e(
|
|
269
|
-
|
|
269
|
+
At,
|
|
270
270
|
{
|
|
271
271
|
size: 20,
|
|
272
272
|
className: `${n ? "folder-rotate-down" : "folder-rotate-right"}`
|
|
273
273
|
}
|
|
274
274
|
) }),
|
|
275
275
|
/* @__PURE__ */ g("div", { className: "sb-folder-details", children: [
|
|
276
|
-
n || r ? /* @__PURE__ */ e(
|
|
276
|
+
n || r ? /* @__PURE__ */ e(Xe, { size: 20, className: "folder-open-icon" }) : /* @__PURE__ */ e(Ge, { size: 17, className: "folder-close-icon" }),
|
|
277
277
|
/* @__PURE__ */ e("span", { className: "sb-folder-name", title: t.name, children: t.name })
|
|
278
278
|
] })
|
|
279
279
|
]
|
|
280
280
|
}
|
|
281
281
|
),
|
|
282
|
-
/* @__PURE__ */ e(
|
|
282
|
+
/* @__PURE__ */ e(Yt, { open: n, children: /* @__PURE__ */ e("div", { className: "folder-collapsible", children: t.subDirectories.map((u, h) => /* @__PURE__ */ e(Pt, { folder: u }, h)) }) })
|
|
283
283
|
] }) : /* @__PURE__ */ g(
|
|
284
284
|
"div",
|
|
285
285
|
{
|
|
@@ -288,69 +288,69 @@ const Ct = ({ isLoading: t }) => {
|
|
|
288
288
|
children: [
|
|
289
289
|
/* @__PURE__ */ e("span", { className: "non-expanable" }),
|
|
290
290
|
/* @__PURE__ */ g("div", { className: "sb-folder-details", children: [
|
|
291
|
-
r ? /* @__PURE__ */ e(
|
|
291
|
+
r ? /* @__PURE__ */ e(Xe, { size: 20, className: "folder-open-icon" }) : /* @__PURE__ */ e(Ge, { size: 17, className: "folder-close-icon" }),
|
|
292
292
|
/* @__PURE__ */ e("span", { className: "sb-folder-name", title: t.name, children: t.name })
|
|
293
293
|
] })
|
|
294
294
|
]
|
|
295
295
|
}
|
|
296
296
|
);
|
|
297
|
-
},
|
|
298
|
-
const [t, n] = b([]), { files: s } = ke(), r = (o,
|
|
299
|
-
var
|
|
300
|
-
return
|
|
297
|
+
}, cn = (t) => t == null ? void 0 : t.split("/").slice(0, -1).join("/"), dn = () => {
|
|
298
|
+
const [t, n] = b([]), { files: s } = ke(), r = (o, a) => {
|
|
299
|
+
var i;
|
|
300
|
+
return a[o] ? (i = a[o]) == null ? void 0 : i.map((l) => ({
|
|
301
301
|
...l,
|
|
302
|
-
subDirectories: r(l.path,
|
|
302
|
+
subDirectories: r(l.path, a)
|
|
303
303
|
})) : [];
|
|
304
304
|
};
|
|
305
|
-
return
|
|
305
|
+
return V(() => {
|
|
306
306
|
if (Array.isArray(s)) {
|
|
307
|
-
const o = s.filter((
|
|
308
|
-
n(() => r("",
|
|
307
|
+
const o = s.filter((i) => i.isDirectory), a = Object.groupBy(o, ({ path: i }) => cn(i));
|
|
308
|
+
n(() => r("", a));
|
|
309
309
|
}
|
|
310
|
-
}, [s]), /* @__PURE__ */ e("div", { className: "sb-folders-list", children: (t == null ? void 0 : t.length) > 0 ? /* @__PURE__ */ e(se, { children: t == null ? void 0 : t.map((o,
|
|
311
|
-
},
|
|
312
|
-
const [t, n] = b([]), [s, r] = b([]), [o,
|
|
310
|
+
}, [s]), /* @__PURE__ */ e("div", { className: "sb-folders-list", children: (t == null ? void 0 : t.length) > 0 ? /* @__PURE__ */ e(se, { children: t == null ? void 0 : t.map((o, a) => /* @__PURE__ */ e(Pt, { folder: o }, a)) }) : /* @__PURE__ */ e("div", { className: "empty-nav-pane", children: "Nothing here yet" }) });
|
|
311
|
+
}, un = () => {
|
|
312
|
+
const [t, n] = b([]), [s, r] = b([]), [o, a] = b([]), [i, l] = b(!1), { currentPath: c, setCurrentPath: u } = oe(), h = re(null), f = re([]), w = re(null), T = ye(() => {
|
|
313
313
|
l(!1);
|
|
314
314
|
});
|
|
315
|
-
|
|
315
|
+
V(() => {
|
|
316
316
|
n(() => {
|
|
317
|
-
let
|
|
317
|
+
let E = "";
|
|
318
318
|
return c == null ? void 0 : c.split("/").map((F) => ({
|
|
319
319
|
name: F || "Home",
|
|
320
|
-
path: F === "" ? F :
|
|
320
|
+
path: F === "" ? F : E += `/${F}`
|
|
321
321
|
}));
|
|
322
|
-
}), r([]),
|
|
322
|
+
}), r([]), a([]);
|
|
323
323
|
}, [c]);
|
|
324
|
-
const
|
|
325
|
-
|
|
326
|
-
},
|
|
327
|
-
const
|
|
328
|
-
return
|
|
324
|
+
const R = (E) => {
|
|
325
|
+
u(E);
|
|
326
|
+
}, O = () => {
|
|
327
|
+
const E = h.current.clientWidth, F = getComputedStyle(h.current), N = parseFloat(F.paddingLeft), m = s.length > 0 ? 1 : 0, p = parseFloat(F.gap) * (t.length + m);
|
|
328
|
+
return E - (N + p);
|
|
329
329
|
}, M = () => {
|
|
330
330
|
var m;
|
|
331
|
-
const
|
|
332
|
-
return
|
|
331
|
+
const E = O(), F = f.current.reduce((p, D) => D ? p + D.clientWidth : p, 0), N = ((m = w.current) == null ? void 0 : m.clientWidth) || 0;
|
|
332
|
+
return E - (F + N);
|
|
333
333
|
}, C = () => h.current.scrollWidth > h.current.clientWidth;
|
|
334
|
-
return
|
|
335
|
-
var
|
|
334
|
+
return V(() => {
|
|
335
|
+
var E;
|
|
336
336
|
if (C()) {
|
|
337
|
-
const F = t[1], N = (
|
|
338
|
-
|
|
337
|
+
const F = t[1], N = (E = f.current[1]) == null ? void 0 : E.clientWidth;
|
|
338
|
+
a((m) => [...m, N]), r((m) => [...m, F]), n((m) => m.filter((p, D) => D !== 1));
|
|
339
339
|
} else if (s.length > 0 && M() > o.at(-1)) {
|
|
340
340
|
const F = [t[0], s.at(-1), ...t.slice(1)];
|
|
341
|
-
n(F), r((N) => N.slice(0, -1)),
|
|
341
|
+
n(F), r((N) => N.slice(0, -1)), a((N) => N.slice(0, -1));
|
|
342
342
|
}
|
|
343
343
|
}, [C]), /* @__PURE__ */ g("div", { className: "bread-crumb-container", children: [
|
|
344
|
-
/* @__PURE__ */ e("div", { className: "breadcrumb", ref: h, children: t.map((
|
|
344
|
+
/* @__PURE__ */ e("div", { className: "breadcrumb", ref: h, children: t.map((E, F) => /* @__PURE__ */ g("div", { style: { display: "contents" }, children: [
|
|
345
345
|
/* @__PURE__ */ g(
|
|
346
346
|
"span",
|
|
347
347
|
{
|
|
348
348
|
className: "folder-name",
|
|
349
|
-
onClick: () =>
|
|
350
|
-
ref: (N) =>
|
|
349
|
+
onClick: () => R(E.path),
|
|
350
|
+
ref: (N) => f.current[F] = N,
|
|
351
351
|
children: [
|
|
352
|
-
F === 0 ? /* @__PURE__ */ e(
|
|
353
|
-
|
|
352
|
+
F === 0 ? /* @__PURE__ */ e($t, {}) : /* @__PURE__ */ e(jt, {}),
|
|
353
|
+
E.name
|
|
354
354
|
]
|
|
355
355
|
}
|
|
356
356
|
),
|
|
@@ -361,39 +361,39 @@ const Ct = ({ isLoading: t }) => {
|
|
|
361
361
|
onClick: () => l(!0),
|
|
362
362
|
ref: w,
|
|
363
363
|
title: "Show more folders",
|
|
364
|
-
children: /* @__PURE__ */ e(
|
|
364
|
+
children: /* @__PURE__ */ e(zt, { size: 22, className: "hidden-folders" })
|
|
365
365
|
}
|
|
366
366
|
)
|
|
367
367
|
] }, F)) }),
|
|
368
|
-
|
|
368
|
+
i && /* @__PURE__ */ e("ul", { ref: T.ref, className: "hidden-folders-container", children: s.map((E, F) => /* @__PURE__ */ e(
|
|
369
369
|
"li",
|
|
370
370
|
{
|
|
371
371
|
onClick: () => {
|
|
372
|
-
|
|
372
|
+
R(E.path), l(!1);
|
|
373
373
|
},
|
|
374
|
-
children:
|
|
374
|
+
children: E.name
|
|
375
375
|
},
|
|
376
376
|
F
|
|
377
377
|
)) })
|
|
378
378
|
] });
|
|
379
379
|
}, Fe = (t) => ({
|
|
380
|
-
pdf: /* @__PURE__ */ e(
|
|
380
|
+
pdf: /* @__PURE__ */ e(Ut, { size: t }),
|
|
381
381
|
jpg: /* @__PURE__ */ e(Ee, { size: t }),
|
|
382
382
|
jpeg: /* @__PURE__ */ e(Ee, { size: t }),
|
|
383
383
|
png: /* @__PURE__ */ e(Ee, { size: t }),
|
|
384
|
-
txt: /* @__PURE__ */ e(
|
|
385
|
-
doc: /* @__PURE__ */ e(
|
|
386
|
-
docx: /* @__PURE__ */ e(
|
|
387
|
-
mp4: /* @__PURE__ */ e(
|
|
388
|
-
webm: /* @__PURE__ */ e(
|
|
389
|
-
mp3: /* @__PURE__ */ e(
|
|
390
|
-
m4a: /* @__PURE__ */ e(
|
|
391
|
-
zip: /* @__PURE__ */ e(
|
|
392
|
-
ppt: /* @__PURE__ */ e(
|
|
393
|
-
pptx: /* @__PURE__ */ e(
|
|
394
|
-
xls: /* @__PURE__ */ e(
|
|
395
|
-
xlsx: /* @__PURE__ */ e(
|
|
396
|
-
exe: /* @__PURE__ */ e(
|
|
384
|
+
txt: /* @__PURE__ */ e(qt, { size: t }),
|
|
385
|
+
doc: /* @__PURE__ */ e(qe, { size: t }),
|
|
386
|
+
docx: /* @__PURE__ */ e(qe, { size: t }),
|
|
387
|
+
mp4: /* @__PURE__ */ e(He, { size: t }),
|
|
388
|
+
webm: /* @__PURE__ */ e(He, { size: t }),
|
|
389
|
+
mp3: /* @__PURE__ */ e(_e, { size: t }),
|
|
390
|
+
m4a: /* @__PURE__ */ e(_e, { size: t }),
|
|
391
|
+
zip: /* @__PURE__ */ e(Ht, { size: t }),
|
|
392
|
+
ppt: /* @__PURE__ */ e(Ke, { size: t }),
|
|
393
|
+
pptx: /* @__PURE__ */ e(Ke, { size: t }),
|
|
394
|
+
xls: /* @__PURE__ */ e(Ye, { size: t }),
|
|
395
|
+
xlsx: /* @__PURE__ */ e(Ye, { size: t }),
|
|
396
|
+
exe: /* @__PURE__ */ e(_t, { size: t }),
|
|
397
397
|
html: /* @__PURE__ */ e(J, { size: t }),
|
|
398
398
|
css: /* @__PURE__ */ e(J, { size: t }),
|
|
399
399
|
js: /* @__PURE__ */ e(J, { size: t }),
|
|
@@ -414,20 +414,20 @@ const Ct = ({ isLoading: t }) => {
|
|
|
414
414
|
}), Et = (t, n, s) => {
|
|
415
415
|
if (s.find((r) => r.name === t)) {
|
|
416
416
|
const r = "", o = t;
|
|
417
|
-
let
|
|
418
|
-
const
|
|
419
|
-
s.forEach((
|
|
420
|
-
const h =
|
|
421
|
-
if (
|
|
422
|
-
const
|
|
423
|
-
!isNaN(w) && w >
|
|
417
|
+
let a = 0;
|
|
418
|
+
const i = new RegExp(`${o} \\(\\d+\\)`);
|
|
419
|
+
s.forEach((u) => {
|
|
420
|
+
const h = u.isDirectory ? u.name : u.name.split(".").slice(0, -1).join(".");
|
|
421
|
+
if (i.test(h)) {
|
|
422
|
+
const f = h.split(`${o} (`).pop().slice(0, -1), w = parseInt(f);
|
|
423
|
+
!isNaN(w) && w > a && (a = w);
|
|
424
424
|
}
|
|
425
425
|
});
|
|
426
|
-
const l = ` (${++
|
|
426
|
+
const l = ` (${++a})`;
|
|
427
427
|
return o + l + r;
|
|
428
428
|
} else
|
|
429
429
|
return t;
|
|
430
|
-
}, Rt = ({ nameInputRef: t, maxLength: n, value: s, onChange: r, onKeyDown: o, onClick:
|
|
430
|
+
}, Rt = ({ nameInputRef: t, maxLength: n, value: s, onChange: r, onKeyDown: o, onClick: a, rows: i }) => /* @__PURE__ */ e(
|
|
431
431
|
"textarea",
|
|
432
432
|
{
|
|
433
433
|
ref: t,
|
|
@@ -436,63 +436,63 @@ const Ct = ({ isLoading: t }) => {
|
|
|
436
436
|
value: s,
|
|
437
437
|
onChange: r,
|
|
438
438
|
onKeyDown: o,
|
|
439
|
-
onClick:
|
|
440
|
-
rows:
|
|
439
|
+
onClick: a,
|
|
440
|
+
rows: i
|
|
441
441
|
}
|
|
442
|
-
), xt = ({ message: t, xPlacement: n, yPlacement: s }) => /* @__PURE__ */ e("p", { className: `error-tooltip ${n} ${s}`, children: t }),
|
|
443
|
-
const [o,
|
|
442
|
+
), xt = ({ message: t, xPlacement: n, yPlacement: s }) => /* @__PURE__ */ e("p", { className: `error-tooltip ${n} ${s}`, children: t }), fn = 220, hn = ({ filesViewRef: t, file: n, onCreateFolder: s, triggerAction: r }) => {
|
|
443
|
+
const [o, a] = b(n.name), [i, l] = b(!1), [c, u] = b(""), [h, f] = b("right"), [w, T] = b("bottom"), R = ye((p) => {
|
|
444
444
|
p.preventDefault(), p.stopPropagation();
|
|
445
|
-
}), { currentFolder:
|
|
446
|
-
|
|
445
|
+
}), { currentFolder: O, currentPathFiles: M, setCurrentPathFiles: C } = oe(), { activeLayout: E } = ce(), F = (p) => {
|
|
446
|
+
a(p.target.value), l(!1);
|
|
447
447
|
}, N = (p) => {
|
|
448
448
|
if (p.stopPropagation(), p.key === "Enter") {
|
|
449
449
|
p.preventDefault(), m();
|
|
450
450
|
return;
|
|
451
451
|
}
|
|
452
|
-
p.key === "Escape" && (p.preventDefault(), r.close(), C((y) => y.filter((
|
|
452
|
+
p.key === "Escape" && (p.preventDefault(), r.close(), C((y) => y.filter((P) => P.key !== n.key))), /[\\/:*?"<>|]/.test(p.key) ? (p.preventDefault(), u(
|
|
453
453
|
`A file name can't contain any of the following characters: \\ / : * ? " < > |`
|
|
454
|
-
), l(!0)) : (l(!1),
|
|
454
|
+
), l(!0)) : (l(!1), u(""));
|
|
455
455
|
};
|
|
456
|
-
|
|
457
|
-
if (
|
|
456
|
+
V(() => {
|
|
457
|
+
if (i) {
|
|
458
458
|
const p = setTimeout(() => {
|
|
459
|
-
l(!1),
|
|
459
|
+
l(!1), u("");
|
|
460
460
|
}, 7e3);
|
|
461
461
|
return () => clearTimeout(p);
|
|
462
462
|
}
|
|
463
|
-
}, [
|
|
463
|
+
}, [i]);
|
|
464
464
|
function m() {
|
|
465
|
-
var
|
|
465
|
+
var P, x;
|
|
466
466
|
let p = o.trim();
|
|
467
|
-
const
|
|
468
|
-
if (
|
|
469
|
-
|
|
467
|
+
const D = M.filter((j) => !(j.key && j.key === n.key));
|
|
468
|
+
if (D.find((j) => j.name.toLowerCase() === p.toLowerCase())) {
|
|
469
|
+
u(`This destination already contains a folder named '${p}'.`), l(!0), (P = R.ref.current) == null || P.focus(), (x = R.ref.current) == null || x.select(), R.setIsClicked(!1);
|
|
470
470
|
return;
|
|
471
471
|
}
|
|
472
|
-
p === "" && (p = Et("New Folder", !0,
|
|
472
|
+
p === "" && (p = Et("New Folder", !0, D)), fe(s, "onCreateFolder", p, O), C((j) => j.filter((H) => H.key !== n.key)), r.close();
|
|
473
473
|
}
|
|
474
|
-
return
|
|
475
|
-
var p,
|
|
476
|
-
if ((p =
|
|
477
|
-
const H = t.current.getBoundingClientRect(), I =
|
|
478
|
-
H.right -
|
|
474
|
+
return V(() => {
|
|
475
|
+
var p, D, y;
|
|
476
|
+
if ((p = R.ref.current) == null || p.focus(), (D = R.ref.current) == null || D.select(), (y = R.ref) != null && y.current) {
|
|
477
|
+
const H = t.current.getBoundingClientRect(), I = R.ref.current, K = I.getBoundingClientRect();
|
|
478
|
+
H.right - K.left > 313 ? f("right") : f("left"), H.bottom - (K.top + I.clientHeight) > 88 ? T("bottom") : T("top");
|
|
479
479
|
}
|
|
480
|
-
}, []),
|
|
481
|
-
|
|
482
|
-
}, [
|
|
480
|
+
}, []), V(() => {
|
|
481
|
+
R.isClicked && m();
|
|
482
|
+
}, [R.isClicked]), /* @__PURE__ */ g(se, { children: [
|
|
483
483
|
/* @__PURE__ */ e(
|
|
484
484
|
Rt,
|
|
485
485
|
{
|
|
486
|
-
nameInputRef:
|
|
487
|
-
maxLength:
|
|
486
|
+
nameInputRef: R.ref,
|
|
487
|
+
maxLength: fn,
|
|
488
488
|
value: o,
|
|
489
489
|
onChange: F,
|
|
490
490
|
onKeyDown: N,
|
|
491
491
|
onClick: (p) => p.stopPropagation(),
|
|
492
|
-
...
|
|
492
|
+
...E === "list" && { rows: 1 }
|
|
493
493
|
}
|
|
494
494
|
),
|
|
495
|
-
|
|
495
|
+
i && /* @__PURE__ */ e(
|
|
496
496
|
xt,
|
|
497
497
|
{
|
|
498
498
|
message: c,
|
|
@@ -516,13 +516,13 @@ const Ct = ({ isLoading: t }) => {
|
|
|
516
516
|
setShow: s,
|
|
517
517
|
heading: r,
|
|
518
518
|
dialogWidth: o = "25%",
|
|
519
|
-
contentClassName:
|
|
520
|
-
closeButton:
|
|
519
|
+
contentClassName: a = "",
|
|
520
|
+
closeButton: i = !0
|
|
521
521
|
}) => {
|
|
522
|
-
const l = re(null), c = (
|
|
523
|
-
|
|
522
|
+
const l = re(null), c = (u) => {
|
|
523
|
+
u.key === "Escape" && s(!1);
|
|
524
524
|
};
|
|
525
|
-
return
|
|
525
|
+
return V(() => {
|
|
526
526
|
n ? l.current.showModal() : l.current.close();
|
|
527
527
|
}, [n]), /* @__PURE__ */ g(
|
|
528
528
|
"dialog",
|
|
@@ -534,29 +534,29 @@ const Ct = ({ isLoading: t }) => {
|
|
|
534
534
|
children: [
|
|
535
535
|
/* @__PURE__ */ g("div", { className: "fm-modal-header", children: [
|
|
536
536
|
/* @__PURE__ */ e("span", { className: "fm-modal-heading", children: r }),
|
|
537
|
-
|
|
537
|
+
i && /* @__PURE__ */ e(Wt, { size: 18, onClick: () => s(!1), className: "close-icon", title: "Close" })
|
|
538
538
|
] }),
|
|
539
539
|
t
|
|
540
540
|
]
|
|
541
541
|
}
|
|
542
542
|
);
|
|
543
|
-
}, pe = (t) => t.split(".").pop(),
|
|
544
|
-
const [o,
|
|
545
|
-
var
|
|
546
|
-
(
|
|
543
|
+
}, pe = (t) => t.split(".").pop(), pn = 220, mn = ({ filesViewRef: t, file: n, onRename: s, triggerAction: r }) => {
|
|
544
|
+
const [o, a] = b(n == null ? void 0 : n.name), [i, l] = b(!1), [c, u] = b(!1), [h, f] = b(""), [w, T] = b("right"), [R, O] = b("bottom"), { currentPathFiles: M, setCurrentPathFiles: C } = oe(), { activeLayout: E } = ce(), F = re(null), N = ye((y) => {
|
|
545
|
+
var P;
|
|
546
|
+
(P = F.current) != null && P.contains(y.target) || (y.preventDefault(), y.stopPropagation());
|
|
547
547
|
}), m = (y) => {
|
|
548
548
|
if (y.stopPropagation(), y.key === "Enter") {
|
|
549
549
|
y.preventDefault(), N.setIsClicked(!0);
|
|
550
550
|
return;
|
|
551
551
|
}
|
|
552
|
-
/[\\/:*?"<>|]/.test(y.key) ? (y.preventDefault(),
|
|
552
|
+
/[\\/:*?"<>|]/.test(y.key) ? (y.preventDefault(), f(
|
|
553
553
|
`A file name can't contain any of the following characters: \\ / : * ? " < > |`
|
|
554
|
-
),
|
|
554
|
+
), u(!0)) : u(!1);
|
|
555
555
|
};
|
|
556
|
-
|
|
556
|
+
V(() => {
|
|
557
557
|
if (c) {
|
|
558
558
|
const y = setTimeout(() => {
|
|
559
|
-
|
|
559
|
+
u(!1), f("");
|
|
560
560
|
}, 7e3);
|
|
561
561
|
return () => clearTimeout(y);
|
|
562
562
|
}
|
|
@@ -564,51 +564,51 @@ const Ct = ({ isLoading: t }) => {
|
|
|
564
564
|
function p(y) {
|
|
565
565
|
if (o === "" || o === n.name) {
|
|
566
566
|
C(
|
|
567
|
-
(
|
|
567
|
+
(P) => P.map((x) => (x.key === n.key && (x.isEditing = !1), x))
|
|
568
568
|
), r.close();
|
|
569
569
|
return;
|
|
570
|
-
} else if (M.some((
|
|
571
|
-
|
|
570
|
+
} else if (M.some((P) => P.name === o)) {
|
|
571
|
+
u(!0), f(`This destination already contains a folder named '${o}'.`), N.setIsClicked(!1);
|
|
572
572
|
return;
|
|
573
573
|
} else if (!n.isDirectory && !y) {
|
|
574
|
-
const
|
|
575
|
-
if (
|
|
574
|
+
const P = pe(n.name), x = pe(o);
|
|
575
|
+
if (P !== x) {
|
|
576
576
|
l(!0);
|
|
577
577
|
return;
|
|
578
578
|
}
|
|
579
579
|
}
|
|
580
|
-
|
|
580
|
+
u(!1), fe(s, "onRename", n, o), C((P) => P.filter((x) => x.key !== n.key)), r.close();
|
|
581
581
|
}
|
|
582
|
-
const
|
|
583
|
-
var y,
|
|
584
|
-
if ((
|
|
585
|
-
(j = (
|
|
582
|
+
const D = () => {
|
|
583
|
+
var y, P, x, j, H, I;
|
|
584
|
+
if ((P = (y = N.ref) == null ? void 0 : y.current) == null || P.focus(), n.isDirectory)
|
|
585
|
+
(j = (x = N.ref) == null ? void 0 : x.current) == null || j.select();
|
|
586
586
|
else {
|
|
587
|
-
const
|
|
588
|
-
(I = (H = N.ref) == null ? void 0 : H.current) == null || I.setSelectionRange(0,
|
|
587
|
+
const K = pe(n.name), Z = n.name.length - K.length - 1;
|
|
588
|
+
(I = (H = N.ref) == null ? void 0 : H.current) == null || I.setSelectionRange(0, Z);
|
|
589
589
|
}
|
|
590
590
|
};
|
|
591
|
-
return
|
|
591
|
+
return V(() => {
|
|
592
592
|
var y;
|
|
593
|
-
if (
|
|
594
|
-
const H = t.current.getBoundingClientRect(), I = N.ref.current,
|
|
595
|
-
H.right -
|
|
593
|
+
if (D(), (y = N.ref) != null && y.current) {
|
|
594
|
+
const H = t.current.getBoundingClientRect(), I = N.ref.current, K = I.getBoundingClientRect();
|
|
595
|
+
H.right - K.left > 313 ? T("right") : T("left"), H.bottom - (K.top + I.clientHeight) > 88 ? O("bottom") : O("top");
|
|
596
596
|
}
|
|
597
|
-
}, []),
|
|
598
|
-
N.isClicked && p(!1),
|
|
597
|
+
}, []), V(() => {
|
|
598
|
+
N.isClicked && p(!1), D();
|
|
599
599
|
}, [N.isClicked]), /* @__PURE__ */ g(se, { children: [
|
|
600
600
|
/* @__PURE__ */ e(
|
|
601
601
|
Rt,
|
|
602
602
|
{
|
|
603
603
|
nameInputRef: N.ref,
|
|
604
|
-
maxLength:
|
|
604
|
+
maxLength: pn,
|
|
605
605
|
value: o,
|
|
606
606
|
onChange: (y) => {
|
|
607
|
-
|
|
607
|
+
a(y.target.value), u(!1);
|
|
608
608
|
},
|
|
609
609
|
onKeyDown: m,
|
|
610
610
|
onClick: (y) => y.stopPropagation(),
|
|
611
|
-
...
|
|
611
|
+
...E === "list" && { rows: 1 }
|
|
612
612
|
}
|
|
613
613
|
),
|
|
614
614
|
c && /* @__PURE__ */ e(
|
|
@@ -616,20 +616,20 @@ const Ct = ({ isLoading: t }) => {
|
|
|
616
616
|
{
|
|
617
617
|
message: h,
|
|
618
618
|
xPlacement: w,
|
|
619
|
-
yPlacement:
|
|
619
|
+
yPlacement: R
|
|
620
620
|
}
|
|
621
621
|
),
|
|
622
622
|
/* @__PURE__ */ e(
|
|
623
623
|
Tt,
|
|
624
624
|
{
|
|
625
625
|
heading: "Rename",
|
|
626
|
-
show:
|
|
626
|
+
show: i,
|
|
627
627
|
setShow: l,
|
|
628
628
|
dialogWidth: "25vw",
|
|
629
629
|
closeButton: !1,
|
|
630
630
|
children: /* @__PURE__ */ g("div", { className: "fm-rename-folder-container", ref: F, children: [
|
|
631
631
|
/* @__PURE__ */ e("div", { className: "fm-rename-folder-input", children: /* @__PURE__ */ g("div", { className: "fm-rename-warning", children: [
|
|
632
|
-
/* @__PURE__ */ e(
|
|
632
|
+
/* @__PURE__ */ e(Gt, { size: 70, color: "orange" }),
|
|
633
633
|
/* @__PURE__ */ e("div", { children: "If you change a file name extension, the file might become unusable. Are you sure you want to change it?" })
|
|
634
634
|
] }) }),
|
|
635
635
|
/* @__PURE__ */ g("div", { className: "fm-rename-folder-action", children: [
|
|
@@ -639,7 +639,7 @@ const Ct = ({ isLoading: t }) => {
|
|
|
639
639
|
type: "secondary",
|
|
640
640
|
onClick: () => {
|
|
641
641
|
C(
|
|
642
|
-
(y) => y.map((
|
|
642
|
+
(y) => y.map((P) => (P.key === n.key && (P.isEditing = !1), P))
|
|
643
643
|
), l(!1), r.close();
|
|
644
644
|
},
|
|
645
645
|
children: "No"
|
|
@@ -669,104 +669,104 @@ const Ct = ({ isLoading: t }) => {
|
|
|
669
669
|
return `${r.toFixed(n)} MB`;
|
|
670
670
|
if (r >= 1024)
|
|
671
671
|
return `${o.toFixed(n)} GB`;
|
|
672
|
-
},
|
|
672
|
+
}, vn = (t) => {
|
|
673
673
|
if (!t || isNaN(Date.parse(t))) return "";
|
|
674
674
|
t = new Date(t);
|
|
675
675
|
let n = t.getHours();
|
|
676
676
|
const s = t.getMinutes(), r = n >= 12 ? "PM" : "AM";
|
|
677
677
|
n = n % 12, n = n || 12;
|
|
678
|
-
const o = t.getMonth() + 1,
|
|
679
|
-
return `${o}/${
|
|
680
|
-
}, Dt = ({ name: t, id: n, checked: s, onClick: r, onChange: o, className:
|
|
678
|
+
const o = t.getMonth() + 1, a = t.getDate(), i = t.getFullYear();
|
|
679
|
+
return `${o}/${a}/${i} ${n}:${s < 10 ? "0" + s : s} ${r}`;
|
|
680
|
+
}, Dt = ({ name: t, id: n, checked: s, onClick: r, onChange: o, className: a = "", title: i, disabled: l = !1 }) => /* @__PURE__ */ e(
|
|
681
681
|
"input",
|
|
682
682
|
{
|
|
683
|
-
className: `fm-checkbox ${
|
|
683
|
+
className: `fm-checkbox ${a}`,
|
|
684
684
|
type: "checkbox",
|
|
685
685
|
name: t,
|
|
686
686
|
id: n,
|
|
687
687
|
checked: s,
|
|
688
688
|
onClick: r,
|
|
689
689
|
onChange: o,
|
|
690
|
-
title:
|
|
690
|
+
title: i,
|
|
691
691
|
disabled: l
|
|
692
692
|
}
|
|
693
|
-
), Re = 50,
|
|
693
|
+
), Re = 50, gn = ({
|
|
694
694
|
index: t,
|
|
695
695
|
file: n,
|
|
696
696
|
onCreateFolder: s,
|
|
697
697
|
onRename: r,
|
|
698
698
|
enableFilePreview: o,
|
|
699
|
-
onFileOpen:
|
|
700
|
-
filesViewRef:
|
|
699
|
+
onFileOpen: a,
|
|
700
|
+
filesViewRef: i,
|
|
701
701
|
selectedFileIndexes: l,
|
|
702
702
|
triggerAction: c,
|
|
703
|
-
handleContextMenu:
|
|
703
|
+
handleContextMenu: u,
|
|
704
704
|
setLastSelectedFile: h
|
|
705
705
|
}) => {
|
|
706
|
-
var
|
|
707
|
-
const [
|
|
708
|
-
|
|
709
|
-
}, Ce = (
|
|
710
|
-
if (l.length > 0 &&
|
|
706
|
+
var Q, G, ie, We;
|
|
707
|
+
const [f, w] = b(!1), [T, R] = b(0), [O, M] = b("hidden"), [C, E] = b(""), [F, N] = b(null), { activeLayout: m } = ce(), p = m === "grid" ? 48 : 20, D = Fe(p), { setCurrentPath: y, currentPathFiles: P } = oe(), { setSelectedFiles: x } = le(), { clipBoard: j, handleCutCopy: H, setClipBoard: I, handlePasting: K } = Ne(), Z = re(null), X = Fe(Re), Y = (j == null ? void 0 : j.isMoving) && j.files.find((B) => B.name === n.name && B.path === n.path), de = () => {
|
|
708
|
+
a(n), n.isDirectory ? (y(n.path), x([])) : o && c.show("previewFile");
|
|
709
|
+
}, Ce = (B, ne) => {
|
|
710
|
+
if (l.length > 0 && B) {
|
|
711
711
|
let ae = !1, ue = l[0], he = t;
|
|
712
712
|
if (ue >= he) {
|
|
713
713
|
const Mt = ue;
|
|
714
714
|
ue = he, he = Mt, ae = !0;
|
|
715
715
|
}
|
|
716
|
-
const
|
|
717
|
-
|
|
718
|
-
} else l.length > 0 && ne ?
|
|
716
|
+
const Be = P.slice(ue, he + 1);
|
|
717
|
+
x(ae ? Be.reverse() : Be);
|
|
718
|
+
} else l.length > 0 && ne ? x((ae) => {
|
|
719
719
|
const ue = ae.filter((he) => he.path !== n.path);
|
|
720
720
|
return ae.length === ue.length ? [...ae, n] : ue;
|
|
721
|
-
}) :
|
|
722
|
-
}, d = (
|
|
723
|
-
if (
|
|
724
|
-
Ce(
|
|
721
|
+
}) : x([n]);
|
|
722
|
+
}, d = (B) => {
|
|
723
|
+
if (B.stopPropagation(), n.isEditing) return;
|
|
724
|
+
Ce(B.shiftKey, B.ctrlKey);
|
|
725
725
|
const ne = (/* @__PURE__ */ new Date()).getTime();
|
|
726
|
-
if (ne -
|
|
726
|
+
if (ne - T < 300) {
|
|
727
727
|
de();
|
|
728
728
|
return;
|
|
729
729
|
}
|
|
730
|
-
|
|
731
|
-
}, v = (
|
|
732
|
-
|
|
733
|
-
}, $ = (
|
|
734
|
-
|
|
730
|
+
R(ne);
|
|
731
|
+
}, v = (B) => {
|
|
732
|
+
B.key === "Enter" && (B.stopPropagation(), x([n]), de());
|
|
733
|
+
}, $ = (B) => {
|
|
734
|
+
B.stopPropagation(), B.preventDefault(), !n.isEditing && (f || x([n]), h(n), u(B, !0));
|
|
735
735
|
}, A = () => {
|
|
736
736
|
M("visible");
|
|
737
|
-
},
|
|
738
|
-
!
|
|
739
|
-
},
|
|
740
|
-
|
|
741
|
-
}, k = (
|
|
742
|
-
|
|
743
|
-
}, L = () => I(null),
|
|
744
|
-
|
|
745
|
-
}, _ = (
|
|
746
|
-
|
|
747
|
-
},
|
|
748
|
-
|
|
737
|
+
}, S = () => {
|
|
738
|
+
!f && M("hidden");
|
|
739
|
+
}, W = (B) => {
|
|
740
|
+
B.target.checked ? x((ne) => [...ne, n]) : x((ne) => ne.filter((ae) => ae.name !== n.name && ae.path !== n.path)), w(B.target.checked);
|
|
741
|
+
}, k = (B) => {
|
|
742
|
+
B.dataTransfer.setDragImage(Z.current, 30, 50), B.dataTransfer.effectAllowed = "copy", H(!0);
|
|
743
|
+
}, L = () => I(null), U = (B) => {
|
|
744
|
+
B.preventDefault(), f || !n.isDirectory ? B.dataTransfer.dropEffect = "none" : (N({ x: B.clientX, y: B.clientY + 12 }), B.dataTransfer.dropEffect = "copy", E("file-drop-zone"));
|
|
745
|
+
}, _ = (B) => {
|
|
746
|
+
B.currentTarget.contains(B.relatedTarget) || (E((ne) => ne && ""), N(null));
|
|
747
|
+
}, q = (B) => {
|
|
748
|
+
B.preventDefault(), !(f || !n.isDirectory) && (K(n), E((ne) => ne && ""), N(null));
|
|
749
749
|
};
|
|
750
|
-
return
|
|
750
|
+
return V(() => {
|
|
751
751
|
w(l.includes(t)), M(l.includes(t) ? "visible" : "hidden");
|
|
752
752
|
}, [l]), /* @__PURE__ */ g(
|
|
753
753
|
"div",
|
|
754
754
|
{
|
|
755
|
-
className: `file-item-container ${C} ${
|
|
755
|
+
className: `file-item-container ${C} ${f || n.isEditing ? "file-selected" : ""} ${Y ? "file-moving" : ""}`,
|
|
756
756
|
tabIndex: 0,
|
|
757
757
|
title: n.name,
|
|
758
758
|
onClick: d,
|
|
759
759
|
onKeyDown: v,
|
|
760
760
|
onContextMenu: $,
|
|
761
761
|
onMouseOver: A,
|
|
762
|
-
onMouseLeave:
|
|
763
|
-
draggable:
|
|
762
|
+
onMouseLeave: S,
|
|
763
|
+
draggable: f,
|
|
764
764
|
onDragStart: k,
|
|
765
765
|
onDragEnd: L,
|
|
766
|
-
onDragEnter:
|
|
767
|
-
onDragOver:
|
|
766
|
+
onDragEnter: U,
|
|
767
|
+
onDragOver: U,
|
|
768
768
|
onDragLeave: _,
|
|
769
|
-
onDrop:
|
|
769
|
+
onDrop: q,
|
|
770
770
|
children: [
|
|
771
771
|
/* @__PURE__ */ g("div", { className: "file-item", children: [
|
|
772
772
|
!n.isEditing && /* @__PURE__ */ e(
|
|
@@ -774,25 +774,25 @@ const Ct = ({ isLoading: t }) => {
|
|
|
774
774
|
{
|
|
775
775
|
name: n.name,
|
|
776
776
|
id: n.name,
|
|
777
|
-
checked:
|
|
778
|
-
className: `selection-checkbox ${
|
|
779
|
-
onChange:
|
|
780
|
-
onClick: (
|
|
777
|
+
checked: f,
|
|
778
|
+
className: `selection-checkbox ${O}`,
|
|
779
|
+
onChange: W,
|
|
780
|
+
onClick: (B) => B.stopPropagation()
|
|
781
781
|
}
|
|
782
782
|
),
|
|
783
|
-
n.isDirectory ? /* @__PURE__ */ e(
|
|
783
|
+
n.isDirectory ? /* @__PURE__ */ e(Ve, { size: p }) : /* @__PURE__ */ e(se, { children: D[(G = (Q = n.name) == null ? void 0 : Q.split(".").pop()) == null ? void 0 : G.toLowerCase()] ?? /* @__PURE__ */ e(be, { size: p }) }),
|
|
784
784
|
n.isEditing ? /* @__PURE__ */ e("div", { className: `rename-file-container ${m}`, children: c.actionType === "createFolder" ? /* @__PURE__ */ e(
|
|
785
|
-
|
|
785
|
+
hn,
|
|
786
786
|
{
|
|
787
|
-
filesViewRef:
|
|
787
|
+
filesViewRef: i,
|
|
788
788
|
file: n,
|
|
789
789
|
onCreateFolder: s,
|
|
790
790
|
triggerAction: c
|
|
791
791
|
}
|
|
792
792
|
) : /* @__PURE__ */ e(
|
|
793
|
-
|
|
793
|
+
mn,
|
|
794
794
|
{
|
|
795
|
-
filesViewRef:
|
|
795
|
+
filesViewRef: i,
|
|
796
796
|
file: n,
|
|
797
797
|
onRename: r,
|
|
798
798
|
triggerAction: c
|
|
@@ -800,7 +800,7 @@ const Ct = ({ isLoading: t }) => {
|
|
|
800
800
|
) }) : /* @__PURE__ */ e("span", { className: "text-truncate file-name", children: n.name })
|
|
801
801
|
] }),
|
|
802
802
|
m === "list" && /* @__PURE__ */ g(se, { children: [
|
|
803
|
-
/* @__PURE__ */ e("div", { className: "modified-date", children:
|
|
803
|
+
/* @__PURE__ */ e("div", { className: "modified-date", children: vn(n.updatedAt) }),
|
|
804
804
|
/* @__PURE__ */ e("div", { className: "size", children: (n == null ? void 0 : n.size) > 0 ? Pe(n == null ? void 0 : n.size) : "" })
|
|
805
805
|
] }),
|
|
806
806
|
F && /* @__PURE__ */ g(
|
|
@@ -817,57 +817,57 @@ const Ct = ({ isLoading: t }) => {
|
|
|
817
817
|
]
|
|
818
818
|
}
|
|
819
819
|
),
|
|
820
|
-
/* @__PURE__ */ e("div", { ref:
|
|
820
|
+
/* @__PURE__ */ e("div", { ref: Z, className: "drag-icon", children: n.isDirectory ? /* @__PURE__ */ e(Ve, { size: Re }) : /* @__PURE__ */ e(se, { children: X[(We = (ie = n.name) == null ? void 0 : ie.split(".").pop()) == null ? void 0 : We.toLowerCase()] ?? /* @__PURE__ */ e(be, { size: Re }) }) })
|
|
821
821
|
]
|
|
822
822
|
}
|
|
823
823
|
);
|
|
824
|
-
},
|
|
824
|
+
}, yn = ({ subMenuRef: t, list: n, position: s = "right" }) => /* @__PURE__ */ e("ul", { ref: t, className: `sub-menu ${s}`, children: n == null ? void 0 : n.map((r) => /* @__PURE__ */ g("li", { onClick: r.onClick, children: [
|
|
825
825
|
/* @__PURE__ */ e("span", { className: "item-selected", children: r.selected && /* @__PURE__ */ e(gt, { size: 13 }) }),
|
|
826
826
|
r.icon,
|
|
827
827
|
/* @__PURE__ */ e("span", { children: r.title })
|
|
828
|
-
] }, r.title)) }),
|
|
829
|
-
const [
|
|
830
|
-
const { clickX: C, clickY:
|
|
831
|
-
|
|
832
|
-
},
|
|
828
|
+
] }, r.title)) }), Cn = ({ filesViewRef: t, contextMenuRef: n, menuItems: s, visible: r, clickPosition: o }) => {
|
|
829
|
+
const [a, i] = b(0), [l, c] = b(0), [u, h] = b(null), [f, w] = b("right"), T = re(null), R = () => {
|
|
830
|
+
const { clickX: C, clickY: E } = o, F = t.current, N = F.getBoundingClientRect(), m = F.offsetWidth - F.clientWidth, p = n.current.getBoundingClientRect(), D = p.width, y = p.height, P = C - N.left, x = N.width - (P + m) > D, j = !x, H = E - N.top, I = N.height - H > y, K = !I;
|
|
831
|
+
x ? (i(`${P}px`), w("right")) : j && (i(`${P - D}px`), w("left")), I ? c(`${H + F.scrollTop}px`) : K && c(`${H + F.scrollTop - y}px`);
|
|
832
|
+
}, O = (C) => {
|
|
833
833
|
C.preventDefault(), C.stopPropagation();
|
|
834
834
|
}, M = (C) => {
|
|
835
835
|
h(C);
|
|
836
836
|
};
|
|
837
|
-
if (
|
|
838
|
-
r && n.current ?
|
|
837
|
+
if (V(() => {
|
|
838
|
+
r && n.current ? R() : (c(0), i(0), h(null));
|
|
839
839
|
}, [r]), r)
|
|
840
840
|
return /* @__PURE__ */ e(
|
|
841
841
|
"div",
|
|
842
842
|
{
|
|
843
843
|
ref: n,
|
|
844
|
-
onContextMenu:
|
|
844
|
+
onContextMenu: O,
|
|
845
845
|
onClick: (C) => C.stopPropagation(),
|
|
846
846
|
className: `fm-context-menu ${l ? "visible" : "hidden"}`,
|
|
847
847
|
style: {
|
|
848
848
|
top: l,
|
|
849
|
-
left:
|
|
849
|
+
left: a
|
|
850
850
|
},
|
|
851
|
-
children: /* @__PURE__ */ e("div", { className: "file-context-menu-list", children: /* @__PURE__ */ e("ul", { children: s.filter((C) => !C.hidden).map((C,
|
|
852
|
-
const F = C.hasOwnProperty("children"), N =
|
|
851
|
+
children: /* @__PURE__ */ e("div", { className: "file-context-menu-list", children: /* @__PURE__ */ e("ul", { children: s.filter((C) => !C.hidden).map((C, E) => {
|
|
852
|
+
const F = C.hasOwnProperty("children"), N = u === E && F;
|
|
853
853
|
return /* @__PURE__ */ g("div", { children: [
|
|
854
854
|
/* @__PURE__ */ g(
|
|
855
855
|
"li",
|
|
856
856
|
{
|
|
857
857
|
onClick: C.onClick,
|
|
858
858
|
className: `${C.className ?? ""} ${N ? "active" : ""}`,
|
|
859
|
-
onMouseOver: () => M(
|
|
859
|
+
onMouseOver: () => M(E),
|
|
860
860
|
children: [
|
|
861
861
|
C.icon,
|
|
862
862
|
/* @__PURE__ */ e("span", { children: C.title }),
|
|
863
863
|
F && /* @__PURE__ */ g(se, { children: [
|
|
864
|
-
/* @__PURE__ */ e(
|
|
864
|
+
/* @__PURE__ */ e(Kt, { size: 14, className: "list-expand-icon" }),
|
|
865
865
|
N && /* @__PURE__ */ e(
|
|
866
|
-
|
|
866
|
+
yn,
|
|
867
867
|
{
|
|
868
|
-
subMenuRef:
|
|
868
|
+
subMenuRef: T,
|
|
869
869
|
list: C.children,
|
|
870
|
-
position:
|
|
870
|
+
position: f
|
|
871
871
|
}
|
|
872
872
|
)
|
|
873
873
|
] })
|
|
@@ -879,32 +879,32 @@ const Ct = ({ isLoading: t }) => {
|
|
|
879
879
|
}) }) })
|
|
880
880
|
}
|
|
881
881
|
);
|
|
882
|
-
},
|
|
883
|
-
const [r, o] = b([]), [
|
|
884
|
-
|
|
882
|
+
}, wn = (t, n, s) => {
|
|
883
|
+
const [r, o] = b([]), [a, i] = b(!1), [l, c] = b(!1), [u, h] = b({ clickX: 0, clickY: 0 }), [f, w] = b(null), { clipBoard: T, setClipBoard: R, handleCutCopy: O, handlePasting: M } = Ne(), { selectedFiles: C, setSelectedFiles: E, handleDownload: F } = le(), { currentPath: N, setCurrentPath: m, currentPathFiles: p, setCurrentPathFiles: D } = oe(), { activeLayout: y, setActiveLayout: P } = ce(), x = () => {
|
|
884
|
+
f.isDirectory ? (m(f.path), o([]), E([])) : n && s.show("previewFile"), i(!1);
|
|
885
885
|
}, j = (k) => {
|
|
886
|
-
|
|
886
|
+
O(k), i(!1);
|
|
887
887
|
}, H = () => {
|
|
888
|
-
M(
|
|
888
|
+
M(f), i(!1);
|
|
889
889
|
}, I = () => {
|
|
890
|
-
|
|
891
|
-
},
|
|
892
|
-
F(),
|
|
893
|
-
},
|
|
894
|
-
|
|
890
|
+
i(!1), s.show("rename");
|
|
891
|
+
}, K = () => {
|
|
892
|
+
F(), i(!1);
|
|
893
|
+
}, Z = () => {
|
|
894
|
+
i(!1), s.show("delete");
|
|
895
895
|
}, d = [
|
|
896
896
|
{
|
|
897
897
|
title: "View",
|
|
898
|
-
icon: y === "grid" ? /* @__PURE__ */ e(
|
|
898
|
+
icon: y === "grid" ? /* @__PURE__ */ e(Ue, { size: 18 }) : /* @__PURE__ */ e(we, { size: 18 }),
|
|
899
899
|
onClick: () => {
|
|
900
900
|
},
|
|
901
901
|
children: [
|
|
902
902
|
{
|
|
903
903
|
title: "Grid",
|
|
904
|
-
icon: /* @__PURE__ */ e(
|
|
904
|
+
icon: /* @__PURE__ */ e(Ue, { size: 18 }),
|
|
905
905
|
selected: y === "grid",
|
|
906
906
|
onClick: () => {
|
|
907
|
-
|
|
907
|
+
P("grid"), i(!1);
|
|
908
908
|
}
|
|
909
909
|
},
|
|
910
910
|
{
|
|
@@ -912,7 +912,7 @@ const Ct = ({ isLoading: t }) => {
|
|
|
912
912
|
icon: /* @__PURE__ */ e(we, { size: 18 }),
|
|
913
913
|
selected: y === "list",
|
|
914
914
|
onClick: () => {
|
|
915
|
-
|
|
915
|
+
P("list"), i(!1);
|
|
916
916
|
}
|
|
917
917
|
}
|
|
918
918
|
]
|
|
@@ -921,7 +921,7 @@ const Ct = ({ isLoading: t }) => {
|
|
|
921
921
|
title: "Refresh",
|
|
922
922
|
icon: /* @__PURE__ */ e(ht, { size: 18 }),
|
|
923
923
|
onClick: () => {
|
|
924
|
-
|
|
924
|
+
i(!1), fe(t, "onRefresh"), R(null);
|
|
925
925
|
},
|
|
926
926
|
divider: !0
|
|
927
927
|
},
|
|
@@ -929,29 +929,29 @@ const Ct = ({ isLoading: t }) => {
|
|
|
929
929
|
title: "New folder",
|
|
930
930
|
icon: /* @__PURE__ */ e(ft, { size: 18 }),
|
|
931
931
|
onClick: () => {
|
|
932
|
-
s.show("createFolder"),
|
|
932
|
+
s.show("createFolder"), i(!1);
|
|
933
933
|
}
|
|
934
934
|
},
|
|
935
935
|
{
|
|
936
936
|
title: "Upload",
|
|
937
937
|
icon: /* @__PURE__ */ e(mt, { size: 18 }),
|
|
938
938
|
onClick: () => {
|
|
939
|
-
|
|
939
|
+
i(!1), s.show("uploadFile");
|
|
940
940
|
},
|
|
941
941
|
divider: !0
|
|
942
942
|
},
|
|
943
943
|
{
|
|
944
944
|
title: "Select all",
|
|
945
|
-
icon: /* @__PURE__ */ e(
|
|
945
|
+
icon: /* @__PURE__ */ e(Bt, { size: 18 }),
|
|
946
946
|
onClick: () => {
|
|
947
|
-
|
|
947
|
+
E(p), i(!1);
|
|
948
948
|
}
|
|
949
949
|
}
|
|
950
950
|
], v = [
|
|
951
951
|
{
|
|
952
952
|
title: "Open",
|
|
953
|
-
icon:
|
|
954
|
-
onClick:
|
|
953
|
+
icon: f != null && f.isDirectory ? /* @__PURE__ */ e(Jt, { size: 20 }) : /* @__PURE__ */ e(be, { size: 16 }),
|
|
954
|
+
onClick: x,
|
|
955
955
|
divider: !0
|
|
956
956
|
},
|
|
957
957
|
{
|
|
@@ -963,14 +963,14 @@ const Ct = ({ isLoading: t }) => {
|
|
|
963
963
|
title: "Copy",
|
|
964
964
|
icon: /* @__PURE__ */ e(ut, { strokeWidth: 0.1, size: 17 }),
|
|
965
965
|
onClick: () => j(!1),
|
|
966
|
-
divider: !(
|
|
966
|
+
divider: !(f != null && f.isDirectory)
|
|
967
967
|
},
|
|
968
968
|
{
|
|
969
969
|
title: "Paste",
|
|
970
970
|
icon: /* @__PURE__ */ e(Ie, { size: 18 }),
|
|
971
971
|
onClick: H,
|
|
972
|
-
className: `${
|
|
973
|
-
hidden: !(
|
|
972
|
+
className: `${T ? "" : "disable-paste"}`,
|
|
973
|
+
hidden: !(f != null && f.isDirectory),
|
|
974
974
|
divider: !0
|
|
975
975
|
},
|
|
976
976
|
{
|
|
@@ -981,17 +981,17 @@ const Ct = ({ isLoading: t }) => {
|
|
|
981
981
|
},
|
|
982
982
|
{
|
|
983
983
|
title: "Download",
|
|
984
|
-
icon: /* @__PURE__ */ e(
|
|
985
|
-
onClick:
|
|
986
|
-
hidden:
|
|
984
|
+
icon: /* @__PURE__ */ e(je, { size: 18 }),
|
|
985
|
+
onClick: K,
|
|
986
|
+
hidden: f == null ? void 0 : f.isDirectory
|
|
987
987
|
},
|
|
988
988
|
{
|
|
989
989
|
title: "Delete",
|
|
990
990
|
icon: /* @__PURE__ */ e(pt, { size: 19 }),
|
|
991
|
-
onClick:
|
|
991
|
+
onClick: Z
|
|
992
992
|
}
|
|
993
993
|
], $ = () => {
|
|
994
|
-
|
|
994
|
+
D((k) => [
|
|
995
995
|
...k,
|
|
996
996
|
{
|
|
997
997
|
name: Et("New Folder", !0, k),
|
|
@@ -1002,13 +1002,13 @@ const Ct = ({ isLoading: t }) => {
|
|
|
1002
1002
|
}
|
|
1003
1003
|
]);
|
|
1004
1004
|
}, A = () => {
|
|
1005
|
-
|
|
1006
|
-
},
|
|
1007
|
-
o([]),
|
|
1008
|
-
},
|
|
1009
|
-
k.preventDefault(), h({ clickX: k.clientX, clickY: k.clientY }), c(L), !L &&
|
|
1005
|
+
D((k) => (k[r.at(-1)] && (k[r.at(-1)].isEditing = !0), k)), o([]), E([]);
|
|
1006
|
+
}, S = () => {
|
|
1007
|
+
o([]), E((k) => k.length > 0 ? [] : k);
|
|
1008
|
+
}, W = (k, L = !1) => {
|
|
1009
|
+
k.preventDefault(), h({ clickX: k.clientX, clickY: k.clientY }), c(L), !L && S(), i(!0);
|
|
1010
1010
|
};
|
|
1011
|
-
return
|
|
1011
|
+
return V(() => {
|
|
1012
1012
|
if (s.isActive)
|
|
1013
1013
|
switch (s.actionType) {
|
|
1014
1014
|
case "createFolder":
|
|
@@ -1018,24 +1018,24 @@ const Ct = ({ isLoading: t }) => {
|
|
|
1018
1018
|
A();
|
|
1019
1019
|
break;
|
|
1020
1020
|
}
|
|
1021
|
-
}, [s.isActive]),
|
|
1022
|
-
o([]),
|
|
1023
|
-
}, [N]),
|
|
1021
|
+
}, [s.isActive]), V(() => {
|
|
1022
|
+
o([]), E([]);
|
|
1023
|
+
}, [N]), V(() => {
|
|
1024
1024
|
C.length > 0 ? o(() => C.map((k) => p.findIndex((L) => L.path === k.path))) : o([]);
|
|
1025
1025
|
}, [C, p]), {
|
|
1026
1026
|
emptySelecCtxItems: d,
|
|
1027
1027
|
selecCtxItems: v,
|
|
1028
|
-
handleContextMenu:
|
|
1029
|
-
unselectFiles:
|
|
1030
|
-
visible:
|
|
1031
|
-
setVisible:
|
|
1028
|
+
handleContextMenu: W,
|
|
1029
|
+
unselectFiles: S,
|
|
1030
|
+
visible: a,
|
|
1031
|
+
setVisible: i,
|
|
1032
1032
|
setLastSelectedFile: w,
|
|
1033
1033
|
selectedFileIndexes: r,
|
|
1034
|
-
clickPosition:
|
|
1034
|
+
clickPosition: u,
|
|
1035
1035
|
isSelectionCtx: l
|
|
1036
1036
|
};
|
|
1037
|
-
},
|
|
1038
|
-
const [n, s] = b(!1), { selectedFiles: r, setSelectedFiles: o } = le(), { currentPathFiles:
|
|
1037
|
+
}, bn = ({ unselectFiles: t }) => {
|
|
1038
|
+
const [n, s] = b(!1), { selectedFiles: r, setSelectedFiles: o } = le(), { currentPathFiles: a } = oe(), i = $e(() => a.length > 0 && r.length === a.length, [r, a]);
|
|
1039
1039
|
return /* @__PURE__ */ g(
|
|
1040
1040
|
"div",
|
|
1041
1041
|
{
|
|
@@ -1043,46 +1043,46 @@ const Ct = ({ isLoading: t }) => {
|
|
|
1043
1043
|
onMouseOver: () => s(!0),
|
|
1044
1044
|
onMouseLeave: () => s(!1),
|
|
1045
1045
|
children: [
|
|
1046
|
-
/* @__PURE__ */ e("div", { className: "file-select-all", children: (n ||
|
|
1047
|
-
c.target.checked ? (o(
|
|
1048
|
-
}, title: "Select all", disabled:
|
|
1046
|
+
/* @__PURE__ */ e("div", { className: "file-select-all", children: (n || i) && /* @__PURE__ */ e(Dt, { checked: i, onChange: (c) => {
|
|
1047
|
+
c.target.checked ? (o(a), s(!0)) : t();
|
|
1048
|
+
}, title: "Select all", disabled: a.length === 0 }) }),
|
|
1049
1049
|
/* @__PURE__ */ e("div", { className: "file-name", children: "Name" }),
|
|
1050
1050
|
/* @__PURE__ */ e("div", { className: "file-date", children: "Modified" }),
|
|
1051
1051
|
/* @__PURE__ */ e("div", { className: "file-size", children: "Size" })
|
|
1052
1052
|
]
|
|
1053
1053
|
}
|
|
1054
1054
|
);
|
|
1055
|
-
},
|
|
1055
|
+
}, Fn = ({
|
|
1056
1056
|
onCreateFolder: t,
|
|
1057
1057
|
onRename: n,
|
|
1058
1058
|
onFileOpen: s,
|
|
1059
1059
|
onRefresh: r,
|
|
1060
1060
|
enableFilePreview: o,
|
|
1061
|
-
triggerAction:
|
|
1061
|
+
triggerAction: a
|
|
1062
1062
|
}) => {
|
|
1063
|
-
const { currentPathFiles:
|
|
1064
|
-
emptySelecCtxItems:
|
|
1063
|
+
const { currentPathFiles: i } = oe(), l = re(null), { activeLayout: c } = ce(), {
|
|
1064
|
+
emptySelecCtxItems: u,
|
|
1065
1065
|
selecCtxItems: h,
|
|
1066
|
-
handleContextMenu:
|
|
1066
|
+
handleContextMenu: f,
|
|
1067
1067
|
unselectFiles: w,
|
|
1068
|
-
visible:
|
|
1069
|
-
setVisible:
|
|
1070
|
-
setLastSelectedFile:
|
|
1068
|
+
visible: T,
|
|
1069
|
+
setVisible: R,
|
|
1070
|
+
setLastSelectedFile: O,
|
|
1071
1071
|
selectedFileIndexes: M,
|
|
1072
1072
|
clickPosition: C,
|
|
1073
|
-
isSelectionCtx:
|
|
1074
|
-
} =
|
|
1073
|
+
isSelectionCtx: E
|
|
1074
|
+
} = wn(r, o, a), F = ye(() => R(!1));
|
|
1075
1075
|
return /* @__PURE__ */ g(
|
|
1076
1076
|
"div",
|
|
1077
1077
|
{
|
|
1078
1078
|
ref: l,
|
|
1079
1079
|
className: `files ${c}`,
|
|
1080
|
-
onContextMenu:
|
|
1080
|
+
onContextMenu: f,
|
|
1081
1081
|
onClick: w,
|
|
1082
1082
|
children: [
|
|
1083
|
-
c === "list" && /* @__PURE__ */ e(
|
|
1084
|
-
(
|
|
1085
|
-
|
|
1083
|
+
c === "list" && /* @__PURE__ */ e(bn, { unselectFiles: w }),
|
|
1084
|
+
(i == null ? void 0 : i.length) > 0 ? /* @__PURE__ */ e(se, { children: i.map((N, m) => /* @__PURE__ */ e(
|
|
1085
|
+
gn,
|
|
1086
1086
|
{
|
|
1087
1087
|
index: m,
|
|
1088
1088
|
file: N,
|
|
@@ -1090,32 +1090,32 @@ const Ct = ({ isLoading: t }) => {
|
|
|
1090
1090
|
onRename: n,
|
|
1091
1091
|
onFileOpen: s,
|
|
1092
1092
|
enableFilePreview: o,
|
|
1093
|
-
triggerAction:
|
|
1093
|
+
triggerAction: a,
|
|
1094
1094
|
filesViewRef: l,
|
|
1095
1095
|
selectedFileIndexes: M,
|
|
1096
|
-
handleContextMenu:
|
|
1097
|
-
setVisible:
|
|
1098
|
-
setLastSelectedFile:
|
|
1096
|
+
handleContextMenu: f,
|
|
1097
|
+
setVisible: R,
|
|
1098
|
+
setLastSelectedFile: O
|
|
1099
1099
|
},
|
|
1100
1100
|
m
|
|
1101
1101
|
)) }) : /* @__PURE__ */ e("div", { className: "empty-folder", children: "This folder is empty." }),
|
|
1102
1102
|
/* @__PURE__ */ e(
|
|
1103
|
-
|
|
1103
|
+
Cn,
|
|
1104
1104
|
{
|
|
1105
1105
|
filesViewRef: l,
|
|
1106
1106
|
contextMenuRef: F.ref,
|
|
1107
|
-
menuItems:
|
|
1108
|
-
visible:
|
|
1109
|
-
setVisible:
|
|
1107
|
+
menuItems: E ? h : u,
|
|
1108
|
+
visible: T,
|
|
1109
|
+
setVisible: R,
|
|
1110
1110
|
clickPosition: C
|
|
1111
1111
|
}
|
|
1112
1112
|
)
|
|
1113
1113
|
]
|
|
1114
1114
|
}
|
|
1115
1115
|
);
|
|
1116
|
-
},
|
|
1117
|
-
const [s, r] = b(""), { selectedFiles: o, setSelectedFiles:
|
|
1118
|
-
return
|
|
1116
|
+
}, kn = ({ triggerAction: t, onDelete: n }) => {
|
|
1117
|
+
const [s, r] = b(""), { selectedFiles: o, setSelectedFiles: a } = le();
|
|
1118
|
+
return V(() => {
|
|
1119
1119
|
r(() => {
|
|
1120
1120
|
if (o.length === 1)
|
|
1121
1121
|
return `Are you sure you want to delete "${o[0].name}"?`;
|
|
@@ -1127,24 +1127,24 @@ const Ct = ({ isLoading: t }) => {
|
|
|
1127
1127
|
/* @__PURE__ */ g("div", { className: "file-delete-confirm-actions", children: [
|
|
1128
1128
|
/* @__PURE__ */ e(me, { type: "secondary", onClick: () => t.close(), children: "Cancel" }),
|
|
1129
1129
|
/* @__PURE__ */ e(me, { type: "danger", onClick: () => {
|
|
1130
|
-
n(o),
|
|
1130
|
+
n(o), a([]), t.close();
|
|
1131
1131
|
}, children: "Delete" })
|
|
1132
1132
|
] })
|
|
1133
1133
|
] });
|
|
1134
|
-
},
|
|
1134
|
+
}, Nn = ({ percent: t = 0, isCanceled: n = !1, isCompleted: s = !1, error: r }) => /* @__PURE__ */ g("div", { role: "progressbar", className: "fm-progress", children: [
|
|
1135
1135
|
!r && /* @__PURE__ */ e("div", { className: "fm-progress-bar", children: /* @__PURE__ */ e("div", { className: "fm-progress-bar-fill", style: { width: `${t}%` } }) }),
|
|
1136
1136
|
n ? /* @__PURE__ */ e("span", { className: "fm-upload-canceled", children: "Canceled" }) : r ? /* @__PURE__ */ e("span", { className: "fm-upload-canceled", children: r }) : /* @__PURE__ */ e("div", { className: "fm-progress-status", children: /* @__PURE__ */ e("span", { children: s ? "Completed" : t + "% done" }) })
|
|
1137
|
-
] }),
|
|
1137
|
+
] }), Pn = ({
|
|
1138
1138
|
index: t,
|
|
1139
1139
|
fileData: n,
|
|
1140
1140
|
setFiles: s,
|
|
1141
1141
|
setIsUploading: r,
|
|
1142
1142
|
fileUploadConfig: o,
|
|
1143
|
-
onFileUploaded:
|
|
1144
|
-
handleFileRemove:
|
|
1143
|
+
onFileUploaded: a,
|
|
1144
|
+
handleFileRemove: i
|
|
1145
1145
|
}) => {
|
|
1146
|
-
var p,
|
|
1147
|
-
const [l, c] = b(0), [
|
|
1146
|
+
var p, D, y, P;
|
|
1147
|
+
const [l, c] = b(0), [u, h] = b(!1), [f, w] = b(!1), [T, R] = b(!1), O = Fe(33), M = re(), { onError: C } = ke(), E = (x) => {
|
|
1148
1148
|
c(0), r((H) => ({
|
|
1149
1149
|
...H,
|
|
1150
1150
|
[t]: !1
|
|
@@ -1153,100 +1153,100 @@ const Ct = ({ isLoading: t }) => {
|
|
|
1153
1153
|
type: "upload",
|
|
1154
1154
|
message: "Upload failed.",
|
|
1155
1155
|
response: {
|
|
1156
|
-
status:
|
|
1157
|
-
statusText:
|
|
1158
|
-
data:
|
|
1156
|
+
status: x.status,
|
|
1157
|
+
statusText: x.statusText,
|
|
1158
|
+
data: x.response
|
|
1159
1159
|
}
|
|
1160
1160
|
};
|
|
1161
1161
|
s(
|
|
1162
|
-
(H) => H.map((I,
|
|
1162
|
+
(H) => H.map((I, K) => t === K ? {
|
|
1163
1163
|
...I,
|
|
1164
1164
|
error: j.message
|
|
1165
1165
|
} : I)
|
|
1166
|
-
),
|
|
1167
|
-
}, F = (
|
|
1168
|
-
if (!
|
|
1166
|
+
), R(!0), C(j, n.file);
|
|
1167
|
+
}, F = (x) => {
|
|
1168
|
+
if (!x.error)
|
|
1169
1169
|
return new Promise((j, H) => {
|
|
1170
1170
|
const I = new XMLHttpRequest();
|
|
1171
|
-
M.current = I, r((
|
|
1172
|
-
...
|
|
1171
|
+
M.current = I, r((Y) => ({
|
|
1172
|
+
...Y,
|
|
1173
1173
|
[t]: !0
|
|
1174
|
-
})), I.upload.onprogress = (
|
|
1175
|
-
if (
|
|
1176
|
-
const de = Math.round(
|
|
1174
|
+
})), I.upload.onprogress = (Y) => {
|
|
1175
|
+
if (Y.lengthComputable) {
|
|
1176
|
+
const de = Math.round(Y.loaded / Y.total * 100);
|
|
1177
1177
|
c(de);
|
|
1178
1178
|
}
|
|
1179
1179
|
}, I.onload = () => {
|
|
1180
|
-
r((
|
|
1181
|
-
...
|
|
1180
|
+
r((Y) => ({
|
|
1181
|
+
...Y,
|
|
1182
1182
|
[t]: !1
|
|
1183
|
-
})), I.status === 200 || I.status === 201 ? (h(!0),
|
|
1183
|
+
})), I.status === 200 || I.status === 201 ? (h(!0), a(I.response), j(I.response)) : (H(I.statusText), E(I));
|
|
1184
1184
|
}, I.onerror = () => {
|
|
1185
|
-
H(I.statusText),
|
|
1185
|
+
H(I.statusText), E(I);
|
|
1186
1186
|
}, I.open("POST", o == null ? void 0 : o.url, !0);
|
|
1187
|
-
const
|
|
1188
|
-
for (let
|
|
1189
|
-
I.setRequestHeader(
|
|
1190
|
-
const
|
|
1191
|
-
for (let
|
|
1192
|
-
X[
|
|
1193
|
-
|
|
1187
|
+
const K = o == null ? void 0 : o.headers;
|
|
1188
|
+
for (let Y in K)
|
|
1189
|
+
I.setRequestHeader(Y, K[Y]);
|
|
1190
|
+
const Z = new FormData(), X = x == null ? void 0 : x.appendData;
|
|
1191
|
+
for (let Y in X)
|
|
1192
|
+
X[Y] && Z.append(Y, X[Y]);
|
|
1193
|
+
Z.append("file", x.file), I.send(Z);
|
|
1194
1194
|
});
|
|
1195
1195
|
};
|
|
1196
|
-
|
|
1196
|
+
V(() => {
|
|
1197
1197
|
M.current || F(n);
|
|
1198
1198
|
}, []);
|
|
1199
1199
|
const N = () => {
|
|
1200
|
-
M.current && (M.current.abort(), r((
|
|
1201
|
-
...
|
|
1200
|
+
M.current && (M.current.abort(), r((x) => ({
|
|
1201
|
+
...x,
|
|
1202
1202
|
[t]: !1
|
|
1203
1203
|
})), w(!0), c(0));
|
|
1204
1204
|
}, m = () => {
|
|
1205
1205
|
n != null && n.file && (s(
|
|
1206
|
-
(
|
|
1206
|
+
(x) => x.map((j, H) => t === H ? {
|
|
1207
1207
|
...j,
|
|
1208
1208
|
error: !1
|
|
1209
1209
|
} : j)
|
|
1210
|
-
), F({ ...n, error: !1 }), w(!1),
|
|
1210
|
+
), F({ ...n, error: !1 }), w(!1), R(!1));
|
|
1211
1211
|
};
|
|
1212
1212
|
return n.removed ? null : /* @__PURE__ */ g("li", { children: [
|
|
1213
|
-
/* @__PURE__ */ e("div", { className: "file-icon", children:
|
|
1213
|
+
/* @__PURE__ */ e("div", { className: "file-icon", children: O[pe((p = n.file) == null ? void 0 : p.name)] ?? /* @__PURE__ */ e(be, { size: 33 }) }),
|
|
1214
1214
|
/* @__PURE__ */ g("div", { className: "file", children: [
|
|
1215
1215
|
/* @__PURE__ */ g("div", { className: "file-details", children: [
|
|
1216
1216
|
/* @__PURE__ */ g("div", { className: "file-info", children: [
|
|
1217
|
-
/* @__PURE__ */ e("span", { className: "file-name text-truncate", title: (
|
|
1218
|
-
/* @__PURE__ */ e("span", { className: "file-size", children: Pe((
|
|
1217
|
+
/* @__PURE__ */ e("span", { className: "file-name text-truncate", title: (D = n.file) == null ? void 0 : D.name, children: (y = n.file) == null ? void 0 : y.name }),
|
|
1218
|
+
/* @__PURE__ */ e("span", { className: "file-size", children: Pe((P = n.file) == null ? void 0 : P.size) })
|
|
1219
1219
|
] }),
|
|
1220
|
-
|
|
1220
|
+
u ? /* @__PURE__ */ e(Vt, { title: "Uploaded", className: "upload-success" }) : f || T ? /* @__PURE__ */ e(en, { className: "retry-upload", title: "Retry", onClick: m }) : /* @__PURE__ */ e(
|
|
1221
1221
|
"div",
|
|
1222
1222
|
{
|
|
1223
1223
|
className: "rm-file",
|
|
1224
1224
|
title: `${n.error ? "Remove" : "Abort Upload"}`,
|
|
1225
|
-
onClick: n.error ? () =>
|
|
1226
|
-
children: /* @__PURE__ */ e(
|
|
1225
|
+
onClick: n.error ? () => i(t) : N,
|
|
1226
|
+
children: /* @__PURE__ */ e(Zt, {})
|
|
1227
1227
|
}
|
|
1228
1228
|
)
|
|
1229
1229
|
] }),
|
|
1230
1230
|
/* @__PURE__ */ e(
|
|
1231
|
-
|
|
1231
|
+
Nn,
|
|
1232
1232
|
{
|
|
1233
1233
|
percent: l,
|
|
1234
|
-
isCanceled:
|
|
1235
|
-
isCompleted:
|
|
1234
|
+
isCanceled: f,
|
|
1235
|
+
isCompleted: u,
|
|
1236
1236
|
error: n.error
|
|
1237
1237
|
}
|
|
1238
1238
|
)
|
|
1239
1239
|
] })
|
|
1240
1240
|
] });
|
|
1241
|
-
},
|
|
1241
|
+
}, En = ({
|
|
1242
1242
|
fileUploadConfig: t,
|
|
1243
1243
|
maxFileSize: n,
|
|
1244
1244
|
acceptedFileTypes: s,
|
|
1245
1245
|
onFileUploading: r,
|
|
1246
1246
|
onFileUploaded: o
|
|
1247
1247
|
}) => {
|
|
1248
|
-
const [
|
|
1249
|
-
m.key === "Enter" &&
|
|
1248
|
+
const [a, i] = b([]), [l, c] = b(!1), [u, h] = b({}), { currentFolder: f, currentPathFiles: w } = oe(), { onError: T } = ke(), R = re(null), O = (m) => {
|
|
1249
|
+
m.key === "Enter" && R.current.click();
|
|
1250
1250
|
}, M = (m) => {
|
|
1251
1251
|
if (s && !s.includes(pe(m.name)))
|
|
1252
1252
|
return "File type is not allowed.";
|
|
@@ -1256,19 +1256,19 @@ const Ct = ({ isLoading: t }) => {
|
|
|
1256
1256
|
if (n && m.size > n) return `Maximum upload size is ${Pe(n, 0)}.`;
|
|
1257
1257
|
}, C = (m) => {
|
|
1258
1258
|
if (m = m.filter(
|
|
1259
|
-
(p) => !
|
|
1259
|
+
(p) => !a.some((D) => D.file.name.toLowerCase() === p.name.toLowerCase())
|
|
1260
1260
|
), m.length > 0) {
|
|
1261
|
-
const p = m.map((
|
|
1262
|
-
const y = r(
|
|
1263
|
-
return
|
|
1264
|
-
file:
|
|
1261
|
+
const p = m.map((D) => {
|
|
1262
|
+
const y = r(D, f), P = M(D);
|
|
1263
|
+
return P && T({ type: "upload", message: P }, D), {
|
|
1264
|
+
file: D,
|
|
1265
1265
|
appendData: y,
|
|
1266
|
-
...
|
|
1266
|
+
...P && { error: P }
|
|
1267
1267
|
};
|
|
1268
1268
|
});
|
|
1269
|
-
|
|
1269
|
+
i((D) => [...D, ...p]);
|
|
1270
1270
|
}
|
|
1271
|
-
},
|
|
1271
|
+
}, E = (m) => {
|
|
1272
1272
|
m.preventDefault(), c(!1);
|
|
1273
1273
|
const p = Array.from(m.dataTransfer.files);
|
|
1274
1274
|
C(p);
|
|
@@ -1276,36 +1276,36 @@ const Ct = ({ isLoading: t }) => {
|
|
|
1276
1276
|
const p = Array.from(m.target.files);
|
|
1277
1277
|
C(p);
|
|
1278
1278
|
}, N = (m) => {
|
|
1279
|
-
|
|
1280
|
-
const
|
|
1279
|
+
i((p) => {
|
|
1280
|
+
const D = p.map((y, P) => m === P ? {
|
|
1281
1281
|
...y,
|
|
1282
1282
|
removed: !0
|
|
1283
1283
|
} : y);
|
|
1284
|
-
return
|
|
1284
|
+
return D.every((y) => !!y.removed) ? [] : D;
|
|
1285
1285
|
});
|
|
1286
1286
|
};
|
|
1287
|
-
return /* @__PURE__ */ g("div", { className: `fm-upload-file ${
|
|
1287
|
+
return /* @__PURE__ */ g("div", { className: `fm-upload-file ${a.length > 0 ? "file-selcted" : ""}`, children: [
|
|
1288
1288
|
/* @__PURE__ */ g("div", { className: "select-files", children: [
|
|
1289
1289
|
/* @__PURE__ */ e(
|
|
1290
1290
|
"div",
|
|
1291
1291
|
{
|
|
1292
1292
|
className: `draggable-file-input ${l ? "dragging" : ""}`,
|
|
1293
|
-
onDrop:
|
|
1293
|
+
onDrop: E,
|
|
1294
1294
|
onDragOver: (m) => m.preventDefault(),
|
|
1295
1295
|
onDragEnter: () => c(!0),
|
|
1296
1296
|
onDragLeave: () => c(!1),
|
|
1297
1297
|
children: /* @__PURE__ */ g("div", { className: "input-text", children: [
|
|
1298
|
-
/* @__PURE__ */ e(
|
|
1298
|
+
/* @__PURE__ */ e(Qt, { size: 30 }),
|
|
1299
1299
|
/* @__PURE__ */ e("span", { children: "Drag files to upload" })
|
|
1300
1300
|
] })
|
|
1301
1301
|
}
|
|
1302
1302
|
),
|
|
1303
|
-
/* @__PURE__ */ e("div", { className: "btn-choose-file", children: /* @__PURE__ */ g(me, { padding: "0", onKeyDown:
|
|
1303
|
+
/* @__PURE__ */ e("div", { className: "btn-choose-file", children: /* @__PURE__ */ g(me, { padding: "0", onKeyDown: O, children: [
|
|
1304
1304
|
/* @__PURE__ */ e("label", { htmlFor: "chooseFile", children: "Choose File" }),
|
|
1305
1305
|
/* @__PURE__ */ e(
|
|
1306
1306
|
"input",
|
|
1307
1307
|
{
|
|
1308
|
-
ref:
|
|
1308
|
+
ref: R,
|
|
1309
1309
|
type: "file",
|
|
1310
1310
|
id: "chooseFile",
|
|
1311
1311
|
className: "choose-file-input",
|
|
@@ -1316,17 +1316,17 @@ const Ct = ({ isLoading: t }) => {
|
|
|
1316
1316
|
)
|
|
1317
1317
|
] }) })
|
|
1318
1318
|
] }),
|
|
1319
|
-
|
|
1320
|
-
/* @__PURE__ */ e("div", { className: "heading", children: Object.values(
|
|
1319
|
+
a.length > 0 && /* @__PURE__ */ g("div", { className: "files-progress", children: [
|
|
1320
|
+
/* @__PURE__ */ e("div", { className: "heading", children: Object.values(u).some((m) => m) ? /* @__PURE__ */ g(se, { children: [
|
|
1321
1321
|
/* @__PURE__ */ e("h2", { children: "Uploading" }),
|
|
1322
|
-
/* @__PURE__ */ e(
|
|
1322
|
+
/* @__PURE__ */ e(lt, { type: "cylon", color: "black", height: 18, width: 20 })
|
|
1323
1323
|
] }) : /* @__PURE__ */ e("h2", { children: "Completed" }) }),
|
|
1324
|
-
/* @__PURE__ */ e("ul", { children:
|
|
1325
|
-
|
|
1324
|
+
/* @__PURE__ */ e("ul", { children: a.map((m, p) => /* @__PURE__ */ e(
|
|
1325
|
+
Pn,
|
|
1326
1326
|
{
|
|
1327
1327
|
index: p,
|
|
1328
1328
|
fileData: m,
|
|
1329
|
-
setFiles:
|
|
1329
|
+
setFiles: i,
|
|
1330
1330
|
fileUploadConfig: t,
|
|
1331
1331
|
setIsUploading: h,
|
|
1332
1332
|
onFileUploaded: o,
|
|
@@ -1336,76 +1336,79 @@ const Ct = ({ isLoading: t }) => {
|
|
|
1336
1336
|
)) })
|
|
1337
1337
|
] })
|
|
1338
1338
|
] });
|
|
1339
|
-
},
|
|
1340
|
-
var
|
|
1341
|
-
const [
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1339
|
+
}, Je = ["jpg", "jpeg", "png"], Ze = ["mp4", "mov", "avi"], Qe = ["mp3", "wav", "m4a"], et = ["txt", "pdf"], Rn = ({ filePreviewPath: t, filePreviewComponent: n }) => {
|
|
1340
|
+
var R;
|
|
1341
|
+
const [s, r] = b(!0), [o, a] = b(!1), { selectedFiles: i } = le(), l = Fe(73), c = (R = pe(i[0].name)) == null ? void 0 : R.toLowerCase(), u = `${t}${i[0].path}`, h = $e(
|
|
1342
|
+
() => n == null ? void 0 : n(i[0]),
|
|
1343
|
+
[n]
|
|
1344
|
+
), f = () => {
|
|
1345
|
+
r(!1), a(!1);
|
|
1346
|
+
}, w = () => {
|
|
1347
|
+
r(!1), a(!0);
|
|
1348
|
+
}, T = () => {
|
|
1349
|
+
window.location.href = u;
|
|
1347
1350
|
};
|
|
1348
|
-
return /* @__PURE__ */ g("section", { className: `file-previewer ${
|
|
1349
|
-
|
|
1350
|
-
...Ge,
|
|
1351
|
+
return Lt.isValidElement(h) ? h : /* @__PURE__ */ g("section", { className: `file-previewer ${c === "pdf" ? "pdf-previewer" : ""}`, children: [
|
|
1352
|
+
o || ![
|
|
1351
1353
|
...Je,
|
|
1352
1354
|
...Ze,
|
|
1353
|
-
...Qe
|
|
1354
|
-
|
|
1355
|
-
|
|
1355
|
+
...Qe,
|
|
1356
|
+
...et
|
|
1357
|
+
].includes(c) && /* @__PURE__ */ g("div", { className: "preview-error", children: [
|
|
1358
|
+
/* @__PURE__ */ e("span", { className: "error-icon", children: l[c] ?? /* @__PURE__ */ e(Xt, { size: 73 }) }),
|
|
1356
1359
|
/* @__PURE__ */ e("span", { className: "error-msg", children: "Sorry! Preview is not available for this file." }),
|
|
1357
1360
|
/* @__PURE__ */ g("div", { className: "file-info", children: [
|
|
1358
1361
|
/* @__PURE__ */ e("span", { className: "file-name", children: i[0].name }),
|
|
1359
1362
|
i[0].size && /* @__PURE__ */ e("span", { children: "-" }),
|
|
1360
1363
|
/* @__PURE__ */ e("span", { className: "file-size", children: Pe(i[0].size) })
|
|
1361
1364
|
] }),
|
|
1362
|
-
/* @__PURE__ */ e(me, { onClick:
|
|
1363
|
-
/* @__PURE__ */ e(
|
|
1365
|
+
/* @__PURE__ */ e(me, { onClick: T, padding: "0.45rem .9rem", children: /* @__PURE__ */ g("div", { className: "download-btn", children: [
|
|
1366
|
+
/* @__PURE__ */ e(je, { size: 18 }),
|
|
1364
1367
|
/* @__PURE__ */ e("span", { children: "Download" })
|
|
1365
1368
|
] }) })
|
|
1366
1369
|
] }),
|
|
1367
|
-
|
|
1368
|
-
/* @__PURE__ */ e(Ct, { isLoading:
|
|
1370
|
+
Je.includes(c) && /* @__PURE__ */ g(se, { children: [
|
|
1371
|
+
/* @__PURE__ */ e(Ct, { isLoading: s }),
|
|
1369
1372
|
/* @__PURE__ */ e(
|
|
1370
1373
|
"img",
|
|
1371
1374
|
{
|
|
1372
|
-
src:
|
|
1375
|
+
src: u,
|
|
1373
1376
|
alt: "Preview Unavailable",
|
|
1374
|
-
className: `photo-popup-image ${
|
|
1377
|
+
className: `photo-popup-image ${s ? "img-loading" : ""}`,
|
|
1375
1378
|
onLoad: f,
|
|
1376
|
-
onError:
|
|
1379
|
+
onError: w,
|
|
1377
1380
|
loading: "lazy"
|
|
1378
1381
|
}
|
|
1379
1382
|
)
|
|
1380
1383
|
] }),
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
+
Ze.includes(c) && /* @__PURE__ */ e("video", { src: u, className: "video-preview", controls: !0, autoPlay: !0 }),
|
|
1385
|
+
Qe.includes(c) && /* @__PURE__ */ e("audio", { src: u, controls: !0, autoPlay: !0, className: "audio-preview" }),
|
|
1386
|
+
et.includes(c) && /* @__PURE__ */ e(se, { children: /* @__PURE__ */ e(
|
|
1384
1387
|
"iframe",
|
|
1385
1388
|
{
|
|
1386
|
-
src:
|
|
1389
|
+
src: u,
|
|
1387
1390
|
onLoad: f,
|
|
1388
|
-
onError:
|
|
1391
|
+
onError: w,
|
|
1389
1392
|
frameBorder: "0",
|
|
1390
|
-
className: `photo-popup-iframe ${
|
|
1393
|
+
className: `photo-popup-iframe ${s ? "img-loading" : ""}`
|
|
1391
1394
|
}
|
|
1392
1395
|
) })
|
|
1393
1396
|
] });
|
|
1394
|
-
}, xe = (t) => t.toLowerCase(),
|
|
1395
|
-
const r = re(/* @__PURE__ */ new Set([])), o =
|
|
1397
|
+
}, xe = (t) => t.toLowerCase(), ee = (t, n, s = !1) => {
|
|
1398
|
+
const r = re(/* @__PURE__ */ new Set([])), o = $e(() => new Set(t.map((c) => xe(c))), [t]), a = (c) => {
|
|
1396
1399
|
if (!c.repeat && (r.current.add(xe(c.key)), o.isSubsetOf(r.current) && !s)) {
|
|
1397
1400
|
c.preventDefault(), n(c);
|
|
1398
1401
|
return;
|
|
1399
1402
|
}
|
|
1400
|
-
},
|
|
1403
|
+
}, i = (c) => {
|
|
1401
1404
|
r.current.delete(xe(c.key));
|
|
1402
1405
|
}, l = () => {
|
|
1403
1406
|
r.current.clear();
|
|
1404
1407
|
};
|
|
1405
|
-
|
|
1406
|
-
window.removeEventListener("keydown",
|
|
1408
|
+
V(() => (window.addEventListener("keydown", a), window.addEventListener("keyup", i), window.addEventListener("blur", l), () => {
|
|
1409
|
+
window.removeEventListener("keydown", a), window.removeEventListener("keyup", i), window.removeEventListener("blur", l);
|
|
1407
1410
|
}), [o, n, s]);
|
|
1408
|
-
},
|
|
1411
|
+
}, te = {
|
|
1409
1412
|
createFolder: ["Alt", "Shift", "N"],
|
|
1410
1413
|
uploadFiles: ["Control", "U"],
|
|
1411
1414
|
cut: ["Control", "X"],
|
|
@@ -1427,61 +1430,62 @@ const Ct = ({ isLoading: t }) => {
|
|
|
1427
1430
|
// Act as Ctrl + Shift + 2 but could cause problems for QWERTZ or DVORAK etc. keyborad layouts.
|
|
1428
1431
|
refresh: ["F5"],
|
|
1429
1432
|
clearSelection: ["Escape"]
|
|
1430
|
-
},
|
|
1431
|
-
const { setClipBoard: s, handleCutCopy: r, handlePasting: o } = Ne(), { currentFolder:
|
|
1433
|
+
}, xn = (t, n) => {
|
|
1434
|
+
const { setClipBoard: s, handleCutCopy: r, handlePasting: o } = Ne(), { currentFolder: a, currentPathFiles: i } = oe(), { setSelectedFiles: l, handleDownload: c } = le(), { setActiveLayout: u } = ce(), h = () => {
|
|
1432
1435
|
t.show("createFolder");
|
|
1433
|
-
},
|
|
1436
|
+
}, f = () => {
|
|
1434
1437
|
t.show("uploadFile");
|
|
1435
1438
|
}, w = () => {
|
|
1436
1439
|
r(!0);
|
|
1437
|
-
},
|
|
1440
|
+
}, T = () => {
|
|
1438
1441
|
r(!1);
|
|
1439
|
-
},
|
|
1440
|
-
o(
|
|
1441
|
-
},
|
|
1442
|
+
}, R = () => {
|
|
1443
|
+
o(a);
|
|
1444
|
+
}, O = () => {
|
|
1442
1445
|
t.show("rename");
|
|
1443
1446
|
}, M = () => {
|
|
1444
1447
|
c();
|
|
1445
1448
|
}, C = () => {
|
|
1446
1449
|
t.show("delete");
|
|
1447
|
-
},
|
|
1448
|
-
|
|
1450
|
+
}, E = () => {
|
|
1451
|
+
i.length > 0 && l([i[0]]);
|
|
1449
1452
|
}, F = () => {
|
|
1450
|
-
|
|
1453
|
+
i.length > 0 && l([i.at(-1)]);
|
|
1451
1454
|
}, N = () => {
|
|
1452
|
-
l(
|
|
1455
|
+
l(i);
|
|
1453
1456
|
}, m = () => {
|
|
1454
|
-
l((
|
|
1457
|
+
l((P) => P.length > 0 ? [] : P);
|
|
1455
1458
|
}, p = () => {
|
|
1456
1459
|
fe(n, "onRefresh"), s(null);
|
|
1457
|
-
},
|
|
1458
|
-
|
|
1460
|
+
}, D = () => {
|
|
1461
|
+
u("grid");
|
|
1459
1462
|
}, y = () => {
|
|
1460
|
-
|
|
1463
|
+
u("list");
|
|
1461
1464
|
};
|
|
1462
|
-
|
|
1463
|
-
},
|
|
1465
|
+
ee(te.createFolder, h, t.isActive), ee(te.uploadFiles, f, t.isActive), ee(te.cut, w, t.isActive), ee(te.copy, T, t.isActive), ee(te.paste, R, t.isActive), ee(te.rename, O, t.isActive), ee(te.download, M, t.isActive), ee(te.delete, C, t.isActive), ee(te.jumpToFirst, E, t.isActive), ee(te.jumpToLast, F, t.isActive), ee(te.selectAll, N, t.isActive), ee(te.clearSelection, m, t.isActive), ee(te.refresh, p, t.isActive), ee(te.gridLayout, D, t.isActive), ee(te.listLayout, y, t.isActive);
|
|
1466
|
+
}, Tn = ({
|
|
1464
1467
|
fileUploadConfig: t,
|
|
1465
1468
|
onFileUploading: n,
|
|
1466
1469
|
onFileUploaded: s,
|
|
1467
1470
|
onDelete: r,
|
|
1468
1471
|
onRefresh: o,
|
|
1469
|
-
maxFileSize:
|
|
1470
|
-
filePreviewPath:
|
|
1471
|
-
|
|
1472
|
-
|
|
1472
|
+
maxFileSize: a,
|
|
1473
|
+
filePreviewPath: i,
|
|
1474
|
+
filePreviewComponent: l,
|
|
1475
|
+
acceptedFileTypes: c,
|
|
1476
|
+
triggerAction: u
|
|
1473
1477
|
}) => {
|
|
1474
|
-
const [
|
|
1475
|
-
|
|
1476
|
-
const
|
|
1478
|
+
const [h, f] = b(null), { selectedFiles: w } = le();
|
|
1479
|
+
xn(u, o);
|
|
1480
|
+
const T = {
|
|
1477
1481
|
uploadFile: {
|
|
1478
1482
|
title: "Upload",
|
|
1479
1483
|
component: /* @__PURE__ */ e(
|
|
1480
|
-
|
|
1484
|
+
En,
|
|
1481
1485
|
{
|
|
1482
1486
|
fileUploadConfig: t,
|
|
1483
|
-
maxFileSize:
|
|
1484
|
-
acceptedFileTypes:
|
|
1487
|
+
maxFileSize: a,
|
|
1488
|
+
acceptedFileTypes: c,
|
|
1485
1489
|
onFileUploading: n,
|
|
1486
1490
|
onFileUploaded: s
|
|
1487
1491
|
}
|
|
@@ -1490,66 +1494,72 @@ const Ct = ({ isLoading: t }) => {
|
|
|
1490
1494
|
},
|
|
1491
1495
|
delete: {
|
|
1492
1496
|
title: "Delete",
|
|
1493
|
-
component: /* @__PURE__ */ e(
|
|
1497
|
+
component: /* @__PURE__ */ e(kn, { triggerAction: u, onDelete: r }),
|
|
1494
1498
|
width: "25%"
|
|
1495
1499
|
},
|
|
1496
1500
|
previewFile: {
|
|
1497
1501
|
title: "Preview",
|
|
1498
|
-
component: /* @__PURE__ */ e(
|
|
1502
|
+
component: /* @__PURE__ */ e(
|
|
1503
|
+
Rn,
|
|
1504
|
+
{
|
|
1505
|
+
filePreviewPath: i,
|
|
1506
|
+
filePreviewComponent: l
|
|
1507
|
+
}
|
|
1508
|
+
),
|
|
1499
1509
|
width: "50%"
|
|
1500
1510
|
}
|
|
1501
1511
|
};
|
|
1502
|
-
if (
|
|
1503
|
-
if (
|
|
1504
|
-
const
|
|
1505
|
-
|
|
1512
|
+
if (V(() => {
|
|
1513
|
+
if (u.isActive) {
|
|
1514
|
+
const R = u.actionType;
|
|
1515
|
+
R === "previewFile" && (T[R].title = (w == null ? void 0 : w.name) ?? "Preview"), f(T[R]);
|
|
1506
1516
|
} else
|
|
1507
|
-
|
|
1508
|
-
}, [
|
|
1517
|
+
f(null);
|
|
1518
|
+
}, [u.isActive]), h)
|
|
1509
1519
|
return /* @__PURE__ */ e(
|
|
1510
1520
|
Tt,
|
|
1511
1521
|
{
|
|
1512
|
-
heading:
|
|
1513
|
-
show:
|
|
1514
|
-
setShow:
|
|
1515
|
-
dialogWidth:
|
|
1516
|
-
children:
|
|
1522
|
+
heading: h.title,
|
|
1523
|
+
show: u.isActive,
|
|
1524
|
+
setShow: u.close,
|
|
1525
|
+
dialogWidth: h.width,
|
|
1526
|
+
children: h == null ? void 0 : h.component
|
|
1517
1527
|
}
|
|
1518
1528
|
);
|
|
1519
|
-
},
|
|
1529
|
+
}, Dn = () => {
|
|
1520
1530
|
const [t, n] = b(!1), [s, r] = b(null);
|
|
1521
1531
|
return {
|
|
1522
1532
|
isActive: t,
|
|
1523
1533
|
actionType: s,
|
|
1524
|
-
show: (
|
|
1525
|
-
n(!0), r(
|
|
1534
|
+
show: (i) => {
|
|
1535
|
+
n(!0), r(i);
|
|
1526
1536
|
},
|
|
1527
1537
|
close: () => {
|
|
1528
1538
|
n(!1), r(null);
|
|
1529
1539
|
}
|
|
1530
1540
|
};
|
|
1531
|
-
},
|
|
1532
|
-
const [s, r] = b({ col1: t, col2: n }), [o,
|
|
1541
|
+
}, On = (t, n) => {
|
|
1542
|
+
const [s, r] = b({ col1: t, col2: n }), [o, a] = b(!1), i = re(null);
|
|
1533
1543
|
return {
|
|
1534
|
-
containerRef:
|
|
1544
|
+
containerRef: i,
|
|
1535
1545
|
colSizes: s,
|
|
1536
1546
|
setColSizes: r,
|
|
1537
1547
|
isDragging: o,
|
|
1538
1548
|
handleMouseDown: () => {
|
|
1539
|
-
|
|
1549
|
+
a(!0);
|
|
1540
1550
|
},
|
|
1541
1551
|
handleMouseUp: () => {
|
|
1542
|
-
|
|
1552
|
+
a(!1);
|
|
1543
1553
|
},
|
|
1544
1554
|
handleMouseMove: (h) => {
|
|
1545
1555
|
if (!o) return;
|
|
1546
1556
|
h.preventDefault();
|
|
1547
|
-
const w =
|
|
1548
|
-
|
|
1557
|
+
const w = i.current.getBoundingClientRect(), T = (h.clientX - w.left) / w.width * 100;
|
|
1558
|
+
T >= 15 && T <= 60 && r({ col1: T, col2: 100 - T });
|
|
1549
1559
|
}
|
|
1550
1560
|
};
|
|
1551
1561
|
};
|
|
1552
|
-
function
|
|
1562
|
+
function Sn(t) {
|
|
1553
1563
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
1554
1564
|
}
|
|
1555
1565
|
var Ae = { exports: {} };
|
|
@@ -1558,103 +1568,103 @@ object-assign
|
|
|
1558
1568
|
(c) Sindre Sorhus
|
|
1559
1569
|
@license MIT
|
|
1560
1570
|
*/
|
|
1561
|
-
var Te,
|
|
1562
|
-
function
|
|
1563
|
-
if (
|
|
1564
|
-
|
|
1571
|
+
var Te, tt;
|
|
1572
|
+
function Mn() {
|
|
1573
|
+
if (tt) return Te;
|
|
1574
|
+
tt = 1;
|
|
1565
1575
|
var t = Object.getOwnPropertySymbols, n = Object.prototype.hasOwnProperty, s = Object.prototype.propertyIsEnumerable;
|
|
1566
|
-
function r(
|
|
1567
|
-
if (
|
|
1576
|
+
function r(a) {
|
|
1577
|
+
if (a == null)
|
|
1568
1578
|
throw new TypeError("Object.assign cannot be called with null or undefined");
|
|
1569
|
-
return Object(
|
|
1579
|
+
return Object(a);
|
|
1570
1580
|
}
|
|
1571
1581
|
function o() {
|
|
1572
1582
|
try {
|
|
1573
1583
|
if (!Object.assign)
|
|
1574
1584
|
return !1;
|
|
1575
|
-
var
|
|
1576
|
-
if (
|
|
1585
|
+
var a = new String("abc");
|
|
1586
|
+
if (a[5] = "de", Object.getOwnPropertyNames(a)[0] === "5")
|
|
1577
1587
|
return !1;
|
|
1578
|
-
for (var
|
|
1579
|
-
|
|
1580
|
-
var c = Object.getOwnPropertyNames(
|
|
1581
|
-
return
|
|
1588
|
+
for (var i = {}, l = 0; l < 10; l++)
|
|
1589
|
+
i["_" + String.fromCharCode(l)] = l;
|
|
1590
|
+
var c = Object.getOwnPropertyNames(i).map(function(h) {
|
|
1591
|
+
return i[h];
|
|
1582
1592
|
});
|
|
1583
1593
|
if (c.join("") !== "0123456789")
|
|
1584
1594
|
return !1;
|
|
1585
|
-
var
|
|
1595
|
+
var u = {};
|
|
1586
1596
|
return "abcdefghijklmnopqrst".split("").forEach(function(h) {
|
|
1587
|
-
|
|
1588
|
-
}), Object.keys(Object.assign({},
|
|
1597
|
+
u[h] = h;
|
|
1598
|
+
}), Object.keys(Object.assign({}, u)).join("") === "abcdefghijklmnopqrst";
|
|
1589
1599
|
} catch {
|
|
1590
1600
|
return !1;
|
|
1591
1601
|
}
|
|
1592
1602
|
}
|
|
1593
|
-
return Te = o() ? Object.assign : function(
|
|
1594
|
-
for (var l, c = r(
|
|
1603
|
+
return Te = o() ? Object.assign : function(a, i) {
|
|
1604
|
+
for (var l, c = r(a), u, h = 1; h < arguments.length; h++) {
|
|
1595
1605
|
l = Object(arguments[h]);
|
|
1596
|
-
for (var
|
|
1597
|
-
n.call(l,
|
|
1606
|
+
for (var f in l)
|
|
1607
|
+
n.call(l, f) && (c[f] = l[f]);
|
|
1598
1608
|
if (t) {
|
|
1599
|
-
|
|
1600
|
-
for (var w = 0; w <
|
|
1601
|
-
s.call(l,
|
|
1609
|
+
u = t(l);
|
|
1610
|
+
for (var w = 0; w < u.length; w++)
|
|
1611
|
+
s.call(l, u[w]) && (c[u[w]] = l[u[w]]);
|
|
1602
1612
|
}
|
|
1603
1613
|
}
|
|
1604
1614
|
return c;
|
|
1605
1615
|
}, Te;
|
|
1606
1616
|
}
|
|
1607
|
-
var De,
|
|
1608
|
-
function
|
|
1609
|
-
if (
|
|
1610
|
-
|
|
1617
|
+
var De, nt;
|
|
1618
|
+
function ze() {
|
|
1619
|
+
if (nt) return De;
|
|
1620
|
+
nt = 1;
|
|
1611
1621
|
var t = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
1612
1622
|
return De = t, De;
|
|
1613
1623
|
}
|
|
1614
|
-
var Oe,
|
|
1624
|
+
var Oe, rt;
|
|
1615
1625
|
function Ot() {
|
|
1616
|
-
return
|
|
1626
|
+
return rt || (rt = 1, Oe = Function.call.bind(Object.prototype.hasOwnProperty)), Oe;
|
|
1617
1627
|
}
|
|
1618
|
-
var Se,
|
|
1619
|
-
function
|
|
1620
|
-
if (
|
|
1621
|
-
|
|
1628
|
+
var Se, st;
|
|
1629
|
+
function Ln() {
|
|
1630
|
+
if (st) return Se;
|
|
1631
|
+
st = 1;
|
|
1622
1632
|
var t = function() {
|
|
1623
1633
|
};
|
|
1624
1634
|
if (process.env.NODE_ENV !== "production") {
|
|
1625
|
-
var n =
|
|
1626
|
-
t = function(
|
|
1627
|
-
var
|
|
1628
|
-
typeof console < "u" && console.error(
|
|
1635
|
+
var n = ze(), s = {}, r = Ot();
|
|
1636
|
+
t = function(a) {
|
|
1637
|
+
var i = "Warning: " + a;
|
|
1638
|
+
typeof console < "u" && console.error(i);
|
|
1629
1639
|
try {
|
|
1630
|
-
throw new Error(
|
|
1640
|
+
throw new Error(i);
|
|
1631
1641
|
} catch {
|
|
1632
1642
|
}
|
|
1633
1643
|
};
|
|
1634
1644
|
}
|
|
1635
|
-
function o(
|
|
1645
|
+
function o(a, i, l, c, u) {
|
|
1636
1646
|
if (process.env.NODE_ENV !== "production") {
|
|
1637
|
-
for (var h in
|
|
1638
|
-
if (r(
|
|
1639
|
-
var
|
|
1647
|
+
for (var h in a)
|
|
1648
|
+
if (r(a, h)) {
|
|
1649
|
+
var f;
|
|
1640
1650
|
try {
|
|
1641
|
-
if (typeof
|
|
1651
|
+
if (typeof a[h] != "function") {
|
|
1642
1652
|
var w = Error(
|
|
1643
|
-
(c || "React class") + ": " + l + " type `" + h + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof
|
|
1653
|
+
(c || "React class") + ": " + l + " type `" + h + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof a[h] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
|
|
1644
1654
|
);
|
|
1645
1655
|
throw w.name = "Invariant Violation", w;
|
|
1646
1656
|
}
|
|
1647
|
-
|
|
1648
|
-
} catch (
|
|
1649
|
-
|
|
1657
|
+
f = a[h](i, h, c, l, null, n);
|
|
1658
|
+
} catch (R) {
|
|
1659
|
+
f = R;
|
|
1650
1660
|
}
|
|
1651
|
-
if (
|
|
1652
|
-
(c || "React class") + ": type specification of " + l + " `" + h + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof
|
|
1653
|
-
),
|
|
1654
|
-
s[
|
|
1655
|
-
var
|
|
1661
|
+
if (f && !(f instanceof Error) && t(
|
|
1662
|
+
(c || "React class") + ": type specification of " + l + " `" + h + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof f + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
|
|
1663
|
+
), f instanceof Error && !(f.message in s)) {
|
|
1664
|
+
s[f.message] = !0;
|
|
1665
|
+
var T = u ? u() : "";
|
|
1656
1666
|
t(
|
|
1657
|
-
"Failed " + l + " type: " +
|
|
1667
|
+
"Failed " + l + " type: " + f.message + (T ?? "")
|
|
1658
1668
|
);
|
|
1659
1669
|
}
|
|
1660
1670
|
}
|
|
@@ -1664,13 +1674,13 @@ function Mn() {
|
|
|
1664
1674
|
process.env.NODE_ENV !== "production" && (s = {});
|
|
1665
1675
|
}, Se = o, Se;
|
|
1666
1676
|
}
|
|
1667
|
-
var Me,
|
|
1668
|
-
function
|
|
1669
|
-
if (
|
|
1670
|
-
|
|
1671
|
-
var t = yt, n =
|
|
1677
|
+
var Me, ot;
|
|
1678
|
+
function In() {
|
|
1679
|
+
if (ot) return Me;
|
|
1680
|
+
ot = 1;
|
|
1681
|
+
var t = yt, n = Mn(), s = ze(), r = Ot(), o = Ln(), a = function() {
|
|
1672
1682
|
};
|
|
1673
|
-
process.env.NODE_ENV !== "production" && (
|
|
1683
|
+
process.env.NODE_ENV !== "production" && (a = function(l) {
|
|
1674
1684
|
var c = "Warning: " + l;
|
|
1675
1685
|
typeof console < "u" && console.error(c);
|
|
1676
1686
|
try {
|
|
@@ -1678,17 +1688,17 @@ function Ln() {
|
|
|
1678
1688
|
} catch {
|
|
1679
1689
|
}
|
|
1680
1690
|
});
|
|
1681
|
-
function
|
|
1691
|
+
function i() {
|
|
1682
1692
|
return null;
|
|
1683
1693
|
}
|
|
1684
1694
|
return Me = function(l, c) {
|
|
1685
|
-
var
|
|
1686
|
-
function
|
|
1687
|
-
var v = d && (
|
|
1695
|
+
var u = typeof Symbol == "function" && Symbol.iterator, h = "@@iterator";
|
|
1696
|
+
function f(d) {
|
|
1697
|
+
var v = d && (u && d[u] || d[h]);
|
|
1688
1698
|
if (typeof v == "function")
|
|
1689
1699
|
return v;
|
|
1690
1700
|
}
|
|
1691
|
-
var w = "<<anonymous>>",
|
|
1701
|
+
var w = "<<anonymous>>", T = {
|
|
1692
1702
|
array: C("array"),
|
|
1693
1703
|
bigint: C("bigint"),
|
|
1694
1704
|
bool: C("boolean"),
|
|
@@ -1697,55 +1707,55 @@ function Ln() {
|
|
|
1697
1707
|
object: C("object"),
|
|
1698
1708
|
string: C("string"),
|
|
1699
1709
|
symbol: C("symbol"),
|
|
1700
|
-
any:
|
|
1710
|
+
any: E(),
|
|
1701
1711
|
arrayOf: F,
|
|
1702
1712
|
element: N(),
|
|
1703
1713
|
elementType: m(),
|
|
1704
1714
|
instanceOf: p,
|
|
1705
|
-
node:
|
|
1715
|
+
node: x(),
|
|
1706
1716
|
objectOf: y,
|
|
1707
|
-
oneOf:
|
|
1708
|
-
oneOfType:
|
|
1717
|
+
oneOf: D,
|
|
1718
|
+
oneOfType: P,
|
|
1709
1719
|
shape: H,
|
|
1710
1720
|
exact: I
|
|
1711
1721
|
};
|
|
1712
|
-
function
|
|
1722
|
+
function R(d, v) {
|
|
1713
1723
|
return d === v ? d !== 0 || 1 / d === 1 / v : d !== d && v !== v;
|
|
1714
1724
|
}
|
|
1715
|
-
function
|
|
1725
|
+
function O(d, v) {
|
|
1716
1726
|
this.message = d, this.data = v && typeof v == "object" ? v : {}, this.stack = "";
|
|
1717
1727
|
}
|
|
1718
|
-
|
|
1728
|
+
O.prototype = Error.prototype;
|
|
1719
1729
|
function M(d) {
|
|
1720
1730
|
if (process.env.NODE_ENV !== "production")
|
|
1721
1731
|
var v = {}, $ = 0;
|
|
1722
|
-
function A(
|
|
1723
|
-
if (
|
|
1732
|
+
function A(W, k, L, U, _, q, Q) {
|
|
1733
|
+
if (U = U || w, q = q || L, Q !== s) {
|
|
1724
1734
|
if (c) {
|
|
1725
1735
|
var G = new Error(
|
|
1726
1736
|
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
1727
1737
|
);
|
|
1728
1738
|
throw G.name = "Invariant Violation", G;
|
|
1729
1739
|
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
|
|
1730
|
-
var ie =
|
|
1740
|
+
var ie = U + ":" + L;
|
|
1731
1741
|
!v[ie] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
1732
|
-
$ < 3 && (
|
|
1733
|
-
"You are manually calling a React.PropTypes validation function for the `" +
|
|
1742
|
+
$ < 3 && (a(
|
|
1743
|
+
"You are manually calling a React.PropTypes validation function for the `" + q + "` prop on `" + U + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
1734
1744
|
), v[ie] = !0, $++);
|
|
1735
1745
|
}
|
|
1736
1746
|
}
|
|
1737
|
-
return k[L] == null ?
|
|
1747
|
+
return k[L] == null ? W ? k[L] === null ? new O("The " + _ + " `" + q + "` is marked as required " + ("in `" + U + "`, but its value is `null`.")) : new O("The " + _ + " `" + q + "` is marked as required in " + ("`" + U + "`, but its value is `undefined`.")) : null : d(k, L, U, _, q);
|
|
1738
1748
|
}
|
|
1739
|
-
var
|
|
1740
|
-
return
|
|
1749
|
+
var S = A.bind(null, !1);
|
|
1750
|
+
return S.isRequired = A.bind(null, !0), S;
|
|
1741
1751
|
}
|
|
1742
1752
|
function C(d) {
|
|
1743
|
-
function v($, A,
|
|
1744
|
-
var
|
|
1753
|
+
function v($, A, S, W, k, L) {
|
|
1754
|
+
var U = $[A], _ = X(U);
|
|
1745
1755
|
if (_ !== d) {
|
|
1746
|
-
var
|
|
1747
|
-
return new
|
|
1748
|
-
"Invalid " +
|
|
1756
|
+
var q = Y(U);
|
|
1757
|
+
return new O(
|
|
1758
|
+
"Invalid " + W + " `" + k + "` of type " + ("`" + q + "` supplied to `" + S + "`, expected ") + ("`" + d + "`."),
|
|
1749
1759
|
{ expectedType: d }
|
|
1750
1760
|
);
|
|
1751
1761
|
}
|
|
@@ -1753,159 +1763,159 @@ function Ln() {
|
|
|
1753
1763
|
}
|
|
1754
1764
|
return M(v);
|
|
1755
1765
|
}
|
|
1756
|
-
function
|
|
1757
|
-
return M(
|
|
1766
|
+
function E() {
|
|
1767
|
+
return M(i);
|
|
1758
1768
|
}
|
|
1759
1769
|
function F(d) {
|
|
1760
|
-
function v($, A,
|
|
1770
|
+
function v($, A, S, W, k) {
|
|
1761
1771
|
if (typeof d != "function")
|
|
1762
|
-
return new
|
|
1772
|
+
return new O("Property `" + k + "` of component `" + S + "` has invalid PropType notation inside arrayOf.");
|
|
1763
1773
|
var L = $[A];
|
|
1764
1774
|
if (!Array.isArray(L)) {
|
|
1765
|
-
var
|
|
1766
|
-
return new
|
|
1775
|
+
var U = X(L);
|
|
1776
|
+
return new O("Invalid " + W + " `" + k + "` of type " + ("`" + U + "` supplied to `" + S + "`, expected an array."));
|
|
1767
1777
|
}
|
|
1768
1778
|
for (var _ = 0; _ < L.length; _++) {
|
|
1769
|
-
var
|
|
1770
|
-
if (
|
|
1771
|
-
return
|
|
1779
|
+
var q = d(L, _, S, W, k + "[" + _ + "]", s);
|
|
1780
|
+
if (q instanceof Error)
|
|
1781
|
+
return q;
|
|
1772
1782
|
}
|
|
1773
1783
|
return null;
|
|
1774
1784
|
}
|
|
1775
1785
|
return M(v);
|
|
1776
1786
|
}
|
|
1777
1787
|
function N() {
|
|
1778
|
-
function d(v, $, A,
|
|
1788
|
+
function d(v, $, A, S, W) {
|
|
1779
1789
|
var k = v[$];
|
|
1780
1790
|
if (!l(k)) {
|
|
1781
1791
|
var L = X(k);
|
|
1782
|
-
return new
|
|
1792
|
+
return new O("Invalid " + S + " `" + W + "` of type " + ("`" + L + "` supplied to `" + A + "`, expected a single ReactElement."));
|
|
1783
1793
|
}
|
|
1784
1794
|
return null;
|
|
1785
1795
|
}
|
|
1786
1796
|
return M(d);
|
|
1787
1797
|
}
|
|
1788
1798
|
function m() {
|
|
1789
|
-
function d(v, $, A,
|
|
1799
|
+
function d(v, $, A, S, W) {
|
|
1790
1800
|
var k = v[$];
|
|
1791
1801
|
if (!t.isValidElementType(k)) {
|
|
1792
1802
|
var L = X(k);
|
|
1793
|
-
return new
|
|
1803
|
+
return new O("Invalid " + S + " `" + W + "` of type " + ("`" + L + "` supplied to `" + A + "`, expected a single ReactElement type."));
|
|
1794
1804
|
}
|
|
1795
1805
|
return null;
|
|
1796
1806
|
}
|
|
1797
1807
|
return M(d);
|
|
1798
1808
|
}
|
|
1799
1809
|
function p(d) {
|
|
1800
|
-
function v($, A,
|
|
1810
|
+
function v($, A, S, W, k) {
|
|
1801
1811
|
if (!($[A] instanceof d)) {
|
|
1802
|
-
var L = d.name || w,
|
|
1803
|
-
return new
|
|
1812
|
+
var L = d.name || w, U = Ce($[A]);
|
|
1813
|
+
return new O("Invalid " + W + " `" + k + "` of type " + ("`" + U + "` supplied to `" + S + "`, expected ") + ("instance of `" + L + "`."));
|
|
1804
1814
|
}
|
|
1805
1815
|
return null;
|
|
1806
1816
|
}
|
|
1807
1817
|
return M(v);
|
|
1808
1818
|
}
|
|
1809
|
-
function
|
|
1819
|
+
function D(d) {
|
|
1810
1820
|
if (!Array.isArray(d))
|
|
1811
|
-
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ?
|
|
1821
|
+
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? a(
|
|
1812
1822
|
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
|
|
1813
|
-
) :
|
|
1814
|
-
function v($, A,
|
|
1815
|
-
for (var L = $[A],
|
|
1816
|
-
if (
|
|
1823
|
+
) : a("Invalid argument supplied to oneOf, expected an array.")), i;
|
|
1824
|
+
function v($, A, S, W, k) {
|
|
1825
|
+
for (var L = $[A], U = 0; U < d.length; U++)
|
|
1826
|
+
if (R(L, d[U]))
|
|
1817
1827
|
return null;
|
|
1818
|
-
var _ = JSON.stringify(d, function(
|
|
1819
|
-
var ie =
|
|
1828
|
+
var _ = JSON.stringify(d, function(Q, G) {
|
|
1829
|
+
var ie = Y(G);
|
|
1820
1830
|
return ie === "symbol" ? String(G) : G;
|
|
1821
1831
|
});
|
|
1822
|
-
return new
|
|
1832
|
+
return new O("Invalid " + W + " `" + k + "` of value `" + String(L) + "` " + ("supplied to `" + S + "`, expected one of " + _ + "."));
|
|
1823
1833
|
}
|
|
1824
1834
|
return M(v);
|
|
1825
1835
|
}
|
|
1826
1836
|
function y(d) {
|
|
1827
|
-
function v($, A,
|
|
1837
|
+
function v($, A, S, W, k) {
|
|
1828
1838
|
if (typeof d != "function")
|
|
1829
|
-
return new
|
|
1830
|
-
var L = $[A],
|
|
1831
|
-
if (
|
|
1832
|
-
return new
|
|
1839
|
+
return new O("Property `" + k + "` of component `" + S + "` has invalid PropType notation inside objectOf.");
|
|
1840
|
+
var L = $[A], U = X(L);
|
|
1841
|
+
if (U !== "object")
|
|
1842
|
+
return new O("Invalid " + W + " `" + k + "` of type " + ("`" + U + "` supplied to `" + S + "`, expected an object."));
|
|
1833
1843
|
for (var _ in L)
|
|
1834
1844
|
if (r(L, _)) {
|
|
1835
|
-
var
|
|
1836
|
-
if (
|
|
1837
|
-
return
|
|
1845
|
+
var q = d(L, _, S, W, k + "." + _, s);
|
|
1846
|
+
if (q instanceof Error)
|
|
1847
|
+
return q;
|
|
1838
1848
|
}
|
|
1839
1849
|
return null;
|
|
1840
1850
|
}
|
|
1841
1851
|
return M(v);
|
|
1842
1852
|
}
|
|
1843
|
-
function
|
|
1853
|
+
function P(d) {
|
|
1844
1854
|
if (!Array.isArray(d))
|
|
1845
|
-
return process.env.NODE_ENV !== "production" &&
|
|
1855
|
+
return process.env.NODE_ENV !== "production" && a("Invalid argument supplied to oneOfType, expected an instance of array."), i;
|
|
1846
1856
|
for (var v = 0; v < d.length; v++) {
|
|
1847
1857
|
var $ = d[v];
|
|
1848
1858
|
if (typeof $ != "function")
|
|
1849
|
-
return
|
|
1859
|
+
return a(
|
|
1850
1860
|
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + de($) + " at index " + v + "."
|
|
1851
|
-
),
|
|
1861
|
+
), i;
|
|
1852
1862
|
}
|
|
1853
|
-
function A(
|
|
1854
|
-
for (var _ = [],
|
|
1855
|
-
var
|
|
1863
|
+
function A(S, W, k, L, U) {
|
|
1864
|
+
for (var _ = [], q = 0; q < d.length; q++) {
|
|
1865
|
+
var Q = d[q], G = Q(S, W, k, L, U, s);
|
|
1856
1866
|
if (G == null)
|
|
1857
1867
|
return null;
|
|
1858
1868
|
G.data && r(G.data, "expectedType") && _.push(G.data.expectedType);
|
|
1859
1869
|
}
|
|
1860
1870
|
var ie = _.length > 0 ? ", expected one of type [" + _.join(", ") + "]" : "";
|
|
1861
|
-
return new
|
|
1871
|
+
return new O("Invalid " + L + " `" + U + "` supplied to " + ("`" + k + "`" + ie + "."));
|
|
1862
1872
|
}
|
|
1863
1873
|
return M(A);
|
|
1864
1874
|
}
|
|
1865
|
-
function
|
|
1866
|
-
function d(v, $, A,
|
|
1867
|
-
return
|
|
1875
|
+
function x() {
|
|
1876
|
+
function d(v, $, A, S, W) {
|
|
1877
|
+
return K(v[$]) ? null : new O("Invalid " + S + " `" + W + "` supplied to " + ("`" + A + "`, expected a ReactNode."));
|
|
1868
1878
|
}
|
|
1869
1879
|
return M(d);
|
|
1870
1880
|
}
|
|
1871
|
-
function j(d, v, $, A,
|
|
1872
|
-
return new
|
|
1873
|
-
(d || "React class") + ": " + v + " type `" + $ + "." + A + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" +
|
|
1881
|
+
function j(d, v, $, A, S) {
|
|
1882
|
+
return new O(
|
|
1883
|
+
(d || "React class") + ": " + v + " type `" + $ + "." + A + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + S + "`."
|
|
1874
1884
|
);
|
|
1875
1885
|
}
|
|
1876
1886
|
function H(d) {
|
|
1877
|
-
function v($, A,
|
|
1878
|
-
var L = $[A],
|
|
1879
|
-
if (
|
|
1880
|
-
return new
|
|
1887
|
+
function v($, A, S, W, k) {
|
|
1888
|
+
var L = $[A], U = X(L);
|
|
1889
|
+
if (U !== "object")
|
|
1890
|
+
return new O("Invalid " + W + " `" + k + "` of type `" + U + "` " + ("supplied to `" + S + "`, expected `object`."));
|
|
1881
1891
|
for (var _ in d) {
|
|
1882
|
-
var
|
|
1883
|
-
if (typeof
|
|
1884
|
-
return j(
|
|
1885
|
-
var
|
|
1886
|
-
if (
|
|
1887
|
-
return
|
|
1892
|
+
var q = d[_];
|
|
1893
|
+
if (typeof q != "function")
|
|
1894
|
+
return j(S, W, k, _, Y(q));
|
|
1895
|
+
var Q = q(L, _, S, W, k + "." + _, s);
|
|
1896
|
+
if (Q)
|
|
1897
|
+
return Q;
|
|
1888
1898
|
}
|
|
1889
1899
|
return null;
|
|
1890
1900
|
}
|
|
1891
1901
|
return M(v);
|
|
1892
1902
|
}
|
|
1893
1903
|
function I(d) {
|
|
1894
|
-
function v($, A,
|
|
1895
|
-
var L = $[A],
|
|
1896
|
-
if (
|
|
1897
|
-
return new
|
|
1904
|
+
function v($, A, S, W, k) {
|
|
1905
|
+
var L = $[A], U = X(L);
|
|
1906
|
+
if (U !== "object")
|
|
1907
|
+
return new O("Invalid " + W + " `" + k + "` of type `" + U + "` " + ("supplied to `" + S + "`, expected `object`."));
|
|
1898
1908
|
var _ = n({}, $[A], d);
|
|
1899
|
-
for (var
|
|
1900
|
-
var
|
|
1901
|
-
if (r(d,
|
|
1902
|
-
return j(
|
|
1903
|
-
if (!
|
|
1904
|
-
return new
|
|
1905
|
-
"Invalid " +
|
|
1909
|
+
for (var q in _) {
|
|
1910
|
+
var Q = d[q];
|
|
1911
|
+
if (r(d, q) && typeof Q != "function")
|
|
1912
|
+
return j(S, W, k, q, Y(Q));
|
|
1913
|
+
if (!Q)
|
|
1914
|
+
return new O(
|
|
1915
|
+
"Invalid " + W + " `" + k + "` key `" + q + "` supplied to `" + S + "`.\nBad object: " + JSON.stringify($[A], null, " ") + `
|
|
1906
1916
|
Valid keys: ` + JSON.stringify(Object.keys(d), null, " ")
|
|
1907
1917
|
);
|
|
1908
|
-
var G =
|
|
1918
|
+
var G = Q(L, q, S, W, k + "." + q, s);
|
|
1909
1919
|
if (G)
|
|
1910
1920
|
return G;
|
|
1911
1921
|
}
|
|
@@ -1913,7 +1923,7 @@ Valid keys: ` + JSON.stringify(Object.keys(d), null, " ")
|
|
|
1913
1923
|
}
|
|
1914
1924
|
return M(v);
|
|
1915
1925
|
}
|
|
1916
|
-
function
|
|
1926
|
+
function K(d) {
|
|
1917
1927
|
switch (typeof d) {
|
|
1918
1928
|
case "number":
|
|
1919
1929
|
case "string":
|
|
@@ -1923,20 +1933,20 @@ Valid keys: ` + JSON.stringify(Object.keys(d), null, " ")
|
|
|
1923
1933
|
return !d;
|
|
1924
1934
|
case "object":
|
|
1925
1935
|
if (Array.isArray(d))
|
|
1926
|
-
return d.every(
|
|
1936
|
+
return d.every(K);
|
|
1927
1937
|
if (d === null || l(d))
|
|
1928
1938
|
return !0;
|
|
1929
|
-
var v =
|
|
1939
|
+
var v = f(d);
|
|
1930
1940
|
if (v) {
|
|
1931
1941
|
var $ = v.call(d), A;
|
|
1932
1942
|
if (v !== d.entries) {
|
|
1933
1943
|
for (; !(A = $.next()).done; )
|
|
1934
|
-
if (!
|
|
1944
|
+
if (!K(A.value))
|
|
1935
1945
|
return !1;
|
|
1936
1946
|
} else
|
|
1937
1947
|
for (; !(A = $.next()).done; ) {
|
|
1938
|
-
var
|
|
1939
|
-
if (
|
|
1948
|
+
var S = A.value;
|
|
1949
|
+
if (S && !K(S[1]))
|
|
1940
1950
|
return !1;
|
|
1941
1951
|
}
|
|
1942
1952
|
} else
|
|
@@ -1946,14 +1956,14 @@ Valid keys: ` + JSON.stringify(Object.keys(d), null, " ")
|
|
|
1946
1956
|
return !1;
|
|
1947
1957
|
}
|
|
1948
1958
|
}
|
|
1949
|
-
function
|
|
1959
|
+
function Z(d, v) {
|
|
1950
1960
|
return d === "symbol" ? !0 : v ? v["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && v instanceof Symbol : !1;
|
|
1951
1961
|
}
|
|
1952
1962
|
function X(d) {
|
|
1953
1963
|
var v = typeof d;
|
|
1954
|
-
return Array.isArray(d) ? "array" : d instanceof RegExp ? "object" :
|
|
1964
|
+
return Array.isArray(d) ? "array" : d instanceof RegExp ? "object" : Z(v, d) ? "symbol" : v;
|
|
1955
1965
|
}
|
|
1956
|
-
function
|
|
1966
|
+
function Y(d) {
|
|
1957
1967
|
if (typeof d > "u" || d === null)
|
|
1958
1968
|
return "" + d;
|
|
1959
1969
|
var v = X(d);
|
|
@@ -1966,7 +1976,7 @@ Valid keys: ` + JSON.stringify(Object.keys(d), null, " ")
|
|
|
1966
1976
|
return v;
|
|
1967
1977
|
}
|
|
1968
1978
|
function de(d) {
|
|
1969
|
-
var v =
|
|
1979
|
+
var v = Y(d);
|
|
1970
1980
|
switch (v) {
|
|
1971
1981
|
case "array":
|
|
1972
1982
|
case "object":
|
|
@@ -1982,21 +1992,21 @@ Valid keys: ` + JSON.stringify(Object.keys(d), null, " ")
|
|
|
1982
1992
|
function Ce(d) {
|
|
1983
1993
|
return !d.constructor || !d.constructor.name ? w : d.constructor.name;
|
|
1984
1994
|
}
|
|
1985
|
-
return
|
|
1995
|
+
return T.checkPropTypes = o, T.resetWarningCache = o.resetWarningCache, T.PropTypes = T, T;
|
|
1986
1996
|
}, Me;
|
|
1987
1997
|
}
|
|
1988
|
-
var Le,
|
|
1989
|
-
function
|
|
1990
|
-
if (
|
|
1991
|
-
|
|
1992
|
-
var t =
|
|
1998
|
+
var Le, it;
|
|
1999
|
+
function An() {
|
|
2000
|
+
if (it) return Le;
|
|
2001
|
+
it = 1;
|
|
2002
|
+
var t = ze();
|
|
1993
2003
|
function n() {
|
|
1994
2004
|
}
|
|
1995
2005
|
function s() {
|
|
1996
2006
|
}
|
|
1997
2007
|
return s.resetWarningCache = n, Le = function() {
|
|
1998
|
-
function r(
|
|
1999
|
-
if (
|
|
2008
|
+
function r(i, l, c, u, h, f) {
|
|
2009
|
+
if (f !== t) {
|
|
2000
2010
|
var w = new Error(
|
|
2001
2011
|
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
2002
2012
|
);
|
|
@@ -2007,7 +2017,7 @@ function In() {
|
|
|
2007
2017
|
function o() {
|
|
2008
2018
|
return r;
|
|
2009
2019
|
}
|
|
2010
|
-
var
|
|
2020
|
+
var a = {
|
|
2011
2021
|
array: r,
|
|
2012
2022
|
bigint: r,
|
|
2013
2023
|
bool: r,
|
|
@@ -2030,22 +2040,22 @@ function In() {
|
|
|
2030
2040
|
checkPropTypes: s,
|
|
2031
2041
|
resetWarningCache: n
|
|
2032
2042
|
};
|
|
2033
|
-
return
|
|
2043
|
+
return a.PropTypes = a, a;
|
|
2034
2044
|
}, Le;
|
|
2035
2045
|
}
|
|
2036
2046
|
if (process.env.NODE_ENV !== "production") {
|
|
2037
|
-
var
|
|
2038
|
-
Ae.exports =
|
|
2047
|
+
var $n = yt, jn = !0;
|
|
2048
|
+
Ae.exports = In()($n.isElement, jn);
|
|
2039
2049
|
} else
|
|
2040
|
-
Ae.exports =
|
|
2041
|
-
var
|
|
2042
|
-
const
|
|
2050
|
+
Ae.exports = An()();
|
|
2051
|
+
var zn = Ae.exports;
|
|
2052
|
+
const z = /* @__PURE__ */ Sn(zn), Wn = (t, n, s) => {
|
|
2043
2053
|
const r = t[n];
|
|
2044
2054
|
if (r && isNaN(Date.parse(r)))
|
|
2045
2055
|
return new Error(
|
|
2046
2056
|
`Invalid prop \`${n}\` supplied to \`${s}\`. Expected a valid date string (ISO 8601) but received \`${r}\`.`
|
|
2047
2057
|
);
|
|
2048
|
-
},
|
|
2058
|
+
}, at = (t, n, s) => {
|
|
2049
2059
|
const r = t[n];
|
|
2050
2060
|
try {
|
|
2051
2061
|
new URL(r);
|
|
@@ -2062,137 +2072,141 @@ const q = /* @__PURE__ */ On(jn), zn = (t, n, s) => {
|
|
|
2062
2072
|
onCreateFolder: r,
|
|
2063
2073
|
onFileUploading: o = () => {
|
|
2064
2074
|
},
|
|
2065
|
-
onFileUploaded:
|
|
2075
|
+
onFileUploaded: a = () => {
|
|
2066
2076
|
},
|
|
2067
|
-
onPaste:
|
|
2077
|
+
onPaste: i,
|
|
2068
2078
|
onRename: l,
|
|
2069
2079
|
onDownload: c,
|
|
2070
|
-
onDelete:
|
|
2080
|
+
onDelete: u = () => null,
|
|
2071
2081
|
onLayoutChange: h = () => {
|
|
2072
2082
|
},
|
|
2073
|
-
onRefresh:
|
|
2083
|
+
onRefresh: f,
|
|
2074
2084
|
onFileOpen: w = () => {
|
|
2075
2085
|
},
|
|
2076
|
-
onError:
|
|
2086
|
+
onError: T = () => {
|
|
2077
2087
|
},
|
|
2078
|
-
layout:
|
|
2079
|
-
enableFilePreview:
|
|
2088
|
+
layout: R = "grid",
|
|
2089
|
+
enableFilePreview: O = !0,
|
|
2080
2090
|
maxFileSize: M,
|
|
2081
2091
|
filePreviewPath: C,
|
|
2082
|
-
acceptedFileTypes:
|
|
2092
|
+
acceptedFileTypes: E,
|
|
2083
2093
|
height: F = "600px",
|
|
2084
2094
|
width: N = "100%",
|
|
2085
|
-
initialPath: m = ""
|
|
2095
|
+
initialPath: m = "",
|
|
2096
|
+
filePreviewComponent: p,
|
|
2097
|
+
primaryColor: D = "#6155b4",
|
|
2098
|
+
fontFamily: y = "Nunito Sans, sans-serif"
|
|
2086
2099
|
}) => {
|
|
2087
|
-
const
|
|
2088
|
-
return /* @__PURE__ */ g(
|
|
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
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
}
|
|
2159
|
-
);
|
|
2100
|
+
const P = Dn(), { containerRef: x, colSizes: j, isDragging: H, handleMouseMove: I, handleMouseUp: K, handleMouseDown: Z } = On(20, 80);
|
|
2101
|
+
return /* @__PURE__ */ g("main", { className: "file-explorer", onContextMenu: (Y) => Y.preventDefault(), style: {
|
|
2102
|
+
"--file-manager-font-family": y,
|
|
2103
|
+
"--file-manager-primary-color": D,
|
|
2104
|
+
height: F,
|
|
2105
|
+
width: N
|
|
2106
|
+
}, children: [
|
|
2107
|
+
/* @__PURE__ */ e(Ct, { isLoading: s }),
|
|
2108
|
+
/* @__PURE__ */ e(rn, { filesData: t, onError: T, children: /* @__PURE__ */ e(sn, { initialPath: m, children: /* @__PURE__ */ e(on, { onDownload: c, children: /* @__PURE__ */ e(an, { onPaste: i, children: /* @__PURE__ */ g(tn, { layout: R, children: [
|
|
2109
|
+
/* @__PURE__ */ e(
|
|
2110
|
+
ln,
|
|
2111
|
+
{
|
|
2112
|
+
allowCreateFolder: !0,
|
|
2113
|
+
allowUploadFile: !0,
|
|
2114
|
+
onLayoutChange: h,
|
|
2115
|
+
onRefresh: f,
|
|
2116
|
+
triggerAction: P
|
|
2117
|
+
}
|
|
2118
|
+
),
|
|
2119
|
+
/* @__PURE__ */ g(
|
|
2120
|
+
"section",
|
|
2121
|
+
{
|
|
2122
|
+
ref: x,
|
|
2123
|
+
onMouseMove: I,
|
|
2124
|
+
onMouseUp: K,
|
|
2125
|
+
className: "files-container",
|
|
2126
|
+
children: [
|
|
2127
|
+
/* @__PURE__ */ g("div", { className: "navigation-pane", style: { width: j.col1 + "%" }, children: [
|
|
2128
|
+
/* @__PURE__ */ e(dn, {}),
|
|
2129
|
+
/* @__PURE__ */ e(
|
|
2130
|
+
"div",
|
|
2131
|
+
{
|
|
2132
|
+
className: `sidebar-resize ${H ? "sidebar-dragging" : ""}`,
|
|
2133
|
+
onMouseDown: Z
|
|
2134
|
+
}
|
|
2135
|
+
)
|
|
2136
|
+
] }),
|
|
2137
|
+
/* @__PURE__ */ g("div", { className: "folders-preview", style: { width: j.col2 + "%" }, children: [
|
|
2138
|
+
/* @__PURE__ */ e(un, {}),
|
|
2139
|
+
/* @__PURE__ */ e(
|
|
2140
|
+
Fn,
|
|
2141
|
+
{
|
|
2142
|
+
onCreateFolder: r,
|
|
2143
|
+
onRename: l,
|
|
2144
|
+
onFileOpen: w,
|
|
2145
|
+
onRefresh: f,
|
|
2146
|
+
enableFilePreview: O,
|
|
2147
|
+
triggerAction: P
|
|
2148
|
+
}
|
|
2149
|
+
)
|
|
2150
|
+
] })
|
|
2151
|
+
]
|
|
2152
|
+
}
|
|
2153
|
+
),
|
|
2154
|
+
/* @__PURE__ */ e(
|
|
2155
|
+
Tn,
|
|
2156
|
+
{
|
|
2157
|
+
fileUploadConfig: n,
|
|
2158
|
+
onFileUploading: o,
|
|
2159
|
+
onFileUploaded: a,
|
|
2160
|
+
onDelete: u,
|
|
2161
|
+
onRefresh: f,
|
|
2162
|
+
maxFileSize: M,
|
|
2163
|
+
filePreviewPath: C,
|
|
2164
|
+
filePreviewComponent: p,
|
|
2165
|
+
acceptedFileTypes: E,
|
|
2166
|
+
triggerAction: P
|
|
2167
|
+
}
|
|
2168
|
+
)
|
|
2169
|
+
] }) }) }) }) })
|
|
2170
|
+
] });
|
|
2160
2171
|
};
|
|
2161
2172
|
St.displayName = "FileManager";
|
|
2162
2173
|
St.propTypes = {
|
|
2163
|
-
files:
|
|
2164
|
-
|
|
2165
|
-
name:
|
|
2166
|
-
isDirectory:
|
|
2167
|
-
path:
|
|
2168
|
-
updatedAt:
|
|
2169
|
-
size:
|
|
2174
|
+
files: z.arrayOf(
|
|
2175
|
+
z.shape({
|
|
2176
|
+
name: z.string.isRequired,
|
|
2177
|
+
isDirectory: z.bool.isRequired,
|
|
2178
|
+
path: z.string.isRequired,
|
|
2179
|
+
updatedAt: Wn,
|
|
2180
|
+
size: z.number
|
|
2170
2181
|
})
|
|
2171
2182
|
).isRequired,
|
|
2172
|
-
fileUploadConfig:
|
|
2173
|
-
url:
|
|
2174
|
-
headers:
|
|
2183
|
+
fileUploadConfig: z.shape({
|
|
2184
|
+
url: at,
|
|
2185
|
+
headers: z.objectOf(z.string)
|
|
2175
2186
|
}),
|
|
2176
|
-
isLoading:
|
|
2177
|
-
onCreateFolder:
|
|
2178
|
-
onFileUploading:
|
|
2179
|
-
onFileUploaded:
|
|
2180
|
-
onRename:
|
|
2181
|
-
onDelete:
|
|
2182
|
-
onPaste:
|
|
2183
|
-
onDownload:
|
|
2184
|
-
onLayoutChange:
|
|
2185
|
-
onRefresh:
|
|
2186
|
-
onFileOpen:
|
|
2187
|
-
onError:
|
|
2188
|
-
layout:
|
|
2189
|
-
maxFileSize:
|
|
2190
|
-
enableFilePreview:
|
|
2191
|
-
filePreviewPath:
|
|
2192
|
-
acceptedFileTypes:
|
|
2193
|
-
height:
|
|
2194
|
-
width:
|
|
2195
|
-
initialPath:
|
|
2187
|
+
isLoading: z.bool,
|
|
2188
|
+
onCreateFolder: z.func,
|
|
2189
|
+
onFileUploading: z.func,
|
|
2190
|
+
onFileUploaded: z.func,
|
|
2191
|
+
onRename: z.func,
|
|
2192
|
+
onDelete: z.func,
|
|
2193
|
+
onPaste: z.func,
|
|
2194
|
+
onDownload: z.func,
|
|
2195
|
+
onLayoutChange: z.func,
|
|
2196
|
+
onRefresh: z.func,
|
|
2197
|
+
onFileOpen: z.func,
|
|
2198
|
+
onError: z.func,
|
|
2199
|
+
layout: z.oneOf(["grid", "list"]),
|
|
2200
|
+
maxFileSize: z.number,
|
|
2201
|
+
enableFilePreview: z.bool,
|
|
2202
|
+
filePreviewPath: at,
|
|
2203
|
+
acceptedFileTypes: z.string,
|
|
2204
|
+
height: z.oneOfType([z.string, z.number]),
|
|
2205
|
+
width: z.oneOfType([z.string, z.number]),
|
|
2206
|
+
initialPath: z.string,
|
|
2207
|
+
filePreviewComponent: z.func,
|
|
2208
|
+
primaryColor: z.string,
|
|
2209
|
+
fontFamily: z.string
|
|
2196
2210
|
};
|
|
2197
2211
|
export {
|
|
2198
2212
|
St as FileManager
|