@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,10 +1,11 @@
|
|
|
1
1
|
import e from "./AcButton.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { fixedFrame as t } from "./fixedFrame.js";
|
|
3
|
+
import { Teleport as n, Transition as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createVNode as c, defineComponent as l, mergeModels as u, nextTick as d, normalizeClass as f, normalizeStyle as ee, onBeforeUnmount as te, onMounted as p, onUpdated as m, openBlock as h, provide as g, ref as _, renderSlot as v, toRef as y, unref as b, useId as x, useModel as S, useSlots as C, watch as w, withCtx as T } from "vue";
|
|
4
|
+
import { ChevronDown as E, Ellipsis as D } from "@lucide/vue";
|
|
4
5
|
//#region src/lib/components/AcDropdown.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var O = ["aria-label", "disabled"], k = ["aria-labelledby", "aria-label"], A = "[role=\"menuitem\"]:not([aria-disabled=\"true\"])", j = /*@__PURE__*/ l({
|
|
6
7
|
__name: "AcDropdown",
|
|
7
|
-
props: /*@__PURE__*/
|
|
8
|
+
props: /*@__PURE__*/ u({
|
|
8
9
|
label: { default: "" },
|
|
9
10
|
menuLabel: { default: "Actions" },
|
|
10
11
|
align: { default: "start" },
|
|
@@ -22,24 +23,24 @@ var ne = ["aria-label", "disabled"], re = ["aria-labelledby", "aria-label"], D =
|
|
|
22
23
|
openModifiers: {}
|
|
23
24
|
}),
|
|
24
25
|
emits: ["update:open"],
|
|
25
|
-
setup(
|
|
26
|
-
let
|
|
26
|
+
setup(l) {
|
|
27
|
+
let u = l, j = S(l, "open"), M = C(), ne = {
|
|
27
28
|
menu: 240,
|
|
28
29
|
panel: 320
|
|
29
|
-
},
|
|
30
|
+
}, re = {
|
|
30
31
|
"top-start": "origin-top-left",
|
|
31
32
|
"top-end": "origin-top-right",
|
|
32
33
|
"bottom-start": "origin-bottom-left",
|
|
33
34
|
"bottom-end": "origin-bottom-right"
|
|
34
|
-
},
|
|
35
|
+
}, ie = {
|
|
35
36
|
menu: "rounded-10 border-border py-1",
|
|
36
37
|
panel: "rounded-14 border-border/80 p-2"
|
|
37
|
-
}, N = x(), P = `${N}-menu`, F =
|
|
38
|
+
}, N = x(), P = `${N}-menu`, F = _(null), I = _(null), L = _({}), R = _(!1), z = _(""), B = null, V = "menu", H = "", U, W = i(() => re[`${R.value ? "top" : "bottom"}-${u.align}`]);
|
|
38
39
|
function G() {
|
|
39
|
-
B = F.value?.querySelector("button, a[href], [tabindex]") ?? null, B && (B.id || (B.id = `${N}-trigger`), z.value = B.id, B.setAttribute("aria-haspopup", "menu"), B.setAttribute("aria-expanded", String(
|
|
40
|
+
B = F.value?.querySelector("button, a[href], [tabindex]") ?? null, B && (B.id || (B.id = `${N}-trigger`), z.value = B.id, B.setAttribute("aria-haspopup", "menu"), B.setAttribute("aria-expanded", String(j.value)), j.value ? B.setAttribute("aria-controls", P) : B.removeAttribute("aria-controls"));
|
|
40
41
|
}
|
|
41
42
|
function K() {
|
|
42
|
-
return [...I.value?.querySelectorAll(
|
|
43
|
+
return [...I.value?.querySelectorAll(A) ?? []];
|
|
43
44
|
}
|
|
44
45
|
function q(e) {
|
|
45
46
|
let t = K();
|
|
@@ -47,44 +48,44 @@ var ne = ["aria-label", "disabled"], re = ["aria-labelledby", "aria-label"], D =
|
|
|
47
48
|
t[e === "first" ? 0 : e === "last" ? t.length - 1 : (e + t.length) % t.length]?.focus();
|
|
48
49
|
}
|
|
49
50
|
function J(e) {
|
|
50
|
-
|
|
51
|
+
u.disabled || (V = e, j.value = !0);
|
|
51
52
|
}
|
|
52
53
|
function Y(e = !0) {
|
|
53
|
-
|
|
54
|
+
j.value && (j.value = !1, e && B?.focus());
|
|
54
55
|
}
|
|
55
56
|
function X() {
|
|
56
57
|
if (!B || !I.value) return;
|
|
57
|
-
let e = B.getBoundingClientRect(), t = `${Math.min(Math.max(e.width,
|
|
58
|
-
I.value.style.minWidth =
|
|
59
|
-
let { offsetWidth:
|
|
60
|
-
R.value = !
|
|
61
|
-
[
|
|
62
|
-
left: `${Math.max(8, Math.min(
|
|
63
|
-
minWidth:
|
|
64
|
-
maxHeight: `${Math.max(
|
|
58
|
+
let e = B.getBoundingClientRect(), n = t(), r = `${Math.min(Math.max(e.width, ne[u.variant]), n.width - 16)}px`;
|
|
59
|
+
I.value.style.minWidth = r;
|
|
60
|
+
let { offsetWidth: i, offsetHeight: a } = I.value, o = n.bottom - e.bottom - 8 - 8, s = e.top - n.top - 8 - 8, c = u.placement === "top" ? s >= a || s > o : o < a && s > o, l = (u.align === "end" ? e.right - i : e.left) - n.left;
|
|
61
|
+
R.value = !c, L.value = {
|
|
62
|
+
[c ? "bottom" : "top"]: `${c ? n.bottom - e.top + 8 : e.bottom + 8 - n.top}px`,
|
|
63
|
+
left: `${Math.max(8, Math.min(l, n.width - i - 8))}px`,
|
|
64
|
+
minWidth: r,
|
|
65
|
+
maxHeight: `${Math.max(c ? s : o, 120)}px`
|
|
65
66
|
};
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
+
function ae(e) {
|
|
68
69
|
if (B?.contains(e.target)) {
|
|
69
|
-
if (
|
|
70
|
+
if (j.value) return Y();
|
|
70
71
|
J(e.detail === 0 ? "first" : "menu");
|
|
71
72
|
}
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
+
function oe(e) {
|
|
74
75
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
75
|
-
if (e.preventDefault(),
|
|
76
|
+
if (e.preventDefault(), j.value) return q(e.key === "ArrowDown" ? "first" : "last");
|
|
76
77
|
J(e.key === "ArrowDown" ? "first" : "last");
|
|
77
78
|
}
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
+
function se(e) {
|
|
80
81
|
let t = K(), n = t.indexOf(document.activeElement);
|
|
81
82
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
82
83
|
e.preventDefault();
|
|
83
84
|
let t = e.key === "ArrowDown" ? 1 : -1;
|
|
84
85
|
q(n < 0 ? t > 0 ? "first" : "last" : n + t);
|
|
85
|
-
} else e.key === "Home" || e.key === "End" ? (e.preventDefault(), q(e.key === "Home" ? "first" : "last")) : e.key === "Escape" ? (e.preventDefault(), Y()) : e.key === "Tab" ? Y() : e.key === " " && n >= 0 && t[n].tagName !== "BUTTON" ? (e.preventDefault(), t[n].click()) : e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey && e.key !== " " &&
|
|
86
|
+
} else e.key === "Home" || e.key === "End" ? (e.preventDefault(), q(e.key === "Home" ? "first" : "last")) : e.key === "Escape" ? (e.preventDefault(), Y()) : e.key === "Tab" ? Y() : e.key === " " && n >= 0 && t[n].tagName !== "BUTTON" ? (e.preventDefault(), t[n].click()) : e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey && e.key !== " " && ce(e.key, t, n);
|
|
86
87
|
}
|
|
87
|
-
function
|
|
88
|
+
function ce(e, t, n) {
|
|
88
89
|
H += e.toLowerCase(), clearTimeout(U), U = setTimeout(() => H = "", 500);
|
|
89
90
|
let r = (e) => (e.dataset.acLabel || e.textContent || "").trim().toLowerCase(), i = H.length === 1 ? n + 1 : Math.max(n, 0);
|
|
90
91
|
[...t.slice(i), ...t.slice(0, i)].find((e) => r(e).startsWith(H))?.focus();
|
|
@@ -99,49 +100,49 @@ var ne = ["aria-label", "disabled"], re = ["aria-labelledby", "aria-label"], D =
|
|
|
99
100
|
function $(e) {
|
|
100
101
|
e ? (document.addEventListener("pointerdown", Z, !0), window.addEventListener("scroll", Q, !0), window.addEventListener("resize", Q)) : (document.removeEventListener("pointerdown", Z, !0), window.removeEventListener("scroll", Q, !0), window.removeEventListener("resize", Q));
|
|
101
102
|
}
|
|
102
|
-
return
|
|
103
|
+
return g("ac-dropdown", {
|
|
103
104
|
close: Y,
|
|
104
105
|
focusMenu: () => I.value?.focus(),
|
|
105
|
-
variant:
|
|
106
|
-
}),
|
|
107
|
-
G(), $(e), e && (await
|
|
108
|
-
}),
|
|
106
|
+
variant: y(u, "variant")
|
|
107
|
+
}), w(j, async (e) => {
|
|
108
|
+
G(), $(e), e && (await d(), X(), V === "menu" ? I.value?.focus() : q(V), V = "menu");
|
|
109
|
+
}), p(G), m(G), te(() => {
|
|
109
110
|
$(!1), clearTimeout(U);
|
|
110
|
-
}), (
|
|
111
|
+
}), (t, i) => (h(), s("div", {
|
|
111
112
|
ref_key: "root",
|
|
112
113
|
ref: F,
|
|
113
114
|
class: "inline-flex",
|
|
114
115
|
"data-ac-ds": "",
|
|
115
116
|
"data-testid": "ac-dropdown",
|
|
116
|
-
onClick:
|
|
117
|
-
onKeydown:
|
|
118
|
-
}, [
|
|
117
|
+
onClick: ae,
|
|
118
|
+
onKeydown: oe
|
|
119
|
+
}, [M.trigger ? v(t.$slots, "trigger", { open: j.value }, void 0, void 0, 0) : l.label ? (h(), a(e, {
|
|
119
120
|
key: 1,
|
|
120
|
-
title:
|
|
121
|
+
title: l.label,
|
|
121
122
|
color: "white",
|
|
122
|
-
disabled:
|
|
123
|
+
disabled: l.disabled
|
|
123
124
|
}, {
|
|
124
|
-
default:
|
|
125
|
-
class:
|
|
125
|
+
default: T(() => [c(b(E), {
|
|
126
|
+
class: f(["-mr-1 text-muted transition-transform duration-200", j.value && "rotate-180"]),
|
|
126
127
|
"aria-hidden": "true"
|
|
127
128
|
}, null, 8, ["class"])]),
|
|
128
129
|
_: 1
|
|
129
|
-
}, 8, ["title", "disabled"])) : (
|
|
130
|
+
}, 8, ["title", "disabled"])) : (h(), s("button", {
|
|
130
131
|
key: 2,
|
|
131
132
|
type: "button",
|
|
132
|
-
"aria-label":
|
|
133
|
-
disabled:
|
|
134
|
-
class:
|
|
135
|
-
}, [
|
|
133
|
+
"aria-label": l.menuLabel,
|
|
134
|
+
disabled: l.disabled,
|
|
135
|
+
class: f(["inline-flex size-7 cursor-pointer items-center justify-center rounded-8 text-muted transition-colors duration-200 hover:bg-surface-sunken hover:text-heading 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", j.value && "bg-surface-sunken text-heading"])
|
|
136
|
+
}, [c(b(D), {
|
|
136
137
|
class: "size-4",
|
|
137
138
|
"aria-hidden": "true"
|
|
138
|
-
})], 10,
|
|
139
|
+
})], 10, O)), (h(), a(n, { to: "body" }, [c(r, {
|
|
139
140
|
"enter-active-class": "transition-[opacity,scale] duration-150 ease-out motion-reduce:transition-none",
|
|
140
141
|
"enter-from-class": "opacity-0 motion-safe:scale-95",
|
|
141
142
|
"leave-active-class": "transition-[opacity,scale] duration-100 ease-in motion-reduce:transition-none",
|
|
142
143
|
"leave-to-class": "opacity-0 motion-safe:scale-95"
|
|
143
144
|
}, {
|
|
144
|
-
default:
|
|
145
|
+
default: T(() => [j.value ? (h(), s("div", {
|
|
145
146
|
key: 0,
|
|
146
147
|
id: P,
|
|
147
148
|
ref_key: "panel",
|
|
@@ -149,17 +150,17 @@ var ne = ["aria-label", "disabled"], re = ["aria-labelledby", "aria-label"], D =
|
|
|
149
150
|
role: "menu",
|
|
150
151
|
tabindex: "-1",
|
|
151
152
|
"aria-orientation": "vertical",
|
|
152
|
-
"aria-labelledby": (
|
|
153
|
-
"aria-label":
|
|
154
|
-
class:
|
|
155
|
-
style:
|
|
153
|
+
"aria-labelledby": (M.trigger || l.label) && z.value ? z.value : void 0,
|
|
154
|
+
"aria-label": M.trigger || l.label ? void 0 : l.menuLabel,
|
|
155
|
+
class: f(["ac-scrollbar fixed z-[90] flex w-max max-w-[min(320px,calc(100vw-16px))] flex-col border bg-surface shadow-lg outline-none", [ie[l.variant], W.value]]),
|
|
156
|
+
style: ee(L.value),
|
|
156
157
|
"data-ac-ds": "",
|
|
157
158
|
"data-testid": "ac-dropdown-menu",
|
|
158
|
-
onKeydown:
|
|
159
|
-
}, [
|
|
159
|
+
onKeydown: se
|
|
160
|
+
}, [v(t.$slots, "default")], 46, k)) : o("", !0)]),
|
|
160
161
|
_: 3
|
|
161
162
|
})]))], 544));
|
|
162
163
|
}
|
|
163
164
|
});
|
|
164
165
|
//#endregion
|
|
165
|
-
export {
|
|
166
|
+
export { j as default };
|
|
@@ -30,11 +30,11 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
30
30
|
title: string;
|
|
31
31
|
description: string;
|
|
32
32
|
error: undefined;
|
|
33
|
+
titleTag: "h2" | "h3" | "h4" | "p";
|
|
33
34
|
compact: boolean;
|
|
34
35
|
retrying: boolean;
|
|
35
36
|
retryText: string;
|
|
36
37
|
hideRetry: boolean;
|
|
37
|
-
titleTag: "h2" | "h3" | "h4" | "p";
|
|
38
38
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
39
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
40
40
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import e from "./AcButton.js";
|
|
2
|
-
import {
|
|
2
|
+
import { fixedFrame as t } from "./fixedFrame.js";
|
|
3
|
+
import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, inject as l, normalizeClass as u, normalizeStyle as d, onBeforeUnmount as f, onMounted as p, openBlock as m, ref as h, renderSlot as g, watch as _ } from "vue";
|
|
3
4
|
//#region src/lib/components/AcFormFooter.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
5
|
+
var v = { class: "flex min-w-0 items-center gap-2 text-base text-muted" }, y = { class: "ml-auto flex items-center gap-3" }, b = /*@__PURE__*/ c({
|
|
5
6
|
__name: "AcFormFooter",
|
|
6
7
|
props: {
|
|
7
8
|
submitLabel: { default: "Save" },
|
|
@@ -22,58 +23,58 @@ var _ = { class: "flex min-w-0 items-center gap-2 text-base text-muted" }, v = {
|
|
|
22
23
|
form: { default: "" }
|
|
23
24
|
},
|
|
24
25
|
emits: ["cancel", "save"],
|
|
25
|
-
setup(
|
|
26
|
-
let
|
|
26
|
+
setup(c, { emit: b }) {
|
|
27
|
+
let x = c, S = b, C = l("ac-form", null), w = h(null), T = h(null), E = h({
|
|
27
28
|
left: 0,
|
|
28
29
|
width: 0,
|
|
29
30
|
height: 0
|
|
30
|
-
}),
|
|
31
|
-
function
|
|
32
|
-
e.currentTarget?.form ||
|
|
31
|
+
}), D, O = n(() => C?.widthClass.value ?? "");
|
|
32
|
+
function k(e) {
|
|
33
|
+
e.currentTarget?.form || S("save");
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
if (!
|
|
36
|
-
let e =
|
|
37
|
-
|
|
38
|
-
left: e.left,
|
|
35
|
+
function A() {
|
|
36
|
+
if (!w.value || !T.value) return;
|
|
37
|
+
let e = w.value.getBoundingClientRect();
|
|
38
|
+
E.value = {
|
|
39
|
+
left: e.left - t().left,
|
|
39
40
|
width: e.width,
|
|
40
|
-
height:
|
|
41
|
+
height: T.value.offsetHeight
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
|
-
function A() {
|
|
44
|
-
j(), b.sticky === "viewport" && C.value && w.value && (k(), E = new ResizeObserver(k), E.observe(C.value), E.observe(w.value), window.addEventListener("resize", k));
|
|
45
|
-
}
|
|
46
44
|
function j() {
|
|
47
|
-
|
|
45
|
+
M(), x.sticky === "viewport" && w.value && T.value && (A(), D = new ResizeObserver(A), D.observe(w.value), D.observe(T.value), window.addEventListener("resize", A));
|
|
48
46
|
}
|
|
49
|
-
|
|
47
|
+
function M() {
|
|
48
|
+
D?.disconnect(), D = void 0, window.removeEventListener("resize", A);
|
|
49
|
+
}
|
|
50
|
+
return _(() => x.sticky, j, { flush: "post" }), p(j), f(M), (t, n) => (m(), a("div", {
|
|
50
51
|
ref_key: "root",
|
|
51
|
-
ref:
|
|
52
|
-
class:
|
|
53
|
-
style:
|
|
52
|
+
ref: w,
|
|
53
|
+
class: u(["mt-4 w-full", [c.sticky === "container" && "sticky bottom-0 z-10", c.sticky !== "viewport" && O.value]]),
|
|
54
|
+
style: d(c.sticky === "viewport" ? { height: `${E.value.height}px` } : void 0),
|
|
54
55
|
"data-ac-ds": "",
|
|
55
56
|
"data-testid": "ac-form-footer"
|
|
56
|
-
}, [
|
|
57
|
+
}, [o("div", {
|
|
57
58
|
ref_key: "bar",
|
|
58
|
-
ref:
|
|
59
|
-
class:
|
|
60
|
-
style:
|
|
61
|
-
left: `${
|
|
62
|
-
width: `${
|
|
59
|
+
ref: T,
|
|
60
|
+
class: u(["border-t border-border bg-surface py-4", c.sticky === "viewport" && "fixed bottom-0 z-40 px-4"]),
|
|
61
|
+
style: d(c.sticky === "viewport" ? {
|
|
62
|
+
left: `${E.value.left}px`,
|
|
63
|
+
width: `${E.value.width}px`
|
|
63
64
|
} : void 0)
|
|
64
|
-
}, [
|
|
65
|
+
}, [o("div", { class: u(["flex w-full flex-wrap items-center justify-between gap-x-4 gap-y-2", O.value]) }, [o("div", v, [g(t.$slots, "left")]), o("div", y, [g(t.$slots, "right", {}, () => [c.hideCancel ? i("", !0) : (m(), r(e, {
|
|
65
66
|
key: 0,
|
|
66
|
-
title:
|
|
67
|
+
title: c.cancelLabel,
|
|
67
68
|
color: "white",
|
|
68
|
-
disabled:
|
|
69
|
-
onClick:
|
|
70
|
-
}, null, 8, ["title", "disabled"])),
|
|
71
|
-
title:
|
|
69
|
+
disabled: c.loading,
|
|
70
|
+
onClick: n[0] ||= (e) => S("cancel")
|
|
71
|
+
}, null, 8, ["title", "disabled"])), s(e, {
|
|
72
|
+
title: c.submitLabel,
|
|
72
73
|
type: "submit",
|
|
73
|
-
form:
|
|
74
|
-
loading:
|
|
75
|
-
disabled:
|
|
76
|
-
onClick:
|
|
74
|
+
form: c.form || void 0,
|
|
75
|
+
loading: c.loading,
|
|
76
|
+
disabled: c.disabled,
|
|
77
|
+
onClick: k
|
|
77
78
|
}, null, 8, [
|
|
78
79
|
"title",
|
|
79
80
|
"form",
|
|
@@ -83,4 +84,4 @@ var _ = { class: "flex min-w-0 items-center gap-2 text-base text-muted" }, v = {
|
|
|
83
84
|
}
|
|
84
85
|
});
|
|
85
86
|
//#endregion
|
|
86
|
-
export {
|
|
87
|
+
export { b as default };
|
|
@@ -48,8 +48,8 @@ declare const __VLS_base: import("vue").DefineComponent<Props, {}, {}, {}, {}, i
|
|
|
48
48
|
size: "normal" | "compact";
|
|
49
49
|
top: string;
|
|
50
50
|
subtitle: string;
|
|
51
|
-
sticky: boolean;
|
|
52
51
|
titleTag: "h1" | "h2" | "h3" | "h4";
|
|
52
|
+
sticky: boolean;
|
|
53
53
|
countLabel: string;
|
|
54
54
|
docsHref: string;
|
|
55
55
|
backButton: boolean;
|
|
@@ -1,23 +1,31 @@
|
|
|
1
|
-
import type { Component } from "vue";
|
|
1
|
+
import type { Component, HTMLAttributes } from "vue";
|
|
2
2
|
export interface Props {
|
|
3
|
-
/** Label above the field. Pass `placeholder` for an example value inside it. */
|
|
4
|
-
label
|
|
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
|
+
label?: string;
|
|
5
5
|
/** Native `name` attribute. */
|
|
6
6
|
name?: string;
|
|
7
7
|
/** Native input type. `password` adds a show/hide toggle. */
|
|
8
8
|
type?: "text" | "password" | "email" | "number" | "url" | "search";
|
|
9
9
|
/** Marks the field required and adds a red asterisk. */
|
|
10
10
|
required?: boolean;
|
|
11
|
+
/** Adds the red asterisk without native `required`, for forms that run their own validation on submit. */
|
|
12
|
+
requiredMark?: boolean;
|
|
11
13
|
/** Disables the field. */
|
|
12
14
|
disabled?: boolean;
|
|
13
15
|
/** Read-only field: a muted fill, and "(read only)" after the label. */
|
|
14
16
|
readonly?: boolean;
|
|
15
17
|
/** Error text under the field. Turns the border and label red and sets `aria-invalid`. */
|
|
16
18
|
errorMsg?: string;
|
|
19
|
+
/** Turns the border red and sets `aria-invalid` without a message, for forms that print their own. */
|
|
20
|
+
invalid?: boolean;
|
|
17
21
|
/** Help text between the label and the field. */
|
|
18
22
|
hint?: string;
|
|
19
|
-
/** `small` 36px or `normal` 42px tall. */
|
|
20
|
-
size?: "small" | "normal";
|
|
23
|
+
/** `xsmall` 34px, `small` 36px or `normal` 42px tall. */
|
|
24
|
+
size?: "xsmall" | "small" | "normal";
|
|
25
|
+
/** Classes for the `<input>` element itself, e.g. `font-mono`. `class` goes on the wrapper. */
|
|
26
|
+
inputClass?: HTMLAttributes["class"];
|
|
27
|
+
/** Shows a spinner in the password toggle and disables it, e.g. while `update:showValue` fetches a stored secret. */
|
|
28
|
+
revealing?: boolean;
|
|
21
29
|
/** Text of a button attached to the right edge, such as "Copy", "Generate" or "Browse". It emits `addon` when clicked. Also its accessible name when `addon-icon-only` is set. */
|
|
22
30
|
addonLabel?: string;
|
|
23
31
|
/** A Lucide icon component shown in the attached button, before `addon-label`. */
|
|
@@ -31,9 +39,15 @@ type __VLS_Slots = {
|
|
|
31
39
|
prefix?: () => unknown;
|
|
32
40
|
/** Content inside the field after the value: a unit such as `Gi` or `%`, or a status icon. */
|
|
33
41
|
suffix?: () => unknown;
|
|
42
|
+
/** Content before the label text, such as a 14px icon. */
|
|
43
|
+
"label-icon"?: () => unknown;
|
|
44
|
+
/** Content after the label text, such as "(Optional)" or an info tooltip. */
|
|
45
|
+
"label-extra"?: () => unknown;
|
|
34
46
|
};
|
|
35
47
|
type __VLS_ModelProps = {
|
|
36
48
|
modelValue?: string | number;
|
|
49
|
+
/** Whether a password shows as plain text. Bind `v-model:show-value` to fetch a stored value before it shows. */
|
|
50
|
+
"showValue"?: boolean;
|
|
37
51
|
};
|
|
38
52
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
39
53
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
@@ -42,18 +56,25 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
42
56
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
43
57
|
"update:modelValue": (value: string | number) => any;
|
|
44
58
|
addon: (event: MouseEvent) => any;
|
|
59
|
+
"update:showValue": (value: boolean) => any;
|
|
45
60
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
46
61
|
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
47
62
|
onAddon?: ((event: MouseEvent) => any) | undefined;
|
|
63
|
+
"onUpdate:showValue"?: ((value: boolean) => any) | undefined;
|
|
48
64
|
}>, {
|
|
49
65
|
type: "text" | "password" | "email" | "number" | "url" | "search";
|
|
50
66
|
required: boolean;
|
|
67
|
+
label: string;
|
|
51
68
|
disabled: boolean;
|
|
52
69
|
name: string;
|
|
53
|
-
size: "small" | "normal";
|
|
54
|
-
readonly: boolean;
|
|
70
|
+
size: "xsmall" | "small" | "normal";
|
|
55
71
|
hint: string;
|
|
72
|
+
invalid: boolean;
|
|
73
|
+
readonly: boolean;
|
|
56
74
|
errorMsg: string;
|
|
75
|
+
requiredMark: boolean;
|
|
76
|
+
inputClass: string | false | Record<string, any> | import("vue").ClassValue[] | null;
|
|
77
|
+
revealing: boolean;
|
|
57
78
|
addonLabel: string;
|
|
58
79
|
addonIcon: Component;
|
|
59
80
|
addonIconOnly: boolean;
|