@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,7 +1,7 @@
|
|
|
1
1
|
export interface Props {
|
|
2
|
-
/** Heading, e.g. "Delete
|
|
2
|
+
/** Heading, e.g. "Delete database". */
|
|
3
3
|
title?: string;
|
|
4
|
-
/** The question. The item name
|
|
4
|
+
/** The question. The item name follows it in bold monospace. */
|
|
5
5
|
message?: string;
|
|
6
6
|
/** Name of the thing being deleted, e.g. `demo-postgres`. */
|
|
7
7
|
itemName?: string;
|
|
@@ -9,7 +9,7 @@ export interface Props {
|
|
|
9
9
|
detail?: string;
|
|
10
10
|
/** Label of the destructive button. */
|
|
11
11
|
confirmText?: string;
|
|
12
|
-
/**
|
|
12
|
+
/** Shows `itemName` in a code chip and requires typing it before the delete button enables. Use for irreversible deletes. */
|
|
13
13
|
confirmByTyping?: boolean;
|
|
14
14
|
/** Shows a spinner on the delete button and blocks closing while the request runs. */
|
|
15
15
|
loading?: boolean;
|
|
@@ -36,9 +36,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
36
36
|
title: string;
|
|
37
37
|
loading: boolean;
|
|
38
38
|
message: string;
|
|
39
|
+
confirmText: string;
|
|
39
40
|
itemName: string;
|
|
40
41
|
detail: string;
|
|
41
|
-
confirmText: string;
|
|
42
42
|
confirmByTyping: boolean;
|
|
43
43
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
44
44
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
import e from "./AcButton.js";
|
|
2
2
|
import t from "./AcModal.js";
|
|
3
3
|
import n from "./AcInput.js";
|
|
4
|
-
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeModels as f, openBlock as p, ref as m, renderSlot as h, toDisplayString as g,
|
|
5
|
-
import { Trash2 as x } from "@lucide/vue";
|
|
4
|
+
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeModels as f, openBlock as p, ref as m, renderSlot as h, toDisplayString as g, useModel as _, watch as v, withCtx as y } from "vue";
|
|
6
5
|
//#region src/lib/components/AcDeleteModal.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
8
|
-
class: "inline-flex size-10 shrink-0 items-center justify-center rounded-full bg-red-95 text-red-40 ring-8 ring-red-97",
|
|
9
|
-
"aria-hidden": "true"
|
|
10
|
-
}, w = { class: "min-w-0 flex-1 pt-0.5" }, T = { class: "text-lg leading-6 text-heading" }, E = { class: "font-semibold break-all" }, D = {
|
|
6
|
+
var b = { class: "flex flex-col gap-5" }, x = { class: "text-base text-body" }, S = { class: "font-mono font-semibold break-all text-heading" }, C = {
|
|
11
7
|
key: 0,
|
|
12
|
-
class: "mt-1 text-base text-
|
|
13
|
-
},
|
|
14
|
-
key:
|
|
15
|
-
class: "
|
|
16
|
-
},
|
|
17
|
-
key: 2,
|
|
18
|
-
class: "mt-4"
|
|
19
|
-
}, M = /*@__PURE__*/ d({
|
|
8
|
+
class: "mt-1.5 text-base text-muted"
|
|
9
|
+
}, w = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "flex flex-col gap-2"
|
|
12
|
+
}, T = { class: "self-start rounded-8 bg-surface-sunken px-2.5 py-1.5 font-mono text-base break-all text-heading" }, E = { key: 1 }, D = /*@__PURE__*/ d({
|
|
20
13
|
__name: "AcDeleteModal",
|
|
21
14
|
props: /*@__PURE__*/ f({
|
|
22
15
|
title: { default: "Delete" },
|
|
@@ -41,62 +34,60 @@ var S = { class: "flex gap-4" }, C = {
|
|
|
41
34
|
}),
|
|
42
35
|
emits: /*@__PURE__*/ f(["confirm", "cancel"], ["update:open"]),
|
|
43
36
|
setup(d, { emit: f }) {
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
let
|
|
47
|
-
|
|
37
|
+
let D = d, O = f, k = _(d, "open"), A = m("");
|
|
38
|
+
v(k, (e) => e && (A.value = ""));
|
|
39
|
+
let j = i(() => !D.confirmByTyping || A.value === D.itemName), M = () => {
|
|
40
|
+
k.value = !1, O("cancel");
|
|
48
41
|
};
|
|
49
42
|
return (i, f) => (p(), a(t, {
|
|
50
|
-
open:
|
|
51
|
-
"onUpdate:open": f[2] ||= (e) =>
|
|
43
|
+
open: k.value,
|
|
44
|
+
"onUpdate:open": f[2] ||= (e) => k.value = e,
|
|
52
45
|
title: d.title,
|
|
53
46
|
size: "small",
|
|
54
47
|
closable: !d.loading,
|
|
55
48
|
"close-on-outside-click": !d.loading,
|
|
56
|
-
onClose: f[3] ||= (e) =>
|
|
49
|
+
onClose: f[3] ||= (e) => O("cancel")
|
|
57
50
|
}, {
|
|
58
|
-
footer:
|
|
51
|
+
footer: y(() => [u(e, {
|
|
59
52
|
title: "Cancel",
|
|
60
53
|
color: "white",
|
|
61
54
|
disabled: d.loading,
|
|
62
55
|
"data-ac-ds": "",
|
|
63
56
|
"data-testid": "ac-delete-modal-cancel",
|
|
64
|
-
onClick:
|
|
57
|
+
onClick: M
|
|
65
58
|
}, null, 8, ["disabled"]), u(e, {
|
|
66
59
|
title: d.confirmText,
|
|
67
60
|
color: "danger",
|
|
68
61
|
loading: d.loading,
|
|
69
|
-
disabled: !
|
|
62
|
+
disabled: !j.value,
|
|
70
63
|
"data-ac-ds": "",
|
|
71
64
|
"data-testid": "ac-delete-modal-confirm",
|
|
72
|
-
onClick: f[1] ||= (e) =>
|
|
65
|
+
onClick: f[1] ||= (e) => O("confirm", d.itemName)
|
|
73
66
|
}, null, 8, [
|
|
74
67
|
"title",
|
|
75
68
|
"loading",
|
|
76
69
|
"disabled"
|
|
77
70
|
])]),
|
|
78
|
-
default:
|
|
79
|
-
|
|
80
|
-
"aria-hidden": "true"
|
|
81
|
-
})]), c("div", w, [
|
|
82
|
-
c("p", T, [
|
|
71
|
+
default: y(() => [c("div", b, [
|
|
72
|
+
c("div", null, [c("p", x, [
|
|
83
73
|
l(g(d.message), 1),
|
|
84
|
-
d.itemName ? (p(), s(r, { key: 0 }, [f[4] ||= l(g(" "), -1), c("strong",
|
|
74
|
+
d.itemName ? (p(), s(r, { key: 0 }, [f[4] ||= l(g(" "), -1), c("strong", S, g(d.itemName), 1)], 64)) : o("", !0),
|
|
85
75
|
f[5] ||= l("? ", -1)
|
|
86
|
-
]),
|
|
87
|
-
d.
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
76
|
+
]), d.detail ? (p(), s("p", C, g(d.detail), 1)) : o("", !0)]),
|
|
77
|
+
d.confirmByTyping && d.itemName ? (p(), s("div", w, [
|
|
78
|
+
f[6] ||= c("p", { class: "text-base text-muted" }, "To confirm, type the name below.", -1),
|
|
79
|
+
c("code", T, g(d.itemName), 1),
|
|
80
|
+
u(n, {
|
|
81
|
+
modelValue: A.value,
|
|
82
|
+
"onUpdate:modelValue": f[0] ||= (e) => A.value = e,
|
|
83
|
+
class: "mt-3",
|
|
84
|
+
label: "Resource name",
|
|
85
|
+
placeholder: "Enter the name",
|
|
86
|
+
autocomplete: "off"
|
|
87
|
+
}, null, 8, ["modelValue"])
|
|
88
|
+
])) : o("", !0),
|
|
89
|
+
i.$slots.default ? (p(), s("div", E, [h(i.$slots, "default")])) : o("", !0)
|
|
90
|
+
])]),
|
|
100
91
|
_: 3
|
|
101
92
|
}, 8, [
|
|
102
93
|
"open",
|
|
@@ -107,4 +98,4 @@ var S = { class: "flex gap-4" }, C = {
|
|
|
107
98
|
}
|
|
108
99
|
});
|
|
109
100
|
//#endregion
|
|
110
|
-
export {
|
|
101
|
+
export { D as default };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ChartTooltipSlotProps } from "../charts/ChartFrame.vue";
|
|
2
|
+
import type { ChartAccessor, ChartCategory, ChartDatum } from "../charts/shared";
|
|
3
|
+
export interface Props {
|
|
4
|
+
/** One row per segment, e.g. `{ engine: "Postgres", count: 42 }`. */
|
|
5
|
+
data: ChartDatum[];
|
|
6
|
+
/** The segment's key: a field name or a function. Also its name unless `categories` gives one. */
|
|
7
|
+
index?: ChartAccessor<string>;
|
|
8
|
+
/** The segment's size: a field name or a function. */
|
|
9
|
+
value?: ChartAccessor<number>;
|
|
10
|
+
/** Names and colours per segment key: `{ postgres: { name: "Postgres", color: "chart-1" } }`. Without it, keys are the names and colours follow `chart-1`, `chart-2`… in row order. */
|
|
11
|
+
categories?: Record<string, ChartCategory>;
|
|
12
|
+
/** Plot height in px; the ring's diameter fits it. */
|
|
13
|
+
height?: number;
|
|
14
|
+
/** Ring thickness in px. `0` draws a pie. */
|
|
15
|
+
arcWidth?: number;
|
|
16
|
+
/** Formats values in the legend, tooltip, centre and data table. Defaults to compact numbers: `1.2K`. */
|
|
17
|
+
valueFormatter?: (value: number) => string;
|
|
18
|
+
/** Legend to the `right` (it wraps below on narrow screens), `top`, `bottom`, or `none`. Clicking an entry hides or shows that segment. */
|
|
19
|
+
legend?: "top" | "bottom" | "right" | "none";
|
|
20
|
+
/** Shows each segment's value in the legend. */
|
|
21
|
+
legendValues?: boolean;
|
|
22
|
+
/** Small text under the centre value, e.g. "Databases". */
|
|
23
|
+
centerLabel?: string;
|
|
24
|
+
/** Big text in the ring's centre, e.g. the total. Use the `center` slot for anything richer. */
|
|
25
|
+
centerValue?: string | number;
|
|
26
|
+
/** Prints each segment's share (`38%`) beside the ring. Segments under 4% are left unlabelled so labels don't collide. */
|
|
27
|
+
arcLabels?: boolean;
|
|
28
|
+
/** Shows a tooltip with the segment's value and share on hover. */
|
|
29
|
+
tooltip?: boolean;
|
|
30
|
+
/** Shows a skeleton of the same height while data loads. */
|
|
31
|
+
loading?: boolean;
|
|
32
|
+
/** Text shown in place of the ring when `data` is empty or every value is 0. */
|
|
33
|
+
emptyText?: string;
|
|
34
|
+
/** Accessible name, e.g. "Databases by engine". Show the visible title in the surrounding card. */
|
|
35
|
+
title?: string;
|
|
36
|
+
/** A sentence for screen readers on what the chart shows. Defaults to each segment's share. */
|
|
37
|
+
description?: string;
|
|
38
|
+
}
|
|
39
|
+
type __VLS_Slots = {
|
|
40
|
+
/** Content in the ring's centre. Gets the visible total, raw and formatted. */
|
|
41
|
+
center?: (props: {
|
|
42
|
+
total: number;
|
|
43
|
+
formatted: string;
|
|
44
|
+
}) => unknown;
|
|
45
|
+
/** Replaces the tooltip body for the hovered segment. */
|
|
46
|
+
tooltip?: (props: ChartTooltipSlotProps) => unknown;
|
|
47
|
+
};
|
|
48
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
49
|
+
legend: "top" | "bottom" | "right" | "none";
|
|
50
|
+
title: string;
|
|
51
|
+
value: ChartAccessor<number>;
|
|
52
|
+
description: string;
|
|
53
|
+
height: number;
|
|
54
|
+
loading: boolean;
|
|
55
|
+
index: ChartAccessor<string>;
|
|
56
|
+
tooltip: boolean;
|
|
57
|
+
emptyText: string;
|
|
58
|
+
categories: Record<string, ChartCategory>;
|
|
59
|
+
arcWidth: number;
|
|
60
|
+
valueFormatter: (value: number) => string;
|
|
61
|
+
legendValues: boolean;
|
|
62
|
+
centerLabel: string;
|
|
63
|
+
centerValue: string | number;
|
|
64
|
+
arcLabels: boolean;
|
|
65
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
66
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
67
|
+
declare const _default: typeof __VLS_export;
|
|
68
|
+
export default _default;
|
|
69
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
70
|
+
new (): {
|
|
71
|
+
$slots: S;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import e from "../charts/ChartFrame.js";
|
|
2
|
+
import { chartColor as t, chartDuration as n, formatCompact as r, readValue as i } from "../charts/shared.js";
|
|
3
|
+
import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createSlots as u, createVNode as d, defineComponent as f, guardReactiveProps as p, normalizeProps as m, normalizeStyle as h, openBlock as g, ref as _, renderList as v, renderSlot as y, toDisplayString as b, unref as x, withCtx as S } from "vue";
|
|
4
|
+
import { ChartPie as C } from "@lucide/vue";
|
|
5
|
+
import { VisDonut as w, VisSingleContainer as T } from "@unovis/vue";
|
|
6
|
+
import { Donut as E } from "@unovis/ts";
|
|
7
|
+
//#region src/lib/components/AcDonutChart.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
+
var D = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "pointer-events-none absolute inset-0 flex flex-col items-center justify-center text-center"
|
|
11
|
+
}, O = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "text-2xl font-semibold tracking-tight text-heading tabular-nums"
|
|
14
|
+
}, k = {
|
|
15
|
+
key: 1,
|
|
16
|
+
class: "text-xs text-muted"
|
|
17
|
+
}, A = 24, j = .04, M = /*@__PURE__*/ f({
|
|
18
|
+
__name: "AcDonutChart",
|
|
19
|
+
props: {
|
|
20
|
+
data: {},
|
|
21
|
+
index: {
|
|
22
|
+
type: [String, Function],
|
|
23
|
+
default: "name"
|
|
24
|
+
},
|
|
25
|
+
value: {
|
|
26
|
+
type: [String, Function],
|
|
27
|
+
default: "value"
|
|
28
|
+
},
|
|
29
|
+
categories: { default: void 0 },
|
|
30
|
+
height: { default: 240 },
|
|
31
|
+
arcWidth: { default: 24 },
|
|
32
|
+
valueFormatter: {
|
|
33
|
+
type: Function,
|
|
34
|
+
default: void 0
|
|
35
|
+
},
|
|
36
|
+
legend: { default: "right" },
|
|
37
|
+
legendValues: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: !0
|
|
40
|
+
},
|
|
41
|
+
centerLabel: { default: "" },
|
|
42
|
+
centerValue: { default: "" },
|
|
43
|
+
arcLabels: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !1
|
|
46
|
+
},
|
|
47
|
+
tooltip: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: !0
|
|
50
|
+
},
|
|
51
|
+
loading: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: !1
|
|
54
|
+
},
|
|
55
|
+
emptyText: { default: "No data to show yet" },
|
|
56
|
+
title: { default: "" },
|
|
57
|
+
description: { default: "" }
|
|
58
|
+
},
|
|
59
|
+
setup(f) {
|
|
60
|
+
let M = f, N = n(), P = _([]), F = _(0), I = _(null), L = o(() => M.data.map((e, t) => String(i(e, t, M.index)))), R = o(() => M.data.map((e, t) => Math.max(0, Number(i(e, t, M.value)) || 0))), z = o(() => R.value.map((e, t) => P.value.includes(L.value[t]) ? 0 : e)), B = o(() => z.value.reduce((e, t) => e + t, 0)), V = o(() => L.value.map((e, n) => t(M.categories?.[e]?.color, n))), H = o(() => L.value.map((e) => M.categories?.[e]?.name ?? e));
|
|
61
|
+
function U(e) {
|
|
62
|
+
return M.valueFormatter ? M.valueFormatter(e) : r(e);
|
|
63
|
+
}
|
|
64
|
+
function W(e, t = B.value) {
|
|
65
|
+
return t ? `${Math.round(e / t * 100)}%` : "0%";
|
|
66
|
+
}
|
|
67
|
+
let G = o(() => L.value.map((e, t) => ({
|
|
68
|
+
key: e,
|
|
69
|
+
name: H.value[t],
|
|
70
|
+
color: V.value[t],
|
|
71
|
+
value: M.legendValues ? U(R.value[t]) : void 0
|
|
72
|
+
}))), K = o(() => R.value.reduce((e, t) => e + t, 0)), q = o(() => ({
|
|
73
|
+
columns: [
|
|
74
|
+
"Name",
|
|
75
|
+
"Value",
|
|
76
|
+
"Share"
|
|
77
|
+
],
|
|
78
|
+
rows: L.value.map((e, t) => [
|
|
79
|
+
H.value[t],
|
|
80
|
+
U(R.value[t]),
|
|
81
|
+
W(R.value[t], K.value)
|
|
82
|
+
])
|
|
83
|
+
})), J = o(() => {
|
|
84
|
+
let e = L.value.map((e, t) => `${H.value[t]} ${W(R.value[t], K.value)}`).join(", ");
|
|
85
|
+
return [M.title, M.description || `${L.value.length} segments: ${e}.`].filter(Boolean).join(". ");
|
|
86
|
+
}), Y = o(() => Math.min(F.value || M.height, M.height)), X = o(() => M.arcLabels ? Math.max(40, Y.value / 2 - A) : void 0), Z = o(() => {
|
|
87
|
+
if (!M.arcLabels || !B.value || !F.value) return [];
|
|
88
|
+
let e = (X.value ?? Y.value / 2) + A / 2 + 2, t = 0;
|
|
89
|
+
return z.value.flatMap((n, r) => {
|
|
90
|
+
let i = (t + n / 2) / B.value * 2 * Math.PI;
|
|
91
|
+
return t += n, n / B.value < j ? [] : [{
|
|
92
|
+
key: L.value[r],
|
|
93
|
+
text: W(n),
|
|
94
|
+
left: F.value / 2 + e * Math.sin(i),
|
|
95
|
+
top: M.height / 2 - e * Math.cos(i)
|
|
96
|
+
}];
|
|
97
|
+
});
|
|
98
|
+
}), Q = (e, t) => z.value[t], $ = (e, t) => V.value[t];
|
|
99
|
+
function ee(e, t) {
|
|
100
|
+
let n = e.index, r = z.value[n];
|
|
101
|
+
I.value = {
|
|
102
|
+
clientX: t.clientX,
|
|
103
|
+
clientY: t.clientY,
|
|
104
|
+
title: "",
|
|
105
|
+
items: [{
|
|
106
|
+
key: L.value[n],
|
|
107
|
+
name: H.value[n],
|
|
108
|
+
color: V.value[n],
|
|
109
|
+
value: r,
|
|
110
|
+
formatted: `${U(r)} (${W(r)})`
|
|
111
|
+
}],
|
|
112
|
+
datum: e.data,
|
|
113
|
+
index: n
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
function te() {
|
|
117
|
+
I.value = null;
|
|
118
|
+
}
|
|
119
|
+
let ne = { [E.selectors.segment]: {
|
|
120
|
+
mousemove: ee,
|
|
121
|
+
mouseleave: te
|
|
122
|
+
} };
|
|
123
|
+
return (t, n) => (g(), s(e, {
|
|
124
|
+
hidden: P.value,
|
|
125
|
+
"onUpdate:hidden": n[0] ||= (e) => P.value = e,
|
|
126
|
+
width: F.value,
|
|
127
|
+
"onUpdate:width": n[1] ||= (e) => F.value = e,
|
|
128
|
+
testid: "ac-donut-chart",
|
|
129
|
+
height: f.height,
|
|
130
|
+
loading: f.loading,
|
|
131
|
+
empty: !f.data.length || !K.value,
|
|
132
|
+
"empty-text": f.emptyText,
|
|
133
|
+
"empty-icon": x(C),
|
|
134
|
+
legend: f.legend,
|
|
135
|
+
"legend-items": G.value,
|
|
136
|
+
"legend-centered": "",
|
|
137
|
+
summary: J.value,
|
|
138
|
+
title: f.title,
|
|
139
|
+
description: f.description,
|
|
140
|
+
table: q.value,
|
|
141
|
+
tip: I.value,
|
|
142
|
+
tooltip: f.tooltip
|
|
143
|
+
}, u({
|
|
144
|
+
default: S(() => [
|
|
145
|
+
d(x(T), {
|
|
146
|
+
data: f.data,
|
|
147
|
+
height: f.height,
|
|
148
|
+
duration: x(N)
|
|
149
|
+
}, {
|
|
150
|
+
default: S(() => [d(x(w), {
|
|
151
|
+
value: Q,
|
|
152
|
+
color: $,
|
|
153
|
+
"arc-width": f.arcWidth,
|
|
154
|
+
radius: X.value,
|
|
155
|
+
"pad-angle": 0,
|
|
156
|
+
"corner-radius": f.arcWidth ? 2 : 0,
|
|
157
|
+
"show-background": !0,
|
|
158
|
+
events: f.tooltip ? ne : void 0
|
|
159
|
+
}, null, 8, [
|
|
160
|
+
"arc-width",
|
|
161
|
+
"radius",
|
|
162
|
+
"corner-radius",
|
|
163
|
+
"events"
|
|
164
|
+
])]),
|
|
165
|
+
_: 1
|
|
166
|
+
}, 8, [
|
|
167
|
+
"data",
|
|
168
|
+
"height",
|
|
169
|
+
"duration"
|
|
170
|
+
]),
|
|
171
|
+
t.$slots.center || f.centerValue !== "" || f.centerLabel ? (g(), l("div", D, [y(t.$slots, "center", {
|
|
172
|
+
total: B.value,
|
|
173
|
+
formatted: U(B.value)
|
|
174
|
+
}, () => [f.centerValue === "" ? c("", !0) : (g(), l("span", O, b(f.centerValue), 1)), f.centerLabel ? (g(), l("span", k, b(f.centerLabel), 1)) : c("", !0)])])) : c("", !0),
|
|
175
|
+
(g(!0), l(a, null, v(Z.value, (e) => (g(), l("span", {
|
|
176
|
+
key: e.key,
|
|
177
|
+
class: "pointer-events-none absolute -translate-x-1/2 -translate-y-1/2 text-xs font-medium text-muted tabular-nums",
|
|
178
|
+
style: h({
|
|
179
|
+
left: `${e.left}px`,
|
|
180
|
+
top: `${e.top}px`
|
|
181
|
+
}),
|
|
182
|
+
"aria-hidden": "true"
|
|
183
|
+
}, b(e.text), 5))), 128))
|
|
184
|
+
]),
|
|
185
|
+
_: 2
|
|
186
|
+
}, [t.$slots.tooltip ? {
|
|
187
|
+
name: "tooltip",
|
|
188
|
+
fn: S((e) => [y(t.$slots, "tooltip", m(p(e)))]),
|
|
189
|
+
key: "0"
|
|
190
|
+
} : void 0]), 1032, [
|
|
191
|
+
"hidden",
|
|
192
|
+
"width",
|
|
193
|
+
"height",
|
|
194
|
+
"loading",
|
|
195
|
+
"empty",
|
|
196
|
+
"empty-text",
|
|
197
|
+
"empty-icon",
|
|
198
|
+
"legend",
|
|
199
|
+
"legend-items",
|
|
200
|
+
"summary",
|
|
201
|
+
"title",
|
|
202
|
+
"description",
|
|
203
|
+
"table",
|
|
204
|
+
"tip",
|
|
205
|
+
"tooltip"
|
|
206
|
+
]));
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
//#endregion
|
|
210
|
+
export { M as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface Props {
|
|
2
|
-
/** Text of the default trigger button. Without it (and without a `trigger` slot) a ⋮ icon button is shown. */
|
|
2
|
+
/** Text of the default trigger button. Without it (and without a `trigger` slot) a 32px ⋮ icon button is shown. */
|
|
3
3
|
label?: string;
|
|
4
4
|
/** Accessible name of the menu and of the ⋮ trigger, e.g. "Actions for demo-postgres". */
|
|
5
5
|
menuLabel?: string;
|
|
@@ -44,9 +44,9 @@ var T = ["aria-label", "disabled"], E = ["aria-labelledby", "aria-label"], D = "
|
|
|
44
44
|
if (!L || !N.value) return;
|
|
45
45
|
let e = L.getBoundingClientRect(), t = `${Math.min(Math.max(e.width, 192), window.innerWidth - 16)}px`;
|
|
46
46
|
N.value.style.minWidth = t;
|
|
47
|
-
let { offsetWidth: n, offsetHeight: r } = N.value, i = window.innerHeight - e.bottom -
|
|
47
|
+
let { offsetWidth: n, offsetHeight: r } = N.value, i = window.innerHeight - e.bottom - 8 - 8, a = e.top - 8 - 8, o = c.placement === "top" ? a >= r || a > i : i < r && a > i, s = c.align === "end" ? e.right - n : e.left;
|
|
48
48
|
F.value = !o, P.value = {
|
|
49
|
-
[o ? "bottom" : "top"]: `${o ? window.innerHeight - e.top +
|
|
49
|
+
[o ? "bottom" : "top"]: `${o ? window.innerHeight - e.top + 8 : e.bottom + 8}px`,
|
|
50
50
|
left: `${Math.max(8, Math.min(s, window.innerWidth - n - 8))}px`,
|
|
51
51
|
minWidth: t,
|
|
52
52
|
maxHeight: `${Math.max(o ? a : i, 120)}px`
|
|
@@ -82,7 +82,7 @@ var T = ["aria-label", "disabled"], E = ["aria-labelledby", "aria-label"], D = "
|
|
|
82
82
|
M.value?.contains(t) || N.value?.contains(t) || G(!1);
|
|
83
83
|
}
|
|
84
84
|
function Q(e) {
|
|
85
|
-
e && N.value?.contains(e.target) || K();
|
|
85
|
+
e?.target instanceof Node && N.value?.contains(e.target) || K();
|
|
86
86
|
}
|
|
87
87
|
function $(e) {
|
|
88
88
|
e ? (document.addEventListener("pointerdown", Z, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q)) : (document.removeEventListener("pointerdown", Z, !0), window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q));
|
|
@@ -118,15 +118,15 @@ var T = ["aria-label", "disabled"], E = ["aria-labelledby", "aria-label"], D = "
|
|
|
118
118
|
type: "button",
|
|
119
119
|
"aria-label": s.menuLabel,
|
|
120
120
|
disabled: s.disabled,
|
|
121
|
-
class: u(["inline-flex size-
|
|
121
|
+
class: u(["inline-flex size-8 cursor-pointer items-center justify-center rounded-10 text-muted transition-colors duration-200 hover:bg-surface-sunken hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", O.value && "bg-surface-sunken text-heading"])
|
|
122
122
|
}, [o(y(w), {
|
|
123
123
|
class: "size-4",
|
|
124
124
|
"aria-hidden": "true"
|
|
125
125
|
})], 10, T)), (h(), r(t, { to: "body" }, [o(n, {
|
|
126
|
-
"enter-active-class": "transition duration-150 ease-out",
|
|
127
|
-
"enter-from-class": `opacity-0 motion-safe:scale-
|
|
128
|
-
"leave-active-class": "transition duration-100 ease-in",
|
|
129
|
-
"leave-to-class": "opacity-0"
|
|
126
|
+
"enter-active-class": "transition-[opacity,scale,translate] duration-150 ease-out motion-reduce:transition-none",
|
|
127
|
+
"enter-from-class": `opacity-0 motion-safe:scale-95 ${F.value ? "motion-safe:-translate-y-1" : "motion-safe:translate-y-1"}`,
|
|
128
|
+
"leave-active-class": "transition-[opacity,scale] duration-100 ease-in motion-reduce:transition-none",
|
|
129
|
+
"leave-to-class": "opacity-0 motion-safe:scale-95"
|
|
130
130
|
}, {
|
|
131
131
|
default: S(() => [O.value ? (h(), a("div", {
|
|
132
132
|
key: 0,
|
|
@@ -138,7 +138,7 @@ var T = ["aria-label", "disabled"], E = ["aria-labelledby", "aria-label"], D = "
|
|
|
138
138
|
"aria-orientation": "vertical",
|
|
139
139
|
"aria-labelledby": (k.trigger || s.label) && I.value ? I.value : void 0,
|
|
140
140
|
"aria-label": k.trigger || s.label ? void 0 : s.menuLabel,
|
|
141
|
-
class: u(["ac-scrollbar fixed z-[90] flex w-max max-w-[min(320px,calc(100vw-16px))] flex-col rounded-
|
|
141
|
+
class: u(["ac-scrollbar fixed z-[90] flex w-max max-w-[min(320px,calc(100vw-16px))] flex-col rounded-14 border border-border bg-surface p-2 shadow-lg outline-none", F.value ? "origin-top" : "origin-bottom"]),
|
|
142
142
|
style: d(P.value),
|
|
143
143
|
"data-ac-ds": "",
|
|
144
144
|
"data-testid": "ac-dropdown-menu",
|
|
@@ -2,7 +2,7 @@ import { createCommentVNode as e, createElementBlock as t, createElementVNode as
|
|
|
2
2
|
//#region src/lib/components/AcDropdownDivider.vue?vue&type=script&setup=true&lang.ts
|
|
3
3
|
var o = ["aria-label"], s = {
|
|
4
4
|
key: 0,
|
|
5
|
-
class: "px-
|
|
5
|
+
class: "px-3 pt-2 pb-1 text-sm font-semibold tracking-[0.08em] text-muted uppercase"
|
|
6
6
|
}, c = /*@__PURE__*/ r({
|
|
7
7
|
__name: "AcDropdownDivider",
|
|
8
8
|
props: { label: { default: "" } },
|
|
@@ -13,7 +13,7 @@ var o = ["aria-label"], s = {
|
|
|
13
13
|
class: "group",
|
|
14
14
|
"data-ac-ds": "",
|
|
15
15
|
"data-testid": "ac-dropdown-divider"
|
|
16
|
-
}, [l[0] ||= n("div", { class: "-mx-
|
|
16
|
+
}, [l[0] ||= n("div", { class: "-mx-2 my-1 h-px bg-border group-first:hidden" }, null, -1), r.label ? (i(), t("div", s, a(r.label), 1)) : e("", !0)], 8, o));
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
//#endregion
|
|
@@ -8,7 +8,7 @@ export interface Props {
|
|
|
8
8
|
icon?: Component;
|
|
9
9
|
/** Keyboard shortcut hint shown at the right, e.g. "⌘D". Display only; bind the key yourself. */
|
|
10
10
|
shortcut?: string;
|
|
11
|
-
/** Red text for destructive actions such as Delete. Confirm them before acting. */
|
|
11
|
+
/** Red text and a red hover tint for destructive actions such as Delete. Confirm them before acting. */
|
|
12
12
|
danger?: boolean;
|
|
13
13
|
/** Disables the item; it's skipped by the arrow keys. */
|
|
14
14
|
disabled?: boolean;
|
|
@@ -2,10 +2,10 @@ import { computed as e, createBlock as t, createCommentVNode as n, createElement
|
|
|
2
2
|
//#region src/lib/components/AcDropdownItem.vue?vue&type=script&setup=true&lang.ts
|
|
3
3
|
var g = { class: "min-w-0 flex-1" }, _ = { class: "block truncate" }, v = {
|
|
4
4
|
key: 0,
|
|
5
|
-
class: "block text-xs text-muted"
|
|
5
|
+
class: "mt-0.5 block text-xs text-muted"
|
|
6
6
|
}, y = {
|
|
7
7
|
key: 1,
|
|
8
|
-
class: "mt-0.5 shrink-0 font-sans text-xs text-muted"
|
|
8
|
+
class: "mt-0.5 shrink-0 font-sans text-xs text-muted tabular-nums"
|
|
9
9
|
}, b = /*@__PURE__*/ o({
|
|
10
10
|
__name: "AcDropdownItem",
|
|
11
11
|
props: {
|
|
@@ -53,7 +53,7 @@ var g = { class: "min-w-0 flex-1" }, _ = { class: "block truncate" }, v = {
|
|
|
53
53
|
disabled: T.value === "button" && o.disabled || void 0,
|
|
54
54
|
"aria-disabled": o.disabled || void 0,
|
|
55
55
|
"data-ac-label": o.label || void 0,
|
|
56
|
-
class: c(["flex w-full cursor-pointer items-start gap-2.5 rounded-
|
|
56
|
+
class: c(["flex w-full cursor-pointer items-start gap-2.5 rounded-8 px-3 py-2 text-left text-base no-underline outline-none select-none transition-colors duration-150 disabled:cursor-not-allowed disabled:opacity-50 motion-reduce:transition-none", o.danger ? "text-danger-strong focus:bg-danger/10" : "text-heading focus:bg-accent"]),
|
|
57
57
|
"data-ac-ds": "",
|
|
58
58
|
"data-testid": "ac-dropdown-item",
|
|
59
59
|
onClick: E,
|
|
@@ -12,8 +12,10 @@ export interface Props {
|
|
|
12
12
|
query?: string;
|
|
13
13
|
/** A Lucide icon component to replace the variant's default icon. */
|
|
14
14
|
icon?: Component;
|
|
15
|
-
/** `small` for inside a table or card, `normal` for a list area, `large` for a whole page. */
|
|
15
|
+
/** `small` for inside a table or card, `normal` for a list area, `large` for a whole page. Icon tiles are 48px, 64px and 64px. */
|
|
16
16
|
size?: "small" | "normal" | "large";
|
|
17
|
+
/** Draws a dashed 16px-round frame on the card surface (a red one for `error`), for a state that stands alone on the page rather than inside a card or table. */
|
|
18
|
+
framed?: boolean;
|
|
17
19
|
}
|
|
18
20
|
type __VLS_Slots = {
|
|
19
21
|
/** Replaces the icon, e.g. with an illustration. */
|
|
@@ -31,6 +33,7 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
31
33
|
icon: Component;
|
|
32
34
|
size: "small" | "normal" | "large";
|
|
33
35
|
query: string;
|
|
36
|
+
framed: boolean;
|
|
34
37
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
35
38
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
36
39
|
declare const _default: typeof __VLS_export;
|