@ac-design/design-system 2.2.0 → 2.3.0
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/compat.css +210 -0
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +74 -73
- package/dist/lib/components/AcButton.vue.d.ts +18 -12
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +62 -32
- package/dist/lib/components/AcCard.vue.d.ts +11 -5
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +99 -51
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +151 -150
- package/dist/lib/components/AcColorInput.vue.d.ts +1 -1
- package/dist/lib/components/AcDatePicker.vue.d.ts +27 -3
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +518 -454
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +56 -55
- package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +39 -38
- package/dist/lib/components/AcHeader.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +28 -7
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +149 -80
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +1 -1
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +6 -0
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +74 -58
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/lib/components/AcNavbar.vue.d.ts +2 -0
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +31 -25
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +90 -89
- package/dist/lib/components/AcNumberInput.vue.d.ts +1 -1
- package/dist/lib/components/AcRadioCard.js +5 -0
- package/dist/lib/components/AcRadioCard.vue.d.ts +55 -0
- package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +135 -0
- package/dist/lib/components/AcSelect.vue.d.ts +12 -1
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +237 -220
- 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/AcSidebar.vue.d.ts +9 -0
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +113 -94
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +19 -18
- package/dist/lib/components/AcSlider.vue.d.ts +1 -1
- package/dist/lib/components/AcTable.vue.d.ts +13 -1
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +106 -86
- package/dist/lib/components/AcTagInput.vue.d.ts +1 -1
- package/dist/lib/components/AcTextarea.vue.d.ts +30 -4
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +92 -61
- package/dist/lib/components/AcThemeMode.vue.d.ts +10 -2
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +53 -42
- package/dist/lib/components/AcTimePicker.vue.d.ts +21 -3
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +234 -201
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +73 -72
- package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +125 -107
- package/dist/lib/components/fixedFrame.d.ts +11 -0
- package/dist/lib/components/fixedFrame.js +24 -0
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/types.d.ts +2 -0
- package/dist/lib/index.js +34 -33
- package/package.json +1 -1
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
import { createCommentVNode as e, createElementBlock as t,
|
|
2
|
-
import { Menu as
|
|
1
|
+
import { createCommentVNode as e, createElementBlock as t, createVNode as n, defineComponent as r, normalizeClass as i, openBlock as a, renderSlot as o, toDisplayString as s, unref as c } from "vue";
|
|
2
|
+
import { Menu as l } from "@lucide/vue";
|
|
3
3
|
//#region src/lib/components/AcNavbar.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var u = ["aria-label"], d = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "flex shrink-0 items-center gap-2"
|
|
7
|
-
},
|
|
7
|
+
}, f = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "inline-flex items-center rounded-6 border border-primary/25 bg-primary/10 px-1.5 py-0.5 text-sm font-semibold tracking-wide text-primary-strong uppercase"
|
|
10
|
-
},
|
|
10
|
+
}, p = ["aria-label"], m = {
|
|
11
11
|
key: 3,
|
|
12
12
|
class: "hidden min-w-0 shrink sm:block sm:w-48 md:w-60 lg:w-80 xl:w-96"
|
|
13
|
-
},
|
|
13
|
+
}, h = {
|
|
14
|
+
key: 4,
|
|
15
|
+
class: "flex min-w-0 flex-1 items-center"
|
|
16
|
+
}, g = {
|
|
17
|
+
key: 5,
|
|
18
|
+
class: "flex min-w-0 flex-1 justify-center"
|
|
19
|
+
}, _ = {
|
|
14
20
|
key: 0,
|
|
15
21
|
class: "hidden w-full max-w-md sm:block"
|
|
16
22
|
}, v = {
|
|
17
|
-
key:
|
|
23
|
+
key: 6,
|
|
18
24
|
class: "flex shrink-0 items-center gap-0.5 sm:gap-3"
|
|
19
|
-
}, y = /*@__PURE__*/
|
|
25
|
+
}, y = /*@__PURE__*/ r({
|
|
20
26
|
__name: "AcNavbar",
|
|
21
27
|
props: {
|
|
22
28
|
menuButton: { default: "mobile" },
|
|
@@ -30,37 +36,37 @@ var d = ["aria-label"], f = {
|
|
|
30
36
|
searchPosition: { default: "start" }
|
|
31
37
|
},
|
|
32
38
|
emits: ["menu"],
|
|
33
|
-
setup(
|
|
39
|
+
setup(r, { emit: y }) {
|
|
34
40
|
let b = y;
|
|
35
|
-
return (y, x) => (
|
|
36
|
-
class:
|
|
41
|
+
return (y, x) => (a(), t("header", {
|
|
42
|
+
class: i(["top-0 z-30 flex h-18 shrink-0 items-center gap-2 border-b border-border/80 bg-surface/90 px-4 backdrop-blur-sm sm:gap-4 sm:px-6", r.sticky && "sticky"]),
|
|
37
43
|
"data-ac-ds": "",
|
|
38
44
|
"data-testid": "ac-navbar"
|
|
39
45
|
}, [
|
|
40
|
-
|
|
46
|
+
r.menuButton === "never" ? e("", !0) : (a(), t("button", {
|
|
41
47
|
key: 0,
|
|
42
48
|
type: "button",
|
|
43
|
-
class:
|
|
44
|
-
"md:hidden":
|
|
45
|
-
"lg:hidden":
|
|
49
|
+
class: i(["inline-flex size-9.5 shrink-0 cursor-pointer items-center justify-center rounded-10 border border-transparent text-muted transition-colors duration-200 hover:border-border hover:bg-surface-sunken/50 hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none", {
|
|
50
|
+
"md:hidden": r.menuButton === "mobile",
|
|
51
|
+
"lg:hidden": r.menuButton === "tablet"
|
|
46
52
|
}]),
|
|
47
|
-
"aria-label":
|
|
53
|
+
"aria-label": r.menuLabel,
|
|
48
54
|
"data-ac-ds": "",
|
|
49
55
|
"data-testid": "ac-navbar-menu",
|
|
50
56
|
onClick: x[0] ||= (e) => b("menu")
|
|
51
|
-
}, [
|
|
57
|
+
}, [n(c(l), {
|
|
52
58
|
class: "size-5",
|
|
53
59
|
"aria-hidden": "true"
|
|
54
|
-
})], 10,
|
|
55
|
-
y.$slots.brand ||
|
|
56
|
-
y.$slots.default ? (
|
|
60
|
+
})], 10, u)),
|
|
61
|
+
y.$slots.brand || r.productName ? (a(), t("div", d, [o(y.$slots, "brand"), r.productName ? (a(), t("span", f, s(r.productName), 1)) : e("", !0)])) : e("", !0),
|
|
62
|
+
y.$slots.default ? (a(), t("nav", {
|
|
57
63
|
key: 2,
|
|
58
|
-
"aria-label":
|
|
64
|
+
"aria-label": r.label,
|
|
59
65
|
class: "hidden items-center gap-1 md:flex"
|
|
60
|
-
}, [
|
|
61
|
-
y.$slots.search &&
|
|
62
|
-
|
|
63
|
-
y.$slots.actions ? (
|
|
66
|
+
}, [o(y.$slots, "default")], 8, p)) : e("", !0),
|
|
67
|
+
y.$slots.search && r.searchPosition === "start" ? (a(), t("div", m, [o(y.$slots, "search")])) : e("", !0),
|
|
68
|
+
y.$slots.start ? (a(), t("div", h, [o(y.$slots, "start")])) : (a(), t("div", g, [y.$slots.search && r.searchPosition === "center" ? (a(), t("div", _, [o(y.$slots, "search")])) : e("", !0)])),
|
|
69
|
+
y.$slots.actions ? (a(), t("div", v, [o(y.$slots, "actions")])) : e("", !0)
|
|
64
70
|
], 2));
|
|
65
71
|
}
|
|
66
72
|
});
|
|
@@ -1,52 +1,53 @@
|
|
|
1
1
|
import e from "./AcNavbarItem.js";
|
|
2
|
-
import t from "./
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
2
|
+
import { fixedFrame as t } from "./fixedFrame.js";
|
|
3
|
+
import n from "./AcSkeleton.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, createTextVNode as d, createVNode as f, defineComponent as p, getCurrentInstance as m, mergeModels as h, mergeProps as g, nextTick as _, normalizeClass as v, normalizeStyle as ee, onBeforeUnmount as te, openBlock as y, ref as b, renderList as x, renderSlot as S, resolveDynamicComponent as C, toDisplayString as w, unref as T, useId as ne, useModel as re, watch as E, withCtx as D } from "vue";
|
|
5
|
+
import { ArrowRight as ie, Bell as ae, BellOff as oe } from "@lucide/vue";
|
|
5
6
|
//#region src/lib/components/AcNotificationMenu.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var se = {
|
|
7
8
|
class: "inline-flex",
|
|
8
9
|
"data-ac-ds": "",
|
|
9
10
|
"data-testid": "ac-notification-menu"
|
|
10
|
-
},
|
|
11
|
+
}, ce = { class: "flex shrink-0 items-center justify-between gap-2 border-b border-border p-3" }, le = {
|
|
11
12
|
key: 0,
|
|
12
13
|
class: "sr-only"
|
|
13
|
-
},
|
|
14
|
+
}, ue = {
|
|
14
15
|
key: 0,
|
|
15
16
|
class: "flex flex-col gap-4 p-3",
|
|
16
17
|
"aria-busy": "true",
|
|
17
18
|
role: "status",
|
|
18
19
|
"aria-label": "Loading notifications"
|
|
19
|
-
},
|
|
20
|
+
}, de = {
|
|
20
21
|
key: 1,
|
|
21
22
|
class: "flex flex-col items-center gap-3 px-6 py-10 text-center"
|
|
22
|
-
},
|
|
23
|
+
}, fe = {
|
|
23
24
|
class: "inline-flex size-12 items-center justify-center rounded-14 bg-primary/10 text-primary-strong",
|
|
24
25
|
"aria-hidden": "true"
|
|
25
|
-
},
|
|
26
|
+
}, pe = { class: "text-lg font-semibold text-heading" }, me = {
|
|
26
27
|
key: 2,
|
|
27
28
|
role: "list",
|
|
28
29
|
class: "ac-scrollbar min-h-0 flex-1 divide-y divide-border",
|
|
29
30
|
"data-ac-ds": "",
|
|
30
31
|
"data-testid": "ac-notification-menu-list"
|
|
31
|
-
},
|
|
32
|
+
}, he = { class: "flex items-center gap-2" }, ge = { class: "line-clamp-2 min-w-0 text-base font-medium text-heading" }, _e = {
|
|
32
33
|
key: 1,
|
|
33
34
|
class: "size-2 shrink-0 rounded-full bg-primary",
|
|
34
35
|
"aria-hidden": "true"
|
|
35
|
-
},
|
|
36
|
+
}, ve = {
|
|
36
37
|
key: 2,
|
|
37
38
|
class: "sr-only"
|
|
38
|
-
},
|
|
39
|
+
}, ye = {
|
|
39
40
|
key: 0,
|
|
40
41
|
class: "mt-1 line-clamp-2 block text-xs text-muted"
|
|
41
|
-
},
|
|
42
|
+
}, be = { class: "mt-1 flex items-center gap-1.5 text-xs text-muted" }, xe = {
|
|
42
43
|
key: 1,
|
|
43
44
|
"aria-hidden": "true"
|
|
44
|
-
},
|
|
45
|
+
}, Se = ["datetime", "title"], Ce = {
|
|
45
46
|
key: 3,
|
|
46
47
|
class: "shrink-0 border-t border-border p-1.5"
|
|
47
|
-
},
|
|
48
|
+
}, we = "[data-notification-item]", Te = 6048e5, O = /*@__PURE__*/ p({
|
|
48
49
|
__name: "AcNotificationMenu",
|
|
49
|
-
props: /*@__PURE__*/
|
|
50
|
+
props: /*@__PURE__*/ h({
|
|
50
51
|
notifications: { default: () => [] },
|
|
51
52
|
unreadCount: { default: void 0 },
|
|
52
53
|
loading: {
|
|
@@ -66,13 +67,13 @@ var oe = {
|
|
|
66
67
|
},
|
|
67
68
|
openModifiers: {}
|
|
68
69
|
}),
|
|
69
|
-
emits: /*@__PURE__*/
|
|
70
|
+
emits: /*@__PURE__*/ h([
|
|
70
71
|
"select",
|
|
71
72
|
"markAllRead",
|
|
72
73
|
"viewAll"
|
|
73
74
|
], ["update:open"]),
|
|
74
|
-
setup(
|
|
75
|
-
let O =
|
|
75
|
+
setup(p, { emit: h }) {
|
|
76
|
+
let O = p, k = re(p, "open"), A = h, Ee = {
|
|
76
77
|
success: "success",
|
|
77
78
|
succeeded: "success",
|
|
78
79
|
completed: "success",
|
|
@@ -91,7 +92,7 @@ var oe = {
|
|
|
91
92
|
inprogress: "info",
|
|
92
93
|
progressing: "info",
|
|
93
94
|
info: "info"
|
|
94
|
-
},
|
|
95
|
+
}, De = {
|
|
95
96
|
success: "text-success-strong",
|
|
96
97
|
danger: "text-danger-strong",
|
|
97
98
|
warning: "text-warning-strong",
|
|
@@ -100,30 +101,30 @@ var oe = {
|
|
|
100
101
|
}, j = new Intl.RelativeTimeFormat(void 0, {
|
|
101
102
|
numeric: "auto",
|
|
102
103
|
style: "narrow"
|
|
103
|
-
}),
|
|
104
|
+
}), Oe = new Intl.DateTimeFormat(void 0, {
|
|
104
105
|
dateStyle: "medium",
|
|
105
106
|
timeStyle: "short"
|
|
106
|
-
}),
|
|
107
|
+
}), ke = new Intl.DateTimeFormat(void 0, {
|
|
107
108
|
month: "short",
|
|
108
109
|
day: "numeric"
|
|
109
|
-
}), M =
|
|
110
|
-
function
|
|
111
|
-
return e.type ? e.type :
|
|
110
|
+
}), M = m()?.appContext.components.RouterLink, N = ne(), P = `${N}-panel`, F = `${N}-heading`, I = b(null), L = b(null), R = b({}), z = b(!0), B = b(Date.now()), V, H = o(() => O.unreadCount ?? O.notifications.filter((e) => !e.read).length), Ae = o(() => O.notifications.some((e) => !e.read)), je = o(() => !!(O.viewAllHref || O.viewAllTo));
|
|
111
|
+
function Me(e) {
|
|
112
|
+
return e.type ? e.type : Ee[(e.status ?? "").toLowerCase().replace(/[^a-z]/g, "")] ?? "neutral";
|
|
112
113
|
}
|
|
113
114
|
function U(e) {
|
|
114
115
|
return e instanceof Date ? e.getTime() : typeof e == "number" ? e < 1e11 ? e * 1e3 : e : new Date(e).getTime();
|
|
115
116
|
}
|
|
116
|
-
function
|
|
117
|
+
function Ne(e) {
|
|
117
118
|
let t = U(e);
|
|
118
119
|
if (Number.isNaN(t)) return "";
|
|
119
120
|
let n = t - B.value, r = Math.abs(n);
|
|
120
|
-
return r < 45e3 ? "Just now" : r >=
|
|
121
|
+
return r < 45e3 ? "Just now" : r >= Te ? ke.format(t) : r < 36e5 ? j.format(Math.round(n / 6e4), "minute") : r < 864e5 ? j.format(Math.round(n / 36e5), "hour") : j.format(Math.round(n / 864e5), "day");
|
|
121
122
|
}
|
|
122
|
-
function
|
|
123
|
+
function Pe(e) {
|
|
123
124
|
let t = U(e);
|
|
124
|
-
return Number.isNaN(t) ? "" :
|
|
125
|
+
return Number.isNaN(t) ? "" : Oe.format(t);
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
+
function Fe(e) {
|
|
127
128
|
let t = U(e);
|
|
128
129
|
return Number.isNaN(t) ? void 0 : new Date(t).toISOString();
|
|
129
130
|
}
|
|
@@ -138,7 +139,7 @@ var oe = {
|
|
|
138
139
|
return I.value?.$el ?? null;
|
|
139
140
|
}
|
|
140
141
|
function q() {
|
|
141
|
-
return [...L.value?.querySelectorAll(
|
|
142
|
+
return [...L.value?.querySelectorAll(we) ?? []];
|
|
142
143
|
}
|
|
143
144
|
function J(e) {
|
|
144
145
|
let t = q();
|
|
@@ -147,37 +148,37 @@ var oe = {
|
|
|
147
148
|
function Y() {
|
|
148
149
|
let e = K();
|
|
149
150
|
if (!e || !L.value) return;
|
|
150
|
-
let
|
|
151
|
-
z.value = !
|
|
152
|
-
[
|
|
153
|
-
left: `${Math.max(8, Math.min(
|
|
154
|
-
maxHeight: `${Math.max(
|
|
151
|
+
let n = e.getBoundingClientRect(), r = t(), { offsetWidth: i, offsetHeight: a } = L.value, o = r.bottom - n.bottom - 6 - 8, s = n.top - r.top - 6 - 8, c = o < a && s > o, l = (O.align === "end" ? n.right - i : n.left) - r.left;
|
|
152
|
+
z.value = !c, R.value = {
|
|
153
|
+
[c ? "bottom" : "top"]: `${c ? r.bottom - n.top + 6 : n.bottom + 6 - r.top}px`,
|
|
154
|
+
left: `${Math.max(8, Math.min(l, r.width - i - 8))}px`,
|
|
155
|
+
maxHeight: `${Math.max(c ? s : o, 200)}px`
|
|
155
156
|
};
|
|
156
157
|
}
|
|
157
158
|
function X(e = !0) {
|
|
158
159
|
k.value && (k.value = !1, e && K()?.focus());
|
|
159
160
|
}
|
|
160
|
-
function
|
|
161
|
+
function Ie() {
|
|
161
162
|
k.value ? X() : k.value = !0;
|
|
162
163
|
}
|
|
163
|
-
function
|
|
164
|
+
function Le(e) {
|
|
164
165
|
A("select", e), X(!1);
|
|
165
166
|
}
|
|
166
|
-
function
|
|
167
|
+
function Re() {
|
|
167
168
|
A("viewAll"), X(!1);
|
|
168
169
|
}
|
|
169
|
-
function
|
|
170
|
+
function ze(e) {
|
|
170
171
|
e.key !== "ArrowDown" || k.value || (e.preventDefault(), k.value = !0);
|
|
171
172
|
}
|
|
172
|
-
function
|
|
173
|
+
function Z(e) {
|
|
173
174
|
let t = q(), n = t.indexOf(document.activeElement);
|
|
174
|
-
(e.key === "ArrowDown" || e.key === "ArrowUp") && t.length ? (e.preventDefault(), J(n < 0 ? e.key === "ArrowDown" ? 0 : -1 : n + (e.key === "ArrowDown" ? 1 : -1))) : (e.key === "Home" || e.key === "End") && n >= 0 ? (e.preventDefault(), J(e.key === "Home" ? 0 : -1)) : e.key === "Escape" ? (e.preventDefault(), X()) : e.key === "Tab" &&
|
|
175
|
+
(e.key === "ArrowDown" || e.key === "ArrowUp") && t.length ? (e.preventDefault(), J(n < 0 ? e.key === "ArrowDown" ? 0 : -1 : n + (e.key === "ArrowDown" ? 1 : -1))) : (e.key === "Home" || e.key === "End") && n >= 0 ? (e.preventDefault(), J(e.key === "Home" ? 0 : -1)) : e.key === "Escape" ? (e.preventDefault(), X()) : e.key === "Tab" && Be(e);
|
|
175
176
|
}
|
|
176
|
-
function
|
|
177
|
+
function Be(e) {
|
|
177
178
|
let t = [...L.value?.querySelectorAll("a[href], button:not([disabled])") ?? []], n = t[0], r = t[t.length - 1];
|
|
178
179
|
e.shiftKey && (document.activeElement === n || document.activeElement === L.value) ? (e.preventDefault(), X()) : !e.shiftKey && (document.activeElement === r || !t.length) && X();
|
|
179
180
|
}
|
|
180
|
-
function
|
|
181
|
+
function Ve(e) {
|
|
181
182
|
let t = e.target;
|
|
182
183
|
K()?.contains(t) || L.value?.contains(t) || X(!1);
|
|
183
184
|
}
|
|
@@ -186,28 +187,28 @@ var oe = {
|
|
|
186
187
|
}
|
|
187
188
|
function $(e) {
|
|
188
189
|
let t = e ? "addEventListener" : "removeEventListener";
|
|
189
|
-
document[t]("pointerdown",
|
|
190
|
+
document[t]("pointerdown", Ve, !0), window[t]("scroll", Q, !0), window[t]("resize", Q), clearInterval(V), e && (V = setInterval(() => B.value = Date.now(), 3e4));
|
|
190
191
|
}
|
|
191
192
|
return E(k, async (e) => {
|
|
192
193
|
if ($(e), !e) return;
|
|
193
|
-
B.value = Date.now(), await
|
|
194
|
+
B.value = Date.now(), await _(), Y();
|
|
194
195
|
let t = q()[0];
|
|
195
196
|
t ? t.focus() : L.value?.focus();
|
|
196
|
-
}), E(() => [O.notifications.length, O.loading], () => k.value &&
|
|
197
|
+
}), E(() => [O.notifications.length, O.loading], () => k.value && _(Y)), te(() => $(!1)), (t, o) => (y(), l("div", se, [f(e, {
|
|
197
198
|
ref_key: "trigger",
|
|
198
199
|
ref: I,
|
|
199
|
-
label:
|
|
200
|
-
icon:
|
|
200
|
+
label: p.label,
|
|
201
|
+
icon: T(ae),
|
|
201
202
|
"icon-only": "",
|
|
202
203
|
badge: H.value,
|
|
203
204
|
"aria-haspopup": "dialog",
|
|
204
205
|
"aria-expanded": k.value,
|
|
205
206
|
"aria-controls": k.value ? P : void 0,
|
|
206
|
-
class:
|
|
207
|
+
class: v(k.value && "border-border bg-surface-sunken/50 text-heading"),
|
|
207
208
|
"data-ac-ds": "",
|
|
208
209
|
"data-testid": "ac-notification-menu-trigger",
|
|
209
|
-
onClick:
|
|
210
|
-
onKeydown:
|
|
210
|
+
onClick: Ie,
|
|
211
|
+
onKeydown: ze
|
|
211
212
|
}, null, 8, [
|
|
212
213
|
"label",
|
|
213
214
|
"icon",
|
|
@@ -215,13 +216,13 @@ var oe = {
|
|
|
215
216
|
"aria-expanded",
|
|
216
217
|
"aria-controls",
|
|
217
218
|
"class"
|
|
218
|
-
]), (
|
|
219
|
+
]), (y(), s(i, { to: "body" }, [f(a, {
|
|
219
220
|
"enter-active-class": "transition duration-150 ease-out",
|
|
220
221
|
"enter-from-class": "opacity-0 motion-safe:scale-95",
|
|
221
222
|
"leave-active-class": "transition duration-100 ease-in",
|
|
222
223
|
"leave-to-class": "opacity-0"
|
|
223
224
|
}, {
|
|
224
|
-
default: D(() => [k.value ? (
|
|
225
|
+
default: D(() => [k.value ? (y(), l("div", {
|
|
225
226
|
key: 0,
|
|
226
227
|
id: P,
|
|
227
228
|
ref_key: "panel",
|
|
@@ -229,79 +230,79 @@ var oe = {
|
|
|
229
230
|
role: "dialog",
|
|
230
231
|
tabindex: "-1",
|
|
231
232
|
"aria-labelledby": F,
|
|
232
|
-
class:
|
|
233
|
+
class: v(["fixed z-[90] flex w-[calc(320px*var(--ac-scale))] max-w-[calc(100vw-16px)] flex-col overflow-hidden rounded-14 border border-border/80 bg-surface shadow-lg outline-none", z.value ? "origin-top-right" : "origin-bottom-right"]),
|
|
233
234
|
style: ee(R.value),
|
|
234
235
|
"data-ac-ds": "",
|
|
235
236
|
"data-testid": "ac-notification-menu-panel",
|
|
236
|
-
onKeydown:
|
|
237
|
+
onKeydown: Z
|
|
237
238
|
}, [
|
|
238
|
-
|
|
239
|
+
u("div", ce, [u("h2", {
|
|
239
240
|
id: F,
|
|
240
241
|
class: "font-heading text-base font-semibold text-heading"
|
|
241
|
-
},
|
|
242
|
+
}, w(p.label), 1), Ae.value || H.value ? (y(), l("button", {
|
|
242
243
|
key: 0,
|
|
243
244
|
type: "button",
|
|
244
245
|
class: "cursor-pointer rounded-4 text-xs text-muted transition-colors duration-200 hover:text-primary focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
245
246
|
"data-ac-ds": "",
|
|
246
247
|
"data-testid": "ac-notification-menu-mark-all",
|
|
247
|
-
onClick:
|
|
248
|
-
}, [
|
|
249
|
-
|
|
248
|
+
onClick: o[0] ||= (e) => A("markAllRead")
|
|
249
|
+
}, [o[1] ||= d(" Mark all as read", -1), H.value ? (y(), l("span", le, " (" + w(H.value) + " unread)", 1)) : c("", !0)])) : c("", !0)]),
|
|
250
|
+
p.loading ? (y(), l("div", ue, [(y(), l(r, null, x(3, (e) => f(n, {
|
|
250
251
|
key: e,
|
|
251
252
|
shape: "text",
|
|
252
253
|
lines: 3,
|
|
253
254
|
height: "10px",
|
|
254
255
|
label: ""
|
|
255
|
-
})), 64))])) :
|
|
256
|
+
})), 64))])) : p.notifications.length ? (y(), l("ul", me, [(y(!0), l(r, null, x(p.notifications, (e) => (y(), l("li", { key: e.id }, [(y(), s(C(W(e.to, e.href)), g({ ref_for: !0 }, G(e.to, e.href), {
|
|
256
257
|
"data-notification-item": "",
|
|
257
258
|
class: ["relative block w-full cursor-pointer p-3 text-left no-underline outline-none transition-colors duration-200 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", !e.read && "bg-primary/8"],
|
|
258
259
|
"data-ac-ds": "",
|
|
259
260
|
"data-testid": "ac-notification-menu-item",
|
|
260
|
-
onClick: (t) =>
|
|
261
|
+
onClick: (t) => Le(e)
|
|
261
262
|
}), {
|
|
262
|
-
default: D(() => [
|
|
263
|
-
|
|
264
|
-
e.icon ? (
|
|
263
|
+
default: D(() => [S(t.$slots, "item", { item: e }, () => [
|
|
264
|
+
u("span", he, [
|
|
265
|
+
e.icon ? (y(), s(C(e.icon), {
|
|
265
266
|
key: 0,
|
|
266
267
|
class: "size-4 shrink-0 text-muted",
|
|
267
268
|
"aria-hidden": "true"
|
|
268
|
-
})) :
|
|
269
|
-
|
|
270
|
-
e.read ?
|
|
271
|
-
e.read ?
|
|
269
|
+
})) : c("", !0),
|
|
270
|
+
u("span", ge, w(e.title || e.msg), 1),
|
|
271
|
+
e.read ? c("", !0) : (y(), l("span", _e)),
|
|
272
|
+
e.read ? c("", !0) : (y(), l("span", ve, "(unread)"))
|
|
272
273
|
]),
|
|
273
|
-
e.title && e.msg ? (
|
|
274
|
-
|
|
275
|
-
e.status ? (
|
|
274
|
+
e.title && e.msg ? (y(), l("span", ye, w(e.msg), 1)) : c("", !0),
|
|
275
|
+
u("span", be, [
|
|
276
|
+
e.status ? (y(), l("span", {
|
|
276
277
|
key: 0,
|
|
277
|
-
class:
|
|
278
|
-
},
|
|
279
|
-
e.status ? (
|
|
280
|
-
|
|
281
|
-
datetime:
|
|
282
|
-
title:
|
|
283
|
-
},
|
|
278
|
+
class: v(["font-medium", De[Me(e)]])
|
|
279
|
+
}, w(e.status), 3)) : c("", !0),
|
|
280
|
+
e.status ? (y(), l("span", xe, "·")) : c("", !0),
|
|
281
|
+
u("time", {
|
|
282
|
+
datetime: Fe(e.time),
|
|
283
|
+
title: Pe(e.time)
|
|
284
|
+
}, w(Ne(e.time)), 9, Se)
|
|
284
285
|
])
|
|
285
286
|
])]),
|
|
286
287
|
_: 2
|
|
287
|
-
}, 1040, ["class", "onClick"]))]))), 128))])) : (
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
288
|
+
}, 1040, ["class", "onClick"]))]))), 128))])) : (y(), l("div", de, [S(t.$slots, "empty", {}, () => [
|
|
289
|
+
u("span", fe, [f(T(oe), { class: "size-6" })]),
|
|
290
|
+
u("p", pe, w(p.emptyText), 1),
|
|
291
|
+
o[2] ||= u("p", { class: "max-w-64 text-base text-muted" }, "Backups, upgrades and alerts from your clusters show up here.", -1)
|
|
291
292
|
])])),
|
|
292
|
-
|
|
293
|
+
t.$slots.footer || je.value ? (y(), l("div", Ce, [S(t.$slots, "footer", { close: X }, () => [(y(), s(C(W(p.viewAllTo, p.viewAllHref)), g(G(p.viewAllTo, p.viewAllHref), {
|
|
293
294
|
class: "group/link flex h-9 w-full cursor-pointer items-center justify-center gap-1.5 rounded-8 text-base font-semibold text-primary-strong no-underline outline-none transition-colors duration-200 hover:bg-surface-sunken focus-visible:bg-surface-sunken focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
|
|
294
295
|
"data-ac-ds": "",
|
|
295
296
|
"data-testid": "ac-notification-menu-view-all",
|
|
296
|
-
onClick:
|
|
297
|
+
onClick: Re
|
|
297
298
|
}), {
|
|
298
|
-
default: D(() => [
|
|
299
|
+
default: D(() => [d(w(p.viewAllLabel) + " ", 1), f(T(ie), {
|
|
299
300
|
class: "size-3.5 transition-transform duration-200 group-hover/link:translate-x-0.5 motion-reduce:transition-none",
|
|
300
301
|
"aria-hidden": "true"
|
|
301
302
|
})]),
|
|
302
303
|
_: 1
|
|
303
|
-
}, 16))])])) :
|
|
304
|
-
], 38)) :
|
|
304
|
+
}, 16))])])) : c("", !0)
|
|
305
|
+
], 38)) : c("", !0)]),
|
|
305
306
|
_: 3
|
|
306
307
|
})]))]));
|
|
307
308
|
}
|
|
@@ -59,9 +59,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
59
59
|
min: number;
|
|
60
60
|
name: string;
|
|
61
61
|
size: "small" | "normal";
|
|
62
|
+
hint: string;
|
|
62
63
|
step: number;
|
|
63
64
|
readonly: boolean;
|
|
64
|
-
hint: string;
|
|
65
65
|
errorMsg: string;
|
|
66
66
|
unit: string;
|
|
67
67
|
precision: number;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export interface Props<V> {
|
|
2
|
+
/** Native radio `name`, used as given. Cards with the same `name` form one group: arrow keys move between them. Old cloud-ui `group`. */
|
|
3
|
+
name: string;
|
|
4
|
+
/** The value this card writes to `v-model` when it's selected. */
|
|
5
|
+
value: V;
|
|
6
|
+
/** Bold line at the top of the card. */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** Muted text under the title. */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** Greys the card out and stops it from being selected. */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Shows an 18px radio before the content instead of the check badge in the corner. Old cloud-ui `is-radio-show`. */
|
|
13
|
+
showRadio?: boolean;
|
|
14
|
+
/** Classes for the title, replacing `text-base font-semibold text-heading`, e.g. `text-lg font-semibold text-heading`. */
|
|
15
|
+
titleClass?: string;
|
|
16
|
+
/** Classes for the description, replacing `mt-0.5 text-xs leading-relaxed text-muted`. */
|
|
17
|
+
descriptionClass?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
20
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(Props<T> & {
|
|
21
|
+
modelValue?: T;
|
|
22
|
+
}) & {
|
|
23
|
+
"onUpdate:modelValue"?: ((value: T | undefined) => any) | undefined;
|
|
24
|
+
onChange?: ((value: T) => any) | undefined;
|
|
25
|
+
}> & (typeof globalThis extends {
|
|
26
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
27
|
+
} ? P : {});
|
|
28
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
29
|
+
/** Moves focus to the radio. */
|
|
30
|
+
focus: () => void | undefined;
|
|
31
|
+
}>) => void;
|
|
32
|
+
attrs: any;
|
|
33
|
+
slots: {
|
|
34
|
+
/** Replaces the whole card body (icon, title, description, features and right content). The radio and selection styles stay. Old cloud-ui `is-custom` with `#custom`. */
|
|
35
|
+
default?: () => unknown;
|
|
36
|
+
/** Icon or logo tile before the title. */
|
|
37
|
+
icon?: () => unknown;
|
|
38
|
+
/** Content after the title on the same line, e.g. a "Recommended" pill. Old cloud-ui `#subTitle`. */
|
|
39
|
+
subtitle?: () => unknown;
|
|
40
|
+
/** Pills under the description, e.g. "HA" or "PITR". */
|
|
41
|
+
features?: () => unknown;
|
|
42
|
+
/** Content on the right of the card, e.g. a price. Below 768px it moves under the text. Hides the check badge, so pair it with `show-radio`. Old cloud-ui `#rightContent`. */
|
|
43
|
+
right?: () => unknown;
|
|
44
|
+
};
|
|
45
|
+
emit: ((evt: "change", value: T) => void) & ((event: "update:modelValue", value: T | undefined) => void);
|
|
46
|
+
}>) => import("vue").VNode & {
|
|
47
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
48
|
+
};
|
|
49
|
+
declare const _default: typeof __VLS_export;
|
|
50
|
+
export default _default;
|
|
51
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
52
|
+
[K in keyof T]: T[K];
|
|
53
|
+
} : {
|
|
54
|
+
[K in keyof T as K]: T[K];
|
|
55
|
+
}) & {};
|