ablok-components 0.0.38 → 0.0.41
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 +189 -182
- 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} +4 -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 (
|
|
27
|
-
class:
|
|
26
|
+
return (o, t) => (r(), c("i", {
|
|
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
|
-
|
|
81
|
+
m(o.$slots, "default")
|
|
82
82
|
]));
|
|
83
83
|
}
|
|
84
84
|
});
|
|
@@ -88,15 +88,17 @@ const Ne = /* @__PURE__ */ g({
|
|
|
88
88
|
tag: null,
|
|
89
89
|
size: null,
|
|
90
90
|
variant: null,
|
|
91
|
-
text: null
|
|
91
|
+
text: null,
|
|
92
|
+
className: null
|
|
92
93
|
},
|
|
93
94
|
setup(e) {
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
const o = e, t = h(() => o.tag || "p");
|
|
96
|
+
return (d, a) => (r(), C(D(p(t)), {
|
|
97
|
+
class: b(["headline", `headline--${e.size}${e.className || ""}`])
|
|
96
98
|
}, {
|
|
97
99
|
default: A(() => [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
m(d.$slots, "default", {}, () => [
|
|
101
|
+
V(v(e.text), 1)
|
|
100
102
|
])
|
|
101
103
|
]),
|
|
102
104
|
_: 3
|
|
@@ -111,11 +113,11 @@ const Ne = /* @__PURE__ */ g({
|
|
|
111
113
|
className: null
|
|
112
114
|
},
|
|
113
115
|
setup(e) {
|
|
114
|
-
return (
|
|
115
|
-
class:
|
|
116
|
+
return (o, t) => (r(), c("p", {
|
|
117
|
+
class: b(["base-paragraph", `base-paragraph--${e.size}${e.className || ""}`])
|
|
116
118
|
}, [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
m(o.$slots, "default", {}, () => [
|
|
120
|
+
V(v(e.text), 1)
|
|
119
121
|
])
|
|
120
122
|
], 2));
|
|
121
123
|
}
|
|
@@ -136,15 +138,15 @@ const Ne = /* @__PURE__ */ g({
|
|
|
136
138
|
fab: { type: Boolean }
|
|
137
139
|
},
|
|
138
140
|
setup(e) {
|
|
139
|
-
const
|
|
140
|
-
return (
|
|
141
|
-
const
|
|
142
|
-
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", {
|
|
143
145
|
type: e.type,
|
|
144
146
|
disabled: e.disabled,
|
|
145
147
|
href: e.href,
|
|
146
148
|
to: e.to,
|
|
147
|
-
class:
|
|
149
|
+
class: b(["base-button btn btn-primary", {
|
|
148
150
|
disabled: e.disabled,
|
|
149
151
|
pending: e.pending,
|
|
150
152
|
rounded: e.rounded,
|
|
@@ -156,16 +158,16 @@ const Ne = /* @__PURE__ */ g({
|
|
|
156
158
|
"x-small": e.size === "x-small"
|
|
157
159
|
}])
|
|
158
160
|
}, [
|
|
159
|
-
|
|
160
|
-
e.icon ? (r(), C(
|
|
161
|
+
m(d.$slots, "default", {}, () => [
|
|
162
|
+
e.icon ? (r(), C(i, {
|
|
161
163
|
key: 0,
|
|
162
164
|
id: e.icon,
|
|
163
165
|
class: "base-button__caption"
|
|
164
|
-
}, null, 8, ["id"])) :
|
|
165
|
-
|
|
166
|
+
}, null, 8, ["id"])) : w("", !0),
|
|
167
|
+
p(t) ? (r(), c("span", {
|
|
166
168
|
key: 1,
|
|
167
|
-
class:
|
|
168
|
-
}, v(e.caption), 3)) :
|
|
169
|
+
class: b(["base-button__caption", { "icon-padding": e.icon }])
|
|
170
|
+
}, v(e.caption), 3)) : w("", !0)
|
|
169
171
|
])
|
|
170
172
|
], 10, K);
|
|
171
173
|
};
|
|
@@ -233,22 +235,22 @@ const Q = { class: "input-group form-input__input-group" }, W = ["type", "id", "
|
|
|
233
235
|
}
|
|
234
236
|
},
|
|
235
237
|
emits: ["update:modelValue"],
|
|
236
|
-
setup(e, { emit:
|
|
237
|
-
const t = e,
|
|
238
|
+
setup(e, { emit: o }) {
|
|
239
|
+
const t = e, d = h({
|
|
238
240
|
get() {
|
|
239
241
|
return t.modelValue;
|
|
240
242
|
},
|
|
241
|
-
set(
|
|
242
|
-
|
|
243
|
+
set(a) {
|
|
244
|
+
o("update:modelValue", a);
|
|
243
245
|
}
|
|
244
246
|
});
|
|
245
|
-
return (
|
|
246
|
-
class:
|
|
247
|
+
return (a, i) => (r(), c("div", {
|
|
248
|
+
class: b(["form-input", `form-input--${e.type}`])
|
|
247
249
|
}, [
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
"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),
|
|
252
254
|
type: e.type === "color" ? "text" : e.type,
|
|
253
255
|
id: e.id,
|
|
254
256
|
name: e.name,
|
|
@@ -259,17 +261,17 @@ const Q = { class: "input-group form-input__input-group" }, W = ["type", "id", "
|
|
|
259
261
|
required: e.required,
|
|
260
262
|
maxlength: e.maxlength,
|
|
261
263
|
checked: e.checked,
|
|
262
|
-
class:
|
|
264
|
+
class: b(["form-control", {
|
|
263
265
|
"form-check-input": e.type === "checkbox"
|
|
264
266
|
}]),
|
|
265
267
|
"aria-label": e.label
|
|
266
268
|
}, null, 10, W), [
|
|
267
|
-
[H,
|
|
269
|
+
[H, p(d)]
|
|
268
270
|
]),
|
|
269
|
-
|
|
270
|
-
e.type === "color" ? (r(),
|
|
271
|
-
|
|
272
|
-
"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),
|
|
273
275
|
type: "color",
|
|
274
276
|
name: `${e.name}-color`,
|
|
275
277
|
id: `${e.id}-color`,
|
|
@@ -279,15 +281,15 @@ const Q = { class: "input-group form-input__input-group" }, W = ["type", "id", "
|
|
|
279
281
|
class: "form-control",
|
|
280
282
|
"aria-label": e.label
|
|
281
283
|
}, null, 8, _), [
|
|
282
|
-
[U,
|
|
284
|
+
[U, p(d)]
|
|
283
285
|
])
|
|
284
|
-
])) :
|
|
286
|
+
])) : w("", !0)
|
|
285
287
|
])
|
|
286
288
|
]),
|
|
287
|
-
|
|
288
|
-
|
|
289
|
+
m(a.$slots, "label", {}, () => [
|
|
290
|
+
u("label", {
|
|
289
291
|
for: e.id,
|
|
290
|
-
class:
|
|
292
|
+
class: b(["form-input__label", {
|
|
291
293
|
"form-check-label": e.type === "checkbox"
|
|
292
294
|
}]),
|
|
293
295
|
innerHTML: `${e.label}${e.required ? " *" : ""}`
|
|
@@ -355,19 +357,19 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
355
357
|
}
|
|
356
358
|
},
|
|
357
359
|
emits: ["update:modelValue"],
|
|
358
|
-
setup(e, { emit:
|
|
359
|
-
const t = e,
|
|
360
|
+
setup(e, { emit: o }) {
|
|
361
|
+
const t = e, d = h({
|
|
360
362
|
get() {
|
|
361
363
|
return t.modelValue;
|
|
362
364
|
},
|
|
363
|
-
set(
|
|
364
|
-
|
|
365
|
+
set(a) {
|
|
366
|
+
o("update:modelValue", a);
|
|
365
367
|
}
|
|
366
368
|
});
|
|
367
|
-
return (
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
"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),
|
|
371
373
|
type: e.type === "color" ? "text" : e.type,
|
|
372
374
|
id: e.id,
|
|
373
375
|
name: e.name,
|
|
@@ -377,15 +379,15 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
377
379
|
"read-only": e.readOnly,
|
|
378
380
|
required: e.required,
|
|
379
381
|
maxlength: e.maxlength,
|
|
380
|
-
class:
|
|
382
|
+
class: b(["form-control", {}]),
|
|
381
383
|
"aria-label": e.label
|
|
382
384
|
}, null, 8, le), [
|
|
383
|
-
[U,
|
|
385
|
+
[U, p(d)]
|
|
384
386
|
]),
|
|
385
|
-
|
|
386
|
-
e.type === "color" ? (r(),
|
|
387
|
-
|
|
388
|
-
"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),
|
|
389
391
|
type: "color",
|
|
390
392
|
name: `${e.name}-color`,
|
|
391
393
|
id: `${e.id}-color`,
|
|
@@ -395,14 +397,14 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
395
397
|
class: "form-control",
|
|
396
398
|
"aria-label": e.label
|
|
397
399
|
}, null, 8, ne), [
|
|
398
|
-
[U,
|
|
400
|
+
[U, p(d)]
|
|
399
401
|
])
|
|
400
|
-
])) :
|
|
402
|
+
])) : w("", !0)
|
|
401
403
|
]),
|
|
402
|
-
|
|
403
|
-
|
|
404
|
+
m(a.$slots, "label", {}, () => [
|
|
405
|
+
u("label", {
|
|
404
406
|
for: e.id,
|
|
405
|
-
class:
|
|
407
|
+
class: b(["form-input__label", {
|
|
406
408
|
"form-check-label": e.type === "checkbox"
|
|
407
409
|
}]),
|
|
408
410
|
innerHTML: `${e.label}${e.required ? " *" : ""}`
|
|
@@ -450,37 +452,37 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
450
452
|
}
|
|
451
453
|
},
|
|
452
454
|
emits: ["change", "update:modelValue"],
|
|
453
|
-
setup(e, { emit:
|
|
454
|
-
const t = e,
|
|
455
|
-
return
|
|
456
|
-
|
|
457
|
-
(
|
|
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)
|
|
458
460
|
);
|
|
459
|
-
}, { immediate: !0 }),
|
|
460
|
-
const
|
|
461
|
-
const
|
|
462
|
-
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];
|
|
463
465
|
}, []);
|
|
464
|
-
|
|
466
|
+
o("update:modelValue", n);
|
|
465
467
|
}, { deep: !0 }), L(() => {
|
|
466
|
-
}), (
|
|
467
|
-
const
|
|
468
|
-
return r(),
|
|
469
|
-
(r(!0),
|
|
470
|
-
key:
|
|
471
|
-
modelValue:
|
|
472
|
-
"onUpdate:modelValue": (
|
|
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,
|
|
473
475
|
type: "checkbox",
|
|
474
476
|
name: e.name,
|
|
475
|
-
id: `${e.id}-${
|
|
476
|
-
label: `${
|
|
477
|
+
id: `${e.id}-${s}`,
|
|
478
|
+
label: `${l.text || l}${e.required ? " *" : ""}`,
|
|
477
479
|
disabled: e.disabled,
|
|
478
480
|
"read-only": e.readOnly,
|
|
479
481
|
required: e.required
|
|
480
482
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "name", "id", "label", "disabled", "read-only", "required"]))), 128)),
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
483
|
+
u("label", { for: e.id }, [
|
|
484
|
+
m(a.$slots, "label", {}, () => [
|
|
485
|
+
V(v(e.label), 1)
|
|
484
486
|
])
|
|
485
487
|
], 8, oe)
|
|
486
488
|
]);
|
|
@@ -526,32 +528,32 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
526
528
|
}
|
|
527
529
|
},
|
|
528
530
|
emits: ["change", "update:modelValue"],
|
|
529
|
-
setup(e, { emit:
|
|
531
|
+
setup(e, { emit: o }) {
|
|
530
532
|
const t = e;
|
|
531
|
-
|
|
532
|
-
function a
|
|
533
|
-
|
|
533
|
+
x(t.options.map((a) => a.value === t.modelValue));
|
|
534
|
+
function d(a) {
|
|
535
|
+
o("update:modelValue", a);
|
|
534
536
|
}
|
|
535
537
|
return L(() => {
|
|
536
|
-
}), (
|
|
537
|
-
const
|
|
538
|
-
return r(),
|
|
539
|
-
(r(!0),
|
|
540
|
-
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,
|
|
541
543
|
type: "radio",
|
|
542
544
|
name: e.name,
|
|
543
|
-
id: `${e.id}-${
|
|
544
|
-
value:
|
|
545
|
-
label: `${
|
|
546
|
-
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,
|
|
547
549
|
disabled: e.disabled,
|
|
548
550
|
"read-only": e.readOnly,
|
|
549
551
|
required: e.required,
|
|
550
|
-
onChange: (
|
|
552
|
+
onChange: (f) => d(l)
|
|
551
553
|
}, null, 8, ["name", "id", "value", "label", "checked", "disabled", "read-only", "required", "onChange"]))), 128)),
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
554
|
+
u("label", { for: e.id }, [
|
|
555
|
+
m(a.$slots, "label", {}, () => [
|
|
556
|
+
V(v(e.label), 1)
|
|
555
557
|
])
|
|
556
558
|
], 8, re)
|
|
557
559
|
]);
|
|
@@ -617,32 +619,32 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
617
619
|
}
|
|
618
620
|
},
|
|
619
621
|
emits: ["update:modelValue"],
|
|
620
|
-
setup(e, { emit:
|
|
622
|
+
setup(e, { emit: o }) {
|
|
621
623
|
const t = e;
|
|
622
624
|
h({
|
|
623
625
|
get() {
|
|
624
626
|
return t.modelValue;
|
|
625
627
|
},
|
|
626
|
-
set(
|
|
627
|
-
|
|
628
|
+
set(n) {
|
|
629
|
+
o("update:modelValue", n);
|
|
628
630
|
}
|
|
629
631
|
});
|
|
630
|
-
function
|
|
631
|
-
|
|
632
|
+
function d(n) {
|
|
633
|
+
o("update:modelValue", n);
|
|
632
634
|
}
|
|
633
|
-
const
|
|
635
|
+
const a = h(() => [
|
|
634
636
|
{
|
|
635
637
|
text: "Please select"
|
|
636
638
|
},
|
|
637
639
|
...t.options.map(
|
|
638
|
-
(
|
|
640
|
+
(n) => typeof n == "string" ? { value: n, text: n } : n
|
|
639
641
|
)
|
|
640
|
-
]),
|
|
641
|
-
return (
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
class:
|
|
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
|
+
class: b(["btn dropdown-toggle", {
|
|
646
648
|
[`btn-${e.variant}`]: e.variant,
|
|
647
649
|
[`btn-${e.color}`]: e.color,
|
|
648
650
|
[`btn-${e.disabled}`]: e.disabled,
|
|
@@ -653,25 +655,25 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
653
655
|
"data-bs-toggle": "dropdown",
|
|
654
656
|
"aria-expanded": "false",
|
|
655
657
|
disabled: e.disabled
|
|
656
|
-
}, v(
|
|
657
|
-
|
|
658
|
+
}, v(p(i) ? p(i).text : e.placeholder), 11, me),
|
|
659
|
+
u("ul", {
|
|
658
660
|
class: "dropdown-menu",
|
|
659
661
|
"aria-labelledby": e.id
|
|
660
662
|
}, [
|
|
661
|
-
(r(!0),
|
|
662
|
-
|
|
663
|
-
|
|
663
|
+
(r(!0), c(M, null, N(p(a), (s, f) => (r(), c("li", { key: f }, [
|
|
664
|
+
m(n.$slots, "option", {}, () => [
|
|
665
|
+
u("a", {
|
|
664
666
|
class: "dropdown-item",
|
|
665
|
-
onClick: T((
|
|
666
|
-
}, v(
|
|
667
|
+
onClick: T((k) => d(s.value), ["prevent"])
|
|
668
|
+
}, v(s.text), 9, pe)
|
|
667
669
|
])
|
|
668
670
|
]))), 128))
|
|
669
671
|
], 8, ye)
|
|
670
672
|
])
|
|
671
673
|
]),
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
674
|
+
u("label", { for: e.id }, [
|
|
675
|
+
m(n.$slots, "label", {}, () => [
|
|
676
|
+
V(v(e.label), 1)
|
|
675
677
|
])
|
|
676
678
|
], 8, be)
|
|
677
679
|
]));
|
|
@@ -728,46 +730,51 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
728
730
|
}
|
|
729
731
|
},
|
|
730
732
|
emits: ["update:modelValue"],
|
|
731
|
-
setup(e, { emit:
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
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);
|
|
736
739
|
}));
|
|
737
740
|
}
|
|
738
|
-
const a = P([]), n = h(() =>
|
|
739
|
-
return h(() =>
|
|
740
|
-
|
|
741
|
-
}, { deep: !0 }), (
|
|
742
|
-
|
|
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", {
|
|
747
|
+
class: b(["form-input file-input", "file-input--primary"])
|
|
743
748
|
}, [
|
|
744
|
-
|
|
749
|
+
u("input", {
|
|
750
|
+
ref_key: "input",
|
|
751
|
+
ref: a,
|
|
745
752
|
type: "file",
|
|
746
753
|
id: e.id,
|
|
747
754
|
name: e.name,
|
|
748
755
|
class: "d-none",
|
|
749
|
-
onChange:
|
|
756
|
+
onChange: d,
|
|
750
757
|
multiple: e.multiple,
|
|
751
758
|
accept: e.accept
|
|
752
759
|
}, null, 40, ge),
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
760
|
+
u("div", he, [
|
|
761
|
+
m(l.$slots, "input-prepend"),
|
|
762
|
+
u("input", {
|
|
756
763
|
type: "text",
|
|
757
|
-
value:
|
|
764
|
+
value: p(n),
|
|
758
765
|
id: e.id,
|
|
759
766
|
name: e.name,
|
|
760
767
|
class: "form-control"
|
|
761
768
|
}, null, 8, ve),
|
|
762
|
-
|
|
763
|
-
|
|
769
|
+
m(l.$slots, "input-append", {}, () => [
|
|
770
|
+
u("label", {
|
|
764
771
|
for: e.id,
|
|
765
772
|
class: "btn btn-outline-dark"
|
|
766
773
|
}, " Select Image ", 8, $e)
|
|
767
774
|
])
|
|
768
775
|
]),
|
|
769
|
-
|
|
770
|
-
|
|
776
|
+
m(l.$slots, "label", {}, () => [
|
|
777
|
+
u("label", {
|
|
771
778
|
for: e.id,
|
|
772
779
|
class: "form-input__label",
|
|
773
780
|
innerHTML: `${e.label}${e.required ? " *" : ""}`
|
|
@@ -775,11 +782,11 @@ const te = { class: "form-input form-input--textarea" }, le = ["type", "id", "na
|
|
|
775
782
|
])
|
|
776
783
|
]));
|
|
777
784
|
}
|
|
778
|
-
}), xe = { class: "media-upload" }, Ve = ["src"],
|
|
785
|
+
}), xe = { class: "media-upload" }, Ve = ["src"], ke = ["onClick"], Be = ["for"];
|
|
779
786
|
async function we(e) {
|
|
780
|
-
return await new Promise((
|
|
787
|
+
return await new Promise((o) => {
|
|
781
788
|
let t = new FileReader();
|
|
782
|
-
t.onload = () =>
|
|
789
|
+
t.onload = () => o(t.result), t.readAsDataURL(e);
|
|
783
790
|
});
|
|
784
791
|
}
|
|
785
792
|
const Pe = /* @__PURE__ */ g({
|
|
@@ -838,52 +845,52 @@ const Pe = /* @__PURE__ */ g({
|
|
|
838
845
|
}
|
|
839
846
|
},
|
|
840
847
|
emits: ["update:modelValue", "update:src"],
|
|
841
|
-
setup(e, { emit:
|
|
842
|
-
const t = e,
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
src: await we(
|
|
847
|
-
type:
|
|
848
|
+
setup(e, { emit: o }) {
|
|
849
|
+
const t = e, d = x([]), a = x([]), i = h(() => t.modelValue.length ? t.modelValue : t.src ? [{ type: "", src: t.src }] : a.value);
|
|
850
|
+
$(() => d, async (l, s) => {
|
|
851
|
+
a.value = await Promise.all(
|
|
852
|
+
l.value.map(async (f) => ({
|
|
853
|
+
src: await we(f),
|
|
854
|
+
type: f.type
|
|
848
855
|
}))
|
|
849
856
|
);
|
|
850
|
-
}, { deep: !0 }),
|
|
851
|
-
const
|
|
852
|
-
|
|
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);
|
|
853
860
|
}, { deep: !0 });
|
|
854
|
-
function l
|
|
855
|
-
|
|
861
|
+
function n(l) {
|
|
862
|
+
d.value.splice(l, 1);
|
|
856
863
|
}
|
|
857
|
-
return (
|
|
858
|
-
const
|
|
859
|
-
return r(),
|
|
860
|
-
(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", {
|
|
861
868
|
key: B.src,
|
|
862
869
|
class: "media-upload__thumbnail"
|
|
863
870
|
}, [
|
|
864
|
-
|
|
871
|
+
u("img", {
|
|
865
872
|
src: B.src,
|
|
866
873
|
class: "img-thumbnail rounded"
|
|
867
874
|
}, null, 8, Ve),
|
|
868
|
-
|
|
869
|
-
onClick: T((qe) =>
|
|
875
|
+
u("button", {
|
|
876
|
+
onClick: T((qe) => n(I), ["prevent"]),
|
|
870
877
|
class: "btn btn--close"
|
|
871
878
|
}, [
|
|
872
|
-
z(
|
|
873
|
-
], 8,
|
|
879
|
+
z(f, { symbol: "x" })
|
|
880
|
+
], 8, ke)
|
|
874
881
|
]))), 128)),
|
|
875
|
-
z(
|
|
876
|
-
modelValue:
|
|
877
|
-
"onUpdate:modelValue":
|
|
882
|
+
z(k, {
|
|
883
|
+
modelValue: d.value,
|
|
884
|
+
"onUpdate:modelValue": s[0] || (s[0] = (B) => d.value = B),
|
|
878
885
|
id: e.id,
|
|
879
886
|
name: e.name,
|
|
880
887
|
accept: e.accept,
|
|
881
888
|
class: "d-none"
|
|
882
889
|
}, null, 8, ["modelValue", "id", "name", "accept"]),
|
|
883
|
-
|
|
890
|
+
u("label", {
|
|
884
891
|
for: e.id,
|
|
885
892
|
class: "btn btn-outline-dark"
|
|
886
|
-
}, " Select Image ", 8,
|
|
893
|
+
}, " Select Image ", 8, Be)
|
|
887
894
|
]);
|
|
888
895
|
};
|
|
889
896
|
}
|