vlite3 1.4.25 → 1.4.27

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 (32) hide show
  1. package/components/CategoryManager/CategoryManager.vue2.js +3 -2
  2. package/components/Chart/BarChart.vue.d.ts +1 -1
  3. package/components/Chart/ChartLegend.vue.d.ts +22 -0
  4. package/components/Chart/ChartLegend.vue.js +91 -0
  5. package/components/Chart/ChartLegend.vue2.js +4 -0
  6. package/components/Chart/GanttChart.vue.d.ts +2 -2
  7. package/components/Chart/LineChart.vue.d.ts +5 -2
  8. package/components/Chart/LineChart.vue.js +1 -1
  9. package/components/Chart/LineChart.vue2.js +40 -39
  10. package/components/Chart/PieChart.vue.d.ts +11 -4
  11. package/components/Chart/PieChart.vue.js +118 -114
  12. package/components/Chart/SegmentBarChart.vue.d.ts +1 -1
  13. package/components/Chart/TimelineChart.vue.d.ts +2 -2
  14. package/components/Chart/index.d.ts +2 -1
  15. package/components/Chart/types.d.ts +25 -0
  16. package/components/ColorPicker/ColorPicker.vue.d.ts +20 -1
  17. package/components/ColorPicker/ColorPicker.vue.js +72 -59
  18. package/components/DateRangePicker.vue.js +5 -239
  19. package/components/DateRangePicker.vue2.js +239 -2
  20. package/components/Form/FormField.vue.js +10 -10
  21. package/components/Heatmap/Heatmap.vue.d.ts +1 -1
  22. package/components/Screen/ScreenFilter.vue.js +3 -2
  23. package/components/SidebarMenu/SidebarMenu.vue.d.ts +1 -1
  24. package/components/Stats/StatItem.vue.d.ts +2 -0
  25. package/components/Stats/StatItem.vue.js +234 -134
  26. package/components/Stats/Stats.vue.d.ts +1 -0
  27. package/components/Stats/Stats.vue.js +45 -41
  28. package/components/Stats/components/StatTrend.vue.js +35 -32
  29. package/components/Stats/types.d.ts +32 -2
  30. package/index.js +138 -136
  31. package/package.json +2 -2
  32. package/style.css +1 -1
@@ -1,4 +1,241 @@
1
- import f from "./DateRangePicker.vue.js";
1
+ import { defineComponent as $, ref as b, watch as F, computed as u, openBlock as d, createBlock as m, unref as v, withCtx as D, createElementVNode as i, createElementBlock as w, Fragment as L, renderList as T, createCommentVNode as z, createVNode as h, normalizeClass as y, toDisplayString as x, createTextVNode as B } from "vue";
2
+ import E from "./Dropdown/Dropdown.vue.js";
3
+ import R from "./Icon.vue.js";
4
+ import { $t as l } from "../utils/i18n.js";
5
+ /* empty css */
6
+ /* empty css */
7
+ /* empty css */
8
+ import P from "./Button.vue.js";
9
+ import p from "v-datepicker-lite";
10
+ import "v-datepicker-lite/style.css";
11
+ const j = { class: "flex items-center justify-start gap-2 w-full" }, H = { class: "flex flex-col sm:flex-row bg-background rounded-md" }, Q = {
12
+ key: 0,
13
+ class: "flex flex-col gap-1 sm:pr-3 py-2 sm:border-r border-border max-h-[280px]"
14
+ }, O = { class: "flex flex-col sm:flex-row items-center gap-4 py-2 p-3" }, I = { class: "border border-border rounded-md overflow-hidden bg-background" }, U = { class: "flex items-center justify-center shrink-0" }, q = { class: "border border-border rounded-md overflow-hidden bg-background" }, le = /* @__PURE__ */ $({
15
+ __name: "DateRangePicker",
16
+ props: {
17
+ modelValue: {},
18
+ placeholderStart: { default: "Start Date" },
19
+ placeholderEnd: { default: "End Date" },
20
+ minDate: {},
21
+ maxDate: {},
22
+ disabled: { type: Boolean },
23
+ readonly: { type: Boolean },
24
+ size: {},
25
+ variant: {},
26
+ showQuickRanges: { type: Boolean, default: !0 },
27
+ triggerClass: {}
28
+ },
29
+ emits: ["update:modelValue", "change"],
30
+ setup(s, { emit: M }) {
31
+ const g = s, k = M, o = b(!1), c = b(0);
32
+ F(o, (a) => {
33
+ a && c.value++;
34
+ });
35
+ const n = u({
36
+ get: () => {
37
+ const a = g.modelValue;
38
+ return a ? {
39
+ startDate: a.startDate !== void 0 ? a.startDate : a.start,
40
+ endDate: a.endDate !== void 0 ? a.endDate : a.end
41
+ } : { startDate: null, endDate: null };
42
+ },
43
+ set: (a) => {
44
+ k("update:modelValue", a), k("change", a);
45
+ }
46
+ }), Y = (a) => {
47
+ n.value = { ...n.value, startDate: a };
48
+ }, S = (a) => {
49
+ n.value = { ...n.value, endDate: a };
50
+ }, C = u(() => {
51
+ if (n.value.endDate) {
52
+ const a = new Date(n.value.endDate);
53
+ if (!isNaN(a.getTime())) return a.toISOString();
54
+ }
55
+ return g.maxDate;
56
+ }), N = u(() => {
57
+ if (n.value.startDate) {
58
+ const a = new Date(n.value.startDate);
59
+ if (!isNaN(a.getTime())) return a.toISOString();
60
+ }
61
+ return g.minDate;
62
+ }), f = (a) => {
63
+ if (!a) return "";
64
+ try {
65
+ const e = new Date(a);
66
+ return isNaN(e.getTime()) ? "" : e.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric" });
67
+ } catch {
68
+ return "";
69
+ }
70
+ }, V = u(() => [
71
+ {
72
+ label: l("vlite.dateRangePicker.today") !== "vlite.dateRangePicker.today" ? l("vlite.dateRangePicker.today") : "Today",
73
+ value: "today",
74
+ icon: "lucide:calendar"
75
+ },
76
+ {
77
+ label: l("vlite.dateRangePicker.yesterday") !== "vlite.dateRangePicker.yesterday" ? l("vlite.dateRangePicker.yesterday") : "Yesterday",
78
+ value: "yesterday",
79
+ icon: "lucide:calendar-minus"
80
+ },
81
+ {
82
+ label: l("vlite.dateRangePicker.last7Days") !== "vlite.dateRangePicker.last7Days" ? l("vlite.dateRangePicker.last7Days") : "Last 7 Days",
83
+ value: "last_7_days",
84
+ icon: "lucide:calendar-days"
85
+ },
86
+ {
87
+ label: l("vlite.dateRangePicker.last30Days") !== "vlite.dateRangePicker.last30Days" ? l("vlite.dateRangePicker.last30Days") : "Last 30 Days",
88
+ value: "last_30_days",
89
+ icon: "lucide:calendar-days"
90
+ },
91
+ {
92
+ label: l("vlite.dateRangePicker.thisMonth") !== "vlite.dateRangePicker.thisMonth" ? l("vlite.dateRangePicker.thisMonth") : "This Month",
93
+ value: "this_month",
94
+ icon: "lucide:calendar-range"
95
+ },
96
+ {
97
+ label: l("vlite.dateRangePicker.lastMonth") !== "vlite.dateRangePicker.lastMonth" ? l("vlite.dateRangePicker.lastMonth") : "Last Month",
98
+ value: "last_month",
99
+ icon: "lucide:calendar-range"
100
+ },
101
+ {
102
+ label: l("vlite.dateRangePicker.last6Months") !== "vlite.dateRangePicker.last6Months" ? l("vlite.dateRangePicker.last6Months") : "Last 6 Months",
103
+ value: "last_6_months",
104
+ icon: "lucide:history"
105
+ },
106
+ {
107
+ label: l("vlite.dateRangePicker.thisYear") !== "vlite.dateRangePicker.thisYear" ? l("vlite.dateRangePicker.thisYear") : "This Year",
108
+ value: "this_year",
109
+ icon: "lucide:calendar-check"
110
+ },
111
+ {
112
+ label: l("vlite.dateRangePicker.lastYear") !== "vlite.dateRangePicker.lastYear" ? l("vlite.dateRangePicker.lastYear") : "Last Year",
113
+ value: "last_year",
114
+ icon: "lucide:history"
115
+ }
116
+ ]), _ = (a) => {
117
+ const e = /* @__PURE__ */ new Date();
118
+ let t = /* @__PURE__ */ new Date(), r = /* @__PURE__ */ new Date();
119
+ switch (e.setHours(0, 0, 0, 0), t.setHours(0, 0, 0, 0), r.setHours(0, 0, 0, 0), a.value) {
120
+ case "today":
121
+ t = new Date(e), r = new Date(e);
122
+ break;
123
+ case "yesterday":
124
+ t = new Date(e), t.setDate(t.getDate() - 1), r = new Date(t);
125
+ break;
126
+ case "last_7_days":
127
+ t = new Date(e), t.setDate(t.getDate() - 6), r = new Date(e);
128
+ break;
129
+ case "last_30_days":
130
+ t = new Date(e), t.setDate(t.getDate() - 29), r = new Date(e);
131
+ break;
132
+ case "this_month":
133
+ t = new Date(e.getFullYear(), e.getMonth(), 1), r = new Date(e);
134
+ break;
135
+ case "last_month":
136
+ t = new Date(e.getFullYear(), e.getMonth() - 1, 1), r = new Date(e.getFullYear(), e.getMonth(), 0);
137
+ break;
138
+ case "last_6_months":
139
+ t = new Date(e.getFullYear(), e.getMonth() - 5, 1), r = new Date(e);
140
+ break;
141
+ case "this_year":
142
+ t = new Date(e.getFullYear(), 0, 1), r = new Date(e);
143
+ break;
144
+ case "last_year":
145
+ t = new Date(e.getFullYear() - 1, 0, 1), r = new Date(e.getFullYear() - 1, 11, 31);
146
+ break;
147
+ }
148
+ n.value = { startDate: t, endDate: r }, c.value++, o.value = !1;
149
+ };
150
+ return (a, e) => (d(), m(v(E), {
151
+ isOpen: o.value,
152
+ "onUpdate:isOpen": e[0] || (e[0] = (t) => o.value = t),
153
+ position: "bottom-start",
154
+ disabled: s.disabled || s.readonly,
155
+ class: "w-full sm:w-auto inline-block",
156
+ maxHeight: "none"
157
+ }, {
158
+ trigger: D(({ isOpen: t }) => [
159
+ h(P, {
160
+ icon: "lucide:calendar",
161
+ variant: s.variant || "outline",
162
+ size: s.size || "md",
163
+ disabled: s.disabled,
164
+ class: y(["w-full justify-between text-left font-normal", [s.triggerClass, { "ring-1 ring-ring ring-offset-[1]": t }]]),
165
+ "data-testid": a.$attrs["data-testid"] || (a.$attrs.name ? `daterange-${a.$attrs.name}` : "daterange")
166
+ }, {
167
+ default: D(() => [
168
+ i("div", j, [
169
+ i("span", {
170
+ class: y({ "text-muted-foreground": !n.value.startDate })
171
+ }, x(n.value.startDate ? f(n.value.startDate) : s.placeholderStart), 3),
172
+ e[1] || (e[1] = B(" — ", -1)),
173
+ i("span", {
174
+ class: y({ "text-muted-foreground": !n.value.endDate })
175
+ }, x(n.value.endDate ? f(n.value.endDate) : s.placeholderEnd), 3)
176
+ ])
177
+ ]),
178
+ _: 1
179
+ }, 8, ["variant", "size", "disabled", "class", "data-testid"])
180
+ ]),
181
+ menu: D(() => [
182
+ i("div", H, [
183
+ s.showQuickRanges ? (d(), w("div", Q, [
184
+ e[2] || (e[2] = i("div", { class: "text-xs pl-2 pb-2 font-semibold text-muted-foreground uppercase tracking-wider" }, " Quick Ranges ", -1)),
185
+ (d(!0), w(L, null, T(V.value, (t) => (d(), m(P, {
186
+ key: t.value,
187
+ text: t.label,
188
+ icon: t.icon,
189
+ variant: "ghost",
190
+ size: "sm",
191
+ class: "justify-start w-full font-normal",
192
+ onClick: (r) => _(t)
193
+ }, null, 8, ["text", "icon", "onClick"]))), 128))
194
+ ])) : z("", !0),
195
+ i("div", O, [
196
+ i("div", I, [
197
+ (d(), m(v(p), {
198
+ key: "start-" + c.value,
199
+ value: n.value.startDate,
200
+ onChange: Y,
201
+ mode: "date",
202
+ "max-date": C.value,
203
+ "min-date": s.minDate,
204
+ disabled: s.disabled,
205
+ class: "min-w-[270px]",
206
+ readonly: s.readonly
207
+ }, null, 8, ["value", "max-date", "min-date", "disabled", "readonly"]))
208
+ ]),
209
+ i("div", U, [
210
+ h(R, {
211
+ icon: "lucide:arrow-right",
212
+ class: "w-5 h-5 text-muted-foreground hidden sm:block opacity-50"
213
+ }),
214
+ h(R, {
215
+ icon: "lucide:arrow-down",
216
+ class: "w-5 h-5 text-muted-foreground sm:hidden opacity-50"
217
+ })
218
+ ]),
219
+ i("div", q, [
220
+ (d(), m(v(p), {
221
+ key: "end-" + c.value,
222
+ value: n.value.endDate,
223
+ onChange: S,
224
+ mode: "date",
225
+ "min-date": N.value,
226
+ "max-date": s.maxDate,
227
+ class: "min-w-[270px]",
228
+ disabled: s.disabled,
229
+ readonly: s.readonly
230
+ }, null, 8, ["value", "min-date", "max-date", "disabled", "readonly"]))
231
+ ])
232
+ ])
233
+ ])
234
+ ]),
235
+ _: 1
236
+ }, 8, ["isOpen", "disabled"]));
237
+ }
238
+ });
2
239
  export {
3
- f as default
240
+ le as default
4
241
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as E, computed as f, markRaw as O, openBlock as c, createBlock as m, mergeProps as p, toHandlers as C, createSlots as M, unref as P, withCtx as u, createVNode as L, createTextVNode as x, toDisplayString as y, createCommentVNode as N, resolveDynamicComponent as q } from "vue";
1
+ import { defineComponent as E, computed as f, markRaw as O, openBlock as c, createBlock as m, mergeProps as p, toHandlers as $, createSlots as M, unref as P, withCtx as u, createVNode as L, createTextVNode as x, toDisplayString as y, createCommentVNode as N, resolveDynamicComponent as q } from "vue";
2
2
  import { resolveFieldType as G, isComponent as k, isAddonObject as T } from "./utils/form.utils.js";
3
3
  import J from "../NumberInput.vue.js";
4
4
  import z from "../Button.vue.js";
@@ -172,10 +172,10 @@ const Ne = /* @__PURE__ */ E({
172
172
  rounded: oe,
173
173
  error: se,
174
174
  switchVariant: ue,
175
- ...D
175
+ ...j
176
176
  } = t;
177
177
  return {
178
- ...D,
178
+ ...j,
179
179
  modelValue: !!e.value,
180
180
  label: e.field.label,
181
181
  labelI18n: e.field.labelI18n,
@@ -426,15 +426,15 @@ const Ne = /* @__PURE__ */ E({
426
426
  d(l.value, l.data);
427
427
  }
428
428
  } : {};
429
- }), H = f(() => {
429
+ }), D = f(() => {
430
430
  const a = o.value;
431
431
  return a === "text" || a === "email" || a === "password" || a === "tel" || a === "url" || a === "search" || !a;
432
- }), j = f(() => H.value || o.value === "textarea" || b.value), F = (a, l) => {
432
+ }), H = f(() => D.value || o.value === "textarea" || b.value), F = (a, l) => {
433
433
  v("addonChange", a.name, { value: l.value });
434
- }, $ = (a) => {
434
+ }, C = (a) => {
435
435
  a.action && v("addonAction", a.action);
436
436
  };
437
- return (a, l) => j.value ? (c(), m(V, p({ key: 0 }, w.value, C(A.value)), M({ _: 2 }, [
437
+ return (a, l) => H.value ? (c(), m(V, p({ key: 0 }, w.value, $(A.value)), M({ _: 2 }, [
438
438
  P(T)(i.field.addonLeft) ? {
439
439
  name: "addon-left",
440
440
  fn: u(() => [
@@ -458,7 +458,7 @@ const Ne = /* @__PURE__ */ E({
458
458
  key: 1,
459
459
  variant: "outline"
460
460
  }, i.field.addonLeft.props || {}, {
461
- onClick: l[1] || (l[1] = (r) => $(i.field.addonLeft))
461
+ onClick: l[1] || (l[1] = (r) => C(i.field.addonLeft))
462
462
  }), {
463
463
  default: u(() => [
464
464
  x(y(i.field.addonLeft.text), 1)
@@ -491,7 +491,7 @@ const Ne = /* @__PURE__ */ E({
491
491
  key: 1,
492
492
  variant: "outline"
493
493
  }, i.field.addonRight.props || {}, {
494
- onClick: l[3] || (l[3] = (r) => $(i.field.addonRight))
494
+ onClick: l[3] || (l[3] = (r) => C(i.field.addonRight))
495
495
  }), {
496
496
  default: u(() => [
497
497
  x(y(i.field.addonRight.text), 1)
@@ -504,7 +504,7 @@ const Ne = /* @__PURE__ */ E({
504
504
  ]), 1040)) : (c(), m(q(U.value), p({
505
505
  key: 1,
506
506
  class: o.value === "check" || o.value === "switch" && i.field.props?.switchVariant === "basic" ? "" : "w-full"
507
- }, w.value, C(A.value)), null, 16, ["class"]));
507
+ }, w.value, $(A.value)), null, 16, ["class"]));
508
508
  }
509
509
  });
510
510
  export {
@@ -8,9 +8,9 @@ declare const _default: import('vue').DefineComponent<HeatmapProps, {}, {}, {},
8
8
  }>, {
9
9
  class: string;
10
10
  layout: import('./types').HeatmapLayout;
11
+ showLegend: boolean;
11
12
  minValue: number;
12
13
  maxValue: number;
13
- showLegend: boolean;
14
14
  showLabels: boolean;
15
15
  interactive: boolean;
16
16
  responsive: boolean;
@@ -13,6 +13,7 @@ import "vue-draggable-plus";
13
13
  /* empty css */
14
14
  import "v-datepicker-lite";
15
15
  import "v-datepicker-lite/style.css";
16
+ /* empty css */
16
17
  import "@jaames/iro";
17
18
  import "@vueuse/core";
18
19
  /* empty css */
@@ -29,7 +30,7 @@ import "../../core/config.js";
29
30
  const N = { class: "text-gray-800! h-4! w-4! flex items-center justify-center" }, A = { style: { "will-change": "transform", contain: "layout style" } }, E = {
30
31
  class: "pt-2 px-2 min-w-[295px]",
31
32
  style: { "will-change": "transform", contain: "layout style" }
32
- }, ue = /* @__PURE__ */ B({
33
+ }, ce = /* @__PURE__ */ B({
33
34
  __name: "ScreenFilter",
34
35
  props: {
35
36
  schema: {},
@@ -192,5 +193,5 @@ const N = { class: "text-gray-800! h-4! w-4! flex items-center justify-center" }
192
193
  }
193
194
  });
194
195
  export {
195
- ue as default
196
+ ce as default
196
197
  };
@@ -6,6 +6,7 @@ declare const _default: import('vue').DefineComponent<SidebarMenuProps, {}, {},
6
6
  items: SidebarMenuItemSchema[];
7
7
  allowMultiple: boolean;
8
8
  iconSize: string;
9
+ showTooltip: boolean;
9
10
  mobileBreakpoint: "sm" | "md" | "lg" | "xl" | "none";
10
11
  menuOffset: [number, number];
11
12
  indentSize: number;
@@ -19,7 +20,6 @@ declare const _default: import('vue').DefineComponent<SidebarMenuProps, {}, {},
19
20
  compactItemPadding: string;
20
21
  nestedMenuWidth: string;
21
22
  nestedMenuMaxHeight: string;
22
- showTooltip: boolean;
23
23
  forceTreeView: boolean;
24
24
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLElement>;
25
25
  export default _default;
@@ -10,12 +10,14 @@ type __VLS_Props = {
10
10
  iconSize?: string;
11
11
  iconBoxShape?: IconBoxShape;
12
12
  iconBoxStyle?: IconBoxStyle;
13
+ sparklineHeight?: number;
13
14
  };
14
15
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
15
16
  variant: StatsVariant;
16
17
  loading: boolean;
17
18
  layout: StatsLayout;
18
19
  attached: boolean;
20
+ sparklineHeight: number;
19
21
  iconBoxShape: IconBoxShape;
20
22
  iconBoxStyle: IconBoxStyle;
21
23
  iconSize: string;