ablok-components 0.0.34 → 0.0.37
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
|
|
1
|
+
import { defineComponent as g, openBlock as u, createElementBlock as s, normalizeClass as b, createElementVNode as o, renderSlot as m, computed as h, resolveComponent as $, createBlock as U, createCommentVNode as k, unref as p, toDisplayString as v, withDirectives as B, isRef as w, vModelDynamic as A, vModelText as C, ref as q, watch as S, onBeforeMount as T, Fragment as O, renderList as M, createTextVNode as L, withModifiers as I, reactive as D, createVNode as N } from "vue";
|
|
2
2
|
const R = {
|
|
3
3
|
class: "icon",
|
|
4
4
|
preserveAspectRatio: "xMaxYMin"
|
|
5
|
-
}, F = ["xlink:href"],
|
|
5
|
+
}, F = ["xlink:href"], qe = /* @__PURE__ */ g({
|
|
6
6
|
__name: "svg-icon",
|
|
7
7
|
props: {
|
|
8
8
|
basePath: {
|
|
@@ -23,13 +23,13 @@ const R = {
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
setup(e) {
|
|
26
|
-
return (r,
|
|
27
|
-
class:
|
|
26
|
+
return (r, a) => (u(), s("i", {
|
|
27
|
+
class: b(["svg-icon", {
|
|
28
28
|
[`svg-icon--${e.size}`]: e.size
|
|
29
29
|
}])
|
|
30
30
|
}, [
|
|
31
31
|
(u(), 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",
|
|
35
35
|
x: "0",
|
|
@@ -39,7 +39,7 @@ const R = {
|
|
|
39
39
|
], 2));
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
const
|
|
42
|
+
const H = { class: "loading-spinner d-block" }, P = { class: "loading-spinner__animation" }, E = {
|
|
43
43
|
class: "d-block",
|
|
44
44
|
version: "1.1",
|
|
45
45
|
id: "L9",
|
|
@@ -50,7 +50,7 @@ const P = { class: "loading-spinner d-block" }, H = { 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"], G = /* @__PURE__ */
|
|
53
|
+
}, j = ["fill"], G = /* @__PURE__ */ o("animateTransform", {
|
|
54
54
|
attributeName: "transform",
|
|
55
55
|
attributeType: "XML",
|
|
56
56
|
type: "rotate",
|
|
@@ -60,7 +60,7 @@ const P = { class: "loading-spinner d-block" }, H = { class: "loading-spinner__a
|
|
|
60
60
|
repeatCount: "indefinite"
|
|
61
61
|
}, null, -1), J = [
|
|
62
62
|
G
|
|
63
|
-
],
|
|
63
|
+
], Oe = /* @__PURE__ */ g({
|
|
64
64
|
__name: "loading-spinner",
|
|
65
65
|
props: {
|
|
66
66
|
color: {
|
|
@@ -69,10 +69,10 @@ const P = { class: "loading-spinner d-block" }, H = { class: "loading-spinner__a
|
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
setup(e) {
|
|
72
|
-
return (r,
|
|
73
|
-
|
|
72
|
+
return (r, a) => (u(), s("span", H, [
|
|
73
|
+
o("span", P, [
|
|
74
74
|
(u(), s("svg", E, [
|
|
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
|
}, J, 8, j)
|
|
@@ -82,7 +82,7 @@ const P = { class: "loading-spinner d-block" }, H = { class: "loading-spinner__a
|
|
|
82
82
|
]));
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
|
-
const X = ["type", "disabled", "href", "to"],
|
|
85
|
+
const X = ["type", "disabled", "href", "to"], Me = /* @__PURE__ */ g({
|
|
86
86
|
__name: "base-button",
|
|
87
87
|
props: {
|
|
88
88
|
type: null,
|
|
@@ -99,15 +99,15 @@ const X = ["type", "disabled", "href", "to"], Be = /* @__PURE__ */ b({
|
|
|
99
99
|
fab: { type: Boolean }
|
|
100
100
|
},
|
|
101
101
|
setup(e) {
|
|
102
|
-
const r = e,
|
|
103
|
-
return (
|
|
102
|
+
const r = e, a = h(() => r.caption && !r.fab);
|
|
103
|
+
return (l, n) => {
|
|
104
104
|
const d = $("svg-icon");
|
|
105
105
|
return u(), s("button", {
|
|
106
106
|
type: e.type,
|
|
107
107
|
disabled: e.disabled,
|
|
108
108
|
href: e.href,
|
|
109
109
|
to: e.to,
|
|
110
|
-
class:
|
|
110
|
+
class: b(["base-button btn btn-primary", {
|
|
111
111
|
disabled: e.disabled,
|
|
112
112
|
pending: e.pending,
|
|
113
113
|
rounded: e.rounded,
|
|
@@ -119,16 +119,16 @@ const X = ["type", "disabled", "href", "to"], Be = /* @__PURE__ */ b({
|
|
|
119
119
|
"x-small": e.size === "x-small"
|
|
120
120
|
}])
|
|
121
121
|
}, [
|
|
122
|
-
m(
|
|
123
|
-
e.icon ? (u(),
|
|
122
|
+
m(l.$slots, "default", {}, () => [
|
|
123
|
+
e.icon ? (u(), U(d, {
|
|
124
124
|
key: 0,
|
|
125
125
|
id: e.icon,
|
|
126
126
|
class: "base-button__caption"
|
|
127
|
-
}, null, 8, ["id"])) :
|
|
128
|
-
p(
|
|
127
|
+
}, null, 8, ["id"])) : k("", !0),
|
|
128
|
+
p(a) ? (u(), s("span", {
|
|
129
129
|
key: 1,
|
|
130
|
-
class:
|
|
131
|
-
},
|
|
130
|
+
class: b(["base-button__caption", { "icon-padding": e.icon }])
|
|
131
|
+
}, v(e.caption), 3)) : k("", !0)
|
|
132
132
|
])
|
|
133
133
|
], 10, X);
|
|
134
134
|
};
|
|
@@ -140,7 +140,7 @@ function y() {
|
|
|
140
140
|
const Y = { class: "input-group form-input__input-group" }, K = ["type", "id", "name", "placeholder", "pattern", "disabled", "read-only", "required", "maxlength", "checked", "aria-label"], Q = {
|
|
141
141
|
key: 0,
|
|
142
142
|
class: "form-input__color-swatch"
|
|
143
|
-
}, W = ["name", "id", "disabled", "read-only", "required", "aria-label"], Z = ["for", "innerHTML"],
|
|
143
|
+
}, W = ["name", "id", "disabled", "read-only", "required", "aria-label"], Z = ["for", "innerHTML"], Ce = /* @__PURE__ */ g({
|
|
144
144
|
__name: "form-input",
|
|
145
145
|
props: {
|
|
146
146
|
modelValue: {
|
|
@@ -197,21 +197,21 @@ const Y = { class: "input-group form-input__input-group" }, K = ["type", "id", "
|
|
|
197
197
|
},
|
|
198
198
|
emits: ["update:modelValue"],
|
|
199
199
|
setup(e, { emit: r }) {
|
|
200
|
-
const
|
|
200
|
+
const a = e, l = h({
|
|
201
201
|
get() {
|
|
202
|
-
return
|
|
202
|
+
return a.modelValue;
|
|
203
203
|
},
|
|
204
204
|
set(n) {
|
|
205
205
|
r("update:modelValue", n);
|
|
206
206
|
}
|
|
207
207
|
});
|
|
208
208
|
return (n, d) => (u(), s("div", {
|
|
209
|
-
class:
|
|
209
|
+
class: b(["form-input", `form-input--${e.type}`])
|
|
210
210
|
}, [
|
|
211
|
-
|
|
211
|
+
o("div", Y, [
|
|
212
212
|
m(n.$slots, "input-prepend"),
|
|
213
|
-
|
|
214
|
-
"onUpdate:modelValue": d[0] || (d[0] = (
|
|
213
|
+
B(o("input", {
|
|
214
|
+
"onUpdate:modelValue": d[0] || (d[0] = (t) => w(l) ? l.value = t : null),
|
|
215
215
|
type: e.type === "color" ? "text" : e.type,
|
|
216
216
|
id: e.id,
|
|
217
217
|
name: e.name,
|
|
@@ -222,15 +222,17 @@ const Y = { class: "input-group form-input__input-group" }, K = ["type", "id", "
|
|
|
222
222
|
required: e.required,
|
|
223
223
|
maxlength: e.maxlength,
|
|
224
224
|
checked: e.checked,
|
|
225
|
-
class: "form-control",
|
|
225
|
+
class: b(["form-control", {
|
|
226
|
+
"form-check-input": e.type === "checkbox"
|
|
227
|
+
}]),
|
|
226
228
|
"aria-label": e.label
|
|
227
|
-
}, null,
|
|
228
|
-
[
|
|
229
|
+
}, null, 10, K), [
|
|
230
|
+
[A, p(l)]
|
|
229
231
|
]),
|
|
230
232
|
m(n.$slots, "input-append", {}, () => [
|
|
231
233
|
e.type === "color" ? (u(), s("span", Q, [
|
|
232
|
-
|
|
233
|
-
"onUpdate:modelValue": d[1] || (d[1] = (
|
|
234
|
+
B(o("input", {
|
|
235
|
+
"onUpdate:modelValue": d[1] || (d[1] = (t) => w(l) ? l.value = t : null),
|
|
234
236
|
type: "color",
|
|
235
237
|
name: `${e.name}-color`,
|
|
236
238
|
id: `${e.id}-color`,
|
|
@@ -240,22 +242,138 @@ const Y = { class: "input-group form-input__input-group" }, K = ["type", "id", "
|
|
|
240
242
|
class: "form-control",
|
|
241
243
|
"aria-label": e.label
|
|
242
244
|
}, null, 8, W), [
|
|
243
|
-
[
|
|
245
|
+
[C, p(l)]
|
|
244
246
|
])
|
|
245
|
-
])) :
|
|
247
|
+
])) : k("", !0)
|
|
246
248
|
])
|
|
247
249
|
]),
|
|
248
250
|
m(n.$slots, "label", {}, () => [
|
|
249
|
-
|
|
251
|
+
o("label", {
|
|
250
252
|
for: e.id,
|
|
251
|
-
class: "form-input__label",
|
|
253
|
+
class: b(["form-input__label", {
|
|
254
|
+
"form-check-label": e.type === "checkbox"
|
|
255
|
+
}]),
|
|
252
256
|
innerHTML: `${e.label}${e.required ? " *" : ""}`
|
|
253
|
-
}, null,
|
|
257
|
+
}, null, 10, Z)
|
|
254
258
|
])
|
|
255
259
|
], 2));
|
|
256
260
|
}
|
|
257
261
|
});
|
|
258
|
-
const _ = { class: "
|
|
262
|
+
const _ = { class: "form-input form-input--textarea" }, ee = ["type", "id", "name", "placeholder", "pattern", "disabled", "read-only", "required", "maxlength", "aria-label"], te = {
|
|
263
|
+
key: 0,
|
|
264
|
+
class: "form-input__color-swatch"
|
|
265
|
+
}, le = ["name", "id", "disabled", "read-only", "required", "aria-label"], ae = ["for", "innerHTML"], Ue = /* @__PURE__ */ g({
|
|
266
|
+
__name: "input-textarea",
|
|
267
|
+
props: {
|
|
268
|
+
modelValue: {
|
|
269
|
+
type: String,
|
|
270
|
+
default: ""
|
|
271
|
+
},
|
|
272
|
+
type: {
|
|
273
|
+
type: String,
|
|
274
|
+
default: "text"
|
|
275
|
+
},
|
|
276
|
+
name: {
|
|
277
|
+
type: String,
|
|
278
|
+
default: () => y()
|
|
279
|
+
},
|
|
280
|
+
id: {
|
|
281
|
+
type: String,
|
|
282
|
+
default: () => y()
|
|
283
|
+
},
|
|
284
|
+
label: {
|
|
285
|
+
type: String,
|
|
286
|
+
default: ""
|
|
287
|
+
},
|
|
288
|
+
placeholder: {
|
|
289
|
+
type: String,
|
|
290
|
+
default: ""
|
|
291
|
+
},
|
|
292
|
+
variant: {
|
|
293
|
+
type: String,
|
|
294
|
+
default: ""
|
|
295
|
+
},
|
|
296
|
+
disabled: {
|
|
297
|
+
type: Boolean,
|
|
298
|
+
default: !1
|
|
299
|
+
},
|
|
300
|
+
readOnly: {
|
|
301
|
+
type: Boolean,
|
|
302
|
+
default: !1
|
|
303
|
+
},
|
|
304
|
+
required: {
|
|
305
|
+
type: Boolean,
|
|
306
|
+
default: !1
|
|
307
|
+
},
|
|
308
|
+
maxlength: {
|
|
309
|
+
type: Number
|
|
310
|
+
},
|
|
311
|
+
pattern: {
|
|
312
|
+
type: String,
|
|
313
|
+
default: null
|
|
314
|
+
},
|
|
315
|
+
checked: {
|
|
316
|
+
type: Boolean,
|
|
317
|
+
default: !1
|
|
318
|
+
}
|
|
319
|
+
},
|
|
320
|
+
emits: ["update:modelValue"],
|
|
321
|
+
setup(e, { emit: r }) {
|
|
322
|
+
const a = e, l = h({
|
|
323
|
+
get() {
|
|
324
|
+
return a.modelValue;
|
|
325
|
+
},
|
|
326
|
+
set(n) {
|
|
327
|
+
r("update:modelValue", n);
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
return (n, d) => (u(), s("div", _, [
|
|
331
|
+
m(n.$slots, "input-prepend"),
|
|
332
|
+
B(o("textarea", {
|
|
333
|
+
"onUpdate:modelValue": d[0] || (d[0] = (t) => w(l) ? l.value = t : null),
|
|
334
|
+
type: e.type === "color" ? "text" : e.type,
|
|
335
|
+
id: e.id,
|
|
336
|
+
name: e.name,
|
|
337
|
+
placeholder: e.placeholder,
|
|
338
|
+
pattern: e.pattern,
|
|
339
|
+
disabled: e.disabled,
|
|
340
|
+
"read-only": e.readOnly,
|
|
341
|
+
required: e.required,
|
|
342
|
+
maxlength: e.maxlength,
|
|
343
|
+
class: b(["form-control", {}]),
|
|
344
|
+
"aria-label": e.label
|
|
345
|
+
}, null, 8, ee), [
|
|
346
|
+
[C, p(l)]
|
|
347
|
+
]),
|
|
348
|
+
m(n.$slots, "input-append", {}, () => [
|
|
349
|
+
e.type === "color" ? (u(), s("span", te, [
|
|
350
|
+
B(o("input", {
|
|
351
|
+
"onUpdate:modelValue": d[1] || (d[1] = (t) => w(l) ? l.value = t : null),
|
|
352
|
+
type: "color",
|
|
353
|
+
name: `${e.name}-color`,
|
|
354
|
+
id: `${e.id}-color`,
|
|
355
|
+
disabled: e.disabled,
|
|
356
|
+
"read-only": e.readOnly,
|
|
357
|
+
required: e.required,
|
|
358
|
+
class: "form-control",
|
|
359
|
+
"aria-label": e.label
|
|
360
|
+
}, null, 8, le), [
|
|
361
|
+
[C, p(l)]
|
|
362
|
+
])
|
|
363
|
+
])) : k("", !0)
|
|
364
|
+
]),
|
|
365
|
+
m(n.$slots, "label", {}, () => [
|
|
366
|
+
o("label", {
|
|
367
|
+
for: e.id,
|
|
368
|
+
class: b(["form-input__label", {
|
|
369
|
+
"form-check-label": e.type === "checkbox"
|
|
370
|
+
}]),
|
|
371
|
+
innerHTML: `${e.label}${e.required ? " *" : ""}`
|
|
372
|
+
}, null, 10, ae)
|
|
373
|
+
])
|
|
374
|
+
]));
|
|
375
|
+
}
|
|
376
|
+
}), ne = { class: "radio-group" }, de = ["for"], Le = /* @__PURE__ */ g({
|
|
259
377
|
__name: "check-group",
|
|
260
378
|
props: {
|
|
261
379
|
modelValue: {
|
|
@@ -296,42 +414,42 @@ const _ = { class: "radio-group" }, ee = ["for"], we = /* @__PURE__ */ b({
|
|
|
296
414
|
},
|
|
297
415
|
emits: ["change", "update:modelValue"],
|
|
298
416
|
setup(e, { emit: r }) {
|
|
299
|
-
const
|
|
300
|
-
return S(() =>
|
|
301
|
-
|
|
302
|
-
(
|
|
417
|
+
const a = e, l = q([]);
|
|
418
|
+
return S(() => a.modelValue, (n, d) => {
|
|
419
|
+
l.value = a.options.map(
|
|
420
|
+
(t) => t.value ? a.modelValue.some((i) => i["value "] === t.value) : a.modelValue.some((i) => i === t)
|
|
303
421
|
);
|
|
304
|
-
}, { immediate: !0 }), S(
|
|
305
|
-
const
|
|
306
|
-
const
|
|
307
|
-
return [...
|
|
422
|
+
}, { immediate: !0 }), S(l, (n, d) => {
|
|
423
|
+
const t = n.reduce((i, c, f) => {
|
|
424
|
+
const x = c && a.options[f] ? [a.options[f] || a.options[f]] : [];
|
|
425
|
+
return [...i, ...x];
|
|
308
426
|
}, []);
|
|
309
|
-
r("update:modelValue",
|
|
310
|
-
}, { deep: !0 }),
|
|
427
|
+
r("update:modelValue", t);
|
|
428
|
+
}, { deep: !0 }), T(() => {
|
|
311
429
|
}), (n, d) => {
|
|
312
|
-
const
|
|
313
|
-
return u(), s("div",
|
|
314
|
-
(u(!0), s(
|
|
430
|
+
const t = $("form-input");
|
|
431
|
+
return u(), s("div", ne, [
|
|
432
|
+
(u(!0), s(O, null, M(e.options, (i, c) => (u(), U(t, {
|
|
315
433
|
key: c,
|
|
316
|
-
modelValue: p(
|
|
317
|
-
"onUpdate:modelValue": (f) => p(
|
|
434
|
+
modelValue: p(l)[c],
|
|
435
|
+
"onUpdate:modelValue": (f) => p(l)[c] = f,
|
|
318
436
|
type: "checkbox",
|
|
319
437
|
name: e.name,
|
|
320
438
|
id: `${e.id}-${c}`,
|
|
321
|
-
label: `${
|
|
439
|
+
label: `${i.text || i}${e.required ? " *" : ""}`,
|
|
322
440
|
disabled: e.disabled,
|
|
323
441
|
"read-only": e.readOnly,
|
|
324
442
|
required: e.required
|
|
325
443
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "name", "id", "label", "disabled", "read-only", "required"]))), 128)),
|
|
326
|
-
|
|
444
|
+
o("label", { for: e.id }, [
|
|
327
445
|
m(n.$slots, "label", {}, () => [
|
|
328
|
-
|
|
446
|
+
L(v(e.label), 1)
|
|
329
447
|
])
|
|
330
|
-
], 8,
|
|
448
|
+
], 8, de)
|
|
331
449
|
]);
|
|
332
450
|
};
|
|
333
451
|
}
|
|
334
|
-
}),
|
|
452
|
+
}), oe = { class: "radio-group" }, ie = ["for"], Ne = /* @__PURE__ */ g({
|
|
335
453
|
__name: "radio-group",
|
|
336
454
|
props: {
|
|
337
455
|
modelValue: {
|
|
@@ -372,40 +490,40 @@ const _ = { class: "radio-group" }, ee = ["for"], we = /* @__PURE__ */ b({
|
|
|
372
490
|
},
|
|
373
491
|
emits: ["change", "update:modelValue"],
|
|
374
492
|
setup(e, { emit: r }) {
|
|
375
|
-
const
|
|
376
|
-
|
|
377
|
-
function
|
|
493
|
+
const a = e;
|
|
494
|
+
q(a.options.map((n) => n.value === a.modelValue));
|
|
495
|
+
function l(n) {
|
|
378
496
|
r("update:modelValue", n);
|
|
379
497
|
}
|
|
380
|
-
return
|
|
498
|
+
return T(() => {
|
|
381
499
|
}), (n, d) => {
|
|
382
|
-
const
|
|
383
|
-
return u(), s("div",
|
|
384
|
-
(u(!0), s(
|
|
500
|
+
const t = $("form-input");
|
|
501
|
+
return u(), s("div", oe, [
|
|
502
|
+
(u(!0), s(O, null, M(e.options, (i, c) => (u(), U(t, {
|
|
385
503
|
key: c,
|
|
386
504
|
type: "radio",
|
|
387
505
|
name: e.name,
|
|
388
506
|
id: `${e.id}-${c}`,
|
|
389
|
-
value:
|
|
390
|
-
label: `${
|
|
391
|
-
checked:
|
|
507
|
+
value: i.value || i,
|
|
508
|
+
label: `${i.text || i}${e.required ? " *" : ""}`,
|
|
509
|
+
checked: i.value ? i.value === e.modelValue : i === e.modelValue,
|
|
392
510
|
disabled: e.disabled,
|
|
393
511
|
"read-only": e.readOnly,
|
|
394
512
|
required: e.required,
|
|
395
|
-
onChange: (f) =>
|
|
513
|
+
onChange: (f) => l(i)
|
|
396
514
|
}, null, 8, ["name", "id", "value", "label", "checked", "disabled", "read-only", "required", "onChange"]))), 128)),
|
|
397
|
-
|
|
515
|
+
o("label", { for: e.id }, [
|
|
398
516
|
m(n.$slots, "label", {}, () => [
|
|
399
|
-
|
|
517
|
+
L(v(e.label), 1)
|
|
400
518
|
])
|
|
401
|
-
], 8,
|
|
519
|
+
], 8, ie)
|
|
402
520
|
]);
|
|
403
521
|
};
|
|
404
522
|
}
|
|
405
|
-
}),
|
|
523
|
+
}), ue = { class: "input input-dropdown" }, re = { class: "dropdown" }, se = {
|
|
406
524
|
class: "btn-group",
|
|
407
525
|
role: "group"
|
|
408
|
-
},
|
|
526
|
+
}, ce = ["id", "disabled"], fe = ["aria-labelledby"], me = ["onClick"], ye = ["for"], Te = /* @__PURE__ */ g({
|
|
409
527
|
__name: "input-dropdown",
|
|
410
528
|
props: {
|
|
411
529
|
modelValue: {
|
|
@@ -463,31 +581,31 @@ const _ = { class: "radio-group" }, ee = ["for"], we = /* @__PURE__ */ b({
|
|
|
463
581
|
},
|
|
464
582
|
emits: ["update:modelValue"],
|
|
465
583
|
setup(e, { emit: r }) {
|
|
466
|
-
const
|
|
467
|
-
|
|
584
|
+
const a = e;
|
|
585
|
+
h({
|
|
468
586
|
get() {
|
|
469
|
-
return
|
|
587
|
+
return a.modelValue;
|
|
470
588
|
},
|
|
471
|
-
set(
|
|
472
|
-
r("update:modelValue",
|
|
589
|
+
set(t) {
|
|
590
|
+
r("update:modelValue", t);
|
|
473
591
|
}
|
|
474
592
|
});
|
|
475
|
-
function
|
|
476
|
-
r("update:modelValue",
|
|
593
|
+
function l(t) {
|
|
594
|
+
r("update:modelValue", t);
|
|
477
595
|
}
|
|
478
|
-
const n =
|
|
596
|
+
const n = h(() => [
|
|
479
597
|
{
|
|
480
598
|
text: "Please select"
|
|
481
599
|
},
|
|
482
|
-
...
|
|
483
|
-
(
|
|
600
|
+
...a.options.map(
|
|
601
|
+
(t) => typeof t == "string" ? { value: t, text: t } : t
|
|
484
602
|
)
|
|
485
|
-
]), d =
|
|
486
|
-
return (
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
class:
|
|
603
|
+
]), d = h(() => [...a.options].find((t) => JSON.stringify(t.value) === JSON.stringify(a.modelValue)));
|
|
604
|
+
return (t, i) => (u(), s("div", ue, [
|
|
605
|
+
o("div", re, [
|
|
606
|
+
o("div", se, [
|
|
607
|
+
o("button", {
|
|
608
|
+
class: b(["btn dropdown-toggle", {
|
|
491
609
|
[`btn-${e.variant}`]: e.variant,
|
|
492
610
|
[`btn-${e.color}`]: e.color,
|
|
493
611
|
[`btn-${e.disabled}`]: e.disabled,
|
|
@@ -498,30 +616,30 @@ const _ = { class: "radio-group" }, ee = ["for"], we = /* @__PURE__ */ b({
|
|
|
498
616
|
"data-bs-toggle": "dropdown",
|
|
499
617
|
"aria-expanded": "false",
|
|
500
618
|
disabled: e.disabled
|
|
501
|
-
},
|
|
502
|
-
|
|
619
|
+
}, v(p(d) ? p(d).text : e.placeholder), 11, ce),
|
|
620
|
+
o("ul", {
|
|
503
621
|
class: "dropdown-menu",
|
|
504
622
|
"aria-labelledby": e.id
|
|
505
623
|
}, [
|
|
506
|
-
(u(!0), s(
|
|
507
|
-
m(
|
|
508
|
-
|
|
624
|
+
(u(!0), s(O, null, M(p(n), (c, f) => (u(), s("li", { key: f }, [
|
|
625
|
+
m(t.$slots, "option", {}, () => [
|
|
626
|
+
o("a", {
|
|
509
627
|
class: "dropdown-item",
|
|
510
|
-
onClick:
|
|
511
|
-
},
|
|
628
|
+
onClick: I((x) => l(c.value), ["prevent"])
|
|
629
|
+
}, v(c.text), 9, me)
|
|
512
630
|
])
|
|
513
631
|
]))), 128))
|
|
514
|
-
], 8,
|
|
632
|
+
], 8, fe)
|
|
515
633
|
])
|
|
516
634
|
]),
|
|
517
|
-
|
|
518
|
-
m(
|
|
519
|
-
|
|
635
|
+
o("label", { for: e.id }, [
|
|
636
|
+
m(t.$slots, "label", {}, () => [
|
|
637
|
+
L(v(e.label), 1)
|
|
520
638
|
])
|
|
521
|
-
], 8,
|
|
639
|
+
], 8, ye)
|
|
522
640
|
]));
|
|
523
641
|
}
|
|
524
|
-
}),
|
|
642
|
+
}), pe = ["id", "name", "multiple", "accept"], be = { class: "form-input__input-group input-group" }, ge = ["value", "id", "name"], he = ["for"], ve = ["for", "innerHTML"], Ie = /* @__PURE__ */ g({
|
|
525
643
|
__name: "file-input",
|
|
526
644
|
props: {
|
|
527
645
|
modelValue: {
|
|
@@ -574,60 +692,60 @@ const _ = { class: "radio-group" }, ee = ["for"], we = /* @__PURE__ */ b({
|
|
|
574
692
|
},
|
|
575
693
|
emits: ["update:modelValue"],
|
|
576
694
|
setup(e, { emit: r }) {
|
|
577
|
-
function
|
|
578
|
-
const
|
|
579
|
-
|
|
580
|
-
|
|
695
|
+
function a(d) {
|
|
696
|
+
const t = d.target && d.target.files;
|
|
697
|
+
t && (l.splice(0, l.length), Array.from(t).forEach((i) => {
|
|
698
|
+
l.push(i);
|
|
581
699
|
}));
|
|
582
700
|
}
|
|
583
|
-
const
|
|
584
|
-
return
|
|
701
|
+
const l = D([]), n = h(() => l && l.map((d) => d.name));
|
|
702
|
+
return h(() => l.map((d) => URL.createObjectURL(d))), S(() => l, (d, t) => {
|
|
585
703
|
console.log("file input", d), r("update:modelValue", d);
|
|
586
|
-
}, { deep: !0 }), (d,
|
|
587
|
-
class:
|
|
704
|
+
}, { deep: !0 }), (d, t) => (u(), s("div", {
|
|
705
|
+
class: b(["form-input file-input", "file-input--primary"])
|
|
588
706
|
}, [
|
|
589
|
-
|
|
707
|
+
o("input", {
|
|
590
708
|
type: "file",
|
|
591
709
|
id: e.id,
|
|
592
710
|
name: e.name,
|
|
593
711
|
class: "d-none",
|
|
594
|
-
onChange:
|
|
712
|
+
onChange: a,
|
|
595
713
|
multiple: e.multiple,
|
|
596
714
|
accept: e.accept
|
|
597
|
-
}, null, 40,
|
|
598
|
-
|
|
715
|
+
}, null, 40, pe),
|
|
716
|
+
o("div", be, [
|
|
599
717
|
m(d.$slots, "input-prepend"),
|
|
600
|
-
|
|
718
|
+
o("input", {
|
|
601
719
|
type: "text",
|
|
602
720
|
value: p(n),
|
|
603
721
|
id: e.id,
|
|
604
722
|
name: e.name,
|
|
605
723
|
class: "form-control"
|
|
606
|
-
}, null, 8,
|
|
724
|
+
}, null, 8, ge),
|
|
607
725
|
m(d.$slots, "input-append", {}, () => [
|
|
608
|
-
|
|
726
|
+
o("label", {
|
|
609
727
|
for: e.id,
|
|
610
728
|
class: "btn btn-outline-dark"
|
|
611
|
-
}, " Select Image ", 8,
|
|
729
|
+
}, " Select Image ", 8, he)
|
|
612
730
|
])
|
|
613
731
|
]),
|
|
614
732
|
m(d.$slots, "label", {}, () => [
|
|
615
|
-
|
|
733
|
+
o("label", {
|
|
616
734
|
for: e.id,
|
|
617
735
|
class: "form-input__label",
|
|
618
736
|
innerHTML: `${e.label}${e.required ? " *" : ""}`
|
|
619
|
-
}, null, 8,
|
|
737
|
+
}, null, 8, ve)
|
|
620
738
|
])
|
|
621
739
|
]));
|
|
622
740
|
}
|
|
623
|
-
}),
|
|
624
|
-
async function
|
|
741
|
+
}), $e = { class: "media-upload" }, Se = ["src"], xe = ["onClick"], Ve = ["for"];
|
|
742
|
+
async function ke(e) {
|
|
625
743
|
return await new Promise((r) => {
|
|
626
|
-
let
|
|
627
|
-
|
|
744
|
+
let a = new FileReader();
|
|
745
|
+
a.onload = () => r(a.result), a.readAsDataURL(e);
|
|
628
746
|
});
|
|
629
747
|
}
|
|
630
|
-
const
|
|
748
|
+
const ze = /* @__PURE__ */ g({
|
|
631
749
|
__name: "media-upload",
|
|
632
750
|
props: {
|
|
633
751
|
modelValue: {
|
|
@@ -684,63 +802,64 @@ const Me = /* @__PURE__ */ b({
|
|
|
684
802
|
},
|
|
685
803
|
emits: ["update:modelValue", "update:src"],
|
|
686
804
|
setup(e, { emit: r }) {
|
|
687
|
-
const
|
|
688
|
-
S(() =>
|
|
805
|
+
const a = e, l = q([]), n = q([]), d = h(() => a.modelValue.length ? a.modelValue : a.src ? [{ type: "", src: a.src }] : n.value);
|
|
806
|
+
S(() => l, async (i, c) => {
|
|
689
807
|
n.value = await Promise.all(
|
|
690
|
-
|
|
691
|
-
src: await
|
|
808
|
+
i.value.map(async (f) => ({
|
|
809
|
+
src: await ke(f),
|
|
692
810
|
type: f.type
|
|
693
811
|
}))
|
|
694
812
|
);
|
|
695
|
-
}, { deep: !0 }), S(() => n, async (
|
|
696
|
-
const f =
|
|
697
|
-
r("update:modelValue", f),
|
|
813
|
+
}, { deep: !0 }), S(() => n, async (i, c) => {
|
|
814
|
+
const f = a.multiple ? n.value : [n.value[0]];
|
|
815
|
+
r("update:modelValue", f), a.multiple || r("update:src", n.value[0] && n.value[0].src);
|
|
698
816
|
}, { deep: !0 });
|
|
699
|
-
function
|
|
700
|
-
|
|
817
|
+
function t(i) {
|
|
818
|
+
l.value.splice(i, 1);
|
|
701
819
|
}
|
|
702
|
-
return (
|
|
703
|
-
const f = $("svg-icon"),
|
|
704
|
-
return u(), s("div",
|
|
705
|
-
(u(!0), s(
|
|
706
|
-
key:
|
|
820
|
+
return (i, c) => {
|
|
821
|
+
const f = $("svg-icon"), x = $("file-input");
|
|
822
|
+
return u(), s("div", $e, [
|
|
823
|
+
(u(!0), s(O, null, M(p(d), (V, z) => (u(), s("div", {
|
|
824
|
+
key: V.src,
|
|
707
825
|
class: "media-upload__thumbnail"
|
|
708
826
|
}, [
|
|
709
|
-
|
|
710
|
-
src:
|
|
827
|
+
o("img", {
|
|
828
|
+
src: V.src,
|
|
711
829
|
class: "img-thumbnail rounded"
|
|
712
|
-
}, null, 8,
|
|
713
|
-
|
|
714
|
-
onClick:
|
|
830
|
+
}, null, 8, Se),
|
|
831
|
+
o("button", {
|
|
832
|
+
onClick: I((Be) => t(z), ["prevent"]),
|
|
715
833
|
class: "btn btn--close"
|
|
716
834
|
}, [
|
|
717
|
-
|
|
718
|
-
], 8,
|
|
835
|
+
N(f, { symbol: "x" })
|
|
836
|
+
], 8, xe)
|
|
719
837
|
]))), 128)),
|
|
720
|
-
|
|
721
|
-
modelValue:
|
|
722
|
-
"onUpdate:modelValue": c[0] || (c[0] = (
|
|
838
|
+
N(x, {
|
|
839
|
+
modelValue: l.value,
|
|
840
|
+
"onUpdate:modelValue": c[0] || (c[0] = (V) => l.value = V),
|
|
723
841
|
id: e.id,
|
|
724
842
|
name: e.name,
|
|
725
843
|
accept: e.accept,
|
|
726
844
|
class: "d-none"
|
|
727
845
|
}, null, 8, ["modelValue", "id", "name", "accept"]),
|
|
728
|
-
|
|
846
|
+
o("label", {
|
|
729
847
|
for: e.id,
|
|
730
848
|
class: "btn btn-outline-dark"
|
|
731
|
-
}, " Select Image ", 8,
|
|
849
|
+
}, " Select Image ", 8, Ve)
|
|
732
850
|
]);
|
|
733
851
|
};
|
|
734
852
|
}
|
|
735
853
|
});
|
|
736
854
|
export {
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
855
|
+
Me as BaseButton,
|
|
856
|
+
Le as CheckGroup,
|
|
857
|
+
Ie as FileInput,
|
|
858
|
+
Ce as FormInput,
|
|
859
|
+
Te as InputDropdown,
|
|
860
|
+
Ue as InputTextarea,
|
|
861
|
+
Oe as LoadingSpinner,
|
|
862
|
+
ze as MediaUpload,
|
|
863
|
+
Ne as RadioGroup,
|
|
864
|
+
qe as SvgIcon
|
|
746
865
|
};
|