vlite3 1.4.5 → 1.4.6
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/AppShell/AppShellLayoutStorefront.vue.d.ts +4 -17
- package/components/AppShell/AppShellLayoutStorefront.vue.js +116 -152
- package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
- package/components/AvatarUploader/AvatarUploader.vue.js +1 -1
- package/components/CategoryManager/CategoryManager.vue2.js +1 -1
- package/components/Chat/ChatInterface.vue.js +1 -1
- package/components/Comment/CommentEditor.vue.js +1 -1
- package/components/FilePicker/FilePickerDropzone.vue.d.ts +27 -0
- package/components/FilePicker/FilePickerDropzone.vue.js +117 -0
- package/components/FilePicker/FilePickerDropzone.vue2.js +4 -0
- package/components/FilePicker/FilePickerInput.vue.d.ts +22 -0
- package/components/FilePicker/FilePickerInput.vue.js +147 -0
- package/components/FilePicker/FilePickerInput.vue2.js +4 -0
- package/components/FilePicker/FilePreview.vue.d.ts +21 -0
- package/components/FilePicker/FilePreview.vue.js +95 -0
- package/components/FilePicker/FilePreview.vue2.js +4 -0
- package/components/FilePicker/composables/useFileProcessing.d.ts +65 -0
- package/components/FilePicker/composables/useFileProcessing.js +141 -0
- package/components/FilePicker/index.d.ts +2 -2
- package/components/FilePicker/{FilePicker.vue.d.ts → index.vue.d.ts} +11 -18
- package/components/FilePicker/index.vue.js +131 -0
- package/components/FilePicker/index.vue2.js +4 -0
- package/components/FilePicker/types.d.ts +17 -0
- package/components/FilePicker/utils.d.ts +23 -0
- package/components/FilePicker/utils.js +37 -0
- package/components/Form/AccordionView.vue.d.ts +26 -0
- package/components/Form/AccordionView.vue.js +219 -0
- package/components/Form/AccordionView.vue2.js +4 -0
- package/components/Form/FormField.vue.js +2 -2
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/TableRow.vue.d.ts +18 -0
- package/components/Form/TableRow.vue.js +88 -0
- package/components/Form/TableRow.vue2.js +4 -0
- package/components/Form/TableView.vue.d.ts +23 -0
- package/components/Form/TableView.vue.js +88 -0
- package/components/Form/TableView.vue2.js +4 -0
- package/components/Form/composables/useCustomFieldRows.d.ts +52 -0
- package/components/Form/composables/useCustomFieldRows.js +77 -0
- package/components/Form/index.d.ts +1 -1
- package/components/Form/{CustomFields.vue.d.ts → index.vue.d.ts} +5 -6
- package/components/Form/index.vue.js +7 -0
- package/components/Form/index.vue2.js +141 -0
- package/components/Form/rowHelpers.d.ts +45 -0
- package/components/Form/rowHelpers.js +40 -0
- package/components/IconPicker.vue.d.ts +2 -2
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/ThumbnailSelector/ThumbnailSelector.vue.js +1 -1
- package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +1 -1
- package/components/index.d.ts +1 -1
- package/index.js +2 -2
- package/package.json +1 -1
- package/style.css +1 -1
- package/components/FilePicker/FilePicker.vue.js +0 -437
- package/components/FilePicker/FilePicker.vue2.js +0 -4
- package/components/Form/CustomFields.vue.js +0 -7
- package/components/Form/CustomFields.vue2.js +0 -465
|
@@ -7,31 +7,18 @@ declare function __VLS_template(): {
|
|
|
7
7
|
toggle: () => boolean;
|
|
8
8
|
}): any;
|
|
9
9
|
left?(_: {}): any;
|
|
10
|
-
left?(_: {}): any;
|
|
11
|
-
nav?(_: {}): any;
|
|
12
|
-
nav?(_: {}): any;
|
|
13
|
-
logo?(_: {}): any;
|
|
14
|
-
logo?(_: {}): any;
|
|
15
|
-
center?(_: {}): any;
|
|
16
10
|
center?(_: {}): any;
|
|
17
|
-
search?(_: {}): any;
|
|
18
|
-
search?(_: {}): any;
|
|
19
|
-
actions?(_: {}): any;
|
|
20
|
-
actions?(_: {}): any;
|
|
21
11
|
right?(_: {}): any;
|
|
22
|
-
|
|
23
|
-
'mobile-search'?(_: {}): any;
|
|
24
|
-
categories?(_: {
|
|
25
|
-
categoryRoutePrefix: string;
|
|
26
|
-
}): any;
|
|
12
|
+
'mobile-bottom'?(_: {}): any;
|
|
27
13
|
categories?(_: {
|
|
28
14
|
categoryRoutePrefix: string;
|
|
29
15
|
}): any;
|
|
30
16
|
main?(_: {}): any;
|
|
31
17
|
footer?(_: {}): any;
|
|
32
18
|
'mobile-sidebar-header'?(_: {}): any;
|
|
33
|
-
'mobile-sidebar'?(_: {
|
|
34
|
-
|
|
19
|
+
'mobile-sidebar'?(_: {
|
|
20
|
+
categoryRoutePrefix: string;
|
|
21
|
+
}): any;
|
|
35
22
|
'mobile-sidebar-footer'?(_: {}): any;
|
|
36
23
|
};
|
|
37
24
|
refs: {
|
|
@@ -1,215 +1,179 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as z, inject as T, computed as v, openBlock as t, createElementBlock as i, renderSlot as l, createCommentVNode as d, createElementVNode as a, normalizeClass as n, unref as e, createVNode as f, isRef as y, createSlots as _, withCtx as w } from "vue";
|
|
2
|
+
import R from "../Icon.vue.js";
|
|
3
|
+
import P from "../SidePanel.vue.js";
|
|
4
|
+
import V from "../Navbar/NavbarTabs.vue.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import
|
|
6
|
+
import j from "../Breadcrumb/Breadcrumb.vue.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import { APPSHELL_LAYOUT_KEY as
|
|
9
|
-
import { normalizeRoutePrefix as
|
|
10
|
-
const
|
|
8
|
+
import { APPSHELL_LAYOUT_KEY as N } from "./useAppShell.js";
|
|
9
|
+
import { normalizeRoutePrefix as B } from "../CategoryMenu/utils.js";
|
|
10
|
+
const E = { class: "vlite-app-layout flex flex-col w-full h-full min-h-0 bg-body text-foreground overflow-hidden" }, L = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "shrink-0 w-full"
|
|
13
|
-
},
|
|
13
|
+
}, M = { class: "w-full mx-auto max-w-7xl px-3 sm:px-4 md:px-6 lg:px-8" }, O = ["aria-label"], A = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "flex items-center justify-center min-w-0 flex-1 px-2"
|
|
16
|
+
}, U = { class: "w-full min-w-0 max-w-7xl mx-auto overflow-hidden px-3 sm:px-4 md:px-6 lg:px-8" }, Y = {
|
|
14
17
|
key: 0,
|
|
15
18
|
class: "shrink-0 w-full"
|
|
16
|
-
},
|
|
19
|
+
}, D = {
|
|
17
20
|
key: 2,
|
|
18
21
|
class: "shrink-0 w-full border-t border-border bg-background"
|
|
19
|
-
},
|
|
22
|
+
}, H = { class: "flex flex-col h-full" }, I = {
|
|
20
23
|
class: "flex-1 overflow-y-auto px-3.5 py-4 space-y-4 scrollbar-thin scrollbar-stable",
|
|
21
24
|
style: { "will-change": "transform", contain: "layout style" }
|
|
22
|
-
},
|
|
25
|
+
}, K = {
|
|
23
26
|
key: 0,
|
|
24
27
|
class: "mt-auto border-t border-border px-3.5 py-3"
|
|
25
|
-
}, te = /* @__PURE__ */
|
|
28
|
+
}, te = /* @__PURE__ */ z({
|
|
26
29
|
__name: "AppShellLayoutStorefront",
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
29
|
-
props:
|
|
30
|
-
isMobileMenuOpen:
|
|
31
|
-
isSidebarVisible:
|
|
32
|
-
toggleSidebar:
|
|
33
|
-
pageTitle:
|
|
34
|
-
breadcrumbData:
|
|
35
|
-
breakpointClasses:
|
|
36
|
-
nestedTabsItems:
|
|
30
|
+
setup(q) {
|
|
31
|
+
const k = T(N), {
|
|
32
|
+
props: s,
|
|
33
|
+
isMobileMenuOpen: r,
|
|
34
|
+
isSidebarVisible: F,
|
|
35
|
+
toggleSidebar: G,
|
|
36
|
+
pageTitle: J,
|
|
37
|
+
breadcrumbData: p,
|
|
38
|
+
breakpointClasses: u,
|
|
39
|
+
nestedTabsItems: g,
|
|
37
40
|
activeNestedTab: c,
|
|
38
|
-
handleNestedTabClick:
|
|
39
|
-
mainScrollRef:
|
|
40
|
-
layoutMainRef:
|
|
41
|
-
} =
|
|
41
|
+
handleNestedTabClick: x,
|
|
42
|
+
mainScrollRef: $,
|
|
43
|
+
layoutMainRef: C
|
|
44
|
+
} = k, S = v(() => [
|
|
42
45
|
"w-full shrink-0 bg-background transition-shadow duration-200",
|
|
43
46
|
{
|
|
44
47
|
fixed: "fixed top-0 left-0 z-50",
|
|
45
48
|
sticky: "sticky top-0 z-50",
|
|
46
49
|
relative: "relative z-20",
|
|
47
50
|
absolute: "absolute top-0 left-0 w-full z-50"
|
|
48
|
-
}[
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
].filter(Boolean).join(" ")), h = v(() =>
|
|
54
|
-
return (
|
|
55
|
-
|
|
56
|
-
o
|
|
57
|
-
])) :
|
|
58
|
-
|
|
59
|
-
class:
|
|
51
|
+
}[s.position || "sticky"],
|
|
52
|
+
s.border ? "border-b border-border" : "",
|
|
53
|
+
s.glass ? "bg-background/90 backdrop-blur-md" : "",
|
|
54
|
+
s.floating ? "m-3 rounded-lg border border-border shadow-sm overflow-hidden" : "",
|
|
55
|
+
s.class
|
|
56
|
+
].filter(Boolean).join(" ")), h = v(() => B(s.categoryRoutePrefix));
|
|
57
|
+
return (o, m) => (t(), i("div", E, [
|
|
58
|
+
o.$slots.announcement ? (t(), i("div", L, [
|
|
59
|
+
l(o.$slots, "announcement")
|
|
60
|
+
])) : d("", !0),
|
|
61
|
+
a("header", {
|
|
62
|
+
class: n(S.value)
|
|
60
63
|
}, [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
class:
|
|
64
|
+
a("div", M, [
|
|
65
|
+
a("div", {
|
|
66
|
+
class: n(["flex w-full items-center justify-between gap-3 md:gap-6", e(s).height])
|
|
64
67
|
}, [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
68
|
+
a("div", {
|
|
69
|
+
class: n(["flex items-center gap-2 sm:gap-4 min-w-0 shrink-0", { "flex-1": !o.$slots.center }])
|
|
70
|
+
}, [
|
|
71
|
+
l(o.$slots, "mobile-trigger", {
|
|
72
|
+
isOpen: e(r),
|
|
73
|
+
toggle: () => r.value = !e(r)
|
|
69
74
|
}, () => [
|
|
70
|
-
|
|
75
|
+
a("button", {
|
|
71
76
|
type: "button",
|
|
72
|
-
class:
|
|
73
|
-
"aria-label":
|
|
74
|
-
onClick:
|
|
77
|
+
class: n(["inline-flex items-center justify-center w-9 h-9 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent", [e(u).mobileTrigger, e(s).mobileTriggerClass]]),
|
|
78
|
+
"aria-label": e(r) ? "Close menu" : "Open menu",
|
|
79
|
+
onClick: m[0] || (m[0] = (b) => r.value = !e(r))
|
|
75
80
|
}, [
|
|
76
|
-
|
|
77
|
-
icon:
|
|
81
|
+
f(R, {
|
|
82
|
+
icon: e(r) ? "lucide:x" : "lucide:menu",
|
|
78
83
|
class: "w-5 h-5"
|
|
79
84
|
}, null, 8, ["icon"])
|
|
80
|
-
], 10,
|
|
85
|
+
], 10, O)
|
|
81
86
|
]),
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
key: 1,
|
|
90
|
-
class: a(["items-center gap-1 min-w-0", s(m).desktopContent]),
|
|
91
|
-
"aria-label": "Primary navigation"
|
|
92
|
-
}, [
|
|
93
|
-
o(e.$slots, "nav")
|
|
94
|
-
], 2)) : i("", !0)
|
|
95
|
-
]),
|
|
96
|
-
e.$slots.logo || e.$slots.center ? (r(), t("div", {
|
|
97
|
-
key: 0,
|
|
98
|
-
class: a(["min-w-0 justify-self-center flex items-center justify-center", s(l).logoClass])
|
|
99
|
-
}, [
|
|
100
|
-
o(e.$slots, "logo", {}, () => [
|
|
101
|
-
o(e.$slots, "center")
|
|
102
|
-
])
|
|
103
|
-
], 2)) : i("", !0),
|
|
104
|
-
d("div", {
|
|
105
|
-
class: a(["flex items-center justify-end gap-2 min-w-0 justify-self-end", s(l).rightClass])
|
|
87
|
+
l(o.$slots, "left")
|
|
88
|
+
], 2),
|
|
89
|
+
o.$slots.center ? (t(), i("div", A, [
|
|
90
|
+
l(o.$slots, "center")
|
|
91
|
+
])) : d("", !0),
|
|
92
|
+
a("div", {
|
|
93
|
+
class: n(["flex items-center justify-end gap-2 sm:gap-4 min-w-0 shrink-0", [e(s).rightClass, { "flex-1": !o.$slots.center }]])
|
|
106
94
|
}, [
|
|
107
|
-
|
|
108
|
-
key: 0,
|
|
109
|
-
class: a(["items-center min-w-0 w-full max-w-sm", s(m).desktopContent])
|
|
110
|
-
}, [
|
|
111
|
-
o(e.$slots, "search")
|
|
112
|
-
], 2)) : i("", !0),
|
|
113
|
-
o(e.$slots, "actions", {}, () => [
|
|
114
|
-
o(e.$slots, "right")
|
|
115
|
-
])
|
|
95
|
+
l(o.$slots, "right")
|
|
116
96
|
], 2)
|
|
117
97
|
], 2),
|
|
118
|
-
|
|
98
|
+
o.$slots["mobile-bottom"] ? (t(), i("div", {
|
|
119
99
|
key: 0,
|
|
120
|
-
class:
|
|
100
|
+
class: n(["pb-3 w-full", e(u).mobileTrigger])
|
|
121
101
|
}, [
|
|
122
|
-
o
|
|
123
|
-
|
|
124
|
-
])
|
|
125
|
-
], 2)) : i("", !0)
|
|
102
|
+
l(o.$slots, "mobile-bottom")
|
|
103
|
+
], 2)) : d("", !0)
|
|
126
104
|
]),
|
|
127
|
-
|
|
105
|
+
o.$slots.categories ? (t(), i("div", {
|
|
128
106
|
key: 0,
|
|
129
|
-
class:
|
|
107
|
+
class: n(["w-full min-w-0 overflow-hidden border-t border-border bg-background", [e(u).desktopContent, e(s).menuClass]])
|
|
130
108
|
}, [
|
|
131
|
-
|
|
132
|
-
o
|
|
109
|
+
a("div", U, [
|
|
110
|
+
l(o.$slots, "categories", { categoryRoutePrefix: h.value })
|
|
133
111
|
])
|
|
134
|
-
], 2)) :
|
|
112
|
+
], 2)) : d("", !0)
|
|
135
113
|
], 2),
|
|
136
|
-
|
|
114
|
+
o.$slots.main ? (t(), i("main", {
|
|
137
115
|
key: 1,
|
|
138
116
|
ref_key: "layoutMainRef",
|
|
139
|
-
ref:
|
|
117
|
+
ref: C,
|
|
140
118
|
class: "flex-1 overflow-hidden w-full relative flex flex-col min-h-0"
|
|
141
119
|
}, [
|
|
142
|
-
s
|
|
143
|
-
|
|
144
|
-
modelValue:
|
|
145
|
-
"onUpdate:modelValue":
|
|
146
|
-
onChange:
|
|
147
|
-
items:
|
|
120
|
+
e(s).renderNestedTabs && e(g).length > 0 ? (t(), i("div", Y, [
|
|
121
|
+
f(V, {
|
|
122
|
+
modelValue: e(c),
|
|
123
|
+
"onUpdate:modelValue": m[1] || (m[1] = (b) => y(c) ? c.value = b : null),
|
|
124
|
+
onChange: e(x),
|
|
125
|
+
items: e(g)
|
|
148
126
|
}, null, 8, ["modelValue", "onChange", "items"])
|
|
149
|
-
])) :
|
|
150
|
-
s
|
|
127
|
+
])) : d("", !0),
|
|
128
|
+
e(s).breadcrumb && e(s).breadcrumbPosition === "main" && e(p).items.value.length > 1 ? (t(), i("div", {
|
|
151
129
|
key: 1,
|
|
152
|
-
class:
|
|
130
|
+
class: n(["shrink-0 w-full border-b border-border px-6 py-2", e(s).breadcrumbClass])
|
|
153
131
|
}, [
|
|
154
|
-
|
|
155
|
-
items:
|
|
156
|
-
variant: s
|
|
157
|
-
separator: s
|
|
158
|
-
size: s
|
|
132
|
+
f(e(j), {
|
|
133
|
+
items: e(p).items.value,
|
|
134
|
+
variant: e(s).breadcrumbVariant,
|
|
135
|
+
separator: e(s).breadcrumbSeparator,
|
|
136
|
+
size: e(s).breadcrumbSize
|
|
159
137
|
}, null, 8, ["items", "variant", "separator", "size"])
|
|
160
|
-
], 2)) :
|
|
161
|
-
|
|
138
|
+
], 2)) : d("", !0),
|
|
139
|
+
a("div", {
|
|
162
140
|
ref_key: "mainScrollRef",
|
|
163
|
-
ref:
|
|
141
|
+
ref: $,
|
|
164
142
|
style: { "will-change": "transform", contain: "layout style" },
|
|
165
|
-
class:
|
|
143
|
+
class: n(["flex-1 overflow-y-auto w-full relative h-full scrollbar-thin scrollbar-stable", e(s).contentClass])
|
|
166
144
|
}, [
|
|
167
|
-
o
|
|
145
|
+
l(o.$slots, "main")
|
|
168
146
|
], 2)
|
|
169
|
-
], 512)) :
|
|
170
|
-
|
|
171
|
-
o
|
|
172
|
-
])) :
|
|
173
|
-
|
|
174
|
-
show:
|
|
175
|
-
"onUpdate:show":
|
|
147
|
+
], 512)) : d("", !0),
|
|
148
|
+
o.$slots.footer ? (t(), i("footer", D, [
|
|
149
|
+
l(o.$slots, "footer")
|
|
150
|
+
])) : d("", !0),
|
|
151
|
+
f(P, {
|
|
152
|
+
show: e(r),
|
|
153
|
+
"onUpdate:show": m[2] || (m[2] = (b) => y(r) ? r.value = b : null),
|
|
176
154
|
position: "left",
|
|
177
155
|
size: "sm",
|
|
178
|
-
triggerClass:
|
|
179
|
-
class:
|
|
156
|
+
triggerClass: e(u).mobileTrigger,
|
|
157
|
+
class: n(["z-60", e(u).mobileTrigger]),
|
|
180
158
|
headerClass: "pl-3! pr-4.5! py-3!",
|
|
181
159
|
bodyClass: "p-0!"
|
|
182
|
-
},
|
|
183
|
-
default:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
o
|
|
187
|
-
o(e.$slots, "mobile-nav", {}, () => [
|
|
188
|
-
o(e.$slots, "nav")
|
|
189
|
-
]),
|
|
190
|
-
o(e.$slots, "categories", { categoryRoutePrefix: h.value }),
|
|
191
|
-
o(e.$slots, "left")
|
|
192
|
-
])
|
|
160
|
+
}, _({
|
|
161
|
+
default: w(() => [
|
|
162
|
+
a("div", H, [
|
|
163
|
+
a("div", I, [
|
|
164
|
+
l(o.$slots, "mobile-sidebar", { categoryRoutePrefix: h.value })
|
|
193
165
|
]),
|
|
194
|
-
|
|
195
|
-
o
|
|
196
|
-
|
|
197
|
-
o(e.$slots, "right")
|
|
198
|
-
])
|
|
199
|
-
])
|
|
200
|
-
])) : i("", !0)
|
|
166
|
+
o.$slots["mobile-sidebar-footer"] ? (t(), i("div", K, [
|
|
167
|
+
l(o.$slots, "mobile-sidebar-footer")
|
|
168
|
+
])) : d("", !0)
|
|
201
169
|
])
|
|
202
170
|
]),
|
|
203
171
|
_: 2
|
|
204
172
|
}, [
|
|
205
|
-
|
|
173
|
+
o.$slots["mobile-sidebar-header"] ? {
|
|
206
174
|
name: "header",
|
|
207
|
-
fn:
|
|
208
|
-
o
|
|
209
|
-
o(e.$slots, "logo", {}, () => [
|
|
210
|
-
o(e.$slots, "center")
|
|
211
|
-
])
|
|
212
|
-
])
|
|
175
|
+
fn: w(() => [
|
|
176
|
+
l(o.$slots, "mobile-sidebar-header")
|
|
213
177
|
]),
|
|
214
178
|
key: "0"
|
|
215
179
|
} : void 0
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as x, ref as w, computed as z, openBlock as i, createElementBlock as n, createElementVNode as b, normalizeClass as r, createVNode as o, withCtx as V, createCommentVNode as g, withModifiers as C } from "vue";
|
|
2
2
|
import c from "../Icon.vue.js";
|
|
3
|
-
import U from "../FilePicker/
|
|
3
|
+
import U from "../FilePicker/index.vue.js";
|
|
4
4
|
import $ from "../Avatar.vue.js";
|
|
5
5
|
const A = ["data-testid"], R = ["onClick"], F = /* @__PURE__ */ x({
|
|
6
6
|
name: "AvatarUploader",
|
|
@@ -2,7 +2,7 @@ import { defineComponent as te, ref as p, computed as w, onMounted as le, onUnmo
|
|
|
2
2
|
import ce from "./ChatBubble.vue.js";
|
|
3
3
|
import V from "../Button.vue.js";
|
|
4
4
|
import K from "../Icon.vue.js";
|
|
5
|
-
import ue from "../FilePicker/
|
|
5
|
+
import ue from "../FilePicker/index.vue.js";
|
|
6
6
|
import { useFileUpload as fe } from "../Form/composables/useFileUpload.js";
|
|
7
7
|
import { $t as u } from "../../utils/i18n.js";
|
|
8
8
|
const me = { class: "flex flex-col w-full h-full flex-1 min-h-0 bg-transparent" }, ve = {
|
|
@@ -3,7 +3,7 @@ import { $t as k } from "../../utils/i18n.js";
|
|
|
3
3
|
import C from "../Button.vue.js";
|
|
4
4
|
import w from "../Icon.vue.js";
|
|
5
5
|
import O from "../Avatar.vue.js";
|
|
6
|
-
import Q from "../FilePicker/
|
|
6
|
+
import Q from "../FilePicker/index.vue.js";
|
|
7
7
|
import { useFileUpload as W } from "../Form/composables/useFileUpload.js";
|
|
8
8
|
const X = { class: "flex-1 min-w-0 flex flex-col gap-2" }, Y = {
|
|
9
9
|
key: 0,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { FilePickerValue } from './types';
|
|
2
|
+
interface Props {
|
|
3
|
+
displayFiles: FilePickerValue[];
|
|
4
|
+
hasValue: boolean;
|
|
5
|
+
multiSelect: boolean;
|
|
6
|
+
maxFiles?: number;
|
|
7
|
+
loading: boolean;
|
|
8
|
+
isProcessing: boolean;
|
|
9
|
+
disabled: boolean;
|
|
10
|
+
allowRename: boolean;
|
|
11
|
+
fileTypes: string[];
|
|
12
|
+
displayText: string;
|
|
13
|
+
dragAndDropLabel: string;
|
|
14
|
+
enterFileNameLabel: string;
|
|
15
|
+
renameFileLabel: string;
|
|
16
|
+
addMoreLabel: string;
|
|
17
|
+
dataTestid: string;
|
|
18
|
+
getPreviewSrc: (file: FilePickerValue) => string;
|
|
19
|
+
onTrigger: () => void;
|
|
20
|
+
onRemove: (index: number) => void;
|
|
21
|
+
onRename: (index: number, newName: string) => void;
|
|
22
|
+
onDrop: (fileList: FileList) => void;
|
|
23
|
+
}
|
|
24
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
25
|
+
containerRef: HTMLDivElement;
|
|
26
|
+
}, HTMLDivElement>;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { defineComponent as F, ref as u, computed as D, openBlock as n, createElementBlock as t, normalizeClass as k, createElementVNode as o, createBlock as s, toDisplayString as d, createTextVNode as T, createCommentVNode as g, Fragment as w, renderList as L, unref as B, createVNode as P } from "vue";
|
|
2
|
+
import f from "../Icon.vue.js";
|
|
3
|
+
import R from "../Button.vue.js";
|
|
4
|
+
import p from "./FilePreview.vue.js";
|
|
5
|
+
import { isImageFile as C } from "./utils.js";
|
|
6
|
+
const N = ["data-testid"], S = { class: "p-3 bg-muted rounded-full text-muted-foreground" }, V = { class: "space-y-1" }, z = { class: "text-sm font-medium text-foreground" }, A = { class: "text-primary hover:underline" }, M = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "text-xs text-muted-foreground"
|
|
9
|
+
}, $ = {
|
|
10
|
+
key: 1,
|
|
11
|
+
class: "space-y-2"
|
|
12
|
+
}, j = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "flex gap-2"
|
|
15
|
+
}, H = /* @__PURE__ */ F({
|
|
16
|
+
__name: "FilePickerDropzone",
|
|
17
|
+
props: {
|
|
18
|
+
displayFiles: {},
|
|
19
|
+
hasValue: { type: Boolean },
|
|
20
|
+
multiSelect: { type: Boolean },
|
|
21
|
+
maxFiles: {},
|
|
22
|
+
loading: { type: Boolean },
|
|
23
|
+
isProcessing: { type: Boolean },
|
|
24
|
+
disabled: { type: Boolean },
|
|
25
|
+
allowRename: { type: Boolean },
|
|
26
|
+
fileTypes: {},
|
|
27
|
+
displayText: {},
|
|
28
|
+
dragAndDropLabel: {},
|
|
29
|
+
enterFileNameLabel: {},
|
|
30
|
+
renameFileLabel: {},
|
|
31
|
+
addMoreLabel: {},
|
|
32
|
+
dataTestid: {},
|
|
33
|
+
getPreviewSrc: { type: Function },
|
|
34
|
+
onTrigger: { type: Function },
|
|
35
|
+
onRemove: { type: Function },
|
|
36
|
+
onRename: { type: Function },
|
|
37
|
+
onDrop: { type: Function }
|
|
38
|
+
},
|
|
39
|
+
setup(e) {
|
|
40
|
+
const a = e, l = u(!1), y = u(null), b = (i) => {
|
|
41
|
+
i.preventDefault(), !(a.disabled || a.loading) && (l.value = !0);
|
|
42
|
+
}, v = (i) => {
|
|
43
|
+
i.preventDefault(), l.value = !1;
|
|
44
|
+
}, x = (i) => {
|
|
45
|
+
i.preventDefault(), l.value = !1, !(a.disabled || a.loading || a.isProcessing) && i.dataTransfer?.files && a.onDrop(i.dataTransfer.files);
|
|
46
|
+
}, h = D(() => a.multiSelect ? a.maxFiles ? a.displayFiles.length < a.maxFiles : !0 : !1);
|
|
47
|
+
return (i, c) => (n(), t("div", {
|
|
48
|
+
ref_key: "containerRef",
|
|
49
|
+
ref: y,
|
|
50
|
+
class: "relative",
|
|
51
|
+
"data-testid": e.dataTestid,
|
|
52
|
+
onDragover: b,
|
|
53
|
+
onDragleave: v,
|
|
54
|
+
onDrop: x
|
|
55
|
+
}, [
|
|
56
|
+
e.hasValue ? (n(), t("div", $, [
|
|
57
|
+
(n(!0), t(w, null, L(e.displayFiles, (r, m) => (n(), s(p, {
|
|
58
|
+
key: m,
|
|
59
|
+
file: r,
|
|
60
|
+
index: m,
|
|
61
|
+
"allow-rename": e.allowRename,
|
|
62
|
+
disabled: e.disabled,
|
|
63
|
+
loading: e.loading,
|
|
64
|
+
"is-processing": e.isProcessing,
|
|
65
|
+
"multi-select": e.multiSelect,
|
|
66
|
+
"enter-file-name-label": e.enterFileNameLabel,
|
|
67
|
+
"rename-file-label": e.renameFileLabel,
|
|
68
|
+
"get-preview-src": e.getPreviewSrc,
|
|
69
|
+
"is-image": B(C),
|
|
70
|
+
"on-remove": e.onRemove,
|
|
71
|
+
"on-rename": e.onRename,
|
|
72
|
+
"on-trigger": e.onTrigger
|
|
73
|
+
}, null, 8, ["file", "index", "allow-rename", "disabled", "loading", "is-processing", "multi-select", "enter-file-name-label", "rename-file-label", "get-preview-src", "is-image", "on-remove", "on-rename", "on-trigger"]))), 128)),
|
|
74
|
+
h.value ? (n(), t("div", j, [
|
|
75
|
+
P(R, {
|
|
76
|
+
size: "sm",
|
|
77
|
+
variant: "outline",
|
|
78
|
+
icon: "lucide:plus",
|
|
79
|
+
text: e.addMoreLabel,
|
|
80
|
+
disabled: e.disabled || e.loading || e.isProcessing,
|
|
81
|
+
onClick: e.onTrigger
|
|
82
|
+
}, null, 8, ["text", "disabled", "onClick"])
|
|
83
|
+
])) : g("", !0)
|
|
84
|
+
])) : (n(), t("div", {
|
|
85
|
+
key: 0,
|
|
86
|
+
class: k(["border-2 bg-body border-dashed border-border rounded-lg p-6 transition-all duration-200 ease-in-out cursor-pointer flex flex-col items-center justify-center text-center gap-2", [
|
|
87
|
+
l.value ? "border-primary bg-primary/5" : "hover:border-primary/50",
|
|
88
|
+
e.disabled || e.loading || e.isProcessing ? "opacity-50 cursor-not-allowed" : ""
|
|
89
|
+
]]),
|
|
90
|
+
onClick: c[0] || (c[0] = //@ts-ignore
|
|
91
|
+
(...r) => e.onTrigger && e.onTrigger(...r))
|
|
92
|
+
}, [
|
|
93
|
+
o("div", S, [
|
|
94
|
+
e.loading || e.isProcessing ? (n(), s(f, {
|
|
95
|
+
key: 0,
|
|
96
|
+
icon: "lucide:loader-2",
|
|
97
|
+
class: "w-6 h-6 animate-spin"
|
|
98
|
+
})) : (n(), s(f, {
|
|
99
|
+
key: 1,
|
|
100
|
+
icon: "lucide:upload-cloud",
|
|
101
|
+
class: "w-6 h-6"
|
|
102
|
+
}))
|
|
103
|
+
]),
|
|
104
|
+
o("div", V, [
|
|
105
|
+
o("p", z, [
|
|
106
|
+
o("span", A, d(e.displayText), 1),
|
|
107
|
+
T(" " + d(e.dragAndDropLabel), 1)
|
|
108
|
+
]),
|
|
109
|
+
e.fileTypes.length ? (n(), t("p", M, d(e.fileTypes.join(", ")), 1)) : g("", !0)
|
|
110
|
+
])
|
|
111
|
+
], 2))
|
|
112
|
+
], 40, N));
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
export {
|
|
116
|
+
H as default
|
|
117
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FilePickerValue } from './types';
|
|
2
|
+
import { InputSize, InputRounded } from '../../types';
|
|
3
|
+
interface Props {
|
|
4
|
+
displayFiles: FilePickerValue[];
|
|
5
|
+
firstDisplayFile?: FilePickerValue;
|
|
6
|
+
hasValue: boolean;
|
|
7
|
+
multiSelect: boolean;
|
|
8
|
+
loading: boolean;
|
|
9
|
+
isProcessing: boolean;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
displayPlaceholder: string;
|
|
12
|
+
acceptedFileSummary: string;
|
|
13
|
+
size: InputSize;
|
|
14
|
+
rounded: InputRounded;
|
|
15
|
+
getPreviewSrc: (file: FilePickerValue) => string;
|
|
16
|
+
dataTestid: string;
|
|
17
|
+
triggerAriaLabel: string;
|
|
18
|
+
onTrigger: () => void;
|
|
19
|
+
onClear: () => void;
|
|
20
|
+
}
|
|
21
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
22
|
+
export default _default;
|