ablok-components 0.0.39 → 0.0.42
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 +173 -168
- package/dist/ablok-components.umd.js +1 -1
- package/dist/components/{base-button.vue.d.ts → form/base-button/base-button.vue.d.ts} +0 -0
- package/dist/components/{base-form.vue.d.ts → form/base-form/base-form.vue.d.ts} +0 -0
- package/dist/components/{check-group.vue.d.ts → form/check-group/check-group.vue.d.ts} +0 -0
- package/dist/components/{file-input.vue.d.ts → form/file-input/file-input.vue.d.ts} +0 -0
- package/dist/components/{form-input.vue.d.ts → form/form-input/form-input.vue.d.ts} +0 -0
- package/dist/components/{input-dropdown.vue.d.ts → form/input-dropdown/input-dropdown.vue.d.ts} +0 -0
- package/dist/components/{input-textarea.vue.d.ts → form/input-textarea/input-textarea.vue.d.ts} +0 -0
- package/dist/components/{media-upload.vue.d.ts → form/media-upload/media-upload.vue.d.ts} +0 -0
- package/dist/components/{radio-group.vue.d.ts → form/radio-group/radio-group.vue.d.ts} +0 -0
- package/dist/components/{loading-spinner.vue.d.ts → icon/loading-spinner/loading-spinner.vue.d.ts} +0 -0
- package/dist/components/{svg-icon.vue.d.ts → icon/svg-icon/svg-icon.vue.d.ts} +0 -0
- package/dist/components/{base-headline.vue.d.ts → text/base-headline/base-headline.vue.d.ts} +0 -0
- package/dist/components/{base-paragraph.vue.d.ts → text/base-paragraph/base-paragraph.vue.d.ts} +0 -0
- package/dist/env.d.ts +8 -0
- package/dist/index.d.ts +12 -12
- package/dist/style.css +1 -1
- package/dist/symbol-defs.svg +769 -224
- package/dist/{components → utilities}/helpers.d.ts +0 -0
- package/package.json +2 -1
- package/dist/components/base-button.story.vue.d.ts +0 -48
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as g, openBlock as r, createElementBlock as
|
|
1
|
+
import { defineComponent as g, openBlock as r, createElementBlock as c, normalizeClass as b, createElementVNode as u, renderSlot as m, computed as h, createBlock as C, resolveDynamicComponent as D, unref as p, withCtx as A, createTextVNode as V, toDisplayString as v, resolveComponent as S, createCommentVNode as w, withDirectives as q, isRef as O, vModelDynamic as H, vModelText as U, ref as x, watch as $, onBeforeMount as L, Fragment as M, renderList as N, withModifiers as T, reactive as P, createVNode as z } from "vue";
|
|
2
2
|
const R = {
|
|
3
3
|
class: "icon",
|
|
4
4
|
preserveAspectRatio: "xMaxYMin"
|
|
@@ -23,13 +23,13 @@ const R = {
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
setup(e) {
|
|
26
|
-
return (
|
|
26
|
+
return (o, t) => (r(), c("i", {
|
|
27
27
|
class: b(["svg-icon", {
|
|
28
28
|
[`svg-icon--${e.size}`]: e.size
|
|
29
29
|
}])
|
|
30
30
|
}, [
|
|
31
|
-
(r(),
|
|
32
|
-
|
|
31
|
+
(r(), c("svg", R, [
|
|
32
|
+
u("use", {
|
|
33
33
|
"xlink:href": `${e.basePath}#${e.prefix}${e.symbol}`,
|
|
34
34
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
35
35
|
x: "0",
|
|
@@ -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
|
-
}, J = ["fill"], X = /* @__PURE__ */
|
|
53
|
+
}, J = ["fill"], X = /* @__PURE__ */ u("animateTransform", {
|
|
54
54
|
attributeName: "transform",
|
|
55
55
|
attributeType: "XML",
|
|
56
56
|
type: "rotate",
|
|
@@ -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(),
|
|
75
|
-
|
|
72
|
+
return (o, t) => (r(), c("span", E, [
|
|
73
|
+
u("span", j, [
|
|
74
|
+
(r(), c("svg", G, [
|
|
75
|
+
u("path", {
|
|
76
76
|
fill: e.color,
|
|
77
77
|
d: "M73,50c0-12.7-10.3-23-23-23S27,37.3,27,50 M30.9,50c0-10.5,8.5-19.1,19.1-19.1S69.1,39.5,69.1,50"
|
|
78
78
|
}, Y, 8, J)
|
|
79
79
|
]))
|
|
80
80
|
]),
|
|
81
|
-
m(
|
|
81
|
+
m(o.$slots, "default")
|
|
82
82
|
]));
|
|
83
83
|
}
|
|
84
84
|
});
|
|
@@ -92,13 +92,13 @@ const Ne = /* @__PURE__ */ g({
|
|
|
92
92
|
className: null
|
|
93
93
|
},
|
|
94
94
|
setup(e) {
|
|
95
|
-
const
|
|
96
|
-
return (
|
|
95
|
+
const o = e, t = h(() => o.tag || "p");
|
|
96
|
+
return (d, a) => (r(), C(D(p(t)), {
|
|
97
97
|
class: b(["headline", `headline--${e.size}${e.className || ""}`])
|
|
98
98
|
}, {
|
|
99
99
|
default: A(() => [
|
|
100
|
-
m(
|
|
101
|
-
|
|
100
|
+
m(d.$slots, "default", {}, () => [
|
|
101
|
+
V(v(e.text), 1)
|
|
102
102
|
])
|
|
103
103
|
]),
|
|
104
104
|
_: 3
|
|
@@ -113,11 +113,11 @@ const Ne = /* @__PURE__ */ g({
|
|
|
113
113
|
className: null
|
|
114
114
|
},
|
|
115
115
|
setup(e) {
|
|
116
|
-
return (
|
|
116
|
+
return (o, t) => (r(), c("p", {
|
|
117
117
|
class: b(["base-paragraph", `base-paragraph--${e.size}${e.className || ""}`])
|
|
118
118
|
}, [
|
|
119
|
-
m(
|
|
120
|
-
|
|
119
|
+
m(o.$slots, "default", {}, () => [
|
|
120
|
+
V(v(e.text), 1)
|
|
121
121
|
])
|
|
122
122
|
], 2));
|
|
123
123
|
}
|
|
@@ -138,10 +138,10 @@ const Ne = /* @__PURE__ */ g({
|
|
|
138
138
|
fab: { type: Boolean }
|
|
139
139
|
},
|
|
140
140
|
setup(e) {
|
|
141
|
-
const
|
|
142
|
-
return (
|
|
143
|
-
const
|
|
144
|
-
return r(),
|
|
141
|
+
const o = e, t = h(() => o.caption && !o.fab);
|
|
142
|
+
return (d, a) => {
|
|
143
|
+
const i = S("svg-icon");
|
|
144
|
+
return r(), c("button", {
|
|
145
145
|
type: e.type,
|
|
146
146
|
disabled: e.disabled,
|
|
147
147
|
href: e.href,
|
|
@@ -158,16 +158,16 @@ const Ne = /* @__PURE__ */ g({
|
|
|
158
158
|
"x-small": e.size === "x-small"
|
|
159
159
|
}])
|
|
160
160
|
}, [
|
|
161
|
-
m(
|
|
162
|
-
e.icon ? (r(), C(
|
|
161
|
+
m(d.$slots, "default", {}, () => [
|
|
162
|
+
e.icon ? (r(), C(i, {
|
|
163
163
|
key: 0,
|
|
164
164
|
id: e.icon,
|
|
165
165
|
class: "base-button__caption"
|
|
166
|
-
}, null, 8, ["id"])) :
|
|
167
|
-
p(t) ? (r(),
|
|
166
|
+
}, null, 8, ["id"])) : w("", !0),
|
|
167
|
+
p(t) ? (r(), c("span", {
|
|
168
168
|
key: 1,
|
|
169
169
|
class: b(["base-button__caption", { "icon-padding": e.icon }])
|
|
170
|
-
}, v(e.caption), 3)) :
|
|
170
|
+
}, v(e.caption), 3)) : w("", !0)
|
|
171
171
|
])
|
|
172
172
|
], 10, K);
|
|
173
173
|
};
|
|
@@ -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 t = e,
|
|
238
|
+
setup(e, { emit: o }) {
|
|
239
|
+
const t = e, d = h({
|
|
240
240
|
get() {
|
|
241
241
|
return t.modelValue;
|
|
242
242
|
},
|
|
243
|
-
set(
|
|
244
|
-
|
|
243
|
+
set(a) {
|
|
244
|
+
o("update:modelValue", a);
|
|
245
245
|
}
|
|
246
246
|
});
|
|
247
|
-
return (
|
|
247
|
+
return (a, i) => (r(), c("div", {
|
|
248
248
|
class: b(["form-input", `form-input--${e.type}`])
|
|
249
249
|
}, [
|
|
250
|
-
|
|
251
|
-
m(
|
|
252
|
-
|
|
253
|
-
"onUpdate:modelValue":
|
|
250
|
+
u("div", Q, [
|
|
251
|
+
m(a.$slots, "input-prepend"),
|
|
252
|
+
q(u("input", {
|
|
253
|
+
"onUpdate:modelValue": i[0] || (i[0] = (n) => O(d) ? d.value = n : null),
|
|
254
254
|
type: e.type === "color" ? "text" : e.type,
|
|
255
255
|
id: e.id,
|
|
256
256
|
name: e.name,
|
|
@@ -266,12 +266,12 @@ const Q = { class: "input-group form-input__input-group" }, W = ["type", "id", "
|
|
|
266
266
|
}]),
|
|
267
267
|
"aria-label": e.label
|
|
268
268
|
}, null, 10, W), [
|
|
269
|
-
[H, p(
|
|
269
|
+
[H, p(d)]
|
|
270
270
|
]),
|
|
271
|
-
m(
|
|
272
|
-
e.type === "color" ? (r(),
|
|
273
|
-
|
|
274
|
-
"onUpdate:modelValue":
|
|
271
|
+
m(a.$slots, "input-append", {}, () => [
|
|
272
|
+
e.type === "color" ? (r(), c("span", Z, [
|
|
273
|
+
q(u("input", {
|
|
274
|
+
"onUpdate:modelValue": i[1] || (i[1] = (n) => O(d) ? d.value = n : null),
|
|
275
275
|
type: "color",
|
|
276
276
|
name: `${e.name}-color`,
|
|
277
277
|
id: `${e.id}-color`,
|
|
@@ -281,13 +281,13 @@ const Q = { class: "input-group form-input__input-group" }, W = ["type", "id", "
|
|
|
281
281
|
class: "form-control",
|
|
282
282
|
"aria-label": e.label
|
|
283
283
|
}, null, 8, _), [
|
|
284
|
-
[U, p(
|
|
284
|
+
[U, p(d)]
|
|
285
285
|
])
|
|
286
|
-
])) :
|
|
286
|
+
])) : w("", !0)
|
|
287
287
|
])
|
|
288
288
|
]),
|
|
289
|
-
m(
|
|
290
|
-
|
|
289
|
+
m(a.$slots, "label", {}, () => [
|
|
290
|
+
u("label", {
|
|
291
291
|
for: e.id,
|
|
292
292
|
class: b(["form-input__label", {
|
|
293
293
|
"form-check-label": e.type === "checkbox"
|
|
@@ -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 t = e,
|
|
360
|
+
setup(e, { emit: o }) {
|
|
361
|
+
const t = e, d = h({
|
|
362
362
|
get() {
|
|
363
363
|
return t.modelValue;
|
|
364
364
|
},
|
|
365
|
-
set(
|
|
366
|
-
|
|
365
|
+
set(a) {
|
|
366
|
+
o("update:modelValue", a);
|
|
367
367
|
}
|
|
368
368
|
});
|
|
369
|
-
return (
|
|
370
|
-
m(
|
|
371
|
-
|
|
372
|
-
"onUpdate:modelValue":
|
|
369
|
+
return (a, i) => (r(), c("div", te, [
|
|
370
|
+
m(a.$slots, "input-prepend"),
|
|
371
|
+
q(u("textarea", {
|
|
372
|
+
"onUpdate:modelValue": i[0] || (i[0] = (n) => O(d) ? d.value = n : null),
|
|
373
373
|
type: e.type === "color" ? "text" : e.type,
|
|
374
374
|
id: e.id,
|
|
375
375
|
name: e.name,
|
|
@@ -382,12 +382,12 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
382
382
|
class: b(["form-control", {}]),
|
|
383
383
|
"aria-label": e.label
|
|
384
384
|
}, null, 8, le), [
|
|
385
|
-
[U, p(
|
|
385
|
+
[U, p(d)]
|
|
386
386
|
]),
|
|
387
|
-
m(
|
|
388
|
-
e.type === "color" ? (r(),
|
|
389
|
-
|
|
390
|
-
"onUpdate:modelValue":
|
|
387
|
+
m(a.$slots, "input-append", {}, () => [
|
|
388
|
+
e.type === "color" ? (r(), c("span", ae, [
|
|
389
|
+
q(u("input", {
|
|
390
|
+
"onUpdate:modelValue": i[1] || (i[1] = (n) => O(d) ? d.value = n : null),
|
|
391
391
|
type: "color",
|
|
392
392
|
name: `${e.name}-color`,
|
|
393
393
|
id: `${e.id}-color`,
|
|
@@ -397,12 +397,12 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
397
397
|
class: "form-control",
|
|
398
398
|
"aria-label": e.label
|
|
399
399
|
}, null, 8, ne), [
|
|
400
|
-
[U, p(
|
|
400
|
+
[U, p(d)]
|
|
401
401
|
])
|
|
402
|
-
])) :
|
|
402
|
+
])) : w("", !0)
|
|
403
403
|
]),
|
|
404
|
-
m(
|
|
405
|
-
|
|
404
|
+
m(a.$slots, "label", {}, () => [
|
|
405
|
+
u("label", {
|
|
406
406
|
for: e.id,
|
|
407
407
|
class: b(["form-input__label", {
|
|
408
408
|
"form-check-label": e.type === "checkbox"
|
|
@@ -452,37 +452,37 @@ 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 t = e,
|
|
457
|
-
return
|
|
458
|
-
|
|
459
|
-
(
|
|
455
|
+
setup(e, { emit: o }) {
|
|
456
|
+
const t = e, d = x([]);
|
|
457
|
+
return $(() => t.modelValue, (a, i) => {
|
|
458
|
+
d.value = t.options.map(
|
|
459
|
+
(n) => n.value ? t.modelValue.some((l) => l["value "] === n.value) : t.modelValue.some((l) => l === n)
|
|
460
460
|
);
|
|
461
|
-
}, { immediate: !0 }),
|
|
462
|
-
const
|
|
463
|
-
const
|
|
464
|
-
return [...
|
|
461
|
+
}, { immediate: !0 }), $(d, (a, i) => {
|
|
462
|
+
const n = a.reduce((l, s, f) => {
|
|
463
|
+
const k = s && t.options[f] ? [t.options[f] || t.options[f]] : [];
|
|
464
|
+
return [...l, ...k];
|
|
465
465
|
}, []);
|
|
466
|
-
|
|
466
|
+
o("update:modelValue", n);
|
|
467
467
|
}, { deep: !0 }), L(() => {
|
|
468
|
-
}), (
|
|
469
|
-
const
|
|
470
|
-
return r(),
|
|
471
|
-
(r(!0),
|
|
472
|
-
key:
|
|
473
|
-
modelValue: p(
|
|
474
|
-
"onUpdate:modelValue": (f) => p(
|
|
468
|
+
}), (a, i) => {
|
|
469
|
+
const n = S("form-input");
|
|
470
|
+
return r(), c("div", ie, [
|
|
471
|
+
(r(!0), c(M, null, N(e.options, (l, s) => (r(), C(n, {
|
|
472
|
+
key: s,
|
|
473
|
+
modelValue: p(d)[s],
|
|
474
|
+
"onUpdate:modelValue": (f) => p(d)[s] = f,
|
|
475
475
|
type: "checkbox",
|
|
476
476
|
name: e.name,
|
|
477
|
-
id: `${e.id}-${
|
|
478
|
-
label: `${
|
|
477
|
+
id: `${e.id}-${s}`,
|
|
478
|
+
label: `${l.text || l}${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
|
+
u("label", { for: e.id }, [
|
|
484
|
+
m(a.$slots, "label", {}, () => [
|
|
485
|
+
V(v(e.label), 1)
|
|
486
486
|
])
|
|
487
487
|
], 8, oe)
|
|
488
488
|
]);
|
|
@@ -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:
|
|
531
|
+
setup(e, { emit: o }) {
|
|
532
532
|
const t = e;
|
|
533
|
-
|
|
534
|
-
function
|
|
535
|
-
|
|
533
|
+
x(t.options.map((a) => a.value === t.modelValue));
|
|
534
|
+
function d(a) {
|
|
535
|
+
o("update:modelValue", a);
|
|
536
536
|
}
|
|
537
537
|
return L(() => {
|
|
538
|
-
}), (
|
|
539
|
-
const
|
|
540
|
-
return r(),
|
|
541
|
-
(r(!0),
|
|
542
|
-
key:
|
|
538
|
+
}), (a, i) => {
|
|
539
|
+
const n = S("form-input");
|
|
540
|
+
return r(), c("div", ue, [
|
|
541
|
+
(r(!0), c(M, null, N(e.options, (l, s) => (r(), C(n, {
|
|
542
|
+
key: s,
|
|
543
543
|
type: "radio",
|
|
544
544
|
name: e.name,
|
|
545
|
-
id: `${e.id}-${
|
|
546
|
-
value:
|
|
547
|
-
label: `${
|
|
548
|
-
checked:
|
|
545
|
+
id: `${e.id}-${s}`,
|
|
546
|
+
value: l.value || l,
|
|
547
|
+
label: `${l.text || l}${e.required ? " *" : ""}`,
|
|
548
|
+
checked: l.value ? l.value === e.modelValue : l === e.modelValue,
|
|
549
549
|
disabled: e.disabled,
|
|
550
550
|
"read-only": e.readOnly,
|
|
551
551
|
required: e.required,
|
|
552
|
-
onChange: (f) => l
|
|
552
|
+
onChange: (f) => d(l)
|
|
553
553
|
}, null, 8, ["name", "id", "value", "label", "checked", "disabled", "read-only", "required", "onChange"]))), 128)),
|
|
554
|
-
|
|
555
|
-
m(
|
|
556
|
-
|
|
554
|
+
u("label", { for: e.id }, [
|
|
555
|
+
m(a.$slots, "label", {}, () => [
|
|
556
|
+
V(v(e.label), 1)
|
|
557
557
|
])
|
|
558
558
|
], 8, re)
|
|
559
559
|
]);
|
|
560
560
|
};
|
|
561
561
|
}
|
|
562
|
-
}), se = { class: "input input-dropdown" }, ce = { class: "dropdown" },
|
|
562
|
+
}), se = { class: "input input-dropdown" }, ce = { class: "dropdown" }, fe = {
|
|
563
563
|
class: "btn-group",
|
|
564
564
|
role: "group"
|
|
565
|
-
},
|
|
565
|
+
}, me = ["id", "disabled"], ye = ["aria-labelledby"], pe = ["onClick"], be = ["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:
|
|
622
|
+
setup(e, { emit: o }) {
|
|
623
623
|
const t = e;
|
|
624
624
|
h({
|
|
625
625
|
get() {
|
|
626
626
|
return t.modelValue;
|
|
627
627
|
},
|
|
628
|
-
set(
|
|
629
|
-
|
|
628
|
+
set(n) {
|
|
629
|
+
o("update:modelValue", n);
|
|
630
630
|
}
|
|
631
631
|
});
|
|
632
|
-
function
|
|
633
|
-
|
|
632
|
+
function d(n) {
|
|
633
|
+
o("update:modelValue", n);
|
|
634
634
|
}
|
|
635
|
-
const
|
|
635
|
+
const a = h(() => [
|
|
636
636
|
{
|
|
637
637
|
text: "Please select"
|
|
638
638
|
},
|
|
639
639
|
...t.options.map(
|
|
640
|
-
(
|
|
640
|
+
(n) => typeof n == "string" ? { value: n, text: n } : n
|
|
641
641
|
)
|
|
642
|
-
]),
|
|
643
|
-
return (
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
642
|
+
]), i = h(() => [...t.options].find((n) => JSON.stringify(n.value) === JSON.stringify(t.modelValue)));
|
|
643
|
+
return (n, l) => (r(), c("div", se, [
|
|
644
|
+
u("div", ce, [
|
|
645
|
+
u("div", fe, [
|
|
646
|
+
u("button", {
|
|
647
647
|
class: b(["btn dropdown-toggle", {
|
|
648
648
|
[`btn-${e.variant}`]: e.variant,
|
|
649
649
|
[`btn-${e.color}`]: e.color,
|
|
@@ -655,25 +655,25 @@ 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
|
-
}, v(p(
|
|
659
|
-
|
|
658
|
+
}, v(p(i) ? p(i).text : e.placeholder), 11, me),
|
|
659
|
+
u("ul", {
|
|
660
660
|
class: "dropdown-menu",
|
|
661
661
|
"aria-labelledby": e.id
|
|
662
662
|
}, [
|
|
663
|
-
(r(!0),
|
|
664
|
-
m(
|
|
665
|
-
|
|
663
|
+
(r(!0), c(M, null, N(p(a), (s, f) => (r(), c("li", { key: f }, [
|
|
664
|
+
m(n.$slots, "option", {}, () => [
|
|
665
|
+
u("a", {
|
|
666
666
|
class: "dropdown-item",
|
|
667
|
-
onClick: T((
|
|
668
|
-
}, v(
|
|
667
|
+
onClick: T((k) => d(s.value), ["prevent"])
|
|
668
|
+
}, v(s.text), 9, pe)
|
|
669
669
|
])
|
|
670
670
|
]))), 128))
|
|
671
671
|
], 8, ye)
|
|
672
672
|
])
|
|
673
673
|
]),
|
|
674
|
-
|
|
675
|
-
m(
|
|
676
|
-
|
|
674
|
+
u("label", { for: e.id }, [
|
|
675
|
+
m(n.$slots, "label", {}, () => [
|
|
676
|
+
V(v(e.label), 1)
|
|
677
677
|
])
|
|
678
678
|
], 8, be)
|
|
679
679
|
]));
|
|
@@ -730,46 +730,51 @@ 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
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
733
|
+
setup(e, { emit: o }) {
|
|
734
|
+
const t = e;
|
|
735
|
+
function d(l) {
|
|
736
|
+
const s = l.target && l.target.files;
|
|
737
|
+
s && (i.splice(0, i.length), Array.from(s).forEach((f) => {
|
|
738
|
+
i.push(f);
|
|
738
739
|
}));
|
|
739
740
|
}
|
|
740
|
-
const
|
|
741
|
-
return h(() =>
|
|
742
|
-
|
|
743
|
-
}, { deep: !0 }), (
|
|
741
|
+
const a = x(), i = P([]), n = h(() => i && i.map((l) => l.name));
|
|
742
|
+
return h(() => i.map((l) => URL.createObjectURL(l))), $(() => t.modelValue, (l, s) => {
|
|
743
|
+
l.length === 0 && (a.value.value = null);
|
|
744
|
+
}, { deep: !0 }), $(() => i, (l, s) => {
|
|
745
|
+
o("update:modelValue", l);
|
|
746
|
+
}, { deep: !0 }), (l, s) => (r(), c("div", {
|
|
744
747
|
class: b(["form-input file-input", "file-input--primary"])
|
|
745
748
|
}, [
|
|
746
|
-
|
|
749
|
+
u("input", {
|
|
750
|
+
ref_key: "input",
|
|
751
|
+
ref: a,
|
|
747
752
|
type: "file",
|
|
748
753
|
id: e.id,
|
|
749
754
|
name: e.name,
|
|
750
755
|
class: "d-none",
|
|
751
|
-
onChange:
|
|
756
|
+
onChange: d,
|
|
752
757
|
multiple: e.multiple,
|
|
753
758
|
accept: e.accept
|
|
754
759
|
}, null, 40, ge),
|
|
755
|
-
|
|
756
|
-
m(
|
|
757
|
-
|
|
760
|
+
u("div", he, [
|
|
761
|
+
m(l.$slots, "input-prepend"),
|
|
762
|
+
u("input", {
|
|
758
763
|
type: "text",
|
|
759
764
|
value: p(n),
|
|
760
765
|
id: e.id,
|
|
761
766
|
name: e.name,
|
|
762
767
|
class: "form-control"
|
|
763
768
|
}, null, 8, ve),
|
|
764
|
-
m(
|
|
765
|
-
|
|
769
|
+
m(l.$slots, "input-append", {}, () => [
|
|
770
|
+
u("label", {
|
|
766
771
|
for: e.id,
|
|
767
772
|
class: "btn btn-outline-dark"
|
|
768
773
|
}, " Select Image ", 8, $e)
|
|
769
774
|
])
|
|
770
775
|
]),
|
|
771
|
-
m(
|
|
772
|
-
|
|
776
|
+
m(l.$slots, "label", {}, () => [
|
|
777
|
+
u("label", {
|
|
773
778
|
for: e.id,
|
|
774
779
|
class: "form-input__label",
|
|
775
780
|
innerHTML: `${e.label}${e.required ? " *" : ""}`
|
|
@@ -777,11 +782,11 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
777
782
|
])
|
|
778
783
|
]));
|
|
779
784
|
}
|
|
780
|
-
}), xe = { class: "media-upload" }, Ve = ["src"],
|
|
785
|
+
}), xe = { class: "media-upload" }, Ve = ["src"], ke = ["onClick"], Be = ["for"];
|
|
781
786
|
async function we(e) {
|
|
782
|
-
return await new Promise((
|
|
787
|
+
return await new Promise((o) => {
|
|
783
788
|
let t = new FileReader();
|
|
784
|
-
t.onload = () =>
|
|
789
|
+
t.onload = () => o(t.result), t.readAsDataURL(e);
|
|
785
790
|
});
|
|
786
791
|
}
|
|
787
792
|
const Pe = /* @__PURE__ */ g({
|
|
@@ -840,52 +845,52 @@ const Pe = /* @__PURE__ */ g({
|
|
|
840
845
|
}
|
|
841
846
|
},
|
|
842
847
|
emits: ["update:modelValue", "update:src"],
|
|
843
|
-
setup(e, { emit:
|
|
844
|
-
const t = e,
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
+
setup(e, { emit: o }) {
|
|
849
|
+
const t = e, d = x([]), a = x([]), i = h(() => t.modelValue.length ? t.modelValue : t.src ? [{ type: "", src: t.src }] : a.value);
|
|
850
|
+
$(() => d, async (l, s) => {
|
|
851
|
+
a.value = await Promise.all(
|
|
852
|
+
l.value.map(async (f) => ({
|
|
848
853
|
src: await we(f),
|
|
849
854
|
type: f.type
|
|
850
855
|
}))
|
|
851
856
|
);
|
|
852
|
-
}, { deep: !0 }),
|
|
853
|
-
const f = t.multiple ?
|
|
854
|
-
|
|
857
|
+
}, { deep: !0 }), $(() => a, async (l, s) => {
|
|
858
|
+
const f = t.multiple ? a.value : a.value[0];
|
|
859
|
+
o("update:modelValue", f), t.multiple || o("update:src", a.value[0] && a.value[0].src);
|
|
855
860
|
}, { deep: !0 });
|
|
856
|
-
function
|
|
857
|
-
|
|
861
|
+
function n(l) {
|
|
862
|
+
d.value.splice(l, 1);
|
|
858
863
|
}
|
|
859
|
-
return (
|
|
860
|
-
const f =
|
|
861
|
-
return r(),
|
|
862
|
-
(r(!0),
|
|
864
|
+
return (l, s) => {
|
|
865
|
+
const f = S("svg-icon"), k = S("file-input");
|
|
866
|
+
return r(), c("div", xe, [
|
|
867
|
+
(r(!0), c(M, null, N(p(i), (B, I) => (r(), c("div", {
|
|
863
868
|
key: B.src,
|
|
864
869
|
class: "media-upload__thumbnail"
|
|
865
870
|
}, [
|
|
866
|
-
|
|
871
|
+
u("img", {
|
|
867
872
|
src: B.src,
|
|
868
873
|
class: "img-thumbnail rounded"
|
|
869
874
|
}, null, 8, Ve),
|
|
870
|
-
|
|
871
|
-
onClick: T((qe) =>
|
|
875
|
+
u("button", {
|
|
876
|
+
onClick: T((qe) => n(I), ["prevent"]),
|
|
872
877
|
class: "btn btn--close"
|
|
873
878
|
}, [
|
|
874
879
|
z(f, { symbol: "x" })
|
|
875
|
-
], 8,
|
|
880
|
+
], 8, ke)
|
|
876
881
|
]))), 128)),
|
|
877
|
-
z(
|
|
878
|
-
modelValue:
|
|
879
|
-
"onUpdate:modelValue":
|
|
882
|
+
z(k, {
|
|
883
|
+
modelValue: d.value,
|
|
884
|
+
"onUpdate:modelValue": s[0] || (s[0] = (B) => d.value = B),
|
|
880
885
|
id: e.id,
|
|
881
886
|
name: e.name,
|
|
882
887
|
accept: e.accept,
|
|
883
888
|
class: "d-none"
|
|
884
889
|
}, null, 8, ["modelValue", "id", "name", "accept"]),
|
|
885
|
-
|
|
890
|
+
u("label", {
|
|
886
891
|
for: e.id,
|
|
887
892
|
class: "btn btn-outline-dark"
|
|
888
|
-
}, " Select Image ", 8,
|
|
893
|
+
}, " Select Image ", 8, Be)
|
|
889
894
|
]);
|
|
890
895
|
};
|
|
891
896
|
}
|