ablok-components 0.0.37 → 0.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as g, openBlock as
|
|
1
|
+
import { defineComponent as g, openBlock as r, createElementBlock as s, normalizeClass as p, createElementVNode as o, renderSlot as f, createBlock as C, resolveDynamicComponent as D, withCtx as A, createTextVNode as x, toDisplayString as v, computed as h, resolveComponent as $, createCommentVNode as k, unref as b, 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"
|
|
5
|
-
}, F = ["xlink:href"],
|
|
5
|
+
}, F = ["xlink:href"], Ce = /* @__PURE__ */ g({
|
|
6
6
|
__name: "svg-icon",
|
|
7
7
|
props: {
|
|
8
8
|
basePath: {
|
|
@@ -23,12 +23,12 @@ const R = {
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
setup(e) {
|
|
26
|
-
return (
|
|
27
|
-
class:
|
|
26
|
+
return (i, t) => (r(), s("i", {
|
|
27
|
+
class: p(["svg-icon", {
|
|
28
28
|
[`svg-icon--${e.size}`]: e.size
|
|
29
29
|
}])
|
|
30
30
|
}, [
|
|
31
|
-
(
|
|
31
|
+
(r(), s("svg", R, [
|
|
32
32
|
o("use", {
|
|
33
33
|
"xlink:href": `${e.basePath}#${e.prefix}${e.symbol}`,
|
|
34
34
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
@@ -39,7 +39,7 @@ const R = {
|
|
|
39
39
|
], 2));
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
const
|
|
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
|
-
},
|
|
53
|
+
}, J = ["fill"], X = /* @__PURE__ */ o("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),
|
|
62
|
-
|
|
63
|
-
],
|
|
61
|
+
}, null, -1), Y = [
|
|
62
|
+
X
|
|
63
|
+
], Me = /* @__PURE__ */ g({
|
|
64
64
|
__name: "loading-spinner",
|
|
65
65
|
props: {
|
|
66
66
|
color: {
|
|
@@ -69,20 +69,57 @@ const H = { class: "loading-spinner d-block" }, P = { class: "loading-spinner__a
|
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
setup(e) {
|
|
72
|
-
return (
|
|
73
|
-
o("span",
|
|
74
|
-
(
|
|
72
|
+
return (i, t) => (r(), s("span", E, [
|
|
73
|
+
o("span", j, [
|
|
74
|
+
(r(), s("svg", G, [
|
|
75
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
|
+
}, Y, 8, J)
|
|
79
79
|
]))
|
|
80
80
|
]),
|
|
81
|
-
|
|
81
|
+
f(i.$slots, "default")
|
|
82
82
|
]));
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
|
-
const
|
|
85
|
+
const Ne = /* @__PURE__ */ g({
|
|
86
|
+
__name: "base-headline",
|
|
87
|
+
props: {
|
|
88
|
+
tag: null,
|
|
89
|
+
size: null,
|
|
90
|
+
variant: null,
|
|
91
|
+
text: null
|
|
92
|
+
},
|
|
93
|
+
setup(e) {
|
|
94
|
+
return (i, t) => (r(), C(D(e.tag), {
|
|
95
|
+
class: p(["headline", `headline--${e.size}`])
|
|
96
|
+
}, {
|
|
97
|
+
default: A(() => [
|
|
98
|
+
f(i.$slots, "default", {}, () => [
|
|
99
|
+
x(v(e.text), 1)
|
|
100
|
+
])
|
|
101
|
+
]),
|
|
102
|
+
_: 3
|
|
103
|
+
}, 8, ["class"]));
|
|
104
|
+
}
|
|
105
|
+
}), Ue = /* @__PURE__ */ g({
|
|
106
|
+
__name: "base-paragraph",
|
|
107
|
+
props: {
|
|
108
|
+
size: null,
|
|
109
|
+
variant: null,
|
|
110
|
+
text: null,
|
|
111
|
+
className: null
|
|
112
|
+
},
|
|
113
|
+
setup(e) {
|
|
114
|
+
return (i, t) => (r(), s("p", {
|
|
115
|
+
class: p(["base-paragraph", `base-paragraph--${e.size} ${e.className}`])
|
|
116
|
+
}, [
|
|
117
|
+
f(i.$slots, "default", {}, () => [
|
|
118
|
+
x(v(e.text), 1)
|
|
119
|
+
])
|
|
120
|
+
], 2));
|
|
121
|
+
}
|
|
122
|
+
}), K = ["type", "disabled", "href", "to"], ze = /* @__PURE__ */ g({
|
|
86
123
|
__name: "base-button",
|
|
87
124
|
props: {
|
|
88
125
|
type: null,
|
|
@@ -99,15 +136,15 @@ const X = ["type", "disabled", "href", "to"], Me = /* @__PURE__ */ g({
|
|
|
99
136
|
fab: { type: Boolean }
|
|
100
137
|
},
|
|
101
138
|
setup(e) {
|
|
102
|
-
const
|
|
103
|
-
return (
|
|
139
|
+
const i = e, t = h(() => i.caption && !i.fab);
|
|
140
|
+
return (a, n) => {
|
|
104
141
|
const d = $("svg-icon");
|
|
105
|
-
return
|
|
142
|
+
return r(), s("button", {
|
|
106
143
|
type: e.type,
|
|
107
144
|
disabled: e.disabled,
|
|
108
145
|
href: e.href,
|
|
109
146
|
to: e.to,
|
|
110
|
-
class:
|
|
147
|
+
class: p(["base-button btn btn-primary", {
|
|
111
148
|
disabled: e.disabled,
|
|
112
149
|
pending: e.pending,
|
|
113
150
|
rounded: e.rounded,
|
|
@@ -119,28 +156,28 @@ const X = ["type", "disabled", "href", "to"], Me = /* @__PURE__ */ g({
|
|
|
119
156
|
"x-small": e.size === "x-small"
|
|
120
157
|
}])
|
|
121
158
|
}, [
|
|
122
|
-
|
|
123
|
-
e.icon ? (
|
|
159
|
+
f(a.$slots, "default", {}, () => [
|
|
160
|
+
e.icon ? (r(), C(d, {
|
|
124
161
|
key: 0,
|
|
125
162
|
id: e.icon,
|
|
126
163
|
class: "base-button__caption"
|
|
127
164
|
}, null, 8, ["id"])) : k("", !0),
|
|
128
|
-
|
|
165
|
+
b(t) ? (r(), s("span", {
|
|
129
166
|
key: 1,
|
|
130
|
-
class:
|
|
167
|
+
class: p(["base-button__caption", { "icon-padding": e.icon }])
|
|
131
168
|
}, v(e.caption), 3)) : k("", !0)
|
|
132
169
|
])
|
|
133
|
-
], 10,
|
|
170
|
+
], 10, K);
|
|
134
171
|
};
|
|
135
172
|
}
|
|
136
173
|
});
|
|
137
174
|
function y() {
|
|
138
175
|
return (new Date().valueOf() + Math.random()).toString(36);
|
|
139
176
|
}
|
|
140
|
-
const
|
|
177
|
+
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
178
|
key: 0,
|
|
142
179
|
class: "form-input__color-swatch"
|
|
143
|
-
},
|
|
180
|
+
}, _ = ["name", "id", "disabled", "read-only", "required", "aria-label"], ee = ["for", "innerHTML"], Le = /* @__PURE__ */ g({
|
|
144
181
|
__name: "form-input",
|
|
145
182
|
props: {
|
|
146
183
|
modelValue: {
|
|
@@ -196,22 +233,22 @@ const Y = { class: "input-group form-input__input-group" }, K = ["type", "id", "
|
|
|
196
233
|
}
|
|
197
234
|
},
|
|
198
235
|
emits: ["update:modelValue"],
|
|
199
|
-
setup(e, { emit:
|
|
200
|
-
const
|
|
236
|
+
setup(e, { emit: i }) {
|
|
237
|
+
const t = e, a = h({
|
|
201
238
|
get() {
|
|
202
|
-
return
|
|
239
|
+
return t.modelValue;
|
|
203
240
|
},
|
|
204
241
|
set(n) {
|
|
205
|
-
|
|
242
|
+
i("update:modelValue", n);
|
|
206
243
|
}
|
|
207
244
|
});
|
|
208
|
-
return (n, d) => (
|
|
209
|
-
class:
|
|
245
|
+
return (n, d) => (r(), s("div", {
|
|
246
|
+
class: p(["form-input", `form-input--${e.type}`])
|
|
210
247
|
}, [
|
|
211
|
-
o("div",
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
248
|
+
o("div", Q, [
|
|
249
|
+
f(n.$slots, "input-prepend"),
|
|
250
|
+
w(o("input", {
|
|
251
|
+
"onUpdate:modelValue": d[0] || (d[0] = (l) => q(a) ? a.value = l : null),
|
|
215
252
|
type: e.type === "color" ? "text" : e.type,
|
|
216
253
|
id: e.id,
|
|
217
254
|
name: e.name,
|
|
@@ -222,17 +259,17 @@ const Y = { class: "input-group form-input__input-group" }, K = ["type", "id", "
|
|
|
222
259
|
required: e.required,
|
|
223
260
|
maxlength: e.maxlength,
|
|
224
261
|
checked: e.checked,
|
|
225
|
-
class:
|
|
262
|
+
class: p(["form-control", {
|
|
226
263
|
"form-check-input": e.type === "checkbox"
|
|
227
264
|
}]),
|
|
228
265
|
"aria-label": e.label
|
|
229
|
-
}, null, 10,
|
|
230
|
-
[
|
|
266
|
+
}, null, 10, W), [
|
|
267
|
+
[H, b(a)]
|
|
231
268
|
]),
|
|
232
|
-
|
|
233
|
-
e.type === "color" ? (
|
|
234
|
-
|
|
235
|
-
"onUpdate:modelValue": d[1] || (d[1] = (
|
|
269
|
+
f(n.$slots, "input-append", {}, () => [
|
|
270
|
+
e.type === "color" ? (r(), s("span", Z, [
|
|
271
|
+
w(o("input", {
|
|
272
|
+
"onUpdate:modelValue": d[1] || (d[1] = (l) => q(a) ? a.value = l : null),
|
|
236
273
|
type: "color",
|
|
237
274
|
name: `${e.name}-color`,
|
|
238
275
|
id: `${e.id}-color`,
|
|
@@ -241,28 +278,28 @@ const Y = { class: "input-group form-input__input-group" }, K = ["type", "id", "
|
|
|
241
278
|
required: e.required,
|
|
242
279
|
class: "form-control",
|
|
243
280
|
"aria-label": e.label
|
|
244
|
-
}, null, 8,
|
|
245
|
-
[
|
|
281
|
+
}, null, 8, _), [
|
|
282
|
+
[U, b(a)]
|
|
246
283
|
])
|
|
247
284
|
])) : k("", !0)
|
|
248
285
|
])
|
|
249
286
|
]),
|
|
250
|
-
|
|
287
|
+
f(n.$slots, "label", {}, () => [
|
|
251
288
|
o("label", {
|
|
252
289
|
for: e.id,
|
|
253
|
-
class:
|
|
290
|
+
class: p(["form-input__label", {
|
|
254
291
|
"form-check-label": e.type === "checkbox"
|
|
255
292
|
}]),
|
|
256
293
|
innerHTML: `${e.label}${e.required ? " *" : ""}`
|
|
257
|
-
}, null, 10,
|
|
294
|
+
}, null, 10, ee)
|
|
258
295
|
])
|
|
259
296
|
], 2));
|
|
260
297
|
}
|
|
261
298
|
});
|
|
262
|
-
const
|
|
299
|
+
const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "name", "placeholder", "pattern", "disabled", "read-only", "required", "maxlength", "aria-label"], ae = {
|
|
263
300
|
key: 0,
|
|
264
301
|
class: "form-input__color-swatch"
|
|
265
|
-
},
|
|
302
|
+
}, ne = ["name", "id", "disabled", "read-only", "required", "aria-label"], de = ["for", "innerHTML"], Te = /* @__PURE__ */ g({
|
|
266
303
|
__name: "input-textarea",
|
|
267
304
|
props: {
|
|
268
305
|
modelValue: {
|
|
@@ -318,19 +355,19 @@ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "nam
|
|
|
318
355
|
}
|
|
319
356
|
},
|
|
320
357
|
emits: ["update:modelValue"],
|
|
321
|
-
setup(e, { emit:
|
|
322
|
-
const
|
|
358
|
+
setup(e, { emit: i }) {
|
|
359
|
+
const t = e, a = h({
|
|
323
360
|
get() {
|
|
324
|
-
return
|
|
361
|
+
return t.modelValue;
|
|
325
362
|
},
|
|
326
363
|
set(n) {
|
|
327
|
-
|
|
364
|
+
i("update:modelValue", n);
|
|
328
365
|
}
|
|
329
366
|
});
|
|
330
|
-
return (n, d) => (
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
367
|
+
return (n, d) => (r(), s("div", te, [
|
|
368
|
+
f(n.$slots, "input-prepend"),
|
|
369
|
+
w(o("textarea", {
|
|
370
|
+
"onUpdate:modelValue": d[0] || (d[0] = (l) => q(a) ? a.value = l : null),
|
|
334
371
|
type: e.type === "color" ? "text" : e.type,
|
|
335
372
|
id: e.id,
|
|
336
373
|
name: e.name,
|
|
@@ -340,15 +377,15 @@ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "nam
|
|
|
340
377
|
"read-only": e.readOnly,
|
|
341
378
|
required: e.required,
|
|
342
379
|
maxlength: e.maxlength,
|
|
343
|
-
class:
|
|
380
|
+
class: p(["form-control", {}]),
|
|
344
381
|
"aria-label": e.label
|
|
345
|
-
}, null, 8,
|
|
346
|
-
[
|
|
382
|
+
}, null, 8, le), [
|
|
383
|
+
[U, b(a)]
|
|
347
384
|
]),
|
|
348
|
-
|
|
349
|
-
e.type === "color" ? (
|
|
350
|
-
|
|
351
|
-
"onUpdate:modelValue": d[1] || (d[1] = (
|
|
385
|
+
f(n.$slots, "input-append", {}, () => [
|
|
386
|
+
e.type === "color" ? (r(), s("span", ae, [
|
|
387
|
+
w(o("input", {
|
|
388
|
+
"onUpdate:modelValue": d[1] || (d[1] = (l) => q(a) ? a.value = l : null),
|
|
352
389
|
type: "color",
|
|
353
390
|
name: `${e.name}-color`,
|
|
354
391
|
id: `${e.id}-color`,
|
|
@@ -357,23 +394,23 @@ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "nam
|
|
|
357
394
|
required: e.required,
|
|
358
395
|
class: "form-control",
|
|
359
396
|
"aria-label": e.label
|
|
360
|
-
}, null, 8,
|
|
361
|
-
[
|
|
397
|
+
}, null, 8, ne), [
|
|
398
|
+
[U, b(a)]
|
|
362
399
|
])
|
|
363
400
|
])) : k("", !0)
|
|
364
401
|
]),
|
|
365
|
-
|
|
402
|
+
f(n.$slots, "label", {}, () => [
|
|
366
403
|
o("label", {
|
|
367
404
|
for: e.id,
|
|
368
|
-
class:
|
|
405
|
+
class: p(["form-input__label", {
|
|
369
406
|
"form-check-label": e.type === "checkbox"
|
|
370
407
|
}]),
|
|
371
408
|
innerHTML: `${e.label}${e.required ? " *" : ""}`
|
|
372
|
-
}, null, 10,
|
|
409
|
+
}, null, 10, de)
|
|
373
410
|
])
|
|
374
411
|
]));
|
|
375
412
|
}
|
|
376
|
-
}),
|
|
413
|
+
}), ie = { class: "radio-group" }, oe = ["for"], Ie = /* @__PURE__ */ g({
|
|
377
414
|
__name: "check-group",
|
|
378
415
|
props: {
|
|
379
416
|
modelValue: {
|
|
@@ -413,43 +450,43 @@ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "nam
|
|
|
413
450
|
}
|
|
414
451
|
},
|
|
415
452
|
emits: ["change", "update:modelValue"],
|
|
416
|
-
setup(e, { emit:
|
|
417
|
-
const
|
|
418
|
-
return S(() =>
|
|
419
|
-
|
|
420
|
-
(
|
|
453
|
+
setup(e, { emit: i }) {
|
|
454
|
+
const t = e, a = O([]);
|
|
455
|
+
return S(() => t.modelValue, (n, d) => {
|
|
456
|
+
a.value = t.options.map(
|
|
457
|
+
(l) => l.value ? t.modelValue.some((u) => u["value "] === l.value) : t.modelValue.some((u) => u === l)
|
|
421
458
|
);
|
|
422
|
-
}, { immediate: !0 }), S(
|
|
423
|
-
const
|
|
424
|
-
const
|
|
425
|
-
return [...
|
|
459
|
+
}, { immediate: !0 }), S(a, (n, d) => {
|
|
460
|
+
const l = n.reduce((u, c, m) => {
|
|
461
|
+
const V = c && t.options[m] ? [t.options[m] || t.options[m]] : [];
|
|
462
|
+
return [...u, ...V];
|
|
426
463
|
}, []);
|
|
427
|
-
|
|
428
|
-
}, { deep: !0 }),
|
|
464
|
+
i("update:modelValue", l);
|
|
465
|
+
}, { deep: !0 }), L(() => {
|
|
429
466
|
}), (n, d) => {
|
|
430
|
-
const
|
|
431
|
-
return
|
|
432
|
-
(
|
|
467
|
+
const l = $("form-input");
|
|
468
|
+
return r(), s("div", ie, [
|
|
469
|
+
(r(!0), s(M, null, N(e.options, (u, c) => (r(), C(l, {
|
|
433
470
|
key: c,
|
|
434
|
-
modelValue:
|
|
435
|
-
"onUpdate:modelValue": (
|
|
471
|
+
modelValue: b(a)[c],
|
|
472
|
+
"onUpdate:modelValue": (m) => b(a)[c] = m,
|
|
436
473
|
type: "checkbox",
|
|
437
474
|
name: e.name,
|
|
438
475
|
id: `${e.id}-${c}`,
|
|
439
|
-
label: `${
|
|
476
|
+
label: `${u.text || u}${e.required ? " *" : ""}`,
|
|
440
477
|
disabled: e.disabled,
|
|
441
478
|
"read-only": e.readOnly,
|
|
442
479
|
required: e.required
|
|
443
480
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "name", "id", "label", "disabled", "read-only", "required"]))), 128)),
|
|
444
481
|
o("label", { for: e.id }, [
|
|
445
|
-
|
|
446
|
-
|
|
482
|
+
f(n.$slots, "label", {}, () => [
|
|
483
|
+
x(v(e.label), 1)
|
|
447
484
|
])
|
|
448
|
-
], 8,
|
|
485
|
+
], 8, oe)
|
|
449
486
|
]);
|
|
450
487
|
};
|
|
451
488
|
}
|
|
452
|
-
}),
|
|
489
|
+
}), ue = { class: "radio-group" }, re = ["for"], De = /* @__PURE__ */ g({
|
|
453
490
|
__name: "radio-group",
|
|
454
491
|
props: {
|
|
455
492
|
modelValue: {
|
|
@@ -489,41 +526,41 @@ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "nam
|
|
|
489
526
|
}
|
|
490
527
|
},
|
|
491
528
|
emits: ["change", "update:modelValue"],
|
|
492
|
-
setup(e, { emit:
|
|
493
|
-
const
|
|
494
|
-
|
|
495
|
-
function
|
|
496
|
-
|
|
529
|
+
setup(e, { emit: i }) {
|
|
530
|
+
const t = e;
|
|
531
|
+
O(t.options.map((n) => n.value === t.modelValue));
|
|
532
|
+
function a(n) {
|
|
533
|
+
i("update:modelValue", n);
|
|
497
534
|
}
|
|
498
|
-
return
|
|
535
|
+
return L(() => {
|
|
499
536
|
}), (n, d) => {
|
|
500
|
-
const
|
|
501
|
-
return
|
|
502
|
-
(
|
|
537
|
+
const l = $("form-input");
|
|
538
|
+
return r(), s("div", ue, [
|
|
539
|
+
(r(!0), s(M, null, N(e.options, (u, c) => (r(), C(l, {
|
|
503
540
|
key: c,
|
|
504
541
|
type: "radio",
|
|
505
542
|
name: e.name,
|
|
506
543
|
id: `${e.id}-${c}`,
|
|
507
|
-
value:
|
|
508
|
-
label: `${
|
|
509
|
-
checked:
|
|
544
|
+
value: u.value || u,
|
|
545
|
+
label: `${u.text || u}${e.required ? " *" : ""}`,
|
|
546
|
+
checked: u.value ? u.value === e.modelValue : u === e.modelValue,
|
|
510
547
|
disabled: e.disabled,
|
|
511
548
|
"read-only": e.readOnly,
|
|
512
549
|
required: e.required,
|
|
513
|
-
onChange: (
|
|
550
|
+
onChange: (m) => a(u)
|
|
514
551
|
}, null, 8, ["name", "id", "value", "label", "checked", "disabled", "read-only", "required", "onChange"]))), 128)),
|
|
515
552
|
o("label", { for: e.id }, [
|
|
516
|
-
|
|
517
|
-
|
|
553
|
+
f(n.$slots, "label", {}, () => [
|
|
554
|
+
x(v(e.label), 1)
|
|
518
555
|
])
|
|
519
|
-
], 8,
|
|
556
|
+
], 8, re)
|
|
520
557
|
]);
|
|
521
558
|
};
|
|
522
559
|
}
|
|
523
|
-
}),
|
|
560
|
+
}), se = { class: "input input-dropdown" }, ce = { class: "dropdown" }, fe = {
|
|
524
561
|
class: "btn-group",
|
|
525
562
|
role: "group"
|
|
526
|
-
},
|
|
563
|
+
}, me = ["id", "disabled"], ye = ["aria-labelledby"], pe = ["onClick"], be = ["for"], Ae = /* @__PURE__ */ g({
|
|
527
564
|
__name: "input-dropdown",
|
|
528
565
|
props: {
|
|
529
566
|
modelValue: {
|
|
@@ -580,32 +617,32 @@ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "nam
|
|
|
580
617
|
}
|
|
581
618
|
},
|
|
582
619
|
emits: ["update:modelValue"],
|
|
583
|
-
setup(e, { emit:
|
|
584
|
-
const
|
|
620
|
+
setup(e, { emit: i }) {
|
|
621
|
+
const t = e;
|
|
585
622
|
h({
|
|
586
623
|
get() {
|
|
587
|
-
return
|
|
624
|
+
return t.modelValue;
|
|
588
625
|
},
|
|
589
|
-
set(
|
|
590
|
-
|
|
626
|
+
set(l) {
|
|
627
|
+
i("update:modelValue", l);
|
|
591
628
|
}
|
|
592
629
|
});
|
|
593
|
-
function l
|
|
594
|
-
|
|
630
|
+
function a(l) {
|
|
631
|
+
i("update:modelValue", l);
|
|
595
632
|
}
|
|
596
633
|
const n = h(() => [
|
|
597
634
|
{
|
|
598
635
|
text: "Please select"
|
|
599
636
|
},
|
|
600
|
-
...
|
|
601
|
-
(
|
|
637
|
+
...t.options.map(
|
|
638
|
+
(l) => typeof l == "string" ? { value: l, text: l } : l
|
|
602
639
|
)
|
|
603
|
-
]), d = h(() => [...
|
|
604
|
-
return (
|
|
605
|
-
o("div",
|
|
606
|
-
o("div",
|
|
640
|
+
]), d = h(() => [...t.options].find((l) => JSON.stringify(l.value) === JSON.stringify(t.modelValue)));
|
|
641
|
+
return (l, u) => (r(), s("div", se, [
|
|
642
|
+
o("div", ce, [
|
|
643
|
+
o("div", fe, [
|
|
607
644
|
o("button", {
|
|
608
|
-
class:
|
|
645
|
+
class: p(["btn dropdown-toggle", {
|
|
609
646
|
[`btn-${e.variant}`]: e.variant,
|
|
610
647
|
[`btn-${e.color}`]: e.color,
|
|
611
648
|
[`btn-${e.disabled}`]: e.disabled,
|
|
@@ -616,30 +653,30 @@ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "nam
|
|
|
616
653
|
"data-bs-toggle": "dropdown",
|
|
617
654
|
"aria-expanded": "false",
|
|
618
655
|
disabled: e.disabled
|
|
619
|
-
}, v(
|
|
656
|
+
}, v(b(d) ? b(d).text : e.placeholder), 11, me),
|
|
620
657
|
o("ul", {
|
|
621
658
|
class: "dropdown-menu",
|
|
622
659
|
"aria-labelledby": e.id
|
|
623
660
|
}, [
|
|
624
|
-
(
|
|
625
|
-
|
|
661
|
+
(r(!0), s(M, null, N(b(n), (c, m) => (r(), s("li", { key: m }, [
|
|
662
|
+
f(l.$slots, "option", {}, () => [
|
|
626
663
|
o("a", {
|
|
627
664
|
class: "dropdown-item",
|
|
628
|
-
onClick:
|
|
629
|
-
}, v(c.text), 9,
|
|
665
|
+
onClick: T((V) => a(c.value), ["prevent"])
|
|
666
|
+
}, v(c.text), 9, pe)
|
|
630
667
|
])
|
|
631
668
|
]))), 128))
|
|
632
|
-
], 8,
|
|
669
|
+
], 8, ye)
|
|
633
670
|
])
|
|
634
671
|
]),
|
|
635
672
|
o("label", { for: e.id }, [
|
|
636
|
-
|
|
637
|
-
|
|
673
|
+
f(l.$slots, "label", {}, () => [
|
|
674
|
+
x(v(e.label), 1)
|
|
638
675
|
])
|
|
639
|
-
], 8,
|
|
676
|
+
], 8, be)
|
|
640
677
|
]));
|
|
641
678
|
}
|
|
642
|
-
}),
|
|
679
|
+
}), 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
680
|
__name: "file-input",
|
|
644
681
|
props: {
|
|
645
682
|
modelValue: {
|
|
@@ -691,61 +728,61 @@ const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "nam
|
|
|
691
728
|
}
|
|
692
729
|
},
|
|
693
730
|
emits: ["update:modelValue"],
|
|
694
|
-
setup(e, { emit:
|
|
695
|
-
function
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
|
|
731
|
+
setup(e, { emit: i }) {
|
|
732
|
+
function t(d) {
|
|
733
|
+
const l = d.target && d.target.files;
|
|
734
|
+
l && (a.splice(0, a.length), Array.from(l).forEach((u) => {
|
|
735
|
+
a.push(u);
|
|
699
736
|
}));
|
|
700
737
|
}
|
|
701
|
-
const
|
|
702
|
-
return h(() =>
|
|
703
|
-
console.log("file input", d),
|
|
704
|
-
}, { deep: !0 }), (d,
|
|
705
|
-
class:
|
|
738
|
+
const a = P([]), n = h(() => a && a.map((d) => d.name));
|
|
739
|
+
return h(() => a.map((d) => URL.createObjectURL(d))), S(() => a, (d, l) => {
|
|
740
|
+
console.log("file input", d), i("update:modelValue", d);
|
|
741
|
+
}, { deep: !0 }), (d, l) => (r(), s("div", {
|
|
742
|
+
class: p(["form-input file-input", "file-input--primary"])
|
|
706
743
|
}, [
|
|
707
744
|
o("input", {
|
|
708
745
|
type: "file",
|
|
709
746
|
id: e.id,
|
|
710
747
|
name: e.name,
|
|
711
748
|
class: "d-none",
|
|
712
|
-
onChange:
|
|
749
|
+
onChange: t,
|
|
713
750
|
multiple: e.multiple,
|
|
714
751
|
accept: e.accept
|
|
715
|
-
}, null, 40,
|
|
716
|
-
o("div",
|
|
717
|
-
|
|
752
|
+
}, null, 40, ge),
|
|
753
|
+
o("div", he, [
|
|
754
|
+
f(d.$slots, "input-prepend"),
|
|
718
755
|
o("input", {
|
|
719
756
|
type: "text",
|
|
720
|
-
value:
|
|
757
|
+
value: b(n),
|
|
721
758
|
id: e.id,
|
|
722
759
|
name: e.name,
|
|
723
760
|
class: "form-control"
|
|
724
|
-
}, null, 8,
|
|
725
|
-
|
|
761
|
+
}, null, 8, ve),
|
|
762
|
+
f(d.$slots, "input-append", {}, () => [
|
|
726
763
|
o("label", {
|
|
727
764
|
for: e.id,
|
|
728
765
|
class: "btn btn-outline-dark"
|
|
729
|
-
}, " Select Image ", 8,
|
|
766
|
+
}, " Select Image ", 8, $e)
|
|
730
767
|
])
|
|
731
768
|
]),
|
|
732
|
-
|
|
769
|
+
f(d.$slots, "label", {}, () => [
|
|
733
770
|
o("label", {
|
|
734
771
|
for: e.id,
|
|
735
772
|
class: "form-input__label",
|
|
736
773
|
innerHTML: `${e.label}${e.required ? " *" : ""}`
|
|
737
|
-
}, null, 8,
|
|
774
|
+
}, null, 8, Se)
|
|
738
775
|
])
|
|
739
776
|
]));
|
|
740
777
|
}
|
|
741
|
-
}),
|
|
742
|
-
async function
|
|
743
|
-
return await new Promise((
|
|
744
|
-
let
|
|
745
|
-
|
|
778
|
+
}), xe = { class: "media-upload" }, Ve = ["src"], Be = ["onClick"], ke = ["for"];
|
|
779
|
+
async function we(e) {
|
|
780
|
+
return await new Promise((i) => {
|
|
781
|
+
let t = new FileReader();
|
|
782
|
+
t.onload = () => i(t.result), t.readAsDataURL(e);
|
|
746
783
|
});
|
|
747
784
|
}
|
|
748
|
-
const
|
|
785
|
+
const Pe = /* @__PURE__ */ g({
|
|
749
786
|
__name: "media-upload",
|
|
750
787
|
props: {
|
|
751
788
|
modelValue: {
|
|
@@ -801,43 +838,43 @@ const ze = /* @__PURE__ */ g({
|
|
|
801
838
|
}
|
|
802
839
|
},
|
|
803
840
|
emits: ["update:modelValue", "update:src"],
|
|
804
|
-
setup(e, { emit:
|
|
805
|
-
const
|
|
806
|
-
S(() =>
|
|
841
|
+
setup(e, { emit: i }) {
|
|
842
|
+
const t = e, a = O([]), n = O([]), d = h(() => t.modelValue.length ? t.modelValue : t.src ? [{ type: "", src: t.src }] : n.value);
|
|
843
|
+
S(() => a, async (u, c) => {
|
|
807
844
|
n.value = await Promise.all(
|
|
808
|
-
|
|
809
|
-
src: await
|
|
810
|
-
type:
|
|
845
|
+
u.value.map(async (m) => ({
|
|
846
|
+
src: await we(m),
|
|
847
|
+
type: m.type
|
|
811
848
|
}))
|
|
812
849
|
);
|
|
813
|
-
}, { deep: !0 }), S(() => n, async (
|
|
814
|
-
const
|
|
815
|
-
|
|
850
|
+
}, { deep: !0 }), S(() => n, async (u, c) => {
|
|
851
|
+
const m = t.multiple ? n.value : [n.value[0]];
|
|
852
|
+
i("update:modelValue", m), t.multiple || i("update:src", n.value[0] && n.value[0].src);
|
|
816
853
|
}, { deep: !0 });
|
|
817
|
-
function
|
|
818
|
-
|
|
854
|
+
function l(u) {
|
|
855
|
+
a.value.splice(u, 1);
|
|
819
856
|
}
|
|
820
|
-
return (
|
|
821
|
-
const
|
|
822
|
-
return
|
|
823
|
-
(
|
|
824
|
-
key:
|
|
857
|
+
return (u, c) => {
|
|
858
|
+
const m = $("svg-icon"), V = $("file-input");
|
|
859
|
+
return r(), s("div", xe, [
|
|
860
|
+
(r(!0), s(M, null, N(b(d), (B, I) => (r(), s("div", {
|
|
861
|
+
key: B.src,
|
|
825
862
|
class: "media-upload__thumbnail"
|
|
826
863
|
}, [
|
|
827
864
|
o("img", {
|
|
828
|
-
src:
|
|
865
|
+
src: B.src,
|
|
829
866
|
class: "img-thumbnail rounded"
|
|
830
|
-
}, null, 8,
|
|
867
|
+
}, null, 8, Ve),
|
|
831
868
|
o("button", {
|
|
832
|
-
onClick:
|
|
869
|
+
onClick: T((qe) => l(I), ["prevent"]),
|
|
833
870
|
class: "btn btn--close"
|
|
834
871
|
}, [
|
|
835
|
-
|
|
836
|
-
], 8,
|
|
872
|
+
z(m, { symbol: "x" })
|
|
873
|
+
], 8, Be)
|
|
837
874
|
]))), 128)),
|
|
838
|
-
|
|
839
|
-
modelValue:
|
|
840
|
-
"onUpdate:modelValue": c[0] || (c[0] = (
|
|
875
|
+
z(V, {
|
|
876
|
+
modelValue: a.value,
|
|
877
|
+
"onUpdate:modelValue": c[0] || (c[0] = (B) => a.value = B),
|
|
841
878
|
id: e.id,
|
|
842
879
|
name: e.name,
|
|
843
880
|
accept: e.accept,
|
|
@@ -846,20 +883,22 @@ const ze = /* @__PURE__ */ g({
|
|
|
846
883
|
o("label", {
|
|
847
884
|
for: e.id,
|
|
848
885
|
class: "btn btn-outline-dark"
|
|
849
|
-
}, " Select Image ", 8,
|
|
886
|
+
}, " Select Image ", 8, ke)
|
|
850
887
|
]);
|
|
851
888
|
};
|
|
852
889
|
}
|
|
853
890
|
});
|
|
854
891
|
export {
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
892
|
+
ze as BaseButton,
|
|
893
|
+
Ne as BaseHeadline,
|
|
894
|
+
Ue as BaseParagraph,
|
|
895
|
+
Ie as CheckGroup,
|
|
896
|
+
He as FileInput,
|
|
897
|
+
Le as FormInput,
|
|
898
|
+
Ae as InputDropdown,
|
|
899
|
+
Te as InputTextarea,
|
|
900
|
+
Me as LoadingSpinner,
|
|
901
|
+
Pe as MediaUpload,
|
|
902
|
+
De as RadioGroup,
|
|
903
|
+
Ce as SvgIcon
|
|
865
904
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s.AblokComponents={},s.Vue))})(this,function(s,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(r,a)=>(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))}}),me="",h={class:"loading-spinner d-block"},k={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"},$=["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(r,a)=>(e.openBlock(),e.createElementBlock("span",h,[e.createElementVNode("span",k,[(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,$)]))]),e.renderSlot(r.$slots,"default")]))}}),fe="",E=["type","disabled","href","to"],x=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 r=t,a=e.computed(()=>r.caption&&!r.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(a)?(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,E)}}}),pe="";function u(){return(new Date().valueOf()+Math.random()).toString(36)}const N={class:"input-group form-input__input-group"},w=["type","id","name","placeholder","pattern","disabled","read-only","required","maxlength","checked","aria-label"],C={key:0,class:"form-input__color-swatch"},q=["name","id","disabled","read-only","required","aria-label"],M=["for","innerHTML"],O=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:r}){const a=t,n=e.computed({get(){return a.modelValue},set(o){r("update:modelValue",o)}});return(o,d)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["form-input",`form-input--${t.type}`])},[e.createElementVNode("div",N,[e.renderSlot(o.$slots,"input-prepend"),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":d[0]||(d[0]=l=>e.isRef(n)?n.value=l: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,w),[[e.vModelDynamic,e.unref(n)]]),e.renderSlot(o.$slots,"input-append",{},()=>[t.type==="color"?(e.openBlock(),e.createElementBlock("span",C,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":d[1]||(d[1]=l=>e.isRef(n)?n.value=l: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,q),[[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,M)])],2))}}),ye="",T={class:"form-input form-input--textarea"},z=["type","id","name","placeholder","pattern","disabled","read-only","required","maxlength","aria-label"],D={key:0,class:"form-input__color-swatch"},L=["name","id","disabled","read-only","required","aria-label"],U=["for","innerHTML"],I=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:r}){const a=t,n=e.computed({get(){return a.modelValue},set(o){r("update:modelValue",o)}});return(o,d)=>(e.openBlock(),e.createElementBlock("div",T,[e.renderSlot(o.$slots,"input-prepend"),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":d[0]||(d[0]=l=>e.isRef(n)?n.value=l: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,z),[[e.vModelText,e.unref(n)]]),e.renderSlot(o.$slots,"input-append",{},()=>[t.type==="color"?(e.openBlock(),e.createElementBlock("span",D,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":d[1]||(d[1]=l=>e.isRef(n)?n.value=l: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,L),[[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,U)])]))}}),R={class:"radio-group"},A=["for"],F=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:r}){const a=t,n=e.ref([]);return e.watch(()=>a.modelValue,(o,d)=>{n.value=a.options.map(l=>l.value?a.modelValue.some(i=>i["value "]===l.value):a.modelValue.some(i=>i===l))},{immediate:!0}),e.watch(n,(o,d)=>{const l=o.reduce((i,c,m)=>{const f=c&&a.options[m]?[a.options[m]||a.options[m]]:[];return[...i,...f]},[]);r("update:modelValue",l)},{deep:!0}),e.onBeforeMount(()=>{}),(o,d)=>{const l=e.resolveComponent("form-input");return e.openBlock(),e.createElementBlock("div",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,(i,c)=>(e.openBlock(),e.createBlock(l,{key:c,modelValue:e.unref(n)[c],"onUpdate:modelValue":m=>e.unref(n)[c]=m,type:"checkbox",name:t.name,id:`${t.id}-${c}`,label:`${i.text||i}${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,A)])}}}),P={class:"radio-group"},H=["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:r}){const a=t;e.ref(a.options.map(o=>o.value===a.modelValue));function n(o){r("update:modelValue",o)}return e.onBeforeMount(()=>{}),(o,d)=>{const l=e.resolveComponent("form-input");return e.openBlock(),e.createElementBlock("div",P,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.options,(i,c)=>(e.openBlock(),e.createBlock(l,{key:c,type:"radio",name:t.name,id:`${t.id}-${c}`,value:i.value||i,label:`${i.text||i}${t.required?" *":""}`,checked:i.value?i.value===t.modelValue:i===t.modelValue,disabled:t.disabled,"read-only":t.readOnly,required:t.required,onChange:m=>n(i)},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,H)])}}}),G={class:"input input-dropdown"},J={class:"dropdown"},X={class:"btn-group",role:"group"},Y=["id","disabled"],K=["aria-labelledby"],Q=["onClick"],W=["for"],Z=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:r}){const a=t;e.computed({get(){return a.modelValue},set(l){r("update:modelValue",l)}});function n(l){r("update:modelValue",l)}const o=e.computed(()=>[{text:"Please select"},...a.options.map(l=>typeof l=="string"?{value:l,text:l}:l)]),d=e.computed(()=>[...a.options].find(l=>JSON.stringify(l.value)===JSON.stringify(a.modelValue)));return(l,i)=>(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("div",J,[e.createElementVNode("div",X,[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,Y),e.createElementVNode("ul",{class:"dropdown-menu","aria-labelledby":t.id},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),(c,m)=>(e.openBlock(),e.createElementBlock("li",{key:m},[e.renderSlot(l.$slots,"option",{},()=>[e.createElementVNode("a",{class:"dropdown-item",onClick:e.withModifiers(f=>n(c.value),["prevent"])},e.toDisplayString(c.text),9,Q)])]))),128))],8,K)])]),e.createElementVNode("label",{for:t.id},[e.renderSlot(l.$slots,"label",{},()=>[e.createTextVNode(e.toDisplayString(t.label),1)])],8,W)]))}}),_=["id","name","multiple","accept"],v={class:"form-input__input-group input-group"},ee=["value","id","name"],te=["for"],le=["for","innerHTML"],ne=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:r}){function a(d){const l=d.target&&d.target.files;l&&(n.splice(0,n.length),Array.from(l).forEach(i=>{n.push(i)}))}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,l)=>{console.log("file input",d),r("update:modelValue",d)},{deep:!0}),(d,l)=>(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:a,multiple:t.multiple,accept:t.accept},null,40,_),e.createElementVNode("div",v,[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,ee),e.renderSlot(d.$slots,"input-append",{},()=>[e.createElementVNode("label",{for:t.id,class:"btn btn-outline-dark"}," Select Image ",8,te)])]),e.renderSlot(d.$slots,"label",{},()=>[e.createElementVNode("label",{for:t.id,class:"form-input__label",innerHTML:`${t.label}${t.required?" *":""}`},null,8,le)])]))}}),ae={class:"media-upload"},oe=["src"],de=["onClick"],ie=["for"];async function re(t){return await new Promise(r=>{let a=new FileReader;a.onload=()=>r(a.result),a.readAsDataURL(t)})}const ce=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:r}){const a=t,n=e.ref([]),o=e.ref([]),d=e.computed(()=>a.modelValue.length?a.modelValue:a.src?[{type:"",src:a.src}]:o.value);e.watch(()=>n,async(i,c)=>{o.value=await Promise.all(i.value.map(async m=>({src:await re(m),type:m.type})))},{deep:!0}),e.watch(()=>o,async(i,c)=>{const m=a.multiple?o.value:[o.value[0]];r("update:modelValue",m),a.multiple||r("update:src",o.value[0]&&o.value[0].src)},{deep:!0});function l(i){n.value.splice(i,1)}return(i,c)=>{const m=e.resolveComponent("svg-icon"),f=e.resolveComponent("file-input");return e.openBlock(),e.createElementBlock("div",ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(p,se)=>(e.openBlock(),e.createElementBlock("div",{key:p.src,class:"media-upload__thumbnail"},[e.createElementVNode("img",{src:p.src,class:"img-thumbnail rounded"},null,8,oe),e.createElementVNode("button",{onClick:e.withModifiers(ge=>l(se),["prevent"]),class:"btn btn--close"},[e.createVNode(m,{symbol:"x"})],8,de)]))),128)),e.createVNode(f,{modelValue:n.value,"onUpdate:modelValue":c[0]||(c[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,ie)])}}}),be="";s.BaseButton=x,s.CheckGroup=F,s.FileInput=ne,s.FormInput=O,s.InputDropdown=Z,s.InputTextarea=I,s.LoadingSpinner=V,s.MediaUpload=ce,s.RadioGroup=j,s.SvgIcon=g,Object.defineProperties(s,{__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"},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"}})});
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
new (...args: any[]): {
|
|
3
|
+
$: import("vue").ComponentInternalInstance;
|
|
4
|
+
$data: {};
|
|
5
|
+
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
6
|
+
tag?: string | undefined;
|
|
7
|
+
size?: string | undefined;
|
|
8
|
+
variant?: string | undefined;
|
|
9
|
+
text?: string | undefined;
|
|
10
|
+
}>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
11
|
+
$attrs: {
|
|
12
|
+
[x: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
$refs: {
|
|
15
|
+
[x: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
$slots: Readonly<{
|
|
18
|
+
[name: string]: import("vue").Slot | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
21
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
22
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
23
|
+
$el: any;
|
|
24
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
25
|
+
tag?: string | undefined;
|
|
26
|
+
size?: string | undefined;
|
|
27
|
+
variant?: string | undefined;
|
|
28
|
+
text?: string | undefined;
|
|
29
|
+
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & {
|
|
30
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
31
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
32
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
33
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
34
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
35
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
36
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
37
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
38
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
39
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
40
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
41
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
42
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
43
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
44
|
+
errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
|
|
45
|
+
};
|
|
46
|
+
$forceUpdate: () => void;
|
|
47
|
+
$nextTick: typeof import("vue").nextTick;
|
|
48
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
49
|
+
} & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
50
|
+
tag?: string | undefined;
|
|
51
|
+
size?: string | undefined;
|
|
52
|
+
variant?: string | undefined;
|
|
53
|
+
text?: string | undefined;
|
|
54
|
+
}>>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
55
|
+
__isFragment?: undefined;
|
|
56
|
+
__isTeleport?: undefined;
|
|
57
|
+
__isSuspense?: undefined;
|
|
58
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
59
|
+
tag?: string | undefined;
|
|
60
|
+
size?: string | undefined;
|
|
61
|
+
variant?: string | undefined;
|
|
62
|
+
text?: string | undefined;
|
|
63
|
+
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
64
|
+
$slots: {
|
|
65
|
+
default: (_: {}) => any;
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
export default _default;
|
|
69
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
70
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
71
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
72
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
73
|
+
} : {
|
|
74
|
+
type: import('vue').PropType<T[K]>;
|
|
75
|
+
required: true;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
new (...args: any[]): {
|
|
3
|
+
$: import("vue").ComponentInternalInstance;
|
|
4
|
+
$data: {};
|
|
5
|
+
$props: Partial<{}> & Omit<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
6
|
+
size?: string | undefined;
|
|
7
|
+
variant?: string | undefined;
|
|
8
|
+
text?: string | undefined;
|
|
9
|
+
className?: string | undefined;
|
|
10
|
+
}>>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>;
|
|
11
|
+
$attrs: {
|
|
12
|
+
[x: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
$refs: {
|
|
15
|
+
[x: string]: unknown;
|
|
16
|
+
};
|
|
17
|
+
$slots: Readonly<{
|
|
18
|
+
[name: string]: import("vue").Slot | undefined;
|
|
19
|
+
}>;
|
|
20
|
+
$root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
21
|
+
$parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
|
|
22
|
+
$emit: (event: string, ...args: any[]) => void;
|
|
23
|
+
$el: any;
|
|
24
|
+
$options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
25
|
+
size?: string | undefined;
|
|
26
|
+
variant?: string | undefined;
|
|
27
|
+
text?: string | undefined;
|
|
28
|
+
className?: string | undefined;
|
|
29
|
+
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & {
|
|
30
|
+
beforeCreate?: ((() => void) | (() => void)[]) | undefined;
|
|
31
|
+
created?: ((() => void) | (() => void)[]) | undefined;
|
|
32
|
+
beforeMount?: ((() => void) | (() => void)[]) | undefined;
|
|
33
|
+
mounted?: ((() => void) | (() => void)[]) | undefined;
|
|
34
|
+
beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
|
|
35
|
+
updated?: ((() => void) | (() => void)[]) | undefined;
|
|
36
|
+
activated?: ((() => void) | (() => void)[]) | undefined;
|
|
37
|
+
deactivated?: ((() => void) | (() => void)[]) | undefined;
|
|
38
|
+
beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
|
|
39
|
+
beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
|
|
40
|
+
destroyed?: ((() => void) | (() => void)[]) | undefined;
|
|
41
|
+
unmounted?: ((() => void) | (() => void)[]) | undefined;
|
|
42
|
+
renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
43
|
+
renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
|
|
44
|
+
errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
|
|
45
|
+
};
|
|
46
|
+
$forceUpdate: () => void;
|
|
47
|
+
$nextTick: typeof import("vue").nextTick;
|
|
48
|
+
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
49
|
+
} & Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
50
|
+
size?: string | undefined;
|
|
51
|
+
variant?: string | undefined;
|
|
52
|
+
text?: string | undefined;
|
|
53
|
+
className?: string | undefined;
|
|
54
|
+
}>>> & import("vue").ShallowUnwrapRef<{}> & {} & import("vue").ComponentCustomProperties;
|
|
55
|
+
__isFragment?: undefined;
|
|
56
|
+
__isTeleport?: undefined;
|
|
57
|
+
__isSuspense?: undefined;
|
|
58
|
+
} & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
59
|
+
size?: string | undefined;
|
|
60
|
+
variant?: string | undefined;
|
|
61
|
+
text?: string | undefined;
|
|
62
|
+
className?: string | undefined;
|
|
63
|
+
}>>>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {}> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
64
|
+
$slots: {
|
|
65
|
+
default: (_: {}) => any;
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
export default _default;
|
|
69
|
+
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
70
|
+
declare type __VLS_TypePropsToRuntimeProps<T> = {
|
|
71
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
72
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
73
|
+
} : {
|
|
74
|
+
type: import('vue').PropType<T[K]>;
|
|
75
|
+
required: true;
|
|
76
|
+
};
|
|
77
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { default as SvgIcon } from "./components/svg-icon.vue";
|
|
2
2
|
export { default as LoadingSpinner } from "./components/loading-spinner.vue";
|
|
3
|
+
export { default as BaseHeadline } from "./components/base-headline.vue";
|
|
4
|
+
export { default as BaseParagraph } from "./components/base-paragraph.vue";
|
|
3
5
|
export { default as BaseButton } from "./components/base-button.vue";
|
|
4
6
|
export { default as FormInput } from "./components/form-input.vue";
|
|
5
7
|
export { default as InputTextarea } from "./components/input-textarea.vue";
|