@stachelock/ui 0.6.2 → 0.6.4
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/AvatarIcon-kcEI0AWe.js +4 -0
- package/dist/AvatarImage-YFR2etb8.js +4 -0
- package/dist/AvatarInitials-B7wCnBX9.js +4 -0
- package/dist/ImageDropzoneInput.vue_vue_type_script_setup_true_lang-7JWDfxD2.js +393 -0
- package/dist/index.js +1988 -1975
- package/dist/inputs/AddressInput.d.ts +1 -0
- package/dist/inputs/AddressInput.js +639 -0
- package/dist/inputs/ImageDropzoneInput.d.ts +1 -0
- package/dist/inputs/ImageDropzoneInput.js +4 -0
- package/dist/src/components/avatars/AvatarIcon.d.ts +18 -0
- package/dist/src/components/avatars/AvatarImage.d.ts +25 -0
- package/dist/src/components/avatars/AvatarInitials.d.ts +15 -0
- package/dist/src/components/avatars/AvatarWithText.d.ts +129 -0
- package/dist/src/components/avatars/index.d.ts +4 -0
- package/dist/src/components/formatters/DateFormatter.d.ts +119 -0
- package/dist/src/components/formatters/DateRangeFormatter.d.ts +63 -0
- package/dist/src/components/formatters/index.d.ts +2 -0
- package/dist/src/components/icons/brands/DiscordBrandIcon.d.ts +2 -0
- package/dist/src/components/icons/brands/FacebookBrandIcon.d.ts +2 -0
- package/dist/src/components/icons/brands/GitHubBrandIcon.d.ts +2 -0
- package/dist/src/components/icons/brands/InstagramBrandIcon.d.ts +2 -0
- package/dist/src/components/icons/brands/LinkedInBrandIcon.d.ts +2 -0
- package/dist/src/components/icons/brands/PinterestBrandIcon.d.ts +2 -0
- package/dist/src/components/icons/brands/SnapchatBrandIcon.d.ts +2 -0
- package/dist/src/components/icons/brands/ThreadsBrandIcon.d.ts +2 -0
- package/dist/src/components/icons/brands/TikTokBrandIcon.d.ts +2 -0
- package/dist/src/components/icons/brands/TwitchBrandIcon.d.ts +2 -0
- package/dist/src/components/icons/brands/XBrandIcon.d.ts +2 -0
- package/dist/src/components/icons/brands/YouTubeBrandIcon.d.ts +2 -0
- package/dist/src/components/icons/brands/index.d.ts +12 -0
- package/dist/src/components/icons/index.d.ts +1 -0
- package/dist/src/components/index.d.ts +3 -0
- package/dist/src/components/inputs/DatepickerInput.d.ts +5 -5
- package/dist/src/components/inputs/ImageDropzoneInput.d.ts +326 -0
- package/dist/src/components/inputs/index.d.ts +1 -0
- package/dist/src/components/wrappers/BackgroundGradientWrapper.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/ui.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
import { defineComponent as G, ref as p, computed as F, onMounted as H, watch as J, createElementBlock as u, openBlock as r, createCommentVNode as f, withDirectives as v, toDisplayString as y, createElementVNode as o, normalizeClass as A, createVNode as b, withCtx as R, renderSlot as K, vShow as x, Fragment as Q, renderList as Z, mergeProps as E, unref as $, createBlock as w } from "vue";
|
|
2
|
+
import { XCircleIcon as ee, PhotoIcon as B } from "@heroicons/vue/24/solid";
|
|
3
|
+
import { _ as N } from "./FileDropzoneInput.vue_vue_type_script_setup_true_lang-BJR-_ngq.js";
|
|
4
|
+
import I from "./components/CloudinaryImage.js";
|
|
5
|
+
import O from "./components/LoadingDots.js";
|
|
6
|
+
const le = { class: "sl-space-y-2" }, se = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "sl-grid sl-grid-cols-3 sl-items-center"
|
|
9
|
+
}, te = {
|
|
10
|
+
key: 0,
|
|
11
|
+
for: "dropzone-file",
|
|
12
|
+
class: "sl-text-sm sl-col-span-2 sl-text-gray-700 dark:sl-text-gray-200"
|
|
13
|
+
}, ae = {
|
|
14
|
+
key: 1,
|
|
15
|
+
class: "sl-text-xs sl-text-gray-400 dark:sl-text-gray-500 sl-col-start-3 sl-text-right"
|
|
16
|
+
}, re = {
|
|
17
|
+
key: 2,
|
|
18
|
+
class: "sl-text-xs sl-uppercase sl-text-gray-500 dark:sl-text-gray-400 sl-truncate sl-text-right sl-font-semibold sl-justify-self-end sl-col-start-3"
|
|
19
|
+
}, oe = { class: "sl-w-full" }, ie = ["onClick"], ne = { class: "sl-absolute sl-inset-0 sl-flex sl-items-center sl-justify-center sl-z-10 sl-bg-black sl-bg-opacity-50 sl-transition-opacity sl-duration-200" }, ue = { class: "sl-absolute sl-inset-0 sl-z-30 sl-flex sl-items-center sl-justify-center sl-bg-primary-50 dark:sl-bg-primary-900/30 sl-bg-opacity-95 sl-border-2 sl-border-dashed sl-border-primary-400 sl-rounded-lg sl-transition-opacity sl-duration-200" }, de = { class: "sl-text-center" }, ce = { class: "sl-mt-2 sl-text-sm sl-font-medium sl-text-primary-600 dark:sl-text-primary-400" }, fe = { class: "sl-w-full" }, me = { key: 2 }, ge = { class: "sl-flex sl-items-center sl-p-4 sl-bg-gray-50 dark:sl-bg-slate-800 sl-rounded-lg" }, pe = { class: "sl-flex-shrink-0" }, ye = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "sl-h-16 sl-w-16 sl-rounded-full sl-bg-gray-200 dark:sl-bg-slate-700 sl-flex sl-items-center sl-justify-center"
|
|
22
|
+
}, ve = { class: "sl-ml-4 sl-text-left" }, be = { class: "sl-text-sm sl-font-medium sl-text-gray-700 dark:sl-text-gray-200" }, xe = { class: "sl-text-xs sl-text-gray-500 dark:sl-text-gray-400" }, he = { class: "sl-absolute sl-inset-2 sl-z-20 sl-flex sl-items-center sl-justify-center sl-bg-gray-50 dark:sl-bg-slate-800 sl-bg-opacity-95 sl-text-gray-600 dark:sl-text-gray-300 sl-transition-opacity sl-duration-200 sl-rounded-md" }, ke = { class: "sl-absolute sl-inset-x-0 sl-top-0 sl-bottom-1 sl-z-20 sl-flex sl-items-center sl-justify-center sl-bg-gray-50 dark:sl-bg-slate-800 sl-bg-opacity-95 sl-text-gray-600 dark:sl-text-gray-300 sl-transition-opacity sl-duration-200 sl-rounded-lg" }, we = { class: "sl-absolute sl-inset-0 sl-z-30 sl-flex sl-items-center sl-justify-center sl-bg-primary-50 dark:sl-bg-primary-900/30 sl-bg-opacity-95 sl-border-2 sl-border-dashed sl-border-primary-400 sl-rounded-lg sl-transition-opacity sl-duration-200" }, De = { class: "sl-text-center" }, ze = { class: "sl-mt-2 sl-text-sm sl-font-medium sl-text-primary-600 dark:sl-text-primary-400" }, je = {
|
|
23
|
+
key: 3,
|
|
24
|
+
class: "sl-mt-2 sl-text-sm sl-text-red-600 dark:sl-text-red-400"
|
|
25
|
+
}, Ue = /* @__PURE__ */ G({
|
|
26
|
+
__name: "ImageDropzoneInput",
|
|
27
|
+
props: {
|
|
28
|
+
/** Current image value(s) */
|
|
29
|
+
modelValue: {
|
|
30
|
+
type: [Array, Object, null],
|
|
31
|
+
default: null
|
|
32
|
+
},
|
|
33
|
+
/** Field name for form integration */
|
|
34
|
+
name: {
|
|
35
|
+
type: String,
|
|
36
|
+
required: !0
|
|
37
|
+
},
|
|
38
|
+
/** Label text */
|
|
39
|
+
label: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: ""
|
|
42
|
+
},
|
|
43
|
+
/** Tertiary label (right-aligned) */
|
|
44
|
+
tertiaryLabel: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: ""
|
|
47
|
+
},
|
|
48
|
+
/** Image corner rounding style */
|
|
49
|
+
imageRounded: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "rounded-full"
|
|
52
|
+
},
|
|
53
|
+
/** Preset type for upload configuration */
|
|
54
|
+
presetType: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: "photos"
|
|
57
|
+
},
|
|
58
|
+
/** Allow multiple file uploads */
|
|
59
|
+
enableMultiple: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: !1
|
|
62
|
+
},
|
|
63
|
+
/** Accepted MIME types */
|
|
64
|
+
acceptedFormats: {
|
|
65
|
+
type: Array,
|
|
66
|
+
default: () => ["image/jpeg", "image/png", "image/gif", "image/webp"]
|
|
67
|
+
},
|
|
68
|
+
/** Maximum file size in MB */
|
|
69
|
+
maximumFileSize: {
|
|
70
|
+
type: Number,
|
|
71
|
+
default: 10
|
|
72
|
+
},
|
|
73
|
+
/** Display as avatar style */
|
|
74
|
+
isAvatar: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: !0
|
|
77
|
+
},
|
|
78
|
+
/** Additional props for CloudinaryImage */
|
|
79
|
+
cloudinaryImageProps: {
|
|
80
|
+
type: Object,
|
|
81
|
+
default: () => ({})
|
|
82
|
+
},
|
|
83
|
+
/** Use full screen height */
|
|
84
|
+
fullSize: {
|
|
85
|
+
type: Boolean,
|
|
86
|
+
default: !1
|
|
87
|
+
},
|
|
88
|
+
/** Delete file from Cloudinary on clear */
|
|
89
|
+
deleteFileFromCloudinary: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: !0
|
|
92
|
+
},
|
|
93
|
+
/** Show validation errors */
|
|
94
|
+
showErrors: {
|
|
95
|
+
type: Boolean,
|
|
96
|
+
default: !1
|
|
97
|
+
},
|
|
98
|
+
/** Disable the input */
|
|
99
|
+
disabled: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: !1
|
|
102
|
+
},
|
|
103
|
+
/** Message to show when disabled */
|
|
104
|
+
disabledMessage: {
|
|
105
|
+
type: String,
|
|
106
|
+
default: ""
|
|
107
|
+
},
|
|
108
|
+
/** Show colorful validation states */
|
|
109
|
+
colorfulValidation: {
|
|
110
|
+
type: Boolean,
|
|
111
|
+
default: !0
|
|
112
|
+
},
|
|
113
|
+
/** Project ID for upload context */
|
|
114
|
+
projectId: {
|
|
115
|
+
type: String,
|
|
116
|
+
default: ""
|
|
117
|
+
},
|
|
118
|
+
/**
|
|
119
|
+
* Upload handler - must be provided by consuming package
|
|
120
|
+
* @param file - File to upload
|
|
121
|
+
* @param presetType - Preset type for configuration
|
|
122
|
+
* @param projectId - Project context
|
|
123
|
+
* @returns CloudinaryAsset
|
|
124
|
+
*/
|
|
125
|
+
onUpload: {
|
|
126
|
+
type: Function,
|
|
127
|
+
required: !0
|
|
128
|
+
},
|
|
129
|
+
/**
|
|
130
|
+
* Delete handler - called when clearing an image
|
|
131
|
+
* @param publicId - Cloudinary public_id to delete
|
|
132
|
+
*/
|
|
133
|
+
onDelete: {
|
|
134
|
+
type: Function,
|
|
135
|
+
default: void 0
|
|
136
|
+
},
|
|
137
|
+
/**
|
|
138
|
+
* Check if uploading is allowed (e.g., for demo mode)
|
|
139
|
+
* @returns boolean - true if upload should be blocked
|
|
140
|
+
*/
|
|
141
|
+
onBeforeUpload: {
|
|
142
|
+
type: Function,
|
|
143
|
+
default: void 0
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
emits: ["update:modelValue", "update:media", "clear:media"],
|
|
147
|
+
setup(t, { expose: q, emit: W }) {
|
|
148
|
+
const s = t, D = W, a = p([]), i = p("empty"), m = p(!1), h = p(!1), k = p(!1), d = p(!1), z = p(""), j = p(!1), M = p(!0), S = F(() => s.disabled || h.value), X = F(() => i.value === "loading" ? "Please be patient while we upload your file" : i.value === "uploaded" && a.value[0]?.created_at ? `Uploaded ${new Date(a.value[0].created_at).toLocaleDateString()}` : "Click to replace"), Y = F(() => {
|
|
149
|
+
if (!a.value[0]?.original_file_name) return "Image";
|
|
150
|
+
const e = a.value[0].original_file_name, l = 20;
|
|
151
|
+
if (e.length <= l) return e;
|
|
152
|
+
const n = e.lastIndexOf("."), g = n !== -1 ? e.substring(n) : "";
|
|
153
|
+
return (n !== -1 ? e.substring(0, n) : e).substring(0, l - 3 - g.length) + "..." + g;
|
|
154
|
+
}), V = F(() => {
|
|
155
|
+
const e = "sl-border-2 sl-border-dashed sl-shadow-sm sl-ring-1 sl-ring-inset focus-within:sl-ring-2 focus-within:sl-ring-inset focus-within:sl-ring-primary-600 sl-transition-all sl-duration-200";
|
|
156
|
+
return !s.colorfulValidation || !j.value && !s.showErrors ? `${e} sl-border-gray-300 dark:sl-border-slate-600 sl-ring-gray-300 dark:sl-ring-slate-600` : M.value && j.value && s.colorfulValidation ? `${e} sl-border-green-500 sl-ring-green-500` : !M.value && s.colorfulValidation && (j.value || s.showErrors) ? `${e} sl-border-red-500 sl-ring-red-500` : `${e} sl-border-gray-300 dark:sl-border-slate-600 sl-ring-gray-300 dark:sl-ring-slate-600`;
|
|
157
|
+
}), U = async (e) => {
|
|
158
|
+
if (!(s.onBeforeUpload && s.onBeforeUpload()))
|
|
159
|
+
try {
|
|
160
|
+
h.value = !0, j.value = !0, z.value = "";
|
|
161
|
+
const l = Array.from(e), n = s.enableMultiple ? l : [l[0]];
|
|
162
|
+
for (const g of n) {
|
|
163
|
+
i.value = "loading";
|
|
164
|
+
try {
|
|
165
|
+
const c = await s.onUpload(g, s.presetType, s.projectId);
|
|
166
|
+
if (c) {
|
|
167
|
+
s.enableMultiple ? a.value.push(c) : a.value = [c], i.value = "uploaded", M.value = !0, D("update:modelValue", s.enableMultiple ? a.value : a.value[0]);
|
|
168
|
+
const L = {
|
|
169
|
+
cloudinaryAsset: c,
|
|
170
|
+
presetType: s.presetType,
|
|
171
|
+
projectId: s.projectId
|
|
172
|
+
};
|
|
173
|
+
D("update:media", L);
|
|
174
|
+
} else
|
|
175
|
+
throw new Error("Upload failed - no response");
|
|
176
|
+
} catch (c) {
|
|
177
|
+
console.error("Upload error:", c), z.value = c.message || "Upload failed", i.value = "error", M.value = !1;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
} catch (l) {
|
|
181
|
+
console.error(l);
|
|
182
|
+
} finally {
|
|
183
|
+
h.value = !1;
|
|
184
|
+
}
|
|
185
|
+
}, T = (e) => {
|
|
186
|
+
e.preventDefault(), e.stopPropagation(), e.dataTransfer?.types?.includes("Files") && (k.value = !0);
|
|
187
|
+
}, P = (e) => {
|
|
188
|
+
e.preventDefault(), e.stopPropagation();
|
|
189
|
+
const l = e.currentTarget.getBoundingClientRect(), n = e.clientX, g = e.clientY;
|
|
190
|
+
(n < l.left || n > l.right || g < l.top || g > l.bottom) && (k.value = !1);
|
|
191
|
+
}, _ = async (e) => {
|
|
192
|
+
if (e.preventDefault(), e.stopPropagation(), k.value = !1, d.value = !0, e.dataTransfer?.files && e.dataTransfer.files.length > 0)
|
|
193
|
+
try {
|
|
194
|
+
await U(e.dataTransfer.files);
|
|
195
|
+
} finally {
|
|
196
|
+
d.value = !1;
|
|
197
|
+
}
|
|
198
|
+
else
|
|
199
|
+
d.value = !1;
|
|
200
|
+
}, C = async (e) => {
|
|
201
|
+
try {
|
|
202
|
+
h.value = !0, e && s.deleteFileFromCloudinary && s.onDelete && await s.onDelete(e), e && D("clear:media", e);
|
|
203
|
+
} catch (l) {
|
|
204
|
+
console.error(l);
|
|
205
|
+
} finally {
|
|
206
|
+
i.value = "empty", a.value = [], h.value = !1, D("update:modelValue", null);
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
return H(() => {
|
|
210
|
+
s.modelValue && (a.value = Array.isArray(s.modelValue) ? s.modelValue : [s.modelValue], i.value = "inherited");
|
|
211
|
+
}), J(
|
|
212
|
+
() => s.modelValue,
|
|
213
|
+
(e) => {
|
|
214
|
+
e ? (a.value = Array.isArray(e) ? e : [e], i.value = "inherited") : (i.value = "empty", a.value = []);
|
|
215
|
+
},
|
|
216
|
+
{ immediate: !0 }
|
|
217
|
+
), q({
|
|
218
|
+
clearImage: C,
|
|
219
|
+
imageInputStatus: i,
|
|
220
|
+
uploadResponse: a
|
|
221
|
+
}), (e, l) => (r(), u("div", le, [
|
|
222
|
+
t.label || t.tertiaryLabel ? (r(), u("div", se, [
|
|
223
|
+
t.label ? (r(), u("label", te, y(t.label), 1)) : f("", !0),
|
|
224
|
+
S.value && t.disabledMessage ? (r(), u("p", ae, y(t.disabledMessage), 1)) : f("", !0),
|
|
225
|
+
t.tertiaryLabel && !S.value ? (r(), u("span", re, y(t.tertiaryLabel), 1)) : f("", !0)
|
|
226
|
+
])) : f("", !0),
|
|
227
|
+
v(o("div", {
|
|
228
|
+
class: A(["sl-flex sl-items-center sl-justify-center sl-w-full", { "sl-h-screen": t.fullSize, "sl-mt-2": t.label }])
|
|
229
|
+
}, [
|
|
230
|
+
o("div", oe, [
|
|
231
|
+
b(N, {
|
|
232
|
+
"enable-multiple": t.enableMultiple,
|
|
233
|
+
"onUpdate:files": U,
|
|
234
|
+
"accepted-formats": t.acceptedFormats,
|
|
235
|
+
"maximum-file-size": t.maximumFileSize,
|
|
236
|
+
disabled: S.value,
|
|
237
|
+
"ring-classes": V.value,
|
|
238
|
+
height: "md"
|
|
239
|
+
}, {
|
|
240
|
+
default: R(() => [
|
|
241
|
+
K(e.$slots, "empty-state", {}, () => [
|
|
242
|
+
l[8] || (l[8] = o("p", { class: "sl-text-sm sl-text-gray-500 dark:sl-text-gray-400" }, " Click to upload or drag and drop your files here. ", -1))
|
|
243
|
+
])
|
|
244
|
+
]),
|
|
245
|
+
_: 3
|
|
246
|
+
}, 8, ["enable-multiple", "accepted-formats", "maximum-file-size", "disabled", "ring-classes"])
|
|
247
|
+
])
|
|
248
|
+
], 2), [
|
|
249
|
+
[x, i.value === "empty"]
|
|
250
|
+
]),
|
|
251
|
+
a.value && Array.isArray(a.value) && a.value.length > 1 ? (r(), u("div", {
|
|
252
|
+
key: 1,
|
|
253
|
+
class: A(["sl-flex sl-flex-wrap sl--mx-2", { "sl-mt-2": t.label }])
|
|
254
|
+
}, [
|
|
255
|
+
(r(!0), u(Q, null, Z(a.value, (n, g) => (r(), u("div", {
|
|
256
|
+
key: g,
|
|
257
|
+
class: "sl-p-2 sl-relative sl-group",
|
|
258
|
+
onDragover: T,
|
|
259
|
+
onDragleave: P,
|
|
260
|
+
onDrop: _
|
|
261
|
+
}, [
|
|
262
|
+
o("button", {
|
|
263
|
+
type: "button",
|
|
264
|
+
onClick: (c) => C(n.public_id),
|
|
265
|
+
onMouseenter: l[0] || (l[0] = (c) => m.value = !0),
|
|
266
|
+
onMouseleave: l[1] || (l[1] = (c) => m.value = !1),
|
|
267
|
+
class: "sl-relative sl-rounded-lg sl-overflow-hidden focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-primary-500",
|
|
268
|
+
"aria-label": "Remove image"
|
|
269
|
+
}, [
|
|
270
|
+
b(I, E({
|
|
271
|
+
"public-id": n.public_id
|
|
272
|
+
}, { ref_for: !0 }, t.cloudinaryImageProps, { class: "sl-transition-transform sl-duration-200 group-hover:sl-scale-105 sl-w-full sl-h-full sl-object-cover" }), null, 16, ["public-id"]),
|
|
273
|
+
v(o("span", ne, [
|
|
274
|
+
b($(ee), { class: "sl-h-10 sl-w-10 sl-text-red-600" })
|
|
275
|
+
], 512), [
|
|
276
|
+
[x, m.value]
|
|
277
|
+
])
|
|
278
|
+
], 40, ie),
|
|
279
|
+
v(o("div", ue, [
|
|
280
|
+
o("div", de, [
|
|
281
|
+
d.value ? f("", !0) : (r(), w($(B), {
|
|
282
|
+
key: 0,
|
|
283
|
+
class: "sl-mx-auto sl-h-12 sl-w-12 sl-text-primary-400"
|
|
284
|
+
})),
|
|
285
|
+
d.value ? (r(), w(O, {
|
|
286
|
+
key: 1,
|
|
287
|
+
size: "sm"
|
|
288
|
+
})) : f("", !0),
|
|
289
|
+
o("p", ce, y(d.value ? "Uploading..." : "Drop to replace"), 1)
|
|
290
|
+
])
|
|
291
|
+
], 512), [
|
|
292
|
+
[x, k.value || d.value]
|
|
293
|
+
])
|
|
294
|
+
], 32))), 128)),
|
|
295
|
+
i.value === "uploaded" && t.enableMultiple ? (r(), u("div", {
|
|
296
|
+
key: 0,
|
|
297
|
+
class: A(["sl-flex sl-items-center sl-justify-center sl-w-full", { "sl-h-screen": t.fullSize }])
|
|
298
|
+
}, [
|
|
299
|
+
o("div", fe, [
|
|
300
|
+
b(N, {
|
|
301
|
+
"enable-multiple": t.enableMultiple,
|
|
302
|
+
"onUpdate:files": U,
|
|
303
|
+
"accepted-formats": t.acceptedFormats,
|
|
304
|
+
"maximum-file-size": t.maximumFileSize,
|
|
305
|
+
disabled: S.value,
|
|
306
|
+
"ring-classes": V.value,
|
|
307
|
+
height: "sm"
|
|
308
|
+
}, {
|
|
309
|
+
default: R(() => [...l[9] || (l[9] = [
|
|
310
|
+
o("p", { class: "sl-text-sm sl-text-gray-500 dark:sl-text-gray-400" }, "Add more images", -1)
|
|
311
|
+
])]),
|
|
312
|
+
_: 1
|
|
313
|
+
}, 8, ["enable-multiple", "accepted-formats", "maximum-file-size", "disabled", "ring-classes"])
|
|
314
|
+
])
|
|
315
|
+
], 2)) : f("", !0)
|
|
316
|
+
], 2)) : (r(), u("div", me, [
|
|
317
|
+
i.value === "uploaded" || i.value === "loading" || i.value === "inherited" ? (r(), u("div", {
|
|
318
|
+
key: 0,
|
|
319
|
+
class: "sl-relative sl-mt-2",
|
|
320
|
+
onDragover: T,
|
|
321
|
+
onDragleave: P,
|
|
322
|
+
onDrop: _
|
|
323
|
+
}, [
|
|
324
|
+
t.isAvatar ? (r(), u("button", {
|
|
325
|
+
key: 0,
|
|
326
|
+
type: "button",
|
|
327
|
+
onClick: l[2] || (l[2] = (n) => C(a.value[0]?.public_id)),
|
|
328
|
+
onMouseenter: l[3] || (l[3] = (n) => m.value = !0),
|
|
329
|
+
onMouseleave: l[4] || (l[4] = (n) => m.value = !1),
|
|
330
|
+
class: "sl-w-full focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-primary-600 focus:sl-ring-offset-2 sl-rounded-lg sl-overflow-hidden sl-transition-all sl-duration-200",
|
|
331
|
+
"aria-label": "Replace avatar"
|
|
332
|
+
}, [
|
|
333
|
+
o("div", ge, [
|
|
334
|
+
o("div", pe, [
|
|
335
|
+
a.value[0]?.public_id && i.value !== "loading" ? (r(), w(I, {
|
|
336
|
+
key: 0,
|
|
337
|
+
"public-id": a.value[0].public_id,
|
|
338
|
+
width: 64,
|
|
339
|
+
height: 64,
|
|
340
|
+
class: "sl-h-16 sl-w-16 sl-rounded-full sl-object-cover",
|
|
341
|
+
skeleton: "user"
|
|
342
|
+
}, null, 8, ["public-id"])) : (r(), u("div", ye, [
|
|
343
|
+
b($(B), { class: "sl-h-8 sl-w-8 sl-text-gray-400 dark:sl-text-gray-500" })
|
|
344
|
+
]))
|
|
345
|
+
]),
|
|
346
|
+
o("div", ve, [
|
|
347
|
+
o("p", be, y(i.value === "loading" ? "Uploading..." : Y.value), 1),
|
|
348
|
+
o("p", xe, y(i.value === "loading" ? "Please wait..." : X.value), 1)
|
|
349
|
+
])
|
|
350
|
+
]),
|
|
351
|
+
v(o("span", he, " Replace ", 512), [
|
|
352
|
+
[x, m.value]
|
|
353
|
+
])
|
|
354
|
+
], 32)) : (r(), u("button", {
|
|
355
|
+
key: 1,
|
|
356
|
+
type: "button",
|
|
357
|
+
onClick: l[5] || (l[5] = (n) => C(a.value[0]?.public_id)),
|
|
358
|
+
onMouseenter: l[6] || (l[6] = (n) => m.value = !0),
|
|
359
|
+
onMouseleave: l[7] || (l[7] = (n) => m.value = !1),
|
|
360
|
+
class: "sl-w-full focus:sl-outline-none focus:sl-ring-2 focus:sl-ring-primary-600 focus:sl-ring-offset-2 sl-rounded-lg sl-overflow-hidden sl-transition-all sl-duration-200",
|
|
361
|
+
"aria-label": "Replace image"
|
|
362
|
+
}, [
|
|
363
|
+
b(I, E({
|
|
364
|
+
"public-id": a.value[0]?.public_id
|
|
365
|
+
}, t.cloudinaryImageProps, { class: "sl-transition-transform sl-duration-200 group-hover:sl-scale-105 sl-w-full sl-h-full sl-object-cover" }), null, 16, ["public-id"]),
|
|
366
|
+
v(o("span", ke, " Replace ", 512), [
|
|
367
|
+
[x, m.value]
|
|
368
|
+
])
|
|
369
|
+
], 32)),
|
|
370
|
+
v(o("div", we, [
|
|
371
|
+
o("div", De, [
|
|
372
|
+
d.value ? f("", !0) : (r(), w($(B), {
|
|
373
|
+
key: 0,
|
|
374
|
+
class: "sl-mx-auto sl-h-12 sl-w-12 sl-text-primary-400"
|
|
375
|
+
})),
|
|
376
|
+
d.value ? (r(), w(O, {
|
|
377
|
+
key: 1,
|
|
378
|
+
size: "sm"
|
|
379
|
+
})) : f("", !0),
|
|
380
|
+
o("p", ze, y(d.value ? "Uploading..." : "Drop to replace"), 1)
|
|
381
|
+
])
|
|
382
|
+
], 512), [
|
|
383
|
+
[x, k.value || d.value]
|
|
384
|
+
])
|
|
385
|
+
], 32)) : f("", !0)
|
|
386
|
+
])),
|
|
387
|
+
z.value ? (r(), u("p", je, y(z.value), 1)) : f("", !0)
|
|
388
|
+
]));
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
export {
|
|
392
|
+
Ue as _
|
|
393
|
+
};
|