@robuust-digital/vue-components 2.6.8 → 2.7.0

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,705 +0,0 @@
1
- import { openBlock as l, createElementBlock as n, createElementVNode as u, defineComponent as w, Fragment as k, renderList as V, renderSlot as c, createTextVNode as S, toDisplayString as g, createVNode as I, unref as h, normalizeClass as p, createBlock as C, resolveDynamicComponent as P, withCtx as O, createCommentVNode as $, computed as B, useAttrs as A, ref as x, withDirectives as M, mergeProps as y, vModelDynamic as F, normalizeProps as j, guardReactiveProps as E, vModelSelect as H, vModelText as D } from "vue";
2
- import { r as R } from "./XMarkIcon-CPr_Rd8y.js";
3
- import { u as T } from "./FormInput.vue_vue_type_script_setup_true_lang-Bg7YPGyY.js";
4
- import { S as U } from "./icon-spinner-BYCMrTdL.js";
5
- import { r as Z } from "./ChevronDownIcon-BYWciGnh.js";
6
- function K(e, r) {
7
- return l(), n("svg", {
8
- xmlns: "http://www.w3.org/2000/svg",
9
- viewBox: "0 0 24 24",
10
- fill: "currentColor",
11
- "aria-hidden": "true",
12
- "data-slot": "icon"
13
- }, [
14
- u("path", {
15
- "fill-rule": "evenodd",
16
- d: "M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.74a.75.75 0 0 1 1.04-.207Z",
17
- "clip-rule": "evenodd"
18
- })
19
- ]);
20
- }
21
- function q(e, r) {
22
- return l(), n("svg", {
23
- xmlns: "http://www.w3.org/2000/svg",
24
- viewBox: "0 0 24 24",
25
- fill: "currentColor",
26
- "aria-hidden": "true",
27
- "data-slot": "icon"
28
- }, [
29
- u("path", {
30
- "fill-rule": "evenodd",
31
- d: "M12 3.75a.75.75 0 0 1 .75.75v6.75h6.75a.75.75 0 0 1 0 1.5h-6.75v6.75a.75.75 0 0 1-1.5 0v-6.75H4.5a.75.75 0 0 1 0-1.5h6.75V4.5a.75.75 0 0 1 .75-.75Z",
32
- "clip-rule": "evenodd"
33
- })
34
- ]);
35
- }
36
- const G = { class: "rvc-accordion" }, J = ["open", "name"], Q = ["innerHTML"], Me = /* @__PURE__ */ w({
37
- __name: "Accordion",
38
- props: {
39
- items: {},
40
- name: {},
41
- defaultOpenIndex: {},
42
- contentClass: {}
43
- },
44
- setup(e) {
45
- return (r, v) => (l(), n("div", G, [
46
- (l(!0), n(k, null, V(e.items, (f, s) => (l(), n("details", {
47
- key: s,
48
- open: e.defaultOpenIndex === s,
49
- name: e.name
50
- }, [
51
- u("summary", null, [
52
- c(r.$slots, "summary", {
53
- item: f,
54
- index: s
55
- }, () => [
56
- S(g(f.title) + " ", 1),
57
- c(r.$slots, "icon", { classList: "rvc-accordion-icon" }, () => [
58
- I(h(q), { class: "rvc-accordion-icon" })
59
- ])
60
- ])
61
- ]),
62
- u("div", {
63
- class: p(["rvc-accordion-content", e.contentClass])
64
- }, [
65
- c(r.$slots, "content", {
66
- item: f,
67
- index: s
68
- }, () => [
69
- u("div", {
70
- innerHTML: f.content
71
- }, null, 8, Q)
72
- ])
73
- ], 2)
74
- ], 8, J))), 128))
75
- ]));
76
- }
77
- }), W = { class: "rvc-alert-title" }, Te = /* @__PURE__ */ w({
78
- __name: "Alert",
79
- props: {
80
- as: { default: "div" },
81
- title: { default: "" },
82
- icon: { type: [Function, Object, null], default: null },
83
- type: { default: "info" },
84
- close: { type: Boolean, default: !1 }
85
- },
86
- emits: ["alert:close"],
87
- setup(e) {
88
- return (r, v) => (l(), C(P(e.as), {
89
- class: p(["rvc-alert", `rvc-alert-${e.type}`])
90
- }, {
91
- default: O(() => [
92
- c(r.$slots, "icon", {}, () => [
93
- e.icon ? (l(), C(P(e.icon), {
94
- key: 0,
95
- class: "rvc-alert-icon"
96
- })) : $("", !0)
97
- ]),
98
- u("div", null, [
99
- c(r.$slots, "title", {}, () => [
100
- u("span", W, g(e.title), 1)
101
- ]),
102
- c(r.$slots, "default")
103
- ]),
104
- c(r.$slots, "close", {}, () => [
105
- e.close ? (l(), n("button", {
106
- key: 0,
107
- type: "button",
108
- class: "rvc-alert-close",
109
- onClick: v[0] || (v[0] = (f) => r.$emit("alert:close"))
110
- }, [
111
- I(h(R))
112
- ])) : $("", !0)
113
- ])
114
- ]),
115
- _: 3
116
- }, 8, ["class"]));
117
- }
118
- }), X = { class: "rvc-checkbox-input" }, Y = {
119
- key: 0,
120
- class: "rvc-checkbox-label"
121
- }, Ae = /* @__PURE__ */ w({
122
- inheritAttrs: !1,
123
- __name: "Checkbox",
124
- props: {
125
- modelValue: { type: [Number, String, Object, Array, Boolean, null], default: null },
126
- label: { default: "" },
127
- rootClass: { default: "" }
128
- },
129
- emits: ["update:modelValue"],
130
- setup(e, { emit: r }) {
131
- const v = e, f = r, s = B({
132
- get: () => v.modelValue,
133
- set: (t) => f("update:modelValue", t)
134
- }), { hasModelBinding: d } = T(), m = A(), a = B(() => ({
135
- ...m,
136
- type: "checkbox"
137
- })), o = x(null);
138
- return (t, i) => (l(), n("label", {
139
- class: p(["rvc-checkbox", e.rootClass])
140
- }, [
141
- u("div", X, [
142
- h(d) ? M((l(), n("input", y({ key: 0 }, a.value, {
143
- ref_key: "input",
144
- ref: o,
145
- "onUpdate:modelValue": i[0] || (i[0] = (b) => s.value = b)
146
- }), null, 16)), [
147
- [F, s.value]
148
- ]) : (l(), n("input", y({ key: 1 }, a.value, {
149
- ref_key: "input",
150
- ref: o
151
- }), null, 16)),
152
- c(t.$slots, "icon", {}, () => [
153
- I(h(K))
154
- ])
155
- ]),
156
- c(t.$slots, "default", { label: e.label }, () => [
157
- e.label ? (l(), n("span", Y, g(e.label), 1)) : $("", !0)
158
- ])
159
- ], 2));
160
- }
161
- });
162
- function _(e, r) {
163
- return l(), n("svg", {
164
- xmlns: "http://www.w3.org/2000/svg",
165
- viewBox: "0 0 16 16",
166
- fill: "currentColor",
167
- "aria-hidden": "true",
168
- "data-slot": "icon"
169
- }, [
170
- u("path", {
171
- "fill-rule": "evenodd",
172
- d: "M8 14a.75.75 0 0 1-.75-.75V4.56L4.03 7.78a.75.75 0 0 1-1.06-1.06l4.5-4.5a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06L8.75 4.56v8.69A.75.75 0 0 1 8 14Z",
173
- "clip-rule": "evenodd"
174
- })
175
- ]);
176
- }
177
- function ee(e, r) {
178
- return l(), n("svg", {
179
- xmlns: "http://www.w3.org/2000/svg",
180
- viewBox: "0 0 20 20",
181
- fill: "currentColor",
182
- "aria-hidden": "true",
183
- "data-slot": "icon"
184
- }, [
185
- u("path", {
186
- "fill-rule": "evenodd",
187
- d: "M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z",
188
- "clip-rule": "evenodd"
189
- })
190
- ]);
191
- }
192
- function te(e, r) {
193
- return l(), n("svg", {
194
- xmlns: "http://www.w3.org/2000/svg",
195
- viewBox: "0 0 20 20",
196
- fill: "currentColor",
197
- "aria-hidden": "true",
198
- "data-slot": "icon"
199
- }, [
200
- u("path", {
201
- "fill-rule": "evenodd",
202
- d: "M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",
203
- "clip-rule": "evenodd"
204
- })
205
- ]);
206
- }
207
- const ae = ["value"], le = ["value"], N = /* @__PURE__ */ w({
208
- inheritAttrs: !1,
209
- __name: "FormSelect",
210
- props: {
211
- modelValue: { type: [String, Number, Object, Boolean, null], default: null },
212
- rootClass: { default: "" },
213
- prefixIcon: { type: [Function, Object, null], default: null },
214
- icon: { type: [Function, Object, null], default: null },
215
- size: { default: "base" },
216
- options: { default: () => [] },
217
- optionLabel: { default: "name" },
218
- optionValue: { default: "id" }
219
- },
220
- emits: ["update:modelValue"],
221
- setup(e, { emit: r }) {
222
- const v = e, f = r, s = B({
223
- get: () => v.modelValue,
224
- set: (a) => f("update:modelValue", a)
225
- }), { hasModelBinding: d } = T(), m = x(null);
226
- return (a, o) => (l(), n("div", {
227
- class: p([
228
- "rvc-select",
229
- `rvc-select-${e.size}`,
230
- e.rootClass
231
- ])
232
- }, [
233
- e.prefixIcon ? c(a.$slots, "prefixIcon", {
234
- key: 0,
235
- icon: e.prefixIcon
236
- }, () => [
237
- (l(), C(P(e.prefixIcon), { "aria-hidden": "true" }))
238
- ]) : $("", !0),
239
- c(a.$slots, "select", j(E(a.$attrs)), () => [
240
- h(d) ? M((l(), n("select", y({ key: 0 }, a.$attrs, {
241
- ref_key: "select",
242
- ref: m,
243
- "onUpdate:modelValue": o[0] || (o[0] = (t) => s.value = t)
244
- }), [
245
- c(a.$slots, "default", {}, () => [
246
- e.options.length > 0 ? (l(!0), n(k, { key: 0 }, V(e.options, (t, i) => (l(), n("option", {
247
- key: `option-${i}-${t[e.optionValue]}`,
248
- value: t[e.optionValue]
249
- }, g(t[e.optionLabel]), 9, ae))), 128)) : $("", !0)
250
- ])
251
- ], 16)), [
252
- [H, s.value]
253
- ]) : (l(), n("select", y({ key: 1 }, a.$attrs, {
254
- ref_key: "select",
255
- ref: m
256
- }), [
257
- c(a.$slots, "default", {}, () => [
258
- e.options.length > 0 ? (l(!0), n(k, { key: 0 }, V(e.options, (t, i) => (l(), n("option", {
259
- key: `option-${i}-${t[e.optionValue]}`,
260
- value: t[e.optionValue]
261
- }, g(t[e.optionLabel]), 9, le))), 128)) : $("", !0)
262
- ])
263
- ], 16))
264
- ]),
265
- c(a.$slots, "icon", { icon: e.icon }, () => [
266
- (l(), C(P(e.icon ?? h(Z)), { "aria-hidden": "true" }))
267
- ])
268
- ], 2));
269
- }
270
- }), ne = {
271
- key: 0,
272
- class: "rvc-pagination"
273
- }, oe = ["value"], se = { class: "rvc-pagination-info" }, ie = { class: "rvc-pagination-nav-list" }, re = ["disabled", "onClick"], ce = { key: 2 }, ue = { key: 3 }, de = /* @__PURE__ */ w({
274
- __name: "Pagination",
275
- props: {
276
- pagination: {},
277
- perPage: { default: 10 },
278
- perPageLabel: { default: "per page" },
279
- perPageOptions: { default: () => [10, 20, 50] },
280
- fromLabel: { default: "of" },
281
- prevIcon: { type: [Function, Object, null], default: null },
282
- nextIcon: { type: [Function, Object, null], default: null }
283
- },
284
- emits: ["pagination:change", "pagination:perPage"],
285
- setup(e, { emit: r }) {
286
- const v = e, f = r, s = B({
287
- get: () => v.perPage,
288
- set: (d) => f("pagination:perPage", Number(d))
289
- });
290
- return (d, m) => e.pagination?.total ? (l(), n("div", ne, [
291
- c(d.$slots, "perPage", y(e.pagination, { perPage: s.value }), () => [
292
- I(N, {
293
- modelValue: s.value,
294
- "onUpdate:modelValue": m[0] || (m[0] = (a) => s.value = a),
295
- size: "sm",
296
- "root-class": "rvc-pagination-per-page"
297
- }, {
298
- default: O(() => [
299
- (l(!0), n(k, null, V(e.perPageOptions, (a) => (l(), n("option", {
300
- key: `pagination-items-per-page-option-${a}`,
301
- value: a
302
- }, g(a) + " " + g(e.perPageLabel), 9, oe))), 128))
303
- ]),
304
- _: 1
305
- }, 8, ["modelValue"])
306
- ]),
307
- c(d.$slots, "info", y(e.pagination, { fromLabel: e.fromLabel }), () => [
308
- u("div", se, g(e.pagination.from) + " - " + g(e.pagination.to) + " " + g(e.fromLabel) + " " + g(e.pagination.total), 1)
309
- ]),
310
- u("nav", null, [
311
- u("ol", ie, [
312
- (l(!0), n(k, null, V(e.pagination.links, (a, o) => (l(), n("li", {
313
- key: `pagination-link-${a.label}-${o}`,
314
- class: "rvc-pagination-nav-list-item"
315
- }, [
316
- u("button", {
317
- type: "button",
318
- disabled: a.label === "..." || !a.url,
319
- class: p([
320
- "rvc-pagination-button",
321
- { "rvc-pagination-button-active": a.active }
322
- ]),
323
- onClick: (t) => a.url && f("pagination:change", a.url)
324
- }, [
325
- a.url !== "..." && o === 0 ? c(d.$slots, "prevIcon", {
326
- key: 0,
327
- icon: e.prevIcon,
328
- link: a,
329
- index: o
330
- }, () => [
331
- (l(), C(P(e.prevIcon || h(ee)), {
332
- "aria-hidden": "true",
333
- class: p([
334
- "rvc-pagination-button-icon",
335
- { "rvc-pagination-button-icon-disabled": !a.url }
336
- ])
337
- }, null, 8, ["class"]))
338
- ]) : a.label !== "..." && o === e.pagination.links.length - 1 ? c(d.$slots, "nextIcon", {
339
- key: 1,
340
- icon: e.nextIcon,
341
- link: a,
342
- index: o
343
- }, () => [
344
- (l(), C(P(e.nextIcon || h(te)), {
345
- "aria-hidden": "true",
346
- class: p([
347
- "rvc-pagination-button-icon",
348
- { "rvc-pagination-button-icon-disabled": !a.url }
349
- ])
350
- }, null, 8, ["class"]))
351
- ]) : a.label === "..." ? (l(), n("span", ce, " ... ")) : (l(), n("span", ue, g(a.label), 1))
352
- ], 10, re)
353
- ]))), 128))
354
- ])
355
- ])
356
- ])) : $("", !0);
357
- }
358
- }), ve = { key: 0 }, fe = ["aria-label", "onClick"], ge = ["innerHTML"], be = { key: 2 }, me = ["colspan"], pe = { key: 3 }, ye = ["colspan"], $e = { class: "rvc-table-spinner-wrapper" }, he = { key: 4 }, Fe = /* @__PURE__ */ w({
359
- __name: "DataTable",
360
- props: {
361
- headers: { default: () => [] },
362
- items: {},
363
- noResultsText: { default: "No results found." },
364
- loadingText: { default: "Loading content..." },
365
- striped: { type: Boolean, default: !1 },
366
- spinning: { type: Boolean, default: !1 },
367
- pagination: { default: null },
368
- perPage: { default: 10 },
369
- perPageLabel: { default: "per page" },
370
- perPageOptions: { default: () => [10, 20, 50] },
371
- fromLabel: { default: "of" },
372
- prevIcon: { type: [Function, Object, null], default: null },
373
- nextIcon: { type: [Function, Object, null], default: null },
374
- wrapperClass: { default: "" },
375
- defaultSort: { default: null }
376
- },
377
- emits: ["table:sortBy", "pagination:change", "pagination:perPage"],
378
- setup(e, { emit: r }) {
379
- const v = e, f = r, s = x(v.defaultSort), d = (a) => v.headers.find((o) => o.key === a), m = (a) => {
380
- a.key && (!s.value || s.value.key !== a.key ? s.value = {
381
- key: a.key,
382
- direction: "asc"
383
- } : s.value.direction === "asc" ? s.value = {
384
- key: a.key,
385
- direction: "desc"
386
- } : s.value = null, f("table:sortBy", s.value));
387
- };
388
- return (a, o) => (l(), n("div", null, [
389
- u("div", {
390
- class: p(["rvc-table-wrapper", e.wrapperClass])
391
- }, [
392
- u("table", {
393
- class: p([{ "rvc-table-striped": e.striped }, "rvc-table"])
394
- }, [
395
- e.headers.length ? (l(), n("thead", ve, [
396
- c(a.$slots, "headers", { headers: e.headers }, () => [
397
- u("tr", null, [
398
- (l(!0), n(k, null, V(e.headers, (t, i) => c(a.$slots, "header", {
399
- header: t,
400
- index: i
401
- }, () => [
402
- (l(), n("th", y({ ref_for: !0 }, { ...t, id: t.id === void 0 || t.id === null ? void 0 : String(t.id) }, {
403
- key: `rvc-table-header-${t.id ?? t.key ?? i}`,
404
- class: {
405
- "rvc-table-text-left": t.align === "left" || !t.align,
406
- "rvc-table-text-center": t.align === "center",
407
- "rvc-table-text-right": t.align === "right"
408
- }
409
- }), [
410
- t.sortable && t.key ? (l(), n("button", {
411
- key: 0,
412
- type: "button",
413
- "aria-label": `Sort on ${t.label}`,
414
- class: p([
415
- "rvc-table-sort-button",
416
- {
417
- "rvc-table-sort-button-center": t.align === "center",
418
- "rvc-table-sort-button-right": t.align === "right"
419
- }
420
- ]),
421
- onClick: (b) => m(t)
422
- }, [
423
- c(a.$slots, "header-label", {
424
- sortBy: s.value,
425
- header: t
426
- }, () => [
427
- S(g(t.label), 1)
428
- ]),
429
- I(h(_), {
430
- class: p([
431
- "rvc-table-sort-icon",
432
- {
433
- "rvc-table-sort-icon-visible": s.value?.key === t.key,
434
- "rvc-table-sort-icon-invisible": !s.value || s.value.key !== t.key,
435
- "rvc-table-sort-icon-rotated": s.value?.key === t.key && s.value.direction === "desc"
436
- }
437
- ])
438
- }, null, 8, ["class"])
439
- ], 10, fe)) : c(a.$slots, "header-label", {
440
- key: 1,
441
- sortBy: s.value,
442
- header: t
443
- }, () => [
444
- S(g(t.label), 1)
445
- ])
446
- ], 16))
447
- ])), 256))
448
- ])
449
- ])
450
- ])) : $("", !0),
451
- e.items.length && !e.spinning ? c(a.$slots, "tbody", {
452
- key: 1,
453
- items: e.items
454
- }, () => [
455
- u("tbody", null, [
456
- (l(!0), n(k, null, V(e.items, (t, i) => c(a.$slots, "items", {
457
- item: t,
458
- index: i
459
- }, () => [
460
- (l(), n("tr", {
461
- key: `rvc-table-row-${i}-${t.id}`
462
- }, [
463
- c(a.$slots, "item", {
464
- item: t,
465
- index: i
466
- }, () => [
467
- (l(!0), n(k, null, V(t, (b, L) => (l(), n("td", y({
468
- key: `rvc-table-row-${i}-column-${L}-${t.id}`
469
- }, { ref_for: !0 }, t.attrs, {
470
- class: {
471
- "rvc-table-text-left": d(String(L))?.align === "left" || !d(String(L))?.align,
472
- "rvc-table-text-center": d(String(L))?.align === "center",
473
- "rvc-table-text-right": d(String(L))?.align === "right"
474
- },
475
- innerHTML: b
476
- }), null, 16, ge))), 128))
477
- ])
478
- ]))
479
- ])), 256))
480
- ])
481
- ]) : !e.items.length && !e.spinning ? (l(), n("tbody", be, [
482
- u("tr", null, [
483
- u("td", {
484
- colspan: e.headers.length,
485
- class: "rvc-table-state"
486
- }, [
487
- u("p", null, g(e.noResultsText), 1)
488
- ], 8, me)
489
- ])
490
- ])) : (l(), n("tbody", pe, [
491
- u("tr", null, [
492
- u("td", {
493
- colspan: e.headers.length,
494
- class: "rvc-table-state"
495
- }, [
496
- c(a.$slots, "spinner", {
497
- spinning: e.spinning,
498
- label: e.loadingText
499
- }, () => [
500
- u("div", $e, [
501
- e.spinning ? (l(), C(h(U), {
502
- key: 0,
503
- "aria-hidden": "true",
504
- class: "rvc-table-spinner"
505
- })) : $("", !0),
506
- S(" " + g(e.loadingText), 1)
507
- ])
508
- ])
509
- ], 8, ye)
510
- ])
511
- ])),
512
- a.$slots.footer ? (l(), n("tfoot", he, [
513
- c(a.$slots, "footer", {
514
- headers: e.headers,
515
- items: e.items
516
- })
517
- ])) : $("", !0)
518
- ], 2)
519
- ], 2),
520
- e.pagination ? c(a.$slots, "pagination", j(y({ key: 0 }, e.pagination)), () => [
521
- I(de, {
522
- pagination: e.pagination,
523
- "per-page": e.perPage,
524
- "per-page-label": e.perPageLabel,
525
- "per-page-options": e.perPageOptions,
526
- "from-label": e.fromLabel,
527
- "prev-icon": e.prevIcon,
528
- "next-icon": e.nextIcon,
529
- "onPagination:change": o[0] || (o[0] = (t) => f("pagination:change", t)),
530
- "onPagination:perPage": o[1] || (o[1] = (t) => f("pagination:perPage", t))
531
- }, null, 8, ["pagination", "per-page", "per-page-label", "per-page-options", "from-label", "prev-icon", "next-icon"])
532
- ]) : $("", !0)
533
- ]));
534
- }
535
- }), ke = {
536
- key: 1,
537
- class: "rvc-empty-state-title"
538
- }, je = /* @__PURE__ */ w({
539
- __name: "EmptyState",
540
- props: {
541
- title: {},
542
- background: { type: Boolean },
543
- icon: { type: [Function, Object, null] }
544
- },
545
- setup(e) {
546
- return (r, v) => (l(), n("div", {
547
- class: p(["rvc-empty-state", { "rvc-empty-state-bg": e.background }])
548
- }, [
549
- e.icon ? (l(), C(P(e.icon), {
550
- key: 0,
551
- class: "rvc-empty-state-icon"
552
- })) : $("", !0),
553
- e.title ? (l(), n("p", ke, g(e.title), 1)) : $("", !0),
554
- c(r.$slots, "default")
555
- ], 2));
556
- }
557
- }), Ne = /* @__PURE__ */ w({
558
- __name: "FormTextarea",
559
- props: {
560
- modelValue: { default: void 0 },
561
- size: { default: "base" }
562
- },
563
- emits: ["update:modelValue"],
564
- setup(e, { emit: r }) {
565
- const v = e, f = r, { hasModelBinding: s } = T(), d = x(null), m = B({
566
- get: () => v.modelValue,
567
- set: (o) => f("update:modelValue", o)
568
- }), a = B(() => [
569
- "rvc-textarea",
570
- `rvc-textarea-${v.size}`
571
- ]);
572
- return (o, t) => h(s) ? M((l(), n("textarea", {
573
- key: 0,
574
- ref_key: "textarea",
575
- ref: d,
576
- "onUpdate:modelValue": t[0] || (t[0] = (i) => m.value = i),
577
- class: p(a.value)
578
- }, null, 2)), [
579
- [D, m.value]
580
- ]) : (l(), n("textarea", {
581
- key: 1,
582
- ref_key: "textarea",
583
- ref: d,
584
- class: p(a.value)
585
- }, null, 2));
586
- }
587
- }), Ve = { class: "rvc-radio-input" }, we = { class: "rvc-radio-label" }, ze = /* @__PURE__ */ w({
588
- inheritAttrs: !1,
589
- __name: "Radio",
590
- props: {
591
- modelValue: { type: [Boolean, String, Array, Object, Number, null], default: null },
592
- label: { default: "" },
593
- rootClass: { default: "" }
594
- },
595
- emits: ["update:modelValue"],
596
- setup(e, { emit: r }) {
597
- const v = e, f = r, s = B({
598
- get: () => v.modelValue,
599
- set: (t) => f("update:modelValue", t)
600
- }), { hasModelBinding: d } = T(), m = A(), a = B(() => ({
601
- ...m,
602
- type: "radio"
603
- })), o = x(null);
604
- return (t, i) => (l(), n("label", {
605
- class: p(["rvc-radio", e.rootClass])
606
- }, [
607
- u("div", Ve, [
608
- h(d) ? M((l(), n("input", y({ key: 0 }, a.value, {
609
- ref_key: "input",
610
- ref: o,
611
- "onUpdate:modelValue": i[0] || (i[0] = (b) => s.value = b)
612
- }), null, 16)), [
613
- [F, s.value]
614
- ]) : (l(), n("input", y({ key: 1 }, a.value, {
615
- ref_key: "input",
616
- ref: o
617
- }), null, 16))
618
- ]),
619
- c(t.$slots, "default", {}, () => [
620
- u("span", we, g(e.label), 1)
621
- ])
622
- ], 2));
623
- }
624
- }), Ce = { class: "rvc-tabs-nav" }, Be = ["value", "selected"], Ee = /* @__PURE__ */ w({
625
- inheritAttrs: !1,
626
- __name: "Tabs",
627
- props: {
628
- modelValue: { default: void 0 },
629
- tabs: { default: () => [] },
630
- tabStyle: { default: "default" }
631
- },
632
- emits: ["update:modelValue", "tabs:change"],
633
- setup(e, { emit: r }) {
634
- const v = e, f = r, s = () => {
635
- const o = v.tabs.findIndex((t) => t.active);
636
- return o >= 0 ? o : 0;
637
- }, d = B({
638
- get: () => v.modelValue ?? s(),
639
- set: (o) => {
640
- const t = v.tabs[o];
641
- f("update:modelValue", o), t && f("tabs:change", t);
642
- }
643
- }), m = (o) => {
644
- const i = +o.target.value;
645
- d.value = i;
646
- const b = v.tabs[i];
647
- b?.selectEvent && b.selectEvent();
648
- }, a = (o) => {
649
- const {
650
- active: t,
651
- as: i,
652
- bindAs: b,
653
- selectEvent: L,
654
- name: Pe,
655
- ...z
656
- } = o;
657
- return z;
658
- };
659
- return (o, t) => (l(), n(k, null, [
660
- u("div", y(o.$attrs, {
661
- class: ["rvc-tabs", { "rvc-tabs-buttons": e.tabStyle === "buttons" }]
662
- }), [
663
- u("nav", Ce, [
664
- (l(!0), n(k, null, V(e.tabs, (i, b) => (l(), C(P(i.as ? i.as : "button"), y({ ref_for: !0 }, a(i), {
665
- key: `${b}-tab-item`,
666
- as: i.bindAs ? i.bindAs : void 0,
667
- class: ["rvc-tab", { "rvc-tab-active": d.value === b }],
668
- onClick: (L) => d.value = b
669
- }), {
670
- default: O(() => [
671
- S(g(i.name), 1)
672
- ]),
673
- _: 2
674
- }, 1040, ["as", "class", "onClick"]))), 128))
675
- ])
676
- ], 16),
677
- I(N, y(o.$attrs, {
678
- "root-class": "rvc-tabs-select",
679
- value: d.value,
680
- onChange: m
681
- }), {
682
- default: O(() => [
683
- (l(!0), n(k, null, V(e.tabs, (i, b) => (l(), n("option", {
684
- key: `${b}-tab-item-select-option`,
685
- value: b,
686
- selected: d.value === b
687
- }, g(i.name), 9, Be))), 128))
688
- ]),
689
- _: 1
690
- }, 16, ["value"])
691
- ], 64));
692
- }
693
- });
694
- export {
695
- Me as _,
696
- Te as a,
697
- Ae as b,
698
- Fe as c,
699
- je as d,
700
- N as e,
701
- Ne as f,
702
- de as g,
703
- ze as h,
704
- Ee as i
705
- };