ablok-components 0.0.37 → 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 (20) hide show
  1. package/dist/ablok-components.es.js +262 -216
  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/text/base-headline/base-headline.vue.d.ts +81 -0
  15. package/dist/components/{base-button.story.vue.d.ts → text/base-paragraph/base-paragraph.vue.d.ts} +37 -8
  16. package/dist/index.d.ts +12 -10
  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
@@ -1,8 +1,8 @@
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";
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"
5
- }, F = ["xlink:href"], qe = /* @__PURE__ */ g({
5
+ }, F = ["xlink:href"], Ce = /* @__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, a) => (u(), 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
- (u(), 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",
@@ -39,7 +39,7 @@ const R = {
39
39
  ], 2));
40
40
  }
41
41
  });
42
- const H = { class: "loading-spinner d-block" }, P = { class: "loading-spinner__animation" }, E = {
42
+ const E = { class: "loading-spinner d-block" }, j = { class: "loading-spinner__animation" }, G = {
43
43
  class: "d-block",
44
44
  version: "1.1",
45
45
  id: "L9",
@@ -50,7 +50,7 @@ const H = { class: "loading-spinner d-block" }, P = { 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__ */ o("animateTransform", {
53
+ }, J = ["fill"], X = /* @__PURE__ */ u("animateTransform", {
54
54
  attributeName: "transform",
55
55
  attributeType: "XML",
56
56
  type: "rotate",
@@ -58,9 +58,9 @@ const H = { class: "loading-spinner d-block" }, P = { class: "loading-spinner__a
58
58
  from: "0 50 50",
59
59
  to: "360 50 50",
60
60
  repeatCount: "indefinite"
61
- }, null, -1), J = [
62
- G
63
- ], Oe = /* @__PURE__ */ g({
61
+ }, null, -1), Y = [
62
+ X
63
+ ], Me = /* @__PURE__ */ g({
64
64
  __name: "loading-spinner",
65
65
  props: {
66
66
  color: {
@@ -69,20 +69,59 @@ const H = { class: "loading-spinner d-block" }, P = { class: "loading-spinner__a
69
69
  }
70
70
  },
71
71
  setup(e) {
72
- return (r, a) => (u(), s("span", H, [
73
- o("span", P, [
74
- (u(), s("svg", E, [
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
- }, J, 8, j)
78
+ }, Y, 8, J)
79
79
  ]))
80
80
  ]),
81
- m(r.$slots, "default")
81
+ m(o.$slots, "default")
82
82
  ]));
83
83
  }
84
84
  });
85
- const X = ["type", "disabled", "href", "to"], Me = /* @__PURE__ */ g({
85
+ const Ne = /* @__PURE__ */ g({
86
+ __name: "base-headline",
87
+ props: {
88
+ tag: null,
89
+ size: null,
90
+ variant: null,
91
+ text: null,
92
+ className: null
93
+ },
94
+ setup(e) {
95
+ const o = e, t = h(() => o.tag || "p");
96
+ return (d, a) => (r(), C(D(p(t)), {
97
+ class: b(["headline", `headline--${e.size}${e.className || ""}`])
98
+ }, {
99
+ default: A(() => [
100
+ m(d.$slots, "default", {}, () => [
101
+ V(v(e.text), 1)
102
+ ])
103
+ ]),
104
+ _: 3
105
+ }, 8, ["class"]));
106
+ }
107
+ }), Ue = /* @__PURE__ */ g({
108
+ __name: "base-paragraph",
109
+ props: {
110
+ size: null,
111
+ variant: null,
112
+ text: null,
113
+ className: null
114
+ },
115
+ setup(e) {
116
+ return (o, t) => (r(), c("p", {
117
+ class: b(["base-paragraph", `base-paragraph--${e.size}${e.className || ""}`])
118
+ }, [
119
+ m(o.$slots, "default", {}, () => [
120
+ V(v(e.text), 1)
121
+ ])
122
+ ], 2));
123
+ }
124
+ }), K = ["type", "disabled", "href", "to"], ze = /* @__PURE__ */ g({
86
125
  __name: "base-button",
87
126
  props: {
88
127
  type: null,
@@ -99,10 +138,10 @@ const X = ["type", "disabled", "href", "to"], Me = /* @__PURE__ */ g({
99
138
  fab: { type: Boolean }
100
139
  },
101
140
  setup(e) {
102
- const r = e, a = h(() => r.caption && !r.fab);
103
- return (l, n) => {
104
- const d = $("svg-icon");
105
- return u(), 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", {
106
145
  type: e.type,
107
146
  disabled: e.disabled,
108
147
  href: e.href,
@@ -119,28 +158,28 @@ const X = ["type", "disabled", "href", "to"], Me = /* @__PURE__ */ g({
119
158
  "x-small": e.size === "x-small"
120
159
  }])
121
160
  }, [
122
- m(l.$slots, "default", {}, () => [
123
- e.icon ? (u(), U(d, {
161
+ m(d.$slots, "default", {}, () => [
162
+ e.icon ? (r(), C(i, {
124
163
  key: 0,
125
164
  id: e.icon,
126
165
  class: "base-button__caption"
127
- }, null, 8, ["id"])) : k("", !0),
128
- p(a) ? (u(), s("span", {
166
+ }, null, 8, ["id"])) : w("", !0),
167
+ p(t) ? (r(), c("span", {
129
168
  key: 1,
130
169
  class: b(["base-button__caption", { "icon-padding": e.icon }])
131
- }, v(e.caption), 3)) : k("", !0)
170
+ }, v(e.caption), 3)) : w("", !0)
132
171
  ])
133
- ], 10, X);
172
+ ], 10, K);
134
173
  };
135
174
  }
136
175
  });
137
176
  function y() {
138
177
  return (new Date().valueOf() + Math.random()).toString(36);
139
178
  }
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 = {
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 = {
141
180
  key: 0,
142
181
  class: "form-input__color-swatch"
143
- }, W = ["name", "id", "disabled", "read-only", "required", "aria-label"], Z = ["for", "innerHTML"], Ce = /* @__PURE__ */ g({
182
+ }, _ = ["name", "id", "disabled", "read-only", "required", "aria-label"], ee = ["for", "innerHTML"], Le = /* @__PURE__ */ g({
144
183
  __name: "form-input",
145
184
  props: {
146
185
  modelValue: {
@@ -196,22 +235,22 @@ const Y = { class: "input-group form-input__input-group" }, K = ["type", "id", "
196
235
  }
197
236
  },
198
237
  emits: ["update:modelValue"],
199
- setup(e, { emit: r }) {
200
- const a = e, l = h({
238
+ setup(e, { emit: o }) {
239
+ const t = e, d = h({
201
240
  get() {
202
- return a.modelValue;
241
+ return t.modelValue;
203
242
  },
204
- set(n) {
205
- r("update:modelValue", n);
243
+ set(a) {
244
+ o("update:modelValue", a);
206
245
  }
207
246
  });
208
- return (n, d) => (u(), s("div", {
247
+ return (a, i) => (r(), c("div", {
209
248
  class: b(["form-input", `form-input--${e.type}`])
210
249
  }, [
211
- o("div", Y, [
212
- m(n.$slots, "input-prepend"),
213
- B(o("input", {
214
- "onUpdate:modelValue": d[0] || (d[0] = (t) => w(l) ? l.value = t : 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),
215
254
  type: e.type === "color" ? "text" : e.type,
216
255
  id: e.id,
217
256
  name: e.name,
@@ -226,13 +265,13 @@ const Y = { class: "input-group form-input__input-group" }, K = ["type", "id", "
226
265
  "form-check-input": e.type === "checkbox"
227
266
  }]),
228
267
  "aria-label": e.label
229
- }, null, 10, K), [
230
- [A, p(l)]
268
+ }, null, 10, W), [
269
+ [H, p(d)]
231
270
  ]),
232
- m(n.$slots, "input-append", {}, () => [
233
- e.type === "color" ? (u(), s("span", Q, [
234
- B(o("input", {
235
- "onUpdate:modelValue": d[1] || (d[1] = (t) => w(l) ? l.value = t : 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),
236
275
  type: "color",
237
276
  name: `${e.name}-color`,
238
277
  id: `${e.id}-color`,
@@ -241,28 +280,28 @@ const Y = { class: "input-group form-input__input-group" }, K = ["type", "id", "
241
280
  required: e.required,
242
281
  class: "form-control",
243
282
  "aria-label": e.label
244
- }, null, 8, W), [
245
- [C, p(l)]
283
+ }, null, 8, _), [
284
+ [U, p(d)]
246
285
  ])
247
- ])) : k("", !0)
286
+ ])) : w("", !0)
248
287
  ])
249
288
  ]),
250
- m(n.$slots, "label", {}, () => [
251
- o("label", {
289
+ m(a.$slots, "label", {}, () => [
290
+ u("label", {
252
291
  for: e.id,
253
292
  class: b(["form-input__label", {
254
293
  "form-check-label": e.type === "checkbox"
255
294
  }]),
256
295
  innerHTML: `${e.label}${e.required ? " *" : ""}`
257
- }, null, 10, Z)
296
+ }, null, 10, ee)
258
297
  ])
259
298
  ], 2));
260
299
  }
261
300
  });
262
- const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "name", "placeholder", "pattern", "disabled", "read-only", "required", "maxlength", "aria-label"], te = {
301
+ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "name", "placeholder", "pattern", "disabled", "read-only", "required", "maxlength", "aria-label"], ae = {
263
302
  key: 0,
264
303
  class: "form-input__color-swatch"
265
- }, le = ["name", "id", "disabled", "read-only", "required", "aria-label"], ae = ["for", "innerHTML"], Ue = /* @__PURE__ */ g({
304
+ }, ne = ["name", "id", "disabled", "read-only", "required", "aria-label"], de = ["for", "innerHTML"], Te = /* @__PURE__ */ g({
266
305
  __name: "input-textarea",
267
306
  props: {
268
307
  modelValue: {
@@ -318,19 +357,19 @@ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "nam
318
357
  }
319
358
  },
320
359
  emits: ["update:modelValue"],
321
- setup(e, { emit: r }) {
322
- const a = e, l = h({
360
+ setup(e, { emit: o }) {
361
+ const t = e, d = h({
323
362
  get() {
324
- return a.modelValue;
363
+ return t.modelValue;
325
364
  },
326
- set(n) {
327
- r("update:modelValue", n);
365
+ set(a) {
366
+ o("update:modelValue", a);
328
367
  }
329
368
  });
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),
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),
334
373
  type: e.type === "color" ? "text" : e.type,
335
374
  id: e.id,
336
375
  name: e.name,
@@ -342,13 +381,13 @@ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "nam
342
381
  maxlength: e.maxlength,
343
382
  class: b(["form-control", {}]),
344
383
  "aria-label": e.label
345
- }, null, 8, ee), [
346
- [C, p(l)]
384
+ }, null, 8, le), [
385
+ [U, p(d)]
347
386
  ]),
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),
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),
352
391
  type: "color",
353
392
  name: `${e.name}-color`,
354
393
  id: `${e.id}-color`,
@@ -357,23 +396,23 @@ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "nam
357
396
  required: e.required,
358
397
  class: "form-control",
359
398
  "aria-label": e.label
360
- }, null, 8, le), [
361
- [C, p(l)]
399
+ }, null, 8, ne), [
400
+ [U, p(d)]
362
401
  ])
363
- ])) : k("", !0)
402
+ ])) : w("", !0)
364
403
  ]),
365
- m(n.$slots, "label", {}, () => [
366
- o("label", {
404
+ m(a.$slots, "label", {}, () => [
405
+ u("label", {
367
406
  for: e.id,
368
407
  class: b(["form-input__label", {
369
408
  "form-check-label": e.type === "checkbox"
370
409
  }]),
371
410
  innerHTML: `${e.label}${e.required ? " *" : ""}`
372
- }, null, 10, ae)
411
+ }, null, 10, de)
373
412
  ])
374
413
  ]));
375
414
  }
376
- }), ne = { class: "radio-group" }, de = ["for"], Le = /* @__PURE__ */ g({
415
+ }), ie = { class: "radio-group" }, oe = ["for"], Ie = /* @__PURE__ */ g({
377
416
  __name: "check-group",
378
417
  props: {
379
418
  modelValue: {
@@ -413,43 +452,43 @@ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "nam
413
452
  }
414
453
  },
415
454
  emits: ["change", "update:modelValue"],
416
- setup(e, { emit: r }) {
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)
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)
421
460
  );
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];
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];
426
465
  }, []);
427
- r("update:modelValue", t);
428
- }, { deep: !0 }), T(() => {
429
- }), (n, d) => {
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, {
433
- key: c,
434
- modelValue: p(l)[c],
435
- "onUpdate:modelValue": (f) => p(l)[c] = f,
466
+ o("update:modelValue", n);
467
+ }, { deep: !0 }), L(() => {
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,
436
475
  type: "checkbox",
437
476
  name: e.name,
438
- id: `${e.id}-${c}`,
439
- label: `${i.text || i}${e.required ? " *" : ""}`,
477
+ id: `${e.id}-${s}`,
478
+ label: `${l.text || l}${e.required ? " *" : ""}`,
440
479
  disabled: e.disabled,
441
480
  "read-only": e.readOnly,
442
481
  required: e.required
443
482
  }, null, 8, ["modelValue", "onUpdate:modelValue", "name", "id", "label", "disabled", "read-only", "required"]))), 128)),
444
- o("label", { for: e.id }, [
445
- m(n.$slots, "label", {}, () => [
446
- L(v(e.label), 1)
483
+ u("label", { for: e.id }, [
484
+ m(a.$slots, "label", {}, () => [
485
+ V(v(e.label), 1)
447
486
  ])
448
- ], 8, de)
487
+ ], 8, oe)
449
488
  ]);
450
489
  };
451
490
  }
452
- }), oe = { class: "radio-group" }, ie = ["for"], Ne = /* @__PURE__ */ g({
491
+ }), ue = { class: "radio-group" }, re = ["for"], De = /* @__PURE__ */ g({
453
492
  __name: "radio-group",
454
493
  props: {
455
494
  modelValue: {
@@ -489,41 +528,41 @@ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "nam
489
528
  }
490
529
  },
491
530
  emits: ["change", "update:modelValue"],
492
- setup(e, { emit: r }) {
493
- const a = e;
494
- q(a.options.map((n) => n.value === a.modelValue));
495
- function l(n) {
496
- r("update:modelValue", n);
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);
497
536
  }
498
- return T(() => {
499
- }), (n, d) => {
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, {
503
- key: c,
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,
504
543
  type: "radio",
505
544
  name: e.name,
506
- id: `${e.id}-${c}`,
507
- value: i.value || i,
508
- label: `${i.text || i}${e.required ? " *" : ""}`,
509
- checked: i.value ? i.value === e.modelValue : i === 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,
510
549
  disabled: e.disabled,
511
550
  "read-only": e.readOnly,
512
551
  required: e.required,
513
- onChange: (f) => l(i)
552
+ onChange: (f) => d(l)
514
553
  }, null, 8, ["name", "id", "value", "label", "checked", "disabled", "read-only", "required", "onChange"]))), 128)),
515
- o("label", { for: e.id }, [
516
- m(n.$slots, "label", {}, () => [
517
- L(v(e.label), 1)
554
+ u("label", { for: e.id }, [
555
+ m(a.$slots, "label", {}, () => [
556
+ V(v(e.label), 1)
518
557
  ])
519
- ], 8, ie)
558
+ ], 8, re)
520
559
  ]);
521
560
  };
522
561
  }
523
- }), ue = { class: "input input-dropdown" }, re = { class: "dropdown" }, se = {
562
+ }), se = { class: "input input-dropdown" }, ce = { class: "dropdown" }, fe = {
524
563
  class: "btn-group",
525
564
  role: "group"
526
- }, ce = ["id", "disabled"], fe = ["aria-labelledby"], me = ["onClick"], ye = ["for"], Te = /* @__PURE__ */ g({
565
+ }, me = ["id", "disabled"], ye = ["aria-labelledby"], pe = ["onClick"], be = ["for"], Ae = /* @__PURE__ */ g({
527
566
  __name: "input-dropdown",
528
567
  props: {
529
568
  modelValue: {
@@ -580,31 +619,31 @@ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "nam
580
619
  }
581
620
  },
582
621
  emits: ["update:modelValue"],
583
- setup(e, { emit: r }) {
584
- const a = e;
622
+ setup(e, { emit: o }) {
623
+ const t = e;
585
624
  h({
586
625
  get() {
587
- return a.modelValue;
626
+ return t.modelValue;
588
627
  },
589
- set(t) {
590
- r("update:modelValue", t);
628
+ set(n) {
629
+ o("update:modelValue", n);
591
630
  }
592
631
  });
593
- function l(t) {
594
- r("update:modelValue", t);
632
+ function d(n) {
633
+ o("update:modelValue", n);
595
634
  }
596
- const n = h(() => [
635
+ const a = h(() => [
597
636
  {
598
637
  text: "Please select"
599
638
  },
600
- ...a.options.map(
601
- (t) => typeof t == "string" ? { value: t, text: t } : t
639
+ ...t.options.map(
640
+ (n) => typeof n == "string" ? { value: n, text: n } : n
602
641
  )
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", {
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", {
608
647
  class: b(["btn dropdown-toggle", {
609
648
  [`btn-${e.variant}`]: e.variant,
610
649
  [`btn-${e.color}`]: e.color,
@@ -616,30 +655,30 @@ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "nam
616
655
  "data-bs-toggle": "dropdown",
617
656
  "aria-expanded": "false",
618
657
  disabled: e.disabled
619
- }, v(p(d) ? p(d).text : e.placeholder), 11, ce),
620
- o("ul", {
658
+ }, v(p(i) ? p(i).text : e.placeholder), 11, me),
659
+ u("ul", {
621
660
  class: "dropdown-menu",
622
661
  "aria-labelledby": e.id
623
662
  }, [
624
- (u(!0), s(O, null, M(p(n), (c, f) => (u(), s("li", { key: f }, [
625
- m(t.$slots, "option", {}, () => [
626
- 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", {
627
666
  class: "dropdown-item",
628
- onClick: I((x) => l(c.value), ["prevent"])
629
- }, v(c.text), 9, me)
667
+ onClick: T((k) => d(s.value), ["prevent"])
668
+ }, v(s.text), 9, pe)
630
669
  ])
631
670
  ]))), 128))
632
- ], 8, fe)
671
+ ], 8, ye)
633
672
  ])
634
673
  ]),
635
- o("label", { for: e.id }, [
636
- m(t.$slots, "label", {}, () => [
637
- L(v(e.label), 1)
674
+ u("label", { for: e.id }, [
675
+ m(n.$slots, "label", {}, () => [
676
+ V(v(e.label), 1)
638
677
  ])
639
- ], 8, ye)
678
+ ], 8, be)
640
679
  ]));
641
680
  }
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({
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({
643
682
  __name: "file-input",
644
683
  props: {
645
684
  modelValue: {
@@ -691,61 +730,66 @@ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "nam
691
730
  }
692
731
  },
693
732
  emits: ["update:modelValue"],
694
- setup(e, { emit: r }) {
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);
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);
699
739
  }));
700
740
  }
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) => {
703
- console.log("file input", d), r("update:modelValue", d);
704
- }, { deep: !0 }), (d, t) => (u(), 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", {
705
747
  class: b(["form-input file-input", "file-input--primary"])
706
748
  }, [
707
- o("input", {
749
+ u("input", {
750
+ ref_key: "input",
751
+ ref: a,
708
752
  type: "file",
709
753
  id: e.id,
710
754
  name: e.name,
711
755
  class: "d-none",
712
- onChange: a,
756
+ onChange: d,
713
757
  multiple: e.multiple,
714
758
  accept: e.accept
715
- }, null, 40, pe),
716
- o("div", be, [
717
- m(d.$slots, "input-prepend"),
718
- o("input", {
759
+ }, null, 40, ge),
760
+ u("div", he, [
761
+ m(l.$slots, "input-prepend"),
762
+ u("input", {
719
763
  type: "text",
720
764
  value: p(n),
721
765
  id: e.id,
722
766
  name: e.name,
723
767
  class: "form-control"
724
- }, null, 8, ge),
725
- m(d.$slots, "input-append", {}, () => [
726
- o("label", {
768
+ }, null, 8, ve),
769
+ m(l.$slots, "input-append", {}, () => [
770
+ u("label", {
727
771
  for: e.id,
728
772
  class: "btn btn-outline-dark"
729
- }, " Select Image ", 8, he)
773
+ }, " Select Image ", 8, $e)
730
774
  ])
731
775
  ]),
732
- m(d.$slots, "label", {}, () => [
733
- o("label", {
776
+ m(l.$slots, "label", {}, () => [
777
+ u("label", {
734
778
  for: e.id,
735
779
  class: "form-input__label",
736
780
  innerHTML: `${e.label}${e.required ? " *" : ""}`
737
- }, null, 8, ve)
781
+ }, null, 8, Se)
738
782
  ])
739
783
  ]));
740
784
  }
741
- }), $e = { class: "media-upload" }, Se = ["src"], xe = ["onClick"], Ve = ["for"];
742
- async function ke(e) {
743
- return await new Promise((r) => {
744
- let a = new FileReader();
745
- a.onload = () => r(a.result), a.readAsDataURL(e);
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);
746
790
  });
747
791
  }
748
- const ze = /* @__PURE__ */ g({
792
+ const Pe = /* @__PURE__ */ g({
749
793
  __name: "media-upload",
750
794
  props: {
751
795
  modelValue: {
@@ -801,65 +845,67 @@ const ze = /* @__PURE__ */ g({
801
845
  }
802
846
  },
803
847
  emits: ["update:modelValue", "update:src"],
804
- setup(e, { emit: r }) {
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) => {
807
- n.value = await Promise.all(
808
- i.value.map(async (f) => ({
809
- src: await ke(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) => ({
853
+ src: await we(f),
810
854
  type: f.type
811
855
  }))
812
856
  );
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);
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);
816
860
  }, { deep: !0 });
817
- function t(i) {
818
- l.value.splice(i, 1);
861
+ function n(l) {
862
+ d.value.splice(l, 1);
819
863
  }
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,
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", {
868
+ key: B.src,
825
869
  class: "media-upload__thumbnail"
826
870
  }, [
827
- o("img", {
828
- src: V.src,
871
+ u("img", {
872
+ src: B.src,
829
873
  class: "img-thumbnail rounded"
830
- }, null, 8, Se),
831
- o("button", {
832
- onClick: I((Be) => t(z), ["prevent"]),
874
+ }, null, 8, Ve),
875
+ u("button", {
876
+ onClick: T((qe) => n(I), ["prevent"]),
833
877
  class: "btn btn--close"
834
878
  }, [
835
- N(f, { symbol: "x" })
836
- ], 8, xe)
879
+ z(f, { symbol: "x" })
880
+ ], 8, ke)
837
881
  ]))), 128)),
838
- N(x, {
839
- modelValue: l.value,
840
- "onUpdate:modelValue": c[0] || (c[0] = (V) => l.value = V),
882
+ z(k, {
883
+ modelValue: d.value,
884
+ "onUpdate:modelValue": s[0] || (s[0] = (B) => d.value = B),
841
885
  id: e.id,
842
886
  name: e.name,
843
887
  accept: e.accept,
844
888
  class: "d-none"
845
889
  }, null, 8, ["modelValue", "id", "name", "accept"]),
846
- o("label", {
890
+ u("label", {
847
891
  for: e.id,
848
892
  class: "btn btn-outline-dark"
849
- }, " Select Image ", 8, Ve)
893
+ }, " Select Image ", 8, Be)
850
894
  ]);
851
895
  };
852
896
  }
853
897
  });
854
898
  export {
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
899
+ ze as BaseButton,
900
+ Ne as BaseHeadline,
901
+ Ue as BaseParagraph,
902
+ Ie as CheckGroup,
903
+ He as FileInput,
904
+ Le as FormInput,
905
+ Ae as InputDropdown,
906
+ Te as InputTextarea,
907
+ Me as LoadingSpinner,
908
+ Pe as MediaUpload,
909
+ De as RadioGroup,
910
+ Ce as SvgIcon
865
911
  };