@velkymx/vibeui 0.5.4 → 0.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.
Files changed (31) hide show
  1. package/README.md +34 -744
  2. package/dist/components/VibeAccordion.vue.d.ts +36 -5
  3. package/dist/components/VibeAlert.vue.d.ts +19 -2
  4. package/dist/components/VibeCarousel.vue.d.ts +47 -6
  5. package/dist/components/VibeCollapse.vue.d.ts +9 -4
  6. package/dist/components/VibeDropdown.vue.d.ts +32 -5
  7. package/dist/components/VibeFormCheckbox.vue.d.ts +30 -22
  8. package/dist/components/VibeFormDatepicker.vue.d.ts +3 -2
  9. package/dist/components/VibeFormInput.vue.d.ts +4 -3
  10. package/dist/components/VibeFormRadio.vue.d.ts +33 -25
  11. package/dist/components/VibeFormSelect.vue.d.ts +46 -38
  12. package/dist/components/VibeFormSpinbutton.vue.d.ts +9 -8
  13. package/dist/components/VibeFormSwitch.vue.d.ts +16 -8
  14. package/dist/components/VibeFormTextarea.vue.d.ts +36 -28
  15. package/dist/components/VibeFormWysiwyg.vue.d.ts +3 -2
  16. package/dist/components/VibeModal.vue.d.ts +36 -5
  17. package/dist/components/VibeNav.vue.d.ts +39 -40
  18. package/dist/components/VibeOffcanvas.vue.d.ts +37 -6
  19. package/dist/components/VibePopover.vue.d.ts +31 -5
  20. package/dist/components/VibeScrollspy.vue.d.ts +9 -3
  21. package/dist/components/VibeTabContent.vue.d.ts +13 -3
  22. package/dist/components/VibeToast.vue.d.ts +41 -6
  23. package/dist/components/VibeTooltip.vue.d.ts +31 -5
  24. package/dist/composables/useColorMode.d.ts +14 -0
  25. package/dist/composables/useId.d.ts +5 -0
  26. package/dist/index.d.ts +2 -0
  27. package/dist/types.d.ts +1 -0
  28. package/dist/vibeui.css +1 -1
  29. package/dist/vibeui.es.js +2098 -1596
  30. package/dist/vibeui.umd.js +1 -1
  31. package/package.json +4 -4
package/dist/vibeui.es.js CHANGED
@@ -1,45 +1,60 @@
1
- import { defineComponent as x, computed as y, openBlock as i, createElementBlock as s, normalizeClass as g, renderSlot as C, createTextVNode as w, toDisplayString as m, createCommentVNode as b, createBlock as q, resolveDynamicComponent as P, withCtx as F, createElementVNode as h, normalizeStyle as D, Fragment as M, renderList as A, reactive as oe, provide as de, unref as re, inject as Z, ref as T, watch as E, onMounted as G, onBeforeUnmount as H, useModel as Y, withDirectives as W, vModelText as ue, vModelSelect as ce, withModifiers as X, mergeModels as J } from "vue";
2
- const fe = /* @__PURE__ */ x({
1
+ import { defineComponent as M, ref as E, onMounted as Y, onBeforeUnmount as X, watch as O, openBlock as n, createElementBlock as i, normalizeClass as $, renderSlot as N, createTextVNode as I, toDisplayString as k, createCommentVNode as y, computed as m, createBlock as z, resolveDynamicComponent as A, withCtx as j, createElementVNode as S, normalizeStyle as K, Fragment as F, renderList as H, nextTick as ne, reactive as pe, provide as ve, unref as ye, inject as J, getCurrentInstance as ge, Teleport as ie, useModel as _, withDirectives as de, vModelText as ke, vModelSelect as Se, withModifiers as Z, mergeModels as ue } from "vue";
2
+ const $e = /* @__PURE__ */ M({
3
3
  __name: "VibeAlert",
4
4
  props: {
5
5
  variant: { type: String, default: "primary" },
6
6
  modelValue: { type: Boolean, default: !0 },
7
7
  dismissable: { type: Boolean, default: !1 },
8
- message: { type: String, required: !0 }
8
+ message: { type: String, required: !0 },
9
+ fade: { type: Boolean, default: !0 }
9
10
  },
10
- emits: ["update:modelValue", "component-error"],
11
- setup(e, { emit: f }) {
12
- const t = e, a = f, l = y({
13
- get: () => t.modelValue,
14
- set: (d) => a("update:modelValue", d)
15
- }), r = () => {
16
- try {
17
- l.value = !1;
18
- } catch (d) {
19
- a("component-error", {
20
- message: "Dismiss failed",
21
- componentName: "VibeAlert",
22
- originalError: d
23
- });
24
- }
11
+ emits: ["update:modelValue", "close", "closed", "component-error"],
12
+ setup(e, { emit: v }) {
13
+ const t = e, a = v, l = E(null), s = E(null), o = E(t.modelValue), r = () => {
14
+ a("close");
15
+ }, u = () => {
16
+ o.value = !1, a("update:modelValue", !1), a("closed");
25
17
  };
26
- return (d, u) => l.value ? (i(), s("div", {
18
+ Y(async () => {
19
+ if (l.value)
20
+ try {
21
+ const g = (await import("bootstrap")).Alert;
22
+ s.value = new g(l.value), l.value.addEventListener("close.bs.alert", r), l.value.addEventListener("closed.bs.alert", u);
23
+ } catch (b) {
24
+ a("component-error", {
25
+ message: "Bootstrap JS not loaded. Alert will use basic Vue logic.",
26
+ componentName: "VibeAlert",
27
+ originalError: b
28
+ });
29
+ }
30
+ }), X(() => {
31
+ l.value && (l.value.removeEventListener("close.bs.alert", r), l.value.removeEventListener("closed.bs.alert", u)), s.value && (s.value.dispose(), s.value = null);
32
+ }), O(() => t.modelValue, (b) => {
33
+ b ? o.value = !0 : s.value && o.value ? s.value.close() : o.value = !1;
34
+ });
35
+ const c = () => {
36
+ s.value ? s.value.close() : (o.value = !1, a("update:modelValue", !1), a("closed"));
37
+ };
38
+ return (b, g) => o.value ? (n(), i("div", {
27
39
  key: 0,
28
- class: g(`alert alert-${e.variant}`),
40
+ ref_key: "alertRef",
41
+ ref: l,
42
+ class: $(["alert", `alert-${e.variant}`, { "alert-dismissible": e.dismissable, "fade show": e.fade }]),
29
43
  role: "alert"
30
44
  }, [
31
- C(d.$slots, "default", {}, () => [
32
- w(m(e.message), 1)
45
+ N(b.$slots, "default", {}, () => [
46
+ I(k(e.message), 1)
33
47
  ]),
34
- e.dismissable ? (i(), s("button", {
48
+ e.dismissable ? (n(), i("button", {
35
49
  key: 0,
50
+ type: "button",
36
51
  class: "btn-close",
37
- onClick: r,
38
- "aria-label": "Close"
39
- })) : b("", !0)
40
- ], 2)) : b("", !0);
52
+ "aria-label": "Close",
53
+ onClick: c
54
+ })) : y("", !0)
55
+ ], 2)) : y("", !0);
41
56
  }
42
- }), ve = /* @__PURE__ */ x({
57
+ }), we = /* @__PURE__ */ M({
43
58
  __name: "VibeBadge",
44
59
  props: {
45
60
  variant: { type: String, default: "primary" },
@@ -47,21 +62,21 @@ const fe = /* @__PURE__ */ x({
47
62
  tag: { type: String, default: "span" }
48
63
  },
49
64
  emits: ["component-error"],
50
- setup(e, { emit: f }) {
51
- const t = e, a = y(() => {
65
+ setup(e, { emit: v }) {
66
+ const t = e, a = m(() => {
52
67
  const l = ["badge", `bg-${t.variant}`];
53
68
  return t.pill && l.push("rounded-pill"), l.join(" ");
54
69
  });
55
- return (l, r) => (i(), q(P(e.tag), {
56
- class: g(a.value)
70
+ return (l, s) => (n(), z(A(e.tag), {
71
+ class: $(a.value)
57
72
  }, {
58
- default: F(() => [
59
- C(l.$slots, "default")
73
+ default: j(() => [
74
+ N(l.$slots, "default")
60
75
  ]),
61
76
  _: 3
62
77
  }, 8, ["class"]));
63
78
  }
64
- }), be = /* @__PURE__ */ x({
79
+ }), Ve = /* @__PURE__ */ M({
65
80
  __name: "VibeButton",
66
81
  props: {
67
82
  variant: { type: String, default: "primary" },
@@ -74,29 +89,29 @@ const fe = /* @__PURE__ */ x({
74
89
  active: { type: Boolean, default: !1 }
75
90
  },
76
91
  emits: ["click", "component-error"],
77
- setup(e, { emit: f }) {
78
- const t = e, a = f, l = y(() => t.href ? "a" : t.to ? "router-link" : "button"), r = y(() => {
79
- const u = ["btn"];
80
- return t.outline ? u.push(`btn-outline-${t.variant}`) : u.push(`btn-${t.variant}`), t.size && u.push(`btn-${t.size}`), t.active && u.push("active"), u.join(" ");
81
- }), d = (u) => {
82
- t.disabled || a("click", u);
92
+ setup(e, { emit: v }) {
93
+ const t = e, a = v, l = m(() => t.href ? "a" : t.to ? "router-link" : "button"), s = m(() => {
94
+ const r = ["btn"];
95
+ return t.outline ? r.push(`btn-outline-${t.variant}`) : r.push(`btn-${t.variant}`), t.size && r.push(`btn-${t.size}`), t.active && r.push("active"), r.join(" ");
96
+ }), o = (r) => {
97
+ t.disabled || a("click", r);
83
98
  };
84
- return (u, o) => (i(), q(P(l.value), {
85
- class: g(r.value),
99
+ return (r, u) => (n(), z(A(l.value), {
100
+ class: $(s.value),
86
101
  type: e.href || e.to ? void 0 : e.type,
87
102
  href: e.href,
88
103
  to: e.to,
89
104
  disabled: e.disabled,
90
105
  "aria-disabled": e.disabled,
91
- onClick: d
106
+ onClick: o
92
107
  }, {
93
- default: F(() => [
94
- C(u.$slots, "default")
108
+ default: j(() => [
109
+ N(r.$slots, "default")
95
110
  ]),
96
111
  _: 3
97
112
  }, 8, ["class", "type", "href", "to", "disabled", "aria-disabled"]));
98
113
  }
99
- }), me = ["role", "aria-label"], he = /* @__PURE__ */ x({
114
+ }), Ce = ["role", "aria-label"], xe = /* @__PURE__ */ M({
100
115
  __name: "VibeButtonGroup",
101
116
  props: {
102
117
  size: { type: String, default: void 0 },
@@ -105,20 +120,20 @@ const fe = /* @__PURE__ */ x({
105
120
  ariaLabel: { type: String, default: void 0 }
106
121
  },
107
122
  emits: ["component-error"],
108
- setup(e, { emit: f }) {
109
- const t = e, a = y(() => {
123
+ setup(e, { emit: v }) {
124
+ const t = e, a = m(() => {
110
125
  const l = [t.vertical ? "btn-group-vertical" : "btn-group"];
111
126
  return t.size && l.push(`btn-group-${t.size}`), l.join(" ");
112
127
  });
113
- return (l, r) => (i(), s("div", {
114
- class: g(a.value),
128
+ return (l, s) => (n(), i("div", {
129
+ class: $(a.value),
115
130
  role: e.role,
116
131
  "aria-label": e.ariaLabel
117
132
  }, [
118
- C(l.$slots, "default")
119
- ], 10, me));
133
+ N(l.$slots, "default")
134
+ ], 10, Ce));
120
135
  }
121
- }), ye = ["disabled", "aria-label"], ge = /* @__PURE__ */ x({
136
+ }), Be = ["disabled", "aria-label"], Le = /* @__PURE__ */ M({
122
137
  __name: "VibeCloseButton",
123
138
  props: {
124
139
  disabled: { type: Boolean, default: !1 },
@@ -126,19 +141,19 @@ const fe = /* @__PURE__ */ x({
126
141
  ariaLabel: { type: String, default: "Close" }
127
142
  },
128
143
  emits: ["click", "component-error"],
129
- setup(e, { emit: f }) {
130
- const t = e, a = f, l = (r) => {
131
- t.disabled || a("click", r);
144
+ setup(e, { emit: v }) {
145
+ const t = e, a = v, l = (s) => {
146
+ t.disabled || a("click", s);
132
147
  };
133
- return (r, d) => (i(), s("button", {
148
+ return (s, o) => (n(), i("button", {
134
149
  type: "button",
135
- class: g(["btn-close", { "btn-close-white": e.white }]),
150
+ class: $(["btn-close", { "btn-close-white": e.white }]),
136
151
  disabled: e.disabled,
137
152
  "aria-label": e.ariaLabel,
138
153
  onClick: l
139
- }, null, 10, ye));
154
+ }, null, 10, Be));
140
155
  }
141
- }), pe = { class: "visually-hidden" }, ke = /* @__PURE__ */ x({
156
+ }), Te = { class: "visually-hidden" }, Ne = /* @__PURE__ */ M({
142
157
  __name: "VibeSpinner",
143
158
  props: {
144
159
  variant: { type: String, default: void 0 },
@@ -148,22 +163,22 @@ const fe = /* @__PURE__ */ x({
148
163
  tag: { type: String, default: "div" }
149
164
  },
150
165
  emits: ["component-error"],
151
- setup(e, { emit: f }) {
152
- const t = e, a = y(() => {
166
+ setup(e, { emit: v }) {
167
+ const t = e, a = m(() => {
153
168
  const l = [`spinner-${t.type}`];
154
169
  return t.variant && l.push(`text-${t.variant}`), t.size && l.push(`spinner-${t.type}-${t.size}`), l.join(" ");
155
170
  });
156
- return (l, r) => (i(), q(P(e.tag), {
157
- class: g(a.value),
171
+ return (l, s) => (n(), z(A(e.tag), {
172
+ class: $(a.value),
158
173
  role: "status"
159
174
  }, {
160
- default: F(() => [
161
- h("span", pe, m(e.label), 1)
175
+ default: j(() => [
176
+ S("span", Te, k(e.label), 1)
162
177
  ]),
163
178
  _: 1
164
179
  }, 8, ["class"]));
165
180
  }
166
- }), $e = /* @__PURE__ */ x({
181
+ }), Ee = /* @__PURE__ */ M({
167
182
  __name: "VibePlaceholder",
168
183
  props: {
169
184
  variant: { type: String, default: void 0 },
@@ -173,49 +188,49 @@ const fe = /* @__PURE__ */ x({
173
188
  tag: { type: String, default: "span" }
174
189
  },
175
190
  emits: ["component-error"],
176
- setup(e, { emit: f }) {
177
- const t = e, a = y(() => {
178
- const d = ["placeholder"];
179
- return t.variant && d.push(`bg-${t.variant}`), t.size && d.push(`placeholder-${t.size}`), d.join(" ");
180
- }), l = y(() => {
191
+ setup(e, { emit: v }) {
192
+ const t = e, a = m(() => {
193
+ const o = ["placeholder"];
194
+ return t.variant && o.push(`bg-${t.variant}`), t.size && o.push(`placeholder-${t.size}`), o.join(" ");
195
+ }), l = m(() => {
181
196
  if (t.animation) return `placeholder-${t.animation}`;
182
- }), r = y(() => {
197
+ }), s = m(() => {
183
198
  if (t.width)
184
199
  return { width: typeof t.width == "number" ? `${t.width}%` : t.width };
185
200
  });
186
- return (d, u) => (i(), q(P(e.tag), {
187
- class: g(l.value)
201
+ return (o, r) => (n(), z(A(e.tag), {
202
+ class: $(l.value)
188
203
  }, {
189
- default: F(() => [
190
- h("span", {
191
- class: g(a.value),
192
- style: D(r.value)
204
+ default: j(() => [
205
+ S("span", {
206
+ class: $(a.value),
207
+ style: K(s.value)
193
208
  }, [
194
- C(d.$slots, "default")
209
+ N(o.$slots, "default")
195
210
  ], 6)
196
211
  ]),
197
212
  _: 3
198
213
  }, 8, ["class"]));
199
214
  }
200
- }), Se = /* @__PURE__ */ x({
215
+ }), Me = /* @__PURE__ */ M({
201
216
  __name: "VibeContainer",
202
217
  props: {
203
218
  fluid: { type: [Boolean, String], default: !1 },
204
219
  tag: { type: String, default: "div" }
205
220
  },
206
221
  emits: ["component-error"],
207
- setup(e, { emit: f }) {
208
- const t = e, a = y(() => t.fluid === !1 ? "container" : t.fluid === !0 ? "container-fluid" : `container-${t.fluid}`);
209
- return (l, r) => (i(), q(P(e.tag), {
210
- class: g(a.value)
222
+ setup(e, { emit: v }) {
223
+ const t = e, a = m(() => t.fluid === !1 ? "container" : t.fluid === !0 ? "container-fluid" : `container-${t.fluid}`);
224
+ return (l, s) => (n(), z(A(e.tag), {
225
+ class: $(a.value)
211
226
  }, {
212
- default: F(() => [
213
- C(l.$slots, "default")
227
+ default: j(() => [
228
+ N(l.$slots, "default")
214
229
  ]),
215
230
  _: 3
216
231
  }, 8, ["class"]));
217
232
  }
218
- }), Ve = /* @__PURE__ */ x({
233
+ }), Ie = /* @__PURE__ */ M({
219
234
  __name: "VibeRow",
220
235
  props: {
221
236
  tag: { type: String, default: "div" },
@@ -251,33 +266,33 @@ const fe = /* @__PURE__ */ x({
251
266
  justifyContent: { type: String, default: void 0 }
252
267
  },
253
268
  emits: ["component-error"],
254
- setup(e, { emit: f }) {
255
- const t = e, a = y(() => {
269
+ setup(e, { emit: v }) {
270
+ const t = e, a = m(() => {
256
271
  const l = ["row"];
257
272
  t.gutters !== void 0 && l.push(`g-${t.gutters}`), t.guttersX !== void 0 && l.push(`gx-${t.guttersX}`), t.guttersY !== void 0 && l.push(`gy-${t.guttersY}`);
258
- const r = ["sm", "md", "lg", "xl", "xxl"];
259
- return r.forEach((d) => {
260
- const u = d.charAt(0).toUpperCase() + d.slice(1), o = `gutters${u}`;
261
- t[o] !== void 0 && l.push(`g-${d}-${t[o]}`);
262
- const n = `guttersX${u}`;
263
- t[n] !== void 0 && l.push(`gx-${d}-${t[n]}`);
264
- const c = `guttersY${u}`;
265
- t[c] !== void 0 && l.push(`gy-${d}-${t[c]}`);
266
- }), t.rowCols !== void 0 && l.push(`row-cols-${t.rowCols}`), r.forEach((d) => {
267
- const u = `rowCols${d.charAt(0).toUpperCase() + d.slice(1)}`;
268
- t[u] !== void 0 && l.push(`row-cols-${d}-${t[u]}`);
273
+ const s = ["sm", "md", "lg", "xl", "xxl"];
274
+ return s.forEach((o) => {
275
+ const r = o.charAt(0).toUpperCase() + o.slice(1), u = `gutters${r}`;
276
+ t[u] !== void 0 && l.push(`g-${o}-${t[u]}`);
277
+ const c = `guttersX${r}`;
278
+ t[c] !== void 0 && l.push(`gx-${o}-${t[c]}`);
279
+ const b = `guttersY${r}`;
280
+ t[b] !== void 0 && l.push(`gy-${o}-${t[b]}`);
281
+ }), t.rowCols !== void 0 && l.push(`row-cols-${t.rowCols}`), s.forEach((o) => {
282
+ const r = `rowCols${o.charAt(0).toUpperCase() + o.slice(1)}`;
283
+ t[r] !== void 0 && l.push(`row-cols-${o}-${t[r]}`);
269
284
  }), t.alignItems && l.push(`align-items-${t.alignItems}`), t.justifyContent && l.push(`justify-content-${t.justifyContent}`), l.join(" ");
270
285
  });
271
- return (l, r) => (i(), q(P(e.tag), {
272
- class: g(a.value)
286
+ return (l, s) => (n(), z(A(e.tag), {
287
+ class: $(a.value)
273
288
  }, {
274
- default: F(() => [
275
- C(l.$slots, "default")
289
+ default: j(() => [
290
+ N(l.$slots, "default")
276
291
  ]),
277
292
  _: 3
278
293
  }, 8, ["class"]));
279
294
  }
280
- }), Ce = /* @__PURE__ */ x({
295
+ }), Fe = /* @__PURE__ */ M({
281
296
  __name: "VibeCol",
282
297
  props: {
283
298
  tag: { type: String, default: "div" },
@@ -306,8 +321,8 @@ const fe = /* @__PURE__ */ x({
306
321
  alignSelf: { type: String, default: void 0 }
307
322
  },
308
323
  emits: ["component-error"],
309
- setup(e, { emit: f }) {
310
- const t = e, a = y(() => {
324
+ setup(e, { emit: v }) {
325
+ const t = e, a = m(() => {
311
326
  const l = [];
312
327
  return t.cols !== void 0 || t.sm !== void 0 || t.md !== void 0 || t.lg !== void 0 || t.xl !== void 0 || t.xxl !== void 0 ? (t.cols === !0 ? l.push("col") : t.cols === "auto" ? l.push("col-auto") : t.cols && l.push(`col-${t.cols}`), [
313
328
  { name: "sm", value: t.sm },
@@ -315,35 +330,35 @@ const fe = /* @__PURE__ */ x({
315
330
  { name: "lg", value: t.lg },
316
331
  { name: "xl", value: t.xl },
317
332
  { name: "xxl", value: t.xxl }
318
- ].forEach(({ name: u, value: o }) => {
319
- o === !0 ? l.push(`col-${u}`) : o === "auto" ? l.push(`col-${u}-auto`) : o !== void 0 && l.push(`col-${u}-${o}`);
333
+ ].forEach(({ name: r, value: u }) => {
334
+ u === !0 ? l.push(`col-${r}`) : u === "auto" ? l.push(`col-${r}-auto`) : u !== void 0 && l.push(`col-${r}-${u}`);
320
335
  })) : l.push("col"), t.offset !== void 0 && l.push(`offset-${t.offset}`), t.offsetSm !== void 0 && l.push(`offset-sm-${t.offsetSm}`), t.offsetMd !== void 0 && l.push(`offset-md-${t.offsetMd}`), t.offsetLg !== void 0 && l.push(`offset-lg-${t.offsetLg}`), t.offsetXl !== void 0 && l.push(`offset-xl-${t.offsetXl}`), t.offsetXxl !== void 0 && l.push(`offset-xxl-${t.offsetXxl}`), t.order !== void 0 && l.push(`order-${t.order}`), t.orderSm !== void 0 && l.push(`order-sm-${t.orderSm}`), t.orderMd !== void 0 && l.push(`order-md-${t.orderMd}`), t.orderLg !== void 0 && l.push(`order-lg-${t.orderLg}`), t.orderXl !== void 0 && l.push(`order-xl-${t.orderXl}`), t.orderXxl !== void 0 && l.push(`order-xxl-${t.orderXxl}`), t.alignSelf && l.push(`align-self-${t.alignSelf}`), l.join(" ");
321
336
  });
322
- return (l, r) => (i(), q(P(e.tag), {
323
- class: g(a.value)
337
+ return (l, s) => (n(), z(A(e.tag), {
338
+ class: $(a.value)
324
339
  }, {
325
- default: F(() => [
326
- C(l.$slots, "default")
340
+ default: j(() => [
341
+ N(l.$slots, "default")
327
342
  ]),
328
343
  _: 3
329
344
  }, 8, ["class"]));
330
345
  }
331
- }), xe = ["src", "alt"], we = {
346
+ }), Pe = ["src", "alt"], Re = {
332
347
  key: 1,
333
348
  class: "card-header"
334
- }, Be = {
349
+ }, qe = {
335
350
  key: 2,
336
351
  class: "card-body"
337
- }, Ne = {
352
+ }, ze = {
338
353
  key: 0,
339
354
  class: "card-title"
340
- }, Te = {
355
+ }, Ae = {
341
356
  key: 1,
342
357
  class: "card-text"
343
- }, Me = {
358
+ }, je = {
344
359
  key: 3,
345
360
  class: "card-footer"
346
- }, qe = ["src", "alt"], Pe = /* @__PURE__ */ x({
361
+ }, Oe = ["src", "alt"], He = /* @__PURE__ */ M({
347
362
  __name: "VibeCard",
348
363
  props: {
349
364
  variant: { type: String, default: void 0 },
@@ -362,145 +377,198 @@ const fe = /* @__PURE__ */ x({
362
377
  imgBottom: { type: Boolean, default: !1 }
363
378
  },
364
379
  emits: ["component-error"],
365
- setup(e, { emit: f }) {
366
- const t = e, a = y(() => {
380
+ setup(e, { emit: v }) {
381
+ const t = e, a = m(() => {
367
382
  const l = ["card"];
368
383
  return t.variant && l.push(`text-bg-${t.variant}`), t.border && l.push(`border-${t.border}`), t.textVariant && l.push(`text-${t.textVariant}`), l.join(" ");
369
384
  });
370
- return (l, r) => (i(), q(P(e.tag), {
371
- class: g(a.value)
385
+ return (l, s) => (n(), z(A(e.tag), {
386
+ class: $(a.value)
372
387
  }, {
373
- default: F(() => [
374
- e.imgSrc && e.imgTop ? (i(), s("img", {
388
+ default: j(() => [
389
+ e.imgSrc && e.imgTop ? (n(), i("img", {
375
390
  key: 0,
376
391
  src: e.imgSrc,
377
392
  alt: e.imgAlt,
378
393
  class: "card-img-top"
379
- }, null, 8, xe)) : b("", !0),
380
- e.header || l.$slots.header ? (i(), s("div", we, [
381
- C(l.$slots, "header", {}, () => [
382
- w(m(e.header), 1)
394
+ }, null, 8, Pe)) : y("", !0),
395
+ e.header || l.$slots.header ? (n(), i("div", Re, [
396
+ N(l.$slots, "header", {}, () => [
397
+ I(k(e.header), 1)
383
398
  ])
384
- ])) : b("", !0),
385
- e.title || e.body || l.$slots.default || l.$slots.body ? (i(), s("div", Be, [
386
- e.title || l.$slots.title ? (i(), s("h5", Ne, [
387
- C(l.$slots, "title", {}, () => [
388
- w(m(e.title), 1)
399
+ ])) : y("", !0),
400
+ e.title || e.body || l.$slots.default || l.$slots.body ? (n(), i("div", qe, [
401
+ e.title || l.$slots.title ? (n(), i("h5", ze, [
402
+ N(l.$slots, "title", {}, () => [
403
+ I(k(e.title), 1)
389
404
  ])
390
- ])) : b("", !0),
391
- e.body || l.$slots.body ? (i(), s("p", Te, [
392
- C(l.$slots, "body", {}, () => [
393
- w(m(e.body), 1)
405
+ ])) : y("", !0),
406
+ e.body || l.$slots.body ? (n(), i("p", Ae, [
407
+ N(l.$slots, "body", {}, () => [
408
+ I(k(e.body), 1)
394
409
  ])
395
- ])) : b("", !0),
396
- C(l.$slots, "default")
397
- ])) : b("", !0),
398
- e.footer || l.$slots.footer ? (i(), s("div", Me, [
399
- C(l.$slots, "footer", {}, () => [
400
- w(m(e.footer), 1)
410
+ ])) : y("", !0),
411
+ N(l.$slots, "default")
412
+ ])) : y("", !0),
413
+ e.footer || l.$slots.footer ? (n(), i("div", je, [
414
+ N(l.$slots, "footer", {}, () => [
415
+ I(k(e.footer), 1)
401
416
  ])
402
- ])) : b("", !0),
403
- e.imgSrc && e.imgBottom ? (i(), s("img", {
417
+ ])) : y("", !0),
418
+ e.imgSrc && e.imgBottom ? (n(), i("img", {
404
419
  key: 4,
405
420
  src: e.imgSrc,
406
421
  alt: e.imgAlt,
407
422
  class: "card-img-bottom"
408
- }, null, 8, qe)) : b("", !0)
423
+ }, null, 8, Oe)) : y("", !0)
409
424
  ]),
410
425
  _: 3
411
426
  }, 8, ["class"]));
412
427
  }
413
- }), Fe = ["aria-label"], Le = { class: "breadcrumb" }, ze = ["aria-current"], je = /* @__PURE__ */ x({
428
+ }), De = ["aria-label"], Ge = { class: "breadcrumb" }, Xe = ["aria-current"], Ye = /* @__PURE__ */ M({
414
429
  __name: "VibeBreadcrumb",
415
430
  props: {
416
431
  ariaLabel: { type: String, default: "breadcrumb" },
417
432
  items: { type: Array, required: !0 }
418
433
  },
419
434
  emits: ["item-click", "component-error"],
420
- setup(e, { emit: f }) {
421
- const t = f, a = (l, r, d) => {
422
- l.active || t("item-click", { item: l, index: r, event: d });
435
+ setup(e, { emit: v }) {
436
+ const t = v, a = (l, s, o) => {
437
+ l.active || t("item-click", { item: l, index: s, event: o });
423
438
  };
424
- return (l, r) => (i(), s("nav", { "aria-label": e.ariaLabel }, [
425
- h("ol", Le, [
426
- (i(!0), s(M, null, A(e.items, (d, u) => (i(), s("li", {
427
- key: u,
428
- class: g(["breadcrumb-item", { active: d.active }]),
429
- "aria-current": d.active ? "page" : void 0
439
+ return (l, s) => (n(), i("nav", { "aria-label": e.ariaLabel }, [
440
+ S("ol", Ge, [
441
+ (n(!0), i(F, null, H(e.items, (o, r) => (n(), i("li", {
442
+ key: r,
443
+ class: $(["breadcrumb-item", { active: o.active }]),
444
+ "aria-current": o.active ? "page" : void 0
430
445
  }, [
431
- (i(), q(P(d.href ? "a" : d.to ? "router-link" : "span"), {
432
- href: d.href,
433
- to: d.to,
434
- onClick: (o) => a(d, u, o)
446
+ (n(), z(A(o.href ? "a" : o.to ? "router-link" : "span"), {
447
+ href: o.href,
448
+ to: o.to,
449
+ onClick: (u) => a(o, r, u)
435
450
  }, {
436
- default: F(() => [
437
- C(l.$slots, "item", {
438
- item: d,
439
- index: u
451
+ default: j(() => [
452
+ N(l.$slots, "item", {
453
+ item: o,
454
+ index: r
440
455
  }, () => [
441
- w(m(d.text), 1)
456
+ I(k(o.text), 1)
442
457
  ])
443
458
  ]),
444
459
  _: 2
445
460
  }, 1032, ["href", "to", "onClick"]))
446
- ], 10, ze))), 128))
461
+ ], 10, Xe))), 128))
447
462
  ])
448
- ], 8, Fe));
463
+ ], 8, De));
449
464
  }
450
- }), Ae = /* @__PURE__ */ x({
465
+ }), Ue = { class: "dropdown-menu" }, Je = {
466
+ key: 0,
467
+ class: "dropdown-divider"
468
+ }, Ke = {
469
+ key: 1,
470
+ class: "dropdown-header"
471
+ }, Qe = /* @__PURE__ */ M({
451
472
  __name: "VibeNav",
452
473
  props: {
453
- tabs: { type: Boolean, default: !1 },
474
+ items: { type: Array, required: !0 },
454
475
  pills: { type: Boolean, default: !1 },
455
- fill: { type: Boolean, default: !1 },
456
- justified: { type: Boolean, default: !1 },
476
+ tabs: { type: Boolean, default: !1 },
457
477
  vertical: { type: Boolean, default: !1 },
458
- tag: { type: String, default: "ul" },
459
- items: { type: Array, required: !0 }
478
+ justified: { type: Boolean, default: !1 },
479
+ fill: { type: Boolean, default: !1 },
480
+ tag: { type: String, default: "ul" }
460
481
  },
461
- emits: ["item-click", "component-error"],
462
- setup(e, { emit: f }) {
463
- const t = e, a = f, l = y(() => {
464
- const o = ["nav"];
465
- return t.tabs && o.push("nav-tabs"), t.pills && o.push("nav-pills"), t.fill && o.push("nav-fill"), t.justified && o.push("nav-justified"), t.vertical && o.push("flex-column"), o.join(" ");
466
- }), r = (o) => {
467
- const n = ["nav-link"];
468
- return o.active && n.push("active"), o.disabled && n.push("disabled"), n.join(" ");
469
- }, d = (o) => o.href ? "a" : o.to ? "router-link" : "a", u = (o, n, c) => {
470
- o.disabled || a("item-click", { item: o, index: n, event: c });
482
+ emits: ["item-click", "show", "shown", "hide", "hidden", "component-error"],
483
+ setup(e, { expose: v, emit: t }) {
484
+ const a = e, l = t, s = E(null), o = /* @__PURE__ */ new Map(), r = m(() => {
485
+ const d = ["nav"];
486
+ return a.pills && d.push("nav-pills"), a.tabs && d.push("nav-tabs"), a.vertical && d.push("flex-column"), a.justified && d.push("nav-justified"), a.fill && d.push("nav-fill"), d.join(" ");
487
+ }), u = (d) => l("show", d), c = (d) => l("shown", d), b = (d) => l("hide", d), g = (d) => l("hidden", d), C = async () => {
488
+ if (s.value)
489
+ try {
490
+ const f = (await import("bootstrap")).Tab;
491
+ s.value.querySelectorAll('[data-bs-toggle="tab"], [data-bs-toggle="pill"]').forEach((w) => {
492
+ const x = w;
493
+ if (!o.has(x)) {
494
+ const V = new f(x);
495
+ o.set(x, V), x.addEventListener("show.bs.tab", u), x.addEventListener("shown.bs.tab", c), x.addEventListener("hide.bs.tab", b), x.addEventListener("hidden.bs.tab", g);
496
+ }
497
+ });
498
+ } catch (d) {
499
+ l("component-error", {
500
+ message: "Bootstrap JS not loaded. Nav will use basic Vue logic.",
501
+ componentName: "VibeNav",
502
+ originalError: d
503
+ });
504
+ }
505
+ };
506
+ Y(C), X(() => {
507
+ o.forEach((d, f) => {
508
+ f.removeEventListener("show.bs.tab", u), f.removeEventListener("shown.bs.tab", c), f.removeEventListener("hide.bs.tab", b), f.removeEventListener("hidden.bs.tab", g), d.dispose();
509
+ }), o.clear();
510
+ }), O(() => a.items, async () => {
511
+ await ne(), await C();
512
+ }, { deep: !0 });
513
+ const p = (d, f, h) => {
514
+ d.disabled || l("item-click", { item: d, index: f, event: h });
471
515
  };
472
- return (o, n) => (i(), q(P(e.tag), {
473
- class: g(l.value)
516
+ return v({ bsInstances: o, refresh: C }), (d, f) => (n(), z(A(e.tag), {
517
+ ref_key: "navRef",
518
+ ref: s,
519
+ class: $(r.value)
474
520
  }, {
475
- default: F(() => [
476
- (i(!0), s(M, null, A(e.items, (c, v) => (i(), s("li", {
477
- key: v,
478
- class: "nav-item"
521
+ default: j(() => [
522
+ (n(!0), i(F, null, H(e.items, (h, w) => (n(), i("li", {
523
+ key: w,
524
+ class: $(["nav-item", { dropdown: h.children && h.children.length > 0 }])
479
525
  }, [
480
- (i(), q(P(d(c)), {
481
- class: g(r(c)),
482
- href: c.href,
483
- to: c.to,
484
- "aria-current": c.active ? "page" : void 0,
485
- "aria-disabled": c.disabled,
486
- onClick: (p) => u(c, v, p)
526
+ h.children && h.children.length > 0 ? (n(), i(F, { key: 0 }, [
527
+ S("a", {
528
+ class: $(["nav-link dropdown-toggle", { active: h.active, disabled: h.disabled }]),
529
+ "data-bs-toggle": "dropdown",
530
+ href: "#",
531
+ role: "button",
532
+ "aria-expanded": "false"
533
+ }, k(h.text), 3),
534
+ S("ul", Ue, [
535
+ (n(!0), i(F, null, H(h.children, (x, V) => (n(), i("li", { key: V }, [
536
+ x.divider ? (n(), i("hr", Je)) : x.header ? (n(), i("h6", Ke, k(x.text), 1)) : (n(), z(A(x.href ? "a" : x.to ? "router-link" : "button"), {
537
+ key: 2,
538
+ class: $(["dropdown-item", { active: x.active, disabled: x.disabled }]),
539
+ href: x.href,
540
+ to: x.to,
541
+ type: !x.href && !x.to ? "button" : void 0
542
+ }, {
543
+ default: j(() => [
544
+ I(k(x.text), 1)
545
+ ]),
546
+ _: 2
547
+ }, 1032, ["class", "href", "to", "type"]))
548
+ ]))), 128))
549
+ ])
550
+ ], 64)) : (n(), z(A(h.href ? "a" : h.to ? "router-link" : "button"), {
551
+ key: 1,
552
+ class: $(["nav-link", { active: h.active, disabled: h.disabled }]),
553
+ href: h.href,
554
+ to: h.to,
555
+ type: !h.href && !h.to ? "button" : void 0,
556
+ "aria-current": h.active ? "page" : void 0,
557
+ "data-bs-toggle": (e.tabs || e.pills) && h.href && h.href.startsWith("#") ? e.tabs ? "tab" : "pill" : void 0,
558
+ "data-bs-target": h.href && h.href.startsWith("#") ? h.href : void 0,
559
+ onClick: (x) => p(h, w, x)
487
560
  }, {
488
- default: F(() => [
489
- C(o.$slots, "item", {
490
- item: c,
491
- index: v
492
- }, () => [
493
- w(m(c.text), 1)
494
- ])
561
+ default: j(() => [
562
+ I(k(h.text), 1)
495
563
  ]),
496
564
  _: 2
497
- }, 1032, ["class", "href", "to", "aria-current", "aria-disabled", "onClick"]))
498
- ]))), 128))
565
+ }, 1032, ["class", "href", "to", "type", "aria-current", "data-bs-toggle", "data-bs-target", "onClick"]))
566
+ ], 2))), 128))
499
567
  ]),
500
- _: 3
568
+ _: 1
501
569
  }, 8, ["class"]));
502
570
  }
503
- }), Ie = /* @__PURE__ */ x({
571
+ }), We = /* @__PURE__ */ M({
504
572
  __name: "VibeNavbar",
505
573
  props: {
506
574
  variant: { type: String, default: "light" },
@@ -511,181 +579,183 @@ const fe = /* @__PURE__ */ x({
511
579
  tag: { type: String, default: "nav" }
512
580
  },
513
581
  emits: ["component-error"],
514
- setup(e, { emit: f }) {
515
- const t = e, a = oe({});
516
- de("vibeNavbarCollapse", { collapseStates: a, toggleCollapse: (o) => {
517
- a[o] = !a[o];
582
+ setup(e, { emit: v }) {
583
+ const t = e, a = pe({});
584
+ ve("vibeNavbarCollapse", { collapseStates: a, toggleCollapse: (u) => {
585
+ a[u] = !a[u];
518
586
  } });
519
- const r = y(() => {
520
- const o = ["navbar"];
521
- return t.expand === !0 ? o.push("navbar-expand") : typeof t.expand == "string" && o.push(`navbar-expand-${t.expand}`), o.push(`bg-${t.variant}`), t.position && o.push(t.position), o.join(" ");
522
- }), d = y(() => {
587
+ const s = m(() => {
588
+ const u = ["navbar"];
589
+ return t.expand === !0 ? u.push("navbar-expand") : typeof t.expand == "string" && u.push(`navbar-expand-${t.expand}`), u.push(`bg-${t.variant}`), t.position && u.push(t.position), u.join(" ");
590
+ }), o = m(() => {
523
591
  if (t.theme) return t.theme;
524
592
  if (t.variant === "dark") return "dark";
525
593
  if (t.variant === "light") return "light";
526
- }), u = y(() => {
594
+ }), r = m(() => {
527
595
  if (t.container !== !1)
528
596
  return t.container === !0 ? "container-fluid" : `container-${t.container}`;
529
597
  });
530
- return (o, n) => (i(), q(P(e.tag), {
531
- class: g(r.value),
532
- "data-bs-theme": d.value
598
+ return (u, c) => (n(), z(A(e.tag), {
599
+ class: $(s.value),
600
+ "data-bs-theme": o.value
533
601
  }, {
534
- default: F(() => [
535
- u.value ? (i(), s("div", {
602
+ default: j(() => [
603
+ r.value ? (n(), i("div", {
536
604
  key: 0,
537
- class: g(u.value)
605
+ class: $(r.value)
538
606
  }, [
539
- C(o.$slots, "default")
540
- ], 2)) : C(o.$slots, "default", { key: 1 })
607
+ N(u.$slots, "default")
608
+ ], 2)) : N(u.$slots, "default", { key: 1 })
541
609
  ]),
542
610
  _: 3
543
611
  }, 8, ["class", "data-bs-theme"]));
544
612
  }
545
- }), Oe = /* @__PURE__ */ x({
613
+ }), Ze = /* @__PURE__ */ M({
546
614
  __name: "VibeNavbarBrand",
547
615
  props: {
548
616
  href: { type: String, default: void 0 },
549
617
  to: { type: [String, Object], default: void 0 }
550
618
  },
551
619
  emits: ["component-error"],
552
- setup(e, { emit: f }) {
620
+ setup(e, { emit: v }) {
553
621
  const t = e, a = t.href ? "a" : t.to ? "router-link" : "span";
554
- return (l, r) => (i(), q(P(re(a)), {
622
+ return (l, s) => (n(), z(A(ye(a)), {
555
623
  class: "navbar-brand",
556
624
  href: e.href,
557
625
  to: e.to
558
626
  }, {
559
- default: F(() => [
560
- C(l.$slots, "default")
627
+ default: j(() => [
628
+ N(l.$slots, "default")
561
629
  ]),
562
630
  _: 3
563
631
  }, 8, ["href", "to"]));
564
632
  }
565
- }), De = ["aria-controls", "aria-expanded", "aria-label"], Ee = /* @__PURE__ */ x({
633
+ }), _e = ["data-bs-target", "aria-controls", "aria-expanded", "aria-label"], et = /* @__PURE__ */ M({
566
634
  __name: "VibeNavbarToggle",
567
635
  props: {
568
636
  target: { type: String, required: !0 },
569
637
  ariaLabel: { type: String, default: "Toggle navigation" }
570
638
  },
571
639
  emits: ["component-error"],
572
- setup(e, { emit: f }) {
573
- const t = e, a = Z("vibeNavbarCollapse", null), l = y(() => (a == null ? void 0 : a.collapseStates[t.target]) ?? !1), r = () => {
640
+ setup(e, { emit: v }) {
641
+ const t = e, a = J("vibeNavbarCollapse", null), l = m(() => a?.collapseStates[t.target] ?? !1), s = async () => {
574
642
  a && a.toggleCollapse(t.target);
643
+ try {
644
+ const o = document.getElementById(t.target);
645
+ o && (await import("bootstrap")).Collapse.getOrCreateInstance(o).toggle();
646
+ } catch {
647
+ }
575
648
  };
576
- return (d, u) => (i(), s("button", {
649
+ return (o, r) => (n(), i("button", {
577
650
  class: "navbar-toggler",
578
651
  type: "button",
652
+ "data-bs-target": `#${e.target}`,
653
+ "data-bs-toggle": "collapse",
579
654
  "aria-controls": e.target,
580
655
  "aria-expanded": l.value,
581
656
  "aria-label": e.ariaLabel,
582
- onClick: r
583
- }, [...u[0] || (u[0] = [
584
- h("span", { class: "navbar-toggler-icon" }, null, -1)
585
- ])], 8, De));
657
+ onClick: s
658
+ }, [...r[0] || (r[0] = [
659
+ S("span", { class: "navbar-toggler-icon" }, null, -1)
660
+ ])], 8, _e));
586
661
  }
587
- }), Re = { class: "dropdown-menu" }, Xe = { key: 0 }, Ye = { key: 1 }, Ge = { class: "dropdown-header" }, He = { key: 2 }, Ke = /* @__PURE__ */ x({
662
+ }), tt = { class: "dropdown-menu" }, at = { key: 0 }, lt = { key: 1 }, ot = { class: "dropdown-header" }, st = { key: 2 }, nt = /* @__PURE__ */ M({
588
663
  __name: "VibeNavbarNav",
589
664
  props: {
590
665
  tag: { type: String, default: "ul" },
591
666
  items: { type: Array, default: void 0 }
592
667
  },
593
668
  emits: ["item-click", "dropdown-item-click", "component-error"],
594
- setup(e, { emit: f }) {
595
- const t = f, a = (n) => {
596
- var v;
597
- const c = ["nav-item"];
598
- return (v = n.children) != null && v.length && c.push("dropdown"), c.join(" ");
599
- }, l = (n) => {
600
- var v;
601
- const c = ["nav-link"];
602
- return n.active && c.push("active"), n.disabled && c.push("disabled"), (v = n.children) != null && v.length && c.push("dropdown-toggle"), c.join(" ");
603
- }, r = (n) => n.href ? "a" : n.to ? "router-link" : "a", d = (n) => {
604
- const c = ["dropdown-item"];
605
- return n.active && c.push("active"), n.disabled && c.push("disabled"), c.join(" ");
606
- }, u = (n, c, v) => {
607
- n.disabled || t("item-click", { item: n, index: c, event: v });
608
- }, o = (n, c, v, p, B) => {
609
- !v.disabled && !v.divider && !v.header && t("dropdown-item-click", { item: n, itemIndex: c, child: v, childIndex: p, event: B });
669
+ setup(e, { emit: v }) {
670
+ const t = v, a = (c) => {
671
+ const b = ["nav-item"];
672
+ return c.children?.length && b.push("dropdown"), b.join(" ");
673
+ }, l = (c) => {
674
+ const b = ["nav-link"];
675
+ return c.active && b.push("active"), c.disabled && b.push("disabled"), c.children?.length && b.push("dropdown-toggle"), b.join(" ");
676
+ }, s = (c) => c.href ? "a" : c.to ? "router-link" : "a", o = (c) => {
677
+ const b = ["dropdown-item"];
678
+ return c.active && b.push("active"), c.disabled && b.push("disabled"), b.join(" ");
679
+ }, r = (c, b, g) => {
680
+ c.disabled || t("item-click", { item: c, index: b, event: g });
681
+ }, u = (c, b, g, C, p) => {
682
+ !g.disabled && !g.divider && !g.header && t("dropdown-item-click", { item: c, itemIndex: b, child: g, childIndex: C, event: p });
610
683
  };
611
- return (n, c) => (i(), q(P(e.tag), { class: "navbar-nav" }, {
612
- default: F(() => [
613
- e.items && e.items.length > 0 ? (i(!0), s(M, { key: 0 }, A(e.items, (v, p) => {
614
- var B;
615
- return i(), s("li", {
616
- key: p,
617
- class: g(a(v))
618
- }, [
619
- (B = v.children) != null && B.length ? (i(), s(M, { key: 0 }, [
620
- h("a", {
621
- class: g(l(v)),
622
- href: "#",
623
- role: "button",
624
- "data-bs-toggle": "dropdown",
625
- "aria-expanded": "false"
626
- }, [
627
- C(n.$slots, "item", {
628
- item: v,
629
- index: p
630
- }, () => [
631
- w(m(v.text), 1)
632
- ])
633
- ], 2),
634
- h("ul", Re, [
635
- (i(!0), s(M, null, A(v.children, ($, L) => (i(), s(M, { key: L }, [
636
- $.divider ? (i(), s("li", Xe, [...c[0] || (c[0] = [
637
- h("hr", { class: "dropdown-divider" }, null, -1)
638
- ])])) : $.header ? (i(), s("li", Ye, [
639
- h("h6", Ge, m($.text), 1)
640
- ])) : (i(), s("li", He, [
641
- (i(), q(P($.href ? "a" : $.to ? "router-link" : "button"), {
642
- class: g(d($)),
643
- href: $.href,
644
- to: $.to,
645
- type: !$.href && !$.to ? "button" : void 0,
646
- onClick: (z) => o(v, p, $, L, z)
647
- }, {
648
- default: F(() => [
649
- C(n.$slots, "dropdown-item", {
650
- item: v,
651
- child: $,
652
- index: p,
653
- childIndex: L
654
- }, () => [
655
- w(m($.text), 1)
656
- ])
657
- ]),
658
- _: 2
659
- }, 1032, ["class", "href", "to", "type", "onClick"]))
660
- ]))
661
- ], 64))), 128))
684
+ return (c, b) => (n(), z(A(e.tag), { class: "navbar-nav" }, {
685
+ default: j(() => [
686
+ e.items && e.items.length > 0 ? (n(!0), i(F, { key: 0 }, H(e.items, (g, C) => (n(), i("li", {
687
+ key: C,
688
+ class: $(a(g))
689
+ }, [
690
+ g.children?.length ? (n(), i(F, { key: 0 }, [
691
+ S("a", {
692
+ class: $(l(g)),
693
+ href: "#",
694
+ role: "button",
695
+ "data-bs-toggle": "dropdown",
696
+ "aria-expanded": "false"
697
+ }, [
698
+ N(c.$slots, "item", {
699
+ item: g,
700
+ index: C
701
+ }, () => [
702
+ I(k(g.text), 1)
662
703
  ])
663
- ], 64)) : (i(), q(P(r(v)), {
664
- key: 1,
665
- class: g(l(v)),
666
- href: v.href,
667
- to: v.to,
668
- "aria-current": v.active ? "page" : void 0,
669
- "aria-disabled": v.disabled,
670
- onClick: ($) => u(v, p, $)
671
- }, {
672
- default: F(() => [
673
- C(n.$slots, "item", {
674
- item: v,
675
- index: p
676
- }, () => [
677
- w(m(v.text), 1)
678
- ])
679
- ]),
680
- _: 2
681
- }, 1032, ["class", "href", "to", "aria-current", "aria-disabled", "onClick"]))
682
- ], 2);
683
- }), 128)) : C(n.$slots, "default", { key: 1 })
704
+ ], 2),
705
+ S("ul", tt, [
706
+ (n(!0), i(F, null, H(g.children, (p, d) => (n(), i(F, { key: d }, [
707
+ p.divider ? (n(), i("li", at, [...b[0] || (b[0] = [
708
+ S("hr", { class: "dropdown-divider" }, null, -1)
709
+ ])])) : p.header ? (n(), i("li", lt, [
710
+ S("h6", ot, k(p.text), 1)
711
+ ])) : (n(), i("li", st, [
712
+ (n(), z(A(p.href ? "a" : p.to ? "router-link" : "button"), {
713
+ class: $(o(p)),
714
+ href: p.href,
715
+ to: p.to,
716
+ type: !p.href && !p.to ? "button" : void 0,
717
+ onClick: (f) => u(g, C, p, d, f)
718
+ }, {
719
+ default: j(() => [
720
+ N(c.$slots, "dropdown-item", {
721
+ item: g,
722
+ child: p,
723
+ index: C,
724
+ childIndex: d
725
+ }, () => [
726
+ I(k(p.text), 1)
727
+ ])
728
+ ]),
729
+ _: 2
730
+ }, 1032, ["class", "href", "to", "type", "onClick"]))
731
+ ]))
732
+ ], 64))), 128))
733
+ ])
734
+ ], 64)) : (n(), z(A(s(g)), {
735
+ key: 1,
736
+ class: $(l(g)),
737
+ href: g.href,
738
+ to: g.to,
739
+ "aria-current": g.active ? "page" : void 0,
740
+ "aria-disabled": g.disabled,
741
+ onClick: (p) => r(g, C, p)
742
+ }, {
743
+ default: j(() => [
744
+ N(c.$slots, "item", {
745
+ item: g,
746
+ index: C
747
+ }, () => [
748
+ I(k(g.text), 1)
749
+ ])
750
+ ]),
751
+ _: 2
752
+ }, 1032, ["class", "href", "to", "aria-current", "aria-disabled", "onClick"]))
753
+ ], 2))), 128)) : N(c.$slots, "default", { key: 1 })
684
754
  ]),
685
755
  _: 3
686
756
  }));
687
757
  }
688
- }), Ue = ["aria-label"], Qe = ["disabled", "aria-disabled"], We = ["aria-current", "onClick"], Je = ["disabled", "aria-disabled"], Ze = /* @__PURE__ */ x({
758
+ }), it = ["aria-label"], rt = ["disabled", "aria-disabled"], dt = ["aria-current", "onClick"], ut = ["disabled", "aria-disabled"], ct = /* @__PURE__ */ M({
689
759
  __name: "VibePagination",
690
760
  props: {
691
761
  size: { type: String, default: void 0 },
@@ -697,71 +767,71 @@ const fe = /* @__PURE__ */ x({
697
767
  nextText: { type: String, default: "Next" }
698
768
  },
699
769
  emits: ["update:currentPage", "page-click", "component-error"],
700
- setup(e, { emit: f }) {
701
- const t = e, a = f, l = y(() => {
702
- const n = ["pagination"];
703
- return t.size && n.push(`pagination-${t.size}`), n.join(" ");
704
- }), r = y(() => Array.from({ length: t.totalPages }, (n, c) => c + 1)), d = (n) => {
705
- n >= 1 && n <= t.totalPages && (a("update:currentPage", n), a("page-click", n));
706
- }, u = y(() => t.currentPage === 1), o = y(() => t.currentPage === t.totalPages);
707
- return (n, c) => (i(), s("nav", { "aria-label": e.ariaLabel }, [
708
- h("ul", {
709
- class: g(l.value)
770
+ setup(e, { emit: v }) {
771
+ const t = e, a = v, l = m(() => {
772
+ const c = ["pagination"];
773
+ return t.size && c.push(`pagination-${t.size}`), c.join(" ");
774
+ }), s = m(() => Array.from({ length: t.totalPages }, (c, b) => b + 1)), o = (c) => {
775
+ c >= 1 && c <= t.totalPages && (a("update:currentPage", c), a("page-click", c));
776
+ }, r = m(() => t.currentPage === 1), u = m(() => t.currentPage === t.totalPages);
777
+ return (c, b) => (n(), i("nav", { "aria-label": e.ariaLabel }, [
778
+ S("ul", {
779
+ class: $(l.value)
710
780
  }, [
711
- e.showPrevNext ? (i(), s("li", {
781
+ e.showPrevNext ? (n(), i("li", {
712
782
  key: 0,
713
- class: g(["page-item", { disabled: u.value }])
783
+ class: $(["page-item", { disabled: r.value }])
714
784
  }, [
715
- h("button", {
785
+ S("button", {
716
786
  class: "page-link",
717
787
  type: "button",
718
- disabled: u.value,
719
- "aria-disabled": u.value,
720
- onClick: c[0] || (c[0] = (v) => d(e.currentPage - 1))
788
+ disabled: r.value,
789
+ "aria-disabled": r.value,
790
+ onClick: b[0] || (b[0] = (g) => o(e.currentPage - 1))
721
791
  }, [
722
- C(n.$slots, "prev", { disabled: u.value }, () => [
723
- w(m(e.prevText), 1)
792
+ N(c.$slots, "prev", { disabled: r.value }, () => [
793
+ I(k(e.prevText), 1)
724
794
  ])
725
- ], 8, Qe)
726
- ], 2)) : b("", !0),
727
- (i(!0), s(M, null, A(r.value, (v) => (i(), s("li", {
728
- key: v,
729
- class: g(["page-item", { active: v === e.currentPage }])
795
+ ], 8, rt)
796
+ ], 2)) : y("", !0),
797
+ (n(!0), i(F, null, H(s.value, (g) => (n(), i("li", {
798
+ key: g,
799
+ class: $(["page-item", { active: g === e.currentPage }])
730
800
  }, [
731
- h("button", {
801
+ S("button", {
732
802
  class: "page-link",
733
803
  type: "button",
734
- "aria-current": v === e.currentPage ? "page" : void 0,
735
- onClick: (p) => d(v)
804
+ "aria-current": g === e.currentPage ? "page" : void 0,
805
+ onClick: (C) => o(g)
736
806
  }, [
737
- C(n.$slots, "page", {
738
- page: v,
739
- active: v === e.currentPage
807
+ N(c.$slots, "page", {
808
+ page: g,
809
+ active: g === e.currentPage
740
810
  }, () => [
741
- w(m(v), 1)
811
+ I(k(g), 1)
742
812
  ])
743
- ], 8, We)
813
+ ], 8, dt)
744
814
  ], 2))), 128)),
745
- e.showPrevNext ? (i(), s("li", {
815
+ e.showPrevNext ? (n(), i("li", {
746
816
  key: 1,
747
- class: g(["page-item", { disabled: o.value }])
817
+ class: $(["page-item", { disabled: u.value }])
748
818
  }, [
749
- h("button", {
819
+ S("button", {
750
820
  class: "page-link",
751
821
  type: "button",
752
- disabled: o.value,
753
- "aria-disabled": o.value,
754
- onClick: c[1] || (c[1] = (v) => d(e.currentPage + 1))
822
+ disabled: u.value,
823
+ "aria-disabled": u.value,
824
+ onClick: b[1] || (b[1] = (g) => o(e.currentPage + 1))
755
825
  }, [
756
- C(n.$slots, "next", { disabled: o.value }, () => [
757
- w(m(e.nextText), 1)
826
+ N(c.$slots, "next", { disabled: u.value }, () => [
827
+ I(k(e.nextText), 1)
758
828
  ])
759
- ], 8, Je)
760
- ], 2)) : b("", !0)
829
+ ], 8, ut)
830
+ ], 2)) : y("", !0)
761
831
  ], 2)
762
- ], 8, Ue));
832
+ ], 8, it));
763
833
  }
764
- }), _e = ["id", "aria-labelledby"], et = /* @__PURE__ */ x({
834
+ }), vt = ["id", "aria-labelledby"], ft = /* @__PURE__ */ M({
765
835
  __name: "VibeTabContent",
766
836
  props: {
767
837
  id: { type: String, default: void 0 },
@@ -769,37 +839,47 @@ const fe = /* @__PURE__ */ x({
769
839
  panes: { type: Array, required: !0 },
770
840
  fade: { type: Boolean, default: !0 }
771
841
  },
772
- emits: ["component-error"],
773
- setup(e, { emit: f }) {
774
- const t = e, a = (l) => {
842
+ emits: ["component-error", "shown", "hide", "hidden"],
843
+ setup(e, { emit: v }) {
844
+ const t = e, a = E(null), l = /* @__PURE__ */ new Map(), s = (o) => {
775
845
  const r = ["tab-pane"];
776
- return t.fade && r.push("fade"), l.active && r.push("show", "active"), r.join(" ");
846
+ return t.fade && r.push("fade"), o.active && r.push("show", "active"), r.join(" ");
777
847
  };
778
- return (l, r) => (i(), q(P(e.tag), {
848
+ return Y(async () => {
849
+ if (a.value)
850
+ try {
851
+ const r = (await import("bootstrap")).Tab;
852
+ } catch {
853
+ }
854
+ }), X(() => {
855
+ l.forEach((o) => o.dispose()), l.clear();
856
+ }), (o, r) => (n(), z(A(e.tag), {
779
857
  id: e.id,
858
+ ref_key: "tabContentRef",
859
+ ref: a,
780
860
  class: "tab-content"
781
861
  }, {
782
- default: F(() => [
783
- (i(!0), s(M, null, A(e.panes, (d, u) => (i(), s("div", {
784
- key: d.id,
785
- id: d.id,
786
- class: g(a(d)),
862
+ default: j(() => [
863
+ (n(!0), i(F, null, H(e.panes, (u, c) => (n(), i("div", {
864
+ key: u.id,
865
+ id: u.id,
866
+ class: $(s(u)),
787
867
  role: "tabpanel",
788
- "aria-labelledby": `${d.id}-tab`,
868
+ "aria-labelledby": `${u.id}-tab`,
789
869
  tabindex: "0"
790
870
  }, [
791
- C(l.$slots, "pane", {
792
- pane: d,
793
- index: u
871
+ N(o.$slots, "pane", {
872
+ pane: u,
873
+ index: c
794
874
  }, () => [
795
- w(m(d.content), 1)
875
+ I(k(u.content), 1)
796
876
  ])
797
- ], 10, _e))), 128))
877
+ ], 10, vt))), 128))
798
878
  ]),
799
879
  _: 3
800
880
  }, 8, ["id"]));
801
881
  }
802
- }), tt = /* @__PURE__ */ x({
882
+ }), bt = /* @__PURE__ */ M({
803
883
  __name: "VibeListGroup",
804
884
  props: {
805
885
  flush: { type: Boolean, default: !1 },
@@ -809,35 +889,35 @@ const fe = /* @__PURE__ */ x({
809
889
  items: { type: Array, required: !0 }
810
890
  },
811
891
  emits: ["item-click", "component-error"],
812
- setup(e, { emit: f }) {
813
- const t = e, a = f, l = y(() => {
814
- const o = ["list-group"];
815
- return t.flush && o.push("list-group-flush"), t.numbered && o.push("list-group-numbered"), t.horizontal === !0 ? o.push("list-group-horizontal") : typeof t.horizontal == "string" && o.push(`list-group-horizontal-${t.horizontal}`), o.join(" ");
816
- }), r = (o) => o.href ? "a" : o.to ? "router-link" : "li", d = (o) => {
817
- const n = ["list-group-item"];
818
- return o.active && n.push("active"), o.disabled && n.push("disabled"), o.variant && n.push(`list-group-item-${o.variant}`), n.join(" ");
819
- }, u = (o, n, c) => {
820
- o.disabled || a("item-click", { item: o, index: n, event: c });
892
+ setup(e, { emit: v }) {
893
+ const t = e, a = v, l = m(() => {
894
+ const u = ["list-group"];
895
+ return t.flush && u.push("list-group-flush"), t.numbered && u.push("list-group-numbered"), t.horizontal === !0 ? u.push("list-group-horizontal") : typeof t.horizontal == "string" && u.push(`list-group-horizontal-${t.horizontal}`), u.join(" ");
896
+ }), s = (u) => u.href ? "a" : u.to ? "router-link" : "li", o = (u) => {
897
+ const c = ["list-group-item"];
898
+ return u.active && c.push("active"), u.disabled && c.push("disabled"), u.variant && c.push(`list-group-item-${u.variant}`), c.join(" ");
899
+ }, r = (u, c, b) => {
900
+ u.disabled || a("item-click", { item: u, index: c, event: b });
821
901
  };
822
- return (o, n) => (i(), q(P(e.tag), {
823
- class: g(l.value)
902
+ return (u, c) => (n(), z(A(e.tag), {
903
+ class: $(l.value)
824
904
  }, {
825
- default: F(() => [
826
- (i(!0), s(M, null, A(e.items, (c, v) => (i(), q(P(r(c)), {
827
- key: v,
828
- class: g(d(c)),
829
- href: c.href,
830
- to: c.to,
831
- "aria-disabled": c.disabled,
832
- "aria-current": c.active,
833
- onClick: (p) => u(c, v, p)
905
+ default: j(() => [
906
+ (n(!0), i(F, null, H(e.items, (b, g) => (n(), z(A(s(b)), {
907
+ key: g,
908
+ class: $(o(b)),
909
+ href: b.href,
910
+ to: b.to,
911
+ "aria-disabled": b.disabled,
912
+ "aria-current": b.active,
913
+ onClick: (C) => r(b, g, C)
834
914
  }, {
835
- default: F(() => [
836
- C(o.$slots, "item", {
837
- item: c,
838
- index: v
915
+ default: j(() => [
916
+ N(u.$slots, "item", {
917
+ item: b,
918
+ index: g
839
919
  }, () => [
840
- w(m(c.text), 1)
920
+ I(k(b.text), 1)
841
921
  ])
842
922
  ]),
843
923
  _: 2
@@ -846,220 +926,333 @@ const fe = /* @__PURE__ */ x({
846
926
  _: 3
847
927
  }, 8, ["class"]));
848
928
  }
849
- }), at = ["aria-valuenow", "aria-valuemax"], lt = /* @__PURE__ */ x({
929
+ }), ht = ["aria-valuenow", "aria-valuemax"], mt = /* @__PURE__ */ M({
850
930
  __name: "VibeProgress",
851
931
  props: {
852
932
  height: { type: String, default: void 0 },
853
933
  bars: { type: Array, required: !0 }
854
934
  },
855
935
  emits: ["component-error"],
856
- setup(e, { emit: f }) {
857
- const t = e, a = y(() => {
936
+ setup(e, { emit: v }) {
937
+ const t = e, a = m(() => {
858
938
  if (t.height)
859
939
  return { height: t.height };
860
- }), l = (u) => {
861
- const o = ["progress-bar"];
862
- return u.variant && o.push(`bg-${u.variant}`), (u.striped || u.animated) && o.push("progress-bar-striped"), u.animated && o.push("progress-bar-animated"), o.join(" ");
863
- }, r = (u) => {
864
- const o = u.max || 100;
865
- return { width: `${Math.min(100, Math.max(0, u.value / o * 100))}%` };
866
- }, d = (u) => u.label ? u.label : u.showValue ? `${u.value}%` : "";
867
- return (u, o) => (i(), s("div", {
940
+ }), l = (r) => {
941
+ const u = ["progress-bar"];
942
+ return r.variant && u.push(`bg-${r.variant}`), (r.striped || r.animated) && u.push("progress-bar-striped"), r.animated && u.push("progress-bar-animated"), u.join(" ");
943
+ }, s = (r) => {
944
+ const u = r.max || 100;
945
+ return { width: `${Math.min(100, Math.max(0, r.value / u * 100))}%` };
946
+ }, o = (r) => r.label ? r.label : r.showValue ? `${r.value}%` : "";
947
+ return (r, u) => (n(), i("div", {
868
948
  class: "progress",
869
- style: D(a.value)
949
+ style: K(a.value)
870
950
  }, [
871
- (i(!0), s(M, null, A(e.bars, (n, c) => (i(), s("div", {
872
- key: c,
873
- class: g(l(n)),
874
- style: D(r(n)),
951
+ (n(!0), i(F, null, H(e.bars, (c, b) => (n(), i("div", {
952
+ key: b,
953
+ class: $(l(c)),
954
+ style: K(s(c)),
875
955
  role: "progressbar",
876
- "aria-valuenow": n.value,
956
+ "aria-valuenow": c.value,
877
957
  "aria-valuemin": 0,
878
- "aria-valuemax": n.max || 100
958
+ "aria-valuemax": c.max || 100
879
959
  }, [
880
- C(u.$slots, "label", {
881
- bar: n,
882
- index: c
960
+ N(r.$slots, "label", {
961
+ bar: c,
962
+ index: b
883
963
  }, () => [
884
- w(m(d(n)), 1)
964
+ I(k(o(c)), 1)
885
965
  ])
886
- ], 14, at))), 128))
966
+ ], 14, ht))), 128))
887
967
  ], 4));
888
968
  }
889
- }), it = ["id"], st = { class: "accordion-header" }, nt = ["data-bs-target", "aria-expanded", "aria-controls", "onClick"], ot = ["id", "data-bs-parent"], dt = { class: "accordion-body" }, rt = /* @__PURE__ */ x({
969
+ });
970
+ let ce = 0;
971
+ function G(e = "vibe") {
972
+ const v = ge(), t = v ? v.uid : "no-instance";
973
+ return ce++, `${e}-${t}-${ce}`;
974
+ }
975
+ const pt = ["id"], yt = { class: "accordion-header" }, gt = ["data-bs-target", "aria-expanded", "aria-controls", "onClick"], kt = ["id", "data-bs-parent"], St = { class: "accordion-body" }, $t = /* @__PURE__ */ M({
890
976
  __name: "VibeAccordion",
891
977
  props: {
892
- id: { type: String, required: !0 },
978
+ id: { type: String, default: () => G("accordion") },
893
979
  flush: { type: Boolean, default: !1 },
894
- items: { type: Array, required: !0 }
980
+ items: { type: Array, required: !0 },
981
+ alwaysOpen: { type: Boolean, default: !1 }
895
982
  },
896
- emits: ["item-click", "component-error"],
897
- setup(e, { emit: f }) {
898
- const t = f, a = (l, r) => {
899
- t("item-click", { item: l, index: r });
983
+ emits: ["item-click", "show", "shown", "hide", "hidden", "component-error"],
984
+ setup(e, { expose: v, emit: t }) {
985
+ const a = e, l = t, s = E(null), o = /* @__PURE__ */ new Map(), r = (p) => l("show", p), u = (p) => l("shown", p), c = (p) => l("hide", p), b = (p) => l("hidden", p), g = async () => {
986
+ if (s.value)
987
+ try {
988
+ const d = (await import("bootstrap")).Collapse;
989
+ s.value.querySelectorAll(".accordion-collapse").forEach((h) => {
990
+ const w = h.id;
991
+ if (!o.has(w)) {
992
+ const x = new d(h, {
993
+ toggle: !1,
994
+ parent: a.alwaysOpen ? void 0 : `#${a.id}`
995
+ });
996
+ o.set(w, x), h.addEventListener("show.bs.collapse", () => r(w)), h.addEventListener("shown.bs.collapse", () => u(w)), h.addEventListener("hide.bs.collapse", () => c(w)), h.addEventListener("hidden.bs.collapse", () => b(w)), a.items.find((q) => q.id === w)?.show && x.show();
997
+ }
998
+ });
999
+ } catch (p) {
1000
+ l("component-error", {
1001
+ message: "Bootstrap JS not loaded. Accordion will use data attributes only.",
1002
+ componentName: "VibeAccordion",
1003
+ originalError: p
1004
+ });
1005
+ }
1006
+ };
1007
+ Y(g), X(() => {
1008
+ o.forEach((p, d) => {
1009
+ const f = document.getElementById(d);
1010
+ f && (f.removeEventListener("show.bs.collapse", () => r(d)), f.removeEventListener("shown.bs.collapse", () => u(d)), f.removeEventListener("hide.bs.collapse", () => c(d)), f.removeEventListener("hidden.bs.collapse", () => b(d))), p.dispose();
1011
+ }), o.clear();
1012
+ }), O(() => a.items, async (p, d) => {
1013
+ p.length !== d?.length && (await ne(), await g()), p.forEach((f) => {
1014
+ const h = o.get(f.id);
1015
+ h && (f.show ? h.show() : a.alwaysOpen || h.hide());
1016
+ });
1017
+ }, { deep: !0 });
1018
+ const C = (p, d) => {
1019
+ l("item-click", { item: p, index: d });
900
1020
  };
901
- return (l, r) => (i(), s("div", {
1021
+ return v({ bsInstances: o, refresh: g }), (p, d) => (n(), i("div", {
1022
+ ref_key: "accordionRef",
1023
+ ref: s,
902
1024
  id: e.id,
903
- class: g(["accordion", { "accordion-flush": e.flush }])
1025
+ class: $(["accordion", { "accordion-flush": e.flush }])
904
1026
  }, [
905
- (i(!0), s(M, null, A(e.items, (d, u) => (i(), s("div", {
906
- key: d.id,
1027
+ (n(!0), i(F, null, H(e.items, (f, h) => (n(), i("div", {
1028
+ key: f.id,
907
1029
  class: "accordion-item"
908
1030
  }, [
909
- h("h2", st, [
910
- h("button", {
911
- class: g(["accordion-button", { collapsed: !d.show }]),
1031
+ S("h2", yt, [
1032
+ S("button", {
1033
+ class: $(["accordion-button", { collapsed: !f.show }]),
912
1034
  type: "button",
913
1035
  "data-bs-toggle": "collapse",
914
- "data-bs-target": `#${d.id}`,
915
- "aria-expanded": d.show,
916
- "aria-controls": d.id,
917
- onClick: (o) => a(d, u)
1036
+ "data-bs-target": `#${f.id}`,
1037
+ "aria-expanded": f.show,
1038
+ "aria-controls": f.id,
1039
+ onClick: (w) => C(f, h)
918
1040
  }, [
919
- C(l.$slots, "title", {
920
- item: d,
921
- index: u
1041
+ N(p.$slots, "title", {
1042
+ item: f,
1043
+ index: h
922
1044
  }, () => [
923
- w(m(d.title), 1)
1045
+ I(k(f.title), 1)
924
1046
  ])
925
- ], 10, nt)
1047
+ ], 10, gt)
926
1048
  ]),
927
- h("div", {
928
- id: d.id,
929
- class: g(["accordion-collapse", "collapse", { show: d.show }]),
930
- "data-bs-parent": `#${e.id}`
1049
+ S("div", {
1050
+ id: f.id,
1051
+ class: $(["accordion-collapse", "collapse", { show: f.show }]),
1052
+ "data-bs-parent": e.alwaysOpen ? void 0 : `#${e.id}`
931
1053
  }, [
932
- h("div", dt, [
933
- C(l.$slots, "content", {
934
- item: d,
935
- index: u
1054
+ S("div", St, [
1055
+ N(p.$slots, "content", {
1056
+ item: f,
1057
+ index: h
936
1058
  }, () => [
937
- w(m(d.content), 1)
1059
+ I(k(f.content), 1)
938
1060
  ])
939
1061
  ])
940
- ], 10, ot)
1062
+ ], 10, kt)
941
1063
  ]))), 128))
942
- ], 10, it));
1064
+ ], 10, pt));
943
1065
  }
944
- }), ut = /* @__PURE__ */ x({
1066
+ }), wt = /* @__PURE__ */ M({
945
1067
  __name: "VibeCollapse",
946
1068
  props: {
947
- id: { type: String, required: !0 },
1069
+ id: { type: String, default: () => G("collapse") },
948
1070
  modelValue: { type: Boolean, default: !1 },
949
1071
  tag: { type: String, default: "div" },
950
1072
  horizontal: { type: Boolean, default: !1 },
951
1073
  isNav: { type: Boolean, default: !1 }
952
1074
  },
953
1075
  emits: ["update:modelValue", "show", "shown", "hide", "hidden", "component-error"],
954
- setup(e, { emit: f }) {
955
- const t = e, a = Z("vibeNavbarCollapse", null), l = T(t.modelValue);
956
- E(() => t.modelValue, (u) => {
957
- l.value = u;
1076
+ setup(e, { emit: v }) {
1077
+ const t = e, a = v, l = J("vibeNavbarCollapse", null), s = E(null), o = E(null), r = E(!1), u = () => {
1078
+ r.value = !0, a("show");
1079
+ }, c = () => {
1080
+ a("shown"), a("update:modelValue", !0);
1081
+ }, b = () => {
1082
+ a("hide");
1083
+ }, g = () => {
1084
+ r.value = !1, a("hidden"), a("update:modelValue", !1);
1085
+ };
1086
+ Y(async () => {
1087
+ if (s.value)
1088
+ try {
1089
+ const f = (await import("bootstrap")).Collapse;
1090
+ o.value = new f(s.value, {
1091
+ toggle: !1
1092
+ }), s.value.addEventListener("show.bs.collapse", u), s.value.addEventListener("shown.bs.collapse", c), s.value.addEventListener("hide.bs.collapse", b), s.value.addEventListener("hidden.bs.collapse", g), (l && t.id in l.collapseStates ? l.collapseStates[t.id] : t.modelValue) && o.value.show();
1093
+ } catch (d) {
1094
+ a("component-error", {
1095
+ message: "Bootstrap JS not loaded. Collapse will use CSS classes only.",
1096
+ componentName: "VibeCollapse",
1097
+ originalError: d
1098
+ });
1099
+ }
1100
+ }), X(() => {
1101
+ s.value && (s.value.removeEventListener("show.bs.collapse", u), s.value.removeEventListener("shown.bs.collapse", c), s.value.removeEventListener("hide.bs.collapse", b), s.value.removeEventListener("hidden.bs.collapse", g)), o.value && (o.value.dispose(), o.value = null);
1102
+ });
1103
+ const C = m(() => l && t.id in l.collapseStates ? l.collapseStates[t.id] : t.modelValue);
1104
+ O(C, (d) => {
1105
+ o.value && (d && !r.value ? o.value.show() : !d && r.value && o.value.hide());
958
1106
  });
959
- const r = y(() => a && t.id in a.collapseStates ? a.collapseStates[t.id] : l.value), d = y(() => {
960
- const u = ["collapse"];
961
- return t.isNav && u.push("navbar-collapse"), t.horizontal && u.push("collapse-horizontal"), r.value && u.push("show"), u.join(" ");
1107
+ const p = m(() => {
1108
+ const d = ["collapse"];
1109
+ return t.isNav && d.push("navbar-collapse"), t.horizontal && d.push("collapse-horizontal"), !o.value && C.value && d.push("show"), d.join(" ");
962
1110
  });
963
- return (u, o) => (i(), q(P(e.tag), {
1111
+ return (d, f) => (n(), z(A(e.tag), {
1112
+ ref_key: "collapseRef",
1113
+ ref: s,
964
1114
  id: e.id,
965
- class: g(d.value)
1115
+ class: $(p.value)
966
1116
  }, {
967
- default: F(() => [
968
- C(u.$slots, "default")
1117
+ default: j(() => [
1118
+ N(d.$slots, "default")
969
1119
  ]),
970
1120
  _: 3
971
1121
  }, 8, ["id", "class"]));
972
1122
  }
973
- }), ct = ["id"], ft = ["aria-labelledby"], vt = { key: 0 }, bt = { key: 1 }, mt = { class: "dropdown-header" }, ht = { key: 2 }, yt = /* @__PURE__ */ x({
1123
+ }), Vt = ["id", "data-bs-auto-close"], Ct = ["id", "data-bs-auto-close"], xt = ["aria-labelledby"], Bt = { key: 0 }, Lt = { key: 1 }, Tt = { class: "dropdown-header" }, Nt = { key: 2 }, Et = /* @__PURE__ */ M({
974
1124
  __name: "VibeDropdown",
975
1125
  props: {
976
- id: { type: String, required: !0 },
1126
+ id: { type: String, default: () => G("dropdown") },
977
1127
  text: { type: String, default: "Dropdown" },
978
1128
  variant: { type: String, default: "primary" },
979
1129
  size: { type: String, default: void 0 },
980
1130
  split: { type: Boolean, default: !1 },
981
1131
  direction: { type: String, default: "down" },
982
1132
  menuEnd: { type: Boolean, default: !1 },
983
- items: { type: Array, required: !0 }
1133
+ items: { type: Array, required: !0 },
1134
+ autoClose: { type: [Boolean, String], default: !0 }
984
1135
  },
985
- emits: ["item-click", "component-error"],
986
- setup(e, { emit: f }) {
987
- const t = e, a = f, l = y(() => t.direction === "up" ? "dropup" : t.direction === "end" ? "dropend" : t.direction === "start" ? "dropstart" : "dropdown"), r = y(() => {
988
- const n = ["btn", `btn-${t.variant}`];
989
- return t.size && n.push(`btn-${t.size}`), n.join(" ");
990
- }), d = y(() => {
991
- const n = ["dropdown-menu"];
992
- return t.menuEnd && n.push("dropdown-menu-end"), n.join(" ");
993
- }), u = (n) => {
994
- const c = ["dropdown-item"];
995
- return n.active && c.push("active"), n.disabled && c.push("disabled"), c.join(" ");
996
- }, o = (n, c, v) => {
997
- !n.disabled && !n.divider && !n.header && a("item-click", { item: n, index: c, event: v });
1136
+ emits: ["item-click", "show", "shown", "hide", "hidden", "component-error"],
1137
+ setup(e, { expose: v, emit: t }) {
1138
+ const a = e, l = t, s = E(null), o = E(null), r = m(() => a.direction === "up" ? "dropup" : a.direction === "end" ? "dropend" : a.direction === "start" ? "dropstart" : "dropdown"), u = m(() => {
1139
+ const V = ["btn", `btn-${a.variant}`];
1140
+ return a.size && V.push(`btn-${a.size}`), V.join(" ");
1141
+ }), c = m(() => {
1142
+ const V = ["dropdown-menu"];
1143
+ return a.menuEnd && V.push("dropdown-menu-end"), V.join(" ");
1144
+ }), b = (V) => {
1145
+ const q = ["dropdown-item"];
1146
+ return V.active && q.push("active"), V.disabled && q.push("disabled"), q.join(" ");
1147
+ }, g = () => l("show"), C = () => l("shown"), p = () => l("hide"), d = () => l("hidden");
1148
+ Y(async () => {
1149
+ if (s.value)
1150
+ try {
1151
+ const q = (await import("bootstrap")).Dropdown, P = s.value.querySelector(".dropdown-toggle");
1152
+ P && (o.value = new q(P, {
1153
+ autoClose: a.autoClose
1154
+ }), P.addEventListener("show.bs.dropdown", g), P.addEventListener("shown.bs.dropdown", C), P.addEventListener("hide.bs.dropdown", p), P.addEventListener("hidden.bs.dropdown", d));
1155
+ } catch (V) {
1156
+ l("component-error", {
1157
+ message: "Bootstrap JS not loaded. Dropdown will use data attributes only.",
1158
+ componentName: "VibeDropdown",
1159
+ originalError: V
1160
+ });
1161
+ }
1162
+ }), X(() => {
1163
+ const V = s.value?.querySelector(".dropdown-toggle");
1164
+ V && (V.removeEventListener("show.bs.dropdown", g), V.removeEventListener("shown.bs.dropdown", C), V.removeEventListener("hide.bs.dropdown", p), V.removeEventListener("hidden.bs.dropdown", d)), o.value && (o.value.dispose(), o.value = null);
1165
+ });
1166
+ const f = (V, q, P) => {
1167
+ !V.disabled && !V.divider && !V.header && l("item-click", { item: V, index: q, event: P });
998
1168
  };
999
- return (n, c) => (i(), s("div", {
1000
- class: g(l.value)
1169
+ return v({ show: () => o.value?.show(), hide: () => o.value?.hide(), toggle: () => o.value?.toggle() }), (V, q) => (n(), i("div", {
1170
+ ref_key: "dropdownRef",
1171
+ ref: s,
1172
+ class: $(r.value)
1001
1173
  }, [
1002
- h("button", {
1174
+ e.split ? (n(), i(F, { key: 1 }, [
1175
+ S("button", {
1176
+ class: $(u.value),
1177
+ type: "button"
1178
+ }, [
1179
+ N(V.$slots, "button", {}, () => [
1180
+ I(k(e.text), 1)
1181
+ ])
1182
+ ], 2),
1183
+ S("button", {
1184
+ id: e.id,
1185
+ type: "button",
1186
+ class: $([u.value, "dropdown-toggle", "dropdown-toggle-split"]),
1187
+ "data-bs-toggle": "dropdown",
1188
+ "aria-expanded": "false",
1189
+ "data-bs-auto-close": e.autoClose
1190
+ }, [...q[0] || (q[0] = [
1191
+ S("span", { class: "visually-hidden" }, "Toggle Dropdown", -1)
1192
+ ])], 10, Ct)
1193
+ ], 64)) : (n(), i("button", {
1194
+ key: 0,
1003
1195
  id: e.id,
1004
- class: g([r.value, "dropdown-toggle"]),
1196
+ class: $([u.value, "dropdown-toggle"]),
1005
1197
  type: "button",
1006
1198
  "data-bs-toggle": "dropdown",
1007
- "aria-expanded": "false"
1199
+ "aria-expanded": "false",
1200
+ "data-bs-auto-close": e.autoClose
1008
1201
  }, [
1009
- C(n.$slots, "button", {}, () => [
1010
- w(m(e.text), 1)
1202
+ N(V.$slots, "button", {}, () => [
1203
+ I(k(e.text), 1)
1011
1204
  ])
1012
- ], 10, ct),
1013
- h("ul", {
1014
- class: g(d.value),
1205
+ ], 10, Vt)),
1206
+ S("ul", {
1207
+ class: $(c.value),
1015
1208
  "aria-labelledby": e.id
1016
1209
  }, [
1017
- (i(!0), s(M, null, A(e.items, (v, p) => (i(), s(M, { key: p }, [
1018
- v.divider ? (i(), s("li", vt, [...c[0] || (c[0] = [
1019
- h("hr", { class: "dropdown-divider" }, null, -1)
1020
- ])])) : v.header ? (i(), s("li", bt, [
1021
- h("h6", mt, [
1022
- C(n.$slots, "header", {
1023
- item: v,
1024
- index: p
1210
+ (n(!0), i(F, null, H(e.items, (P, R) => (n(), i(F, { key: R }, [
1211
+ P.divider ? (n(), i("li", Bt, [...q[1] || (q[1] = [
1212
+ S("hr", { class: "dropdown-divider" }, null, -1)
1213
+ ])])) : P.header ? (n(), i("li", Lt, [
1214
+ S("h6", Tt, [
1215
+ N(V.$slots, "header", {
1216
+ item: P,
1217
+ index: R
1025
1218
  }, () => [
1026
- w(m(v.text), 1)
1219
+ I(k(P.text), 1)
1027
1220
  ])
1028
1221
  ])
1029
- ])) : (i(), s("li", ht, [
1030
- (i(), q(P(v.href ? "a" : v.to ? "router-link" : "button"), {
1031
- class: g(u(v)),
1032
- href: v.href,
1033
- to: v.to,
1034
- type: !v.href && !v.to ? "button" : void 0,
1035
- disabled: v.disabled,
1036
- onClick: (B) => o(v, p, B)
1222
+ ])) : (n(), i("li", Nt, [
1223
+ (n(), z(A(P.href ? "a" : P.to ? "router-link" : "button"), {
1224
+ class: $(b(P)),
1225
+ href: P.href,
1226
+ to: P.to,
1227
+ type: !P.href && !P.to ? "button" : void 0,
1228
+ disabled: P.disabled,
1229
+ onClick: (Q) => f(P, R, Q)
1037
1230
  }, {
1038
- default: F(() => [
1039
- C(n.$slots, "item", {
1040
- item: v,
1041
- index: p
1231
+ default: j(() => [
1232
+ N(V.$slots, "item", {
1233
+ item: P,
1234
+ index: R
1042
1235
  }, () => [
1043
- w(m(v.text), 1)
1236
+ I(k(P.text), 1)
1044
1237
  ])
1045
1238
  ]),
1046
1239
  _: 2
1047
1240
  }, 1032, ["class", "href", "to", "type", "disabled", "onClick"]))
1048
1241
  ]))
1049
1242
  ], 64))), 128))
1050
- ], 10, ft)
1243
+ ], 10, xt)
1051
1244
  ], 2));
1052
1245
  }
1053
- }), gt = ["id", "aria-labelledby", "aria-hidden", "data-bs-backdrop", "data-bs-keyboard"], pt = { class: "modal-content" }, kt = {
1246
+ }), Mt = ["id", "aria-labelledby", "aria-hidden", "data-bs-backdrop", "data-bs-keyboard"], It = { class: "modal-content" }, Ft = {
1054
1247
  key: 0,
1055
1248
  class: "modal-header"
1056
- }, $t = ["id"], St = { class: "modal-body" }, Vt = {
1249
+ }, Pt = ["id"], Rt = { class: "modal-body" }, qt = {
1057
1250
  key: 1,
1058
1251
  class: "modal-footer"
1059
- }, Ct = /* @__PURE__ */ x({
1252
+ }, zt = /* @__PURE__ */ M({
1060
1253
  __name: "VibeModal",
1061
1254
  props: {
1062
- id: { type: String, required: !0 },
1255
+ id: { type: String, default: () => G("modal") },
1063
1256
  modelValue: { type: Boolean, default: !1 },
1064
1257
  title: { type: String, default: "" },
1065
1258
  size: { type: String, default: void 0 },
@@ -1068,206 +1261,284 @@ const fe = /* @__PURE__ */ x({
1068
1261
  fullscreen: { type: [Boolean, String], default: !1 },
1069
1262
  staticBackdrop: { type: Boolean, default: !1 },
1070
1263
  hideHeader: { type: Boolean, default: !1 },
1071
- hideFooter: { type: Boolean, default: !1 }
1264
+ hideFooter: { type: Boolean, default: !1 },
1265
+ teleport: { type: [String, Boolean], default: "body" }
1072
1266
  },
1073
1267
  emits: ["update:modelValue", "show", "shown", "hide", "hidden", "component-error"],
1074
- setup(e, { emit: f }) {
1075
- const t = e, a = f, l = T(null), r = T(null), d = T(!1), u = y(() => {
1076
- const p = ["modal-dialog"];
1077
- return t.size && p.push(`modal-${t.size}`), t.centered && p.push("modal-dialog-centered"), t.scrollable && p.push("modal-dialog-scrollable"), t.fullscreen === !0 ? p.push("modal-fullscreen") : typeof t.fullscreen == "string" && p.push(`modal-fullscreen-${t.fullscreen}-down`), p.join(" ");
1078
- }), o = () => {
1079
- d.value = !0, a("show");
1080
- }, n = () => {
1081
- a("shown"), a("update:modelValue", !0);
1082
- }, c = () => {
1083
- a("hide");
1084
- }, v = () => {
1085
- d.value = !1, a("hidden"), a("update:modelValue", !1);
1086
- };
1087
- return G(async () => {
1088
- if (l.value)
1268
+ setup(e, { expose: v, emit: t }) {
1269
+ const a = e, l = t, s = E(null), o = E(null), r = E(!1), u = m(() => {
1270
+ const w = ["modal-dialog"];
1271
+ return a.size && w.push(`modal-${a.size}`), a.centered && w.push("modal-dialog-centered"), a.scrollable && w.push("modal-dialog-scrollable"), a.fullscreen === !0 ? w.push("modal-fullscreen") : typeof a.fullscreen == "string" && w.push(`modal-fullscreen-${a.fullscreen}-down`), w.join(" ");
1272
+ }), c = () => {
1273
+ r.value = !0, l("show");
1274
+ }, b = () => {
1275
+ l("shown"), l("update:modelValue", !0);
1276
+ }, g = () => {
1277
+ l("hide");
1278
+ }, C = () => {
1279
+ r.value = !1, l("hidden"), l("update:modelValue", !1);
1280
+ }, p = async () => {
1281
+ if (s.value) {
1282
+ o.value && o.value.dispose();
1089
1283
  try {
1090
- const B = (await import("bootstrap")).Modal;
1091
- r.value = new B(l.value, {
1092
- backdrop: t.staticBackdrop ? "static" : !0,
1093
- keyboard: !t.staticBackdrop
1094
- }), l.value.addEventListener("show.bs.modal", o), l.value.addEventListener("shown.bs.modal", n), l.value.addEventListener("hide.bs.modal", c), l.value.addEventListener("hidden.bs.modal", v), t.modelValue && r.value.show();
1095
- } catch {
1096
- a("component-error", "Bootstrap JS not loaded. Modal will use data attributes only.");
1284
+ const x = (await import("bootstrap")).Modal;
1285
+ o.value = new x(s.value, {
1286
+ backdrop: a.staticBackdrop ? "static" : !0,
1287
+ keyboard: !a.staticBackdrop,
1288
+ focus: !0
1289
+ }), s.value.addEventListener("show.bs.modal", c), s.value.addEventListener("shown.bs.modal", b), s.value.addEventListener("hide.bs.modal", g), s.value.addEventListener("hidden.bs.modal", C), a.modelValue && o.value.show();
1290
+ } catch (w) {
1291
+ l("component-error", {
1292
+ message: "Bootstrap JS not loaded. Modal will use data attributes only.",
1293
+ componentName: "VibeModal",
1294
+ originalError: w
1295
+ });
1097
1296
  }
1098
- }), H(() => {
1099
- l.value && (l.value.removeEventListener("show.bs.modal", o), l.value.removeEventListener("shown.bs.modal", n), l.value.removeEventListener("hide.bs.modal", c), l.value.removeEventListener("hidden.bs.modal", v)), r.value && (r.value.dispose(), r.value = null);
1100
- }), E(() => t.modelValue, (p) => {
1101
- r.value && (p && !d.value ? r.value.show() : !p && d.value && r.value.hide());
1102
- }), (p, B) => (i(), s("div", {
1103
- ref_key: "modalRef",
1104
- ref: l,
1105
- id: e.id,
1106
- class: g(["modal fade", { show: d.value }]),
1107
- style: D(d.value ? { display: "block" } : {}),
1108
- tabindex: "-1",
1109
- "aria-labelledby": `${e.id}-label`,
1110
- "aria-hidden": !d.value,
1111
- "data-bs-backdrop": e.staticBackdrop ? "static" : void 0,
1112
- "data-bs-keyboard": !e.staticBackdrop
1297
+ }
1298
+ };
1299
+ Y(p), X(() => {
1300
+ s.value && (s.value.removeEventListener("show.bs.modal", c), s.value.removeEventListener("shown.bs.modal", b), s.value.removeEventListener("hide.bs.modal", g), s.value.removeEventListener("hidden.bs.modal", C)), o.value && (r.value && o.value.hide(), o.value.dispose(), o.value = null);
1301
+ }), O(() => a.modelValue, (w) => {
1302
+ o.value && (w && !r.value ? o.value.show() : !w && r.value && o.value.hide());
1303
+ }), O(() => a.staticBackdrop, p);
1304
+ const d = () => o.value?.show(), f = () => o.value?.hide();
1305
+ return v({ show: d, hide: f, handleUpdate: () => o.value?.handleUpdate(), bsInstance: o }), (w, x) => (n(), z(ie, {
1306
+ to: e.teleport === !0 ? "body" : e.teleport || void 0,
1307
+ disabled: !e.teleport
1113
1308
  }, [
1114
- h("div", {
1115
- class: g(u.value)
1309
+ S("div", {
1310
+ ref_key: "modalRef",
1311
+ ref: s,
1312
+ id: e.id,
1313
+ class: $(["modal fade", { show: r.value }]),
1314
+ tabindex: "-1",
1315
+ "aria-labelledby": `${e.id}-label`,
1316
+ "aria-hidden": !r.value,
1317
+ "data-bs-backdrop": e.staticBackdrop ? "static" : void 0,
1318
+ "data-bs-keyboard": !e.staticBackdrop
1116
1319
  }, [
1117
- h("div", pt, [
1118
- e.hideHeader ? b("", !0) : (i(), s("div", kt, [
1119
- h("h5", {
1120
- id: `${e.id}-label`,
1121
- class: "modal-title"
1122
- }, [
1123
- C(p.$slots, "header", {}, () => [
1124
- w(m(e.title), 1)
1125
- ])
1126
- ], 8, $t),
1127
- B[0] || (B[0] = h("button", {
1128
- type: "button",
1129
- class: "btn-close",
1130
- "data-bs-dismiss": "modal",
1131
- "aria-label": "Close"
1132
- }, null, -1))
1133
- ])),
1134
- h("div", St, [
1135
- C(p.$slots, "default")
1136
- ]),
1137
- e.hideFooter ? b("", !0) : (i(), s("div", Vt, [
1138
- C(p.$slots, "footer", {}, () => [
1139
- B[1] || (B[1] = h("button", {
1320
+ S("div", {
1321
+ class: $(u.value)
1322
+ }, [
1323
+ S("div", It, [
1324
+ e.hideHeader ? y("", !0) : (n(), i("div", Ft, [
1325
+ S("h5", {
1326
+ id: `${e.id}-label`,
1327
+ class: "modal-title"
1328
+ }, [
1329
+ N(w.$slots, "header", {}, () => [
1330
+ I(k(e.title), 1)
1331
+ ])
1332
+ ], 8, Pt),
1333
+ S("button", {
1140
1334
  type: "button",
1141
- class: "btn btn-secondary",
1142
- "data-bs-dismiss": "modal"
1143
- }, "Close", -1))
1144
- ])
1145
- ]))
1146
- ])
1147
- ], 2)
1148
- ], 14, gt));
1335
+ class: "btn-close",
1336
+ "aria-label": "Close",
1337
+ onClick: f
1338
+ })
1339
+ ])),
1340
+ S("div", Rt, [
1341
+ N(w.$slots, "default")
1342
+ ]),
1343
+ e.hideFooter ? y("", !0) : (n(), i("div", qt, [
1344
+ N(w.$slots, "footer", {}, () => [
1345
+ S("button", {
1346
+ type: "button",
1347
+ class: "btn btn-secondary",
1348
+ onClick: f
1349
+ }, "Close")
1350
+ ])
1351
+ ]))
1352
+ ])
1353
+ ], 2)
1354
+ ], 10, Mt)
1355
+ ], 8, ["to", "disabled"]));
1149
1356
  }
1150
- }), xt = ["id", "aria-labelledby", "data-bs-backdrop", "data-bs-scroll"], wt = { class: "offcanvas-header" }, Bt = ["id"], Nt = { class: "offcanvas-body" }, Tt = /* @__PURE__ */ x({
1357
+ }), At = ["id", "aria-labelledby", "data-bs-backdrop", "data-bs-scroll"], jt = { class: "offcanvas-header" }, Ot = ["id"], Ht = { class: "offcanvas-body" }, Dt = /* @__PURE__ */ M({
1151
1358
  __name: "VibeOffcanvas",
1152
1359
  props: {
1153
- id: { type: String, required: !0 },
1360
+ id: { type: String, default: () => G("offcanvas") },
1154
1361
  modelValue: { type: Boolean, default: !1 },
1155
1362
  title: { type: String, default: "" },
1156
1363
  placement: { type: String, default: "start" },
1157
1364
  backdrop: { type: [Boolean, String], default: !0 },
1158
- scroll: { type: Boolean, default: !1 }
1365
+ scroll: { type: Boolean, default: !1 },
1366
+ teleport: { type: [String, Boolean], default: "body" }
1159
1367
  },
1160
1368
  emits: ["update:modelValue", "show", "shown", "hide", "hidden", "component-error"],
1161
- setup(e, { emit: f }) {
1162
- const t = e, a = y(() => `offcanvas offcanvas-${t.placement}`);
1163
- return (l, r) => (i(), s("div", {
1164
- id: e.id,
1165
- class: g(a.value),
1166
- tabindex: "-1",
1167
- "aria-labelledby": `${e.id}-label`,
1168
- "data-bs-backdrop": e.backdrop === !1 ? "false" : e.backdrop === "static" ? "static" : "true",
1169
- "data-bs-scroll": e.scroll
1369
+ setup(e, { expose: v, emit: t }) {
1370
+ const a = e, l = t, s = E(null), o = E(null), r = E(!1), u = m(() => `offcanvas offcanvas-${a.placement}`), c = () => {
1371
+ r.value = !0, l("show");
1372
+ }, b = () => {
1373
+ l("shown"), l("update:modelValue", !0);
1374
+ }, g = () => {
1375
+ l("hide");
1376
+ }, C = () => {
1377
+ r.value = !1, l("hidden"), l("update:modelValue", !1);
1378
+ }, p = async () => {
1379
+ if (s.value) {
1380
+ o.value && o.value.dispose();
1381
+ try {
1382
+ const w = (await import("bootstrap")).Offcanvas;
1383
+ o.value = new w(s.value, {
1384
+ backdrop: a.backdrop === !1 ? !1 : a.backdrop === "static" ? "static" : !0,
1385
+ scroll: a.scroll,
1386
+ keyboard: a.backdrop !== "static"
1387
+ }), s.value.addEventListener("show.bs.offcanvas", c), s.value.addEventListener("shown.bs.offcanvas", b), s.value.addEventListener("hide.bs.offcanvas", g), s.value.addEventListener("hidden.bs.offcanvas", C), a.modelValue && o.value.show();
1388
+ } catch (h) {
1389
+ l("component-error", {
1390
+ message: "Bootstrap JS not loaded. Offcanvas will use data attributes only.",
1391
+ componentName: "VibeOffcanvas",
1392
+ originalError: h
1393
+ });
1394
+ }
1395
+ }
1396
+ };
1397
+ Y(p), X(() => {
1398
+ s.value && (s.value.removeEventListener("show.bs.offcanvas", c), s.value.removeEventListener("shown.bs.offcanvas", b), s.value.removeEventListener("hide.bs.offcanvas", g), s.value.removeEventListener("hidden.bs.offcanvas", C)), o.value && (r.value && o.value.hide(), o.value.dispose(), o.value = null);
1399
+ }), O(() => a.modelValue, (h) => {
1400
+ o.value && (h && !r.value ? o.value.show() : !h && r.value && o.value.hide());
1401
+ }), O([() => a.placement, () => a.backdrop, () => a.scroll], p);
1402
+ const d = () => o.value?.show(), f = () => o.value?.hide();
1403
+ return v({ show: d, hide: f, bsInstance: o }), (h, w) => (n(), z(ie, {
1404
+ to: e.teleport === !0 ? "body" : e.teleport || void 0,
1405
+ disabled: !e.teleport
1170
1406
  }, [
1171
- h("div", wt, [
1172
- h("h5", {
1173
- id: `${e.id}-label`,
1174
- class: "offcanvas-title"
1175
- }, [
1176
- C(l.$slots, "header", {}, () => [
1177
- w(m(e.title), 1)
1178
- ])
1179
- ], 8, Bt),
1180
- r[0] || (r[0] = h("button", {
1181
- type: "button",
1182
- class: "btn-close",
1183
- "data-bs-dismiss": "offcanvas",
1184
- "aria-label": "Close"
1185
- }, null, -1))
1186
- ]),
1187
- h("div", Nt, [
1188
- C(l.$slots, "default")
1189
- ])
1190
- ], 10, xt));
1407
+ S("div", {
1408
+ ref_key: "offcanvasRef",
1409
+ ref: s,
1410
+ id: e.id,
1411
+ class: $(u.value),
1412
+ tabindex: "-1",
1413
+ "aria-labelledby": `${e.id}-label`,
1414
+ "data-bs-backdrop": e.backdrop === !1 ? "false" : e.backdrop === "static" ? "static" : "true",
1415
+ "data-bs-scroll": e.scroll
1416
+ }, [
1417
+ S("div", jt, [
1418
+ S("h5", {
1419
+ id: `${e.id}-label`,
1420
+ class: "offcanvas-title"
1421
+ }, [
1422
+ N(h.$slots, "header", {}, () => [
1423
+ I(k(e.title), 1)
1424
+ ])
1425
+ ], 8, Ot),
1426
+ S("button", {
1427
+ type: "button",
1428
+ class: "btn-close",
1429
+ "aria-label": "Close",
1430
+ onClick: f
1431
+ })
1432
+ ]),
1433
+ S("div", Ht, [
1434
+ N(h.$slots, "default")
1435
+ ])
1436
+ ], 10, At)
1437
+ ], 8, ["to", "disabled"]));
1191
1438
  }
1192
- }), Mt = ["id", "data-bs-autohide", "data-bs-delay"], qt = {
1439
+ }), Gt = ["id", "data-bs-autohide", "data-bs-delay"], Xt = {
1193
1440
  key: 0,
1194
1441
  class: "toast-header"
1195
- }, Pt = { class: "me-auto" }, Ft = { class: "toast-body" }, Lt = /* @__PURE__ */ x({
1442
+ }, Yt = { class: "me-auto" }, Ut = { class: "toast-body" }, Jt = /* @__PURE__ */ M({
1196
1443
  __name: "VibeToast",
1197
1444
  props: {
1198
- id: { type: String, default: void 0 },
1445
+ id: { type: String, default: () => G("toast") },
1199
1446
  modelValue: { type: Boolean, default: !1 },
1200
1447
  title: { type: String, default: "" },
1201
1448
  variant: { type: String, default: void 0 },
1202
1449
  autohide: { type: Boolean, default: !0 },
1203
- delay: { type: Number, default: 5e3 }
1450
+ delay: { type: Number, default: 5e3 },
1451
+ teleport: { type: [String, Boolean], default: "body" },
1452
+ placement: { type: String, default: "top-end" }
1204
1453
  },
1205
1454
  emits: ["update:modelValue", "show", "shown", "hide", "hidden", "component-error"],
1206
- setup(e, { emit: f }) {
1207
- const t = e, a = f, l = T(null), r = T(null), d = T(!1), u = y(() => {
1208
- const p = ["toast"];
1209
- return t.variant && p.push(`text-bg-${t.variant}`), p.join(" ");
1210
- }), o = () => {
1211
- d.value = !0, a("show");
1212
- }, n = () => {
1213
- a("shown"), a("update:modelValue", !0);
1214
- }, c = () => {
1215
- a("hide");
1216
- }, v = () => {
1217
- d.value = !1, a("hidden"), a("update:modelValue", !1);
1218
- };
1219
- return G(async () => {
1220
- if (l.value)
1455
+ setup(e, { expose: v, emit: t }) {
1456
+ const a = e, l = t, s = E(null), o = E(null), r = E(!1), u = m(() => {
1457
+ const w = ["toast"];
1458
+ return a.variant && w.push(`text-bg-${a.variant}`), w.join(" ");
1459
+ }), c = m(() => {
1460
+ const w = ["toast-container", "position-fixed", "p-3"], x = a.placement;
1461
+ return x.includes("top") && w.push("top-0"), x.includes("bottom") && w.push("bottom-0"), x.includes("middle") && w.push("top-50", "start-50", "translate-middle"), x.includes("start") && w.push("start-0"), x.includes("end") && w.push("end-0"), x.includes("center") && !x.includes("middle") && w.push("start-50", "translate-middle-x"), w.join(" ");
1462
+ }), b = () => {
1463
+ r.value = !0, l("show");
1464
+ }, g = () => {
1465
+ l("shown"), l("update:modelValue", !0);
1466
+ }, C = () => {
1467
+ l("hide");
1468
+ }, p = () => {
1469
+ r.value = !1, l("hidden"), l("update:modelValue", !1);
1470
+ }, d = async () => {
1471
+ if (s.value) {
1472
+ o.value && o.value.dispose();
1221
1473
  try {
1222
- const B = (await import("bootstrap")).Toast;
1223
- r.value = new B(l.value, {
1224
- autohide: t.autohide,
1225
- delay: t.delay
1226
- }), l.value.addEventListener("show.bs.toast", o), l.value.addEventListener("shown.bs.toast", n), l.value.addEventListener("hide.bs.toast", c), l.value.addEventListener("hidden.bs.toast", v), t.modelValue && r.value.show();
1227
- } catch {
1228
- a("component-error", "Bootstrap JS not loaded. Toast will use data attributes only.");
1474
+ const x = (await import("bootstrap")).Toast;
1475
+ o.value = new x(s.value, {
1476
+ autohide: a.autohide,
1477
+ delay: a.delay
1478
+ }), s.value.addEventListener("show.bs.toast", b), s.value.addEventListener("shown.bs.toast", g), s.value.addEventListener("hide.bs.toast", C), s.value.addEventListener("hidden.bs.toast", p), a.modelValue && o.value.show();
1479
+ } catch (w) {
1480
+ l("component-error", {
1481
+ message: "Bootstrap JS not loaded. Toast will use data attributes only.",
1482
+ componentName: "VibeToast",
1483
+ originalError: w
1484
+ });
1229
1485
  }
1230
- }), H(() => {
1231
- l.value && (l.value.removeEventListener("show.bs.toast", o), l.value.removeEventListener("shown.bs.toast", n), l.value.removeEventListener("hide.bs.toast", c), l.value.removeEventListener("hidden.bs.toast", v)), r.value && (r.value.dispose(), r.value = null);
1232
- }), E(() => t.modelValue, (p) => {
1233
- r.value && (p && !d.value ? r.value.show() : !p && d.value && r.value.hide());
1234
- }), (p, B) => (i(), s("div", {
1235
- ref_key: "toastRef",
1236
- ref: l,
1237
- id: e.id,
1238
- class: g(u.value),
1239
- role: "alert",
1240
- "aria-live": "assertive",
1241
- "aria-atomic": "true",
1242
- "data-bs-autohide": e.autohide,
1243
- "data-bs-delay": e.delay
1486
+ }
1487
+ };
1488
+ Y(d), X(() => {
1489
+ s.value && (s.value.removeEventListener("show.bs.toast", b), s.value.removeEventListener("shown.bs.toast", g), s.value.removeEventListener("hide.bs.toast", C), s.value.removeEventListener("hidden.bs.toast", p)), o.value && (o.value.dispose(), o.value = null);
1490
+ }), O(() => a.modelValue, (w) => {
1491
+ o.value && (w && !r.value ? o.value.show() : !w && r.value && o.value.hide());
1492
+ }), O([() => a.autohide, () => a.delay], d);
1493
+ const f = () => o.value?.show(), h = () => o.value?.hide();
1494
+ return v({ show: f, hide: h, bsInstance: o }), (w, x) => (n(), z(ie, {
1495
+ to: e.teleport === !0 ? "body" : e.teleport || void 0,
1496
+ disabled: !e.teleport
1244
1497
  }, [
1245
- e.title || p.$slots.header ? (i(), s("div", qt, [
1246
- C(p.$slots, "header", {}, () => [
1247
- h("strong", Pt, m(e.title), 1)
1248
- ]),
1249
- B[0] || (B[0] = h("button", {
1250
- type: "button",
1251
- class: "btn-close",
1252
- "data-bs-dismiss": "toast",
1253
- "aria-label": "Close"
1254
- }, null, -1))
1255
- ])) : b("", !0),
1256
- h("div", Ft, [
1257
- C(p.$slots, "default")
1258
- ])
1259
- ], 10, Mt));
1498
+ S("div", {
1499
+ class: $(c.value),
1500
+ style: { "z-index": "1090" }
1501
+ }, [
1502
+ S("div", {
1503
+ ref_key: "toastRef",
1504
+ ref: s,
1505
+ id: e.id,
1506
+ class: $(u.value),
1507
+ role: "alert",
1508
+ "aria-live": "assertive",
1509
+ "aria-atomic": "true",
1510
+ "data-bs-autohide": e.autohide,
1511
+ "data-bs-delay": e.delay
1512
+ }, [
1513
+ e.title || w.$slots.header ? (n(), i("div", Xt, [
1514
+ N(w.$slots, "header", {}, () => [
1515
+ S("strong", Yt, k(e.title), 1)
1516
+ ]),
1517
+ S("button", {
1518
+ type: "button",
1519
+ class: "btn-close",
1520
+ "aria-label": "Close",
1521
+ onClick: h
1522
+ })
1523
+ ])) : y("", !0),
1524
+ S("div", Ut, [
1525
+ N(w.$slots, "default")
1526
+ ])
1527
+ ], 10, Gt)
1528
+ ], 2)
1529
+ ], 8, ["to", "disabled"]));
1260
1530
  }
1261
- }), zt = ["id", "data-bs-ride", "data-bs-interval", "data-bs-keyboard", "data-bs-pause", "data-bs-wrap", "data-bs-touch"], jt = {
1531
+ }), Kt = ["id", "data-bs-ride", "data-bs-interval", "data-bs-keyboard", "data-bs-pause", "data-bs-wrap", "data-bs-touch"], Qt = {
1262
1532
  key: 0,
1263
1533
  class: "carousel-indicators"
1264
- }, At = ["data-bs-target", "data-bs-slide-to", "aria-current", "aria-label"], It = { class: "carousel-inner" }, Ot = ["data-bs-interval"], Dt = ["src", "alt"], Et = {
1534
+ }, Wt = ["data-bs-target", "data-bs-slide-to", "aria-current", "aria-label"], Zt = { class: "carousel-inner" }, _t = ["data-bs-interval"], ea = ["src", "alt"], ta = {
1265
1535
  key: 0,
1266
1536
  class: "carousel-caption d-none d-md-block"
1267
- }, Rt = { key: 0 }, Xt = { key: 1 }, Yt = ["data-bs-target"], Gt = ["data-bs-target"], Ht = /* @__PURE__ */ x({
1537
+ }, aa = { key: 0 }, la = { key: 1 }, oa = ["data-bs-target"], sa = ["data-bs-target"], na = /* @__PURE__ */ M({
1268
1538
  __name: "VibeCarousel",
1269
1539
  props: {
1270
- id: { type: String, required: !0 },
1540
+ id: { type: String, default: () => G("carousel") },
1541
+ modelValue: { type: Number, default: 0 },
1271
1542
  controls: { type: Boolean, default: !0 },
1272
1543
  indicators: { type: Boolean, default: !0 },
1273
1544
  ride: { type: [Boolean, String], default: !1 },
@@ -1280,16 +1551,50 @@ const fe = /* @__PURE__ */ x({
1280
1551
  fade: { type: Boolean, default: !1 },
1281
1552
  items: { type: Array, required: !0 }
1282
1553
  },
1283
- emits: ["slide", "slid", "component-error"],
1284
- setup(e, { emit: f }) {
1285
- const t = e, a = y(() => {
1286
- const r = ["carousel", "slide"];
1287
- return t.dark && r.push("carousel-dark"), t.fade && r.push("carousel-fade"), r.join(" ");
1288
- }), l = (r, d) => r.alt ? r.alt : r.caption ? r.caption : r.captionText ? r.captionText : `Carousel slide ${d + 1}`;
1289
- return G(() => {
1290
- }), (r, d) => (i(), s("div", {
1554
+ emits: ["update:modelValue", "slide", "slid", "component-error"],
1555
+ setup(e, { expose: v, emit: t }) {
1556
+ const a = e, l = t, s = E(null), o = E(null), r = E(a.modelValue), u = m(() => {
1557
+ const p = ["carousel", "slide"];
1558
+ return a.dark && p.push("carousel-dark"), a.fade && p.push("carousel-fade"), p.join(" ");
1559
+ }), c = (p) => {
1560
+ l("slide", p);
1561
+ }, b = (p) => {
1562
+ r.value = p.to, l("update:modelValue", p.to), l("slid", p);
1563
+ }, g = async () => {
1564
+ if (s.value) {
1565
+ o.value && o.value.dispose();
1566
+ try {
1567
+ const d = (await import("bootstrap")).Carousel;
1568
+ o.value = new d(s.value, {
1569
+ interval: a.interval,
1570
+ keyboard: a.keyboard,
1571
+ pause: a.pause,
1572
+ ride: a.ride === !0 ? "carousel" : a.ride,
1573
+ wrap: a.wrap,
1574
+ touch: a.touch
1575
+ }), s.value.addEventListener("slide.bs.carousel", c), s.value.addEventListener("slid.bs.carousel", b), a.modelValue !== 0 && o.value.to(a.modelValue);
1576
+ } catch (p) {
1577
+ l("component-error", {
1578
+ message: "Bootstrap JS not loaded. Carousel will use data attributes only.",
1579
+ componentName: "VibeCarousel",
1580
+ originalError: p
1581
+ });
1582
+ }
1583
+ }
1584
+ };
1585
+ Y(g), X(() => {
1586
+ s.value && (s.value.removeEventListener("slide.bs.carousel", c), s.value.removeEventListener("slid.bs.carousel", b)), o.value && (o.value.dispose(), o.value = null);
1587
+ }), O(() => a.modelValue, (p) => {
1588
+ o.value && p !== r.value && o.value.to(p);
1589
+ }), O(() => a.items, async () => {
1590
+ await ne(), await g();
1591
+ }, { deep: !0 });
1592
+ const C = (p, d) => p.alt ? p.alt : p.caption ? p.caption : p.captionText ? p.captionText : `Carousel slide ${d + 1}`;
1593
+ return v({ bsInstance: o, refresh: g }), (p, d) => (n(), i("div", {
1594
+ ref_key: "carouselRef",
1595
+ ref: s,
1291
1596
  id: e.id,
1292
- class: g(a.value),
1597
+ class: $(u.value),
1293
1598
  "data-bs-ride": e.ride === !0 ? "carousel" : e.ride,
1294
1599
  "data-bs-interval": e.interval,
1295
1600
  "data-bs-keyboard": e.keyboard,
@@ -1297,110 +1602,168 @@ const fe = /* @__PURE__ */ x({
1297
1602
  "data-bs-wrap": e.wrap,
1298
1603
  "data-bs-touch": e.touch
1299
1604
  }, [
1300
- e.indicators ? (i(), s("div", jt, [
1301
- (i(!0), s(M, null, A(e.items, (u, o) => (i(), s("button", {
1302
- key: `indicator-${u.src}-${o}`,
1605
+ e.indicators ? (n(), i("div", Qt, [
1606
+ (n(!0), i(F, null, H(e.items, (f, h) => (n(), i("button", {
1607
+ key: `indicator-${h}`,
1303
1608
  type: "button",
1304
1609
  "data-bs-target": `#${e.id}`,
1305
- "data-bs-slide-to": o,
1306
- class: g({ active: u.active || o === 0 }),
1307
- "aria-current": u.active || o === 0,
1308
- "aria-label": `Slide ${o + 1}`
1309
- }, null, 10, At))), 128))
1310
- ])) : b("", !0),
1311
- h("div", It, [
1312
- (i(!0), s(M, null, A(e.items, (u, o) => (i(), s("div", {
1313
- key: `slide-${u.src}-${o}`,
1314
- class: g(["carousel-item", { active: u.active || o === 0 }]),
1315
- "data-bs-interval": u.interval
1610
+ "data-bs-slide-to": h,
1611
+ class: $({ active: h === r.value }),
1612
+ "aria-current": h === r.value,
1613
+ "aria-label": `Slide ${h + 1}`
1614
+ }, null, 10, Wt))), 128))
1615
+ ])) : y("", !0),
1616
+ S("div", Zt, [
1617
+ (n(!0), i(F, null, H(e.items, (f, h) => (n(), i("div", {
1618
+ key: `slide-${h}`,
1619
+ class: $(["carousel-item", { active: h === r.value }]),
1620
+ "data-bs-interval": f.interval
1316
1621
  }, [
1317
- h("img", {
1318
- src: u.src,
1319
- alt: l(u, o),
1622
+ S("img", {
1623
+ src: f.src,
1624
+ alt: C(f, h),
1320
1625
  class: "d-block w-100"
1321
- }, null, 8, Dt),
1322
- u.caption || u.captionText || r.$slots.caption ? (i(), s("div", Et, [
1323
- C(r.$slots, "caption", {
1324
- item: u,
1325
- index: o
1626
+ }, null, 8, ea),
1627
+ f.caption || f.captionText || p.$slots.caption ? (n(), i("div", ta, [
1628
+ N(p.$slots, "caption", {
1629
+ item: f,
1630
+ index: h
1326
1631
  }, () => [
1327
- u.caption ? (i(), s("h5", Rt, m(u.caption), 1)) : b("", !0),
1328
- u.captionText ? (i(), s("p", Xt, m(u.captionText), 1)) : b("", !0)
1632
+ f.caption ? (n(), i("h5", aa, k(f.caption), 1)) : y("", !0),
1633
+ f.captionText ? (n(), i("p", la, k(f.captionText), 1)) : y("", !0)
1329
1634
  ])
1330
- ])) : b("", !0)
1331
- ], 10, Ot))), 128))
1635
+ ])) : y("", !0)
1636
+ ], 10, _t))), 128))
1332
1637
  ]),
1333
- e.controls ? (i(), s("button", {
1334
- key: 1,
1335
- class: "carousel-control-prev",
1336
- type: "button",
1337
- "data-bs-target": `#${e.id}`,
1338
- "data-bs-slide": "prev"
1339
- }, [...d[0] || (d[0] = [
1340
- h("span", {
1341
- class: "carousel-control-prev-icon",
1342
- "aria-hidden": "true"
1343
- }, null, -1),
1344
- h("span", { class: "visually-hidden" }, "Previous", -1)
1345
- ])], 8, Yt)) : b("", !0),
1346
- e.controls ? (i(), s("button", {
1347
- key: 2,
1348
- class: "carousel-control-next",
1349
- type: "button",
1350
- "data-bs-target": `#${e.id}`,
1351
- "data-bs-slide": "next"
1352
- }, [...d[1] || (d[1] = [
1353
- h("span", {
1354
- class: "carousel-control-next-icon",
1355
- "aria-hidden": "true"
1356
- }, null, -1),
1357
- h("span", { class: "visually-hidden" }, "Next", -1)
1358
- ])], 8, Gt)) : b("", !0)
1359
- ], 10, zt));
1638
+ e.controls ? (n(), i(F, { key: 1 }, [
1639
+ S("button", {
1640
+ class: "carousel-control-prev",
1641
+ type: "button",
1642
+ "data-bs-target": `#${e.id}`,
1643
+ "data-bs-slide": "prev"
1644
+ }, [...d[0] || (d[0] = [
1645
+ S("span", {
1646
+ class: "carousel-control-prev-icon",
1647
+ "aria-hidden": "true"
1648
+ }, null, -1),
1649
+ S("span", { class: "visually-hidden" }, "Previous", -1)
1650
+ ])], 8, oa),
1651
+ S("button", {
1652
+ class: "carousel-control-next",
1653
+ type: "button",
1654
+ "data-bs-target": `#${e.id}`,
1655
+ "data-bs-slide": "next"
1656
+ }, [...d[1] || (d[1] = [
1657
+ S("span", {
1658
+ class: "carousel-control-next-icon",
1659
+ "aria-hidden": "true"
1660
+ }, null, -1),
1661
+ S("span", { class: "visually-hidden" }, "Next", -1)
1662
+ ])], 8, sa)
1663
+ ], 64)) : y("", !0)
1664
+ ], 10, Kt));
1360
1665
  }
1361
- }), Kt = ["data-bs-placement", "data-bs-title", "data-bs-trigger", "data-bs-html"], Ut = /* @__PURE__ */ x({
1666
+ }), ia = ["data-bs-placement", "data-bs-title", "data-bs-trigger", "data-bs-html"], ra = /* @__PURE__ */ M({
1362
1667
  __name: "VibeTooltip",
1363
1668
  props: {
1364
- content: { type: String, required: !0 },
1669
+ content: { type: String, default: void 0 },
1670
+ text: { type: String, default: void 0 },
1365
1671
  placement: { type: String, default: "top" },
1366
1672
  trigger: { type: String, default: "hover focus" },
1367
1673
  html: { type: Boolean, default: !1 }
1368
1674
  },
1369
1675
  emits: ["component-error"],
1370
- setup(e, { emit: f }) {
1371
- return (t, a) => (i(), s("span", {
1676
+ setup(e, { expose: v, emit: t }) {
1677
+ const a = e, l = t, s = E(null), o = E(null), r = async () => {
1678
+ if (s.value) {
1679
+ o.value && o.value.dispose();
1680
+ try {
1681
+ const c = (await import("bootstrap")).Tooltip;
1682
+ o.value = new c(s.value, {
1683
+ title: a.text || a.content || "",
1684
+ placement: a.placement,
1685
+ trigger: a.trigger,
1686
+ html: a.html
1687
+ });
1688
+ } catch (u) {
1689
+ l("component-error", {
1690
+ message: "Bootstrap JS not loaded. Tooltip will use data attributes only.",
1691
+ componentName: "VibeTooltip",
1692
+ originalError: u
1693
+ });
1694
+ }
1695
+ }
1696
+ };
1697
+ return Y(r), X(() => {
1698
+ o.value && (o.value.dispose(), o.value = null);
1699
+ }), O([() => a.content, () => a.text], () => {
1700
+ o.value && o.value.setContent({ ".tooltip-inner": a.text || a.content || "" });
1701
+ }), O([() => a.placement, () => a.trigger, () => a.html], r), v({ bsInstance: o }), (u, c) => (n(), i("span", {
1702
+ ref_key: "tooltipRef",
1703
+ ref: s,
1372
1704
  "data-bs-toggle": "tooltip",
1373
1705
  "data-bs-placement": e.placement,
1374
- "data-bs-title": e.content,
1706
+ "data-bs-title": e.text || e.content,
1375
1707
  "data-bs-trigger": e.trigger,
1376
1708
  "data-bs-html": e.html
1377
1709
  }, [
1378
- C(t.$slots, "default")
1379
- ], 8, Kt));
1710
+ N(u.$slots, "default")
1711
+ ], 8, ia));
1380
1712
  }
1381
- }), Qt = ["data-bs-placement", "data-bs-title", "data-bs-content", "data-bs-trigger", "data-bs-html"], Wt = /* @__PURE__ */ x({
1713
+ }), da = ["data-bs-placement", "data-bs-title", "data-bs-content", "data-bs-trigger", "data-bs-html"], ua = /* @__PURE__ */ M({
1382
1714
  __name: "VibePopover",
1383
1715
  props: {
1384
1716
  title: { type: String, default: void 0 },
1385
- content: { type: String, required: !0 },
1717
+ content: { type: String, default: void 0 },
1718
+ text: { type: String, default: void 0 },
1386
1719
  placement: { type: String, default: "top" },
1387
1720
  trigger: { type: String, default: "click" },
1388
1721
  html: { type: Boolean, default: !1 }
1389
1722
  },
1390
1723
  emits: ["component-error"],
1391
- setup(e, { emit: f }) {
1392
- return (t, a) => (i(), s("span", {
1724
+ setup(e, { expose: v, emit: t }) {
1725
+ const a = e, l = t, s = E(null), o = E(null), r = async () => {
1726
+ if (s.value) {
1727
+ o.value && o.value.dispose();
1728
+ try {
1729
+ const c = (await import("bootstrap")).Popover;
1730
+ o.value = new c(s.value, {
1731
+ title: a.title,
1732
+ content: a.text || a.content || "",
1733
+ placement: a.placement,
1734
+ trigger: a.trigger,
1735
+ html: a.html
1736
+ });
1737
+ } catch (u) {
1738
+ l("component-error", {
1739
+ message: "Bootstrap JS not loaded. Popover will use data attributes only.",
1740
+ componentName: "VibePopover",
1741
+ originalError: u
1742
+ });
1743
+ }
1744
+ }
1745
+ };
1746
+ return Y(r), X(() => {
1747
+ o.value && (o.value.dispose(), o.value = null);
1748
+ }), O([() => a.content, () => a.text, () => a.title], () => {
1749
+ o.value && o.value.setContent({
1750
+ ".popover-header": a.title || "",
1751
+ ".popover-body": a.text || a.content || ""
1752
+ });
1753
+ }), O([() => a.placement, () => a.trigger, () => a.html], r), v({ bsInstance: o }), (u, c) => (n(), i("span", {
1754
+ ref_key: "popoverRef",
1755
+ ref: s,
1393
1756
  "data-bs-toggle": "popover",
1394
1757
  "data-bs-placement": e.placement,
1395
1758
  "data-bs-title": e.title,
1396
- "data-bs-content": e.content,
1759
+ "data-bs-content": e.text || e.content,
1397
1760
  "data-bs-trigger": e.trigger,
1398
1761
  "data-bs-html": e.html
1399
1762
  }, [
1400
- C(t.$slots, "default")
1401
- ], 8, Qt));
1763
+ N(u.$slots, "default")
1764
+ ], 8, da));
1402
1765
  }
1403
- }), Jt = /* @__PURE__ */ x({
1766
+ }), ca = /* @__PURE__ */ M({
1404
1767
  __name: "VibeScrollspy",
1405
1768
  props: {
1406
1769
  target: { type: String, required: !0 },
@@ -1410,22 +1773,49 @@ const fe = /* @__PURE__ */ x({
1410
1773
  tag: { type: String, default: "div" }
1411
1774
  },
1412
1775
  emits: ["activate", "component-error"],
1413
- setup(e, { emit: f }) {
1414
- return (t, a) => (i(), q(P(e.tag), {
1776
+ setup(e, { expose: v, emit: t }) {
1777
+ const a = e, l = t, s = E(null), o = E(null), r = (c) => {
1778
+ l("activate", c);
1779
+ };
1780
+ return Y(async () => {
1781
+ if (s.value)
1782
+ try {
1783
+ const b = (await import("bootstrap")).ScrollSpy;
1784
+ o.value = new b(s.value, {
1785
+ target: a.target,
1786
+ offset: a.offset,
1787
+ method: a.method,
1788
+ smoothScroll: a.smoothScroll
1789
+ }), s.value.addEventListener("activate.bs.scrollspy", r);
1790
+ } catch (c) {
1791
+ l("component-error", {
1792
+ message: "Bootstrap JS not loaded. ScrollSpy will use data attributes only.",
1793
+ componentName: "VibeScrollspy",
1794
+ originalError: c
1795
+ });
1796
+ }
1797
+ }), X(() => {
1798
+ s.value && s.value.removeEventListener("activate.bs.scrollspy", r), o.value && (o.value.dispose(), o.value = null);
1799
+ }), v({ refresh: () => {
1800
+ o.value && o.value.refresh();
1801
+ } }), (c, b) => (n(), z(A(e.tag), {
1802
+ ref_key: "scrollspyRef",
1803
+ ref: s,
1415
1804
  "data-bs-spy": "scroll",
1416
1805
  "data-bs-target": e.target,
1417
1806
  "data-bs-offset": e.offset,
1418
1807
  "data-bs-method": e.method,
1419
1808
  "data-bs-smooth-scroll": e.smoothScroll,
1420
- tabindex: "0"
1809
+ tabindex: "0",
1810
+ style: { position: "relative", height: "100%", overflow: "auto" }
1421
1811
  }, {
1422
- default: F(() => [
1423
- C(t.$slots, "default")
1812
+ default: j(() => [
1813
+ N(c.$slots, "default")
1424
1814
  ]),
1425
1815
  _: 3
1426
1816
  }, 8, ["data-bs-target", "data-bs-offset", "data-bs-method", "data-bs-smooth-scroll"]));
1427
1817
  }
1428
- }), Zt = /* @__PURE__ */ x({
1818
+ }), va = /* @__PURE__ */ M({
1429
1819
  __name: "VibeIcon",
1430
1820
  props: {
1431
1821
  // Icon name (e.g., 'house', 'heart-fill', 'star')
@@ -1444,67 +1834,67 @@ const fe = /* @__PURE__ */ x({
1444
1834
  rotate: { type: Number, default: void 0 }
1445
1835
  },
1446
1836
  emits: ["click", "component-error"],
1447
- setup(e, { emit: f }) {
1448
- const t = e, a = f, l = y(() => {
1449
- const u = ["bi", `bi-${t.icon}`];
1450
- return t.size && (["1x", "2x", "3x", "4x", "5x"].includes(t.size) || u.push(`bi-${t.size}`)), t.customClass && u.push(t.customClass), u.join(" ");
1451
- }), r = y(() => {
1452
- const u = {};
1837
+ setup(e, { emit: v }) {
1838
+ const t = e, a = v, l = m(() => {
1839
+ const r = ["bi", `bi-${t.icon}`];
1840
+ return t.size && (["1x", "2x", "3x", "4x", "5x"].includes(t.size) || r.push(`bi-${t.size}`)), t.customClass && r.push(t.customClass), r.join(" ");
1841
+ }), s = m(() => {
1842
+ const r = {};
1453
1843
  if (t.fontSize)
1454
- u.fontSize = t.fontSize;
1844
+ r.fontSize = t.fontSize;
1455
1845
  else if (t.size) {
1456
- const n = {
1846
+ const c = {
1457
1847
  "1x": "1rem",
1458
1848
  "2x": "2rem",
1459
1849
  "3x": "3rem",
1460
1850
  "4x": "4rem",
1461
1851
  "5x": "5rem"
1462
1852
  };
1463
- n[t.size] && (u.fontSize = n[t.size]);
1853
+ c[t.size] && (r.fontSize = c[t.size]);
1464
1854
  }
1465
- t.color && (u.color = t.color);
1466
- const o = [];
1467
- return t.flipH && o.push("scaleX(-1)"), t.flipV && o.push("scaleY(-1)"), t.rotate && o.push(`rotate(${t.rotate}deg)`), o.length > 0 && (u.transform = o.join(" "), u.display = "inline-block"), Object.keys(u).length > 0 ? u : void 0;
1468
- }), d = (u) => {
1469
- a("click", u);
1855
+ t.color && (r.color = t.color);
1856
+ const u = [];
1857
+ return t.flipH && u.push("scaleX(-1)"), t.flipV && u.push("scaleY(-1)"), t.rotate && u.push(`rotate(${t.rotate}deg)`), u.length > 0 && (r.transform = u.join(" "), r.display = "inline-block"), Object.keys(r).length > 0 ? r : void 0;
1858
+ }), o = (r) => {
1859
+ a("click", r);
1470
1860
  };
1471
- return (u, o) => (i(), s("i", {
1472
- class: g(l.value),
1473
- style: D(r.value),
1861
+ return (r, u) => (n(), i("i", {
1862
+ class: $(l.value),
1863
+ style: K(s.value),
1474
1864
  "aria-hidden": !0,
1475
- onClick: d
1865
+ onClick: o
1476
1866
  }, null, 6));
1477
1867
  }
1478
- }), _t = { class: "vibe-datatable" }, ea = { class: "row mb-3" }, ta = {
1868
+ }), fa = { class: "vibe-datatable" }, ba = { class: "row mb-3" }, ha = {
1479
1869
  key: 0,
1480
1870
  class: "col-md-6 mb-2 mb-md-0"
1481
- }, aa = ["placeholder"], la = {
1871
+ }, ma = ["placeholder"], pa = {
1482
1872
  key: 1,
1483
1873
  class: "col-md-6"
1484
- }, ia = { class: "d-flex justify-content-md-end align-items-center" }, sa = ["value"], na = ["onClick"], oa = {
1874
+ }, ya = { class: "d-flex justify-content-md-end align-items-center" }, ga = ["value"], ka = ["onClick"], Sa = {
1485
1875
  key: 0,
1486
1876
  class: "ms-1"
1487
- }, da = ["onClick"], ra = { key: 0 }, ua = ["colspan"], ca = { class: "row" }, fa = {
1877
+ }, $a = ["onClick"], wa = { key: 0 }, Va = ["colspan"], Ca = { class: "row" }, xa = {
1488
1878
  key: 0,
1489
1879
  class: "col-md-6 mb-2 mb-md-0"
1490
- }, va = { class: "datatable-info" }, ba = {
1880
+ }, Ba = { class: "datatable-info" }, La = {
1491
1881
  key: 1,
1492
1882
  class: "col-md-6"
1493
- }, ma = { class: "pagination justify-content-md-end mb-0" }, ha = {
1883
+ }, Ta = { class: "pagination justify-content-md-end mb-0" }, Na = {
1494
1884
  key: 0,
1495
1885
  class: "page-item"
1496
- }, ya = {
1886
+ }, Ea = {
1497
1887
  key: 1,
1498
1888
  class: "page-item disabled"
1499
- }, ga = ["onClick"], pa = {
1889
+ }, Ma = ["onClick"], Ia = {
1500
1890
  key: 2,
1501
1891
  class: "page-item disabled"
1502
- }, ka = {
1892
+ }, Fa = {
1503
1893
  key: 3,
1504
1894
  class: "page-item"
1505
- }, $a = /* @__PURE__ */ x({
1895
+ }, Pa = /* @__PURE__ */ M({
1506
1896
  __name: "VibeDataTable",
1507
- props: /* @__PURE__ */ J({
1897
+ props: /* @__PURE__ */ ue({
1508
1898
  // Data
1509
1899
  items: { type: Array, default: () => [] },
1510
1900
  columns: { type: Array, required: !0 },
@@ -1543,233 +1933,233 @@ const fe = /* @__PURE__ */ x({
1543
1933
  sortDesc: { type: Boolean, default: !1 },
1544
1934
  sortDescModifiers: {}
1545
1935
  }),
1546
- emits: /* @__PURE__ */ J(["row-clicked", "component-error"], ["update:currentPage", "update:perPage", "update:sortBy", "update:sortDesc"]),
1547
- setup(e, { emit: f }) {
1548
- const t = e, a = Y(e, "currentPage"), l = Y(e, "perPage"), r = Y(e, "sortBy"), d = Y(e, "sortDesc"), u = f, o = T(""), n = T(null), c = T(""), v = (k, S) => t.rowKey && k[t.rowKey] !== void 0 ? String(k[t.rowKey]) : S;
1549
- E(o, (k) => {
1550
- n.value !== null && clearTimeout(n.value), n.value = setTimeout(() => {
1551
- c.value = k, a.value = 1, n.value = null;
1936
+ emits: /* @__PURE__ */ ue(["row-clicked", "component-error"], ["update:currentPage", "update:perPage", "update:sortBy", "update:sortDesc"]),
1937
+ setup(e, { emit: v }) {
1938
+ const t = e, a = _(e, "currentPage"), l = _(e, "perPage"), s = _(e, "sortBy"), o = _(e, "sortDesc"), r = v, u = E(""), c = E(null), b = E(""), g = (B, L) => t.rowKey && B[t.rowKey] !== void 0 ? String(B[t.rowKey]) : L;
1939
+ O(u, (B) => {
1940
+ c.value !== null && clearTimeout(c.value), c.value = setTimeout(() => {
1941
+ b.value = B, a.value = 1, c.value = null;
1552
1942
  }, t.searchDebounce);
1553
- }), H(() => {
1554
- n.value !== null && (clearTimeout(n.value), n.value = null);
1943
+ }), X(() => {
1944
+ c.value !== null && (clearTimeout(c.value), c.value = null);
1555
1945
  });
1556
- const p = y(() => {
1557
- if (!t.searchable || !c.value)
1946
+ const C = m(() => {
1947
+ if (!t.searchable || !b.value)
1558
1948
  return t.items || [];
1559
- const k = c.value.toLowerCase();
1560
- return (t.items || []).filter((S) => (t.columns || []).some((V) => {
1561
- if (V.searchable === !1) return !1;
1562
- const j = S[V.key];
1563
- return j == null ? !1 : String(j).toLowerCase().includes(k);
1949
+ const B = b.value.toLowerCase();
1950
+ return (t.items || []).filter((L) => (t.columns || []).some((T) => {
1951
+ if (T.searchable === !1) return !1;
1952
+ const D = L[T.key];
1953
+ return D == null ? !1 : String(D).toLowerCase().includes(B);
1564
1954
  }));
1565
- }), B = (k, S, V) => {
1566
- if (k == null) return 1;
1567
- if (S == null) return -1;
1568
- if (typeof k == "string" && typeof S == "string") {
1569
- const j = k.toLowerCase(), I = S.toLowerCase();
1570
- return j < I ? V ? 1 : -1 : j > I ? V ? -1 : 1 : 0;
1955
+ }), p = (B, L, T) => {
1956
+ if (B == null) return 1;
1957
+ if (L == null) return -1;
1958
+ if (typeof B == "string" && typeof L == "string") {
1959
+ const D = B.toLowerCase(), U = L.toLowerCase();
1960
+ return D < U ? T ? 1 : -1 : D > U ? T ? -1 : 1 : 0;
1571
1961
  }
1572
- if (typeof k == "number" && typeof S == "number")
1573
- return k < S ? V ? 1 : -1 : k > S ? V ? -1 : 1 : 0;
1574
- if (typeof k == "boolean" && typeof S == "boolean")
1575
- return k === S ? 0 : (k ? 1 : -1) * (V ? -1 : 1);
1576
- if (k instanceof Date && S instanceof Date) {
1577
- const j = k.getTime(), I = S.getTime();
1578
- return j < I ? V ? 1 : -1 : j > I ? V ? -1 : 1 : 0;
1962
+ if (typeof B == "number" && typeof L == "number")
1963
+ return B < L ? T ? 1 : -1 : B > L ? T ? -1 : 1 : 0;
1964
+ if (typeof B == "boolean" && typeof L == "boolean")
1965
+ return B === L ? 0 : (B ? 1 : -1) * (T ? -1 : 1);
1966
+ if (B instanceof Date && L instanceof Date) {
1967
+ const D = B.getTime(), U = L.getTime();
1968
+ return D < U ? T ? 1 : -1 : D > U ? T ? -1 : 1 : 0;
1579
1969
  }
1580
1970
  return 0;
1581
- }, $ = y(() => {
1582
- if (!t.sortable || !r.value)
1583
- return p.value;
1584
- const k = [...p.value], S = r.value;
1585
- return k.sort((V, j) => B(V[S], j[S], d.value)), k;
1586
- }), L = y(() => {
1971
+ }, d = m(() => {
1972
+ if (!t.sortable || !s.value)
1973
+ return C.value;
1974
+ const B = [...C.value], L = s.value;
1975
+ return B.sort((T, D) => p(T[L], D[L], o.value)), B;
1976
+ }), f = m(() => {
1587
1977
  if (!t.paginated)
1588
- return $.value;
1589
- const k = (a.value - 1) * l.value, S = k + l.value;
1590
- return $.value.slice(k, S);
1591
- }), z = y(() => t.items.length), N = y(() => p.value.length), O = y(() => Math.ceil(N.value / l.value)), K = y(() => N.value === 0 ? 0 : (a.value - 1) * l.value + 1), U = y(() => {
1592
- const k = a.value * l.value;
1593
- return Math.min(k, N.value);
1594
- }), _ = y(() => (N.value !== z.value ? t.filteredInfoText : t.infoText).replace("{start}", String(K.value)).replace("{end}", String(U.value)).replace("{total}", String(N.value)).replace("{totalRows}", String(z.value))), ee = y(() => {
1595
- const k = ["table"];
1596
- return t.striped && k.push("table-striped"), t.bordered && k.push("table-bordered"), t.borderless && k.push("table-borderless"), t.hover && k.push("table-hover"), t.small && k.push("table-sm"), t.variant && k.push(`table-${t.variant}`), k.join(" ");
1597
- }), te = (k) => {
1598
- !t.sortable || k.sortable === !1 || (r.value === k.key ? d.value = !d.value : (r.value = k.key, d.value = !1));
1599
- }, R = (k) => {
1600
- k < 1 || k > O.value || (a.value = k);
1601
- }, ae = () => {
1978
+ return d.value;
1979
+ const B = (a.value - 1) * l.value, L = B + l.value;
1980
+ return d.value.slice(B, L);
1981
+ }), h = m(() => t.items.length), w = m(() => C.value.length), x = m(() => Math.ceil(w.value / l.value)), V = m(() => w.value === 0 ? 0 : (a.value - 1) * l.value + 1), q = m(() => {
1982
+ const B = a.value * l.value;
1983
+ return Math.min(B, w.value);
1984
+ }), P = m(() => (w.value !== h.value ? t.filteredInfoText : t.infoText).replace("{start}", String(V.value)).replace("{end}", String(q.value)).replace("{total}", String(w.value)).replace("{totalRows}", String(h.value))), R = m(() => {
1985
+ const B = ["table"];
1986
+ return t.striped && B.push("table-striped"), t.bordered && B.push("table-bordered"), t.borderless && B.push("table-borderless"), t.hover && B.push("table-hover"), t.small && B.push("table-sm"), t.variant && B.push(`table-${t.variant}`), B.join(" ");
1987
+ }), Q = (B) => {
1988
+ !t.sortable || B.sortable === !1 || (s.value === B.key ? o.value = !o.value : (s.value = B.key, o.value = !1));
1989
+ }, W = (B) => {
1990
+ B < 1 || B > x.value || (a.value = B);
1991
+ }, te = () => {
1602
1992
  a.value = 1;
1603
- }, le = (k, S) => {
1604
- u("row-clicked", k, S);
1605
- }, ie = (k, S) => {
1606
- const V = k[S.key];
1607
- return S.formatter ? S.formatter(V, k) : V;
1608
- }, se = (k) => !t.sortable || k.sortable === !1 ? "" : r.value !== k.key ? "⇅" : d.value ? "↓" : "↑", ne = (k) => {
1609
- const S = { ...k.thStyle };
1610
- return t.sortable && k.sortable !== !1 && (S.cursor = "pointer"), S;
1993
+ }, fe = (B, L) => {
1994
+ r("row-clicked", B, L);
1995
+ }, be = (B, L) => {
1996
+ const T = B[L.key];
1997
+ return L.formatter ? L.formatter(T, B) : T;
1998
+ }, he = (B) => !t.sortable || B.sortable === !1 ? "" : s.value !== B.key ? "⇅" : o.value ? "↓" : "↑", me = (B) => {
1999
+ const L = { ...B.thStyle };
2000
+ return t.sortable && B.sortable !== !1 && (L.cursor = "pointer"), L;
1611
2001
  };
1612
- return (k, S) => (i(), s("div", _t, [
1613
- h("div", ea, [
1614
- e.searchable ? (i(), s("div", ta, [
1615
- W(h("input", {
1616
- "onUpdate:modelValue": S[0] || (S[0] = (V) => o.value = V),
2002
+ return (B, L) => (n(), i("div", fa, [
2003
+ S("div", ba, [
2004
+ e.searchable ? (n(), i("div", ha, [
2005
+ de(S("input", {
2006
+ "onUpdate:modelValue": L[0] || (L[0] = (T) => u.value = T),
1617
2007
  type: "search",
1618
2008
  class: "form-control",
1619
2009
  placeholder: e.searchPlaceholder
1620
- }, null, 8, aa), [
1621
- [ue, o.value]
2010
+ }, null, 8, ma), [
2011
+ [ke, u.value]
1622
2012
  ])
1623
- ])) : b("", !0),
1624
- e.showPerPage && e.paginated ? (i(), s("div", la, [
1625
- h("div", ia, [
1626
- S[6] || (S[6] = h("label", { class: "me-2 mb-0" }, "Show", -1)),
1627
- W(h("select", {
1628
- "onUpdate:modelValue": S[1] || (S[1] = (V) => l.value = V),
2013
+ ])) : y("", !0),
2014
+ e.showPerPage && e.paginated ? (n(), i("div", pa, [
2015
+ S("div", ya, [
2016
+ L[6] || (L[6] = S("label", { class: "me-2 mb-0" }, "Show", -1)),
2017
+ de(S("select", {
2018
+ "onUpdate:modelValue": L[1] || (L[1] = (T) => l.value = T),
1629
2019
  class: "form-select form-select-sm",
1630
2020
  style: { width: "auto" },
1631
- onChange: ae
2021
+ onChange: te
1632
2022
  }, [
1633
- (i(!0), s(M, null, A(e.perPageOptions, (V) => (i(), s("option", {
1634
- key: V,
1635
- value: V
1636
- }, m(V), 9, sa))), 128))
2023
+ (n(!0), i(F, null, H(e.perPageOptions, (T) => (n(), i("option", {
2024
+ key: T,
2025
+ value: T
2026
+ }, k(T), 9, ga))), 128))
1637
2027
  ], 544), [
1638
2028
  [
1639
- ce,
2029
+ Se,
1640
2030
  l.value,
1641
2031
  void 0,
1642
2032
  { number: !0 }
1643
2033
  ]
1644
2034
  ]),
1645
- S[7] || (S[7] = h("span", { class: "ms-2" }, "entries", -1))
2035
+ L[7] || (L[7] = S("span", { class: "ms-2" }, "entries", -1))
1646
2036
  ])
1647
- ])) : b("", !0)
2037
+ ])) : y("", !0)
1648
2038
  ]),
1649
- h("div", {
1650
- class: g({ "table-responsive": e.responsive })
2039
+ S("div", {
2040
+ class: $({ "table-responsive": e.responsive })
1651
2041
  }, [
1652
- h("table", {
1653
- class: g(ee.value)
2042
+ S("table", {
2043
+ class: $(R.value)
1654
2044
  }, [
1655
- h("thead", null, [
1656
- h("tr", null, [
1657
- (i(!0), s(M, null, A(e.columns, (V) => (i(), s("th", {
1658
- key: V.key,
1659
- class: g(V.headerClass),
1660
- style: D(ne(V)),
1661
- onClick: (j) => te(V)
2045
+ S("thead", null, [
2046
+ S("tr", null, [
2047
+ (n(!0), i(F, null, H(e.columns, (T) => (n(), i("th", {
2048
+ key: T.key,
2049
+ class: $(T.headerClass),
2050
+ style: K(me(T)),
2051
+ onClick: (D) => Q(T)
1662
2052
  }, [
1663
- w(m(V.label) + " ", 1),
1664
- e.sortable && V.sortable !== !1 ? (i(), s("span", oa, m(se(V)), 1)) : b("", !0)
1665
- ], 14, na))), 128))
2053
+ I(k(T.label) + " ", 1),
2054
+ e.sortable && T.sortable !== !1 ? (n(), i("span", Sa, k(he(T)), 1)) : y("", !0)
2055
+ ], 14, ka))), 128))
1666
2056
  ])
1667
2057
  ]),
1668
- h("tbody", null, [
1669
- (i(!0), s(M, null, A(L.value, (V, j) => (i(), s("tr", {
1670
- key: v(V, j),
1671
- onClick: (I) => le(V, j),
2058
+ S("tbody", null, [
2059
+ (n(!0), i(F, null, H(f.value, (T, D) => (n(), i("tr", {
2060
+ key: g(T, D),
2061
+ onClick: (U) => fe(T, D),
1672
2062
  style: { cursor: "pointer" }
1673
2063
  }, [
1674
- (i(!0), s(M, null, A(e.columns, (I) => (i(), s("td", {
1675
- key: I.key,
1676
- class: g(I.class),
1677
- style: D(I.tdStyle)
2064
+ (n(!0), i(F, null, H(e.columns, (U) => (n(), i("td", {
2065
+ key: U.key,
2066
+ class: $(U.class),
2067
+ style: K(U.tdStyle)
1678
2068
  }, [
1679
- C(k.$slots, `cell(${I.key})`, {
1680
- item: V,
1681
- value: V[I.key],
1682
- index: j
2069
+ N(B.$slots, `cell(${U.key})`, {
2070
+ item: T,
2071
+ value: T[U.key],
2072
+ index: D
1683
2073
  }, () => [
1684
- w(m(ie(V, I)), 1)
2074
+ I(k(be(T, U)), 1)
1685
2075
  ], !0)
1686
2076
  ], 6))), 128))
1687
- ], 8, da))), 128)),
1688
- L.value.length === 0 && e.showEmpty ? (i(), s("tr", ra, [
1689
- h("td", {
1690
- colspan: e.columns.length,
2077
+ ], 8, $a))), 128)),
2078
+ f.value.length === 0 && e.showEmpty ? (n(), i("tr", wa, [
2079
+ S("td", {
2080
+ colspan: e.columns?.length || 1,
1691
2081
  class: "text-center"
1692
- }, m(e.emptyText), 9, ua)
1693
- ])) : b("", !0)
2082
+ }, k(e.emptyText), 9, Va)
2083
+ ])) : y("", !0)
1694
2084
  ])
1695
2085
  ], 2)
1696
2086
  ], 2),
1697
- h("div", ca, [
1698
- e.showInfo ? (i(), s("div", fa, [
1699
- h("div", va, m(_.value), 1)
1700
- ])) : b("", !0),
1701
- e.paginated && O.value > 1 ? (i(), s("div", ba, [
1702
- h("nav", null, [
1703
- h("ul", ma, [
1704
- h("li", {
1705
- class: g(["page-item", { disabled: a.value === 1 }])
2087
+ S("div", Ca, [
2088
+ e.showInfo ? (n(), i("div", xa, [
2089
+ S("div", Ba, k(P.value), 1)
2090
+ ])) : y("", !0),
2091
+ e.paginated && x.value > 1 ? (n(), i("div", La, [
2092
+ S("nav", null, [
2093
+ S("ul", Ta, [
2094
+ S("li", {
2095
+ class: $(["page-item", { disabled: a.value === 1 }])
1706
2096
  }, [
1707
- h("a", {
2097
+ S("a", {
1708
2098
  class: "page-link",
1709
2099
  href: "#",
1710
- onClick: S[2] || (S[2] = X((V) => R(a.value - 1), ["prevent"]))
2100
+ onClick: L[2] || (L[2] = Z((T) => W(a.value - 1), ["prevent"]))
1711
2101
  }, " Previous ")
1712
2102
  ], 2),
1713
- a.value > 3 ? (i(), s("li", ha, [
1714
- h("a", {
2103
+ a.value > 3 ? (n(), i("li", Na, [
2104
+ S("a", {
1715
2105
  class: "page-link",
1716
2106
  href: "#",
1717
- onClick: S[3] || (S[3] = X((V) => R(1), ["prevent"]))
2107
+ onClick: L[3] || (L[3] = Z((T) => W(1), ["prevent"]))
1718
2108
  }, "1")
1719
- ])) : b("", !0),
1720
- a.value > 4 ? (i(), s("li", ya, [...S[8] || (S[8] = [
1721
- h("span", { class: "page-link" }, "...", -1)
1722
- ])])) : b("", !0),
1723
- (i(!0), s(M, null, A(Array.from({ length: O.value }, (V, j) => j + 1).filter(
1724
- (V) => V >= a.value - 2 && V <= a.value + 2
1725
- ), (V) => (i(), s("li", {
1726
- key: V,
1727
- class: g(["page-item", { active: V === a.value }])
2109
+ ])) : y("", !0),
2110
+ a.value > 4 ? (n(), i("li", Ea, [...L[8] || (L[8] = [
2111
+ S("span", { class: "page-link" }, "...", -1)
2112
+ ])])) : y("", !0),
2113
+ (n(!0), i(F, null, H(Array.from({ length: x.value }, (T, D) => D + 1).filter(
2114
+ (T) => T >= a.value - 2 && T <= a.value + 2
2115
+ ), (T) => (n(), i("li", {
2116
+ key: T,
2117
+ class: $(["page-item", { active: T === a.value }])
1728
2118
  }, [
1729
- h("a", {
2119
+ S("a", {
1730
2120
  class: "page-link",
1731
2121
  href: "#",
1732
- onClick: X((j) => R(V), ["prevent"])
1733
- }, m(V), 9, ga)
2122
+ onClick: Z((D) => W(T), ["prevent"])
2123
+ }, k(T), 9, Ma)
1734
2124
  ], 2))), 128)),
1735
- a.value < O.value - 3 ? (i(), s("li", pa, [...S[9] || (S[9] = [
1736
- h("span", { class: "page-link" }, "...", -1)
1737
- ])])) : b("", !0),
1738
- a.value < O.value - 2 ? (i(), s("li", ka, [
1739
- h("a", {
2125
+ a.value < x.value - 3 ? (n(), i("li", Ia, [...L[9] || (L[9] = [
2126
+ S("span", { class: "page-link" }, "...", -1)
2127
+ ])])) : y("", !0),
2128
+ a.value < x.value - 2 ? (n(), i("li", Fa, [
2129
+ S("a", {
1740
2130
  class: "page-link",
1741
2131
  href: "#",
1742
- onClick: S[4] || (S[4] = X((V) => R(O.value), ["prevent"]))
1743
- }, m(O.value), 1)
1744
- ])) : b("", !0),
1745
- h("li", {
1746
- class: g(["page-item", { disabled: a.value === O.value }])
2132
+ onClick: L[4] || (L[4] = Z((T) => W(x.value), ["prevent"]))
2133
+ }, k(x.value), 1)
2134
+ ])) : y("", !0),
2135
+ S("li", {
2136
+ class: $(["page-item", { disabled: a.value === x.value }])
1747
2137
  }, [
1748
- h("a", {
2138
+ S("a", {
1749
2139
  class: "page-link",
1750
2140
  href: "#",
1751
- onClick: S[5] || (S[5] = X((V) => R(a.value + 1), ["prevent"]))
2141
+ onClick: L[5] || (L[5] = Z((T) => W(a.value + 1), ["prevent"]))
1752
2142
  }, " Next ")
1753
2143
  ], 2)
1754
2144
  ])
1755
2145
  ])
1756
- ])) : b("", !0)
2146
+ ])) : y("", !0)
1757
2147
  ])
1758
2148
  ]));
1759
2149
  }
1760
- }), Q = (e, f) => {
2150
+ }), re = (e, v) => {
1761
2151
  const t = e.__vccOpts || e;
1762
- for (const [a, l] of f)
2152
+ for (const [a, l] of v)
1763
2153
  t[a] = l;
1764
2154
  return t;
1765
- }, Sa = /* @__PURE__ */ Q($a, [["__scopeId", "data-v-25bff6a6"]]), Va = { class: "mb-3" }, Ca = ["for"], xa = {
2155
+ }, Ra = /* @__PURE__ */ re(Pa, [["__scopeId", "data-v-d5aa8072"]]), qa = ["for"], za = {
1766
2156
  key: 0,
1767
2157
  class: "text-danger"
1768
- }, wa = ["id", "type", "value", "placeholder", "disabled", "readonly", "required", "aria-invalid", "aria-describedby"], Ba = ["id"], Na = {
1769
- key: 2,
2158
+ }, Aa = ["id", "type", "value", "placeholder", "disabled", "readonly", "required", "aria-invalid", "aria-describedby"], ja = ["id"], Oa = {
2159
+ key: 0,
1770
2160
  class: "valid-feedback",
1771
2161
  style: { display: "block" }
1772
- }, Ta = ["id"], Ma = /* @__PURE__ */ x({
2162
+ }, Ha = ["id"], Da = /* @__PURE__ */ M({
1773
2163
  __name: "VibeFormInput",
1774
2164
  props: {
1775
2165
  modelValue: {
@@ -1777,7 +2167,7 @@ const fe = /* @__PURE__ */ x({
1777
2167
  default: ""
1778
2168
  },
1779
2169
  type: { type: String, default: "text" },
1780
- id: { type: String, required: !0 },
2170
+ id: { type: String, default: void 0 },
1781
2171
  label: { type: String, default: void 0 },
1782
2172
  placeholder: { type: String, default: void 0 },
1783
2173
  disabled: { type: Boolean, default: !1 },
@@ -1792,254 +2182,278 @@ const fe = /* @__PURE__ */ x({
1792
2182
  plaintext: { type: Boolean, default: !1 }
1793
2183
  },
1794
2184
  emits: ["update:modelValue", "validate", "blur", "focus", "input", "change"],
1795
- setup(e, { emit: f }) {
1796
- const t = e, a = f, l = y(() => {
1797
- const n = [];
1798
- return t.plaintext ? n.push("form-control-plaintext") : (n.push("form-control"), t.size && n.push(`form-control-${t.size}`)), t.validationState === "valid" && n.push("is-valid"), t.validationState === "invalid" && n.push("is-invalid"), n.join(" ");
1799
- }), r = (n) => {
1800
- const c = n.target, v = t.type === "number" ? c.value === "" ? "" : Number(c.value) : c.value;
1801
- a("update:modelValue", v), a("input", n), t.validateOn === "input" && a("validate");
1802
- }, d = (n) => {
1803
- a("change", n), t.validateOn === "change" && a("validate");
1804
- }, u = (n) => {
1805
- a("blur", n), t.validateOn === "blur" && a("validate");
1806
- }, o = (n) => {
1807
- a("focus", n);
2185
+ setup(e, { emit: v }) {
2186
+ const t = e, a = v, l = J("vibeFormGroup", null), s = m(() => t.id || l?.consumeId() || G("input")), o = m(() => !!t.label && !l?.hasLabel.value), r = m(() => !!t.validationState && !l?.hasValidation.value), u = m(() => !!t.helpText && !l?.hasHelp.value), c = m(() => {
2187
+ const d = [];
2188
+ return t.plaintext ? d.push("form-control-plaintext") : (d.push("form-control"), t.size && d.push(`form-control-${t.size}`)), t.validationState === "valid" && d.push("is-valid"), t.validationState === "invalid" && d.push("is-invalid"), d.join(" ");
2189
+ }), b = (d) => {
2190
+ const f = d.target, h = t.type === "number" ? f.value === "" ? "" : Number(f.value) : f.value;
2191
+ a("update:modelValue", h), a("input", d), t.validateOn === "input" && a("validate");
2192
+ }, g = (d) => {
2193
+ a("change", d), t.validateOn === "change" && a("validate");
2194
+ }, C = (d) => {
2195
+ a("blur", d), t.validateOn === "blur" && a("validate");
2196
+ }, p = (d) => {
2197
+ a("focus", d);
1808
2198
  };
1809
- return (n, c) => (i(), s("div", Va, [
1810
- e.label ? (i(), s("label", {
2199
+ return (d, f) => (n(), i("div", {
2200
+ class: $({ "mb-3": o.value || u.value || r.value })
2201
+ }, [
2202
+ o.value ? (n(), i("label", {
1811
2203
  key: 0,
1812
- for: e.id,
2204
+ for: s.value,
1813
2205
  class: "form-label"
1814
2206
  }, [
1815
- w(m(e.label) + " ", 1),
1816
- e.required ? (i(), s("span", xa, "*")) : b("", !0)
1817
- ], 8, Ca)) : b("", !0),
1818
- h("input", {
1819
- id: e.id,
2207
+ I(k(e.label) + " ", 1),
2208
+ e.required ? (n(), i("span", za, "*")) : y("", !0)
2209
+ ], 8, qa)) : y("", !0),
2210
+ S("input", {
2211
+ id: s.value,
1820
2212
  type: e.type,
1821
- class: g(l.value),
2213
+ class: $(c.value),
1822
2214
  value: e.modelValue,
1823
2215
  placeholder: e.placeholder,
1824
2216
  disabled: e.disabled,
1825
2217
  readonly: e.readonly || e.plaintext,
1826
2218
  required: e.required,
1827
2219
  "aria-invalid": e.validationState === "invalid",
1828
- "aria-describedby": e.validationMessage || e.helpText ? `${e.id}-feedback` : void 0,
1829
- onInput: r,
1830
- onChange: d,
1831
- onBlur: u,
1832
- onFocus: o
1833
- }, null, 42, wa),
1834
- e.helpText && !e.validationMessage ? (i(), s("div", {
2220
+ "aria-describedby": e.validationMessage || e.helpText ? `${s.value}-feedback` : void 0,
2221
+ onInput: b,
2222
+ onChange: g,
2223
+ onBlur: C,
2224
+ onFocus: p
2225
+ }, null, 42, Aa),
2226
+ u.value ? (n(), i("div", {
1835
2227
  key: 1,
1836
- id: `${e.id}-feedback`,
2228
+ id: `${s.value}-feedback`,
1837
2229
  class: "form-text"
1838
- }, m(e.helpText), 9, Ba)) : b("", !0),
1839
- e.validationState === "valid" ? (i(), s("div", Na, m(e.validationMessage || "Looks good!"), 1)) : b("", !0),
1840
- e.validationState === "invalid" ? (i(), s("div", {
1841
- key: 3,
1842
- id: `${e.id}-feedback`,
1843
- class: "invalid-feedback",
1844
- style: { display: "block" }
1845
- }, m(e.validationMessage || "Please provide a valid value."), 9, Ta)) : b("", !0)
1846
- ]));
2230
+ }, k(e.helpText), 9, ja)) : y("", !0),
2231
+ r.value ? (n(), i(F, { key: 2 }, [
2232
+ e.validationState === "valid" ? (n(), i("div", Oa, k(e.validationMessage || "Looks good!"), 1)) : y("", !0),
2233
+ e.validationState === "invalid" ? (n(), i("div", {
2234
+ key: 1,
2235
+ id: `${s.value}-feedback`,
2236
+ class: "invalid-feedback",
2237
+ style: { display: "block" }
2238
+ }, k(e.validationMessage || "Please provide a valid value."), 9, Ha)) : y("", !0)
2239
+ ], 64)) : y("", !0)
2240
+ ], 2));
1847
2241
  }
1848
- }), qa = { class: "mb-3" }, Pa = ["for"], Fa = {
2242
+ }), Ga = ["for"], Xa = {
1849
2243
  key: 0,
1850
2244
  class: "text-danger"
1851
- }, La = ["id", "value", "disabled", "required", "multiple", "size", "aria-invalid", "aria-describedby"], za = ["selected"], ja = ["value", "disabled"], Aa = ["id"], Ia = {
1852
- key: 2,
2245
+ }, Ya = ["id", "value", "multiple", "size", "disabled", "required", "aria-invalid", "aria-describedby"], Ua = {
2246
+ key: 0,
2247
+ value: "",
2248
+ disabled: "",
2249
+ selected: ""
2250
+ }, Ja = ["value", "disabled"], Ka = ["id"], Qa = {
2251
+ key: 0,
1853
2252
  class: "valid-feedback",
1854
2253
  style: { display: "block" }
1855
- }, Oa = ["id"], Da = /* @__PURE__ */ x({
2254
+ }, Wa = ["id"], Za = /* @__PURE__ */ M({
1856
2255
  __name: "VibeFormSelect",
1857
2256
  props: {
1858
2257
  modelValue: {
1859
2258
  type: [String, Number, Array],
1860
- default: "",
1861
- validator: (e) => !0
2259
+ default: ""
1862
2260
  },
1863
- id: { type: String, required: !0 },
2261
+ id: { type: String, default: void 0 },
1864
2262
  label: { type: String, default: void 0 },
1865
2263
  options: { type: Array, default: () => [] },
2264
+ multiple: { type: Boolean, default: !1 },
2265
+ selectSize: { type: Number, default: void 0 },
2266
+ htmlSize: { type: Number, default: void 0 },
2267
+ placeholder: { type: String, default: void 0 },
1866
2268
  disabled: { type: Boolean, default: !1 },
1867
2269
  required: { type: Boolean, default: !1 },
1868
- multiple: { type: Boolean, default: !1 },
1869
2270
  size: { type: String, default: void 0 },
1870
- htmlSize: { type: Number, default: void 0 },
1871
2271
  validationState: { type: String, default: null },
1872
2272
  validationMessage: { type: String, default: void 0 },
1873
2273
  validationRules: { type: [Array, Function], default: void 0 },
1874
- validateOn: { type: String, default: "blur" },
1875
- helpText: { type: String, default: void 0 },
1876
- placeholder: { type: String, default: void 0 }
2274
+ validateOn: { type: String, default: "change" },
2275
+ helpText: { type: String, default: void 0 }
1877
2276
  },
1878
2277
  emits: ["update:modelValue", "validate", "blur", "focus", "change"],
1879
- setup(e, { emit: f }) {
1880
- const t = e, a = f, l = y(() => {
1881
- const o = ["form-select"];
1882
- return t.size && o.push(`form-select-${t.size}`), t.validationState === "valid" && o.push("is-valid"), t.validationState === "invalid" && o.push("is-invalid"), o.join(" ");
1883
- }), r = (o) => {
1884
- const n = o.target;
1885
- let c;
1886
- t.multiple ? c = Array.from(n.selectedOptions).map((p) => p.value) : c = n.value, a("update:modelValue", c), a("change", o), t.validateOn === "change" && a("validate");
1887
- }, d = (o) => {
1888
- a("blur", o), t.validateOn === "blur" && a("validate");
1889
- }, u = (o) => {
1890
- a("focus", o);
2278
+ setup(e, { emit: v }) {
2279
+ const t = e, a = v, l = J("vibeFormGroup", null), s = m(() => t.id || l?.consumeId() || G("select")), o = m(() => !!t.label && !l?.hasLabel.value), r = m(() => !!t.validationState && !l?.hasValidation.value), u = m(() => !!t.helpText && !l?.hasHelp.value), c = m(() => {
2280
+ const d = ["form-select"];
2281
+ return t.size && d.push(`form-select-${t.size}`), t.validationState === "valid" && d.push("is-valid"), t.validationState === "invalid" && d.push("is-invalid"), d.join(" ");
2282
+ }), b = (d) => {
2283
+ const f = d.target;
2284
+ let h;
2285
+ t.multiple ? h = Array.from(f.selectedOptions).map((w) => w.value) : h = f.value, a("update:modelValue", h);
2286
+ }, g = (d) => {
2287
+ a("change", d), t.validateOn === "change" && a("validate");
2288
+ }, C = (d) => {
2289
+ a("blur", d), t.validateOn === "blur" && a("validate");
2290
+ }, p = (d) => {
2291
+ a("focus", d);
1891
2292
  };
1892
- return (o, n) => (i(), s("div", qa, [
1893
- e.label ? (i(), s("label", {
2293
+ return (d, f) => (n(), i("div", {
2294
+ class: $({ "mb-3": o.value || u.value || r.value })
2295
+ }, [
2296
+ o.value ? (n(), i("label", {
1894
2297
  key: 0,
1895
- for: e.id,
2298
+ for: s.value,
1896
2299
  class: "form-label"
1897
2300
  }, [
1898
- w(m(e.label) + " ", 1),
1899
- e.required ? (i(), s("span", Fa, "*")) : b("", !0)
1900
- ], 8, Pa)) : b("", !0),
1901
- h("select", {
1902
- id: e.id,
1903
- class: g(l.value),
2301
+ I(k(e.label) + " ", 1),
2302
+ e.required ? (n(), i("span", Xa, "*")) : y("", !0)
2303
+ ], 8, Ga)) : y("", !0),
2304
+ S("select", {
2305
+ id: s.value,
2306
+ class: $(c.value),
1904
2307
  value: e.modelValue,
2308
+ multiple: e.multiple,
2309
+ size: e.htmlSize || e.selectSize,
1905
2310
  disabled: e.disabled,
1906
2311
  required: e.required,
1907
- multiple: e.multiple,
1908
- size: e.htmlSize,
1909
2312
  "aria-invalid": e.validationState === "invalid",
1910
- "aria-describedby": e.validationMessage || e.helpText ? `${e.id}-feedback` : void 0,
1911
- onChange: r,
1912
- onBlur: d,
1913
- onFocus: u
2313
+ "aria-describedby": e.validationMessage || e.helpText ? `${s.value}-feedback` : void 0,
2314
+ onInput: b,
2315
+ onChange: g,
2316
+ onBlur: C,
2317
+ onFocus: p
1914
2318
  }, [
1915
- e.placeholder && !e.multiple ? (i(), s("option", {
1916
- key: 0,
1917
- value: "",
1918
- disabled: "",
1919
- selected: !e.modelValue
1920
- }, m(e.placeholder), 9, za)) : b("", !0),
1921
- (i(!0), s(M, null, A(e.options, (c) => (i(), s("option", {
1922
- key: c.value,
1923
- value: c.value,
1924
- disabled: c.disabled
1925
- }, m(c.text), 9, ja))), 128)),
1926
- C(o.$slots, "default")
1927
- ], 42, La),
1928
- e.helpText && !e.validationMessage ? (i(), s("div", {
2319
+ e.placeholder ? (n(), i("option", Ua, k(e.placeholder), 1)) : y("", !0),
2320
+ N(d.$slots, "default", {}, () => [
2321
+ (n(!0), i(F, null, H(e.options, (h) => (n(), i("option", {
2322
+ key: String(h.value),
2323
+ value: h.value,
2324
+ disabled: h.disabled
2325
+ }, k(h.text), 9, Ja))), 128))
2326
+ ])
2327
+ ], 42, Ya),
2328
+ u.value ? (n(), i("div", {
1929
2329
  key: 1,
1930
- id: `${e.id}-feedback`,
2330
+ id: `${s.value}-feedback`,
1931
2331
  class: "form-text"
1932
- }, m(e.helpText), 9, Aa)) : b("", !0),
1933
- e.validationState === "valid" ? (i(), s("div", Ia, m(e.validationMessage || "Looks good!"), 1)) : b("", !0),
1934
- e.validationState === "invalid" ? (i(), s("div", {
1935
- key: 3,
1936
- id: `${e.id}-feedback`,
1937
- class: "invalid-feedback",
1938
- style: { display: "block" }
1939
- }, m(e.validationMessage || "Please select a valid option."), 9, Oa)) : b("", !0)
1940
- ]));
2332
+ }, k(e.helpText), 9, Ka)) : y("", !0),
2333
+ r.value ? (n(), i(F, { key: 2 }, [
2334
+ e.validationState === "valid" ? (n(), i("div", Qa, k(e.validationMessage || "Looks good!"), 1)) : y("", !0),
2335
+ e.validationState === "invalid" ? (n(), i("div", {
2336
+ key: 1,
2337
+ id: `${s.value}-feedback`,
2338
+ class: "invalid-feedback",
2339
+ style: { display: "block" }
2340
+ }, k(e.validationMessage || "Please select an option."), 9, Wa)) : y("", !0)
2341
+ ], 64)) : y("", !0)
2342
+ ], 2));
1941
2343
  }
1942
- }), Ea = { class: "mb-3" }, Ra = ["for"], Xa = {
2344
+ }), _a = ["for"], el = {
1943
2345
  key: 0,
1944
2346
  class: "text-danger"
1945
- }, Ya = ["id", "value", "placeholder", "disabled", "readonly", "required", "rows", "maxlength", "aria-invalid", "aria-describedby"], Ga = {
1946
- key: 1,
1947
- class: "form-text"
1948
- }, Ha = ["id"], Ka = {
1949
- key: 3,
2347
+ }, tl = ["id", "value", "placeholder", "rows", "maxlength", "disabled", "readonly", "required", "aria-invalid", "aria-describedby"], al = ["id"], ll = {
2348
+ key: 0,
2349
+ class: "ms-auto"
2350
+ }, ol = {
2351
+ key: 0,
1950
2352
  class: "valid-feedback",
1951
2353
  style: { display: "block" }
1952
- }, Ua = ["id"], Qa = /* @__PURE__ */ x({
2354
+ }, sl = ["id"], nl = /* @__PURE__ */ M({
1953
2355
  __name: "VibeFormTextarea",
1954
2356
  props: {
1955
2357
  modelValue: {
1956
2358
  type: String,
1957
- default: "",
1958
- validator: (e) => !0
2359
+ default: ""
1959
2360
  },
1960
- id: { type: String, required: !0 },
2361
+ id: { type: String, default: void 0 },
1961
2362
  label: { type: String, default: void 0 },
1962
2363
  placeholder: { type: String, default: void 0 },
2364
+ rows: { type: [Number, String], default: 3 },
2365
+ maxlength: { type: [Number, String], default: void 0 },
1963
2366
  disabled: { type: Boolean, default: !1 },
1964
2367
  readonly: { type: Boolean, default: !1 },
1965
2368
  required: { type: Boolean, default: !1 },
1966
- rows: { type: Number, default: 3 },
1967
- maxlength: { type: Number, default: void 0 },
1968
2369
  size: { type: String, default: void 0 },
1969
2370
  validationState: { type: String, default: null },
1970
2371
  validationMessage: { type: String, default: void 0 },
1971
2372
  validationRules: { type: [Array, Function], default: void 0 },
1972
2373
  validateOn: { type: String, default: "blur" },
1973
2374
  helpText: { type: String, default: void 0 },
2375
+ noResize: { type: Boolean, default: !1 },
1974
2376
  showCharCount: { type: Boolean, default: !1 }
1975
2377
  },
1976
2378
  emits: ["update:modelValue", "validate", "blur", "focus", "input", "change"],
1977
- setup(e, { emit: f }) {
1978
- const t = e, a = f, l = y(() => {
1979
- const v = ["form-control"];
1980
- return t.size && v.push(`form-control-${t.size}`), t.validationState === "valid" && v.push("is-valid"), t.validationState === "invalid" && v.push("is-invalid"), v.join(" ");
1981
- }), r = y(() => {
1982
- const v = typeof t.modelValue == "string" ? t.modelValue : "";
1983
- return v ? v.length : 0;
1984
- }), d = y(() => t.maxlength ? `${r.value} / ${t.maxlength}` : `${r.value}`), u = (v) => {
1985
- const p = v.target;
1986
- a("update:modelValue", p.value), a("input", v), t.validateOn === "input" && a("validate");
1987
- }, o = (v) => {
1988
- a("change", v), t.validateOn === "change" && a("validate");
1989
- }, n = (v) => {
1990
- a("blur", v), t.validateOn === "blur" && a("validate");
1991
- }, c = (v) => {
1992
- a("focus", v);
2379
+ setup(e, { emit: v }) {
2380
+ const t = e, a = v, l = J("vibeFormGroup", null), s = m(() => t.id || l?.consumeId() || G("textarea")), o = m(() => !!t.label && !l?.hasLabel.value), r = m(() => !!t.validationState && !l?.hasValidation.value), u = m(() => (!!t.helpText || t.showCharCount) && !l?.hasHelp.value), c = m(() => {
2381
+ const h = ["form-control"];
2382
+ return t.size && h.push(`form-control-${t.size}`), t.validationState === "valid" && h.push("is-valid"), t.validationState === "invalid" && h.push("is-invalid"), h.join(" ");
2383
+ }), b = m(() => {
2384
+ if (t.noResize) return { resize: "none" };
2385
+ }), g = m(() => t.modelValue?.length || 0), C = (h) => {
2386
+ const w = h.target;
2387
+ a("update:modelValue", w.value), a("input", h), t.validateOn === "input" && a("validate");
2388
+ }, p = (h) => {
2389
+ a("change", h), t.validateOn === "change" && a("validate");
2390
+ }, d = (h) => {
2391
+ a("blur", h), t.validateOn === "blur" && a("validate");
2392
+ }, f = (h) => {
2393
+ a("focus", h);
1993
2394
  };
1994
- return (v, p) => (i(), s("div", Ea, [
1995
- e.label ? (i(), s("label", {
2395
+ return (h, w) => (n(), i("div", {
2396
+ class: $({ "mb-3": o.value || u.value || r.value })
2397
+ }, [
2398
+ o.value ? (n(), i("label", {
1996
2399
  key: 0,
1997
- for: e.id,
2400
+ for: s.value,
1998
2401
  class: "form-label"
1999
2402
  }, [
2000
- w(m(e.label) + " ", 1),
2001
- e.required ? (i(), s("span", Xa, "*")) : b("", !0)
2002
- ], 8, Ra)) : b("", !0),
2003
- h("textarea", {
2004
- id: e.id,
2005
- class: g(l.value),
2403
+ I(k(e.label) + " ", 1),
2404
+ e.required ? (n(), i("span", el, "*")) : y("", !0)
2405
+ ], 8, _a)) : y("", !0),
2406
+ S("textarea", {
2407
+ id: s.value,
2408
+ class: $(c.value),
2409
+ style: K(b.value),
2006
2410
  value: e.modelValue,
2007
2411
  placeholder: e.placeholder,
2412
+ rows: e.rows,
2413
+ maxlength: e.maxlength,
2008
2414
  disabled: e.disabled,
2009
2415
  readonly: e.readonly,
2010
2416
  required: e.required,
2011
- rows: e.rows,
2012
- maxlength: e.maxlength,
2013
2417
  "aria-invalid": e.validationState === "invalid",
2014
- "aria-describedby": e.validationMessage || e.helpText ? `${e.id}-feedback` : void 0,
2015
- onInput: u,
2016
- onChange: o,
2017
- onBlur: n,
2018
- onFocus: c
2019
- }, null, 42, Ya),
2020
- e.showCharCount ? (i(), s("div", Ga, m(d.value), 1)) : b("", !0),
2021
- e.helpText && !e.validationMessage && !e.showCharCount ? (i(), s("div", {
2022
- key: 2,
2023
- id: `${e.id}-feedback`,
2024
- class: "form-text"
2025
- }, m(e.helpText), 9, Ha)) : b("", !0),
2026
- e.validationState === "valid" ? (i(), s("div", Ka, m(e.validationMessage || "Looks good!"), 1)) : b("", !0),
2027
- e.validationState === "invalid" ? (i(), s("div", {
2028
- key: 4,
2029
- id: `${e.id}-feedback`,
2030
- class: "invalid-feedback",
2031
- style: { display: "block" }
2032
- }, m(e.validationMessage || "Please provide a valid value."), 9, Ua)) : b("", !0)
2033
- ]));
2418
+ "aria-describedby": e.validationMessage || e.helpText || e.showCharCount ? `${s.value}-feedback` : void 0,
2419
+ onInput: C,
2420
+ onChange: p,
2421
+ onBlur: d,
2422
+ onFocus: f
2423
+ }, null, 46, tl),
2424
+ u.value ? (n(), i("div", {
2425
+ key: 1,
2426
+ id: `${s.value}-feedback`,
2427
+ class: "form-text d-flex justify-content-between"
2428
+ }, [
2429
+ S("span", null, k(e.helpText), 1),
2430
+ e.showCharCount ? (n(), i("span", ll, [
2431
+ e.maxlength ? (n(), i(F, { key: 0 }, [
2432
+ I(k(g.value) + " / " + k(e.maxlength), 1)
2433
+ ], 64)) : (n(), i(F, { key: 1 }, [
2434
+ I(k(g.value), 1)
2435
+ ], 64))
2436
+ ])) : y("", !0)
2437
+ ], 8, al)) : y("", !0),
2438
+ r.value ? (n(), i(F, { key: 2 }, [
2439
+ e.validationState === "valid" ? (n(), i("div", ol, k(e.validationMessage || "Looks good!"), 1)) : y("", !0),
2440
+ e.validationState === "invalid" ? (n(), i("div", {
2441
+ key: 1,
2442
+ id: `${s.value}-feedback`,
2443
+ class: "invalid-feedback",
2444
+ style: { display: "block" }
2445
+ }, k(e.validationMessage || "Please provide a valid value."), 9, sl)) : y("", !0)
2446
+ ], 64)) : y("", !0)
2447
+ ], 2));
2034
2448
  }
2035
- }), Wa = { class: "mb-3" }, Ja = ["for"], Za = {
2449
+ }), il = ["for"], rl = {
2036
2450
  key: 0,
2037
2451
  class: "text-danger"
2038
- }, _a = ["disabled"], el = ["id", "value", "disabled", "readonly", "required", "min", "max", "step", "aria-invalid", "aria-describedby"], tl = ["disabled"], al = ["id"], ll = {
2039
- key: 2,
2452
+ }, dl = ["disabled"], ul = ["id", "value", "disabled", "readonly", "required", "min", "max", "step", "aria-invalid", "aria-describedby"], cl = ["disabled"], vl = ["id"], fl = {
2453
+ key: 0,
2040
2454
  class: "valid-feedback",
2041
2455
  style: { display: "block" }
2042
- }, il = ["id"], sl = /* @__PURE__ */ x({
2456
+ }, bl = ["id"], hl = /* @__PURE__ */ M({
2043
2457
  __name: "VibeFormSpinbutton",
2044
2458
  props: {
2045
2459
  modelValue: {
@@ -2047,7 +2461,7 @@ const fe = /* @__PURE__ */ x({
2047
2461
  default: 0,
2048
2462
  validator: (e) => !0
2049
2463
  },
2050
- id: { type: String, required: !0 },
2464
+ id: { type: String, default: void 0 },
2051
2465
  label: { type: String, default: void 0 },
2052
2466
  disabled: { type: Boolean, default: !1 },
2053
2467
  readonly: { type: Boolean, default: !1 },
@@ -2065,57 +2479,59 @@ const fe = /* @__PURE__ */ x({
2065
2479
  vertical: { type: Boolean, default: !1 }
2066
2480
  },
2067
2481
  emits: ["update:modelValue", "validate", "blur", "focus", "input", "change", "increment", "decrement"],
2068
- setup(e, { emit: f }) {
2069
- const t = e, a = f, l = y(() => {
2070
- const $ = ["form-control"];
2071
- return t.size && $.push(`form-control-${t.size}`), t.validationState === "valid" && $.push("is-valid"), t.validationState === "invalid" && $.push("is-invalid"), $.join(" ");
2072
- }), r = y(() => {
2073
- const $ = ["input-group"];
2074
- return t.size && $.push(`input-group-${t.size}`), t.vertical && $.push("input-group-vertical"), $.join(" ");
2075
- }), d = y(() => t.disabled || t.readonly ? !1 : t.min === void 0 || t.wrap ? !0 : t.modelValue > t.min), u = y(() => t.disabled || t.readonly ? !1 : t.max === void 0 || t.wrap ? !0 : t.modelValue < t.max), o = ($) => {
2076
- const L = $.target;
2077
- let z = L.value === "" ? 0 : Number(L.value);
2078
- t.min !== void 0 && z < t.min && (z = t.min), t.max !== void 0 && z > t.max && (z = t.max), a("update:modelValue", z), a("input", $), t.validateOn === "input" && a("validate");
2079
- }, n = ($) => {
2080
- a("change", $), t.validateOn === "change" && a("validate");
2081
- }, c = ($) => {
2082
- a("blur", $), t.validateOn === "blur" && a("validate");
2083
- }, v = ($) => {
2084
- a("focus", $);
2085
- }, p = () => {
2086
- if (!u.value) return;
2087
- let $ = t.modelValue + t.step;
2088
- t.max !== void 0 && $ > t.max && ($ = t.wrap ? t.min ?? 0 : t.max), a("update:modelValue", $), a("increment", $), t.validateOn === "change" && a("validate");
2089
- }, B = () => {
2090
- if (!d.value) return;
2091
- let $ = t.modelValue - t.step;
2092
- t.min !== void 0 && $ < t.min && ($ = t.wrap ? t.max ?? 0 : t.min), a("update:modelValue", $), a("decrement", $), t.validateOn === "change" && a("validate");
2482
+ setup(e, { emit: v }) {
2483
+ const t = e, a = v, l = J("vibeFormGroup", null), s = m(() => t.id || l?.consumeId() || G("spinbutton")), o = m(() => !!t.label && !l?.hasLabel.value), r = m(() => !!t.validationState && !l?.hasValidation.value), u = m(() => !!t.helpText && !l?.hasHelp.value), c = m(() => {
2484
+ const V = ["form-control"];
2485
+ return t.size && V.push(`form-control-${t.size}`), t.validationState === "valid" && V.push("is-valid"), t.validationState === "invalid" && V.push("is-invalid"), V.join(" ");
2486
+ }), b = m(() => {
2487
+ const V = ["input-group"];
2488
+ return t.size && V.push(`input-group-${t.size}`), t.vertical && V.push("input-group-vertical"), V.join(" ");
2489
+ }), g = m(() => t.disabled || t.readonly ? !1 : t.min === void 0 || t.wrap ? !0 : t.modelValue > t.min), C = m(() => t.disabled || t.readonly ? !1 : t.max === void 0 || t.wrap ? !0 : t.modelValue < t.max), p = (V) => {
2490
+ const q = V.target;
2491
+ let P = q.value === "" ? 0 : Number(q.value);
2492
+ t.min !== void 0 && P < t.min && (P = t.min), t.max !== void 0 && P > t.max && (P = t.max), a("update:modelValue", P), a("input", V), t.validateOn === "input" && a("validate");
2493
+ }, d = (V) => {
2494
+ a("change", V), t.validateOn === "change" && a("validate");
2495
+ }, f = (V) => {
2496
+ a("blur", V), t.validateOn === "blur" && a("validate");
2497
+ }, h = (V) => {
2498
+ a("focus", V);
2499
+ }, w = () => {
2500
+ if (!C.value) return;
2501
+ let V = t.modelValue + t.step;
2502
+ t.max !== void 0 && V > t.max && (V = t.wrap ? t.min ?? 0 : t.max), a("update:modelValue", V), a("increment", V), t.validateOn === "change" && a("validate");
2503
+ }, x = () => {
2504
+ if (!g.value) return;
2505
+ let V = t.modelValue - t.step;
2506
+ t.min !== void 0 && V < t.min && (V = t.wrap ? t.max ?? 0 : t.min), a("update:modelValue", V), a("decrement", V), t.validateOn === "change" && a("validate");
2093
2507
  };
2094
- return ($, L) => (i(), s("div", Wa, [
2095
- e.label ? (i(), s("label", {
2508
+ return (V, q) => (n(), i("div", {
2509
+ class: $({ "mb-3": o.value || u.value || r.value })
2510
+ }, [
2511
+ o.value ? (n(), i("label", {
2096
2512
  key: 0,
2097
- for: e.id,
2513
+ for: s.value,
2098
2514
  class: "form-label"
2099
2515
  }, [
2100
- w(m(e.label) + " ", 1),
2101
- e.required ? (i(), s("span", Za, "*")) : b("", !0)
2102
- ], 8, Ja)) : b("", !0),
2103
- h("div", {
2104
- class: g(r.value)
2516
+ I(k(e.label) + " ", 1),
2517
+ e.required ? (n(), i("span", rl, "*")) : y("", !0)
2518
+ ], 8, il)) : y("", !0),
2519
+ S("div", {
2520
+ class: $(b.value)
2105
2521
  }, [
2106
- h("button", {
2522
+ S("button", {
2107
2523
  class: "btn btn-outline-secondary",
2108
2524
  type: "button",
2109
- disabled: !d.value,
2110
- onClick: B,
2525
+ disabled: !g.value,
2526
+ onClick: x,
2111
2527
  "aria-label": "Decrement"
2112
- }, [...L[0] || (L[0] = [
2113
- h("span", { "aria-hidden": "true" }, "−", -1)
2114
- ])], 8, _a),
2115
- h("input", {
2116
- id: e.id,
2528
+ }, [...q[0] || (q[0] = [
2529
+ S("span", { "aria-hidden": "true" }, "−", -1)
2530
+ ])], 8, dl),
2531
+ S("input", {
2532
+ id: s.value,
2117
2533
  type: "number",
2118
- class: g(l.value),
2534
+ class: $(c.value),
2119
2535
  value: e.modelValue,
2120
2536
  disabled: e.disabled,
2121
2537
  readonly: e.readonly,
@@ -2124,44 +2540,46 @@ const fe = /* @__PURE__ */ x({
2124
2540
  max: e.max,
2125
2541
  step: e.step,
2126
2542
  "aria-invalid": e.validationState === "invalid",
2127
- "aria-describedby": e.validationMessage || e.helpText ? `${e.id}-feedback` : void 0,
2128
- onInput: o,
2129
- onChange: n,
2130
- onBlur: c,
2131
- onFocus: v
2132
- }, null, 42, el),
2133
- h("button", {
2543
+ "aria-describedby": e.validationMessage || e.helpText ? `${s.value}-feedback` : void 0,
2544
+ onInput: p,
2545
+ onChange: d,
2546
+ onBlur: f,
2547
+ onFocus: h
2548
+ }, null, 42, ul),
2549
+ S("button", {
2134
2550
  class: "btn btn-outline-secondary",
2135
2551
  type: "button",
2136
- disabled: !u.value,
2137
- onClick: p,
2552
+ disabled: !C.value,
2553
+ onClick: w,
2138
2554
  "aria-label": "Increment"
2139
- }, [...L[1] || (L[1] = [
2140
- h("span", { "aria-hidden": "true" }, "+", -1)
2141
- ])], 8, tl)
2555
+ }, [...q[1] || (q[1] = [
2556
+ S("span", { "aria-hidden": "true" }, "+", -1)
2557
+ ])], 8, cl)
2142
2558
  ], 2),
2143
- e.helpText && !e.validationMessage ? (i(), s("div", {
2559
+ u.value ? (n(), i("div", {
2144
2560
  key: 1,
2145
- id: `${e.id}-feedback`,
2561
+ id: `${s.value}-feedback`,
2146
2562
  class: "form-text"
2147
- }, m(e.helpText), 9, al)) : b("", !0),
2148
- e.validationState === "valid" ? (i(), s("div", ll, m(e.validationMessage || "Looks good!"), 1)) : b("", !0),
2149
- e.validationState === "invalid" ? (i(), s("div", {
2150
- key: 3,
2151
- id: `${e.id}-feedback`,
2152
- class: "invalid-feedback",
2153
- style: { display: "block" }
2154
- }, m(e.validationMessage || "Please provide a valid value."), 9, il)) : b("", !0)
2155
- ]));
2563
+ }, k(e.helpText), 9, vl)) : y("", !0),
2564
+ r.value ? (n(), i(F, { key: 2 }, [
2565
+ e.validationState === "valid" ? (n(), i("div", fl, k(e.validationMessage || "Looks good!"), 1)) : y("", !0),
2566
+ e.validationState === "invalid" ? (n(), i("div", {
2567
+ key: 1,
2568
+ id: `${s.value}-feedback`,
2569
+ class: "invalid-feedback",
2570
+ style: { display: "block" }
2571
+ }, k(e.validationMessage || "Please provide a valid value."), 9, bl)) : y("", !0)
2572
+ ], 64)) : y("", !0)
2573
+ ], 2));
2156
2574
  }
2157
- }), nl = /* @__PURE__ */ Q(sl, [["__scopeId", "data-v-fbee244e"]]), ol = { class: "mb-3" }, dl = ["for"], rl = {
2575
+ }), ml = /* @__PURE__ */ re(hl, [["__scopeId", "data-v-49746a62"]]), pl = ["for"], yl = {
2158
2576
  key: 0,
2159
2577
  class: "text-danger"
2160
- }, ul = ["id", "type", "value", "disabled", "readonly", "required", "min", "max", "aria-invalid", "aria-describedby"], cl = ["id"], fl = {
2161
- key: 2,
2578
+ }, gl = ["id", "type", "value", "disabled", "readonly", "required", "min", "max", "aria-invalid", "aria-describedby"], kl = ["id"], Sl = {
2579
+ key: 0,
2162
2580
  class: "valid-feedback",
2163
2581
  style: { display: "block" }
2164
- }, vl = ["id"], bl = /* @__PURE__ */ x({
2582
+ }, $l = ["id"], wl = /* @__PURE__ */ M({
2165
2583
  __name: "VibeFormDatepicker",
2166
2584
  props: {
2167
2585
  modelValue: {
@@ -2169,7 +2587,7 @@ const fe = /* @__PURE__ */ x({
2169
2587
  default: "",
2170
2588
  validator: (e) => !0
2171
2589
  },
2172
- id: { type: String, required: !0 },
2590
+ id: { type: String, default: void 0 },
2173
2591
  label: { type: String, default: void 0 },
2174
2592
  disabled: { type: Boolean, default: !1 },
2175
2593
  readonly: { type: Boolean, default: !1 },
@@ -2185,33 +2603,35 @@ const fe = /* @__PURE__ */ x({
2185
2603
  type: { type: String, default: "date" }
2186
2604
  },
2187
2605
  emits: ["update:modelValue", "validate", "blur", "focus", "input", "change"],
2188
- setup(e, { emit: f }) {
2189
- const t = e, a = f, l = y(() => {
2190
- const n = ["form-control"];
2191
- return t.size && n.push(`form-control-${t.size}`), t.validationState === "valid" && n.push("is-valid"), t.validationState === "invalid" && n.push("is-invalid"), n.join(" ");
2192
- }), r = (n) => {
2193
- const c = n.target;
2194
- a("update:modelValue", c.value), a("input", n), t.validateOn === "input" && a("validate");
2195
- }, d = (n) => {
2196
- a("change", n), t.validateOn === "change" && a("validate");
2197
- }, u = (n) => {
2198
- a("blur", n), t.validateOn === "blur" && a("validate");
2199
- }, o = (n) => {
2200
- a("focus", n);
2606
+ setup(e, { emit: v }) {
2607
+ const t = e, a = v, l = J("vibeFormGroup", null), s = m(() => t.id || l?.consumeId() || G("datepicker")), o = m(() => !!t.label && !l?.hasLabel.value), r = m(() => !!t.validationState && !l?.hasValidation.value), u = m(() => !!t.helpText && !l?.hasHelp.value), c = m(() => {
2608
+ const d = ["form-control"];
2609
+ return t.size && d.push(`form-control-${t.size}`), t.validationState === "valid" && d.push("is-valid"), t.validationState === "invalid" && d.push("is-invalid"), d.join(" ");
2610
+ }), b = (d) => {
2611
+ const f = d.target;
2612
+ a("update:modelValue", f.value), a("input", d), t.validateOn === "input" && a("validate");
2613
+ }, g = (d) => {
2614
+ a("change", d), t.validateOn === "change" && a("validate");
2615
+ }, C = (d) => {
2616
+ a("blur", d), t.validateOn === "blur" && a("validate");
2617
+ }, p = (d) => {
2618
+ a("focus", d);
2201
2619
  };
2202
- return (n, c) => (i(), s("div", ol, [
2203
- e.label ? (i(), s("label", {
2620
+ return (d, f) => (n(), i("div", {
2621
+ class: $({ "mb-3": o.value || u.value || r.value })
2622
+ }, [
2623
+ o.value ? (n(), i("label", {
2204
2624
  key: 0,
2205
- for: e.id,
2625
+ for: s.value,
2206
2626
  class: "form-label"
2207
2627
  }, [
2208
- w(m(e.label) + " ", 1),
2209
- e.required ? (i(), s("span", rl, "*")) : b("", !0)
2210
- ], 8, dl)) : b("", !0),
2211
- h("input", {
2212
- id: e.id,
2628
+ I(k(e.label) + " ", 1),
2629
+ e.required ? (n(), i("span", yl, "*")) : y("", !0)
2630
+ ], 8, pl)) : y("", !0),
2631
+ S("input", {
2632
+ id: s.value,
2213
2633
  type: e.type,
2214
- class: g(l.value),
2634
+ class: $(c.value),
2215
2635
  value: e.modelValue,
2216
2636
  disabled: e.disabled,
2217
2637
  readonly: e.readonly,
@@ -2219,293 +2639,305 @@ const fe = /* @__PURE__ */ x({
2219
2639
  min: e.min,
2220
2640
  max: e.max,
2221
2641
  "aria-invalid": e.validationState === "invalid",
2222
- "aria-describedby": e.validationMessage || e.helpText ? `${e.id}-feedback` : void 0,
2223
- onInput: r,
2224
- onChange: d,
2225
- onBlur: u,
2226
- onFocus: o
2227
- }, null, 42, ul),
2228
- e.helpText && !e.validationMessage ? (i(), s("div", {
2642
+ "aria-describedby": e.validationMessage || e.helpText ? `${s.value}-feedback` : void 0,
2643
+ onInput: b,
2644
+ onChange: g,
2645
+ onBlur: C,
2646
+ onFocus: p
2647
+ }, null, 42, gl),
2648
+ u.value ? (n(), i("div", {
2229
2649
  key: 1,
2230
- id: `${e.id}-feedback`,
2650
+ id: `${s.value}-feedback`,
2231
2651
  class: "form-text"
2232
- }, m(e.helpText), 9, cl)) : b("", !0),
2233
- e.validationState === "valid" ? (i(), s("div", fl, m(e.validationMessage || "Looks good!"), 1)) : b("", !0),
2234
- e.validationState === "invalid" ? (i(), s("div", {
2235
- key: 3,
2236
- id: `${e.id}-feedback`,
2237
- class: "invalid-feedback",
2238
- style: { display: "block" }
2239
- }, m(e.validationMessage || "Please provide a valid date."), 9, vl)) : b("", !0)
2240
- ]));
2652
+ }, k(e.helpText), 9, kl)) : y("", !0),
2653
+ r.value ? (n(), i(F, { key: 2 }, [
2654
+ e.validationState === "valid" ? (n(), i("div", Sl, k(e.validationMessage || "Looks good!"), 1)) : y("", !0),
2655
+ e.validationState === "invalid" ? (n(), i("div", {
2656
+ key: 1,
2657
+ id: `${s.value}-feedback`,
2658
+ class: "invalid-feedback",
2659
+ style: { display: "block" }
2660
+ }, k(e.validationMessage || "Please provide a valid date."), 9, $l)) : y("", !0)
2661
+ ], 64)) : y("", !0)
2662
+ ], 2));
2241
2663
  }
2242
- }), ml = ["id", "checked", "value", "disabled", "required", "indeterminate", "aria-invalid", "aria-describedby"], hl = ["for"], yl = {
2664
+ }), Vl = ["id", "checked", "disabled", "required", "indeterminate", "aria-invalid", "aria-describedby"], Cl = ["for"], xl = {
2243
2665
  key: 0,
2244
2666
  class: "text-danger"
2245
- }, gl = ["id"], pl = {
2246
- key: 2,
2667
+ }, Bl = ["id"], Ll = {
2668
+ key: 0,
2247
2669
  class: "valid-feedback",
2248
2670
  style: { display: "block" }
2249
- }, kl = ["id"], $l = /* @__PURE__ */ x({
2671
+ }, Tl = ["id"], Nl = /* @__PURE__ */ M({
2250
2672
  __name: "VibeFormCheckbox",
2251
2673
  props: {
2252
2674
  modelValue: {
2253
2675
  type: [Boolean, Array],
2254
- default: !1,
2255
- validator: (e) => !0
2676
+ default: !1
2256
2677
  },
2257
- id: { type: String, required: !0 },
2258
- label: { type: String, default: void 0 },
2259
2678
  value: { type: [String, Number, Boolean], default: !0 },
2679
+ id: { type: String, default: void 0 },
2680
+ label: { type: String, default: void 0 },
2260
2681
  disabled: { type: Boolean, default: !1 },
2261
2682
  required: { type: Boolean, default: !1 },
2262
2683
  inline: { type: Boolean, default: !1 },
2684
+ indeterminate: { type: Boolean, default: !1 },
2263
2685
  validationState: { type: String, default: null },
2264
2686
  validationMessage: { type: String, default: void 0 },
2265
2687
  validationRules: { type: [Array, Function], default: void 0 },
2266
- validateOn: { type: String, default: "blur" },
2688
+ validateOn: { type: String, default: "change" },
2267
2689
  helpText: { type: String, default: void 0 },
2268
- indeterminate: { type: Boolean, default: !1 }
2690
+ reverse: { type: Boolean, default: !1 }
2269
2691
  },
2270
2692
  emits: ["update:modelValue", "validate", "blur", "focus", "change"],
2271
- setup(e, { emit: f }) {
2272
- const t = e, a = f, l = y(() => {
2273
- const c = ["form-check-input"];
2274
- return t.validationState === "valid" && c.push("is-valid"), t.validationState === "invalid" && c.push("is-invalid"), c.join(" ");
2275
- }), r = y(() => {
2276
- const c = ["form-check"];
2277
- return t.inline && c.push("form-check-inline"), c.join(" ");
2278
- }), d = y(() => Array.isArray(t.modelValue) ? t.modelValue.includes(t.value) : t.modelValue === t.value || t.modelValue === !0), u = (c) => {
2279
- const v = c.target;
2280
- let p;
2693
+ setup(e, { emit: v }) {
2694
+ const t = e, a = v, l = J("vibeFormGroup", null), s = m(() => t.id || l?.consumeId() || G("checkbox")), o = m(() => !!t.label && !l?.hasLabel.value), r = m(() => !!t.validationState && !l?.hasValidation.value), u = m(() => !!t.helpText && !l?.hasHelp.value), c = m(() => {
2695
+ const f = ["form-check"];
2696
+ return t.inline && f.push("form-check-inline"), t.reverse && f.push("form-check-reverse"), f.join(" ");
2697
+ }), b = m(() => {
2698
+ const f = ["form-check-input"];
2699
+ return t.validationState === "valid" && f.push("is-valid"), t.validationState === "invalid" && f.push("is-invalid"), f.join(" ");
2700
+ }), g = m(() => Array.isArray(t.modelValue) ? t.modelValue.includes(t.value) : t.modelValue === t.value), C = (f) => {
2701
+ const h = f.target;
2702
+ let w;
2281
2703
  if (Array.isArray(t.modelValue))
2282
- if (p = [...t.modelValue], v.checked)
2283
- p.includes(t.value) || p.push(t.value);
2704
+ if (w = [...t.modelValue], h.checked)
2705
+ w.push(t.value);
2284
2706
  else {
2285
- const B = p.indexOf(t.value);
2286
- B > -1 && p.splice(B, 1);
2707
+ const x = w.indexOf(t.value);
2708
+ x > -1 && w.splice(x, 1);
2287
2709
  }
2288
2710
  else
2289
- p = v.checked;
2290
- a("update:modelValue", p), a("change", c), t.validateOn === "change" && a("validate");
2291
- }, o = (c) => {
2292
- a("blur", c), t.validateOn === "blur" && a("validate");
2293
- }, n = (c) => {
2294
- a("focus", c);
2711
+ w = h.checked ? t.value : t.value === !0 ? !1 : null;
2712
+ a("update:modelValue", w), a("change", f), t.validateOn === "change" && a("validate");
2713
+ }, p = (f) => {
2714
+ a("blur", f), t.validateOn === "blur" && a("validate");
2715
+ }, d = (f) => {
2716
+ a("focus", f);
2295
2717
  };
2296
- return (c, v) => (i(), s("div", {
2297
- class: g(r.value)
2718
+ return (f, h) => (n(), i("div", {
2719
+ class: $([c.value, { "mb-3": o.value || u.value || r.value }])
2298
2720
  }, [
2299
- h("input", {
2300
- id: e.id,
2721
+ S("input", {
2722
+ id: s.value,
2301
2723
  type: "checkbox",
2302
- class: g(l.value),
2303
- checked: d.value,
2304
- value: e.value,
2724
+ class: $(b.value),
2725
+ checked: g.value,
2305
2726
  disabled: e.disabled,
2306
2727
  required: e.required,
2307
2728
  indeterminate: e.indeterminate,
2308
2729
  "aria-invalid": e.validationState === "invalid",
2309
- "aria-describedby": e.validationMessage || e.helpText ? `${e.id}-feedback` : void 0,
2310
- onChange: u,
2311
- onBlur: o,
2312
- onFocus: n
2313
- }, null, 42, ml),
2314
- e.label ? (i(), s("label", {
2730
+ "aria-describedby": e.validationMessage || e.helpText ? `${s.value}-feedback` : void 0,
2731
+ onChange: C,
2732
+ onBlur: p,
2733
+ onFocus: d
2734
+ }, null, 42, Vl),
2735
+ o.value ? (n(), i("label", {
2315
2736
  key: 0,
2316
- for: e.id,
2737
+ for: s.value,
2317
2738
  class: "form-check-label"
2318
2739
  }, [
2319
- w(m(e.label) + " ", 1),
2320
- e.required ? (i(), s("span", yl, "*")) : b("", !0)
2321
- ], 8, hl)) : b("", !0),
2322
- e.helpText && !e.validationMessage ? (i(), s("div", {
2740
+ I(k(e.label) + " ", 1),
2741
+ e.required ? (n(), i("span", xl, "*")) : y("", !0)
2742
+ ], 8, Cl)) : y("", !0),
2743
+ u.value ? (n(), i("div", {
2323
2744
  key: 1,
2324
- id: `${e.id}-feedback`,
2745
+ id: `${s.value}-feedback`,
2325
2746
  class: "form-text"
2326
- }, m(e.helpText), 9, gl)) : b("", !0),
2327
- e.validationState === "valid" ? (i(), s("div", pl, m(e.validationMessage || "Looks good!"), 1)) : b("", !0),
2328
- e.validationState === "invalid" ? (i(), s("div", {
2329
- key: 3,
2330
- id: `${e.id}-feedback`,
2331
- class: "invalid-feedback",
2332
- style: { display: "block" }
2333
- }, m(e.validationMessage || "You must check this box."), 9, kl)) : b("", !0)
2747
+ }, k(e.helpText), 9, Bl)) : y("", !0),
2748
+ r.value ? (n(), i(F, { key: 2 }, [
2749
+ e.validationState === "valid" ? (n(), i("div", Ll, k(e.validationMessage || "Looks good!"), 1)) : y("", !0),
2750
+ e.validationState === "invalid" ? (n(), i("div", {
2751
+ key: 1,
2752
+ id: `${s.value}-feedback`,
2753
+ class: "invalid-feedback",
2754
+ style: { display: "block" }
2755
+ }, k(e.validationMessage || "Please check this box."), 9, Tl)) : y("", !0)
2756
+ ], 64)) : y("", !0)
2334
2757
  ], 2));
2335
2758
  }
2336
- }), Sl = ["id", "checked", "value", "name", "disabled", "required", "aria-invalid", "aria-describedby"], Vl = ["for"], Cl = {
2759
+ }), El = ["id", "name", "value", "checked", "disabled", "required", "aria-invalid", "aria-describedby"], Ml = ["for"], Il = {
2337
2760
  key: 0,
2338
2761
  class: "text-danger"
2339
- }, xl = ["id"], wl = {
2340
- key: 2,
2762
+ }, Fl = ["id"], Pl = {
2763
+ key: 0,
2341
2764
  class: "valid-feedback",
2342
2765
  style: { display: "block" }
2343
- }, Bl = ["id"], Nl = /* @__PURE__ */ x({
2766
+ }, Rl = ["id"], ql = /* @__PURE__ */ M({
2344
2767
  __name: "VibeFormRadio",
2345
2768
  props: {
2346
2769
  modelValue: {
2347
2770
  type: [String, Number, Boolean],
2348
- default: void 0,
2349
- validator: (e) => !0
2771
+ default: ""
2350
2772
  },
2351
- id: { type: String, required: !0 },
2352
- label: { type: String, default: void 0 },
2353
2773
  value: { type: [String, Number, Boolean], required: !0 },
2354
2774
  name: { type: String, required: !0 },
2775
+ id: { type: String, default: void 0 },
2776
+ label: { type: String, default: void 0 },
2355
2777
  disabled: { type: Boolean, default: !1 },
2356
2778
  required: { type: Boolean, default: !1 },
2357
2779
  inline: { type: Boolean, default: !1 },
2358
2780
  validationState: { type: String, default: null },
2359
2781
  validationMessage: { type: String, default: void 0 },
2360
2782
  validationRules: { type: [Array, Function], default: void 0 },
2361
- validateOn: { type: String, default: "blur" },
2362
- helpText: { type: String, default: void 0 }
2783
+ validateOn: { type: String, default: "change" },
2784
+ helpText: { type: String, default: void 0 },
2785
+ reverse: { type: Boolean, default: !1 }
2363
2786
  },
2364
2787
  emits: ["update:modelValue", "validate", "blur", "focus", "change"],
2365
- setup(e, { emit: f }) {
2366
- const t = e, a = f, l = y(() => {
2367
- const c = ["form-check-input"];
2368
- return t.validationState === "valid" && c.push("is-valid"), t.validationState === "invalid" && c.push("is-invalid"), c.join(" ");
2369
- }), r = y(() => {
2370
- const c = ["form-check"];
2371
- return t.inline && c.push("form-check-inline"), c.join(" ");
2372
- }), d = y(() => t.modelValue === t.value), u = (c) => {
2373
- c.target.checked && a("update:modelValue", t.value), a("change", c), t.validateOn === "change" && a("validate");
2374
- }, o = (c) => {
2375
- a("blur", c), t.validateOn === "blur" && a("validate");
2376
- }, n = (c) => {
2377
- a("focus", c);
2788
+ setup(e, { emit: v }) {
2789
+ const t = e, a = v, l = J("vibeFormGroup", null), s = m(() => t.id || l?.consumeId() || G("radio")), o = m(() => !!t.label && !l?.hasLabel.value), r = m(() => !!t.validationState && !l?.hasValidation.value), u = m(() => !!t.helpText && !l?.hasHelp.value), c = m(() => {
2790
+ const f = ["form-check"];
2791
+ return t.inline && f.push("form-check-inline"), t.reverse && f.push("form-check-reverse"), f.join(" ");
2792
+ }), b = m(() => {
2793
+ const f = ["form-check-input"];
2794
+ return t.validationState === "valid" && f.push("is-valid"), t.validationState === "invalid" && f.push("is-invalid"), f.join(" ");
2795
+ }), g = m(() => t.modelValue === t.value), C = (f) => {
2796
+ a("update:modelValue", t.value), a("change", f), t.validateOn === "change" && a("validate");
2797
+ }, p = (f) => {
2798
+ a("blur", f), t.validateOn === "blur" && a("validate");
2799
+ }, d = (f) => {
2800
+ a("focus", f);
2378
2801
  };
2379
- return (c, v) => (i(), s("div", {
2380
- class: g(r.value)
2802
+ return (f, h) => (n(), i("div", {
2803
+ class: $([c.value, { "mb-3": o.value || u.value || r.value }])
2381
2804
  }, [
2382
- h("input", {
2383
- id: e.id,
2805
+ S("input", {
2806
+ id: s.value,
2384
2807
  type: "radio",
2385
- class: g(l.value),
2386
- checked: d.value,
2387
- value: e.value,
2808
+ class: $(b.value),
2388
2809
  name: e.name,
2810
+ value: e.value,
2811
+ checked: g.value,
2389
2812
  disabled: e.disabled,
2390
2813
  required: e.required,
2391
2814
  "aria-invalid": e.validationState === "invalid",
2392
- "aria-describedby": e.validationMessage || e.helpText ? `${e.id}-feedback` : void 0,
2393
- onChange: u,
2394
- onBlur: o,
2395
- onFocus: n
2396
- }, null, 42, Sl),
2397
- e.label ? (i(), s("label", {
2815
+ "aria-describedby": e.validationMessage || e.helpText ? `${s.value}-feedback` : void 0,
2816
+ onChange: C,
2817
+ onBlur: p,
2818
+ onFocus: d
2819
+ }, null, 42, El),
2820
+ o.value ? (n(), i("label", {
2398
2821
  key: 0,
2399
- for: e.id,
2822
+ for: s.value,
2400
2823
  class: "form-check-label"
2401
2824
  }, [
2402
- w(m(e.label) + " ", 1),
2403
- e.required ? (i(), s("span", Cl, "*")) : b("", !0)
2404
- ], 8, Vl)) : b("", !0),
2405
- e.helpText && !e.validationMessage ? (i(), s("div", {
2825
+ I(k(e.label) + " ", 1),
2826
+ e.required ? (n(), i("span", Il, "*")) : y("", !0)
2827
+ ], 8, Ml)) : y("", !0),
2828
+ u.value ? (n(), i("div", {
2406
2829
  key: 1,
2407
- id: `${e.id}-feedback`,
2830
+ id: `${s.value}-feedback`,
2408
2831
  class: "form-text"
2409
- }, m(e.helpText), 9, xl)) : b("", !0),
2410
- e.validationState === "valid" ? (i(), s("div", wl, m(e.validationMessage || "Looks good!"), 1)) : b("", !0),
2411
- e.validationState === "invalid" ? (i(), s("div", {
2412
- key: 3,
2413
- id: `${e.id}-feedback`,
2414
- class: "invalid-feedback",
2415
- style: { display: "block" }
2416
- }, m(e.validationMessage || "Please select an option."), 9, Bl)) : b("", !0)
2832
+ }, k(e.helpText), 9, Fl)) : y("", !0),
2833
+ r.value ? (n(), i(F, { key: 2 }, [
2834
+ e.validationState === "valid" ? (n(), i("div", Pl, k(e.validationMessage || "Looks good!"), 1)) : y("", !0),
2835
+ e.validationState === "invalid" ? (n(), i("div", {
2836
+ key: 1,
2837
+ id: `${s.value}-feedback`,
2838
+ class: "invalid-feedback",
2839
+ style: { display: "block" }
2840
+ }, k(e.validationMessage || "Please select an option."), 9, Rl)) : y("", !0)
2841
+ ], 64)) : y("", !0)
2417
2842
  ], 2));
2418
2843
  }
2419
- }), Tl = { class: "form-check form-switch" }, Ml = ["id", "checked", "disabled", "required", "aria-invalid", "aria-describedby"], ql = ["for"], Pl = {
2844
+ }), zl = ["id", "checked", "disabled", "required", "aria-invalid", "aria-describedby"], Al = ["for"], jl = {
2420
2845
  key: 0,
2421
2846
  class: "text-danger"
2422
- }, Fl = ["id"], Ll = {
2423
- key: 2,
2847
+ }, Ol = ["id"], Hl = {
2848
+ key: 0,
2424
2849
  class: "valid-feedback",
2425
2850
  style: { display: "block" }
2426
- }, zl = ["id"], jl = /* @__PURE__ */ x({
2851
+ }, Dl = ["id"], Gl = /* @__PURE__ */ M({
2427
2852
  __name: "VibeFormSwitch",
2428
2853
  props: {
2429
2854
  modelValue: {
2430
2855
  type: Boolean,
2431
- default: !1,
2432
- validator: (e) => !0
2856
+ default: !1
2433
2857
  },
2434
- id: { type: String, required: !0 },
2858
+ id: { type: String, default: void 0 },
2435
2859
  label: { type: String, default: void 0 },
2436
2860
  disabled: { type: Boolean, default: !1 },
2437
2861
  required: { type: Boolean, default: !1 },
2862
+ inline: { type: Boolean, default: !1 },
2438
2863
  validationState: { type: String, default: null },
2439
2864
  validationMessage: { type: String, default: void 0 },
2440
2865
  validationRules: { type: [Array, Function], default: void 0 },
2441
- validateOn: { type: String, default: "blur" },
2866
+ validateOn: { type: String, default: "change" },
2442
2867
  helpText: { type: String, default: void 0 }
2443
2868
  },
2444
2869
  emits: ["update:modelValue", "validate", "blur", "focus", "change"],
2445
- setup(e, { emit: f }) {
2446
- const t = e, a = f, l = y(() => {
2447
- const o = ["form-check-input"];
2448
- return t.validationState === "valid" && o.push("is-valid"), t.validationState === "invalid" && o.push("is-invalid"), o.join(" ");
2449
- }), r = (o) => {
2450
- const n = o.target;
2451
- a("update:modelValue", n.checked), a("change", o), t.validateOn === "change" && a("validate");
2452
- }, d = (o) => {
2453
- a("blur", o), t.validateOn === "blur" && a("validate");
2454
- }, u = (o) => {
2455
- a("focus", o);
2870
+ setup(e, { emit: v }) {
2871
+ const t = e, a = v, l = J("vibeFormGroup", null), s = m(() => t.id || l?.consumeId() || G("switch")), o = m(() => !!t.label && !l?.hasLabel.value), r = m(() => !!t.validationState && !l?.hasValidation.value), u = m(() => !!t.helpText && !l?.hasHelp.value), c = m(() => {
2872
+ const d = ["form-check", "form-switch"];
2873
+ return t.inline && d.push("form-check-inline"), d.join(" ");
2874
+ }), b = m(() => {
2875
+ const d = ["form-check-input"];
2876
+ return t.validationState === "valid" && d.push("is-valid"), t.validationState === "invalid" && d.push("is-invalid"), d.join(" ");
2877
+ }), g = (d) => {
2878
+ const f = d.target;
2879
+ a("update:modelValue", f.checked), a("change", d), t.validateOn === "change" && a("validate");
2880
+ }, C = (d) => {
2881
+ a("blur", d), t.validateOn === "blur" && a("validate");
2882
+ }, p = (d) => {
2883
+ a("focus", d);
2456
2884
  };
2457
- return (o, n) => (i(), s("div", Tl, [
2458
- h("input", {
2459
- id: e.id,
2885
+ return (d, f) => (n(), i("div", {
2886
+ class: $([c.value, { "mb-3": o.value || u.value || r.value }])
2887
+ }, [
2888
+ S("input", {
2889
+ id: s.value,
2460
2890
  type: "checkbox",
2461
- class: g(l.value),
2891
+ role: "switch",
2892
+ class: $(b.value),
2462
2893
  checked: e.modelValue,
2463
2894
  disabled: e.disabled,
2464
2895
  required: e.required,
2465
2896
  "aria-invalid": e.validationState === "invalid",
2466
- "aria-describedby": e.validationMessage || e.helpText ? `${e.id}-feedback` : void 0,
2467
- role: "switch",
2468
- onChange: r,
2469
- onBlur: d,
2470
- onFocus: u
2471
- }, null, 42, Ml),
2472
- e.label ? (i(), s("label", {
2897
+ "aria-describedby": e.validationMessage || e.helpText ? `${s.value}-feedback` : void 0,
2898
+ onChange: g,
2899
+ onBlur: C,
2900
+ onFocus: p
2901
+ }, null, 42, zl),
2902
+ o.value ? (n(), i("label", {
2473
2903
  key: 0,
2474
- for: e.id,
2904
+ for: s.value,
2475
2905
  class: "form-check-label"
2476
2906
  }, [
2477
- w(m(e.label) + " ", 1),
2478
- e.required ? (i(), s("span", Pl, "*")) : b("", !0)
2479
- ], 8, ql)) : b("", !0),
2480
- e.helpText && !e.validationMessage ? (i(), s("div", {
2907
+ I(k(e.label) + " ", 1),
2908
+ e.required ? (n(), i("span", jl, "*")) : y("", !0)
2909
+ ], 8, Al)) : y("", !0),
2910
+ u.value ? (n(), i("div", {
2481
2911
  key: 1,
2482
- id: `${e.id}-feedback`,
2912
+ id: `${s.value}-feedback`,
2483
2913
  class: "form-text"
2484
- }, m(e.helpText), 9, Fl)) : b("", !0),
2485
- e.validationState === "valid" ? (i(), s("div", Ll, m(e.validationMessage || "Looks good!"), 1)) : b("", !0),
2486
- e.validationState === "invalid" ? (i(), s("div", {
2487
- key: 3,
2488
- id: `${e.id}-feedback`,
2489
- class: "invalid-feedback",
2490
- style: { display: "block" }
2491
- }, m(e.validationMessage || "You must toggle this switch."), 9, zl)) : b("", !0)
2492
- ]));
2914
+ }, k(e.helpText), 9, Ol)) : y("", !0),
2915
+ r.value ? (n(), i(F, { key: 2 }, [
2916
+ e.validationState === "valid" ? (n(), i("div", Hl, k(e.validationMessage || "Looks good!"), 1)) : y("", !0),
2917
+ e.validationState === "invalid" ? (n(), i("div", {
2918
+ key: 1,
2919
+ id: `${s.value}-feedback`,
2920
+ class: "invalid-feedback",
2921
+ style: { display: "block" }
2922
+ }, k(e.validationMessage || "Please toggle this switch."), 9, Dl)) : y("", !0)
2923
+ ], 64)) : y("", !0)
2924
+ ], 2));
2493
2925
  }
2494
- }), Al = ["for"], Il = {
2926
+ }), Xl = ["for"], Yl = {
2495
2927
  key: 0,
2496
2928
  class: "text-danger"
2497
- }, Ol = ["id"], Dl = {
2929
+ }, Ul = ["id"], Jl = {
2498
2930
  key: 1,
2499
2931
  class: "valid-feedback",
2500
2932
  style: { display: "block" }
2501
- }, El = ["id"], Rl = ["for"], Xl = {
2933
+ }, Kl = ["id"], Ql = ["for"], Wl = {
2502
2934
  key: 0,
2503
2935
  class: "text-danger"
2504
- }, Yl = ["id"], Gl = {
2936
+ }, Zl = ["id"], _l = {
2505
2937
  key: 2,
2506
2938
  class: "valid-feedback",
2507
2939
  style: { display: "block" }
2508
- }, Hl = ["id"], Kl = /* @__PURE__ */ x({
2940
+ }, eo = ["id"], to = /* @__PURE__ */ M({
2509
2941
  __name: "VibeFormGroup",
2510
2942
  props: {
2511
2943
  label: { type: String, default: void 0 },
@@ -2520,85 +2952,93 @@ const fe = /* @__PURE__ */ x({
2520
2952
  labelAlign: { type: String, default: void 0 }
2521
2953
  },
2522
2954
  setup(e) {
2523
- const f = e, t = y(() => {
2524
- const d = [];
2525
- return f.floating ? d.push("form-floating") : f.row ? d.push("row", "mb-3") : d.push("mb-3"), d.join(" ");
2526
- }), a = y(() => {
2527
- const d = [];
2528
- return f.floating ? d.push("form-label") : f.row ? (d.push("col-form-label"), f.labelCols && d.push(`col-sm-${f.labelCols}`), f.labelAlign && d.push(`text-${f.labelAlign}`)) : d.push("form-label"), d.join(" ");
2529
- }), l = y(() => f.row && f.labelCols ? `col-sm-${12 - Number(f.labelCols)}` : ""), r = y(() => f.labelFor ? `${f.labelFor}-feedback` : void 0);
2530
- return (d, u) => (i(), s("div", {
2531
- class: g(t.value)
2955
+ const v = e, t = m(() => v.labelFor || G("form-group")), a = E(!1);
2956
+ ve("vibeFormGroup", {
2957
+ id: t,
2958
+ consumeId: () => a.value ? null : (a.value = !0, t.value),
2959
+ hasLabel: m(() => !!v.label),
2960
+ hasValidation: m(() => !!v.validationState),
2961
+ hasHelp: m(() => !!v.helpText)
2962
+ });
2963
+ const s = m(() => {
2964
+ const c = [];
2965
+ return v.floating ? c.push("form-floating") : v.row ? c.push("row", "mb-3") : c.push("mb-3"), c.join(" ");
2966
+ }), o = m(() => {
2967
+ const c = [];
2968
+ return v.floating ? c.push("form-label") : v.row ? (c.push("col-form-label"), v.labelCols && c.push(`col-sm-${v.labelCols}`), v.labelAlign && c.push(`text-${v.labelAlign}`)) : c.push("form-label"), c.join(" ");
2969
+ }), r = m(() => v.row && v.labelCols ? `col-sm-${12 - Number(v.labelCols)}` : ""), u = m(() => `${t.value}-feedback`);
2970
+ return (c, b) => (n(), i("div", {
2971
+ class: $(s.value)
2532
2972
  }, [
2533
- e.label && !e.floating ? (i(), s("label", {
2973
+ e.label && !e.floating ? (n(), i("label", {
2534
2974
  key: 0,
2535
- for: e.labelFor,
2536
- class: g(a.value)
2975
+ for: t.value,
2976
+ class: $(o.value)
2537
2977
  }, [
2538
- w(m(e.label) + " ", 1),
2539
- e.required ? (i(), s("span", Il, "*")) : b("", !0)
2540
- ], 10, Al)) : b("", !0),
2541
- e.row && e.labelCols ? (i(), s("div", {
2978
+ I(k(e.label) + " ", 1),
2979
+ e.required ? (n(), i("span", Yl, "*")) : y("", !0)
2980
+ ], 10, Xl)) : y("", !0),
2981
+ e.row && e.labelCols ? (n(), i("div", {
2542
2982
  key: 1,
2543
- class: g(l.value)
2983
+ class: $(r.value)
2544
2984
  }, [
2545
- C(d.$slots, "default"),
2546
- e.helpText && !e.validationMessage ? (i(), s("div", {
2985
+ N(c.$slots, "default"),
2986
+ e.helpText && !e.validationMessage ? (n(), i("div", {
2547
2987
  key: 0,
2548
- id: r.value,
2988
+ id: u.value,
2549
2989
  class: "form-text"
2550
- }, m(e.helpText), 9, Ol)) : b("", !0),
2551
- e.validationState === "valid" ? (i(), s("div", Dl, m(e.validationMessage || "Looks good!"), 1)) : b("", !0),
2552
- e.validationState === "invalid" ? (i(), s("div", {
2990
+ }, k(e.helpText), 9, Ul)) : y("", !0),
2991
+ e.validationState === "valid" ? (n(), i("div", Jl, k(e.validationMessage || "Looks good!"), 1)) : y("", !0),
2992
+ e.validationState === "invalid" ? (n(), i("div", {
2553
2993
  key: 2,
2554
- id: r.value,
2994
+ id: u.value,
2555
2995
  class: "invalid-feedback",
2556
2996
  style: { display: "block" }
2557
- }, m(e.validationMessage || "Please provide a valid value."), 9, El)) : b("", !0)
2558
- ], 2)) : (i(), s(M, { key: 2 }, [
2559
- C(d.$slots, "default"),
2560
- e.label && e.floating ? (i(), s("label", {
2997
+ }, k(e.validationMessage || "Please provide a valid value."), 9, Kl)) : y("", !0)
2998
+ ], 2)) : (n(), i(F, { key: 2 }, [
2999
+ N(c.$slots, "default"),
3000
+ e.label && e.floating ? (n(), i("label", {
2561
3001
  key: 0,
2562
- for: e.labelFor,
2563
- class: g(a.value)
3002
+ for: t.value,
3003
+ class: $(o.value)
2564
3004
  }, [
2565
- w(m(e.label) + " ", 1),
2566
- e.required ? (i(), s("span", Xl, "*")) : b("", !0)
2567
- ], 10, Rl)) : b("", !0),
2568
- e.helpText && !e.validationMessage ? (i(), s("div", {
3005
+ I(k(e.label) + " ", 1),
3006
+ e.required ? (n(), i("span", Wl, "*")) : y("", !0)
3007
+ ], 10, Ql)) : y("", !0),
3008
+ e.helpText && !e.validationMessage ? (n(), i("div", {
2569
3009
  key: 1,
2570
- id: r.value,
3010
+ id: u.value,
2571
3011
  class: "form-text"
2572
- }, m(e.helpText), 9, Yl)) : b("", !0),
2573
- e.validationState === "valid" ? (i(), s("div", Gl, m(e.validationMessage || "Looks good!"), 1)) : b("", !0),
2574
- e.validationState === "invalid" ? (i(), s("div", {
3012
+ }, k(e.helpText), 9, Zl)) : y("", !0),
3013
+ e.validationState === "valid" ? (n(), i("div", _l, k(e.validationMessage || "Looks good!"), 1)) : y("", !0),
3014
+ e.validationState === "invalid" ? (n(), i("div", {
2575
3015
  key: 3,
2576
- id: r.value,
3016
+ id: u.value,
2577
3017
  class: "invalid-feedback",
2578
3018
  style: { display: "block" }
2579
- }, m(e.validationMessage || "Please provide a valid value."), 9, Hl)) : b("", !0)
3019
+ }, k(e.validationMessage || "Please provide a valid value."), 9, eo)) : y("", !0)
2580
3020
  ], 64))
2581
3021
  ], 2));
2582
3022
  }
2583
- }), Ul = { class: "mb-3" }, Ql = ["for"], Wl = {
3023
+ }), ao = ["for"], lo = {
2584
3024
  key: 0,
2585
3025
  class: "text-danger"
2586
- }, Jl = {
3026
+ }, oo = {
2587
3027
  key: 1,
2588
3028
  class: "alert alert-warning",
2589
3029
  role: "alert"
2590
- }, Zl = ["id"], _l = ["id"], ei = {
2591
- key: 4,
3030
+ }, so = ["id"], no = ["id"], io = {
3031
+ key: 0,
2592
3032
  class: "valid-feedback",
2593
3033
  style: { display: "block" }
2594
- }, ti = ["id"], ai = /* @__PURE__ */ x({
3034
+ }, ro = ["id"], uo = /* @__PURE__ */ M({
2595
3035
  __name: "VibeFormWysiwyg",
2596
3036
  props: {
2597
3037
  modelValue: {
2598
3038
  type: String,
2599
3039
  default: ""
2600
3040
  },
2601
- id: { type: String, required: !0 },
3041
+ id: { type: String, default: () => G("wysiwyg") },
2602
3042
  label: { type: String, default: void 0 },
2603
3043
  placeholder: { type: String, default: "Write something..." },
2604
3044
  disabled: { type: Boolean, default: !1 },
@@ -2614,173 +3054,183 @@ const fe = /* @__PURE__ */ x({
2614
3054
  height: { type: String, default: "200px" }
2615
3055
  },
2616
3056
  emits: ["update:modelValue", "validate", "blur", "focus", "change", "ready"],
2617
- setup(e, { emit: f }) {
2618
- const t = e, a = f, l = T(null), r = T(null), d = T(!1), u = T(null), o = T(!1), n = T(null), c = T(null), v = T(null), p = y(() => {
2619
- const N = ["vibe-wysiwyg-container"];
2620
- return t.validationState === "valid" && N.push("is-valid"), t.validationState === "invalid" && N.push("is-invalid"), t.disabled && N.push("disabled"), N.join(" ");
2621
- }), B = [
3057
+ setup(e, { emit: v }) {
3058
+ const t = e, a = v, l = J("vibeFormGroup", null), s = m(() => t.id || l?.id.value || G("wysiwyg")), o = m(() => !!t.label && !l?.hasLabel.value), r = m(() => !!t.validationState && !l?.hasValidation.value), u = m(() => !!t.helpText && !l?.hasHelp.value), c = E(null), b = E(null), g = E(!1), C = E(null), p = E(!1), d = E(null), f = E(null), h = E(null), w = m(() => {
3059
+ const R = ["vibe-wysiwyg-container"];
3060
+ return t.validationState === "valid" && R.push("is-valid"), t.validationState === "invalid" && R.push("is-invalid"), t.disabled && R.push("disabled"), R.join(" ");
3061
+ }), x = [
2622
3062
  [{ header: [1, 2, 3, !1] }],
2623
3063
  ["bold", "italic", "underline", "strike"],
2624
3064
  [{ list: "ordered" }, { list: "bullet" }],
2625
3065
  [{ color: [] }, { background: [] }],
2626
3066
  ["link", "image"],
2627
3067
  ["clean"]
2628
- ], $ = () => t.toolbar === !1 ? !1 : t.toolbar === !0 || t.toolbar === void 0 ? B : t.toolbar, L = (N) => {
2629
- r.value && (o.value = !0, r.value.setContents([], "silent"), N && r.value.clipboard.dangerouslyPasteHTML(N, "silent"), o.value = !1);
2630
- }, z = () => !r.value || r.value.getText().trim().length === 0 ? "" : r.value.getSemanticHTML();
2631
- return G(async () => {
3068
+ ], V = () => t.toolbar === !1 ? !1 : t.toolbar === !0 || t.toolbar === void 0 ? x : t.toolbar, q = (R) => {
3069
+ b.value && (p.value = !0, b.value.setContents([], "silent"), R && b.value.clipboard.dangerouslyPasteHTML(R, "silent"), p.value = !1);
3070
+ }, P = () => !b.value || b.value.getText().trim().length === 0 ? "" : b.value.getSemanticHTML();
3071
+ return Y(async () => {
2632
3072
  try {
2633
- const N = await import("quill"), O = N.default || N;
2634
- if (await import("quill/dist/quill.snow.css"), l.value) {
2635
- const K = {
3073
+ const R = await import("quill"), Q = R.default || R;
3074
+ if (await import("quill/dist/quill.snow.css"), c.value) {
3075
+ const W = {
2636
3076
  theme: t.theme,
2637
3077
  placeholder: t.placeholder,
2638
3078
  readOnly: t.readonly || t.disabled,
2639
3079
  modules: {
2640
- toolbar: $()
3080
+ toolbar: V()
2641
3081
  }
2642
3082
  };
2643
- r.value = new O(l.value, K), t.modelValue && L(t.modelValue), v.value = () => {
2644
- if (o.value) return;
2645
- const U = z();
2646
- a("update:modelValue", U), a("change"), t.validateOn === "change" && a("validate");
2647
- }, r.value.on("text-change", v.value), n.value = () => {
3083
+ b.value = new Q(c.value, W), t.modelValue && q(t.modelValue), h.value = () => {
3084
+ if (p.value) return;
3085
+ const te = P();
3086
+ a("update:modelValue", te), a("change"), t.validateOn === "change" && a("validate");
3087
+ }, b.value.on("text-change", h.value), d.value = () => {
2648
3088
  a("blur"), t.validateOn === "blur" && a("validate");
2649
- }, r.value.root.addEventListener("blur", n.value), c.value = () => {
3089
+ }, b.value.root.addEventListener("blur", d.value), f.value = () => {
2650
3090
  a("focus");
2651
- }, r.value.root.addEventListener("focus", c.value), d.value = !0, a("ready", r.value);
3091
+ }, b.value.root.addEventListener("focus", f.value), g.value = !0, a("ready", b.value);
3092
+ }
3093
+ } catch (R) {
3094
+ console.error("Failed to load Quill editor:", R), C.value = "Failed to load WYSIWYG editor. Please install quill: npm install quill", g.value = !1;
3095
+ }
3096
+ }), X(() => {
3097
+ if (b.value) {
3098
+ if (h.value && (b.value.off("text-change", h.value), h.value = null), d.value && (b.value.root.removeEventListener("blur", d.value), d.value = null), f.value && (b.value.root.removeEventListener("focus", f.value), f.value = null), c.value) {
3099
+ const R = c.value.parentElement?.querySelector(".ql-toolbar");
3100
+ R && R.remove();
2652
3101
  }
2653
- } catch (N) {
2654
- console.error("Failed to load Quill editor:", N), u.value = "Failed to load WYSIWYG editor. Please install quill: npm install quill", d.value = !1;
3102
+ b.value = null;
2655
3103
  }
2656
- }), H(() => {
2657
- r.value && (v.value && (r.value.off("text-change", v.value), v.value = null), n.value && (r.value.root.removeEventListener("blur", n.value), n.value = null), c.value && (r.value.root.removeEventListener("focus", c.value), c.value = null), r.value = null);
2658
- }), E(() => t.modelValue, (N) => {
2659
- if (!r.value) return;
2660
- z() !== (N || "") && L(N || "");
2661
- }), E(() => t.disabled, (N) => {
2662
- r.value && r.value.enable(!N);
2663
- }), E(() => t.readonly, (N) => {
2664
- r.value && r.value.enable(!N);
2665
- }), (N, O) => (i(), s("div", Ul, [
2666
- e.label ? (i(), s("label", {
3104
+ }), O(() => t.modelValue, (R) => {
3105
+ if (!b.value) return;
3106
+ P() !== (R || "") && q(R || "");
3107
+ }), O(() => t.disabled, (R) => {
3108
+ b.value && b.value.enable(!R);
3109
+ }), O(() => t.readonly, (R) => {
3110
+ b.value && b.value.enable(!R);
3111
+ }), (R, Q) => (n(), i("div", {
3112
+ class: $({ "mb-3": o.value || u.value || r.value })
3113
+ }, [
3114
+ o.value ? (n(), i("label", {
2667
3115
  key: 0,
2668
- for: e.id,
3116
+ for: s.value,
2669
3117
  class: "form-label"
2670
3118
  }, [
2671
- w(m(e.label) + " ", 1),
2672
- e.required ? (i(), s("span", Wl, "*")) : b("", !0)
2673
- ], 8, Ql)) : b("", !0),
2674
- u.value ? (i(), s("div", Jl, m(u.value), 1)) : (i(), s("div", {
3119
+ I(k(e.label) + " ", 1),
3120
+ e.required ? (n(), i("span", lo, "*")) : y("", !0)
3121
+ ], 8, ao)) : y("", !0),
3122
+ C.value ? (n(), i("div", oo, k(C.value), 1)) : (n(), i("div", {
2675
3123
  key: 2,
2676
- class: g(p.value),
2677
- style: D({ minHeight: e.height })
3124
+ class: $(w.value),
3125
+ style: K({ minHeight: e.height })
2678
3126
  }, [
2679
- h("div", {
3127
+ S("div", {
2680
3128
  ref_key: "editorContainer",
2681
- ref: l,
2682
- id: e.id
2683
- }, null, 8, Zl)
3129
+ ref: c,
3130
+ id: s.value
3131
+ }, null, 8, so)
2684
3132
  ], 6)),
2685
- e.helpText && !e.validationMessage ? (i(), s("div", {
3133
+ u.value ? (n(), i("div", {
2686
3134
  key: 3,
2687
- id: `${e.id}-feedback`,
3135
+ id: `${s.value}-feedback`,
2688
3136
  class: "form-text"
2689
- }, m(e.helpText), 9, _l)) : b("", !0),
2690
- e.validationState === "valid" ? (i(), s("div", ei, m(e.validationMessage || "Looks good!"), 1)) : b("", !0),
2691
- e.validationState === "invalid" ? (i(), s("div", {
2692
- key: 5,
2693
- id: `${e.id}-feedback`,
2694
- class: "invalid-feedback",
2695
- style: { display: "block" }
2696
- }, m(e.validationMessage || "Please provide valid content."), 9, ti)) : b("", !0)
2697
- ]));
3137
+ }, k(e.helpText), 9, no)) : y("", !0),
3138
+ r.value ? (n(), i(F, { key: 4 }, [
3139
+ e.validationState === "valid" ? (n(), i("div", io, k(e.validationMessage || "Looks good!"), 1)) : y("", !0),
3140
+ e.validationState === "invalid" ? (n(), i("div", {
3141
+ key: 1,
3142
+ id: `${s.value}-feedback`,
3143
+ class: "invalid-feedback",
3144
+ style: { display: "block" }
3145
+ }, k(e.validationMessage || "Please provide valid content."), 9, ro)) : y("", !0)
3146
+ ], 64)) : y("", !0)
3147
+ ], 2));
2698
3148
  }
2699
- }), li = /* @__PURE__ */ Q(ai, [["__scopeId", "data-v-8e6e81b0"]]), si = {
3149
+ }), co = /* @__PURE__ */ re(uo, [["__scopeId", "data-v-1ed73fd7"]]), bo = {
2700
3150
  install(e) {
2701
- e.component("VibeAlert", fe), e.component("VibeBadge", ve), e.component("VibeButton", be), e.component("VibeButtonGroup", he), e.component("VibeCloseButton", ge), e.component("VibeSpinner", ke), e.component("VibePlaceholder", $e), e.component("VibeContainer", Se), e.component("VibeRow", Ve), e.component("VibeCol", Ce), e.component("VibeCard", Pe), e.component("VibeBreadcrumb", je), e.component("VibeNav", Ae), e.component("VibeNavbar", Ie), e.component("VibeNavbarBrand", Oe), e.component("VibeNavbarToggle", Ee), e.component("VibeNavbarNav", Ke), e.component("VibePagination", Ze), e.component("VibeTabContent", et), e.component("VibeListGroup", tt), e.component("VibeProgress", lt), e.component("VibeAccordion", rt), e.component("VibeCollapse", ut), e.component("VibeDropdown", yt), e.component("VibeModal", Ct), e.component("VibeOffcanvas", Tt), e.component("VibeToast", Lt), e.component("VibeCarousel", Ht), e.component("VibeTooltip", Ut), e.component("VibePopover", Wt), e.component("VibeScrollspy", Jt), e.component("VibeIcon", Zt), e.component("VibeDataTable", Sa), e.component("VibeFormInput", Ma), e.component("VibeFormSelect", Da), e.component("VibeFormTextarea", Qa), e.component("VibeFormSpinbutton", nl), e.component("VibeFormDatepicker", bl), e.component("VibeFormCheckbox", $l), e.component("VibeFormRadio", Nl), e.component("VibeFormSwitch", jl), e.component("VibeFormGroup", Kl), e.component("VibeFormWysiwyg", li);
3151
+ e.component("VibeAlert", $e), e.component("VibeBadge", we), e.component("VibeButton", Ve), e.component("VibeButtonGroup", xe), e.component("VibeCloseButton", Le), e.component("VibeSpinner", Ne), e.component("VibePlaceholder", Ee), e.component("VibeContainer", Me), e.component("VibeRow", Ie), e.component("VibeCol", Fe), e.component("VibeCard", He), e.component("VibeBreadcrumb", Ye), e.component("VibeNav", Qe), e.component("VibeNavbar", We), e.component("VibeNavbarBrand", Ze), e.component("VibeNavbarToggle", et), e.component("VibeNavbarNav", nt), e.component("VibePagination", ct), e.component("VibeTabContent", ft), e.component("VibeListGroup", bt), e.component("VibeProgress", mt), e.component("VibeAccordion", $t), e.component("VibeCollapse", wt), e.component("VibeDropdown", Et), e.component("VibeModal", zt), e.component("VibeOffcanvas", Dt), e.component("VibeToast", Jt), e.component("VibeCarousel", na), e.component("VibeTooltip", ra), e.component("VibePopover", ua), e.component("VibeScrollspy", ca), e.component("VibeIcon", va), e.component("VibeDataTable", Ra), e.component("VibeFormInput", Da), e.component("VibeFormSelect", Za), e.component("VibeFormTextarea", nl), e.component("VibeFormSpinbutton", ml), e.component("VibeFormDatepicker", wl), e.component("VibeFormCheckbox", Nl), e.component("VibeFormRadio", ql), e.component("VibeFormSwitch", Gl), e.component("VibeFormGroup", to), e.component("VibeFormWysiwyg", co);
2702
3152
  }
2703
3153
  };
2704
- function ni(e = "") {
2705
- const f = T(e), t = T(null), a = T(""), l = T(!1), r = T(!1), d = T(!1), u = async (B) => {
2706
- if (!B)
3154
+ function ho(e = "") {
3155
+ const v = E(e), t = E(null), a = E(""), l = E(!1), s = E(!1), o = E(!1), r = async (p) => {
3156
+ if (!p)
2707
3157
  return t.value = null, a.value = "", { valid: !0 };
2708
- d.value = !0;
3158
+ o.value = !0;
2709
3159
  try {
2710
- const $ = Array.isArray(B) ? B : [{ validator: B }];
2711
- for (const L of $) {
2712
- const z = await L.validator(f.value);
2713
- if (z === !1 || typeof z == "string")
2714
- return t.value = "invalid", a.value = typeof z == "string" ? z : L.message || "Invalid value", d.value = !1, { valid: !1, message: a.value };
3160
+ const d = Array.isArray(p) ? p : [{ validator: p }];
3161
+ for (const f of d) {
3162
+ const h = await f.validator(v.value);
3163
+ if (h === !1 || typeof h == "string")
3164
+ return t.value = "invalid", a.value = typeof h == "string" ? h : f.message || "Invalid value", o.value = !1, { valid: !1, message: a.value };
2715
3165
  }
2716
- return t.value = "valid", a.value = "", d.value = !1, { valid: !0 };
3166
+ return t.value = "valid", a.value = "", o.value = !1, { valid: !0 };
2717
3167
  } catch {
2718
- return t.value = "invalid", a.value = "Validation error occurred", d.value = !1, { valid: !1, message: a.value };
3168
+ return t.value = "invalid", a.value = "Validation error occurred", o.value = !1, { valid: !1, message: a.value };
2719
3169
  }
2720
- }, o = () => {
2721
- f.value = e, t.value = null, a.value = "", l.value = !1, r.value = !1, d.value = !1;
2722
- }, n = () => {
2723
- r.value = !0;
3170
+ }, u = () => {
3171
+ v.value = e, t.value = null, a.value = "", l.value = !1, s.value = !1, o.value = !1;
2724
3172
  }, c = () => {
3173
+ s.value = !0;
3174
+ }, b = () => {
2725
3175
  l.value = !0;
2726
- }, v = y(() => t.value === "valid"), p = y(() => t.value === "invalid");
3176
+ }, g = m(() => t.value === "valid"), C = m(() => t.value === "invalid");
2727
3177
  return {
2728
- value: f,
3178
+ value: v,
2729
3179
  validationState: t,
2730
3180
  validationMessage: a,
2731
3181
  isDirty: l,
2732
- isTouched: r,
2733
- isValidating: d,
2734
- isValid: v,
2735
- isInvalid: p,
2736
- validate: u,
2737
- reset: o,
2738
- markAsTouched: n,
2739
- markAsDirty: c
3182
+ isTouched: s,
3183
+ isValidating: o,
3184
+ isValid: g,
3185
+ isInvalid: C,
3186
+ validate: r,
3187
+ reset: u,
3188
+ markAsTouched: c,
3189
+ markAsDirty: b
2740
3190
  };
2741
3191
  }
2742
- const oi = {
3192
+ const mo = {
2743
3193
  required: (e = "This field is required") => ({
2744
- validator: (f) => Array.isArray(f) ? f.length > 0 || e : typeof f == "string" ? f.trim().length > 0 || e : f != null && f !== "" || e,
3194
+ validator: (v) => Array.isArray(v) ? v.length > 0 || e : typeof v == "string" ? v.trim().length > 0 || e : v != null && v !== "" || e,
2745
3195
  message: e
2746
3196
  }),
2747
3197
  email: (e = "Please enter a valid email address") => ({
2748
- validator: (f) => f ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(f) || e : !0,
3198
+ validator: (v) => v ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v) || e : !0,
2749
3199
  message: e
2750
3200
  }),
2751
- minLength: (e, f) => ({
2752
- validator: (t) => t ? t.length >= e || f || `Minimum length is ${e} characters` : !0,
2753
- message: f
3201
+ minLength: (e, v) => ({
3202
+ validator: (t) => t ? t.length >= e || v || `Minimum length is ${e} characters` : !0,
3203
+ message: v
2754
3204
  }),
2755
- maxLength: (e, f) => ({
2756
- validator: (t) => t ? t.length <= e || f || `Maximum length is ${e} characters` : !0,
2757
- message: f
3205
+ maxLength: (e, v) => ({
3206
+ validator: (t) => t ? t.length <= e || v || `Maximum length is ${e} characters` : !0,
3207
+ message: v
2758
3208
  }),
2759
- min: (e, f) => ({
3209
+ min: (e, v) => ({
2760
3210
  validator: (t) => {
2761
3211
  if (t == null || t === "") return !0;
2762
3212
  const a = Number(t);
2763
- return Number.isNaN(a) ? f || "Value must be a number" : a >= e || f || `Minimum value is ${e}`;
3213
+ return Number.isNaN(a) ? v || "Value must be a number" : a >= e || v || `Minimum value is ${e}`;
2764
3214
  },
2765
- message: f
3215
+ message: v
2766
3216
  }),
2767
- max: (e, f) => ({
3217
+ max: (e, v) => ({
2768
3218
  validator: (t) => {
2769
3219
  if (t == null || t === "") return !0;
2770
3220
  const a = Number(t);
2771
- return Number.isNaN(a) ? f || "Value must be a number" : a <= e || f || `Maximum value is ${e}`;
3221
+ return Number.isNaN(a) ? v || "Value must be a number" : a <= e || v || `Maximum value is ${e}`;
2772
3222
  },
2773
- message: f
3223
+ message: v
2774
3224
  }),
2775
- pattern: (e, f = "Invalid format") => ({
2776
- validator: (t) => t ? e.test(t) || f : !0,
2777
- message: f
3225
+ pattern: (e, v = "Invalid format") => ({
3226
+ validator: (t) => t ? e.test(t) || v : !0,
3227
+ message: v
2778
3228
  }),
2779
3229
  url: (e = "Please enter a valid URL") => ({
2780
- validator: (f) => {
2781
- if (!f) return !0;
3230
+ validator: (v) => {
3231
+ if (!v) return !0;
2782
3232
  try {
2783
- return new URL(f), !0;
3233
+ return new URL(v), !0;
2784
3234
  } catch {
2785
3235
  return e;
2786
3236
  }
@@ -2791,52 +3241,104 @@ const oi = {
2791
3241
  async: (e) => ({
2792
3242
  validator: e
2793
3243
  })
2794
- };
3244
+ }, ae = "vibe-color-mode", le = {
3245
+ light: "dark",
3246
+ dark: "auto",
3247
+ auto: "light"
3248
+ }, se = E("auto");
3249
+ let oe = !1;
3250
+ function vo(e) {
3251
+ typeof document > "u" || document.documentElement.setAttribute("data-bs-theme", e);
3252
+ }
3253
+ function ee(e) {
3254
+ se.value = e, vo(e);
3255
+ }
3256
+ ee("auto");
3257
+ function po() {
3258
+ function e(l) {
3259
+ if (l in le) {
3260
+ try {
3261
+ localStorage.setItem(ae, l);
3262
+ } catch {
3263
+ }
3264
+ ee(l);
3265
+ }
3266
+ }
3267
+ function v() {
3268
+ if (oe) return;
3269
+ let l = "auto";
3270
+ try {
3271
+ const s = localStorage.getItem(ae);
3272
+ s !== null && s in le && (l = s);
3273
+ } catch {
3274
+ }
3275
+ ee(l), oe = !0;
3276
+ }
3277
+ function t() {
3278
+ try {
3279
+ localStorage.removeItem(ae);
3280
+ } catch {
3281
+ }
3282
+ oe = !1, ee("auto");
3283
+ }
3284
+ function a() {
3285
+ e(le[se.value] ?? "auto");
3286
+ }
3287
+ return {
3288
+ colorMode: se,
3289
+ setColorMode: e,
3290
+ toggleColorMode: a,
3291
+ initColorMode: v,
3292
+ clearColorMode: t
3293
+ };
3294
+ }
2795
3295
  export {
2796
- rt as VibeAccordion,
2797
- fe as VibeAlert,
2798
- ve as VibeBadge,
2799
- je as VibeBreadcrumb,
2800
- be as VibeButton,
2801
- he as VibeButtonGroup,
2802
- Pe as VibeCard,
2803
- Ht as VibeCarousel,
2804
- ge as VibeCloseButton,
2805
- Ce as VibeCol,
2806
- ut as VibeCollapse,
2807
- Se as VibeContainer,
2808
- Sa as VibeDataTable,
2809
- yt as VibeDropdown,
2810
- $l as VibeFormCheckbox,
2811
- bl as VibeFormDatepicker,
2812
- Kl as VibeFormGroup,
2813
- Ma as VibeFormInput,
2814
- Nl as VibeFormRadio,
2815
- Da as VibeFormSelect,
2816
- nl as VibeFormSpinbutton,
2817
- jl as VibeFormSwitch,
2818
- Qa as VibeFormTextarea,
2819
- li as VibeFormWysiwyg,
2820
- Zt as VibeIcon,
2821
- tt as VibeListGroup,
2822
- Ct as VibeModal,
2823
- Ae as VibeNav,
2824
- Ie as VibeNavbar,
2825
- Oe as VibeNavbarBrand,
2826
- Ke as VibeNavbarNav,
2827
- Ee as VibeNavbarToggle,
2828
- Tt as VibeOffcanvas,
2829
- Ze as VibePagination,
2830
- $e as VibePlaceholder,
2831
- Wt as VibePopover,
2832
- lt as VibeProgress,
2833
- Ve as VibeRow,
2834
- Jt as VibeScrollspy,
2835
- ke as VibeSpinner,
2836
- et as VibeTabContent,
2837
- Lt as VibeToast,
2838
- Ut as VibeTooltip,
2839
- si as default,
2840
- ni as useFormValidation,
2841
- oi as validators
3296
+ $t as VibeAccordion,
3297
+ $e as VibeAlert,
3298
+ we as VibeBadge,
3299
+ Ye as VibeBreadcrumb,
3300
+ Ve as VibeButton,
3301
+ xe as VibeButtonGroup,
3302
+ He as VibeCard,
3303
+ na as VibeCarousel,
3304
+ Le as VibeCloseButton,
3305
+ Fe as VibeCol,
3306
+ wt as VibeCollapse,
3307
+ Me as VibeContainer,
3308
+ Ra as VibeDataTable,
3309
+ Et as VibeDropdown,
3310
+ Nl as VibeFormCheckbox,
3311
+ wl as VibeFormDatepicker,
3312
+ to as VibeFormGroup,
3313
+ Da as VibeFormInput,
3314
+ ql as VibeFormRadio,
3315
+ Za as VibeFormSelect,
3316
+ ml as VibeFormSpinbutton,
3317
+ Gl as VibeFormSwitch,
3318
+ nl as VibeFormTextarea,
3319
+ co as VibeFormWysiwyg,
3320
+ va as VibeIcon,
3321
+ bt as VibeListGroup,
3322
+ zt as VibeModal,
3323
+ Qe as VibeNav,
3324
+ We as VibeNavbar,
3325
+ Ze as VibeNavbarBrand,
3326
+ nt as VibeNavbarNav,
3327
+ et as VibeNavbarToggle,
3328
+ Dt as VibeOffcanvas,
3329
+ ct as VibePagination,
3330
+ Ee as VibePlaceholder,
3331
+ ua as VibePopover,
3332
+ mt as VibeProgress,
3333
+ Ie as VibeRow,
3334
+ ca as VibeScrollspy,
3335
+ Ne as VibeSpinner,
3336
+ ft as VibeTabContent,
3337
+ Jt as VibeToast,
3338
+ ra as VibeTooltip,
3339
+ bo as default,
3340
+ po as useColorMode,
3341
+ ho as useFormValidation,
3342
+ G as useId,
3343
+ mo as validators
2842
3344
  };