@ac-design/design-system 2.6.1 → 2.7.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 +113 -0
- 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/AcCellValue.vue.d.ts +1 -1
- package/dist/lib/components/AcCheckList.vue.d.ts +1 -1
- package/dist/lib/components/AcConfirmModal.vue.d.ts +1 -1
- 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/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/AcMonthPicker.js +5 -0
- package/dist/lib/components/AcMonthPicker.vue.d.ts +102 -0
- package/dist/lib/components/AcMonthPicker.vue_vue_type_script_setup_true_lang.js +595 -0
- package/dist/lib/components/AcNavbarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcResourceCard.vue.d.ts +1 -1
- 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/AcSidebarItem.vue.d.ts +1 -1
- package/dist/lib/components/AcStatCard.vue.d.ts +1 -1
- 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/package.json +1 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
export interface ListItem {
|
|
3
|
+
/** Unique key. Defaults to the title. */
|
|
4
|
+
key?: string;
|
|
5
|
+
/** Main line of the row. */
|
|
6
|
+
title: string;
|
|
7
|
+
/** Muted second line under the title. */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** A Lucide icon before the text. */
|
|
10
|
+
icon?: Component;
|
|
11
|
+
/** Route for `RouterLink` (needs vue-router in the app). */
|
|
12
|
+
to?: string | Record<string, unknown>;
|
|
13
|
+
/** Plain link, when there's no router. */
|
|
14
|
+
href?: string;
|
|
15
|
+
/** Highlights the row as the current or chosen one. */
|
|
16
|
+
selected?: boolean;
|
|
17
|
+
/** Greys the row out and blocks clicks. */
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Shows a chevron at the end, for rows that open something. */
|
|
20
|
+
chevron?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface Props {
|
|
23
|
+
/** Rows to render, for simple lists: `{ key?, title, description?, icon?, to?, href?, selected?, disabled?, chevron? }`. Put AcListItems in the default slot instead for custom rows. */
|
|
24
|
+
items?: ListItem[];
|
|
25
|
+
/** `plain` has no frame, for a list inside a card or panel; `card` puts the list in a bordered card. */
|
|
26
|
+
variant?: "plain" | "card";
|
|
27
|
+
/** Draws a line between rows. */
|
|
28
|
+
divided?: boolean;
|
|
29
|
+
/** `normal` 14px titles with 12px padding; `small` 12px titles with 8px padding, for side panels and dense lists. */
|
|
30
|
+
size?: "small" | "normal";
|
|
31
|
+
/** Accessible name of the list, e.g. "Regions". */
|
|
32
|
+
label?: string;
|
|
33
|
+
}
|
|
34
|
+
type __VLS_Slots = {
|
|
35
|
+
/** AcListItem children. Replaces `items`. */
|
|
36
|
+
default?: () => unknown;
|
|
37
|
+
};
|
|
38
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
39
|
+
select: (item: ListItem, index: number) => any;
|
|
40
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
41
|
+
onSelect?: ((item: ListItem, index: number) => any) | undefined;
|
|
42
|
+
}>, {
|
|
43
|
+
variant: "plain" | "card";
|
|
44
|
+
label: string;
|
|
45
|
+
size: "small" | "normal";
|
|
46
|
+
items: ListItem[];
|
|
47
|
+
divided: boolean;
|
|
48
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
49
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
50
|
+
declare const _default: typeof __VLS_export;
|
|
51
|
+
export default _default;
|
|
52
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
53
|
+
new (): {
|
|
54
|
+
$slots: S;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import e from "./AcListItem.js";
|
|
2
|
+
import { Fragment as t, computed as n, createBlock as r, createElementBlock as i, defineComponent as a, getCurrentInstance as o, mergeProps as s, normalizeClass as c, openBlock as l, provide as u, reactive as d, ref as f, renderList as p, renderSlot as m, toHandlers as h, toRef as g } from "vue";
|
|
3
|
+
//#region src/lib/components/AcList.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var _ = ["aria-label"], v = "[data-ac-list-row]:not([aria-disabled='true']):not(:disabled)", y = /*@__PURE__*/ a({
|
|
5
|
+
__name: "AcList",
|
|
6
|
+
props: {
|
|
7
|
+
items: { default: () => [] },
|
|
8
|
+
variant: { default: "plain" },
|
|
9
|
+
divided: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: !1
|
|
12
|
+
},
|
|
13
|
+
size: { default: "normal" },
|
|
14
|
+
label: { default: void 0 }
|
|
15
|
+
},
|
|
16
|
+
emits: ["select"],
|
|
17
|
+
setup(a, { emit: y }) {
|
|
18
|
+
let b = a, x = y, S = !!o()?.vnode.props?.onSelect, C = f(null), w = n(() => b.variant === "plain" && !b.divided), T = n(() => b.items.some((e) => e.selected !== void 0));
|
|
19
|
+
u("ac-list", d({
|
|
20
|
+
size: g(b, "size"),
|
|
21
|
+
rounded: w
|
|
22
|
+
}));
|
|
23
|
+
function E(e, t) {
|
|
24
|
+
return S ? { click: () => x("select", e, t) } : {};
|
|
25
|
+
}
|
|
26
|
+
function D(e) {
|
|
27
|
+
if (![
|
|
28
|
+
"ArrowDown",
|
|
29
|
+
"ArrowUp",
|
|
30
|
+
"Home",
|
|
31
|
+
"End"
|
|
32
|
+
].includes(e.key)) return;
|
|
33
|
+
let t = e.target;
|
|
34
|
+
if (!t.matches("[data-ac-list-row]")) return;
|
|
35
|
+
let n = [...C.value?.querySelectorAll(v) ?? []].filter((e) => e.closest("[data-testid='ac-list']") === C.value), r = n.indexOf(t);
|
|
36
|
+
r < 0 || (e.preventDefault(), n[e.key === "Home" ? 0 : e.key === "End" ? n.length - 1 : Math.min(Math.max(r + (e.key === "ArrowDown" ? 1 : -1), 0), n.length - 1)]?.focus());
|
|
37
|
+
}
|
|
38
|
+
return (n, o) => (l(), i("ul", {
|
|
39
|
+
ref_key: "root",
|
|
40
|
+
ref: C,
|
|
41
|
+
role: "list",
|
|
42
|
+
class: c(["@container m-0 flex list-none flex-col p-0", [
|
|
43
|
+
a.variant === "card" && "overflow-hidden rounded-14 border border-border bg-surface",
|
|
44
|
+
a.divided && "divide-y divide-border",
|
|
45
|
+
w.value && "gap-0.5"
|
|
46
|
+
]]),
|
|
47
|
+
"aria-label": a.label,
|
|
48
|
+
"data-ac-ds": "",
|
|
49
|
+
"data-testid": "ac-list",
|
|
50
|
+
onKeydown: D
|
|
51
|
+
}, [m(n.$slots, "default", {}, () => [(l(!0), i(t, null, p(a.items, (t, n) => (l(), r(e, s({
|
|
52
|
+
key: t.key ?? t.title,
|
|
53
|
+
title: t.title,
|
|
54
|
+
description: t.description,
|
|
55
|
+
icon: t.icon,
|
|
56
|
+
to: t.to,
|
|
57
|
+
href: t.href,
|
|
58
|
+
selected: T.value ? !!t.selected : void 0,
|
|
59
|
+
disabled: t.disabled,
|
|
60
|
+
chevron: t.chevron
|
|
61
|
+
}, h(E(t, n))), null, 16, [
|
|
62
|
+
"title",
|
|
63
|
+
"description",
|
|
64
|
+
"icon",
|
|
65
|
+
"to",
|
|
66
|
+
"href",
|
|
67
|
+
"selected",
|
|
68
|
+
"disabled",
|
|
69
|
+
"chevron"
|
|
70
|
+
]))), 128))])], 42, _));
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
//#endregion
|
|
74
|
+
export { y as default };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { Component } from "vue";
|
|
2
|
+
export interface Props {
|
|
3
|
+
/** Main line of the row. Truncates with an ellipsis when it doesn't fit. */
|
|
4
|
+
title?: string;
|
|
5
|
+
/** Muted second line under the title, e.g. "3 datacenters". Truncates too. */
|
|
6
|
+
description?: string;
|
|
7
|
+
/** A Lucide icon before the text, e.g. `:icon="Database"`. The `leading` slot replaces it. */
|
|
8
|
+
icon?: Component;
|
|
9
|
+
/** Route to link to. Renders `RouterLink` when vue-router is installed in the app, otherwise a plain link (string routes only). */
|
|
10
|
+
to?: string | Record<string, unknown>;
|
|
11
|
+
/** Plain URL, for pages outside the app. Takes over from `to` when vue-router isn't installed. */
|
|
12
|
+
href?: string;
|
|
13
|
+
/** Highlights the row as the current or chosen one. On a link it sets `aria-current="page"`; on a button `aria-pressed`. Leave it unset on rows that don't select anything. */
|
|
14
|
+
selected?: boolean;
|
|
15
|
+
/** Greys the row out and blocks clicks. */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Shows a chevron at the end, for rows that open or zoom to something. */
|
|
18
|
+
chevron?: boolean;
|
|
19
|
+
}
|
|
20
|
+
type __VLS_Slots = {
|
|
21
|
+
/** Replaces `icon`, e.g. a colour dot, an avatar or a provider logo. */
|
|
22
|
+
leading?: () => unknown;
|
|
23
|
+
/** Replaces the title text, e.g. to add a badge or use a mono font. */
|
|
24
|
+
title?: () => unknown;
|
|
25
|
+
/** Replaces the description text. */
|
|
26
|
+
description?: () => unknown;
|
|
27
|
+
/** Extra content beside the text, e.g. a message column. It moves under the text when the list is narrower than 512px. */
|
|
28
|
+
default?: () => unknown;
|
|
29
|
+
/** Meta on the right, before the chevron: badges, a count, a status dot or a timestamp. */
|
|
30
|
+
trailing?: () => unknown;
|
|
31
|
+
};
|
|
32
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
33
|
+
click: (e: MouseEvent) => any;
|
|
34
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
35
|
+
onClick?: ((e: MouseEvent) => any) | undefined;
|
|
36
|
+
}>, {
|
|
37
|
+
title: string;
|
|
38
|
+
description: string;
|
|
39
|
+
disabled: boolean;
|
|
40
|
+
href: string;
|
|
41
|
+
to: string | Record<string, unknown>;
|
|
42
|
+
icon: Component;
|
|
43
|
+
chevron: boolean;
|
|
44
|
+
selected: boolean;
|
|
45
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
46
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
47
|
+
declare const _default: typeof __VLS_export;
|
|
48
|
+
export default _default;
|
|
49
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
50
|
+
new (): {
|
|
51
|
+
$slots: S;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, defineComponent as o, getCurrentInstance as s, inject as c, mergeProps as l, normalizeClass as u, openBlock as d, renderSlot as f, resolveDynamicComponent as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
|
|
2
|
+
import { ChevronRight as _ } from "@lucide/vue";
|
|
3
|
+
//#region src/lib/components/AcListItem.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var v = {
|
|
5
|
+
class: "m-0 min-w-0 list-none p-0",
|
|
6
|
+
"data-ac-ds": "",
|
|
7
|
+
"data-testid": "ac-list-item"
|
|
8
|
+
}, y = { class: "flex min-w-0 flex-1 flex-col gap-x-4 gap-y-1 @lg:flex-row @lg:items-center" }, b = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "flex shrink-0 items-center gap-2 text-xs text-muted"
|
|
11
|
+
}, x = "aria-[current=page]:bg-accent aria-[current=true]:bg-accent aria-pressed:bg-accent", S = "group-aria-[current=page]/row:block group-aria-[current=true]/row:block group-aria-pressed/row:block", C = "group-aria-[current=page]/row:text-primary group-aria-[current=true]/row:text-primary group-aria-pressed/row:text-primary", w = /*@__PURE__*/ o({
|
|
12
|
+
__name: "AcListItem",
|
|
13
|
+
props: {
|
|
14
|
+
title: { default: "" },
|
|
15
|
+
description: { default: "" },
|
|
16
|
+
icon: { default: void 0 },
|
|
17
|
+
to: { default: void 0 },
|
|
18
|
+
href: { default: void 0 },
|
|
19
|
+
selected: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: void 0
|
|
22
|
+
},
|
|
23
|
+
disabled: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !1
|
|
26
|
+
},
|
|
27
|
+
chevron: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !1
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
emits: ["click"],
|
|
33
|
+
setup(o, { emit: w }) {
|
|
34
|
+
let T = o, E = w, D = {
|
|
35
|
+
normal: {
|
|
36
|
+
row: "gap-3 px-4 py-3",
|
|
37
|
+
title: "text-base",
|
|
38
|
+
description: "mt-0.5 text-xs",
|
|
39
|
+
icon: "size-4"
|
|
40
|
+
},
|
|
41
|
+
small: {
|
|
42
|
+
row: "gap-2.5 px-3 py-2",
|
|
43
|
+
title: "text-xs",
|
|
44
|
+
description: "text-xs",
|
|
45
|
+
icon: "size-3.5"
|
|
46
|
+
}
|
|
47
|
+
}, O = c("ac-list", null), k = s()?.appContext.components.RouterLink, A = !!s()?.vnode.props?.onClick, j = e(() => D[O?.size ?? "normal"]), M = e(() => T.to && k && !T.disabled ? k : T.to || T.href ? "a" : A ? "button" : "div"), N = e(() => M.value !== "div"), P = e(() => {
|
|
48
|
+
let e = {};
|
|
49
|
+
return M.value === k ? e.to = T.to : M.value === "a" ? T.disabled ? (e.role = "link", e["aria-disabled"] = "true") : e.href = T.href ?? (typeof T.to == "string" ? T.to : void 0) : M.value === "button" && (e.type = "button", e.disabled = T.disabled || void 0, e["aria-pressed"] = T.selected), N.value && (e["data-ac-list-row"] = ""), T.selected && M.value !== "button" && (e["aria-current"] = N.value ? "page" : "true"), e;
|
|
50
|
+
});
|
|
51
|
+
function F(e) {
|
|
52
|
+
if (T.disabled) {
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
E("click", e);
|
|
57
|
+
}
|
|
58
|
+
return (e, s) => (d(), r("li", v, [(d(), t(p(M.value), l(P.value, {
|
|
59
|
+
class: ["group/row relative flex w-full min-w-0 items-center border-0 bg-transparent text-left text-body no-underline transition-colors duration-150 motion-reduce:transition-none", [
|
|
60
|
+
j.value.row,
|
|
61
|
+
x,
|
|
62
|
+
h(O)?.rounded && "rounded-10",
|
|
63
|
+
N.value && "focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset",
|
|
64
|
+
N.value && (o.disabled ? "pointer-events-none cursor-not-allowed opacity-50" : "cursor-pointer hover:bg-accent-hover"),
|
|
65
|
+
!N.value && o.disabled && "opacity-50"
|
|
66
|
+
]],
|
|
67
|
+
"data-ac-ds": "",
|
|
68
|
+
"data-testid": "ac-list-row",
|
|
69
|
+
onClick: F
|
|
70
|
+
}), {
|
|
71
|
+
default: g(() => [
|
|
72
|
+
i("span", {
|
|
73
|
+
class: u(["absolute start-0 top-1.5 bottom-1.5 hidden w-[3px] rounded-e-full bg-primary", S]),
|
|
74
|
+
"aria-hidden": "true"
|
|
75
|
+
}),
|
|
76
|
+
e.$slots.leading || o.icon ? (d(), r("span", {
|
|
77
|
+
key: 0,
|
|
78
|
+
class: u(["flex shrink-0 items-center justify-center text-muted transition-colors duration-150", C])
|
|
79
|
+
}, [f(e.$slots, "leading", {}, () => [(d(), t(p(o.icon), {
|
|
80
|
+
class: u(j.value.icon),
|
|
81
|
+
"aria-hidden": "true"
|
|
82
|
+
}, null, 8, ["class"]))])])) : n("", !0),
|
|
83
|
+
i("span", y, [i("span", { class: u(["min-w-0", e.$slots.default ? "@lg:w-2/5 @lg:max-w-[240px] @lg:shrink-0" : "flex-1"]) }, [e.$slots.title || o.title ? (d(), r("span", {
|
|
84
|
+
key: 0,
|
|
85
|
+
class: u(["block truncate font-medium text-heading", j.value.title])
|
|
86
|
+
}, [f(e.$slots, "title", {}, () => [a(m(o.title), 1)])], 2)) : n("", !0), e.$slots.description || o.description ? (d(), r("span", {
|
|
87
|
+
key: 1,
|
|
88
|
+
class: u(["block truncate text-muted", j.value.description])
|
|
89
|
+
}, [f(e.$slots, "description", {}, () => [a(m(o.description), 1)])], 2)) : n("", !0)], 2), e.$slots.default ? (d(), r("span", {
|
|
90
|
+
key: 0,
|
|
91
|
+
class: u(["min-w-0 flex-1 text-muted", j.value.title])
|
|
92
|
+
}, [f(e.$slots, "default")], 2)) : n("", !0)]),
|
|
93
|
+
e.$slots.trailing ? (d(), r("span", b, [f(e.$slots, "trailing")])) : n("", !0),
|
|
94
|
+
o.chevron ? (d(), t(h(_), {
|
|
95
|
+
key: 2,
|
|
96
|
+
class: "size-4 shrink-0 text-muted rtl:rotate-180",
|
|
97
|
+
"aria-hidden": "true"
|
|
98
|
+
})) : n("", !0)
|
|
99
|
+
]),
|
|
100
|
+
_: 3
|
|
101
|
+
}, 16, ["class"]))]));
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
//#endregion
|
|
105
|
+
export { w as default };
|
|
@@ -36,6 +36,40 @@ export interface MapGeoJson {
|
|
|
36
36
|
id?: string | number;
|
|
37
37
|
}[];
|
|
38
38
|
}
|
|
39
|
+
/** A round area drawn under the points, such as the reach of a cloud region. */
|
|
40
|
+
export interface MapArea {
|
|
41
|
+
/** Unique key, e.g. the region slug `europe`. */
|
|
42
|
+
id: string;
|
|
43
|
+
/** Name under the area, in the tooltip and data table, e.g. "Europe". */
|
|
44
|
+
label: string;
|
|
45
|
+
/** Degrees north of the centre; negative is south. */
|
|
46
|
+
latitude: number;
|
|
47
|
+
/** Degrees east of the centre; negative is west. */
|
|
48
|
+
longitude: number;
|
|
49
|
+
/** Radius in km, measured north to south. The circle stays round and covers the same ground at every zoom. */
|
|
50
|
+
radius: number;
|
|
51
|
+
/** Fill and edge colour. Defaults to `chart-1`, `chart-2`… in the order the areas are listed. */
|
|
52
|
+
color?: ChartColor;
|
|
53
|
+
/** A line under the label on the map and in the tooltip, e.g. "4 datacenters". */
|
|
54
|
+
description?: string;
|
|
55
|
+
/** Other fields, read by your `area-tooltip` slot. */
|
|
56
|
+
[key: string]: any;
|
|
57
|
+
}
|
|
58
|
+
/** Where `focus()` moves the view. */
|
|
59
|
+
export interface MapFocusTarget {
|
|
60
|
+
/** Degrees north of the new centre. */
|
|
61
|
+
latitude: number;
|
|
62
|
+
/** Degrees east of the new centre. */
|
|
63
|
+
longitude: number;
|
|
64
|
+
/** Zoom as a multiple of the whole-world view. Keeps the current zoom when left out. */
|
|
65
|
+
zoom?: number;
|
|
66
|
+
}
|
|
67
|
+
export interface MapChartAreaTooltipSlotProps {
|
|
68
|
+
/** The hovered area. */
|
|
69
|
+
area: MapArea;
|
|
70
|
+
/** Its colour as CSS, e.g. `var(--color-chart-2)`. */
|
|
71
|
+
color: string;
|
|
72
|
+
}
|
|
39
73
|
export interface MapChartTooltipSlotProps {
|
|
40
74
|
/** The hovered point. */
|
|
41
75
|
point: MapPoint;
|
|
@@ -49,6 +83,12 @@ export interface MapChartTooltipSlotProps {
|
|
|
49
83
|
export interface Props {
|
|
50
84
|
/** The locations to plot: `{ id, label, latitude, longitude, status?, description?, value? }`. */
|
|
51
85
|
points: MapPoint[];
|
|
86
|
+
/** Round areas drawn under the points, e.g. the reach of each region: `{ id, label, latitude, longitude, radius, color?, description? }`, with `radius` in km. */
|
|
87
|
+
areas?: MapArea[];
|
|
88
|
+
/** Prints each area's `label` and `description` under it. Labels that would overlap are hidden. */
|
|
89
|
+
areaLabels?: boolean;
|
|
90
|
+
/** Ids of points or areas to highlight, e.g. the datacenter open in a side panel. Set it from `point-click` or `area-click`. */
|
|
91
|
+
selected?: string | string[];
|
|
52
92
|
/** Map height in px. The width fills the container; on narrow screens the world view shrinks to keep its shape. */
|
|
53
93
|
height?: number;
|
|
54
94
|
/** Point diameter in px, or a function of the point, e.g. to size by `value`. cloud-ui uses 10px. */
|
|
@@ -69,7 +109,7 @@ export interface Props {
|
|
|
69
109
|
zoom?: boolean;
|
|
70
110
|
/** Smallest and largest zoom, as multiples of the whole-world view. */
|
|
71
111
|
zoomExtent?: [number, number];
|
|
72
|
-
/** Starts zoomed to fit the points instead of the whole world. */
|
|
112
|
+
/** Starts zoomed to fit the points and areas instead of the whole world. */
|
|
73
113
|
fitToPoints?: boolean;
|
|
74
114
|
/** Your own map in place of the built-in world, e.g. one your API serves. Without it, a 110m Natural Earth world (no Antarctica) loads on first use, about 40 KB gzipped. */
|
|
75
115
|
geoJson?: MapGeoJson;
|
|
@@ -79,11 +119,13 @@ export interface Props {
|
|
|
79
119
|
valueFormatter?: (value: number) => string;
|
|
80
120
|
/** Plural noun for the points in the screen-reader summary: "World map, 10 datacenters: 8 healthy, 2 down." */
|
|
81
121
|
pointsLabel?: string;
|
|
122
|
+
/** Plural noun for the areas in the screen-reader summary: "World map, 16 datacenters in 8 regions: …". */
|
|
123
|
+
areasLabel?: string;
|
|
82
124
|
/** Shows a tooltip with the point's label, description, status and value on hover. Customise it with the `tooltip` slot. */
|
|
83
125
|
tooltip?: boolean;
|
|
84
126
|
/** Shows a skeleton of the same height while data loads. */
|
|
85
127
|
loading?: boolean;
|
|
86
|
-
/** Text shown in place of the map when `points`
|
|
128
|
+
/** Text shown in place of the map when `points` and `areas` are empty. */
|
|
87
129
|
emptyText?: string;
|
|
88
130
|
/** Accessible name, e.g. "Datacenters". Show the visible title in the surrounding card. */
|
|
89
131
|
title?: string;
|
|
@@ -97,11 +139,28 @@ export interface Props {
|
|
|
97
139
|
type __VLS_Slots = {
|
|
98
140
|
/** Replaces the tooltip body for the hovered point. */
|
|
99
141
|
tooltip?: (props: MapChartTooltipSlotProps) => unknown;
|
|
142
|
+
/** Replaces the tooltip body for the hovered area. */
|
|
143
|
+
"area-tooltip"?: (props: MapChartAreaTooltipSlotProps) => unknown;
|
|
100
144
|
};
|
|
101
|
-
declare
|
|
145
|
+
declare function zoomIn(): void;
|
|
146
|
+
declare function zoomOut(): void;
|
|
147
|
+
/** Moves the view to an area or point by id (fitted with room around it), or to a centre and zoom. */
|
|
148
|
+
declare function focus(target?: string | MapFocusTarget): void;
|
|
149
|
+
/** Returns to the starting view: the whole world, or the fitted box with `fitToPoints`. */
|
|
150
|
+
declare function resetView(): void;
|
|
151
|
+
declare const __VLS_base: import("vue").DefineComponent<Props, {
|
|
152
|
+
/** Moves the view to an area or point by id, or to `{ latitude, longitude, zoom? }`. */
|
|
153
|
+
focus: typeof focus;
|
|
154
|
+
/** Returns to the starting view. */
|
|
155
|
+
resetView: typeof resetView;
|
|
156
|
+
zoomIn: typeof zoomIn;
|
|
157
|
+
zoomOut: typeof zoomOut;
|
|
158
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
102
159
|
"point-click": (point: MapPoint) => any;
|
|
160
|
+
"area-click": (area: MapArea) => any;
|
|
103
161
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
104
162
|
"onPoint-click"?: ((point: MapPoint) => any) | undefined;
|
|
163
|
+
"onArea-click"?: ((area: MapArea) => any) | undefined;
|
|
105
164
|
}>, {
|
|
106
165
|
legend: ChartLegendPosition;
|
|
107
166
|
title: string;
|
|
@@ -112,12 +171,15 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
112
171
|
loading: boolean;
|
|
113
172
|
pulse: boolean | string[];
|
|
114
173
|
emptyText: string;
|
|
174
|
+
selected: string | string[];
|
|
115
175
|
labels: boolean;
|
|
116
176
|
valueLabel: string;
|
|
117
177
|
renderer: ChartRenderer;
|
|
118
178
|
zoom: boolean;
|
|
119
179
|
valueFormatter: (value: number) => string;
|
|
120
180
|
legendValues: boolean;
|
|
181
|
+
areas: MapArea[];
|
|
182
|
+
areaLabels: boolean;
|
|
121
183
|
pointSize: number | ((point: MapPoint) => number);
|
|
122
184
|
statusLabels: Record<string, string>;
|
|
123
185
|
statusColors: Record<string, ChartColor>;
|
|
@@ -125,6 +187,7 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
125
187
|
fitToPoints: boolean;
|
|
126
188
|
geoJson: MapGeoJson;
|
|
127
189
|
pointsLabel: string;
|
|
190
|
+
areasLabel: string;
|
|
128
191
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
129
192
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
130
193
|
declare const _default: typeof __VLS_export;
|