ablok-components 0.3.78 → 0.3.79

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,9 +1,13 @@
1
+ import { PropType } from '../../../../vue/dist/vue.esm-bundler.js';
2
+ import { LocalUrlFormat } from '../../../composables/useLocalFileUrl';
1
3
  declare function __VLS_template(): {
2
4
  attrs: Partial<{}>;
3
5
  slots: {
4
6
  button?(_: {}): any;
5
7
  };
6
- refs: {};
8
+ refs: {
9
+ root: HTMLDivElement;
10
+ };
7
11
  rootEl: HTMLDivElement;
8
12
  };
9
13
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
@@ -124,6 +128,10 @@ declare const __VLS_component: import('../../../../vue/dist/vue.esm-bundler.js')
124
128
  type: BooleanConstructor;
125
129
  default: boolean;
126
130
  };
131
+ localUrlFormat: {
132
+ type: PropType<LocalUrlFormat>;
133
+ default: string;
134
+ };
127
135
  }>, {}, {}, {}, {}, import('../../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, import('../../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, {
128
136
  "update:modelValue": (...args: any[]) => void;
129
137
  "update:src": (...args: any[]) => void;
@@ -244,6 +252,10 @@ declare const __VLS_component: import('../../../../vue/dist/vue.esm-bundler.js')
244
252
  type: BooleanConstructor;
245
253
  default: boolean;
246
254
  };
255
+ localUrlFormat: {
256
+ type: PropType<LocalUrlFormat>;
257
+ default: string;
258
+ };
247
259
  }>> & Readonly<{
248
260
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
249
261
  "onUpdate:src"?: ((...args: any[]) => any) | undefined;
@@ -270,7 +282,10 @@ declare const __VLS_component: import('../../../../vue/dist/vue.esm-bundler.js')
270
282
  enablePreview: boolean;
271
283
  previewWidth: number;
272
284
  dropFiles: boolean;
273
- }, {}, {}, {}, string, import('../../../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions, true, {}, HTMLDivElement>;
285
+ localUrlFormat: LocalUrlFormat;
286
+ }, {}, {}, {}, string, import('../../../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions, true, {
287
+ root: HTMLDivElement;
288
+ }, HTMLDivElement>;
274
289
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
275
290
  export default _default;
276
291
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1,13 +1,16 @@
1
- import { defineComponent as C, watch as y, openBlock as a, createElementBlock as n, normalizeClass as b, unref as i, Fragment as g, renderList as U, createElementVNode as o, withModifiers as v, createVNode as u, isRef as z, renderSlot as D, Transition as N, withCtx as P, createCommentVNode as T } from "vue";
2
- import h from "../../atoms/svg-icon/svg-icon.vue.js";
1
+ import { defineComponent as A, ref as f, toRef as L, computed as N, watch as b, openBlock as s, createElementBlock as u, normalizeClass as h, unref as y, Fragment as V, renderList as P, createElementVNode as d, withModifiers as S, createVNode as m, renderSlot as T, Transition as M, withCtx as _, createCommentVNode as H } from "vue";
2
+ import k from "../../atoms/svg-icon/svg-icon.vue.js";
3
3
  /* empty css */
4
- import L from "../../atoms/input-file/input-file.vue.js";
5
- import { useFileUpload as x } from "../../../composables/useFileUpload.js";
6
- import { fileToDataUrl as M, uniqueId as S } from "../../../utilities/helpers.js";
7
- const W = ["src"], _ = ["onClick"], q = ["onClick"], E = ["for"], H = ["innerHTML"], R = {
4
+ import W from "../../atoms/input-file/input-file.vue.js";
5
+ import { useDragAndDrop as q } from "../../../composables/useDragAndDrop.js";
6
+ import { useUploadTransport as x } from "../../../composables/useUploadTransport.js";
7
+ import { useLocalFileUrl as E } from "../../../composables/useLocalFileUrl.js";
8
+ import { sanitizeHtml as I } from "../../../composables/useSanitize.js";
9
+ import { uniqueId as w } from "../../../utilities/helpers.js";
10
+ const R = ["src"], O = ["onClick"], j = ["onClick"], G = ["for"], J = ["innerHTML"], K = {
8
11
  key: 0,
9
12
  class: "file-upload__loading-spinner"
10
- }, K = /* @__PURE__ */ C({
13
+ }, oe = /* @__PURE__ */ A({
11
14
  __name: "file-upload",
12
15
  props: {
13
16
  modelValue: {
@@ -19,11 +22,11 @@ const W = ["src"], _ = ["onClick"], q = ["onClick"], E = ["for"], H = ["innerHTM
19
22
  },
20
23
  name: {
21
24
  type: String,
22
- default: () => S()
25
+ default: () => w()
23
26
  },
24
27
  id: {
25
28
  type: String,
26
- default: () => S()
29
+ default: () => w()
27
30
  },
28
31
  label: {
29
32
  type: String,
@@ -92,86 +95,110 @@ const W = ["src"], _ = ["onClick"], q = ["onClick"], E = ["for"], H = ["innerHTM
92
95
  dropFiles: {
93
96
  type: Boolean,
94
97
  default: !1
98
+ },
99
+ localUrlFormat: {
100
+ type: String,
101
+ default: "dataUrl"
95
102
  }
96
103
  },
97
104
  emits: ["update:modelValue", "update:src"],
98
- setup(e, { emit: w }) {
99
- const s = e, m = w, { pending: k, files: r, dataUrls: c, isDragging: F, thumbnails: B, uploadFile: V, removeFile: p } = x(s, m);
100
- return y(() => r.value, async (l) => {
101
- c.value = await Promise.all(
102
- l.map(async (t) => ({
103
- src: s.toDataUrl ? await M(t) : await V(t),
104
- type: t.type
105
+ setup(a, { emit: F }) {
106
+ const e = a, i = F, v = f(), c = f([]), o = f([]), { pending: U, uploadFile: B } = x(e), { toLocalUrl: D, revoke: $ } = E(L(e, "localUrlFormat")), { isDragging: C } = q(v, {
107
+ enabled: () => e.dropFiles,
108
+ onDrop: (t) => {
109
+ c.value = t;
110
+ }
111
+ }), z = N(() => e.modelValue?.length ? e.modelValue : e.src ? [{ type: "", src: e.src }] : o.value);
112
+ function g(t) {
113
+ const l = typeof t == "string" ? parseInt(t, 10) : t, n = Array.isArray(e.modelValue) && e.modelValue.length > 0, p = Array.isArray(o.value) && o.value.length > 0;
114
+ if (p && l < o.value.length && ($(o.value[l]?.src), o.value.splice(l, 1)), n) {
115
+ const r = [...e.modelValue];
116
+ l < r.length && r.splice(l, 1), i("update:modelValue", r), e.multiple || i("update:src", r[0]?.src || "");
117
+ } else if (p) {
118
+ const r = e.multiple ? o.value : o.value[0];
119
+ i("update:modelValue", r), e.multiple || i("update:src", o.value[0]?.src || "");
120
+ } else
121
+ i("update:modelValue", e.multiple ? [] : void 0), i("update:src", "");
122
+ c.value.splice(l, 1);
123
+ }
124
+ return b(() => c.value, async (t) => {
125
+ const l = await Promise.all(
126
+ t.map(async (n) => ({
127
+ src: e.toDataUrl ? await D(n) : await B(n),
128
+ type: n.type
105
129
  }))
106
130
  );
107
- }, { deep: !0 }), y(() => c.value, async (l) => {
108
- const t = s.multiple ? l : l[0];
109
- m("update:modelValue", t), s.multiple || m("update:src", l[0] && l[0].src);
110
- }, { deep: !0 }), (l, t) => (a(), n("div", {
111
- class: b(["file-upload", {
112
- "has-dragging": e.dropFiles,
113
- "is-dragging": i(F)
131
+ o.value = l.filter((n) => n !== null);
132
+ }, { deep: !0 }), b(() => o.value, async (t) => {
133
+ const l = e.multiple ? t : t[0];
134
+ i("update:modelValue", l), e.multiple || i("update:src", t[0] && t[0].src);
135
+ }, { deep: !0 }), (t, l) => (s(), u("div", {
136
+ ref_key: "root",
137
+ ref: v,
138
+ class: h(["file-upload", {
139
+ "has-dragging": a.dropFiles,
140
+ "is-dragging": y(C)
114
141
  }])
115
142
  }, [
116
- (a(!0), n(g, null, U(i(B), (d, f) => (a(), n("div", {
117
- key: d.src,
118
- class: b(e.enablePreview ? "file-upload__thumbnail" : "file-upload__reset")
143
+ (s(!0), u(V, null, P(z.value, (n, p) => (s(), u("div", {
144
+ key: n.src,
145
+ class: h(a.enablePreview ? "file-upload__thumbnail" : "file-upload__reset")
119
146
  }, [
120
- e.enablePreview ? (a(), n(g, { key: 0 }, [
121
- o("img", {
122
- src: `${d.src}${e.previewWidth ? `?width=${e.previewWidth}` : ""}`,
147
+ a.enablePreview ? (s(), u(V, { key: 0 }, [
148
+ d("img", {
149
+ src: `${n.src}${a.previewWidth ? `?width=${a.previewWidth}` : ""}`,
123
150
  class: "img-thumbnail rounded"
124
- }, null, 8, W),
125
- o("button", {
126
- onClick: v(($) => i(p)(f), ["prevent"]),
151
+ }, null, 8, R),
152
+ d("button", {
153
+ onClick: S((r) => g(p), ["prevent"]),
127
154
  class: "btn btn--close"
128
155
  }, [
129
- u(h, { symbol: "x" })
130
- ], 8, _)
131
- ], 64)) : (a(), n("button", {
156
+ m(k, { symbol: "x" })
157
+ ], 8, O)
158
+ ], 64)) : (s(), u("button", {
132
159
  key: 1,
133
- onClick: v(($) => i(p)(f), ["prevent"]),
160
+ onClick: S((r) => g(p), ["prevent"]),
134
161
  class: "btn btn--close btn-outline-contrast"
135
162
  }, [
136
- u(h, { symbol: "x" })
137
- ], 8, q))
163
+ m(k, { symbol: "x" })
164
+ ], 8, j))
138
165
  ], 2))), 128)),
139
- u(L, {
140
- modelValue: i(r),
141
- "onUpdate:modelValue": t[0] || (t[0] = (d) => z(r) ? r.value = d : null),
142
- id: e.id,
143
- name: e.name,
144
- accept: e.accept,
145
- "max-file-size": e.maxFileSize,
166
+ m(W, {
167
+ modelValue: c.value,
168
+ "onUpdate:modelValue": l[0] || (l[0] = (n) => c.value = n),
169
+ id: a.id,
170
+ name: a.name,
171
+ accept: a.accept,
172
+ "max-file-size": a.maxFileSize,
146
173
  class: "d-none"
147
174
  }, null, 8, ["modelValue", "id", "name", "accept", "max-file-size"]),
148
- o("label", {
149
- for: e.id,
175
+ d("label", {
176
+ for: a.id,
150
177
  class: "file-upload__label"
151
178
  }, [
152
- D(l.$slots, "button", {}, () => [
153
- o("span", {
179
+ T(t.$slots, "button", {}, () => [
180
+ d("span", {
154
181
  class: "btn btn-outline-contrast",
155
- innerHTML: e.label || l.$t("common.selectFile")
156
- }, null, 8, H)
182
+ innerHTML: y(I)(a.label || t.$t("common.selectFile"))
183
+ }, null, 8, J)
157
184
  ]),
158
- u(N, { name: "fade" }, {
159
- default: P(() => [
160
- i(k) ? (a(), n("span", R, [...t[1] || (t[1] = [
161
- o("span", {
185
+ m(M, { name: "fade" }, {
186
+ default: _(() => [
187
+ y(U) ? (s(), u("span", K, [...l[1] || (l[1] = [
188
+ d("span", {
162
189
  class: "spinner-border",
163
190
  role: "status"
164
191
  }, [
165
- o("span", { class: "visually-hidden" }, "Loading...")
192
+ d("span", { class: "visually-hidden" }, "Loading...")
166
193
  ], -1)
167
- ])])) : T("", !0)
194
+ ])])) : H("", !0)
168
195
  ]),
169
196
  _: 1
170
197
  })
171
- ], 8, E)
198
+ ], 8, G)
172
199
  ], 2));
173
200
  }
174
201
  });
175
202
  export {
176
- K as default
203
+ oe as default
177
204
  };
@@ -1,10 +1,14 @@
1
+ import { PropType } from '../../../../vue/dist/vue.esm-bundler.js';
2
+ import { LocalUrlFormat } from '../../../composables/useLocalFileUrl';
1
3
  import { IMediaObject } from '../../../types/media';
2
4
  declare function __VLS_template(): {
3
5
  attrs: Partial<{}>;
4
6
  slots: {
5
7
  button?(_: {}): any;
6
8
  };
7
- refs: {};
9
+ refs: {
10
+ root: HTMLDivElement;
11
+ };
8
12
  rootEl: HTMLDivElement;
9
13
  };
10
14
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
@@ -98,6 +102,10 @@ declare const __VLS_component: import('../../../../vue/dist/vue.esm-bundler.js')
98
102
  default: number;
99
103
  };
100
104
  aspectRatio: NumberConstructor;
105
+ localUrlFormat: {
106
+ type: PropType<LocalUrlFormat>;
107
+ default: string;
108
+ };
101
109
  }>, {}, {}, {}, {}, import('../../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, import('../../../../vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, {
102
110
  "update:modelValue": (...args: any[]) => void;
103
111
  "update:src": (...args: any[]) => void;
@@ -191,6 +199,10 @@ declare const __VLS_component: import('../../../../vue/dist/vue.esm-bundler.js')
191
199
  default: number;
192
200
  };
193
201
  aspectRatio: NumberConstructor;
202
+ localUrlFormat: {
203
+ type: PropType<LocalUrlFormat>;
204
+ default: string;
205
+ };
194
206
  }>> & Readonly<{
195
207
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
196
208
  "onUpdate:src"?: ((...args: any[]) => any) | undefined;
@@ -214,9 +226,12 @@ declare const __VLS_component: import('../../../../vue/dist/vue.esm-bundler.js')
214
226
  enablePreview: boolean;
215
227
  previewWidth: number;
216
228
  dropFiles: boolean;
229
+ localUrlFormat: LocalUrlFormat;
217
230
  enableReview: boolean;
218
231
  maxImageWidth: number;
219
- }, {}, {}, {}, string, import('../../../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions, true, {}, HTMLDivElement>;
232
+ }, {}, {}, {}, string, import('../../../../vue/dist/vue.esm-bundler.js').ComponentProvideOptions, true, {
233
+ root: HTMLDivElement;
234
+ }, HTMLDivElement>;
220
235
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
221
236
  export default _default;
222
237
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1,21 +1,24 @@
1
- import { defineComponent as L, ref as b, computed as P, watch as v, onMounted as Q, onBeforeUnmount as q, openBlock as s, createElementBlock as m, normalizeClass as U, unref as g, Fragment as A, createVNode as r, normalizeStyle as E, isRef as D, createElementVNode as o, withModifiers as w, createCommentVNode as h, renderSlot as H, Transition as O, withCtx as $, createBlock as j, toDisplayString as G } from "vue";
2
- import J from "../image-crop-resize/image-crop-resize.vue.js";
3
- import K from "../../atoms/base-image/base-image.vue.js";
1
+ import { defineComponent as P, ref as u, toRef as Q, computed as H, watch as v, onBeforeUnmount as O, openBlock as s, createElementBlock as p, normalizeClass as C, unref as $, Fragment as q, createVNode as d, normalizeStyle as E, createElementVNode as n, withModifiers as h, createCommentVNode as V, renderSlot as j, Transition as A, withCtx as B, createBlock as G, toDisplayString as J } from "vue";
2
+ import K from "../image-crop-resize/image-crop-resize.vue.js";
3
+ import X from "../../atoms/base-image/base-image.vue.js";
4
4
  /* empty css */
5
- import k from "../../atoms/svg-icon/svg-icon.vue.js";
5
+ import z from "../../atoms/svg-icon/svg-icon.vue.js";
6
6
  /* empty css */
7
- import X from "../../atoms/input-file/input-file.vue.js";
8
- import Y from "../../templates/modal-dialog/modal-dialog.vue.js";
7
+ import Y from "../../atoms/input-file/input-file.vue.js";
8
+ import Z from "../../templates/modal-dialog/modal-dialog.vue.js";
9
9
  /* empty css */
10
- import { useFileUpload as Z } from "../../../composables/useFileUpload.js";
11
- import { resizeImageFileByMaxWidth as _, fileToDataUrl as R, uniqueId as W, srcToFile as ee } from "../../../utilities/helpers.js";
12
- const te = { class: "image-upload__controls" }, ae = { class: "d-flex gap-1 align-items-center" }, le = {
10
+ import { useDragAndDrop as _ } from "../../../composables/useDragAndDrop.js";
11
+ import { useUploadTransport as ee } from "../../../composables/useUploadTransport.js";
12
+ import { useLocalFileUrl as te } from "../../../composables/useLocalFileUrl.js";
13
+ import { sanitizeHtml as ae } from "../../../composables/useSanitize.js";
14
+ import { resizeImageFileByMaxWidth as le, uniqueId as N, srcToFile as oe } from "../../../utilities/helpers.js";
15
+ const ie = { class: "image-upload__controls" }, ne = { class: "d-flex gap-1 align-items-center" }, re = {
13
16
  key: 1,
14
17
  class: "image-upload__controls"
15
- }, ne = ["for"], ie = ["innerHTML"], oe = {
18
+ }, ue = ["for"], se = ["innerHTML"], de = {
16
19
  key: 0,
17
20
  class: "image-upload__loading-spinner"
18
- }, ge = /* @__PURE__ */ L({
21
+ }, ke = /* @__PURE__ */ P({
19
22
  __name: "image-upload",
20
23
  props: {
21
24
  modelValue: {
@@ -27,11 +30,11 @@ const te = { class: "image-upload__controls" }, ae = { class: "d-flex gap-1 alig
27
30
  },
28
31
  name: {
29
32
  type: String,
30
- default: () => W()
33
+ default: () => N()
31
34
  },
32
35
  id: {
33
36
  type: String,
34
- default: () => W()
37
+ default: () => N()
35
38
  },
36
39
  label: {
37
40
  type: String,
@@ -106,163 +109,175 @@ const te = { class: "image-upload__controls" }, ae = { class: "d-flex gap-1 alig
106
109
  type: Number,
107
110
  default: 4096
108
111
  },
109
- aspectRatio: Number
112
+ aspectRatio: Number,
113
+ localUrlFormat: {
114
+ type: String,
115
+ default: "dataUrl"
116
+ }
110
117
  },
111
118
  emits: ["update:modelValue", "update:src"],
112
- setup(a, { emit: z }) {
113
- const i = a, p = z, u = b(!1), d = b(null), l = b(null), V = b(null), {
114
- pending: C,
115
- files: f,
116
- // dataUrls,
117
- imgLoaded: c,
118
- isDragging: N,
119
- uploadFile: F,
120
- setupDragAndDrop: T,
121
- cleanupDragAndDrop: x
122
- } = Z(i, p), y = P(() => i.modelValue ? i.modelValue : i.src ? { type: "", src: i.src } : d.value);
123
- function S() {
124
- d.value = null, f.value = [], c.value = !1, p("update:modelValue", void 0), p("update:src", "");
119
+ setup(a, { emit: T }) {
120
+ const o = a, y = T, D = u(), f = u([]), b = u(!1), r = u(!1), m = u(null), l = u(null), F = u(null);
121
+ let c = !1;
122
+ const { pending: L, uploadFile: R } = ee(o), { toLocalUrl: S, revoke: g } = te(Q(o, "localUrlFormat")), { isDragging: x } = _(D, {
123
+ enabled: () => o.dropFiles,
124
+ onDrop: (t) => {
125
+ f.value = t;
126
+ }
127
+ }), w = H(() => o.modelValue ? o.modelValue : o.src ? { type: "", src: o.src } : m.value);
128
+ function U(t) {
129
+ g(m.value?.src), m.value = t;
130
+ }
131
+ function k() {
132
+ U(null), f.value = [], b.value = !1, y("update:modelValue", void 0), y("update:src", "");
125
133
  }
126
- function B() {
127
- S();
134
+ function W() {
135
+ k();
128
136
  }
129
137
  v(() => f.value, async (t) => {
130
138
  if (!t || !t.length || !t[0]) return;
131
- c.value = !1;
132
- const e = await _(t[0], i.maxImageWidth);
133
- i.enableReview ? (l.value = {
134
- src: await R(e),
139
+ b.value = !1;
140
+ const e = await le(t[0], o.maxImageWidth);
141
+ o.enableReview ? (l.value = {
142
+ src: await S(e),
135
143
  type: e.type
136
- }, u.value = !0) : d.value = {
137
- src: i.toDataUrl ? await R(e) : await F(e),
144
+ }, c = !0, r.value = !0) : U({
145
+ src: o.toDataUrl ? await S(e) : await R(e),
138
146
  type: e.type
139
- };
140
- }), v(() => d.value, (t) => {
141
- p("update:modelValue", t || void 0), p("update:src", t?.src || "");
142
- }), v(() => V.value, async (t) => {
143
- t && (d.value = {
144
- src: await F(t),
145
- type: t.type
146
- }, V.value = null);
147
- }), v(() => u.value, (t, e) => {
148
- !t && e && l.value && (l.value = null, B());
149
- }), v(() => i.src, (t) => {
150
- !t && d.value && B();
147
+ });
148
+ }), v(() => m.value, (t) => {
149
+ y("update:modelValue", t || void 0), y("update:src", t?.src || "");
150
+ }), v(() => F.value, async (t) => {
151
+ if (t) {
152
+ try {
153
+ U({
154
+ src: o.toDataUrl ? await S(t) : await R(t),
155
+ type: t.type
156
+ });
157
+ } catch (e) {
158
+ console.error(`Failed to process file "${t.name}"`, e);
159
+ }
160
+ F.value = null;
161
+ }
162
+ }), v(() => r.value, (t, e) => {
163
+ !t && e && l.value && (c && g(l.value.src), c = !1, l.value = null, W());
164
+ }), v(() => o.src, (t) => {
165
+ !t && m.value && W();
151
166
  });
152
- function M(t, e) {
153
- l.value = { src: t, type: e }, u.value = !0;
167
+ function I(t, e) {
168
+ c = !1, l.value = { src: t, type: e }, r.value = !0;
154
169
  }
155
- async function I() {
156
- l.value && (V.value = await ee(
170
+ async function M() {
171
+ l.value && (F.value = await oe(
157
172
  l.value.src,
158
173
  "file",
159
174
  l.value.type
160
- )), l.value = null, u.value = !1;
175
+ ), c && g(l.value.src)), c = !1, l.value = null, r.value = !1;
161
176
  }
162
- return Q(() => {
163
- T();
164
- }), q(() => {
165
- x();
166
- }), (t, e) => (s(), m("div", {
167
- class: U(["image-upload", {
177
+ return O(() => {
178
+ g(m.value?.src);
179
+ }), (t, e) => (s(), p("div", {
180
+ ref_key: "root",
181
+ ref: D,
182
+ class: C(["image-upload", {
168
183
  "has-dragging": a.dropFiles,
169
- "is-dragging": g(N)
184
+ "is-dragging": $(x)
170
185
  }])
171
186
  }, [
172
- !u.value && y.value ? (s(), m("div", {
187
+ !r.value && w.value ? (s(), p("div", {
173
188
  key: 0,
174
- class: U(["mb-2", a.enablePreview ? "image-upload__thumbnail" : "image-upload__reset"])
189
+ class: C(["mb-2", a.enablePreview ? "image-upload__thumbnail" : "image-upload__reset"])
175
190
  }, [
176
- a.enablePreview ? (s(), m(A, { key: 0 }, [
177
- r(K, {
178
- src: `${y.value.src}${a.previewWidth ? `?width=${a.previewWidth}` : ""}`,
191
+ a.enablePreview ? (s(), p(q, { key: 0 }, [
192
+ d(X, {
193
+ src: `${w.value.src}${a.previewWidth ? `?width=${a.previewWidth}` : ""}`,
179
194
  class: "img-thumbnail rounded",
180
- ready: g(c),
181
- "onUpdate:ready": e[0] || (e[0] = (n) => D(c) ? c.value = n : null),
195
+ ready: b.value,
196
+ "onUpdate:ready": e[0] || (e[0] = (i) => b.value = i),
182
197
  animate: !1,
183
198
  style: E({ maxWidth: a.previewWidth ? `${a.previewWidth}px` : "auto", height: "auto" })
184
199
  }, null, 8, ["src", "ready", "style"]),
185
- o("div", te, [
186
- o("div", ae, [
187
- o("button", {
200
+ n("div", ie, [
201
+ n("div", ne, [
202
+ n("button", {
188
203
  type: "button",
189
- onClick: e[1] || (e[1] = w((n) => M(y.value.src, y.value.type), ["prevent", "stop"])),
204
+ onClick: e[1] || (e[1] = h((i) => I(w.value.src, w.value.type), ["prevent", "stop"])),
190
205
  class: "btn btn--edit btn-sm btn-light"
191
206
  }, [
192
- r(k, { symbol: "edit-2" })
207
+ d(z, { symbol: "edit-2" })
193
208
  ]),
194
- o("button", {
209
+ n("button", {
195
210
  type: "button",
196
- onClick: e[2] || (e[2] = w((n) => S(), ["prevent", "stop"])),
211
+ onClick: e[2] || (e[2] = h((i) => k(), ["prevent", "stop"])),
197
212
  class: "btn btn--close btn-sm btn-light"
198
213
  }, [
199
- r(k, { symbol: "x" })
214
+ d(z, { symbol: "x" })
200
215
  ])
201
216
  ])
202
217
  ])
203
- ], 64)) : (s(), m("div", le, [
204
- o("button", {
205
- onClick: e[3] || (e[3] = w((n) => S(), ["prevent", "stop"])),
218
+ ], 64)) : (s(), p("div", re, [
219
+ n("button", {
220
+ onClick: e[3] || (e[3] = h((i) => k(), ["prevent", "stop"])),
206
221
  class: "btn btn--close btn-outline-contrast"
207
222
  }, [
208
- r(k, { symbol: "x" })
223
+ d(z, { symbol: "x" })
209
224
  ])
210
225
  ]))
211
- ], 2)) : h("", !0),
212
- r(X, {
213
- modelValue: g(f),
214
- "onUpdate:modelValue": e[4] || (e[4] = (n) => D(f) ? f.value = n : null),
226
+ ], 2)) : V("", !0),
227
+ d(Y, {
228
+ modelValue: f.value,
229
+ "onUpdate:modelValue": e[4] || (e[4] = (i) => f.value = i),
215
230
  id: a.id,
216
231
  name: a.name,
217
232
  accept: a.accept,
218
233
  "max-file-size": a.maxFileSize,
219
234
  class: "d-none"
220
235
  }, null, 8, ["modelValue", "id", "name", "accept", "max-file-size"]),
221
- a.src ? h("", !0) : (s(), m("label", {
236
+ a.src ? V("", !0) : (s(), p("label", {
222
237
  key: 1,
223
238
  for: a.id,
224
239
  class: "image-upload__label"
225
240
  }, [
226
- H(t.$slots, "button", {}, () => [
227
- o("span", {
241
+ j(t.$slots, "button", {}, () => [
242
+ n("span", {
228
243
  class: "btn btn-outline-contrast",
229
- innerHTML: a.label || t.$t("common.selectFile")
230
- }, null, 8, ie)
244
+ innerHTML: $(ae)(a.label || t.$t("common.selectFile"))
245
+ }, null, 8, se)
231
246
  ]),
232
- r(O, { name: "fade" }, {
233
- default: $(() => [
234
- g(C) ? (s(), m("span", oe, [...e[7] || (e[7] = [
235
- o("span", {
247
+ d(A, { name: "fade" }, {
248
+ default: B(() => [
249
+ $(L) ? (s(), p("span", de, [...e[7] || (e[7] = [
250
+ n("span", {
236
251
  class: "spinner-border",
237
252
  role: "status"
238
253
  }, [
239
- o("span", { class: "visually-hidden" }, "Loading...")
254
+ n("span", { class: "visually-hidden" }, "Loading...")
240
255
  ], -1)
241
- ])])) : h("", !0)
256
+ ])])) : V("", !0)
242
257
  ]),
243
258
  _: 1
244
259
  })
245
- ], 8, ne)),
246
- r(Y, {
247
- modelValue: u.value,
248
- "onUpdate:modelValue": e[6] || (e[6] = (n) => u.value = n),
260
+ ], 8, ue)),
261
+ d(Z, {
262
+ modelValue: r.value,
263
+ "onUpdate:modelValue": e[6] || (e[6] = (i) => r.value = i),
249
264
  footer: !1
250
265
  }, {
251
- default: $(() => [
252
- u.value && l.value ? (s(), j(J, {
266
+ default: B(() => [
267
+ r.value && l.value ? (s(), G(K, {
253
268
  key: 0,
254
269
  modelValue: l.value.src,
255
- "onUpdate:modelValue": e[5] || (e[5] = (n) => l.value.src = n),
270
+ "onUpdate:modelValue": e[5] || (e[5] = (i) => l.value.src = i),
256
271
  "aspect-ratio": a.aspectRatio
257
272
  }, {
258
- submit: $(() => [
259
- o("button", {
273
+ submit: B(() => [
274
+ n("button", {
260
275
  class: "btn btn-primary",
261
- onClick: w(I, ["prevent", "stop"])
262
- }, G(t.$t("common.save")), 1)
276
+ onClick: h(M, ["prevent", "stop"])
277
+ }, J(t.$t("common.save")), 1)
263
278
  ]),
264
279
  _: 1
265
- }, 8, ["modelValue", "aspect-ratio"])) : h("", !0)
280
+ }, 8, ["modelValue", "aspect-ratio"])) : V("", !0)
266
281
  ]),
267
282
  _: 1
268
283
  }, 8, ["modelValue"])
@@ -270,5 +285,5 @@ const te = { class: "image-upload__controls" }, ae = { class: "d-flex gap-1 alig
270
285
  }
271
286
  });
272
287
  export {
273
- ge as default
288
+ ke as default
274
289
  };