vlite3 1.0.4 → 1.0.6

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 (49) hide show
  1. package/components/AttachmentsList/AttachmentsList.vue.d.ts +19 -3
  2. package/components/AttachmentsList/AttachmentsList.vue.js +274 -111
  3. package/components/AttachmentsList/fileTypeIcon.d.ts +16 -0
  4. package/components/AttachmentsList/fileTypeIcon.js +127 -0
  5. package/components/AttachmentsList/index.d.ts +1 -0
  6. package/components/AttachmentsList/types.d.ts +74 -2
  7. package/components/Avatar.vue.js +2 -2
  8. package/components/Badge.vue.js +7 -7
  9. package/components/Button.vue.js +36 -43
  10. package/components/ButtonGroup.vue.js +2 -2
  11. package/components/ButtonGroup.vue2.js +8 -8
  12. package/components/CategoryManager/CategoryManager.vue.d.ts +36 -0
  13. package/components/CategoryManager/CategoryNode.vue.d.ts +15 -0
  14. package/components/CategoryManager/index.d.ts +2 -0
  15. package/components/CategoryManager/types.d.ts +43 -0
  16. package/components/Chat/ChatBubble.vue.js +70 -56
  17. package/components/Chat/ChatInterface.vue.js +182 -142
  18. package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
  19. package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
  20. package/components/Dropdown/DropdownMenu.vue.js +2 -2
  21. package/components/Dropdown/DropdownMenu.vue2.js +1 -0
  22. package/components/FilePicker/FilePicker.vue.js +117 -122
  23. package/components/Input.vue.js +28 -26
  24. package/components/Kanban/Kanban.vue.d.ts +7 -16
  25. package/components/Kanban/Kanban.vue.js +1 -1
  26. package/components/Kanban/Kanban.vue2.js +79 -47
  27. package/components/Kanban/KanbanBoard.vue.js +2 -2
  28. package/components/Kanban/KanbanBoard.vue2.js +21 -21
  29. package/components/Kanban/types.d.ts +3 -0
  30. package/components/List/List.vue.js +89 -85
  31. package/components/Navbar/Navbar.vue.d.ts +4 -0
  32. package/components/Navbar/Navbar.vue.js +196 -173
  33. package/components/Navbar/NavbarTabs.vue.js +72 -66
  34. package/components/NavbarCommandPalette.vue.js +11 -11
  35. package/components/NumberInput.vue.js +2 -2
  36. package/components/NumberInput.vue2.js +144 -104
  37. package/components/Screen/Screen.vue.d.ts +12 -29
  38. package/components/Screen/Screen.vue.js +228 -195
  39. package/components/Screen/components/ScreenViewToggle.vue.d.ts +6 -3
  40. package/components/Screen/components/ScreenViewToggle.vue.js +29 -34
  41. package/components/Screen/types.d.ts +59 -7
  42. package/components/Stats/Stats.vue.d.ts +1 -0
  43. package/components/Stats/Stats.vue.js +184 -156
  44. package/components/Stats/types.d.ts +1 -0
  45. package/components/Workbook/Sheet.vue.d.ts +1 -1
  46. package/directives/vRipple.js +28 -9
  47. package/index.js +87 -85
  48. package/package.json +1 -1
  49. package/style.css +1 -1
@@ -1,37 +1,55 @@
1
- import { defineComponent as N, computed as w, openBlock as s, createElementBlock as a, normalizeClass as t, Fragment as y, renderList as V, normalizeStyle as v, createElementVNode as c, toDisplayString as l, unref as b, createVNode as f, createCommentVNode as d, createBlock as E, createTextVNode as L } from "vue";
1
+ import { defineComponent as N, computed as w, openBlock as n, createElementBlock as r, normalizeClass as s, Fragment as y, renderList as V, normalizeStyle as b, createElementVNode as i, toDisplayString as c, unref as h, createVNode as f, createCommentVNode as d, createBlock as E, createTextVNode as L } from "vue";
2
2
  import g from "../Icon.vue.js";
3
- import { $t as h } from "../../utils/i18n.js";
3
+ import { $t as v } from "../../utils/i18n.js";
4
4
  const O = { class: "flex items-center justify-between w-full mt-1" }, D = {
5
5
  key: 0,
6
- class: "mt-1 flex items-center gap-1 text-sm"
6
+ class: "h-8 w-24 bg-gray-50 animate-pulse rounded-md"
7
7
  }, F = {
8
+ key: 2,
9
+ class: "mt-1 flex items-center gap-1 text-sm"
10
+ }, T = {
8
11
  key: 0,
9
12
  class: "text-muted-foreground truncate"
10
- }, T = {
13
+ }, q = {
11
14
  key: 0,
15
+ class: "h-9 w-24 bg-gray-50 animate-pulse rounded-md"
16
+ }, A = {
17
+ key: 2,
12
18
  class: "flex items-center gap-1 text-sm"
13
- }, q = {
19
+ }, G = {
14
20
  key: 1,
21
+ class: "h-8 w-20 bg-gray-50 animate-pulse rounded-md mt-1"
22
+ }, H = {
23
+ key: 3,
15
24
  class: "mt-2 flex items-center gap-1.5 text-sm"
16
- }, A = {
25
+ }, J = {
17
26
  key: 0,
18
27
  class: "text-muted-foreground truncate"
19
- }, G = {
28
+ }, K = {
20
29
  key: 3,
21
30
  class: "flex-1 flex flex-col justify-center min-w-0"
22
- }, H = {
31
+ }, Q = {
23
32
  key: 0,
33
+ class: "h-9 w-24 bg-gray-50 animate-pulse rounded-md mt-0.5"
34
+ }, R = {
35
+ key: 2,
24
36
  class: "mt-1 flex items-center gap-1 text-sm"
25
- }, J = {
37
+ }, U = {
26
38
  key: 0,
27
39
  class: "text-muted-foreground truncate"
28
- }, K = { class: "flex-1 flex flex-col justify-center min-w-0" }, Q = { class: "flex items-baseline gap-2 mt-1" }, R = {
40
+ }, W = {
41
+ key: 1,
42
+ class: "h-6 w-5 bg-gray-50 animate-pulse rounded-sm shrink-0"
43
+ }, X = { class: "flex-1 flex flex-col justify-center min-w-0" }, Y = { class: "flex items-baseline gap-2 mt-1" }, Z = {
44
+ key: 0,
45
+ class: "h-8 w-24 bg-gray-50 animate-pulse rounded-md"
46
+ }, _ = {
29
47
  key: 0,
30
48
  class: "mt-2 flex items-center gap-1.5 text-sm"
31
- }, U = {
49
+ }, ee = {
32
50
  key: 0,
33
51
  class: "text-muted-foreground truncate"
34
- }, Z = /* @__PURE__ */ N({
52
+ }, se = /* @__PURE__ */ N({
35
53
  __name: "Stats",
36
54
  props: {
37
55
  items: {},
@@ -39,6 +57,7 @@ const O = { class: "flex items-center justify-between w-full mt-1" }, D = {
39
57
  layout: { default: "icon-left" },
40
58
  columns: { default: 4 },
41
59
  attached: { type: Boolean, default: !1 },
60
+ loading: { type: Boolean, default: !1 },
42
61
  titleSize: { default: "" },
43
62
  valueSize: { default: "" },
44
63
  iconSize: { default: "" },
@@ -46,19 +65,22 @@ const O = { class: "flex items-center justify-between w-full mt-1" }, D = {
46
65
  iconBoxStyle: { default: "transparent" },
47
66
  class: { default: "" }
48
67
  },
49
- setup(n) {
50
- const o = n, S = w(() => {
51
- const i = Number(o.columns) || 4;
52
- return i === 1 ? "grid-cols-1" : i === 2 ? "grid-cols-1 sm:grid-cols-2" : i === 3 ? "grid-cols-1 sm:grid-cols-3" : i === 4 ? "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4" : i === 5 ? "grid-cols-1 sm:grid-cols-3 lg:grid-cols-5" : i === 6 ? "grid-cols-1 sm:grid-cols-3 lg:grid-cols-6" : "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4";
53
- }), z = w(() => [
54
- "grid",
55
- S.value,
56
- o.attached ? "gap-0 border-t border-l overflow-hidden" : "gap-3 sm:gap-4.5",
57
- o.variant === "shadow" && o.attached ? "shadow-md" : "",
58
- o?.layout === "inline-label-value" ? "rounded-sm overflow-hidden" : "",
59
- o.class
60
- ].join(" ")), I = (i, r) => {
61
- const e = o.layout === "inline-label-value" ? "flex px-3.5 py-3 relative transition-all duration-200" : "flex p-3 relative transition-all duration-200", u = {
68
+ setup(t) {
69
+ const o = t, S = w(() => {
70
+ const l = Number(o.columns) || 4;
71
+ return l === 1 ? "grid-cols-1" : l === 2 ? "grid-cols-1 sm:grid-cols-2" : l === 3 ? "grid-cols-1 sm:grid-cols-3" : l === 4 ? "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4" : l === 5 ? "grid-cols-1 sm:grid-cols-3 lg:grid-cols-5" : l === 6 ? "grid-cols-1 sm:grid-cols-3 lg:grid-cols-6" : "grid-cols-1 sm:grid-cols-2 lg:grid-cols-4";
72
+ }), z = w(() => {
73
+ const l = o.attached && o.variant !== "transparent" ? "border-t border-l border-border overflow-hidden" : "overflow-hidden";
74
+ return [
75
+ "grid",
76
+ S.value,
77
+ o.attached ? `gap-0 ${l}` : "gap-3 sm:gap-4.5",
78
+ o.variant === "shadow" && o.attached ? "shadow-md" : "",
79
+ o?.layout === "inline-label-value" ? "rounded-sm" : "",
80
+ o.class
81
+ ].join(" ");
82
+ }), C = (l, a) => {
83
+ const e = o.layout === "inline-label-value" ? "flex px-3.5 py-3 relative " : "flex p-3 relative ", u = {
62
84
  "icon-left": "flex-row items-center gap-3 text-left",
63
85
  "icon-right": "flex-row items-center justify-between gap-3 text-left",
64
86
  "icon-top": "flex-col items-start gap-1 px-5! pt-2! text-left",
@@ -75,11 +97,11 @@ const O = { class: "flex items-center justify-between w-full mt-1" }, D = {
75
97
  }, j = u[o.layout] || u["icon-left"];
76
98
  let x = "";
77
99
  if (o.attached)
78
- x = "border-b border-r hover:bg-muted/30", o.variant !== "transparent" && (x += " bg-card");
100
+ o.variant === "transparent" ? x = "border-b border-r border-transparent hover:bg-muted/30" : o.variant === "outline" ? x = "border-b border-r border-border hover:bg-muted/30" : x = "border-b border-r border-border hover:bg-muted/30 bg-card";
79
101
  else {
80
102
  switch (o.variant) {
81
103
  case "solid": {
82
- const M = i.color || "primary", m = {
104
+ const M = l.color || "primary", p = {
83
105
  primary: "bg-primary-light",
84
106
  secondary: "bg-secondary",
85
107
  success: "bg-success-light",
@@ -87,14 +109,14 @@ const O = { class: "flex items-center justify-between w-full mt-1" }, D = {
87
109
  danger: "bg-danger-light",
88
110
  info: "bg-info-light"
89
111
  };
90
- x = `${m[M] || m.primary}`;
112
+ x = `${p[M] || p.primary}`;
91
113
  break;
92
114
  }
93
115
  case "outline":
94
- x = "bg-body border";
116
+ x = "border border-border";
95
117
  break;
96
118
  case "shadow":
97
- x = "bg-body shadow-md border border-border/50";
119
+ x = "bg-card shadow-md border border-border/50";
98
120
  break;
99
121
  case "transparent":
100
122
  x = "bg-transparent";
@@ -103,14 +125,14 @@ const O = { class: "flex items-center justify-between w-full mt-1" }, D = {
103
125
  x += " rounded-lg";
104
126
  }
105
127
  return [e, j, x].join(" ");
106
- }, C = (i) => {
128
+ }, I = (l) => {
107
129
  if (o.variant === "solid" && !o.attached) {
108
- const r = i.color;
109
- if (r && !["primary", "secondary", "success", "warning", "danger", "info"].includes(r))
110
- return { backgroundColor: `${r}15` };
130
+ const a = l.color;
131
+ if (a && !["primary", "secondary", "success", "warning", "danger", "info"].includes(a))
132
+ return { backgroundColor: `${a}15` };
111
133
  }
112
134
  if (o.layout === "split-bar") {
113
- const r = i.color, e = {
135
+ const a = l.color, e = {
114
136
  primary: "var(--color-primary)",
115
137
  secondary: "var(--color-secondary)",
116
138
  success: "var(--color-success)",
@@ -118,14 +140,14 @@ const O = { class: "flex items-center justify-between w-full mt-1" }, D = {
118
140
  danger: "var(--color-danger)",
119
141
  info: "var(--color-info)"
120
142
  };
121
- if (r)
122
- return { borderLeftColor: e[r] || r };
143
+ if (a)
144
+ return { borderLeftColor: e[a] || a };
123
145
  }
124
146
  return {};
125
- }, P = w(() => o.iconBoxShape === "full-rounded" ? "rounded-full" : o.iconBoxShape === "none" ? "rounded-none" : "rounded-lg"), p = (i) => {
126
- const r = `flex items-center justify-center shrink-0 ${P.value} p-3`, e = i.color || "primary";
147
+ }, P = w(() => o.iconBoxShape === "full-rounded" ? "rounded-full" : o.iconBoxShape === "none" ? "rounded-none" : "rounded-lg"), k = (l) => {
148
+ const a = `flex items-center justify-center shrink-0 ${P.value} p-3`, e = l.color || "primary";
127
149
  if (o.iconBoxStyle === "transparent")
128
- return `${r} bg-transparent ${{
150
+ return `${a} bg-transparent ${{
129
151
  primary: "text-primary",
130
152
  secondary: "text-secondary-foreground",
131
153
  success: "text-success-dark",
@@ -142,7 +164,7 @@ const O = { class: "flex items-center justify-between w-full mt-1" }, D = {
142
164
  danger: "bg-danger text-danger-fg",
143
165
  info: "bg-info text-info-fg"
144
166
  };
145
- return `${r} ${u[e] || u.primary}`;
167
+ return `${a} ${u[e] || u.primary}`;
146
168
  } else {
147
169
  const u = {
148
170
  primary: "bg-primary-light text-primary",
@@ -152,10 +174,10 @@ const O = { class: "flex items-center justify-between w-full mt-1" }, D = {
152
174
  danger: "bg-danger-light text-danger-dark",
153
175
  info: "bg-info-light text-info-dark"
154
176
  };
155
- return `${r} ${u[e] || u.primary}`;
177
+ return `${a} ${u[e] || u.primary}`;
156
178
  }
157
- }, $ = (i) => {
158
- const r = i.color || "primary";
179
+ }, B = (l) => {
180
+ const a = l.color || "primary";
159
181
  return `shrink-0 ${{
160
182
  primary: "text-primary",
161
183
  secondary: "text-secondary-foreground",
@@ -163,177 +185,183 @@ const O = { class: "flex items-center justify-between w-full mt-1" }, D = {
163
185
  warning: "text-warning-dark",
164
186
  danger: "text-danger-dark",
165
187
  info: "text-info-dark"
166
- }[r] || "text-primary"}`;
167
- }, B = (i) => {
168
- const r = i.color;
169
- return r && !["primary", "secondary", "success", "warning", "danger", "info"].includes(r) ? { color: r } : {};
170
- }, k = (i) => {
171
- const r = i.color;
172
- return r && !["primary", "secondary", "success", "warning", "danger", "info"].includes(r) ? o.iconBoxStyle === "transparent" ? { color: r } : o.variant === "solid" && !o.attached ? { backgroundColor: r, color: "#fff" } : { color: r, backgroundColor: `${r}20` } : {};
188
+ }[a] || "text-primary"}`;
189
+ }, $ = (l) => {
190
+ const a = l.color;
191
+ return a && !["primary", "secondary", "success", "warning", "danger", "info"].includes(a) ? { color: a } : {};
192
+ }, m = (l) => {
193
+ const a = l.color;
194
+ return a && !["primary", "secondary", "success", "warning", "danger", "info"].includes(a) ? o.iconBoxStyle === "transparent" ? { color: a } : o.variant === "solid" && !o.attached ? { backgroundColor: a, color: "#fff" } : { color: a, backgroundColor: `${a}20` } : {};
173
195
  };
174
- return (i, r) => (s(), a("div", {
175
- class: t(z.value)
196
+ return (l, a) => (n(), r("div", {
197
+ class: s(z.value)
176
198
  }, [
177
- (s(!0), a(y, null, V(n.items, (e, u) => (s(), a("div", {
199
+ (n(!0), r(y, null, V(t.items, (e, u) => (n(), r("div", {
178
200
  key: e.id || u,
179
- class: t(I(e)),
180
- style: v(C(e))
201
+ class: s(C(e)),
202
+ style: b(I(e))
181
203
  }, [
182
- n.layout === "title-top-icon-bottom-right" ? (s(), a(y, { key: 0 }, [
183
- c("h3", {
184
- class: t(n.titleSize || "text-sm font-medium text-muted-foreground truncate w-full")
185
- }, l(e.titleI18n ? b(h)(e.titleI18n) : e.title), 3),
186
- c("div", O, [
187
- c("div", null, [
188
- c("p", {
189
- class: t(n.valueSize || "text-2xl font-bold text-foreground truncate")
190
- }, l(e.value), 3),
191
- e.trend ? (s(), a("div", D, [
204
+ t.layout === "title-top-icon-bottom-right" ? (n(), r(y, { key: 0 }, [
205
+ i("h3", {
206
+ class: s(t.titleSize || "text-sm font-medium text-muted-foreground truncate w-full")
207
+ }, c(e.titleI18n ? h(v)(e.titleI18n) : e.title), 3),
208
+ i("div", O, [
209
+ i("div", null, [
210
+ t.loading ? (n(), r("div", D)) : (n(), r("p", {
211
+ key: 1,
212
+ class: s(t.valueSize || "text-2xl font-bold text-foreground truncate")
213
+ }, c(e.value), 3)),
214
+ e.trend && !t.loading ? (n(), r("div", F, [
192
215
  f(g, {
193
216
  icon: e.trend.isPositive ? "lucide:trending-up" : "lucide:trending-down",
194
- class: t([e.trend.isPositive ? "text-success" : "text-danger", "w-4 h-4 shrink-0"])
217
+ class: s([e.trend.isPositive ? "text-success" : "text-danger", "w-4 h-4 shrink-0"])
195
218
  }, null, 8, ["icon", "class"]),
196
- c("span", {
197
- class: t([e.trend.isPositive ? "text-success-dark" : "text-danger-dark", "font-medium whitespace-nowrap"])
198
- }, l(e.trend.value), 3),
199
- e.trend.label ? (s(), a("span", F, l(e.trend.label), 1)) : d("", !0)
219
+ i("span", {
220
+ class: s([e.trend.isPositive ? "text-success-dark" : "text-danger-dark", "font-medium whitespace-nowrap"])
221
+ }, c(e.trend.value), 3),
222
+ e.trend.label ? (n(), r("span", T, c(e.trend.label), 1)) : d("", !0)
200
223
  ])) : d("", !0)
201
224
  ]),
202
- e.icon ? (s(), a("div", {
225
+ e.icon ? (n(), r("div", {
203
226
  key: 0,
204
- class: t(p(e)),
205
- style: v(k(e))
227
+ class: s(k(e)),
228
+ style: b(m(e))
206
229
  }, [
207
230
  f(g, {
208
231
  icon: e.icon,
209
- class: t(n.iconSize || "w-6 h-6")
232
+ class: s(t.iconSize || "w-6 h-6")
210
233
  }, null, 8, ["icon", "class"])
211
234
  ], 6)) : d("", !0)
212
235
  ])
213
- ], 64)) : n.layout === "centered-value-title" ? (s(), a(y, { key: 1 }, [
214
- c("p", {
215
- class: t(n.valueSize || "text-3xl font-bold text-foreground")
216
- }, l(e.value), 3),
217
- c("h3", {
218
- class: t(n.titleSize || "text-sm font-medium text-muted-foreground")
219
- }, l(e.titleI18n ? b(h)(e.titleI18n) : e.title), 3),
220
- e.trend ? (s(), a("div", T, [
236
+ ], 64)) : t.layout === "centered-value-title" ? (n(), r(y, { key: 1 }, [
237
+ t.loading ? (n(), r("div", q)) : (n(), r("p", {
238
+ key: 1,
239
+ class: s(t.valueSize || "text-3xl font-bold text-foreground")
240
+ }, c(e.value), 3)),
241
+ i("h3", {
242
+ class: s(t.titleSize || "text-sm font-medium text-muted-foreground")
243
+ }, c(e.titleI18n ? h(v)(e.titleI18n) : e.title), 3),
244
+ e.trend && !t.loading ? (n(), r("div", A, [
221
245
  f(g, {
222
246
  icon: e.trend.isPositive ? "lucide:trending-up" : "lucide:trending-down",
223
- class: t([e.trend.isPositive ? "text-success" : "text-danger", "w-4 h-4 shrink-0"])
247
+ class: s([e.trend.isPositive ? "text-success" : "text-danger", "w-4 h-4 shrink-0"])
224
248
  }, null, 8, ["icon", "class"]),
225
- c("span", {
226
- class: t([e.trend.isPositive ? "text-success-dark" : "text-danger-dark", "font-medium"])
227
- }, l(e.trend.value), 3)
249
+ i("span", {
250
+ class: s([e.trend.isPositive ? "text-success-dark" : "text-danger-dark", "font-medium"])
251
+ }, c(e.trend.value), 3)
228
252
  ])) : d("", !0)
229
- ], 64)) : n.layout === "floating-icon" ? (s(), a(y, { key: 2 }, [
230
- e.icon ? (s(), a("div", {
253
+ ], 64)) : t.layout === "floating-icon" ? (n(), r(y, { key: 2 }, [
254
+ e.icon ? (n(), r("div", {
231
255
  key: 0,
232
- class: t([p(e), "absolute top-4 right-4"]),
233
- style: v(k(e))
256
+ class: s([k(e), "absolute top-4 right-4"]),
257
+ style: b(m(e))
234
258
  }, [
235
259
  f(g, {
236
260
  icon: e.icon,
237
- class: t(n.iconSize || "w-6 h-6")
261
+ class: s(t.iconSize || "w-6 h-6")
238
262
  }, null, 8, ["icon", "class"])
239
263
  ], 6)) : d("", !0),
240
- c("h3", {
241
- class: t(n.titleSize || "text-sm font-medium text-muted-foreground truncate pr-12")
242
- }, l(e.titleI18n ? b(h)(e.titleI18n) : e.title), 3),
243
- c("p", {
244
- class: t(n.valueSize || "text-2xl font-bold text-foreground truncate mt-1")
245
- }, l(e.value), 3),
246
- e.trend ? (s(), a("div", q, [
264
+ i("h3", {
265
+ class: s(t.titleSize || "text-sm font-medium text-muted-foreground truncate pr-12")
266
+ }, c(e.titleI18n ? h(v)(e.titleI18n) : e.title), 3),
267
+ t.loading ? (n(), r("div", G)) : (n(), r("p", {
268
+ key: 2,
269
+ class: s(t.valueSize || "text-2xl font-bold text-foreground truncate mt-1")
270
+ }, c(e.value), 3)),
271
+ e.trend && !t.loading ? (n(), r("div", H, [
247
272
  f(g, {
248
273
  icon: e.trend.isPositive ? "lucide:trending-up" : "lucide:trending-down",
249
- class: t([e.trend.isPositive ? "text-success" : "text-danger", "w-4 h-4 shrink-0"])
274
+ class: s([e.trend.isPositive ? "text-success" : "text-danger", "w-4 h-4 shrink-0"])
250
275
  }, null, 8, ["icon", "class"]),
251
- c("span", {
252
- class: t([e.trend.isPositive ? "text-success-dark" : "text-danger-dark", "font-medium whitespace-nowrap"])
253
- }, l(e.trend.value), 3),
254
- e.trend.label ? (s(), a("span", A, l(e.trend.label), 1)) : d("", !0)
276
+ i("span", {
277
+ class: s([e.trend.isPositive ? "text-success-dark" : "text-danger-dark", "font-medium whitespace-nowrap"])
278
+ }, c(e.trend.value), 3),
279
+ e.trend.label ? (n(), r("span", J, c(e.trend.label), 1)) : d("", !0)
255
280
  ])) : d("", !0)
256
- ], 64)) : n.layout === "split-bar" ? (s(), a("div", G, [
257
- c("h3", {
258
- class: t(
259
- n.titleSize || "text-xs font-semibold uppercase tracking-widest text-muted-foreground truncate"
281
+ ], 64)) : t.layout === "split-bar" ? (n(), r("div", K, [
282
+ i("h3", {
283
+ class: s(
284
+ t.titleSize || "text-xs font-semibold uppercase tracking-widest text-muted-foreground truncate"
260
285
  )
261
- }, l(e.titleI18n ? b(h)(e.titleI18n) : e.title), 3),
262
- c("p", {
263
- class: t(n.valueSize || "text-3xl font-black text-foreground truncate mt-0.5")
264
- }, l(e.value), 3),
265
- e.trend ? (s(), a("div", H, [
286
+ }, c(e.titleI18n ? h(v)(e.titleI18n) : e.title), 3),
287
+ t.loading ? (n(), r("div", Q)) : (n(), r("p", {
288
+ key: 1,
289
+ class: s(t.valueSize || "text-3xl font-black text-foreground truncate mt-0.5")
290
+ }, c(e.value), 3)),
291
+ e.trend && !t.loading ? (n(), r("div", R, [
266
292
  f(g, {
267
293
  icon: e.trend.isPositive ? "lucide:trending-up" : "lucide:trending-down",
268
- class: t([e.trend.isPositive ? "text-success" : "text-danger", "w-4 h-4 shrink-0"])
294
+ class: s([e.trend.isPositive ? "text-success" : "text-danger", "w-4 h-4 shrink-0"])
269
295
  }, null, 8, ["icon", "class"]),
270
- c("span", {
271
- class: t([e.trend.isPositive ? "text-success-dark" : "text-danger-dark", "font-medium whitespace-nowrap"])
272
- }, l(e.trend.value), 3),
273
- e.trend.label ? (s(), a("span", J, l(e.trend.label), 1)) : d("", !0)
296
+ i("span", {
297
+ class: s([e.trend.isPositive ? "text-success-dark" : "text-danger-dark", "font-medium whitespace-nowrap"])
298
+ }, c(e.trend.value), 3),
299
+ e.trend.label ? (n(), r("span", U, c(e.trend.label), 1)) : d("", !0)
274
300
  ])) : d("", !0)
275
- ])) : n.layout === "inline-label-value" ? (s(), a(y, { key: 4 }, [
276
- e.icon ? (s(), E(g, {
301
+ ])) : t.layout === "inline-label-value" ? (n(), r(y, { key: 4 }, [
302
+ e.icon ? (n(), E(g, {
277
303
  key: 0,
278
304
  icon: e.icon,
279
- class: t([$(e), n.iconSize || "w-4.5 h-4.5"]),
280
- style: v(B(e))
305
+ class: s([B(e), t.iconSize || "w-4.5 h-4.5"]),
306
+ style: b($(e))
281
307
  }, null, 8, ["icon", "class", "style"])) : d("", !0),
282
- c("span", {
283
- class: t([n.titleSize || "-text-fs-2 font-medium text-muted-foreground truncate", "flex-1 min-w-0"])
284
- }, l(e.titleI18n ? b(h)(e.titleI18n) : e.title), 3),
285
- c("span", {
286
- class: t(n.valueSize || "-text-fs-1 font-semibold text-foreground tabular-nums shrink-0")
287
- }, l(e.value), 3),
288
- e.trend ? (s(), a("span", {
289
- key: 1,
290
- class: t(["shrink-0 flex items-center gap-0.5 text-xs font-medium", e.trend.isPositive ? "text-success-dark" : "text-danger-dark"])
308
+ i("span", {
309
+ class: s([t.titleSize || "-text-fs-2 font-medium text-muted-foreground truncate", "flex-1 min-w-0"])
310
+ }, c(e.titleI18n ? h(v)(e.titleI18n) : e.title), 3),
311
+ t.loading ? (n(), r("div", W)) : (n(), r("span", {
312
+ key: 2,
313
+ class: s(t.valueSize || "-text-fs-1 font-semibold text-foreground tabular-nums shrink-0")
314
+ }, c(e.value), 3)),
315
+ e.trend && !t.loading ? (n(), r("span", {
316
+ key: 3,
317
+ class: s(["shrink-0 flex items-center gap-0.5 text-xs font-medium", e.trend.isPositive ? "text-success-dark" : "text-danger-dark"])
291
318
  }, [
292
319
  f(g, {
293
320
  icon: e.trend.isPositive ? "lucide:trending-up" : "lucide:trending-down",
294
321
  class: "w-3 h-3"
295
322
  }, null, 8, ["icon"]),
296
- L(" " + l(e.trend.value), 1)
323
+ L(" " + c(e.trend.value), 1)
297
324
  ], 2)) : d("", !0)
298
- ], 64)) : (s(), a(y, { key: 5 }, [
299
- e.icon && n.layout !== "icon-right" ? (s(), a("div", {
325
+ ], 64)) : (n(), r(y, { key: 5 }, [
326
+ e.icon && t.layout !== "icon-right" ? (n(), r("div", {
300
327
  key: 0,
301
- class: t(p(e)),
302
- style: v(k(e))
328
+ class: s(k(e)),
329
+ style: b(m(e))
303
330
  }, [
304
331
  f(g, {
305
332
  icon: e.icon,
306
- class: t(n.iconSize || "w-6 h-6")
333
+ class: s(t.iconSize || "w-6 h-6")
307
334
  }, null, 8, ["icon", "class"])
308
335
  ], 6)) : d("", !0),
309
- c("div", K, [
310
- c("h3", {
311
- class: t(n.titleSize || "text-sm font-medium text-muted-foreground truncate")
312
- }, l(e.titleI18n ? b(h)(e.titleI18n) : e.title), 3),
313
- c("div", Q, [
314
- c("p", {
315
- class: t(n.valueSize || "text-2xl font-bold text-foreground truncate")
316
- }, l(e.value), 3)
336
+ i("div", X, [
337
+ i("h3", {
338
+ class: s(t.titleSize || "text-sm font-medium text-muted-foreground truncate")
339
+ }, c(e.titleI18n ? h(v)(e.titleI18n) : e.title), 3),
340
+ i("div", Y, [
341
+ t.loading ? (n(), r("div", Z)) : (n(), r("p", {
342
+ key: 1,
343
+ class: s(t.valueSize || "text-2xl font-bold text-foreground truncate")
344
+ }, c(e.value), 3))
317
345
  ]),
318
- e.trend ? (s(), a("div", R, [
346
+ e.trend && !t.loading ? (n(), r("div", _, [
319
347
  f(g, {
320
348
  icon: e.trend.isPositive ? "lucide:trending-up" : "lucide:trending-down",
321
- class: t([e.trend.isPositive ? "text-success" : "text-danger", "w-4 h-4 shrink-0"])
349
+ class: s([e.trend.isPositive ? "text-success" : "text-danger", "w-4 h-4 shrink-0"])
322
350
  }, null, 8, ["icon", "class"]),
323
- c("span", {
324
- class: t([e.trend.isPositive ? "text-success-dark" : "text-danger-dark", "font-medium whitespace-nowrap"])
325
- }, l(e.trend.value), 3),
326
- e.trend.label ? (s(), a("span", U, l(e.trend.label), 1)) : d("", !0)
351
+ i("span", {
352
+ class: s([e.trend.isPositive ? "text-success-dark" : "text-danger-dark", "font-medium whitespace-nowrap"])
353
+ }, c(e.trend.value), 3),
354
+ e.trend.label ? (n(), r("span", ee, c(e.trend.label), 1)) : d("", !0)
327
355
  ])) : d("", !0)
328
356
  ]),
329
- e.icon && n.layout === "icon-right" ? (s(), a("div", {
357
+ e.icon && t.layout === "icon-right" ? (n(), r("div", {
330
358
  key: 1,
331
- class: t(p(e)),
332
- style: v(k(e))
359
+ class: s(k(e)),
360
+ style: b(m(e))
333
361
  }, [
334
362
  f(g, {
335
363
  icon: e.icon,
336
- class: t(n.iconSize || "w-6 h-6")
364
+ class: s(t.iconSize || "w-6 h-6")
337
365
  }, null, 8, ["icon", "class"])
338
366
  ], 6)) : d("", !0)
339
367
  ], 64))
@@ -342,5 +370,5 @@ const O = { class: "flex items-center justify-between w-full mt-1" }, D = {
342
370
  }
343
371
  });
344
372
  export {
345
- Z as default
373
+ se as default
346
374
  };
@@ -23,6 +23,7 @@ export interface StatsProps {
23
23
  layout?: StatsLayout;
24
24
  columns?: number | string;
25
25
  attached?: boolean;
26
+ loading?: boolean;
26
27
  titleSize?: string;
27
28
  valueSize?: string;
28
29
  iconSize?: string;
@@ -34,9 +34,9 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
34
34
  onDuplicate?: (id: string) => any;
35
35
  }>, {
36
36
  itemClass: string;
37
- confirmDelete: boolean;
38
37
  isEditing: boolean;
39
38
  canDelete: boolean;
39
+ confirmDelete: boolean;
40
40
  allowIconChange: boolean;
41
41
  activeItemClass: string;
42
42
  inactiveItemClass: string;
@@ -1,16 +1,35 @@
1
- const c = (e, i) => {
2
- const n = i.getBoundingClientRect(), s = e.clientX - n.left, l = e.clientY - n.top, t = document.createElement("span"), p = Math.max(n.width, n.height), o = p / 2;
3
- t.style.width = t.style.height = `${p}px`, t.style.left = `${s - o}px`, t.style.top = `${l - o}px`, t.style.position = "absolute", t.style.pointerEvents = "none", t.classList.add("ripple"), i.querySelectorAll(".ripple").forEach((r) => r.remove()), i.appendChild(t), setTimeout(() => {
4
- t && t.parentNode && t.remove();
5
- }, 600);
6
- }, a = {
1
+ const y = (e, t) => {
2
+ const i = t.getBoundingClientRect(), p = e.clientX - i.left, d = e.clientY - i.top, s = Math.max(i.width, i.height), c = s / 2;
3
+ t.querySelectorAll(".ripple").forEach((r) => r.remove());
4
+ const o = document.createElement("span");
5
+ o.style.cssText = `
6
+ width: ${s}px;
7
+ height: ${s}px;
8
+ left: ${p - c}px;
9
+ top: ${d - c}px;
10
+ position: absolute;
11
+ pointer-events: none;
12
+ border-radius: 50%;
13
+ transform: scale(0);
14
+ opacity: 0;
15
+ will-change: transform, opacity;
16
+ background-color: rgba(255, 255, 255, 1);
17
+ `, o.classList.add("ripple"), t.appendChild(o);
18
+ let a = null;
19
+ const m = 400, l = (r) => {
20
+ a || (a = r);
21
+ const n = Math.min((r - a) / m, 1), u = (1 - Math.pow(1 - n, 3)) * 2.5, h = n < 0.4 ? n * 0.2 : 0.08 * (1 - (n - 0.4) / 0.6);
22
+ o.style.transform = `scale(${u})`, o.style.opacity = `${h}`, n < 1 ? requestAnimationFrame(l) : o.remove();
23
+ };
24
+ requestAnimationFrame(l);
25
+ }, g = {
7
26
  mounted(e) {
8
- window.getComputedStyle(e).position === "static" && (e.style.position = "relative"), e.style.overflow = "hidden", e._rippleHandler = (i) => c(i, e), e.addEventListener("click", e._rippleHandler);
27
+ window.getComputedStyle(e).position === "static" && (e.style.position = "relative"), e.style.overflow = "hidden", e._rippleHandler = (t) => y(t, e), e.addEventListener("click", e._rippleHandler);
9
28
  },
10
29
  unmounted(e) {
11
- e._rippleHandler && e.removeEventListener("click", e._rippleHandler), e.querySelectorAll(".ripple").forEach((n) => n.remove());
30
+ e._rippleHandler && e.removeEventListener("click", e._rippleHandler), e.querySelectorAll(".ripple").forEach((t) => t.remove());
12
31
  }
13
32
  };
14
33
  export {
15
- a as vRipple
34
+ g as vRipple
16
35
  };