@ac-design/design-system 2.0.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/charts/ChartFrame.vue.d.ts +2 -0
- package/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +42 -37
- package/dist/lib/charts/cartesian.d.ts +324 -0
- package/dist/lib/charts/cartesian.js +137 -0
- package/dist/lib/charts/echarts.d.ts +86 -0
- package/dist/lib/charts/echarts.js +173 -0
- package/dist/lib/charts/graph.d.ts +77 -0
- package/dist/lib/charts/graph.js +155 -0
- package/dist/lib/charts/index.d.ts +4 -0
- package/dist/lib/charts/index.js +3 -1
- package/dist/lib/charts/shared.d.ts +0 -7
- package/dist/lib/charts/shared.js +1 -19
- package/dist/lib/charts/xy.d.ts +11 -7
- package/dist/lib/charts/xy.js +53 -72
- package/dist/lib/compat.css +1322 -278
- package/dist/lib/components/AcAlert.vue.d.ts +9 -0
- package/dist/lib/components/AcAlert.vue_vue_type_script_setup_true_lang.js +121 -21
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcAreaChart.vue.d.ts +3 -0
- package/dist/lib/components/AcAreaChart.vue_vue_type_script_setup_true_lang.js +132 -142
- package/dist/lib/components/AcAvatar.vue.d.ts +7 -4
- package/dist/lib/components/AcAvatar.vue_vue_type_script_setup_true_lang.js +59 -54
- package/dist/lib/components/AcBadge.vue.d.ts +7 -3
- package/dist/lib/components/AcBadge.vue_vue_type_script_setup_true_lang.js +35 -28
- package/dist/lib/components/AcBarChart.vue.d.ts +3 -0
- package/dist/lib/components/AcBarChart.vue_vue_type_script_setup_true_lang.js +142 -146
- package/dist/lib/components/AcBreadcrumb.vue.d.ts +4 -1
- package/dist/lib/components/AcBreadcrumb.vue_vue_type_script_setup_true_lang.js +18 -17
- package/dist/lib/components/AcBulkActionBar.vue.d.ts +2 -0
- package/dist/lib/components/AcBulkActionBar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcButton.vue.d.ts +12 -6
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +85 -47
- package/dist/lib/components/AcCard.vue.d.ts +34 -3
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +169 -34
- package/dist/lib/components/AcCellValue.vue.d.ts +3 -3
- package/dist/lib/components/AcCellValue.vue_vue_type_script_setup_true_lang.js +171 -165
- package/dist/lib/components/AcCheckBox.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +58 -72
- package/dist/lib/components/AcCheckList.js +5 -0
- package/dist/lib/components/AcCheckList.vue.d.ts +45 -0
- package/dist/lib/components/AcCheckList.vue_vue_type_script_setup_true_lang.js +64 -0
- package/dist/lib/components/AcCheckRadio.vue.d.ts +30 -5
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +100 -36
- package/dist/lib/components/AcCircularProgress.vue.d.ts +4 -4
- package/dist/lib/components/AcCircularProgress.vue_vue_type_script_setup_true_lang.js +12 -9
- package/dist/lib/components/AcColorInput.vue.d.ts +5 -2
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +127 -97
- package/dist/lib/components/AcCommandBlock.js +5 -0
- package/dist/lib/components/AcCommandBlock.vue.d.ts +34 -0
- package/dist/lib/components/AcCommandBlock.vue_vue_type_script_setup_true_lang.js +88 -0
- package/dist/lib/components/AcConfirmModal.vue.d.ts +1 -1
- package/dist/lib/components/AcConfirmModal.vue_vue_type_script_setup_true_lang.js +7 -3
- package/dist/lib/components/AcCopyButton.vue.d.ts +2 -2
- package/dist/lib/components/AcCopyButton.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcCostSummary.js +5 -0
- package/dist/lib/components/AcCostSummary.vue.d.ts +102 -0
- package/dist/lib/components/AcCostSummary.vue_vue_type_script_setup_true_lang.js +179 -0
- package/dist/lib/components/AcDatePicker.vue.d.ts +3 -3
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +606 -380
- package/dist/lib/components/AcDeleteModal.vue_vue_type_script_setup_true_lang.js +47 -41
- package/dist/lib/components/AcDonutChart.vue.d.ts +10 -0
- package/dist/lib/components/AcDonutChart.vue_vue_type_script_setup_true_lang.js +116 -89
- package/dist/lib/components/AcDropdown.vue.d.ts +5 -2
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +88 -75
- package/dist/lib/components/AcDropdownDivider.vue_vue_type_script_setup_true_lang.js +11 -10
- package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
- package/dist/lib/components/AcDropdownItem.vue_vue_type_script_setup_true_lang.js +17 -17
- package/dist/lib/components/AcEmptyState.vue.d.ts +1 -1
- package/dist/lib/components/AcErrorState.js +5 -0
- package/dist/lib/components/AcErrorState.vue.d.ts +46 -0
- package/dist/lib/components/AcErrorState.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcFeatureCard.vue.d.ts +6 -0
- package/dist/lib/components/AcFeatureCard.vue_vue_type_script_setup_true_lang.js +136 -114
- package/dist/lib/components/AcFooter.vue.d.ts +1 -1
- package/dist/lib/components/AcFooter.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcFormFooter.vue.d.ts +1 -1
- package/dist/lib/components/AcFormSection.vue.d.ts +1 -1
- package/dist/lib/components/AcGraphChart.js +5 -0
- package/dist/lib/components/AcGraphChart.vue.d.ts +124 -0
- package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +578 -0
- package/dist/lib/components/AcHeader.vue.d.ts +20 -2
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +84 -26
- package/dist/lib/components/AcInfoTable.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +76 -79
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +4 -4
- package/dist/lib/components/AcKeyValueInput.vue_vue_type_script_setup_true_lang.js +199 -183
- package/dist/lib/components/AcLineChart.vue.d.ts +6 -0
- package/dist/lib/components/AcLineChart.vue_vue_type_script_setup_true_lang.js +113 -125
- package/dist/lib/components/AcLoader.js +5 -0
- package/dist/lib/components/AcLoader.vue.d.ts +15 -0
- package/dist/lib/components/AcLoader.vue_vue_type_script_setup_true_lang.js +66 -0
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +3 -1
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +44 -36
- package/dist/lib/components/AcMapChart.js +5 -0
- package/dist/lib/components/AcMapChart.vue.d.ts +136 -0
- package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +518 -0
- package/dist/lib/components/AcModal.vue.d.ts +6 -3
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +85 -61
- package/dist/lib/components/AcNavbar.vue.d.ts +8 -5
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +25 -17
- package/dist/lib/components/AcNavbarItem.vue.d.ts +2 -2
- package/dist/lib/components/AcNavbarItem.vue_vue_type_script_setup_true_lang.js +3 -4
- package/dist/lib/components/AcNotificationMenu.vue.d.ts +3 -3
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +133 -168
- package/dist/lib/components/AcNumberInput.vue.d.ts +2 -2
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +137 -147
- package/dist/lib/components/AcPage.vue.d.ts +2 -2
- package/dist/lib/components/AcPage.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcPagination.vue.d.ts +5 -5
- package/dist/lib/components/AcPagination.vue_vue_type_script_setup_true_lang.js +59 -56
- package/dist/lib/components/AcPreloader.vue.d.ts +3 -3
- package/dist/lib/components/AcPreloader.vue_vue_type_script_setup_true_lang.js +15 -16
- package/dist/lib/components/AcProductHero.js +5 -0
- package/dist/lib/components/AcProductHero.vue.d.ts +56 -0
- package/dist/lib/components/AcProductHero.vue_vue_type_script_setup_true_lang.js +95 -0
- package/dist/lib/components/AcProgress.vue.d.ts +17 -2
- package/dist/lib/components/AcProgress.vue_vue_type_script_setup_true_lang.js +83 -29
- package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
- package/dist/lib/components/AcResourceCard.vue_vue_type_script_setup_true_lang.js +4 -4
- package/dist/lib/components/AcSearchBar.vue.d.ts +1 -1
- package/dist/lib/components/AcSearchBar.vue_vue_type_script_setup_true_lang.js +8 -4
- package/dist/lib/components/AcSelect.vue.d.ts +3 -3
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +232 -243
- package/dist/lib/components/AcSettingsRow.js +5 -0
- package/dist/lib/components/AcSettingsRow.vue.d.ts +29 -0
- package/dist/lib/components/AcSettingsRow.vue_vue_type_script_setup_true_lang.js +37 -0
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +5 -5
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebar.vue.d.ts +4 -1
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +104 -94
- package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebarItem.vue_vue_type_script_setup_true_lang.js +42 -42
- package/dist/lib/components/AcSidebarSection.vue.d.ts +2 -2
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +23 -18
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcSwitch.vue.d.ts +3 -0
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +46 -39
- package/dist/lib/components/AcSwitchCard.vue.d.ts +3 -3
- package/dist/lib/components/AcSwitchCard.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +65 -65
- package/dist/lib/components/AcTabs.vue.d.ts +9 -2
- package/dist/lib/components/AcTabs.vue_vue_type_script_setup_true_lang.js +42 -27
- package/dist/lib/components/AcTag.vue.d.ts +1 -1
- package/dist/lib/components/AcTagInput.vue.d.ts +5 -5
- package/dist/lib/components/AcTagInput.vue_vue_type_script_setup_true_lang.js +140 -142
- package/dist/lib/components/AcTextarea.vue.d.ts +1 -1
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +69 -72
- package/dist/lib/components/AcThemeMode.vue.d.ts +3 -3
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +54 -22
- package/dist/lib/components/AcTimePicker.vue.d.ts +1 -1
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +177 -185
- package/dist/lib/components/AcToaster.vue.d.ts +6 -3
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +103 -64
- package/dist/lib/components/AcTooltip.vue.d.ts +34 -14
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +184 -70
- package/dist/lib/components/AcUserMenu.vue.d.ts +23 -1
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +181 -138
- package/dist/lib/components/index.d.ts +7 -0
- package/dist/lib/components/status.d.ts +3 -1
- package/dist/lib/components/status.js +20 -5
- package/dist/lib/composables/useToast.d.ts +17 -1
- package/dist/lib/composables/useToast.js +10 -2
- package/dist/lib/index.d.ts +7 -3
- package/dist/lib/index.js +80 -73
- package/dist/lib/theme.css +39 -54
- package/package.json +12 -3
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import e from "./
|
|
1
|
+
import e from "./AcSpinner.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,
|
|
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, normalizeClass as p, openBlock as m, ref as h, renderSlot as g, toDisplayString as _, useModel as v, watch as y, withCtx as b } from "vue";
|
|
5
5
|
//#region src/lib/components/AcDeleteModal.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
6
|
+
var x = {
|
|
7
|
+
class: "flex flex-col gap-5",
|
|
8
|
+
"data-ac-ds": "",
|
|
9
|
+
"data-testid": "ac-delete-modal"
|
|
10
|
+
}, S = { class: "text-lg text-muted" }, C = { class: "font-mono font-semibold break-all text-heading" }, w = {
|
|
7
11
|
key: 0,
|
|
8
|
-
class: "mt-
|
|
9
|
-
},
|
|
12
|
+
class: "mt-2 text-base text-muted"
|
|
13
|
+
}, T = {
|
|
10
14
|
key: 0,
|
|
11
15
|
class: "flex flex-col gap-2"
|
|
12
|
-
},
|
|
16
|
+
}, E = { class: "self-start rounded-8 bg-surface-sunken px-2.5 py-1.5 font-mono text-base break-all text-heading" }, D = { key: 1 }, O = ["disabled"], k = ["disabled", "aria-busy"], A = "inline-flex h-10 cursor-pointer items-center justify-center gap-2 rounded-10 border px-4 text-lg whitespace-nowrap transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", j = /*@__PURE__*/ d({
|
|
13
17
|
__name: "AcDeleteModal",
|
|
14
18
|
props: /*@__PURE__*/ f({
|
|
15
19
|
title: { default: "Delete" },
|
|
@@ -34,59 +38,61 @@ var b = { class: "flex flex-col gap-5" }, x = { class: "text-base text-body" },
|
|
|
34
38
|
}),
|
|
35
39
|
emits: /*@__PURE__*/ f(["confirm", "cancel"], ["update:open"]),
|
|
36
40
|
setup(d, { emit: f }) {
|
|
37
|
-
let
|
|
38
|
-
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
let j = d, M = v(d, "open"), N = f, P = h("");
|
|
42
|
+
y(M, (e) => e && (P.value = ""));
|
|
43
|
+
let F = i(() => !j.confirmByTyping || P.value === j.itemName);
|
|
44
|
+
function I() {
|
|
45
|
+
M.value = !1, N("cancel");
|
|
46
|
+
}
|
|
47
|
+
return (i, f) => (m(), a(t, {
|
|
48
|
+
open: M.value,
|
|
49
|
+
"onUpdate:open": f[2] ||= (e) => M.value = e,
|
|
45
50
|
title: d.title,
|
|
46
51
|
size: "small",
|
|
52
|
+
variant: "plain",
|
|
47
53
|
closable: !d.loading,
|
|
48
54
|
"close-on-outside-click": !d.loading,
|
|
49
|
-
onClose: f[3] ||= (e) =>
|
|
55
|
+
onClose: f[3] ||= (e) => N("cancel")
|
|
50
56
|
}, {
|
|
51
|
-
footer:
|
|
52
|
-
|
|
53
|
-
|
|
57
|
+
footer: b(() => [c("button", {
|
|
58
|
+
type: "button",
|
|
59
|
+
class: p([A, "border-border bg-transparent text-heading hover:bg-surface-sunken focus-visible:ring-ring"]),
|
|
54
60
|
disabled: d.loading,
|
|
55
61
|
"data-ac-ds": "",
|
|
56
62
|
"data-testid": "ac-delete-modal-cancel",
|
|
57
|
-
onClick:
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
onClick: I
|
|
64
|
+
}, " Cancel ", 8, O), c("button", {
|
|
65
|
+
type: "button",
|
|
66
|
+
class: p([[A, d.loading && "pointer-events-none"], "border-transparent bg-danger text-white hover:bg-danger-hover focus-visible:ring-danger"]),
|
|
67
|
+
disabled: !F.value || void 0,
|
|
68
|
+
"aria-busy": d.loading || void 0,
|
|
63
69
|
"data-ac-ds": "",
|
|
64
70
|
"data-testid": "ac-delete-modal-confirm",
|
|
65
|
-
onClick: f[1] ||= (e) =>
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
])]),
|
|
71
|
-
default:
|
|
72
|
-
c("div", null, [c("p",
|
|
73
|
-
l(
|
|
74
|
-
d.itemName ? (
|
|
71
|
+
onClick: f[1] ||= (e) => !d.loading && N("confirm", d.itemName)
|
|
72
|
+
}, [d.loading ? (m(), a(e, {
|
|
73
|
+
key: 0,
|
|
74
|
+
class: "-ml-0.5",
|
|
75
|
+
label: ""
|
|
76
|
+
})) : o("", !0), l(" " + _(d.confirmText), 1)], 10, k)]),
|
|
77
|
+
default: b(() => [c("div", x, [
|
|
78
|
+
c("div", null, [c("p", S, [
|
|
79
|
+
l(_(d.message), 1),
|
|
80
|
+
d.itemName ? (m(), s(r, { key: 0 }, [f[4] ||= l(_(" "), -1), c("strong", C, _(d.itemName), 1)], 64)) : o("", !0),
|
|
75
81
|
f[5] ||= l("? ", -1)
|
|
76
|
-
]), d.detail ? (
|
|
77
|
-
d.confirmByTyping && d.itemName ? (
|
|
82
|
+
]), d.detail ? (m(), s("p", w, _(d.detail), 1)) : o("", !0)]),
|
|
83
|
+
d.confirmByTyping && d.itemName ? (m(), s("div", T, [
|
|
78
84
|
f[6] ||= c("p", { class: "text-base text-muted" }, "To confirm, type the name below.", -1),
|
|
79
|
-
c("code",
|
|
85
|
+
c("code", E, _(d.itemName), 1),
|
|
80
86
|
u(n, {
|
|
81
|
-
modelValue:
|
|
82
|
-
"onUpdate:modelValue": f[0] ||= (e) =>
|
|
87
|
+
modelValue: P.value,
|
|
88
|
+
"onUpdate:modelValue": f[0] ||= (e) => P.value = e,
|
|
83
89
|
class: "mt-3",
|
|
84
90
|
label: "Resource name",
|
|
85
91
|
placeholder: "Enter the name",
|
|
86
92
|
autocomplete: "off"
|
|
87
93
|
}, null, 8, ["modelValue"])
|
|
88
94
|
])) : o("", !0),
|
|
89
|
-
i.$slots.default ? (
|
|
95
|
+
i.$slots.default ? (m(), s("div", D, [g(i.$slots, "default")])) : o("", !0)
|
|
90
96
|
])]),
|
|
91
97
|
_: 3
|
|
92
98
|
}, 8, [
|
|
@@ -98,4 +104,4 @@ var b = { class: "flex flex-col gap-5" }, x = { class: "text-base text-body" },
|
|
|
98
104
|
}
|
|
99
105
|
});
|
|
100
106
|
//#endregion
|
|
101
|
-
export {
|
|
107
|
+
export { j as default };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ChartTooltipSlotProps } from "../charts/ChartFrame.vue";
|
|
2
|
+
import type { ChartRenderer } from "../charts/echarts";
|
|
2
3
|
import type { ChartAccessor, ChartCategory, ChartDatum } from "../charts/shared";
|
|
3
4
|
export interface Props {
|
|
4
5
|
/** One row per segment, e.g. `{ engine: "Postgres", count: 42 }`. */
|
|
@@ -13,6 +14,8 @@ export interface Props {
|
|
|
13
14
|
height?: number;
|
|
14
15
|
/** Ring thickness in px. `0` draws a pie. */
|
|
15
16
|
arcWidth?: number;
|
|
17
|
+
/** Draws the top half of the ring only, like a gauge, e.g. for a quota. The centre value sits under the arc. */
|
|
18
|
+
half?: boolean;
|
|
16
19
|
/** Formats values in the legend, tooltip, centre and data table. Defaults to compact numbers: `1.2K`. */
|
|
17
20
|
valueFormatter?: (value: number) => string;
|
|
18
21
|
/** Legend to the `right` (it wraps below on narrow screens), `top`, `bottom`, or `none`. Clicking an entry hides or shows that segment. */
|
|
@@ -35,6 +38,10 @@ export interface Props {
|
|
|
35
38
|
title?: string;
|
|
36
39
|
/** A sentence for screen readers on what the chart shows. Defaults to each segment's share. */
|
|
37
40
|
description?: string;
|
|
41
|
+
/** `canvas` (default) or `svg`, which is crisper when printed or zoomed. */
|
|
42
|
+
renderer?: ChartRenderer;
|
|
43
|
+
/** Sweeps the segments in and animates changes. Always off when the viewer asks for reduced motion. */
|
|
44
|
+
animation?: boolean;
|
|
38
45
|
}
|
|
39
46
|
type __VLS_Slots = {
|
|
40
47
|
/** Content in the ring's centre. Gets the visible total, raw and formatted. */
|
|
@@ -52,11 +59,14 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
52
59
|
description: string;
|
|
53
60
|
height: number;
|
|
54
61
|
loading: boolean;
|
|
62
|
+
animation: boolean;
|
|
55
63
|
index: ChartAccessor<string>;
|
|
56
64
|
tooltip: boolean;
|
|
57
65
|
emptyText: string;
|
|
66
|
+
renderer: ChartRenderer;
|
|
58
67
|
categories: Record<string, ChartCategory>;
|
|
59
68
|
arcWidth: number;
|
|
69
|
+
half: boolean;
|
|
60
70
|
valueFormatter: (value: number) => string;
|
|
61
71
|
legendValues: boolean;
|
|
62
72
|
centerLabel: string;
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
import e from "../charts/ChartFrame.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { bindItemHover as t, useEChart as n } from "../charts/echarts.js";
|
|
3
|
+
import { chartColor as r, formatCompact as i, readValue as a } from "../charts/shared.js";
|
|
4
|
+
import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createSlots as f, defineComponent as p, guardReactiveProps as m, normalizeClass as h, normalizeProps as g, normalizeStyle as _, openBlock as v, ref as y, renderList as b, renderSlot as x, toDisplayString as S, unref as ee, withCtx as C } from "vue";
|
|
5
|
+
import { ChartPie as w } from "@lucide/vue";
|
|
6
|
+
import { use as T } from "echarts/core";
|
|
7
|
+
import { PieChart as E } from "echarts/charts";
|
|
7
8
|
//#region src/lib/components/AcDonutChart.vue?vue&type=script&setup=true&lang.ts
|
|
8
9
|
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
10
|
key: 0,
|
|
13
11
|
class: "text-2xl font-semibold tracking-tight text-heading tabular-nums"
|
|
14
|
-
},
|
|
12
|
+
}, O = {
|
|
15
13
|
key: 1,
|
|
16
14
|
class: "text-xs text-muted"
|
|
17
|
-
},
|
|
15
|
+
}, k = 24, A = .04, j = 4, M = /*@__PURE__*/ p({
|
|
18
16
|
__name: "AcDonutChart",
|
|
19
17
|
props: {
|
|
20
18
|
data: {},
|
|
@@ -29,6 +27,10 @@ var D = {
|
|
|
29
27
|
categories: { default: void 0 },
|
|
30
28
|
height: { default: 240 },
|
|
31
29
|
arcWidth: { default: 24 },
|
|
30
|
+
half: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
32
34
|
valueFormatter: {
|
|
33
35
|
type: Function,
|
|
34
36
|
default: void 0
|
|
@@ -54,22 +56,28 @@ var D = {
|
|
|
54
56
|
},
|
|
55
57
|
emptyText: { default: "No data to show yet" },
|
|
56
58
|
title: { default: "" },
|
|
57
|
-
description: { default: "" }
|
|
59
|
+
description: { default: "" },
|
|
60
|
+
renderer: { default: "canvas" },
|
|
61
|
+
animation: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: !0
|
|
64
|
+
}
|
|
58
65
|
},
|
|
59
|
-
setup(
|
|
60
|
-
|
|
66
|
+
setup(p) {
|
|
67
|
+
T([E]);
|
|
68
|
+
let M = p, N = y(), P = y([]), F = y(0), I = y(null), L = s(() => M.data.map((e, t) => String(a(e, t, M.index)))), R = s(() => M.data.map((e, t) => Math.max(0, Number(a(e, t, M.value)) || 0))), z = s(() => R.value.map((e, t) => P.value.includes(L.value[t]) ? 0 : e)), B = s(() => z.value.reduce((e, t) => e + t, 0)), V = s(() => L.value.map((e, t) => r(M.categories?.[e]?.color, t))), H = s(() => L.value.map((e) => M.categories?.[e]?.name ?? e));
|
|
61
69
|
function U(e) {
|
|
62
|
-
return M.valueFormatter ? M.valueFormatter(e) :
|
|
70
|
+
return M.valueFormatter ? M.valueFormatter(e) : i(e);
|
|
63
71
|
}
|
|
64
72
|
function W(e, t = B.value) {
|
|
65
73
|
return t ? `${Math.round(e / t * 100)}%` : "0%";
|
|
66
74
|
}
|
|
67
|
-
let G =
|
|
75
|
+
let G = s(() => L.value.map((e, t) => ({
|
|
68
76
|
key: e,
|
|
69
77
|
name: H.value[t],
|
|
70
78
|
color: V.value[t],
|
|
71
79
|
value: M.legendValues ? U(R.value[t]) : void 0
|
|
72
|
-
}))), K =
|
|
80
|
+
}))), K = s(() => R.value.reduce((e, t) => e + t, 0)), q = s(() => ({
|
|
73
81
|
columns: [
|
|
74
82
|
"Name",
|
|
75
83
|
"Value",
|
|
@@ -80,112 +88,131 @@ var D = {
|
|
|
80
88
|
U(R.value[t]),
|
|
81
89
|
W(R.value[t], K.value)
|
|
82
90
|
])
|
|
83
|
-
})), J =
|
|
91
|
+
})), J = s(() => {
|
|
84
92
|
let e = L.value.map((e, t) => `${H.value[t]} ${W(R.value[t], K.value)}`).join(", ");
|
|
85
93
|
return [M.title, M.description || `${L.value.length} segments: ${e}.`].filter(Boolean).join(". ");
|
|
86
|
-
}), Y =
|
|
94
|
+
}), Y = s(() => F.value || M.height), X = s(() => {
|
|
95
|
+
let e = M.half ? Math.min(Y.value / 2, M.height) : Math.min(Y.value, M.height) / 2;
|
|
96
|
+
return Math.max(40, e - j - (M.arcLabels ? k : 0));
|
|
97
|
+
}), Z = s(() => M.arcWidth > 0 ? Math.max(0, X.value - M.arcWidth) : 0), Q = s(() => Y.value / 2), $ = s(() => M.half ? M.height / 2 + X.value / 2 : M.height / 2), te = s(() => {
|
|
87
98
|
if (!M.arcLabels || !B.value || !F.value) return [];
|
|
88
|
-
let e =
|
|
89
|
-
return z.value.flatMap((
|
|
90
|
-
let
|
|
91
|
-
return
|
|
92
|
-
key: L.value[
|
|
93
|
-
text: W(
|
|
94
|
-
left:
|
|
95
|
-
top:
|
|
99
|
+
let e = X.value + k / 2 + 2, t = M.half ? Math.PI : 2 * Math.PI, n = M.half ? -Math.PI / 2 : 0, r = 0;
|
|
100
|
+
return z.value.flatMap((i, a) => {
|
|
101
|
+
let o = n + (r + i / 2) / B.value * t;
|
|
102
|
+
return r += i, i / B.value < A ? [] : [{
|
|
103
|
+
key: L.value[a],
|
|
104
|
+
text: W(i),
|
|
105
|
+
left: Q.value + e * Math.sin(o),
|
|
106
|
+
top: $.value - e * Math.cos(o)
|
|
96
107
|
}];
|
|
97
108
|
});
|
|
98
|
-
})
|
|
99
|
-
function
|
|
100
|
-
|
|
109
|
+
});
|
|
110
|
+
function ne(e) {
|
|
111
|
+
return {
|
|
112
|
+
type: "pie",
|
|
113
|
+
data: L.value.flatMap((t, n) => P.value.includes(t) ? [] : [{
|
|
114
|
+
name: H.value[n],
|
|
115
|
+
value: R.value[n],
|
|
116
|
+
row: n,
|
|
117
|
+
itemStyle: { color: e.color(V.value[n]) }
|
|
118
|
+
}]),
|
|
119
|
+
center: [Q.value, $.value],
|
|
120
|
+
radius: [Z.value, X.value],
|
|
121
|
+
startAngle: M.half ? 180 : 90,
|
|
122
|
+
endAngle: M.half ? 360 : "auto",
|
|
123
|
+
avoidLabelOverlap: !1,
|
|
124
|
+
label: { show: !1 },
|
|
125
|
+
labelLine: { show: !1 },
|
|
126
|
+
itemStyle: {
|
|
127
|
+
borderColor: e.surface,
|
|
128
|
+
borderWidth: 2,
|
|
129
|
+
borderRadius: M.arcWidth > 0 ? 4 : 0
|
|
130
|
+
},
|
|
131
|
+
emphasis: {
|
|
132
|
+
scale: !0,
|
|
133
|
+
scaleSize: j
|
|
134
|
+
},
|
|
135
|
+
animationType: "expansion",
|
|
136
|
+
animationTypeUpdate: "transition",
|
|
137
|
+
animationDuration: 500,
|
|
138
|
+
animationDurationUpdate: 300
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function re(e, t, n) {
|
|
142
|
+
if (!e || !M.tooltip) return;
|
|
143
|
+
let r = e.row, i = z.value[r];
|
|
101
144
|
I.value = {
|
|
102
|
-
clientX: t
|
|
103
|
-
clientY:
|
|
145
|
+
clientX: t,
|
|
146
|
+
clientY: n,
|
|
104
147
|
title: "",
|
|
105
148
|
items: [{
|
|
106
|
-
key: L.value[
|
|
107
|
-
name: H.value[
|
|
108
|
-
color: V.value[
|
|
109
|
-
value:
|
|
110
|
-
formatted: `${U(
|
|
149
|
+
key: L.value[r],
|
|
150
|
+
name: H.value[r],
|
|
151
|
+
color: V.value[r],
|
|
152
|
+
value: i,
|
|
153
|
+
formatted: `${U(i)} (${W(i)})`
|
|
111
154
|
}],
|
|
112
|
-
datum:
|
|
113
|
-
index:
|
|
155
|
+
datum: M.data[r],
|
|
156
|
+
index: r
|
|
114
157
|
};
|
|
115
158
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
159
|
+
return n({
|
|
160
|
+
host: N,
|
|
161
|
+
renderer: () => M.renderer,
|
|
162
|
+
option: (e) => ({
|
|
163
|
+
animation: M.animation && !e.reducedMotion,
|
|
164
|
+
series: [ne(e)]
|
|
165
|
+
}),
|
|
166
|
+
setup: (e) => t(e, (e) => re(e.data, e.clientX, e.clientY), () => I.value = null)
|
|
167
|
+
}), (t, n) => (v(), c(e, {
|
|
124
168
|
hidden: P.value,
|
|
125
169
|
"onUpdate:hidden": n[0] ||= (e) => P.value = e,
|
|
126
170
|
width: F.value,
|
|
127
171
|
"onUpdate:width": n[1] ||= (e) => F.value = e,
|
|
128
172
|
testid: "ac-donut-chart",
|
|
129
|
-
height:
|
|
130
|
-
loading:
|
|
131
|
-
empty: !
|
|
132
|
-
"empty-text":
|
|
133
|
-
"empty-icon":
|
|
134
|
-
legend:
|
|
173
|
+
height: p.height,
|
|
174
|
+
loading: p.loading,
|
|
175
|
+
empty: !p.data.length || !K.value,
|
|
176
|
+
"empty-text": p.emptyText,
|
|
177
|
+
"empty-icon": ee(w),
|
|
178
|
+
legend: p.legend,
|
|
135
179
|
"legend-items": G.value,
|
|
136
180
|
"legend-centered": "",
|
|
137
181
|
summary: J.value,
|
|
138
|
-
title:
|
|
139
|
-
description:
|
|
182
|
+
title: p.title,
|
|
183
|
+
description: p.description,
|
|
140
184
|
table: q.value,
|
|
141
185
|
tip: I.value,
|
|
142
|
-
tooltip:
|
|
143
|
-
},
|
|
144
|
-
default:
|
|
145
|
-
d(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
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", {
|
|
186
|
+
tooltip: p.tooltip
|
|
187
|
+
}, f({
|
|
188
|
+
default: C(() => [
|
|
189
|
+
d("div", {
|
|
190
|
+
ref_key: "host",
|
|
191
|
+
ref: N,
|
|
192
|
+
class: "size-full"
|
|
193
|
+
}, null, 512),
|
|
194
|
+
t.$slots.center || p.centerValue !== "" || p.centerLabel ? (v(), u("div", {
|
|
195
|
+
key: 0,
|
|
196
|
+
class: h(["pointer-events-none absolute inset-x-0 flex flex-col items-center text-center", p.half ? "justify-end" : "inset-y-0 justify-center"]),
|
|
197
|
+
style: _(p.half ? { bottom: `${p.height - $.value + 2}px` } : void 0)
|
|
198
|
+
}, [x(t.$slots, "center", {
|
|
172
199
|
total: B.value,
|
|
173
200
|
formatted: U(B.value)
|
|
174
|
-
}, () => [
|
|
175
|
-
(
|
|
201
|
+
}, () => [p.centerValue === "" ? l("", !0) : (v(), u("span", D, S(p.centerValue), 1)), p.centerLabel ? (v(), u("span", O, S(p.centerLabel), 1)) : l("", !0)])], 6)) : l("", !0),
|
|
202
|
+
(v(!0), u(o, null, b(te.value, (e) => (v(), u("span", {
|
|
176
203
|
key: e.key,
|
|
177
204
|
class: "pointer-events-none absolute -translate-x-1/2 -translate-y-1/2 text-xs font-medium text-muted tabular-nums",
|
|
178
|
-
style:
|
|
205
|
+
style: _({
|
|
179
206
|
left: `${e.left}px`,
|
|
180
207
|
top: `${e.top}px`
|
|
181
208
|
}),
|
|
182
209
|
"aria-hidden": "true"
|
|
183
|
-
},
|
|
210
|
+
}, S(e.text), 5))), 128))
|
|
184
211
|
]),
|
|
185
212
|
_: 2
|
|
186
213
|
}, [t.$slots.tooltip ? {
|
|
187
214
|
name: "tooltip",
|
|
188
|
-
fn:
|
|
215
|
+
fn: C((e) => [x(t.$slots, "tooltip", g(m(e)))]),
|
|
189
216
|
key: "0"
|
|
190
217
|
} : void 0]), 1032, [
|
|
191
218
|
"hidden",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export interface Props {
|
|
2
|
-
/** Text of the default trigger button. Without it (and without a `trigger` slot) a
|
|
2
|
+
/** Text of the default trigger button. Without it (and without a `trigger` slot) a 28px ⋯ icon button is shown. */
|
|
3
3
|
label?: string;
|
|
4
|
-
/** Accessible name of the menu and of the
|
|
4
|
+
/** Accessible name of the menu and of the ⋯ trigger, e.g. "Actions for demo-postgres". */
|
|
5
5
|
menuLabel?: string;
|
|
6
6
|
/** Which edge of the trigger the menu lines up with. Use `end` for menus at the right of a row. Old `is-right`. */
|
|
7
7
|
align?: "start" | "end";
|
|
@@ -9,6 +9,8 @@ export interface Props {
|
|
|
9
9
|
placement?: "bottom" | "top";
|
|
10
10
|
/** Disables the default trigger and stops the menu opening. */
|
|
11
11
|
disabled?: boolean;
|
|
12
|
+
/** `menu`: cloud-ui's row-action list, at least 240px, full-width rows. `panel`: its navbar Create menu, 320px, padded with rounded rows, 20px icons and a medium-weight label over the description. */
|
|
13
|
+
variant?: "menu" | "panel";
|
|
12
14
|
}
|
|
13
15
|
type __VLS_Props = Props;
|
|
14
16
|
type __VLS_Slots = {
|
|
@@ -29,6 +31,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
29
31
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
30
32
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
31
33
|
}>, {
|
|
34
|
+
variant: "menu" | "panel";
|
|
32
35
|
label: string;
|
|
33
36
|
disabled: boolean;
|
|
34
37
|
align: "start" | "end";
|