@robuust-digital/vue-components 2.3.2 → 2.5.0-beta.1

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,670 +0,0 @@
1
- import { createElementBlock as n, openBlock as l, createElementVNode as u, defineComponent as w, Fragment as k, renderList as V, renderSlot as c, createTextVNode as M, toDisplayString as g, createVNode as L, unref as h, normalizeClass as y, createBlock as C, resolveDynamicComponent as P, withCtx as T, createCommentVNode as $, computed as B, useAttrs as O, ref as x, withDirectives as A, mergeProps as p, vModelDynamic as N, normalizeProps as F, guardReactiveProps as E, vModelSelect as H, vModelText as D } from "vue";
2
- import { r as R } from "./XMarkIcon-90mcPzBs.js";
3
- import { u as I } from "./FormInput.vue_vue_type_script_setup_true_lang-C_1WSzbH.js";
4
- import { S as U } from "./icon-spinner-CP0VP_YM.js";
5
- import { r as Z } from "./ChevronDownIcon-CcE_K1lg.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"], Ae = /* @__PURE__ */ w({
37
- __name: "Accordion",
38
- props: {
39
- items: {},
40
- name: {},
41
- defaultOpenIndex: {},
42
- contentClass: {}
43
- },
44
- setup(e) {
45
- return (r, d) => (l(), n("div", G, [
46
- (l(!0), n(k, null, V(e.items, (v, 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: v,
54
- index: s
55
- }, () => [
56
- M(g(v.title) + " ", 1),
57
- c(r.$slots, "icon", { classList: "rvc-accordion-icon" }, () => [
58
- L(h(q), { class: "rvc-accordion-icon" })
59
- ])
60
- ])
61
- ]),
62
- u("div", {
63
- class: y(["rvc-accordion-content", e.contentClass])
64
- }, [
65
- c(r.$slots, "content", {
66
- item: v,
67
- index: s
68
- }, () => [
69
- u("div", {
70
- innerHTML: v.content
71
- }, null, 8, Q)
72
- ])
73
- ], 2)
74
- ], 8, J))), 128))
75
- ]));
76
- }
77
- }), W = { class: "rvc-alert-title" }, Ie = /* @__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, d) => (l(), C(P(e.as), {
89
- class: y(["rvc-alert", `rvc-alert-${e.type}`])
90
- }, {
91
- default: T(() => [
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: d[0] || (d[0] = (v) => r.$emit("alert:close"))
110
- }, [
111
- L(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
- }, Oe = /* @__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 d = e, v = r, s = B({
132
- get: () => d.modelValue,
133
- set: (t) => v("update:modelValue", t)
134
- }), { hasModelBinding: f } = I(), m = O(), a = B(() => ({
135
- ...m,
136
- type: "checkbox"
137
- })), o = x(null);
138
- return (t, i) => (l(), n("label", {
139
- class: y(["rvc-checkbox", e.rootClass])
140
- }, [
141
- u("div", X, [
142
- h(f) ? A((l(), n("input", p({ 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
- [N, s.value]
148
- ]) : (l(), n("input", p({ key: 1 }, a.value, {
149
- ref_key: "input",
150
- ref: o
151
- }), null, 16)),
152
- c(t.$slots, "icon", {}, () => [
153
- L(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"], j = /* @__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 d = e, v = r, s = B({
223
- get: () => d.modelValue,
224
- set: (a) => v("update:modelValue", a)
225
- }), { hasModelBinding: f } = I(), m = x(null);
226
- return (a, o) => (l(), n("div", {
227
- class: y([
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", F(E(a.$attrs)), () => [
240
- h(f) ? A((l(), n("select", p({ 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", p({ 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
- }, se = ["value"], oe = { 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
- },
282
- emits: ["pagination:change", "pagination:perPage"],
283
- setup(e, { emit: r }) {
284
- const d = e, v = r, s = x(d.perPage);
285
- return (f, m) => e.pagination?.total ? (l(), n("div", ne, [
286
- c(f.$slots, "perPage", p(e.pagination, { perPage: s.value }), () => [
287
- L(j, {
288
- modelValue: s.value,
289
- "onUpdate:modelValue": [
290
- m[0] || (m[0] = (a) => s.value = a),
291
- m[1] || (m[1] = (a) => v("pagination:perPage", Number(a)))
292
- ],
293
- size: "sm",
294
- "root-class": "rvc-pagination-per-page"
295
- }, {
296
- default: T(() => [
297
- (l(!0), n(k, null, V(e.perPageOptions, (a) => (l(), n("option", {
298
- key: `pagination-items-per-page-option-${a}`,
299
- value: a
300
- }, g(a) + " " + g(e.perPageLabel), 9, se))), 128))
301
- ]),
302
- _: 1
303
- }, 8, ["modelValue"])
304
- ]),
305
- c(f.$slots, "info", p(e.pagination, { fromLabel: e.fromLabel }), () => [
306
- u("div", oe, g(e.pagination.from) + " - " + g(e.pagination.to) + " " + g(e.fromLabel) + " " + g(e.pagination.total), 1)
307
- ]),
308
- u("nav", null, [
309
- u("ol", ie, [
310
- (l(!0), n(k, null, V(e.pagination.links, (a, o) => (l(), n("li", {
311
- key: `pagination-link-${a.label}-${o}`,
312
- class: "rvc-pagination-nav-list-item"
313
- }, [
314
- u("button", {
315
- type: "button",
316
- disabled: a.label === "..." || !a.url,
317
- class: y([
318
- "rvc-pagination-button",
319
- { "rvc-pagination-button-active": a.active }
320
- ]),
321
- onClick: (t) => a.url && v("pagination:change", a.url)
322
- }, [
323
- a.url !== "..." && o === 0 ? (l(), C(h(ee), {
324
- key: 0,
325
- "aria-hidden": "true",
326
- class: y([
327
- "rvc-pagination-button-icon",
328
- { "rvc-pagination-button-icon-disabled": !a.url }
329
- ])
330
- }, null, 8, ["class"])) : a.label !== "..." && o === e.pagination.links.length - 1 ? (l(), C(h(te), {
331
- key: 1,
332
- "aria-hidden": "true",
333
- class: y([
334
- "rvc-pagination-button-icon",
335
- { "rvc-pagination-button-icon-disabled": !a.url }
336
- ])
337
- }, null, 8, ["class"])) : a.label === "..." ? (l(), n("span", ce, " ... ")) : (l(), n("span", ue, g(a.label), 1))
338
- ], 10, re)
339
- ]))), 128))
340
- ])
341
- ])
342
- ])) : $("", !0);
343
- }
344
- }), ve = { key: 0 }, fe = ["aria-label", "onClick"], ge = ["innerHTML"], me = { key: 1 }, be = ["colspan"], ye = { key: 2 }, pe = ["colspan"], $e = { class: "rvc-table-spinner-wrapper" }, he = { key: 1 }, Ne = /* @__PURE__ */ w({
345
- __name: "DataTable",
346
- props: {
347
- headers: { default: () => [] },
348
- items: {},
349
- noResultsText: { default: "No results found." },
350
- loadingText: { default: "Loading content..." },
351
- striped: { type: Boolean, default: !1 },
352
- spinning: { type: Boolean, default: !1 },
353
- pagination: { default: null },
354
- wrapperClass: { default: "" },
355
- defaultSort: { default: null }
356
- },
357
- emits: ["table:sortBy", "pagination:change", "pagination:perPage"],
358
- setup(e, { emit: r }) {
359
- const d = e, v = r, s = x(d.defaultSort), f = (a) => d.headers.find((o) => o.key === a), m = (a) => {
360
- a.key && (!s.value || s.value.key !== a.key ? s.value = {
361
- key: a.key,
362
- direction: "asc"
363
- } : s.value.direction === "asc" ? s.value = {
364
- key: a.key,
365
- direction: "desc"
366
- } : s.value = null, v("table:sortBy", s.value));
367
- };
368
- return (a, o) => (l(), n("div", null, [
369
- u("div", {
370
- class: y(["rvc-table-wrapper", e.wrapperClass])
371
- }, [
372
- u("table", {
373
- class: y([{ "rvc-table-striped": e.striped }, "rvc-table"])
374
- }, [
375
- e.headers.length ? (l(), n("thead", ve, [
376
- c(a.$slots, "headers", { headers: e.headers }, () => [
377
- u("tr", null, [
378
- (l(!0), n(k, null, V(e.headers, (t, i) => c(a.$slots, "header", {
379
- header: t,
380
- index: i
381
- }, () => [
382
- (l(), n("th", p({ ref_for: !0 }, { ...t, id: String(t.id) }, {
383
- key: `rvc-table-header-${t.id}`,
384
- class: {
385
- "rvc-table-text-left": t.align === "left" || !t.align,
386
- "rvc-table-text-center": t.align === "center",
387
- "rvc-table-text-right": t.align === "right"
388
- }
389
- }), [
390
- t.sortable && t.key ? (l(), n("button", {
391
- key: 0,
392
- type: "button",
393
- "aria-label": `Sort on ${t.label}`,
394
- class: y([
395
- "rvc-table-sort-button",
396
- {
397
- "rvc-table-sort-button-center": t.align === "center",
398
- "rvc-table-sort-button-right": t.align === "right"
399
- }
400
- ]),
401
- onClick: (b) => m(t)
402
- }, [
403
- c(a.$slots, "header-label", {
404
- sortBy: s.value,
405
- header: t
406
- }, () => [
407
- M(g(t.label), 1)
408
- ]),
409
- L(h(_), {
410
- class: y([
411
- "rvc-table-sort-icon",
412
- {
413
- "rvc-table-sort-icon-visible": s.value?.key === t.key,
414
- "rvc-table-sort-icon-invisible": !s.value || s.value.key !== t.key,
415
- "rvc-table-sort-icon-rotated": s.value?.key === t.key && s.value.direction === "desc"
416
- }
417
- ])
418
- }, null, 8, ["class"])
419
- ], 10, fe)) : c(a.$slots, "header-label", {
420
- key: 1,
421
- sortBy: s.value,
422
- header: t
423
- }, () => [
424
- M(g(t.label), 1)
425
- ])
426
- ], 16))
427
- ])), 256))
428
- ])
429
- ])
430
- ])) : $("", !0),
431
- u("tbody", null, [
432
- e.items.length && !e.spinning ? (l(!0), n(k, { key: 0 }, V(e.items, (t, i) => c(a.$slots, "items", {
433
- item: t,
434
- index: i
435
- }, () => [
436
- (l(), n("tr", {
437
- key: `rvc-table-row-${i}-${t.id}`
438
- }, [
439
- c(a.$slots, "item", {
440
- item: t,
441
- index: i
442
- }, () => [
443
- (l(!0), n(k, null, V(t, (b, S) => (l(), n("td", p({
444
- key: `rvc-table-row-${i}-column-${S}-${t.id}`
445
- }, { ref_for: !0 }, t.attrs, {
446
- class: {
447
- "rvc-table-text-left": f(String(S))?.align === "left" || !f(String(S))?.align,
448
- "rvc-table-text-center": f(String(S))?.align === "center",
449
- "rvc-table-text-right": f(String(S))?.align === "right"
450
- },
451
- innerHTML: b
452
- }), null, 16, ge))), 128))
453
- ])
454
- ]))
455
- ])), 256)) : !e.items.length && !e.spinning ? (l(), n("tr", me, [
456
- u("td", {
457
- colspan: e.headers.length,
458
- class: "rvc-table-state"
459
- }, [
460
- u("p", null, g(e.noResultsText), 1)
461
- ], 8, be)
462
- ])) : (l(), n("tr", ye, [
463
- u("td", {
464
- colspan: e.headers.length,
465
- class: "rvc-table-state"
466
- }, [
467
- c(a.$slots, "spinner", {
468
- spinning: e.spinning,
469
- label: e.loadingText
470
- }, () => [
471
- u("div", $e, [
472
- e.spinning ? (l(), C(h(U), {
473
- key: 0,
474
- "aria-hidden": "true",
475
- class: "rvc-table-spinner"
476
- })) : $("", !0),
477
- M(" " + g(e.loadingText), 1)
478
- ])
479
- ])
480
- ], 8, pe)
481
- ]))
482
- ]),
483
- a.$slots.footer ? (l(), n("tfoot", he, [
484
- c(a.$slots, "footer", {
485
- headers: e.headers,
486
- items: e.items
487
- })
488
- ])) : $("", !0)
489
- ], 2)
490
- ], 2),
491
- e.pagination ? c(a.$slots, "pagination", F(p({ key: 0 }, e.pagination)), () => [
492
- L(de, {
493
- pagination: e.pagination,
494
- "onPagination:change": o[0] || (o[0] = (t) => v("pagination:change", t)),
495
- "onPagination:perPage": o[1] || (o[1] = (t) => v("pagination:perPage", t))
496
- }, null, 8, ["pagination"])
497
- ]) : $("", !0)
498
- ]));
499
- }
500
- }), ke = {
501
- key: 1,
502
- class: "rvc-empty-state-title"
503
- }, Fe = /* @__PURE__ */ w({
504
- __name: "EmptyState",
505
- props: {
506
- title: {},
507
- background: { type: Boolean },
508
- icon: { type: [Function, Object, null] }
509
- },
510
- setup(e) {
511
- return (r, d) => (l(), n("div", {
512
- class: y(["rvc-empty-state", { "rvc-empty-state-bg": e.background }])
513
- }, [
514
- e.icon ? (l(), C(P(e.icon), {
515
- key: 0,
516
- class: "rvc-empty-state-icon"
517
- })) : $("", !0),
518
- e.title ? (l(), n("p", ke, g(e.title), 1)) : $("", !0),
519
- c(r.$slots, "default")
520
- ], 2));
521
- }
522
- }), je = /* @__PURE__ */ w({
523
- __name: "FormTextarea",
524
- props: {
525
- modelValue: { default: void 0 },
526
- size: { default: "base" }
527
- },
528
- emits: ["update:modelValue"],
529
- setup(e, { emit: r }) {
530
- const d = e, v = r, { hasModelBinding: s } = I(), f = x(null), m = B({
531
- get: () => d.modelValue,
532
- set: (o) => v("update:modelValue", o)
533
- }), a = B(() => [
534
- "rvc-textarea",
535
- `rvc-textarea-${d.size}`
536
- ]);
537
- return (o, t) => h(s) ? A((l(), n("textarea", {
538
- key: 0,
539
- ref_key: "textarea",
540
- ref: f,
541
- "onUpdate:modelValue": t[0] || (t[0] = (i) => m.value = i),
542
- class: y(a.value)
543
- }, null, 2)), [
544
- [D, m.value]
545
- ]) : (l(), n("textarea", {
546
- key: 1,
547
- ref_key: "textarea",
548
- ref: f,
549
- class: y(a.value)
550
- }, null, 2));
551
- }
552
- }), Ve = { class: "rvc-radio-input" }, we = { class: "rvc-radio-label" }, ze = /* @__PURE__ */ w({
553
- inheritAttrs: !1,
554
- __name: "Radio",
555
- props: {
556
- modelValue: { type: [Boolean, String, Array, Object, Number, null], default: null },
557
- label: { default: "" },
558
- rootClass: { default: "" }
559
- },
560
- emits: ["update:modelValue"],
561
- setup(e, { emit: r }) {
562
- const d = e, v = r, s = B({
563
- get: () => d.modelValue,
564
- set: (t) => v("update:modelValue", t)
565
- }), { hasModelBinding: f } = I(), m = O(), a = B(() => ({
566
- ...m,
567
- type: "radio"
568
- })), o = x(null);
569
- return (t, i) => (l(), n("label", {
570
- class: y(["rvc-radio", e.rootClass])
571
- }, [
572
- u("div", Ve, [
573
- h(f) ? A((l(), n("input", p({ key: 0 }, a.value, {
574
- ref_key: "input",
575
- ref: o,
576
- "onUpdate:modelValue": i[0] || (i[0] = (b) => s.value = b)
577
- }), null, 16)), [
578
- [N, s.value]
579
- ]) : (l(), n("input", p({ key: 1 }, a.value, {
580
- ref_key: "input",
581
- ref: o
582
- }), null, 16))
583
- ]),
584
- c(t.$slots, "default", {}, () => [
585
- u("span", we, g(e.label), 1)
586
- ])
587
- ], 2));
588
- }
589
- }), Ce = { class: "rvc-tabs-nav" }, Be = ["value", "selected"], Ee = /* @__PURE__ */ w({
590
- inheritAttrs: !1,
591
- __name: "Tabs",
592
- props: {
593
- modelValue: { default: void 0 },
594
- tabs: { default: () => [] },
595
- tabStyle: { default: "default" }
596
- },
597
- emits: ["update:modelValue", "tabs:change"],
598
- setup(e, { emit: r }) {
599
- const d = e, v = r, s = () => {
600
- const o = d.tabs.findIndex((t) => t.active);
601
- return o >= 0 ? o : 0;
602
- }, f = B({
603
- get: () => d.modelValue ?? s(),
604
- set: (o) => {
605
- const t = d.tabs[o];
606
- v("update:modelValue", o), t && v("tabs:change", t);
607
- }
608
- }), m = (o) => {
609
- const i = +o.target.value;
610
- f.value = i;
611
- const b = d.tabs[i];
612
- b?.selectEvent && b.selectEvent();
613
- }, a = (o) => {
614
- const {
615
- active: t,
616
- as: i,
617
- bindAs: b,
618
- selectEvent: S,
619
- name: Se,
620
- ...z
621
- } = o;
622
- return z;
623
- };
624
- return (o, t) => (l(), n(k, null, [
625
- u("div", p(o.$attrs, {
626
- class: ["rvc-tabs", { "rvc-tabs-buttons": e.tabStyle === "buttons" }]
627
- }), [
628
- u("nav", Ce, [
629
- (l(!0), n(k, null, V(e.tabs, (i, b) => (l(), C(P(i.as ? i.as : "button"), p({ ref_for: !0 }, a(i), {
630
- key: `${b}-tab-item`,
631
- as: i.bindAs ? i.bindAs : void 0,
632
- class: ["rvc-tab", { "rvc-tab-active": f.value === b }],
633
- onClick: (S) => f.value = b
634
- }), {
635
- default: T(() => [
636
- M(g(i.name), 1)
637
- ]),
638
- _: 2
639
- }, 1040, ["as", "class", "onClick"]))), 128))
640
- ])
641
- ], 16),
642
- L(j, p(o.$attrs, {
643
- "root-class": "rvc-tabs-select",
644
- value: f.value,
645
- onChange: m
646
- }), {
647
- default: T(() => [
648
- (l(!0), n(k, null, V(e.tabs, (i, b) => (l(), n("option", {
649
- key: `${b}-tab-item-select-option`,
650
- value: b,
651
- selected: f.value === b
652
- }, g(i.name), 9, Be))), 128))
653
- ]),
654
- _: 1
655
- }, 16, ["value"])
656
- ], 64));
657
- }
658
- });
659
- export {
660
- Ae as _,
661
- Ie as a,
662
- Oe as b,
663
- Ne as c,
664
- Fe as d,
665
- j as e,
666
- je as f,
667
- de as g,
668
- ze as h,
669
- Ee as i
670
- };