ablok-components 0.0.42 → 0.0.45

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,8 +1,8 @@
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";
1
+ import { defineComponent as g, openBlock as r, createElementBlock as c, normalizeClass as b, createElementVNode as i, renderSlot as m, computed as v, createBlock as C, resolveDynamicComponent as A, unref as p, withCtx as F, createTextVNode as k, toDisplayString as $, resolveComponent as x, createCommentVNode as w, withDirectives as q, isRef as O, vModelDynamic as P, vModelText as z, ref as V, watch as S, onBeforeMount as U, Fragment as M, renderList as N, withModifiers as I, reactive as H, createVNode as L } from "vue";
2
2
  const R = {
3
3
  class: "icon",
4
4
  preserveAspectRatio: "xMaxYMin"
5
- }, F = ["xlink:href"], Ce = /* @__PURE__ */ g({
5
+ }, E = ["xlink:href"], Ce = /* @__PURE__ */ g({
6
6
  __name: "svg-icon",
7
7
  props: {
8
8
  basePath: {
@@ -23,23 +23,23 @@ const R = {
23
23
  }
24
24
  },
25
25
  setup(e) {
26
- return (o, t) => (r(), c("i", {
26
+ return (s, l) => (r(), c("i", {
27
27
  class: b(["svg-icon", {
28
28
  [`svg-icon--${e.size}`]: e.size
29
29
  }])
30
30
  }, [
31
31
  (r(), c("svg", R, [
32
- u("use", {
32
+ i("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",
36
36
  y: "0"
37
- }, null, 8, F)
37
+ }, null, 8, E)
38
38
  ]))
39
39
  ], 2));
40
40
  }
41
41
  });
42
- const E = { class: "loading-spinner d-block" }, j = { class: "loading-spinner__animation" }, G = {
42
+ const j = { class: "loading-spinner d-block" }, G = { class: "loading-spinner__animation" }, J = {
43
43
  class: "d-block",
44
44
  version: "1.1",
45
45
  id: "L9",
@@ -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__ */ u("animateTransform", {
53
+ }, X = ["fill"], Y = /* @__PURE__ */ i("animateTransform", {
54
54
  attributeName: "transform",
55
55
  attributeType: "XML",
56
56
  type: "rotate",
@@ -58,8 +58,8 @@ const E = { class: "loading-spinner d-block" }, j = { class: "loading-spinner__a
58
58
  from: "0 50 50",
59
59
  to: "360 50 50",
60
60
  repeatCount: "indefinite"
61
- }, null, -1), Y = [
62
- X
61
+ }, null, -1), K = [
62
+ Y
63
63
  ], Me = /* @__PURE__ */ g({
64
64
  __name: "loading-spinner",
65
65
  props: {
@@ -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 (o, t) => (r(), c("span", E, [
73
- u("span", j, [
74
- (r(), c("svg", G, [
75
- u("path", {
72
+ return (s, l) => (r(), c("span", j, [
73
+ i("span", G, [
74
+ (r(), c("svg", J, [
75
+ i("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
- }, Y, 8, J)
78
+ }, K, 8, X)
79
79
  ]))
80
80
  ]),
81
- m(o.$slots, "default")
81
+ m(s.$slots, "default")
82
82
  ]));
83
83
  }
84
84
  });
@@ -92,19 +92,19 @@ const Ne = /* @__PURE__ */ g({
92
92
  className: null
93
93
  },
94
94
  setup(e) {
95
- const o = e, t = h(() => o.tag || "p");
96
- return (d, a) => (r(), C(D(p(t)), {
95
+ const s = e, l = v(() => s.tag || "p");
96
+ return (d, t) => (r(), C(A(p(l)), {
97
97
  class: b(["headline", `headline--${e.size}${e.className || ""}`])
98
98
  }, {
99
- default: A(() => [
99
+ default: F(() => [
100
100
  m(d.$slots, "default", {}, () => [
101
- V(v(e.text), 1)
101
+ k($(e.text), 1)
102
102
  ])
103
103
  ]),
104
104
  _: 3
105
105
  }, 8, ["class"]));
106
106
  }
107
- }), Ue = /* @__PURE__ */ g({
107
+ }), Te = /* @__PURE__ */ g({
108
108
  __name: "base-paragraph",
109
109
  props: {
110
110
  size: null,
@@ -113,15 +113,15 @@ const Ne = /* @__PURE__ */ g({
113
113
  className: null
114
114
  },
115
115
  setup(e) {
116
- return (o, t) => (r(), c("p", {
116
+ return (s, l) => (r(), c("p", {
117
117
  class: b(["base-paragraph", `base-paragraph--${e.size}${e.className || ""}`])
118
118
  }, [
119
- m(o.$slots, "default", {}, () => [
120
- V(v(e.text), 1)
119
+ m(s.$slots, "default", {}, () => [
120
+ k($(e.text), 1)
121
121
  ])
122
122
  ], 2));
123
123
  }
124
- }), K = ["type", "disabled", "href", "to"], ze = /* @__PURE__ */ g({
124
+ }), Q = ["type", "disabled", "href", "to"], ze = /* @__PURE__ */ g({
125
125
  __name: "base-button",
126
126
  props: {
127
127
  type: null,
@@ -138,9 +138,9 @@ const Ne = /* @__PURE__ */ g({
138
138
  fab: { type: Boolean }
139
139
  },
140
140
  setup(e) {
141
- const o = e, t = h(() => o.caption && !o.fab);
142
- return (d, a) => {
143
- const i = S("svg-icon");
141
+ const s = e, l = v(() => s.caption && !s.fab);
142
+ return (d, t) => {
143
+ const o = x("svg-icon");
144
144
  return r(), c("button", {
145
145
  type: e.type,
146
146
  disabled: e.disabled,
@@ -159,27 +159,27 @@ const Ne = /* @__PURE__ */ g({
159
159
  }])
160
160
  }, [
161
161
  m(d.$slots, "default", {}, () => [
162
- e.icon ? (r(), C(i, {
162
+ e.icon ? (r(), C(o, {
163
163
  key: 0,
164
164
  id: e.icon,
165
165
  class: "base-button__caption"
166
166
  }, null, 8, ["id"])) : w("", !0),
167
- p(t) ? (r(), c("span", {
167
+ p(l) ? (r(), c("span", {
168
168
  key: 1,
169
169
  class: b(["base-button__caption", { "icon-padding": e.icon }])
170
- }, v(e.caption), 3)) : w("", !0)
170
+ }, $(e.caption), 3)) : w("", !0)
171
171
  ])
172
- ], 10, K);
172
+ ], 10, Q);
173
173
  };
174
174
  }
175
175
  });
176
176
  function y() {
177
177
  return (new Date().valueOf() + Math.random()).toString(36);
178
178
  }
179
- const Q = { class: "input-group form-input__input-group" }, W = ["type", "id", "name", "placeholder", "pattern", "disabled", "read-only", "required", "maxlength", "checked", "aria-label"], Z = {
179
+ const W = { class: "input-group form-input__input-group" }, Z = ["type", "id", "name", "placeholder", "pattern", "disabled", "read-only", "required", "maxlength", "checked", "aria-label"], _ = {
180
180
  key: 0,
181
181
  class: "form-input__color-swatch"
182
- }, _ = ["name", "id", "disabled", "read-only", "required", "aria-label"], ee = ["for", "innerHTML"], Le = /* @__PURE__ */ g({
182
+ }, ee = ["name", "id", "disabled", "read-only", "required", "aria-label"], te = ["for", "innerHTML"], Le = /* @__PURE__ */ g({
183
183
  __name: "form-input",
184
184
  props: {
185
185
  modelValue: {
@@ -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: o }) {
239
- const t = e, d = h({
238
+ setup(e, { emit: s }) {
239
+ const l = e, d = v({
240
240
  get() {
241
- return t.modelValue;
241
+ return l.modelValue;
242
242
  },
243
- set(a) {
244
- o("update:modelValue", a);
243
+ set(t) {
244
+ s("update:modelValue", t);
245
245
  }
246
246
  });
247
- return (a, i) => (r(), c("div", {
247
+ return (t, o) => (r(), c("div", {
248
248
  class: b(["form-input", `form-input--${e.type}`])
249
249
  }, [
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),
250
+ i("div", W, [
251
+ m(t.$slots, "input-prepend"),
252
+ q(i("input", {
253
+ "onUpdate:modelValue": o[0] || (o[0] = (a) => O(d) ? d.value = a : null),
254
254
  type: e.type === "color" ? "text" : e.type,
255
255
  id: e.id,
256
256
  name: e.name,
@@ -265,13 +265,13 @@ const Q = { class: "input-group form-input__input-group" }, W = ["type", "id", "
265
265
  "form-check-input": e.type === "checkbox"
266
266
  }]),
267
267
  "aria-label": e.label
268
- }, null, 10, W), [
269
- [H, p(d)]
268
+ }, null, 10, Z), [
269
+ [P, p(d)]
270
270
  ]),
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),
271
+ m(t.$slots, "input-append", {}, () => [
272
+ e.type === "color" ? (r(), c("span", _, [
273
+ q(i("input", {
274
+ "onUpdate:modelValue": o[1] || (o[1] = (a) => O(d) ? d.value = a : null),
275
275
  type: "color",
276
276
  name: `${e.name}-color`,
277
277
  id: `${e.id}-color`,
@@ -280,28 +280,28 @@ const Q = { class: "input-group form-input__input-group" }, W = ["type", "id", "
280
280
  required: e.required,
281
281
  class: "form-control",
282
282
  "aria-label": e.label
283
- }, null, 8, _), [
284
- [U, p(d)]
283
+ }, null, 8, ee), [
284
+ [z, p(d)]
285
285
  ])
286
286
  ])) : w("", !0)
287
287
  ])
288
288
  ]),
289
- m(a.$slots, "label", {}, () => [
290
- u("label", {
289
+ m(t.$slots, "label", {}, () => [
290
+ i("label", {
291
291
  for: e.id,
292
292
  class: b(["form-input__label", {
293
293
  "form-check-label": e.type === "checkbox"
294
294
  }]),
295
295
  innerHTML: `${e.label}${e.required ? " *" : ""}`
296
- }, null, 10, ee)
296
+ }, null, 10, te)
297
297
  ])
298
298
  ], 2));
299
299
  }
300
300
  });
301
- const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "name", "placeholder", "pattern", "disabled", "read-only", "required", "maxlength", "aria-label"], ae = {
301
+ const le = { class: "form-input form-input--textarea" }, ae = ["type", "id", "name", "placeholder", "pattern", "disabled", "read-only", "required", "maxlength", "aria-label"], ne = {
302
302
  key: 0,
303
303
  class: "form-input__color-swatch"
304
- }, ne = ["name", "id", "disabled", "read-only", "required", "aria-label"], de = ["for", "innerHTML"], Te = /* @__PURE__ */ g({
304
+ }, de = ["name", "id", "disabled", "read-only", "required", "aria-label"], oe = ["for", "innerHTML"], Ue = /* @__PURE__ */ g({
305
305
  __name: "input-textarea",
306
306
  props: {
307
307
  modelValue: {
@@ -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: o }) {
361
- const t = e, d = h({
360
+ setup(e, { emit: s }) {
361
+ const l = e, d = v({
362
362
  get() {
363
- return t.modelValue;
363
+ return l.modelValue;
364
364
  },
365
- set(a) {
366
- o("update:modelValue", a);
365
+ set(t) {
366
+ s("update:modelValue", t);
367
367
  }
368
368
  });
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),
369
+ return (t, o) => (r(), c("div", le, [
370
+ m(t.$slots, "input-prepend"),
371
+ q(i("textarea", {
372
+ "onUpdate:modelValue": o[0] || (o[0] = (a) => O(d) ? d.value = a : null),
373
373
  type: e.type === "color" ? "text" : e.type,
374
374
  id: e.id,
375
375
  name: e.name,
@@ -381,13 +381,13 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
381
381
  maxlength: e.maxlength,
382
382
  class: b(["form-control", {}]),
383
383
  "aria-label": e.label
384
- }, null, 8, le), [
385
- [U, p(d)]
384
+ }, null, 8, ae), [
385
+ [z, p(d)]
386
386
  ]),
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),
387
+ m(t.$slots, "input-append", {}, () => [
388
+ e.type === "color" ? (r(), c("span", ne, [
389
+ q(i("input", {
390
+ "onUpdate:modelValue": o[1] || (o[1] = (a) => O(d) ? d.value = a : null),
391
391
  type: "color",
392
392
  name: `${e.name}-color`,
393
393
  id: `${e.id}-color`,
@@ -396,23 +396,23 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
396
396
  required: e.required,
397
397
  class: "form-control",
398
398
  "aria-label": e.label
399
- }, null, 8, ne), [
400
- [U, p(d)]
399
+ }, null, 8, de), [
400
+ [z, p(d)]
401
401
  ])
402
402
  ])) : w("", !0)
403
403
  ]),
404
- m(a.$slots, "label", {}, () => [
405
- u("label", {
404
+ m(t.$slots, "label", {}, () => [
405
+ i("label", {
406
406
  for: e.id,
407
407
  class: b(["form-input__label", {
408
408
  "form-check-label": e.type === "checkbox"
409
409
  }]),
410
410
  innerHTML: `${e.label}${e.required ? " *" : ""}`
411
- }, null, 10, de)
411
+ }, null, 10, oe)
412
412
  ])
413
413
  ]));
414
414
  }
415
- }), ie = { class: "radio-group" }, oe = ["for"], Ie = /* @__PURE__ */ g({
415
+ }), ie = { class: "radio-group" }, ue = ["for"], Ie = /* @__PURE__ */ g({
416
416
  __name: "check-group",
417
417
  props: {
418
418
  modelValue: {
@@ -452,43 +452,43 @@ 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: 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)
455
+ setup(e, { emit: s }) {
456
+ const l = e, d = V([]);
457
+ return S(() => l.modelValue, (t, o) => {
458
+ d.value = l.options.map(
459
+ (a) => a.value ? l.modelValue.some((n) => n["value "] === a.value) : l.modelValue.some((n) => n === a)
460
460
  );
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];
461
+ }, { immediate: !0 }), S(d, (t, o) => {
462
+ const a = t.reduce((n, u, f) => {
463
+ const h = u && l.options[f] ? [l.options[f] || l.options[f]] : [];
464
+ return [...n, ...h];
465
465
  }, []);
466
- o("update:modelValue", n);
467
- }, { deep: !0 }), L(() => {
468
- }), (a, i) => {
469
- const n = S("form-input");
466
+ s("update:modelValue", a);
467
+ }, { deep: !0 }), U(() => {
468
+ }), (t, o) => {
469
+ const a = x("form-input");
470
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,
471
+ (r(!0), c(M, null, N(e.options, (n, u) => (r(), C(a, {
472
+ key: u,
473
+ modelValue: p(d)[u],
474
+ "onUpdate:modelValue": (f) => p(d)[u] = f,
475
475
  type: "checkbox",
476
476
  name: e.name,
477
- id: `${e.id}-${s}`,
478
- label: `${l.text || l}${e.required ? " *" : ""}`,
477
+ id: `${e.id}-${u}`,
478
+ label: `${n.text || n}${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
- u("label", { for: e.id }, [
484
- m(a.$slots, "label", {}, () => [
485
- V(v(e.label), 1)
483
+ i("label", { for: e.id }, [
484
+ m(t.$slots, "label", {}, () => [
485
+ k($(e.label), 1)
486
486
  ])
487
- ], 8, oe)
487
+ ], 8, ue)
488
488
  ]);
489
489
  };
490
490
  }
491
- }), ue = { class: "radio-group" }, re = ["for"], De = /* @__PURE__ */ g({
491
+ }), re = { class: "radio-group" }, se = ["for"], De = /* @__PURE__ */ g({
492
492
  __name: "radio-group",
493
493
  props: {
494
494
  modelValue: {
@@ -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: o }) {
532
- const t = e;
533
- x(t.options.map((a) => a.value === t.modelValue));
534
- function d(a) {
535
- o("update:modelValue", a);
531
+ setup(e, { emit: s }) {
532
+ const l = e;
533
+ V(l.options.map((t) => t.value === l.modelValue));
534
+ function d(t) {
535
+ s("update:modelValue", t);
536
536
  }
537
- return L(() => {
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,
537
+ return U(() => {
538
+ }), (t, o) => {
539
+ const a = x("form-input");
540
+ return r(), c("div", re, [
541
+ (r(!0), c(M, null, N(e.options, (n, u) => (r(), C(a, {
542
+ key: u,
543
543
  type: "radio",
544
544
  name: e.name,
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,
545
+ id: `${e.id}-${u}`,
546
+ value: n.value || n,
547
+ label: `${n.text || n}${e.required ? " *" : ""}`,
548
+ checked: n.value ? n.value === e.modelValue : n === e.modelValue,
549
549
  disabled: e.disabled,
550
550
  "read-only": e.readOnly,
551
551
  required: e.required,
552
- onChange: (f) => d(l)
552
+ onChange: (f) => d(n)
553
553
  }, null, 8, ["name", "id", "value", "label", "checked", "disabled", "read-only", "required", "onChange"]))), 128)),
554
- u("label", { for: e.id }, [
555
- m(a.$slots, "label", {}, () => [
556
- V(v(e.label), 1)
554
+ i("label", { for: e.id }, [
555
+ m(t.$slots, "label", {}, () => [
556
+ k($(e.label), 1)
557
557
  ])
558
- ], 8, re)
558
+ ], 8, se)
559
559
  ]);
560
560
  };
561
561
  }
562
- }), se = { class: "input input-dropdown" }, ce = { class: "dropdown" }, fe = {
562
+ }), ce = { class: "input input-dropdown" }, fe = { class: "dropdown" }, me = {
563
563
  class: "btn-group",
564
564
  role: "group"
565
- }, me = ["id", "disabled"], ye = ["aria-labelledby"], pe = ["onClick"], be = ["for"], Ae = /* @__PURE__ */ g({
565
+ }, ye = ["id", "disabled"], pe = ["aria-labelledby"], be = ["onClick"], ge = ["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: o }) {
623
- const t = e;
624
- h({
622
+ setup(e, { emit: s }) {
623
+ const l = e;
624
+ v({
625
625
  get() {
626
- return t.modelValue;
626
+ return l.modelValue;
627
627
  },
628
- set(n) {
629
- o("update:modelValue", n);
628
+ set(a) {
629
+ s("update:modelValue", a);
630
630
  }
631
631
  });
632
- function d(n) {
633
- o("update:modelValue", n);
632
+ function d(a) {
633
+ s("update:modelValue", a);
634
634
  }
635
- const a = h(() => [
635
+ const t = v(() => [
636
636
  {
637
637
  text: "Please select"
638
638
  },
639
- ...t.options.map(
640
- (n) => typeof n == "string" ? { value: n, text: n } : n
639
+ ...l.options.map(
640
+ (a) => typeof a == "string" ? { value: a, text: a } : a
641
641
  )
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", {
642
+ ]), o = v(() => [...l.options].find((a) => JSON.stringify(a.value) === JSON.stringify(l.modelValue)));
643
+ return (a, n) => (r(), c("div", ce, [
644
+ i("div", fe, [
645
+ i("div", me, [
646
+ i("button", {
647
647
  class: b(["btn dropdown-toggle", {
648
648
  [`btn-${e.variant}`]: e.variant,
649
649
  [`btn-${e.color}`]: e.color,
@@ -655,30 +655,30 @@ 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(i) ? p(i).text : e.placeholder), 11, me),
659
- u("ul", {
658
+ }, $(p(o) ? p(o).text : e.placeholder), 11, ye),
659
+ i("ul", {
660
660
  class: "dropdown-menu",
661
661
  "aria-labelledby": e.id
662
662
  }, [
663
- (r(!0), c(M, null, N(p(a), (s, f) => (r(), c("li", { key: f }, [
664
- m(n.$slots, "option", {}, () => [
665
- u("a", {
663
+ (r(!0), c(M, null, N(p(t), (u, f) => (r(), c("li", { key: f }, [
664
+ m(a.$slots, "option", {}, () => [
665
+ i("a", {
666
666
  class: "dropdown-item",
667
- onClick: T((k) => d(s.value), ["prevent"])
668
- }, v(s.text), 9, pe)
667
+ onClick: I((h) => d(u.value), ["prevent"])
668
+ }, $(u.text), 9, be)
669
669
  ])
670
670
  ]))), 128))
671
- ], 8, ye)
671
+ ], 8, pe)
672
672
  ])
673
673
  ]),
674
- u("label", { for: e.id }, [
675
- m(n.$slots, "label", {}, () => [
676
- V(v(e.label), 1)
674
+ i("label", { for: e.id }, [
675
+ m(a.$slots, "label", {}, () => [
676
+ k($(e.label), 1)
677
677
  ])
678
- ], 8, be)
678
+ ], 8, ge)
679
679
  ]));
680
680
  }
681
- }), ge = ["id", "name", "multiple", "accept"], he = { class: "form-input__input-group input-group" }, ve = ["value", "id", "name"], $e = ["for"], Se = ["for", "innerHTML"], He = /* @__PURE__ */ g({
681
+ }), he = ["id", "name", "multiple", "accept"], ve = { class: "form-input__input-group input-group" }, $e = ["value", "id", "name"], Se = ["for"], xe = ["for", "innerHTML"], Fe = /* @__PURE__ */ g({
682
682
  __name: "file-input",
683
683
  props: {
684
684
  modelValue: {
@@ -730,25 +730,25 @@ 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: 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);
733
+ setup(e, { emit: s }) {
734
+ const l = e;
735
+ function d(n) {
736
+ const u = n.target && n.target.files;
737
+ u && (o.splice(0, o.length), Array.from(u).forEach((f) => {
738
+ o.push(f);
739
739
  }));
740
740
  }
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", {
741
+ const t = V(), o = H([]), a = v(() => o && o.map((n) => n.name));
742
+ return v(() => o.map((n) => URL.createObjectURL(n))), S(() => l.modelValue, (n, u) => {
743
+ n.length === 0 && (t.value.value = null);
744
+ }, { deep: !0 }), S(() => o, (n, u) => {
745
+ s("update:modelValue", n);
746
+ }, { deep: !0 }), (n, u) => (r(), c("div", {
747
747
  class: b(["form-input file-input", "file-input--primary"])
748
748
  }, [
749
- u("input", {
749
+ i("input", {
750
750
  ref_key: "input",
751
- ref: a,
751
+ ref: t,
752
752
  type: "file",
753
753
  id: e.id,
754
754
  name: e.name,
@@ -756,41 +756,34 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
756
756
  onChange: d,
757
757
  multiple: e.multiple,
758
758
  accept: e.accept
759
- }, null, 40, ge),
760
- u("div", he, [
761
- m(l.$slots, "input-prepend"),
762
- u("input", {
759
+ }, null, 40, he),
760
+ i("div", ve, [
761
+ m(n.$slots, "input-prepend"),
762
+ i("input", {
763
763
  type: "text",
764
- value: p(n),
764
+ value: p(a),
765
765
  id: e.id,
766
766
  name: e.name,
767
767
  class: "form-control"
768
- }, null, 8, ve),
769
- m(l.$slots, "input-append", {}, () => [
770
- u("label", {
768
+ }, null, 8, $e),
769
+ m(n.$slots, "input-append", {}, () => [
770
+ i("label", {
771
771
  for: e.id,
772
772
  class: "btn btn-outline-dark"
773
- }, " Select Image ", 8, $e)
773
+ }, " Select Image ", 8, Se)
774
774
  ])
775
775
  ]),
776
- m(l.$slots, "label", {}, () => [
777
- u("label", {
776
+ m(n.$slots, "label", {}, () => [
777
+ i("label", {
778
778
  for: e.id,
779
779
  class: "form-input__label",
780
780
  innerHTML: `${e.label}${e.required ? " *" : ""}`
781
- }, null, 8, Se)
781
+ }, null, 8, xe)
782
782
  ])
783
783
  ]));
784
784
  }
785
- }), xe = { class: "media-upload" }, Ve = ["src"], ke = ["onClick"], Be = ["for"];
786
- async function we(e) {
787
- return await new Promise((o) => {
788
- let t = new FileReader();
789
- t.onload = () => o(t.result), t.readAsDataURL(e);
790
- });
791
- }
792
- const Pe = /* @__PURE__ */ g({
793
- __name: "media-upload",
785
+ }), Ve = { class: "file-upload" }, ke = ["src"], Be = ["onClick"], we = ["for"], Pe = /* @__PURE__ */ g({
786
+ __name: "file-upload",
794
787
  props: {
795
788
  modelValue: {
796
789
  type: Array,
@@ -842,55 +835,72 @@ const Pe = /* @__PURE__ */ g({
842
835
  accept: {
843
836
  type: String,
844
837
  default: "image/*"
838
+ },
839
+ endpoint: {
840
+ type: URL,
841
+ default: ""
845
842
  }
846
843
  },
847
844
  emits: ["update:modelValue", "update:src"],
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) => ({
853
- src: await we(f),
854
- type: f.type
845
+ setup(e, { emit: s }) {
846
+ const l = e, d = V([]), t = V([]), o = v(() => l.modelValue.length ? l.modelValue : l.src ? [{ type: "", src: l.src }] : t.value);
847
+ S(() => d, async (u, f) => {
848
+ t.value = await Promise.all(
849
+ u.value.map(async (h) => ({
850
+ src: await n(h),
851
+ type: h.type
855
852
  }))
856
853
  );
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);
854
+ }, { deep: !0 }), S(() => t, async (u, f) => {
855
+ const h = l.multiple ? t.value : t.value[0];
856
+ s("update:modelValue", h), l.multiple || s("update:src", t.value[0] && t.value[0].src);
860
857
  }, { deep: !0 });
861
- function n(l) {
862
- d.value.splice(l, 1);
858
+ function a(u) {
859
+ d.value.splice(u, 1);
860
+ }
861
+ async function n(u) {
862
+ const f = new FormData();
863
+ return f.append("method", "POST"), f.append("file", u), await fetch(l.endpoint, {
864
+ method: "POST",
865
+ headers: {
866
+ Accept: "application/json",
867
+ "Content-Type": "multipart/form-data"
868
+ },
869
+ body: f
870
+ }).catch((T) => {
871
+ console.error("Error", T);
872
+ });
863
873
  }
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", {
874
+ return (u, f) => {
875
+ const h = x("svg-icon"), T = x("file-input");
876
+ return r(), c("div", Ve, [
877
+ (r(!0), c(M, null, N(p(o), (B, D) => (r(), c("div", {
868
878
  key: B.src,
869
- class: "media-upload__thumbnail"
879
+ class: "file-upload__thumbnail"
870
880
  }, [
871
- u("img", {
881
+ i("img", {
872
882
  src: B.src,
873
883
  class: "img-thumbnail rounded"
874
- }, null, 8, Ve),
875
- u("button", {
876
- onClick: T((qe) => n(I), ["prevent"]),
884
+ }, null, 8, ke),
885
+ i("button", {
886
+ onClick: I((qe) => a(D), ["prevent"]),
877
887
  class: "btn btn--close"
878
888
  }, [
879
- z(f, { symbol: "x" })
880
- ], 8, ke)
889
+ L(h, { symbol: "x" })
890
+ ], 8, Be)
881
891
  ]))), 128)),
882
- z(k, {
892
+ L(T, {
883
893
  modelValue: d.value,
884
- "onUpdate:modelValue": s[0] || (s[0] = (B) => d.value = B),
894
+ "onUpdate:modelValue": f[0] || (f[0] = (B) => d.value = B),
885
895
  id: e.id,
886
896
  name: e.name,
887
897
  accept: e.accept,
888
898
  class: "d-none"
889
899
  }, null, 8, ["modelValue", "id", "name", "accept"]),
890
- u("label", {
900
+ i("label", {
891
901
  for: e.id,
892
902
  class: "btn btn-outline-dark"
893
- }, " Select Image ", 8, Be)
903
+ }, " Select Image ", 8, we)
894
904
  ]);
895
905
  };
896
906
  }
@@ -898,14 +908,14 @@ const Pe = /* @__PURE__ */ g({
898
908
  export {
899
909
  ze as BaseButton,
900
910
  Ne as BaseHeadline,
901
- Ue as BaseParagraph,
911
+ Te as BaseParagraph,
902
912
  Ie as CheckGroup,
903
- He as FileInput,
913
+ Fe as FileInput,
914
+ Pe as FileUpload,
904
915
  Le as FormInput,
905
916
  Ae as InputDropdown,
906
- Te as InputTextarea,
917
+ Ue as InputTextarea,
907
918
  Me as LoadingSpinner,
908
- Pe as MediaUpload,
909
919
  De as RadioGroup,
910
920
  Ce as SvgIcon
911
921
  };