@ac-design/design-system 2.6.1 → 2.8.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/dist/lib/charts/ChartFrame.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/charts/graph.d.ts +9 -15
- package/dist/lib/charts/graph.js +79 -75
- package/dist/lib/charts/index.d.ts +4 -2
- package/dist/lib/charts/index.js +2 -1
- package/dist/lib/charts/nodeSymbol.d.ts +15 -0
- package/dist/lib/charts/nodeSymbol.js +27 -0
- package/dist/lib/charts/tree.d.ts +15 -0
- package/dist/lib/charts/tree.js +89 -0
- package/dist/lib/compat.css +162 -10
- package/dist/lib/components/AcAccordionItem.vue.d.ts +3 -1
- package/dist/lib/components/AcAccordionItem.vue_vue_type_script_setup_true_lang.js +35 -26
- package/dist/lib/components/AcAlert.vue.d.ts +1 -1
- package/dist/lib/components/AcBadge.vue.d.ts +1 -1
- package/dist/lib/components/AcBanner.vue.d.ts +1 -1
- package/dist/lib/components/AcCard.vue.d.ts +1 -1
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcCellValue.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +46 -43
- package/dist/lib/components/AcCheckList.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckRadio.vue_vue_type_script_setup_true_lang.js +3 -3
- package/dist/lib/components/AcColorInput.vue.d.ts +4 -0
- package/dist/lib/components/AcColorInput.vue_vue_type_script_setup_true_lang.js +12 -2
- package/dist/lib/components/AcConfirmModal.vue.d.ts +1 -1
- package/dist/lib/components/AcDatePicker.vue.d.ts +3 -0
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +12 -2
- package/dist/lib/components/AcDropdownItem.vue.d.ts +1 -1
- package/dist/lib/components/AcFeatureCard.vue.d.ts +1 -1
- package/dist/lib/components/AcGraphChart.vue.d.ts +53 -3
- package/dist/lib/components/AcGraphChart.vue_vue_type_script_setup_true_lang.js +401 -233
- package/dist/lib/components/AcHeader.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +2 -0
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +18 -8
- package/dist/lib/components/AcList.js +5 -0
- package/dist/lib/components/AcList.vue.d.ts +56 -0
- package/dist/lib/components/AcList.vue_vue_type_script_setup_true_lang.js +74 -0
- package/dist/lib/components/AcListItem.js +5 -0
- package/dist/lib/components/AcListItem.vue.d.ts +53 -0
- package/dist/lib/components/AcListItem.vue_vue_type_script_setup_true_lang.js +105 -0
- package/dist/lib/components/AcMapChart.vue.d.ts +66 -3
- package/dist/lib/components/AcMapChart.vue_vue_type_script_setup_true_lang.js +403 -201
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +12 -8
- package/dist/lib/components/AcMonthPicker.js +5 -0
- package/dist/lib/components/AcMonthPicker.vue.d.ts +105 -0
- package/dist/lib/components/AcMonthPicker.vue_vue_type_script_setup_true_lang.js +605 -0
- package/dist/lib/components/AcNavbarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcNumberInput.vue.d.ts +3 -0
- package/dist/lib/components/AcNumberInput.vue_vue_type_script_setup_true_lang.js +11 -1
- package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
- package/dist/lib/components/AcSelect.vue.d.ts +3 -0
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +241 -218
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +11 -7
- package/dist/lib/components/AcSideTabs.vue.d.ts +3 -1
- package/dist/lib/components/AcSideTabs.vue_vue_type_script_setup_true_lang.js +53 -33
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcSidebarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcStatCard.vue.d.ts +1 -1
- package/dist/lib/components/AcSteps.vue.d.ts +3 -0
- package/dist/lib/components/AcSteps.vue_vue_type_script_setup_true_lang.js +33 -29
- package/dist/lib/components/AcSwitch.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +83 -72
- package/dist/lib/components/AcTextarea.vue.d.ts +3 -0
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +11 -1
- package/dist/lib/components/AcTimePicker.vue.d.ts +3 -0
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +12 -2
- package/dist/lib/components/AcToaster.vue.d.ts +3 -0
- package/dist/lib/components/AcToaster.vue_vue_type_script_setup_true_lang.js +71 -68
- package/dist/lib/components/AcTreeChart.js +5 -0
- package/dist/lib/components/AcTreeChart.vue.d.ts +135 -0
- package/dist/lib/components/AcTreeChart.vue_vue_type_script_setup_true_lang.js +809 -0
- package/dist/lib/components/AcUsageCard.vue.d.ts +1 -1
- package/dist/lib/components/index.d.ts +5 -2
- package/dist/lib/composables/copyText.d.ts +5 -1
- package/dist/lib/composables/copyText.js +15 -3
- package/dist/lib/index.d.ts +3 -0
- package/dist/lib/index.js +85 -81
- package/dist/lib/theme.css +11 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "./AcButton.js";
|
|
2
2
|
import { useToast as t } from "../composables/useToast.js";
|
|
3
|
-
import { Fragment as n, Teleport as r, TransitionGroup as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, nextTick as f, normalizeClass as p,
|
|
3
|
+
import { Fragment as n, Teleport as r, TransitionGroup as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, nextTick as f, normalizeClass as p, normalizeStyle as m, onBeforeUnmount as h, openBlock as g, ref as _, renderList as v, resolveDynamicComponent as y, toDisplayString as b, unref as x, watch as S, withCtx as ee } from "vue";
|
|
4
4
|
import { CircleCheck as C, CircleX as w, Info as T, TriangleAlert as E, X as D } from "@lucide/vue";
|
|
5
5
|
//#region src/lib/components/AcToaster.vue?vue&type=script&setup=true&lang.ts
|
|
6
6
|
var O = ["aria-label"], k = {
|
|
@@ -8,7 +8,7 @@ var O = ["aria-label"], k = {
|
|
|
8
8
|
role: "status",
|
|
9
9
|
"aria-live": "polite",
|
|
10
10
|
"aria-atomic": "true"
|
|
11
|
-
},
|
|
11
|
+
}, A = {
|
|
12
12
|
class: "sr-only",
|
|
13
13
|
role: "alert",
|
|
14
14
|
"aria-live": "assertive",
|
|
@@ -16,10 +16,11 @@ var O = ["aria-label"], k = {
|
|
|
16
16
|
}, te = ["data-tone"], ne = { class: "flex min-w-0 flex-1 flex-col gap-0.5" }, re = { class: "text-base leading-[1.35] font-semibold break-words text-heading" }, ie = {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "text-[13px] leading-[1.45] break-words text-muted"
|
|
19
|
-
},
|
|
19
|
+
}, j = ["aria-label", "onClick"], M = ["data-toast-bar"], N = 3, P = "transition-[opacity,translate] duration-300 ease-[cubic-bezier(0.21,1.02,0.73,1)] motion-reduce:duration-150", F = /*@__PURE__*/ d({
|
|
20
20
|
__name: "AcToaster",
|
|
21
21
|
props: {
|
|
22
22
|
position: { default: "top-right" },
|
|
23
|
+
offset: { default: "" },
|
|
23
24
|
max: { default: 5 },
|
|
24
25
|
progress: {
|
|
25
26
|
type: Boolean,
|
|
@@ -28,7 +29,7 @@ var O = ["aria-label"], k = {
|
|
|
28
29
|
label: { default: "Notifications" }
|
|
29
30
|
},
|
|
30
31
|
setup(d) {
|
|
31
|
-
let
|
|
32
|
+
let F = d, I = {
|
|
32
33
|
neutral: {
|
|
33
34
|
iconClass: "",
|
|
34
35
|
box: "border-border bg-surface",
|
|
@@ -58,137 +59,139 @@ var O = ["aria-label"], k = {
|
|
|
58
59
|
box: "border-border bg-surface",
|
|
59
60
|
bar: "bg-info"
|
|
60
61
|
}
|
|
61
|
-
},
|
|
62
|
-
"top-right": "top-
|
|
63
|
-
"top-center": "top-
|
|
64
|
-
"bottom-right": "bottom-
|
|
65
|
-
"bottom-center": "bottom-
|
|
66
|
-
}, { toasts:
|
|
67
|
-
function
|
|
68
|
-
return e.duration > 0 && (e.progress ??
|
|
69
|
-
}
|
|
70
|
-
function J(e) {
|
|
71
|
-
let t = V.get(e);
|
|
72
|
-
t && !H && (t.started = Date.now(), t.handle = setTimeout(() => L(e), t.remaining), oe(e));
|
|
62
|
+
}, L = {
|
|
63
|
+
"top-right": "top-[var(--ac-toaster-offset,80px)] sm:right-5",
|
|
64
|
+
"top-center": "top-[var(--ac-toaster-offset,80px)] sm:left-1/2 sm:-translate-x-1/2",
|
|
65
|
+
"bottom-right": "bottom-[var(--ac-toaster-offset,20px)] sm:right-5",
|
|
66
|
+
"bottom-center": "bottom-[var(--ac-toaster-offset,20px)] sm:left-1/2 sm:-translate-x-1/2"
|
|
67
|
+
}, { toasts: R, dismiss: z } = t(), B = _(null), V = _(""), H = _(""), U = /* @__PURE__ */ new Map(), W = !1, G = /* @__PURE__ */ new Set(), K = a(() => F.position.startsWith("top")), q = a(() => R.value.slice(-F.max)), J = a(() => F.position.endsWith("right") ? "opacity-0 motion-safe:translate-x-[120%]" : K.value ? "opacity-0 motion-safe:-translate-y-2" : "opacity-0 motion-safe:translate-y-2");
|
|
68
|
+
function ae(e) {
|
|
69
|
+
return e.duration > 0 && (e.progress ?? F.progress);
|
|
73
70
|
}
|
|
74
71
|
function Y(e) {
|
|
75
|
-
let t =
|
|
72
|
+
let t = U.get(e);
|
|
73
|
+
t && !W && (t.started = Date.now(), t.handle = setTimeout(() => z(e), t.remaining), oe(e));
|
|
74
|
+
}
|
|
75
|
+
function X(e) {
|
|
76
|
+
let t = U.get(e);
|
|
76
77
|
t?.handle && (clearTimeout(t.handle), t.handle = void 0, t.remaining -= Date.now() - t.started, t.bar?.pause());
|
|
77
78
|
}
|
|
78
79
|
async function oe(e) {
|
|
79
80
|
await f();
|
|
80
|
-
let t =
|
|
81
|
+
let t = U.get(e);
|
|
81
82
|
if (t?.handle) {
|
|
82
83
|
if (t.bar) return t.bar.play();
|
|
83
|
-
t.bar = (
|
|
84
|
+
t.bar = (B.value?.querySelector(`[data-toast-bar="${CSS.escape(e)}"]`))?.animate([{ transform: "scaleX(1)" }, { transform: "scaleX(0)" }], {
|
|
84
85
|
duration: t.duration,
|
|
85
86
|
fill: "forwards"
|
|
86
87
|
});
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
|
-
function
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
function Z() {
|
|
93
|
-
H = !0, V.forEach((e, t) => Y(t));
|
|
90
|
+
function Z(e, t = !1) {
|
|
91
|
+
X(e), t && U.get(e)?.bar?.cancel(), U.delete(e);
|
|
94
92
|
}
|
|
95
93
|
function Q() {
|
|
96
|
-
|
|
94
|
+
W = !0, U.forEach((e, t) => X(t));
|
|
97
95
|
}
|
|
98
|
-
function $(
|
|
99
|
-
|
|
96
|
+
function $() {
|
|
97
|
+
W = !1, U.forEach((e, t) => Y(t));
|
|
100
98
|
}
|
|
101
99
|
function se(e) {
|
|
100
|
+
e.currentTarget.contains(e.relatedTarget) || $();
|
|
101
|
+
}
|
|
102
|
+
function ce(e) {
|
|
102
103
|
let t = new Set(e.map((e) => e.id));
|
|
103
|
-
for (let [e] of
|
|
104
|
-
for (let t of e)
|
|
104
|
+
for (let [e] of U) t.has(e) || Z(e);
|
|
105
|
+
for (let t of e) U.get(t.id)?.version !== t.version && (Z(t.id, !0), t.duration > 0 && (U.set(t.id, {
|
|
105
106
|
version: t.version,
|
|
106
107
|
duration: t.duration,
|
|
107
108
|
remaining: t.duration,
|
|
108
109
|
started: 0
|
|
109
|
-
}),
|
|
110
|
+
}), Y(t.id)));
|
|
110
111
|
}
|
|
111
|
-
async function
|
|
112
|
-
let t = e.filter((e) => !
|
|
113
|
-
if (
|
|
112
|
+
async function le(e) {
|
|
113
|
+
let t = e.filter((e) => !G.has(`${e.id}:${e.version}`));
|
|
114
|
+
if (G = new Set(e.map((e) => `${e.id}:${e.version}`)), !t.length) return;
|
|
114
115
|
let n = (e) => /[.!?…]$/.test(e.trim()) ? e.trim() : `${e.trim()}.`, r = (e) => e.flatMap((e) => [e.title, e.description ?? ""].filter(Boolean).map(n)).join(" "), i = t.filter((e) => e.tone === "error"), a = t.filter((e) => e.tone !== "error");
|
|
115
|
-
|
|
116
|
+
V.value = "", H.value = "", await f(), a.length && (V.value = r(a)), i.length && (H.value = r(i));
|
|
116
117
|
}
|
|
117
|
-
function
|
|
118
|
-
e.action?.onClick(),
|
|
118
|
+
function ue(e) {
|
|
119
|
+
e.action?.onClick(), z(e.id);
|
|
119
120
|
}
|
|
120
|
-
return
|
|
121
|
-
|
|
122
|
-
}, { immediate: !0 }),
|
|
121
|
+
return S(q, (e) => {
|
|
122
|
+
ce(e), le(e);
|
|
123
|
+
}, { immediate: !0 }), h(() => U.forEach((e) => {
|
|
123
124
|
clearTimeout(e.handle), e.bar?.cancel();
|
|
124
|
-
})), (t, a) => (
|
|
125
|
+
})), (t, a) => (g(), o(r, { to: "body" }, [l("section", {
|
|
125
126
|
ref_key: "root",
|
|
126
|
-
ref:
|
|
127
|
+
ref: B,
|
|
127
128
|
"aria-label": d.label,
|
|
128
129
|
"data-ac-ds": "",
|
|
129
130
|
"data-testid": "ac-toaster"
|
|
130
131
|
}, [
|
|
131
|
-
l("div", k,
|
|
132
|
-
l("div",
|
|
132
|
+
l("div", k, b(V.value), 1),
|
|
133
|
+
l("div", A, b(H.value), 1),
|
|
133
134
|
u(i, {
|
|
134
135
|
tag: "ol",
|
|
135
|
-
class: p(["pointer-events-none fixed inset-x-5 z-[100] flex flex-col gap-3 sm:inset-x-auto sm:w-[384px]",
|
|
136
|
-
"
|
|
137
|
-
"enter-
|
|
138
|
-
"
|
|
139
|
-
"leave-
|
|
136
|
+
class: p(["pointer-events-none fixed inset-x-5 z-[100] flex flex-col gap-3 sm:inset-x-auto sm:w-[384px]", L[d.position]]),
|
|
137
|
+
style: m(d.offset ? { "--ac-toaster-offset": d.offset } : void 0),
|
|
138
|
+
"enter-active-class": P,
|
|
139
|
+
"enter-from-class": J.value,
|
|
140
|
+
"leave-active-class": P,
|
|
141
|
+
"leave-to-class": J.value,
|
|
140
142
|
"move-class": "motion-safe:transition-transform motion-safe:duration-200",
|
|
141
|
-
onPointerenter:
|
|
142
|
-
onPointerleave:
|
|
143
|
-
onFocusin:
|
|
144
|
-
onFocusout:
|
|
143
|
+
onPointerenter: Q,
|
|
144
|
+
onPointerleave: $,
|
|
145
|
+
onFocusin: Q,
|
|
146
|
+
onFocusout: se
|
|
145
147
|
}, {
|
|
146
|
-
default:
|
|
148
|
+
default: ee(() => [(g(!0), c(n, null, v(q.value, (t, n) => (g(), c("li", {
|
|
147
149
|
key: t.id,
|
|
148
150
|
class: p(["pointer-events-auto relative flex items-start gap-3 overflow-hidden rounded-10 border py-3.5 pl-4 shadow-md", [
|
|
149
|
-
|
|
151
|
+
I[t.tone].box,
|
|
150
152
|
t.dismissible ? "pr-10" : "pr-4",
|
|
151
|
-
|
|
153
|
+
q.value.length - 1 - n >= N && "max-sm:hidden"
|
|
152
154
|
]]),
|
|
153
155
|
"data-ac-ds": "",
|
|
154
156
|
"data-testid": "ac-toast",
|
|
155
157
|
"data-tone": t.tone
|
|
156
158
|
}, [
|
|
157
|
-
|
|
159
|
+
I[t.tone].icon ? (g(), o(y(I[t.tone].icon), {
|
|
158
160
|
key: 0,
|
|
159
|
-
class: p(["mt-px size-5 shrink-0",
|
|
161
|
+
class: p(["mt-px size-5 shrink-0", I[t.tone].iconClass]),
|
|
160
162
|
"stroke-width": 2.25,
|
|
161
163
|
"aria-hidden": "true"
|
|
162
164
|
}, null, 8, ["class"])) : s("", !0),
|
|
163
|
-
l("div", ne, [l("p", re,
|
|
164
|
-
t.action ? (
|
|
165
|
+
l("div", ne, [l("p", re, b(t.title), 1), t.description ? (g(), c("p", ie, b(t.description), 1)) : s("", !0)]),
|
|
166
|
+
t.action ? (g(), o(e, {
|
|
165
167
|
key: 1,
|
|
166
168
|
title: t.action.label,
|
|
167
169
|
size: "small",
|
|
168
170
|
color: "white",
|
|
169
171
|
class: "-my-1 shrink-0",
|
|
170
|
-
onClick: (e) =>
|
|
172
|
+
onClick: (e) => ue(t)
|
|
171
173
|
}, null, 8, ["title", "onClick"])) : s("", !0),
|
|
172
|
-
t.dismissible ? (
|
|
174
|
+
t.dismissible ? (g(), c("button", {
|
|
173
175
|
key: 2,
|
|
174
176
|
type: "button",
|
|
175
177
|
class: "absolute top-2 right-2 inline-flex size-6 cursor-pointer items-center justify-center rounded-6 text-muted transition-colors hover:bg-surface-sunken hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
176
178
|
"aria-label": `Dismiss: ${t.title}`,
|
|
177
|
-
onClick: (e) =>
|
|
178
|
-
}, [u(
|
|
179
|
+
onClick: (e) => x(z)(t.id)
|
|
180
|
+
}, [u(x(D), {
|
|
179
181
|
class: "size-3.5",
|
|
180
182
|
"aria-hidden": "true"
|
|
181
|
-
})], 8,
|
|
182
|
-
|
|
183
|
+
})], 8, j)) : s("", !0),
|
|
184
|
+
ae(t) ? (g(), c("span", {
|
|
183
185
|
key: 3,
|
|
184
186
|
"data-toast-bar": t.id,
|
|
185
|
-
class: p(["absolute bottom-0 left-0 h-0.5 w-full origin-left opacity-70 motion-reduce:hidden",
|
|
187
|
+
class: p(["absolute bottom-0 left-0 h-0.5 w-full origin-left opacity-70 motion-reduce:hidden", I[t.tone].bar]),
|
|
186
188
|
"aria-hidden": "true"
|
|
187
|
-
}, null, 10,
|
|
189
|
+
}, null, 10, M)) : s("", !0)
|
|
188
190
|
], 10, te))), 128))]),
|
|
189
191
|
_: 1
|
|
190
192
|
}, 8, [
|
|
191
193
|
"class",
|
|
194
|
+
"style",
|
|
192
195
|
"enter-from-class",
|
|
193
196
|
"leave-to-class"
|
|
194
197
|
])
|
|
@@ -196,4 +199,4 @@ var O = ["aria-label"], k = {
|
|
|
196
199
|
}
|
|
197
200
|
});
|
|
198
201
|
//#endregion
|
|
199
|
-
export {
|
|
202
|
+
export { F as default };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
import type { ChartRenderer } from "../charts/echarts";
|
|
3
|
+
import type { ChartColor } from "../charts/shared";
|
|
4
|
+
/** A node's health: drawn as the ring colour, and counted as a problem when `warning` or `danger`. */
|
|
5
|
+
export type TreeChartStatus = "success" | "info" | "warning" | "danger" | "neutral";
|
|
6
|
+
/** One node of the tree. Nest nodes in `children`. */
|
|
7
|
+
export interface TreeChartNode {
|
|
8
|
+
/** Unique id across the whole tree. Events and `reveal()` use it. */
|
|
9
|
+
id: string;
|
|
10
|
+
/** Name on the first line of the label, e.g. `demo-vpc`. */
|
|
11
|
+
name: string;
|
|
12
|
+
/** Second line of the label, e.g. a CIDR or an instance size. Also in the tooltip. */
|
|
13
|
+
description?: string;
|
|
14
|
+
/** Resource type, e.g. "Subnet". Picks the icon and its colour through `kindIcons` and `kindColors`, and shows in the tooltip. */
|
|
15
|
+
kind?: string;
|
|
16
|
+
/** A Lucide icon component, or 1–3 characters of text, drawn in the node. Overrides `kindIcons`. Without either the node is a dot. */
|
|
17
|
+
icon?: Component | string;
|
|
18
|
+
/** Colours the ring. `warning` and `danger` also add a `!` badge to the label. */
|
|
19
|
+
status?: TreeChartStatus;
|
|
20
|
+
/** Status in words for the tooltip and data table, e.g. "NotReady". Defaults to the status name. */
|
|
21
|
+
statusText?: string;
|
|
22
|
+
/** A short chip after the name, e.g. `{ text: "Public", tone: "success" }`. */
|
|
23
|
+
badge?: {
|
|
24
|
+
text: string;
|
|
25
|
+
tone?: TreeChartStatus;
|
|
26
|
+
};
|
|
27
|
+
/** How the node relates to its parent, shown muted before the name, e.g. "routes via" or ":8080". */
|
|
28
|
+
relation?: string;
|
|
29
|
+
/** Draws the node and its label faded, e.g. a reference to a resource whose own entry is elsewhere in the tree. */
|
|
30
|
+
muted?: boolean;
|
|
31
|
+
/** Starts this node folded (`true`) or open (`false`), whatever `expandDepth` says. */
|
|
32
|
+
collapsed?: boolean;
|
|
33
|
+
children?: TreeChartNode[];
|
|
34
|
+
}
|
|
35
|
+
/** What the `tooltip` slot gets for the hovered node. */
|
|
36
|
+
export interface TreeChartTooltipSlotProps {
|
|
37
|
+
/** The hovered node, as passed in `data`. */
|
|
38
|
+
node: TreeChartNode;
|
|
39
|
+
/** Names of its ancestors, from the root down. */
|
|
40
|
+
path: string[];
|
|
41
|
+
/** Whether its children are showing. Always false for a node without children. */
|
|
42
|
+
expanded: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface Props {
|
|
45
|
+
/** The tree: one root node, or an array of roots drawn one under the other. */
|
|
46
|
+
data: TreeChartNode | TreeChartNode[];
|
|
47
|
+
/** Layout direction: `LR` (left to right, best for deep or wide trees) or `TB` (top to bottom, for small hierarchies). */
|
|
48
|
+
direction?: "LR" | "TB";
|
|
49
|
+
/** How many levels start open: `1` shows the roots' children, `2` their grandchildren too. A node's `collapsed` wins. Pass `Infinity` to open everything. */
|
|
50
|
+
expandDepth?: number;
|
|
51
|
+
/** Text to find. Matching names, descriptions and kinds are highlighted, and their branches open. */
|
|
52
|
+
search?: string;
|
|
53
|
+
/** Plot height in px. With `autoHeight`, only used while there's nothing to measure yet. */
|
|
54
|
+
height?: number;
|
|
55
|
+
/** Grows the plot to fit the open rows (34px a row, 40px with descriptions, up to 4,000px), so opening a branch never squeezes the rest. */
|
|
56
|
+
autoHeight?: boolean;
|
|
57
|
+
/** `polyline` draws square elbows from a parent to its children; `curve` draws one curved line per child. */
|
|
58
|
+
edgeShape?: "polyline" | "curve";
|
|
59
|
+
/** Icon colour per kind: `{ Subnet: "chart-2" }`. Without it, kinds take `chart-1`, `chart-2`… in order of first appearance. */
|
|
60
|
+
kindColors?: Record<string, ChartColor>;
|
|
61
|
+
/** Icon per kind, so node data can stay plain JSON: `{ Subnet: Network }`. A node's own `icon` wins. */
|
|
62
|
+
kindIcons?: Record<string, Component | string>;
|
|
63
|
+
/** Shows zoom in, zoom out and fit buttons in the bottom-right corner. Dragging pans either way. */
|
|
64
|
+
zoom?: boolean;
|
|
65
|
+
/** Shows a tooltip with the node's name, kind, status and description on hover. */
|
|
66
|
+
tooltip?: boolean;
|
|
67
|
+
/** Shows a skeleton of the same height while data loads. */
|
|
68
|
+
loading?: boolean;
|
|
69
|
+
/** Text shown in place of the tree when `data` is empty. */
|
|
70
|
+
emptyText?: string;
|
|
71
|
+
/** Accessible name, e.g. "Resources of demo-vpc". Show the visible title in the surrounding card. */
|
|
72
|
+
title?: string;
|
|
73
|
+
/** A sentence for screen readers on what the tree shows. Defaults to the number of items, levels and problems. */
|
|
74
|
+
description?: string;
|
|
75
|
+
/** `canvas` (default) stays fast with thousands of nodes; `svg` is crisper when printed and lighter for a few dozen. */
|
|
76
|
+
renderer?: ChartRenderer;
|
|
77
|
+
/** Animates opening and moving branches. Off when the viewer asks for reduced motion, and above 2,000 nodes. */
|
|
78
|
+
animation?: boolean;
|
|
79
|
+
}
|
|
80
|
+
type __VLS_Slots = {
|
|
81
|
+
/** Replaces the tooltip body for the hovered node. */
|
|
82
|
+
tooltip?: (props: TreeChartTooltipSlotProps) => unknown;
|
|
83
|
+
};
|
|
84
|
+
/** Opens every level down to `depth` (`1` shows the roots' children) and folds the rest. */
|
|
85
|
+
declare function expandToDepth(depth: number): void;
|
|
86
|
+
/** Opens every node. */
|
|
87
|
+
declare function expandAll(): void;
|
|
88
|
+
/** Folds everything below the roots' children. */
|
|
89
|
+
declare function collapseAll(): void;
|
|
90
|
+
/** Opens the ancestors of the node with this id, so it's on screen. */
|
|
91
|
+
declare function reveal(id: string): void;
|
|
92
|
+
/** Resets pan and zoom to show the tree as first drawn. */
|
|
93
|
+
declare function fit(): void;
|
|
94
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {
|
|
95
|
+
expandAll: typeof expandAll;
|
|
96
|
+
collapseAll: typeof collapseAll;
|
|
97
|
+
expandToDepth: typeof expandToDepth;
|
|
98
|
+
reveal: typeof reveal;
|
|
99
|
+
fit: typeof fit;
|
|
100
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
101
|
+
select: (node: TreeChartNode) => any;
|
|
102
|
+
open: (node: TreeChartNode) => any;
|
|
103
|
+
toggle: (node: TreeChartNode, expanded: boolean) => any;
|
|
104
|
+
matches: (nodes: TreeChartNode[]) => any;
|
|
105
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
106
|
+
onSelect?: ((node: TreeChartNode) => any) | undefined;
|
|
107
|
+
onOpen?: ((node: TreeChartNode) => any) | undefined;
|
|
108
|
+
onToggle?: ((node: TreeChartNode, expanded: boolean) => any) | undefined;
|
|
109
|
+
onMatches?: ((nodes: TreeChartNode[]) => any) | undefined;
|
|
110
|
+
}>, {
|
|
111
|
+
search: string;
|
|
112
|
+
title: string;
|
|
113
|
+
description: string;
|
|
114
|
+
height: number;
|
|
115
|
+
direction: "LR" | "TB";
|
|
116
|
+
animation: boolean;
|
|
117
|
+
tooltip: boolean;
|
|
118
|
+
loading: boolean;
|
|
119
|
+
emptyText: string;
|
|
120
|
+
renderer: ChartRenderer;
|
|
121
|
+
zoom: boolean;
|
|
122
|
+
kindColors: Record<string, ChartColor>;
|
|
123
|
+
kindIcons: Record<string, Component | string>;
|
|
124
|
+
expandDepth: number;
|
|
125
|
+
autoHeight: boolean;
|
|
126
|
+
edgeShape: "polyline" | "curve";
|
|
127
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
128
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
129
|
+
declare const _default: typeof __VLS_export;
|
|
130
|
+
export default _default;
|
|
131
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
132
|
+
new (): {
|
|
133
|
+
$slots: S;
|
|
134
|
+
};
|
|
135
|
+
};
|