vlite3 1.1.2 → 1.1.4

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 (87) hide show
  1. package/components/AttachmentsList/AttachmentsList.vue.d.ts +1 -1
  2. package/components/AttachmentsList/AttachmentsList.vue.js +237 -163
  3. package/components/Avatar.vue.js +1 -1
  4. package/components/AvatarUploader/AvatarUploader.vue.js +40 -37
  5. package/components/Button.vue.js +30 -28
  6. package/components/Carousel/Carousel.vue.d.ts +2 -2
  7. package/components/CategoryManager/CategoryManager.vue.d.ts +10 -2
  8. package/components/CategoryManager/CategoryManager.vue.js +137 -118
  9. package/components/CategoryManager/CategoryNode.vue.d.ts +2 -0
  10. package/components/CategoryManager/CategoryNode.vue.js +93 -88
  11. package/components/Chat/ChatBubble.vue.js +22 -22
  12. package/components/CheckBox.vue.js +29 -28
  13. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  14. package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
  15. package/components/ConfirmationModal.vue.js +30 -28
  16. package/components/CopyButton.vue.d.ts +50 -0
  17. package/components/CopyButton.vue.js +69 -0
  18. package/components/CopyButton.vue2.js +4 -0
  19. package/components/DataTable/DataTable.vue.js +44 -44
  20. package/components/DatePicker.vue.js +41 -35
  21. package/components/DateRangePicker.vue.js +18 -17
  22. package/components/Dropdown/Dropdown.vue.d.ts +3 -0
  23. package/components/Dropdown/Dropdown.vue.js +117 -115
  24. package/components/Dropdown/DropdownBooleanItem.vue.js +16 -15
  25. package/components/Dropdown/DropdownItem.vue.js +21 -20
  26. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  27. package/components/Dropdown/DropdownMenu.vue2.js +13 -12
  28. package/components/Dropdown/DropdownTrigger.vue.d.ts +2 -0
  29. package/components/Dropdown/DropdownTrigger.vue.js +10 -6
  30. package/components/Dropdown/composables/useDropdownHydration.d.ts +2 -0
  31. package/components/Dropdown/composables/useDropdownSelection.d.ts +1 -0
  32. package/components/Dropdown/composables/useDropdownSelection.js +46 -31
  33. package/components/FilePicker/FilePicker.vue.js +93 -90
  34. package/components/Form/CustomFields.vue.js +2 -2
  35. package/components/Form/Form.vue.js +2 -2
  36. package/components/Form/Form.vue2.js +68 -64
  37. package/components/Form/FormField.vue.js +204 -148
  38. package/components/Form/FormFields.vue.js +2 -2
  39. package/components/Form/FormFields.vue2.js +28 -27
  40. package/components/Form/types.d.ts +2 -2
  41. package/components/Form/utils/form.utils.d.ts +3 -3
  42. package/components/Form/utils/form.utils.js +37 -37
  43. package/components/Input.vue.js +64 -62
  44. package/components/Invoice/Invoice.vue.js +9 -7
  45. package/components/Invoice/InvoiceTotals.vue.d.ts +14 -0
  46. package/components/Invoice/InvoiceTotals.vue.js +86 -0
  47. package/components/Invoice/InvoiceTotals.vue2.js +4 -0
  48. package/components/Invoice/InvoiceVariant1.vue.d.ts +3 -1
  49. package/components/Invoice/InvoiceVariant1.vue.js +194 -207
  50. package/components/Invoice/InvoiceVariant2.vue.d.ts +3 -1
  51. package/components/Invoice/InvoiceVariant2.vue.js +109 -118
  52. package/components/Invoice/InvoiceVariant3.vue.d.ts +3 -1
  53. package/components/Invoice/InvoiceVariant3.vue.js +157 -167
  54. package/components/Invoice/InvoiceVariant4.vue.d.ts +3 -1
  55. package/components/Invoice/InvoiceVariant4.vue.js +192 -202
  56. package/components/Invoice/index.d.ts +1 -0
  57. package/components/Invoice/types.d.ts +22 -0
  58. package/components/Masonry/Masonry.vue.d.ts +1 -1
  59. package/components/Modal.vue.js +1 -1
  60. package/components/Modal.vue2.js +60 -54
  61. package/components/MultiSelect/MultiSelect.vue.js +47 -46
  62. package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +2 -0
  63. package/components/NavbarCommandPalette.vue.js +1 -1
  64. package/components/NumberInput.vue.js +2 -2
  65. package/components/NumberInput.vue2.js +121 -116
  66. package/components/PricingPlan/PricingPlan.vue.d.ts +1 -1
  67. package/components/SidePanel.vue.js +2 -2
  68. package/components/SidePanel.vue2.js +58 -52
  69. package/components/Stats/StatItem.vue.js +96 -91
  70. package/components/Stats/types.d.ts +1 -0
  71. package/components/Switch.vue.d.ts +6 -1
  72. package/components/Switch.vue.js +61 -24
  73. package/components/TagInput/TagInput.vue.d.ts +187 -0
  74. package/components/TagInput/TagInput.vue.js +113 -0
  75. package/components/TagInput/TagInput.vue2.js +4 -0
  76. package/components/TagInput/index.d.ts +1 -0
  77. package/components/Textarea.vue.js +19 -18
  78. package/components/ThumbnailSelector/ThumbnailSelector.vue.js +2 -2
  79. package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +19 -16
  80. package/core/config.d.ts +36 -0
  81. package/index.d.ts +2 -0
  82. package/index.js +130 -124
  83. package/package.json +1 -1
  84. package/style.css +616 -1
  85. package/types/button.d.ts +1 -1
  86. package/types/styles.d.ts +1 -0
  87. package/utils/functions.js +9 -9
@@ -1,8 +1,8 @@
1
- import { defineComponent as I, computed as l, openBlock as y, createBlock as h, createSlots as w, withCtx as c, createElementVNode as r, toDisplayString as f, createVNode as m, renderSlot as x } from "vue";
1
+ import { defineComponent as I, computed as a, openBlock as w, createBlock as y, mergeProps as h, createSlots as $, withCtx as d, createElementVNode as r, toDisplayString as f, createVNode as p, renderSlot as u } from "vue";
2
2
  import b from "./Modal.vue.js";
3
- import p from "./Button.vue.js";
3
+ import x from "./Button.vue.js";
4
4
  import { $t as n } from "../utils/i18n.js";
5
- const k = { class: "pb-2 px-[2px]" }, $ = { class: "mb-1.5 font-semibold text-lg" }, B = { class: "text-sm text-muted-foreground" }, S = { class: "flex w-full items-center justify-end space-x-2 px-[2px]" }, _ = /* @__PURE__ */ I({
5
+ const k = { class: "pb-2 px-[2px]" }, B = { class: "mb-1.5 font-semibold text-lg" }, S = { class: "text-sm text-muted-foreground" }, z = { class: "flex w-full items-center justify-end space-x-2 px-[2px]" }, E = /* @__PURE__ */ I({
6
6
  __name: "ConfirmationModal",
7
7
  props: {
8
8
  show: { type: Boolean, default: !1 },
@@ -18,69 +18,71 @@ const k = { class: "pb-2 px-[2px]" }, $ = { class: "mb-1.5 font-semibold text-lg
18
18
  variant: { default: "danger" }
19
19
  },
20
20
  emits: ["cancel", "confirm"],
21
- setup(o, { emit: u }) {
22
- const t = o, d = u, a = () => {
23
- d("cancel");
24
- }, v = l(() => t.titleI18n ? n(t.titleI18n) : t.title), g = l(
21
+ setup(o, { emit: v }) {
22
+ const t = o, m = v, l = () => {
23
+ m("cancel");
24
+ }, s = a(() => t.titleI18n ? n(t.titleI18n) : t.title), g = a(
25
25
  () => t.descriptionI18n ? n(t.descriptionI18n) : t.description
26
- ), T = l(() => {
26
+ ), T = a(() => {
27
27
  if (t.confirmTextI18n) return n(t.confirmTextI18n);
28
28
  if (t.confirmText) return t.confirmText;
29
29
  const e = n("vlite.confirmation.confirm");
30
30
  return e !== "vlite.confirmation.confirm" ? e : "Confirm";
31
- }), C = l(() => {
31
+ }), C = a(() => {
32
32
  if (t.cancelTextI18n) return n(t.cancelTextI18n);
33
33
  if (t.cancelText) return t.cancelText;
34
34
  const e = n("vlite.confirmation.cancel");
35
35
  return e !== "vlite.confirmation.cancel" ? e : "Cancel";
36
36
  });
37
- return (e, i) => (y(), h(b, {
38
- show: o.show,
37
+ return (e, i) => (w(), y(b, h({ show: o.show }, e.$attrs, {
38
+ "data-testid": e.$attrs["data-testid"] || (s.value ? `confirm-modal-${s.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "confirm-modal"),
39
39
  footerClass: "border-t-0! pt-0! pb-3.5!",
40
40
  "max-width": "max-w-[400px]",
41
- onClose: a,
42
- "onUpdate:show": i[1] || (i[1] = (s) => !s && a())
43
- }, w({
44
- footer: c(({ close: s }) => [
45
- r("div", S, [
46
- m(p, {
41
+ onClose: l,
42
+ "onUpdate:show": i[1] || (i[1] = (c) => !c && l())
43
+ }), $({
44
+ footer: d(({ close: c }) => [
45
+ r("div", z, [
46
+ p(x, {
47
47
  variant: "secondary",
48
48
  text: C.value,
49
49
  disabled: o.loading,
50
50
  size: "sm2",
51
+ "data-testid": "confirm-modal-cancel",
51
52
  onClick: () => {
52
- s?.(), a?.();
53
+ c?.(), l?.();
53
54
  }
54
55
  }, null, 8, ["text", "disabled", "onClick"]),
55
- m(p, {
56
+ p(x, {
56
57
  size: "sm2",
57
58
  variant: o.variant,
58
59
  text: T.value,
59
60
  loading: o.loading,
60
- onClick: i[0] || (i[0] = (z) => d("confirm"))
61
+ "data-testid": "confirm-modal-confirm",
62
+ onClick: i[0] || (i[0] = (D) => m("confirm"))
61
63
  }, null, 8, ["variant", "text", "loading"])
62
64
  ])
63
65
  ]),
64
- default: c(() => [
66
+ default: d(() => [
65
67
  r("div", k, [
66
- r("h3", $, f(v.value), 1),
67
- r("p", B, f(g.value), 1)
68
+ r("h3", B, f(s.value), 1),
69
+ r("p", S, f(g.value), 1)
68
70
  ])
69
71
  ]),
70
72
  _: 2
71
73
  }, [
72
74
  e.$slots?.trigger ? {
73
75
  name: "trigger",
74
- fn: c(() => [
75
- x(e.$slots, "trigger", {}, () => [
76
- x(e.$slots, "default")
76
+ fn: d(() => [
77
+ u(e.$slots, "trigger", {}, () => [
78
+ u(e.$slots, "default")
77
79
  ])
78
80
  ]),
79
81
  key: "0"
80
82
  } : void 0
81
- ]), 1032, ["show"]));
83
+ ]), 1040, ["show", "data-testid"]));
82
84
  }
83
85
  });
84
86
  export {
85
- _ as default
87
+ E as default
86
88
  };
@@ -0,0 +1,50 @@
1
+ import { ButtonVariant, ButtonSize, ButtonRounded } from '../types';
2
+ export interface CopyButtonProps {
3
+ /** The content to be copied to the clipboard */
4
+ textToCopy: string;
5
+ variant?: ButtonVariant;
6
+ size?: ButtonSize;
7
+ rounded?: ButtonRounded;
8
+ class?: any;
9
+ disabled?: boolean;
10
+ defaultIcon?: string;
11
+ copiedIcon?: string;
12
+ defaultText?: string;
13
+ copiedText?: string;
14
+ defaultTextI18n?: string;
15
+ copiedTextI18n?: string;
16
+ asIcon?: boolean;
17
+ }
18
+ declare function __VLS_template(): {
19
+ attrs: Partial<{}>;
20
+ slots: {
21
+ default?(_: {
22
+ copied: boolean;
23
+ }): any;
24
+ };
25
+ refs: {};
26
+ rootEl: HTMLButtonElement;
27
+ };
28
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
29
+ declare const __VLS_component: import('vue').DefineComponent<CopyButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
30
+ copy: (text: string) => any;
31
+ error: (err: Error) => any;
32
+ }, string, import('vue').PublicProps, Readonly<CopyButtonProps> & Readonly<{
33
+ onCopy?: (text: string) => any;
34
+ onError?: (err: Error) => any;
35
+ }>, {
36
+ variant: ButtonVariant;
37
+ size: ButtonSize;
38
+ asIcon: boolean;
39
+ defaultIcon: string;
40
+ copiedIcon: string;
41
+ defaultTextI18n: string;
42
+ copiedTextI18n: string;
43
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLButtonElement>;
44
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
45
+ export default _default;
46
+ type __VLS_WithTemplateSlots<T, S> = T & {
47
+ new (): {
48
+ $slots: S;
49
+ };
50
+ };
@@ -0,0 +1,69 @@
1
+ import { defineComponent as f, ref as p, computed as l, openBlock as m, createBlock as x, normalizeClass as T, withCtx as y, renderSlot as v, createCommentVNode as I } from "vue";
2
+ import C from "./Button.vue.js";
3
+ import { $t as r } from "../utils/i18n.js";
4
+ const z = /* @__PURE__ */ f({
5
+ __name: "CopyButton",
6
+ props: {
7
+ textToCopy: {},
8
+ variant: { default: "outline" },
9
+ size: { default: "md" },
10
+ rounded: {},
11
+ class: {},
12
+ disabled: { type: Boolean },
13
+ defaultIcon: { default: "lucide:copy" },
14
+ copiedIcon: { default: "lucide:check" },
15
+ defaultText: {},
16
+ copiedText: {},
17
+ defaultTextI18n: { default: "vlite.copyButton.copy" },
18
+ copiedTextI18n: { default: "vlite.copyButton.copied" },
19
+ asIcon: { type: Boolean, default: !1 }
20
+ },
21
+ emits: ["copy", "error"],
22
+ setup(o, { emit: d }) {
23
+ const e = o, c = d, a = p(!1);
24
+ let n = null;
25
+ const u = l(() => a.value ? e.copiedIcon : e.defaultIcon), i = l(() => {
26
+ if (!e.asIcon)
27
+ if (a.value) {
28
+ if (e.copiedText) return e.copiedText;
29
+ const t = r(e.copiedTextI18n);
30
+ return t !== e.copiedTextI18n ? t : "Copied";
31
+ } else {
32
+ if (e.defaultText) return e.defaultText;
33
+ const t = r(e.defaultTextI18n);
34
+ return t !== e.defaultTextI18n ? t : "Copy";
35
+ }
36
+ }), s = async () => {
37
+ if (!e.disabled)
38
+ try {
39
+ await navigator.clipboard.writeText(e.textToCopy), a.value = !0, c("copy", e.textToCopy), n && clearTimeout(n), n = setTimeout(() => {
40
+ a.value = !1;
41
+ }, 500);
42
+ } catch (t) {
43
+ c("error", t instanceof Error ? t : new Error("Copy failed"));
44
+ }
45
+ };
46
+ return (t, B) => (m(), x(C, {
47
+ variant: o.variant,
48
+ size: o.size,
49
+ rounded: o.rounded,
50
+ class: T(e.class),
51
+ disabled: o.disabled,
52
+ icon: u.value,
53
+ text: i.value,
54
+ "as-icon": o.asIcon,
55
+ onClick: s
56
+ }, {
57
+ default: y(() => [
58
+ !o.asIcon && !i.value ? v(t.$slots, "default", {
59
+ key: 0,
60
+ copied: a.value
61
+ }) : I("", !0)
62
+ ]),
63
+ _: 3
64
+ }, 8, ["variant", "size", "rounded", "class", "disabled", "icon", "text", "as-icon"]));
65
+ }
66
+ });
67
+ export {
68
+ z as default
69
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./CopyButton.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,4 +1,4 @@
1
- import { defineComponent as ye, inject as we, computed as i, ref as y, watch as g, openBlock as r, createElementBlock as m, createBlock as U, normalizeClass as w, createSlots as j, withCtx as x, renderSlot as $, createVNode as B, createCommentVNode as W, createElementVNode as f, Fragment as A, renderList as E, normalizeStyle as L, isMemoSame as Y, mergeProps as X, unref as q } from "vue";
1
+ import { defineComponent as ye, inject as we, computed as i, ref as y, watch as g, openBlock as r, createElementBlock as u, createBlock as U, normalizeClass as w, createSlots as j, withCtx as x, renderSlot as $, createVNode as B, createCommentVNode as W, createElementVNode as m, Fragment as A, renderList as E, normalizeStyle as L, isMemoSame as Y, mergeProps as X, unref as q } from "vue";
2
2
  import Pe from "../CheckBox.vue.js";
3
3
  import Ce from "../Button.vue.js";
4
4
  import Se from "../ConfirmationModal.vue.js";
@@ -61,7 +61,7 @@ const Be = { class: "space-y-6.5" }, Ee = { class: "overflow-x-auto w-full" }, R
61
61
  const H = (e, t) => {
62
62
  if (!(!e || !t))
63
63
  return t.includes(".") ? t.split(".").reduce((l, n) => l?.[n], e) : e[t];
64
- }, c = (e, t) => H(e, t), J = (e, t) => {
64
+ }, d = (e, t) => H(e, t), J = (e, t) => {
65
65
  const l = ["id", "_id"];
66
66
  if (t && t !== "auto") return t;
67
67
  if (e && e.length > 0) {
@@ -69,7 +69,7 @@ const Be = { class: "space-y-6.5" }, Ee = { class: "overflow-x-auto w-full" }, R
69
69
  if (n in e[0]) return n;
70
70
  }
71
71
  return "_id";
72
- }, Q = (e) => e.sortKey || e.field, a = o, b = G, R = we($e, null), F = i(() => R?.disableSearch ? !1 : a.showSearch), C = i(() => a.hideSelectable ? !1 : R ? R.forceSelectable : !0), d = i(() => J(a.rows, a.keyField)), u = y({ field: "", order: "" }), S = y(
72
+ }, Q = (e) => e.sortKey || e.field, a = o, b = G, R = we($e, null), F = i(() => R?.disableSearch ? !1 : a.showSearch), C = i(() => a.hideSelectable ? !1 : R ? R.forceSelectable : !0), c = i(() => J(a.rows, a.keyField)), v = y({ field: "", order: "" }), S = y(
73
73
  a.pageInfo?.itemsPerPage || a.paginationProps?.itemsPerPage || 10
74
74
  ), h = y(a.pageInfo?.currentPage || 1), p = y(a.search || ""), k = y(!1), Z = i(() => a.loading);
75
75
  g(
@@ -103,29 +103,29 @@ const Be = { class: "space-y-6.5" }, Ee = { class: "overflow-x-auto w-full" }, R
103
103
  g(
104
104
  () => a.selectedRows,
105
105
  (e) => {
106
- const t = new Set((e || []).map((l) => c(l, d.value)));
106
+ const t = new Set((e || []).map((l) => d(l, c.value)));
107
107
  (t.size !== s.value.size || [...t].some((l) => !s.value.has(l))) && (s.value = t);
108
108
  },
109
109
  { immediate: !0, deep: !0 }
110
110
  );
111
111
  const V = i(
112
- () => a.rows.length > 0 && a.rows.every((e) => s.value.has(c(e, d.value)))
112
+ () => a.rows.length > 0 && a.rows.every((e) => s.value.has(d(e, c.value)))
113
113
  ), K = i(() => s.value.size > 0 && !V.value), _ = i(() => {
114
114
  const e = [...a.selectedRows || [], ...a.rows], t = /* @__PURE__ */ new Map();
115
- return e.forEach((l) => t.set(c(l, d.value), l)), Array.from(s.value).map((l) => t.get(l)).filter(Boolean);
115
+ return e.forEach((l) => t.set(d(l, c.value), l)), Array.from(s.value).map((l) => t.get(l)).filter(Boolean);
116
116
  }), ee = (e) => {
117
117
  const t = new Set(s.value);
118
- e ? a.rows.forEach((l) => t.add(c(l, d.value))) : a.rows.forEach((l) => t.delete(c(l, d.value))), s.value = t, O();
118
+ e ? a.rows.forEach((l) => t.add(d(l, c.value))) : a.rows.forEach((l) => t.delete(d(l, c.value))), s.value = t, O();
119
119
  }, te = (e) => {
120
120
  const t = new Set(s.value);
121
121
  t.has(e) ? t.delete(e) : t.add(e), s.value = t, O();
122
122
  }, O = () => {
123
123
  const e = /* @__PURE__ */ new Set(), t = [];
124
124
  a.rows.forEach((l) => {
125
- const n = c(l, d.value);
125
+ const n = d(l, c.value);
126
126
  s.value.has(n) && (t.push(l), e.add(n));
127
127
  }), (a.selectedRows || []).forEach((l) => {
128
- const n = c(l, d.value);
128
+ const n = d(l, c.value);
129
129
  !e.has(n) && s.value.has(n) && (t.push(l), e.add(n));
130
130
  }), b("select", {
131
131
  selected: t,
@@ -134,7 +134,7 @@ const Be = { class: "space-y-6.5" }, Ee = { class: "overflow-x-auto w-full" }, R
134
134
  }), b("update:selectedRows", t);
135
135
  }, le = (e) => {
136
136
  const t = a.headers.find((n) => n.field === e), l = t ? Q(t) : e;
137
- u.value.field === l ? u.value.order === "asc" ? u.value.order = "desc" : u.value.order === "desc" ? (u.value.order = "", u.value.field = "") : u.value.order = "asc" : (u.value.field = l, u.value.order = "asc"), h.value = 1, z();
137
+ v.value.field === l ? v.value.order = v.value.order === "asc" ? "desc" : "asc" : (v.value.field = l, v.value.order = "asc"), h.value = 1, z();
138
138
  }, ae = (e) => {
139
139
  h.value = e, z();
140
140
  }, oe = (e) => {
@@ -147,7 +147,7 @@ const Be = { class: "space-y-6.5" }, Ee = { class: "overflow-x-auto w-full" }, R
147
147
  M && clearTimeout(M), M = setTimeout(() => {
148
148
  const e = {
149
149
  pagination: { page: h.value, limit: S.value },
150
- sort: { ...u.value },
150
+ sort: { ...v.value },
151
151
  search: p.value,
152
152
  filter: {}
153
153
  };
@@ -157,7 +157,7 @@ const Be = { class: "space-y-6.5" }, Ee = { class: "overflow-x-auto w-full" }, R
157
157
  g(
158
158
  () => a.rows,
159
159
  () => {
160
- const e = new Set(a.rows.map((t) => c(t, d.value)));
160
+ const e = new Set(a.rows.map((t) => d(t, c.value)));
161
161
  s.value = new Set([...s.value].filter((t) => e.has(t)));
162
162
  }
163
163
  );
@@ -167,10 +167,10 @@ const Be = { class: "space-y-6.5" }, Ee = { class: "overflow-x-auto w-full" }, R
167
167
  "overflow-hidden",
168
168
  a.bordered ? "border border-border" : "",
169
169
  a.class
170
- ].join(" ")), re = i(() => ["w-full caption-bottom -text-fs-1", a.tableClass].join(" ")), de = (e) => {
170
+ ].join(" ")), re = i(() => ["w-full caption-bottom -text-fs-1", a.tableClass].join(" ")), ce = (e) => {
171
171
  const t = {};
172
172
  return e.width && !/(?:^|\s|:)w-/.test(e.width) && (t.width = e.width), e.minWidth && !/(?:^|\s|:)min-w-/.test(e.minWidth) && (t.minWidth = e.minWidth), t;
173
- }, ce = (e) => {
173
+ }, de = (e) => {
174
174
  const t = [];
175
175
  return e.width && /(?:^|\s|:)w-/.test(e.width) && t.push(e.width), e.minWidth && /(?:^|\s|:)min-w-/.test(e.minWidth) && t.push(e.minWidth), t.join(" ");
176
176
  }, ue = i(
@@ -190,7 +190,7 @@ const Be = { class: "space-y-6.5" }, Ee = { class: "overflow-x-auto w-full" }, R
190
190
  const e = P("vlite.dataTable.cancelBtn");
191
191
  return e !== "vlite.dataTable.cancelBtn" ? e : "Cancel";
192
192
  });
193
- return (e, t) => (r(), m("div", Be, [
193
+ return (e, t) => (r(), u("div", Be, [
194
194
  F.value || e.$slots?.["toolbar-left"] || e.$slots?.["toolbar-right"] ? (r(), U(xe, {
195
195
  key: 0,
196
196
  modelValue: p.value,
@@ -229,22 +229,22 @@ const Be = { class: "space-y-6.5" }, Ee = { class: "overflow-x-auto w-full" }, R
229
229
  key: "2"
230
230
  } : void 0
231
231
  ]), 1032, ["modelValue", "show-search", "placeholder", "placeholderI18n", "class", "search-class"])) : W("", !0),
232
- f("div", {
232
+ m("div", {
233
233
  class: w(ie.value)
234
234
  }, [
235
- f("div", Ee, [
236
- f("table", {
235
+ m("div", Ee, [
236
+ m("table", {
237
237
  class: w([re.value, "data-table"])
238
238
  }, [
239
- f("thead", {
239
+ m("thead", {
240
240
  class: w([
241
241
  "[&_tr]:border-b [&_tr]:border-border bg-muted",
242
242
  o.variant === "raised" ? "[&_th:first-child]:rounded-tl-lg [&_th:last-child]:rounded-tr-lg" : ""
243
243
  ])
244
244
  }, [
245
- f("tr", Re, [
246
- C.value ? (r(), m("th", ze, [
247
- f("div", We, [
245
+ m("tr", Re, [
246
+ C.value ? (r(), u("th", ze, [
247
+ m("div", We, [
248
248
  B(Pe, {
249
249
  "model-value": V.value,
250
250
  indeterminate: K.value,
@@ -253,60 +253,60 @@ const Be = { class: "space-y-6.5" }, Ee = { class: "overflow-x-auto w-full" }, R
253
253
  }, null, 8, ["model-value", "indeterminate"])
254
254
  ])
255
255
  ])) : W("", !0),
256
- (r(!0), m(A, null, E(o.headers, (l) => (r(), U(Te, {
256
+ (r(!0), u(A, null, E(o.headers, (l) => (r(), U(Te, {
257
257
  key: l.field,
258
258
  header: l,
259
- "sort-config": u.value,
259
+ "sort-config": v.value,
260
260
  compact: o.compact,
261
261
  "table-sortable": o.sortable,
262
262
  onSort: le,
263
- class: w(["last:pr-5!", ce(l)]),
264
- style: L(de(l))
263
+ class: w(["last:pr-5!", de(l)]),
264
+ style: L(ce(l))
265
265
  }, null, 8, ["header", "sort-config", "compact", "table-sortable", "class", "style"]))), 128))
266
266
  ])
267
267
  ], 2),
268
- f("tbody", Ae, [
269
- Z.value ? (r(!0), m(A, { key: 0 }, E(Math.min(S.value, 15), (l, n, be, v) => {
268
+ m("tbody", Ae, [
269
+ Z.value ? (r(!0), u(A, { key: 0 }, E(Math.min(S.value, 15), (l, n, be, f) => {
270
270
  const I = [];
271
- if (v && v.key === "skeleton-" + l && Y(v, I)) return v;
272
- const T = (r(), m("tr", {
271
+ if (f && f.key === "skeleton-" + l && Y(f, I)) return f;
272
+ const T = (r(), u("tr", {
273
273
  key: "skeleton-" + l,
274
274
  class: "border-b border-border/70 bg-background transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"
275
275
  }, [
276
- C.value ? (r(), m("td", Ne, [...t[8] || (t[8] = [
277
- f("div", { class: "flex items-center justify-center" }, [
278
- f("div", { class: "h-4 w-4 rounded-[4px] bg-muted/50 animate-pulse" })
276
+ C.value ? (r(), u("td", Ne, [...t[8] || (t[8] = [
277
+ m("div", { class: "flex items-center justify-center" }, [
278
+ m("div", { class: "h-4 w-4 rounded-[4px] bg-muted/50 animate-pulse" })
279
279
  ], -1)
280
280
  ])])) : W("", !0),
281
- (r(!0), m(A, null, E(o.headers, (D) => (r(), m("td", {
281
+ (r(!0), u(A, null, E(o.headers, (D) => (r(), u("td", {
282
282
  key: D.field,
283
283
  class: w(["p-5! align-middle last:pr-6!", [D.hideOnMobile ? "hidden md:table-cell" : ""]])
284
284
  }, [
285
- f("div", {
285
+ m("div", {
286
286
  class: "rounded-md bg-muted/50 animate-pulse h-4",
287
287
  style: L({ width: `${50 + Math.random() * 40}%` })
288
288
  }, null, 4)
289
289
  ], 2))), 128))
290
290
  ]));
291
291
  return T.memo = I, T;
292
- }, t, 2), 128)) : o.rows.length > 0 ? (r(!0), m(A, { key: 1 }, E(o.rows, (l, n, be, v) => {
292
+ }, t, 2), 128)) : o.rows.length > 0 ? (r(!0), u(A, { key: 1 }, E(o.rows, (l, n, be, f) => {
293
293
  const I = [
294
294
  l,
295
- s.value.has(c(l, d.value)),
295
+ s.value.has(d(l, c.value)),
296
296
  C.value,
297
297
  o.compact,
298
298
  o.striped,
299
299
  o.hoverable
300
300
  ];
301
- if (v && v.key === c(l, d.value) && Y(v, I)) return v;
301
+ if (f && f.key === d(l, c.value) && Y(f, I)) return f;
302
302
  const T = (r(), U(De, {
303
- key: c(l, d.value),
303
+ key: d(l, c.value),
304
304
  row: l,
305
305
  headers: o.headers,
306
306
  index: n,
307
- "key-field": d.value,
307
+ "key-field": c.value,
308
308
  selectable: C.value,
309
- "is-selected": s.value.has(c(l, d.value)),
309
+ "is-selected": s.value.has(d(l, c.value)),
310
310
  hoverable: o.hoverable,
311
311
  striped: o.striped,
312
312
  compact: o.compact,
@@ -322,8 +322,8 @@ const Be = { class: "space-y-6.5" }, Ee = { class: "overflow-x-auto w-full" }, R
322
322
  }))
323
323
  ]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "hoverable", "striped", "compact"]));
324
324
  return T.memo = I, T;
325
- }, t, 4), 128)) : (r(), m("tr", Ve, [
326
- f("td", {
325
+ }, t, 4), 128)) : (r(), u("tr", Ve, [
326
+ m("td", {
327
327
  colspan: C.value ? o.headers.length + 1 : o.headers.length,
328
328
  class: "align-middle hover:bg-transparent"
329
329
  }, [
@@ -349,7 +349,7 @@ const Be = { class: "space-y-6.5" }, Ee = { class: "overflow-x-auto w-full" }, R
349
349
  ], 2)
350
350
  ])
351
351
  ], 2),
352
- o.showPagination && o.pageInfo && o.pageInfo.totalPages > 1 ? (r(), m("div", Ue, [
352
+ o.showPagination && o.pageInfo && o.pageInfo.totalPages > 1 ? (r(), u("div", Ue, [
353
353
  B(q(ke), X({
354
354
  "current-page": h.value,
355
355
  "total-pages": o.pageInfo.totalPages,
@@ -1,13 +1,13 @@
1
- import { defineComponent as z, computed as m, openBlock as x, createBlock as k, unref as D, withCtx as h, createElementVNode as L, createVNode as g, renderSlot as B, mergeProps as P } from "vue";
2
- import V from "./Button.vue.js";
3
- import U from "./Dropdown/Dropdown.vue.js";
1
+ import { defineComponent as z, computed as m, openBlock as w, createBlock as $, unref as D, withCtx as h, createElementVNode as p, createVNode as g, renderSlot as L, mergeProps as x } from "vue";
2
+ import P from "./Button.vue.js";
3
+ import B from "./Dropdown/Dropdown.vue.js";
4
4
  import "@iconify/vue";
5
- import { $t as I } from "../utils/i18n.js";
5
+ import { $t as V } from "../utils/i18n.js";
6
6
  /* empty css */
7
7
  /* empty css */
8
- import j, { TimePicker as C } from "v-datepicker-lite";
8
+ import U, { TimePicker as j } from "v-datepicker-lite";
9
9
  import "v-datepicker-lite/style.css";
10
- const F = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ z({
10
+ const C = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ z({
11
11
  __name: "DatePicker",
12
12
  props: {
13
13
  placeholder: {},
@@ -29,45 +29,45 @@ const F = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ z({
29
29
  readonly: { type: Boolean }
30
30
  },
31
31
  emits: ["update:modelValue", "change"],
32
- setup(t, { emit: N }) {
33
- const r = t, y = N, a = m({
32
+ setup(t, { emit: I }) {
33
+ const r = t, y = I, a = m({
34
34
  get: () => r.modelValue ?? r.value,
35
35
  set: (e) => {
36
36
  y("update:modelValue", e), y("change", e);
37
37
  }
38
- }), T = (e) => e instanceof Date ? e.getHours() !== 0 || e.getMinutes() !== 0 : typeof e == "string" ? e.includes("T") || /\d{2}:\d{2}/.test(e) : !1, u = (e) => {
38
+ }), N = (e) => e instanceof Date ? e.getHours() !== 0 || e.getMinutes() !== 0 : typeof e == "string" ? e.includes("T") || /\d{2}:\d{2}/.test(e) : !1, u = (e) => {
39
39
  if (!e) return null;
40
40
  if (e instanceof Date)
41
41
  return isNaN(e.getTime()) ? null : new Date(e.getFullYear(), e.getMonth(), e.getDate());
42
42
  if (typeof e == "string") {
43
43
  if (/^\d{4}-\d{2}-\d{2}$/.test(e)) {
44
- const [l, d, o] = e.split("-").map(Number);
45
- return new Date(l, d - 1, o);
44
+ const [d, l, o] = e.split("-").map(Number);
45
+ return new Date(d, l - 1, o);
46
46
  }
47
47
  if (e.includes("T")) {
48
- const l = e.split("T")[0], [d, o, s] = l.split("-").map(Number);
49
- return new Date(d, o - 1, s);
48
+ const d = e.split("T")[0], [l, o, s] = d.split("-").map(Number);
49
+ return new Date(l, o - 1, s);
50
50
  }
51
51
  const i = new Date(e);
52
52
  return isNaN(i.getTime()) ? null : i;
53
53
  }
54
54
  return null;
55
55
  }, c = (e) => {
56
- const n = e.getFullYear(), i = String(e.getMonth() + 1).padStart(2, "0"), l = String(e.getDate()).padStart(2, "0");
57
- return `${n}-${i}-${l}`;
56
+ const n = e.getFullYear(), i = String(e.getMonth() + 1).padStart(2, "0"), d = String(e.getDate()).padStart(2, "0");
57
+ return `${n}-${i}-${d}`;
58
58
  }, b = (e) => {
59
59
  try {
60
60
  if (e && typeof e == "object") {
61
- const d = e.startDate || e.start, o = e.endDate || e.end;
62
- if (d && o) {
63
- const s = u(d), w = u(o);
64
- if (s && w) return { startDate: s, endDate: w };
61
+ const l = e.startDate || e.start, o = e.endDate || e.end;
62
+ if (l && o) {
63
+ const s = u(l), k = u(o);
64
+ if (s && k) return { startDate: s, endDate: k };
65
65
  }
66
66
  }
67
67
  const n = u(e);
68
68
  if (!n) return null;
69
- const i = new Date(n), l = new Date(n);
70
- return l.setDate(i.getDate() + 6), { startDate: i, endDate: l };
69
+ const i = new Date(n), d = new Date(n);
70
+ return d.setDate(i.getDate() + 6), { startDate: i, endDate: d };
71
71
  } catch {
72
72
  return null;
73
73
  }
@@ -99,7 +99,7 @@ const F = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ z({
99
99
  }
100
100
  const e = new Date(a.value);
101
101
  if (isNaN(e.getTime())) return String(a.value);
102
- const n = r.mode === "dateTime" && T(a.value);
102
+ const n = r.mode === "dateTime" && N(a.value);
103
103
  return e.toLocaleDateString("en-US", {
104
104
  month: "short",
105
105
  day: "numeric",
@@ -110,9 +110,9 @@ const F = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ z({
110
110
  return String(a.value);
111
111
  }
112
112
  }), v = m(() => {
113
- if (r.placeholderI18n) return I(r.placeholderI18n);
113
+ if (r.placeholderI18n) return V(r.placeholderI18n);
114
114
  if (r.placeholder !== void 0) return r.placeholder;
115
- const e = I("vlite.datePicker.placeholder");
115
+ const e = V("vlite.datePicker.placeholder");
116
116
  return e !== "vlite.datePicker.placeholder" ? e : "Select date";
117
117
  }), S = (e) => {
118
118
  if (r.mode === "week") {
@@ -133,8 +133,8 @@ const F = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ z({
133
133
  }
134
134
  }
135
135
  a.value = e;
136
- }, $ = m(() => r.mode === "week" && a.value && typeof a.value == "object" && (a.value.startDate || a.value.start) || a.value);
137
- return (e, n) => t.mode !== "time" ? (x(), k(D(U), {
136
+ }, T = m(() => r.mode === "week" && a.value && typeof a.value == "object" && (a.value.startDate || a.value.start) || a.value);
137
+ return (e, n) => t.mode !== "time" ? (w(), $(D(B), {
138
138
  key: 0,
139
139
  position: "bottom-start",
140
140
  class: "w-full",
@@ -143,23 +143,26 @@ const F = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ z({
143
143
  disabled: t.disabled || t.readonly
144
144
  }, {
145
145
  trigger: h(() => [
146
- B(e.$slots, "default", {
146
+ L(e.$slots, "default", {
147
147
  value: a.value,
148
148
  displayValue: f.value
149
149
  }, () => [
150
- g(V, P({
150
+ g(P, x({
151
151
  text: f.value?.replace("-", "—") || v.value,
152
152
  variant: t.variant || "outline",
153
153
  size: t.size || "md",
154
154
  icon: t.icon || "lucide:calendar",
155
155
  disabled: t.disabled
156
- }, t.btnProps, { class: "w-full justify-start text-left font-normal" }), null, 16, ["text", "variant", "size", "icon", "disabled"])
156
+ }, t.btnProps, {
157
+ class: "w-full justify-start text-left font-normal",
158
+ "data-testid": e.$attrs["data-testid"] || (e.$attrs.name ? `datepicker-${e.$attrs.name}` : "datepicker")
159
+ }), null, 16, ["text", "variant", "size", "icon", "disabled", "data-testid"])
157
160
  ])
158
161
  ]),
159
162
  default: h(() => [
160
- L("div", F, [
161
- g(D(j), {
162
- value: $.value,
163
+ p("div", C, [
164
+ g(D(U), {
165
+ value: T.value,
163
166
  mode: t.mode,
164
167
  "min-date": t.minDate,
165
168
  "max-date": t.maxDate,
@@ -174,7 +177,7 @@ const F = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ z({
174
177
  ])
175
178
  ]),
176
179
  _: 3
177
- }, 8, ["teleport", "disabled"])) : (x(), k(D(C), {
180
+ }, 8, ["teleport", "disabled"])) : (w(), $(D(j), {
178
181
  key: 1,
179
182
  "model-value": a.value,
180
183
  "onUpdate:modelValue": [
@@ -192,13 +195,16 @@ const F = { class: "overflow-hidden min-w-[300px]" }, G = /* @__PURE__ */ z({
192
195
  readonly: t.readonly
193
196
  }, {
194
197
  default: h(() => [
195
- g(V, P({
198
+ g(P, x({
196
199
  text: f.value || v.value,
197
200
  variant: t.variant || "outline",
198
201
  size: t.size || "md",
199
202
  icon: t.icon || (t.mode === "time" ? "lucide:clock" : "lucide:calendar"),
200
203
  disabled: t.disabled
201
- }, t.btnProps, { class: "w-full justify-start text-left font-normal" }), null, 16, ["text", "variant", "size", "icon", "disabled"])
204
+ }, t.btnProps, {
205
+ class: "w-full justify-start text-left font-normal",
206
+ "data-testid": e.$attrs["data-testid"] || (e.$attrs.name ? `timepicker-${e.$attrs.name}` : "timepicker")
207
+ }), null, 16, ["text", "variant", "size", "icon", "disabled", "data-testid"])
202
208
  ]),
203
209
  _: 1
204
210
  }, 8, ["model-value", "mode", "min-date", "max-date", "disabled-dates", "minuteInterval", "disabled", "readonly"]));