@ac-design/design-system 2.2.0 → 2.3.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 +89 -88
- package/dist/lib/compat.css +210 -0
- package/dist/lib/components/AcAppSwitcher.vue_vue_type_script_setup_true_lang.js +74 -73
- package/dist/lib/components/AcButton.vue.d.ts +18 -12
- package/dist/lib/components/AcButton.vue_vue_type_script_setup_true_lang.js +62 -32
- package/dist/lib/components/AcCard.vue.d.ts +11 -5
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +99 -51
- package/dist/lib/components/AcClusterSwitcher.vue_vue_type_script_setup_true_lang.js +151 -150
- package/dist/lib/components/AcColorInput.vue.d.ts +1 -1
- package/dist/lib/components/AcDatePicker.vue.d.ts +27 -3
- package/dist/lib/components/AcDatePicker.vue_vue_type_script_setup_true_lang.js +518 -454
- package/dist/lib/components/AcDropdown.vue_vue_type_script_setup_true_lang.js +56 -55
- package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
- package/dist/lib/components/AcFormFooter.vue_vue_type_script_setup_true_lang.js +39 -38
- package/dist/lib/components/AcHeader.vue.d.ts +1 -1
- package/dist/lib/components/AcInput.vue.d.ts +28 -7
- package/dist/lib/components/AcInput.vue_vue_type_script_setup_true_lang.js +149 -80
- package/dist/lib/components/AcKeyValueInput.vue.d.ts +1 -1
- package/dist/lib/components/AcLocaleSwitcher.vue.d.ts +6 -0
- package/dist/lib/components/AcLocaleSwitcher.vue_vue_type_script_setup_true_lang.js +74 -58
- package/dist/lib/components/AcModal.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/lib/components/AcNavbar.vue.d.ts +2 -0
- package/dist/lib/components/AcNavbar.vue_vue_type_script_setup_true_lang.js +31 -25
- package/dist/lib/components/AcNotificationMenu.vue_vue_type_script_setup_true_lang.js +90 -89
- package/dist/lib/components/AcNumberInput.vue.d.ts +1 -1
- package/dist/lib/components/AcRadioCard.js +5 -0
- package/dist/lib/components/AcRadioCard.vue.d.ts +55 -0
- package/dist/lib/components/AcRadioCard.vue_vue_type_script_setup_true_lang.js +135 -0
- package/dist/lib/components/AcSelect.vue.d.ts +12 -1
- package/dist/lib/components/AcSelect.vue_vue_type_script_setup_true_lang.js +237 -220
- package/dist/lib/components/AcSidePanel.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/lib/components/AcSideTabs.vue.d.ts +1 -1
- package/dist/lib/components/AcSidebar.vue.d.ts +9 -0
- package/dist/lib/components/AcSidebar.vue_vue_type_script_setup_true_lang.js +113 -94
- package/dist/lib/components/AcSidebarSection.vue_vue_type_script_setup_true_lang.js +19 -18
- package/dist/lib/components/AcSlider.vue.d.ts +1 -1
- package/dist/lib/components/AcTable.vue.d.ts +13 -1
- package/dist/lib/components/AcTable.vue_vue_type_script_setup_true_lang.js +106 -86
- package/dist/lib/components/AcTagInput.vue.d.ts +1 -1
- package/dist/lib/components/AcTextarea.vue.d.ts +30 -4
- package/dist/lib/components/AcTextarea.vue_vue_type_script_setup_true_lang.js +92 -61
- package/dist/lib/components/AcThemeMode.vue.d.ts +10 -2
- package/dist/lib/components/AcThemeMode.vue_vue_type_script_setup_true_lang.js +53 -42
- package/dist/lib/components/AcTimePicker.vue.d.ts +21 -3
- package/dist/lib/components/AcTimePicker.vue_vue_type_script_setup_true_lang.js +234 -201
- package/dist/lib/components/AcTooltip.vue_vue_type_script_setup_true_lang.js +73 -72
- package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +125 -107
- package/dist/lib/components/fixedFrame.d.ts +11 -0
- package/dist/lib/components/fixedFrame.js +24 -0
- package/dist/lib/components/index.d.ts +1 -0
- package/dist/lib/components/types.d.ts +2 -0
- package/dist/lib/index.js +34 -33
- package/package.json +1 -1
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import e from "../components/
|
|
2
|
-
import t from "../components/
|
|
3
|
-
import
|
|
1
|
+
import { fixedFrame as e } from "../components/fixedFrame.js";
|
|
2
|
+
import t from "../components/AcSkeleton.js";
|
|
3
|
+
import n from "../components/AcEmptyState.js";
|
|
4
|
+
import { Fragment as r, Teleport as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, mergeModels as d, normalizeClass as f, normalizeStyle as p, onBeforeUnmount as m, onMounted as h, openBlock as g, ref as _, renderList as v, renderSlot as y, toDisplayString as b, useModel as x, watch as S } from "vue";
|
|
4
5
|
//#region src/lib/charts/ChartFrame.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var C = ["data-testid"], w = ["aria-pressed", "onClick"], T = { class: "truncate" }, E = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "ml-auto pl-3 font-medium text-heading tabular-nums"
|
|
8
|
-
},
|
|
9
|
+
}, D = ["role", "aria-label"], O = ["aria-label"], k = {
|
|
9
10
|
key: 4,
|
|
10
11
|
class: "sr-only"
|
|
11
|
-
},
|
|
12
|
+
}, A = {
|
|
12
13
|
key: 5,
|
|
13
14
|
class: "sr-only"
|
|
14
|
-
},
|
|
15
|
+
}, j = {
|
|
15
16
|
scope: "row",
|
|
16
17
|
class: "text-left"
|
|
17
|
-
},
|
|
18
|
+
}, M = {
|
|
18
19
|
key: 0,
|
|
19
20
|
class: "mb-1.5 font-medium text-heading"
|
|
20
|
-
},
|
|
21
|
+
}, N = { class: "m-0 flex list-none flex-col gap-1 p-0" }, P = { class: "min-w-0 flex-1 truncate text-muted" }, F = { class: "pl-4 font-medium text-heading tabular-nums" }, I = {
|
|
21
22
|
key: 1,
|
|
22
23
|
class: "mt-1.5 flex justify-between gap-4 border-t border-border pt-1.5"
|
|
23
|
-
},
|
|
24
|
+
}, L = { class: "font-medium text-heading tabular-nums" }, R = 14, z = 300, B = 200, V = /*@__PURE__*/ u({
|
|
24
25
|
__name: "ChartFrame",
|
|
25
|
-
props: /*@__PURE__*/
|
|
26
|
+
props: /*@__PURE__*/ d({
|
|
26
27
|
testid: {},
|
|
27
28
|
height: {},
|
|
28
29
|
loading: { type: Boolean },
|
|
@@ -48,126 +49,126 @@ var S = ["data-testid"], C = ["aria-pressed", "onClick"], w = { class: "truncate
|
|
|
48
49
|
widthModifiers: {}
|
|
49
50
|
}),
|
|
50
51
|
emits: ["update:hidden", "update:width"],
|
|
51
|
-
setup(
|
|
52
|
-
let
|
|
53
|
-
function W(e) {
|
|
54
|
-
let t = B.value.includes(e);
|
|
55
|
-
!t && u.legendItems.length - B.value.length <= 1 || (B.value = t ? B.value.filter((t) => t !== e) : [...B.value, e]);
|
|
56
|
-
}
|
|
52
|
+
setup(u) {
|
|
53
|
+
let d = u, V = x(u, "hidden"), H = x(u, "width"), U = _(), W;
|
|
57
54
|
function G(e) {
|
|
58
|
-
let t =
|
|
55
|
+
let t = V.value.includes(e);
|
|
56
|
+
!t && d.legendItems.length - V.value.length <= 1 || (V.value = t ? V.value.filter((t) => t !== e) : [...V.value, e]);
|
|
57
|
+
}
|
|
58
|
+
function K(t) {
|
|
59
|
+
let n = e(), r = t.clientX > n.right - z, i = t.clientY > n.bottom - B;
|
|
59
60
|
return {
|
|
60
|
-
left:
|
|
61
|
-
right:
|
|
62
|
-
top:
|
|
63
|
-
bottom:
|
|
61
|
+
left: r ? void 0 : `${t.clientX - n.left + R}px`,
|
|
62
|
+
right: r ? `${n.right - t.clientX + R}px` : void 0,
|
|
63
|
+
top: i ? void 0 : `${t.clientY - n.top + R}px`,
|
|
64
|
+
bottom: i ? `${n.bottom - t.clientY + R}px` : void 0
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
|
-
function
|
|
67
|
-
|
|
68
|
-
e && (
|
|
69
|
-
}),
|
|
67
|
+
function q() {
|
|
68
|
+
W?.disconnect(), U.value && typeof ResizeObserver < "u" && (W = new ResizeObserver(([e]) => {
|
|
69
|
+
e && (H.value = Math.round(e.contentRect.width));
|
|
70
|
+
}), W.observe(U.value));
|
|
70
71
|
}
|
|
71
|
-
return
|
|
72
|
-
class:
|
|
72
|
+
return S(U, q), h(q), m(() => W?.disconnect()), (e, d) => (g(), s("figure", {
|
|
73
|
+
class: f(["m-0 flex w-full min-w-0 gap-3", u.legend === "right" ? "flex-wrap items-center justify-center gap-x-10" : "flex-col"]),
|
|
73
74
|
"data-ac-ds": "",
|
|
74
75
|
"data-ac-chart": "",
|
|
75
|
-
"data-testid":
|
|
76
|
+
"data-testid": u.testid
|
|
76
77
|
}, [
|
|
77
|
-
|
|
78
|
+
u.legend !== "none" && u.legendItems.length > 1 && !u.loading && !u.empty ? (g(), s("ul", {
|
|
78
79
|
key: 0,
|
|
79
|
-
class:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
80
|
+
class: f(["m-0 flex list-none flex-wrap gap-x-4 gap-y-1.5 p-0", [
|
|
81
|
+
u.legend === "bottom" && "order-last",
|
|
82
|
+
u.legend === "right" && "order-last max-w-[320px] min-w-[180px] flex-1 flex-col gap-y-2",
|
|
83
|
+
u.legendCentered && u.legend !== "right" && "justify-center"
|
|
83
84
|
]]),
|
|
84
85
|
"aria-label": "Legend"
|
|
85
|
-
}, [(
|
|
86
|
+
}, [(g(!0), s(r, null, v(u.legendItems, (e) => (g(), s("li", {
|
|
86
87
|
key: e.key,
|
|
87
88
|
class: "flex"
|
|
88
|
-
}, [
|
|
89
|
+
}, [c("button", {
|
|
89
90
|
type: "button",
|
|
90
|
-
class:
|
|
91
|
-
"aria-pressed": !
|
|
92
|
-
onClick: (t) =>
|
|
91
|
+
class: f(["inline-flex min-w-0 cursor-pointer items-center gap-2 rounded-6 text-xs transition-colors duration-200 hover:text-heading focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface motion-reduce:transition-none", [V.value.includes(e.key) ? "text-muted/60 line-through" : "text-muted", u.legend === "right" && "w-full"]]),
|
|
92
|
+
"aria-pressed": !V.value.includes(e.key),
|
|
93
|
+
onClick: (t) => G(e.key)
|
|
93
94
|
}, [
|
|
94
|
-
|
|
95
|
-
class:
|
|
96
|
-
style:
|
|
95
|
+
c("span", {
|
|
96
|
+
class: f(["size-2.5 shrink-0 rounded-full transition-opacity duration-200 motion-reduce:transition-none", V.value.includes(e.key) && "opacity-30"]),
|
|
97
|
+
style: p({ backgroundColor: e.color }),
|
|
97
98
|
"aria-hidden": "true"
|
|
98
99
|
}, null, 6),
|
|
99
|
-
|
|
100
|
-
e.value ? (
|
|
101
|
-
], 10,
|
|
102
|
-
|
|
100
|
+
c("span", T, b(e.name), 1),
|
|
101
|
+
e.value ? (g(), s("span", E, b(e.value), 1)) : o("", !0)
|
|
102
|
+
], 10, w)]))), 128))], 2)) : o("", !0),
|
|
103
|
+
u.loading ? (g(), a(t, {
|
|
103
104
|
key: 1,
|
|
104
105
|
shape: "rect",
|
|
105
|
-
height: `${
|
|
106
|
+
height: `${u.height}px`,
|
|
106
107
|
label: "Loading chart"
|
|
107
|
-
}, null, 8, ["height"])) :
|
|
108
|
+
}, null, 8, ["height"])) : u.empty ? (g(), s("div", {
|
|
108
109
|
key: 2,
|
|
109
110
|
class: "flex w-full items-center justify-center overflow-hidden",
|
|
110
|
-
style:
|
|
111
|
-
}, [
|
|
111
|
+
style: p({ height: `${u.height}px` })
|
|
112
|
+
}, [l(n, {
|
|
112
113
|
size: "small",
|
|
113
|
-
icon:
|
|
114
|
-
title:
|
|
115
|
-
}, null, 8, ["icon", "title"])], 4)) : (
|
|
114
|
+
icon: u.emptyIcon,
|
|
115
|
+
title: u.emptyText
|
|
116
|
+
}, null, 8, ["icon", "title"])], 4)) : (g(), s("div", {
|
|
116
117
|
key: 3,
|
|
117
118
|
ref_key: "plot",
|
|
118
|
-
ref:
|
|
119
|
-
class:
|
|
120
|
-
style:
|
|
121
|
-
height: `${
|
|
122
|
-
width: `${
|
|
123
|
-
} : { height: `${
|
|
124
|
-
role:
|
|
125
|
-
"aria-label":
|
|
126
|
-
}, [
|
|
119
|
+
ref: U,
|
|
120
|
+
class: f(["relative min-w-0", u.legend === "right" ? "max-w-full shrink-0" : "w-full"]),
|
|
121
|
+
style: p(u.legend === "right" ? {
|
|
122
|
+
height: `${u.height}px`,
|
|
123
|
+
width: `${u.height}px`
|
|
124
|
+
} : { height: `${u.height}px` }),
|
|
125
|
+
role: e.$slots.controls ? void 0 : "img",
|
|
126
|
+
"aria-label": e.$slots.controls ? void 0 : u.summary
|
|
127
|
+
}, [e.$slots.controls ? (g(), s("div", {
|
|
127
128
|
key: 0,
|
|
128
129
|
class: "size-full",
|
|
129
130
|
role: "img",
|
|
130
|
-
"aria-label":
|
|
131
|
-
}, [
|
|
132
|
-
|
|
133
|
-
!
|
|
134
|
-
|
|
135
|
-
|
|
131
|
+
"aria-label": u.summary
|
|
132
|
+
}, [y(e.$slots, "default")], 8, O)) : y(e.$slots, "default", {}, void 0, void 0, 1), y(e.$slots, "controls")], 14, D)),
|
|
133
|
+
u.title || u.description ? (g(), s("figcaption", k, b([u.title, u.description].filter(Boolean).join(". ")), 1)) : o("", !0),
|
|
134
|
+
!u.loading && !u.empty ? (g(), s("table", A, [
|
|
135
|
+
c("caption", null, b(u.title ? `${u.title}: data` : "Chart data"), 1),
|
|
136
|
+
c("thead", null, [c("tr", null, [(g(!0), s(r, null, v(u.table.columns, (e, t) => (g(), s("th", {
|
|
136
137
|
key: t,
|
|
137
138
|
scope: "col",
|
|
138
139
|
class: "text-left"
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
])) :
|
|
142
|
-
(
|
|
140
|
+
}, b(e), 1))), 128))])]),
|
|
141
|
+
c("tbody", null, [(g(!0), s(r, null, v(u.table.rows, (e, t) => (g(), s("tr", { key: t }, [c("th", j, b(e[0]), 1), (g(!0), s(r, null, v(e.slice(1), (e, t) => (g(), s("td", { key: t }, b(e), 1))), 128))]))), 128))])
|
|
142
|
+
])) : o("", !0),
|
|
143
|
+
(g(), a(i, { to: "body" }, [u.tooltip && u.tip && !u.loading && !u.empty ? (g(), s("div", {
|
|
143
144
|
key: 0,
|
|
144
145
|
class: "pointer-events-none fixed z-[100] w-max max-w-[280px] min-w-[160px] rounded-10 border border-border bg-surface px-3 py-2.5 text-xs text-body shadow-lg",
|
|
145
|
-
style:
|
|
146
|
+
style: p(K(u.tip)),
|
|
146
147
|
"aria-hidden": "true",
|
|
147
148
|
"data-ac-ds": "",
|
|
148
149
|
"data-testid": "ac-chart-tooltip"
|
|
149
|
-
}, [
|
|
150
|
-
datum:
|
|
151
|
-
index:
|
|
152
|
-
title:
|
|
153
|
-
items:
|
|
150
|
+
}, [y(e.$slots, "tooltip", {
|
|
151
|
+
datum: u.tip.datum,
|
|
152
|
+
index: u.tip.index,
|
|
153
|
+
title: u.tip.title,
|
|
154
|
+
items: u.tip.items
|
|
154
155
|
}, () => [
|
|
155
|
-
|
|
156
|
-
|
|
156
|
+
u.tip.title ? (g(), s("p", M, b(u.tip.title), 1)) : o("", !0),
|
|
157
|
+
c("ul", N, [(g(!0), s(r, null, v(u.tip.items, (e) => (g(), s("li", {
|
|
157
158
|
key: e.key,
|
|
158
159
|
class: "flex items-center gap-2"
|
|
159
160
|
}, [
|
|
160
|
-
|
|
161
|
+
c("span", {
|
|
161
162
|
class: "size-2 shrink-0 rounded-full",
|
|
162
|
-
style:
|
|
163
|
+
style: p({ backgroundColor: e.color })
|
|
163
164
|
}, null, 4),
|
|
164
|
-
|
|
165
|
-
|
|
165
|
+
c("span", P, b(e.name), 1),
|
|
166
|
+
c("span", F, b(e.formatted), 1)
|
|
166
167
|
]))), 128))]),
|
|
167
|
-
|
|
168
|
-
])], 4)) :
|
|
169
|
-
], 10,
|
|
168
|
+
u.tip.total ? (g(), s("p", I, [d[0] ||= c("span", { class: "text-muted" }, "Total", -1), c("span", L, b(u.tip.total), 1)])) : o("", !0)
|
|
169
|
+
])], 4)) : o("", !0)]))
|
|
170
|
+
], 10, C));
|
|
170
171
|
}
|
|
171
172
|
});
|
|
172
173
|
//#endregion
|
|
173
|
-
export {
|
|
174
|
+
export { V as default };
|