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