@ac-design/design-system 2.1.1 → 2.2.1
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/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +89 -88
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +74 -73
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +151 -150
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +373 -372
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +56 -55
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +39 -38
- package/dist/lib/components/AcModal.vue.d.ts +10 -1
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +59 -39
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +90 -89
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +146 -145
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +156 -155
- package/dist/lib/components/AcTooltip.vue.d.ts +1 -1
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +73 -72
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +132 -131
- package/dist/lib/components/fixedFrame.d.ts +11 -0
- package/dist/lib/components/fixedFrame.js +24 -0
- package/package.json +1 -1
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import e from "../components/
|
|
2
|
-
import t from "../components/
|
|
3
|
-
import
|
|
1
|
+
import { fixedFrame as e } from "../components/fixedFrame.js";
|
|
2
|
+
import t from "../components/AcSkeleton.js";
|
|
3
|
+
import n from "../components/AcEmptyState.js";
|
|
4
|
+
import { Fragment as r, Teleport as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, mergeModels as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as h, openBlock as g, ref as _, renderList as v, renderSlot as y, toDisplayString as b, useModel as x, watch as S } from "vue";
|
|
4
5
|
//#region src/lib/charts/ChartFrame.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var C = ["data-testid"], w = ["aria-pressed", "onClick"], T = { class: "truncate" }, E = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "ml-auto pl-3 font-medium text-heading tabular-nums"
|
|
8
|
-
},
|
|
9
|
+
}, D = ["role", "aria-label"], O = ["aria-label"], k = {
|
|
9
10
|
key: 4,
|
|
10
11
|
class: "sr-only"
|
|
11
|
-
},
|
|
12
|
+
}, A = {
|
|
12
13
|
key: 5,
|
|
13
14
|
class: "sr-only"
|
|
14
|
-
},
|
|
15
|
+
}, j = {
|
|
15
16
|
scope: "row",
|
|
16
17
|
class: "text-left"
|
|
17
|
-
},
|
|
18
|
+
}, M = {
|
|
18
19
|
key: 0,
|
|
19
20
|
class: "mb-1.5 font-medium text-heading"
|
|
20
|
-
},
|
|
21
|
+
}, N = { class: "m-0 flex list-none flex-col gap-1 p-0" }, P = { class: "min-w-0 flex-1 truncate text-muted" }, F = { class: "pl-4 font-medium text-heading tabular-nums" }, I = {
|
|
21
22
|
key: 1,
|
|
22
23
|
class: "mt-1.5 flex justify-between gap-4 border-t border-border pt-1.5"
|
|
23
|
-
},
|
|
24
|
+
}, L = { class: "font-medium text-heading tabular-nums" }, R = 14, z = 300, B = 200, V = /*@__PURE__*/ u({
|
|
24
25
|
__name: "ChartFrame",
|
|
25
|
-
props: /*@__PURE__*/
|
|
26
|
+
props: /*@__PURE__*/ d({
|
|
26
27
|
testid: {},
|
|
27
28
|
height: {},
|
|
28
29
|
loading: { type: Boolean },
|
|
@@ -48,126 +49,126 @@ var S = ["data-testid"], C = ["aria-pressed", "onClick"], w = { class: "truncate
|
|
|
48
49
|
widthModifiers: {}
|
|
49
50
|
}),
|
|
50
51
|
emits: ["update:hidden", "update:width"],
|
|
51
|
-
setup(
|
|
52
|
-
let
|
|
53
|
-
function W(e) {
|
|
54
|
-
let t = B.value.includes(e);
|
|
55
|
-
!t && u.legendItems.length - B.value.length <= 1 || (B.value = t ? B.value.filter((t) => t !== e) : [...B.value, e]);
|
|
56
|
-
}
|
|
52
|
+
setup(u) {
|
|
53
|
+
let d = u, V = x(u, "hidden"), H = x(u, "width"), U = _(), W;
|
|
57
54
|
function G(e) {
|
|
58
|
-
let t =
|
|
55
|
+
let t = V.value.includes(e);
|
|
56
|
+
!t && d.legendItems.length - V.value.length <= 1 || (V.value = t ? V.value.filter((t) => t !== e) : [...V.value, e]);
|
|
57
|
+
}
|
|
58
|
+
function K(t) {
|
|
59
|
+
let n = e(), r = t.clientX > n.right - z, i = t.clientY > n.bottom - B;
|
|
59
60
|
return {
|
|
60
|
-
left:
|
|
61
|
-
right:
|
|
62
|
-
top:
|
|
63
|
-
bottom:
|
|
61
|
+
left: r ? void 0 : `${t.clientX - n.left + R}px`,
|
|
62
|
+
right: r ? `${n.right - t.clientX + R}px` : void 0,
|
|
63
|
+
top: i ? void 0 : `${t.clientY - n.top + R}px`,
|
|
64
|
+
bottom: i ? `${n.bottom - t.clientY + R}px` : void 0
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
e && (
|
|
69
|
-
}),
|
|
67
|
+
function q() {
|
|
68
|
+
W?.disconnect(), U.value && typeof ResizeObserver < "u" && (W = new ResizeObserver(([e]) => {
|
|
69
|
+
e && (H.value = Math.round(e.contentRect.width));
|
|
70
|
+
}), W.observe(U.value));
|
|
70
71
|
}
|
|
71
|
-
return
|
|
72
|
-
class:
|
|
72
|
+
return S(U, q), h(q), m(() => W?.disconnect()), (e, d) => (g(), s("figure", {
|
|
73
|
+
class: f(["m-0 flex w-full min-w-0 gap-3", u.legend === "right" ? "flex-wrap items-center justify-center gap-x-10" : "flex-col"]),
|
|
73
74
|
"data-ac-ds": "",
|
|
74
75
|
"data-ac-chart": "",
|
|
75
|
-
"data-testid":
|
|
76
|
+
"data-testid": u.testid
|
|
76
77
|
}, [
|
|
77
|
-
|
|
78
|
+
u.legend !== "none" && u.legendItems.length > 1 && !u.loading && !u.empty ? (g(), s("ul", {
|
|
78
79
|
key: 0,
|
|
79
|
-
class:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
class: f(["m-0 flex list-none flex-wrap gap-x-4 gap-y-1.5 p-0", [
|
|
81
|
+
u.legend === "bottom" && "order-last",
|
|
82
|
+
u.legend === "right" && "order-last max-w-[320px] min-w-[180px] flex-1 flex-col gap-y-2",
|
|
83
|
+
u.legendCentered && u.legend !== "right" && "justify-center"
|
|
83
84
|
]]),
|
|
84
85
|
"aria-label": "Legend"
|
|
85
|
-
}, [(
|
|
86
|
+
}, [(g(!0), s(r, null, v(u.legendItems, (e) => (g(), s("li", {
|
|
86
87
|
key: e.key,
|
|
87
88
|
class: "flex"
|
|
88
|
-
}, [
|
|
89
|
+
}, [c("button", {
|
|
89
90
|
type: "button",
|
|
90
|
-
class:
|
|
91
|
-
"aria-pressed": !
|
|
92
|
-
onClick: (t) =>
|
|
91
|
+
class: f(["inline-flex min-w-0 cursor-pointer items-center gap-2 rounded-6 text-xs transition-colors duration-200 hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface motion-reduce:transition-none", [V.value.includes(e.key) ? "text-muted/60 line-through" : "text-muted", u.legend === "right" && "w-full"]]),
|
|
92
|
+
"aria-pressed": !V.value.includes(e.key),
|
|
93
|
+
onClick: (t) => G(e.key)
|
|
93
94
|
}, [
|
|
94
|
-
|
|
95
|
-
class:
|
|
96
|
-
style:
|
|
95
|
+
c("span", {
|
|
96
|
+
class: f(["size-2.5 shrink-0 rounded-full transition-opacity duration-200 motion-reduce:transition-none", V.value.includes(e.key) && "opacity-30"]),
|
|
97
|
+
style: p({ backgroundColor: e.color }),
|
|
97
98
|
"aria-hidden": "true"
|
|
98
99
|
}, null, 6),
|
|
99
|
-
|
|
100
|
-
e.value ? (
|
|
101
|
-
], 10,
|
|
102
|
-
|
|
100
|
+
c("span", T, b(e.name), 1),
|
|
101
|
+
e.value ? (g(), s("span", E, b(e.value), 1)) : o("", !0)
|
|
102
|
+
], 10, w)]))), 128))], 2)) : o("", !0),
|
|
103
|
+
u.loading ? (g(), a(t, {
|
|
103
104
|
key: 1,
|
|
104
105
|
shape: "rect",
|
|
105
|
-
height: `${
|
|
106
|
+
height: `${u.height}px`,
|
|
106
107
|
label: "Loading chart"
|
|
107
|
-
}, null, 8, ["height"])) :
|
|
108
|
+
}, null, 8, ["height"])) : u.empty ? (g(), s("div", {
|
|
108
109
|
key: 2,
|
|
109
110
|
class: "flex w-full items-center justify-center overflow-hidden",
|
|
110
|
-
style:
|
|
111
|
-
}, [
|
|
111
|
+
style: p({ height: `${u.height}px` })
|
|
112
|
+
}, [l(n, {
|
|
112
113
|
size: "small",
|
|
113
|
-
icon:
|
|
114
|
-
title:
|
|
115
|
-
}, null, 8, ["icon", "title"])], 4)) : (
|
|
114
|
+
icon: u.emptyIcon,
|
|
115
|
+
title: u.emptyText
|
|
116
|
+
}, null, 8, ["icon", "title"])], 4)) : (g(), s("div", {
|
|
116
117
|
key: 3,
|
|
117
118
|
ref_key: "plot",
|
|
118
|
-
ref:
|
|
119
|
-
class:
|
|
120
|
-
style:
|
|
121
|
-
height: `${
|
|
122
|
-
width: `${
|
|
123
|
-
} : { height: `${
|
|
124
|
-
role:
|
|
125
|
-
"aria-label":
|
|
126
|
-
}, [
|
|
119
|
+
ref: U,
|
|
120
|
+
class: f(["relative min-w-0", u.legend === "right" ? "max-w-full shrink-0" : "w-full"]),
|
|
121
|
+
style: p(u.legend === "right" ? {
|
|
122
|
+
height: `${u.height}px`,
|
|
123
|
+
width: `${u.height}px`
|
|
124
|
+
} : { height: `${u.height}px` }),
|
|
125
|
+
role: e.$slots.controls ? void 0 : "img",
|
|
126
|
+
"aria-label": e.$slots.controls ? void 0 : u.summary
|
|
127
|
+
}, [e.$slots.controls ? (g(), s("div", {
|
|
127
128
|
key: 0,
|
|
128
129
|
class: "size-full",
|
|
129
130
|
role: "img",
|
|
130
|
-
"aria-label":
|
|
131
|
-
}, [
|
|
132
|
-
|
|
133
|
-
!
|
|
134
|
-
|
|
135
|
-
|
|
131
|
+
"aria-label": u.summary
|
|
132
|
+
}, [y(e.$slots, "default")], 8, O)) : y(e.$slots, "default", {}, void 0, void 0, 1), y(e.$slots, "controls")], 14, D)),
|
|
133
|
+
u.title || u.description ? (g(), s("figcaption", k, b([u.title, u.description].filter(Boolean).join(". ")), 1)) : o("", !0),
|
|
134
|
+
!u.loading && !u.empty ? (g(), s("table", A, [
|
|
135
|
+
c("caption", null, b(u.title ? `${u.title}: data` : "Chart data"), 1),
|
|
136
|
+
c("thead", null, [c("tr", null, [(g(!0), s(r, null, v(u.table.columns, (e, t) => (g(), s("th", {
|
|
136
137
|
key: t,
|
|
137
138
|
scope: "col",
|
|
138
139
|
class: "text-left"
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
])) :
|
|
142
|
-
(
|
|
140
|
+
}, b(e), 1))), 128))])]),
|
|
141
|
+
c("tbody", null, [(g(!0), s(r, null, v(u.table.rows, (e, t) => (g(), s("tr", { key: t }, [c("th", j, b(e[0]), 1), (g(!0), s(r, null, v(e.slice(1), (e, t) => (g(), s("td", { key: t }, b(e), 1))), 128))]))), 128))])
|
|
142
|
+
])) : o("", !0),
|
|
143
|
+
(g(), a(i, { to: "body" }, [u.tooltip && u.tip && !u.loading && !u.empty ? (g(), s("div", {
|
|
143
144
|
key: 0,
|
|
144
145
|
class: "pointer-events-none fixed z-[100] w-max max-w-[280px] min-w-[160px] rounded-10 border border-border bg-surface px-3 py-2.5 text-xs text-body shadow-lg",
|
|
145
|
-
style:
|
|
146
|
+
style: p(K(u.tip)),
|
|
146
147
|
"aria-hidden": "true",
|
|
147
148
|
"data-ac-ds": "",
|
|
148
149
|
"data-testid": "ac-chart-tooltip"
|
|
149
|
-
}, [
|
|
150
|
-
datum:
|
|
151
|
-
index:
|
|
152
|
-
title:
|
|
153
|
-
items:
|
|
150
|
+
}, [y(e.$slots, "tooltip", {
|
|
151
|
+
datum: u.tip.datum,
|
|
152
|
+
index: u.tip.index,
|
|
153
|
+
title: u.tip.title,
|
|
154
|
+
items: u.tip.items
|
|
154
155
|
}, () => [
|
|
155
|
-
|
|
156
|
-
|
|
156
|
+
u.tip.title ? (g(), s("p", M, b(u.tip.title), 1)) : o("", !0),
|
|
157
|
+
c("ul", N, [(g(!0), s(r, null, v(u.tip.items, (e) => (g(), s("li", {
|
|
157
158
|
key: e.key,
|
|
158
159
|
class: "flex items-center gap-2"
|
|
159
160
|
}, [
|
|
160
|
-
|
|
161
|
+
c("span", {
|
|
161
162
|
class: "size-2 shrink-0 rounded-full",
|
|
162
|
-
style:
|
|
163
|
+
style: p({ backgroundColor: e.color })
|
|
163
164
|
}, null, 4),
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
c("span", P, b(e.name), 1),
|
|
166
|
+
c("span", F, b(e.formatted), 1)
|
|
166
167
|
]))), 128))]),
|
|
167
|
-
|
|
168
|
-
])], 4)) :
|
|
169
|
-
], 10,
|
|
168
|
+
u.tip.total ? (g(), s("p", I, [d[0] ||= c("span", { class: "text-muted" }, "Total", -1), c("span", L, b(u.tip.total), 1)])) : o("", !0)
|
|
169
|
+
])], 4)) : o("", !0)]))
|
|
170
|
+
], 10, C));
|
|
170
171
|
}
|
|
171
172
|
});
|
|
172
173
|
//#endregion
|
|
173
|
-
export {
|
|
174
|
+
export { V as default };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import e from "./AcLogo.js";
|
|
2
2
|
import t from "./AcNavbarItem.js";
|
|
3
|
-
import {
|
|
3
|
+
import { fixedFrame as n } from "./fixedFrame.js";
|
|
4
|
+
import { Fragment as r, Teleport as i, Transition as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, defineComponent as f, mergeModels as p, nextTick as m, normalizeClass as h, normalizeStyle as g, onBeforeUnmount as ee, openBlock as _, ref as v, renderList as te, renderSlot as ne, resolveDynamicComponent as y, toDisplayString as b, unref as x, useId as re, useModel as ie, watch as ae, withCtx as oe } from "vue";
|
|
4
5
|
import { ChartLine as se, Check as ce, Database as le, GraduationCap as ue, Grip as de, Receipt as fe, Server as pe, ServerCog as me, Telescope as he } from "@lucide/vue";
|
|
5
6
|
//#region src/lib/components/AcAppSwitcher.vue?vue&type=script&setup=true&lang.ts
|
|
6
7
|
var ge = {
|
|
@@ -15,22 +16,22 @@ var ge = {
|
|
|
15
16
|
"aria-current",
|
|
16
17
|
"title",
|
|
17
18
|
"onClick"
|
|
18
|
-
],
|
|
19
|
+
], S = ["src"], C = {
|
|
19
20
|
key: 3,
|
|
20
21
|
class: "text-lg font-semibold"
|
|
21
|
-
},
|
|
22
|
+
}, w = { class: "w-full truncate text-xs font-medium text-heading" }, T = {
|
|
22
23
|
key: 0,
|
|
23
24
|
class: "sr-only"
|
|
24
|
-
},
|
|
25
|
+
}, E = {
|
|
25
26
|
key: 1,
|
|
26
27
|
class: "absolute top-1.5 right-1.5 inline-flex size-4 items-center justify-center rounded-full bg-primary text-white",
|
|
27
28
|
"aria-hidden": "true"
|
|
28
|
-
},
|
|
29
|
+
}, D = {
|
|
29
30
|
key: 0,
|
|
30
31
|
class: "mt-2 border-t border-border pt-2"
|
|
31
|
-
},
|
|
32
|
+
}, O = "id", k = 3, A = 6, j = /*@__PURE__*/ f({
|
|
32
33
|
__name: "AcAppSwitcher",
|
|
33
|
-
props: /*@__PURE__*/
|
|
34
|
+
props: /*@__PURE__*/ p({
|
|
34
35
|
currentApp: { default: "platform" },
|
|
35
36
|
baseUrl: { default: "https://appscode.com" },
|
|
36
37
|
activeOrganization: { default: "" },
|
|
@@ -54,11 +55,11 @@ var ge = {
|
|
|
54
55
|
},
|
|
55
56
|
openModifiers: {}
|
|
56
57
|
}),
|
|
57
|
-
emits: /*@__PURE__*/
|
|
58
|
-
setup(
|
|
59
|
-
let
|
|
58
|
+
emits: /*@__PURE__*/ p(["select"], ["update:open"]),
|
|
59
|
+
setup(f, { emit: p }) {
|
|
60
|
+
let j = f, M = ie(f, "open"), N = p, P = [
|
|
60
61
|
{
|
|
61
|
-
name:
|
|
62
|
+
name: O,
|
|
62
63
|
title: "Platform",
|
|
63
64
|
port: "8080",
|
|
64
65
|
subtitle: "Manage your platform & accounts"
|
|
@@ -111,14 +112,14 @@ var ge = {
|
|
|
111
112
|
icon: ue,
|
|
112
113
|
color: "red"
|
|
113
114
|
}
|
|
114
|
-
],
|
|
115
|
+
], F = {
|
|
115
116
|
name: "console",
|
|
116
117
|
title: "Console",
|
|
117
118
|
port: "5990",
|
|
118
119
|
subtitle: "Manage your kubernetes clusters",
|
|
119
120
|
icon: pe,
|
|
120
121
|
color: "blue"
|
|
121
|
-
},
|
|
122
|
+
}, ye = [
|
|
122
123
|
"https://appscode.ninja",
|
|
123
124
|
"https://appscode.com",
|
|
124
125
|
"http://bb.test:8080"
|
|
@@ -126,7 +127,7 @@ var ge = {
|
|
|
126
127
|
"billing",
|
|
127
128
|
"selfhost",
|
|
128
129
|
"learn"
|
|
129
|
-
],
|
|
130
|
+
], be = {
|
|
130
131
|
primary: "bg-primary/10 text-primary-strong ring-primary/25",
|
|
131
132
|
blue: "bg-info/10 text-info-strong ring-info/25",
|
|
132
133
|
green: "bg-success/10 text-success-strong ring-success/25",
|
|
@@ -134,15 +135,15 @@ var ge = {
|
|
|
134
135
|
purple: "bg-pending/10 text-pending-strong ring-pending/25",
|
|
135
136
|
red: "bg-danger/10 text-danger-strong ring-danger/25",
|
|
136
137
|
slate: "bg-surface-sunken text-muted ring-border"
|
|
137
|
-
}, L = re(), R = `${L}-panel`, z = `${L}-heading`, B =
|
|
138
|
-
let e = [...
|
|
139
|
-
return
|
|
140
|
-
}), G =
|
|
138
|
+
}, L = re(), R = `${L}-panel`, z = `${L}-heading`, B = v(null), V = v(null), H = v({}), U = v(!0), W = o(() => j.currentApp === "platform" ? O : j.currentApp), xe = o(() => !ye.includes(j.baseUrl)), Se = o(() => {
|
|
139
|
+
let e = [...P];
|
|
140
|
+
return j.activeOrgType !== k && e.splice(1, 0, F), e.filter((e) => !xe.value || !I.includes(e.name) || e.name === "billing" && j.isOfflineInstaller && j.activeOrgType === A);
|
|
141
|
+
}), G = o(() => (j.apps ?? Se.value).filter((e) => !j.hideCurrent || e.name !== W.value).map((e) => ({
|
|
141
142
|
...e,
|
|
142
|
-
url: e.url ??
|
|
143
|
+
url: e.url ?? Ce(e)
|
|
143
144
|
})));
|
|
144
|
-
function
|
|
145
|
-
return
|
|
145
|
+
function Ce(e) {
|
|
146
|
+
return j.baseUrl.includes("bb.test") ? `http://bb.test:${e.port}/${e.name}/` : j.baseUrl.includes("localhost") ? `http://localhost:${e.port}/${e.name}/` : `${j.baseUrl}/${e.name}/`;
|
|
146
147
|
}
|
|
147
148
|
function K(e) {
|
|
148
149
|
return e.name === W.value;
|
|
@@ -153,7 +154,7 @@ var ge = {
|
|
|
153
154
|
function J() {
|
|
154
155
|
return [...V.value?.querySelectorAll("[data-app-tile]") ?? []];
|
|
155
156
|
}
|
|
156
|
-
function
|
|
157
|
+
function we(e) {
|
|
157
158
|
let t = e[0]?.offsetTop, n = e.filter((e) => e.offsetTop === t).length;
|
|
158
159
|
return Math.max(n, 1);
|
|
159
160
|
}
|
|
@@ -164,43 +165,43 @@ var ge = {
|
|
|
164
165
|
function X() {
|
|
165
166
|
let e = q();
|
|
166
167
|
if (!e || !V.value) return;
|
|
167
|
-
let t = e.getBoundingClientRect(), { offsetWidth:
|
|
168
|
-
U.value = !
|
|
169
|
-
[
|
|
170
|
-
left: `${Math.max(8, Math.min(
|
|
171
|
-
maxHeight: `${Math.max(
|
|
168
|
+
let t = e.getBoundingClientRect(), r = n(), { offsetWidth: i, offsetHeight: a } = V.value, o = r.bottom - t.bottom - 6 - 8, s = t.top - r.top - 6 - 8, c = o < a && s > o, l = (j.align === "end" ? t.right - i : t.left) - r.left;
|
|
169
|
+
U.value = !c, H.value = {
|
|
170
|
+
[c ? "bottom" : "top"]: `${c ? r.bottom - t.top + 6 : t.bottom + 6 - r.top}px`,
|
|
171
|
+
left: `${Math.max(8, Math.min(l, r.width - i - 8))}px`,
|
|
172
|
+
maxHeight: `${Math.max(c ? s : o, 160)}px`
|
|
172
173
|
};
|
|
173
174
|
}
|
|
174
175
|
function Z(e = !0) {
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
function we() {
|
|
178
|
-
j.value ? Z() : j.value = !0;
|
|
176
|
+
M.value && (M.value = !1, e && q()?.focus());
|
|
179
177
|
}
|
|
180
178
|
function Te() {
|
|
181
|
-
|
|
182
|
-
A.rootDomain && e.push(`domain=${A.rootDomain}`), document.cookie = e.join("; ");
|
|
179
|
+
M.value ? Z() : M.value = !0;
|
|
183
180
|
}
|
|
184
|
-
function Ee(
|
|
185
|
-
e
|
|
181
|
+
function Ee() {
|
|
182
|
+
let e = [`gorg=${encodeURIComponent(j.activeOrganization)}`, "path=/"];
|
|
183
|
+
j.rootDomain && e.push(`domain=${j.rootDomain}`), document.cookie = e.join("; ");
|
|
186
184
|
}
|
|
187
185
|
function De(e) {
|
|
188
|
-
e.
|
|
186
|
+
e.name === "grafana" && Ee(), N("select", e);
|
|
189
187
|
}
|
|
190
188
|
function Oe(e) {
|
|
191
|
-
|
|
189
|
+
e.key !== "ArrowDown" || M.value || (e.preventDefault(), M.value = !0);
|
|
190
|
+
}
|
|
191
|
+
function ke(e) {
|
|
192
|
+
let t = J(), n = t.indexOf(document.activeElement), r = we(t), i = {
|
|
192
193
|
ArrowRight: 1,
|
|
193
194
|
ArrowLeft: -1,
|
|
194
195
|
ArrowDown: r,
|
|
195
196
|
ArrowUp: -r
|
|
196
197
|
};
|
|
197
|
-
e.key in i && n >= 0 ? (e.preventDefault(), Y(n + i[e.key])) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), Y(e.key === "Home" ? 0 : t.length - 1)) : e.key === "Escape" ? (e.preventDefault(), Z()) : e.key === "Tab" &&
|
|
198
|
+
e.key in i && n >= 0 ? (e.preventDefault(), Y(n + i[e.key])) : e.key === "Home" || e.key === "End" ? (e.preventDefault(), Y(e.key === "Home" ? 0 : t.length - 1)) : e.key === "Escape" ? (e.preventDefault(), Z()) : e.key === "Tab" && Ae(e);
|
|
198
199
|
}
|
|
199
|
-
function
|
|
200
|
+
function Ae(e) {
|
|
200
201
|
let t = [...V.value?.querySelectorAll("a[href], button:not([disabled])") ?? []], n = t[0], r = t[t.length - 1];
|
|
201
202
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), Z()) : !e.shiftKey && document.activeElement === r && Z();
|
|
202
203
|
}
|
|
203
|
-
function
|
|
204
|
+
function je(e) {
|
|
204
205
|
let t = e.target;
|
|
205
206
|
q()?.contains(t) || V.value?.contains(t) || Z(!1);
|
|
206
207
|
}
|
|
@@ -209,57 +210,57 @@ var ge = {
|
|
|
209
210
|
}
|
|
210
211
|
function $(e) {
|
|
211
212
|
let t = e ? "addEventListener" : "removeEventListener";
|
|
212
|
-
document[t]("pointerdown",
|
|
213
|
+
document[t]("pointerdown", je, !0), window[t]("scroll", Q, !0), window[t]("resize", Q);
|
|
213
214
|
}
|
|
214
|
-
return ae(
|
|
215
|
+
return ae(M, async (e) => {
|
|
215
216
|
if ($(e), !e) return;
|
|
216
|
-
await
|
|
217
|
+
await m(), X();
|
|
217
218
|
let t = J(), n = G.value.findIndex(K);
|
|
218
219
|
Y(n >= 0 && t[n] ? n : 0);
|
|
219
|
-
}), ee(() => $(!1)), (
|
|
220
|
+
}), ee(() => $(!1)), (n, o) => (_(), l("div", ge, [d(t, {
|
|
220
221
|
ref_key: "trigger",
|
|
221
222
|
ref: B,
|
|
222
|
-
label:
|
|
223
|
-
icon:
|
|
223
|
+
label: f.label,
|
|
224
|
+
icon: x(de),
|
|
224
225
|
"icon-only": "",
|
|
225
226
|
"aria-haspopup": "dialog",
|
|
226
|
-
"aria-expanded":
|
|
227
|
-
"aria-controls":
|
|
228
|
-
class:
|
|
227
|
+
"aria-expanded": M.value,
|
|
228
|
+
"aria-controls": M.value ? R : void 0,
|
|
229
|
+
class: h(M.value && "bg-surface-sunken text-heading"),
|
|
229
230
|
"data-ac-ds": "",
|
|
230
231
|
"data-testid": "ac-app-switcher-trigger",
|
|
231
|
-
onClick:
|
|
232
|
-
onKeydown:
|
|
232
|
+
onClick: Te,
|
|
233
|
+
onKeydown: Oe
|
|
233
234
|
}, null, 8, [
|
|
234
235
|
"label",
|
|
235
236
|
"icon",
|
|
236
237
|
"aria-expanded",
|
|
237
238
|
"aria-controls",
|
|
238
239
|
"class"
|
|
239
|
-
]), (
|
|
240
|
+
]), (_(), s(i, { to: "body" }, [d(a, {
|
|
240
241
|
"enter-active-class": "transition duration-150 ease-out",
|
|
241
242
|
"enter-from-class": "opacity-0 motion-safe:scale-95",
|
|
242
243
|
"leave-active-class": "transition duration-100 ease-in",
|
|
243
244
|
"leave-to-class": "opacity-0"
|
|
244
245
|
}, {
|
|
245
|
-
default: oe(() => [
|
|
246
|
+
default: oe(() => [M.value ? (_(), l("div", {
|
|
246
247
|
key: 0,
|
|
247
248
|
id: R,
|
|
248
249
|
ref_key: "panel",
|
|
249
250
|
ref: V,
|
|
250
251
|
role: "dialog",
|
|
251
252
|
"aria-labelledby": z,
|
|
252
|
-
class:
|
|
253
|
-
style:
|
|
253
|
+
class: h(["ac-scrollbar fixed z-[90] flex w-[calc(340px*var(--ac-scale))] max-w-[calc(100vw-16px)] flex-col rounded-14 border border-border bg-surface p-2 shadow-lg", U.value ? "origin-top-right" : "origin-bottom-right"]),
|
|
254
|
+
style: g(H.value),
|
|
254
255
|
"data-ac-ds": "",
|
|
255
256
|
"data-testid": "ac-app-switcher-panel",
|
|
256
|
-
onKeydown:
|
|
257
|
+
onKeydown: ke
|
|
257
258
|
}, [
|
|
258
|
-
|
|
259
|
+
u("p", {
|
|
259
260
|
id: z,
|
|
260
261
|
class: "px-3 pt-2 pb-2 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
|
|
261
|
-
},
|
|
262
|
-
|
|
262
|
+
}, b(f.label), 1),
|
|
263
|
+
u("ul", _e, [(_(!0), l(r, null, te(G.value, (t) => (_(), l("li", { key: t.name }, [u("a", {
|
|
263
264
|
href: t.url,
|
|
264
265
|
"data-app-tile": "",
|
|
265
266
|
"aria-current": K(t) ? "page" : void 0,
|
|
@@ -267,37 +268,37 @@ var ge = {
|
|
|
267
268
|
class: "group relative flex h-full flex-col items-center gap-2 rounded-8 px-1.5 pt-3 pb-2.5 text-center no-underline outline-none transition-colors duration-200 hover:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset aria-[current=page]:bg-accent",
|
|
268
269
|
"data-ac-ds": "",
|
|
269
270
|
"data-testid": "ac-app-switcher-app",
|
|
270
|
-
onClick: (e) =>
|
|
271
|
+
onClick: (e) => De(t)
|
|
271
272
|
}, [
|
|
272
|
-
|
|
273
|
-
class:
|
|
273
|
+
u("span", {
|
|
274
|
+
class: h(["relative inline-flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-10 ring-1 transition-transform duration-200 ring-inset motion-safe:group-hover:-translate-y-px", t.iconUrl || t.name === O && !t.icon ? "bg-surface ring-border" : be[t.color ?? "slate"]]),
|
|
274
275
|
"aria-hidden": "true"
|
|
275
|
-
}, [t.iconUrl ? (
|
|
276
|
+
}, [t.iconUrl ? (_(), l("img", {
|
|
276
277
|
key: 0,
|
|
277
278
|
src: t.iconUrl,
|
|
278
279
|
alt: "",
|
|
279
280
|
class: "size-7 object-contain"
|
|
280
|
-
}, null, 8,
|
|
281
|
+
}, null, 8, S)) : t.icon ? (_(), s(y(t.icon), {
|
|
281
282
|
key: 1,
|
|
282
283
|
class: "size-5"
|
|
283
|
-
})) : t.name ===
|
|
284
|
+
})) : t.name === O ? (_(), s(e, {
|
|
284
285
|
key: 2,
|
|
285
286
|
variant: "mark",
|
|
286
287
|
size: 28,
|
|
287
288
|
label: ""
|
|
288
|
-
})) : (
|
|
289
|
-
|
|
290
|
-
t.subtitle ? (
|
|
291
|
-
K(t) ? (
|
|
289
|
+
})) : (_(), l("span", C, b(t.title.charAt(0)), 1))], 2),
|
|
290
|
+
u("span", w, b(t.title), 1),
|
|
291
|
+
t.subtitle ? (_(), l("span", T, b(t.subtitle), 1)) : c("", !0),
|
|
292
|
+
K(t) ? (_(), l("span", E, [d(x(ce), {
|
|
292
293
|
class: "size-2.5",
|
|
293
294
|
"stroke-width": 3
|
|
294
|
-
})])) :
|
|
295
|
+
})])) : c("", !0)
|
|
295
296
|
], 8, ve)]))), 128))]),
|
|
296
|
-
|
|
297
|
-
], 38)) :
|
|
297
|
+
n.$slots.footer ? (_(), l("div", D, [ne(n.$slots, "footer", { close: Z })])) : c("", !0)
|
|
298
|
+
], 38)) : c("", !0)]),
|
|
298
299
|
_: 3
|
|
299
300
|
})]))]));
|
|
300
301
|
}
|
|
301
302
|
});
|
|
302
303
|
//#endregion
|
|
303
|
-
export {
|
|
304
|
+
export { j as default };
|