ablok-components 0.0.39 → 0.0.40

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.
Files changed (21) hide show
  1. package/dist/ablok-components.es.js +173 -168
  2. package/dist/ablok-components.umd.js +1 -1
  3. package/dist/components/{base-button.vue.d.ts → form/base-button/base-button.vue.d.ts} +0 -0
  4. package/dist/components/{base-form.vue.d.ts → form/base-form/base-form.vue.d.ts} +0 -0
  5. package/dist/components/{check-group.vue.d.ts → form/check-group/check-group.vue.d.ts} +0 -0
  6. package/dist/components/{file-input.vue.d.ts → form/file-input/file-input.vue.d.ts} +0 -0
  7. package/dist/components/{form-input.vue.d.ts → form/form-input/form-input.vue.d.ts} +0 -0
  8. package/dist/components/{input-dropdown.vue.d.ts → form/input-dropdown/input-dropdown.vue.d.ts} +0 -0
  9. package/dist/components/{input-textarea.vue.d.ts → form/input-textarea/input-textarea.vue.d.ts} +0 -0
  10. package/dist/components/{media-upload.vue.d.ts → form/media-upload/media-upload.vue.d.ts} +0 -0
  11. package/dist/components/{radio-group.vue.d.ts → form/radio-group/radio-group.vue.d.ts} +0 -0
  12. package/dist/components/{loading-spinner.vue.d.ts → icon/loading-spinner/loading-spinner.vue.d.ts} +0 -0
  13. package/dist/components/{svg-icon.vue.d.ts → icon/svg-icon/svg-icon.vue.d.ts} +0 -0
  14. package/dist/components/{base-headline.vue.d.ts → text/base-headline/base-headline.vue.d.ts} +0 -0
  15. package/dist/components/{base-paragraph.vue.d.ts → text/base-paragraph/base-paragraph.vue.d.ts} +0 -0
  16. package/dist/index.d.ts +12 -12
  17. package/dist/style.css +1 -1
  18. package/dist/symbol-defs.svg +769 -224
  19. package/dist/{components → utilities}/helpers.d.ts +0 -0
  20. package/package.json +1 -1
  21. package/dist/components/base-button.story.vue.d.ts +0 -48
@@ -1,4 +1,4 @@
1
- import { defineComponent as g, openBlock as r, createElementBlock as s, normalizeClass as b, createElementVNode as o, renderSlot as m, computed as h, createBlock as C, resolveDynamicComponent as D, unref as p, withCtx as A, createTextVNode as x, toDisplayString as v, resolveComponent as $, createCommentVNode as k, withDirectives as w, isRef as q, vModelDynamic as H, vModelText as U, ref as O, watch as S, onBeforeMount as L, Fragment as M, renderList as N, withModifiers as T, reactive as P, createVNode as z } from "vue";
1
+ import { defineComponent as g, openBlock as r, createElementBlock as c, normalizeClass as b, createElementVNode as u, renderSlot as m, computed as h, createBlock as C, resolveDynamicComponent as D, unref as p, withCtx as A, createTextVNode as V, toDisplayString as v, resolveComponent as S, createCommentVNode as w, withDirectives as q, isRef as O, vModelDynamic as H, vModelText as U, ref as x, watch as $, onBeforeMount as L, Fragment as M, renderList as N, withModifiers as T, reactive as P, createVNode as z } from "vue";
2
2
  const R = {
3
3
  class: "icon",
4
4
  preserveAspectRatio: "xMaxYMin"
@@ -23,13 +23,13 @@ const R = {
23
23
  }
24
24
  },
25
25
  setup(e) {
26
- return (i, t) => (r(), s("i", {
26
+ return (o, t) => (r(), c("i", {
27
27
  class: b(["svg-icon", {
28
28
  [`svg-icon--${e.size}`]: e.size
29
29
  }])
30
30
  }, [
31
- (r(), s("svg", R, [
32
- o("use", {
31
+ (r(), c("svg", R, [
32
+ u("use", {
33
33
  "xlink:href": `${e.basePath}#${e.prefix}${e.symbol}`,
34
34
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
35
35
  x: "0",
@@ -50,7 +50,7 @@ const E = { class: "loading-spinner d-block" }, j = { class: "loading-spinner__a
50
50
  viewBox: "0 0 100 100",
51
51
  "enable-background": "new 0 0 0 0",
52
52
  "xml:space": "preserve"
53
- }, J = ["fill"], X = /* @__PURE__ */ o("animateTransform", {
53
+ }, J = ["fill"], X = /* @__PURE__ */ u("animateTransform", {
54
54
  attributeName: "transform",
55
55
  attributeType: "XML",
56
56
  type: "rotate",
@@ -69,16 +69,16 @@ const E = { class: "loading-spinner d-block" }, j = { class: "loading-spinner__a
69
69
  }
70
70
  },
71
71
  setup(e) {
72
- return (i, t) => (r(), s("span", E, [
73
- o("span", j, [
74
- (r(), s("svg", G, [
75
- o("path", {
72
+ return (o, t) => (r(), c("span", E, [
73
+ u("span", j, [
74
+ (r(), c("svg", G, [
75
+ u("path", {
76
76
  fill: e.color,
77
77
  d: "M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50"
78
78
  }, Y, 8, J)
79
79
  ]))
80
80
  ]),
81
- m(i.$slots, "default")
81
+ m(o.$slots, "default")
82
82
  ]));
83
83
  }
84
84
  });
@@ -92,13 +92,13 @@ const Ne = /* @__PURE__ */ g({
92
92
  className: null
93
93
  },
94
94
  setup(e) {
95
- const i = e, t = h(() => i.tag || "p");
96
- return (l, n) => (r(), C(D(p(t)), {
95
+ const o = e, t = h(() => o.tag || "p");
96
+ return (d, a) => (r(), C(D(p(t)), {
97
97
  class: b(["headline", `headline--${e.size}${e.className || ""}`])
98
98
  }, {
99
99
  default: A(() => [
100
- m(l.$slots, "default", {}, () => [
101
- x(v(e.text), 1)
100
+ m(d.$slots, "default", {}, () => [
101
+ V(v(e.text), 1)
102
102
  ])
103
103
  ]),
104
104
  _: 3
@@ -113,11 +113,11 @@ const Ne = /* @__PURE__ */ g({
113
113
  className: null
114
114
  },
115
115
  setup(e) {
116
- return (i, t) => (r(), s("p", {
116
+ return (o, t) => (r(), c("p", {
117
117
  class: b(["base-paragraph", `base-paragraph--${e.size}${e.className || ""}`])
118
118
  }, [
119
- m(i.$slots, "default", {}, () => [
120
- x(v(e.text), 1)
119
+ m(o.$slots, "default", {}, () => [
120
+ V(v(e.text), 1)
121
121
  ])
122
122
  ], 2));
123
123
  }
@@ -138,10 +138,10 @@ const Ne = /* @__PURE__ */ g({
138
138
  fab: { type: Boolean }
139
139
  },
140
140
  setup(e) {
141
- const i = e, t = h(() => i.caption && !i.fab);
142
- return (l, n) => {
143
- const d = $("svg-icon");
144
- return r(), s("button", {
141
+ const o = e, t = h(() => o.caption && !o.fab);
142
+ return (d, a) => {
143
+ const i = S("svg-icon");
144
+ return r(), c("button", {
145
145
  type: e.type,
146
146
  disabled: e.disabled,
147
147
  href: e.href,
@@ -158,16 +158,16 @@ const Ne = /* @__PURE__ */ g({
158
158
  "x-small": e.size === "x-small"
159
159
  }])
160
160
  }, [
161
- m(l.$slots, "default", {}, () => [
162
- e.icon ? (r(), C(d, {
161
+ m(d.$slots, "default", {}, () => [
162
+ e.icon ? (r(), C(i, {
163
163
  key: 0,
164
164
  id: e.icon,
165
165
  class: "base-button__caption"
166
- }, null, 8, ["id"])) : k("", !0),
167
- p(t) ? (r(), s("span", {
166
+ }, null, 8, ["id"])) : w("", !0),
167
+ p(t) ? (r(), c("span", {
168
168
  key: 1,
169
169
  class: b(["base-button__caption", { "icon-padding": e.icon }])
170
- }, v(e.caption), 3)) : k("", !0)
170
+ }, v(e.caption), 3)) : w("", !0)
171
171
  ])
172
172
  ], 10, K);
173
173
  };
@@ -235,22 +235,22 @@ const Q = { class: "input-group form-input__input-group" }, W = ["type", "id", "
235
235
  }
236
236
  },
237
237
  emits: ["update:modelValue"],
238
- setup(e, { emit: i }) {
239
- const t = e, l = h({
238
+ setup(e, { emit: o }) {
239
+ const t = e, d = h({
240
240
  get() {
241
241
  return t.modelValue;
242
242
  },
243
- set(n) {
244
- i("update:modelValue", n);
243
+ set(a) {
244
+ o("update:modelValue", a);
245
245
  }
246
246
  });
247
- return (n, d) => (r(), s("div", {
247
+ return (a, i) => (r(), c("div", {
248
248
  class: b(["form-input", `form-input--${e.type}`])
249
249
  }, [
250
- o("div", Q, [
251
- m(n.$slots, "input-prepend"),
252
- w(o("input", {
253
- "onUpdate:modelValue": d[0] || (d[0] = (a) => q(l) ? l.value = a : null),
250
+ u("div", Q, [
251
+ m(a.$slots, "input-prepend"),
252
+ q(u("input", {
253
+ "onUpdate:modelValue": i[0] || (i[0] = (n) => O(d) ? d.value = n : null),
254
254
  type: e.type === "color" ? "text" : e.type,
255
255
  id: e.id,
256
256
  name: e.name,
@@ -266,12 +266,12 @@ const Q = { class: "input-group form-input__input-group" }, W = ["type", "id", "
266
266
  }]),
267
267
  "aria-label": e.label
268
268
  }, null, 10, W), [
269
- [H, p(l)]
269
+ [H, p(d)]
270
270
  ]),
271
- m(n.$slots, "input-append", {}, () => [
272
- e.type === "color" ? (r(), s("span", Z, [
273
- w(o("input", {
274
- "onUpdate:modelValue": d[1] || (d[1] = (a) => q(l) ? l.value = a : null),
271
+ m(a.$slots, "input-append", {}, () => [
272
+ e.type === "color" ? (r(), c("span", Z, [
273
+ q(u("input", {
274
+ "onUpdate:modelValue": i[1] || (i[1] = (n) => O(d) ? d.value = n : null),
275
275
  type: "color",
276
276
  name: `${e.name}-color`,
277
277
  id: `${e.id}-color`,
@@ -281,13 +281,13 @@ const Q = { class: "input-group form-input__input-group" }, W = ["type", "id", "
281
281
  class: "form-control",
282
282
  "aria-label": e.label
283
283
  }, null, 8, _), [
284
- [U, p(l)]
284
+ [U, p(d)]
285
285
  ])
286
- ])) : k("", !0)
286
+ ])) : w("", !0)
287
287
  ])
288
288
  ]),
289
- m(n.$slots, "label", {}, () => [
290
- o("label", {
289
+ m(a.$slots, "label", {}, () => [
290
+ u("label", {
291
291
  for: e.id,
292
292
  class: b(["form-input__label", {
293
293
  "form-check-label": e.type === "checkbox"
@@ -357,19 +357,19 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
357
357
  }
358
358
  },
359
359
  emits: ["update:modelValue"],
360
- setup(e, { emit: i }) {
361
- const t = e, l = h({
360
+ setup(e, { emit: o }) {
361
+ const t = e, d = h({
362
362
  get() {
363
363
  return t.modelValue;
364
364
  },
365
- set(n) {
366
- i("update:modelValue", n);
365
+ set(a) {
366
+ o("update:modelValue", a);
367
367
  }
368
368
  });
369
- return (n, d) => (r(), s("div", te, [
370
- m(n.$slots, "input-prepend"),
371
- w(o("textarea", {
372
- "onUpdate:modelValue": d[0] || (d[0] = (a) => q(l) ? l.value = a : null),
369
+ return (a, i) => (r(), c("div", te, [
370
+ m(a.$slots, "input-prepend"),
371
+ q(u("textarea", {
372
+ "onUpdate:modelValue": i[0] || (i[0] = (n) => O(d) ? d.value = n : null),
373
373
  type: e.type === "color" ? "text" : e.type,
374
374
  id: e.id,
375
375
  name: e.name,
@@ -382,12 +382,12 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
382
382
  class: b(["form-control", {}]),
383
383
  "aria-label": e.label
384
384
  }, null, 8, le), [
385
- [U, p(l)]
385
+ [U, p(d)]
386
386
  ]),
387
- m(n.$slots, "input-append", {}, () => [
388
- e.type === "color" ? (r(), s("span", ae, [
389
- w(o("input", {
390
- "onUpdate:modelValue": d[1] || (d[1] = (a) => q(l) ? l.value = a : null),
387
+ m(a.$slots, "input-append", {}, () => [
388
+ e.type === "color" ? (r(), c("span", ae, [
389
+ q(u("input", {
390
+ "onUpdate:modelValue": i[1] || (i[1] = (n) => O(d) ? d.value = n : null),
391
391
  type: "color",
392
392
  name: `${e.name}-color`,
393
393
  id: `${e.id}-color`,
@@ -397,12 +397,12 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
397
397
  class: "form-control",
398
398
  "aria-label": e.label
399
399
  }, null, 8, ne), [
400
- [U, p(l)]
400
+ [U, p(d)]
401
401
  ])
402
- ])) : k("", !0)
402
+ ])) : w("", !0)
403
403
  ]),
404
- m(n.$slots, "label", {}, () => [
405
- o("label", {
404
+ m(a.$slots, "label", {}, () => [
405
+ u("label", {
406
406
  for: e.id,
407
407
  class: b(["form-input__label", {
408
408
  "form-check-label": e.type === "checkbox"
@@ -452,37 +452,37 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
452
452
  }
453
453
  },
454
454
  emits: ["change", "update:modelValue"],
455
- setup(e, { emit: i }) {
456
- const t = e, l = O([]);
457
- return S(() => t.modelValue, (n, d) => {
458
- l.value = t.options.map(
459
- (a) => a.value ? t.modelValue.some((u) => u["value "] === a.value) : t.modelValue.some((u) => u === a)
455
+ setup(e, { emit: o }) {
456
+ const t = e, d = x([]);
457
+ return $(() => t.modelValue, (a, i) => {
458
+ d.value = t.options.map(
459
+ (n) => n.value ? t.modelValue.some((l) => l["value "] === n.value) : t.modelValue.some((l) => l === n)
460
460
  );
461
- }, { immediate: !0 }), S(l, (n, d) => {
462
- const a = n.reduce((u, c, f) => {
463
- const V = c && t.options[f] ? [t.options[f] || t.options[f]] : [];
464
- return [...u, ...V];
461
+ }, { immediate: !0 }), $(d, (a, i) => {
462
+ const n = a.reduce((l, s, f) => {
463
+ const k = s && t.options[f] ? [t.options[f] || t.options[f]] : [];
464
+ return [...l, ...k];
465
465
  }, []);
466
- i("update:modelValue", a);
466
+ o("update:modelValue", n);
467
467
  }, { deep: !0 }), L(() => {
468
- }), (n, d) => {
469
- const a = $("form-input");
470
- return r(), s("div", ie, [
471
- (r(!0), s(M, null, N(e.options, (u, c) => (r(), C(a, {
472
- key: c,
473
- modelValue: p(l)[c],
474
- "onUpdate:modelValue": (f) => p(l)[c] = f,
468
+ }), (a, i) => {
469
+ const n = S("form-input");
470
+ return r(), c("div", ie, [
471
+ (r(!0), c(M, null, N(e.options, (l, s) => (r(), C(n, {
472
+ key: s,
473
+ modelValue: p(d)[s],
474
+ "onUpdate:modelValue": (f) => p(d)[s] = f,
475
475
  type: "checkbox",
476
476
  name: e.name,
477
- id: `${e.id}-${c}`,
478
- label: `${u.text || u}${e.required ? " *" : ""}`,
477
+ id: `${e.id}-${s}`,
478
+ label: `${l.text || l}${e.required ? " *" : ""}`,
479
479
  disabled: e.disabled,
480
480
  "read-only": e.readOnly,
481
481
  required: e.required
482
482
  }, null, 8, ["modelValue", "onUpdate:modelValue", "name", "id", "label", "disabled", "read-only", "required"]))), 128)),
483
- o("label", { for: e.id }, [
484
- m(n.$slots, "label", {}, () => [
485
- x(v(e.label), 1)
483
+ u("label", { for: e.id }, [
484
+ m(a.$slots, "label", {}, () => [
485
+ V(v(e.label), 1)
486
486
  ])
487
487
  ], 8, oe)
488
488
  ]);
@@ -528,41 +528,41 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
528
528
  }
529
529
  },
530
530
  emits: ["change", "update:modelValue"],
531
- setup(e, { emit: i }) {
531
+ setup(e, { emit: o }) {
532
532
  const t = e;
533
- O(t.options.map((n) => n.value === t.modelValue));
534
- function l(n) {
535
- i("update:modelValue", n);
533
+ x(t.options.map((a) => a.value === t.modelValue));
534
+ function d(a) {
535
+ o("update:modelValue", a);
536
536
  }
537
537
  return L(() => {
538
- }), (n, d) => {
539
- const a = $("form-input");
540
- return r(), s("div", ue, [
541
- (r(!0), s(M, null, N(e.options, (u, c) => (r(), C(a, {
542
- key: c,
538
+ }), (a, i) => {
539
+ const n = S("form-input");
540
+ return r(), c("div", ue, [
541
+ (r(!0), c(M, null, N(e.options, (l, s) => (r(), C(n, {
542
+ key: s,
543
543
  type: "radio",
544
544
  name: e.name,
545
- id: `${e.id}-${c}`,
546
- value: u.value || u,
547
- label: `${u.text || u}${e.required ? " *" : ""}`,
548
- checked: u.value ? u.value === e.modelValue : u === e.modelValue,
545
+ id: `${e.id}-${s}`,
546
+ value: l.value || l,
547
+ label: `${l.text || l}${e.required ? " *" : ""}`,
548
+ checked: l.value ? l.value === e.modelValue : l === e.modelValue,
549
549
  disabled: e.disabled,
550
550
  "read-only": e.readOnly,
551
551
  required: e.required,
552
- onChange: (f) => l(u)
552
+ onChange: (f) => d(l)
553
553
  }, null, 8, ["name", "id", "value", "label", "checked", "disabled", "read-only", "required", "onChange"]))), 128)),
554
- o("label", { for: e.id }, [
555
- m(n.$slots, "label", {}, () => [
556
- x(v(e.label), 1)
554
+ u("label", { for: e.id }, [
555
+ m(a.$slots, "label", {}, () => [
556
+ V(v(e.label), 1)
557
557
  ])
558
558
  ], 8, re)
559
559
  ]);
560
560
  };
561
561
  }
562
- }), se = { class: "input input-dropdown" }, ce = { class: "dropdown" }, me = {
562
+ }), se = { class: "input input-dropdown" }, ce = { class: "dropdown" }, fe = {
563
563
  class: "btn-group",
564
564
  role: "group"
565
- }, fe = ["id", "disabled"], ye = ["aria-labelledby"], pe = ["onClick"], be = ["for"], Ae = /* @__PURE__ */ g({
565
+ }, me = ["id", "disabled"], ye = ["aria-labelledby"], pe = ["onClick"], be = ["for"], Ae = /* @__PURE__ */ g({
566
566
  __name: "input-dropdown",
567
567
  props: {
568
568
  modelValue: {
@@ -619,31 +619,31 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
619
619
  }
620
620
  },
621
621
  emits: ["update:modelValue"],
622
- setup(e, { emit: i }) {
622
+ setup(e, { emit: o }) {
623
623
  const t = e;
624
624
  h({
625
625
  get() {
626
626
  return t.modelValue;
627
627
  },
628
- set(a) {
629
- i("update:modelValue", a);
628
+ set(n) {
629
+ o("update:modelValue", n);
630
630
  }
631
631
  });
632
- function l(a) {
633
- i("update:modelValue", a);
632
+ function d(n) {
633
+ o("update:modelValue", n);
634
634
  }
635
- const n = h(() => [
635
+ const a = h(() => [
636
636
  {
637
637
  text: "Please select"
638
638
  },
639
639
  ...t.options.map(
640
- (a) => typeof a == "string" ? { value: a, text: a } : a
640
+ (n) => typeof n == "string" ? { value: n, text: n } : n
641
641
  )
642
- ]), d = h(() => [...t.options].find((a) => JSON.stringify(a.value) === JSON.stringify(t.modelValue)));
643
- return (a, u) => (r(), s("div", se, [
644
- o("div", ce, [
645
- o("div", me, [
646
- o("button", {
642
+ ]), i = h(() => [...t.options].find((n) => JSON.stringify(n.value) === JSON.stringify(t.modelValue)));
643
+ return (n, l) => (r(), c("div", se, [
644
+ u("div", ce, [
645
+ u("div", fe, [
646
+ u("button", {
647
647
  class: b(["btn dropdown-toggle", {
648
648
  [`btn-${e.variant}`]: e.variant,
649
649
  [`btn-${e.color}`]: e.color,
@@ -655,25 +655,25 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
655
655
  "data-bs-toggle": "dropdown",
656
656
  "aria-expanded": "false",
657
657
  disabled: e.disabled
658
- }, v(p(d) ? p(d).text : e.placeholder), 11, fe),
659
- o("ul", {
658
+ }, v(p(i) ? p(i).text : e.placeholder), 11, me),
659
+ u("ul", {
660
660
  class: "dropdown-menu",
661
661
  "aria-labelledby": e.id
662
662
  }, [
663
- (r(!0), s(M, null, N(p(n), (c, f) => (r(), s("li", { key: f }, [
664
- m(a.$slots, "option", {}, () => [
665
- o("a", {
663
+ (r(!0), c(M, null, N(p(a), (s, f) => (r(), c("li", { key: f }, [
664
+ m(n.$slots, "option", {}, () => [
665
+ u("a", {
666
666
  class: "dropdown-item",
667
- onClick: T((V) => l(c.value), ["prevent"])
668
- }, v(c.text), 9, pe)
667
+ onClick: T((k) => d(s.value), ["prevent"])
668
+ }, v(s.text), 9, pe)
669
669
  ])
670
670
  ]))), 128))
671
671
  ], 8, ye)
672
672
  ])
673
673
  ]),
674
- o("label", { for: e.id }, [
675
- m(a.$slots, "label", {}, () => [
676
- x(v(e.label), 1)
674
+ u("label", { for: e.id }, [
675
+ m(n.$slots, "label", {}, () => [
676
+ V(v(e.label), 1)
677
677
  ])
678
678
  ], 8, be)
679
679
  ]));
@@ -730,46 +730,51 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
730
730
  }
731
731
  },
732
732
  emits: ["update:modelValue"],
733
- setup(e, { emit: i }) {
734
- function t(d) {
735
- const a = d.target && d.target.files;
736
- a && (l.splice(0, l.length), Array.from(a).forEach((u) => {
737
- l.push(u);
733
+ setup(e, { emit: o }) {
734
+ const t = e;
735
+ function d(l) {
736
+ const s = l.target && l.target.files;
737
+ s && (i.splice(0, i.length), Array.from(s).forEach((f) => {
738
+ i.push(f);
738
739
  }));
739
740
  }
740
- const l = P([]), n = h(() => l && l.map((d) => d.name));
741
- return h(() => l.map((d) => URL.createObjectURL(d))), S(() => l, (d, a) => {
742
- console.log("file input", d), i("update:modelValue", d);
743
- }, { deep: !0 }), (d, a) => (r(), s("div", {
741
+ const a = x(), i = P([]), n = h(() => i && i.map((l) => l.name));
742
+ return h(() => i.map((l) => URL.createObjectURL(l))), $(() => t.modelValue, (l, s) => {
743
+ l.length === 0 && (a.value.value = null);
744
+ }, { deep: !0 }), $(() => i, (l, s) => {
745
+ o("update:modelValue", l);
746
+ }, { deep: !0 }), (l, s) => (r(), c("div", {
744
747
  class: b(["form-input file-input", "file-input--primary"])
745
748
  }, [
746
- o("input", {
749
+ u("input", {
750
+ ref_key: "input",
751
+ ref: a,
747
752
  type: "file",
748
753
  id: e.id,
749
754
  name: e.name,
750
755
  class: "d-none",
751
- onChange: t,
756
+ onChange: d,
752
757
  multiple: e.multiple,
753
758
  accept: e.accept
754
759
  }, null, 40, ge),
755
- o("div", he, [
756
- m(d.$slots, "input-prepend"),
757
- o("input", {
760
+ u("div", he, [
761
+ m(l.$slots, "input-prepend"),
762
+ u("input", {
758
763
  type: "text",
759
764
  value: p(n),
760
765
  id: e.id,
761
766
  name: e.name,
762
767
  class: "form-control"
763
768
  }, null, 8, ve),
764
- m(d.$slots, "input-append", {}, () => [
765
- o("label", {
769
+ m(l.$slots, "input-append", {}, () => [
770
+ u("label", {
766
771
  for: e.id,
767
772
  class: "btn btn-outline-dark"
768
773
  }, " Select Image ", 8, $e)
769
774
  ])
770
775
  ]),
771
- m(d.$slots, "label", {}, () => [
772
- o("label", {
776
+ m(l.$slots, "label", {}, () => [
777
+ u("label", {
773
778
  for: e.id,
774
779
  class: "form-input__label",
775
780
  innerHTML: `${e.label}${e.required ? " *" : ""}`
@@ -777,11 +782,11 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
777
782
  ])
778
783
  ]));
779
784
  }
780
- }), xe = { class: "media-upload" }, Ve = ["src"], Be = ["onClick"], ke = ["for"];
785
+ }), xe = { class: "media-upload" }, Ve = ["src"], ke = ["onClick"], Be = ["for"];
781
786
  async function we(e) {
782
- return await new Promise((i) => {
787
+ return await new Promise((o) => {
783
788
  let t = new FileReader();
784
- t.onload = () => i(t.result), t.readAsDataURL(e);
789
+ t.onload = () => o(t.result), t.readAsDataURL(e);
785
790
  });
786
791
  }
787
792
  const Pe = /* @__PURE__ */ g({
@@ -840,52 +845,52 @@ const Pe = /* @__PURE__ */ g({
840
845
  }
841
846
  },
842
847
  emits: ["update:modelValue", "update:src"],
843
- setup(e, { emit: i }) {
844
- const t = e, l = O([]), n = O([]), d = h(() => t.modelValue.length ? t.modelValue : t.src ? [{ type: "", src: t.src }] : n.value);
845
- S(() => l, async (u, c) => {
846
- n.value = await Promise.all(
847
- u.value.map(async (f) => ({
848
+ setup(e, { emit: o }) {
849
+ const t = e, d = x([]), a = x([]), i = h(() => t.modelValue.length ? t.modelValue : t.src ? [{ type: "", src: t.src }] : a.value);
850
+ $(() => d, async (l, s) => {
851
+ a.value = await Promise.all(
852
+ l.value.map(async (f) => ({
848
853
  src: await we(f),
849
854
  type: f.type
850
855
  }))
851
856
  );
852
- }, { deep: !0 }), S(() => n, async (u, c) => {
853
- const f = t.multiple ? n.value : [n.value[0]];
854
- i("update:modelValue", f), t.multiple || i("update:src", n.value[0] && n.value[0].src);
857
+ }, { deep: !0 }), $(() => a, async (l, s) => {
858
+ const f = t.multiple ? a.value : a.value[0];
859
+ o("update:modelValue", f), t.multiple || o("update:src", a.value[0] && a.value[0].src);
855
860
  }, { deep: !0 });
856
- function a(u) {
857
- l.value.splice(u, 1);
861
+ function n(l) {
862
+ d.value.splice(l, 1);
858
863
  }
859
- return (u, c) => {
860
- const f = $("svg-icon"), V = $("file-input");
861
- return r(), s("div", xe, [
862
- (r(!0), s(M, null, N(p(d), (B, I) => (r(), s("div", {
864
+ return (l, s) => {
865
+ const f = S("svg-icon"), k = S("file-input");
866
+ return r(), c("div", xe, [
867
+ (r(!0), c(M, null, N(p(i), (B, I) => (r(), c("div", {
863
868
  key: B.src,
864
869
  class: "media-upload__thumbnail"
865
870
  }, [
866
- o("img", {
871
+ u("img", {
867
872
  src: B.src,
868
873
  class: "img-thumbnail rounded"
869
874
  }, null, 8, Ve),
870
- o("button", {
871
- onClick: T((qe) => a(I), ["prevent"]),
875
+ u("button", {
876
+ onClick: T((qe) => n(I), ["prevent"]),
872
877
  class: "btn btn--close"
873
878
  }, [
874
879
  z(f, { symbol: "x" })
875
- ], 8, Be)
880
+ ], 8, ke)
876
881
  ]))), 128)),
877
- z(V, {
878
- modelValue: l.value,
879
- "onUpdate:modelValue": c[0] || (c[0] = (B) => l.value = B),
882
+ z(k, {
883
+ modelValue: d.value,
884
+ "onUpdate:modelValue": s[0] || (s[0] = (B) => d.value = B),
880
885
  id: e.id,
881
886
  name: e.name,
882
887
  accept: e.accept,
883
888
  class: "d-none"
884
889
  }, null, 8, ["modelValue", "id", "name", "accept"]),
885
- o("label", {
890
+ u("label", {
886
891
  for: e.id,
887
892
  class: "btn btn-outline-dark"
888
- }, " Select Image ", 8, ke)
893
+ }, " Select Image ", 8, Be)
889
894
  ]);
890
895
  };
891
896
  }