@robuust-digital/vue-components 2.0.0 → 2.1.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,10 +1,10 @@
1
- import { createElementBlock as l, openBlock as a, createElementVNode as c, Fragment as S, renderList as V, renderSlot as g, createTextVNode as P, toDisplayString as m, createVNode as x, unref as $, normalizeClass as y, createBlock as w, resolveDynamicComponent as C, withCtx as O, createCommentVNode as h, computed as B, useAttrs as N, ref as A, withDirectives as M, mergeProps as b, vModelDynamic as q, normalizeProps as D, guardReactiveProps as z, vModelSelect as E, vModelText as R } from "vue";
1
+ import { createElementBlock as l, openBlock as a, createElementVNode as d, Fragment as k, renderList as V, renderSlot as c, createTextVNode as T, toDisplayString as f, createVNode as C, unref as h, normalizeClass as y, createBlock as w, resolveDynamicComponent as x, withCtx as O, createCommentVNode as $, computed as B, useAttrs as N, ref as A, withDirectives as M, mergeProps as p, vModelDynamic as q, normalizeProps as D, guardReactiveProps as z, vModelSelect as E, vModelText as R } from "vue";
2
2
  import { r as U } from "../_shared/XMarkIcon-90mcPzBs.js";
3
3
  import { r as Z } from "../_shared/ChevronDownIcon-z-5U4fIb.js";
4
- import { _ as Ee } from "../_shared/ChevronDownIcon-z-5U4fIb.js";
5
- import { _ as Ue } from "../_shared/ButtonBase-DfkwHIhN.js";
6
- import { u as j } from "../_shared/FormInput-C5LjZViC.js";
7
- import { _ as Ke } from "../_shared/FormInput-C5LjZViC.js";
4
+ import { _ as Re } from "../_shared/ChevronDownIcon-z-5U4fIb.js";
5
+ import { _ as Ze } from "../_shared/ButtonBase-DfkwHIhN.js";
6
+ import { u as j } from "../_shared/FormInput-B-SQTZTA.js";
7
+ import { _ as Ge } from "../_shared/FormInput-B-SQTZTA.js";
8
8
  import { S as K } from "../_shared/icon-spinner-CmxIOqaK.js";
9
9
  function G(e, u) {
10
10
  return a(), l("svg", {
@@ -14,7 +14,7 @@ function G(e, u) {
14
14
  "aria-hidden": "true",
15
15
  "data-slot": "icon"
16
16
  }, [
17
- c("path", {
17
+ d("path", {
18
18
  "fill-rule": "evenodd",
19
19
  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",
20
20
  "clip-rule": "evenodd"
@@ -29,14 +29,14 @@ function J(e, u) {
29
29
  "aria-hidden": "true",
30
30
  "data-slot": "icon"
31
31
  }, [
32
- c("path", {
32
+ d("path", {
33
33
  "fill-rule": "evenodd",
34
34
  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",
35
35
  "clip-rule": "evenodd"
36
36
  })
37
37
  ]);
38
38
  }
39
- const Q = { class: "rvc-accordion" }, W = ["open", "name"], X = ["innerHTML"], Oe = {
39
+ const Q = { class: "rvc-accordion" }, W = ["open", "name"], X = ["innerHTML"], Me = {
40
40
  __name: "Accordion",
41
41
  props: {
42
42
  items: {
@@ -59,35 +59,35 @@ const Q = { class: "rvc-accordion" }, W = ["open", "name"], X = ["innerHTML"], O
59
59
  },
60
60
  setup(e) {
61
61
  return (u, r) => (a(), l("div", Q, [
62
- (a(!0), l(S, null, V(e.items, (d, i) => (a(), l("details", {
63
- key: i,
64
- open: e.defaultOpenIndex === i,
62
+ (a(!0), l(k, null, V(e.items, (v, o) => (a(), l("details", {
63
+ key: o,
64
+ open: e.defaultOpenIndex === o,
65
65
  name: e.name
66
66
  }, [
67
- c("summary", null, [
68
- g(u.$slots, "summary", {
69
- item: d,
70
- index: i
67
+ d("summary", null, [
68
+ c(u.$slots, "summary", {
69
+ item: v,
70
+ index: o
71
71
  }, () => [
72
- P(m(d.title) + " ", 1),
73
- g(u.$slots, "icon", { classList: "rvc-accordion-icon" }, () => [
74
- x($(J), { class: "rvc-accordion-icon" })
72
+ T(f(v.title) + " ", 1),
73
+ c(u.$slots, "icon", { classList: "rvc-accordion-icon" }, () => [
74
+ C(h(J), { class: "rvc-accordion-icon" })
75
75
  ])
76
76
  ])
77
77
  ]),
78
- c("div", {
78
+ d("div", {
79
79
  class: y(["rvc-accordion-content", e.contentClass])
80
80
  }, [
81
- g(u.$slots, "content", { item: d }, () => [
82
- c("div", {
83
- innerHTML: d.content
81
+ c(u.$slots, "content", { item: v }, () => [
82
+ d("div", {
83
+ innerHTML: v.content
84
84
  }, null, 8, X)
85
85
  ])
86
86
  ], 2)
87
87
  ], 8, W))), 128))
88
88
  ]));
89
89
  }
90
- }, Y = { class: "rvc-alert-title" }, Me = {
90
+ }, Y = { class: "rvc-alert-title" }, je = {
91
91
  __name: "Alert",
92
92
  props: {
93
93
  as: {
@@ -114,37 +114,40 @@ const Q = { class: "rvc-accordion" }, W = ["open", "name"], X = ["innerHTML"], O
114
114
  },
115
115
  emits: ["alert:close"],
116
116
  setup(e) {
117
- return (u, r) => (a(), w(C(e.as), {
117
+ return (u, r) => (a(), w(x(e.as), {
118
118
  class: y(["rvc-alert", `rvc-alert-${e.type}`])
119
119
  }, {
120
120
  default: O(() => [
121
- g(u.$slots, "icon", {}, () => [
122
- e.icon ? (a(), w(C(e.icon), {
121
+ c(u.$slots, "icon", {}, () => [
122
+ e.icon ? (a(), w(x(e.icon), {
123
123
  key: 0,
124
124
  class: "rvc-alert-icon"
125
- })) : h("", !0)
125
+ })) : $("", !0)
126
126
  ]),
127
- c("div", null, [
128
- g(u.$slots, "title", {}, () => [
129
- c("span", Y, m(e.title), 1)
127
+ d("div", null, [
128
+ c(u.$slots, "title", {}, () => [
129
+ d("span", Y, f(e.title), 1)
130
130
  ]),
131
- g(u.$slots, "default")
131
+ c(u.$slots, "default")
132
132
  ]),
133
- g(u.$slots, "close", {}, () => [
133
+ c(u.$slots, "close", {}, () => [
134
134
  e.close ? (a(), l("button", {
135
135
  key: 0,
136
136
  type: "button",
137
137
  class: "rvc-alert-close",
138
- onClick: r[0] || (r[0] = (d) => u.$emit("alert:close"))
138
+ onClick: r[0] || (r[0] = (v) => u.$emit("alert:close"))
139
139
  }, [
140
- x($(U))
141
- ])) : h("", !0)
140
+ C(h(U))
141
+ ])) : $("", !0)
142
142
  ])
143
143
  ]),
144
144
  _: 3
145
145
  }, 8, ["class"]));
146
146
  }
147
- }, _ = { class: "rvc-checkbox-input" }, ee = ["for"], je = /* @__PURE__ */ Object.assign({
147
+ }, _ = { class: "rvc-checkbox-input" }, ee = {
148
+ key: 0,
149
+ class: "rvc-checkbox-label"
150
+ }, Ie = /* @__PURE__ */ Object.assign({
148
151
  inheritAttrs: !1
149
152
  }, {
150
153
  __name: "Checkbox",
@@ -153,10 +156,6 @@ const Q = { class: "rvc-accordion" }, W = ["open", "name"], X = ["innerHTML"], O
153
156
  type: [Boolean, String, Array, Object, Number],
154
157
  default: null
155
158
  },
156
- id: {
157
- type: String,
158
- default: null
159
- },
160
159
  label: {
161
160
  type: String,
162
161
  default: ""
@@ -168,34 +167,35 @@ const Q = { class: "rvc-accordion" }, W = ["open", "name"], X = ["innerHTML"], O
168
167
  },
169
168
  emits: ["update:modelValue"],
170
169
  setup(e, { emit: u }) {
171
- const r = e, d = u, i = B({
170
+ const r = e, v = u, o = B({
172
171
  get: () => r.modelValue,
173
- set: (t) => d("update:modelValue", t)
174
- }), { hasModelBinding: v } = j(), f = N(), s = B(() => ({
175
- ...f,
176
- id: r.id,
172
+ set: (t) => v("update:modelValue", t)
173
+ }), { hasModelBinding: g } = j(), m = N(), s = B(() => ({
174
+ ...m,
177
175
  type: "checkbox"
178
176
  })), n = A(null);
179
- return (t, o) => (a(), l("div", {
177
+ return (t, i) => (a(), l("label", {
180
178
  class: y(["rvc-checkbox", e.rootClass])
181
179
  }, [
182
- $(v) ? M((a(), l("input", b({ key: 0 }, s.value, {
180
+ h(g) ? M((a(), l("input", p({ key: 0 }, s.value, {
183
181
  ref_key: "input",
184
182
  ref: n,
185
- "onUpdate:modelValue": o[0] || (o[0] = (p) => i.value = p)
183
+ "onUpdate:modelValue": i[0] || (i[0] = (b) => o.value = b)
186
184
  }), null, 16)), [
187
- [q, i.value]
188
- ]) : (a(), l("input", b({ key: 1 }, s.value, {
185
+ [q, o.value]
186
+ ]) : (a(), l("input", p({ key: 1 }, s.value, {
189
187
  ref_key: "input",
190
188
  ref: n
191
189
  }), null, 16)),
192
- c("span", _, [
193
- x($(G))
190
+ c(t.$slots, "input", {}, () => [
191
+ d("span", _, [
192
+ c(t.$slots, "icon", {}, () => [
193
+ C(h(G))
194
+ ])
195
+ ])
194
196
  ]),
195
- c("div", null, [
196
- t.$slots.default || e.label ? g(t.$slots, "default", { key: 0 }, () => [
197
- c("label", { for: e.id }, m(e.label), 9, ee)
198
- ]) : h("", !0)
197
+ c(t.$slots, "default", { label: e.label }, () => [
198
+ e.label ? (a(), l("span", ee, f(e.label), 1)) : $("", !0)
199
199
  ])
200
200
  ], 2));
201
201
  }
@@ -208,7 +208,7 @@ function te(e, u) {
208
208
  "aria-hidden": "true",
209
209
  "data-slot": "icon"
210
210
  }, [
211
- c("path", {
211
+ d("path", {
212
212
  "fill-rule": "evenodd",
213
213
  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",
214
214
  "clip-rule": "evenodd"
@@ -223,7 +223,7 @@ function ae(e, u) {
223
223
  "aria-hidden": "true",
224
224
  "data-slot": "icon"
225
225
  }, [
226
- c("path", {
226
+ d("path", {
227
227
  "fill-rule": "evenodd",
228
228
  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",
229
229
  "clip-rule": "evenodd"
@@ -238,14 +238,14 @@ function ne(e, u) {
238
238
  "aria-hidden": "true",
239
239
  "data-slot": "icon"
240
240
  }, [
241
- c("path", {
241
+ d("path", {
242
242
  "fill-rule": "evenodd",
243
243
  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",
244
244
  "clip-rule": "evenodd"
245
245
  })
246
246
  ]);
247
247
  }
248
- const H = /* @__PURE__ */ Object.assign({
248
+ const le = ["value"], se = ["value"], H = /* @__PURE__ */ Object.assign({
249
249
  inheritAttrs: !1
250
250
  }, {
251
251
  __name: "FormSelect",
@@ -270,14 +270,26 @@ const H = /* @__PURE__ */ Object.assign({
270
270
  type: String,
271
271
  default: "base",
272
272
  validator: (e) => ["sm", "base"].includes(e)
273
+ },
274
+ options: {
275
+ type: Array,
276
+ default: () => []
277
+ },
278
+ optionLabel: {
279
+ type: String,
280
+ default: "name"
281
+ },
282
+ optionValue: {
283
+ type: String,
284
+ default: "id"
273
285
  }
274
286
  },
275
287
  emits: ["update:modelValue"],
276
288
  setup(e, { emit: u }) {
277
- const r = e, d = u, i = B({
289
+ const r = e, v = u, o = B({
278
290
  get: () => r.modelValue,
279
- set: (s) => d("update:modelValue", s)
280
- }), { hasModelBinding: v } = j(), f = A(null);
291
+ set: (s) => v("update:modelValue", s)
292
+ }), { hasModelBinding: g } = j(), m = A(null);
281
293
  return (s, n) => (a(), l("div", {
282
294
  class: y([
283
295
  "rvc-select",
@@ -285,37 +297,47 @@ const H = /* @__PURE__ */ Object.assign({
285
297
  e.rootClass
286
298
  ])
287
299
  }, [
288
- e.prefixIcon ? g(s.$slots, "prefixIcon", {
300
+ e.prefixIcon ? c(s.$slots, "prefixIcon", {
289
301
  key: 0,
290
302
  icon: e.prefixIcon
291
303
  }, () => [
292
- (a(), w(C(e.prefixIcon), { "aria-hidden": "true" }))
293
- ]) : h("", !0),
294
- g(s.$slots, "select", D(z(s.$attrs)), () => [
295
- $(v) ? M((a(), l("select", b({ key: 0 }, s.$attrs, {
304
+ (a(), w(x(e.prefixIcon), { "aria-hidden": "true" }))
305
+ ]) : $("", !0),
306
+ c(s.$slots, "select", D(z(s.$attrs)), () => [
307
+ h(g) ? M((a(), l("select", p({ key: 0 }, s.$attrs, {
296
308
  ref_key: "select",
297
- ref: f,
298
- "onUpdate:modelValue": n[0] || (n[0] = (t) => i.value = t)
309
+ ref: m,
310
+ "onUpdate:modelValue": n[0] || (n[0] = (t) => o.value = t)
299
311
  }), [
300
- g(s.$slots, "default")
312
+ c(s.$slots, "default", {}, () => [
313
+ e.options.length > 0 ? (a(!0), l(k, { key: 0 }, V(e.options, (t, i) => (a(), l("option", {
314
+ key: `option-${i}-${t[e.optionValue]}`,
315
+ value: t[e.optionValue]
316
+ }, f(t[e.optionLabel]), 9, le))), 128)) : $("", !0)
317
+ ])
301
318
  ], 16)), [
302
- [E, i.value]
303
- ]) : (a(), l("select", b({ key: 1 }, s.$attrs, {
319
+ [E, o.value]
320
+ ]) : (a(), l("select", p({ key: 1 }, s.$attrs, {
304
321
  ref_key: "select",
305
- ref: f
322
+ ref: m
306
323
  }), [
307
- g(s.$slots, "default")
324
+ c(s.$slots, "default", {}, () => [
325
+ e.options.length > 0 ? (a(!0), l(k, { key: 0 }, V(e.options, (t, i) => (a(), l("option", {
326
+ key: `option-${i}-${t[e.optionValue]}`,
327
+ value: t[e.optionValue]
328
+ }, f(t[e.optionLabel]), 9, se))), 128)) : $("", !0)
329
+ ])
308
330
  ], 16))
309
331
  ]),
310
- g(s.$slots, "icon", { icon: e.icon }, () => [
311
- (a(), w(C(e.icon ?? $(Z)), { "aria-hidden": "true" }))
332
+ c(s.$slots, "icon", { icon: e.icon }, () => [
333
+ (a(), w(x(e.icon ?? h(Z)), { "aria-hidden": "true" }))
312
334
  ])
313
335
  ], 2));
314
336
  }
315
- }), le = {
337
+ }), oe = {
316
338
  key: 0,
317
339
  class: "rvc-pagination"
318
- }, se = ["value"], ie = { class: "rvc-pagination-info" }, re = { class: "rvc-pagination-nav-list" }, oe = ["disabled", "onClick"], ue = { key: 2 }, ce = { key: 3 }, de = {
340
+ }, ie = ["value"], re = { class: "rvc-pagination-info" }, ue = { class: "rvc-pagination-nav-list" }, ce = ["disabled", "onClick"], de = { key: 2 }, ve = { key: 3 }, ge = {
319
341
  __name: "Pagination",
320
342
  props: {
321
343
  pagination: {
@@ -341,78 +363,78 @@ const H = /* @__PURE__ */ Object.assign({
341
363
  },
342
364
  emits: ["pagination:change", "pagination:perPage"],
343
365
  setup(e, { emit: u }) {
344
- const r = e, d = u, i = A(r.perPage);
345
- return (v, f) => {
366
+ const r = e, v = u, o = A(r.perPage);
367
+ return (g, m) => {
346
368
  var s;
347
- return (s = e.pagination) != null && s.total ? (a(), l("div", le, [
348
- g(v.$slots, "perPage", b(e.pagination, { perPage: i.value }), () => [
349
- x(H, {
350
- modelValue: i.value,
369
+ return (s = e.pagination) != null && s.total ? (a(), l("div", oe, [
370
+ c(g.$slots, "perPage", p(e.pagination, { perPage: o.value }), () => [
371
+ C(H, {
372
+ modelValue: o.value,
351
373
  "onUpdate:modelValue": [
352
- f[0] || (f[0] = (n) => i.value = n),
353
- f[1] || (f[1] = (n) => d("pagination:perPage", n))
374
+ m[0] || (m[0] = (n) => o.value = n),
375
+ m[1] || (m[1] = (n) => v("pagination:perPage", n))
354
376
  ],
355
377
  size: "sm",
356
378
  "root-class": "rvc-pagination-per-page"
357
379
  }, {
358
380
  default: O(() => [
359
- (a(!0), l(S, null, V(e.perPageOptions, (n) => (a(), l("option", {
381
+ (a(!0), l(k, null, V(e.perPageOptions, (n) => (a(), l("option", {
360
382
  key: `pagination-items-per-page-option-${n}`,
361
383
  value: n
362
- }, m(n) + " " + m(e.perPageLabel), 9, se))), 128))
384
+ }, f(n) + " " + f(e.perPageLabel), 9, ie))), 128))
363
385
  ]),
364
386
  _: 1
365
387
  }, 8, ["modelValue"])
366
388
  ]),
367
- g(v.$slots, "info", b(e.pagination, { fromLabel: e.fromLabel }), () => [
368
- c("div", ie, m(e.pagination.from) + " - " + m(e.pagination.to) + " " + m(e.fromLabel) + " " + m(e.pagination.total), 1)
389
+ c(g.$slots, "info", p(e.pagination, { fromLabel: e.fromLabel }), () => [
390
+ d("div", re, f(e.pagination.from) + " - " + f(e.pagination.to) + " " + f(e.fromLabel) + " " + f(e.pagination.total), 1)
369
391
  ]),
370
- c("nav", null, [
371
- c("ol", re, [
372
- (a(!0), l(S, null, V(e.pagination.links, (n, t) => (a(), l("li", {
392
+ d("nav", null, [
393
+ d("ol", ue, [
394
+ (a(!0), l(k, null, V(e.pagination.links, (n, t) => (a(), l("li", {
373
395
  key: `pagination-link-${n.label}-${t}`,
374
396
  class: "rvc-pagination-nav-list-item"
375
397
  }, [
376
- c("button", {
398
+ d("button", {
377
399
  type: "button",
378
400
  disabled: n.label === "..." || !n.url,
379
401
  class: y([
380
402
  "rvc-pagination-button",
381
403
  { "rvc-pagination-button-active": n.active }
382
404
  ]),
383
- onClick: (o) => n.url && d("pagination:change", n.url)
405
+ onClick: (i) => n.url && v("pagination:change", n.url)
384
406
  }, [
385
- n.url !== "..." && t === 0 ? (a(), w($(ae), {
407
+ n.url !== "..." && t === 0 ? (a(), w(h(ae), {
386
408
  key: 0,
387
409
  "aria-hidden": "true",
388
410
  class: y([
389
411
  "rvc-pagination-button-icon",
390
412
  { "rvc-pagination-button-icon-disabled": !n.url }
391
413
  ])
392
- }, null, 8, ["class"])) : n.label !== "..." && t === e.pagination.links.length - 1 ? (a(), w($(ne), {
414
+ }, null, 8, ["class"])) : n.label !== "..." && t === e.pagination.links.length - 1 ? (a(), w(h(ne), {
393
415
  key: 1,
394
416
  "aria-hidden": "true",
395
417
  class: y([
396
418
  "rvc-pagination-button-icon",
397
419
  { "rvc-pagination-button-icon-disabled": !n.url }
398
420
  ])
399
- }, null, 8, ["class"])) : n.label === "..." ? (a(), l("span", ue, " ... ")) : (a(), l("span", ce, m(n.label), 1))
400
- ], 10, oe)
421
+ }, null, 8, ["class"])) : n.label === "..." ? (a(), l("span", de, " ... ")) : (a(), l("span", ve, f(n.label), 1))
422
+ ], 10, ce)
401
423
  ]))), 128))
402
424
  ])
403
425
  ])
404
- ])) : h("", !0);
426
+ ])) : $("", !0);
405
427
  };
406
428
  }
407
- }, ve = { key: 0 }, ge = ["aria-label", "onClick"], fe = ["innerHTML"], me = { key: 1 }, pe = ["colspan"], ye = { key: 2 }, be = ["colspan"], $e = { class: "rvc-table-spinner-wrapper" }, Ie = {
429
+ }, fe = { key: 0 }, me = ["aria-label", "onClick"], be = ["innerHTML"], ye = { key: 1 }, pe = ["colspan"], $e = { key: 2 }, he = ["colspan"], ke = { class: "rvc-table-spinner-wrapper" }, Se = { key: 1 }, Fe = {
408
430
  __name: "DataTable",
409
431
  props: {
410
432
  headers: {
411
433
  type: Array,
412
434
  default: () => [],
413
435
  validator: (e) => e.every((r) => {
414
- const d = !r.align || ["left", "center", "right"].includes(r.align), v = !(r.sortable === !0) || typeof r.key == "string" && r.key.length > 0;
415
- return v || console.warn("[DataTable] Header item with sortable=true is missing required 'key' property:", r), !d && r.align && console.warn("[DataTable] Header item has invalid 'align' value. Must be 'left', 'center' or 'right':", r), d && v;
436
+ const v = !r.align || ["left", "center", "right"].includes(r.align), g = !(r.sortable === !0) || typeof r.key == "string" && r.key.length > 0;
437
+ return g || console.warn("[DataTable] Header item with sortable=true is missing required 'key' property:", r), !v && r.align && console.warn("[DataTable] Header item has invalid 'align' value. Must be 'left', 'center' or 'right':", r), v && g;
416
438
  })
417
439
  },
418
440
  items: {
@@ -440,36 +462,41 @@ const H = /* @__PURE__ */ Object.assign({
440
462
  wrapperClass: {
441
463
  type: String,
442
464
  default: ""
465
+ },
466
+ defaultSort: {
467
+ type: Object,
468
+ default: null,
469
+ validator: (e) => e === null ? !0 : typeof e != "object" || !e.key || !["asc", "desc"].includes(e.direction) ? (console.warn("[DataTable] Invalid defaultSort prop. Must be an object with key and direction properties."), !1) : !0
443
470
  }
444
471
  },
445
472
  emits: ["table:sortBy", "pagination:change", "pagination:perPage"],
446
473
  setup(e, { emit: u }) {
447
- const r = e, d = u, i = A(null), v = (s) => r.headers.find((n) => n.key === s), f = (s) => {
448
- !i.value || i.value.key !== s.key ? i.value = {
474
+ const r = e, v = u, o = A(r.defaultSort), g = (s) => r.headers.find((n) => n.key === s), m = (s) => {
475
+ !o.value || o.value.key !== s.key ? o.value = {
449
476
  key: s.key,
450
477
  direction: "asc"
451
- } : i.value.direction === "asc" ? i.value = {
478
+ } : o.value.direction === "asc" ? o.value = {
452
479
  key: s.key,
453
480
  direction: "desc"
454
- } : i.value = null, d("table:sortBy", i.value);
481
+ } : o.value = null, v("table:sortBy", o.value);
455
482
  };
456
483
  return (s, n) => (a(), l("div", null, [
457
- c("div", {
484
+ d("div", {
458
485
  class: y(["rvc-table-wrapper", e.wrapperClass])
459
486
  }, [
460
- c("table", {
487
+ d("table", {
461
488
  class: y([{ "rvc-table-striped": e.striped }, "rvc-table"])
462
489
  }, [
463
- e.headers.length ? (a(), l("thead", ve, [
464
- g(s.$slots, "headers", { headers: e.headers }, () => [
465
- c("tr", null, [
466
- (a(!0), l(S, null, V(e.headers, (t, o) => g(s.$slots, "header", {
490
+ e.headers.length ? (a(), l("thead", fe, [
491
+ c(s.$slots, "headers", { headers: e.headers }, () => [
492
+ d("tr", null, [
493
+ (a(!0), l(k, null, V(e.headers, (t, i) => c(s.$slots, "header", {
467
494
  header: t,
468
- index: o
495
+ index: i
469
496
  }, () => {
470
- var p, k;
497
+ var b, S;
471
498
  return [
472
- (a(), l("th", b({ ref_for: !0 }, t, {
499
+ (a(), l("th", p({ ref_for: !0 }, t, {
473
500
  key: `rvc-table-header-${t.id}`,
474
501
  class: {
475
502
  "rvc-table-text-left": t.align === "left" || !t.align,
@@ -488,107 +515,113 @@ const H = /* @__PURE__ */ Object.assign({
488
515
  "rvc-table-sort-button-right": t.align === "right"
489
516
  }
490
517
  ]),
491
- onClick: (T) => f(t)
518
+ onClick: (L) => m(t)
492
519
  }, [
493
- g(s.$slots, "header-label", {
494
- sortBy: i.value,
520
+ c(s.$slots, "header-label", {
521
+ sortBy: o.value,
495
522
  header: t
496
523
  }, () => [
497
- P(m(t.label), 1)
524
+ T(f(t.label), 1)
498
525
  ]),
499
- x($(te), {
526
+ C(h(te), {
500
527
  class: y([
501
528
  "rvc-table-sort-icon",
502
529
  {
503
- "rvc-table-sort-icon-visible": ((p = i.value) == null ? void 0 : p.key) === t.key,
504
- "rvc-table-sort-icon-invisible": !i.value || i.value.key !== t.key,
505
- "rvc-table-sort-icon-rotated": ((k = i.value) == null ? void 0 : k.key) === t.key && i.value.direction === "desc"
530
+ "rvc-table-sort-icon-visible": ((b = o.value) == null ? void 0 : b.key) === t.key,
531
+ "rvc-table-sort-icon-invisible": !o.value || o.value.key !== t.key,
532
+ "rvc-table-sort-icon-rotated": ((S = o.value) == null ? void 0 : S.key) === t.key && o.value.direction === "desc"
506
533
  }
507
534
  ])
508
535
  }, null, 8, ["class"])
509
- ], 10, ge)) : g(s.$slots, "header-label", {
536
+ ], 10, me)) : c(s.$slots, "header-label", {
510
537
  key: 1,
511
- sortBy: i.value,
538
+ sortBy: o.value,
512
539
  header: t
513
540
  }, () => [
514
- P(m(t.label), 1)
541
+ T(f(t.label), 1)
515
542
  ])
516
543
  ], 16))
517
544
  ];
518
545
  })), 256))
519
546
  ])
520
547
  ])
521
- ])) : h("", !0),
522
- c("tbody", null, [
523
- e.items.length && !e.spinning ? (a(!0), l(S, { key: 0 }, V(e.items, (t, o) => g(s.$slots, "items", {
548
+ ])) : $("", !0),
549
+ d("tbody", null, [
550
+ e.items.length && !e.spinning ? (a(!0), l(k, { key: 0 }, V(e.items, (t, i) => c(s.$slots, "items", {
524
551
  item: t,
525
- index: o
552
+ index: i
526
553
  }, () => [
527
554
  (a(), l("tr", {
528
- key: `rvc-table-row-${o}-${t.id}`
555
+ key: `rvc-table-row-${i}-${t.id}`
529
556
  }, [
530
- g(s.$slots, "item", {
557
+ c(s.$slots, "item", {
531
558
  item: t,
532
- index: o
559
+ index: i
533
560
  }, () => [
534
- (a(!0), l(S, null, V(t, (p, k) => {
535
- var T, L, I, F;
536
- return a(), l("td", b({
537
- key: `rvc-table-row-${o}-column-${k}-${t.id}`
561
+ (a(!0), l(k, null, V(t, (b, S) => {
562
+ var L, P, I, F;
563
+ return a(), l("td", p({
564
+ key: `rvc-table-row-${i}-column-${S}-${t.id}`
538
565
  }, { ref_for: !0 }, t.attrs, {
539
566
  class: {
540
- "rvc-table-text-left": ((T = v(k)) == null ? void 0 : T.align) === "left" || !((L = v(k)) != null && L.align),
541
- "rvc-table-text-center": ((I = v(k)) == null ? void 0 : I.align) === "center",
542
- "rvc-table-text-right": ((F = v(k)) == null ? void 0 : F.align) === "right"
567
+ "rvc-table-text-left": ((L = g(S)) == null ? void 0 : L.align) === "left" || !((P = g(S)) != null && P.align),
568
+ "rvc-table-text-center": ((I = g(S)) == null ? void 0 : I.align) === "center",
569
+ "rvc-table-text-right": ((F = g(S)) == null ? void 0 : F.align) === "right"
543
570
  },
544
- innerHTML: p
545
- }), null, 16, fe);
571
+ innerHTML: b
572
+ }), null, 16, be);
546
573
  }), 128))
547
574
  ])
548
575
  ]))
549
- ])), 256)) : !e.items.length && !e.spinning ? (a(), l("tr", me, [
550
- c("td", {
576
+ ])), 256)) : !e.items.length && !e.spinning ? (a(), l("tr", ye, [
577
+ d("td", {
551
578
  colspan: e.headers.length,
552
579
  class: "rvc-table-state"
553
580
  }, [
554
- c("p", null, m(e.noResultsText), 1)
581
+ d("p", null, f(e.noResultsText), 1)
555
582
  ], 8, pe)
556
- ])) : (a(), l("tr", ye, [
557
- c("td", {
583
+ ])) : (a(), l("tr", $e, [
584
+ d("td", {
558
585
  colspan: e.headers.length,
559
586
  class: "rvc-table-state"
560
587
  }, [
561
- g(s.$slots, "spinner", {
588
+ c(s.$slots, "spinner", {
562
589
  spinning: e.spinning,
563
590
  label: e.loadingText
564
591
  }, () => [
565
- c("div", $e, [
566
- e.spinning ? (a(), w($(K), {
592
+ d("div", ke, [
593
+ e.spinning ? (a(), w(h(K), {
567
594
  key: 0,
568
595
  "aria-hidden": "true",
569
596
  class: "rvc-table-spinner"
570
- })) : h("", !0),
571
- P(" " + m(e.loadingText), 1)
597
+ })) : $("", !0),
598
+ T(" " + f(e.loadingText), 1)
572
599
  ])
573
600
  ])
574
- ], 8, be)
601
+ ], 8, he)
575
602
  ]))
576
- ])
603
+ ]),
604
+ s.$slots.footer ? (a(), l("tfoot", Se, [
605
+ c(s.$slots, "footer", {
606
+ headers: e.headers,
607
+ items: e.items
608
+ })
609
+ ])) : $("", !0)
577
610
  ], 2)
578
611
  ], 2),
579
- e.pagination ? g(s.$slots, "pagination", D(b({ key: 0 }, e.pagination)), () => [
580
- x(de, {
612
+ e.pagination ? c(s.$slots, "pagination", D(p({ key: 0 }, e.pagination)), () => [
613
+ C(ge, {
581
614
  pagination: e.pagination,
582
- "onPagination:change": n[0] || (n[0] = (t) => d("pagination:change", t)),
583
- "onPagination:perPage": n[1] || (n[1] = (t) => d("pagination:perPage", t))
615
+ "onPagination:change": n[0] || (n[0] = (t) => v("pagination:change", t)),
616
+ "onPagination:perPage": n[1] || (n[1] = (t) => v("pagination:perPage", t))
584
617
  }, null, 8, ["pagination"])
585
- ]) : h("", !0)
618
+ ]) : $("", !0)
586
619
  ]));
587
620
  }
588
- }, he = {
621
+ }, Ve = {
589
622
  key: 1,
590
623
  class: "rvc-empty-state-title"
591
- }, Fe = {
624
+ }, Ne = {
592
625
  __name: "EmptyState",
593
626
  props: {
594
627
  title: {
@@ -609,15 +642,15 @@ const H = /* @__PURE__ */ Object.assign({
609
642
  return (u, r) => (a(), l("div", {
610
643
  class: y(["rvc-empty-state", { "rvc-empty-state-bg": e.background }])
611
644
  }, [
612
- e.icon ? (a(), w(C(e.icon), {
645
+ e.icon ? (a(), w(x(e.icon), {
613
646
  key: 0,
614
647
  class: "rvc-empty-state-icon"
615
- })) : h("", !0),
616
- e.title ? (a(), l("p", he, m(e.title), 1)) : h("", !0),
617
- g(u.$slots, "default")
648
+ })) : $("", !0),
649
+ e.title ? (a(), l("p", Ve, f(e.title), 1)) : $("", !0),
650
+ c(u.$slots, "default")
618
651
  ], 2));
619
652
  }
620
- }, Ne = {
653
+ }, qe = {
621
654
  __name: "FormTextarea",
622
655
  props: {
623
656
  modelValue: {
@@ -632,29 +665,29 @@ const H = /* @__PURE__ */ Object.assign({
632
665
  },
633
666
  emits: ["update:modelValue"],
634
667
  setup(e, { emit: u }) {
635
- const r = e, d = u, { hasModelBinding: i } = j(), v = A(null), f = B({
668
+ const r = e, v = u, { hasModelBinding: o } = j(), g = A(null), m = B({
636
669
  get: () => r.modelValue,
637
- set: (n) => d("update:modelValue", n)
670
+ set: (n) => v("update:modelValue", n)
638
671
  }), s = B(() => [
639
672
  "rvc-textarea",
640
673
  `rvc-textarea-${r.size}`
641
674
  ]);
642
- return (n, t) => $(i) ? M((a(), l("textarea", {
675
+ return (n, t) => h(o) ? M((a(), l("textarea", {
643
676
  key: 0,
644
677
  ref_key: "textarea",
645
- ref: v,
646
- "onUpdate:modelValue": t[0] || (t[0] = (o) => f.value = o),
678
+ ref: g,
679
+ "onUpdate:modelValue": t[0] || (t[0] = (i) => m.value = i),
647
680
  class: y(s.value)
648
681
  }, null, 2)), [
649
- [R, f.value]
682
+ [R, m.value]
650
683
  ]) : (a(), l("textarea", {
651
684
  key: 1,
652
685
  ref_key: "textarea",
653
- ref: v,
686
+ ref: g,
654
687
  class: y(s.value)
655
688
  }, null, 2));
656
689
  }
657
- }, ke = { class: "rvc-radio" }, Se = ["id"], we = { key: 2 }, Ve = ["for"], qe = /* @__PURE__ */ Object.assign({
690
+ }, we = { class: "rvc-radio" }, Be = { class: "rvc-radio-label" }, De = /* @__PURE__ */ Object.assign({
658
691
  inheritAttrs: !1
659
692
  }, {
660
693
  __name: "Radio",
@@ -663,10 +696,6 @@ const H = /* @__PURE__ */ Object.assign({
663
696
  type: [Boolean, String, Array, Object, Number],
664
697
  default: null
665
698
  },
666
- id: {
667
- type: String,
668
- default: null
669
- },
670
699
  label: {
671
700
  type: String,
672
701
  default: ""
@@ -674,35 +703,33 @@ const H = /* @__PURE__ */ Object.assign({
674
703
  },
675
704
  emits: ["update:modelValue"],
676
705
  setup(e, { emit: u }) {
677
- const r = e, d = u, i = B({
706
+ const r = e, v = u, o = B({
678
707
  get: () => r.modelValue,
679
- set: (t) => d("update:modelValue", t)
680
- }), { hasModelBinding: v } = j(), f = N(), s = B(() => ({
681
- ...f,
682
- id: r.id,
708
+ set: (t) => v("update:modelValue", t)
709
+ }), { hasModelBinding: g } = j(), m = N(), s = B(() => ({
710
+ ...m,
683
711
  type: "radio"
684
712
  })), n = A(null);
685
- return (t, o) => (a(), l("div", ke, [
686
- $(v) ? M((a(), l("input", b({ key: 0 }, s.value, {
687
- id: e.id,
713
+ return (t, i) => (a(), l("label", we, [
714
+ h(g) ? M((a(), l("input", p({ key: 0 }, s.value, {
688
715
  ref_key: "input",
689
716
  ref: n,
690
- "onUpdate:modelValue": o[0] || (o[0] = (p) => i.value = p)
691
- }), null, 16, Se)), [
692
- [q, i.value]
693
- ]) : (a(), l("input", b({ key: 1 }, s.value, {
717
+ "onUpdate:modelValue": i[0] || (i[0] = (b) => o.value = b)
718
+ }), null, 16)), [
719
+ [q, o.value]
720
+ ]) : (a(), l("input", p({ key: 1 }, s.value, {
694
721
  ref_key: "input",
695
722
  ref: n
696
723
  }), null, 16)),
697
- o[1] || (o[1] = c("span", { class: "rvc-radio-input" }, null, -1)),
698
- t.$slots.default || e.label ? (a(), l("span", we, [
699
- g(t.$slots, "default", {}, () => [
700
- c("label", { for: e.id }, m(e.label), 9, Ve)
701
- ])
702
- ])) : h("", !0)
724
+ c(t.$slots, "input", {}, () => [
725
+ i[1] || (i[1] = d("span", { class: "rvc-radio-input" }, null, -1))
726
+ ]),
727
+ c(t.$slots, "default", {}, () => [
728
+ d("span", Be, f(e.label), 1)
729
+ ])
703
730
  ]));
704
731
  }
705
- }), Be = { class: "rvc-tabs-nav" }, xe = ["value", "selected"], De = /* @__PURE__ */ Object.assign({
732
+ }), Ce = { class: "rvc-tabs-nav" }, xe = ["value", "selected"], He = /* @__PURE__ */ Object.assign({
706
733
  inheritAttrs: !1
707
734
  }, {
708
735
  __name: "Tabs",
@@ -724,60 +751,60 @@ const H = /* @__PURE__ */ Object.assign({
724
751
  },
725
752
  emits: ["update:modelValue", "tabs:change"],
726
753
  setup(e, { emit: u }) {
727
- const r = e, d = u, i = () => {
754
+ const r = e, v = u, o = () => {
728
755
  const n = r.tabs.findIndex((t) => t.active);
729
756
  return n >= 0 ? n : 0;
730
- }, v = B({
731
- get: () => r.modelValue ?? i(),
757
+ }, g = B({
758
+ get: () => r.modelValue ?? o(),
732
759
  set: (n) => {
733
760
  const t = r.tabs[n];
734
- d("update:modelValue", n), d("tabs:change", t);
761
+ v("update:modelValue", n), v("tabs:change", t);
735
762
  }
736
- }), f = (n) => {
763
+ }), m = (n) => {
737
764
  const t = +n.target.value;
738
- v.value = t;
739
- const o = r.tabs[t];
740
- o != null && o.selectEvent && o.selectEvent();
765
+ g.value = t;
766
+ const i = r.tabs[t];
767
+ i != null && i.selectEvent && i.selectEvent();
741
768
  }, s = (n) => {
742
769
  const {
743
770
  active: t,
744
- as: o,
745
- bindAs: p,
746
- selectEvent: k,
747
- name: T,
748
- ...L
771
+ as: i,
772
+ bindAs: b,
773
+ selectEvent: S,
774
+ name: L,
775
+ ...P
749
776
  } = n;
750
- return L;
777
+ return P;
751
778
  };
752
- return (n, t) => (a(), l(S, null, [
753
- c("div", b(n.$attrs, {
779
+ return (n, t) => (a(), l(k, null, [
780
+ d("div", p(n.$attrs, {
754
781
  class: ["rvc-tabs", { "rvc-tabs-buttons": e.tabStyle === "buttons" }]
755
782
  }), [
756
- c("nav", Be, [
757
- (a(!0), l(S, null, V(e.tabs, (o, p) => (a(), w(C(o.as ? o.as : "button"), b({ ref_for: !0 }, s(o), {
758
- key: `${p}-tab-item`,
759
- as: o.bindAs ? o.bindAs : void 0,
760
- class: ["rvc-tab", { "rvc-tab-active": v.value === p }],
761
- onClick: (k) => v.value = p
783
+ d("nav", Ce, [
784
+ (a(!0), l(k, null, V(e.tabs, (i, b) => (a(), w(x(i.as ? i.as : "button"), p({ ref_for: !0 }, s(i), {
785
+ key: `${b}-tab-item`,
786
+ as: i.bindAs ? i.bindAs : void 0,
787
+ class: ["rvc-tab", { "rvc-tab-active": g.value === b }],
788
+ onClick: (S) => g.value = b
762
789
  }), {
763
790
  default: O(() => [
764
- P(m(o.name), 1)
791
+ T(f(i.name), 1)
765
792
  ]),
766
793
  _: 2
767
794
  }, 1040, ["as", "class", "onClick"]))), 128))
768
795
  ])
769
796
  ], 16),
770
- x(H, b(n.$attrs, {
797
+ C(H, p(n.$attrs, {
771
798
  "root-class": "rvc-tabs-select",
772
- value: v.value,
773
- onChange: f
799
+ value: g.value,
800
+ onChange: m
774
801
  }), {
775
802
  default: O(() => [
776
- (a(!0), l(S, null, V(e.tabs, (o, p) => (a(), l("option", {
777
- key: `${p}-tab-item-select-option`,
778
- value: p,
779
- selected: v.value === p
780
- }, m(o.name), 9, xe))), 128))
803
+ (a(!0), l(k, null, V(e.tabs, (i, b) => (a(), l("option", {
804
+ key: `${b}-tab-item-select-option`,
805
+ value: b,
806
+ selected: g.value === b
807
+ }, f(i.name), 9, xe))), 128))
781
808
  ]),
782
809
  _: 1
783
810
  }, 16, ["value"])
@@ -785,17 +812,17 @@ const H = /* @__PURE__ */ Object.assign({
785
812
  }
786
813
  });
787
814
  export {
788
- Oe as Accordion,
789
- Me as Alert,
790
- Ee as Badge,
791
- Ue as ButtonBase,
792
- je as Checkbox,
793
- Ie as DataTable,
794
- Fe as EmptyState,
795
- Ke as FormInput,
815
+ Me as Accordion,
816
+ je as Alert,
817
+ Re as Badge,
818
+ Ze as ButtonBase,
819
+ Ie as Checkbox,
820
+ Fe as DataTable,
821
+ Ne as EmptyState,
822
+ Ge as FormInput,
796
823
  H as FormSelect,
797
- Ne as FormTextarea,
798
- de as Pagination,
799
- qe as Radio,
800
- De as Tabs
824
+ qe as FormTextarea,
825
+ ge as Pagination,
826
+ De as Radio,
827
+ He as Tabs
801
828
  };