@robuust-digital/vue-components 2.6.7 → 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.
@@ -0,0 +1,931 @@
1
+ import { openBlock as t, createElementBlock as n, createElementVNode as c, defineComponent as T, Fragment as L, renderList as B, renderSlot as v, createTextVNode as O, toDisplayString as g, createVNode as A, unref as w, normalizeClass as k, createBlock as x, resolveDynamicComponent as I, withCtx as D, createCommentVNode as y, computed as P, useAttrs as N, ref as M, withDirectives as j, mergeProps as V, vModelDynamic as G, normalizeProps as J, guardReactiveProps as ne, vModelSelect as oe, watch as se, onBeforeUnmount as ie, withModifiers as U, vModelText as re } from "vue";
2
+ import { r as ue } from "./XMarkIcon-CPr_Rd8y.js";
3
+ import { u as E } from "./FormInput.vue_vue_type_script_setup_true_lang-Bg7YPGyY.js";
4
+ import { S as ce } from "./icon-spinner-BYCMrTdL.js";
5
+ import { _ as de } from "./ButtonBase.vue_vue_type_script_setup_true_lang-ZYVNEyNx.js";
6
+ import { r as ve } from "./ChevronDownIcon-BYWciGnh.js";
7
+ function fe(e, d) {
8
+ return t(), n("svg", {
9
+ xmlns: "http://www.w3.org/2000/svg",
10
+ viewBox: "0 0 24 24",
11
+ fill: "currentColor",
12
+ "aria-hidden": "true",
13
+ "data-slot": "icon"
14
+ }, [
15
+ c("path", {
16
+ "fill-rule": "evenodd",
17
+ 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",
18
+ "clip-rule": "evenodd"
19
+ })
20
+ ]);
21
+ }
22
+ function me(e, d) {
23
+ return t(), n("svg", {
24
+ xmlns: "http://www.w3.org/2000/svg",
25
+ viewBox: "0 0 24 24",
26
+ fill: "currentColor",
27
+ "aria-hidden": "true",
28
+ "data-slot": "icon"
29
+ }, [
30
+ c("path", {
31
+ "fill-rule": "evenodd",
32
+ 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",
33
+ "clip-rule": "evenodd"
34
+ })
35
+ ]);
36
+ }
37
+ const be = { class: "rvc-accordion" }, ge = ["open", "name"], pe = ["innerHTML"], ft = /* @__PURE__ */ T({
38
+ __name: "Accordion",
39
+ props: {
40
+ items: {},
41
+ name: {},
42
+ defaultOpenIndex: {},
43
+ contentClass: {}
44
+ },
45
+ setup(e) {
46
+ return (d, o) => (t(), n("div", be, [
47
+ (t(!0), n(L, null, B(e.items, (b, r) => (t(), n("details", {
48
+ key: r,
49
+ open: e.defaultOpenIndex === r,
50
+ name: e.name
51
+ }, [
52
+ c("summary", null, [
53
+ v(d.$slots, "summary", {
54
+ item: b,
55
+ index: r
56
+ }, () => [
57
+ O(g(b.title) + " ", 1),
58
+ v(d.$slots, "icon", { classList: "rvc-accordion-icon" }, () => [
59
+ A(w(me), { class: "rvc-accordion-icon" })
60
+ ])
61
+ ])
62
+ ]),
63
+ c("div", {
64
+ class: k(["rvc-accordion-content", e.contentClass])
65
+ }, [
66
+ v(d.$slots, "content", {
67
+ item: b,
68
+ index: r
69
+ }, () => [
70
+ c("div", {
71
+ innerHTML: b.content
72
+ }, null, 8, pe)
73
+ ])
74
+ ], 2)
75
+ ], 8, ge))), 128))
76
+ ]));
77
+ }
78
+ }), he = { class: "rvc-alert-title" }, mt = /* @__PURE__ */ T({
79
+ __name: "Alert",
80
+ props: {
81
+ as: { default: "div" },
82
+ title: { default: "" },
83
+ icon: { type: [Function, Object, null], default: null },
84
+ type: { default: "info" },
85
+ close: { type: Boolean, default: !1 }
86
+ },
87
+ emits: ["alert:close"],
88
+ setup(e) {
89
+ return (d, o) => (t(), x(I(e.as), {
90
+ class: k(["rvc-alert", `rvc-alert-${e.type}`])
91
+ }, {
92
+ default: D(() => [
93
+ v(d.$slots, "icon", {}, () => [
94
+ e.icon ? (t(), x(I(e.icon), {
95
+ key: 0,
96
+ class: "rvc-alert-icon"
97
+ })) : y("", !0)
98
+ ]),
99
+ c("div", null, [
100
+ v(d.$slots, "title", {}, () => [
101
+ c("span", he, g(e.title), 1)
102
+ ]),
103
+ v(d.$slots, "default")
104
+ ]),
105
+ v(d.$slots, "close", {}, () => [
106
+ e.close ? (t(), n("button", {
107
+ key: 0,
108
+ type: "button",
109
+ class: "rvc-alert-close",
110
+ onClick: o[0] || (o[0] = (b) => d.$emit("alert:close"))
111
+ }, [
112
+ A(w(ue))
113
+ ])) : y("", !0)
114
+ ])
115
+ ]),
116
+ _: 3
117
+ }, 8, ["class"]));
118
+ }
119
+ }), ye = { class: "rvc-checkbox-input" }, $e = {
120
+ key: 0,
121
+ class: "rvc-checkbox-label"
122
+ }, bt = /* @__PURE__ */ T({
123
+ inheritAttrs: !1,
124
+ __name: "Checkbox",
125
+ props: {
126
+ modelValue: { type: [Number, String, Object, Array, Boolean, null], default: null },
127
+ label: { default: "" },
128
+ rootClass: { default: "" }
129
+ },
130
+ emits: ["update:modelValue"],
131
+ setup(e, { emit: d }) {
132
+ const o = e, b = d, r = P({
133
+ get: () => o.modelValue,
134
+ set: (l) => b("update:modelValue", l)
135
+ }), { hasModelBinding: f } = E(), p = N(), a = P(() => ({
136
+ ...p,
137
+ type: "checkbox"
138
+ })), u = M(null);
139
+ return (l, s) => (t(), n("label", {
140
+ class: k(["rvc-checkbox", e.rootClass])
141
+ }, [
142
+ c("div", ye, [
143
+ w(f) ? j((t(), n("input", V({ key: 0 }, a.value, {
144
+ ref_key: "input",
145
+ ref: u,
146
+ "onUpdate:modelValue": s[0] || (s[0] = (h) => r.value = h)
147
+ }), null, 16)), [
148
+ [G, r.value]
149
+ ]) : (t(), n("input", V({ key: 1 }, a.value, {
150
+ ref_key: "input",
151
+ ref: u
152
+ }), null, 16)),
153
+ v(l.$slots, "icon", {}, () => [
154
+ A(w(fe))
155
+ ])
156
+ ]),
157
+ v(l.$slots, "default", { label: e.label }, () => [
158
+ e.label ? (t(), n("span", $e, g(e.label), 1)) : y("", !0)
159
+ ])
160
+ ], 2));
161
+ }
162
+ });
163
+ function ke(e, d) {
164
+ return t(), n("svg", {
165
+ xmlns: "http://www.w3.org/2000/svg",
166
+ viewBox: "0 0 16 16",
167
+ fill: "currentColor",
168
+ "aria-hidden": "true",
169
+ "data-slot": "icon"
170
+ }, [
171
+ c("path", {
172
+ "fill-rule": "evenodd",
173
+ 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",
174
+ "clip-rule": "evenodd"
175
+ })
176
+ ]);
177
+ }
178
+ function q(e, d) {
179
+ return t(), n("svg", {
180
+ xmlns: "http://www.w3.org/2000/svg",
181
+ viewBox: "0 0 16 16",
182
+ fill: "currentColor",
183
+ "aria-hidden": "true",
184
+ "data-slot": "icon"
185
+ }, [
186
+ c("path", { d: "M5.28 4.22a.75.75 0 0 0-1.06 1.06L6.94 8l-2.72 2.72a.75.75 0 1 0 1.06 1.06L8 9.06l2.72 2.72a.75.75 0 1 0 1.06-1.06L9.06 8l2.72-2.72a.75.75 0 0 0-1.06-1.06L8 6.94 5.28 4.22Z" })
187
+ ]);
188
+ }
189
+ function we(e, d) {
190
+ return t(), n("svg", {
191
+ xmlns: "http://www.w3.org/2000/svg",
192
+ viewBox: "0 0 20 20",
193
+ fill: "currentColor",
194
+ "aria-hidden": "true",
195
+ "data-slot": "icon"
196
+ }, [
197
+ c("path", { d: "M9.25 13.25a.75.75 0 0 0 1.5 0V4.636l2.955 3.129a.75.75 0 0 0 1.09-1.03l-4.25-4.5a.75.75 0 0 0-1.09 0l-4.25 4.5a.75.75 0 1 0 1.09 1.03L9.25 4.636v8.614Z" }),
198
+ c("path", { d: "M3.5 12.75a.75.75 0 0 0-1.5 0v2.5A2.75 2.75 0 0 0 4.75 18h10.5A2.75 2.75 0 0 0 18 15.25v-2.5a.75.75 0 0 0-1.5 0v2.5c0 .69-.56 1.25-1.25 1.25H4.75c-.69 0-1.25-.56-1.25-1.25v-2.5Z" })
199
+ ]);
200
+ }
201
+ function Ve(e, d) {
202
+ return t(), n("svg", {
203
+ xmlns: "http://www.w3.org/2000/svg",
204
+ viewBox: "0 0 20 20",
205
+ fill: "currentColor",
206
+ "aria-hidden": "true",
207
+ "data-slot": "icon"
208
+ }, [
209
+ c("path", {
210
+ "fill-rule": "evenodd",
211
+ 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",
212
+ "clip-rule": "evenodd"
213
+ })
214
+ ]);
215
+ }
216
+ function Ce(e, d) {
217
+ return t(), n("svg", {
218
+ xmlns: "http://www.w3.org/2000/svg",
219
+ viewBox: "0 0 20 20",
220
+ fill: "currentColor",
221
+ "aria-hidden": "true",
222
+ "data-slot": "icon"
223
+ }, [
224
+ c("path", {
225
+ "fill-rule": "evenodd",
226
+ 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",
227
+ "clip-rule": "evenodd"
228
+ })
229
+ ]);
230
+ }
231
+ const Le = ["value"], Be = ["value"], Q = /* @__PURE__ */ T({
232
+ inheritAttrs: !1,
233
+ __name: "FormSelect",
234
+ props: {
235
+ modelValue: { type: [String, Number, Object, Boolean, null], default: null },
236
+ rootClass: { default: "" },
237
+ prefixIcon: { type: [Function, Object, null], default: null },
238
+ icon: { type: [Function, Object, null], default: null },
239
+ size: { default: "base" },
240
+ options: { default: () => [] },
241
+ optionLabel: { default: "name" },
242
+ optionValue: { default: "id" }
243
+ },
244
+ emits: ["update:modelValue"],
245
+ setup(e, { emit: d }) {
246
+ const o = e, b = d, r = P({
247
+ get: () => o.modelValue,
248
+ set: (a) => b("update:modelValue", a)
249
+ }), { hasModelBinding: f } = E(), p = M(null);
250
+ return (a, u) => (t(), n("div", {
251
+ class: k([
252
+ "rvc-select",
253
+ `rvc-select-${e.size}`,
254
+ e.rootClass
255
+ ])
256
+ }, [
257
+ e.prefixIcon ? v(a.$slots, "prefixIcon", {
258
+ key: 0,
259
+ icon: e.prefixIcon
260
+ }, () => [
261
+ (t(), x(I(e.prefixIcon), { "aria-hidden": "true" }))
262
+ ]) : y("", !0),
263
+ v(a.$slots, "select", J(ne(a.$attrs)), () => [
264
+ w(f) ? j((t(), n("select", V({ key: 0 }, a.$attrs, {
265
+ ref_key: "select",
266
+ ref: p,
267
+ "onUpdate:modelValue": u[0] || (u[0] = (l) => r.value = l)
268
+ }), [
269
+ v(a.$slots, "default", {}, () => [
270
+ e.options.length > 0 ? (t(!0), n(L, { key: 0 }, B(e.options, (l, s) => (t(), n("option", {
271
+ key: `option-${s}-${l[e.optionValue]}`,
272
+ value: l[e.optionValue]
273
+ }, g(l[e.optionLabel]), 9, Le))), 128)) : y("", !0)
274
+ ])
275
+ ], 16)), [
276
+ [oe, r.value]
277
+ ]) : (t(), n("select", V({ key: 1 }, a.$attrs, {
278
+ ref_key: "select",
279
+ ref: p
280
+ }), [
281
+ v(a.$slots, "default", {}, () => [
282
+ e.options.length > 0 ? (t(!0), n(L, { key: 0 }, B(e.options, (l, s) => (t(), n("option", {
283
+ key: `option-${s}-${l[e.optionValue]}`,
284
+ value: l[e.optionValue]
285
+ }, g(l[e.optionLabel]), 9, Be))), 128)) : y("", !0)
286
+ ])
287
+ ], 16))
288
+ ]),
289
+ v(a.$slots, "icon", { icon: e.icon }, () => [
290
+ (t(), x(I(e.icon ?? w(ve)), { "aria-hidden": "true" }))
291
+ ])
292
+ ], 2));
293
+ }
294
+ }), xe = {
295
+ key: 0,
296
+ class: "rvc-pagination"
297
+ }, Pe = ["value"], Te = { class: "rvc-pagination-info" }, Se = { class: "rvc-pagination-nav-list" }, Ie = ["disabled", "onClick"], Me = { key: 2 }, Ae = { key: 3 }, Fe = /* @__PURE__ */ T({
298
+ __name: "Pagination",
299
+ props: {
300
+ pagination: {},
301
+ perPage: { default: 10 },
302
+ perPageLabel: { default: "per page" },
303
+ perPageOptions: { default: () => [10, 20, 50] },
304
+ fromLabel: { default: "of" },
305
+ prevIcon: { type: [Function, Object, null], default: null },
306
+ nextIcon: { type: [Function, Object, null], default: null }
307
+ },
308
+ emits: ["pagination:change", "pagination:perPage"],
309
+ setup(e, { emit: d }) {
310
+ const o = e, b = d, r = P({
311
+ get: () => o.perPage,
312
+ set: (f) => b("pagination:perPage", Number(f))
313
+ });
314
+ return (f, p) => e.pagination?.total ? (t(), n("div", xe, [
315
+ v(f.$slots, "perPage", V(e.pagination, { perPage: r.value }), () => [
316
+ A(Q, {
317
+ modelValue: r.value,
318
+ "onUpdate:modelValue": p[0] || (p[0] = (a) => r.value = a),
319
+ size: "sm",
320
+ "root-class": "rvc-pagination-per-page"
321
+ }, {
322
+ default: D(() => [
323
+ (t(!0), n(L, null, B(e.perPageOptions, (a) => (t(), n("option", {
324
+ key: `pagination-items-per-page-option-${a}`,
325
+ value: a
326
+ }, g(a) + " " + g(e.perPageLabel), 9, Pe))), 128))
327
+ ]),
328
+ _: 1
329
+ }, 8, ["modelValue"])
330
+ ]),
331
+ v(f.$slots, "info", V(e.pagination, { fromLabel: e.fromLabel }), () => [
332
+ c("div", Te, g(e.pagination.from) + " - " + g(e.pagination.to) + " " + g(e.fromLabel) + " " + g(e.pagination.total), 1)
333
+ ]),
334
+ c("nav", null, [
335
+ c("ol", Se, [
336
+ (t(!0), n(L, null, B(e.pagination.links, (a, u) => (t(), n("li", {
337
+ key: `pagination-link-${a.label}-${u}`,
338
+ class: "rvc-pagination-nav-list-item"
339
+ }, [
340
+ c("button", {
341
+ type: "button",
342
+ disabled: a.label === "..." || !a.url,
343
+ class: k([
344
+ "rvc-pagination-button",
345
+ { "rvc-pagination-button-active": a.active }
346
+ ]),
347
+ onClick: (l) => a.url && b("pagination:change", a.url)
348
+ }, [
349
+ a.url !== "..." && u === 0 ? v(f.$slots, "prevIcon", {
350
+ key: 0,
351
+ icon: e.prevIcon,
352
+ link: a,
353
+ index: u
354
+ }, () => [
355
+ (t(), x(I(e.prevIcon || w(Ve)), {
356
+ "aria-hidden": "true",
357
+ class: k([
358
+ "rvc-pagination-button-icon",
359
+ { "rvc-pagination-button-icon-disabled": !a.url }
360
+ ])
361
+ }, null, 8, ["class"]))
362
+ ]) : a.label !== "..." && u === e.pagination.links.length - 1 ? v(f.$slots, "nextIcon", {
363
+ key: 1,
364
+ icon: e.nextIcon,
365
+ link: a,
366
+ index: u
367
+ }, () => [
368
+ (t(), x(I(e.nextIcon || w(Ce)), {
369
+ "aria-hidden": "true",
370
+ class: k([
371
+ "rvc-pagination-button-icon",
372
+ { "rvc-pagination-button-icon-disabled": !a.url }
373
+ ])
374
+ }, null, 8, ["class"]))
375
+ ]) : a.label === "..." ? (t(), n("span", Me, " ... ")) : (t(), n("span", Ae, g(a.label), 1))
376
+ ], 10, Ie)
377
+ ]))), 128))
378
+ ])
379
+ ])
380
+ ])) : y("", !0);
381
+ }
382
+ }), Oe = { key: 0 }, De = ["aria-label", "onClick"], Ue = ["innerHTML"], je = { key: 2 }, Ee = ["colspan"], Re = { key: 3 }, ze = ["colspan"], Ne = { class: "rvc-table-spinner-wrapper" }, Ze = { key: 4 }, gt = /* @__PURE__ */ T({
383
+ __name: "DataTable",
384
+ props: {
385
+ headers: { default: () => [] },
386
+ items: {},
387
+ noResultsText: { default: "No results found." },
388
+ loadingText: { default: "Loading content..." },
389
+ striped: { type: Boolean, default: !1 },
390
+ spinning: { type: Boolean, default: !1 },
391
+ pagination: { default: null },
392
+ perPage: { default: 10 },
393
+ perPageLabel: { default: "per page" },
394
+ perPageOptions: { default: () => [10, 20, 50] },
395
+ fromLabel: { default: "of" },
396
+ prevIcon: { type: [Function, Object, null], default: null },
397
+ nextIcon: { type: [Function, Object, null], default: null },
398
+ wrapperClass: { default: "" },
399
+ defaultSort: { default: null }
400
+ },
401
+ emits: ["table:sortBy", "pagination:change", "pagination:perPage"],
402
+ setup(e, { emit: d }) {
403
+ const o = e, b = d, r = M(o.defaultSort), f = (a) => o.headers.find((u) => u.key === a), p = (a) => {
404
+ a.key && (!r.value || r.value.key !== a.key ? r.value = {
405
+ key: a.key,
406
+ direction: "asc"
407
+ } : r.value.direction === "asc" ? r.value = {
408
+ key: a.key,
409
+ direction: "desc"
410
+ } : r.value = null, b("table:sortBy", r.value));
411
+ };
412
+ return (a, u) => (t(), n("div", null, [
413
+ c("div", {
414
+ class: k(["rvc-table-wrapper", e.wrapperClass])
415
+ }, [
416
+ c("table", {
417
+ class: k([{ "rvc-table-striped": e.striped }, "rvc-table"])
418
+ }, [
419
+ e.headers.length ? (t(), n("thead", Oe, [
420
+ v(a.$slots, "headers", { headers: e.headers }, () => [
421
+ c("tr", null, [
422
+ (t(!0), n(L, null, B(e.headers, (l, s) => v(a.$slots, "header", {
423
+ header: l,
424
+ index: s
425
+ }, () => [
426
+ (t(), n("th", V({ ref_for: !0 }, { ...l, id: l.id === void 0 || l.id === null ? void 0 : String(l.id) }, {
427
+ key: `rvc-table-header-${l.id ?? l.key ?? s}`,
428
+ class: {
429
+ "rvc-table-text-left": l.align === "left" || !l.align,
430
+ "rvc-table-text-center": l.align === "center",
431
+ "rvc-table-text-right": l.align === "right"
432
+ }
433
+ }), [
434
+ l.sortable && l.key ? (t(), n("button", {
435
+ key: 0,
436
+ type: "button",
437
+ "aria-label": `Sort on ${l.label}`,
438
+ class: k([
439
+ "rvc-table-sort-button",
440
+ {
441
+ "rvc-table-sort-button-center": l.align === "center",
442
+ "rvc-table-sort-button-right": l.align === "right"
443
+ }
444
+ ]),
445
+ onClick: (h) => p(l)
446
+ }, [
447
+ v(a.$slots, "header-label", {
448
+ sortBy: r.value,
449
+ header: l
450
+ }, () => [
451
+ O(g(l.label), 1)
452
+ ]),
453
+ A(w(ke), {
454
+ class: k([
455
+ "rvc-table-sort-icon",
456
+ {
457
+ "rvc-table-sort-icon-visible": r.value?.key === l.key,
458
+ "rvc-table-sort-icon-invisible": !r.value || r.value.key !== l.key,
459
+ "rvc-table-sort-icon-rotated": r.value?.key === l.key && r.value.direction === "desc"
460
+ }
461
+ ])
462
+ }, null, 8, ["class"])
463
+ ], 10, De)) : v(a.$slots, "header-label", {
464
+ key: 1,
465
+ sortBy: r.value,
466
+ header: l
467
+ }, () => [
468
+ O(g(l.label), 1)
469
+ ])
470
+ ], 16))
471
+ ])), 256))
472
+ ])
473
+ ])
474
+ ])) : y("", !0),
475
+ e.items.length && !e.spinning ? v(a.$slots, "tbody", {
476
+ key: 1,
477
+ items: e.items
478
+ }, () => [
479
+ c("tbody", null, [
480
+ (t(!0), n(L, null, B(e.items, (l, s) => v(a.$slots, "items", {
481
+ item: l,
482
+ index: s
483
+ }, () => [
484
+ (t(), n("tr", {
485
+ key: `rvc-table-row-${s}-${l.id}`
486
+ }, [
487
+ v(a.$slots, "item", {
488
+ item: l,
489
+ index: s
490
+ }, () => [
491
+ (t(!0), n(L, null, B(l, (h, S) => (t(), n("td", V({
492
+ key: `rvc-table-row-${s}-column-${S}-${l.id}`
493
+ }, { ref_for: !0 }, l.attrs, {
494
+ class: {
495
+ "rvc-table-text-left": f(String(S))?.align === "left" || !f(String(S))?.align,
496
+ "rvc-table-text-center": f(String(S))?.align === "center",
497
+ "rvc-table-text-right": f(String(S))?.align === "right"
498
+ },
499
+ innerHTML: h
500
+ }), null, 16, Ue))), 128))
501
+ ])
502
+ ]))
503
+ ])), 256))
504
+ ])
505
+ ]) : !e.items.length && !e.spinning ? (t(), n("tbody", je, [
506
+ c("tr", null, [
507
+ c("td", {
508
+ colspan: e.headers.length,
509
+ class: "rvc-table-state"
510
+ }, [
511
+ c("p", null, g(e.noResultsText), 1)
512
+ ], 8, Ee)
513
+ ])
514
+ ])) : (t(), n("tbody", Re, [
515
+ c("tr", null, [
516
+ c("td", {
517
+ colspan: e.headers.length,
518
+ class: "rvc-table-state"
519
+ }, [
520
+ v(a.$slots, "spinner", {
521
+ spinning: e.spinning,
522
+ label: e.loadingText
523
+ }, () => [
524
+ c("div", Ne, [
525
+ e.spinning ? (t(), x(w(ce), {
526
+ key: 0,
527
+ "aria-hidden": "true",
528
+ class: "rvc-table-spinner"
529
+ })) : y("", !0),
530
+ O(" " + g(e.loadingText), 1)
531
+ ])
532
+ ])
533
+ ], 8, ze)
534
+ ])
535
+ ])),
536
+ a.$slots.footer ? (t(), n("tfoot", Ze, [
537
+ v(a.$slots, "footer", {
538
+ headers: e.headers,
539
+ items: e.items
540
+ })
541
+ ])) : y("", !0)
542
+ ], 2)
543
+ ], 2),
544
+ e.pagination ? v(a.$slots, "pagination", J(V({ key: 0 }, e.pagination)), () => [
545
+ A(Fe, {
546
+ pagination: e.pagination,
547
+ "per-page": e.perPage,
548
+ "per-page-label": e.perPageLabel,
549
+ "per-page-options": e.perPageOptions,
550
+ "from-label": e.fromLabel,
551
+ "prev-icon": e.prevIcon,
552
+ "next-icon": e.nextIcon,
553
+ "onPagination:change": u[0] || (u[0] = (l) => b("pagination:change", l)),
554
+ "onPagination:perPage": u[1] || (u[1] = (l) => b("pagination:perPage", l))
555
+ }, null, 8, ["pagination", "per-page", "per-page-label", "per-page-options", "from-label", "prev-icon", "next-icon"])
556
+ ]) : y("", !0)
557
+ ]));
558
+ }
559
+ }), He = {
560
+ key: 1,
561
+ class: "rvc-empty-state-title"
562
+ }, pt = /* @__PURE__ */ T({
563
+ __name: "EmptyState",
564
+ props: {
565
+ title: {},
566
+ background: { type: Boolean },
567
+ icon: { type: [Function, Object, null] }
568
+ },
569
+ setup(e) {
570
+ return (d, o) => (t(), n("div", {
571
+ class: k(["rvc-empty-state", { "rvc-empty-state-bg": e.background }])
572
+ }, [
573
+ e.icon ? (t(), x(I(e.icon), {
574
+ key: 0,
575
+ class: "rvc-empty-state-icon"
576
+ })) : y("", !0),
577
+ e.title ? (t(), n("p", He, g(e.title), 1)) : y("", !0),
578
+ v(d.$slots, "default")
579
+ ], 2));
580
+ }
581
+ }), We = ["accept", "multiple", "disabled"], Ke = ["disabled"], qe = {
582
+ key: 0,
583
+ class: "rvc-file-upload-label"
584
+ }, Ge = {
585
+ key: 1,
586
+ class: "rvc-file-upload-description"
587
+ }, Je = { class: "rvc-file-upload-list" }, Qe = ["src", "alt"], Xe = ["href"], Ye = {
588
+ key: 2,
589
+ class: "rvc-file-upload-file"
590
+ }, _e = ["disabled", "aria-label", "onClick"], et = ["src", "alt"], tt = { class: "rvc-file-upload-file" }, at = ["disabled", "aria-label", "onClick"], ht = /* @__PURE__ */ T({
591
+ inheritAttrs: !1,
592
+ __name: "FileUpload",
593
+ props: {
594
+ modelValue: { default: null },
595
+ existingFiles: { default: () => [] },
596
+ variant: { default: "area" },
597
+ size: { default: "base" },
598
+ multiple: { type: Boolean, default: !1 },
599
+ accept: { default: void 0 },
600
+ disabled: { type: Boolean, default: !1 },
601
+ showThumbnails: { type: Boolean, default: !1 },
602
+ label: { default: "Drop your files here" },
603
+ description: { default: "" },
604
+ buttonLabel: { default: "Upload file" },
605
+ buttonColor: { default: "primary" },
606
+ icon: { type: [Function, Object, null], default: null },
607
+ rootClass: { default: "" }
608
+ },
609
+ emits: ["update:modelValue", "file-upload:add", "file-upload:remove", "file-upload:remove-existing"],
610
+ setup(e, { emit: d }) {
611
+ const o = e, b = d, r = M(null), f = M(!1), p = M(0), a = M(/* @__PURE__ */ new Map()), u = N(), l = P(() => o.icon ?? we), s = P(() => o.modelValue ? Array.isArray(o.modelValue) ? o.modelValue : [o.modelValue] : []), h = (i) => i.type.startsWith("image/");
612
+ se(
613
+ [s, () => o.showThumbnails],
614
+ ([i, $]) => {
615
+ const m = new Set(i);
616
+ a.value.forEach((C, F) => {
617
+ $ && m.has(F) && h(F) || (URL.revokeObjectURL(C), a.value.delete(F));
618
+ }), $ && i.filter((C) => h(C) && !a.value.has(C)).forEach((C) => a.value.set(C, URL.createObjectURL(C)));
619
+ },
620
+ { immediate: !0 }
621
+ ), ie(() => {
622
+ a.value.forEach((i) => URL.revokeObjectURL(i)), a.value.clear();
623
+ });
624
+ const S = () => {
625
+ o.disabled || r.value?.click();
626
+ }, R = (i) => {
627
+ if (o.disabled || !i.length)
628
+ return;
629
+ const $ = o.multiple ? i : i.slice(0, 1), m = o.multiple ? [...s.value, ...$] : $;
630
+ b("update:modelValue", o.multiple ? m : m[0] ?? null), b("file-upload:add", $);
631
+ }, z = (i) => {
632
+ const $ = i.target;
633
+ R(Array.from($.files ?? [])), $.value = "";
634
+ }, Z = (i) => Array.from(i.dataTransfer?.types ?? []).includes("Files"), X = (i) => o.showThumbnails && a.value.has(i), H = (i) => {
635
+ if (i.thumbnailUrl)
636
+ return i.thumbnailUrl;
637
+ if (i.type?.startsWith("image/") && i.url)
638
+ return i.url;
639
+ }, Y = (i) => o.showThumbnails && !!H(i), _ = (i) => {
640
+ o.disabled || !Z(i) || (p.value += 1, f.value = !0);
641
+ }, ee = (i) => {
642
+ if (o.disabled || !Z(i))
643
+ return;
644
+ const { dataTransfer: $ } = i;
645
+ $ && ($.dropEffect = "copy"), f.value = !0;
646
+ }, te = () => {
647
+ p.value = Math.max(0, p.value - 1), f.value = p.value > 0;
648
+ }, ae = (i) => {
649
+ o.disabled || (p.value = 0, f.value = !1, R(Array.from(i.dataTransfer?.files ?? [])));
650
+ }, W = (i) => {
651
+ if (o.disabled)
652
+ return;
653
+ const $ = typeof i == "number" ? i : s.value.indexOf(i), m = s.value[$];
654
+ if (!m)
655
+ return;
656
+ const C = s.value.filter((F, le) => le !== $);
657
+ b("update:modelValue", o.multiple ? C : C[0] ?? null), b("file-upload:remove", m);
658
+ }, K = (i) => {
659
+ o.disabled || b("file-upload:remove-existing", i);
660
+ };
661
+ return (i, $) => (t(), n("div", {
662
+ class: k([
663
+ "rvc-file-upload",
664
+ `rvc-file-upload-variant-${e.variant}`,
665
+ `rvc-file-upload-${e.size}`,
666
+ {
667
+ "rvc-file-upload-dragging": f.value,
668
+ "rvc-file-upload-disabled": e.disabled
669
+ },
670
+ e.rootClass
671
+ ])
672
+ }, [
673
+ c("input", V(w(u), {
674
+ ref_key: "input",
675
+ ref: r,
676
+ class: "rvc-file-upload-input",
677
+ type: "file",
678
+ accept: e.accept || void 0,
679
+ multiple: e.multiple,
680
+ disabled: e.disabled,
681
+ onChange: z
682
+ }), null, 16, We),
683
+ e.variant === "area" ? (t(), n("button", {
684
+ key: 0,
685
+ class: "rvc-file-upload-area",
686
+ type: "button",
687
+ disabled: e.disabled,
688
+ onClick: S,
689
+ onDragenter: U(_, ["prevent"]),
690
+ onDragover: U(ee, ["prevent"]),
691
+ onDragleave: U(te, ["prevent"]),
692
+ onDrop: U(ae, ["prevent"])
693
+ }, [
694
+ v(i.$slots, "icon", { icon: l.value }, () => [
695
+ (t(), x(I(l.value), {
696
+ class: "rvc-file-upload-icon",
697
+ "aria-hidden": "true"
698
+ }))
699
+ ]),
700
+ e.label ? (t(), n("span", qe, g(e.label), 1)) : y("", !0),
701
+ e.description ? (t(), n("span", Ge, g(e.description), 1)) : y("", !0)
702
+ ], 40, Ke)) : (t(), x(de, {
703
+ key: 1,
704
+ label: e.buttonLabel,
705
+ icon: l.value,
706
+ color: e.buttonColor,
707
+ size: e.size,
708
+ "icon-left": "",
709
+ type: "button",
710
+ disabled: e.disabled,
711
+ onClick: S
712
+ }, {
713
+ icon: D(({ icon: m }) => [
714
+ v(i.$slots, "icon", { icon: m }, () => [
715
+ m ? (t(), x(I(m), {
716
+ key: 0,
717
+ class: "rvc-button-icon",
718
+ "aria-hidden": "true"
719
+ })) : y("", !0)
720
+ ])
721
+ ]),
722
+ _: 3
723
+ }, 8, ["label", "icon", "color", "size", "disabled"])),
724
+ s.value.length || e.existingFiles.length ? v(i.$slots, "preview", {
725
+ key: 2,
726
+ files: s.value,
727
+ existingFiles: e.existingFiles,
728
+ removeFile: W,
729
+ removeExistingFile: K
730
+ }, () => [
731
+ c("ul", Je, [
732
+ (t(!0), n(L, null, B(e.existingFiles, (m) => (t(), n("li", {
733
+ key: `existing-${m.id}`,
734
+ class: "rvc-file-upload-item"
735
+ }, [
736
+ Y(m) ? (t(), n("img", {
737
+ key: 0,
738
+ class: "rvc-file-upload-thumbnail",
739
+ src: H(m),
740
+ alt: m.name
741
+ }, null, 8, Qe)) : y("", !0),
742
+ m.url ? (t(), n("a", {
743
+ key: 1,
744
+ class: "rvc-file-upload-file",
745
+ href: m.url
746
+ }, g(m.name), 9, Xe)) : (t(), n("span", Ye, g(m.name), 1)),
747
+ c("button", {
748
+ class: "rvc-file-upload-remove",
749
+ type: "button",
750
+ disabled: e.disabled,
751
+ "aria-label": `Remove ${m.name}`,
752
+ onClick: (C) => K(m)
753
+ }, [
754
+ A(w(q), { "aria-hidden": "true" })
755
+ ], 8, _e)
756
+ ]))), 128)),
757
+ (t(!0), n(L, null, B(s.value, (m, C) => (t(), n("li", {
758
+ key: `${m.name}-${m.lastModified}-${C}`,
759
+ class: "rvc-file-upload-item"
760
+ }, [
761
+ X(m) ? (t(), n("img", {
762
+ key: 0,
763
+ class: "rvc-file-upload-thumbnail",
764
+ src: a.value.get(m),
765
+ alt: m.name
766
+ }, null, 8, et)) : y("", !0),
767
+ c("span", tt, g(m.name), 1),
768
+ c("button", {
769
+ class: "rvc-file-upload-remove",
770
+ type: "button",
771
+ disabled: e.disabled,
772
+ "aria-label": `Remove ${m.name}`,
773
+ onClick: (F) => W(C)
774
+ }, [
775
+ A(w(q), { "aria-hidden": "true" })
776
+ ], 8, at)
777
+ ]))), 128))
778
+ ])
779
+ ]) : y("", !0)
780
+ ], 2));
781
+ }
782
+ }), yt = /* @__PURE__ */ T({
783
+ __name: "FormTextarea",
784
+ props: {
785
+ modelValue: { default: void 0 },
786
+ size: { default: "base" }
787
+ },
788
+ emits: ["update:modelValue"],
789
+ setup(e, { emit: d }) {
790
+ const o = e, b = d, { hasModelBinding: r } = E(), f = M(null), p = P({
791
+ get: () => o.modelValue,
792
+ set: (u) => b("update:modelValue", u)
793
+ }), a = P(() => [
794
+ "rvc-textarea",
795
+ `rvc-textarea-${o.size}`
796
+ ]);
797
+ return (u, l) => w(r) ? j((t(), n("textarea", {
798
+ key: 0,
799
+ ref_key: "textarea",
800
+ ref: f,
801
+ "onUpdate:modelValue": l[0] || (l[0] = (s) => p.value = s),
802
+ class: k(a.value)
803
+ }, null, 2)), [
804
+ [re, p.value]
805
+ ]) : (t(), n("textarea", {
806
+ key: 1,
807
+ ref_key: "textarea",
808
+ ref: f,
809
+ class: k(a.value)
810
+ }, null, 2));
811
+ }
812
+ }), lt = { class: "rvc-radio-input" }, nt = { class: "rvc-radio-label" }, $t = /* @__PURE__ */ T({
813
+ inheritAttrs: !1,
814
+ __name: "Radio",
815
+ props: {
816
+ modelValue: { type: [Boolean, String, Array, Object, Number, null], default: null },
817
+ label: { default: "" },
818
+ rootClass: { default: "" }
819
+ },
820
+ emits: ["update:modelValue"],
821
+ setup(e, { emit: d }) {
822
+ const o = e, b = d, r = P({
823
+ get: () => o.modelValue,
824
+ set: (l) => b("update:modelValue", l)
825
+ }), { hasModelBinding: f } = E(), p = N(), a = P(() => ({
826
+ ...p,
827
+ type: "radio"
828
+ })), u = M(null);
829
+ return (l, s) => (t(), n("label", {
830
+ class: k(["rvc-radio", e.rootClass])
831
+ }, [
832
+ c("div", lt, [
833
+ w(f) ? j((t(), n("input", V({ key: 0 }, a.value, {
834
+ ref_key: "input",
835
+ ref: u,
836
+ "onUpdate:modelValue": s[0] || (s[0] = (h) => r.value = h)
837
+ }), null, 16)), [
838
+ [G, r.value]
839
+ ]) : (t(), n("input", V({ key: 1 }, a.value, {
840
+ ref_key: "input",
841
+ ref: u
842
+ }), null, 16))
843
+ ]),
844
+ v(l.$slots, "default", {}, () => [
845
+ c("span", nt, g(e.label), 1)
846
+ ])
847
+ ], 2));
848
+ }
849
+ }), ot = { class: "rvc-tabs-nav" }, st = ["value", "selected"], kt = /* @__PURE__ */ T({
850
+ inheritAttrs: !1,
851
+ __name: "Tabs",
852
+ props: {
853
+ modelValue: { default: void 0 },
854
+ tabs: { default: () => [] },
855
+ tabStyle: { default: "default" }
856
+ },
857
+ emits: ["update:modelValue", "tabs:change"],
858
+ setup(e, { emit: d }) {
859
+ const o = e, b = d, r = () => {
860
+ const u = o.tabs.findIndex((l) => l.active);
861
+ return u >= 0 ? u : 0;
862
+ }, f = P({
863
+ get: () => o.modelValue ?? r(),
864
+ set: (u) => {
865
+ const l = o.tabs[u];
866
+ b("update:modelValue", u), l && b("tabs:change", l);
867
+ }
868
+ }), p = (u) => {
869
+ const s = +u.target.value;
870
+ f.value = s;
871
+ const h = o.tabs[s];
872
+ h?.selectEvent && h.selectEvent();
873
+ }, a = (u) => {
874
+ const {
875
+ active: l,
876
+ as: s,
877
+ bindAs: h,
878
+ selectEvent: S,
879
+ name: R,
880
+ ...z
881
+ } = u;
882
+ return z;
883
+ };
884
+ return (u, l) => (t(), n(L, null, [
885
+ c("div", V(u.$attrs, {
886
+ class: ["rvc-tabs", { "rvc-tabs-buttons": e.tabStyle === "buttons" }]
887
+ }), [
888
+ c("nav", ot, [
889
+ (t(!0), n(L, null, B(e.tabs, (s, h) => (t(), x(I(s.as ? s.as : "button"), V({ ref_for: !0 }, a(s), {
890
+ key: `${h}-tab-item`,
891
+ as: s.bindAs ? s.bindAs : void 0,
892
+ class: ["rvc-tab", { "rvc-tab-active": f.value === h }],
893
+ onClick: (S) => f.value = h
894
+ }), {
895
+ default: D(() => [
896
+ O(g(s.name), 1)
897
+ ]),
898
+ _: 2
899
+ }, 1040, ["as", "class", "onClick"]))), 128))
900
+ ])
901
+ ], 16),
902
+ A(Q, V(u.$attrs, {
903
+ "root-class": "rvc-tabs-select",
904
+ value: f.value,
905
+ onChange: p
906
+ }), {
907
+ default: D(() => [
908
+ (t(!0), n(L, null, B(e.tabs, (s, h) => (t(), n("option", {
909
+ key: `${h}-tab-item-select-option`,
910
+ value: h,
911
+ selected: f.value === h
912
+ }, g(s.name), 9, st))), 128))
913
+ ]),
914
+ _: 1
915
+ }, 16, ["value"])
916
+ ], 64));
917
+ }
918
+ });
919
+ export {
920
+ ft as _,
921
+ mt as a,
922
+ bt as b,
923
+ gt as c,
924
+ pt as d,
925
+ ht as e,
926
+ Q as f,
927
+ yt as g,
928
+ Fe as h,
929
+ $t as i,
930
+ kt as j
931
+ };