@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,6 +1,6 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import t from "./
|
|
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
|
|
1
|
+
import e from "./AcFontScale.js";
|
|
2
|
+
import t from "./AcThemeMode.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 ne, resolveDynamicComponent as x, toDisplayString as S, unref as C, useId as re, useModel as ie, watch as w, withCtx as T } from "vue";
|
|
4
4
|
import { ChevronDown as ae, LogOut as oe } from "@lucide/vue";
|
|
5
5
|
//#region src/lib/components/AcUserMenu.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var se = {
|
|
@@ -12,22 +12,25 @@ var se = {
|
|
|
12
12
|
"aria-controls",
|
|
13
13
|
"aria-label"
|
|
14
14
|
], le = {
|
|
15
|
-
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "hidden max-w-36 truncate text-base font-medium text-heading sm:block"
|
|
17
|
+
}, ue = {
|
|
18
|
+
class: "inline-flex size-8 shrink-0 rounded-full bg-linear-to-r from-primary/70 to-primary/90 p-0.5",
|
|
16
19
|
"aria-hidden": "true"
|
|
17
|
-
},
|
|
18
|
-
class: "inline-flex size-
|
|
20
|
+
}, E = { class: "inline-flex size-full items-center justify-center overflow-hidden rounded-full bg-surface text-xs font-semibold text-primary-strong" }, D = ["src"], de = {
|
|
21
|
+
class: "inline-flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-full bg-primary/10 text-base font-semibold text-primary-strong ring-1 ring-primary/25 ring-inset",
|
|
19
22
|
"aria-hidden": "true"
|
|
20
|
-
},
|
|
23
|
+
}, fe = ["src"], pe = { class: "min-w-0 flex-1" }, me = { class: "block truncate text-base font-medium text-heading" }, he = {
|
|
21
24
|
key: 0,
|
|
22
25
|
class: "block truncate text-xs text-muted"
|
|
23
|
-
},
|
|
26
|
+
}, ge = {
|
|
24
27
|
key: 0,
|
|
25
28
|
role: "group",
|
|
26
|
-
class: "flex flex-col gap-
|
|
27
|
-
},
|
|
29
|
+
class: "mt-1 flex flex-col gap-0.5 border-t border-border pt-1"
|
|
30
|
+
}, _e = { class: "min-w-0 flex-1 truncate" }, ve = ["aria-labelledby"], ye = ["id"], be = ["aria-labelledby"], xe = ["id"], O = {
|
|
28
31
|
role: "group",
|
|
29
|
-
class: "border-t border-border
|
|
30
|
-
}, k = "flex h-
|
|
32
|
+
class: "mt-1 border-t border-border pt-1"
|
|
33
|
+
}, k = "flex min-h-9 w-full cursor-pointer items-center gap-2.5 rounded-8 px-3 py-2 text-left text-base no-underline outline-none transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0", A = "[role=\"menuitem\"]:not([aria-disabled=\"true\"]), [role=\"radio\"]", j = /*@__PURE__*/ f({
|
|
31
34
|
__name: "AcUserMenu",
|
|
32
35
|
props: /*@__PURE__*/ m({
|
|
33
36
|
name: {},
|
|
@@ -62,137 +65,142 @@ var se = {
|
|
|
62
65
|
"set:theme"
|
|
63
66
|
], ["update:open"]),
|
|
64
67
|
setup(f, { emit: m }) {
|
|
65
|
-
let j = f, M = ie(f, "open"), N = m, P = p()?.appContext.components.RouterLink,
|
|
68
|
+
let j = f, M = ie(f, "open"), N = m, P = `${k} text-heading hover:bg-accent-hover focus-visible:bg-accent-hover [&>svg]:text-muted`, Se = `${k} text-danger-strong hover:bg-danger/10 focus-visible:bg-danger/10`, F = p()?.appContext.components.RouterLink, I = re(), L = `${I}-trigger`, R = `${I}-menu`, z = y(null), B = y(null), V = y(!1), H = y({
|
|
66
69
|
top: 0,
|
|
67
70
|
right: 0
|
|
68
|
-
}),
|
|
71
|
+
}), U = a(() => {
|
|
69
72
|
let e = j.name.trim().split(/[\s._-]+/).filter(Boolean);
|
|
70
73
|
return e.length ? (e[0].charAt(0) + (e.length > 1 ? e[e.length - 1].charAt(0) : "")).toUpperCase() : "?";
|
|
71
|
-
}),
|
|
72
|
-
function
|
|
73
|
-
return e.to &&
|
|
74
|
+
}), W = a(() => !!j.avatarUrl && !V.value);
|
|
75
|
+
function G(e) {
|
|
76
|
+
return e.to && F && !e.disabled ? F : e.to || e.href ? "a" : "button";
|
|
74
77
|
}
|
|
75
|
-
function
|
|
76
|
-
let t =
|
|
77
|
-
return t ===
|
|
78
|
+
function Ce(e) {
|
|
79
|
+
let t = G(e);
|
|
80
|
+
return t === F ? { to: e.to } : t === "a" ? e.disabled ? { "aria-disabled": "true" } : { href: e.href ?? (typeof e.to == "string" ? e.to : void 0) } : {
|
|
78
81
|
type: "button",
|
|
79
82
|
"aria-disabled": e.disabled ? "true" : void 0
|
|
80
83
|
};
|
|
81
84
|
}
|
|
82
|
-
function
|
|
83
|
-
return [...
|
|
85
|
+
function K() {
|
|
86
|
+
return [...B.value?.querySelectorAll(A) ?? []];
|
|
84
87
|
}
|
|
85
|
-
function
|
|
86
|
-
let t =
|
|
88
|
+
function q(e) {
|
|
89
|
+
let t = K();
|
|
87
90
|
t.length && t[(e + t.length) % t.length].focus();
|
|
88
91
|
}
|
|
89
|
-
function
|
|
90
|
-
let e =
|
|
92
|
+
function J() {
|
|
93
|
+
let e = z.value;
|
|
91
94
|
if (!e) return;
|
|
92
|
-
let t = e.getBoundingClientRect(), n =
|
|
93
|
-
|
|
95
|
+
let t = e.getBoundingClientRect(), n = B.value?.offsetHeight ?? 320, r = B.value?.offsetWidth ?? 304, i = Math.max(8, Math.min(window.innerWidth - t.right, window.innerWidth - r - 8)), a = window.innerHeight - t.bottom - 6 - 8;
|
|
96
|
+
H.value = a < n && t.top > a ? {
|
|
94
97
|
bottom: window.innerHeight - t.top + 6,
|
|
95
|
-
right:
|
|
98
|
+
right: i
|
|
96
99
|
} : {
|
|
97
100
|
top: t.bottom + 6,
|
|
98
|
-
right:
|
|
101
|
+
right: i
|
|
99
102
|
};
|
|
100
103
|
}
|
|
101
|
-
async function
|
|
102
|
-
M.value = !0, await
|
|
104
|
+
async function Y(e = "first") {
|
|
105
|
+
M.value = !0, await g(), J(), q(e === "first" ? 0 : -1);
|
|
103
106
|
}
|
|
104
|
-
function
|
|
105
|
-
M.value && (M.value = !1, e &&
|
|
107
|
+
function X(e = !0) {
|
|
108
|
+
M.value && (M.value = !1, e && z.value?.focus());
|
|
106
109
|
}
|
|
107
|
-
function
|
|
110
|
+
function we(e) {
|
|
108
111
|
[
|
|
109
112
|
"Enter",
|
|
110
113
|
" ",
|
|
111
114
|
"ArrowDown"
|
|
112
|
-
].includes(e.key) ? (e.preventDefault(),
|
|
115
|
+
].includes(e.key) ? (e.preventDefault(), Y("first")) : e.key === "ArrowUp" && (e.preventDefault(), Y("last"));
|
|
113
116
|
}
|
|
114
|
-
function
|
|
115
|
-
let t =
|
|
116
|
-
e.key === "ArrowDown" ? (e.preventDefault(),
|
|
117
|
+
function Te(e) {
|
|
118
|
+
let t = K().indexOf(document.activeElement);
|
|
119
|
+
e.key === "ArrowDown" ? (e.preventDefault(), q(t + 1)) : e.key === "ArrowUp" ? (e.preventDefault(), q(t - 1)) : e.key === "Home" ? (e.preventDefault(), q(0)) : e.key === "End" ? (e.preventDefault(), q(-1)) : e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), X()) : e.key === "Tab" && X();
|
|
117
120
|
}
|
|
118
|
-
function
|
|
119
|
-
e.disabled || (N("select", e),
|
|
121
|
+
function Ee(e) {
|
|
122
|
+
e.disabled || (N("select", e), X());
|
|
120
123
|
}
|
|
121
|
-
function
|
|
122
|
-
N("logout"),
|
|
124
|
+
function De() {
|
|
125
|
+
N("logout"), X(!1);
|
|
123
126
|
}
|
|
124
127
|
function Z(e) {
|
|
125
128
|
let t = e.target;
|
|
126
|
-
|
|
129
|
+
z.value?.contains(t) || B.value?.contains(t) || X(!1);
|
|
127
130
|
}
|
|
128
131
|
function Q() {
|
|
129
|
-
|
|
132
|
+
J();
|
|
130
133
|
}
|
|
131
134
|
function $() {
|
|
132
135
|
document.removeEventListener("pointerdown", Z, !0), window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q);
|
|
133
136
|
}
|
|
134
137
|
return w(M, (e) => {
|
|
135
138
|
if (!e) return $();
|
|
136
|
-
document.addEventListener("pointerdown", Z, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q),
|
|
137
|
-
}), w(() => j.avatarUrl, () =>
|
|
138
|
-
id:
|
|
139
|
+
document.addEventListener("pointerdown", Z, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q), g(J);
|
|
140
|
+
}), w(() => j.avatarUrl, () => V.value = !1), te($), (a, p) => (v(), c("div", se, [l("button", {
|
|
141
|
+
id: L,
|
|
139
142
|
ref_key: "trigger",
|
|
140
|
-
ref:
|
|
143
|
+
ref: z,
|
|
141
144
|
type: "button",
|
|
142
145
|
"aria-haspopup": "menu",
|
|
143
146
|
"aria-expanded": M.value,
|
|
144
|
-
"aria-controls": M.value ?
|
|
147
|
+
"aria-controls": M.value ? R : void 0,
|
|
145
148
|
"aria-label": `${f.name}, account menu`,
|
|
146
|
-
class:
|
|
149
|
+
class: _(["group inline-flex h-10 shrink-0 cursor-pointer items-center gap-2 rounded-10 border border-transparent p-0.5 transition-colors max-sm:rounded-full max-sm:border-0 max-sm:p-0 duration-200 hover:border-border hover:bg-surface-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface", [f.showName && "sm:pr-2.5 sm:pl-3", M.value && "border-border bg-surface-sunken/50"]]),
|
|
147
150
|
"data-ac-ds": "",
|
|
148
151
|
"data-testid": "ac-user-menu-trigger",
|
|
149
|
-
onClick: p[1] ||= (e) => M.value ?
|
|
150
|
-
onKeydown:
|
|
151
|
-
}, [
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
152
|
+
onClick: p[1] ||= (e) => M.value ? X() : Y(),
|
|
153
|
+
onKeydown: we
|
|
154
|
+
}, [
|
|
155
|
+
f.showName ? (v(), c("span", le, S(f.name), 1)) : s("", !0),
|
|
156
|
+
l("span", ue, [l("span", E, [W.value ? (v(), c("img", {
|
|
157
|
+
key: 0,
|
|
158
|
+
src: f.avatarUrl,
|
|
159
|
+
alt: "",
|
|
160
|
+
class: "size-full object-cover",
|
|
161
|
+
onError: p[0] ||= (e) => V.value = !0
|
|
162
|
+
}, null, 40, D)) : (v(), c(n, { key: 1 }, [u(S(U.value), 1)], 64))])]),
|
|
163
|
+
f.showName ? (v(), o(C(ae), {
|
|
164
|
+
key: 1,
|
|
165
|
+
class: _(["hidden size-4 shrink-0 text-muted transition-transform duration-200 motion-reduce:transition-none sm:block", M.value && "rotate-180"]),
|
|
166
|
+
"aria-hidden": "true"
|
|
167
|
+
}, null, 8, ["class"])) : s("", !0)
|
|
168
|
+
], 42, ce), (v(), o(r, { to: "body" }, [d(i, {
|
|
161
169
|
"enter-active-class": "transition duration-150 ease-out motion-reduce:transition-none",
|
|
162
|
-
"enter-from-class": "opacity-0
|
|
170
|
+
"enter-from-class": "opacity-0 scale-95",
|
|
163
171
|
"leave-active-class": "transition duration-100 ease-in",
|
|
164
172
|
"leave-to-class": "opacity-0"
|
|
165
173
|
}, {
|
|
166
|
-
default: T(() => [M.value ? (
|
|
174
|
+
default: T(() => [M.value ? (v(), c("div", {
|
|
167
175
|
key: 0,
|
|
168
|
-
id:
|
|
176
|
+
id: R,
|
|
169
177
|
ref_key: "panel",
|
|
170
|
-
ref:
|
|
178
|
+
ref: B,
|
|
171
179
|
role: "menu",
|
|
172
|
-
"aria-labelledby":
|
|
173
|
-
class: "fixed z-[90] w-
|
|
174
|
-
style:
|
|
175
|
-
top:
|
|
176
|
-
bottom:
|
|
177
|
-
right: `${
|
|
180
|
+
"aria-labelledby": L,
|
|
181
|
+
class: "fixed z-[90] w-76 max-w-[calc(100vw-16px)] origin-top-right overflow-hidden rounded-14 border border-border bg-surface p-2 shadow-lg",
|
|
182
|
+
style: ee({
|
|
183
|
+
top: H.value.top === void 0 ? void 0 : `${H.value.top}px`,
|
|
184
|
+
bottom: H.value.bottom === void 0 ? void 0 : `${H.value.bottom}px`,
|
|
185
|
+
right: `${H.value.right}px`
|
|
178
186
|
}),
|
|
179
187
|
"data-ac-ds": "",
|
|
180
188
|
"data-testid": "ac-user-menu-panel",
|
|
181
|
-
onKeydown:
|
|
189
|
+
onKeydown: Te
|
|
182
190
|
}, [
|
|
183
|
-
(
|
|
191
|
+
(v(), o(x(f.profileUrl ? "a" : "div"), {
|
|
184
192
|
href: f.profileUrl || void 0,
|
|
185
193
|
role: f.profileUrl ? "menuitem" : "presentation",
|
|
186
194
|
tabindex: f.profileUrl ? -1 : void 0,
|
|
187
|
-
class:
|
|
195
|
+
class: _(["flex items-center gap-3 rounded-8 px-3 py-2.5 no-underline outline-none", f.profileUrl && "transition-colors duration-150 hover:bg-accent-hover focus-visible:bg-accent-hover focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"])
|
|
188
196
|
}, {
|
|
189
|
-
default: T(() => [l("span",
|
|
197
|
+
default: T(() => [l("span", de, [W.value ? (v(), c("img", {
|
|
190
198
|
key: 0,
|
|
191
199
|
src: f.avatarUrl,
|
|
192
200
|
alt: "",
|
|
193
201
|
class: "size-full object-cover",
|
|
194
|
-
onError: p[2] ||= (e) =>
|
|
195
|
-
}, null, 40,
|
|
202
|
+
onError: p[2] ||= (e) => V.value = !0
|
|
203
|
+
}, null, 40, fe)) : (v(), c(n, { key: 1 }, [u(S(U.value), 1)], 64))]), l("span", pe, [l("span", me, S(f.name), 1), f.email ? (v(), c("span", he, S(f.email), 1)) : s("", !0)])]),
|
|
196
204
|
_: 1
|
|
197
205
|
}, 8, [
|
|
198
206
|
"href",
|
|
@@ -200,51 +208,51 @@ var se = {
|
|
|
200
208
|
"tabindex",
|
|
201
209
|
"class"
|
|
202
210
|
])),
|
|
203
|
-
f.items.length || a.$slots.default ? (
|
|
211
|
+
f.items.length || a.$slots.default ? (v(), c("div", ge, [(v(!0), c(n, null, b(f.items, (e) => (v(), o(x(G(e)), h({ key: e.label }, { ref_for: !0 }, Ce(e), {
|
|
204
212
|
role: "menuitem",
|
|
205
213
|
tabindex: "-1",
|
|
206
|
-
class:
|
|
207
|
-
onClick: (t) =>
|
|
214
|
+
class: P,
|
|
215
|
+
onClick: (t) => Ee(e)
|
|
208
216
|
}), {
|
|
209
|
-
default: T(() => [e.icon ? (
|
|
217
|
+
default: T(() => [e.icon ? (v(), o(x(e.icon), {
|
|
210
218
|
key: 0,
|
|
211
219
|
"aria-hidden": "true"
|
|
212
|
-
})) : s("", !0), l("span",
|
|
220
|
+
})) : s("", !0), l("span", _e, S(e.label), 1)]),
|
|
213
221
|
_: 2
|
|
214
|
-
}, 1040, ["onClick"]))), 128)),
|
|
215
|
-
close:
|
|
216
|
-
itemClass:
|
|
222
|
+
}, 1040, ["onClick"]))), 128)), ne(a.$slots, "default", {
|
|
223
|
+
close: X,
|
|
224
|
+
itemClass: P
|
|
217
225
|
})])) : s("", !0),
|
|
218
|
-
f.showThemeMode ? (
|
|
226
|
+
f.showThemeMode ? (v(), c("div", {
|
|
219
227
|
key: 1,
|
|
220
228
|
role: "group",
|
|
221
|
-
"aria-labelledby": `${C(
|
|
222
|
-
class: "border-t border-border
|
|
229
|
+
"aria-labelledby": `${C(I)}-theme`,
|
|
230
|
+
class: "mt-1 border-t border-border px-1 pt-2 pb-1"
|
|
223
231
|
}, [l("p", {
|
|
224
|
-
id: `${C(
|
|
225
|
-
class: "mb-
|
|
226
|
-
}, "Theme", 8,
|
|
232
|
+
id: `${C(I)}-theme`,
|
|
233
|
+
class: "mb-2 px-2 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
|
|
234
|
+
}, "Theme", 8, ye), d(t, {
|
|
227
235
|
display: "labels",
|
|
228
236
|
"onSet:theme": p[3] ||= (e) => N("set:theme", e)
|
|
229
|
-
})], 8,
|
|
230
|
-
f.showFontScale ? (
|
|
237
|
+
})], 8, ve)) : s("", !0),
|
|
238
|
+
f.showFontScale ? (v(), c("div", {
|
|
231
239
|
key: 2,
|
|
232
240
|
role: "group",
|
|
233
|
-
"aria-labelledby": `${C(
|
|
234
|
-
class: "border-t border-border
|
|
241
|
+
"aria-labelledby": `${C(I)}-scale`,
|
|
242
|
+
class: "mt-1 border-t border-border px-1 pt-2 pb-1"
|
|
235
243
|
}, [l("p", {
|
|
236
|
-
id: `${C(
|
|
237
|
-
class: "mb-
|
|
238
|
-
}, "Text size", 8,
|
|
239
|
-
l("div", O, [(
|
|
244
|
+
id: `${C(I)}-scale`,
|
|
245
|
+
class: "mb-2 px-2 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
|
|
246
|
+
}, "Text size", 8, xe), d(e, { display: "labels" })], 8, be)) : s("", !0),
|
|
247
|
+
l("div", O, [(v(), o(x(f.logoutUrl ? "a" : "button"), {
|
|
240
248
|
href: f.logoutUrl || void 0,
|
|
241
249
|
type: f.logoutUrl ? void 0 : "button",
|
|
242
250
|
role: "menuitem",
|
|
243
251
|
tabindex: "-1",
|
|
244
|
-
class:
|
|
252
|
+
class: _(Se),
|
|
245
253
|
"data-ac-ds": "",
|
|
246
254
|
"data-testid": "ac-user-menu-logout",
|
|
247
|
-
onClick:
|
|
255
|
+
onClick: De
|
|
248
256
|
}, {
|
|
249
257
|
default: T(() => [d(C(oe), { "aria-hidden": "true" }), l("span", null, S(f.logoutLabel), 1)]),
|
|
250
258
|
_: 1
|
|
@@ -6,17 +6,21 @@ export { default as AcAvatar } from "./AcAvatar.vue";
|
|
|
6
6
|
export { default as AcBadge } from "./AcBadge.vue";
|
|
7
7
|
export { default as AcBanner } from "./AcBanner.vue";
|
|
8
8
|
export { default as AcBreadcrumb } from "./AcBreadcrumb.vue";
|
|
9
|
+
export { default as AcBulkActionBar } from "./AcBulkActionBar.vue";
|
|
9
10
|
export { default as AcButton } from "./AcButton.vue";
|
|
10
11
|
export { default as AcButtons } from "./AcButtons.vue";
|
|
11
12
|
export { default as AcCard } from "./AcCard.vue";
|
|
12
|
-
export { default as AcPage } from "./AcPage.vue";
|
|
13
13
|
export { default as AcCellValue } from "./AcCellValue.vue";
|
|
14
14
|
export { default as AcCheckBox } from "./AcCheckBox.vue";
|
|
15
15
|
export { default as AcCheckRadio } from "./AcCheckRadio.vue";
|
|
16
|
+
export { default as AcCircularProgress } from "./AcCircularProgress.vue";
|
|
16
17
|
export { default as AcClusterSwitcher } from "./AcClusterSwitcher.vue";
|
|
18
|
+
export { default as AcColorInput } from "./AcColorInput.vue";
|
|
19
|
+
export { default as AcConfirmModal } from "./AcConfirmModal.vue";
|
|
17
20
|
export { default as AcContentHeader } from "./AcContentHeader.vue";
|
|
18
21
|
export { default as AcContentLayout } from "./AcContentLayout.vue";
|
|
19
22
|
export { default as AcContentTable } from "./AcContentTable.vue";
|
|
23
|
+
export { default as AcCopyButton } from "./AcCopyButton.vue";
|
|
20
24
|
export { default as AcDatePicker } from "./AcDatePicker.vue";
|
|
21
25
|
export { default as AcDeleteConfirmationModal } from "./AcDeleteModal.vue";
|
|
22
26
|
export { default as AcDeleteModal } from "./AcDeleteModal.vue";
|
|
@@ -27,6 +31,8 @@ export { default as AcDropdownItem } from "./AcDropdownItem.vue";
|
|
|
27
31
|
export { default as AcEmptyState } from "./AcEmptyState.vue";
|
|
28
32
|
export { default as AcFeatureCard } from "./AcFeatureCard.vue";
|
|
29
33
|
export { default as AcFileUpload } from "./AcFileUpload.vue";
|
|
34
|
+
export { default as AcFontScale } from "./AcFontScale.vue";
|
|
35
|
+
export { default as AcFooter } from "./AcFooter.vue";
|
|
30
36
|
export { default as AcForm } from "./AcForm.vue";
|
|
31
37
|
export { default as AcFormArray } from "./AcFormArray.vue";
|
|
32
38
|
export { default as AcFormFooter } from "./AcFormFooter.vue";
|
|
@@ -37,11 +43,15 @@ export { default as AcHeaderItems } from "./AcHeaderItems.vue";
|
|
|
37
43
|
export { default as AcInfoTable } from "./AcInfoTable.vue";
|
|
38
44
|
export { default as AcInput } from "./AcInput.vue";
|
|
39
45
|
export { default as AcKbd } from "./AcKbd.vue";
|
|
46
|
+
export { default as AcKeyValueInput } from "./AcKeyValueInput.vue";
|
|
47
|
+
export { default as AcLocaleSwitcher } from "./AcLocaleSwitcher.vue";
|
|
40
48
|
export { default as AcLogo } from "./AcLogo.vue";
|
|
41
49
|
export { default as AcModal } from "./AcModal.vue";
|
|
42
50
|
export { default as AcNavbar } from "./AcNavbar.vue";
|
|
43
51
|
export { default as AcNavbarItem } from "./AcNavbarItem.vue";
|
|
44
52
|
export { default as AcNotificationMenu } from "./AcNotificationMenu.vue";
|
|
53
|
+
export { default as AcNumberInput } from "./AcNumberInput.vue";
|
|
54
|
+
export { default as AcPage } from "./AcPage.vue";
|
|
45
55
|
export { default as AcPagination } from "./AcPagination.vue";
|
|
46
56
|
export { default as AcPreloader } from "./AcPreloader.vue";
|
|
47
57
|
export { default as AcProgress } from "./AcProgress.vue";
|
|
@@ -62,12 +72,14 @@ export { default as AcStatCard } from "./AcStatCard.vue";
|
|
|
62
72
|
export { default as AcStatusBar } from "./AcStatusBar.vue";
|
|
63
73
|
export { default as AcSteps } from "./AcSteps.vue";
|
|
64
74
|
export { default as AcSwitch } from "./AcSwitch.vue";
|
|
75
|
+
export { default as AcSwitchCard } from "./AcSwitchCard.vue";
|
|
65
76
|
export { default as AcTable } from "./AcTable.vue";
|
|
66
77
|
export { default as AcTabs } from "./AcTabs.vue";
|
|
67
78
|
export { default as AcTag } from "./AcTag.vue";
|
|
79
|
+
export { default as AcTagInput } from "./AcTagInput.vue";
|
|
68
80
|
export { default as AcTextarea } from "./AcTextarea.vue";
|
|
69
81
|
export { default as AcThemeMode } from "./AcThemeMode.vue";
|
|
70
|
-
export { default as
|
|
82
|
+
export { default as AcTimePicker } from "./AcTimePicker.vue";
|
|
71
83
|
export { default as AcToaster } from "./AcToaster.vue";
|
|
72
84
|
export { default as AcTooltip } from "./AcTooltip.vue";
|
|
73
85
|
export { default as AcUsageCard } from "./AcUsageCard.vue";
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** Colour of a status. The names match AcBadge's `color`, so `statusMeta(s).tone` can be passed straight to it. */
|
|
2
|
+
export type StatusTone = "success" | "info" | "warning" | "danger" | "pending" | "default";
|
|
3
|
+
/** How a raw state is shown: its colour, a human label and whether it's mid-transition. */
|
|
4
|
+
export interface StatusMeta {
|
|
5
|
+
/** Colour of the badge: `success`, `info`, `warning`, `danger`, `pending` or `default` (neutral). */
|
|
6
|
+
tone: StatusTone;
|
|
7
|
+
/** Human label in sentence case, e.g. "Pending provisioning". */
|
|
8
|
+
label: string;
|
|
9
|
+
/** The resource is changing state (provisioning, deleting…); badges pulse their dot. */
|
|
10
|
+
transient: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface StatusMetaOptions {
|
|
13
|
+
/** Enum prefix to strip before matching, e.g. `VPC_STATE` turns `VPC_STATE_AVAILABLE` into "Available". */
|
|
14
|
+
prefix?: string;
|
|
15
|
+
/** Label to show instead of the humanized state. */
|
|
16
|
+
label?: string;
|
|
17
|
+
}
|
|
18
|
+
/** `"PENDING_PROVISIONING"` → `"pending_provisioning"`, `"NotReady"` → `"not_ready"`, and strips `prefix` (`VPC_STATE`). */
|
|
19
|
+
export declare function normalizeState(state: string, prefix?: string): string;
|
|
20
|
+
/** `"pending_provisioning"` → `"Pending provisioning"`. */
|
|
21
|
+
export declare function humanizeState(key: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Resolves a raw API state ("RUNNING", "VPC_STATE_AVAILABLE", "pending_provisioning", "NotReady") to a tone,
|
|
24
|
+
* a sentence-case label and whether it's transient. Unknown states are neutral, never shown as healthy.
|
|
25
|
+
*/
|
|
26
|
+
export declare function statusMeta(state: string | null | undefined, options?: StatusMetaOptions): StatusMeta;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
//#region src/lib/components/status.ts
|
|
2
|
+
var e = [
|
|
3
|
+
[
|
|
4
|
+
"success",
|
|
5
|
+
!1,
|
|
6
|
+
/* @__PURE__ */ "running.active.available.connected.healthy.up.succeeded.success.successful.ready.attached.enabled.completed.complete.online.bound.in_use.paid.accepted.joined.verified.approved.open.allocated.created.in_sync.current.provisioned.synced.true".split(".")
|
|
7
|
+
],
|
|
8
|
+
[
|
|
9
|
+
"info",
|
|
10
|
+
!0,
|
|
11
|
+
/* @__PURE__ */ "provisioning.pending_provisioning.creating.starting.updating.modifying.upgrading.resizing.restarting.rebooting.attaching.detaching.migrating.in_progress.processing.importing.uploading.scaling.initializing.syncing.connecting.associating.disassociating.recycling.expanding.allocating.initial.progressing".split(".")
|
|
12
|
+
],
|
|
13
|
+
[
|
|
14
|
+
"warning",
|
|
15
|
+
!0,
|
|
16
|
+
[
|
|
17
|
+
"stopping",
|
|
18
|
+
"shutting_down",
|
|
19
|
+
"draining",
|
|
20
|
+
"powering_off"
|
|
21
|
+
]
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
"danger",
|
|
25
|
+
!0,
|
|
26
|
+
[
|
|
27
|
+
"deleting",
|
|
28
|
+
"terminating",
|
|
29
|
+
"destroying",
|
|
30
|
+
"removing",
|
|
31
|
+
"pending_delete",
|
|
32
|
+
"tearing_down"
|
|
33
|
+
]
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
"warning",
|
|
37
|
+
!1,
|
|
38
|
+
[
|
|
39
|
+
"degraded",
|
|
40
|
+
"warning",
|
|
41
|
+
"suspended",
|
|
42
|
+
"impaired",
|
|
43
|
+
"expiring",
|
|
44
|
+
"partial",
|
|
45
|
+
"overdue",
|
|
46
|
+
"out_of_sync",
|
|
47
|
+
"halted",
|
|
48
|
+
"paused"
|
|
49
|
+
]
|
|
50
|
+
],
|
|
51
|
+
[
|
|
52
|
+
"danger",
|
|
53
|
+
!1,
|
|
54
|
+
[
|
|
55
|
+
"failed",
|
|
56
|
+
"failure",
|
|
57
|
+
"error",
|
|
58
|
+
"down",
|
|
59
|
+
"unhealthy",
|
|
60
|
+
"critical",
|
|
61
|
+
"rejected",
|
|
62
|
+
"disconnected",
|
|
63
|
+
"not_connected",
|
|
64
|
+
"unreachable",
|
|
65
|
+
"expired",
|
|
66
|
+
"cancelled",
|
|
67
|
+
"canceled",
|
|
68
|
+
"not_ready",
|
|
69
|
+
"crash_loop_back_off",
|
|
70
|
+
"lost",
|
|
71
|
+
"false"
|
|
72
|
+
]
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
"pending",
|
|
76
|
+
!1,
|
|
77
|
+
[
|
|
78
|
+
"pending",
|
|
79
|
+
"queued",
|
|
80
|
+
"waiting",
|
|
81
|
+
"invited",
|
|
82
|
+
"scheduled",
|
|
83
|
+
"requested",
|
|
84
|
+
"pending_acceptance"
|
|
85
|
+
]
|
|
86
|
+
]
|
|
87
|
+
], t = /* @__PURE__ */ new Map();
|
|
88
|
+
for (let [n, r, i] of e) for (let e of i) t.set(e.replace(/_/g, ""), {
|
|
89
|
+
tone: n,
|
|
90
|
+
transient: r
|
|
91
|
+
});
|
|
92
|
+
function n(e, t) {
|
|
93
|
+
let n = (e) => e.trim().replace(/([a-z\d])([A-Z])/g, "$1_$2").toLowerCase().replace(/[\s-]+/g, "_"), r = n(e), i = t ? n(t).replace(/_+$/, "") : "";
|
|
94
|
+
return i && r.startsWith(`${i}_`) && (r = r.slice(i.length + 1)), r;
|
|
95
|
+
}
|
|
96
|
+
function r(e) {
|
|
97
|
+
if (e === "unspecified" || e === "state_unspecified") return "Unknown";
|
|
98
|
+
let t = e.replace(/_+/g, " ").trim();
|
|
99
|
+
return t ? t.charAt(0).toUpperCase() + t.slice(1) : "Unknown";
|
|
100
|
+
}
|
|
101
|
+
function i(e, i = {}) {
|
|
102
|
+
let a = e ? n(e, i.prefix) : "unknown", o = i.label ?? r(a), s = t.get(a.replace(/_/g, ""));
|
|
103
|
+
return {
|
|
104
|
+
tone: s?.tone ?? "default",
|
|
105
|
+
label: o,
|
|
106
|
+
transient: s?.transient ?? !1
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { r as humanizeState, n as normalizeState, i as statusMeta };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copies text to the clipboard. Uses the async Clipboard API, which browsers only expose on
|
|
3
3
|
* HTTPS and localhost, and falls back to a hidden textarea + `execCommand("copy")` so copying
|
|
4
|
-
* still works on plain-HTTP hosts such as `http://bb.test
|
|
4
|
+
* still works on plain-HTTP hosts such as `http://bb.test`, or when the API rejects (permission denied).
|
|
5
|
+
* Throws when both are blocked.
|
|
5
6
|
*/
|
|
6
7
|
export declare function copyText(text: string): Promise<void>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
//#region src/lib/composables/copyText.ts
|
|
2
2
|
async function e(e) {
|
|
3
|
-
if (navigator.clipboard?.writeText) {
|
|
3
|
+
if (navigator.clipboard?.writeText) try {
|
|
4
4
|
await navigator.clipboard.writeText(e);
|
|
5
5
|
return;
|
|
6
|
-
}
|
|
6
|
+
} catch {}
|
|
7
7
|
let t = document.createElement("textarea");
|
|
8
8
|
t.value = e, t.setAttribute("readonly", ""), t.style.cssText = "position:fixed;top:0;left:0;opacity:0", document.body.appendChild(t), t.select();
|
|
9
9
|
try {
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ComputedRef, MaybeRefOrGetter, Ref } from "vue";
|
|
2
|
+
export interface UseApiPaginationOptions {
|
|
3
|
+
/** Rows per page to start with. Default 10. */
|
|
4
|
+
pageSize?: number;
|
|
5
|
+
/** The next-page token of the latest response, e.g. `() => data.value?.pagination?.nextPageToken`. An empty string means it's the last page; `undefined` (still loading) is ignored. Without it, call `setNextToken` yourself. */
|
|
6
|
+
nextToken?: MaybeRefOrGetter<string | null | undefined>;
|
|
7
|
+
/** Total rows, when the API returns one. Passed on to AcPagination's `total`; bigint is accepted. */
|
|
8
|
+
total?: MaybeRefOrGetter<number | bigint | null | undefined>;
|
|
9
|
+
/** Rows in the latest response, for the "Showing 41–60" summary when there's no total. */
|
|
10
|
+
itemsOnPage?: MaybeRefOrGetter<number | bigint | null | undefined>;
|
|
11
|
+
}
|
|
12
|
+
export interface ApiPaginationProps {
|
|
13
|
+
total?: number;
|
|
14
|
+
hasNext: boolean;
|
|
15
|
+
hasPrev: boolean;
|
|
16
|
+
knownPages: number[];
|
|
17
|
+
itemsOnPage?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface ApiPagination {
|
|
20
|
+
/** The current page, from 1. Bind to AcPagination with `v-model:page`; pages without a cached token are refused. */
|
|
21
|
+
page: Ref<number>;
|
|
22
|
+
/** Rows per page. Bind with `v-model:page-size`; a change goes back to page 1 and forgets the tokens. */
|
|
23
|
+
pageSize: Ref<number>;
|
|
24
|
+
/** The token to request the current page with. Empty on page 1. */
|
|
25
|
+
pageToken: ComputedRef<string>;
|
|
26
|
+
/** Cached tokens by page number. Page 1 is always `""`. */
|
|
27
|
+
tokens: Readonly<Ref<Readonly<Record<number, string>>>>;
|
|
28
|
+
/** Pages with a cached token, so the viewer can jump to them. */
|
|
29
|
+
knownPages: ComputedRef<number[]>;
|
|
30
|
+
hasNext: ComputedRef<boolean>;
|
|
31
|
+
hasPrev: ComputedRef<boolean>;
|
|
32
|
+
/** Moves to the next page if its token is known. */
|
|
33
|
+
next: () => void;
|
|
34
|
+
/** Moves to the previous page. */
|
|
35
|
+
prev: () => void;
|
|
36
|
+
/** Moves to `page` if its token is known; returns whether it moved. */
|
|
37
|
+
goTo: (page: number) => boolean;
|
|
38
|
+
/** Goes back to page 1 and forgets every token. Call it when a filter or search changes. */
|
|
39
|
+
reset: () => void;
|
|
40
|
+
/** Records the next-page token from a response for `forPage` (default the current page). `""` marks it as the last page. */
|
|
41
|
+
setNextToken: (token: string | null | undefined, forPage?: number) => void;
|
|
42
|
+
/** AcPagination props that aren't models: `v-bind="paginationProps"`. */
|
|
43
|
+
paginationProps: ComputedRef<ApiPaginationProps>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Tracks token (cursor) paging for an API that returns a next-page token instead of offsets.
|
|
47
|
+
*
|
|
48
|
+
* It doesn't fetch. Request the page with `pageSize` and `pageToken`, and feed the response's
|
|
49
|
+
* next-page token back through `nextToken` (or `setNextToken`). Each token is cached under its page
|
|
50
|
+
* number, so visited pages can be jumped to. Bind it to AcPagination:
|
|
51
|
+
* `<AcPagination v-model:page="page" v-model:page-size="pageSize" v-bind="paginationProps" />`.
|
|
52
|
+
*
|
|
53
|
+
* @param options Start page size, and getters for the response's next token, total and row count. A number sets only the page size.
|
|
54
|
+
*/
|
|
55
|
+
export declare function useApiPagination(options?: UseApiPaginationOptions | number): ApiPagination;
|