vlite3 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AttachmentsList/AttachmentsList.vue.d.ts +19 -3
- package/components/AttachmentsList/AttachmentsList.vue.js +274 -111
- package/components/AttachmentsList/fileTypeIcon.d.ts +16 -0
- package/components/AttachmentsList/fileTypeIcon.js +127 -0
- package/components/AttachmentsList/index.d.ts +1 -0
- package/components/AttachmentsList/types.d.ts +74 -2
- package/components/Badge.vue.js +7 -7
- package/components/Button.vue.js +36 -43
- package/components/ButtonGroup.vue.js +2 -2
- package/components/ButtonGroup.vue2.js +8 -8
- package/components/CategoryManager/CategoryManager.vue.d.ts +36 -0
- package/components/CategoryManager/CategoryNode.vue.d.ts +15 -0
- package/components/CategoryManager/index.d.ts +2 -0
- package/components/CategoryManager/types.d.ts +43 -0
- package/components/Chat/ChatBubble.vue.js +150 -0
- package/components/Chat/ChatBubble.vue2.js +4 -0
- package/components/Chat/ChatInterface.vue.js +298 -0
- package/components/Chat/ChatInterface.vue2.js +4 -0
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
- package/components/Dropdown/DropdownMenu.vue.js +2 -2
- package/components/Dropdown/DropdownMenu.vue2.js +1 -0
- package/components/FilePicker/FilePicker.vue.js +117 -122
- package/components/Input.vue.js +28 -26
- package/components/Kanban/Kanban.vue.d.ts +9 -16
- package/components/Kanban/Kanban.vue.js +2 -2
- package/components/Kanban/Kanban.vue2.js +87 -35
- package/components/Kanban/types.d.ts +18 -0
- package/components/List/List.vue.js +89 -85
- package/components/Navbar/Navbar.vue.d.ts +4 -0
- package/components/Navbar/Navbar.vue.js +196 -173
- package/components/Navbar/NavbarTabs.vue.js +72 -66
- package/components/NavbarCommandPalette.vue.js +11 -11
- package/components/NumberInput.vue.js +2 -2
- package/components/NumberInput.vue2.js +144 -104
- package/components/Screen/Screen.vue.d.ts +11 -29
- package/components/Screen/Screen.vue.js +222 -190
- package/components/Screen/components/ScreenViewToggle.vue.d.ts +6 -3
- package/components/Screen/components/ScreenViewToggle.vue.js +29 -34
- package/components/Screen/types.d.ts +53 -7
- package/components/Stats/Stats.vue.d.ts +1 -0
- package/components/Stats/Stats.vue.js +184 -156
- package/components/Stats/types.d.ts +1 -0
- package/components/Workbook/Sheet.vue.d.ts +1 -1
- package/directives/vRipple.js +28 -9
- package/index.d.ts +1 -0
- package/index.js +101 -97
- package/package.json +1 -1
- package/style.css +1 -1
|
@@ -1,7 +1,23 @@
|
|
|
1
|
-
import { AttachmentsListProps } from './
|
|
1
|
+
import { AttachmentsListProps } from './';
|
|
2
2
|
declare const _default: import('vue').DefineComponent<AttachmentsListProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<AttachmentsListProps> & Readonly<{}>, {
|
|
3
|
-
variant: "default" | "inline";
|
|
3
|
+
variant: "default" | "list" | "inline" | "card";
|
|
4
|
+
size: "sm" | "md" | "lg";
|
|
5
|
+
itemClass: string;
|
|
6
|
+
gridClass: string;
|
|
4
7
|
canDownload: boolean;
|
|
5
8
|
canView: boolean;
|
|
6
|
-
|
|
9
|
+
clickToPreview: boolean;
|
|
10
|
+
showDownloadInList: boolean;
|
|
11
|
+
rootClass: string;
|
|
12
|
+
cardClass: string;
|
|
13
|
+
cardThumbnailClass: string;
|
|
14
|
+
cardInfoClass: string;
|
|
15
|
+
cardActionsClass: string;
|
|
16
|
+
listClass: string;
|
|
17
|
+
itemIconBoxClass: string;
|
|
18
|
+
itemNameClass: string;
|
|
19
|
+
itemSizeClass: string;
|
|
20
|
+
itemActionsClass: string;
|
|
21
|
+
emptyClass: string;
|
|
22
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
7
23
|
export default _default;
|
|
@@ -1,128 +1,291 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { $t as
|
|
6
|
-
import { downloadFile as
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class: "flex flex-col gap-1.5"
|
|
11
|
-
}, $ = { class: "flex items-center gap-2 overflow-hidden min-w-0" }, A = { class: "flex flex-col overflow-hidden leading-tight min-w-0" }, F = ["title"], U = { class: "flex items-center gap-0.5 shrink-0" }, j = ["aria-label"], S = ["aria-label", "onClick"], E = {
|
|
12
|
-
key: 1,
|
|
13
|
-
class: "text-sm text-muted-foreground italic bg-muted/10 p-4 rounded-lg border border-dashed border-border text-center"
|
|
14
|
-
}, O = /* @__PURE__ */ C({
|
|
1
|
+
import { defineComponent as S, ref as L, computed as f, openBlock as a, createElementBlock as o, normalizeClass as l, Fragment as v, renderList as U, createElementVNode as d, createBlock as u, unref as i, withCtx as T, createVNode as p, createCommentVNode as m, withModifiers as j, toDisplayString as y } from "vue";
|
|
2
|
+
import x from "../Modal.vue.js";
|
|
3
|
+
import P from "../Icon.vue.js";
|
|
4
|
+
import N from "../Button.vue.js";
|
|
5
|
+
import { $t as w } from "../../utils/i18n.js";
|
|
6
|
+
import { downloadFile as E } from "../../utils/functions.js";
|
|
7
|
+
import g from "../FilePreview/FilePreview.vue.js";
|
|
8
|
+
import { getFileTypeIcon as F } from "./fileTypeIcon.js";
|
|
9
|
+
const G = ["onClick"], K = ["src"], W = ["title"], q = { class: "vl-attachments-list__item-size text-xs text-muted-foreground mt-0.5" }, H = ["onClick"], J = { class: "flex items-center gap-3 overflow-hidden min-w-0" }, O = ["src"], Q = { class: "flex flex-col overflow-hidden leading-tight min-w-0" }, R = ["title"], X = ["aria-label"], Y = ["aria-label", "onClick"], ie = /* @__PURE__ */ S({
|
|
15
10
|
__name: "AttachmentsList",
|
|
16
11
|
props: {
|
|
17
12
|
attachments: {},
|
|
18
13
|
canView: { type: Boolean, default: !0 },
|
|
19
14
|
canDownload: { type: Boolean, default: !0 },
|
|
20
|
-
variant: { default: "default" }
|
|
15
|
+
variant: { default: "default" },
|
|
16
|
+
size: { default: "md" },
|
|
17
|
+
clickToPreview: { type: Boolean, default: !1 },
|
|
18
|
+
showDownloadInList: { type: Boolean, default: !0 },
|
|
19
|
+
rootClass: { default: "" },
|
|
20
|
+
gridClass: { default: "" },
|
|
21
|
+
cardClass: { default: "" },
|
|
22
|
+
cardThumbnailClass: { default: "" },
|
|
23
|
+
cardInfoClass: { default: "" },
|
|
24
|
+
cardActionsClass: { default: "" },
|
|
25
|
+
listClass: { default: "" },
|
|
26
|
+
itemClass: { default: "" },
|
|
27
|
+
itemIconBoxClass: { default: "" },
|
|
28
|
+
itemNameClass: { default: "" },
|
|
29
|
+
itemSizeClass: { default: "" },
|
|
30
|
+
itemActionsClass: { default: "" },
|
|
31
|
+
emptyClass: { default: "" }
|
|
21
32
|
},
|
|
22
|
-
setup(
|
|
23
|
-
const c =
|
|
24
|
-
if (!
|
|
25
|
-
const h = 1024,
|
|
26
|
-
return parseFloat((
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
setup(t) {
|
|
34
|
+
const c = t, b = L(null), k = f(() => c.attachments ? Array.isArray(c.attachments) ? c.attachments : [c.attachments] : []), I = (n) => {
|
|
35
|
+
if (!n) return "0 Bytes";
|
|
36
|
+
const h = 1024, e = ["Bytes", "KB", "MB", "GB"], s = Math.floor(Math.log(n) / Math.log(h));
|
|
37
|
+
return parseFloat((n / Math.pow(h, s)).toFixed(2)) + " " + e[s];
|
|
38
|
+
}, D = async (n) => {
|
|
39
|
+
n.fileUrl && n.fileUrl !== "#" && await E(n.fileUrl, n.fileName || "attachment");
|
|
40
|
+
}, A = (n) => n.fileType && n.fileType.startsWith("image/") ? !0 : /\.(jpg|jpeg|png|gif|webp|svg|bmp)(\?.*)?$/i.test(n.fileUrl || ""), V = (n) => {
|
|
41
|
+
c.clickToPreview && c.canView && (b.value = n);
|
|
42
|
+
}, $ = () => {
|
|
43
|
+
b.value = null;
|
|
44
|
+
}, r = f(() => {
|
|
45
|
+
switch (c.size) {
|
|
46
|
+
case "sm":
|
|
47
|
+
return {
|
|
48
|
+
item: "pl-2 pr-2.5 py-1.5 gap-1.5",
|
|
49
|
+
iconBox: "w-7 h-7 rounded",
|
|
50
|
+
icon: "w-3 h-3",
|
|
51
|
+
text: "text-[12px]",
|
|
52
|
+
subtext: "text-[9px]",
|
|
53
|
+
actions: "w-5 h-5 !min-w-[16px] !min-h-[16px]",
|
|
54
|
+
actionIcon: "w-3.5 h-3.5"
|
|
55
|
+
};
|
|
56
|
+
case "lg":
|
|
57
|
+
return {
|
|
58
|
+
item: "pl-3.5 pr-3 py-3 gap-3",
|
|
59
|
+
iconBox: "w-11 h-11 rounded-lg",
|
|
60
|
+
icon: "w-5 h-5",
|
|
61
|
+
text: "text-sm",
|
|
62
|
+
subtext: "-text-fs-3.5",
|
|
63
|
+
actions: "w-7.5 h-8",
|
|
64
|
+
actionIcon: "w-4 h-4"
|
|
65
|
+
};
|
|
66
|
+
default:
|
|
67
|
+
return {
|
|
68
|
+
item: "px-2.5 py-2.5 gap-2",
|
|
69
|
+
iconBox: "w-9 h-9 rounded-md",
|
|
70
|
+
icon: "w-4 h-4",
|
|
71
|
+
text: "-text-fs-2",
|
|
72
|
+
subtext: "text-[10px]",
|
|
73
|
+
actions: "w-7 h-7 !min-w-[20px] !min-h-[20px]",
|
|
74
|
+
actionIcon: "w-4 h-4"
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}), z = f(() => c.canView && !c.clickToPreview), B = f(() => c.canDownload && c.showDownloadInList), M = f(() => z.value || B.value);
|
|
78
|
+
return (n, h) => (a(), o("div", {
|
|
79
|
+
class: l(["vl-attachments-list w-full", t.rootClass])
|
|
80
|
+
}, [
|
|
81
|
+
k.value.length > 0 ? (a(), o(v, { key: 0 }, [
|
|
82
|
+
t.variant === "card" ? (a(), o("div", {
|
|
83
|
+
key: 0,
|
|
84
|
+
class: l(["vl-attachments-list__grid grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4", t.gridClass])
|
|
38
85
|
}, [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
86
|
+
(a(!0), o(v, null, U(k.value, (e, s) => (a(), o("div", {
|
|
87
|
+
key: s,
|
|
88
|
+
class: l(["vl-attachments-list__card relative group rounded-xl border border-border bg-body overflow-hidden hover:shadow-md transition-all flex flex-col", [{ "cursor-pointer": t.clickToPreview && t.canView }, t.cardClass]]),
|
|
89
|
+
onClick: (C) => V(s)
|
|
90
|
+
}, [
|
|
91
|
+
d("div", {
|
|
92
|
+
class: l(["vl-attachments-list__card-thumbnail h-40 w-full bg-muted/30 flex items-center justify-center overflow-hidden relative border-b border-border", t.cardThumbnailClass])
|
|
42
93
|
}, [
|
|
43
|
-
|
|
44
|
-
icon: "lucide:file-text",
|
|
45
|
-
class: l(["w-3.5 h-3.5", e.variant === "inline" ? "opacity-75" : "text-primary"])
|
|
46
|
-
}, null, 8, ["class"])
|
|
47
|
-
], 2),
|
|
48
|
-
i("div", A, [
|
|
49
|
-
i("span", {
|
|
50
|
-
class: l(["text-xs font-medium truncate", e.variant === "inline" ? "" : "text-foreground"]),
|
|
51
|
-
title: t.fileName
|
|
52
|
-
}, w(t.fileName || "Unnamed File"), 11, F),
|
|
53
|
-
i("span", {
|
|
54
|
-
class: l(["text-[10px]", e.variant === "inline" ? "opacity-50" : "text-muted-foreground"])
|
|
55
|
-
}, w(B(t.fileSize)), 3)
|
|
56
|
-
])
|
|
57
|
-
]),
|
|
58
|
-
i("div", U, [
|
|
59
|
-
e.variant === "inline" ? (n(), a(f, { key: 0 }, [
|
|
60
|
-
e.canView ? (n(), y(p, {
|
|
94
|
+
A(e) ? (a(), o("img", {
|
|
61
95
|
key: 0,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
96
|
+
src: e.thumbnailUrl || e.fileUrl,
|
|
97
|
+
class: "w-full h-full object-cover transition-transform group-hover:scale-105"
|
|
98
|
+
}, null, 8, K)) : (a(), u(P, {
|
|
99
|
+
key: 1,
|
|
100
|
+
icon: i(F)(e.fileName, e.fileUrl, e.fileType),
|
|
101
|
+
class: "w-12 h-12 text-muted-foreground/40 transition-transform group-hover:scale-110"
|
|
102
|
+
}, null, 8, ["icon"])),
|
|
103
|
+
t.clickToPreview ? m("", !0) : (a(), o("div", {
|
|
104
|
+
key: 2,
|
|
105
|
+
class: l(["vl-attachments-list__card-actions absolute top-2 right-2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity", t.cardActionsClass])
|
|
106
|
+
}, [
|
|
107
|
+
t.canView ? (a(), u(x, {
|
|
108
|
+
key: 0,
|
|
109
|
+
title: e.fileName || i(w)("common.words.preview", "Preview"),
|
|
110
|
+
"max-width": "max-w-3xl",
|
|
111
|
+
body: i(g),
|
|
112
|
+
bodyProps: { url: e.fileUrl, name: e.fileName, canDownload: t.canDownload }
|
|
113
|
+
}, {
|
|
114
|
+
trigger: T(() => [
|
|
115
|
+
p(N, {
|
|
116
|
+
variant: "secondary",
|
|
117
|
+
size: "xs",
|
|
74
118
|
icon: "lucide:eye",
|
|
75
|
-
class: "w-
|
|
119
|
+
class: "h-7 w-7 px-0 rounded-md shadow-sm"
|
|
76
120
|
})
|
|
77
|
-
],
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
121
|
+
]),
|
|
122
|
+
_: 1
|
|
123
|
+
}, 8, ["title", "body", "bodyProps"])) : m("", !0),
|
|
124
|
+
t.canDownload ? (a(), u(N, {
|
|
125
|
+
key: 1,
|
|
126
|
+
variant: "secondary",
|
|
127
|
+
size: "xs",
|
|
128
|
+
icon: "lucide:download",
|
|
129
|
+
class: "h-7 w-7 px-0 rounded-md shadow-sm",
|
|
130
|
+
onClick: j((C) => D(e), ["stop"])
|
|
131
|
+
}, null, 8, ["onClick"])) : m("", !0)
|
|
132
|
+
], 2))
|
|
133
|
+
], 2),
|
|
134
|
+
d("div", {
|
|
135
|
+
class: l(["vl-attachments-list__card-info p-3 flex flex-col min-w-0", t.cardInfoClass])
|
|
136
|
+
}, [
|
|
137
|
+
d("span", {
|
|
138
|
+
class: "vl-attachments-list__item-name text-sm font-medium truncate",
|
|
139
|
+
title: e.fileName
|
|
140
|
+
}, y(e.fileName || "Unnamed File"), 9, W),
|
|
141
|
+
d("span", q, y(I(e.fileSize)), 1)
|
|
142
|
+
], 2),
|
|
143
|
+
t.clickToPreview && t.canView ? (a(), u(x, {
|
|
144
|
+
key: 0,
|
|
145
|
+
show: b.value === s,
|
|
146
|
+
title: e.fileName || i(w)("common.words.preview", "Preview"),
|
|
147
|
+
"max-width": "max-w-3xl",
|
|
148
|
+
body: i(g),
|
|
149
|
+
bodyProps: { url: e.fileUrl, name: e.fileName, canDownload: t.canDownload },
|
|
150
|
+
onClose: $
|
|
151
|
+
}, null, 8, ["show", "title", "body", "bodyProps"])) : m("", !0)
|
|
152
|
+
], 10, G))), 128))
|
|
153
|
+
], 2)) : (a(), o("div", {
|
|
154
|
+
key: 1,
|
|
155
|
+
class: l(["vl-attachments-list__list flex flex-col gap-1.5", t.listClass])
|
|
156
|
+
}, [
|
|
157
|
+
(a(!0), o(v, null, U(k.value, (e, s) => (a(), o("div", {
|
|
158
|
+
key: s,
|
|
159
|
+
class: l(["vl-attachments-list__item flex items-center justify-between transition-colors rounded-lg", [
|
|
160
|
+
t.variant === "inline" ? "bg-[#79797924] hover:bg-[#7979793f]" : "border border-border bg-muted/20 hover:bg-muted/40",
|
|
161
|
+
r.value.item,
|
|
162
|
+
t.clickToPreview && t.canView ? "cursor-pointer select-none" : "",
|
|
163
|
+
t.itemClass
|
|
164
|
+
]]),
|
|
165
|
+
onClick: (C) => V(s)
|
|
166
|
+
}, [
|
|
167
|
+
d("div", J, [
|
|
168
|
+
d("div", {
|
|
169
|
+
class: l(["vl-attachments-list__item-icon-box flex items-center justify-center shrink-0 overflow-hidden relative", [
|
|
170
|
+
r.value.iconBox,
|
|
171
|
+
t.variant === "inline" ? "bg-[#79797924] hover:bg-[#7979793f]" : "bg-primary/10",
|
|
172
|
+
t.itemIconBoxClass
|
|
173
|
+
]])
|
|
87
174
|
}, [
|
|
88
|
-
|
|
175
|
+
A(e) ? (a(), o("img", {
|
|
176
|
+
key: 0,
|
|
177
|
+
src: e.thumbnailUrl || e.fileUrl,
|
|
178
|
+
class: "w-full h-full object-cover"
|
|
179
|
+
}, null, 8, O)) : (a(), u(P, {
|
|
180
|
+
key: 1,
|
|
181
|
+
icon: i(F)(e.fileName, e.fileUrl, e.fileType),
|
|
182
|
+
class: l([r.value.icon, t.variant === "inline" ? "opacity-75" : "text-primary"])
|
|
183
|
+
}, null, 8, ["icon", "class"]))
|
|
184
|
+
], 2),
|
|
185
|
+
d("div", Q, [
|
|
186
|
+
d("span", {
|
|
187
|
+
class: l(["vl-attachments-list__item-name font-medium truncate", [
|
|
188
|
+
r.value.text,
|
|
189
|
+
t.variant === "inline" ? "" : "text-foreground",
|
|
190
|
+
t.itemNameClass
|
|
191
|
+
]]),
|
|
192
|
+
title: e.fileName
|
|
193
|
+
}, y(e.fileName || "Unnamed File"), 11, R),
|
|
194
|
+
d("span", {
|
|
195
|
+
class: l(["vl-attachments-list__item-size mt-0.5", [
|
|
196
|
+
r.value.subtext,
|
|
197
|
+
t.variant === "inline" ? "opacity-50" : "text-muted-foreground",
|
|
198
|
+
t.itemSizeClass
|
|
199
|
+
]])
|
|
200
|
+
}, y(I(e.fileSize)), 3)
|
|
201
|
+
])
|
|
202
|
+
]),
|
|
203
|
+
M.value ? (a(), o("div", {
|
|
204
|
+
key: 0,
|
|
205
|
+
class: l(["vl-attachments-list__item-actions flex items-center shrink-0 ml-2", [t.size !== "lg" ? "gap-0.5" : "gap-0", t.itemActionsClass]]),
|
|
206
|
+
onClick: h[0] || (h[0] = j(() => {
|
|
207
|
+
}, ["stop"]))
|
|
208
|
+
}, [
|
|
209
|
+
t.variant === "inline" ? (a(), o(v, { key: 0 }, [
|
|
210
|
+
z.value ? (a(), u(x, {
|
|
211
|
+
key: 0,
|
|
212
|
+
title: e.fileName || i(w)("common.words.preview", "Preview"),
|
|
213
|
+
"max-width": "max-w-3xl",
|
|
214
|
+
body: i(g),
|
|
215
|
+
bodyProps: { url: e.fileUrl, name: e.fileName, canDownload: t.canDownload }
|
|
216
|
+
}, {
|
|
217
|
+
trigger: T(() => [
|
|
218
|
+
d("button", {
|
|
219
|
+
type: "button",
|
|
220
|
+
class: l(["inline-flex items-center justify-center rounded opacity-60 hover:opacity-100 bg-transparent! transition-all", r.value.actions]),
|
|
221
|
+
"aria-label": i(w)("common.words.preview", "Preview")
|
|
222
|
+
}, [
|
|
223
|
+
p(P, {
|
|
224
|
+
icon: "lucide:eye",
|
|
225
|
+
class: l(r.value.actionIcon)
|
|
226
|
+
}, null, 8, ["class"])
|
|
227
|
+
], 10, X)
|
|
228
|
+
]),
|
|
229
|
+
_: 1
|
|
230
|
+
}, 8, ["title", "body", "bodyProps"])) : m("", !0),
|
|
231
|
+
B.value ? (a(), o("button", {
|
|
232
|
+
key: 1,
|
|
233
|
+
type: "button",
|
|
234
|
+
class: l(["inline-flex items-center justify-center rounded opacity-60 hover:opacity-100 bg-transparent! transition-all", r.value.actions]),
|
|
235
|
+
"aria-label": i(w)("common.words.download", "Download"),
|
|
236
|
+
onClick: (C) => D(e)
|
|
237
|
+
}, [
|
|
238
|
+
p(P, {
|
|
239
|
+
icon: "lucide:download",
|
|
240
|
+
class: l(r.value.actionIcon)
|
|
241
|
+
}, null, 8, ["class"])
|
|
242
|
+
], 10, Y)) : m("", !0)
|
|
243
|
+
], 64)) : (a(), o(v, { key: 1 }, [
|
|
244
|
+
z.value ? (a(), u(x, {
|
|
245
|
+
key: 0,
|
|
246
|
+
title: e.fileName || i(w)("common.words.preview", "Preview"),
|
|
247
|
+
"max-width": "max-w-3xl",
|
|
248
|
+
body: i(g),
|
|
249
|
+
bodyProps: { url: e.fileUrl, name: e.fileName, canDownload: t.canDownload }
|
|
250
|
+
}, {
|
|
251
|
+
trigger: T(() => [
|
|
252
|
+
p(N, {
|
|
253
|
+
variant: "ghost",
|
|
254
|
+
size: "xs",
|
|
255
|
+
class: l([r.value.actions, "px-0"]),
|
|
256
|
+
icon: "lucide:eye"
|
|
257
|
+
}, null, 8, ["class"])
|
|
258
|
+
]),
|
|
259
|
+
_: 1
|
|
260
|
+
}, 8, ["title", "body", "bodyProps"])) : m("", !0),
|
|
261
|
+
B.value ? (a(), u(N, {
|
|
262
|
+
key: 1,
|
|
263
|
+
variant: "ghost",
|
|
264
|
+
size: "xs",
|
|
265
|
+
class: l([r.value.actions, "px-0"]),
|
|
89
266
|
icon: "lucide:download",
|
|
90
|
-
|
|
91
|
-
})
|
|
92
|
-
],
|
|
93
|
-
],
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}, 8, ["title", "body", "bodyProps"])) : u("", !0),
|
|
111
|
-
e.canDownload ? (n(), y(k, {
|
|
112
|
-
key: 1,
|
|
113
|
-
variant: "ghost",
|
|
114
|
-
size: "xs",
|
|
115
|
-
icon: "lucide:download",
|
|
116
|
-
class: "h-6 w-6 px-0",
|
|
117
|
-
onClick: (D) => b(t)
|
|
118
|
-
}, null, 8, ["onClick"])) : u("", !0)
|
|
119
|
-
], 64))
|
|
120
|
-
])
|
|
121
|
-
], 2))), 128))
|
|
122
|
-
])) : (n(), a("div", E, w(r(s)("common.words.noAttachments", "No attachments found.")), 1))
|
|
123
|
-
]));
|
|
267
|
+
onClick: (C) => D(e)
|
|
268
|
+
}, null, 8, ["class", "onClick"])) : m("", !0)
|
|
269
|
+
], 64))
|
|
270
|
+
], 2)) : m("", !0)
|
|
271
|
+
], 10, H))), 128)),
|
|
272
|
+
t.clickToPreview && t.canView ? (a(!0), o(v, { key: 0 }, U(k.value, (e, s) => (a(), u(x, {
|
|
273
|
+
key: `preview-${s}`,
|
|
274
|
+
show: b.value === s,
|
|
275
|
+
title: e.fileName || i(w)("common.words.preview", "Preview"),
|
|
276
|
+
"max-width": "max-w-3xl",
|
|
277
|
+
body: i(g),
|
|
278
|
+
bodyProps: { url: e.fileUrl, name: e.fileName, canDownload: t.canDownload },
|
|
279
|
+
onClose: $
|
|
280
|
+
}, null, 8, ["show", "title", "body", "bodyProps"]))), 128)) : m("", !0)
|
|
281
|
+
], 2))
|
|
282
|
+
], 64)) : (a(), o("div", {
|
|
283
|
+
key: 1,
|
|
284
|
+
class: l(["vl-attachments-list__empty text-sm text-muted-foreground italic bg-muted/10 p-4 rounded-lg border border-dashed border-border text-center", t.emptyClass])
|
|
285
|
+
}, y(i(w)("common.words.noAttachments", "No attachments found.")), 3))
|
|
286
|
+
], 2));
|
|
124
287
|
}
|
|
125
288
|
});
|
|
126
289
|
export {
|
|
127
|
-
|
|
290
|
+
ie as default
|
|
128
291
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps a file's name or MIME type to the most descriptive Lucide/Iconify icon string.
|
|
3
|
+
* Returns a fallback generic file icon when no match is found.
|
|
4
|
+
*
|
|
5
|
+
* Priority: explicit fileType (MIME) → file extension from fileName/fileUrl
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Returns the best Iconify icon string for a given file.
|
|
9
|
+
*
|
|
10
|
+
* Resolution order:
|
|
11
|
+
* 1. Extension from fileName
|
|
12
|
+
* 2. Extension from fileUrl
|
|
13
|
+
* 3. MIME type prefix match (fileType)
|
|
14
|
+
* 4. Generic fallback
|
|
15
|
+
*/
|
|
16
|
+
export declare function getFileTypeIcon(fileName?: string, fileUrl?: string, fileType?: string): string;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
const c = {
|
|
2
|
+
// ── PDFs ──────────────────────────────────────────────────────────────────
|
|
3
|
+
pdf: "lucide:file-text",
|
|
4
|
+
// ── Word / rich text ──────────────────────────────────────────────────────
|
|
5
|
+
doc: "lucide:file-text",
|
|
6
|
+
docx: "lucide:file-text",
|
|
7
|
+
odt: "lucide:file-text",
|
|
8
|
+
rtf: "lucide:file-text",
|
|
9
|
+
// ── Spreadsheets ──────────────────────────────────────────────────────────
|
|
10
|
+
xls: "lucide:file-spreadsheet",
|
|
11
|
+
xlsx: "lucide:file-spreadsheet",
|
|
12
|
+
ods: "lucide:file-spreadsheet",
|
|
13
|
+
csv: "lucide:file-spreadsheet",
|
|
14
|
+
tsv: "lucide:file-spreadsheet",
|
|
15
|
+
// ── Presentations ─────────────────────────────────────────────────────────
|
|
16
|
+
ppt: "lucide:presentation",
|
|
17
|
+
pptx: "lucide:presentation",
|
|
18
|
+
odp: "lucide:presentation",
|
|
19
|
+
key: "lucide:presentation",
|
|
20
|
+
// ── Plain text / markdown / config ────────────────────────────────────────
|
|
21
|
+
txt: "lucide:file-text",
|
|
22
|
+
md: "lucide:file-text",
|
|
23
|
+
mdx: "lucide:file-text",
|
|
24
|
+
rst: "lucide:file-text",
|
|
25
|
+
log: "lucide:scroll-text",
|
|
26
|
+
// ── Code ──────────────────────────────────────────────────────────────────
|
|
27
|
+
js: "lucide:file-code",
|
|
28
|
+
jsx: "lucide:file-code",
|
|
29
|
+
ts: "lucide:file-code",
|
|
30
|
+
tsx: "lucide:file-code",
|
|
31
|
+
vue: "lucide:file-code",
|
|
32
|
+
py: "lucide:file-code",
|
|
33
|
+
rb: "lucide:file-code",
|
|
34
|
+
php: "lucide:file-code",
|
|
35
|
+
go: "lucide:file-code",
|
|
36
|
+
rs: "lucide:file-code",
|
|
37
|
+
cpp: "lucide:file-code",
|
|
38
|
+
c: "lucide:file-code",
|
|
39
|
+
cs: "lucide:file-code",
|
|
40
|
+
java: "lucide:file-code",
|
|
41
|
+
kt: "lucide:file-code",
|
|
42
|
+
swift: "lucide:file-code",
|
|
43
|
+
html: "lucide:file-code",
|
|
44
|
+
css: "lucide:file-code",
|
|
45
|
+
scss: "lucide:file-code",
|
|
46
|
+
less: "lucide:file-code",
|
|
47
|
+
sh: "lucide:terminal",
|
|
48
|
+
bash: "lucide:terminal",
|
|
49
|
+
sql: "lucide:database",
|
|
50
|
+
json: "lucide:braces",
|
|
51
|
+
yaml: "lucide:braces",
|
|
52
|
+
yml: "lucide:braces",
|
|
53
|
+
toml: "lucide:braces",
|
|
54
|
+
xml: "lucide:code-xml",
|
|
55
|
+
// ── Archives ──────────────────────────────────────────────────────────────
|
|
56
|
+
zip: "lucide:file-archive",
|
|
57
|
+
rar: "lucide:file-archive",
|
|
58
|
+
"7z": "lucide:file-archive",
|
|
59
|
+
tar: "lucide:file-archive",
|
|
60
|
+
gz: "lucide:file-archive",
|
|
61
|
+
bz2: "lucide:file-archive",
|
|
62
|
+
// ── Audio ─────────────────────────────────────────────────────────────────
|
|
63
|
+
mp3: "lucide:file-audio",
|
|
64
|
+
wav: "lucide:file-audio",
|
|
65
|
+
ogg: "lucide:file-audio",
|
|
66
|
+
flac: "lucide:file-audio",
|
|
67
|
+
aac: "lucide:file-audio",
|
|
68
|
+
m4a: "lucide:file-audio",
|
|
69
|
+
wma: "lucide:file-audio",
|
|
70
|
+
opus: "lucide:file-audio",
|
|
71
|
+
// ── Video ─────────────────────────────────────────────────────────────────
|
|
72
|
+
mp4: "lucide:file-video",
|
|
73
|
+
mov: "lucide:file-video",
|
|
74
|
+
avi: "lucide:file-video",
|
|
75
|
+
mkv: "lucide:file-video",
|
|
76
|
+
webm: "lucide:file-video",
|
|
77
|
+
flv: "lucide:file-video",
|
|
78
|
+
wmv: "lucide:file-video",
|
|
79
|
+
m4v: "lucide:file-video",
|
|
80
|
+
"3gp": "lucide:file-video",
|
|
81
|
+
// ── Fonts ─────────────────────────────────────────────────────────────────
|
|
82
|
+
ttf: "lucide:type",
|
|
83
|
+
otf: "lucide:type",
|
|
84
|
+
woff: "lucide:type",
|
|
85
|
+
woff2: "lucide:type",
|
|
86
|
+
// ── Executables / binaries ────────────────────────────────────────────────
|
|
87
|
+
exe: "lucide:cog",
|
|
88
|
+
dmg: "lucide:disc",
|
|
89
|
+
apk: "lucide:smartphone",
|
|
90
|
+
deb: "lucide:package",
|
|
91
|
+
rpm: "lucide:package",
|
|
92
|
+
// ── eBooks ────────────────────────────────────────────────────────────────
|
|
93
|
+
epub: "lucide:book-open",
|
|
94
|
+
mobi: "lucide:book-open"
|
|
95
|
+
}, p = [
|
|
96
|
+
{ prefix: "video/", icon: "lucide:file-video" },
|
|
97
|
+
{ prefix: "audio/", icon: "lucide:file-audio" },
|
|
98
|
+
{ prefix: "text/", icon: "lucide:file-text" },
|
|
99
|
+
{ prefix: "application/pdf", icon: "lucide:file-text" },
|
|
100
|
+
{ prefix: "application/zip", icon: "lucide:file-archive" },
|
|
101
|
+
{ prefix: "application/vnd.ms-excel", icon: "lucide:file-spreadsheet" },
|
|
102
|
+
{ prefix: "application/vnd.openxmlformats-officedocument.spreadsheetml", icon: "lucide:file-spreadsheet" },
|
|
103
|
+
{ prefix: "application/vnd.ms-powerpoint", icon: "lucide:presentation" },
|
|
104
|
+
{ prefix: "application/vnd.openxmlformats-officedocument.presentationml", icon: "lucide:presentation" },
|
|
105
|
+
{ prefix: "application/msword", icon: "lucide:file-text" },
|
|
106
|
+
{ prefix: "application/vnd.openxmlformats-officedocument.wordprocessingml", icon: "lucide:file-text" }
|
|
107
|
+
], s = "lucide:file";
|
|
108
|
+
function t(i) {
|
|
109
|
+
if (!i) return "";
|
|
110
|
+
const l = i.split("?")[0].split("#")[0], e = l.lastIndexOf(".");
|
|
111
|
+
return e === -1 ? "" : l.slice(e + 1).toLowerCase();
|
|
112
|
+
}
|
|
113
|
+
function r(i, l, e) {
|
|
114
|
+
const d = t(i);
|
|
115
|
+
if (d && c[d]) return c[d];
|
|
116
|
+
const o = t(l);
|
|
117
|
+
if (o && c[o]) return c[o];
|
|
118
|
+
if (e) {
|
|
119
|
+
const u = e.toLowerCase();
|
|
120
|
+
for (const { prefix: f, icon: a } of p)
|
|
121
|
+
if (u.startsWith(f)) return a;
|
|
122
|
+
}
|
|
123
|
+
return s;
|
|
124
|
+
}
|
|
125
|
+
export {
|
|
126
|
+
r as getFileTypeIcon
|
|
127
|
+
};
|