ablok-components 0.3.87 → 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.
|
@@ -1,4 +1,15 @@
|
|
|
1
|
-
declare
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
button?(_: {}): any;
|
|
5
|
+
};
|
|
6
|
+
refs: {
|
|
7
|
+
root: HTMLDivElement;
|
|
8
|
+
};
|
|
9
|
+
rootEl: HTMLDivElement;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
|
+
declare const __VLS_component: import('../../../../vue/dist/vue.esm-bundler.js').DefineComponent<import('../../../../vue/dist/vue.esm-bundler.js').ExtractPropTypes<{
|
|
2
13
|
storeId: StringConstructor;
|
|
3
14
|
modelValue: {
|
|
4
15
|
type: {
|
|
@@ -72,6 +83,26 @@ declare const _default: import('../../../../vue/dist/vue.esm-bundler.js').Define
|
|
|
72
83
|
messages: {
|
|
73
84
|
type: null;
|
|
74
85
|
};
|
|
86
|
+
hasHeader: {
|
|
87
|
+
type: BooleanConstructor;
|
|
88
|
+
default: boolean;
|
|
89
|
+
};
|
|
90
|
+
title: {
|
|
91
|
+
type: StringConstructor;
|
|
92
|
+
default: string;
|
|
93
|
+
};
|
|
94
|
+
hasBulkRemove: {
|
|
95
|
+
type: BooleanConstructor;
|
|
96
|
+
default: boolean;
|
|
97
|
+
};
|
|
98
|
+
hasCaptions: {
|
|
99
|
+
type: BooleanConstructor;
|
|
100
|
+
default: boolean;
|
|
101
|
+
};
|
|
102
|
+
editCaptions: {
|
|
103
|
+
type: BooleanConstructor;
|
|
104
|
+
default: boolean;
|
|
105
|
+
};
|
|
75
106
|
}>, {}, {}, {}, {}, import('../../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, import('../../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, {
|
|
76
107
|
"update:modelValue": (...args: any[]) => void;
|
|
77
108
|
}, string, import('../../../../vue/dist/vue.esm-bundler.js').PublicProps, Readonly<import('../../../../vue/dist/vue.esm-bundler.js').ExtractPropTypes<{
|
|
@@ -148,10 +179,31 @@ declare const _default: import('../../../../vue/dist/vue.esm-bundler.js').Define
|
|
|
148
179
|
messages: {
|
|
149
180
|
type: null;
|
|
150
181
|
};
|
|
182
|
+
hasHeader: {
|
|
183
|
+
type: BooleanConstructor;
|
|
184
|
+
default: boolean;
|
|
185
|
+
};
|
|
186
|
+
title: {
|
|
187
|
+
type: StringConstructor;
|
|
188
|
+
default: string;
|
|
189
|
+
};
|
|
190
|
+
hasBulkRemove: {
|
|
191
|
+
type: BooleanConstructor;
|
|
192
|
+
default: boolean;
|
|
193
|
+
};
|
|
194
|
+
hasCaptions: {
|
|
195
|
+
type: BooleanConstructor;
|
|
196
|
+
default: boolean;
|
|
197
|
+
};
|
|
198
|
+
editCaptions: {
|
|
199
|
+
type: BooleanConstructor;
|
|
200
|
+
default: boolean;
|
|
201
|
+
};
|
|
151
202
|
}>> & Readonly<{
|
|
152
203
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
153
204
|
}>, {
|
|
154
205
|
size: number;
|
|
206
|
+
title: string;
|
|
155
207
|
modelValue: {
|
|
156
208
|
type?: string;
|
|
157
209
|
caption?: string;
|
|
@@ -161,7 +213,17 @@ declare const _default: import('../../../../vue/dist/vue.esm-bundler.js').Define
|
|
|
161
213
|
lastModified?: number;
|
|
162
214
|
}[];
|
|
163
215
|
disabled: boolean;
|
|
216
|
+
hasHeader: boolean;
|
|
217
|
+
hasBulkRemove: boolean;
|
|
218
|
+
hasCaptions: boolean;
|
|
219
|
+
editCaptions: boolean;
|
|
164
220
|
}, {}, {}, {}, string, import('../../../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions, true, {
|
|
165
221
|
root: HTMLDivElement;
|
|
166
222
|
}, HTMLDivElement>;
|
|
223
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
167
224
|
export default _default;
|
|
225
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
226
|
+
new (): {
|
|
227
|
+
$slots: S;
|
|
228
|
+
};
|
|
229
|
+
};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { defineComponent as x, computed as
|
|
2
|
-
import
|
|
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
|
+
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,14 +26,34 @@ const F = { class: "container" }, H = { class: "row" }, N = { 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 t =
|
|
32
|
-
return
|
|
55
|
+
const t = g.modelValue || [];
|
|
56
|
+
return f.value = t.map((e) => e.caption || ""), t.map((e) => ({
|
|
33
57
|
type: e.type,
|
|
34
58
|
src: e.src,
|
|
35
59
|
...e.name ? { name: e.name } : {},
|
|
@@ -38,50 +62,65 @@ const F = { class: "container" }, H = { class: "row" }, N = { class: "col-12" },
|
|
|
38
62
|
}));
|
|
39
63
|
},
|
|
40
64
|
set: (t) => {
|
|
41
|
-
const e =
|
|
42
|
-
|
|
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]);
|
|
43
67
|
}
|
|
44
|
-
}),
|
|
45
|
-
function
|
|
46
|
-
const e = [...
|
|
47
|
-
e.splice(t, 1),
|
|
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);
|
|
48
72
|
}
|
|
49
|
-
async function
|
|
50
|
-
|
|
73
|
+
async function w(t) {
|
|
74
|
+
p.value[t] = !p.value[t], p.value[t] || v(), await F(), M.value?.querySelector(`#caption-${t}`)?.focus();
|
|
51
75
|
}
|
|
52
|
-
function
|
|
76
|
+
function H(t) {
|
|
53
77
|
if (t == null) return "";
|
|
54
78
|
const e = ["B", "KB", "MB", "GB", "TB"];
|
|
55
|
-
let
|
|
56
|
-
for (;
|
|
57
|
-
|
|
58
|
-
return `${
|
|
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}`;
|
|
59
83
|
}
|
|
60
84
|
function T(t) {
|
|
61
85
|
return t ? new Date(t).toLocaleDateString() : "";
|
|
62
86
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
87
|
+
function v(t) {
|
|
88
|
+
k("update:modelValue", (t || r.value).map((e, l) => ({
|
|
65
89
|
...e,
|
|
66
|
-
caption:
|
|
90
|
+
caption: f.value[l] || ""
|
|
67
91
|
})));
|
|
68
92
|
}
|
|
69
93
|
return (t, e) => {
|
|
70
|
-
const
|
|
71
|
-
return
|
|
94
|
+
const l = C("svg-icon"), c = C("base-image");
|
|
95
|
+
return a(), i("div", {
|
|
72
96
|
class: "bulk-upload",
|
|
73
97
|
ref_key: "root",
|
|
74
|
-
ref:
|
|
98
|
+
ref: M
|
|
75
99
|
}, [
|
|
76
|
-
o("div",
|
|
77
|
-
o("div",
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
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)
|
|
81
120
|
])),
|
|
82
|
-
|
|
83
|
-
modelValue:
|
|
84
|
-
"onUpdate:modelValue": e[
|
|
121
|
+
u(N, {
|
|
122
|
+
modelValue: r.value,
|
|
123
|
+
"onUpdate:modelValue": e[2] || (e[2] = (s) => r.value = s),
|
|
85
124
|
multiple: !0,
|
|
86
125
|
accept: "image/*",
|
|
87
126
|
"drop-files": !0,
|
|
@@ -89,71 +128,75 @@ const F = { class: "container" }, H = { class: "row" }, N = { class: "col-12" },
|
|
|
89
128
|
"local-url-format": "objectUrl",
|
|
90
129
|
class: "d-flex flex-column border"
|
|
91
130
|
}, {
|
|
92
|
-
"preview-item":
|
|
93
|
-
o("div",
|
|
94
|
-
o("div",
|
|
95
|
-
o("div",
|
|
96
|
-
|
|
97
|
-
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,
|
|
98
137
|
alt: "",
|
|
99
138
|
class: "img-thumbnail"
|
|
100
139
|
}, null, 8, ["src"])
|
|
101
140
|
]),
|
|
102
|
-
o("div",
|
|
103
|
-
o("div",
|
|
104
|
-
o("div",
|
|
141
|
+
o("div", X, [
|
|
142
|
+
o("div", Y, [
|
|
143
|
+
o("div", Z, b(s.name || t.$t("fileInput.unknownFile")), 1),
|
|
105
144
|
o("div", null, [
|
|
106
|
-
|
|
107
|
-
|
|
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)
|
|
108
147
|
])
|
|
109
148
|
]),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
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)
|
|
123
164
|
]),
|
|
124
|
-
o("div",
|
|
165
|
+
o("div", se, [
|
|
125
166
|
o("button", {
|
|
126
|
-
onClick:
|
|
167
|
+
onClick: y((_) => V(n), ["prevent"]),
|
|
127
168
|
class: "btn btn--close"
|
|
128
169
|
}, [
|
|
129
|
-
|
|
130
|
-
], 8,
|
|
170
|
+
u(l, { symbol: "x" })
|
|
171
|
+
], 8, ne),
|
|
131
172
|
o("button", {
|
|
132
|
-
onClick:
|
|
173
|
+
onClick: y((_) => w(n), ["prevent"]),
|
|
133
174
|
class: "btn btn--close"
|
|
134
175
|
}, [
|
|
135
|
-
|
|
136
|
-
symbol:
|
|
176
|
+
u(l, {
|
|
177
|
+
symbol: p.value[n] ? "check" : "edit-3"
|
|
137
178
|
}, null, 8, ["symbol"])
|
|
138
|
-
], 8,
|
|
179
|
+
], 8, ae)
|
|
139
180
|
])
|
|
140
181
|
])
|
|
141
182
|
])
|
|
142
183
|
]),
|
|
143
|
-
button:
|
|
144
|
-
|
|
145
|
-
o("span",
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
+
])
|
|
153
196
|
])
|
|
154
197
|
])
|
|
155
198
|
]),
|
|
156
|
-
_:
|
|
199
|
+
_: 3
|
|
157
200
|
}, 8, ["modelValue"])
|
|
158
201
|
])
|
|
159
202
|
])
|
|
@@ -163,5 +206,5 @@ const F = { class: "container" }, H = { class: "row" }, N = { class: "col-12" },
|
|
|
163
206
|
}
|
|
164
207
|
});
|
|
165
208
|
export {
|
|
166
|
-
|
|
209
|
+
fe as default
|
|
167
210
|
};
|
package/dist/i18n.d.ts
CHANGED
package/dist/locales/en.d.ts
CHANGED