@ac-design/design-system 2.7.0 → 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/compat.css +49 -10
- package/dist/lib/components/AcCard.vue_vue_type_script_setup_true_lang.js +2 -2
- package/dist/lib/components/AcCheckBox.vue_vue_type_script_setup_true_lang.js +46 -43
- 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/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/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/AcModal.vue_vue_type_script_setup_true_lang.js +12 -8
- package/dist/lib/components/AcMonthPicker.vue.d.ts +3 -0
- package/dist/lib/components/AcMonthPicker.vue_vue_type_script_setup_true_lang.js +12 -2
- 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/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/AcSidebar.vue_vue_type_script_setup_true_lang.js +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/theme.css +11 -0
- package/package.json +1 -1
|
@@ -45,6 +45,10 @@ var C = ["aria-labelledby", "aria-describedby"], w = { class: "flex shrink-0 ite
|
|
|
45
45
|
P.closable && (F.value = !1, I("close"));
|
|
46
46
|
}
|
|
47
47
|
function U(e) {
|
|
48
|
+
let t = e.currentTarget;
|
|
49
|
+
e.clientX >= t.getBoundingClientRect().left + t.clientWidth || (e.preventDefault(), P.closeOnOutsideClick && H());
|
|
50
|
+
}
|
|
51
|
+
function W(e) {
|
|
48
52
|
if (e.key === "Escape") {
|
|
49
53
|
if (e.defaultPrevented) return;
|
|
50
54
|
e.stopPropagation(), H();
|
|
@@ -55,7 +59,7 @@ var C = ["aria-labelledby", "aria-describedby"], w = { class: "flex shrink-0 ite
|
|
|
55
59
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
|
|
56
60
|
}
|
|
57
61
|
}
|
|
58
|
-
function
|
|
62
|
+
function G(e) {
|
|
59
63
|
let t = document.body, n = Number(t.dataset.acModals ?? 0) + (e ? 1 : -1);
|
|
60
64
|
if (t.dataset.acModals = String(Math.max(n, 0)), e && n === 1) {
|
|
61
65
|
let e = window.innerWidth - document.documentElement.clientWidth;
|
|
@@ -66,16 +70,16 @@ var C = ["aria-labelledby", "aria-describedby"], w = { class: "flex shrink-0 ite
|
|
|
66
70
|
}
|
|
67
71
|
return y(F, async (e, t) => {
|
|
68
72
|
if (e) {
|
|
69
|
-
V = document.activeElement,
|
|
73
|
+
V = document.activeElement, G(!0), await l();
|
|
70
74
|
let e = B.value?.querySelector("[autofocus]");
|
|
71
75
|
((e && (e.matches(N) ? e : e.querySelector(N))) ?? B.value?.querySelector(L) ?? B.value)?.focus();
|
|
72
|
-
} else t && (
|
|
76
|
+
} else t && (G(!1), V?.isConnected && V.focus());
|
|
73
77
|
}, { immediate: !0 }), d(() => {
|
|
74
|
-
F.value &&
|
|
78
|
+
F.value && (G(!1), V?.isConnected && V.focus());
|
|
75
79
|
}), (c, l) => (f(), n(e, { to: "body" }, [o(t, {
|
|
76
80
|
"enter-active-class": "transition-opacity duration-300 ease-out",
|
|
77
81
|
"enter-from-class": s.side === "right" ? "opacity-0 [&_[data-panel]]:translate-x-full" : "opacity-0 [&_[data-panel]]:-translate-x-full",
|
|
78
|
-
"leave-active-class": "transition-opacity duration-200 ease-in",
|
|
82
|
+
"leave-active-class": "pointer-events-none transition-opacity duration-200 ease-in",
|
|
79
83
|
"leave-to-class": s.side === "right" ? "opacity-0 [&_[data-panel]]:translate-x-full" : "opacity-0 [&_[data-panel]]:-translate-x-full"
|
|
80
84
|
}, {
|
|
81
85
|
default: b(() => [F.value ? (f(), i("div", {
|
|
@@ -83,8 +87,8 @@ var C = ["aria-labelledby", "aria-describedby"], w = { class: "flex shrink-0 ite
|
|
|
83
87
|
class: "fixed inset-0 z-[80] bg-black/50",
|
|
84
88
|
"data-ac-ds": "",
|
|
85
89
|
"data-testid": "ac-side-panel",
|
|
86
|
-
onKeydown:
|
|
87
|
-
onMousedown:
|
|
90
|
+
onKeydown: W,
|
|
91
|
+
onMousedown: x(U, ["self"])
|
|
88
92
|
}, [a("div", {
|
|
89
93
|
ref_key: "panel",
|
|
90
94
|
ref: B,
|
|
@@ -159,7 +159,7 @@ var E = [
|
|
|
159
159
|
s(t, {
|
|
160
160
|
"enter-active-class": "transition-opacity duration-200",
|
|
161
161
|
"enter-from-class": "opacity-0",
|
|
162
|
-
"leave-active-class": "transition-opacity duration-150",
|
|
162
|
+
"leave-active-class": "pointer-events-none transition-opacity duration-150",
|
|
163
163
|
"leave-to-class": "opacity-0"
|
|
164
164
|
}, {
|
|
165
165
|
default: S(() => [q.value ? (p(), a("div", {
|
|
@@ -19,9 +19,12 @@ export interface Props {
|
|
|
19
19
|
orientation?: "horizontal" | "vertical";
|
|
20
20
|
/** With `orientation="vertical"`, the id of the current sub-step of the current step. Earlier sub-steps show a check mark. */
|
|
21
21
|
activeSubstep?: number | string;
|
|
22
|
+
/** With `orientation="horizontal"`, hides the titles and descriptions visually when the steps are narrower than 480px, leaving the numbered dots. Screen readers still read them. Use it when the current step's own heading names it. */
|
|
23
|
+
compact?: boolean;
|
|
22
24
|
}
|
|
23
25
|
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
24
26
|
orientation: "horizontal" | "vertical";
|
|
27
|
+
compact: boolean;
|
|
25
28
|
activeSubstep: number | string;
|
|
26
29
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
30
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
import { Fragment as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, renderList as c, toDisplayString as l, unref as u } from "vue";
|
|
2
2
|
import { Check as d } from "@lucide/vue";
|
|
3
3
|
//#region src/lib/components/AcSteps.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var f = {
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "flex w-full",
|
|
7
|
-
"data-ac-ds": "",
|
|
8
|
-
"data-testid": "ac-steps"
|
|
9
|
-
}, p = ["aria-current"], m = { key: 1 }, h = {
|
|
10
|
-
key: 1,
|
|
11
|
-
class: "mt-0.5 text-xs text-muted"
|
|
12
|
-
}, g = {
|
|
4
|
+
var f = ["aria-current"], p = { key: 1 }, m = {
|
|
13
5
|
key: 1,
|
|
14
6
|
class: "flex w-full flex-col",
|
|
15
7
|
"data-ac-ds": "",
|
|
16
8
|
"data-testid": "ac-steps"
|
|
17
|
-
},
|
|
9
|
+
}, h = ["aria-current"], g = { key: 1 }, _ = { class: "min-w-0 flex-1 pt-1.5" }, v = {
|
|
18
10
|
key: 0,
|
|
19
11
|
class: "mt-0.5 text-xs text-muted"
|
|
20
|
-
},
|
|
12
|
+
}, y = {
|
|
21
13
|
key: 1,
|
|
22
14
|
class: "mt-2 space-y-0.5 border-l border-dashed border-border-dark pl-3",
|
|
23
15
|
"data-testid": "ac-steps-substeps"
|
|
24
|
-
},
|
|
16
|
+
}, b = ["aria-current"], x = {
|
|
25
17
|
key: 1,
|
|
26
18
|
class: "size-1.5 rounded-full bg-primary"
|
|
27
|
-
},
|
|
19
|
+
}, S = /*@__PURE__*/ a({
|
|
28
20
|
__name: "AcSteps",
|
|
29
21
|
props: {
|
|
30
22
|
options: {},
|
|
31
23
|
active: {},
|
|
32
24
|
orientation: { default: "horizontal" },
|
|
33
|
-
activeSubstep: { default: void 0 }
|
|
25
|
+
activeSubstep: { default: void 0 },
|
|
26
|
+
compact: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !1
|
|
29
|
+
}
|
|
34
30
|
},
|
|
35
31
|
setup(a) {
|
|
36
|
-
let
|
|
37
|
-
return (
|
|
32
|
+
let S = a, C = (e) => S.activeSubstep === void 0 ? -1 : (e.substeps ?? []).findIndex((e) => e.id === S.activeSubstep);
|
|
33
|
+
return (S, w) => a.orientation === "horizontal" ? (s(), r("ol", {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: o(["flex w-full", a.compact && "@container/steps"]),
|
|
36
|
+
"data-ac-ds": "",
|
|
37
|
+
"data-testid": "ac-steps"
|
|
38
|
+
}, [(s(!0), r(e, null, c(a.options, (e, c) => (s(), r("li", {
|
|
38
39
|
key: e.id,
|
|
39
40
|
class: "relative flex flex-1 flex-col items-center px-2 text-center",
|
|
40
41
|
"aria-current": a.active === e.id ? "step" : void 0
|
|
@@ -49,10 +50,13 @@ var f = {
|
|
|
49
50
|
class: "size-4",
|
|
50
51
|
"stroke-width": 2.5,
|
|
51
52
|
"aria-hidden": "true"
|
|
52
|
-
})) : (s(), r("span",
|
|
53
|
-
i("p", { class: o(["mt-3 text-base font-medium", a.active >= e.id ? "text-heading" : "text-muted"]) }, l(e.title), 3),
|
|
54
|
-
e.description ? (s(), r("p",
|
|
55
|
-
|
|
53
|
+
})) : (s(), r("span", p, l(e.id), 1))], 2),
|
|
54
|
+
i("p", { class: o(["mt-3 text-base font-medium", [a.active >= e.id ? "text-heading" : "text-muted", a.compact && "@max-[480px]/steps:sr-only"]]) }, l(e.title), 3),
|
|
55
|
+
e.description ? (s(), r("p", {
|
|
56
|
+
key: 1,
|
|
57
|
+
class: o(["mt-0.5 text-xs text-muted", a.compact && "@max-[480px]/steps:sr-only"])
|
|
58
|
+
}, l(e.description), 3)) : n("", !0)
|
|
59
|
+
], 8, f))), 128))], 2)) : (s(), r("ol", m, [(s(!0), r(e, null, c(a.options, (f, p) => (s(), r("li", {
|
|
56
60
|
key: f.id,
|
|
57
61
|
class: "relative flex gap-3 pb-6 last:pb-0",
|
|
58
62
|
"aria-current": a.active === f.id ? "step" : void 0
|
|
@@ -67,25 +71,25 @@ var f = {
|
|
|
67
71
|
class: "size-4",
|
|
68
72
|
"stroke-width": 2.5,
|
|
69
73
|
"aria-hidden": "true"
|
|
70
|
-
})) : (s(), r("span",
|
|
71
|
-
i("div",
|
|
74
|
+
})) : (s(), r("span", g, l(f.id), 1))], 2),
|
|
75
|
+
i("div", _, [
|
|
72
76
|
i("p", { class: o(["text-base font-medium", a.active >= f.id ? "text-heading" : "text-muted"]) }, l(f.title), 3),
|
|
73
|
-
f.description ? (s(), r("p",
|
|
74
|
-
f.substeps?.length && a.active === f.id ? (s(), r("ul",
|
|
77
|
+
f.description ? (s(), r("p", v, l(f.description), 1)) : n("", !0),
|
|
78
|
+
f.substeps?.length && a.active === f.id ? (s(), r("ul", y, [(s(!0), r(e, null, c(f.substeps, (e, c) => (s(), r("li", {
|
|
75
79
|
key: e.id,
|
|
76
80
|
class: "flex items-center gap-2 py-1",
|
|
77
81
|
"aria-current": e.id === a.activeSubstep ? "step" : void 0
|
|
78
82
|
}, [i("span", {
|
|
79
|
-
class: o(["inline-flex size-5 shrink-0 items-center justify-center rounded-full transition-colors duration-200", c <
|
|
83
|
+
class: o(["inline-flex size-5 shrink-0 items-center justify-center rounded-full transition-colors duration-200", c < C(f) ? "bg-primary text-white" : c === C(f) ? "bg-surface text-primary-strong ring-2 ring-primary" : "bg-surface text-muted ring-1 ring-border-dark"]),
|
|
80
84
|
"aria-hidden": "true"
|
|
81
|
-
}, [c <
|
|
85
|
+
}, [c < C(f) ? (s(), t(u(d), {
|
|
82
86
|
key: 0,
|
|
83
87
|
class: "size-3",
|
|
84
88
|
"stroke-width": 3
|
|
85
|
-
})) : c ===
|
|
89
|
+
})) : c === C(f) ? (s(), r("span", x)) : n("", !0)], 2), i("span", { class: o(["min-w-0 truncate text-base", c < C(f) ? "text-heading/80" : c === C(f) ? "font-medium text-heading" : "text-muted"]) }, l(e.title), 3)], 8, b))), 128))])) : n("", !0)
|
|
86
90
|
])
|
|
87
|
-
], 8,
|
|
91
|
+
], 8, h))), 128))]));
|
|
88
92
|
}
|
|
89
93
|
});
|
|
90
94
|
//#endregion
|
|
91
|
-
export {
|
|
95
|
+
export { S as default };
|
|
@@ -53,7 +53,7 @@ var h = { class: "flex items-center gap-2" }, g = ["for"], _ = [
|
|
|
53
53
|
i.label ? (c(), n("label", {
|
|
54
54
|
key: 0,
|
|
55
55
|
for: E.value,
|
|
56
|
-
class: s(["
|
|
56
|
+
class: s(["text-base font-medium", i.disabled ? "cursor-not-allowed text-muted" : "cursor-pointer text-heading"])
|
|
57
57
|
}, d(i.label), 11, g)) : t("", !0),
|
|
58
58
|
u(e.$slots, "middle"),
|
|
59
59
|
r("button", o({
|
|
@@ -8,40 +8,40 @@ var ce = { class: "ac-scrollbar" }, le = { class: "w-full border-separate border
|
|
|
8
8
|
"checked",
|
|
9
9
|
"indeterminate",
|
|
10
10
|
"disabled"
|
|
11
|
-
], fe = ["aria-sort", "onClick"], pe = {
|
|
11
|
+
], fe = ["aria-sort", "onClick"], pe = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "h-11 border-b border-border pl-4 [tr:last-child_&]:border-0"
|
|
14
|
-
},
|
|
14
|
+
}, me = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "h-11 border-b border-border pl-4 [tr:last-child_&]:border-0"
|
|
17
|
-
},
|
|
17
|
+
}, he = {
|
|
18
18
|
key: 2,
|
|
19
19
|
class: "h-11 border-b border-border [tr:last-child_&]:border-0"
|
|
20
|
-
},
|
|
20
|
+
}, ge = [
|
|
21
21
|
"aria-current",
|
|
22
22
|
"aria-disabled",
|
|
23
23
|
"onClick"
|
|
24
|
-
],
|
|
24
|
+
], _e = [
|
|
25
25
|
"aria-expanded",
|
|
26
26
|
"aria-controls",
|
|
27
27
|
"aria-label",
|
|
28
28
|
"onClick"
|
|
29
|
-
],
|
|
29
|
+
], ve = { class: "relative flex size-[18px]" }, ye = [
|
|
30
30
|
"checked",
|
|
31
31
|
"disabled",
|
|
32
32
|
"aria-label",
|
|
33
33
|
"onChange"
|
|
34
|
-
],
|
|
34
|
+
], be = {
|
|
35
35
|
key: 2,
|
|
36
36
|
class: "flex min-w-0 items-center"
|
|
37
|
-
},
|
|
37
|
+
}, xe = {
|
|
38
38
|
key: 1,
|
|
39
39
|
class: "block truncate"
|
|
40
|
-
},
|
|
40
|
+
}, Se = {
|
|
41
41
|
key: 0,
|
|
42
42
|
class: "group",
|
|
43
43
|
"data-testid": "ac-table-detail"
|
|
44
|
-
},
|
|
44
|
+
}, Ce = ["colspan"], we = ["id", "aria-label"], Te = {
|
|
45
45
|
key: 0,
|
|
46
46
|
class: "px-6 py-12 text-center text-muted"
|
|
47
47
|
}, E = "border-border", D = "peer size-[18px] cursor-pointer appearance-none rounded-4 border border-muted/70 bg-background align-middle transition-colors duration-150 hover:border-primary/60 checked:border-primary checked:bg-primary indeterminate:border-primary indeterminate:bg-primary focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", O = /*@__PURE__*/ d({
|
|
@@ -130,7 +130,7 @@ var ce = { class: "ac-scrollbar" }, le = { class: "w-full border-separate border
|
|
|
130
130
|
"update:sortBy"
|
|
131
131
|
]),
|
|
132
132
|
setup(d, { emit: p }) {
|
|
133
|
-
let O = d, k = S(d, "selected"), A = S(d, "expanded"), j = S(d, "page"), M = p, N = ne(), P = f()?.appContext.components.RouterLink,
|
|
133
|
+
let O = d, k = S(d, "selected"), A = S(d, "expanded"), j = S(d, "page"), M = p, N = ne(), P = f()?.appContext.components.RouterLink, Ee = te(), F = S(d, "sortBy"), I = i(() => F.value?.key ?? ""), L = i(() => F.value?.mode ?? "asc"), De = (e) => {
|
|
134
134
|
if (!e.sortable) return;
|
|
135
135
|
let t = I.value === e.key && L.value === "asc" ? "desc" : "asc";
|
|
136
136
|
F.value = {
|
|
@@ -140,26 +140,26 @@ var ce = { class: "ac-scrollbar" }, le = { class: "w-full border-separate border
|
|
|
140
140
|
}, R = i(() => {
|
|
141
141
|
let e = O.search ?? [];
|
|
142
142
|
return e.length ? O.rows.filter((t) => e.every((e) => {
|
|
143
|
-
let n =
|
|
143
|
+
let n = U(t[e.key]);
|
|
144
144
|
return n != null && String(n).toLowerCase().includes(e.searchText.toLowerCase());
|
|
145
145
|
})) : O.rows;
|
|
146
146
|
}), z = i(() => {
|
|
147
147
|
if (!I.value || O.manualSort) return R.value;
|
|
148
148
|
let e = I.value, t = L.value === "asc" ? 1 : -1, n = O.columns.find((t) => t.key === e)?.sortType;
|
|
149
149
|
return n ? [...R.value].sort((r, i) => {
|
|
150
|
-
let a =
|
|
150
|
+
let a = U(r[e]), o = U(i[e]);
|
|
151
151
|
return a == null ? 1 : o == null ? -1 : Ae(a, o, n) * t;
|
|
152
|
-
}) : [...R.value].sort((n, r) => String(
|
|
153
|
-
}),
|
|
152
|
+
}) : [...R.value].sort((n, r) => String(U(n[e]) ?? "").localeCompare(String(U(r[e]) ?? ""), void 0, { numeric: !0 }) * t);
|
|
153
|
+
}), Oe = i(() => O.pageSize ? Math.max(1, Math.ceil(z.value.length / O.pageSize)) : 1), B = i(() => Math.min(Math.max(1, j.value), Oe.value)), V = i(() => {
|
|
154
154
|
if (!O.pageSize) return z.value;
|
|
155
|
-
let e = (
|
|
155
|
+
let e = (B.value - 1) * O.pageSize;
|
|
156
156
|
return z.value.slice(e, e + O.pageSize);
|
|
157
157
|
});
|
|
158
|
-
function
|
|
158
|
+
function H(e) {
|
|
159
159
|
return typeof e == "object" && !!e && !Array.isArray(e) && "data" in e;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
return
|
|
161
|
+
function U(e) {
|
|
162
|
+
return H(e) ? e.sort ?? e.data : e;
|
|
163
163
|
}
|
|
164
164
|
function ke(e) {
|
|
165
165
|
return O.placeholderFor === "falsy" ? !e : e === null || e === "";
|
|
@@ -167,33 +167,33 @@ var ce = { class: "ac-scrollbar" }, le = { class: "w-full border-separate border
|
|
|
167
167
|
function Ae(e, t, n) {
|
|
168
168
|
return n === "number" ? Number(e) - Number(t) : n === "date" ? new Date(String(e)).getTime() - new Date(String(t)).getTime() : String(e).toLowerCase().localeCompare(String(t).toLowerCase());
|
|
169
169
|
}
|
|
170
|
-
let
|
|
171
|
-
function
|
|
170
|
+
let W = (e) => !!O.rowDisabled?.(e), G = (e) => !W(e) && (!O.rowSelectable || O.rowSelectable(e)), K = i(() => V.value.filter(G).map((e) => e[O.rowKey])), q = i(() => new Set(k.value)), J = i(() => K.value.length > 0 && K.value.every((e) => q.value.has(e))), je = i(() => !J.value && K.value.some((e) => q.value.has(e)));
|
|
171
|
+
function Me() {
|
|
172
172
|
let e = new Set(K.value);
|
|
173
173
|
k.value = J.value ? k.value.filter((t) => !e.has(t)) : [...k.value, ...K.value.filter((e) => !q.value.has(e))];
|
|
174
174
|
}
|
|
175
|
-
function
|
|
175
|
+
function Ne(e) {
|
|
176
176
|
let t = e[O.rowKey];
|
|
177
177
|
k.value = q.value.has(t) ? k.value.filter((e) => e !== t) : [...k.value, t];
|
|
178
178
|
}
|
|
179
|
-
let
|
|
180
|
-
function
|
|
179
|
+
let Pe = i(() => new Set(A.value)), Y = (e) => O.expandable && Pe.value.has(e[O.rowKey]), Fe = (e) => !O.canExpand || O.canExpand(e), Ie = (e) => `${Ee}-detail-${String(e[O.rowKey])}`, X = i(() => !!N.actions), Le = i(() => O.columns.length + +!!O.selectable + +!!O.expandable + +!!X.value);
|
|
180
|
+
function Re(e) {
|
|
181
181
|
let t = e[O.rowKey];
|
|
182
|
-
A.value =
|
|
182
|
+
A.value = Pe.value.has(t) ? A.value.filter((e) => e !== t) : [...A.value, t];
|
|
183
183
|
}
|
|
184
184
|
function Z(e) {
|
|
185
|
-
let t = e[O.columns[0]?.key ?? ""], n =
|
|
185
|
+
let t = e[O.columns[0]?.key ?? ""], n = H(t) ? t.data : t;
|
|
186
186
|
return typeof n == "string" || typeof n == "number" ? n : String(e[O.rowKey]);
|
|
187
187
|
}
|
|
188
|
-
let
|
|
189
|
-
function
|
|
188
|
+
let ze = i(() => O.expandable ? "py-3 [tbody_&]:h-[51px]" : "py-3"), Be = (e) => e.wrap ?? O.relaxed ? "whitespace-normal" : "whitespace-nowrap";
|
|
189
|
+
function Ve(e) {
|
|
190
190
|
return !!(e.link || O.truncate || O.placeholder || N[`before-${e.key}`]);
|
|
191
191
|
}
|
|
192
|
-
function
|
|
192
|
+
function He(e) {
|
|
193
193
|
let t = String(e ?? "");
|
|
194
194
|
return O.truncate && t.length > O.truncate ? `${t.slice(0, O.truncate)}...` : t;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function Ue(e, t) {
|
|
197
197
|
let n = e[t.link] || t.linkFallback;
|
|
198
198
|
return typeof n != "string" || !n ? {
|
|
199
199
|
is: "span",
|
|
@@ -206,7 +206,7 @@ var ce = { class: "ac-scrollbar" }, le = { class: "w-full border-separate border
|
|
|
206
206
|
attrs: { href: n }
|
|
207
207
|
};
|
|
208
208
|
}
|
|
209
|
-
let
|
|
209
|
+
let We = i(() => ["overflow-hidden bg-surface", !O.flat && "rounded-10 border border-border"]), Q = (e) => ({
|
|
210
210
|
left: "text-left",
|
|
211
211
|
center: "text-center",
|
|
212
212
|
right: "text-right"
|
|
@@ -214,10 +214,10 @@ var ce = { class: "ac-scrollbar" }, le = { class: "w-full border-separate border
|
|
|
214
214
|
return re(() => `${JSON.stringify(O.search?.map((e) => [e.key, e.searchText]) ?? [])}|${I.value}|${L.value}`, () => {
|
|
215
215
|
O.pageSize && (j.value = 1);
|
|
216
216
|
}), (i, f) => (g(), s("div", {
|
|
217
|
-
class: m(["w-full", !d.pageSize &&
|
|
217
|
+
class: m(["w-full", !d.pageSize && We.value]),
|
|
218
218
|
"data-ac-ds": "",
|
|
219
219
|
"data-testid": "ac-table"
|
|
220
|
-
}, [c("div", { class: m(!!d.pageSize &&
|
|
220
|
+
}, [c("div", { class: m(!!d.pageSize && We.value) }, [c("div", ce, [c("table", le, [c("thead", null, [c("tr", null, [
|
|
221
221
|
d.expandable ? (g(), s("th", {
|
|
222
222
|
key: 0,
|
|
223
223
|
scope: "col",
|
|
@@ -231,11 +231,11 @@ var ce = { class: "ac-scrollbar" }, le = { class: "w-full border-separate border
|
|
|
231
231
|
type: "checkbox",
|
|
232
232
|
class: m(D),
|
|
233
233
|
checked: J.value,
|
|
234
|
-
indeterminate:
|
|
234
|
+
indeterminate: je.value,
|
|
235
235
|
disabled: d.loading || !K.value.length,
|
|
236
236
|
"aria-label": "Select all rows",
|
|
237
|
-
onChange:
|
|
238
|
-
}, null, 40, de), (g(), a(y(
|
|
237
|
+
onChange: Me
|
|
238
|
+
}, null, 40, de), (g(), a(y(je.value ? x(se) : x(T)), {
|
|
239
239
|
class: "pointer-events-none absolute inset-0 m-auto size-3.5 text-white opacity-0 peer-checked:opacity-100 peer-indeterminate:opacity-100",
|
|
240
240
|
"stroke-width": 3,
|
|
241
241
|
"aria-hidden": "true"
|
|
@@ -254,12 +254,23 @@ var ce = { class: "ac-scrollbar" }, le = { class: "w-full border-separate border
|
|
|
254
254
|
]]),
|
|
255
255
|
style: h(e.width ? { width: e.width } : void 0),
|
|
256
256
|
"aria-sort": I.value === e.key ? L.value === "asc" ? "ascending" : "descending" : void 0,
|
|
257
|
-
onClick: (t) =>
|
|
258
|
-
}, [
|
|
259
|
-
|
|
260
|
-
class: m(["
|
|
261
|
-
"
|
|
262
|
-
},
|
|
257
|
+
onClick: (t) => De(e)
|
|
258
|
+
}, [(g(), a(y(e.sortable ? "button" : "span"), {
|
|
259
|
+
type: e.sortable ? "button" : void 0,
|
|
260
|
+
class: m(["inline-flex items-center gap-2", e.sortable && "-mx-1 cursor-pointer rounded-4 border-0 bg-transparent px-1 font-semibold text-inherit focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none"]),
|
|
261
|
+
"data-testid": e.sortable ? `ac-table-sort-${e.key}` : void 0
|
|
262
|
+
}, {
|
|
263
|
+
default: C(() => [v(i.$slots, `header-${e.key}`, { column: e }, () => [l(b(e.label), 1)]), e.sortable ? (g(), a(y(I.value === e.key && L.value === "asc" ? x(oe) : x(ie)), {
|
|
264
|
+
key: 0,
|
|
265
|
+
class: m(["size-4 shrink-0", I.value === e.key ? "text-primary-strong" : "text-muted"]),
|
|
266
|
+
"aria-hidden": "true"
|
|
267
|
+
}, null, 8, ["class"])) : o("", !0)]),
|
|
268
|
+
_: 2
|
|
269
|
+
}, 1032, [
|
|
270
|
+
"type",
|
|
271
|
+
"class",
|
|
272
|
+
"data-testid"
|
|
273
|
+
]))], 14, fe))), 128)),
|
|
263
274
|
X.value ? (g(), s("th", {
|
|
264
275
|
key: 2,
|
|
265
276
|
scope: "col",
|
|
@@ -270,8 +281,8 @@ var ce = { class: "ac-scrollbar" }, le = { class: "w-full border-separate border
|
|
|
270
281
|
]])
|
|
271
282
|
}, [...f[5] ||= [c("span", { class: "sr-only" }, "Actions", -1)]], 2)) : o("", !0)
|
|
272
283
|
])]), c("tbody", null, [d.loading ? (g(!0), s(r, { key: 0 }, _(d.loaderRows, (e) => (g(), s("tr", { key: `loader-${e}` }, [
|
|
273
|
-
d.expandable ? (g(), s("td",
|
|
274
|
-
d.selectable ? (g(), s("td",
|
|
284
|
+
d.expandable ? (g(), s("td", pe)) : o("", !0),
|
|
285
|
+
d.selectable ? (g(), s("td", me)) : o("", !0),
|
|
275
286
|
(g(!0), s(r, null, _(d.columns, (t, n) => (g(), s("td", {
|
|
276
287
|
key: t.key,
|
|
277
288
|
class: m(["h-11 border-b border-border [tr:last-child_&]:border-0", [$(t), t.class]])
|
|
@@ -279,49 +290,49 @@ var ce = { class: "ac-scrollbar" }, le = { class: "w-full border-separate border
|
|
|
279
290
|
class: "block h-2.5 animate-pulse rounded-full bg-surface-sunken",
|
|
280
291
|
style: h({ width: `${50 + (e * 17 + n * 23) % 40}%` })
|
|
281
292
|
}, null, 4)], 2))), 128)),
|
|
282
|
-
X.value ? (g(), s("td",
|
|
283
|
-
]))), 128)) : (g(!0), s(r, { key: 1 }, _(
|
|
293
|
+
X.value ? (g(), s("td", he)) : o("", !0)
|
|
294
|
+
]))), 128)) : (g(!0), s(r, { key: 1 }, _(V.value, (n, p) => (g(), s(r, { key: String(n[d.rowKey] ?? p) }, [c("tr", {
|
|
284
295
|
"data-testid": "ac-table-row",
|
|
285
296
|
class: m(["group transition-colors duration-150", [
|
|
286
297
|
d.clickable && "cursor-pointer hover:bg-surface-sunken/40",
|
|
287
298
|
(d.rowActive?.(n) || d.selectable && q.value.has(n[d.rowKey])) && "bg-primary/5",
|
|
288
299
|
d.rowActive?.(n) && "shadow-[inset_0_0_0_1px_var(--color-primary)]",
|
|
289
|
-
|
|
300
|
+
W(n) && "pointer-events-none cursor-not-allowed opacity-50",
|
|
290
301
|
d.rowClass?.(n)
|
|
291
302
|
]]),
|
|
292
303
|
"aria-current": d.rowActive?.(n) ? "true" : void 0,
|
|
293
|
-
"aria-disabled":
|
|
294
|
-
onClick: (e) => d.clickable && !
|
|
304
|
+
"aria-disabled": W(n) || void 0,
|
|
305
|
+
onClick: (e) => d.clickable && !W(n) && M("row-click", n)
|
|
295
306
|
}, [
|
|
296
307
|
d.expandable ? (g(), s("td", {
|
|
297
308
|
key: 0,
|
|
298
309
|
class: "h-11 w-10 border-b border-border pr-0 pl-4 group-last:border-0",
|
|
299
310
|
onClick: f[0] ||= w(() => {}, ["stop"])
|
|
300
|
-
}, [
|
|
311
|
+
}, [Fe(n) ? (g(), s("button", {
|
|
301
312
|
key: 0,
|
|
302
313
|
type: "button",
|
|
303
314
|
class: "inline-flex size-7 cursor-pointer items-center justify-center rounded-8 text-muted transition-colors hover:bg-surface-sunken hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
304
315
|
"aria-expanded": Y(n),
|
|
305
|
-
"aria-controls":
|
|
316
|
+
"aria-controls": Ie(n),
|
|
306
317
|
"aria-label": `${Y(n) ? "Collapse" : "Expand"} ${Z(n)}`,
|
|
307
318
|
"data-testid": "ac-table-expand",
|
|
308
|
-
onClick: (e) =>
|
|
319
|
+
onClick: (e) => Re(n)
|
|
309
320
|
}, [u(x(ae), {
|
|
310
321
|
class: m(["size-4 transition-transform duration-150 motion-reduce:transition-none", Y(n) && "rotate-90"]),
|
|
311
322
|
"aria-hidden": "true"
|
|
312
|
-
}, null, 8, ["class"])], 8,
|
|
323
|
+
}, null, 8, ["class"])], 8, _e)) : o("", !0)])) : o("", !0),
|
|
313
324
|
d.selectable ? (g(), s("td", {
|
|
314
325
|
key: 1,
|
|
315
326
|
class: "h-11 w-10 border-b border-border pr-1 pl-4 group-last:border-0",
|
|
316
327
|
onClick: f[1] ||= w(() => {}, ["stop"])
|
|
317
|
-
}, [c("span",
|
|
328
|
+
}, [c("span", ve, [c("input", {
|
|
318
329
|
type: "checkbox",
|
|
319
330
|
class: m(D),
|
|
320
331
|
checked: q.value.has(n[d.rowKey]),
|
|
321
|
-
disabled: !
|
|
332
|
+
disabled: !G(n),
|
|
322
333
|
"aria-label": `Select ${Z(n)}`,
|
|
323
|
-
onChange: (e) =>
|
|
324
|
-
}, null, 40,
|
|
334
|
+
onChange: (e) => Ne(n)
|
|
335
|
+
}, null, 40, ye), u(x(T), {
|
|
325
336
|
class: "pointer-events-none absolute inset-0 m-auto size-3.5 text-white opacity-0 peer-checked:opacity-100",
|
|
326
337
|
"stroke-width": 3,
|
|
327
338
|
"aria-hidden": "true"
|
|
@@ -330,8 +341,8 @@ var ce = { class: "ac-scrollbar" }, le = { class: "w-full border-separate border
|
|
|
330
341
|
key: o.key,
|
|
331
342
|
class: m(["h-11 border-b border-border text-body tabular-nums group-last:border-0", [
|
|
332
343
|
$(o),
|
|
333
|
-
|
|
334
|
-
d.relaxed &&
|
|
344
|
+
Be(o),
|
|
345
|
+
d.relaxed && ze.value,
|
|
335
346
|
Q(o),
|
|
336
347
|
o.class
|
|
337
348
|
]])
|
|
@@ -340,8 +351,8 @@ var ce = { class: "ac-scrollbar" }, le = { class: "w-full border-separate border
|
|
|
340
351
|
value: n[o.key]
|
|
341
352
|
}, () => [o.type || o.descriptor ? (g(), a(t, {
|
|
342
353
|
key: 0,
|
|
343
|
-
value:
|
|
344
|
-
cell:
|
|
354
|
+
value: H(n[o.key]) ? void 0 : n[o.key],
|
|
355
|
+
cell: H(n[o.key]) ? n[o.key] : void 0,
|
|
345
356
|
column: o.descriptor,
|
|
346
357
|
type: o.type,
|
|
347
358
|
title: o.label,
|
|
@@ -353,37 +364,37 @@ var ce = { class: "ac-scrollbar" }, le = { class: "w-full border-separate border
|
|
|
353
364
|
"type",
|
|
354
365
|
"title",
|
|
355
366
|
"resolve-link"
|
|
356
|
-
])) :
|
|
367
|
+
])) : Ve(o) && n[o.key] === void 0 ? (g(), s(r, { key: 1 }, [], 64)) : Ve(o) ? (g(), s("span", be, [v(i.$slots, `before-${o.key}`, { row: n }), !o.link && ke(n[o.key]) ? (g(), s(r, { key: 0 }, [l(b(d.placeholder), 1)], 64)) : (g(), a(e, {
|
|
357
368
|
key: 1,
|
|
358
369
|
content: String(n[o.key]),
|
|
359
370
|
disabled: !d.truncate,
|
|
360
371
|
placement: "top"
|
|
361
372
|
}, {
|
|
362
|
-
default: C(() => [o.link ? (g(), a(y(
|
|
373
|
+
default: C(() => [o.link ? (g(), a(y(Ue(n, o).is), ee({
|
|
363
374
|
key: 0,
|
|
364
375
|
ref_for: !0
|
|
365
|
-
},
|
|
366
|
-
default: C(() => [l(b(
|
|
376
|
+
}, Ue(n, o).attrs, { class: "cursor-pointer truncate font-medium text-primary-strong no-underline hover:underline" }), {
|
|
377
|
+
default: C(() => [l(b(He(n[o.key])), 1)]),
|
|
367
378
|
_: 2
|
|
368
|
-
}, 1040)) : (g(), s("span",
|
|
379
|
+
}, 1040)) : (g(), s("span", xe, b(He(n[o.key])), 1))]),
|
|
369
380
|
_: 2
|
|
370
381
|
}, 1032, ["content", "disabled"]))])) : (g(), s(r, { key: 3 }, [l(b(n[o.key]), 1)], 64))])], 2))), 128)),
|
|
371
382
|
X.value ? (g(), s("td", {
|
|
372
383
|
key: 2,
|
|
373
|
-
class: m(["h-11 w-20 border-b border-border px-2 group-last:border-0 lg:w-[120px]", d.relaxed ? [
|
|
384
|
+
class: m(["h-11 w-20 border-b border-border px-2 group-last:border-0 lg:w-[120px]", d.relaxed ? [ze.value, "whitespace-normal"] : "whitespace-nowrap"]),
|
|
374
385
|
onClick: f[2] ||= w(() => {}, ["stop"])
|
|
375
386
|
}, [v(i.$slots, "actions", { row: n })], 2)) : o("", !0)
|
|
376
|
-
], 10,
|
|
377
|
-
colspan:
|
|
387
|
+
], 10, ge), Y(n) && Fe(n) ? (g(), s("tr", Se, [c("td", {
|
|
388
|
+
colspan: Le.value,
|
|
378
389
|
class: m(["border-b border-border p-0 group-last:border-0", !d.expandedBare && "bg-surface-muted"])
|
|
379
390
|
}, [c("div", {
|
|
380
|
-
id:
|
|
391
|
+
id: Ie(n),
|
|
381
392
|
role: "region",
|
|
382
393
|
"aria-label": `Details for ${Z(n)}`,
|
|
383
394
|
class: m(["text-body", !d.expandedBare && "px-6 py-4"])
|
|
384
|
-
}, [v(i.$slots, "expanded", { row: n })], 10,
|
|
395
|
+
}, [v(i.$slots, "expanded", { row: n })], 10, we)], 10, Ce)])) : o("", !0)], 64))), 128))])])]), !d.loading && !z.value.length ? (g(), s("div", Te, [v(i.$slots, "empty", {}, () => [l(b(d.emptyText), 1)])])) : o("", !0)], 2), d.pageSize && Oe.value > 1 && !d.loading ? (g(), a(n, {
|
|
385
396
|
key: 0,
|
|
386
|
-
page:
|
|
397
|
+
page: B.value,
|
|
387
398
|
"page-size": d.pageSize,
|
|
388
399
|
total: z.value.length,
|
|
389
400
|
"hide-page-size": "",
|
|
@@ -2,6 +2,8 @@ import type { HTMLAttributes } from "vue";
|
|
|
2
2
|
export interface Props {
|
|
3
3
|
/** Label above the field. Pass `placeholder` for an example value inside it. Without a label, pass `aria-label`; the placeholder is the accessible name otherwise. */
|
|
4
4
|
label?: string;
|
|
5
|
+
/** Classes for the label above the field, e.g. `@min-[401px]:sr-only` to hide it on wide layouts while screen readers still read it. */
|
|
6
|
+
labelClass?: HTMLAttributes["class"];
|
|
5
7
|
/** Native `name` attribute. */
|
|
6
8
|
name?: string;
|
|
7
9
|
/** Example value shown inside the empty field. */
|
|
@@ -90,6 +92,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
90
92
|
readonly: boolean;
|
|
91
93
|
placeholder: string;
|
|
92
94
|
errorMsg: string;
|
|
95
|
+
labelClass: string | false | Record<string, any> | import("vue").ClassValue[] | null;
|
|
93
96
|
highlight: boolean;
|
|
94
97
|
mono: boolean;
|
|
95
98
|
maxlength: number;
|
|
@@ -23,6 +23,16 @@ var ee = ["for"], C = { key: 0 }, w = ["id"], T = [
|
|
|
23
23
|
__name: "AcTextarea",
|
|
24
24
|
props: /*@__PURE__*/ o({
|
|
25
25
|
label: { default: "" },
|
|
26
|
+
labelClass: {
|
|
27
|
+
type: [
|
|
28
|
+
Boolean,
|
|
29
|
+
null,
|
|
30
|
+
String,
|
|
31
|
+
Object,
|
|
32
|
+
Array
|
|
33
|
+
],
|
|
34
|
+
default: void 0
|
|
35
|
+
},
|
|
26
36
|
name: { default: "" },
|
|
27
37
|
placeholder: { default: void 0 },
|
|
28
38
|
rows: { default: void 0 },
|
|
@@ -164,7 +174,7 @@ var ee = ["for"], C = { key: 0 }, w = ["id"], T = [
|
|
|
164
174
|
U.value ? (d(), n("label", {
|
|
165
175
|
key: 0,
|
|
166
176
|
for: h(I),
|
|
167
|
-
class: l(["mb-2 flex items-center text-base font-medium text-heading", !a.flushLabelSlots && "gap-1"])
|
|
177
|
+
class: l(["mb-2 flex items-center text-base font-medium text-heading", [!a.flushLabelSlots && "gap-1", a.labelClass]])
|
|
168
178
|
}, [
|
|
169
179
|
p(e.$slots, "label-icon"),
|
|
170
180
|
a.label ? (d(), n("span", C, m(a.label), 1)) : t("", !0),
|
|
@@ -2,6 +2,8 @@ import type { HTMLAttributes } from "vue";
|
|
|
2
2
|
export interface Props {
|
|
3
3
|
/** Label above the field. Doubles as the accessible name of the trigger and the popover. */
|
|
4
4
|
label?: string;
|
|
5
|
+
/** Classes for the label above the field, e.g. `@min-[401px]:sr-only` to hide it on wide layouts while screen readers still read it. */
|
|
6
|
+
labelClass?: HTMLAttributes["class"];
|
|
5
7
|
/** Text shown in the field while there's no value. */
|
|
6
8
|
placeholder?: string;
|
|
7
9
|
/** `24` shows 00–23; `12` shows 1–12 with an AM/PM column. `v-model` is always 24-hour. Cloud `hour12`. */
|
|
@@ -73,6 +75,7 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
73
75
|
inline: boolean;
|
|
74
76
|
placeholder: string;
|
|
75
77
|
errorMsg: string;
|
|
78
|
+
labelClass: string | false | Record<string, any> | import("vue").ClassValue[] | null;
|
|
76
79
|
clearable: boolean;
|
|
77
80
|
showSeconds: boolean;
|
|
78
81
|
hourCycle: 12 | 24;
|