ablok-components 0.0.38 → 0.0.39
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,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as g, openBlock as r, createElementBlock as s, normalizeClass as
|
|
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";
|
|
2
2
|
const R = {
|
|
3
3
|
class: "icon",
|
|
4
4
|
preserveAspectRatio: "xMaxYMin"
|
|
@@ -24,7 +24,7 @@ const R = {
|
|
|
24
24
|
},
|
|
25
25
|
setup(e) {
|
|
26
26
|
return (i, t) => (r(), s("i", {
|
|
27
|
-
class:
|
|
27
|
+
class: b(["svg-icon", {
|
|
28
28
|
[`svg-icon--${e.size}`]: e.size
|
|
29
29
|
}])
|
|
30
30
|
}, [
|
|
@@ -78,7 +78,7 @@ const E = { class: "loading-spinner d-block" }, j = { class: "loading-spinner__a
|
|
|
78
78
|
}, Y, 8, J)
|
|
79
79
|
]))
|
|
80
80
|
]),
|
|
81
|
-
|
|
81
|
+
m(i.$slots, "default")
|
|
82
82
|
]));
|
|
83
83
|
}
|
|
84
84
|
});
|
|
@@ -88,14 +88,16 @@ const Ne = /* @__PURE__ */ g({
|
|
|
88
88
|
tag: null,
|
|
89
89
|
size: null,
|
|
90
90
|
variant: null,
|
|
91
|
-
text: null
|
|
91
|
+
text: null,
|
|
92
|
+
className: null
|
|
92
93
|
},
|
|
93
94
|
setup(e) {
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
const i = e, t = h(() => i.tag || "p");
|
|
96
|
+
return (l, n) => (r(), C(D(p(t)), {
|
|
97
|
+
class: b(["headline", `headline--${e.size}${e.className || ""}`])
|
|
96
98
|
}, {
|
|
97
99
|
default: A(() => [
|
|
98
|
-
|
|
100
|
+
m(l.$slots, "default", {}, () => [
|
|
99
101
|
x(v(e.text), 1)
|
|
100
102
|
])
|
|
101
103
|
]),
|
|
@@ -112,9 +114,9 @@ const Ne = /* @__PURE__ */ g({
|
|
|
112
114
|
},
|
|
113
115
|
setup(e) {
|
|
114
116
|
return (i, t) => (r(), s("p", {
|
|
115
|
-
class:
|
|
117
|
+
class: b(["base-paragraph", `base-paragraph--${e.size}${e.className || ""}`])
|
|
116
118
|
}, [
|
|
117
|
-
|
|
119
|
+
m(i.$slots, "default", {}, () => [
|
|
118
120
|
x(v(e.text), 1)
|
|
119
121
|
])
|
|
120
122
|
], 2));
|
|
@@ -137,14 +139,14 @@ const Ne = /* @__PURE__ */ g({
|
|
|
137
139
|
},
|
|
138
140
|
setup(e) {
|
|
139
141
|
const i = e, t = h(() => i.caption && !i.fab);
|
|
140
|
-
return (
|
|
142
|
+
return (l, n) => {
|
|
141
143
|
const d = $("svg-icon");
|
|
142
144
|
return r(), s("button", {
|
|
143
145
|
type: e.type,
|
|
144
146
|
disabled: e.disabled,
|
|
145
147
|
href: e.href,
|
|
146
148
|
to: e.to,
|
|
147
|
-
class:
|
|
149
|
+
class: b(["base-button btn btn-primary", {
|
|
148
150
|
disabled: e.disabled,
|
|
149
151
|
pending: e.pending,
|
|
150
152
|
rounded: e.rounded,
|
|
@@ -156,15 +158,15 @@ const Ne = /* @__PURE__ */ g({
|
|
|
156
158
|
"x-small": e.size === "x-small"
|
|
157
159
|
}])
|
|
158
160
|
}, [
|
|
159
|
-
|
|
161
|
+
m(l.$slots, "default", {}, () => [
|
|
160
162
|
e.icon ? (r(), C(d, {
|
|
161
163
|
key: 0,
|
|
162
164
|
id: e.icon,
|
|
163
165
|
class: "base-button__caption"
|
|
164
166
|
}, null, 8, ["id"])) : k("", !0),
|
|
165
|
-
|
|
167
|
+
p(t) ? (r(), s("span", {
|
|
166
168
|
key: 1,
|
|
167
|
-
class:
|
|
169
|
+
class: b(["base-button__caption", { "icon-padding": e.icon }])
|
|
168
170
|
}, v(e.caption), 3)) : k("", !0)
|
|
169
171
|
])
|
|
170
172
|
], 10, K);
|
|
@@ -234,7 +236,7 @@ const Q = { class: "input-group form-input__input-group" }, W = ["type", "id", "
|
|
|
234
236
|
},
|
|
235
237
|
emits: ["update:modelValue"],
|
|
236
238
|
setup(e, { emit: i }) {
|
|
237
|
-
const t = e,
|
|
239
|
+
const t = e, l = h({
|
|
238
240
|
get() {
|
|
239
241
|
return t.modelValue;
|
|
240
242
|
},
|
|
@@ -243,12 +245,12 @@ const Q = { class: "input-group form-input__input-group" }, W = ["type", "id", "
|
|
|
243
245
|
}
|
|
244
246
|
});
|
|
245
247
|
return (n, d) => (r(), s("div", {
|
|
246
|
-
class:
|
|
248
|
+
class: b(["form-input", `form-input--${e.type}`])
|
|
247
249
|
}, [
|
|
248
250
|
o("div", Q, [
|
|
249
|
-
|
|
251
|
+
m(n.$slots, "input-prepend"),
|
|
250
252
|
w(o("input", {
|
|
251
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
253
|
+
"onUpdate:modelValue": d[0] || (d[0] = (a) => q(l) ? l.value = a : null),
|
|
252
254
|
type: e.type === "color" ? "text" : e.type,
|
|
253
255
|
id: e.id,
|
|
254
256
|
name: e.name,
|
|
@@ -259,17 +261,17 @@ const Q = { class: "input-group form-input__input-group" }, W = ["type", "id", "
|
|
|
259
261
|
required: e.required,
|
|
260
262
|
maxlength: e.maxlength,
|
|
261
263
|
checked: e.checked,
|
|
262
|
-
class:
|
|
264
|
+
class: b(["form-control", {
|
|
263
265
|
"form-check-input": e.type === "checkbox"
|
|
264
266
|
}]),
|
|
265
267
|
"aria-label": e.label
|
|
266
268
|
}, null, 10, W), [
|
|
267
|
-
[H,
|
|
269
|
+
[H, p(l)]
|
|
268
270
|
]),
|
|
269
|
-
|
|
271
|
+
m(n.$slots, "input-append", {}, () => [
|
|
270
272
|
e.type === "color" ? (r(), s("span", Z, [
|
|
271
273
|
w(o("input", {
|
|
272
|
-
"onUpdate:modelValue": d[1] || (d[1] = (
|
|
274
|
+
"onUpdate:modelValue": d[1] || (d[1] = (a) => q(l) ? l.value = a : null),
|
|
273
275
|
type: "color",
|
|
274
276
|
name: `${e.name}-color`,
|
|
275
277
|
id: `${e.id}-color`,
|
|
@@ -279,15 +281,15 @@ const Q = { class: "input-group form-input__input-group" }, W = ["type", "id", "
|
|
|
279
281
|
class: "form-control",
|
|
280
282
|
"aria-label": e.label
|
|
281
283
|
}, null, 8, _), [
|
|
282
|
-
[U,
|
|
284
|
+
[U, p(l)]
|
|
283
285
|
])
|
|
284
286
|
])) : k("", !0)
|
|
285
287
|
])
|
|
286
288
|
]),
|
|
287
|
-
|
|
289
|
+
m(n.$slots, "label", {}, () => [
|
|
288
290
|
o("label", {
|
|
289
291
|
for: e.id,
|
|
290
|
-
class:
|
|
292
|
+
class: b(["form-input__label", {
|
|
291
293
|
"form-check-label": e.type === "checkbox"
|
|
292
294
|
}]),
|
|
293
295
|
innerHTML: `${e.label}${e.required ? " *" : ""}`
|
|
@@ -356,7 +358,7 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
356
358
|
},
|
|
357
359
|
emits: ["update:modelValue"],
|
|
358
360
|
setup(e, { emit: i }) {
|
|
359
|
-
const t = e,
|
|
361
|
+
const t = e, l = h({
|
|
360
362
|
get() {
|
|
361
363
|
return t.modelValue;
|
|
362
364
|
},
|
|
@@ -365,9 +367,9 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
365
367
|
}
|
|
366
368
|
});
|
|
367
369
|
return (n, d) => (r(), s("div", te, [
|
|
368
|
-
|
|
370
|
+
m(n.$slots, "input-prepend"),
|
|
369
371
|
w(o("textarea", {
|
|
370
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
372
|
+
"onUpdate:modelValue": d[0] || (d[0] = (a) => q(l) ? l.value = a : null),
|
|
371
373
|
type: e.type === "color" ? "text" : e.type,
|
|
372
374
|
id: e.id,
|
|
373
375
|
name: e.name,
|
|
@@ -377,15 +379,15 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
377
379
|
"read-only": e.readOnly,
|
|
378
380
|
required: e.required,
|
|
379
381
|
maxlength: e.maxlength,
|
|
380
|
-
class:
|
|
382
|
+
class: b(["form-control", {}]),
|
|
381
383
|
"aria-label": e.label
|
|
382
384
|
}, null, 8, le), [
|
|
383
|
-
[U,
|
|
385
|
+
[U, p(l)]
|
|
384
386
|
]),
|
|
385
|
-
|
|
387
|
+
m(n.$slots, "input-append", {}, () => [
|
|
386
388
|
e.type === "color" ? (r(), s("span", ae, [
|
|
387
389
|
w(o("input", {
|
|
388
|
-
"onUpdate:modelValue": d[1] || (d[1] = (
|
|
390
|
+
"onUpdate:modelValue": d[1] || (d[1] = (a) => q(l) ? l.value = a : null),
|
|
389
391
|
type: "color",
|
|
390
392
|
name: `${e.name}-color`,
|
|
391
393
|
id: `${e.id}-color`,
|
|
@@ -395,14 +397,14 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
395
397
|
class: "form-control",
|
|
396
398
|
"aria-label": e.label
|
|
397
399
|
}, null, 8, ne), [
|
|
398
|
-
[U,
|
|
400
|
+
[U, p(l)]
|
|
399
401
|
])
|
|
400
402
|
])) : k("", !0)
|
|
401
403
|
]),
|
|
402
|
-
|
|
404
|
+
m(n.$slots, "label", {}, () => [
|
|
403
405
|
o("label", {
|
|
404
406
|
for: e.id,
|
|
405
|
-
class:
|
|
407
|
+
class: b(["form-input__label", {
|
|
406
408
|
"form-check-label": e.type === "checkbox"
|
|
407
409
|
}]),
|
|
408
410
|
innerHTML: `${e.label}${e.required ? " *" : ""}`
|
|
@@ -451,25 +453,25 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
451
453
|
},
|
|
452
454
|
emits: ["change", "update:modelValue"],
|
|
453
455
|
setup(e, { emit: i }) {
|
|
454
|
-
const t = e,
|
|
456
|
+
const t = e, l = O([]);
|
|
455
457
|
return S(() => t.modelValue, (n, d) => {
|
|
456
|
-
|
|
457
|
-
(
|
|
458
|
+
l.value = t.options.map(
|
|
459
|
+
(a) => a.value ? t.modelValue.some((u) => u["value "] === a.value) : t.modelValue.some((u) => u === a)
|
|
458
460
|
);
|
|
459
|
-
}, { immediate: !0 }), S(
|
|
460
|
-
const
|
|
461
|
-
const V = c && t.options[
|
|
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]] : [];
|
|
462
464
|
return [...u, ...V];
|
|
463
465
|
}, []);
|
|
464
|
-
i("update:modelValue",
|
|
466
|
+
i("update:modelValue", a);
|
|
465
467
|
}, { deep: !0 }), L(() => {
|
|
466
468
|
}), (n, d) => {
|
|
467
|
-
const
|
|
469
|
+
const a = $("form-input");
|
|
468
470
|
return r(), s("div", ie, [
|
|
469
|
-
(r(!0), s(M, null, N(e.options, (u, c) => (r(), C(
|
|
471
|
+
(r(!0), s(M, null, N(e.options, (u, c) => (r(), C(a, {
|
|
470
472
|
key: c,
|
|
471
|
-
modelValue:
|
|
472
|
-
"onUpdate:modelValue": (
|
|
473
|
+
modelValue: p(l)[c],
|
|
474
|
+
"onUpdate:modelValue": (f) => p(l)[c] = f,
|
|
473
475
|
type: "checkbox",
|
|
474
476
|
name: e.name,
|
|
475
477
|
id: `${e.id}-${c}`,
|
|
@@ -479,7 +481,7 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
479
481
|
required: e.required
|
|
480
482
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "name", "id", "label", "disabled", "read-only", "required"]))), 128)),
|
|
481
483
|
o("label", { for: e.id }, [
|
|
482
|
-
|
|
484
|
+
m(n.$slots, "label", {}, () => [
|
|
483
485
|
x(v(e.label), 1)
|
|
484
486
|
])
|
|
485
487
|
], 8, oe)
|
|
@@ -529,14 +531,14 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
529
531
|
setup(e, { emit: i }) {
|
|
530
532
|
const t = e;
|
|
531
533
|
O(t.options.map((n) => n.value === t.modelValue));
|
|
532
|
-
function
|
|
534
|
+
function l(n) {
|
|
533
535
|
i("update:modelValue", n);
|
|
534
536
|
}
|
|
535
537
|
return L(() => {
|
|
536
538
|
}), (n, d) => {
|
|
537
|
-
const
|
|
539
|
+
const a = $("form-input");
|
|
538
540
|
return r(), s("div", ue, [
|
|
539
|
-
(r(!0), s(M, null, N(e.options, (u, c) => (r(), C(
|
|
541
|
+
(r(!0), s(M, null, N(e.options, (u, c) => (r(), C(a, {
|
|
540
542
|
key: c,
|
|
541
543
|
type: "radio",
|
|
542
544
|
name: e.name,
|
|
@@ -547,20 +549,20 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
547
549
|
disabled: e.disabled,
|
|
548
550
|
"read-only": e.readOnly,
|
|
549
551
|
required: e.required,
|
|
550
|
-
onChange: (
|
|
552
|
+
onChange: (f) => l(u)
|
|
551
553
|
}, null, 8, ["name", "id", "value", "label", "checked", "disabled", "read-only", "required", "onChange"]))), 128)),
|
|
552
554
|
o("label", { for: e.id }, [
|
|
553
|
-
|
|
555
|
+
m(n.$slots, "label", {}, () => [
|
|
554
556
|
x(v(e.label), 1)
|
|
555
557
|
])
|
|
556
558
|
], 8, re)
|
|
557
559
|
]);
|
|
558
560
|
};
|
|
559
561
|
}
|
|
560
|
-
}), se = { class: "input input-dropdown" }, ce = { class: "dropdown" },
|
|
562
|
+
}), se = { class: "input input-dropdown" }, ce = { class: "dropdown" }, me = {
|
|
561
563
|
class: "btn-group",
|
|
562
564
|
role: "group"
|
|
563
|
-
},
|
|
565
|
+
}, fe = ["id", "disabled"], ye = ["aria-labelledby"], pe = ["onClick"], be = ["for"], Ae = /* @__PURE__ */ g({
|
|
564
566
|
__name: "input-dropdown",
|
|
565
567
|
props: {
|
|
566
568
|
modelValue: {
|
|
@@ -623,26 +625,26 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
623
625
|
get() {
|
|
624
626
|
return t.modelValue;
|
|
625
627
|
},
|
|
626
|
-
set(
|
|
627
|
-
i("update:modelValue",
|
|
628
|
+
set(a) {
|
|
629
|
+
i("update:modelValue", a);
|
|
628
630
|
}
|
|
629
631
|
});
|
|
630
|
-
function a
|
|
631
|
-
i("update:modelValue",
|
|
632
|
+
function l(a) {
|
|
633
|
+
i("update:modelValue", a);
|
|
632
634
|
}
|
|
633
635
|
const n = h(() => [
|
|
634
636
|
{
|
|
635
637
|
text: "Please select"
|
|
636
638
|
},
|
|
637
639
|
...t.options.map(
|
|
638
|
-
(
|
|
640
|
+
(a) => typeof a == "string" ? { value: a, text: a } : a
|
|
639
641
|
)
|
|
640
|
-
]), d = h(() => [...t.options].find((
|
|
641
|
-
return (
|
|
642
|
+
]), d = h(() => [...t.options].find((a) => JSON.stringify(a.value) === JSON.stringify(t.modelValue)));
|
|
643
|
+
return (a, u) => (r(), s("div", se, [
|
|
642
644
|
o("div", ce, [
|
|
643
|
-
o("div",
|
|
645
|
+
o("div", me, [
|
|
644
646
|
o("button", {
|
|
645
|
-
class:
|
|
647
|
+
class: b(["btn dropdown-toggle", {
|
|
646
648
|
[`btn-${e.variant}`]: e.variant,
|
|
647
649
|
[`btn-${e.color}`]: e.color,
|
|
648
650
|
[`btn-${e.disabled}`]: e.disabled,
|
|
@@ -653,16 +655,16 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
653
655
|
"data-bs-toggle": "dropdown",
|
|
654
656
|
"aria-expanded": "false",
|
|
655
657
|
disabled: e.disabled
|
|
656
|
-
}, v(
|
|
658
|
+
}, v(p(d) ? p(d).text : e.placeholder), 11, fe),
|
|
657
659
|
o("ul", {
|
|
658
660
|
class: "dropdown-menu",
|
|
659
661
|
"aria-labelledby": e.id
|
|
660
662
|
}, [
|
|
661
|
-
(r(!0), s(M, null, N(
|
|
662
|
-
|
|
663
|
+
(r(!0), s(M, null, N(p(n), (c, f) => (r(), s("li", { key: f }, [
|
|
664
|
+
m(a.$slots, "option", {}, () => [
|
|
663
665
|
o("a", {
|
|
664
666
|
class: "dropdown-item",
|
|
665
|
-
onClick: T((V) =>
|
|
667
|
+
onClick: T((V) => l(c.value), ["prevent"])
|
|
666
668
|
}, v(c.text), 9, pe)
|
|
667
669
|
])
|
|
668
670
|
]))), 128))
|
|
@@ -670,7 +672,7 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
670
672
|
])
|
|
671
673
|
]),
|
|
672
674
|
o("label", { for: e.id }, [
|
|
673
|
-
|
|
675
|
+
m(a.$slots, "label", {}, () => [
|
|
674
676
|
x(v(e.label), 1)
|
|
675
677
|
])
|
|
676
678
|
], 8, be)
|
|
@@ -730,16 +732,16 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
730
732
|
emits: ["update:modelValue"],
|
|
731
733
|
setup(e, { emit: i }) {
|
|
732
734
|
function t(d) {
|
|
733
|
-
const
|
|
734
|
-
|
|
735
|
-
|
|
735
|
+
const a = d.target && d.target.files;
|
|
736
|
+
a && (l.splice(0, l.length), Array.from(a).forEach((u) => {
|
|
737
|
+
l.push(u);
|
|
736
738
|
}));
|
|
737
739
|
}
|
|
738
|
-
const
|
|
739
|
-
return h(() =>
|
|
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) => {
|
|
740
742
|
console.log("file input", d), i("update:modelValue", d);
|
|
741
|
-
}, { deep: !0 }), (d,
|
|
742
|
-
class:
|
|
743
|
+
}, { deep: !0 }), (d, a) => (r(), s("div", {
|
|
744
|
+
class: b(["form-input file-input", "file-input--primary"])
|
|
743
745
|
}, [
|
|
744
746
|
o("input", {
|
|
745
747
|
type: "file",
|
|
@@ -751,22 +753,22 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
751
753
|
accept: e.accept
|
|
752
754
|
}, null, 40, ge),
|
|
753
755
|
o("div", he, [
|
|
754
|
-
|
|
756
|
+
m(d.$slots, "input-prepend"),
|
|
755
757
|
o("input", {
|
|
756
758
|
type: "text",
|
|
757
|
-
value:
|
|
759
|
+
value: p(n),
|
|
758
760
|
id: e.id,
|
|
759
761
|
name: e.name,
|
|
760
762
|
class: "form-control"
|
|
761
763
|
}, null, 8, ve),
|
|
762
|
-
|
|
764
|
+
m(d.$slots, "input-append", {}, () => [
|
|
763
765
|
o("label", {
|
|
764
766
|
for: e.id,
|
|
765
767
|
class: "btn btn-outline-dark"
|
|
766
768
|
}, " Select Image ", 8, $e)
|
|
767
769
|
])
|
|
768
770
|
]),
|
|
769
|
-
|
|
771
|
+
m(d.$slots, "label", {}, () => [
|
|
770
772
|
o("label", {
|
|
771
773
|
for: e.id,
|
|
772
774
|
class: "form-input__label",
|
|
@@ -839,25 +841,25 @@ const Pe = /* @__PURE__ */ g({
|
|
|
839
841
|
},
|
|
840
842
|
emits: ["update:modelValue", "update:src"],
|
|
841
843
|
setup(e, { emit: i }) {
|
|
842
|
-
const t = e,
|
|
843
|
-
S(() =>
|
|
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) => {
|
|
844
846
|
n.value = await Promise.all(
|
|
845
|
-
u.value.map(async (
|
|
846
|
-
src: await we(
|
|
847
|
-
type:
|
|
847
|
+
u.value.map(async (f) => ({
|
|
848
|
+
src: await we(f),
|
|
849
|
+
type: f.type
|
|
848
850
|
}))
|
|
849
851
|
);
|
|
850
852
|
}, { deep: !0 }), S(() => n, async (u, c) => {
|
|
851
|
-
const
|
|
852
|
-
i("update:modelValue",
|
|
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);
|
|
853
855
|
}, { deep: !0 });
|
|
854
|
-
function
|
|
855
|
-
|
|
856
|
+
function a(u) {
|
|
857
|
+
l.value.splice(u, 1);
|
|
856
858
|
}
|
|
857
859
|
return (u, c) => {
|
|
858
|
-
const
|
|
860
|
+
const f = $("svg-icon"), V = $("file-input");
|
|
859
861
|
return r(), s("div", xe, [
|
|
860
|
-
(r(!0), s(M, null, N(
|
|
862
|
+
(r(!0), s(M, null, N(p(d), (B, I) => (r(), s("div", {
|
|
861
863
|
key: B.src,
|
|
862
864
|
class: "media-upload__thumbnail"
|
|
863
865
|
}, [
|
|
@@ -866,15 +868,15 @@ const Pe = /* @__PURE__ */ g({
|
|
|
866
868
|
class: "img-thumbnail rounded"
|
|
867
869
|
}, null, 8, Ve),
|
|
868
870
|
o("button", {
|
|
869
|
-
onClick: T((qe) =>
|
|
871
|
+
onClick: T((qe) => a(I), ["prevent"]),
|
|
870
872
|
class: "btn btn--close"
|
|
871
873
|
}, [
|
|
872
|
-
z(
|
|
874
|
+
z(f, { symbol: "x" })
|
|
873
875
|
], 8, Be)
|
|
874
876
|
]))), 128)),
|
|
875
877
|
z(V, {
|
|
876
|
-
modelValue:
|
|
877
|
-
"onUpdate:modelValue": c[0] || (c[0] = (B) =>
|
|
878
|
+
modelValue: l.value,
|
|
879
|
+
"onUpdate:modelValue": c[0] || (c[0] = (B) => l.value = B),
|
|
878
880
|
id: e.id,
|
|
879
881
|
name: e.name,
|
|
880
882
|
accept: e.accept,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(c=typeof globalThis<"u"?globalThis:c||self,e(c.AblokComponents={},c.Vue))})(this,function(c,e){"use strict";const y={class:"icon",preserveAspectRatio:"xMaxYMin"},b=["xlink:href"],g=e.defineComponent({__name:"svg-icon",props:{basePath:{type:String,default:"/symbol-defs.svg"},prefix:{type:String,default:"icon-"},symbol:{type:String,default:""},size:{type:String,default:"default"}},setup(t){return(i,l)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(["svg-icon",{[`svg-icon--${t.size}`]:t.size}])},[(e.openBlock(),e.createElementBlock("svg",y,[e.createElementVNode("use",{"xlink:href":`${t.basePath}#${t.prefix}${t.symbol}`,"xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0",y:"0"},null,8,b)]))],2))}}),fe="",h={class:"loading-spinner d-block"},B={class:"loading-spinner__animation"},$={class:"d-block",version:"1.1",id:"L9",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 100 100","enable-background":"new 0 0 0 0","xml:space":"preserve"},k=["fill"],S=[e.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",dur:"1s",from:"0 50 50",to:"360 50 50",repeatCount:"indefinite"},null,-1)],V=e.defineComponent({__name:"loading-spinner",props:{color:{type:String,default:"#fff"}},setup(t){return(i,l)=>(e.openBlock(),e.createElementBlock("span",h,[e.createElementVNode("span",B,[(e.openBlock(),e.createElementBlock("svg",$,[e.createElementVNode("path",{fill:t.color,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"},S,8,k)]))]),e.renderSlot(i.$slots,"default")]))}}),ye="",x=e.defineComponent({__name:"base-headline",props:{tag:null,size:null,variant:null,text:null},setup(t){return(i,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.tag),{class:e.normalizeClass(["headline",`headline--${t.size}`])},{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])]),_:3},8,["class"]))}}),E=e.defineComponent({__name:"base-paragraph",props:{size:null,variant:null,text:null,className:null},setup(t){return(i,l)=>(e.openBlock(),e.createElementBlock("p",{class:e.normalizeClass(["base-paragraph",`base-paragraph--${t.size} ${t.className}`])},[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])],2))}}),N=["type","disabled","href","to"],C=e.defineComponent({__name:"base-button",props:{type:null,caption:null,variant:null,size:null,icon:null,href:null,to:null,disabled:{type:Boolean},pending:{type:Boolean},outlined:{type:Boolean},rounded:{type:Boolean},fab:{type:Boolean}},setup(t){const i=t,l=e.computed(()=>i.caption&&!i.fab);return(n,o)=>{const d=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("button",{type:t.type,disabled:t.disabled,href:t.href,to:t.to,class:e.normalizeClass(["base-button btn btn-primary",{disabled:t.disabled,pending:t.pending,rounded:t.rounded,outlined:t.outlined,fab:t.fab,"x-large":t.size==="x-large",large:t.size==="large",small:t.size==="small","x-small":t.size==="x-small"}])},[e.renderSlot(n.$slots,"default",{},()=>[t.icon?(e.openBlock(),e.createBlock(d,{key:0,id:t.icon,class:"base-button__caption"},null,8,["id"])):e.createCommentVNode("",!0),e.unref(l)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["base-button__caption",{"icon-padding":t.icon}])},e.toDisplayString(t.caption),3)):e.createCommentVNode("",!0)])],10,N)}}}),be="";function u(){return(new Date().valueOf()+Math.random()).toString(36)}const w={class:"input-group form-input__input-group"},q=["type","id","name","placeholder","pattern","disabled","read-only","required","maxlength","checked","aria-label"],z={key:0,class:"form-input__color-swatch"},M=["name","id","disabled","read-only","required","aria-label"],O=["for","innerHTML"],T=e.defineComponent({__name:"form-input",props:{modelValue:{type:[String,Number,Boolean],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>u()},id:{type:String,default:()=>u()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},maxlength:{type:Number},pattern:{type:String,default:null},checked:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:i}){const l=t,n=e.computed({get(){return l.modelValue},set(o){i("update:modelValue",o)}});return(o,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["form-input",`form-input--${t.type}`])},[e.createElementVNode("div",w,[e.renderSlot(o.$slots,"input-prepend"),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":d[0]||(d[0]=a=>e.isRef(n)?n.value=a:null),type:t.type==="color"?"text":t.type,id:t.id,name:t.name,placeholder:t.placeholder,pattern:t.pattern,disabled:t.disabled,"read-only":t.readOnly,required:t.required,maxlength:t.maxlength,checked:t.checked,class:e.normalizeClass(["form-control",{"form-check-input":t.type==="checkbox"}]),"aria-label":t.label},null,10,q),[[e.vModelDynamic,e.unref(n)]]),e.renderSlot(o.$slots,"input-append",{},()=>[t.type==="color"?(e.openBlock(),e.createElementBlock("span",z,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":d[1]||(d[1]=a=>e.isRef(n)?n.value=a:null),type:"color",name:`${t.name}-color`,id:`${t.id}-color`,disabled:t.disabled,"read-only":t.readOnly,required:t.required,class:"form-control","aria-label":t.label},null,8,M),[[e.vModelText,e.unref(n)]])])):e.createCommentVNode("",!0)])]),e.renderSlot(o.$slots,"label",{},()=>[e.createElementVNode("label",{for:t.id,class:e.normalizeClass(["form-input__label",{"form-check-label":t.type==="checkbox"}]),innerHTML:`${t.label}${t.required?" *":""}`},null,10,O)])],2))}}),ge="",D={class:"form-input form-input--textarea"},L=["type","id","name","placeholder","pattern","disabled","read-only","required","maxlength","aria-label"],U={key:0,class:"form-input__color-swatch"},I=["name","id","disabled","read-only","required","aria-label"],R=["for","innerHTML"],A=e.defineComponent({__name:"input-textarea",props:{modelValue:{type:String,default:""},type:{type:String,default:"text"},name:{type:String,default:()=>u()},id:{type:String,default:()=>u()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},maxlength:{type:Number},pattern:{type:String,default:null},checked:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:i}){const l=t,n=e.computed({get(){return l.modelValue},set(o){i("update:modelValue",o)}});return(o,d)=>(e.openBlock(),e.createElementBlock("div",D,[e.renderSlot(o.$slots,"input-prepend"),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":d[0]||(d[0]=a=>e.isRef(n)?n.value=a:null),type:t.type==="color"?"text":t.type,id:t.id,name:t.name,placeholder:t.placeholder,pattern:t.pattern,disabled:t.disabled,"read-only":t.readOnly,required:t.required,maxlength:t.maxlength,class:e.normalizeClass(["form-control",{}]),"aria-label":t.label},null,8,L),[[e.vModelText,e.unref(n)]]),e.renderSlot(o.$slots,"input-append",{},()=>[t.type==="color"?(e.openBlock(),e.createElementBlock("span",U,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":d[1]||(d[1]=a=>e.isRef(n)?n.value=a:null),type:"color",name:`${t.name}-color`,id:`${t.id}-color`,disabled:t.disabled,"read-only":t.readOnly,required:t.required,class:"form-control","aria-label":t.label},null,8,I),[[e.vModelText,e.unref(n)]])])):e.createCommentVNode("",!0)]),e.renderSlot(o.$slots,"label",{},()=>[e.createElementVNode("label",{for:t.id,class:e.normalizeClass(["form-input__label",{"form-check-label":t.type==="checkbox"}]),innerHTML:`${t.label}${t.required?" *":""}`},null,10,R)])]))}}),F={class:"radio-group"},P=["for"],H=e.defineComponent({__name:"check-group",props:{modelValue:{default:[]},options:{type:Array,default:[]},name:{type:String,default:()=>u()},id:{type:String,default:()=>u()},label:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},emits:["change","update:modelValue"],setup(t,{emit:i}){const l=t,n=e.ref([]);return e.watch(()=>l.modelValue,(o,d)=>{n.value=l.options.map(a=>a.value?l.modelValue.some(r=>r["value "]===a.value):l.modelValue.some(r=>r===a))},{immediate:!0}),e.watch(n,(o,d)=>{const a=o.reduce((r,s,m)=>{const f=s&&l.options[m]?[l.options[m]||l.options[m]]:[];return[...r,...f]},[]);i("update:modelValue",a)},{deep:!0}),e.onBeforeMount(()=>{}),(o,d)=>{const a=e.resolveComponent("form-input");return e.openBlock(),e.createElementBlock("div",F,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,(r,s)=>(e.openBlock(),e.createBlock(a,{key:s,modelValue:e.unref(n)[s],"onUpdate:modelValue":m=>e.unref(n)[s]=m,type:"checkbox",name:t.name,id:`${t.id}-${s}`,label:`${r.text||r}${t.required?" *":""}`,disabled:t.disabled,"read-only":t.readOnly,required:t.required},null,8,["modelValue","onUpdate:modelValue","name","id","label","disabled","read-only","required"]))),128)),e.createElementVNode("label",{for:t.id},[e.renderSlot(o.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])],8,P)])}}}),j={class:"radio-group"},G=["for"],J=e.defineComponent({__name:"radio-group",props:{modelValue:{default:!1},options:{type:Array,default:[]},name:{type:String,default:()=>u()},id:{type:String,default:()=>u()},label:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},emits:["change","update:modelValue"],setup(t,{emit:i}){const l=t;e.ref(l.options.map(o=>o.value===l.modelValue));function n(o){i("update:modelValue",o)}return e.onBeforeMount(()=>{}),(o,d)=>{const a=e.resolveComponent("form-input");return e.openBlock(),e.createElementBlock("div",j,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,(r,s)=>(e.openBlock(),e.createBlock(a,{key:s,type:"radio",name:t.name,id:`${t.id}-${s}`,value:r.value||r,label:`${r.text||r}${t.required?" *":""}`,checked:r.value?r.value===t.modelValue:r===t.modelValue,disabled:t.disabled,"read-only":t.readOnly,required:t.required,onChange:m=>n(r)},null,8,["name","id","value","label","checked","disabled","read-only","required","onChange"]))),128)),e.createElementVNode("label",{for:t.id},[e.renderSlot(o.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])],8,G)])}}}),X={class:"input input-dropdown"},Y={class:"dropdown"},K={class:"btn-group",role:"group"},Q=["id","disabled"],W=["aria-labelledby"],Z=["onClick"],_=["for"],v=e.defineComponent({__name:"input-dropdown",props:{modelValue:{type:[String,Number,Boolean,Object],default:""},name:{type:String,default:()=>u()},id:{type:String,default:()=>u()},label:{type:String,default:""},placeholder:{type:String,default:"Please select"},options:{type:Array,default:[]},variant:{type:String,default:""},color:{type:String,default:""},disabled:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},required:{type:Boolean,default:!1},outline:{type:Boolean,default:!0},resetOption:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:i}){const l=t;e.computed({get(){return l.modelValue},set(a){i("update:modelValue",a)}});function n(a){i("update:modelValue",a)}const o=e.computed(()=>[{text:"Please select"},...l.options.map(a=>typeof a=="string"?{value:a,text:a}:a)]),d=e.computed(()=>[...l.options].find(a=>JSON.stringify(a.value)===JSON.stringify(l.modelValue)));return(a,r)=>(e.openBlock(),e.createElementBlock("div",X,[e.createElementVNode("div",Y,[e.createElementVNode("div",K,[e.createElementVNode("button",{class:e.normalizeClass(["btn dropdown-toggle",{[`btn-${t.variant}`]:t.variant,[`btn-${t.color}`]:t.color,[`btn-${t.disabled}`]:t.disabled,[`btn-outline-${t.color||"dark"}`]:t.outline}]),type:"button",id:t.id,"data-bs-toggle":"dropdown","aria-expanded":"false",disabled:t.disabled},e.toDisplayString(e.unref(d)?e.unref(d).text:t.placeholder),11,Q),e.createElementVNode("ul",{class:"dropdown-menu","aria-labelledby":t.id},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),(s,m)=>(e.openBlock(),e.createElementBlock("li",{key:m},[e.renderSlot(a.$slots,"option",{},()=>[e.createElementVNode("a",{class:"dropdown-item",onClick:e.withModifiers(f=>n(s.value),["prevent"])},e.toDisplayString(s.text),9,Z)])]))),128))],8,W)])]),e.createElementVNode("label",{for:t.id},[e.renderSlot(a.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])],8,_)]))}}),ee=["id","name","multiple","accept"],te={class:"form-input__input-group input-group"},le=["value","id","name"],ae=["for"],ne=["for","innerHTML"],oe=e.defineComponent({__name:"file-input",props:{modelValue:{type:Array,default:[]},name:{type:String,default:()=>u()},id:{type:String,default:()=>u()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},pattern:{type:String,default:null},multiple:{type:Boolean,default:!1},accept:{type:String}},emits:["update:modelValue"],setup(t,{emit:i}){function l(d){const a=d.target&&d.target.files;a&&(n.splice(0,n.length),Array.from(a).forEach(r=>{n.push(r)}))}const n=e.reactive([]),o=e.computed(()=>n&&n.map(d=>d.name));return e.computed(()=>n.map(d=>URL.createObjectURL(d))),e.watch(()=>n,(d,a)=>{console.log("file input",d),i("update:modelValue",d)},{deep:!0}),(d,a)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["form-input file-input","file-input--primary"])},[e.createElementVNode("input",{type:"file",id:t.id,name:t.name,class:"d-none",onChange:l,multiple:t.multiple,accept:t.accept},null,40,ee),e.createElementVNode("div",te,[e.renderSlot(d.$slots,"input-prepend"),e.createElementVNode("input",{type:"text",value:e.unref(o),id:t.id,name:t.name,class:"form-control"},null,8,le),e.renderSlot(d.$slots,"input-append",{},()=>[e.createElementVNode("label",{for:t.id,class:"btn btn-outline-dark"}," Select Image ",8,ae)])]),e.renderSlot(d.$slots,"label",{},()=>[e.createElementVNode("label",{for:t.id,class:"form-input__label",innerHTML:`${t.label}${t.required?" *":""}`},null,8,ne)])]))}}),de={class:"media-upload"},ie=["src"],re=["onClick"],ce=["for"];async function se(t){return await new Promise(i=>{let l=new FileReader;l.onload=()=>i(l.result),l.readAsDataURL(t)})}const me=e.defineComponent({__name:"media-upload",props:{modelValue:{type:Array,default:[]},src:{type:String},name:{type:String,default:()=>u()},id:{type:String,default:()=>u()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},pattern:{type:String,default:null},multiple:{type:Boolean,default:!1},accept:{type:String,default:"image/*"}},emits:["update:modelValue","update:src"],setup(t,{emit:i}){const l=t,n=e.ref([]),o=e.ref([]),d=e.computed(()=>l.modelValue.length?l.modelValue:l.src?[{type:"",src:l.src}]:o.value);e.watch(()=>n,async(r,s)=>{o.value=await Promise.all(r.value.map(async m=>({src:await se(m),type:m.type})))},{deep:!0}),e.watch(()=>o,async(r,s)=>{const m=l.multiple?o.value:[o.value[0]];i("update:modelValue",m),l.multiple||i("update:src",o.value[0]&&o.value[0].src)},{deep:!0});function a(r){n.value.splice(r,1)}return(r,s)=>{const m=e.resolveComponent("svg-icon"),f=e.resolveComponent("file-input");return e.openBlock(),e.createElementBlock("div",de,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(p,ue)=>(e.openBlock(),e.createElementBlock("div",{key:p.src,class:"media-upload__thumbnail"},[e.createElementVNode("img",{src:p.src,class:"img-thumbnail rounded"},null,8,ie),e.createElementVNode("button",{onClick:e.withModifiers(Be=>a(ue),["prevent"]),class:"btn btn--close"},[e.createVNode(m,{symbol:"x"})],8,re)]))),128)),e.createVNode(f,{modelValue:n.value,"onUpdate:modelValue":s[0]||(s[0]=p=>n.value=p),id:t.id,name:t.name,accept:t.accept,class:"d-none"},null,8,["modelValue","id","name","accept"]),e.createElementVNode("label",{for:t.id,class:"btn btn-outline-dark"}," Select Image ",8,ce)])}}}),he="";c.BaseButton=C,c.BaseHeadline=x,c.BaseParagraph=E,c.CheckGroup=H,c.FileInput=oe,c.FormInput=T,c.InputDropdown=v,c.InputTextarea=A,c.LoadingSpinner=V,c.MediaUpload=me,c.RadioGroup=J,c.SvgIcon=g,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(c,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(c=typeof globalThis<"u"?globalThis:c||self,e(c.AblokComponents={},c.Vue))})(this,function(c,e){"use strict";const y={class:"icon",preserveAspectRatio:"xMaxYMin"},b=["xlink:href"],g=e.defineComponent({__name:"svg-icon",props:{basePath:{type:String,default:"/symbol-defs.svg"},prefix:{type:String,default:"icon-"},symbol:{type:String,default:""},size:{type:String,default:"default"}},setup(t){return(i,l)=>(e.openBlock(),e.createElementBlock("i",{class:e.normalizeClass(["svg-icon",{[`svg-icon--${t.size}`]:t.size}])},[(e.openBlock(),e.createElementBlock("svg",y,[e.createElementVNode("use",{"xlink:href":`${t.basePath}#${t.prefix}${t.symbol}`,"xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0",y:"0"},null,8,b)]))],2))}}),fe="",h={class:"loading-spinner d-block"},$={class:"loading-spinner__animation"},B={class:"d-block",version:"1.1",id:"L9",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 100 100","enable-background":"new 0 0 0 0","xml:space":"preserve"},k=["fill"],S=[e.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",dur:"1s",from:"0 50 50",to:"360 50 50",repeatCount:"indefinite"},null,-1)],V=e.defineComponent({__name:"loading-spinner",props:{color:{type:String,default:"#fff"}},setup(t){return(i,l)=>(e.openBlock(),e.createElementBlock("span",h,[e.createElementVNode("span",$,[(e.openBlock(),e.createElementBlock("svg",B,[e.createElementVNode("path",{fill:t.color,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"},S,8,k)]))]),e.renderSlot(i.$slots,"default")]))}}),ye="",x=e.defineComponent({__name:"base-headline",props:{tag:null,size:null,variant:null,text:null,className:null},setup(t){const i=t,l=e.computed(()=>i.tag||"p");return(a,o)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(l)),{class:e.normalizeClass(["headline",`headline--${t.size}${t.className||""}`])},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])]),_:3},8,["class"]))}}),E=e.defineComponent({__name:"base-paragraph",props:{size:null,variant:null,text:null,className:null},setup(t){return(i,l)=>(e.openBlock(),e.createElementBlock("p",{class:e.normalizeClass(["base-paragraph",`base-paragraph--${t.size}${t.className||""}`])},[e.renderSlot(i.$slots,"default",{},()=>[e.createTextVNode(e.toDisplayString(t.text),1)])],2))}}),N=["type","disabled","href","to"],C=e.defineComponent({__name:"base-button",props:{type:null,caption:null,variant:null,size:null,icon:null,href:null,to:null,disabled:{type:Boolean},pending:{type:Boolean},outlined:{type:Boolean},rounded:{type:Boolean},fab:{type:Boolean}},setup(t){const i=t,l=e.computed(()=>i.caption&&!i.fab);return(a,o)=>{const d=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("button",{type:t.type,disabled:t.disabled,href:t.href,to:t.to,class:e.normalizeClass(["base-button btn btn-primary",{disabled:t.disabled,pending:t.pending,rounded:t.rounded,outlined:t.outlined,fab:t.fab,"x-large":t.size==="x-large",large:t.size==="large",small:t.size==="small","x-small":t.size==="x-small"}])},[e.renderSlot(a.$slots,"default",{},()=>[t.icon?(e.openBlock(),e.createBlock(d,{key:0,id:t.icon,class:"base-button__caption"},null,8,["id"])):e.createCommentVNode("",!0),e.unref(l)?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(["base-button__caption",{"icon-padding":t.icon}])},e.toDisplayString(t.caption),3)):e.createCommentVNode("",!0)])],10,N)}}}),be="";function u(){return(new Date().valueOf()+Math.random()).toString(36)}const w={class:"input-group form-input__input-group"},q=["type","id","name","placeholder","pattern","disabled","read-only","required","maxlength","checked","aria-label"],z={key:0,class:"form-input__color-swatch"},M=["name","id","disabled","read-only","required","aria-label"],O=["for","innerHTML"],T=e.defineComponent({__name:"form-input",props:{modelValue:{type:[String,Number,Boolean],default:""},type:{type:String,default:"text"},name:{type:String,default:()=>u()},id:{type:String,default:()=>u()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},maxlength:{type:Number},pattern:{type:String,default:null},checked:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:i}){const l=t,a=e.computed({get(){return l.modelValue},set(o){i("update:modelValue",o)}});return(o,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["form-input",`form-input--${t.type}`])},[e.createElementVNode("div",w,[e.renderSlot(o.$slots,"input-prepend"),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":d[0]||(d[0]=n=>e.isRef(a)?a.value=n:null),type:t.type==="color"?"text":t.type,id:t.id,name:t.name,placeholder:t.placeholder,pattern:t.pattern,disabled:t.disabled,"read-only":t.readOnly,required:t.required,maxlength:t.maxlength,checked:t.checked,class:e.normalizeClass(["form-control",{"form-check-input":t.type==="checkbox"}]),"aria-label":t.label},null,10,q),[[e.vModelDynamic,e.unref(a)]]),e.renderSlot(o.$slots,"input-append",{},()=>[t.type==="color"?(e.openBlock(),e.createElementBlock("span",z,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":d[1]||(d[1]=n=>e.isRef(a)?a.value=n:null),type:"color",name:`${t.name}-color`,id:`${t.id}-color`,disabled:t.disabled,"read-only":t.readOnly,required:t.required,class:"form-control","aria-label":t.label},null,8,M),[[e.vModelText,e.unref(a)]])])):e.createCommentVNode("",!0)])]),e.renderSlot(o.$slots,"label",{},()=>[e.createElementVNode("label",{for:t.id,class:e.normalizeClass(["form-input__label",{"form-check-label":t.type==="checkbox"}]),innerHTML:`${t.label}${t.required?" *":""}`},null,10,O)])],2))}}),ge="",D={class:"form-input form-input--textarea"},L=["type","id","name","placeholder","pattern","disabled","read-only","required","maxlength","aria-label"],U={key:0,class:"form-input__color-swatch"},I=["name","id","disabled","read-only","required","aria-label"],R=["for","innerHTML"],A=e.defineComponent({__name:"input-textarea",props:{modelValue:{type:String,default:""},type:{type:String,default:"text"},name:{type:String,default:()=>u()},id:{type:String,default:()=>u()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},maxlength:{type:Number},pattern:{type:String,default:null},checked:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:i}){const l=t,a=e.computed({get(){return l.modelValue},set(o){i("update:modelValue",o)}});return(o,d)=>(e.openBlock(),e.createElementBlock("div",D,[e.renderSlot(o.$slots,"input-prepend"),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":d[0]||(d[0]=n=>e.isRef(a)?a.value=n:null),type:t.type==="color"?"text":t.type,id:t.id,name:t.name,placeholder:t.placeholder,pattern:t.pattern,disabled:t.disabled,"read-only":t.readOnly,required:t.required,maxlength:t.maxlength,class:e.normalizeClass(["form-control",{}]),"aria-label":t.label},null,8,L),[[e.vModelText,e.unref(a)]]),e.renderSlot(o.$slots,"input-append",{},()=>[t.type==="color"?(e.openBlock(),e.createElementBlock("span",U,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":d[1]||(d[1]=n=>e.isRef(a)?a.value=n:null),type:"color",name:`${t.name}-color`,id:`${t.id}-color`,disabled:t.disabled,"read-only":t.readOnly,required:t.required,class:"form-control","aria-label":t.label},null,8,I),[[e.vModelText,e.unref(a)]])])):e.createCommentVNode("",!0)]),e.renderSlot(o.$slots,"label",{},()=>[e.createElementVNode("label",{for:t.id,class:e.normalizeClass(["form-input__label",{"form-check-label":t.type==="checkbox"}]),innerHTML:`${t.label}${t.required?" *":""}`},null,10,R)])]))}}),F={class:"radio-group"},P=["for"],H=e.defineComponent({__name:"check-group",props:{modelValue:{default:[]},options:{type:Array,default:[]},name:{type:String,default:()=>u()},id:{type:String,default:()=>u()},label:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},emits:["change","update:modelValue"],setup(t,{emit:i}){const l=t,a=e.ref([]);return e.watch(()=>l.modelValue,(o,d)=>{a.value=l.options.map(n=>n.value?l.modelValue.some(r=>r["value "]===n.value):l.modelValue.some(r=>r===n))},{immediate:!0}),e.watch(a,(o,d)=>{const n=o.reduce((r,s,m)=>{const f=s&&l.options[m]?[l.options[m]||l.options[m]]:[];return[...r,...f]},[]);i("update:modelValue",n)},{deep:!0}),e.onBeforeMount(()=>{}),(o,d)=>{const n=e.resolveComponent("form-input");return e.openBlock(),e.createElementBlock("div",F,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,(r,s)=>(e.openBlock(),e.createBlock(n,{key:s,modelValue:e.unref(a)[s],"onUpdate:modelValue":m=>e.unref(a)[s]=m,type:"checkbox",name:t.name,id:`${t.id}-${s}`,label:`${r.text||r}${t.required?" *":""}`,disabled:t.disabled,"read-only":t.readOnly,required:t.required},null,8,["modelValue","onUpdate:modelValue","name","id","label","disabled","read-only","required"]))),128)),e.createElementVNode("label",{for:t.id},[e.renderSlot(o.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])],8,P)])}}}),j={class:"radio-group"},G=["for"],J=e.defineComponent({__name:"radio-group",props:{modelValue:{default:!1},options:{type:Array,default:[]},name:{type:String,default:()=>u()},id:{type:String,default:()=>u()},label:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1}},emits:["change","update:modelValue"],setup(t,{emit:i}){const l=t;e.ref(l.options.map(o=>o.value===l.modelValue));function a(o){i("update:modelValue",o)}return e.onBeforeMount(()=>{}),(o,d)=>{const n=e.resolveComponent("form-input");return e.openBlock(),e.createElementBlock("div",j,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,(r,s)=>(e.openBlock(),e.createBlock(n,{key:s,type:"radio",name:t.name,id:`${t.id}-${s}`,value:r.value||r,label:`${r.text||r}${t.required?" *":""}`,checked:r.value?r.value===t.modelValue:r===t.modelValue,disabled:t.disabled,"read-only":t.readOnly,required:t.required,onChange:m=>a(r)},null,8,["name","id","value","label","checked","disabled","read-only","required","onChange"]))),128)),e.createElementVNode("label",{for:t.id},[e.renderSlot(o.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])],8,G)])}}}),X={class:"input input-dropdown"},Y={class:"dropdown"},K={class:"btn-group",role:"group"},Q=["id","disabled"],W=["aria-labelledby"],Z=["onClick"],_=["for"],v=e.defineComponent({__name:"input-dropdown",props:{modelValue:{type:[String,Number,Boolean,Object],default:""},name:{type:String,default:()=>u()},id:{type:String,default:()=>u()},label:{type:String,default:""},placeholder:{type:String,default:"Please select"},options:{type:Array,default:[]},variant:{type:String,default:""},color:{type:String,default:""},disabled:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},required:{type:Boolean,default:!1},outline:{type:Boolean,default:!0},resetOption:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:i}){const l=t;e.computed({get(){return l.modelValue},set(n){i("update:modelValue",n)}});function a(n){i("update:modelValue",n)}const o=e.computed(()=>[{text:"Please select"},...l.options.map(n=>typeof n=="string"?{value:n,text:n}:n)]),d=e.computed(()=>[...l.options].find(n=>JSON.stringify(n.value)===JSON.stringify(l.modelValue)));return(n,r)=>(e.openBlock(),e.createElementBlock("div",X,[e.createElementVNode("div",Y,[e.createElementVNode("div",K,[e.createElementVNode("button",{class:e.normalizeClass(["btn dropdown-toggle",{[`btn-${t.variant}`]:t.variant,[`btn-${t.color}`]:t.color,[`btn-${t.disabled}`]:t.disabled,[`btn-outline-${t.color||"dark"}`]:t.outline}]),type:"button",id:t.id,"data-bs-toggle":"dropdown","aria-expanded":"false",disabled:t.disabled},e.toDisplayString(e.unref(d)?e.unref(d).text:t.placeholder),11,Q),e.createElementVNode("ul",{class:"dropdown-menu","aria-labelledby":t.id},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),(s,m)=>(e.openBlock(),e.createElementBlock("li",{key:m},[e.renderSlot(n.$slots,"option",{},()=>[e.createElementVNode("a",{class:"dropdown-item",onClick:e.withModifiers(f=>a(s.value),["prevent"])},e.toDisplayString(s.text),9,Z)])]))),128))],8,W)])]),e.createElementVNode("label",{for:t.id},[e.renderSlot(n.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])],8,_)]))}}),ee=["id","name","multiple","accept"],te={class:"form-input__input-group input-group"},le=["value","id","name"],ae=["for"],ne=["for","innerHTML"],oe=e.defineComponent({__name:"file-input",props:{modelValue:{type:Array,default:[]},name:{type:String,default:()=>u()},id:{type:String,default:()=>u()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},pattern:{type:String,default:null},multiple:{type:Boolean,default:!1},accept:{type:String}},emits:["update:modelValue"],setup(t,{emit:i}){function l(d){const n=d.target&&d.target.files;n&&(a.splice(0,a.length),Array.from(n).forEach(r=>{a.push(r)}))}const a=e.reactive([]),o=e.computed(()=>a&&a.map(d=>d.name));return e.computed(()=>a.map(d=>URL.createObjectURL(d))),e.watch(()=>a,(d,n)=>{console.log("file input",d),i("update:modelValue",d)},{deep:!0}),(d,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["form-input file-input","file-input--primary"])},[e.createElementVNode("input",{type:"file",id:t.id,name:t.name,class:"d-none",onChange:l,multiple:t.multiple,accept:t.accept},null,40,ee),e.createElementVNode("div",te,[e.renderSlot(d.$slots,"input-prepend"),e.createElementVNode("input",{type:"text",value:e.unref(o),id:t.id,name:t.name,class:"form-control"},null,8,le),e.renderSlot(d.$slots,"input-append",{},()=>[e.createElementVNode("label",{for:t.id,class:"btn btn-outline-dark"}," Select Image ",8,ae)])]),e.renderSlot(d.$slots,"label",{},()=>[e.createElementVNode("label",{for:t.id,class:"form-input__label",innerHTML:`${t.label}${t.required?" *":""}`},null,8,ne)])]))}}),de={class:"media-upload"},ie=["src"],re=["onClick"],ce=["for"];async function se(t){return await new Promise(i=>{let l=new FileReader;l.onload=()=>i(l.result),l.readAsDataURL(t)})}const me=e.defineComponent({__name:"media-upload",props:{modelValue:{type:Array,default:[]},src:{type:String},name:{type:String,default:()=>u()},id:{type:String,default:()=>u()},label:{type:String,default:""},placeholder:{type:String,default:""},variant:{type:String,default:""},disabled:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},pattern:{type:String,default:null},multiple:{type:Boolean,default:!1},accept:{type:String,default:"image/*"}},emits:["update:modelValue","update:src"],setup(t,{emit:i}){const l=t,a=e.ref([]),o=e.ref([]),d=e.computed(()=>l.modelValue.length?l.modelValue:l.src?[{type:"",src:l.src}]:o.value);e.watch(()=>a,async(r,s)=>{o.value=await Promise.all(r.value.map(async m=>({src:await se(m),type:m.type})))},{deep:!0}),e.watch(()=>o,async(r,s)=>{const m=l.multiple?o.value:[o.value[0]];i("update:modelValue",m),l.multiple||i("update:src",o.value[0]&&o.value[0].src)},{deep:!0});function n(r){a.value.splice(r,1)}return(r,s)=>{const m=e.resolveComponent("svg-icon"),f=e.resolveComponent("file-input");return e.openBlock(),e.createElementBlock("div",de,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(p,ue)=>(e.openBlock(),e.createElementBlock("div",{key:p.src,class:"media-upload__thumbnail"},[e.createElementVNode("img",{src:p.src,class:"img-thumbnail rounded"},null,8,ie),e.createElementVNode("button",{onClick:e.withModifiers($e=>n(ue),["prevent"]),class:"btn btn--close"},[e.createVNode(m,{symbol:"x"})],8,re)]))),128)),e.createVNode(f,{modelValue:a.value,"onUpdate:modelValue":s[0]||(s[0]=p=>a.value=p),id:t.id,name:t.name,accept:t.accept,class:"d-none"},null,8,["modelValue","id","name","accept"]),e.createElementVNode("label",{for:t.id,class:"btn btn-outline-dark"}," Select Image ",8,ce)])}}}),he="";c.BaseButton=C,c.BaseHeadline=x,c.BaseParagraph=E,c.CheckGroup=H,c.FileInput=oe,c.FormInput=T,c.InputDropdown=v,c.InputTextarea=A,c.LoadingSpinner=V,c.MediaUpload=me,c.RadioGroup=J,c.SvgIcon=g,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -7,6 +7,7 @@ declare const _default: {
|
|
|
7
7
|
size?: string | undefined;
|
|
8
8
|
variant?: string | undefined;
|
|
9
9
|
text?: string | undefined;
|
|
10
|
+
className?: string | undefined;
|
|
10
11
|
}>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
11
12
|
$attrs: {
|
|
12
13
|
[x: string]: unknown;
|
|
@@ -26,6 +27,7 @@ declare const _default: {
|
|
|
26
27
|
size?: string | undefined;
|
|
27
28
|
variant?: string | undefined;
|
|
28
29
|
text?: string | undefined;
|
|
30
|
+
className?: string | undefined;
|
|
29
31
|
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & {
|
|
30
32
|
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
31
33
|
created?: ((() => void) | (() => void)[]) | undefined;
|
|
@@ -51,6 +53,7 @@ declare const _default: {
|
|
|
51
53
|
size?: string | undefined;
|
|
52
54
|
variant?: string | undefined;
|
|
53
55
|
text?: string | undefined;
|
|
56
|
+
className?: string | undefined;
|
|
54
57
|
}>>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
55
58
|
__isFragment?: undefined;
|
|
56
59
|
__isTeleport?: undefined;
|
|
@@ -60,6 +63,7 @@ declare const _default: {
|
|
|
60
63
|
size?: string | undefined;
|
|
61
64
|
variant?: string | undefined;
|
|
62
65
|
text?: string | undefined;
|
|
66
|
+
className?: string | undefined;
|
|
63
67
|
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
64
68
|
$slots: {
|
|
65
69
|
default: (_: {}) => any;
|