@ac-design/design-system 2.0.0 → 2.1.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.d.ts +2 -0
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +42 -37
- package/dist/lib/charts/cartesian.d.ts +324 -0
- package/dist/lib/charts/cartesian.js +137 -0
- package/dist/lib/charts/echarts.d.ts +86 -0
- package/dist/lib/charts/echarts.js +173 -0
- package/dist/lib/charts/graph.d.ts +77 -0
- package/dist/lib/charts/graph.js +155 -0
- package/dist/lib/charts/index.d.ts +4 -0
- package/dist/lib/charts/index.js +3 -1
- package/dist/lib/charts/shared.d.ts +0 -7
- package/dist/lib/charts/shared.js +1 -19
- package/dist/lib/charts/xy.d.ts +11 -7
- package/dist/lib/charts/xy.js +53 -72
- package/dist/lib/compat.css +1322 -278
- package/dist/lib/components/AcAlert.vue.d.ts +9 -0
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -21
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcAreaChart.vue.d.ts +3 -0
- package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +132 -142
- package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +59 -54
- package/dist/lib/components/AcBadge.vue.d.ts +7 -3
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +35 -28
- package/dist/lib/components/AcBarChart.vue.d.ts +3 -0
- package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +142 -146
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +18 -17
- package/dist/lib/components/AcBulkActionBar.vue.d.ts +2 -0
- package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcButton.vue.d.ts +12 -6
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +85 -47
- package/dist/lib/components/AcCard.vue.d.ts +34 -3
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +169 -34
- package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +171 -165
- package/dist/lib/components/AcCheckBox.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +58 -72
- package/dist/lib/components/AcCheckList.js +5 -0
- package/dist/lib/components/AcCheckList.vue.d.ts +45 -0
- package/dist/lib/components/AcCheckList.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/lib/components/AcCheckRadio.vue.d.ts +30 -5
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +100 -36
- package/dist/lib/components/AcCircularProgress.vue.d.ts +4 -4
- package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +12 -9
- package/dist/lib/components/AcColorInput.vue.d.ts +5 -2
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +127 -97
- package/dist/lib/components/AcCommandBlock.js +5 -0
- package/dist/lib/components/AcCommandBlock.vue.d.ts +34 -0
- package/dist/lib/components/AcCommandBlock.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcConfirmModal.vue.d.ts +1 -1
- package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +7 -3
- package/dist/lib/components/AcCopyButton.vue.d.ts +2 -2
- package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcCostSummary.js +5 -0
- package/dist/lib/components/AcCostSummary.vue.d.ts +102 -0
- package/dist/lib/components/AcCostSummary.vue_vue_type_script_setup_true_lang.js +179 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +3 -3
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +606 -380
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +47 -41
- package/dist/lib/components/AcDonutChart.vue.d.ts +10 -0
- package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +116 -89
- package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +88 -75
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +17 -17
- package/dist/lib/components/AcEmptyState.vue.d.ts +1 -1
- package/dist/lib/components/AcErrorState.js +5 -0
- package/dist/lib/components/AcErrorState.vue.d.ts +46 -0
- package/dist/lib/components/AcErrorState.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcFeatureCard.vue.d.ts +6 -0
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +136 -114
- package/dist/lib/components/AcFooter.vue.d.ts +1 -1
- package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcFormFooter.vue.d.ts +1 -1
- package/dist/lib/components/AcFormSection.vue.d.ts +1 -1
- package/dist/lib/components/AcGraphChart.js +5 -0
- package/dist/lib/components/AcGraphChart.vue.d.ts +124 -0
- package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +578 -0
- package/dist/lib/components/AcHeader.vue.d.ts +17 -2
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +79 -25
- package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +76 -79
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +4 -4
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +199 -183
- package/dist/lib/components/AcLineChart.vue.d.ts +6 -0
- package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +113 -125
- package/dist/lib/components/AcLoader.js +5 -0
- package/dist/lib/components/AcLoader.vue.d.ts +15 -0
- package/dist/lib/components/AcLoader.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +3 -1
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +44 -36
- package/dist/lib/components/AcMapChart.js +5 -0
- package/dist/lib/components/AcMapChart.vue.d.ts +136 -0
- package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +518 -0
- package/dist/lib/components/AcModal.vue.d.ts +6 -3
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +85 -61
- package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +25 -17
- package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +133 -168
- package/dist/lib/components/AcNumberInput.vue.d.ts +2 -2
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +137 -147
- package/dist/lib/components/AcPage.vue.d.ts +2 -2
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcPagination.vue.d.ts +5 -5
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +59 -56
- package/dist/lib/components/AcPreloader.vue.d.ts +3 -3
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +15 -16
- package/dist/lib/components/AcProductHero.js +5 -0
- package/dist/lib/components/AcProductHero.vue.d.ts +56 -0
- package/dist/lib/components/AcProductHero.vue_vue_type_script_setup_true_lang.js +95 -0
- package/dist/lib/components/AcProgress.vue.d.ts +17 -2
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +83 -29
- package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +8 -4
- package/dist/lib/components/AcSelect.vue.d.ts +3 -3
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +232 -243
- package/dist/lib/components/AcSettingsRow.js +5 -0
- package/dist/lib/components/AcSettingsRow.vue.d.ts +29 -0
- package/dist/lib/components/AcSettingsRow.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebar.vue.d.ts +4 -1
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +104 -94
- package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +42 -42
- package/dist/lib/components/AcSidebarSection.vue.d.ts +2 -2
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +23 -18
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcSwitch.vue.d.ts +3 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +46 -39
- package/dist/lib/components/AcSwitchCard.vue.d.ts +3 -3
- package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +65 -65
- package/dist/lib/components/AcTabs.vue.d.ts +9 -2
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +42 -27
- package/dist/lib/components/AcTag.vue.d.ts +1 -1
- package/dist/lib/components/AcTagInput.vue.d.ts +5 -5
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +140 -142
- package/dist/lib/components/AcTextarea.vue.d.ts +1 -1
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +69 -72
- package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +54 -22
- package/dist/lib/components/AcTimePicker.vue.d.ts +1 -1
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +177 -185
- package/dist/lib/components/AcToaster.vue.d.ts +6 -3
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +103 -64
- package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +184 -70
- package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +181 -138
- package/dist/lib/components/index.d.ts +7 -0
- package/dist/lib/components/status.d.ts +3 -1
- package/dist/lib/components/status.js +20 -5
- package/dist/lib/composables/useToast.d.ts +17 -1
- package/dist/lib/composables/useToast.js +10 -2
- package/dist/lib/index.d.ts +7 -3
- package/dist/lib/index.js +80 -73
- package/dist/lib/theme.css +39 -54
- package/package.json +12 -3
|
@@ -1,50 +1,50 @@
|
|
|
1
1
|
import e from "./AcNavbarItem.js";
|
|
2
2
|
import t from "./AcSkeleton.js";
|
|
3
|
-
import { Fragment as n, Teleport as r, Transition as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, getCurrentInstance as p, mergeModels as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeStyle as ee, onBeforeUnmount as te, openBlock as v, ref as y, renderList as b, renderSlot as x, resolveDynamicComponent as S, toDisplayString as C, unref as w, useId as
|
|
4
|
-
import { ArrowRight as
|
|
3
|
+
import { Fragment as n, Teleport as r, Transition as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, getCurrentInstance as p, mergeModels as m, mergeProps as h, nextTick as g, normalizeClass as _, normalizeStyle as ee, onBeforeUnmount as te, openBlock as v, ref as y, renderList as b, renderSlot as x, resolveDynamicComponent as S, toDisplayString as C, unref as w, useId as T, useModel as ne, watch as E, withCtx as D } from "vue";
|
|
4
|
+
import { ArrowRight as re, Bell as ie, BellOff as ae } from "@lucide/vue";
|
|
5
5
|
//#region src/lib/components/AcNotificationMenu.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var oe = {
|
|
7
7
|
class: "inline-flex",
|
|
8
8
|
"data-ac-ds": "",
|
|
9
9
|
"data-testid": "ac-notification-menu"
|
|
10
|
-
},
|
|
10
|
+
}, se = { class: "flex shrink-0 items-center justify-between gap-2 border-b border-border p-3" }, ce = {
|
|
11
11
|
key: 0,
|
|
12
|
-
class: "
|
|
13
|
-
},
|
|
12
|
+
class: "sr-only"
|
|
13
|
+
}, le = {
|
|
14
14
|
key: 0,
|
|
15
|
-
class: "flex flex-col gap-4
|
|
15
|
+
class: "flex flex-col gap-4 p-3",
|
|
16
16
|
"aria-busy": "true",
|
|
17
17
|
role: "status",
|
|
18
18
|
"aria-label": "Loading notifications"
|
|
19
|
-
},
|
|
19
|
+
}, ue = {
|
|
20
20
|
key: 1,
|
|
21
21
|
class: "flex flex-col items-center gap-3 px-6 py-10 text-center"
|
|
22
|
-
},
|
|
22
|
+
}, de = {
|
|
23
23
|
class: "inline-flex size-12 items-center justify-center rounded-14 bg-primary/10 text-primary-strong",
|
|
24
24
|
"aria-hidden": "true"
|
|
25
|
-
},
|
|
25
|
+
}, fe = { class: "text-lg font-semibold text-heading" }, pe = {
|
|
26
26
|
key: 2,
|
|
27
27
|
role: "list",
|
|
28
28
|
class: "ac-scrollbar min-h-0 flex-1 divide-y divide-border",
|
|
29
29
|
"data-ac-ds": "",
|
|
30
30
|
"data-testid": "ac-notification-menu-list"
|
|
31
|
-
},
|
|
32
|
-
key: 0,
|
|
33
|
-
class: "mt-1 line-clamp-2 text-xs text-muted"
|
|
34
|
-
}, Ce = { class: "mt-1 flex items-center gap-1.5 text-xs text-muted" }, we = {
|
|
31
|
+
}, me = { class: "flex items-center gap-2" }, he = { class: "line-clamp-2 min-w-0 text-base font-medium text-heading" }, ge = {
|
|
35
32
|
key: 1,
|
|
33
|
+
class: "size-2 shrink-0 rounded-full bg-primary",
|
|
36
34
|
"aria-hidden": "true"
|
|
37
|
-
},
|
|
35
|
+
}, _e = {
|
|
36
|
+
key: 2,
|
|
37
|
+
class: "sr-only"
|
|
38
|
+
}, ve = {
|
|
38
39
|
key: 0,
|
|
39
|
-
class: "mt-
|
|
40
|
-
|
|
41
|
-
}, De = {
|
|
40
|
+
class: "mt-1 line-clamp-2 block text-xs text-muted"
|
|
41
|
+
}, ye = { class: "mt-1 flex items-center gap-1.5 text-xs text-muted" }, be = {
|
|
42
42
|
key: 1,
|
|
43
|
-
|
|
44
|
-
},
|
|
43
|
+
"aria-hidden": "true"
|
|
44
|
+
}, xe = ["datetime", "title"], Se = {
|
|
45
45
|
key: 3,
|
|
46
46
|
class: "shrink-0 border-t border-border p-1.5"
|
|
47
|
-
},
|
|
47
|
+
}, Ce = "[data-notification-item]", we = 6048e5, O = /*@__PURE__*/ f({
|
|
48
48
|
__name: "AcNotificationMenu",
|
|
49
49
|
props: /*@__PURE__*/ m({
|
|
50
50
|
notifications: { default: () => [] },
|
|
@@ -72,7 +72,7 @@ var pe = {
|
|
|
72
72
|
"viewAll"
|
|
73
73
|
], ["update:open"]),
|
|
74
74
|
setup(f, { emit: m }) {
|
|
75
|
-
let
|
|
75
|
+
let O = f, k = ne(f, "open"), A = m, Te = {
|
|
76
76
|
success: "success",
|
|
77
77
|
succeeded: "success",
|
|
78
78
|
completed: "success",
|
|
@@ -91,143 +91,123 @@ var pe = {
|
|
|
91
91
|
inprogress: "info",
|
|
92
92
|
progressing: "info",
|
|
93
93
|
info: "info"
|
|
94
|
-
},
|
|
95
|
-
success:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
danger: {
|
|
101
|
-
icon: le,
|
|
102
|
-
tile: "bg-danger/10 text-danger-strong",
|
|
103
|
-
text: "text-danger-strong"
|
|
104
|
-
},
|
|
105
|
-
warning: {
|
|
106
|
-
icon: fe,
|
|
107
|
-
tile: "bg-warning/10 text-warning-strong",
|
|
108
|
-
text: "text-warning-strong"
|
|
109
|
-
},
|
|
110
|
-
info: {
|
|
111
|
-
icon: de,
|
|
112
|
-
tile: "bg-info/10 text-info-strong",
|
|
113
|
-
text: "text-info-strong"
|
|
114
|
-
},
|
|
115
|
-
neutral: {
|
|
116
|
-
icon: ue,
|
|
117
|
-
tile: "bg-surface-sunken text-muted",
|
|
118
|
-
text: "text-muted"
|
|
119
|
-
}
|
|
94
|
+
}, Ee = {
|
|
95
|
+
success: "text-success-strong",
|
|
96
|
+
danger: "text-danger-strong",
|
|
97
|
+
warning: "text-warning-strong",
|
|
98
|
+
info: "text-info-strong",
|
|
99
|
+
neutral: "text-muted"
|
|
120
100
|
}, j = new Intl.RelativeTimeFormat(void 0, {
|
|
121
101
|
numeric: "auto",
|
|
122
102
|
style: "narrow"
|
|
123
|
-
}),
|
|
103
|
+
}), De = new Intl.DateTimeFormat(void 0, {
|
|
124
104
|
dateStyle: "medium",
|
|
125
105
|
timeStyle: "short"
|
|
126
|
-
}),
|
|
106
|
+
}), Oe = new Intl.DateTimeFormat(void 0, {
|
|
127
107
|
month: "short",
|
|
128
108
|
day: "numeric"
|
|
129
|
-
}), M = p()?.appContext.components.RouterLink, N =
|
|
130
|
-
function
|
|
131
|
-
return e.type ? e.type :
|
|
109
|
+
}), M = p()?.appContext.components.RouterLink, N = T(), P = `${N}-panel`, F = `${N}-heading`, I = y(null), L = y(null), R = y({}), z = y(!0), B = y(Date.now()), V, H = a(() => O.unreadCount ?? O.notifications.filter((e) => !e.read).length), ke = a(() => O.notifications.some((e) => !e.read)), Ae = a(() => !!(O.viewAllHref || O.viewAllTo));
|
|
110
|
+
function je(e) {
|
|
111
|
+
return e.type ? e.type : Te[(e.status ?? "").toLowerCase().replace(/[^a-z]/g, "")] ?? "neutral";
|
|
132
112
|
}
|
|
133
|
-
function
|
|
113
|
+
function U(e) {
|
|
134
114
|
return e instanceof Date ? e.getTime() : typeof e == "number" ? e < 1e11 ? e * 1e3 : e : new Date(e).getTime();
|
|
135
115
|
}
|
|
136
|
-
function
|
|
137
|
-
let t =
|
|
116
|
+
function Me(e) {
|
|
117
|
+
let t = U(e);
|
|
138
118
|
if (Number.isNaN(t)) return "";
|
|
139
119
|
let n = t - B.value, r = Math.abs(n);
|
|
140
|
-
return r < 45e3 ? "Just now" : r >=
|
|
120
|
+
return r < 45e3 ? "Just now" : r >= we ? Oe.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");
|
|
141
121
|
}
|
|
142
|
-
function
|
|
143
|
-
let t =
|
|
144
|
-
return Number.isNaN(t) ? "" :
|
|
122
|
+
function Ne(e) {
|
|
123
|
+
let t = U(e);
|
|
124
|
+
return Number.isNaN(t) ? "" : De.format(t);
|
|
145
125
|
}
|
|
146
|
-
function
|
|
147
|
-
let t =
|
|
126
|
+
function Pe(e) {
|
|
127
|
+
let t = U(e);
|
|
148
128
|
return Number.isNaN(t) ? void 0 : new Date(t).toISOString();
|
|
149
129
|
}
|
|
150
|
-
function
|
|
130
|
+
function W(e, t) {
|
|
151
131
|
return e && M ? M : e || t ? "a" : "button";
|
|
152
132
|
}
|
|
153
|
-
function
|
|
154
|
-
let n =
|
|
133
|
+
function G(e, t) {
|
|
134
|
+
let n = W(e, t);
|
|
155
135
|
return n === M ? { to: e } : n === "a" ? { href: t || (typeof e == "string" ? e : void 0) } : { type: "button" };
|
|
156
136
|
}
|
|
157
|
-
function
|
|
137
|
+
function K() {
|
|
158
138
|
return I.value?.$el ?? null;
|
|
159
139
|
}
|
|
160
|
-
function
|
|
161
|
-
return [...L.value?.querySelectorAll(
|
|
140
|
+
function q() {
|
|
141
|
+
return [...L.value?.querySelectorAll(Ce) ?? []];
|
|
162
142
|
}
|
|
163
|
-
function
|
|
164
|
-
let t =
|
|
143
|
+
function J(e) {
|
|
144
|
+
let t = q();
|
|
165
145
|
t.length && t[(e + t.length) % t.length].focus();
|
|
166
146
|
}
|
|
167
|
-
function
|
|
168
|
-
let e =
|
|
147
|
+
function Y() {
|
|
148
|
+
let e = K();
|
|
169
149
|
if (!e || !L.value) return;
|
|
170
|
-
let t = e.getBoundingClientRect(), { offsetWidth: n, offsetHeight: r } = L.value, i = window.innerHeight - t.bottom - 6 - 8, a = t.top - 6 - 8, o = i < r && a > i, s =
|
|
150
|
+
let t = e.getBoundingClientRect(), { offsetWidth: n, offsetHeight: r } = L.value, i = window.innerHeight - t.bottom - 6 - 8, a = t.top - 6 - 8, o = i < r && a > i, s = O.align === "end" ? t.right - n : t.left;
|
|
171
151
|
z.value = !o, R.value = {
|
|
172
152
|
[o ? "bottom" : "top"]: `${o ? window.innerHeight - t.top + 6 : t.bottom + 6}px`,
|
|
173
153
|
left: `${Math.max(8, Math.min(s, window.innerWidth - n - 8))}px`,
|
|
174
154
|
maxHeight: `${Math.max(o ? a : i, 200)}px`
|
|
175
155
|
};
|
|
176
156
|
}
|
|
177
|
-
function
|
|
178
|
-
|
|
157
|
+
function X(e = !0) {
|
|
158
|
+
k.value && (k.value = !1, e && K()?.focus());
|
|
179
159
|
}
|
|
180
|
-
function
|
|
181
|
-
|
|
160
|
+
function Z() {
|
|
161
|
+
k.value ? X() : k.value = !0;
|
|
182
162
|
}
|
|
183
|
-
function
|
|
184
|
-
|
|
163
|
+
function Fe(e) {
|
|
164
|
+
A("select", e), X(!1);
|
|
185
165
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
166
|
+
function Ie() {
|
|
167
|
+
A("viewAll"), X(!1);
|
|
188
168
|
}
|
|
189
|
-
function
|
|
190
|
-
e.key !== "ArrowDown" ||
|
|
169
|
+
function Le(e) {
|
|
170
|
+
e.key !== "ArrowDown" || k.value || (e.preventDefault(), k.value = !0);
|
|
191
171
|
}
|
|
192
|
-
function
|
|
193
|
-
let t =
|
|
194
|
-
(e.key === "ArrowDown" || e.key === "ArrowUp") && t.length ? (e.preventDefault(),
|
|
172
|
+
function Re(e) {
|
|
173
|
+
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" && ze(e);
|
|
195
175
|
}
|
|
196
|
-
function
|
|
176
|
+
function ze(e) {
|
|
197
177
|
let t = [...L.value?.querySelectorAll("a[href], button:not([disabled])") ?? []], n = t[0], r = t[t.length - 1];
|
|
198
|
-
e.shiftKey && (document.activeElement === n || document.activeElement === L.value) ? (e.preventDefault(),
|
|
178
|
+
e.shiftKey && (document.activeElement === n || document.activeElement === L.value) ? (e.preventDefault(), X()) : !e.shiftKey && (document.activeElement === r || !t.length) && X();
|
|
199
179
|
}
|
|
200
|
-
function
|
|
180
|
+
function Be(e) {
|
|
201
181
|
let t = e.target;
|
|
202
|
-
|
|
182
|
+
K()?.contains(t) || L.value?.contains(t) || X(!1);
|
|
203
183
|
}
|
|
204
184
|
function Q(e) {
|
|
205
|
-
e?.target instanceof Node && L.value?.contains(e.target) ||
|
|
185
|
+
e?.target instanceof Node && L.value?.contains(e.target) || Y();
|
|
206
186
|
}
|
|
207
187
|
function $(e) {
|
|
208
188
|
let t = e ? "addEventListener" : "removeEventListener";
|
|
209
|
-
document[t]("pointerdown",
|
|
189
|
+
document[t]("pointerdown", Be, !0), window[t]("scroll", Q, !0), window[t]("resize", Q), clearInterval(V), e && (V = setInterval(() => B.value = Date.now(), 3e4));
|
|
210
190
|
}
|
|
211
|
-
return
|
|
191
|
+
return E(k, async (e) => {
|
|
212
192
|
if ($(e), !e) return;
|
|
213
|
-
B.value = Date.now(), await g(),
|
|
214
|
-
let t =
|
|
193
|
+
B.value = Date.now(), await g(), Y();
|
|
194
|
+
let t = q()[0];
|
|
215
195
|
t ? t.focus() : L.value?.focus();
|
|
216
|
-
}),
|
|
196
|
+
}), E(() => [O.notifications.length, O.loading], () => k.value && g(Y)), te(() => $(!1)), (a, p) => (v(), c("div", oe, [d(e, {
|
|
217
197
|
ref_key: "trigger",
|
|
218
198
|
ref: I,
|
|
219
199
|
label: f.label,
|
|
220
|
-
icon: w(
|
|
200
|
+
icon: w(ie),
|
|
221
201
|
"icon-only": "",
|
|
222
202
|
badge: H.value,
|
|
223
203
|
"aria-haspopup": "dialog",
|
|
224
|
-
"aria-expanded":
|
|
225
|
-
"aria-controls":
|
|
226
|
-
class: _(
|
|
204
|
+
"aria-expanded": k.value,
|
|
205
|
+
"aria-controls": k.value ? P : void 0,
|
|
206
|
+
class: _(k.value && "border-border bg-surface-sunken/50 text-heading"),
|
|
227
207
|
"data-ac-ds": "",
|
|
228
208
|
"data-testid": "ac-notification-menu-trigger",
|
|
229
|
-
onClick:
|
|
230
|
-
onKeydown:
|
|
209
|
+
onClick: Z,
|
|
210
|
+
onKeydown: Le
|
|
231
211
|
}, null, 8, [
|
|
232
212
|
"label",
|
|
233
213
|
"icon",
|
|
@@ -241,7 +221,7 @@ var pe = {
|
|
|
241
221
|
"leave-active-class": "transition duration-100 ease-in",
|
|
242
222
|
"leave-to-class": "opacity-0"
|
|
243
223
|
}, {
|
|
244
|
-
default:
|
|
224
|
+
default: D(() => [k.value ? (v(), c("div", {
|
|
245
225
|
key: 0,
|
|
246
226
|
id: P,
|
|
247
227
|
ref_key: "panel",
|
|
@@ -249,88 +229,73 @@ var pe = {
|
|
|
249
229
|
role: "dialog",
|
|
250
230
|
tabindex: "-1",
|
|
251
231
|
"aria-labelledby": F,
|
|
252
|
-
class: _(["fixed z-[90] flex w-[calc(
|
|
232
|
+
class: _(["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"]),
|
|
253
233
|
style: ee(R.value),
|
|
254
234
|
"data-ac-ds": "",
|
|
255
235
|
"data-testid": "ac-notification-menu-panel",
|
|
256
|
-
onKeydown:
|
|
236
|
+
onKeydown: Re
|
|
257
237
|
}, [
|
|
258
|
-
l("div",
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
onClick: p[0] ||= (e) => k("markAllRead")
|
|
271
|
-
}, [d(w(se), {
|
|
272
|
-
class: "size-3.5",
|
|
273
|
-
"aria-hidden": "true"
|
|
274
|
-
}), p[2] ||= u(" Mark all as read ", -1)])) : s("", !0)
|
|
275
|
-
]),
|
|
276
|
-
f.loading ? (v(), c("div", ge, [(v(), c(n, null, b(3, (e) => l("div", {
|
|
238
|
+
l("div", se, [l("h2", {
|
|
239
|
+
id: F,
|
|
240
|
+
class: "font-heading text-base font-semibold text-heading"
|
|
241
|
+
}, C(f.label), 1), ke.value || H.value ? (v(), c("button", {
|
|
242
|
+
key: 0,
|
|
243
|
+
type: "button",
|
|
244
|
+
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
|
+
"data-ac-ds": "",
|
|
246
|
+
"data-testid": "ac-notification-menu-mark-all",
|
|
247
|
+
onClick: p[0] ||= (e) => A("markAllRead")
|
|
248
|
+
}, [p[1] ||= u(" Mark all as read", -1), H.value ? (v(), c("span", ce, " (" + C(H.value) + " unread)", 1)) : s("", !0)])) : s("", !0)]),
|
|
249
|
+
f.loading ? (v(), c("div", le, [(v(), c(n, null, b(3, (e) => d(t, {
|
|
277
250
|
key: e,
|
|
278
|
-
class: "flex gap-3"
|
|
279
|
-
}, [d(t, {
|
|
280
|
-
shape: "rect",
|
|
281
|
-
width: "28px",
|
|
282
|
-
height: "28px",
|
|
283
|
-
label: "",
|
|
284
|
-
class: "shrink-0"
|
|
285
|
-
}), d(t, {
|
|
286
251
|
shape: "text",
|
|
287
|
-
lines:
|
|
252
|
+
lines: 3,
|
|
288
253
|
height: "10px",
|
|
289
|
-
label: ""
|
|
290
|
-
|
|
291
|
-
})])), 64))])) : f.notifications.length ? (v(), c("ul", be, [(v(!0), c(n, null, b(f.notifications, (e) => (v(), c("li", { key: e.id }, [(v(), o(S(G(e.to, e.href)), h({ ref_for: !0 }, K(e.to, e.href), {
|
|
254
|
+
label: ""
|
|
255
|
+
})), 64))])) : f.notifications.length ? (v(), c("ul", pe, [(v(!0), c(n, null, b(f.notifications, (e) => (v(), c("li", { key: e.id }, [(v(), o(S(W(e.to, e.href)), h({ ref_for: !0 }, G(e.to, e.href), {
|
|
292
256
|
"data-notification-item": "",
|
|
293
|
-
class: ["relative
|
|
257
|
+
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"],
|
|
294
258
|
"data-ac-ds": "",
|
|
295
259
|
"data-testid": "ac-notification-menu-item",
|
|
296
|
-
onClick: (t) =>
|
|
260
|
+
onClick: (t) => Fe(e)
|
|
297
261
|
}), {
|
|
298
|
-
default:
|
|
299
|
-
l("span",
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
key: 0,
|
|
309
|
-
class: _(["font-medium", A[U(e)].text])
|
|
310
|
-
}, C(e.status), 3)) : s("", !0),
|
|
311
|
-
e.status ? (v(), c("span", we, "·")) : s("", !0),
|
|
312
|
-
l("time", {
|
|
313
|
-
datetime: Re(e.time),
|
|
314
|
-
title: Le(e.time)
|
|
315
|
-
}, C(Ie(e.time)), 9, Te)
|
|
316
|
-
])
|
|
262
|
+
default: D(() => [x(a.$slots, "item", { item: e }, () => [
|
|
263
|
+
l("span", me, [
|
|
264
|
+
e.icon ? (v(), o(S(e.icon), {
|
|
265
|
+
key: 0,
|
|
266
|
+
class: "size-4 shrink-0 text-muted",
|
|
267
|
+
"aria-hidden": "true"
|
|
268
|
+
})) : s("", !0),
|
|
269
|
+
l("span", he, C(e.title || e.msg), 1),
|
|
270
|
+
e.read ? s("", !0) : (v(), c("span", ge)),
|
|
271
|
+
e.read ? s("", !0) : (v(), c("span", _e, "(unread)"))
|
|
317
272
|
]),
|
|
318
|
-
e.
|
|
319
|
-
|
|
273
|
+
e.title && e.msg ? (v(), c("span", ve, C(e.msg), 1)) : s("", !0),
|
|
274
|
+
l("span", ye, [
|
|
275
|
+
e.status ? (v(), c("span", {
|
|
276
|
+
key: 0,
|
|
277
|
+
class: _(["font-medium", Ee[je(e)]])
|
|
278
|
+
}, C(e.status), 3)) : s("", !0),
|
|
279
|
+
e.status ? (v(), c("span", be, "·")) : s("", !0),
|
|
280
|
+
l("time", {
|
|
281
|
+
datetime: Pe(e.time),
|
|
282
|
+
title: Ne(e.time)
|
|
283
|
+
}, C(Me(e.time)), 9, xe)
|
|
284
|
+
])
|
|
320
285
|
])]),
|
|
321
286
|
_: 2
|
|
322
|
-
}, 1040, ["class", "onClick"]))]))), 128))])) : (v(), c("div",
|
|
323
|
-
l("span",
|
|
324
|
-
l("p",
|
|
325
|
-
p[
|
|
287
|
+
}, 1040, ["class", "onClick"]))]))), 128))])) : (v(), c("div", ue, [x(a.$slots, "empty", {}, () => [
|
|
288
|
+
l("span", de, [d(w(ae), { class: "size-6" })]),
|
|
289
|
+
l("p", fe, C(f.emptyText), 1),
|
|
290
|
+
p[2] ||= l("p", { class: "max-w-64 text-base text-muted" }, "Backups, upgrades and alerts from your clusters show up here.", -1)
|
|
326
291
|
])])),
|
|
327
|
-
a.$slots.footer ||
|
|
328
|
-
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-
|
|
292
|
+
a.$slots.footer || Ae.value ? (v(), c("div", Se, [x(a.$slots, "footer", { close: X }, () => [(v(), o(S(W(f.viewAllTo, f.viewAllHref)), h(G(f.viewAllTo, f.viewAllHref), {
|
|
293
|
+
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",
|
|
329
294
|
"data-ac-ds": "",
|
|
330
295
|
"data-testid": "ac-notification-menu-view-all",
|
|
331
|
-
onClick:
|
|
296
|
+
onClick: Ie
|
|
332
297
|
}), {
|
|
333
|
-
default:
|
|
298
|
+
default: D(() => [u(C(f.viewAllLabel) + " ", 1), d(w(re), {
|
|
334
299
|
class: "size-3.5 transition-transform duration-200 group-hover/link:translate-x-0.5 motion-reduce:transition-none",
|
|
335
300
|
"aria-hidden": "true"
|
|
336
301
|
})]),
|
|
@@ -342,4 +307,4 @@ var pe = {
|
|
|
342
307
|
}
|
|
343
308
|
});
|
|
344
309
|
//#endregion
|
|
345
|
-
export {
|
|
310
|
+
export { O as default };
|
|
@@ -13,7 +13,7 @@ export interface Props {
|
|
|
13
13
|
precision?: number;
|
|
14
14
|
/** Unit shown after the value, e.g. `GiB`, `vCPU` or `%`. Also read out with the value. */
|
|
15
15
|
unit?: string;
|
|
16
|
-
/** Shows
|
|
16
|
+
/** Shows bordered − and + buttons on either side of the field. Off by default, like cloud-ui. Cloud `is-show-inc-dec`. */
|
|
17
17
|
stepButtons?: boolean;
|
|
18
18
|
/** Milliseconds a − / + press is held before it starts repeating. */
|
|
19
19
|
holdDelay?: number;
|
|
@@ -29,7 +29,7 @@ export interface Props {
|
|
|
29
29
|
errorMsg?: string;
|
|
30
30
|
/** Help text between the label and the field. */
|
|
31
31
|
hint?: string;
|
|
32
|
-
/** `small` 36px or `normal`
|
|
32
|
+
/** `small` 36px or `normal` 42px tall, the same as `AcInput`; the step buttons match. */
|
|
33
33
|
size?: "small" | "normal";
|
|
34
34
|
}
|
|
35
35
|
type __VLS_Props = Props;
|