vlite3 1.1.10 → 1.1.11
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.
- package/components/AppShell/AppShell.vue.d.ts +39 -0
- package/components/{Navbar/NavbarLayoutClassic.vue.d.ts → AppShell/AppShellLayoutClassic.vue.d.ts} +8 -5
- package/components/{Navbar/NavbarLayoutDock.vue.d.ts → AppShell/AppShellLayoutDashboard.vue.d.ts} +9 -6
- package/components/{Navbar/NavbarLayoutSidebarFirst.vue.d.ts → AppShell/AppShellLayoutDock.vue.d.ts} +9 -5
- package/components/{Navbar/NavbarLayoutDashboard.vue.d.ts → AppShell/AppShellLayoutHeaderShell.vue.d.ts} +9 -6
- package/components/AppShell/AppShellLayoutSidebarFirst.vue.d.ts +40 -0
- package/components/AppShell/index.d.ts +2 -0
- package/components/AppShell/useAppShell.d.ts +37 -0
- package/components/Chart/BarChart.vue.js +46 -48
- package/components/Chart/PieChart.vue.js +45 -45
- package/components/Chart/SegmentBarChart.vue.d.ts +24 -0
- package/components/Chart/SegmentBarChart.vue.js +163 -0
- package/components/Chart/SegmentBarChart.vue2.js +4 -0
- package/components/Chart/StatCardChart.vue.d.ts +11 -0
- package/components/Chart/StatCardChart.vue.js +7 -0
- package/components/Chart/StatCardChart.vue2.js +91 -0
- package/components/Chart/TimelineChart.vue.d.ts +24 -0
- package/components/Chart/TimelineChart.vue.js +198 -0
- package/components/Chart/TimelineChart.vue2.js +4 -0
- package/components/Chart/WaffleChart.vue.d.ts +28 -0
- package/components/Chart/WaffleChart.vue.js +134 -0
- package/components/Chart/WaffleChart.vue2.js +4 -0
- package/components/Chart/index.d.ts +5 -1
- package/components/Chart/types.d.ts +100 -0
- package/components/Navbar/Navbar.vue.d.ts +43 -17
- package/components/Navbar/Navbar.vue.js +177 -54
- package/components/Navbar/useNavbar.d.ts +4 -23
- package/components/Navbar/useNavbar.js +42 -97
- package/components/SidebarMenu/SidebarMenu.vue.js +1 -1
- package/components/SidebarMenu/SidebarMenuItem.vue.js +138 -122
- package/index.js +124 -116
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/appshell.type.d.ts +35 -0
- package/types/navbar.type.d.ts +0 -19
- package/components/Navbar/NavbarLayoutClassic.vue.js +0 -268
- package/components/Navbar/NavbarLayoutClassic.vue2.js +0 -4
- package/components/Navbar/NavbarLayoutDashboard.vue.js +0 -157
- package/components/Navbar/NavbarLayoutDashboard.vue2.js +0 -4
- package/components/Navbar/NavbarLayoutDock.vue.js +0 -156
- package/components/Navbar/NavbarLayoutDock.vue2.js +0 -4
- package/components/Navbar/NavbarLayoutSidebarFirst.vue.js +0 -151
- package/components/Navbar/NavbarLayoutSidebarFirst.vue2.js +0 -4
- package/components/Navbar/NavbarStandalone.vue.d.ts +0 -48
- package/components/Navbar/NavbarStandalone.vue.js +0 -183
- package/components/Navbar/NavbarStandalone.vue2.js +0 -4
- package/composables/useBreadcrumb.js +0 -27
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { AppShellProps } from '../../types/appshell.type';
|
|
2
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<AppShellProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
3
|
+
"toggle-mobile": () => any;
|
|
4
|
+
}, string, import('vue').PublicProps, Readonly<AppShellProps> & Readonly<{
|
|
5
|
+
"onToggle-mobile"?: () => any;
|
|
6
|
+
}>, {
|
|
7
|
+
class: string;
|
|
8
|
+
height: string;
|
|
9
|
+
border: boolean;
|
|
10
|
+
variant: import('../../types/appshell.type').AppShellVariant;
|
|
11
|
+
floating: boolean;
|
|
12
|
+
compact: boolean;
|
|
13
|
+
position: import('../../types/appshell.type').AppShellPosition;
|
|
14
|
+
contentClass: string;
|
|
15
|
+
centerPosition: import('../../types/appshell.type').AppShellCenterPosition;
|
|
16
|
+
glass: boolean;
|
|
17
|
+
mobileBreakpoint: "sm" | "md" | "lg" | "xl";
|
|
18
|
+
menuClass: string;
|
|
19
|
+
rightClass: string;
|
|
20
|
+
mobileTriggerClass: string;
|
|
21
|
+
mobileMenuVariant: "sidepanel" | "dropdown";
|
|
22
|
+
breadcrumb: boolean;
|
|
23
|
+
renderNestedTabs: boolean;
|
|
24
|
+
logoClass: string;
|
|
25
|
+
sidebarToggle: boolean;
|
|
26
|
+
breadcrumbVariant: import('../Breadcrumb').BreadcrumbVariant;
|
|
27
|
+
breadcrumbSeparator: import('../Breadcrumb').BreadcrumbSeparator;
|
|
28
|
+
breadcrumbSize: import('../Breadcrumb').BreadcrumbSize;
|
|
29
|
+
breadcrumbHomeIcon: string;
|
|
30
|
+
breadcrumbPosition: "header" | "main";
|
|
31
|
+
breadcrumbClass: string;
|
|
32
|
+
layoutMode: import('../../types/appshell.type').AppShellLayoutMode;
|
|
33
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, Partial<Record<number, (_: any) => any>>>;
|
|
34
|
+
export default _default;
|
|
35
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
36
|
+
new (): {
|
|
37
|
+
$slots: S;
|
|
38
|
+
};
|
|
39
|
+
};
|
package/components/{Navbar/NavbarLayoutClassic.vue.d.ts → AppShell/AppShellLayoutClassic.vue.d.ts}
RENAMED
|
@@ -28,14 +28,17 @@ declare function __VLS_template(): {
|
|
|
28
28
|
center?(_: {}): any;
|
|
29
29
|
center?(_: {}): any;
|
|
30
30
|
right?(_: {}): any;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
sidebar?(_: {}): any;
|
|
32
|
+
sidebar?(_: {}): any;
|
|
33
|
+
'sidebar-footer'?(_: {}): any;
|
|
34
|
+
'sidebar-footer'?(_: {}): any;
|
|
35
35
|
main?(_: {}): any;
|
|
36
36
|
'mobile-menu'?(_: {}): any;
|
|
37
37
|
'mobile-menu'?(_: {}): any;
|
|
38
|
-
|
|
38
|
+
'mobile-sidebar-header'?(_: {}): any;
|
|
39
|
+
'sidebar-header'?(_: {}): any;
|
|
40
|
+
'mobile-sidebar'?(_: {}): any;
|
|
41
|
+
'mobile-sidebar-footer'?(_: {}): any;
|
|
39
42
|
};
|
|
40
43
|
refs: {
|
|
41
44
|
mobileTriggerRef: HTMLButtonElement;
|
package/components/{Navbar/NavbarLayoutDock.vue.d.ts → AppShell/AppShellLayoutDashboard.vue.d.ts}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
declare function __VLS_template(): {
|
|
2
2
|
attrs: Partial<{}>;
|
|
3
3
|
slots: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
'sidebar-header'?(_: {}): any;
|
|
5
|
+
'sidebar-header'?(_: {}): any;
|
|
6
|
+
sidebar?(_: {}): any;
|
|
7
|
+
sidebar?(_: {}): any;
|
|
8
|
+
'sidebar-footer'?(_: {}): any;
|
|
9
|
+
'sidebar-footer'?(_: {}): any;
|
|
10
10
|
header?(_: {
|
|
11
11
|
isOpen: boolean;
|
|
12
12
|
toggle: () => boolean;
|
|
@@ -16,6 +16,9 @@ declare function __VLS_template(): {
|
|
|
16
16
|
pageTitle: string;
|
|
17
17
|
}): any;
|
|
18
18
|
main?(_: {}): any;
|
|
19
|
+
'mobile-sidebar-header'?(_: {}): any;
|
|
20
|
+
'mobile-sidebar'?(_: {}): any;
|
|
21
|
+
'mobile-sidebar-footer'?(_: {}): any;
|
|
19
22
|
};
|
|
20
23
|
refs: {
|
|
21
24
|
layoutMainRef: HTMLElement;
|
package/components/{Navbar/NavbarLayoutSidebarFirst.vue.d.ts → AppShell/AppShellLayoutDock.vue.d.ts}
RENAMED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
declare function __VLS_template(): {
|
|
2
2
|
attrs: Partial<{}>;
|
|
3
3
|
slots: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
'sidebar-header'?(_: {}): any;
|
|
5
|
+
'sidebar-header'?(_: {}): any;
|
|
6
|
+
sidebar?(_: {}): any;
|
|
7
|
+
sidebar?(_: {}): any;
|
|
8
|
+
'sidebar-footer'?(_: {}): any;
|
|
9
|
+
'sidebar-footer'?(_: {}): any;
|
|
8
10
|
header?(_: {
|
|
9
11
|
isOpen: boolean;
|
|
10
12
|
toggle: () => boolean;
|
|
@@ -14,7 +16,9 @@ declare function __VLS_template(): {
|
|
|
14
16
|
pageTitle: string;
|
|
15
17
|
}): any;
|
|
16
18
|
main?(_: {}): any;
|
|
17
|
-
|
|
19
|
+
'mobile-sidebar-header'?(_: {}): any;
|
|
20
|
+
'mobile-sidebar'?(_: {}): any;
|
|
21
|
+
'mobile-sidebar-footer'?(_: {}): any;
|
|
18
22
|
};
|
|
19
23
|
refs: {
|
|
20
24
|
layoutMainRef: HTMLElement;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
declare function __VLS_template(): {
|
|
2
2
|
attrs: Partial<{}>;
|
|
3
3
|
slots: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
'sidebar-header'?(_: {}): any;
|
|
5
|
+
'sidebar-header'?(_: {}): any;
|
|
6
|
+
sidebar?(_: {}): any;
|
|
7
|
+
sidebar?(_: {}): any;
|
|
8
|
+
'sidebar-footer'?(_: {}): any;
|
|
9
|
+
'sidebar-footer'?(_: {}): any;
|
|
10
10
|
header?(_: {
|
|
11
11
|
isOpen: boolean;
|
|
12
12
|
toggle: () => boolean;
|
|
@@ -16,6 +16,9 @@ declare function __VLS_template(): {
|
|
|
16
16
|
pageTitle: string;
|
|
17
17
|
}): any;
|
|
18
18
|
main?(_: {}): any;
|
|
19
|
+
'mobile-sidebar-header'?(_: {}): any;
|
|
20
|
+
'mobile-sidebar'?(_: {}): any;
|
|
21
|
+
'mobile-sidebar-footer'?(_: {}): any;
|
|
19
22
|
};
|
|
20
23
|
refs: {
|
|
21
24
|
layoutMainRef: HTMLElement;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
attrs: Partial<{}>;
|
|
3
|
+
slots: {
|
|
4
|
+
'sidebar-header'?(_: {}): any;
|
|
5
|
+
'sidebar-header'?(_: {}): any;
|
|
6
|
+
sidebar?(_: {}): any;
|
|
7
|
+
sidebar?(_: {}): any;
|
|
8
|
+
'sidebar-footer'?(_: {}): any;
|
|
9
|
+
'sidebar-footer'?(_: {}): any;
|
|
10
|
+
header?(_: {
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
toggle: () => boolean;
|
|
13
|
+
sidebarVisible: boolean;
|
|
14
|
+
toggleSidebar: () => void;
|
|
15
|
+
breadcrumbItems: any[];
|
|
16
|
+
pageTitle: string;
|
|
17
|
+
}): any;
|
|
18
|
+
main?(_: {}): any;
|
|
19
|
+
'mobile-sidebar-header'?(_: {}): any;
|
|
20
|
+
'mobile-sidebar'?(_: {}): any;
|
|
21
|
+
'mobile-sidebar-footer'?(_: {}): any;
|
|
22
|
+
};
|
|
23
|
+
refs: {
|
|
24
|
+
layoutMainRef: HTMLElement;
|
|
25
|
+
mainScrollRef: HTMLDivElement;
|
|
26
|
+
};
|
|
27
|
+
rootEl: HTMLDivElement;
|
|
28
|
+
};
|
|
29
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
30
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
31
|
+
layoutMainRef: HTMLElement;
|
|
32
|
+
mainScrollRef: HTMLDivElement;
|
|
33
|
+
}, HTMLDivElement>;
|
|
34
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
35
|
+
export default _default;
|
|
36
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
37
|
+
new (): {
|
|
38
|
+
$slots: S;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Ref, ComputedRef, ShallowRef, InjectionKey } from 'vue';
|
|
2
|
+
import { NavbarTabItem } from '../../types/navbar.type';
|
|
3
|
+
import { AppShellProps } from '../../types/appshell.type';
|
|
4
|
+
export interface AppShellLayoutContext {
|
|
5
|
+
/** Original reactive props object */
|
|
6
|
+
props: AppShellProps;
|
|
7
|
+
/** Whether layout mode is active (header/main slots provided) */
|
|
8
|
+
isLayoutMode: boolean;
|
|
9
|
+
isMobileMenuOpen: Ref<boolean>;
|
|
10
|
+
isSidebarVisible: Ref<boolean>;
|
|
11
|
+
sidebarHidden: ComputedRef<boolean>;
|
|
12
|
+
pageTitle: ComputedRef<string>;
|
|
13
|
+
isScrolled: Ref<boolean>;
|
|
14
|
+
mainScrollRef: Ref<HTMLElement | null>;
|
|
15
|
+
layoutMainRef: Ref<HTMLElement | null>;
|
|
16
|
+
toggleSidebar: () => void;
|
|
17
|
+
handleNestedTabClick: (val: string | number) => void;
|
|
18
|
+
breakpointClasses: ComputedRef<{
|
|
19
|
+
mobileTrigger: string;
|
|
20
|
+
desktopContent: string;
|
|
21
|
+
sidebarLayout: string;
|
|
22
|
+
mobileHeader: string;
|
|
23
|
+
desktopSidebar: string;
|
|
24
|
+
desktopOnly: string;
|
|
25
|
+
}>;
|
|
26
|
+
/** Container classes — used by classic / standalone layouts */
|
|
27
|
+
containerClasses: ComputedRef<string>;
|
|
28
|
+
/** Center slot alignment classes */
|
|
29
|
+
centerClasses: ComputedRef<string | undefined>;
|
|
30
|
+
breadcrumbData: {
|
|
31
|
+
items: ComputedRef<any[]>;
|
|
32
|
+
};
|
|
33
|
+
nestedTabsItems: ShallowRef<NavbarTabItem[]>;
|
|
34
|
+
activeNestedTab: Ref<string | number>;
|
|
35
|
+
}
|
|
36
|
+
export declare const APPSHELL_LAYOUT_KEY: InjectionKey<AppShellLayoutContext>;
|
|
37
|
+
export declare function useAppShell(props: AppShellProps, isLayoutMode: boolean): AppShellLayoutContext;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as se, ref as
|
|
1
|
+
import { defineComponent as se, ref as A, computed as f, onMounted as ie, watch as ce, onUnmounted as ve, openBlock as n, createElementBlock as u, Fragment as d, renderList as h, createElementVNode as w, normalizeStyle as U, createTextVNode as de, toDisplayString as p, createCommentVNode as m, unref as k, withDirectives as he, vShow as fe, createBlock as me, Teleport as ye } from "vue";
|
|
2
2
|
import { CHART_COLORS as xe, getColor as J, formatNumber as R, niceYTicks as ge, animateProgress as $e } from "./utils.js";
|
|
3
3
|
const be = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "flex flex-wrap gap-x-4 gap-y-1 mb-3 pl-14"
|
|
6
|
-
}, pe = ["width", "height"], ke = ["id"], we = ["stop-color"], Le = ["stop-color"], Me = ["id"], Ve = ["stop-color"], Ce = ["stop-color"], Be = ["transform"], Ye = ["y1", "x2", "y2", "stroke-opacity"], Re = ["y"], Xe = ["d", "fill"
|
|
6
|
+
}, pe = ["width", "height"], ke = ["id"], we = ["stop-color"], Le = ["stop-color"], Me = ["id"], Ve = ["stop-color"], Ce = ["stop-color"], Be = ["transform"], Ye = ["y1", "x2", "y2", "stroke-opacity"], Re = ["y"], Xe = ["d", "fill"], Oe = ["x", "y"], ze = ["x", "y", "text-anchor", "transform"], Se = ["y1", "x2", "y2", "stroke-opacity"], Ae = ["y2", "stroke-opacity"], Ge = ["transform"], Te = ["x1", "x2", "y2", "stroke-opacity"], We = ["x"], Pe = ["y"], He = ["d", "fill"], Ne = ["x", "y"], Qe = ["y2", "stroke-opacity"], Ze = ["y1", "x2", "y2", "stroke-opacity"], De = { class: "font-medium text-xs mb-1.5" }, Ee = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "text-muted-foreground"
|
|
9
9
|
}, Fe = { class: "font-semibold" }, _e = /* @__PURE__ */ se({
|
|
@@ -30,7 +30,7 @@ const be = {
|
|
|
30
30
|
axisOpacity: { default: 0.1 }
|
|
31
31
|
},
|
|
32
32
|
setup(i) {
|
|
33
|
-
const s = i,
|
|
33
|
+
const s = i, G = A(), O = A(600), g = f(() => s.datasets?.length ? s.datasets.map((l, e) => ({
|
|
34
34
|
label: l.label,
|
|
35
35
|
color: l.color ?? J(s.colors, e),
|
|
36
36
|
values: l.data
|
|
@@ -41,9 +41,9 @@ const be = {
|
|
|
41
41
|
// will use per-bar color from data
|
|
42
42
|
values: (s.data ?? []).map((l) => l.value)
|
|
43
43
|
}
|
|
44
|
-
]), $ = f(() => g.value.length > 1 || !!s.datasets?.length), v = f(() => s.labels?.length ? s.labels : s.datasets?.length ? g.value[0]?.values.map((t, l) => String(l + 1)) ?? [] : (s.data ?? []).map((t) => t.label)),
|
|
44
|
+
]), $ = f(() => g.value.length > 1 || !!s.datasets?.length), v = f(() => s.labels?.length ? s.labels : s.datasets?.length ? g.value[0]?.values.map((t, l) => String(l + 1)) ?? [] : (s.data ?? []).map((t) => t.label)), z = f(() => {
|
|
45
45
|
if (s.orientation !== "vertical" || !s.showXLabels || v.value.length === 0) return !1;
|
|
46
|
-
const t = Math.max(2, Math.floor(
|
|
46
|
+
const t = Math.max(2, Math.floor(O.value / 65));
|
|
47
47
|
return v.value.length > t;
|
|
48
48
|
}), b = f(() => {
|
|
49
49
|
const t = (o) => String(o).length;
|
|
@@ -64,48 +64,48 @@ const be = {
|
|
|
64
64
|
}
|
|
65
65
|
const l = s.showYLabels ? Math.max(2, ...B.value.map((o) => t(s.formatValue ? s.formatValue(o) : R(o)))) * 6.5 : 0, e = s.showYLabels ? Math.max(24, l + 12) : 8;
|
|
66
66
|
let a = s.showXLabels ? 24 : 6;
|
|
67
|
-
return s.showXLabels &&
|
|
67
|
+
return s.showXLabels && z.value && (a = Math.max(2, ...v.value.map((r) => String(r).length)) * 6.5 * 0.7 + 16), {
|
|
68
68
|
top: 24,
|
|
69
69
|
right: 0,
|
|
70
70
|
bottom: a,
|
|
71
71
|
left: e
|
|
72
72
|
};
|
|
73
|
-
}), x = f(() => Math.max(0,
|
|
73
|
+
}), x = f(() => Math.max(0, O.value - b.value.left - b.value.right)), c = f(() => Math.max(0, s.height - b.value.top - b.value.bottom)), Q = f(() => {
|
|
74
74
|
if (s.orientation !== "vertical") return 1;
|
|
75
|
-
const t =
|
|
75
|
+
const t = z.value ? 25 : 65, l = Math.max(2, Math.floor(x.value / t));
|
|
76
76
|
return Math.ceil(v.value.length / l);
|
|
77
77
|
}), K = (t) => {
|
|
78
78
|
if (s.orientation !== "vertical") return !0;
|
|
79
79
|
const l = v.value.length;
|
|
80
|
-
return
|
|
81
|
-
},
|
|
80
|
+
return Q.value <= 1 || t === 0 || t === l - 1 ? !0 : l - 1 - t < Q.value * 0.7 ? !1 : t % Q.value === 0;
|
|
81
|
+
}, T = f(
|
|
82
82
|
() => (s.data ?? []).map((t, l) => t.color ?? J(s.colors, l))
|
|
83
|
-
), ee = f(() => g.value.flatMap((t) => t.values)),
|
|
84
|
-
let
|
|
85
|
-
function
|
|
86
|
-
|
|
83
|
+
), ee = f(() => g.value.flatMap((t) => t.values)), _ = f(() => Math.max(...ee.value) || 1), B = f(() => ge(0, _.value, 5)), L = f(() => B.value[B.value.length - 1] || _.value), W = A(s.animate ? 0 : 1);
|
|
84
|
+
let Z = null;
|
|
85
|
+
function j() {
|
|
86
|
+
Z?.(), W.value = 0, Z = $e(800, (t) => W.value = t);
|
|
87
87
|
}
|
|
88
88
|
ie(() => {
|
|
89
|
-
te(), s.animate &&
|
|
89
|
+
te(), s.animate && j();
|
|
90
90
|
}), ce(() => [s.data, s.datasets], () => {
|
|
91
|
-
s.animate &&
|
|
91
|
+
s.animate && j();
|
|
92
92
|
}, { deep: !0 }), ve(() => {
|
|
93
|
-
|
|
93
|
+
Z?.(), D?.disconnect();
|
|
94
94
|
});
|
|
95
|
-
let
|
|
95
|
+
let D = null;
|
|
96
96
|
function te() {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}),
|
|
97
|
+
G.value && (D = new ResizeObserver((t) => {
|
|
98
|
+
O.value = t[0].contentRect.width || 600;
|
|
99
|
+
}), D.observe(G.value), O.value = G.value.clientWidth || 600);
|
|
100
100
|
}
|
|
101
101
|
const le = f(() => {
|
|
102
102
|
const t = v.value.length;
|
|
103
103
|
if (t === 0) return [];
|
|
104
104
|
const l = x.value / t, e = g.value.length, a = l * 0.2, o = l - a * 2, r = $.value ? o / e : o;
|
|
105
105
|
return v.value.map((M, y) => {
|
|
106
|
-
const V = y * l + a, C = g.value.map((
|
|
107
|
-
const
|
|
108
|
-
return { val:
|
|
106
|
+
const V = y * l + a, C = g.value.map((P, H) => {
|
|
107
|
+
const N = P.values[y] ?? 0, S = N / L.value * c.value * W.value, E = V + H * r, F = c.value - S, I = $.value ? P.color : T.value[y];
|
|
108
|
+
return { val: N, bh: S, x: E, y: F, w: r - ($.value ? 2 : 0), color: I };
|
|
109
109
|
});
|
|
110
110
|
return { label: M, bars: C };
|
|
111
111
|
});
|
|
@@ -114,21 +114,21 @@ const be = {
|
|
|
114
114
|
if (t === 0) return [];
|
|
115
115
|
const l = c.value / t, e = g.value.length, a = l * 0.2, o = l - a * 2, r = $.value ? o / e : o, M = L.value;
|
|
116
116
|
return v.value.map((y, V) => {
|
|
117
|
-
const C = V * l + a,
|
|
118
|
-
const
|
|
119
|
-
return { val:
|
|
117
|
+
const C = V * l + a, P = g.value.map((H, N) => {
|
|
118
|
+
const S = H.values[V] ?? 0, E = S / M * x.value * W.value, F = C + N * r, I = $.value ? H.color : T.value[V];
|
|
119
|
+
return { val: S, bw: E, x: 0, y: F, h: r - ($.value ? 2 : 0), color: I };
|
|
120
120
|
});
|
|
121
|
-
return { label: y, bars:
|
|
121
|
+
return { label: y, bars: P };
|
|
122
122
|
});
|
|
123
|
-
}), Y =
|
|
123
|
+
}), Y = A(null), q = A(null);
|
|
124
124
|
function oe(t) {
|
|
125
125
|
if (!s.showTooltip) return;
|
|
126
126
|
const l = t.currentTarget.getBoundingClientRect(), e = t.clientX - l.left - b.value.left, a = t.clientY - l.top - b.value.top, o = v.value.length;
|
|
127
127
|
if (o === 0) return;
|
|
128
128
|
let r;
|
|
129
|
-
s.orientation === "vertical" ? r = Math.floor(e / x.value * o) : r = Math.floor(a / c.value * o), r = Math.max(0, Math.min(o - 1, r)),
|
|
129
|
+
s.orientation === "vertical" ? r = Math.floor(e / x.value * o) : r = Math.floor(a / c.value * o), r = Math.max(0, Math.min(o - 1, r)), q.value = r;
|
|
130
130
|
const M = g.value.map((y, V) => ({
|
|
131
|
-
color: $.value ? y.color :
|
|
131
|
+
color: $.value ? y.color : T.value[r],
|
|
132
132
|
label: y.label,
|
|
133
133
|
value: s.formatValue ? s.formatValue(y.values[r]) : R(y.values[r])
|
|
134
134
|
}));
|
|
@@ -140,7 +140,7 @@ const be = {
|
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
142
|
function ne() {
|
|
143
|
-
Y.value = null,
|
|
143
|
+
Y.value = null, q.value = null;
|
|
144
144
|
}
|
|
145
145
|
function ue(t, l, e, a, o) {
|
|
146
146
|
const r = Math.min(o, e / 2, a / 2);
|
|
@@ -150,10 +150,10 @@ const be = {
|
|
|
150
150
|
const r = Math.min(o, e / 2, a / 2);
|
|
151
151
|
return r <= 0 || e <= 0 ? `M${t},${l} L${t + e},${l} L${t + e},${l + a} L${t},${l + a} Z` : `M${t},${l} L${t + e - r},${l} Q${t + e},${l} ${t + e},${l + r} L${t + e},${l + a - r} Q${t + e},${l + a} ${t + e - r},${l + a} L${t},${l + a} Z`;
|
|
152
152
|
}
|
|
153
|
-
const
|
|
153
|
+
const X = Math.random().toString(36).slice(2, 7);
|
|
154
154
|
return (t, l) => (n(), u("div", {
|
|
155
155
|
ref_key: "containerRef",
|
|
156
|
-
ref:
|
|
156
|
+
ref: G,
|
|
157
157
|
class: "vlite-bar-chart w-full select-none"
|
|
158
158
|
}, [
|
|
159
159
|
i.showLegend && $.value ? (n(), u("div", be, [
|
|
@@ -163,13 +163,13 @@ const be = {
|
|
|
163
163
|
}, [
|
|
164
164
|
w("span", {
|
|
165
165
|
class: "w-2.5 h-2.5 rounded-sm inline-block",
|
|
166
|
-
style:
|
|
166
|
+
style: U({ backgroundColor: e.color })
|
|
167
167
|
}, null, 4),
|
|
168
168
|
de(" " + p(e.label), 1)
|
|
169
169
|
]))), 128))
|
|
170
170
|
])) : m("", !0),
|
|
171
171
|
(n(), u("svg", {
|
|
172
|
-
width:
|
|
172
|
+
width: O.value,
|
|
173
173
|
height: i.height,
|
|
174
174
|
role: "img",
|
|
175
175
|
"aria-label": "Bar chart",
|
|
@@ -180,7 +180,7 @@ const be = {
|
|
|
180
180
|
w("defs", null, [
|
|
181
181
|
(n(!0), u(d, null, h(g.value, (e, a) => (n(), u("linearGradient", {
|
|
182
182
|
key: a,
|
|
183
|
-
id: `bgrad-${k(
|
|
183
|
+
id: `bgrad-${k(X)}-${a}`,
|
|
184
184
|
x1: "0",
|
|
185
185
|
y1: "0",
|
|
186
186
|
x2: "0",
|
|
@@ -197,9 +197,9 @@ const be = {
|
|
|
197
197
|
"stop-opacity": "0.7"
|
|
198
198
|
}, null, 8, Le)
|
|
199
199
|
], 8, ke))), 128)),
|
|
200
|
-
(n(!0), u(d, null, h(
|
|
200
|
+
(n(!0), u(d, null, h(T.value, (e, a) => (n(), u("linearGradient", {
|
|
201
201
|
key: `sc-${a}`,
|
|
202
|
-
id: `bgrad-single-${k(
|
|
202
|
+
id: `bgrad-single-${k(X)}-${a}`,
|
|
203
203
|
x1: "0",
|
|
204
204
|
y1: "0",
|
|
205
205
|
x2: "0",
|
|
@@ -244,8 +244,7 @@ const be = {
|
|
|
244
244
|
(n(!0), u(d, null, h(e.bars, (o, r) => (n(), u("path", {
|
|
245
245
|
key: r,
|
|
246
246
|
d: ue(o.x, o.y, o.w, o.bh, i.barRadius),
|
|
247
|
-
fill: $.value ? `url(#bgrad-${k(
|
|
248
|
-
opacity: X.value !== null && X.value !== a ? 0.5 : 1,
|
|
247
|
+
fill: $.value ? `url(#bgrad-${k(X)}-${r})` : `url(#bgrad-single-${k(X)}-${a})`,
|
|
249
248
|
class: "transition-opacity duration-150"
|
|
250
249
|
}, null, 8, Xe))), 128)),
|
|
251
250
|
i.showValues ? (n(!0), u(d, { key: 0 }, h(e.bars, (o, r) => (n(), u("text", {
|
|
@@ -261,9 +260,9 @@ const be = {
|
|
|
261
260
|
i.showXLabels ? (n(!0), u(d, { key: 2 }, h(v.value, (e, a) => he((n(), u("text", {
|
|
262
261
|
key: `xl-${a}`,
|
|
263
262
|
x: (a + 0.5) * (x.value / v.value.length),
|
|
264
|
-
y: c.value + (
|
|
265
|
-
"text-anchor":
|
|
266
|
-
transform:
|
|
263
|
+
y: c.value + (z.value ? 12 : 16),
|
|
264
|
+
"text-anchor": z.value ? "end" : "middle",
|
|
265
|
+
transform: z.value ? `rotate(-45, ${(a + 0.5) * (x.value / v.value.length)}, ${c.value + 12})` : void 0,
|
|
267
266
|
"font-size": "11",
|
|
268
267
|
class: "fill-muted-foreground"
|
|
269
268
|
}, p(e), 9, ze)), [
|
|
@@ -322,8 +321,7 @@ const be = {
|
|
|
322
321
|
(n(!0), u(d, null, h(e.bars, (o, r) => (n(), u("path", {
|
|
323
322
|
key: r,
|
|
324
323
|
d: re(o.x, o.y, o.bw, o.h, i.barRadius),
|
|
325
|
-
fill: $.value ? `url(#bgrad-${k(
|
|
326
|
-
opacity: X.value !== null && X.value !== a ? 0.5 : 1,
|
|
324
|
+
fill: $.value ? `url(#bgrad-${k(X)}-${r})` : `url(#bgrad-single-${k(X)}-${a})`,
|
|
327
325
|
class: "transition-opacity duration-150"
|
|
328
326
|
}, null, 8, He))), 128)),
|
|
329
327
|
i.showValues ? (n(!0), u(d, { key: 0 }, h(e.bars, (o, r) => (n(), u("text", {
|
|
@@ -360,7 +358,7 @@ const be = {
|
|
|
360
358
|
Y.value ? (n(), u("div", {
|
|
361
359
|
key: 0,
|
|
362
360
|
class: "vlite-chart-tooltip",
|
|
363
|
-
style:
|
|
361
|
+
style: U({ left: `${Y.value.x + 12}px`, top: `${Y.value.y - 10}px` })
|
|
364
362
|
}, [
|
|
365
363
|
w("div", De, p(Y.value.label), 1),
|
|
366
364
|
(n(!0), u(d, null, h(Y.value.items, (e) => (n(), u("div", {
|
|
@@ -369,7 +367,7 @@ const be = {
|
|
|
369
367
|
}, [
|
|
370
368
|
w("span", {
|
|
371
369
|
class: "w-2 h-2 rounded-sm shrink-0",
|
|
372
|
-
style:
|
|
370
|
+
style: U({ backgroundColor: e.color })
|
|
373
371
|
}, null, 4),
|
|
374
372
|
e.label ? (n(), u("span", Ee, p(e.label) + ":", 1)) : m("", !0),
|
|
375
373
|
w("span", Fe, p(e.value), 1)
|