@ac-design/design-system 0.0.0-stage → 1.0.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/README.md +160 -2
- package/dist/lib/compat.css +4441 -0
- package/dist/lib/components/AcAccordion.js +5 -0
- package/dist/lib/components/AcAccordion.vue.d.ts +35 -0
- package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +61 -0
- package/dist/lib/components/AcAccordionItem.js +5 -0
- package/dist/lib/components/AcAccordionItem.vue.d.ts +49 -0
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/lib/components/AcAlert.js +5 -0
- package/dist/lib/components/AcAlert.vue.d.ts +52 -0
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -0
- package/dist/lib/components/AcAppSwitcher.js +5 -0
- package/dist/lib/components/AcAppSwitcher.vue.d.ts +83 -0
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +303 -0
- package/dist/lib/components/AcAvatar.js +5 -0
- package/dist/lib/components/AcAvatar.vue.d.ts +27 -0
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +116 -0
- package/dist/lib/components/AcBadge.js +5 -0
- package/dist/lib/components/AcBadge.vue.d.ts +32 -0
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcBanner.js +5 -0
- package/dist/lib/components/AcBanner.vue.d.ts +57 -0
- package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +114 -0
- package/dist/lib/components/AcBreadcrumb.js +5 -0
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +25 -0
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcButton.js +5 -0
- package/dist/lib/components/AcButton.vue.d.ts +49 -0
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/lib/components/AcButtons.js +5 -0
- package/dist/lib/components/AcButtons.vue.d.ts +31 -0
- package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +44 -0
- package/dist/lib/components/AcCard.js +5 -0
- package/dist/lib/components/AcCard.vue.d.ts +27 -0
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +28 -0
- package/dist/lib/components/AcCellValue.js +5 -0
- package/dist/lib/components/AcCellValue.vue.d.ts +139 -0
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +386 -0
- package/dist/lib/components/AcCheckBox.js +5 -0
- package/dist/lib/components/AcCheckBox.vue.d.ts +31 -0
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +49 -0
- package/dist/lib/components/AcCheckRadio.js +5 -0
- package/dist/lib/components/AcCheckRadio.vue.d.ts +35 -0
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +56 -0
- package/dist/lib/components/AcClusterSwitcher.js +5 -0
- package/dist/lib/components/AcClusterSwitcher.vue.d.ts +95 -0
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +416 -0
- package/dist/lib/components/AcCodeEditor.js +5 -0
- package/dist/lib/components/AcCodeEditor.vue.d.ts +88 -0
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +381 -0
- package/dist/lib/components/AcContentHeader.js +5 -0
- package/dist/lib/components/AcContentHeader.vue.d.ts +29 -0
- package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +31 -0
- package/dist/lib/components/AcContentLayout.js +5 -0
- package/dist/lib/components/AcContentLayout.vue.d.ts +21 -0
- package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +18 -0
- package/dist/lib/components/AcContentTable.js +5 -0
- package/dist/lib/components/AcContentTable.vue.d.ts +54 -0
- package/dist/lib/components/AcContentTable.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcDatePicker.js +5 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +88 -0
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +794 -0
- package/dist/lib/components/AcDeleteModal.js +5 -0
- package/dist/lib/components/AcDeleteModal.vue.d.ts +51 -0
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +110 -0
- package/dist/lib/components/AcDivider.js +5 -0
- package/dist/lib/components/AcDivider.vue.d.ts +25 -0
- package/dist/lib/components/AcDivider.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/lib/components/AcDropdown.js +5 -0
- package/dist/lib/components/AcDropdown.vue.d.ts +45 -0
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +152 -0
- package/dist/lib/components/AcDropdownDivider.js +5 -0
- package/dist/lib/components/AcDropdownDivider.vue.d.ts +9 -0
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +20 -0
- package/dist/lib/components/AcDropdownItem.js +5 -0
- package/dist/lib/components/AcDropdownItem.vue.d.ts +50 -0
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/lib/components/AcEmptyState.js +5 -0
- package/dist/lib/components/AcEmptyState.vue.d.ts +42 -0
- package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +81 -0
- package/dist/lib/components/AcFeatureCard.js +5 -0
- package/dist/lib/components/AcFeatureCard.vue.d.ts +84 -0
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +218 -0
- package/dist/lib/components/AcFileEditor.js +5 -0
- package/dist/lib/components/AcFileEditor.vue.d.ts +95 -0
- package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +556 -0
- package/dist/lib/components/AcFileUpload.js +5 -0
- package/dist/lib/components/AcFileUpload.vue.d.ts +67 -0
- package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +274 -0
- package/dist/lib/components/AcFontScale.js +5 -0
- package/dist/lib/components/AcFontScale.vue.d.ts +17 -0
- package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/lib/components/AcForm.js +5 -0
- package/dist/lib/components/AcForm.vue.d.ts +31 -0
- package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/lib/components/AcFormArray.js +5 -0
- package/dist/lib/components/AcFormArray.vue.d.ts +124 -0
- package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +485 -0
- package/dist/lib/components/AcFormFooter.js +5 -0
- package/dist/lib/components/AcFormFooter.vue.d.ts +48 -0
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +86 -0
- package/dist/lib/components/AcFormSection.js +5 -0
- package/dist/lib/components/AcFormSection.vue.d.ts +32 -0
- package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +38 -0
- package/dist/lib/components/AcHeader.js +5 -0
- package/dist/lib/components/AcHeader.vue.d.ts +46 -0
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcHeaderItem.js +5 -0
- package/dist/lib/components/AcHeaderItem.vue.d.ts +13 -0
- package/dist/lib/components/AcHeaderItem.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/lib/components/AcHeaderItems.js +5 -0
- package/dist/lib/components/AcHeaderItems.vue.d.ts +13 -0
- package/dist/lib/components/AcHeaderItems.vue_vue_type_script_setup_true_lang.js +14 -0
- package/dist/lib/components/AcInfoTable.js +5 -0
- package/dist/lib/components/AcInfoTable.vue.d.ts +59 -0
- package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +127 -0
- package/dist/lib/components/AcInput.js +5 -0
- package/dist/lib/components/AcInput.vue.d.ts +68 -0
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +143 -0
- package/dist/lib/components/AcKbd.js +5 -0
- package/dist/lib/components/AcKbd.vue.d.ts +25 -0
- package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +134 -0
- package/dist/lib/components/AcLogo.js +5 -0
- package/dist/lib/components/AcLogo.vue.d.ts +18 -0
- package/dist/lib/components/AcLogo.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcModal.js +5 -0
- package/dist/lib/components/AcModal.vue.d.ts +54 -0
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +125 -0
- package/dist/lib/components/AcNavbar.js +5 -0
- package/dist/lib/components/AcNavbar.vue.d.ts +41 -0
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcNavbarItem.js +5 -0
- package/dist/lib/components/AcNavbarItem.vue.d.ts +44 -0
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +65 -0
- package/dist/lib/components/AcNotificationMenu.js +5 -0
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +90 -0
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +345 -0
- package/dist/lib/components/AcPage.js +5 -0
- package/dist/lib/components/AcPage.vue.d.ts +25 -0
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +36 -0
- package/dist/lib/components/AcPagination.js +5 -0
- package/dist/lib/components/AcPagination.vue.d.ts +51 -0
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +160 -0
- package/dist/lib/components/AcPreloader.js +5 -0
- package/dist/lib/components/AcPreloader.vue.d.ts +28 -0
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +39 -0
- package/dist/lib/components/AcProgress.js +5 -0
- package/dist/lib/components/AcProgress.vue.d.ts +31 -0
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/lib/components/AcResourceCard.js +5 -0
- package/dist/lib/components/AcResourceCard.vue.d.ts +106 -0
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +203 -0
- package/dist/lib/components/AcSearchBar.js +5 -0
- package/dist/lib/components/AcSearchBar.vue.d.ts +41 -0
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/lib/components/AcSectionContent.js +5 -0
- package/dist/lib/components/AcSectionContent.vue.d.ts +55 -0
- package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/lib/components/AcSegmentedControl.js +5 -0
- package/dist/lib/components/AcSegmentedControl.vue.d.ts +46 -0
- package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +104 -0
- package/dist/lib/components/AcSelect.js +5 -0
- package/dist/lib/components/AcSelect.vue.d.ts +78 -0
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +441 -0
- package/dist/lib/components/AcSidePanel.js +5 -0
- package/dist/lib/components/AcSidePanel.vue.d.ts +57 -0
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +128 -0
- package/dist/lib/components/AcSideTabs.js +5 -0
- package/dist/lib/components/AcSideTabs.vue.d.ts +93 -0
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +373 -0
- package/dist/lib/components/AcSidebar.js +5 -0
- package/dist/lib/components/AcSidebar.vue.d.ts +63 -0
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +221 -0
- package/dist/lib/components/AcSidebarItem.js +5 -0
- package/dist/lib/components/AcSidebarItem.vue.d.ts +55 -0
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +155 -0
- package/dist/lib/components/AcSidebarSection.js +5 -0
- package/dist/lib/components/AcSidebarSection.vue.d.ts +32 -0
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +48 -0
- package/dist/lib/components/AcSkeleton.js +5 -0
- package/dist/lib/components/AcSkeleton.vue.d.ts +27 -0
- package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +142 -0
- package/dist/lib/components/AcSlider.js +5 -0
- package/dist/lib/components/AcSlider.vue.d.ts +72 -0
- package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +327 -0
- package/dist/lib/components/AcSpinner.js +5 -0
- package/dist/lib/components/AcSpinner.vue.d.ts +12 -0
- package/dist/lib/components/AcSpinner.vue_vue_type_script_setup_true_lang.js +45 -0
- package/dist/lib/components/AcStatCard.js +5 -0
- package/dist/lib/components/AcStatCard.vue.d.ts +84 -0
- package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +225 -0
- package/dist/lib/components/AcStatusBar.js +5 -0
- package/dist/lib/components/AcStatusBar.vue.d.ts +66 -0
- package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +145 -0
- package/dist/lib/components/AcSteps.js +5 -0
- package/dist/lib/components/AcSteps.vue.d.ts +28 -0
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +91 -0
- package/dist/lib/components/AcSwitch.js +5 -0
- package/dist/lib/components/AcSwitch.vue.d.ts +44 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +67 -0
- package/dist/lib/components/AcTable.js +5 -0
- package/dist/lib/components/AcTable.vue.d.ts +98 -0
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +272 -0
- package/dist/lib/components/AcTabs.js +5 -0
- package/dist/lib/components/AcTabs.vue.d.ts +40 -0
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +72 -0
- package/dist/lib/components/AcTag.js +5 -0
- package/dist/lib/components/AcTag.vue.d.ts +41 -0
- package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +99 -0
- package/dist/lib/components/AcTextarea.js +5 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +53 -0
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +120 -0
- package/dist/lib/components/AcThemeMode.js +5 -0
- package/dist/lib/components/AcThemeMode.vue.d.ts +17 -0
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +60 -0
- package/dist/lib/components/AcToaster.js +5 -0
- package/dist/lib/components/AcToaster.vue.d.ts +15 -0
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +166 -0
- package/dist/lib/components/AcTooltip.js +5 -0
- package/dist/lib/components/AcTooltip.vue.d.ts +30 -0
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +117 -0
- package/dist/lib/components/AcUsageCard.js +5 -0
- package/dist/lib/components/AcUsageCard.vue.d.ts +85 -0
- package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +230 -0
- package/dist/lib/components/AcUserMenu.js +5 -0
- package/dist/lib/components/AcUserMenu.vue.d.ts +77 -0
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +258 -0
- package/dist/lib/components/index.d.ts +76 -0
- package/dist/lib/components/types.d.ts +16 -0
- package/dist/lib/composables/copyText.d.ts +6 -0
- package/dist/lib/composables/copyText.js +16 -0
- package/dist/lib/composables/useBrandColor.d.ts +53 -0
- package/dist/lib/composables/useBrandColor.js +148 -0
- package/dist/lib/composables/useColorMode.d.ts +12 -0
- package/dist/lib/composables/useColorMode.js +40 -0
- package/dist/lib/composables/useFontScale.d.ts +16 -0
- package/dist/lib/composables/useFontScale.js +43 -0
- package/dist/lib/composables/useToast.d.ts +68 -0
- package/dist/lib/composables/useToast.js +36 -0
- package/dist/lib/editor/index.d.ts +4 -0
- package/dist/lib/editor/index.js +3 -0
- package/dist/lib/editor/theme.d.ts +3 -0
- package/dist/lib/editor/theme.js +309 -0
- package/dist/lib/editor/validate.d.ts +19 -0
- package/dist/lib/editor/validate.js +127 -0
- package/dist/lib/index.d.ts +29 -0
- package/dist/lib/index.js +78 -0
- package/dist/lib/theme.css +556 -0
- package/package.json +82 -4
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { Teleport as e, Transition as t, computed as n, createBlock as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, nextTick as l, normalizeStyle as u, onBeforeUnmount as d, onMounted as f, onUpdated as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, useId as v, useSlots as y, vShow as b, watch as x, withCtx as S, withDirectives as C } from "vue";
|
|
2
|
+
//#region src/lib/components/AcTooltip.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var w = ["data-side"], T = 6, E = 8, D = /*@__PURE__*/ c({
|
|
4
|
+
__name: "AcTooltip",
|
|
5
|
+
props: {
|
|
6
|
+
content: { default: "" },
|
|
7
|
+
placement: { default: "top" },
|
|
8
|
+
delay: { default: 300 },
|
|
9
|
+
disabled: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: !1
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
setup(c) {
|
|
15
|
+
let D = c, O = y(), k = {
|
|
16
|
+
top: "bottom",
|
|
17
|
+
bottom: "top",
|
|
18
|
+
left: "right",
|
|
19
|
+
right: "left"
|
|
20
|
+
}, A = `${v()}-tip`, j = h(null), M = h(null), N = h(!1), P = h(D.placement), F = h({
|
|
21
|
+
top: 0,
|
|
22
|
+
left: 0
|
|
23
|
+
}), I, L, R = null, z = n(() => !D.disabled && !!(D.content || O.content));
|
|
24
|
+
function B() {
|
|
25
|
+
let e = j.value;
|
|
26
|
+
return e?.querySelector("button, a[href], input, select, textarea, [tabindex]") ?? e?.firstElementChild ?? null;
|
|
27
|
+
}
|
|
28
|
+
function V() {
|
|
29
|
+
let e = B();
|
|
30
|
+
if (R && R !== e && H(R), R = e, !e) return;
|
|
31
|
+
let t = (e.getAttribute("aria-describedby") ?? "").split(" ").filter((e) => e && e !== A);
|
|
32
|
+
z.value && t.push(A), t.length ? e.setAttribute("aria-describedby", t.join(" ")) : e.removeAttribute("aria-describedby");
|
|
33
|
+
}
|
|
34
|
+
function H(e) {
|
|
35
|
+
let t = (e.getAttribute("aria-describedby") ?? "").split(" ").filter((e) => e && e !== A);
|
|
36
|
+
t.length ? e.setAttribute("aria-describedby", t.join(" ")) : e.removeAttribute("aria-describedby");
|
|
37
|
+
}
|
|
38
|
+
function U(e) {
|
|
39
|
+
clearTimeout(L), z.value && !N.value && (clearTimeout(I), I = setTimeout(async () => {
|
|
40
|
+
N.value = !0, await l(), K();
|
|
41
|
+
}, e));
|
|
42
|
+
}
|
|
43
|
+
function W(e = 0) {
|
|
44
|
+
clearTimeout(I), clearTimeout(L), e ? L = setTimeout(() => N.value = !1, e) : N.value = !1;
|
|
45
|
+
}
|
|
46
|
+
function G(e, t, n, r) {
|
|
47
|
+
return e === "top" ? t.top - T - r >= E : e === "bottom" ? t.bottom + T + r <= window.innerHeight - E : e === "left" ? t.left - T - n >= E : t.right + T + n <= window.innerWidth - E;
|
|
48
|
+
}
|
|
49
|
+
function K() {
|
|
50
|
+
let e = B() ?? j.value;
|
|
51
|
+
if (!e || !M.value) return;
|
|
52
|
+
let t = e.getBoundingClientRect(), { offsetWidth: n, offsetHeight: r } = M.value, i = D.placement, a = G(i, t, n, r) || !G(k[i], t, n, r) ? i : k[i], o = (e, t) => Math.max(E, Math.min(e, t - E));
|
|
53
|
+
P.value = a, F.value = a === "top" || a === "bottom" ? {
|
|
54
|
+
top: a === "top" ? t.top - T - r : t.bottom + T,
|
|
55
|
+
left: o(t.left + t.width / 2 - n / 2, window.innerWidth - n)
|
|
56
|
+
} : {
|
|
57
|
+
top: o(t.top + t.height / 2 - r / 2, window.innerHeight - r),
|
|
58
|
+
left: a === "left" ? t.left - T - n : t.right + T
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function q(e) {
|
|
62
|
+
e.pointerType !== "touch" && U(D.delay);
|
|
63
|
+
}
|
|
64
|
+
function J(e) {
|
|
65
|
+
e.target.matches(":focus-visible") && U(0);
|
|
66
|
+
}
|
|
67
|
+
function Y() {
|
|
68
|
+
W();
|
|
69
|
+
}
|
|
70
|
+
function X(e) {
|
|
71
|
+
e.key === "Escape" && N.value && W();
|
|
72
|
+
}
|
|
73
|
+
return x(N, (e) => {
|
|
74
|
+
e ? (document.addEventListener("keydown", X), window.addEventListener("scroll", Y, !0)) : (document.removeEventListener("keydown", X), window.removeEventListener("scroll", Y, !0));
|
|
75
|
+
}), x(z, (e) => {
|
|
76
|
+
V(), e || W();
|
|
77
|
+
}), f(V), p(V), d(() => {
|
|
78
|
+
W(), document.removeEventListener("keydown", X), window.removeEventListener("scroll", Y, !0), R && H(R);
|
|
79
|
+
}), (n, l) => (m(), i("span", {
|
|
80
|
+
ref_key: "root",
|
|
81
|
+
ref: j,
|
|
82
|
+
class: "inline-flex max-w-full",
|
|
83
|
+
"data-ac-ds": "",
|
|
84
|
+
"data-testid": "ac-tooltip",
|
|
85
|
+
onPointerenter: q,
|
|
86
|
+
onPointerleave: l[2] ||= (e) => W(100),
|
|
87
|
+
onPointerdown: l[3] ||= (e) => W(),
|
|
88
|
+
onFocusin: J,
|
|
89
|
+
onFocusout: l[4] ||= (e) => W()
|
|
90
|
+
}, [g(n.$slots, "default"), (m(), r(e, { to: "body" }, [s(t, {
|
|
91
|
+
"enter-active-class": "transition-opacity duration-100 ease-out",
|
|
92
|
+
"enter-from-class": "opacity-0",
|
|
93
|
+
"leave-active-class": "transition-opacity duration-75 ease-in",
|
|
94
|
+
"leave-to-class": "opacity-0"
|
|
95
|
+
}, {
|
|
96
|
+
default: S(() => [C(a("div", {
|
|
97
|
+
id: A,
|
|
98
|
+
ref_key: "tip",
|
|
99
|
+
ref: M,
|
|
100
|
+
role: "tooltip",
|
|
101
|
+
class: "fixed z-[100] w-max max-w-64 rounded-6 bg-slate-10 px-2 py-1 text-xs font-medium text-slate-95 shadow-md dark:bg-slate-80 dark:text-slate-10 dark:ring-1 dark:ring-slate-70",
|
|
102
|
+
"data-side": P.value,
|
|
103
|
+
style: u({
|
|
104
|
+
top: `${F.value.top}px`,
|
|
105
|
+
left: `${F.value.left}px`
|
|
106
|
+
}),
|
|
107
|
+
"data-ac-ds": "",
|
|
108
|
+
"data-testid": "ac-tooltip-panel",
|
|
109
|
+
onPointerenter: l[0] ||= (e) => U(0),
|
|
110
|
+
onPointerleave: l[1] ||= (e) => W(100)
|
|
111
|
+
}, [g(n.$slots, "content", {}, () => [o(_(c.content), 1)])], 44, w), [[b, N.value]])]),
|
|
112
|
+
_: 3
|
|
113
|
+
})]))], 544));
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
//#endregion
|
|
117
|
+
export { D as default };
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
export interface UsageBreakdownRow {
|
|
3
|
+
/** Row name, e.g. a namespace, database or "CPU (core-month)". */
|
|
4
|
+
label: string;
|
|
5
|
+
/** A Lucide icon before the label. */
|
|
6
|
+
icon?: Component;
|
|
7
|
+
/** One value per column after the label. Numbers are formatted with `format`. */
|
|
8
|
+
values: (string | number)[];
|
|
9
|
+
}
|
|
10
|
+
export interface Props {
|
|
11
|
+
/** What is measured, e.g. "Storage", "CPU" or "Billable usage". Also the meter's accessible name. */
|
|
12
|
+
title: string;
|
|
13
|
+
/** A muted line under the title, e.g. "Across 6 databases in demo". */
|
|
14
|
+
description?: string;
|
|
15
|
+
/** The period the numbers cover, shown at the top right, e.g. "Sep 2026" or "This billing cycle". */
|
|
16
|
+
period?: string;
|
|
17
|
+
/** A Lucide icon shown in a tinted tile before the title. Or use the `icon` slot. */
|
|
18
|
+
icon?: Component;
|
|
19
|
+
/** Amount used, in `unit`. Leave unset for a card that only shows a breakdown. */
|
|
20
|
+
used?: number;
|
|
21
|
+
/** The quota or limit, in `unit`. Without it there's no meter and the card reads "No limit". */
|
|
22
|
+
limit?: number;
|
|
23
|
+
/** Unit after the numbers, e.g. "GiB", "cores" or "databases". */
|
|
24
|
+
unit?: string;
|
|
25
|
+
/** Formats every number on the card. Defaults to the browser locale with up to 2 decimals. */
|
|
26
|
+
format?: (value: number) => string;
|
|
27
|
+
/** Percentage of the limit where the meter turns warning and a "Near limit" badge appears. */
|
|
28
|
+
warningAt?: number;
|
|
29
|
+
/** Percentage of the limit where the meter turns danger and an "At limit" badge appears. */
|
|
30
|
+
dangerAt?: number;
|
|
31
|
+
/** Marks `warningAt` and `dangerAt` on the meter. */
|
|
32
|
+
showThresholds?: boolean;
|
|
33
|
+
/** Rows of a breakdown table under the meter: `{ label, icon?, values }`. Old UsageTableCard `tbody`. */
|
|
34
|
+
breakdown?: UsageBreakdownRow[];
|
|
35
|
+
/** Column headings of the breakdown, starting with the label column. Old UsageTableCard `thead`. */
|
|
36
|
+
breakdownHeaders?: string[];
|
|
37
|
+
/** Shows placeholder bars instead of the numbers while they load. Old `isLoaderActive`. */
|
|
38
|
+
loading?: boolean;
|
|
39
|
+
/** Makes the card a `RouterLink` to this route. Needs vue-router in the app; without it a string is used as `href`. */
|
|
40
|
+
to?: string | Record<string, unknown>;
|
|
41
|
+
/** Makes the card a plain link. */
|
|
42
|
+
href?: string;
|
|
43
|
+
/** Link target for `href`, e.g. `_blank`. */
|
|
44
|
+
target?: string;
|
|
45
|
+
}
|
|
46
|
+
type __VLS_Slots = {
|
|
47
|
+
/** Replaces the `icon` tile. */
|
|
48
|
+
icon?: () => unknown;
|
|
49
|
+
/** Buttons at the top right, e.g. "Upgrade plan". */
|
|
50
|
+
actions?: () => unknown;
|
|
51
|
+
/** Extra content between the meter and the breakdown. */
|
|
52
|
+
default?: () => unknown;
|
|
53
|
+
/** A row at the bottom, e.g. "Resets on Oct 1". */
|
|
54
|
+
footer?: () => unknown;
|
|
55
|
+
};
|
|
56
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
57
|
+
click: (e: MouseEvent) => any;
|
|
58
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
59
|
+
onClick?: ((e: MouseEvent) => any) | undefined;
|
|
60
|
+
}>, {
|
|
61
|
+
description: string;
|
|
62
|
+
icon: Component;
|
|
63
|
+
target: string;
|
|
64
|
+
format: (value: number) => string;
|
|
65
|
+
href: string;
|
|
66
|
+
to: string | Record<string, unknown>;
|
|
67
|
+
loading: boolean;
|
|
68
|
+
unit: string;
|
|
69
|
+
period: string;
|
|
70
|
+
used: number;
|
|
71
|
+
limit: number;
|
|
72
|
+
warningAt: number;
|
|
73
|
+
dangerAt: number;
|
|
74
|
+
showThresholds: boolean;
|
|
75
|
+
breakdown: UsageBreakdownRow[];
|
|
76
|
+
breakdownHeaders: string[];
|
|
77
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
78
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
79
|
+
declare const _default: typeof __VLS_export;
|
|
80
|
+
export default _default;
|
|
81
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
82
|
+
new (): {
|
|
83
|
+
$slots: S;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import e from "./AcBadge.js";
|
|
2
|
+
import { Fragment as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createTextVNode as s, defineComponent as c, getCurrentInstance as l, mergeProps as u, normalizeClass as d, normalizeStyle as f, openBlock as p, renderList as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, unref as v, useId as ee, useSlots as te, withCtx as ne } from "vue";
|
|
3
|
+
//#region src/lib/components/AcUsageCard.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col gap-4 p-4" }, ae = { class: "flex min-w-0 items-start gap-3" }, oe = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "inline-flex size-8 shrink-0 items-center justify-center rounded-8 bg-primary-95 text-primary-30 [&_svg]:size-4",
|
|
7
|
+
"aria-hidden": "true"
|
|
8
|
+
}, se = { class: "min-w-0 flex-1" }, ce = ["id"], y = ["title"], b = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "relative z-10 flex shrink-0 flex-wrap items-center justify-end gap-2"
|
|
11
|
+
}, x = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "text-xs text-muted"
|
|
14
|
+
}, S = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "flex min-w-0 flex-col gap-2"
|
|
17
|
+
}, C = { class: "flex min-w-0 flex-wrap items-baseline justify-between gap-x-3 gap-y-1" }, w = { class: "flex min-w-0 flex-wrap items-baseline gap-x-1.5" }, le = { class: "text-3xl font-semibold text-heading" }, ue = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "text-base text-muted"
|
|
20
|
+
}, T = {
|
|
21
|
+
key: 1,
|
|
22
|
+
class: "text-base text-muted"
|
|
23
|
+
}, E = [
|
|
24
|
+
"aria-labelledby",
|
|
25
|
+
"aria-valuemax",
|
|
26
|
+
"aria-valuenow",
|
|
27
|
+
"aria-valuetext"
|
|
28
|
+
], D = {
|
|
29
|
+
key: 1,
|
|
30
|
+
class: "text-base text-body"
|
|
31
|
+
}, O = {
|
|
32
|
+
key: 0,
|
|
33
|
+
class: "ac-scrollbar border-t border-border-light"
|
|
34
|
+
}, k = { class: "w-full text-left text-base" }, A = {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: "text-xs text-muted"
|
|
37
|
+
}, j = {
|
|
38
|
+
scope: "row",
|
|
39
|
+
class: "px-4 py-2.5 font-normal text-body"
|
|
40
|
+
}, M = { class: "flex min-w-0 items-center gap-2" }, N = { class: "truncate" }, P = {
|
|
41
|
+
key: 0,
|
|
42
|
+
class: "ac-skeleton-bone ml-auto block h-3 w-14 rounded-4"
|
|
43
|
+
}, F = {
|
|
44
|
+
key: 1,
|
|
45
|
+
class: "relative z-10 mt-auto flex min-w-0 flex-wrap items-center justify-between gap-x-3 gap-y-1.5 border-t border-border-light px-4 py-3 text-xs text-muted"
|
|
46
|
+
}, I = /*@__PURE__*/ c({
|
|
47
|
+
__name: "AcUsageCard",
|
|
48
|
+
props: {
|
|
49
|
+
title: {},
|
|
50
|
+
description: { default: "" },
|
|
51
|
+
period: { default: "" },
|
|
52
|
+
icon: { default: void 0 },
|
|
53
|
+
used: { default: void 0 },
|
|
54
|
+
limit: { default: void 0 },
|
|
55
|
+
unit: { default: "" },
|
|
56
|
+
format: {
|
|
57
|
+
type: Function,
|
|
58
|
+
default: void 0
|
|
59
|
+
},
|
|
60
|
+
warningAt: { default: 80 },
|
|
61
|
+
dangerAt: { default: 95 },
|
|
62
|
+
showThresholds: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: !0
|
|
65
|
+
},
|
|
66
|
+
breakdown: { default: () => [] },
|
|
67
|
+
breakdownHeaders: { default: () => [] },
|
|
68
|
+
loading: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: !1
|
|
71
|
+
},
|
|
72
|
+
to: { default: void 0 },
|
|
73
|
+
href: { default: void 0 },
|
|
74
|
+
target: { default: void 0 }
|
|
75
|
+
},
|
|
76
|
+
emits: ["click"],
|
|
77
|
+
setup(c, { emit: I }) {
|
|
78
|
+
let L = c, R = I, z = te(), de = {
|
|
79
|
+
ok: {
|
|
80
|
+
fill: "bg-primary",
|
|
81
|
+
track: "bg-primary-93",
|
|
82
|
+
text: "text-muted",
|
|
83
|
+
badge: ""
|
|
84
|
+
},
|
|
85
|
+
warning: {
|
|
86
|
+
fill: "bg-warning",
|
|
87
|
+
track: "bg-yellow-93",
|
|
88
|
+
text: "text-yellow-20",
|
|
89
|
+
badge: "Near limit"
|
|
90
|
+
},
|
|
91
|
+
danger: {
|
|
92
|
+
fill: "bg-danger",
|
|
93
|
+
track: "bg-red-93",
|
|
94
|
+
text: "text-red-30",
|
|
95
|
+
badge: "At limit"
|
|
96
|
+
},
|
|
97
|
+
over: {
|
|
98
|
+
fill: "bg-danger",
|
|
99
|
+
track: "bg-red-93",
|
|
100
|
+
text: "text-red-30",
|
|
101
|
+
badge: "Over limit"
|
|
102
|
+
}
|
|
103
|
+
}, B = new Intl.NumberFormat(void 0, { maximumFractionDigits: 2 }), V = l(), H = V?.appContext.components.RouterLink, U = ee(), W = n(() => typeof L.used == "number" && Number.isFinite(L.used)), G = n(() => W.value && typeof L.limit == "number" && L.limit > 0), K = n(() => G.value ? L.used / L.limit * 100 : 0), q = n(() => G.value ? L.used > L.limit ? "over" : K.value >= L.dangerAt ? "danger" : K.value >= L.warningAt ? "warning" : "ok" : "ok"), J = n(() => de[q.value]), fe = n(() => L.showThresholds ? [L.warningAt, L.dangerAt].filter((e) => e > 0 && e < 100) : []), Y = n(() => {
|
|
104
|
+
if (!G.value) return "";
|
|
105
|
+
let e = L.limit - L.used;
|
|
106
|
+
return e >= 0 ? `${Q(e)} left` : `${Q(-e)} over the limit`;
|
|
107
|
+
}), pe = n(() => {
|
|
108
|
+
let e = `${Q(L.used ?? 0)} of ${Q(L.limit ?? 0)}, ${Math.round(K.value)}%`;
|
|
109
|
+
return J.value.badge ? `${e}, ${J.value.badge.toLowerCase()}` : e;
|
|
110
|
+
}), X = n(() => {
|
|
111
|
+
if (L.to !== void 0 && H) return {
|
|
112
|
+
is: H,
|
|
113
|
+
to: L.to
|
|
114
|
+
};
|
|
115
|
+
let e = L.href ?? (typeof L.to == "string" ? L.to : void 0);
|
|
116
|
+
return e ? {
|
|
117
|
+
is: "a",
|
|
118
|
+
href: e,
|
|
119
|
+
target: L.target,
|
|
120
|
+
rel: L.target === "_blank" ? "noopener noreferrer" : void 0
|
|
121
|
+
} : null;
|
|
122
|
+
});
|
|
123
|
+
function Z(e) {
|
|
124
|
+
return typeof e == "number" ? L.format ? L.format(e) : B.format(e) : e;
|
|
125
|
+
}
|
|
126
|
+
function Q(e) {
|
|
127
|
+
return L.unit ? `${Z(e)} ${L.unit}` : String(Z(e));
|
|
128
|
+
}
|
|
129
|
+
function $() {
|
|
130
|
+
return !X.value && !!V?.vnode.props?.onClick;
|
|
131
|
+
}
|
|
132
|
+
function me(e) {
|
|
133
|
+
R("click", e);
|
|
134
|
+
}
|
|
135
|
+
return (n, l) => (p(), a("section", {
|
|
136
|
+
class: d(["relative flex min-w-0 flex-col rounded-10 border border-border bg-surface shadow-xs transition-[border-color,box-shadow] duration-150 has-[[data-ac-card-link]:focus-visible]:ring-[3px] has-[[data-ac-card-link]:focus-visible]:ring-ring", (X.value || $()) && "hover:border-border-dark hover:shadow-sm"]),
|
|
137
|
+
"aria-labelledby": `${v(U)}-title`,
|
|
138
|
+
"aria-busy": c.loading || void 0,
|
|
139
|
+
"data-ac-ds": "",
|
|
140
|
+
"data-testid": "ac-usage-card"
|
|
141
|
+
}, [
|
|
142
|
+
o("div", ie, [
|
|
143
|
+
o("header", ae, [
|
|
144
|
+
z.icon || c.icon ? (p(), a("span", oe, [h(n.$slots, "icon", {}, () => [(p(), r(g(c.icon)))])])) : i("", !0),
|
|
145
|
+
o("div", se, [o("h3", {
|
|
146
|
+
id: `${v(U)}-title`,
|
|
147
|
+
class: "truncate text-lg leading-6 font-semibold tracking-[-0.01em] text-heading"
|
|
148
|
+
}, [X.value || $() ? (p(), r(g(X.value ? X.value.is : "button"), u({ key: 0 }, X.value ? {
|
|
149
|
+
...X.value,
|
|
150
|
+
is: void 0
|
|
151
|
+
} : { type: "button" }, {
|
|
152
|
+
"data-ac-card-link": "",
|
|
153
|
+
class: "cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-10",
|
|
154
|
+
onClick: me
|
|
155
|
+
}), {
|
|
156
|
+
default: ne(() => [s(_(c.title), 1)]),
|
|
157
|
+
_: 1
|
|
158
|
+
}, 16)) : (p(), a(t, { key: 1 }, [s(_(c.title), 1)], 64))], 8, ce), c.description ? (p(), a("p", {
|
|
159
|
+
key: 0,
|
|
160
|
+
class: "truncate text-xs text-muted",
|
|
161
|
+
title: c.description
|
|
162
|
+
}, _(c.description), 9, y)) : i("", !0)]),
|
|
163
|
+
c.period || J.value.badge || z.actions ? (p(), a("div", b, [
|
|
164
|
+
c.period ? (p(), a("span", x, _(c.period), 1)) : i("", !0),
|
|
165
|
+
J.value.badge && !c.loading ? (p(), r(e, {
|
|
166
|
+
key: 1,
|
|
167
|
+
label: J.value.badge,
|
|
168
|
+
color: q.value === "warning" ? "warning" : "danger",
|
|
169
|
+
variant: "light",
|
|
170
|
+
rounded: "",
|
|
171
|
+
dot: ""
|
|
172
|
+
}, null, 8, ["label", "color"])) : i("", !0),
|
|
173
|
+
h(n.$slots, "actions")
|
|
174
|
+
])) : i("", !0)
|
|
175
|
+
]),
|
|
176
|
+
W.value || c.loading && c.breakdown.length === 0 ? (p(), a("div", S, [c.loading ? (p(), a(t, { key: 0 }, [l[0] ||= o("span", { class: "ac-skeleton-bone block h-6 w-2/5 rounded-4" }, null, -1), l[1] ||= o("span", { class: "ac-skeleton-bone block h-2 w-full rounded-full" }, null, -1)], 64)) : (p(), a(t, { key: 1 }, [
|
|
177
|
+
o("div", C, [o("p", w, [o("span", le, _(Z(c.used)), 1), G.value ? (p(), a("span", ue, "of " + _(Q(c.limit)), 1)) : (p(), a("span", T, [
|
|
178
|
+
s(_(c.unit), 1),
|
|
179
|
+
c.unit ? (p(), a(t, { key: 0 }, [s(" · ")], 64)) : i("", !0),
|
|
180
|
+
l[2] ||= s("No limit", -1)
|
|
181
|
+
]))]), G.value ? (p(), a("span", {
|
|
182
|
+
key: 0,
|
|
183
|
+
class: d(["text-base font-medium tabular-nums", q.value === "ok" ? "text-heading" : J.value.text])
|
|
184
|
+
}, _(Math.round(K.value)) + "% ", 3)) : i("", !0)]),
|
|
185
|
+
G.value ? (p(), a("div", {
|
|
186
|
+
key: 0,
|
|
187
|
+
role: "meter",
|
|
188
|
+
"aria-labelledby": `${v(U)}-title`,
|
|
189
|
+
"aria-valuemin": "0",
|
|
190
|
+
"aria-valuemax": c.limit,
|
|
191
|
+
"aria-valuenow": Math.min(c.used, c.limit),
|
|
192
|
+
"aria-valuetext": pe.value,
|
|
193
|
+
class: d(["relative h-2 w-full overflow-hidden rounded-full", J.value.track])
|
|
194
|
+
}, [o("div", {
|
|
195
|
+
class: d(["h-full rounded-full transition-[width,background-color] duration-300 ease-out motion-reduce:transition-none", J.value.fill]),
|
|
196
|
+
style: f({ width: `${Math.min(100, K.value)}%` })
|
|
197
|
+
}, null, 6), (p(!0), a(t, null, m(fe.value, (e) => (p(), a("span", {
|
|
198
|
+
key: e,
|
|
199
|
+
class: "absolute inset-y-0 w-0.5 -translate-x-1/2 bg-surface",
|
|
200
|
+
style: f({ left: `${e}%` }),
|
|
201
|
+
"aria-hidden": "true"
|
|
202
|
+
}, null, 4))), 128))], 10, E)) : i("", !0),
|
|
203
|
+
Y.value ? (p(), a("p", {
|
|
204
|
+
key: 1,
|
|
205
|
+
class: d(["text-xs", J.value.text])
|
|
206
|
+
}, _(Y.value), 3)) : i("", !0)
|
|
207
|
+
], 64))])) : i("", !0),
|
|
208
|
+
z.default ? (p(), a("div", D, [h(n.$slots, "default")])) : i("", !0)
|
|
209
|
+
]),
|
|
210
|
+
c.breakdown.length ? (p(), a("div", O, [o("table", k, [c.breakdownHeaders.length ? (p(), a("thead", A, [o("tr", null, [(p(!0), a(t, null, m(c.breakdownHeaders, (e, t) => (p(), a("th", {
|
|
211
|
+
key: t,
|
|
212
|
+
scope: "col",
|
|
213
|
+
class: d(["h-9 px-4 font-medium whitespace-nowrap", t > 0 ? "text-right" : "text-left"])
|
|
214
|
+
}, _(e), 3))), 128))])])) : i("", !0), o("tbody", null, [(p(!0), a(t, null, m(c.breakdown, (e, n) => (p(), a("tr", {
|
|
215
|
+
key: `${e.label}${n}`,
|
|
216
|
+
class: d(["border-t border-border-light", !c.breakdownHeaders.length && n === 0 && "border-t-0"])
|
|
217
|
+
}, [o("th", j, [o("span", M, [e.icon ? (p(), r(g(e.icon), {
|
|
218
|
+
key: 0,
|
|
219
|
+
class: "size-4 shrink-0 text-muted",
|
|
220
|
+
"aria-hidden": "true"
|
|
221
|
+
})) : i("", !0), o("span", N, _(e.label), 1)])]), (p(!0), a(t, null, m(e.values, (e, n) => (p(), a("td", {
|
|
222
|
+
key: n,
|
|
223
|
+
class: "px-4 py-2.5 text-right font-medium whitespace-nowrap text-heading tabular-nums"
|
|
224
|
+
}, [c.loading ? (p(), a("span", P)) : (p(), a(t, { key: 1 }, [s(_(Z(e)), 1)], 64))]))), 128))], 2))), 128))])])])) : i("", !0),
|
|
225
|
+
z.footer ? (p(), a("div", F, [h(n.$slots, "footer")])) : i("", !0)
|
|
226
|
+
], 10, re));
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
//#endregion
|
|
230
|
+
export { I as default };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
export interface UserMenuItem {
|
|
3
|
+
/** Text of the row. */
|
|
4
|
+
label: string;
|
|
5
|
+
/** A Lucide icon component. */
|
|
6
|
+
icon?: Component;
|
|
7
|
+
/** Route; rendered as `RouterLink` when vue-router is installed. */
|
|
8
|
+
to?: string | object;
|
|
9
|
+
/** Plain URL. */
|
|
10
|
+
href?: string;
|
|
11
|
+
/** Greys the row out. */
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface Props {
|
|
15
|
+
/** The person's name or username. The avatar shows its initials. */
|
|
16
|
+
name: string;
|
|
17
|
+
/** Second line in the menu header, usually the email address. */
|
|
18
|
+
email?: string;
|
|
19
|
+
/** Profile photo. Falls back to initials when it's missing or fails to load. */
|
|
20
|
+
avatarUrl?: string;
|
|
21
|
+
/** Makes the menu header a link to the profile page. */
|
|
22
|
+
profileUrl?: string;
|
|
23
|
+
/** Rows between the header and Sign out: `{ label, icon?, to?, href?, disabled? }`. Emits `select`. Use the default slot for anything custom. */
|
|
24
|
+
items?: UserMenuItem[];
|
|
25
|
+
/** Adds the Light / Dark / System switch (`AcThemeMode`). */
|
|
26
|
+
showThemeMode?: boolean;
|
|
27
|
+
/** Adds a text-size switch (`AcFontScale`) that scales the whole interface. */
|
|
28
|
+
showFontScale?: boolean;
|
|
29
|
+
/** Shows the name next to the avatar in the trigger (from 640px up). */
|
|
30
|
+
showName?: boolean;
|
|
31
|
+
/** Makes Sign out a link to this URL, e.g. `${accountsDomain}/user/logout`. `logout` is emitted either way. */
|
|
32
|
+
logoutUrl?: string;
|
|
33
|
+
/** Text of the sign-out row. */
|
|
34
|
+
logoutLabel?: string;
|
|
35
|
+
}
|
|
36
|
+
type __VLS_Props = Props;
|
|
37
|
+
type __VLS_Slots = {
|
|
38
|
+
/** Custom rows after `items`. Give each focusable row `role="menuitem"`, `tabindex="-1"` and the `itemClass` classes; call `close()` after an action. */
|
|
39
|
+
default?: (props: {
|
|
40
|
+
close: () => void;
|
|
41
|
+
itemClass: string;
|
|
42
|
+
}) => unknown;
|
|
43
|
+
};
|
|
44
|
+
type __VLS_ModelProps = {
|
|
45
|
+
/** Whether the menu is open. Bind with `v-model:open`. */
|
|
46
|
+
"open"?: boolean;
|
|
47
|
+
};
|
|
48
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
49
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
50
|
+
select: (item: UserMenuItem) => any;
|
|
51
|
+
"update:open": (value: boolean) => any;
|
|
52
|
+
"set:theme": (theme: "light" | "dark") => any;
|
|
53
|
+
logout: () => any;
|
|
54
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
55
|
+
onSelect?: ((item: UserMenuItem) => any) | undefined;
|
|
56
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
57
|
+
"onSet:theme"?: ((theme: "light" | "dark") => any) | undefined;
|
|
58
|
+
onLogout?: (() => any) | undefined;
|
|
59
|
+
}>, {
|
|
60
|
+
items: UserMenuItem[];
|
|
61
|
+
email: string;
|
|
62
|
+
avatarUrl: string;
|
|
63
|
+
profileUrl: string;
|
|
64
|
+
showThemeMode: boolean;
|
|
65
|
+
showFontScale: boolean;
|
|
66
|
+
showName: boolean;
|
|
67
|
+
logoutUrl: string;
|
|
68
|
+
logoutLabel: string;
|
|
69
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
70
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
71
|
+
declare const _default: typeof __VLS_export;
|
|
72
|
+
export default _default;
|
|
73
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
74
|
+
new (): {
|
|
75
|
+
$slots: S;
|
|
76
|
+
};
|
|
77
|
+
};
|