@ac-design/design-system 1.0.3 → 2.0.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/README.md +27 -18
- package/dist/lib/charts/ChartFrame.js +5 -0
- package/dist/lib/charts/ChartFrame.vue.d.ts +69 -0
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +168 -0
- package/dist/lib/charts/index.d.ts +7 -0
- package/dist/lib/charts/index.js +5 -0
- package/dist/lib/charts/shared.d.ts +60 -0
- package/dist/lib/charts/shared.js +114 -0
- package/dist/lib/charts/xy.d.ts +65 -0
- package/dist/lib/charts/xy.js +92 -0
- package/dist/lib/compat.css +1707 -1042
- package/dist/lib/components/AcAccordion.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcAccordionItem.vue.d.ts +1 -1
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/lib/components/AcAlert.vue.d.ts +1 -1
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +19 -25
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +19 -19
- package/dist/lib/components/AcAreaChart.js +5 -0
- package/dist/lib/components/AcAreaChart.vue.d.ts +44 -0
- package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +215 -0
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcBadge.vue.d.ts +16 -7
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +59 -43
- package/dist/lib/components/AcBanner.vue.d.ts +1 -1
- package/dist/lib/components/AcBanner.vue_vue_type_script_setup_true_lang.js +30 -30
- package/dist/lib/components/AcBarChart.js +5 -0
- package/dist/lib/components/AcBarChart.vue.d.ts +43 -0
- package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +217 -0
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +27 -26
- package/dist/lib/components/AcBulkActionBar.js +5 -0
- package/dist/lib/components/AcBulkActionBar.vue.d.ts +43 -0
- package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +84 -0
- package/dist/lib/components/AcButton.vue.d.ts +3 -3
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +42 -34
- package/dist/lib/components/AcButtons.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcCard.vue.d.ts +10 -2
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +37 -11
- package/dist/lib/components/AcCellValue.vue.d.ts +4 -1
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +214 -179
- package/dist/lib/components/AcCheckBox.vue.d.ts +17 -3
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +126 -29
- package/dist/lib/components/AcCheckRadio.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +33 -21
- package/dist/lib/components/AcCircularProgress.js +5 -0
- package/dist/lib/components/AcCircularProgress.vue.d.ts +44 -0
- package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +111 -0
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +142 -167
- package/dist/lib/components/AcCodeEditor.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/lib/components/AcColorInput.js +5 -0
- package/dist/lib/components/AcColorInput.vue.d.ts +54 -0
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/lib/components/AcConfirmModal.js +5 -0
- package/dist/lib/components/AcConfirmModal.vue.d.ts +56 -0
- package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/lib/components/AcContentHeader.vue.d.ts +1 -1
- package/dist/lib/components/AcContentHeader.vue_vue_type_script_setup_true_lang.js +5 -4
- package/dist/lib/components/AcContentLayout.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcCopyButton.js +5 -0
- package/dist/lib/components/AcCopyButton.vue.d.ts +43 -0
- package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +92 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +5 -5
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +204 -213
- package/dist/lib/components/AcDeleteModal.vue.d.ts +4 -4
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +37 -46
- package/dist/lib/components/AcDonutChart.js +5 -0
- package/dist/lib/components/AcDonutChart.vue.d.ts +73 -0
- package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +210 -0
- package/dist/lib/components/AcDropdown.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +9 -9
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/lib/components/AcEmptyState.vue.d.ts +4 -1
- package/dist/lib/components/AcEmptyState.vue_vue_type_script_setup_true_lang.js +50 -39
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +14 -13
- package/dist/lib/components/AcFileEditor.vue_vue_type_script_setup_true_lang.js +16 -16
- package/dist/lib/components/AcFileUpload.vue.d.ts +2 -2
- package/dist/lib/components/AcFileUpload.vue_vue_type_script_setup_true_lang.js +55 -53
- package/dist/lib/components/AcFontScale.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFooter.js +5 -0
- package/dist/lib/components/AcFooter.vue.d.ts +37 -0
- package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +107 -0
- package/dist/lib/components/AcForm.vue.d.ts +3 -0
- package/dist/lib/components/AcForm.vue_vue_type_script_setup_true_lang.js +4 -2
- package/dist/lib/components/AcFormArray.vue.d.ts +2 -2
- package/dist/lib/components/AcFormArray.vue_vue_type_script_setup_true_lang.js +149 -147
- package/dist/lib/components/AcFormFooter.vue.d.ts +2 -2
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcFormSection.vue.d.ts +7 -0
- package/dist/lib/components/AcFormSection.vue_vue_type_script_setup_true_lang.js +31 -21
- package/dist/lib/components/AcHeader.vue.d.ts +3 -3
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/lib/components/AcInfoTable.vue_vue_type_script_setup_true_lang.js +17 -13
- package/dist/lib/components/AcInput.vue.d.ts +3 -3
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +98 -87
- package/dist/lib/components/AcKbd.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcKeyValueInput.js +5 -0
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +114 -0
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +320 -0
- package/dist/lib/components/AcLineChart.js +5 -0
- package/dist/lib/components/AcLineChart.vue.d.ts +38 -0
- package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +187 -0
- package/dist/lib/components/AcLocaleSwitcher.js +5 -0
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +46 -0
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +103 -0
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +23 -23
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/lib/components/AcNavbarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +26 -26
- package/dist/lib/components/AcNumberInput.js +5 -0
- package/dist/lib/components/AcNumberInput.vue.d.ts +79 -0
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +251 -0
- package/dist/lib/components/AcPage.vue.d.ts +2 -2
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcPagination.vue.d.ts +20 -3
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +81 -53
- package/dist/lib/components/AcPreloader.vue.d.ts +1 -1
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/lib/components/AcProgress.vue.d.ts +2 -2
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcResourceCard.vue.d.ts +2 -2
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +13 -13
- package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/lib/components/AcSectionContent.vue.d.ts +2 -2
- package/dist/lib/components/AcSectionContent.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcSegmentedControl.vue.d.ts +1 -1
- package/dist/lib/components/AcSegmentedControl.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcSelect.vue.d.ts +4 -4
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +230 -227
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +31 -31
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +37 -37
- package/dist/lib/components/AcSidebar.vue.d.ts +3 -3
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +75 -75
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +33 -32
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/lib/components/AcSkeleton.vue_vue_type_script_setup_true_lang.js +8 -8
- package/dist/lib/components/AcSlider.vue.d.ts +1 -1
- package/dist/lib/components/AcSlider.vue_vue_type_script_setup_true_lang.js +174 -172
- package/dist/lib/components/AcStatCard.vue.d.ts +3 -3
- package/dist/lib/components/AcStatCard.vue_vue_type_script_setup_true_lang.js +90 -85
- package/dist/lib/components/AcStatusBar.vue.d.ts +1 -1
- package/dist/lib/components/AcStatusBar.vue_vue_type_script_setup_true_lang.js +6 -6
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +28 -28
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +39 -34
- package/dist/lib/components/AcSwitchCard.js +5 -0
- package/dist/lib/components/AcSwitchCard.vue.d.ts +59 -0
- package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +119 -0
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +87 -87
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcTag.vue.d.ts +1 -1
- package/dist/lib/components/AcTag.vue_vue_type_script_setup_true_lang.js +22 -22
- package/dist/lib/components/AcTagInput.js +5 -0
- package/dist/lib/components/AcTagInput.vue.d.ts +74 -0
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +291 -0
- package/dist/lib/components/AcTextarea.vue.d.ts +3 -3
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +89 -64
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/lib/components/AcTimePicker.js +5 -0
- package/dist/lib/components/AcTimePicker.vue.d.ts +65 -0
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +463 -0
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +65 -71
- package/dist/lib/components/AcTooltip.vue.d.ts +1 -1
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +77 -67
- package/dist/lib/components/AcUsageCard.vue_vue_type_script_setup_true_lang.js +27 -27
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +111 -103
- package/dist/lib/components/index.d.ts +14 -2
- package/dist/lib/components/status.d.ts +26 -0
- package/dist/lib/components/status.js +110 -0
- package/dist/lib/composables/copyText.d.ts +2 -1
- package/dist/lib/composables/copyText.js +2 -2
- package/dist/lib/composables/useApiPagination.d.ts +55 -0
- package/dist/lib/composables/useApiPagination.js +58 -0
- package/dist/lib/composables/useBulkSelection.d.ts +44 -0
- package/dist/lib/composables/useBulkSelection.js +41 -0
- package/dist/lib/composables/useFormValidation.d.ts +65 -0
- package/dist/lib/composables/useFormValidation.js +148 -0
- package/dist/lib/composables/useTablePagination.d.ts +49 -0
- package/dist/lib/composables/useTablePagination.js +41 -0
- package/dist/lib/editor/theme.js +65 -62
- package/dist/lib/index.d.ts +14 -0
- package/dist/lib/index.js +95 -78
- package/dist/lib/theme.css +391 -272
- package/package.json +11 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface Props {
|
|
2
|
-
/** The hint text. Keep it to a few words; use the `content` slot for richer text. */
|
|
2
|
+
/** The hint text, in a dark bubble up to 280px wide. Keep it to a few words; use the `content` slot for richer text. */
|
|
3
3
|
content?: string;
|
|
4
4
|
/** Preferred side of the trigger. It flips to the opposite side when there isn't room. */
|
|
5
5
|
placement?: "top" | "bottom" | "left" | "right";
|
|
@@ -1,6 +1,6 @@
|
|
|
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,
|
|
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, normalizeClass as u, normalizeStyle as d, onBeforeUnmount as f, onMounted as p, onUpdated as m, openBlock as h, ref as g, renderSlot as _, toDisplayString as v, useId as y, useSlots as b, vShow as x, watch as S, withCtx as C, withDirectives as w } from "vue";
|
|
2
2
|
//#region src/lib/components/AcTooltip.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
-
var
|
|
3
|
+
var T = ["data-side"], E = 8, D = 8, O = /*@__PURE__*/ c({
|
|
4
4
|
__name: "AcTooltip",
|
|
5
5
|
props: {
|
|
6
6
|
content: { default: "" },
|
|
@@ -12,106 +12,116 @@ var w = ["data-side"], T = 6, E = 8, D = /*@__PURE__*/ c({
|
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
setup(c) {
|
|
15
|
-
let
|
|
15
|
+
let O = c, k = b(), A = {
|
|
16
16
|
top: "bottom",
|
|
17
17
|
bottom: "top",
|
|
18
18
|
left: "right",
|
|
19
19
|
right: "left"
|
|
20
|
-
},
|
|
20
|
+
}, j = {
|
|
21
|
+
top: "translate-y-1",
|
|
22
|
+
bottom: "-translate-y-1",
|
|
23
|
+
left: "translate-x-1",
|
|
24
|
+
right: "-translate-x-1"
|
|
25
|
+
}, M = {
|
|
26
|
+
top: "origin-bottom",
|
|
27
|
+
bottom: "origin-top",
|
|
28
|
+
left: "origin-right",
|
|
29
|
+
right: "origin-left"
|
|
30
|
+
}, N = `${y()}-tip`, P = g(null), F = g(null), I = g(!1), L = g(O.placement), R = g({
|
|
21
31
|
top: 0,
|
|
22
32
|
left: 0
|
|
23
|
-
}),
|
|
24
|
-
function
|
|
25
|
-
let e =
|
|
33
|
+
}), z, B, V = null, H = n(() => !O.disabled && !!(O.content || k.content));
|
|
34
|
+
function U() {
|
|
35
|
+
let e = P.value;
|
|
26
36
|
return e?.querySelector("button, a[href], input, select, textarea, [tabindex]") ?? e?.firstElementChild ?? null;
|
|
27
37
|
}
|
|
28
|
-
function
|
|
29
|
-
let e =
|
|
30
|
-
if (
|
|
31
|
-
let t = (e.getAttribute("aria-describedby") ?? "").split(" ").filter((e) => e && e !==
|
|
32
|
-
|
|
38
|
+
function W() {
|
|
39
|
+
let e = U();
|
|
40
|
+
if (V && V !== e && G(V), V = e, !e) return;
|
|
41
|
+
let t = (e.getAttribute("aria-describedby") ?? "").split(" ").filter((e) => e && e !== N);
|
|
42
|
+
H.value && t.push(N), t.length ? e.setAttribute("aria-describedby", t.join(" ")) : e.removeAttribute("aria-describedby");
|
|
33
43
|
}
|
|
34
|
-
function
|
|
35
|
-
let t = (e.getAttribute("aria-describedby") ?? "").split(" ").filter((e) => e && e !==
|
|
44
|
+
function G(e) {
|
|
45
|
+
let t = (e.getAttribute("aria-describedby") ?? "").split(" ").filter((e) => e && e !== N);
|
|
36
46
|
t.length ? e.setAttribute("aria-describedby", t.join(" ")) : e.removeAttribute("aria-describedby");
|
|
37
47
|
}
|
|
38
|
-
function
|
|
39
|
-
clearTimeout(
|
|
40
|
-
|
|
48
|
+
function K(e) {
|
|
49
|
+
clearTimeout(B), H.value && !I.value && (clearTimeout(z), z = setTimeout(async () => {
|
|
50
|
+
I.value = !0, await l(), Y();
|
|
41
51
|
}, e));
|
|
42
52
|
}
|
|
43
|
-
function
|
|
44
|
-
clearTimeout(
|
|
53
|
+
function q(e = 0) {
|
|
54
|
+
clearTimeout(z), clearTimeout(B), e ? B = setTimeout(() => I.value = !1, e) : I.value = !1;
|
|
45
55
|
}
|
|
46
|
-
function
|
|
47
|
-
return e === "top" ? t.top -
|
|
56
|
+
function J(e, t, n, r) {
|
|
57
|
+
return e === "top" ? t.top - E - r >= D : e === "bottom" ? t.bottom + E + r <= window.innerHeight - D : e === "left" ? t.left - E - n >= D : t.right + E + n <= window.innerWidth - D;
|
|
48
58
|
}
|
|
49
|
-
function
|
|
50
|
-
let e =
|
|
51
|
-
if (!e || !
|
|
52
|
-
let t = e.getBoundingClientRect(), { offsetWidth: n, offsetHeight: r } =
|
|
53
|
-
|
|
54
|
-
top: a === "top" ? t.top -
|
|
59
|
+
function Y() {
|
|
60
|
+
let e = U() ?? P.value;
|
|
61
|
+
if (!e || !F.value) return;
|
|
62
|
+
let t = e.getBoundingClientRect(), { offsetWidth: n, offsetHeight: r } = F.value, i = O.placement, a = J(i, t, n, r) || !J(A[i], t, n, r) ? i : A[i], o = (e, t) => Math.max(D, Math.min(e, t - D));
|
|
63
|
+
L.value = a, R.value = a === "top" || a === "bottom" ? {
|
|
64
|
+
top: a === "top" ? t.top - E - r : t.bottom + E,
|
|
55
65
|
left: o(t.left + t.width / 2 - n / 2, window.innerWidth - n)
|
|
56
66
|
} : {
|
|
57
67
|
top: o(t.top + t.height / 2 - r / 2, window.innerHeight - r),
|
|
58
|
-
left: a === "left" ? t.left -
|
|
68
|
+
left: a === "left" ? t.left - E - n : t.right + E
|
|
59
69
|
};
|
|
60
70
|
}
|
|
61
|
-
function
|
|
62
|
-
e.pointerType !== "touch" &&
|
|
71
|
+
function X(e) {
|
|
72
|
+
e.pointerType !== "touch" && K(O.delay);
|
|
63
73
|
}
|
|
64
|
-
function
|
|
65
|
-
e.target.matches(":focus-visible") &&
|
|
74
|
+
function Z(e) {
|
|
75
|
+
e.target.matches(":focus-visible") && K(0);
|
|
66
76
|
}
|
|
67
|
-
function
|
|
68
|
-
|
|
77
|
+
function Q() {
|
|
78
|
+
q();
|
|
69
79
|
}
|
|
70
|
-
function
|
|
71
|
-
e.key === "Escape" &&
|
|
80
|
+
function $(e) {
|
|
81
|
+
e.key === "Escape" && I.value && q();
|
|
72
82
|
}
|
|
73
|
-
return
|
|
74
|
-
e ? (document.addEventListener("keydown",
|
|
75
|
-
}),
|
|
76
|
-
|
|
77
|
-
}),
|
|
78
|
-
|
|
79
|
-
}), (n, l) => (
|
|
83
|
+
return S(I, (e) => {
|
|
84
|
+
e ? (document.addEventListener("keydown", $), window.addEventListener("scroll", Q, !0)) : (document.removeEventListener("keydown", $), window.removeEventListener("scroll", Q, !0));
|
|
85
|
+
}), S(H, (e) => {
|
|
86
|
+
W(), e || q();
|
|
87
|
+
}), p(W), m(W), f(() => {
|
|
88
|
+
q(), document.removeEventListener("keydown", $), window.removeEventListener("scroll", Q, !0), V && G(V);
|
|
89
|
+
}), (n, l) => (h(), i("span", {
|
|
80
90
|
ref_key: "root",
|
|
81
|
-
ref:
|
|
91
|
+
ref: P,
|
|
82
92
|
class: "inline-flex max-w-full",
|
|
83
93
|
"data-ac-ds": "",
|
|
84
94
|
"data-testid": "ac-tooltip",
|
|
85
|
-
onPointerenter:
|
|
86
|
-
onPointerleave: l[2] ||= (e) =>
|
|
87
|
-
onPointerdown: l[3] ||= (e) =>
|
|
88
|
-
onFocusin:
|
|
89
|
-
onFocusout: l[4] ||= (e) =>
|
|
90
|
-
}, [
|
|
91
|
-
"enter-active-class": "transition-opacity duration-
|
|
92
|
-
"enter-from-class":
|
|
93
|
-
"leave-active-class": "transition-opacity duration-
|
|
94
|
-
"leave-to-class": "opacity-0"
|
|
95
|
+
onPointerenter: X,
|
|
96
|
+
onPointerleave: l[2] ||= (e) => q(100),
|
|
97
|
+
onPointerdown: l[3] ||= (e) => q(),
|
|
98
|
+
onFocusin: Z,
|
|
99
|
+
onFocusout: l[4] ||= (e) => q()
|
|
100
|
+
}, [_(n.$slots, "default"), (h(), r(e, { to: "body" }, [s(t, {
|
|
101
|
+
"enter-active-class": "transition-[opacity,scale,translate] duration-150 ease-out motion-reduce:transition-none",
|
|
102
|
+
"enter-from-class": `opacity-0 scale-95 ${j[L.value ?? "top"]}`,
|
|
103
|
+
"leave-active-class": "transition-[opacity,scale] duration-100 ease-in motion-reduce:transition-none",
|
|
104
|
+
"leave-to-class": "opacity-0 scale-95"
|
|
95
105
|
}, {
|
|
96
|
-
default:
|
|
97
|
-
id:
|
|
106
|
+
default: C(() => [w(a("div", {
|
|
107
|
+
id: N,
|
|
98
108
|
ref_key: "tip",
|
|
99
|
-
ref:
|
|
109
|
+
ref: F,
|
|
100
110
|
role: "tooltip",
|
|
101
|
-
class: "fixed z-[100] w-max max-w-
|
|
102
|
-
"data-side":
|
|
103
|
-
style:
|
|
104
|
-
top: `${
|
|
105
|
-
left: `${
|
|
111
|
+
class: u(["fixed z-[100] w-max max-w-[280px] rounded-10 border border-white/10 bg-tooltip px-2.5 py-1.5 text-xs leading-relaxed break-words whitespace-normal text-on-tooltip shadow-lg shadow-black/25", M[L.value ?? "top"]]),
|
|
112
|
+
"data-side": L.value,
|
|
113
|
+
style: d({
|
|
114
|
+
top: `${R.value.top}px`,
|
|
115
|
+
left: `${R.value.left}px`
|
|
106
116
|
}),
|
|
107
117
|
"data-ac-ds": "",
|
|
108
118
|
"data-testid": "ac-tooltip-panel",
|
|
109
|
-
onPointerenter: l[0] ||= (e) =>
|
|
110
|
-
onPointerleave: l[1] ||= (e) =>
|
|
111
|
-
}, [
|
|
119
|
+
onPointerenter: l[0] ||= (e) => K(0),
|
|
120
|
+
onPointerleave: l[1] ||= (e) => q(100)
|
|
121
|
+
}, [_(n.$slots, "content", {}, () => [o(v(c.content), 1)])], 46, T), [[x, I.value]])]),
|
|
112
122
|
_: 3
|
|
113
|
-
})]))], 544));
|
|
123
|
+
}, 8, ["enter-from-class"])]))], 544));
|
|
114
124
|
}
|
|
115
125
|
});
|
|
116
126
|
//#endregion
|
|
117
|
-
export {
|
|
127
|
+
export { O as default };
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import e from "./AcBadge.js";
|
|
2
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
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
|
+
var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col gap-5 p-5" }, ae = { class: "flex min-w-0 items-start gap-3" }, oe = {
|
|
5
5
|
key: 0,
|
|
6
|
-
class: "inline-flex size-8 shrink-0 items-center justify-center rounded-
|
|
6
|
+
class: "inline-flex size-8 shrink-0 items-center justify-center rounded-10 border border-primary/25 bg-primary/10 text-primary-strong [&_svg]:size-4",
|
|
7
7
|
"aria-hidden": "true"
|
|
8
8
|
}, se = { class: "min-w-0 flex-1" }, ce = ["id"], y = ["title"], b = {
|
|
9
9
|
key: 1,
|
|
10
10
|
class: "relative z-10 flex shrink-0 flex-wrap items-center justify-end gap-2"
|
|
11
11
|
}, x = {
|
|
12
12
|
key: 0,
|
|
13
|
-
class: "text-xs text-muted"
|
|
13
|
+
class: "text-xs font-medium text-muted"
|
|
14
14
|
}, S = {
|
|
15
15
|
key: 0,
|
|
16
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-
|
|
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-bold tracking-tight text-heading tabular-nums" }, ue = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "text-base text-muted"
|
|
20
20
|
}, T = {
|
|
@@ -30,19 +30,19 @@ var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col
|
|
|
30
30
|
class: "text-base text-body"
|
|
31
31
|
}, O = {
|
|
32
32
|
key: 0,
|
|
33
|
-
class: "ac-scrollbar border-t border-border
|
|
33
|
+
class: "ac-scrollbar border-t border-border"
|
|
34
34
|
}, k = { class: "w-full text-left text-base" }, A = {
|
|
35
35
|
key: 0,
|
|
36
|
-
class: "text-xs text-muted"
|
|
36
|
+
class: "bg-surface-sunken/50 text-xs text-muted"
|
|
37
37
|
}, j = {
|
|
38
38
|
scope: "row",
|
|
39
|
-
class: "px-
|
|
39
|
+
class: "px-5 py-2.5 text-left font-normal text-body"
|
|
40
40
|
}, M = { class: "flex min-w-0 items-center gap-2" }, N = { class: "truncate" }, P = {
|
|
41
41
|
key: 0,
|
|
42
|
-
class: "ac-skeleton-bone ml-auto block h-3 w-14 rounded-
|
|
42
|
+
class: "ac-skeleton-bone ml-auto block h-3 w-14 rounded-full"
|
|
43
43
|
}, F = {
|
|
44
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
|
|
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 px-5 py-3 text-base text-muted"
|
|
46
46
|
}, I = /*@__PURE__*/ c({
|
|
47
47
|
__name: "AcUsageCard",
|
|
48
48
|
props: {
|
|
@@ -78,26 +78,26 @@ var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col
|
|
|
78
78
|
let L = c, R = I, z = te(), de = {
|
|
79
79
|
ok: {
|
|
80
80
|
fill: "bg-primary",
|
|
81
|
-
track: "bg-
|
|
81
|
+
track: "bg-surface-sunken",
|
|
82
82
|
text: "text-muted",
|
|
83
83
|
badge: ""
|
|
84
84
|
},
|
|
85
85
|
warning: {
|
|
86
86
|
fill: "bg-warning",
|
|
87
|
-
track: "bg-
|
|
88
|
-
text: "text-
|
|
87
|
+
track: "bg-warning/15",
|
|
88
|
+
text: "text-warning-strong",
|
|
89
89
|
badge: "Near limit"
|
|
90
90
|
},
|
|
91
91
|
danger: {
|
|
92
92
|
fill: "bg-danger",
|
|
93
|
-
track: "bg-
|
|
94
|
-
text: "text-
|
|
93
|
+
track: "bg-danger/15",
|
|
94
|
+
text: "text-danger-strong",
|
|
95
95
|
badge: "At limit"
|
|
96
96
|
},
|
|
97
97
|
over: {
|
|
98
98
|
fill: "bg-danger",
|
|
99
|
-
track: "bg-
|
|
100
|
-
text: "text-
|
|
99
|
+
track: "bg-danger/15",
|
|
100
|
+
text: "text-danger-strong",
|
|
101
101
|
badge: "Over limit"
|
|
102
102
|
}
|
|
103
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(() => {
|
|
@@ -133,7 +133,7 @@ var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col
|
|
|
133
133
|
R("click", e);
|
|
134
134
|
}
|
|
135
135
|
return (n, l) => (p(), a("section", {
|
|
136
|
-
class: d(["relative flex min-w-0 flex-col rounded-
|
|
136
|
+
class: d(["relative flex min-w-0 flex-col rounded-14 border border-border bg-surface transition-[background-color,border-color,box-shadow,translate] duration-200 has-[[data-ac-card-link]:focus-visible]:ring-2 has-[[data-ac-card-link]:focus-visible]:ring-ring has-[[data-ac-card-link]:focus-visible]:ring-offset-2 has-[[data-ac-card-link]:focus-visible]:ring-offset-surface motion-reduce:transition-none", (X.value || $()) && "hover:-translate-y-0.5 hover:border-primary/30 hover:bg-accent-hover/60 hover:shadow-card motion-reduce:hover:translate-y-0"]),
|
|
137
137
|
"aria-labelledby": `${v(U)}-title`,
|
|
138
138
|
"aria-busy": c.loading || void 0,
|
|
139
139
|
"data-ac-ds": "",
|
|
@@ -144,20 +144,20 @@ var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col
|
|
|
144
144
|
z.icon || c.icon ? (p(), a("span", oe, [h(n.$slots, "icon", {}, () => [(p(), r(g(c.icon)))])])) : i("", !0),
|
|
145
145
|
o("div", se, [o("h3", {
|
|
146
146
|
id: `${v(U)}-title`,
|
|
147
|
-
class: "truncate text-lg leading-6 font-semibold tracking-
|
|
147
|
+
class: "truncate font-heading text-lg leading-6 font-semibold tracking-tight text-heading"
|
|
148
148
|
}, [X.value || $() ? (p(), r(g(X.value ? X.value.is : "button"), u({ key: 0 }, X.value ? {
|
|
149
149
|
...X.value,
|
|
150
150
|
is: void 0
|
|
151
151
|
} : { type: "button" }, {
|
|
152
152
|
"data-ac-card-link": "",
|
|
153
|
-
class: "cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-
|
|
153
|
+
class: "cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-14",
|
|
154
154
|
onClick: me
|
|
155
155
|
}), {
|
|
156
156
|
default: ne(() => [s(_(c.title), 1)]),
|
|
157
157
|
_: 1
|
|
158
158
|
}, 16)) : (p(), a(t, { key: 1 }, [s(_(c.title), 1)], 64))], 8, ce), c.description ? (p(), a("p", {
|
|
159
159
|
key: 0,
|
|
160
|
-
class: "truncate text-xs text-muted",
|
|
160
|
+
class: "mt-0.5 truncate text-xs text-muted",
|
|
161
161
|
title: c.description
|
|
162
162
|
}, _(c.description), 9, y)) : i("", !0)]),
|
|
163
163
|
c.period || J.value.badge || z.actions ? (p(), a("div", b, [
|
|
@@ -173,14 +173,14 @@ var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col
|
|
|
173
173
|
h(n.$slots, "actions")
|
|
174
174
|
])) : i("", !0)
|
|
175
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-
|
|
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-7 w-2/5 rounded-6" }, 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
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
178
|
s(_(c.unit), 1),
|
|
179
179
|
c.unit ? (p(), a(t, { key: 0 }, [s(" · ")], 64)) : i("", !0),
|
|
180
180
|
l[2] ||= s("No limit", -1)
|
|
181
181
|
]))]), G.value ? (p(), a("span", {
|
|
182
182
|
key: 0,
|
|
183
|
-
class: d(["text-base font-
|
|
183
|
+
class: d(["text-base font-semibold tabular-nums", q.value === "ok" ? "text-heading" : J.value.text])
|
|
184
184
|
}, _(Math.round(K.value)) + "% ", 3)) : i("", !0)]),
|
|
185
185
|
G.value ? (p(), a("div", {
|
|
186
186
|
key: 0,
|
|
@@ -192,7 +192,7 @@ var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col
|
|
|
192
192
|
"aria-valuetext": pe.value,
|
|
193
193
|
class: d(["relative h-2 w-full overflow-hidden rounded-full", J.value.track])
|
|
194
194
|
}, [o("div", {
|
|
195
|
-
class: d(["h-full rounded-full transition-[width,background-color] duration-
|
|
195
|
+
class: d(["h-full rounded-full transition-[width,background-color] duration-700 ease-out motion-reduce:transition-none", J.value.fill]),
|
|
196
196
|
style: f({ width: `${Math.min(100, K.value)}%` })
|
|
197
197
|
}, null, 6), (p(!0), a(t, null, m(fe.value, (e) => (p(), a("span", {
|
|
198
198
|
key: e,
|
|
@@ -202,7 +202,7 @@ var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col
|
|
|
202
202
|
}, null, 4))), 128))], 10, E)) : i("", !0),
|
|
203
203
|
Y.value ? (p(), a("p", {
|
|
204
204
|
key: 1,
|
|
205
|
-
class: d(["text-xs", J.value.text])
|
|
205
|
+
class: d(["text-xs font-medium", J.value.text])
|
|
206
206
|
}, _(Y.value), 3)) : i("", !0)
|
|
207
207
|
], 64))])) : i("", !0),
|
|
208
208
|
z.default ? (p(), a("div", D, [h(n.$slots, "default")])) : i("", !0)
|
|
@@ -210,17 +210,17 @@ var re = ["aria-labelledby", "aria-busy"], ie = { class: "flex min-w-0 flex-col
|
|
|
210
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
211
|
key: t,
|
|
212
212
|
scope: "col",
|
|
213
|
-
class: d(["h-
|
|
213
|
+
class: d(["h-10 px-5 font-semibold whitespace-nowrap", t > 0 ? "text-right" : "text-left"])
|
|
214
214
|
}, _(e), 3))), 128))])])) : i("", !0), o("tbody", null, [(p(!0), a(t, null, m(c.breakdown, (e, n) => (p(), a("tr", {
|
|
215
215
|
key: `${e.label}${n}`,
|
|
216
|
-
class: d(["border-t border-border
|
|
216
|
+
class: d(["border-t border-border", !c.breakdownHeaders.length && n === 0 && "border-t-0"])
|
|
217
217
|
}, [o("th", j, [o("span", M, [e.icon ? (p(), r(g(e.icon), {
|
|
218
218
|
key: 0,
|
|
219
219
|
class: "size-4 shrink-0 text-muted",
|
|
220
220
|
"aria-hidden": "true"
|
|
221
221
|
})) : i("", !0), o("span", N, _(e.label), 1)])]), (p(!0), a(t, null, m(e.values, (e, n) => (p(), a("td", {
|
|
222
222
|
key: n,
|
|
223
|
-
class: "px-
|
|
223
|
+
class: "px-5 py-2.5 text-right font-medium whitespace-nowrap text-heading tabular-nums"
|
|
224
224
|
}, [c.loading ? (p(), a("span", P)) : (p(), a(t, { key: 1 }, [s(_(Z(e)), 1)], 64))]))), 128))], 2))), 128))])])])) : i("", !0),
|
|
225
225
|
z.footer ? (p(), a("div", F, [h(n.$slots, "footer")])) : i("", !0)
|
|
226
226
|
], 10, re));
|