ablok-components 0.0.34 → 0.0.37

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 b, openBlock as u, createElementBlock as s, normalizeClass as v, createElementVNode as i, renderSlot as m, computed as g, resolveComponent as $, createBlock as O, createCommentVNode as q, unref as p, toDisplayString as h, withDirectives as M, isRef as U, vModelDynamic as T, vModelText as A, ref as B, watch as S, onBeforeMount as N, Fragment as k, renderList as w, createTextVNode as C, withModifiers as z, reactive as D, createVNode as L } from "vue";
1
+ import { defineComponent as g, openBlock as u, createElementBlock as s, normalizeClass as b, createElementVNode as o, renderSlot as m, computed as h, resolveComponent as $, createBlock as U, createCommentVNode as k, unref as p, toDisplayString as v, withDirectives as B, isRef as w, vModelDynamic as A, vModelText as C, ref as q, watch as S, onBeforeMount as T, Fragment as O, renderList as M, createTextVNode as L, withModifiers as I, reactive as D, createVNode as N } from "vue";
2
2
  const R = {
3
3
  class: "icon",
4
4
  preserveAspectRatio: "xMaxYMin"
5
- }, F = ["xlink:href"], Ve = /* @__PURE__ */ b({
5
+ }, F = ["xlink:href"], qe = /* @__PURE__ */ g({
6
6
  __name: "svg-icon",
7
7
  props: {
8
8
  basePath: {
@@ -23,13 +23,13 @@ const R = {
23
23
  }
24
24
  },
25
25
  setup(e) {
26
- return (r, t) => (u(), s("i", {
27
- class: v(["svg-icon", {
26
+ return (r, a) => (u(), s("i", {
27
+ class: b(["svg-icon", {
28
28
  [`svg-icon--${e.size}`]: e.size
29
29
  }])
30
30
  }, [
31
31
  (u(), s("svg", R, [
32
- i("use", {
32
+ o("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",
@@ -39,7 +39,7 @@ const R = {
39
39
  ], 2));
40
40
  }
41
41
  });
42
- const P = { class: "loading-spinner d-block" }, H = { class: "loading-spinner__animation" }, E = {
42
+ const H = { class: "loading-spinner d-block" }, P = { class: "loading-spinner__animation" }, E = {
43
43
  class: "d-block",
44
44
  version: "1.1",
45
45
  id: "L9",
@@ -50,7 +50,7 @@ const P = { class: "loading-spinner d-block" }, H = { 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"], G = /* @__PURE__ */ i("animateTransform", {
53
+ }, j = ["fill"], G = /* @__PURE__ */ o("animateTransform", {
54
54
  attributeName: "transform",
55
55
  attributeType: "XML",
56
56
  type: "rotate",
@@ -60,7 +60,7 @@ const P = { class: "loading-spinner d-block" }, H = { class: "loading-spinner__a
60
60
  repeatCount: "indefinite"
61
61
  }, null, -1), J = [
62
62
  G
63
- ], xe = /* @__PURE__ */ b({
63
+ ], Oe = /* @__PURE__ */ g({
64
64
  __name: "loading-spinner",
65
65
  props: {
66
66
  color: {
@@ -69,10 +69,10 @@ const P = { class: "loading-spinner d-block" }, H = { class: "loading-spinner__a
69
69
  }
70
70
  },
71
71
  setup(e) {
72
- return (r, t) => (u(), s("span", P, [
73
- i("span", H, [
72
+ return (r, a) => (u(), s("span", H, [
73
+ o("span", P, [
74
74
  (u(), s("svg", E, [
75
- i("path", {
75
+ o("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
  }, J, 8, j)
@@ -82,7 +82,7 @@ const P = { class: "loading-spinner d-block" }, H = { class: "loading-spinner__a
82
82
  ]));
83
83
  }
84
84
  });
85
- const X = ["type", "disabled", "href", "to"], Be = /* @__PURE__ */ b({
85
+ const X = ["type", "disabled", "href", "to"], Me = /* @__PURE__ */ g({
86
86
  __name: "base-button",
87
87
  props: {
88
88
  type: null,
@@ -99,15 +99,15 @@ const X = ["type", "disabled", "href", "to"], Be = /* @__PURE__ */ b({
99
99
  fab: { type: Boolean }
100
100
  },
101
101
  setup(e) {
102
- const r = e, t = g(() => r.caption && !r.fab);
103
- return (a, n) => {
102
+ const r = e, a = h(() => r.caption && !r.fab);
103
+ return (l, n) => {
104
104
  const d = $("svg-icon");
105
105
  return u(), s("button", {
106
106
  type: e.type,
107
107
  disabled: e.disabled,
108
108
  href: e.href,
109
109
  to: e.to,
110
- class: v(["base-button btn btn-primary", {
110
+ class: b(["base-button btn btn-primary", {
111
111
  disabled: e.disabled,
112
112
  pending: e.pending,
113
113
  rounded: e.rounded,
@@ -119,16 +119,16 @@ const X = ["type", "disabled", "href", "to"], Be = /* @__PURE__ */ b({
119
119
  "x-small": e.size === "x-small"
120
120
  }])
121
121
  }, [
122
- m(a.$slots, "default", {}, () => [
123
- e.icon ? (u(), O(d, {
122
+ m(l.$slots, "default", {}, () => [
123
+ e.icon ? (u(), U(d, {
124
124
  key: 0,
125
125
  id: e.icon,
126
126
  class: "base-button__caption"
127
- }, null, 8, ["id"])) : q("", !0),
128
- p(t) ? (u(), s("span", {
127
+ }, null, 8, ["id"])) : k("", !0),
128
+ p(a) ? (u(), s("span", {
129
129
  key: 1,
130
- class: v(["base-button__caption", { "icon-padding": e.icon }])
131
- }, h(e.caption), 3)) : q("", !0)
130
+ class: b(["base-button__caption", { "icon-padding": e.icon }])
131
+ }, v(e.caption), 3)) : k("", !0)
132
132
  ])
133
133
  ], 10, X);
134
134
  };
@@ -140,7 +140,7 @@ function y() {
140
140
  const Y = { class: "input-group form-input__input-group" }, K = ["type", "id", "name", "placeholder", "pattern", "disabled", "read-only", "required", "maxlength", "checked", "aria-label"], Q = {
141
141
  key: 0,
142
142
  class: "form-input__color-swatch"
143
- }, W = ["name", "id", "disabled", "read-only", "required", "aria-label"], Z = ["for", "innerHTML"], ke = /* @__PURE__ */ b({
143
+ }, W = ["name", "id", "disabled", "read-only", "required", "aria-label"], Z = ["for", "innerHTML"], Ce = /* @__PURE__ */ g({
144
144
  __name: "form-input",
145
145
  props: {
146
146
  modelValue: {
@@ -197,21 +197,21 @@ const Y = { class: "input-group form-input__input-group" }, K = ["type", "id", "
197
197
  },
198
198
  emits: ["update:modelValue"],
199
199
  setup(e, { emit: r }) {
200
- const t = e, a = g({
200
+ const a = e, l = h({
201
201
  get() {
202
- return t.modelValue;
202
+ return a.modelValue;
203
203
  },
204
204
  set(n) {
205
205
  r("update:modelValue", n);
206
206
  }
207
207
  });
208
208
  return (n, d) => (u(), s("div", {
209
- class: v(["form-input", `form-input--${e.type}`])
209
+ class: b(["form-input", `form-input--${e.type}`])
210
210
  }, [
211
- i("div", Y, [
211
+ o("div", Y, [
212
212
  m(n.$slots, "input-prepend"),
213
- M(i("input", {
214
- "onUpdate:modelValue": d[0] || (d[0] = (l) => U(a) ? a.value = l : null),
213
+ B(o("input", {
214
+ "onUpdate:modelValue": d[0] || (d[0] = (t) => w(l) ? l.value = t : null),
215
215
  type: e.type === "color" ? "text" : e.type,
216
216
  id: e.id,
217
217
  name: e.name,
@@ -222,15 +222,17 @@ const Y = { class: "input-group form-input__input-group" }, K = ["type", "id", "
222
222
  required: e.required,
223
223
  maxlength: e.maxlength,
224
224
  checked: e.checked,
225
- class: "form-control",
225
+ class: b(["form-control", {
226
+ "form-check-input": e.type === "checkbox"
227
+ }]),
226
228
  "aria-label": e.label
227
- }, null, 8, K), [
228
- [T, p(a)]
229
+ }, null, 10, K), [
230
+ [A, p(l)]
229
231
  ]),
230
232
  m(n.$slots, "input-append", {}, () => [
231
233
  e.type === "color" ? (u(), s("span", Q, [
232
- M(i("input", {
233
- "onUpdate:modelValue": d[1] || (d[1] = (l) => U(a) ? a.value = l : null),
234
+ B(o("input", {
235
+ "onUpdate:modelValue": d[1] || (d[1] = (t) => w(l) ? l.value = t : null),
234
236
  type: "color",
235
237
  name: `${e.name}-color`,
236
238
  id: `${e.id}-color`,
@@ -240,22 +242,138 @@ const Y = { class: "input-group form-input__input-group" }, K = ["type", "id", "
240
242
  class: "form-control",
241
243
  "aria-label": e.label
242
244
  }, null, 8, W), [
243
- [A, p(a)]
245
+ [C, p(l)]
244
246
  ])
245
- ])) : q("", !0)
247
+ ])) : k("", !0)
246
248
  ])
247
249
  ]),
248
250
  m(n.$slots, "label", {}, () => [
249
- i("label", {
251
+ o("label", {
250
252
  for: e.id,
251
- class: "form-input__label",
253
+ class: b(["form-input__label", {
254
+ "form-check-label": e.type === "checkbox"
255
+ }]),
252
256
  innerHTML: `${e.label}${e.required ? " *" : ""}`
253
- }, null, 8, Z)
257
+ }, null, 10, Z)
254
258
  ])
255
259
  ], 2));
256
260
  }
257
261
  });
258
- const _ = { class: "radio-group" }, ee = ["for"], we = /* @__PURE__ */ b({
262
+ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "name", "placeholder", "pattern", "disabled", "read-only", "required", "maxlength", "aria-label"], te = {
263
+ key: 0,
264
+ class: "form-input__color-swatch"
265
+ }, le = ["name", "id", "disabled", "read-only", "required", "aria-label"], ae = ["for", "innerHTML"], Ue = /* @__PURE__ */ g({
266
+ __name: "input-textarea",
267
+ props: {
268
+ modelValue: {
269
+ type: String,
270
+ default: ""
271
+ },
272
+ type: {
273
+ type: String,
274
+ default: "text"
275
+ },
276
+ name: {
277
+ type: String,
278
+ default: () => y()
279
+ },
280
+ id: {
281
+ type: String,
282
+ default: () => y()
283
+ },
284
+ label: {
285
+ type: String,
286
+ default: ""
287
+ },
288
+ placeholder: {
289
+ type: String,
290
+ default: ""
291
+ },
292
+ variant: {
293
+ type: String,
294
+ default: ""
295
+ },
296
+ disabled: {
297
+ type: Boolean,
298
+ default: !1
299
+ },
300
+ readOnly: {
301
+ type: Boolean,
302
+ default: !1
303
+ },
304
+ required: {
305
+ type: Boolean,
306
+ default: !1
307
+ },
308
+ maxlength: {
309
+ type: Number
310
+ },
311
+ pattern: {
312
+ type: String,
313
+ default: null
314
+ },
315
+ checked: {
316
+ type: Boolean,
317
+ default: !1
318
+ }
319
+ },
320
+ emits: ["update:modelValue"],
321
+ setup(e, { emit: r }) {
322
+ const a = e, l = h({
323
+ get() {
324
+ return a.modelValue;
325
+ },
326
+ set(n) {
327
+ r("update:modelValue", n);
328
+ }
329
+ });
330
+ return (n, d) => (u(), s("div", _, [
331
+ m(n.$slots, "input-prepend"),
332
+ B(o("textarea", {
333
+ "onUpdate:modelValue": d[0] || (d[0] = (t) => w(l) ? l.value = t : null),
334
+ type: e.type === "color" ? "text" : e.type,
335
+ id: e.id,
336
+ name: e.name,
337
+ placeholder: e.placeholder,
338
+ pattern: e.pattern,
339
+ disabled: e.disabled,
340
+ "read-only": e.readOnly,
341
+ required: e.required,
342
+ maxlength: e.maxlength,
343
+ class: b(["form-control", {}]),
344
+ "aria-label": e.label
345
+ }, null, 8, ee), [
346
+ [C, p(l)]
347
+ ]),
348
+ m(n.$slots, "input-append", {}, () => [
349
+ e.type === "color" ? (u(), s("span", te, [
350
+ B(o("input", {
351
+ "onUpdate:modelValue": d[1] || (d[1] = (t) => w(l) ? l.value = t : null),
352
+ type: "color",
353
+ name: `${e.name}-color`,
354
+ id: `${e.id}-color`,
355
+ disabled: e.disabled,
356
+ "read-only": e.readOnly,
357
+ required: e.required,
358
+ class: "form-control",
359
+ "aria-label": e.label
360
+ }, null, 8, le), [
361
+ [C, p(l)]
362
+ ])
363
+ ])) : k("", !0)
364
+ ]),
365
+ m(n.$slots, "label", {}, () => [
366
+ o("label", {
367
+ for: e.id,
368
+ class: b(["form-input__label", {
369
+ "form-check-label": e.type === "checkbox"
370
+ }]),
371
+ innerHTML: `${e.label}${e.required ? " *" : ""}`
372
+ }, null, 10, ae)
373
+ ])
374
+ ]));
375
+ }
376
+ }), ne = { class: "radio-group" }, de = ["for"], Le = /* @__PURE__ */ g({
259
377
  __name: "check-group",
260
378
  props: {
261
379
  modelValue: {
@@ -296,42 +414,42 @@ const _ = { class: "radio-group" }, ee = ["for"], we = /* @__PURE__ */ b({
296
414
  },
297
415
  emits: ["change", "update:modelValue"],
298
416
  setup(e, { emit: r }) {
299
- const t = e, a = B([]);
300
- return S(() => t.modelValue, (n, d) => {
301
- a.value = t.options.map(
302
- (l) => l.value ? t.modelValue.some((o) => o["value "] === l.value) : t.modelValue.some((o) => o === l)
417
+ const a = e, l = q([]);
418
+ return S(() => a.modelValue, (n, d) => {
419
+ l.value = a.options.map(
420
+ (t) => t.value ? a.modelValue.some((i) => i["value "] === t.value) : a.modelValue.some((i) => i === t)
303
421
  );
304
- }, { immediate: !0 }), S(a, (n, d) => {
305
- const l = n.reduce((o, c, f) => {
306
- const V = c && t.options[f] ? [t.options[f] || t.options[f]] : [];
307
- return [...o, ...V];
422
+ }, { immediate: !0 }), S(l, (n, d) => {
423
+ const t = n.reduce((i, c, f) => {
424
+ const x = c && a.options[f] ? [a.options[f] || a.options[f]] : [];
425
+ return [...i, ...x];
308
426
  }, []);
309
- r("update:modelValue", l);
310
- }, { deep: !0 }), N(() => {
427
+ r("update:modelValue", t);
428
+ }, { deep: !0 }), T(() => {
311
429
  }), (n, d) => {
312
- const l = $("form-input");
313
- return u(), s("div", _, [
314
- (u(!0), s(k, null, w(e.options, (o, c) => (u(), O(l, {
430
+ const t = $("form-input");
431
+ return u(), s("div", ne, [
432
+ (u(!0), s(O, null, M(e.options, (i, c) => (u(), U(t, {
315
433
  key: c,
316
- modelValue: p(a)[c],
317
- "onUpdate:modelValue": (f) => p(a)[c] = f,
434
+ modelValue: p(l)[c],
435
+ "onUpdate:modelValue": (f) => p(l)[c] = f,
318
436
  type: "checkbox",
319
437
  name: e.name,
320
438
  id: `${e.id}-${c}`,
321
- label: `${o.text || o}${e.required ? " *" : ""}`,
439
+ label: `${i.text || i}${e.required ? " *" : ""}`,
322
440
  disabled: e.disabled,
323
441
  "read-only": e.readOnly,
324
442
  required: e.required
325
443
  }, null, 8, ["modelValue", "onUpdate:modelValue", "name", "id", "label", "disabled", "read-only", "required"]))), 128)),
326
- i("label", { for: e.id }, [
444
+ o("label", { for: e.id }, [
327
445
  m(n.$slots, "label", {}, () => [
328
- C(h(e.label), 1)
446
+ L(v(e.label), 1)
329
447
  ])
330
- ], 8, ee)
448
+ ], 8, de)
331
449
  ]);
332
450
  };
333
451
  }
334
- }), te = { class: "radio-group" }, le = ["for"], qe = /* @__PURE__ */ b({
452
+ }), oe = { class: "radio-group" }, ie = ["for"], Ne = /* @__PURE__ */ g({
335
453
  __name: "radio-group",
336
454
  props: {
337
455
  modelValue: {
@@ -372,40 +490,40 @@ const _ = { class: "radio-group" }, ee = ["for"], we = /* @__PURE__ */ b({
372
490
  },
373
491
  emits: ["change", "update:modelValue"],
374
492
  setup(e, { emit: r }) {
375
- const t = e;
376
- B(t.options.map((n) => n.value === t.modelValue));
377
- function a(n) {
493
+ const a = e;
494
+ q(a.options.map((n) => n.value === a.modelValue));
495
+ function l(n) {
378
496
  r("update:modelValue", n);
379
497
  }
380
- return N(() => {
498
+ return T(() => {
381
499
  }), (n, d) => {
382
- const l = $("form-input");
383
- return u(), s("div", te, [
384
- (u(!0), s(k, null, w(e.options, (o, c) => (u(), O(l, {
500
+ const t = $("form-input");
501
+ return u(), s("div", oe, [
502
+ (u(!0), s(O, null, M(e.options, (i, c) => (u(), U(t, {
385
503
  key: c,
386
504
  type: "radio",
387
505
  name: e.name,
388
506
  id: `${e.id}-${c}`,
389
- value: o.value || o,
390
- label: `${o.text || o}${e.required ? " *" : ""}`,
391
- checked: o.value ? o.value === e.modelValue : o === e.modelValue,
507
+ value: i.value || i,
508
+ label: `${i.text || i}${e.required ? " *" : ""}`,
509
+ checked: i.value ? i.value === e.modelValue : i === e.modelValue,
392
510
  disabled: e.disabled,
393
511
  "read-only": e.readOnly,
394
512
  required: e.required,
395
- onChange: (f) => a(o)
513
+ onChange: (f) => l(i)
396
514
  }, null, 8, ["name", "id", "value", "label", "checked", "disabled", "read-only", "required", "onChange"]))), 128)),
397
- i("label", { for: e.id }, [
515
+ o("label", { for: e.id }, [
398
516
  m(n.$slots, "label", {}, () => [
399
- C(h(e.label), 1)
517
+ L(v(e.label), 1)
400
518
  ])
401
- ], 8, le)
519
+ ], 8, ie)
402
520
  ]);
403
521
  };
404
522
  }
405
- }), ae = { class: "input input-dropdown" }, ne = { class: "dropdown" }, de = {
523
+ }), ue = { class: "input input-dropdown" }, re = { class: "dropdown" }, se = {
406
524
  class: "btn-group",
407
525
  role: "group"
408
- }, oe = ["id", "disabled"], ie = ["aria-labelledby"], ue = ["onClick"], re = ["for"], Oe = /* @__PURE__ */ b({
526
+ }, ce = ["id", "disabled"], fe = ["aria-labelledby"], me = ["onClick"], ye = ["for"], Te = /* @__PURE__ */ g({
409
527
  __name: "input-dropdown",
410
528
  props: {
411
529
  modelValue: {
@@ -463,31 +581,31 @@ const _ = { class: "radio-group" }, ee = ["for"], we = /* @__PURE__ */ b({
463
581
  },
464
582
  emits: ["update:modelValue"],
465
583
  setup(e, { emit: r }) {
466
- const t = e;
467
- g({
584
+ const a = e;
585
+ h({
468
586
  get() {
469
- return t.modelValue;
587
+ return a.modelValue;
470
588
  },
471
- set(l) {
472
- r("update:modelValue", l);
589
+ set(t) {
590
+ r("update:modelValue", t);
473
591
  }
474
592
  });
475
- function a(l) {
476
- r("update:modelValue", l);
593
+ function l(t) {
594
+ r("update:modelValue", t);
477
595
  }
478
- const n = g(() => [
596
+ const n = h(() => [
479
597
  {
480
598
  text: "Please select"
481
599
  },
482
- ...t.options.map(
483
- (l) => typeof l == "string" ? { value: l, text: l } : l
600
+ ...a.options.map(
601
+ (t) => typeof t == "string" ? { value: t, text: t } : t
484
602
  )
485
- ]), d = g(() => [...t.options].find((l) => JSON.stringify(l.value) === JSON.stringify(t.modelValue)));
486
- return (l, o) => (u(), s("div", ae, [
487
- i("div", ne, [
488
- i("div", de, [
489
- i("button", {
490
- class: v(["btn dropdown-toggle", {
603
+ ]), d = h(() => [...a.options].find((t) => JSON.stringify(t.value) === JSON.stringify(a.modelValue)));
604
+ return (t, i) => (u(), s("div", ue, [
605
+ o("div", re, [
606
+ o("div", se, [
607
+ o("button", {
608
+ class: b(["btn dropdown-toggle", {
491
609
  [`btn-${e.variant}`]: e.variant,
492
610
  [`btn-${e.color}`]: e.color,
493
611
  [`btn-${e.disabled}`]: e.disabled,
@@ -498,30 +616,30 @@ const _ = { class: "radio-group" }, ee = ["for"], we = /* @__PURE__ */ b({
498
616
  "data-bs-toggle": "dropdown",
499
617
  "aria-expanded": "false",
500
618
  disabled: e.disabled
501
- }, h(p(d) ? p(d).text : e.placeholder), 11, oe),
502
- i("ul", {
619
+ }, v(p(d) ? p(d).text : e.placeholder), 11, ce),
620
+ o("ul", {
503
621
  class: "dropdown-menu",
504
622
  "aria-labelledby": e.id
505
623
  }, [
506
- (u(!0), s(k, null, w(p(n), (c, f) => (u(), s("li", { key: f }, [
507
- m(l.$slots, "option", {}, () => [
508
- i("a", {
624
+ (u(!0), s(O, null, M(p(n), (c, f) => (u(), s("li", { key: f }, [
625
+ m(t.$slots, "option", {}, () => [
626
+ o("a", {
509
627
  class: "dropdown-item",
510
- onClick: z((V) => a(c.value), ["prevent"])
511
- }, h(c.text), 9, ue)
628
+ onClick: I((x) => l(c.value), ["prevent"])
629
+ }, v(c.text), 9, me)
512
630
  ])
513
631
  ]))), 128))
514
- ], 8, ie)
632
+ ], 8, fe)
515
633
  ])
516
634
  ]),
517
- i("label", { for: e.id }, [
518
- m(l.$slots, "label", {}, () => [
519
- C(h(e.label), 1)
635
+ o("label", { for: e.id }, [
636
+ m(t.$slots, "label", {}, () => [
637
+ L(v(e.label), 1)
520
638
  ])
521
- ], 8, re)
639
+ ], 8, ye)
522
640
  ]));
523
641
  }
524
- }), se = ["id", "name", "multiple", "accept"], ce = { class: "form-input__input-group input-group" }, fe = ["value", "id", "name"], me = ["for"], ye = ["for", "innerHTML"], Ce = /* @__PURE__ */ b({
642
+ }), pe = ["id", "name", "multiple", "accept"], be = { class: "form-input__input-group input-group" }, ge = ["value", "id", "name"], he = ["for"], ve = ["for", "innerHTML"], Ie = /* @__PURE__ */ g({
525
643
  __name: "file-input",
526
644
  props: {
527
645
  modelValue: {
@@ -574,60 +692,60 @@ const _ = { class: "radio-group" }, ee = ["for"], we = /* @__PURE__ */ b({
574
692
  },
575
693
  emits: ["update:modelValue"],
576
694
  setup(e, { emit: r }) {
577
- function t(d) {
578
- const l = d.target && d.target.files;
579
- l && (a.splice(0, a.length), Array.from(l).forEach((o) => {
580
- a.push(o);
695
+ function a(d) {
696
+ const t = d.target && d.target.files;
697
+ t && (l.splice(0, l.length), Array.from(t).forEach((i) => {
698
+ l.push(i);
581
699
  }));
582
700
  }
583
- const a = D([]), n = g(() => a && a.map((d) => d.name));
584
- return g(() => a.map((d) => URL.createObjectURL(d))), S(() => a, (d, l) => {
701
+ const l = D([]), n = h(() => l && l.map((d) => d.name));
702
+ return h(() => l.map((d) => URL.createObjectURL(d))), S(() => l, (d, t) => {
585
703
  console.log("file input", d), r("update:modelValue", d);
586
- }, { deep: !0 }), (d, l) => (u(), s("div", {
587
- class: v(["form-input file-input", "file-input--primary"])
704
+ }, { deep: !0 }), (d, t) => (u(), s("div", {
705
+ class: b(["form-input file-input", "file-input--primary"])
588
706
  }, [
589
- i("input", {
707
+ o("input", {
590
708
  type: "file",
591
709
  id: e.id,
592
710
  name: e.name,
593
711
  class: "d-none",
594
- onChange: t,
712
+ onChange: a,
595
713
  multiple: e.multiple,
596
714
  accept: e.accept
597
- }, null, 40, se),
598
- i("div", ce, [
715
+ }, null, 40, pe),
716
+ o("div", be, [
599
717
  m(d.$slots, "input-prepend"),
600
- i("input", {
718
+ o("input", {
601
719
  type: "text",
602
720
  value: p(n),
603
721
  id: e.id,
604
722
  name: e.name,
605
723
  class: "form-control"
606
- }, null, 8, fe),
724
+ }, null, 8, ge),
607
725
  m(d.$slots, "input-append", {}, () => [
608
- i("label", {
726
+ o("label", {
609
727
  for: e.id,
610
728
  class: "btn btn-outline-dark"
611
- }, " Select Image ", 8, me)
729
+ }, " Select Image ", 8, he)
612
730
  ])
613
731
  ]),
614
732
  m(d.$slots, "label", {}, () => [
615
- i("label", {
733
+ o("label", {
616
734
  for: e.id,
617
735
  class: "form-input__label",
618
736
  innerHTML: `${e.label}${e.required ? " *" : ""}`
619
- }, null, 8, ye)
737
+ }, null, 8, ve)
620
738
  ])
621
739
  ]));
622
740
  }
623
- }), pe = { class: "media-upload" }, be = ["src"], ge = ["onClick"], he = ["for"];
624
- async function ve(e) {
741
+ }), $e = { class: "media-upload" }, Se = ["src"], xe = ["onClick"], Ve = ["for"];
742
+ async function ke(e) {
625
743
  return await new Promise((r) => {
626
- let t = new FileReader();
627
- t.onload = () => r(t.result), t.readAsDataURL(e);
744
+ let a = new FileReader();
745
+ a.onload = () => r(a.result), a.readAsDataURL(e);
628
746
  });
629
747
  }
630
- const Me = /* @__PURE__ */ b({
748
+ const ze = /* @__PURE__ */ g({
631
749
  __name: "media-upload",
632
750
  props: {
633
751
  modelValue: {
@@ -684,63 +802,64 @@ const Me = /* @__PURE__ */ b({
684
802
  },
685
803
  emits: ["update:modelValue", "update:src"],
686
804
  setup(e, { emit: r }) {
687
- const t = e, a = B([]), n = B([]), d = g(() => t.modelValue.length ? t.modelValue : t.src ? [{ type: "", src: t.src }] : n.value);
688
- S(() => a, async (o, c) => {
805
+ const a = e, l = q([]), n = q([]), d = h(() => a.modelValue.length ? a.modelValue : a.src ? [{ type: "", src: a.src }] : n.value);
806
+ S(() => l, async (i, c) => {
689
807
  n.value = await Promise.all(
690
- o.value.map(async (f) => ({
691
- src: await ve(f),
808
+ i.value.map(async (f) => ({
809
+ src: await ke(f),
692
810
  type: f.type
693
811
  }))
694
812
  );
695
- }, { deep: !0 }), S(() => n, async (o, c) => {
696
- const f = t.multiple ? n.value : [n.value[0]];
697
- r("update:modelValue", f), t.multiple || r("update:src", n.value[0] && n.value[0].src);
813
+ }, { deep: !0 }), S(() => n, async (i, c) => {
814
+ const f = a.multiple ? n.value : [n.value[0]];
815
+ r("update:modelValue", f), a.multiple || r("update:src", n.value[0] && n.value[0].src);
698
816
  }, { deep: !0 });
699
- function l(o) {
700
- a.value.splice(o, 1);
817
+ function t(i) {
818
+ l.value.splice(i, 1);
701
819
  }
702
- return (o, c) => {
703
- const f = $("svg-icon"), V = $("file-input");
704
- return u(), s("div", pe, [
705
- (u(!0), s(k, null, w(p(d), (x, I) => (u(), s("div", {
706
- key: x.src,
820
+ return (i, c) => {
821
+ const f = $("svg-icon"), x = $("file-input");
822
+ return u(), s("div", $e, [
823
+ (u(!0), s(O, null, M(p(d), (V, z) => (u(), s("div", {
824
+ key: V.src,
707
825
  class: "media-upload__thumbnail"
708
826
  }, [
709
- i("img", {
710
- src: x.src,
827
+ o("img", {
828
+ src: V.src,
711
829
  class: "img-thumbnail rounded"
712
- }, null, 8, be),
713
- i("button", {
714
- onClick: z(($e) => l(I), ["prevent"]),
830
+ }, null, 8, Se),
831
+ o("button", {
832
+ onClick: I((Be) => t(z), ["prevent"]),
715
833
  class: "btn btn--close"
716
834
  }, [
717
- L(f, { symbol: "x" })
718
- ], 8, ge)
835
+ N(f, { symbol: "x" })
836
+ ], 8, xe)
719
837
  ]))), 128)),
720
- L(V, {
721
- modelValue: a.value,
722
- "onUpdate:modelValue": c[0] || (c[0] = (x) => a.value = x),
838
+ N(x, {
839
+ modelValue: l.value,
840
+ "onUpdate:modelValue": c[0] || (c[0] = (V) => l.value = V),
723
841
  id: e.id,
724
842
  name: e.name,
725
843
  accept: e.accept,
726
844
  class: "d-none"
727
845
  }, null, 8, ["modelValue", "id", "name", "accept"]),
728
- i("label", {
846
+ o("label", {
729
847
  for: e.id,
730
848
  class: "btn btn-outline-dark"
731
- }, " Select Image ", 8, he)
849
+ }, " Select Image ", 8, Ve)
732
850
  ]);
733
851
  };
734
852
  }
735
853
  });
736
854
  export {
737
- Be as BaseButton,
738
- we as CheckGroup,
739
- Ce as FileInput,
740
- ke as FormInput,
741
- Oe as InputDropdown,
742
- xe as LoadingSpinner,
743
- Me as MediaUpload,
744
- qe as RadioGroup,
745
- Ve as SvgIcon
855
+ Me as BaseButton,
856
+ Le as CheckGroup,
857
+ Ie as FileInput,
858
+ Ce as FormInput,
859
+ Te as InputDropdown,
860
+ Ue as InputTextarea,
861
+ Oe as LoadingSpinner,
862
+ ze as MediaUpload,
863
+ Ne as RadioGroup,
864
+ qe as SvgIcon
746
865
  };