@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
|
@@ -59,7 +59,9 @@ var C = ["aria-labelledby", "aria-describedby"], w = { class: "flex shrink-0 ite
|
|
|
59
59
|
let t = document.body, n = Number(t.dataset.acModals ?? 0) + (e ? 1 : -1);
|
|
60
60
|
if (t.dataset.acModals = String(Math.max(n, 0)), e && n === 1) {
|
|
61
61
|
let e = window.innerWidth - document.documentElement.clientWidth;
|
|
62
|
-
t.style.overflow = "hidden"
|
|
62
|
+
t.style.overflow = "hidden";
|
|
63
|
+
let n = getComputedStyle(document.documentElement).scrollbarGutter.includes("stable");
|
|
64
|
+
e > 0 && !n && (t.style.paddingRight = `${e}px`);
|
|
63
65
|
} else !e && n <= 0 && (t.style.overflow = "", t.style.paddingRight = "");
|
|
64
66
|
}
|
|
65
67
|
return y(F, async (e, t) => {
|
|
@@ -13,6 +13,12 @@ export interface Props {
|
|
|
13
13
|
hoverExpand?: boolean;
|
|
14
14
|
/** Offset from the top of the viewport on desktop, e.g. `"72px"` under a full-width navbar. The height shrinks to match. */
|
|
15
15
|
top?: string;
|
|
16
|
+
/** Pins the sidebar to the viewport's left edge with `position: fixed` on desktop, instead of `sticky`. The page then makes room itself, e.g. cloud-ui's `lg:pl-52 xl:pl-64`. */
|
|
17
|
+
fixed?: boolean;
|
|
18
|
+
/** Puts the `footer` items at the end of the scrolling list instead of pinning them: they sit at the bottom while the list is short and scroll with it when it's long, as in cloud-ui. */
|
|
19
|
+
footerScrolls?: boolean;
|
|
20
|
+
/** Space between sections. `compact` is cloud-ui's console: 16px either side of the rule between sections, 24px-high section headings and 8px between sub-groups. */
|
|
21
|
+
spacing?: "normal" | "compact";
|
|
16
22
|
}
|
|
17
23
|
type __VLS_Props = Props;
|
|
18
24
|
type __VLS_Slots = {
|
|
@@ -48,13 +54,16 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
48
54
|
"onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
|
|
49
55
|
"onUpdate:mobileOpen"?: ((value: boolean) => any) | undefined;
|
|
50
56
|
}>, {
|
|
57
|
+
fixed: boolean;
|
|
51
58
|
label: string;
|
|
59
|
+
spacing: "normal" | "compact";
|
|
52
60
|
top: string;
|
|
53
61
|
dark: boolean;
|
|
54
62
|
collapsible: boolean;
|
|
55
63
|
contained: boolean;
|
|
56
64
|
breakpoint: number;
|
|
57
65
|
hoverExpand: boolean;
|
|
66
|
+
footerScrolls: boolean;
|
|
58
67
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
59
68
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
60
69
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import { Fragment as e, Transition as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, mergeModels as l, mergeProps as
|
|
2
|
-
import { PanelLeftClose as
|
|
1
|
+
import { Fragment as e, Transition as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, mergeModels as l, mergeProps as ee, nextTick as u, normalizeClass as d, onBeforeUnmount as te, onMounted as f, openBlock as p, provide as m, ref as h, renderSlot as g, resolveDynamicComponent as ne, toDisplayString as _, unref as v, useModel as y, useSlots as b, watch as x, withCtx as S } from "vue";
|
|
2
|
+
import { PanelLeftClose as C, PanelLeftOpen as w, X as T } from "@lucide/vue";
|
|
3
3
|
//#region src/lib/components/AcSidebar.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var E = [
|
|
5
5
|
"role",
|
|
6
6
|
"aria-modal",
|
|
7
7
|
"aria-label"
|
|
8
|
-
], D = ["aria-label"],
|
|
8
|
+
], D = ["aria-label"], re = {
|
|
9
9
|
role: "list",
|
|
10
|
-
class: "flex flex-col gap-1"
|
|
11
|
-
},
|
|
10
|
+
class: "flex shrink-0 flex-col gap-1"
|
|
11
|
+
}, ie = {
|
|
12
12
|
key: 0,
|
|
13
|
+
class: "mt-auto flex shrink-0 flex-col pt-[54px]"
|
|
14
|
+
}, ae = {
|
|
13
15
|
role: "list",
|
|
14
16
|
class: "flex flex-col"
|
|
15
|
-
},
|
|
17
|
+
}, oe = {
|
|
18
|
+
key: 0,
|
|
19
|
+
role: "list",
|
|
20
|
+
class: "flex flex-col"
|
|
21
|
+
}, se = ["aria-label", "title"], ce = { key: 0 }, O = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])", le = 120, ue = 180, k = /*@__PURE__*/ c({
|
|
16
22
|
inheritAttrs: !1,
|
|
17
23
|
__name: "AcSidebar",
|
|
18
24
|
props: /*@__PURE__*/ l({
|
|
@@ -34,7 +40,16 @@ var te = [
|
|
|
34
40
|
type: Boolean,
|
|
35
41
|
default: !1
|
|
36
42
|
},
|
|
37
|
-
top: { default: "0px" }
|
|
43
|
+
top: { default: "0px" },
|
|
44
|
+
fixed: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !1
|
|
47
|
+
},
|
|
48
|
+
footerScrolls: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: !1
|
|
51
|
+
},
|
|
52
|
+
spacing: { default: "normal" }
|
|
38
53
|
}, {
|
|
39
54
|
collapsed: {
|
|
40
55
|
type: Boolean,
|
|
@@ -49,56 +64,56 @@ var te = [
|
|
|
49
64
|
}),
|
|
50
65
|
emits: ["update:collapsed", "update:mobileOpen"],
|
|
51
66
|
setup(c, { expose: l }) {
|
|
52
|
-
let
|
|
53
|
-
function
|
|
54
|
-
|
|
67
|
+
let k = c, A = y(c, "collapsed"), j = y(c, "mobileOpen"), M = b(), N = h(null), P = h(null), F = h(!k.contained && typeof window < "u" && window.matchMedia(J()).matches), I = null, L = null, R = null, z = h(!1), B = n(() => k.hoverExpand && A.value && !F.value && z.value), V = n(() => A.value && !F.value && !B.value), H = n(() => A.value && !F.value), U = !1, W;
|
|
68
|
+
function G(e) {
|
|
69
|
+
k.hoverExpand && (e && U || (clearTimeout(W), W = setTimeout(() => z.value = e, e ? le : ue)));
|
|
55
70
|
}
|
|
56
|
-
function
|
|
57
|
-
|
|
71
|
+
function de() {
|
|
72
|
+
U = !0, clearTimeout(W), z.value = !1, A.value = !A.value;
|
|
58
73
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
74
|
+
function fe() {
|
|
75
|
+
U = !1, G(!1);
|
|
61
76
|
}
|
|
62
|
-
function
|
|
63
|
-
|
|
77
|
+
function pe(e) {
|
|
78
|
+
N.value?.contains(e.relatedTarget) || G(!1);
|
|
64
79
|
}
|
|
65
|
-
let
|
|
66
|
-
top:
|
|
67
|
-
height: `calc(100dvh - ${
|
|
68
|
-
}),
|
|
69
|
-
let e =
|
|
70
|
-
return
|
|
80
|
+
let K = n(() => k.footerScrolls && !!M.footer), q = n(() => F.value && j.value), me = n(() => k.dark), he = n(() => F.value || k.contained ? void 0 : {
|
|
81
|
+
top: k.top,
|
|
82
|
+
height: `calc(100dvh - ${k.top})`
|
|
83
|
+
}), ge = n(() => {
|
|
84
|
+
let e = k.dark ? "dark border-r border-border bg-sidebar text-body shadow-sm" : "border-r border-border bg-sidebar-panel/95 text-body shadow-sm backdrop-blur-sm";
|
|
85
|
+
return F.value ? [
|
|
71
86
|
e,
|
|
72
|
-
|
|
87
|
+
k.contained ? "absolute" : "fixed",
|
|
73
88
|
"inset-y-0 left-0 z-[80] w-64 duration-300 ease-out-soft motion-reduce:transition-none",
|
|
74
|
-
|
|
89
|
+
j.value ? "visible translate-x-0 transition-[translate]" : "invisible -translate-x-full transition-[translate,visibility]"
|
|
75
90
|
] : [
|
|
76
91
|
e,
|
|
77
|
-
|
|
92
|
+
B.value ? [k.contained ? "absolute inset-y-0 left-0" : "fixed left-0", "z-30 shadow-xl"] : k.contained ? "relative h-full" : k.fixed ? "fixed left-0 z-30" : "sticky",
|
|
78
93
|
"transition-[width] duration-200 ease-out-soft motion-reduce:transition-none",
|
|
79
|
-
|
|
94
|
+
V.value ? "w-14" : k.contained ? "w-64" : "w-64 lg:w-52 xl:w-64"
|
|
80
95
|
];
|
|
81
96
|
});
|
|
82
|
-
function
|
|
83
|
-
return `(max-width: ${
|
|
97
|
+
function J() {
|
|
98
|
+
return `(max-width: ${k.breakpoint - .02}px)`;
|
|
84
99
|
}
|
|
85
|
-
function
|
|
86
|
-
|
|
100
|
+
function _e() {
|
|
101
|
+
F.value ? j.value = !j.value : A.value = !A.value;
|
|
87
102
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
103
|
+
function Y() {
|
|
104
|
+
A.value = !1;
|
|
90
105
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
106
|
+
function ve() {
|
|
107
|
+
F.value && (j.value = !1);
|
|
93
108
|
}
|
|
94
109
|
function X() {
|
|
95
|
-
|
|
110
|
+
j.value = !1;
|
|
96
111
|
}
|
|
97
|
-
function
|
|
98
|
-
if (
|
|
112
|
+
function ye(e) {
|
|
113
|
+
if (q.value && N.value) {
|
|
99
114
|
if (e.key === "Escape") e.stopPropagation(), X();
|
|
100
115
|
else if (e.key === "Tab") {
|
|
101
|
-
let t = [...
|
|
116
|
+
let t = [...N.value.querySelectorAll(O)].filter((e) => e.offsetParent !== null);
|
|
102
117
|
if (!t.length) return;
|
|
103
118
|
let n = t[0], r = t[t.length - 1];
|
|
104
119
|
e.shiftKey && document.activeElement === n ? (e.preventDefault(), r.focus()) : !e.shiftKey && document.activeElement === r && (e.preventDefault(), n.focus());
|
|
@@ -106,47 +121,48 @@ var te = [
|
|
|
106
121
|
}
|
|
107
122
|
}
|
|
108
123
|
function Z(e) {
|
|
109
|
-
|
|
124
|
+
F.value = e.matches;
|
|
110
125
|
}
|
|
111
126
|
function Q(e) {
|
|
112
127
|
let t = document.body, n = Number(t.dataset.acModals ?? 0) + (e ? 1 : -1);
|
|
113
128
|
t.dataset.acModals = String(Math.max(n, 0)), e && n === 1 ? t.style.overflow = "hidden" : !e && n <= 0 && (t.style.overflow = "");
|
|
114
129
|
}
|
|
115
130
|
function $() {
|
|
116
|
-
let e =
|
|
131
|
+
let e = P.value, t = e?.querySelector("[aria-current=\"page\"]");
|
|
117
132
|
if (!e || !t) return;
|
|
118
133
|
let n = t.getBoundingClientRect().top - e.getBoundingClientRect().top;
|
|
119
134
|
(n < 0 || n > e.clientHeight - t.offsetHeight) && (e.scrollTop += n - e.clientHeight / 2);
|
|
120
135
|
}
|
|
121
|
-
return
|
|
122
|
-
rail:
|
|
123
|
-
isMobile:
|
|
124
|
-
dark:
|
|
125
|
-
expand:
|
|
126
|
-
navigate:
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
if (j.contained) {
|
|
133
|
-
let e = P.value?.parentElement;
|
|
134
|
-
e && (z = new ResizeObserver(([e]) => I.value = (e?.contentRect.width ?? 0) < j.breakpoint), z.observe(e));
|
|
135
|
-
} else R = window.matchMedia(Y()), I.value = R.matches, R.addEventListener("change", Z);
|
|
136
|
-
$();
|
|
136
|
+
return m("ac-sidebar", {
|
|
137
|
+
rail: V,
|
|
138
|
+
isMobile: F,
|
|
139
|
+
dark: me,
|
|
140
|
+
expand: Y,
|
|
141
|
+
navigate: ve,
|
|
142
|
+
compact: n(() => k.spacing === "compact")
|
|
143
|
+
}), x(q, async (e, t) => {
|
|
144
|
+
e ? (I = document.activeElement, k.contained || Q(!0), await u(), (N.value?.querySelector("[aria-current=\"page\"]") ?? N.value?.querySelector(O))?.focus()) : t && (k.contained || Q(!1), I?.focus?.());
|
|
145
|
+
}), x(F, (e) => {
|
|
146
|
+
e || (j.value = !1);
|
|
137
147
|
}), f(() => {
|
|
138
|
-
|
|
148
|
+
if (k.contained) {
|
|
149
|
+
let e = N.value?.parentElement;
|
|
150
|
+
e && (R = new ResizeObserver(([e]) => F.value = (e?.contentRect.width ?? 0) < k.breakpoint), R.observe(e));
|
|
151
|
+
} else L = window.matchMedia(J()), F.value = L.matches, L.addEventListener("change", Z);
|
|
152
|
+
$();
|
|
153
|
+
}), te(() => {
|
|
154
|
+
clearTimeout(W), L?.removeEventListener("change", Z), R?.disconnect(), q.value && !k.contained && Q(!1);
|
|
139
155
|
}), l({
|
|
140
|
-
toggle:
|
|
156
|
+
toggle: _e,
|
|
141
157
|
revealActive: $
|
|
142
|
-
}), (n, l) => (
|
|
158
|
+
}), (n, l) => (p(), a(e, null, [
|
|
143
159
|
s(t, {
|
|
144
160
|
"enter-active-class": "transition-opacity duration-200",
|
|
145
161
|
"enter-from-class": "opacity-0",
|
|
146
162
|
"leave-active-class": "transition-opacity duration-150",
|
|
147
163
|
"leave-to-class": "opacity-0"
|
|
148
164
|
}, {
|
|
149
|
-
default:
|
|
165
|
+
default: S(() => [q.value ? (p(), a("div", {
|
|
150
166
|
key: 0,
|
|
151
167
|
class: d(["inset-0 z-[79] bg-overlay backdrop-blur-[2px]", c.contained ? "absolute" : "fixed"]),
|
|
152
168
|
"aria-hidden": "true",
|
|
@@ -156,33 +172,33 @@ var te = [
|
|
|
156
172
|
}, null, 2)) : i("", !0)]),
|
|
157
173
|
_: 1
|
|
158
174
|
}),
|
|
159
|
-
|
|
175
|
+
B.value && (!c.fixed || c.contained) ? (p(), a("div", {
|
|
160
176
|
key: 0,
|
|
161
177
|
class: d(["w-14 shrink-0", c.contained && "h-full"]),
|
|
162
178
|
"aria-hidden": "true",
|
|
163
179
|
"data-ac-ds": ""
|
|
164
180
|
}, null, 2)) : i("", !0),
|
|
165
|
-
o("aside",
|
|
181
|
+
o("aside", ee({
|
|
166
182
|
ref_key: "root",
|
|
167
|
-
ref:
|
|
183
|
+
ref: N
|
|
168
184
|
}, n.$attrs, {
|
|
169
|
-
class: ["flex shrink-0 flex-col overflow-hidden",
|
|
170
|
-
style:
|
|
171
|
-
role:
|
|
172
|
-
"aria-modal":
|
|
173
|
-
"aria-label":
|
|
185
|
+
class: ["flex shrink-0 flex-col overflow-hidden", ge.value],
|
|
186
|
+
style: he.value,
|
|
187
|
+
role: q.value ? "dialog" : void 0,
|
|
188
|
+
"aria-modal": q.value || void 0,
|
|
189
|
+
"aria-label": q.value ? c.label : void 0,
|
|
174
190
|
"data-ac-ds": "",
|
|
175
191
|
"data-testid": "ac-sidebar",
|
|
176
|
-
onKeydown:
|
|
177
|
-
onMouseenter: l[0] ||= (e) =>
|
|
178
|
-
onMouseleave:
|
|
179
|
-
onFocusin: l[1] ||= (e) =>
|
|
180
|
-
onFocusout:
|
|
192
|
+
onKeydown: ye,
|
|
193
|
+
onMouseenter: l[0] ||= (e) => G(!0),
|
|
194
|
+
onMouseleave: fe,
|
|
195
|
+
onFocusin: l[1] ||= (e) => G(!0),
|
|
196
|
+
onFocusout: pe
|
|
181
197
|
}), [
|
|
182
|
-
n.$slots.header ||
|
|
198
|
+
n.$slots.header || F.value ? (p(), a("div", {
|
|
183
199
|
key: 0,
|
|
184
|
-
class: d(["flex min-h-17 shrink-0 items-center gap-2 overflow-hidden border-b border-border/70 pt-5 pb-4",
|
|
185
|
-
}, [o("div", { class: d(["flex min-w-0 flex-1 items-center",
|
|
200
|
+
class: d(["flex min-h-17 shrink-0 items-center gap-2 overflow-hidden border-b border-border/70 pt-5 pb-4", V.value ? "mx-2 justify-center" : "mx-4 px-1"])
|
|
201
|
+
}, [o("div", { class: d(["flex min-w-0 flex-1 items-center", V.value && "justify-center"]) }, [g(n.$slots, "header", { collapsed: V.value })], 2), F.value ? (p(), a("button", {
|
|
186
202
|
key: 0,
|
|
187
203
|
type: "button",
|
|
188
204
|
class: "-mr-1.5 inline-flex size-8.5 shrink-0 cursor-pointer items-center justify-center rounded-10 border border-transparent text-muted transition-colors duration-200 hover:border-border hover:bg-surface-sunken/50 hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none",
|
|
@@ -190,42 +206,45 @@ var te = [
|
|
|
190
206
|
"data-ac-ds": "",
|
|
191
207
|
"data-testid": "ac-sidebar-close",
|
|
192
208
|
onClick: X
|
|
193
|
-
}, [s(
|
|
209
|
+
}, [s(v(T), {
|
|
194
210
|
class: "size-5",
|
|
195
211
|
"aria-hidden": "true"
|
|
196
212
|
})])) : i("", !0)], 2)) : i("", !0),
|
|
197
213
|
o("nav", {
|
|
198
214
|
ref_key: "nav",
|
|
199
|
-
ref:
|
|
215
|
+
ref: P,
|
|
200
216
|
"aria-label": c.label,
|
|
201
|
-
class: d(["ac-scrollbar min-h-0 flex-1 overflow-x-hidden py-5",
|
|
202
|
-
}, [o("ul",
|
|
203
|
-
|
|
217
|
+
class: d(["ac-scrollbar min-h-0 flex-1 overflow-x-hidden py-5", [V.value ? "px-2" : "px-4", K.value && "flex flex-col"]])
|
|
218
|
+
}, [o("ul", re, [g(n.$slots, "default")]), K.value ? (p(), a("div", ie, [l[2] ||= o("div", {
|
|
219
|
+
class: "my-6 border-t border-muted/20",
|
|
220
|
+
"aria-hidden": "true"
|
|
221
|
+
}, null, -1), o("ul", ae, [g(n.$slots, "footer", { collapsed: V.value })])])) : i("", !0)], 10, D),
|
|
222
|
+
!K.value && n.$slots.footer || c.collapsible && !F.value ? (p(), a("div", {
|
|
204
223
|
key: 1,
|
|
205
|
-
class: d(["flex shrink-0 flex-col pb-4",
|
|
224
|
+
class: d(["flex shrink-0 flex-col pb-4", V.value ? "px-2" : "px-4"])
|
|
206
225
|
}, [
|
|
207
226
|
o("div", {
|
|
208
|
-
class: d(["border-t border-muted/20",
|
|
227
|
+
class: d(["border-t border-muted/20", V.value ? "mb-3" : "mt-5 mb-6"]),
|
|
209
228
|
"aria-hidden": "true"
|
|
210
229
|
}, null, 2),
|
|
211
|
-
n.$slots.footer ? (
|
|
212
|
-
c.collapsible && !
|
|
230
|
+
!K.value && n.$slots.footer ? (p(), a("ul", oe, [g(n.$slots, "footer", { collapsed: V.value })])) : i("", !0),
|
|
231
|
+
c.collapsible && !F.value ? (p(), a("button", {
|
|
213
232
|
key: 1,
|
|
214
233
|
type: "button",
|
|
215
|
-
class: d(["group flex w-full cursor-pointer items-center gap-3 rounded-10 border border-transparent py-2 text-base font-medium text-heading/80 transition-all duration-200 hover:border-border hover:bg-accent-hover hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset motion-reduce:transition-none",
|
|
216
|
-
"aria-label":
|
|
217
|
-
title:
|
|
234
|
+
class: d(["group flex w-full cursor-pointer items-center gap-3 rounded-10 border border-transparent py-2 text-base font-medium text-heading/80 transition-all duration-200 hover:border-border hover:bg-accent-hover hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset motion-reduce:transition-none", V.value ? "justify-center" : "px-3"]),
|
|
235
|
+
"aria-label": H.value ? "Expand sidebar" : "Collapse sidebar",
|
|
236
|
+
title: V.value ? "Expand sidebar" : void 0,
|
|
218
237
|
"data-ac-ds": "",
|
|
219
238
|
"data-testid": "ac-sidebar-collapse",
|
|
220
|
-
onClick:
|
|
221
|
-
}, [(
|
|
239
|
+
onClick: de
|
|
240
|
+
}, [(p(), r(ne(H.value ? v(w) : v(C)), {
|
|
222
241
|
class: "size-4 shrink-0 text-muted group-hover:text-heading",
|
|
223
242
|
"aria-hidden": "true"
|
|
224
|
-
})),
|
|
243
|
+
})), V.value ? i("", !0) : (p(), a("span", ce, _(H.value ? "Expand" : "Collapse"), 1))], 10, se)) : i("", !0)
|
|
225
244
|
], 2)) : i("", !0)
|
|
226
|
-
], 16,
|
|
245
|
+
], 16, E)
|
|
227
246
|
], 64));
|
|
228
247
|
}
|
|
229
248
|
});
|
|
230
249
|
//#endregion
|
|
231
|
-
export {
|
|
250
|
+
export { k as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createVNode as a, defineComponent as o, inject as s, mergeModels as c, normalizeClass as l, openBlock as u, provide as d, renderSlot as f, toDisplayString as p, unref as m, useId as h, useModel as g } from "vue";
|
|
2
2
|
import { ChevronRight as _ } from "@lucide/vue";
|
|
3
3
|
//#region src/lib/components/AcSidebarSection.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var v = ["aria-expanded", "aria-controls"],
|
|
4
|
+
var v = ["data-closed"], y = ["aria-expanded", "aria-controls"], b = { class: "truncate" }, x = ["inert"], S = ["id", "aria-label"], C = /*@__PURE__*/ o({
|
|
5
5
|
__name: "AcSidebarSection",
|
|
6
6
|
props: /*@__PURE__*/ c({
|
|
7
7
|
label: { default: "" },
|
|
@@ -18,36 +18,37 @@ var v = ["aria-expanded", "aria-controls"], y = { class: "truncate" }, b = ["ine
|
|
|
18
18
|
}),
|
|
19
19
|
emits: ["update:open"],
|
|
20
20
|
setup(o) {
|
|
21
|
-
let c = g(o, "open"),
|
|
22
|
-
d("ac-sidebar-section", !0), d("ac-sidebar-subgroup",
|
|
23
|
-
let
|
|
21
|
+
let c = g(o, "open"), C = s("ac-sidebar", null), w = s("ac-sidebar-section", !1);
|
|
22
|
+
d("ac-sidebar-section", !0), d("ac-sidebar-subgroup", w);
|
|
23
|
+
let T = h(), E = t(() => C?.rail.value ?? !1), D = t(() => c.value || E.value), O = t(() => C?.compact?.value ?? !1), k = t(() => w ? O.value ? "mb-1 py-[5px] text-xm text-muted/80" : "mb-1 py-0.5 text-xm text-muted/80" : O.value ? D.value ? "mb-2 py-1 text-sm text-muted" : "mb-1 py-1 text-sm text-muted" : "mb-2 py-0.5 text-sm text-muted"), A = t(() => w ? O.value ? "mt-0.5 first:mt-0" : "mt-2 first:mt-0" : E.value ? "mt-2 border-t border-muted/20 pt-2 first:mt-0 first:border-0 first:pt-0" : O.value ? "mt-3 first:mt-0 [[data-testid=ac-sidebar-section][data-closed]+&]:mt-0 [[data-testid=ac-sidebar-section]+&]:mt-2.5 [[data-testid=ac-sidebar-section]+&]:border-t [[data-testid=ac-sidebar-section]+&]:border-muted/20 [[data-testid=ac-sidebar-section]+&]:pt-4" : "mt-4 first:mt-0 [[data-testid=ac-sidebar-section]+&]:mt-5 [[data-testid=ac-sidebar-section]+&]:border-t [[data-testid=ac-sidebar-section]+&]:border-muted/20 [[data-testid=ac-sidebar-section]+&]:pt-4");
|
|
24
24
|
return (t, s) => (u(), r("li", {
|
|
25
|
-
class: l(["list-none",
|
|
25
|
+
class: l(["list-none", A.value]),
|
|
26
|
+
"data-closed": !D.value || void 0,
|
|
26
27
|
"data-ac-ds": "",
|
|
27
28
|
"data-testid": "ac-sidebar-section"
|
|
28
|
-
}, [o.label && !
|
|
29
|
+
}, [o.label && !E.value ? (u(), r(e, { key: 0 }, [o.collapsible ? (u(), r("button", {
|
|
29
30
|
key: 0,
|
|
30
31
|
type: "button",
|
|
31
|
-
class: l(["flex w-full cursor-pointer items-center justify-between gap-2 rounded-8 px-1
|
|
32
|
+
class: l(["flex w-full cursor-pointer items-center justify-between gap-2 rounded-8 px-1 text-left font-semibold tracking-[0.08em] uppercase transition-colors duration-200 hover:text-heading focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none focus-visible:ring-inset", k.value]),
|
|
32
33
|
"aria-expanded": c.value,
|
|
33
|
-
"aria-controls": `${m(
|
|
34
|
+
"aria-controls": `${m(T)}-items`,
|
|
34
35
|
onClick: s[0] ||= (e) => c.value = !c.value
|
|
35
|
-
}, [i("span",
|
|
36
|
-
class: l(["shrink-0 text-muted/70 transition-transform duration-200 ease-out motion-reduce:transition-none", [m(
|
|
36
|
+
}, [i("span", b, p(o.label), 1), a(m(_), {
|
|
37
|
+
class: l(["shrink-0 text-muted/70 transition-transform duration-200 ease-out motion-reduce:transition-none", [m(w) ? "size-3.5" : "size-4", c.value && "rotate-90"]]),
|
|
37
38
|
"aria-hidden": "true"
|
|
38
|
-
}, null, 8, ["class"])], 10,
|
|
39
|
+
}, null, 8, ["class"])], 10, y)) : (u(), r("p", {
|
|
39
40
|
key: 1,
|
|
40
|
-
class: l(["truncate px-1
|
|
41
|
+
class: l(["truncate px-1 font-semibold tracking-[0.08em] uppercase", k.value])
|
|
41
42
|
}, p(o.label), 3))], 64)) : n("", !0), i("div", {
|
|
42
|
-
class: l(["grid transition-[grid-template-rows,opacity] duration-300 ease-out-soft motion-reduce:transition-none",
|
|
43
|
-
inert: !
|
|
43
|
+
class: l(["grid transition-[grid-template-rows,opacity] duration-300 ease-out-soft motion-reduce:transition-none", D.value ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"]),
|
|
44
|
+
inert: !D.value || void 0
|
|
44
45
|
}, [i("ul", {
|
|
45
|
-
id: `${m(
|
|
46
|
+
id: `${m(T)}-items`,
|
|
46
47
|
role: "list",
|
|
47
48
|
"aria-label": o.label || void 0,
|
|
48
|
-
class: l(["flex min-h-0 flex-col gap-1 overflow-hidden", [m(
|
|
49
|
-
}, [f(t.$slots, "default")], 10,
|
|
49
|
+
class: l(["flex min-h-0 flex-col gap-1 overflow-hidden", [m(w) && !E.value && "pl-1", D.value && "pb-0.5"]])
|
|
50
|
+
}, [f(t.$slots, "default")], 10, S)], 10, x)], 10, v));
|
|
50
51
|
}
|
|
51
52
|
});
|
|
52
53
|
//#endregion
|
|
53
|
-
export {
|
|
54
|
+
export { C as default };
|
|
@@ -58,9 +58,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
58
58
|
disabled: boolean;
|
|
59
59
|
max: number;
|
|
60
60
|
min: number;
|
|
61
|
+
hint: string;
|
|
61
62
|
step: number;
|
|
62
63
|
tooltip: "auto" | "always" | "never";
|
|
63
|
-
hint: string;
|
|
64
64
|
range: boolean;
|
|
65
65
|
errorMsg: string;
|
|
66
66
|
unit: string;
|
|
@@ -9,9 +9,15 @@ export interface Column {
|
|
|
9
9
|
type?: CellType;
|
|
10
10
|
/** A server-side column descriptor. Shows values with AcCellValue; a row value may be a server cell `{ data, link, color }`. */
|
|
11
11
|
descriptor?: ResourceColumn;
|
|
12
|
+
/** Extra classes for the column's header and cells, e.g. `w-20 lg:w-[120px]` for an actions column. */
|
|
13
|
+
class?: string | string[] | Record<string, boolean>;
|
|
14
|
+
/** Lets cell text wrap onto more lines. Cells stay on one line by default. */
|
|
15
|
+
wrap?: boolean;
|
|
16
|
+
/** Pads the header and cells 8px a side instead of 24px, e.g. for a column of icon buttons. */
|
|
17
|
+
compact?: boolean;
|
|
12
18
|
}
|
|
13
19
|
export interface Props<R> {
|
|
14
|
-
/** Column definitions: `{ key, label, sortable?, align?, width?, type?, descriptor? }`. `type` or `descriptor` shows values with AcCellValue. */
|
|
20
|
+
/** Column definitions: `{ key, label, sortable?, align?, width?, type?, descriptor?, class?, wrap?, compact? }`. `type` or `descriptor` shows values with AcCellValue. */
|
|
15
21
|
columns: Column[];
|
|
16
22
|
/** Row objects. Each column's `key` is read from the row. */
|
|
17
23
|
rows: R[];
|
|
@@ -35,10 +41,16 @@ export interface Props<R> {
|
|
|
35
41
|
rowActive?: (row: R) => boolean;
|
|
36
42
|
/** Greys a row out: it ignores clicks and its checkbox is disabled. */
|
|
37
43
|
rowDisabled?: (row: R) => boolean;
|
|
44
|
+
/** With `selectable`, decides per row whether it can be chosen. Other rows keep their look, links and clicks; only their checkbox is disabled, and the header checkbox skips them. */
|
|
45
|
+
rowSelectable?: (row: R) => boolean;
|
|
46
|
+
/** Extra classes for a row, e.g. `(row) => ({ "bg-danger/5": row.failed })`. */
|
|
47
|
+
rowClass?: (row: R) => string | string[] | Record<string, boolean>;
|
|
38
48
|
/** The table doesn't reorder rows itself: sort the whole list outside (all pages, or on the server) when `sort` fires or `v-model:sortBy` changes. Headers still show the arrow. */
|
|
39
49
|
manualSort?: boolean;
|
|
40
50
|
/** Drops the table's own frame (border, rounded corners, shadow) so it sits flush inside a card or section that already has one. Without it a table in a card draws a second box. */
|
|
41
51
|
flat?: boolean;
|
|
52
|
+
/** Drops the detail area's padding (24px a side, 16px above and below) and tinted fill, for an `expanded` slot that brings its own. */
|
|
53
|
+
expandedBare?: boolean;
|
|
42
54
|
/** Turns a server cell's link template into a URL, e.g. to fill `${username}` and `${clustername}` from the current route. */
|
|
43
55
|
resolveLink?: (link: string) => string;
|
|
44
56
|
}
|