ablok-components 0.3.86 → 0.3.88
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/ablok-components.umd.js +2 -2
- package/dist/components/molecules/base-camera/base-camera.vue.js +147 -146
- package/dist/components/molecules/base-map/base-map.vue.js +49 -49
- package/dist/components/molecules/bulk-upload/bulk-upload.vue.d.ts +102 -1
- package/dist/components/molecules/bulk-upload/bulk-upload.vue.js +139 -72
- package/dist/components/molecules/file-upload/file-upload.vue.d.ts +42 -0
- package/dist/components/molecules/file-upload/file-upload.vue.js +47 -44
- package/dist/i18n.d.ts +1 -0
- package/dist/locales/en.d.ts +1 -0
- package/package.json +19 -19
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as x, computed as z, ref as h, resolveComponent as C, openBlock as a, createElementBlock as i, createElementVNode as o, unref as L, withModifiers as y, createVNode as u, createCommentVNode as m, toDisplayString as b, withCtx as $, renderSlot as S, Fragment as I, withDirectives as U, vModelText as D, nextTick as F } from "vue";
|
|
2
2
|
import N from "../file-upload/file-upload.vue.js";
|
|
3
3
|
/* empty css */
|
|
4
|
-
|
|
4
|
+
import { sanitizeHtml as A } from "../../../composables/useSanitize.js";
|
|
5
|
+
const E = { class: "container" }, R = { class: "row" }, j = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "col-12"
|
|
8
|
+
}, q = { class: "p-3 d-flex align-items-center border border-bottom-0" }, G = ["innerHTML"], K = { class: "col-12" }, J = {
|
|
5
9
|
key: 0,
|
|
6
10
|
class: "grid place-items-center text-center text-muted py-5 border border-bottom-0"
|
|
7
|
-
},
|
|
11
|
+
}, O = { class: "m-0" }, P = { class: "preview-item border-bottom p-3" }, Q = { class: "d-flex gap-3" }, W = { class: "col-2" }, X = { class: "col d-flex flex-column" }, Y = { class: "file-meta text-muted small mb-2" }, Z = { class: "fw-semibold" }, ee = { key: 0 }, te = { key: 1 }, oe = ["onUpdate:modelValue", "id"], le = ["innerHTML"], se = { class: "col-auto d-flex flex-column gap-2" }, ne = ["onClick"], ae = ["onClick"], ie = { class: "d-flex align-items-end p-3" }, de = { class: "btn btn-primary btn-sm ms-auto d-flex align-items-center gap-2" }, re = ["innerHTML"], fe = /* @__PURE__ */ x({
|
|
8
12
|
__name: "bulk-upload",
|
|
9
13
|
props: {
|
|
10
14
|
storeId: String,
|
|
@@ -22,49 +26,101 @@ const S = { class: "container" }, A = { class: "row" }, B = { class: "col-12" },
|
|
|
22
26
|
},
|
|
23
27
|
messages: {
|
|
24
28
|
type: null
|
|
29
|
+
},
|
|
30
|
+
hasHeader: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !0
|
|
33
|
+
},
|
|
34
|
+
title: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ""
|
|
37
|
+
},
|
|
38
|
+
hasBulkRemove: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: !0
|
|
41
|
+
},
|
|
42
|
+
hasCaptions: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !0
|
|
45
|
+
},
|
|
46
|
+
editCaptions: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !0
|
|
25
49
|
}
|
|
26
50
|
},
|
|
27
51
|
emits: ["update:modelValue"],
|
|
28
|
-
setup(
|
|
29
|
-
const
|
|
52
|
+
setup(d, { emit: B }) {
|
|
53
|
+
const g = d, k = B, r = z({
|
|
30
54
|
get: () => {
|
|
31
|
-
const
|
|
32
|
-
return
|
|
55
|
+
const t = g.modelValue || [];
|
|
56
|
+
return f.value = t.map((e) => e.caption || ""), t.map((e) => ({
|
|
57
|
+
type: e.type,
|
|
58
|
+
src: e.src,
|
|
59
|
+
...e.name ? { name: e.name } : {},
|
|
60
|
+
...e.size ? { size: e.size } : {},
|
|
61
|
+
...e.lastModified ? { lastModified: e.lastModified } : {}
|
|
62
|
+
}));
|
|
33
63
|
},
|
|
34
|
-
set: (
|
|
35
|
-
const
|
|
36
|
-
|
|
64
|
+
set: (t) => {
|
|
65
|
+
const e = r.value || [], l = Array.isArray(t) ? t : [], c = l.length <= e.length && l.every((s) => e.some((n) => n.src === s.src));
|
|
66
|
+
v(c ? l : [...e, ...l]);
|
|
37
67
|
}
|
|
38
|
-
}),
|
|
39
|
-
function
|
|
40
|
-
const
|
|
41
|
-
|
|
68
|
+
}), M = h(null), p = h({}), f = h({});
|
|
69
|
+
function V(t) {
|
|
70
|
+
const e = [...g.modelValue || []];
|
|
71
|
+
e.splice(t, 1), k("update:modelValue", e);
|
|
42
72
|
}
|
|
43
|
-
async function
|
|
44
|
-
|
|
73
|
+
async function w(t) {
|
|
74
|
+
p.value[t] = !p.value[t], p.value[t] || v(), await F(), M.value?.querySelector(`#caption-${t}`)?.focus();
|
|
45
75
|
}
|
|
46
|
-
function
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
76
|
+
function H(t) {
|
|
77
|
+
if (t == null) return "";
|
|
78
|
+
const e = ["B", "KB", "MB", "GB", "TB"];
|
|
79
|
+
let l = t, c = e.shift();
|
|
80
|
+
for (; l >= 1024 && e.length; )
|
|
81
|
+
l /= 1024, c = e.shift();
|
|
82
|
+
return `${l.toFixed(1)} ${c}`;
|
|
83
|
+
}
|
|
84
|
+
function T(t) {
|
|
85
|
+
return t ? new Date(t).toLocaleDateString() : "";
|
|
86
|
+
}
|
|
87
|
+
function v(t) {
|
|
88
|
+
k("update:modelValue", (t || r.value).map((e, l) => ({
|
|
89
|
+
...e,
|
|
90
|
+
caption: f.value[l] || ""
|
|
50
91
|
})));
|
|
51
92
|
}
|
|
52
|
-
return (
|
|
53
|
-
const
|
|
54
|
-
return
|
|
93
|
+
return (t, e) => {
|
|
94
|
+
const l = C("svg-icon"), c = C("base-image");
|
|
95
|
+
return a(), i("div", {
|
|
55
96
|
class: "bulk-upload",
|
|
56
97
|
ref_key: "root",
|
|
57
|
-
ref:
|
|
98
|
+
ref: M
|
|
58
99
|
}, [
|
|
59
|
-
o("div",
|
|
60
|
-
o("div",
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
o("p",
|
|
100
|
+
o("div", E, [
|
|
101
|
+
o("div", R, [
|
|
102
|
+
d.hasHeader ? (a(), i("div", j, [
|
|
103
|
+
o("div", q, [
|
|
104
|
+
o("p", {
|
|
105
|
+
class: "fw-bold m-0",
|
|
106
|
+
innerHTML: L(A)(d.title || t.$t("fileInput.bulkUploadHeadline"))
|
|
107
|
+
}, null, 8, G),
|
|
108
|
+
d.hasBulkRemove ? (a(), i("button", {
|
|
109
|
+
key: 0,
|
|
110
|
+
onClick: e[0] || (e[0] = y((s) => r.value = [], ["prevent"])),
|
|
111
|
+
class: "btn btn--close ms-auto p-0"
|
|
112
|
+
}, [
|
|
113
|
+
u(l, { symbol: "x" })
|
|
114
|
+
])) : m("", !0)
|
|
115
|
+
])
|
|
116
|
+
])) : m("", !0),
|
|
117
|
+
o("div", K, [
|
|
118
|
+
r.value.length ? m("", !0) : (a(), i("div", J, [
|
|
119
|
+
o("p", O, b(t.$t("fileInput.noFilesSelected")), 1)
|
|
64
120
|
])),
|
|
65
|
-
|
|
66
|
-
modelValue:
|
|
67
|
-
"onUpdate:modelValue":
|
|
121
|
+
u(N, {
|
|
122
|
+
modelValue: r.value,
|
|
123
|
+
"onUpdate:modelValue": e[2] || (e[2] = (s) => r.value = s),
|
|
68
124
|
multiple: !0,
|
|
69
125
|
accept: "image/*",
|
|
70
126
|
"drop-files": !0,
|
|
@@ -72,64 +128,75 @@ const S = { class: "container" }, A = { class: "row" }, B = { class: "col-12" },
|
|
|
72
128
|
"local-url-format": "objectUrl",
|
|
73
129
|
class: "d-flex flex-column border"
|
|
74
130
|
}, {
|
|
75
|
-
"preview-item":
|
|
76
|
-
o("div",
|
|
77
|
-
o("div",
|
|
78
|
-
o("div",
|
|
79
|
-
|
|
80
|
-
src:
|
|
131
|
+
"preview-item": $(({ bind: { item: s, index: n } }) => [
|
|
132
|
+
o("div", P, [
|
|
133
|
+
o("div", Q, [
|
|
134
|
+
o("div", W, [
|
|
135
|
+
u(c, {
|
|
136
|
+
src: s.src,
|
|
81
137
|
alt: "",
|
|
82
138
|
class: "img-thumbnail"
|
|
83
139
|
}, null, 8, ["src"])
|
|
84
140
|
]),
|
|
85
|
-
o("div",
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
141
|
+
o("div", X, [
|
|
142
|
+
o("div", Y, [
|
|
143
|
+
o("div", Z, b(s.name || t.$t("fileInput.unknownFile")), 1),
|
|
144
|
+
o("div", null, [
|
|
145
|
+
s.size ? (a(), i("span", ee, b(H(s.size)), 1)) : m("", !0),
|
|
146
|
+
s.lastModified ? (a(), i("span", te, " · " + b(T(s.lastModified)), 1)) : m("", !0)
|
|
147
|
+
])
|
|
148
|
+
]),
|
|
149
|
+
d.hasCaptions ? (a(), i(I, { key: 0 }, [
|
|
150
|
+
p.value[n] && d.editCaptions ? U((a(), i("textarea", {
|
|
151
|
+
key: 0,
|
|
152
|
+
"onUpdate:modelValue": (_) => f.value[n] = _,
|
|
153
|
+
id: `caption-${n}`,
|
|
154
|
+
class: "form-control rounded-0 h-100",
|
|
155
|
+
onChangeCapture: e[1] || (e[1] = (_) => v())
|
|
156
|
+
}, null, 40, oe)), [
|
|
157
|
+
[D, f.value[n]]
|
|
158
|
+
]) : (a(), i("p", {
|
|
159
|
+
key: 1,
|
|
160
|
+
class: "m-0",
|
|
161
|
+
innerHTML: f.value[n] || `<small>${t.$t("fileInput.noCaption")}</small>`
|
|
162
|
+
}, null, 8, le))
|
|
163
|
+
], 64)) : m("", !0)
|
|
99
164
|
]),
|
|
100
|
-
o("div",
|
|
165
|
+
o("div", se, [
|
|
101
166
|
o("button", {
|
|
102
|
-
onClick:
|
|
167
|
+
onClick: y((_) => V(n), ["prevent"]),
|
|
103
168
|
class: "btn btn--close"
|
|
104
169
|
}, [
|
|
105
|
-
|
|
106
|
-
], 8,
|
|
170
|
+
u(l, { symbol: "x" })
|
|
171
|
+
], 8, ne),
|
|
107
172
|
o("button", {
|
|
108
|
-
onClick:
|
|
173
|
+
onClick: y((_) => w(n), ["prevent"]),
|
|
109
174
|
class: "btn btn--close"
|
|
110
175
|
}, [
|
|
111
|
-
|
|
112
|
-
symbol:
|
|
176
|
+
u(l, {
|
|
177
|
+
symbol: p.value[n] ? "check" : "edit-3"
|
|
113
178
|
}, null, 8, ["symbol"])
|
|
114
|
-
], 8,
|
|
179
|
+
], 8, ae)
|
|
115
180
|
])
|
|
116
181
|
])
|
|
117
182
|
])
|
|
118
183
|
]),
|
|
119
|
-
button:
|
|
120
|
-
|
|
121
|
-
o("span",
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
184
|
+
button: $(() => [
|
|
185
|
+
S(t.$slots, "button", {}, () => [
|
|
186
|
+
o("span", ie, [
|
|
187
|
+
o("span", de, [
|
|
188
|
+
u(l, {
|
|
189
|
+
symbol: "upload",
|
|
190
|
+
size: "small"
|
|
191
|
+
}),
|
|
192
|
+
o("span", {
|
|
193
|
+
innerHTML: t.$t("common.selectFile")
|
|
194
|
+
}, null, 8, re)
|
|
195
|
+
])
|
|
129
196
|
])
|
|
130
197
|
])
|
|
131
198
|
]),
|
|
132
|
-
_:
|
|
199
|
+
_: 3
|
|
133
200
|
}, 8, ["modelValue"])
|
|
134
201
|
])
|
|
135
202
|
])
|
|
@@ -139,5 +206,5 @@ const S = { class: "container" }, A = { class: "row" }, B = { class: "col-12" },
|
|
|
139
206
|
}
|
|
140
207
|
});
|
|
141
208
|
export {
|
|
142
|
-
|
|
209
|
+
fe as default
|
|
143
210
|
};
|
|
@@ -9,6 +9,9 @@ declare function __VLS_template(): {
|
|
|
9
9
|
item: {
|
|
10
10
|
type?: string;
|
|
11
11
|
src?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
size?: number;
|
|
14
|
+
lastModified?: number;
|
|
12
15
|
};
|
|
13
16
|
index: number;
|
|
14
17
|
};
|
|
@@ -30,24 +33,42 @@ declare const __VLS_component: import('../../../../vue/dist/vue.esm-bundler.js')
|
|
|
30
33
|
(arrayLength: number): {
|
|
31
34
|
type?: string;
|
|
32
35
|
src?: string;
|
|
36
|
+
name?: string;
|
|
37
|
+
size?: number;
|
|
38
|
+
lastModified?: number;
|
|
33
39
|
}[];
|
|
34
40
|
(...items: {
|
|
35
41
|
type?: string;
|
|
36
42
|
src?: string;
|
|
43
|
+
name?: string;
|
|
44
|
+
size?: number;
|
|
45
|
+
lastModified?: number;
|
|
37
46
|
}[]): {
|
|
38
47
|
type?: string;
|
|
39
48
|
src?: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
size?: number;
|
|
51
|
+
lastModified?: number;
|
|
40
52
|
}[];
|
|
41
53
|
new (arrayLength: number): {
|
|
42
54
|
type?: string;
|
|
43
55
|
src?: string;
|
|
56
|
+
name?: string;
|
|
57
|
+
size?: number;
|
|
58
|
+
lastModified?: number;
|
|
44
59
|
}[];
|
|
45
60
|
new (...items: {
|
|
46
61
|
type?: string;
|
|
47
62
|
src?: string;
|
|
63
|
+
name?: string;
|
|
64
|
+
size?: number;
|
|
65
|
+
lastModified?: number;
|
|
48
66
|
}[]): {
|
|
49
67
|
type?: string;
|
|
50
68
|
src?: string;
|
|
69
|
+
name?: string;
|
|
70
|
+
size?: number;
|
|
71
|
+
lastModified?: number;
|
|
51
72
|
}[];
|
|
52
73
|
isArray(arg: any): arg is any[];
|
|
53
74
|
readonly prototype: any[];
|
|
@@ -154,24 +175,42 @@ declare const __VLS_component: import('../../../../vue/dist/vue.esm-bundler.js')
|
|
|
154
175
|
(arrayLength: number): {
|
|
155
176
|
type?: string;
|
|
156
177
|
src?: string;
|
|
178
|
+
name?: string;
|
|
179
|
+
size?: number;
|
|
180
|
+
lastModified?: number;
|
|
157
181
|
}[];
|
|
158
182
|
(...items: {
|
|
159
183
|
type?: string;
|
|
160
184
|
src?: string;
|
|
185
|
+
name?: string;
|
|
186
|
+
size?: number;
|
|
187
|
+
lastModified?: number;
|
|
161
188
|
}[]): {
|
|
162
189
|
type?: string;
|
|
163
190
|
src?: string;
|
|
191
|
+
name?: string;
|
|
192
|
+
size?: number;
|
|
193
|
+
lastModified?: number;
|
|
164
194
|
}[];
|
|
165
195
|
new (arrayLength: number): {
|
|
166
196
|
type?: string;
|
|
167
197
|
src?: string;
|
|
198
|
+
name?: string;
|
|
199
|
+
size?: number;
|
|
200
|
+
lastModified?: number;
|
|
168
201
|
}[];
|
|
169
202
|
new (...items: {
|
|
170
203
|
type?: string;
|
|
171
204
|
src?: string;
|
|
205
|
+
name?: string;
|
|
206
|
+
size?: number;
|
|
207
|
+
lastModified?: number;
|
|
172
208
|
}[]): {
|
|
173
209
|
type?: string;
|
|
174
210
|
src?: string;
|
|
211
|
+
name?: string;
|
|
212
|
+
size?: number;
|
|
213
|
+
lastModified?: number;
|
|
175
214
|
}[];
|
|
176
215
|
isArray(arg: any): arg is any[];
|
|
177
216
|
readonly prototype: any[];
|
|
@@ -281,6 +320,9 @@ declare const __VLS_component: import('../../../../vue/dist/vue.esm-bundler.js')
|
|
|
281
320
|
modelValue: {
|
|
282
321
|
type?: string;
|
|
283
322
|
src?: string;
|
|
323
|
+
name?: string;
|
|
324
|
+
size?: number;
|
|
325
|
+
lastModified?: number;
|
|
284
326
|
}[];
|
|
285
327
|
name: string;
|
|
286
328
|
placeholder: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as L, ref as y, toRef as
|
|
1
|
+
import { defineComponent as L, ref as y, toRef as M, computed as N, watch as b, openBlock as u, createElementBlock as d, normalizeClass as h, unref as v, Fragment as V, renderList as P, renderSlot as S, createElementVNode as c, withModifiers as w, createVNode as p, Transition as T, withCtx as H, createCommentVNode as W } from "vue";
|
|
2
2
|
import k from "../../atoms/svg-icon/svg-icon.vue.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import q from "../../atoms/input-file/input-file.vue.js";
|
|
@@ -10,7 +10,7 @@ import { uniqueId as F } from "../../../utilities/helpers.js";
|
|
|
10
10
|
const _ = ["src"], j = ["onClick"], x = ["onClick"], G = ["for"], J = ["innerHTML"], K = {
|
|
11
11
|
key: 0,
|
|
12
12
|
class: "file-upload__loading-spinner"
|
|
13
|
-
},
|
|
13
|
+
}, ne = /* @__PURE__ */ L({
|
|
14
14
|
__name: "file-upload",
|
|
15
15
|
props: {
|
|
16
16
|
modelValue: {
|
|
@@ -102,93 +102,96 @@ const _ = ["src"], j = ["onClick"], x = ["onClick"], G = ["for"], J = ["innerHTM
|
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
emits: ["update:modelValue", "update:src"],
|
|
105
|
-
setup(
|
|
106
|
-
const e =
|
|
105
|
+
setup(o, { emit: U }) {
|
|
106
|
+
const e = o, i = U, g = y(), m = y([]), n = y([]), { pending: $, uploadFile: B } = I(e), { toLocalUrl: D, revoke: z } = R(M(e, "localUrlFormat")), { isDragging: C } = E(g, {
|
|
107
107
|
enabled: () => e.dropFiles,
|
|
108
108
|
onDrop: (t) => {
|
|
109
|
-
|
|
109
|
+
m.value = t;
|
|
110
110
|
}
|
|
111
|
-
}), A =
|
|
111
|
+
}), A = N(() => e.modelValue?.length ? e.modelValue : e.src ? [{ type: "", src: e.src }] : n.value);
|
|
112
112
|
function f(t) {
|
|
113
|
-
const l = typeof t == "string" ? parseInt(t, 10) : t,
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
116
|
-
l <
|
|
117
|
-
} else if (
|
|
118
|
-
const
|
|
119
|
-
i("update:modelValue",
|
|
113
|
+
const l = typeof t == "string" ? parseInt(t, 10) : t, a = Array.isArray(e.modelValue) && e.modelValue.length > 0, r = Array.isArray(n.value) && n.value.length > 0;
|
|
114
|
+
if (r && l < n.value.length && (z(n.value[l]?.src), n.value.splice(l, 1)), a) {
|
|
115
|
+
const s = [...e.modelValue];
|
|
116
|
+
l < s.length && s.splice(l, 1), i("update:modelValue", s), e.multiple || i("update:src", s[0]?.src || "");
|
|
117
|
+
} else if (r) {
|
|
118
|
+
const s = e.multiple ? n.value : n.value[0];
|
|
119
|
+
i("update:modelValue", s), e.multiple || i("update:src", n.value[0]?.src || "");
|
|
120
120
|
} else
|
|
121
121
|
i("update:modelValue", e.multiple ? [] : void 0), i("update:src", "");
|
|
122
|
-
|
|
122
|
+
m.value.splice(l, 1);
|
|
123
123
|
}
|
|
124
|
-
return b(() =>
|
|
124
|
+
return b(() => m.value, async (t) => {
|
|
125
125
|
const l = await Promise.all(
|
|
126
|
-
t.map(async (
|
|
127
|
-
src: e.toDataUrl ? await D(
|
|
128
|
-
type:
|
|
126
|
+
t.map(async (a) => ({
|
|
127
|
+
src: e.toDataUrl ? await D(a) : await B(a),
|
|
128
|
+
type: a.type,
|
|
129
|
+
name: a.name,
|
|
130
|
+
size: a.size,
|
|
131
|
+
lastModified: a.lastModified
|
|
129
132
|
}))
|
|
130
133
|
);
|
|
131
|
-
|
|
132
|
-
}, { deep: !0 }), b(() =>
|
|
134
|
+
n.value = l;
|
|
135
|
+
}, { deep: !0 }), b(() => n.value, async (t) => {
|
|
133
136
|
const l = e.multiple ? t : t[0];
|
|
134
137
|
i("update:modelValue", l), e.multiple || i("update:src", t[0] && t[0].src);
|
|
135
138
|
}, { deep: !0 }), (t, l) => (u(), d("div", {
|
|
136
139
|
ref_key: "root",
|
|
137
140
|
ref: g,
|
|
138
141
|
class: h(["file-upload", {
|
|
139
|
-
"has-dragging":
|
|
140
|
-
"is-dragging": v(
|
|
142
|
+
"has-dragging": o.dropFiles,
|
|
143
|
+
"is-dragging": v(C)
|
|
141
144
|
}])
|
|
142
145
|
}, [
|
|
143
|
-
(u(!0), d(V, null,
|
|
144
|
-
key:
|
|
145
|
-
class: h(
|
|
146
|
+
(u(!0), d(V, null, P(A.value, (a, r) => (u(), d("div", {
|
|
147
|
+
key: a.src,
|
|
148
|
+
class: h(o.enablePreview ? "file-upload__thumbnail" : "file-upload__reset")
|
|
146
149
|
}, [
|
|
147
150
|
S(t.$slots, "preview-item", {
|
|
148
|
-
bind: { item:
|
|
151
|
+
bind: { item: a, index: r },
|
|
149
152
|
on: { removeFile: f }
|
|
150
153
|
}, () => [
|
|
151
|
-
|
|
154
|
+
o.enablePreview ? (u(), d(V, { key: 0 }, [
|
|
152
155
|
c("img", {
|
|
153
|
-
src: `${
|
|
156
|
+
src: `${a.src}${o.previewWidth ? `?width=${o.previewWidth}` : ""}`,
|
|
154
157
|
class: "img-thumbnail rounded"
|
|
155
158
|
}, null, 8, _),
|
|
156
159
|
c("button", {
|
|
157
|
-
onClick: w((
|
|
160
|
+
onClick: w((s) => f(r), ["prevent"]),
|
|
158
161
|
class: "btn btn--close"
|
|
159
162
|
}, [
|
|
160
|
-
|
|
163
|
+
p(k, { symbol: "x" })
|
|
161
164
|
], 8, j)
|
|
162
165
|
], 64)) : (u(), d("button", {
|
|
163
166
|
key: 1,
|
|
164
|
-
onClick: w((
|
|
167
|
+
onClick: w((s) => f(r), ["prevent"]),
|
|
165
168
|
class: "btn btn--close btn-outline-contrast"
|
|
166
169
|
}, [
|
|
167
|
-
|
|
170
|
+
p(k, { symbol: "x" })
|
|
168
171
|
], 8, x))
|
|
169
172
|
])
|
|
170
173
|
], 2))), 128)),
|
|
171
|
-
|
|
172
|
-
modelValue:
|
|
173
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
174
|
-
id:
|
|
175
|
-
name:
|
|
176
|
-
accept:
|
|
177
|
-
"max-file-size":
|
|
178
|
-
multiple:
|
|
174
|
+
p(q, {
|
|
175
|
+
modelValue: m.value,
|
|
176
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => m.value = a),
|
|
177
|
+
id: o.id,
|
|
178
|
+
name: o.name,
|
|
179
|
+
accept: o.accept,
|
|
180
|
+
"max-file-size": o.maxFileSize,
|
|
181
|
+
multiple: o.multiple,
|
|
179
182
|
class: "d-none"
|
|
180
183
|
}, null, 8, ["modelValue", "id", "name", "accept", "max-file-size", "multiple"]),
|
|
181
184
|
c("label", {
|
|
182
|
-
for:
|
|
185
|
+
for: o.id,
|
|
183
186
|
class: "file-upload__label"
|
|
184
187
|
}, [
|
|
185
188
|
S(t.$slots, "button", {}, () => [
|
|
186
189
|
c("span", {
|
|
187
190
|
class: "btn btn-outline-contrast",
|
|
188
|
-
innerHTML: v(O)(
|
|
191
|
+
innerHTML: v(O)(o.label || t.$t("common.selectFile"))
|
|
189
192
|
}, null, 8, J)
|
|
190
193
|
]),
|
|
191
|
-
|
|
194
|
+
p(T, { name: "fade" }, {
|
|
192
195
|
default: H(() => [
|
|
193
196
|
v($) ? (u(), d("span", K, [...l[1] || (l[1] = [
|
|
194
197
|
c("span", {
|
|
@@ -206,5 +209,5 @@ const _ = ["src"], j = ["onClick"], x = ["onClick"], G = ["for"], J = ["innerHTM
|
|
|
206
209
|
}
|
|
207
210
|
});
|
|
208
211
|
export {
|
|
209
|
-
|
|
212
|
+
ne as default
|
|
210
213
|
};
|
package/dist/i18n.d.ts
CHANGED
package/dist/locales/en.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,23 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ablok-components",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.3.
|
|
5
|
-
"scripts": {
|
|
6
|
-
"dev": "vite --host",
|
|
7
|
-
"story:dev": "histoire dev",
|
|
8
|
-
"story:build": "histoire build",
|
|
9
|
-
"story:preview": "histoire preview",
|
|
10
|
-
"build": "vue-tsc --noEmit --project tsconfig.build.json && vite build",
|
|
11
|
-
"build:watch": "vue-tsc --noEmit --watch --project tsconfig.build.json & vite build --watch",
|
|
12
|
-
"preview": "vite preview",
|
|
13
|
-
"build-lib-bak": "vite build && vue-tsc --emitDeclarationOnly && mv dist/src dist/types",
|
|
14
|
-
"build-lib": "vite build && vue-tsc --emitDeclarationOnly",
|
|
15
|
-
"release": "bash ./scripts/release.sh",
|
|
16
|
-
"postrelease": "bash ./scripts/publish.sh",
|
|
17
|
-
"test": "vitest run",
|
|
18
|
-
"test:watch": "vitest",
|
|
19
|
-
"test:ui": "vitest --ui"
|
|
20
|
-
},
|
|
4
|
+
"version": "0.3.88",
|
|
21
5
|
"dependencies": {
|
|
22
6
|
"date-fns": "^3.0.0",
|
|
23
7
|
"dompurify": "^3.3.1",
|
|
@@ -136,5 +120,21 @@
|
|
|
136
120
|
"./package.json": "./package.json"
|
|
137
121
|
},
|
|
138
122
|
"types": "./dist/index.d.ts",
|
|
139
|
-
"sideEffects": false
|
|
140
|
-
|
|
123
|
+
"sideEffects": false,
|
|
124
|
+
"scripts": {
|
|
125
|
+
"dev": "vite --host",
|
|
126
|
+
"story:dev": "histoire dev",
|
|
127
|
+
"story:build": "histoire build",
|
|
128
|
+
"story:preview": "histoire preview",
|
|
129
|
+
"build": "vue-tsc --noEmit --project tsconfig.build.json && vite build",
|
|
130
|
+
"build:watch": "vue-tsc --noEmit --watch --project tsconfig.build.json & vite build --watch",
|
|
131
|
+
"preview": "vite preview",
|
|
132
|
+
"build-lib-bak": "vite build && vue-tsc --emitDeclarationOnly && mv dist/src dist/types",
|
|
133
|
+
"build-lib": "vite build && vue-tsc --emitDeclarationOnly",
|
|
134
|
+
"release": "bash ./scripts/release.sh",
|
|
135
|
+
"postrelease": "bash ./scripts/publish.sh",
|
|
136
|
+
"test": "vitest run",
|
|
137
|
+
"test:watch": "vitest",
|
|
138
|
+
"test:ui": "vitest --ui"
|
|
139
|
+
}
|
|
140
|
+
}
|