vlite3 1.1.2 → 1.1.5

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 (149) hide show
  1. package/README.md +5 -0
  2. package/components/AttachmentsList/AttachmentsList.vue.d.ts +1 -1
  3. package/components/AttachmentsList/AttachmentsList.vue.js +237 -163
  4. package/components/Avatar.vue.js +1 -1
  5. package/components/AvatarUploader/AvatarUploader.vue.js +40 -37
  6. package/components/Button.vue.js +30 -28
  7. package/components/Carousel/Carousel.vue.d.ts +2 -2
  8. package/components/CategoryManager/CategoryManager.vue.d.ts +10 -2
  9. package/components/CategoryManager/CategoryManager.vue.js +138 -119
  10. package/components/CategoryManager/CategoryNode.vue.d.ts +2 -0
  11. package/components/CategoryManager/CategoryNode.vue.js +93 -88
  12. package/components/Chart/BarChart.vue.d.ts +48 -0
  13. package/components/Chart/CircleChart.vue.d.ts +47 -0
  14. package/components/Chart/LineChart.vue.d.ts +55 -0
  15. package/components/Chart/PieChart.vue.d.ts +49 -0
  16. package/components/Chart/index.d.ts +5 -0
  17. package/components/Chart/types.d.ts +135 -0
  18. package/components/Chart/utils.d.ts +40 -0
  19. package/components/Chat/ChatBubble.vue.js +22 -22
  20. package/components/CheckBox.vue.js +29 -28
  21. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  22. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  23. package/components/Comment/CommentEditor.vue.d.ts +41 -0
  24. package/components/Comment/CommentEditor.vue.js +221 -0
  25. package/components/Comment/CommentEditor.vue2.js +4 -0
  26. package/components/Comment/CommentItem.vue.d.ts +70 -0
  27. package/components/Comment/CommentItem.vue.js +7 -0
  28. package/components/Comment/CommentItem.vue2.js +322 -0
  29. package/components/Comment/CommentThread.vue.d.ts +64 -0
  30. package/components/Comment/CommentThread.vue.js +185 -0
  31. package/components/Comment/CommentThread.vue2.js +4 -0
  32. package/components/Comment/index.d.ts +4 -0
  33. package/components/Comment/types.d.ts +34 -0
  34. package/components/ConfirmationModal.vue.js +30 -28
  35. package/components/CopyButton.vue.d.ts +50 -0
  36. package/components/CopyButton.vue.js +69 -0
  37. package/components/CopyButton.vue2.js +4 -0
  38. package/components/DataTable/DataTable.vue.d.ts +2 -4
  39. package/components/DataTable/DataTable.vue.js +184 -235
  40. package/components/DataTable/DataTableHeader.vue.d.ts +2 -0
  41. package/components/DataTable/DataTableHeader.vue.js +24 -23
  42. package/components/DataTable/DataTableRow.vue.d.ts +2 -0
  43. package/components/DataTable/DataTableRow.vue.js +32 -31
  44. package/components/DataTable/types.d.ts +2 -9
  45. package/components/DatePicker.vue.js +41 -35
  46. package/components/DateRangePicker.vue.js +18 -17
  47. package/components/Dropdown/Dropdown.vue.d.ts +5 -0
  48. package/components/Dropdown/Dropdown.vue.js +141 -137
  49. package/components/Dropdown/DropdownBooleanItem.vue.js +16 -15
  50. package/components/Dropdown/DropdownItem.vue.js +21 -20
  51. package/components/Dropdown/DropdownMenu.vue.js +1 -1
  52. package/components/Dropdown/DropdownMenu.vue2.js +13 -12
  53. package/components/Dropdown/DropdownTrigger.vue.d.ts +4 -0
  54. package/components/Dropdown/DropdownTrigger.vue.js +12 -7
  55. package/components/Dropdown/composables/useDropdownHydration.d.ts +2 -0
  56. package/components/Dropdown/composables/useDropdownSelection.d.ts +1 -0
  57. package/components/Dropdown/composables/useDropdownSelection.js +46 -31
  58. package/components/Empty/Empty.vue.js +7 -5
  59. package/components/Empty/index.d.ts +1 -1
  60. package/components/Empty/variants/Variant12.vue.d.ts +22 -0
  61. package/components/Empty/variants/Variant12.vue.js +35 -0
  62. package/components/Empty/variants/Variant12.vue2.js +4 -0
  63. package/components/FilePicker/FilePicker.vue.js +93 -90
  64. package/components/Footer/Footer.vue.d.ts +3 -0
  65. package/components/Footer/Variant1.vue.d.ts +20 -0
  66. package/components/Footer/Variant2.vue.d.ts +20 -0
  67. package/components/Footer/Variant3.vue.d.ts +12 -0
  68. package/components/Footer/index.d.ts +2 -0
  69. package/components/Footer/types.d.ts +73 -0
  70. package/components/Form/CustomFields.vue.d.ts +2 -0
  71. package/components/Form/CustomFields.vue.js +1 -1
  72. package/components/Form/CustomFields.vue2.js +125 -122
  73. package/components/Form/Form.vue.js +2 -2
  74. package/components/Form/Form.vue2.js +68 -64
  75. package/components/Form/FormField.vue.js +205 -149
  76. package/components/Form/FormFields.vue.js +2 -2
  77. package/components/Form/FormFields.vue2.js +28 -27
  78. package/components/Form/types.d.ts +2 -2
  79. package/components/Form/utils/form.utils.d.ts +3 -3
  80. package/components/Form/utils/form.utils.js +37 -37
  81. package/components/Input.vue.js +64 -62
  82. package/components/Invoice/Invoice.vue.js +9 -7
  83. package/components/Invoice/InvoiceTotals.vue.d.ts +14 -0
  84. package/components/Invoice/InvoiceTotals.vue.js +86 -0
  85. package/components/Invoice/InvoiceTotals.vue2.js +4 -0
  86. package/components/Invoice/InvoiceVariant1.vue.d.ts +3 -1
  87. package/components/Invoice/InvoiceVariant1.vue.js +194 -207
  88. package/components/Invoice/InvoiceVariant2.vue.d.ts +3 -1
  89. package/components/Invoice/InvoiceVariant2.vue.js +109 -118
  90. package/components/Invoice/InvoiceVariant3.vue.d.ts +3 -1
  91. package/components/Invoice/InvoiceVariant3.vue.js +157 -167
  92. package/components/Invoice/InvoiceVariant4.vue.d.ts +3 -1
  93. package/components/Invoice/InvoiceVariant4.vue.js +192 -202
  94. package/components/Invoice/index.d.ts +1 -0
  95. package/components/Invoice/types.d.ts +22 -0
  96. package/components/Masonry/Masonry.vue.d.ts +1 -1
  97. package/components/Modal.vue.js +1 -1
  98. package/components/Modal.vue2.js +60 -54
  99. package/components/MultiSelect/MultiSelect.vue.d.ts +2 -0
  100. package/components/MultiSelect/MultiSelect.vue.js +92 -90
  101. package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +2 -0
  102. package/components/NumberInput.vue.js +2 -2
  103. package/components/NumberInput.vue2.js +127 -121
  104. package/components/PricingPlan/PricingPlan.vue.d.ts +1 -1
  105. package/components/RichTextEditor/RichTextLinkPopover.vue.d.ts +26 -0
  106. package/components/RichTextEditor/RichTextReader.vue.d.ts +7 -0
  107. package/components/RichTextEditor/RichTextToolbar.vue.d.ts +24 -0
  108. package/components/RichTextEditor/composables/useRichTextImageUpload.d.ts +14 -0
  109. package/components/RichTextEditor/composables/useRichTextLinks.d.ts +32 -0
  110. package/components/RichTextEditor/index.d.ts +2 -0
  111. package/components/Screen/Screen.vue.js +45 -46
  112. package/components/Screen/ScreenFilter.vue.js +1 -1
  113. package/components/SidePanel.vue.js +2 -2
  114. package/components/SidePanel.vue2.js +58 -52
  115. package/components/SidebarMenu/SidebarMenu.vue.d.ts +1 -1
  116. package/components/SidebarMenu/SidebarMenu.vue.js +192 -91
  117. package/components/SidebarMenu/SidebarMenu.vue3.js +5 -0
  118. package/components/SidebarMenu/SidebarMenuItem.vue.js +170 -157
  119. package/components/SidebarMenu/types.d.ts +12 -3
  120. package/components/{DataTable/DataTableToolbar.vue.d.ts → Splitter/Splitter.vue.d.ts} +18 -15
  121. package/components/Splitter/Splitter.vue.js +64 -0
  122. package/components/Splitter/Splitter.vue2.js +4 -0
  123. package/components/Splitter/index.d.ts +1 -0
  124. package/components/Stats/StatItem.vue.js +96 -91
  125. package/components/Stats/types.d.ts +1 -0
  126. package/components/StatusChip/status-map.js +34 -2
  127. package/components/Switch.vue.d.ts +6 -1
  128. package/components/Switch.vue.js +61 -24
  129. package/components/TagInput/TagInput.vue.d.ts +187 -0
  130. package/components/TagInput/TagInput.vue.js +113 -0
  131. package/components/TagInput/TagInput.vue2.js +4 -0
  132. package/components/TagInput/index.d.ts +1 -0
  133. package/components/Textarea.vue.js +19 -18
  134. package/components/ThumbnailSelector/ThumbnailSelector.vue.js +2 -2
  135. package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +19 -16
  136. package/components/index.d.ts +4 -0
  137. package/core/config.d.ts +54 -0
  138. package/index.d.ts +4 -0
  139. package/index.js +300 -285
  140. package/package.json +1 -1
  141. package/style.css +657 -6
  142. package/types/button.d.ts +1 -1
  143. package/types/config.type.d.ts +2 -0
  144. package/types/styles.d.ts +1 -0
  145. package/utils/functions.js +9 -9
  146. package/components/DataTable/DataTableToolbar.vue.js +0 -60
  147. package/components/DataTable/DataTableToolbar.vue2.js +0 -4
  148. package/components/SidebarMenu/SidebarMenu.vue2.js +0 -4
  149. /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
@@ -0,0 +1,64 @@
1
+ import { defineComponent as L, ref as f, computed as w, onUnmounted as $, openBlock as V, createElementBlock as _, normalizeClass as v, createElementVNode as u, normalizeStyle as y, renderSlot as p } from "vue";
2
+ const I = /* @__PURE__ */ L({
3
+ __name: "Splitter",
4
+ props: {
5
+ layout: { default: "horizontal" },
6
+ modelValue: { default: 50 },
7
+ min: { default: 10 },
8
+ max: { default: 90 },
9
+ class: { default: "" }
10
+ },
11
+ emits: ["update:modelValue"],
12
+ setup(g, { emit: z }) {
13
+ const t = g, x = z, c = f(null), i = f(!1), l = f(t.modelValue);
14
+ let o = null;
15
+ const E = w(() => t.layout === "horizontal" ? { width: `${l.value}%` } : { height: `${l.value}%` }), b = w(() => t.layout === "horizontal" ? { width: `${100 - l.value}%` } : { height: `${100 - l.value}%` }), h = (e) => {
16
+ e.cancelable && e.type !== "touchstart" && e.preventDefault(), i.value = !0, document.body.style.cursor = t.layout === "horizontal" ? "col-resize" : "row-resize", document.body.style.userSelect = "none", window.addEventListener("mousemove", s, { passive: !1 }), window.addEventListener("mouseup", a), window.addEventListener("touchmove", s, { passive: !1 }), window.addEventListener("touchend", a);
17
+ }, s = (e) => {
18
+ !i.value || !c.value || (e.cancelable && e.preventDefault(), o && cancelAnimationFrame(o), o = requestAnimationFrame(() => {
19
+ const r = c.value.getBoundingClientRect();
20
+ let d, m;
21
+ window.TouchEvent && e instanceof TouchEvent ? (d = e.touches[0].clientX, m = e.touches[0].clientY) : (d = e.clientX, m = e.clientY);
22
+ let n = 0;
23
+ t.layout === "horizontal" ? n = (d - r.left) / r.width * 100 : n = (m - r.top) / r.height * 100, n < t.min && (n = t.min), n > t.max && (n = t.max), l.value = n, x("update:modelValue", n);
24
+ }));
25
+ }, a = () => {
26
+ i.value = !1, document.body.style.cursor = "", document.body.style.userSelect = "", o && (cancelAnimationFrame(o), o = null), window.removeEventListener("mousemove", s), window.removeEventListener("mouseup", a), window.removeEventListener("touchmove", s), window.removeEventListener("touchend", a);
27
+ };
28
+ return $(() => {
29
+ a();
30
+ }), (e, r) => (V(), _("div", {
31
+ ref_key: "containerRef",
32
+ ref: c,
33
+ class: v(["flex w-full h-full overflow-hidden", [t.layout === "vertical" ? "flex-col" : "flex-row", t.class]])
34
+ }, [
35
+ u("div", {
36
+ class: "relative overflow-hidden",
37
+ style: y([{ "will-change": "transform", contain: "layout style" }, E.value])
38
+ }, [
39
+ p(e.$slots, "start")
40
+ ], 4),
41
+ u("div", {
42
+ class: v(["flex items-center justify-center bg-border/40 hover:bg-primary/50 transition-colors z-10 shrink-0 touch-none", [
43
+ t.layout === "horizontal" ? "w-1.5 cursor-col-resize h-full mx-px" : "h-1.5 cursor-row-resize w-full my-px",
44
+ i.value ? "bg-primary/80!" : ""
45
+ ]]),
46
+ onMousedown: h,
47
+ onTouchstart: h
48
+ }, [
49
+ u("div", {
50
+ class: v(["bg-muted-foreground/30 rounded-full", t.layout === "horizontal" ? "h-8 w-0.5" : "w-8 h-0.5"])
51
+ }, null, 2)
52
+ ], 34),
53
+ u("div", {
54
+ class: "relative overflow-hidden flex-1",
55
+ style: y([{ "will-change": "transform", contain: "layout style" }, b.value])
56
+ }, [
57
+ p(e.$slots, "end")
58
+ ], 4)
59
+ ], 2));
60
+ }
61
+ });
62
+ export {
63
+ I as default
64
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./Splitter.vue.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1 @@
1
+ export { default as Splitter } from './Splitter.vue';
@@ -1,14 +1,15 @@
1
- import { defineComponent as w, computed as v, openBlock as e, createElementBlock as i, normalizeStyle as B, normalizeClass as a, Fragment as x, createElementVNode as r, toDisplayString as l, unref as m, createBlock as o, createCommentVNode as c } from "vue";
2
- import { $t as y } from "../../utils/i18n.js";
3
- import s from "./components/StatTrend.vue.js";
4
- import b from "./components/StatIconBox.vue.js";
5
- const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
1
+ import { defineComponent as B, computed as k, openBlock as e, createElementBlock as i, normalizeStyle as I, normalizeClass as n, Fragment as b, createElementVNode as r, toDisplayString as o, unref as y, createBlock as c, createCommentVNode as d } from "vue";
2
+ import { $t as s } from "../../utils/i18n.js";
3
+ import { formatCurrency as C } from "../../utils/functions.js";
4
+ import f from "./components/StatTrend.vue.js";
5
+ import g from "./components/StatIconBox.vue.js";
6
+ const j = { class: "flex items-center justify-between w-full mt-1" }, $ = {
6
7
  key: 0,
7
8
  class: "h-8 w-24 bg-gray-50 animate-pulse rounded-md"
8
- }, j = {
9
+ }, N = {
9
10
  key: 0,
10
11
  class: "h-9 w-24 bg-gray-50 animate-pulse rounded-md"
11
- }, $ = {
12
+ }, V = {
12
13
  key: 1,
13
14
  class: "h-8 w-20 bg-gray-50 animate-pulse rounded-md mt-1"
14
15
  }, E = {
@@ -17,13 +18,13 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
17
18
  }, M = {
18
19
  key: 0,
19
20
  class: "h-9 w-24 bg-gray-50 animate-pulse rounded-md mt-0.5"
20
- }, N = {
21
+ }, D = {
21
22
  key: 1,
22
23
  class: "h-6 w-5 bg-gray-50 animate-pulse rounded-sm shrink-0"
23
- }, V = { class: "flex-1 flex flex-col justify-center min-w-0" }, D = { class: "flex items-baseline gap-2 mt-1" }, F = {
24
+ }, F = { class: "flex-1 flex flex-col justify-center min-w-0" }, L = { class: "flex items-baseline gap-2 mt-1" }, P = {
24
25
  key: 0,
25
26
  class: "h-8 w-24 bg-gray-50 animate-pulse rounded-md"
26
- }, H = /* @__PURE__ */ w({
27
+ }, K = /* @__PURE__ */ B({
27
28
  __name: "StatItem",
28
29
  props: {
29
30
  item: {},
@@ -38,8 +39,12 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
38
39
  iconBoxStyle: { default: "filled" }
39
40
  },
40
41
  setup(t) {
41
- const n = t, k = v(() => {
42
- const d = n.layout === "inline-label-value" ? "flex px-3.5 py-3" : "flex p-3", f = {
42
+ const l = t;
43
+ function m(a) {
44
+ return a.isPrice ? C(Number(a.value)) : a.value;
45
+ }
46
+ const S = k(() => {
47
+ const a = l.layout === "inline-label-value" ? "flex px-3.5 py-3" : "flex p-3", x = {
43
48
  "icon-left": "flex-row items-center gap-3 text-left",
44
49
  "icon-right": "flex-row items-center justify-between gap-3 text-left",
45
50
  "icon-top": "flex-col items-start gap-1 px-5! pt-2! text-left",
@@ -48,14 +53,14 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
48
53
  "floating-icon": "flex-col items-start gap-1 text-left relative",
49
54
  "split-bar": "flex-row items-center gap-3 text-left border-l-4",
50
55
  "inline-label-value": "flex-row items-center gap-2.5 text-left"
51
- }, g = f[n.layout] || f["icon-left"];
56
+ }, h = x[l.layout] || x["icon-left"];
52
57
  let u = "";
53
- if (n.attached)
54
- n.variant === "transparent" ? u = "border-b border-r border-transparent bg-transparent hover:bg-muted/30 transition-colors" : n.variant === "outline" ? u = "border-b border-r border-border bg-transparent hover:bg-muted/30 transition-colors" : u = "border-b border-r border-border bg-card hover:bg-muted/30 transition-colors";
58
+ if (l.attached)
59
+ l.variant === "transparent" ? u = "border-b border-r border-transparent bg-transparent hover:bg-muted/30 transition-colors" : l.variant === "outline" ? u = "border-b border-r border-border bg-transparent hover:bg-muted/30 transition-colors" : u = "border-b border-r border-border bg-card hover:bg-muted/30 transition-colors";
55
60
  else {
56
- switch (n.variant) {
61
+ switch (l.variant) {
57
62
  case "solid": {
58
- const z = n.item.color || "primary", h = {
63
+ const w = l.item.color || "primary", v = {
59
64
  primary: "bg-primary-light",
60
65
  secondary: "bg-secondary",
61
66
  success: "bg-success-light",
@@ -63,7 +68,7 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
63
68
  danger: "bg-danger-light",
64
69
  info: "bg-info-light"
65
70
  };
66
- u = `${h[z] || h.primary}`;
71
+ u = `${v[w] || v.primary}`;
67
72
  break;
68
73
  }
69
74
  case "outline":
@@ -78,15 +83,15 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
78
83
  }
79
84
  u += " rounded-lg";
80
85
  }
81
- return [d, g, u].join(" ");
82
- }), S = v(() => {
83
- if (n.variant === "solid" && !n.attached) {
84
- const d = n.item.color;
85
- if (d && !["primary", "secondary", "success", "warning", "danger", "info"].includes(d))
86
- return { backgroundColor: `${d}15` };
86
+ return [a, h, u].join(" ");
87
+ }), z = k(() => {
88
+ if (l.variant === "solid" && !l.attached) {
89
+ const a = l.item.color;
90
+ if (a && !["primary", "secondary", "success", "warning", "danger", "info"].includes(a))
91
+ return { backgroundColor: `${a}15` };
87
92
  }
88
- if (n.layout === "split-bar") {
89
- const d = n.item.color, f = {
93
+ if (l.layout === "split-bar") {
94
+ const a = l.item.color, x = {
90
95
  primary: "var(--color-primary)",
91
96
  secondary: "var(--color-secondary)",
92
97
  success: "var(--color-success)",
@@ -94,32 +99,32 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
94
99
  danger: "var(--color-danger)",
95
100
  info: "var(--color-info)"
96
101
  };
97
- if (d)
98
- return { borderLeftColor: f[d] || d };
102
+ if (a)
103
+ return { borderLeftColor: x[a] || a };
99
104
  }
100
105
  return {};
101
106
  });
102
- return (d, f) => (e(), i("div", {
103
- class: a(k.value),
104
- style: B(S.value)
107
+ return (a, x) => (e(), i("div", {
108
+ class: n(S.value),
109
+ style: I(z.value)
105
110
  }, [
106
- t.layout === "title-top-icon-bottom-right" ? (e(), i(x, { key: 0 }, [
111
+ t.layout === "title-top-icon-bottom-right" ? (e(), i(b, { key: 0 }, [
107
112
  r("h3", {
108
- class: a(t.titleSize || "text-sm font-medium text-muted-foreground truncate w-full")
109
- }, l(t.item.titleI18n ? m(y)(t.item.titleI18n) : t.item.title), 3),
110
- r("div", I, [
113
+ class: n(t.titleSize || "text-sm font-medium text-muted-foreground truncate w-full")
114
+ }, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
115
+ r("div", j, [
111
116
  r("div", null, [
112
- t.loading ? (e(), i("div", C)) : (e(), i("p", {
117
+ t.loading ? (e(), i("div", $)) : (e(), i("p", {
113
118
  key: 1,
114
- class: a(t.valueSize || "text-2xl font-bold text-foreground truncate")
115
- }, l(t.item.value), 3)),
116
- t.item.trend && !t.loading ? (e(), o(s, {
119
+ class: n(t.valueSize || "text-2xl font-bold text-foreground truncate")
120
+ }, o(m(t.item)), 3)),
121
+ t.item.trend && !t.loading ? (e(), c(f, {
117
122
  key: 2,
118
123
  trend: t.item.trend,
119
124
  layout: t.layout
120
- }, null, 8, ["trend", "layout"])) : c("", !0)
125
+ }, null, 8, ["trend", "layout"])) : d("", !0)
121
126
  ]),
122
- t.item.icon ? (e(), o(b, {
127
+ t.item.icon ? (e(), c(g, {
123
128
  key: 0,
124
129
  item: t.item,
125
130
  variant: t.variant,
@@ -128,23 +133,23 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
128
133
  "icon-box-shape": t.iconBoxShape,
129
134
  "icon-box-style": t.iconBoxStyle,
130
135
  "icon-size": t.iconSize
131
- }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : c("", !0)
136
+ }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0)
132
137
  ])
133
- ], 64)) : t.layout === "centered-value-title" ? (e(), i(x, { key: 1 }, [
134
- t.loading ? (e(), i("div", j)) : (e(), i("p", {
138
+ ], 64)) : t.layout === "centered-value-title" ? (e(), i(b, { key: 1 }, [
139
+ t.loading ? (e(), i("div", N)) : (e(), i("p", {
135
140
  key: 1,
136
- class: a(t.valueSize || "text-3xl font-bold text-foreground")
137
- }, l(t.item.value), 3)),
141
+ class: n(t.valueSize || "text-3xl font-bold text-foreground")
142
+ }, o(m(t.item)), 3)),
138
143
  r("h3", {
139
- class: a(t.titleSize || "text-sm font-medium text-muted-foreground")
140
- }, l(t.item.titleI18n ? m(y)(t.item.titleI18n) : t.item.title), 3),
141
- t.item.trend && !t.loading ? (e(), o(s, {
144
+ class: n(t.titleSize || "text-sm font-medium text-muted-foreground")
145
+ }, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
146
+ t.item.trend && !t.loading ? (e(), c(f, {
142
147
  key: 2,
143
148
  trend: t.item.trend,
144
149
  layout: t.layout
145
- }, null, 8, ["trend", "layout"])) : c("", !0)
146
- ], 64)) : t.layout === "floating-icon" ? (e(), i(x, { key: 2 }, [
147
- t.item.icon ? (e(), o(b, {
150
+ }, null, 8, ["trend", "layout"])) : d("", !0)
151
+ ], 64)) : t.layout === "floating-icon" ? (e(), i(b, { key: 2 }, [
152
+ t.item.icon ? (e(), c(g, {
148
153
  key: 0,
149
154
  item: t.item,
150
155
  variant: t.variant,
@@ -154,36 +159,36 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
154
159
  "icon-box-style": t.iconBoxStyle,
155
160
  "icon-size": t.iconSize,
156
161
  class: "absolute top-4 right-4"
157
- }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : c("", !0),
162
+ }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
158
163
  r("h3", {
159
- class: a(t.titleSize || "text-sm font-medium text-muted-foreground truncate pr-12")
160
- }, l(t.item.titleI18n ? m(y)(t.item.titleI18n) : t.item.title), 3),
161
- t.loading ? (e(), i("div", $)) : (e(), i("p", {
164
+ class: n(t.titleSize || "text-sm font-medium text-muted-foreground truncate pr-12")
165
+ }, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
166
+ t.loading ? (e(), i("div", V)) : (e(), i("p", {
162
167
  key: 2,
163
- class: a(t.valueSize || "text-2xl font-bold text-foreground truncate mt-1")
164
- }, l(t.item.value), 3)),
165
- t.item.trend && !t.loading ? (e(), o(s, {
168
+ class: n(t.valueSize || "text-2xl font-bold text-foreground truncate mt-1")
169
+ }, o(m(t.item)), 3)),
170
+ t.item.trend && !t.loading ? (e(), c(f, {
166
171
  key: 3,
167
172
  trend: t.item.trend,
168
173
  layout: t.layout
169
- }, null, 8, ["trend", "layout"])) : c("", !0)
174
+ }, null, 8, ["trend", "layout"])) : d("", !0)
170
175
  ], 64)) : t.layout === "split-bar" ? (e(), i("div", E, [
171
176
  r("h3", {
172
- class: a(
177
+ class: n(
173
178
  t.titleSize || "text-xs font-semibold uppercase tracking-widest text-muted-foreground truncate"
174
179
  )
175
- }, l(t.item.titleI18n ? m(y)(t.item.titleI18n) : t.item.title), 3),
180
+ }, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
176
181
  t.loading ? (e(), i("div", M)) : (e(), i("p", {
177
182
  key: 1,
178
- class: a(t.valueSize || "text-3xl font-black text-foreground truncate mt-0.5")
179
- }, l(t.item.value), 3)),
180
- t.item.trend && !t.loading ? (e(), o(s, {
183
+ class: n(t.valueSize || "text-3xl font-black text-foreground truncate mt-0.5")
184
+ }, o(m(t.item)), 3)),
185
+ t.item.trend && !t.loading ? (e(), c(f, {
181
186
  key: 2,
182
187
  trend: t.item.trend,
183
188
  layout: t.layout
184
- }, null, 8, ["trend", "layout"])) : c("", !0)
185
- ])) : t.layout === "inline-label-value" ? (e(), i(x, { key: 4 }, [
186
- t.item.icon ? (e(), o(b, {
189
+ }, null, 8, ["trend", "layout"])) : d("", !0)
190
+ ])) : t.layout === "inline-label-value" ? (e(), i(b, { key: 4 }, [
191
+ t.item.icon ? (e(), c(g, {
187
192
  key: 0,
188
193
  item: t.item,
189
194
  variant: t.variant,
@@ -192,21 +197,21 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
192
197
  "icon-box-shape": t.iconBoxShape,
193
198
  "icon-box-style": t.iconBoxStyle,
194
199
  "icon-size": t.iconSize
195
- }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : c("", !0),
200
+ }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
196
201
  r("span", {
197
- class: a([t.titleSize || "-text-fs-2 font-medium text-muted-foreground truncate", "flex-1 min-w-0"])
198
- }, l(t.item.titleI18n ? m(y)(t.item.titleI18n) : t.item.title), 3),
199
- t.loading ? (e(), i("div", N)) : (e(), i("span", {
202
+ class: n([t.titleSize || "-text-fs-2 font-medium text-muted-foreground truncate", "flex-1 min-w-0"])
203
+ }, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
204
+ t.loading ? (e(), i("div", D)) : (e(), i("span", {
200
205
  key: 2,
201
- class: a(t.valueSize || "-text-fs-1 font-semibold text-foreground tabular-nums shrink-0")
202
- }, l(t.item.value), 3)),
203
- t.item.trend && !t.loading ? (e(), o(s, {
206
+ class: n(t.valueSize || "-text-fs-1 font-semibold text-foreground tabular-nums shrink-0")
207
+ }, o(m(t.item)), 3)),
208
+ t.item.trend && !t.loading ? (e(), c(f, {
204
209
  key: 3,
205
210
  trend: t.item.trend,
206
211
  layout: t.layout
207
- }, null, 8, ["trend", "layout"])) : c("", !0)
208
- ], 64)) : (e(), i(x, { key: 5 }, [
209
- t.item.icon && t.layout !== "icon-right" ? (e(), o(b, {
212
+ }, null, 8, ["trend", "layout"])) : d("", !0)
213
+ ], 64)) : (e(), i(b, { key: 5 }, [
214
+ t.item.icon && t.layout !== "icon-right" ? (e(), c(g, {
210
215
  key: 0,
211
216
  item: t.item,
212
217
  variant: t.variant,
@@ -215,24 +220,24 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
215
220
  "icon-box-shape": t.iconBoxShape,
216
221
  "icon-box-style": t.iconBoxStyle,
217
222
  "icon-size": t.iconSize
218
- }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : c("", !0),
219
- r("div", V, [
223
+ }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0),
224
+ r("div", F, [
220
225
  r("h3", {
221
- class: a(t.titleSize || "text-sm font-medium text-muted-foreground truncate")
222
- }, l(t.item.titleI18n ? m(y)(t.item.titleI18n) : t.item.title), 3),
223
- r("div", D, [
224
- t.loading ? (e(), i("div", F)) : (e(), i("p", {
226
+ class: n(t.titleSize || "text-sm font-medium text-muted-foreground truncate")
227
+ }, o(t.item.titleI18n ? y(s)(t.item.titleI18n) : t.item.title), 3),
228
+ r("div", L, [
229
+ t.loading ? (e(), i("div", P)) : (e(), i("p", {
225
230
  key: 1,
226
- class: a(t.valueSize || "text-2xl font-bold text-foreground truncate")
227
- }, l(t.item.value), 3))
231
+ class: n(t.valueSize || "text-2xl font-bold text-foreground truncate")
232
+ }, o(m(t.item)), 3))
228
233
  ]),
229
- t.item.trend && !t.loading ? (e(), o(s, {
234
+ t.item.trend && !t.loading ? (e(), c(f, {
230
235
  key: 0,
231
236
  trend: t.item.trend,
232
237
  layout: t.layout
233
- }, null, 8, ["trend", "layout"])) : c("", !0)
238
+ }, null, 8, ["trend", "layout"])) : d("", !0)
234
239
  ]),
235
- t.item.icon && t.layout === "icon-right" ? (e(), o(b, {
240
+ t.item.icon && t.layout === "icon-right" ? (e(), c(g, {
236
241
  key: 1,
237
242
  item: t.item,
238
243
  variant: t.variant,
@@ -241,11 +246,11 @@ const I = { class: "flex items-center justify-between w-full mt-1" }, C = {
241
246
  "icon-box-shape": t.iconBoxShape,
242
247
  "icon-box-style": t.iconBoxStyle,
243
248
  "icon-size": t.iconSize
244
- }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : c("", !0)
249
+ }, null, 8, ["item", "variant", "layout", "attached", "icon-box-shape", "icon-box-style", "icon-size"])) : d("", !0)
245
250
  ], 64))
246
251
  ], 6));
247
252
  }
248
253
  });
249
254
  export {
250
- H as default
255
+ K as default
251
256
  };
@@ -12,6 +12,7 @@ export interface StatItemSchema {
12
12
  title: string;
13
13
  titleI18n?: string;
14
14
  value: string | number;
15
+ isPrice?: boolean;
15
16
  icon?: string;
16
17
  color?: 'primary' | 'secondary' | 'success' | 'warning' | 'danger' | 'info' | string;
17
18
  trend?: StatTrend;
@@ -19,7 +19,7 @@ const o = {
19
19
  present: { variant: "success", icon: "lucide:user-check" },
20
20
  shipped: { variant: "teal", icon: "lucide:truck" },
21
21
  published: { variant: "success", icon: "lucide:globe" },
22
- online: { variant: "success", icon: "lucide:wifi" },
22
+ online: { variant: "indigo", icon: "lucide:globe" },
23
23
  success: { variant: "success", icon: "lucide:check-circle-2" },
24
24
  passed: { variant: "success", icon: "lucide:check-circle-2" },
25
25
  instock: { variant: "success", icon: "lucide:package-check" },
@@ -157,7 +157,39 @@ const o = {
157
157
  offday: { variant: "secondary", icon: "lucide:calendar-off" },
158
158
  resigned: { variant: "secondary", icon: "lucide:user-minus" },
159
159
  default: { variant: "secondary" },
160
- none: { variant: "secondary" }
160
+ none: { variant: "secondary" },
161
+ // ── Customer Type ──────────────────────────────────────────────────────────
162
+ receiving: { variant: "info", icon: "lucide:arrow-down-circle" },
163
+ giving: { variant: "orange", icon: "lucide:arrow-up-circle" },
164
+ dual: { variant: "purple", icon: "lucide:arrow-left-right" },
165
+ // ── Invoice Status ─────────────────────────────────────────────────────────
166
+ // pending → already mapped above (warning / clock)
167
+ // sent → already mapped above (cyan / send)
168
+ // approved → already mapped above (success / check-circle-2)
169
+ // rejected → already mapped above (danger / x-circle)
170
+ // canceled → already mapped above (pink / ban)
171
+ // completed → already mapped above (success / check-circle-2)
172
+ partialreceive: { variant: "cyan", icon: "lucide:git-commit", label: "Partial Receive" },
173
+ returned: { variant: "pink", icon: "lucide:corner-up-left" },
174
+ // ── Invoice Type ───────────────────────────────────────────────────────────
175
+ sale: { variant: "success", icon: "lucide:shopping-cart" },
176
+ expense: { variant: "warning", icon: "lucide:receipt" },
177
+ // ── Payment Type ───────────────────────────────────────────────────────────
178
+ debit: { variant: "danger", icon: "lucide:arrow-up-right" },
179
+ credit: { variant: "success", icon: "lucide:arrow-down-left" },
180
+ // ── Payment Method ─────────────────────────────────────────────────────────
181
+ // cash → already mapped above (success / banknote)
182
+ // card → already mapped above (purple / credit-card)
183
+ // transfer → already mapped above (cyan / arrow-right-left)
184
+ // online → already mapped above (indigo / globe)
185
+ // ── Tax Type ───────────────────────────────────────────────────────────────
186
+ percentage: { variant: "purple", icon: "lucide:percent" },
187
+ fixed: { variant: "cyan", icon: "lucide:hash" },
188
+ // ── Product Type ───────────────────────────────────────────────────────────
189
+ digital: { variant: "indigo", icon: "lucide:monitor" },
190
+ physical: { variant: "teal", icon: "lucide:package" },
191
+ service: { variant: "blue", icon: "lucide:briefcase" },
192
+ other: { variant: "secondary", icon: "lucide:more-horizontal" }
161
193
  };
162
194
  function n(i) {
163
195
  return i.toLowerCase().replace(/[\s_\-]+/g, "");
@@ -1,8 +1,12 @@
1
+ type SwitchVariant = 'basic' | 'card';
1
2
  interface Props {
2
3
  modelValue?: boolean;
3
4
  disabled?: boolean;
4
5
  label?: string;
5
6
  labelI18n?: string;
7
+ description?: string;
8
+ descriptionI18n?: string;
9
+ variant?: SwitchVariant;
6
10
  class?: string;
7
11
  id?: string;
8
12
  }
@@ -12,7 +16,8 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
12
16
  "onUpdate:modelValue"?: (value: boolean) => any;
13
17
  }>, {
14
18
  class: string;
19
+ variant: SwitchVariant;
15
20
  disabled: boolean;
16
21
  modelValue: boolean;
17
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
22
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
18
23
  export default _default;
@@ -1,47 +1,84 @@
1
- import { defineComponent as u, computed as c, openBlock as n, createElementBlock as i, createElementVNode as r, normalizeClass as t, toDisplayString as m, createCommentVNode as b } from "vue";
2
- import { $t as f } from "../utils/i18n.js";
3
- const p = { class: "flex items-center gap-2" }, g = ["id", "aria-checked", "aria-label", "disabled"], v = /* @__PURE__ */ u({
1
+ import { defineComponent as h, computed as b, openBlock as n, createElementBlock as s, normalizeClass as i, createElementVNode as o, toDisplayString as d, createCommentVNode as u, withModifiers as v } from "vue";
2
+ import { $t as m } from "../utils/i18n.js";
3
+ const w = { class: "flex flex-col gap-0.5 min-w-0" }, p = {
4
+ key: 0,
5
+ class: "text-sm font-medium text-foreground leading-snug select-none"
6
+ }, k = {
7
+ key: 1,
8
+ class: "text-xs text-muted-foreground leading-snug select-none"
9
+ }, y = ["id", "aria-checked", "aria-label", "disabled", "data-testid"], x = ["id", "aria-checked", "aria-label", "disabled", "data-testid"], I = /* @__PURE__ */ h({
4
10
  __name: "Switch",
5
11
  props: {
6
12
  modelValue: { type: Boolean, default: !1 },
7
13
  disabled: { type: Boolean, default: !1 },
8
14
  label: {},
9
15
  labelI18n: {},
16
+ description: {},
17
+ descriptionI18n: {},
18
+ variant: { default: "basic" },
10
19
  class: { default: "" },
11
20
  id: {}
12
21
  },
13
22
  emits: ["update:modelValue"],
14
- setup(e, { emit: s }) {
15
- const l = e, d = s, o = () => {
16
- l.disabled || d("update:modelValue", !l.modelValue);
17
- }, a = c(() => l.labelI18n ? f(l.labelI18n) : l.label);
18
- return (h, k) => (n(), i("div", p, [
19
- r("button", {
23
+ setup(e, { emit: f }) {
24
+ const a = e, g = f, r = () => {
25
+ a.disabled || g("update:modelValue", !a.modelValue);
26
+ }, t = b(() => a.labelI18n ? m(a.labelI18n) : a.label), c = b(
27
+ () => a.descriptionI18n ? m(a.descriptionI18n) : a.description
28
+ );
29
+ return (l, $) => e.variant === "card" ? (n(), s("div", {
30
+ key: 0,
31
+ class: i(["flex items-start justify-between gap-4 w-full rounded-md border border-border bg-background px-4 py-3 cursor-pointer", e.disabled ? "opacity-50 pointer-events-none" : ""]),
32
+ onClick: r
33
+ }, [
34
+ o("div", w, [
35
+ t.value ? (n(), s("span", p, d(t.value), 1)) : u("", !0),
36
+ c.value ? (n(), s("span", k, d(c.value), 1)) : u("", !0)
37
+ ]),
38
+ o("button", {
20
39
  id: e.id,
21
40
  type: "button",
22
41
  role: "switch",
23
42
  "aria-checked": e.modelValue,
24
- "aria-label": a.value || "Toggle",
43
+ "aria-label": t.value || "Toggle",
25
44
  disabled: e.disabled,
26
- class: t(["relative inline-flex h-5.5 w-10.5 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", [e.modelValue ? "bg-primary" : "bg-input", l.class]]),
27
- onClick: o
45
+ class: i(["relative mt-0.5 inline-flex h-5.5 w-10.5 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", e.modelValue ? "bg-primary" : "bg-input"]),
46
+ "data-testid": l.$attrs["data-testid"] || (l.$attrs.name ? `switch-${l.$attrs.name}` : e.id ? `switch-${e.id}` : t.value ? `switch-${t.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "switch"),
47
+ onClick: v(r, ["stop"])
28
48
  }, [
29
- r("span", {
49
+ o("span", {
30
50
  "aria-hidden": "true",
31
- class: t([
32
- "pointer-events-none inline-block h-4.5 w-4.5 transform rounded-full bg-background shadow-lg ring-0 transition duration-200 ease-in-out",
33
- e.modelValue ? "translate-x-5 rtl:translate-x-0" : "translate-x-0 rtl:-translate-x-5"
34
- ])
51
+ class: i(["pointer-events-none inline-block h-4.5 w-4.5 transform rounded-full bg-background shadow-lg ring-0 transition duration-200 ease-in-out", e.modelValue ? "translate-x-5 rtl:translate-x-0" : "translate-x-0 rtl:-translate-x-5"])
35
52
  }, null, 2)
36
- ], 10, g),
37
- a.value ? (n(), i("label", {
53
+ ], 10, y)
54
+ ], 2)) : (n(), s("div", {
55
+ key: 1,
56
+ class: i(["inline-flex items-center gap-2", a.class])
57
+ }, [
58
+ o("button", {
59
+ id: e.id,
60
+ type: "button",
61
+ role: "switch",
62
+ "aria-checked": e.modelValue,
63
+ "aria-label": t.value || "Toggle",
64
+ disabled: e.disabled,
65
+ class: i(["relative inline-flex h-5.5 w-10.5 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", e.modelValue ? "bg-primary" : "bg-input"]),
66
+ "data-testid": l.$attrs["data-testid"] || (l.$attrs.name ? `switch-${l.$attrs.name}` : e.id ? `switch-${e.id}` : t.value ? `switch-${t.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "switch"),
67
+ onClick: r
68
+ }, [
69
+ o("span", {
70
+ "aria-hidden": "true",
71
+ class: i(["pointer-events-none inline-block h-4.5 w-4.5 transform rounded-full bg-background shadow-lg ring-0 transition duration-200 ease-in-out", e.modelValue ? "translate-x-5 rtl:translate-x-0" : "translate-x-0 rtl:-translate-x-5"])
72
+ }, null, 2)
73
+ ], 10, x),
74
+ t.value ? (n(), s("label", {
38
75
  key: 0,
39
- class: t([e.disabled ? "opacity-50" : "", "text-sm font-medium text-foreground cursor-pointer"]),
40
- onClick: o
41
- }, m(a.value), 3)) : b("", !0)
42
- ]));
76
+ class: i([e.disabled ? "opacity-50" : "", "text-sm font-medium text-foreground cursor-pointer"]),
77
+ onClick: r
78
+ }, d(t.value), 3)) : u("", !0)
79
+ ], 2));
43
80
  }
44
81
  });
45
82
  export {
46
- v as default
83
+ I as default
47
84
  };