@epam/ai-dial-ui-kit 0.14.0-dev.48 → 0.14.0-dev.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/FileManager/components/DestinationFolderPopup/DestinationFolderPopup.js +94 -87
- package/dist/components/FileManager/utils.js +31 -23
- package/dist/components-manifest.json +2 -2
- package/dist/dial-ui-kit.cjs +1 -1
- package/dist/file-manager.cjs +1 -1
- package/dist/src/components/FileManager/FileManager.d.ts +2 -1
- package/dist/src/components/FileManager/components/DestinationFolderPopup/DestinationFolderPopup.d.ts +2 -0
- package/dist/src/components/FileManager/utils.d.ts +11 -0
- package/dist/{use-file-manager-tabs-dJ-RvTEw.cjs → use-file-manager-tabs-DjdR_mYM.cjs} +2 -2
- package/package.json +1 -1
package/dist/components/FileManager/components/DestinationFolderPopup/DestinationFolderPopup.js
CHANGED
|
@@ -1,107 +1,113 @@
|
|
|
1
|
-
import { jsx as e, jsxs as s, Fragment as
|
|
2
|
-
import { DialPopup as
|
|
3
|
-
import { DialFileManager as
|
|
4
|
-
import { PopupSize as
|
|
5
|
-
import { DialPrimaryButton as b, DialNeutralButton as
|
|
6
|
-
import { DialButton as
|
|
7
|
-
import { ButtonAppearance as
|
|
8
|
-
import { IconFolderPlus as
|
|
1
|
+
import { jsx as e, jsxs as s, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { DialPopup as Z } from "../../../Popup/Popup.js";
|
|
3
|
+
import { DialFileManager as $ } from "../../FileManager.js";
|
|
4
|
+
import { PopupSize as P } from "../../../../types/popup.js";
|
|
5
|
+
import { DialPrimaryButton as b, DialNeutralButton as F } from "../../../Button/ButtonWrappers.js";
|
|
6
|
+
import { DialButton as L } from "../../../Button/Button.js";
|
|
7
|
+
import { ButtonAppearance as ee } from "../../../../types/button.js";
|
|
8
|
+
import { IconFolderPlus as B, IconEye as ie, IconDotsVertical as oe } from "@tabler/icons-react";
|
|
9
9
|
import { BASE_ICON_PROPS as r } from "../../../../constants/icon.js";
|
|
10
|
-
import { DialSwitch as
|
|
11
|
-
import { useState as
|
|
12
|
-
import { DestinationFolderMode as
|
|
13
|
-
import { DialTooltip as
|
|
14
|
-
import { mergeClasses as
|
|
15
|
-
import { DialNotification as
|
|
16
|
-
import { DialDropdown as
|
|
17
|
-
import { useIsMobileScreen as
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
import { DialSwitch as le } from "../../../Switch/Switch.js";
|
|
11
|
+
import { useState as R, useRef as ne, useMemo as x, useCallback as j } from "react";
|
|
12
|
+
import { DestinationFolderMode as T } from "../../../../types/file-manager.js";
|
|
13
|
+
import { DialTooltip as ae } from "../../../Tooltip/Tooltip.js";
|
|
14
|
+
import { mergeClasses as te } from "../../../../utils/merge-classes.js";
|
|
15
|
+
import { DialNotification as se } from "../../../Notification/Notification.js";
|
|
16
|
+
import { DialDropdown as re } from "../../../Dropdown/Dropdown.js";
|
|
17
|
+
import { useIsMobileScreen as ce } from "../../../../hooks/use-is-mobile-screen.js";
|
|
18
|
+
import { excludePathsFromTree as me } from "../../utils.js";
|
|
19
|
+
const we = ({
|
|
20
|
+
onClose: N,
|
|
21
|
+
onConfirm: y,
|
|
22
|
+
onFolderPopupPathChange: v,
|
|
22
23
|
setDestinationFolderPath: C,
|
|
23
|
-
open:
|
|
24
|
-
copyLabel:
|
|
25
|
-
moveLabel:
|
|
24
|
+
open: E,
|
|
25
|
+
copyLabel: D = "Copy",
|
|
26
|
+
moveLabel: O = "Move",
|
|
26
27
|
addFolderLabel: c = "Add folder",
|
|
27
|
-
mode: m =
|
|
28
|
+
mode: m = T.Copy,
|
|
28
29
|
hiddenFilesSwitcherLabel: f = "Show hidden files",
|
|
29
30
|
showHiddenFileSwitcher: l = !0,
|
|
30
|
-
showCreateFolderButton:
|
|
31
|
-
onUploadFiles:
|
|
32
|
-
onValidateUpload:
|
|
33
|
-
maxFileSize:
|
|
34
|
-
header:
|
|
35
|
-
sourceFolder:
|
|
36
|
-
disabledPathTooltip:
|
|
37
|
-
path:
|
|
38
|
-
collapsedFileTree:
|
|
39
|
-
alertProps:
|
|
40
|
-
processDestinationFolderPath:
|
|
31
|
+
showCreateFolderButton: n = !0,
|
|
32
|
+
onUploadFiles: _,
|
|
33
|
+
onValidateUpload: G,
|
|
34
|
+
maxFileSize: H,
|
|
35
|
+
header: U,
|
|
36
|
+
sourceFolder: p,
|
|
37
|
+
disabledPathTooltip: V = "Unavailable for the original path. Please select another folder",
|
|
38
|
+
path: a,
|
|
39
|
+
collapsedFileTree: q = !1,
|
|
40
|
+
alertProps: M,
|
|
41
|
+
processDestinationFolderPath: d,
|
|
42
|
+
excludedPaths: I,
|
|
43
|
+
items: k,
|
|
41
44
|
...o
|
|
42
45
|
}) => {
|
|
43
|
-
const [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
const [S, w] = R(!1), [J, h] = R(!1), u = ne(null), K = ce(), Q = x(
|
|
47
|
+
() => me(k, I),
|
|
48
|
+
[k, I]
|
|
49
|
+
), z = j((i) => {
|
|
50
|
+
w(i);
|
|
51
|
+
}, []), W = x(() => {
|
|
46
52
|
const i = [];
|
|
47
|
-
return
|
|
53
|
+
return n && i.push({
|
|
48
54
|
key: "add-folder",
|
|
49
55
|
label: c,
|
|
50
|
-
icon: /* @__PURE__ */ e(
|
|
56
|
+
icon: /* @__PURE__ */ e(B, { ...r, className: "text-secondary" }),
|
|
51
57
|
onClick: () => {
|
|
52
58
|
u.current?.createFolder(), h(!1);
|
|
53
59
|
}
|
|
54
60
|
}), l && i.push({
|
|
55
61
|
key: "show-hidden-files",
|
|
56
62
|
label: f,
|
|
57
|
-
icon: /* @__PURE__ */ e(
|
|
63
|
+
icon: /* @__PURE__ */ e(ie, { ...r, className: "text-secondary" }),
|
|
58
64
|
onClick: () => {
|
|
59
|
-
|
|
65
|
+
w((t) => !t), h(!1);
|
|
60
66
|
}
|
|
61
67
|
}), i;
|
|
62
68
|
}, [
|
|
63
69
|
c,
|
|
64
70
|
f,
|
|
65
71
|
l,
|
|
66
|
-
|
|
67
|
-
]),
|
|
72
|
+
n
|
|
73
|
+
]), X = j(
|
|
68
74
|
(i) => {
|
|
69
75
|
if (i) {
|
|
70
|
-
let t =
|
|
71
|
-
|
|
76
|
+
let t = d ? d(i) : i;
|
|
77
|
+
v?.(t), C?.(t);
|
|
72
78
|
}
|
|
73
79
|
},
|
|
74
80
|
[
|
|
75
|
-
|
|
81
|
+
v,
|
|
76
82
|
C,
|
|
77
|
-
|
|
83
|
+
d
|
|
78
84
|
]
|
|
79
|
-
),
|
|
85
|
+
), Y = m === T.Copy ? "Copy to" : "Move to", g = x(() => !a || !p ? !1 : p === a, [a, p]);
|
|
80
86
|
return /* @__PURE__ */ e(
|
|
81
|
-
|
|
87
|
+
Z,
|
|
82
88
|
{
|
|
83
|
-
open:
|
|
89
|
+
open: E,
|
|
84
90
|
onClose: () => {
|
|
85
|
-
|
|
91
|
+
N();
|
|
86
92
|
},
|
|
87
|
-
size:
|
|
93
|
+
size: P.Lg,
|
|
88
94
|
dividerFooter: !0,
|
|
89
95
|
dividers: !1,
|
|
90
96
|
className: "md:!h-[800px] !bg-layer-2",
|
|
91
97
|
footer: /* @__PURE__ */ s("div", { className: "flex justify-between items-center gap-2 p-4 md:px-6", children: [
|
|
92
|
-
/* @__PURE__ */ e("div", { className: "flex items-center gap-4 min-w-0", children:
|
|
93
|
-
|
|
98
|
+
/* @__PURE__ */ e("div", { className: "flex items-center gap-4 min-w-0", children: K ? /* @__PURE__ */ e(
|
|
99
|
+
re,
|
|
94
100
|
{
|
|
95
|
-
items:
|
|
96
|
-
open:
|
|
101
|
+
items: W,
|
|
102
|
+
open: J,
|
|
97
103
|
onOpenChange: h,
|
|
98
104
|
children: /* @__PURE__ */ e(
|
|
99
|
-
|
|
105
|
+
L,
|
|
100
106
|
{
|
|
101
107
|
className: "size-9 shrink-0",
|
|
102
108
|
"aria-label": "More options",
|
|
103
109
|
iconBefore: /* @__PURE__ */ e(
|
|
104
|
-
|
|
110
|
+
oe,
|
|
105
111
|
{
|
|
106
112
|
...r,
|
|
107
113
|
className: "text-secondary"
|
|
@@ -110,67 +116,68 @@ const Oe = ({
|
|
|
110
116
|
}
|
|
111
117
|
)
|
|
112
118
|
}
|
|
113
|
-
) : /* @__PURE__ */ s(
|
|
114
|
-
|
|
119
|
+
) : /* @__PURE__ */ s(A, { children: [
|
|
120
|
+
n && /* @__PURE__ */ e(
|
|
115
121
|
b,
|
|
116
122
|
{
|
|
117
123
|
label: c,
|
|
118
|
-
appearance:
|
|
119
|
-
iconBefore: /* @__PURE__ */ e(
|
|
124
|
+
appearance: ee.Ghost,
|
|
125
|
+
iconBefore: /* @__PURE__ */ e(B, { ...r }),
|
|
120
126
|
onClick: () => {
|
|
121
127
|
u.current?.createFolder();
|
|
122
128
|
}
|
|
123
129
|
}
|
|
124
130
|
),
|
|
125
|
-
|
|
126
|
-
l && /* @__PURE__ */ e(
|
|
127
|
-
|
|
131
|
+
n && l && /* @__PURE__ */ e("div", { className: "w-px h-[26px] bg-controls-disable-accent my-2" }),
|
|
132
|
+
l && /* @__PURE__ */ e(A, { children: /* @__PURE__ */ e("div", { className: "inline-flex items-center cursor-pointer", children: /* @__PURE__ */ e(
|
|
133
|
+
le,
|
|
128
134
|
{
|
|
129
135
|
label: f,
|
|
130
|
-
isOn:
|
|
131
|
-
onChange:
|
|
136
|
+
isOn: S,
|
|
137
|
+
onChange: z,
|
|
132
138
|
switchId: "hidden-files-switch-modal"
|
|
133
139
|
}
|
|
134
140
|
) }) })
|
|
135
141
|
] }) }),
|
|
136
142
|
/* @__PURE__ */ s("div", { className: "flex space-x-4 items-center", children: [
|
|
137
|
-
/* @__PURE__ */ e(
|
|
138
|
-
g ? /* @__PURE__ */ e(
|
|
143
|
+
/* @__PURE__ */ e(F, { onClick: N, label: "Cancel" }),
|
|
144
|
+
g ? /* @__PURE__ */ e(ae, { tooltip: V, children: /* @__PURE__ */ e(
|
|
139
145
|
b,
|
|
140
146
|
{
|
|
141
|
-
onClick:
|
|
142
|
-
label: m === "copy" ?
|
|
147
|
+
onClick: y,
|
|
148
|
+
label: m === "copy" ? D : O,
|
|
143
149
|
disabled: g,
|
|
144
150
|
"aria-disabled": g
|
|
145
151
|
}
|
|
146
152
|
) }) : /* @__PURE__ */ e(
|
|
147
153
|
b,
|
|
148
154
|
{
|
|
149
|
-
onClick:
|
|
150
|
-
label: m === "copy" ?
|
|
155
|
+
onClick: y,
|
|
156
|
+
label: m === "copy" ? D : O
|
|
151
157
|
}
|
|
152
158
|
)
|
|
153
159
|
] })
|
|
154
160
|
] }),
|
|
155
|
-
header:
|
|
161
|
+
header: U ?? Y,
|
|
156
162
|
children: /* @__PURE__ */ s("div", { className: "bg-layer-2 h-full flex flex-col", children: [
|
|
157
|
-
|
|
163
|
+
M && /* @__PURE__ */ e("div", { className: "px-6 mb-4 pt-4", children: /* @__PURE__ */ e(se, { ...M }) }),
|
|
158
164
|
/* @__PURE__ */ e("div", { className: "flex-1 min-h-0", children: /* @__PURE__ */ e(
|
|
159
|
-
|
|
165
|
+
$,
|
|
160
166
|
{
|
|
161
167
|
...o,
|
|
168
|
+
items: Q,
|
|
162
169
|
gridClassName: "size-full",
|
|
163
|
-
className:
|
|
170
|
+
className: te(
|
|
164
171
|
o.className,
|
|
165
172
|
"bg-layer-2 h-full flex pt-0"
|
|
166
173
|
),
|
|
167
174
|
actionsRef: u,
|
|
168
|
-
path:
|
|
169
|
-
showHiddenFiles:
|
|
170
|
-
onShowHiddenFilesChange:
|
|
175
|
+
path: a,
|
|
176
|
+
showHiddenFiles: S,
|
|
177
|
+
onShowHiddenFilesChange: z,
|
|
171
178
|
treeOptions: {
|
|
172
179
|
...o.treeOptions,
|
|
173
|
-
collapsed:
|
|
180
|
+
collapsed: q,
|
|
174
181
|
expandedPaths: /* @__PURE__ */ new Set([o.rootItem?.path || "/"]),
|
|
175
182
|
header: o.treeOptions?.header
|
|
176
183
|
},
|
|
@@ -179,10 +186,10 @@ const Oe = ({
|
|
|
179
186
|
elementId: "file-manager-destination-search",
|
|
180
187
|
...o.navigationPanelOptions
|
|
181
188
|
},
|
|
182
|
-
onUploadFiles:
|
|
183
|
-
onValidateUpload:
|
|
184
|
-
onPathChange:
|
|
185
|
-
maxFileSize:
|
|
189
|
+
onUploadFiles: _,
|
|
190
|
+
onValidateUpload: G,
|
|
191
|
+
onPathChange: X,
|
|
192
|
+
maxFileSize: H
|
|
186
193
|
}
|
|
187
194
|
) })
|
|
188
195
|
] })
|
|
@@ -190,5 +197,5 @@ const Oe = ({
|
|
|
190
197
|
);
|
|
191
198
|
};
|
|
192
199
|
export {
|
|
193
|
-
|
|
200
|
+
we as DialDestinationFolderPopup
|
|
194
201
|
};
|
|
@@ -17,7 +17,7 @@ const u = (t, e) => {
|
|
|
17
17
|
if (r.length <= 1) return t[0];
|
|
18
18
|
const o = "/" + r.slice(0, r.length - 1).join("/");
|
|
19
19
|
return u(t, o) ?? t[0];
|
|
20
|
-
},
|
|
20
|
+
}, d = (t) => (t ?? "").toLowerCase(), w = (t) => d(t).replace(/^\./, ""), D = (t) => {
|
|
21
21
|
if (!t) return [];
|
|
22
22
|
const e = [], n = (r) => {
|
|
23
23
|
const o = r.items ?? [];
|
|
@@ -25,11 +25,18 @@ const u = (t, e) => {
|
|
|
25
25
|
e.push(s), s.nodeType === p.FOLDER && n(s);
|
|
26
26
|
};
|
|
27
27
|
return n(t), e;
|
|
28
|
-
}, A = (t
|
|
28
|
+
}, A = (t, e) => {
|
|
29
|
+
if (!t?.length) return [];
|
|
30
|
+
if (!e?.length) return t;
|
|
31
|
+
const n = new Set(e), r = (o) => o.filter((s) => !n.has(s.path)).map(
|
|
32
|
+
(s) => s.items?.length ? { ...s, items: r(s.items) } : s
|
|
33
|
+
);
|
|
34
|
+
return r(t);
|
|
35
|
+
}, E = (t) => (t.name ?? t.path.split("/").pop() ?? "").startsWith("."), h = (t) => {
|
|
29
36
|
if (!t) return "0 bytes";
|
|
30
37
|
const e = 1024, n = e * 1024;
|
|
31
38
|
return t >= n ? `${(t / n).toFixed(1)} MB` : t >= e ? `${(t / e).toFixed(0)} KB` : `${t} bytes`;
|
|
32
|
-
},
|
|
39
|
+
}, v = (t, e = "en-US", n = {
|
|
33
40
|
year: "numeric",
|
|
34
41
|
month: "short",
|
|
35
42
|
day: "2-digit"
|
|
@@ -41,7 +48,7 @@ const u = (t, e) => {
|
|
|
41
48
|
return t;
|
|
42
49
|
}
|
|
43
50
|
};
|
|
44
|
-
function
|
|
51
|
+
function f(t, e, n) {
|
|
45
52
|
if (!t || t.includes("*/*"))
|
|
46
53
|
return !0;
|
|
47
54
|
const r = e.toLowerCase(), o = n && n.includes(".") ? `.${n.split(".").at(-1).toLowerCase()}` : void 0;
|
|
@@ -67,27 +74,27 @@ const g = (t) => t?.map((e) => e.endsWith("/*") ? e.replace("/*", "s") : F(e).fl
|
|
|
67
74
|
const e = t.flags.replace(/[gy]/g, "");
|
|
68
75
|
return new RegExp(t.source, e);
|
|
69
76
|
};
|
|
70
|
-
function
|
|
77
|
+
function B(t, e, n) {
|
|
71
78
|
if (e && T(e)?.test(t.name))
|
|
72
79
|
return n ?? `This ${t.isFolder ? "folder" : "file"} contains forbidden characters in its name. Please rename it.`;
|
|
73
80
|
}
|
|
74
|
-
const
|
|
81
|
+
const O = (t) => {
|
|
75
82
|
const e = t.lastIndexOf("/");
|
|
76
83
|
return e >= 0 ? {
|
|
77
84
|
parent: t.slice(0, e),
|
|
78
85
|
name: t.slice(e + 1)
|
|
79
86
|
} : { parent: "", name: t };
|
|
80
|
-
},
|
|
81
|
-
const r = !t.contentLength || n == null || t.contentLength <= n, o = !t.contentType ||
|
|
87
|
+
}, C = (t, e, n) => {
|
|
88
|
+
const r = !t.contentLength || n == null || t.contentLength <= n, o = !t.contentType || f(e, t.contentType, t.name);
|
|
82
89
|
return r && o;
|
|
83
|
-
},
|
|
90
|
+
}, N = (t, e, n, r, o) => {
|
|
84
91
|
if (t.nodeType === p.FOLDER) return;
|
|
85
92
|
const s = !t.contentLength || n == null || t.contentLength <= n;
|
|
86
|
-
if (!(!t.contentType ||
|
|
93
|
+
if (!(!t.contentType || f(e, t.contentType, t.name)))
|
|
87
94
|
return r ?? (e?.length ? `Unsupported file type. Supported types: ${g(e)}.` : "Unsupported file type.");
|
|
88
95
|
if (!s)
|
|
89
96
|
return o ?? `File is too large. Maximum size: ${h(n)}.`;
|
|
90
|
-
},
|
|
97
|
+
}, M = (t) => t.replace(/\/+$/, "").split("/").filter(Boolean).length, R = (t) => {
|
|
91
98
|
const e = `${m} `, n = new RegExp(`^${m} (\\d+)$`), r = new Set(
|
|
92
99
|
t.map((c) => c.name.toLowerCase())
|
|
93
100
|
), o = t.map((c) => {
|
|
@@ -101,21 +108,22 @@ const B = (t) => {
|
|
|
101
108
|
};
|
|
102
109
|
export {
|
|
103
110
|
T as cleanForbiddenSymbolsRegExp,
|
|
104
|
-
|
|
111
|
+
D as collectAllDescendants,
|
|
112
|
+
A as excludePathsFromTree,
|
|
105
113
|
x as findFolderForPath,
|
|
106
114
|
u as findNodeByPath,
|
|
107
115
|
g as formatAllowedFileTypesForTooltip,
|
|
108
116
|
h as formatBytes,
|
|
109
|
-
|
|
117
|
+
v as formatDate,
|
|
110
118
|
F as getExtensionsListForMimeType,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
M as getFolderNestingDepth,
|
|
120
|
+
B as getForbiddenSymbolsTooltip,
|
|
121
|
+
R as getNextFolderName,
|
|
122
|
+
N as getRowTooltip,
|
|
123
|
+
f as isFileAccepted,
|
|
124
|
+
C as isFileSelectable,
|
|
125
|
+
E as isHiddenDotFile,
|
|
126
|
+
w as normalizeExtensionWithoutDot,
|
|
127
|
+
d as normalizeToLowerCase,
|
|
128
|
+
O as splitPathAndName
|
|
121
129
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.14.0-dev.
|
|
3
|
-
"generatedAt": "2026-09-
|
|
2
|
+
"version": "0.14.0-dev.49",
|
|
3
|
+
"generatedAt": "2026-09-10T20:07:22.493Z",
|
|
4
4
|
"kit": {
|
|
5
5
|
"name": "@epam/ai-dial-ui-kit",
|
|
6
6
|
"description": "A modern UI kit for building AI DIAL interfaces with React",
|