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