@ac-design/design-system 2.2.1 → 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/compat.css +210 -0
- 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/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 +432 -369
- package/dist/lib/components/AcErrorState.vue.d.ts +1 -1
- 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/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/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 +190 -174
- 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 +206 -174
- package/dist/lib/components/AcUserMenu.vue.d.ts +8 -0
- package/dist/lib/components/AcUserMenu.vue_vue_type_script_setup_true_lang.js +126 -109
- 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
|
@@ -19,6 +19,8 @@ type __VLS_Slots = {
|
|
|
19
19
|
default?: () => unknown;
|
|
20
20
|
/** A search field, placed by `search-position`. Hidden below 640px. */
|
|
21
21
|
search?: () => unknown;
|
|
22
|
+
/** Left-hand content that fills the row up to `actions` and shrinks first when space runs out, e.g. cloud-ui's search field with its phone-only search button. Use it instead of a centred `search`. */
|
|
23
|
+
start?: () => unknown;
|
|
22
24
|
/** Right side: icon actions, notifications, theme and `AcUserMenu` last. */
|
|
23
25
|
actions?: () => unknown;
|
|
24
26
|
};
|
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
import { createCommentVNode as e, createElementBlock as t,
|
|
2
|
-
import { Menu as
|
|
1
|
+
import { createCommentVNode as e, createElementBlock as t, createVNode as n, defineComponent as r, normalizeClass as i, openBlock as a, renderSlot as o, toDisplayString as s, unref as c } from "vue";
|
|
2
|
+
import { Menu as l } from "@lucide/vue";
|
|
3
3
|
//#region src/lib/components/AcNavbar.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
-
var
|
|
4
|
+
var u = ["aria-label"], d = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "flex shrink-0 items-center gap-2"
|
|
7
|
-
},
|
|
7
|
+
}, f = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "inline-flex items-center rounded-6 border border-primary/25 bg-primary/10 px-1.5 py-0.5 text-sm font-semibold tracking-wide text-primary-strong uppercase"
|
|
10
|
-
},
|
|
10
|
+
}, p = ["aria-label"], m = {
|
|
11
11
|
key: 3,
|
|
12
12
|
class: "hidden min-w-0 shrink sm:block sm:w-48 md:w-60 lg:w-80 xl:w-96"
|
|
13
|
-
},
|
|
13
|
+
}, h = {
|
|
14
|
+
key: 4,
|
|
15
|
+
class: "flex min-w-0 flex-1 items-center"
|
|
16
|
+
}, g = {
|
|
17
|
+
key: 5,
|
|
18
|
+
class: "flex min-w-0 flex-1 justify-center"
|
|
19
|
+
}, _ = {
|
|
14
20
|
key: 0,
|
|
15
21
|
class: "hidden w-full max-w-md sm:block"
|
|
16
22
|
}, v = {
|
|
17
|
-
key:
|
|
23
|
+
key: 6,
|
|
18
24
|
class: "flex shrink-0 items-center gap-0.5 sm:gap-3"
|
|
19
|
-
}, y = /*@__PURE__*/
|
|
25
|
+
}, y = /*@__PURE__*/ r({
|
|
20
26
|
__name: "AcNavbar",
|
|
21
27
|
props: {
|
|
22
28
|
menuButton: { default: "mobile" },
|
|
@@ -30,37 +36,37 @@ var d = ["aria-label"], f = {
|
|
|
30
36
|
searchPosition: { default: "start" }
|
|
31
37
|
},
|
|
32
38
|
emits: ["menu"],
|
|
33
|
-
setup(
|
|
39
|
+
setup(r, { emit: y }) {
|
|
34
40
|
let b = y;
|
|
35
|
-
return (y, x) => (
|
|
36
|
-
class:
|
|
41
|
+
return (y, x) => (a(), t("header", {
|
|
42
|
+
class: i(["top-0 z-30 flex h-18 shrink-0 items-center gap-2 border-b border-border/80 bg-surface/90 px-4 backdrop-blur-sm sm:gap-4 sm:px-6", r.sticky && "sticky"]),
|
|
37
43
|
"data-ac-ds": "",
|
|
38
44
|
"data-testid": "ac-navbar"
|
|
39
45
|
}, [
|
|
40
|
-
|
|
46
|
+
r.menuButton === "never" ? e("", !0) : (a(), t("button", {
|
|
41
47
|
key: 0,
|
|
42
48
|
type: "button",
|
|
43
|
-
class:
|
|
44
|
-
"md:hidden":
|
|
45
|
-
"lg:hidden":
|
|
49
|
+
class: i(["inline-flex size-9.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:ring-offset-2 focus-visible:ring-offset-surface focus-visible:outline-none", {
|
|
50
|
+
"md:hidden": r.menuButton === "mobile",
|
|
51
|
+
"lg:hidden": r.menuButton === "tablet"
|
|
46
52
|
}]),
|
|
47
|
-
"aria-label":
|
|
53
|
+
"aria-label": r.menuLabel,
|
|
48
54
|
"data-ac-ds": "",
|
|
49
55
|
"data-testid": "ac-navbar-menu",
|
|
50
56
|
onClick: x[0] ||= (e) => b("menu")
|
|
51
|
-
}, [
|
|
57
|
+
}, [n(c(l), {
|
|
52
58
|
class: "size-5",
|
|
53
59
|
"aria-hidden": "true"
|
|
54
|
-
})], 10,
|
|
55
|
-
y.$slots.brand ||
|
|
56
|
-
y.$slots.default ? (
|
|
60
|
+
})], 10, u)),
|
|
61
|
+
y.$slots.brand || r.productName ? (a(), t("div", d, [o(y.$slots, "brand"), r.productName ? (a(), t("span", f, s(r.productName), 1)) : e("", !0)])) : e("", !0),
|
|
62
|
+
y.$slots.default ? (a(), t("nav", {
|
|
57
63
|
key: 2,
|
|
58
|
-
"aria-label":
|
|
64
|
+
"aria-label": r.label,
|
|
59
65
|
class: "hidden items-center gap-1 md:flex"
|
|
60
|
-
}, [
|
|
61
|
-
y.$slots.search &&
|
|
62
|
-
|
|
63
|
-
y.$slots.actions ? (
|
|
66
|
+
}, [o(y.$slots, "default")], 8, p)) : e("", !0),
|
|
67
|
+
y.$slots.search && r.searchPosition === "start" ? (a(), t("div", m, [o(y.$slots, "search")])) : e("", !0),
|
|
68
|
+
y.$slots.start ? (a(), t("div", h, [o(y.$slots, "start")])) : (a(), t("div", g, [y.$slots.search && r.searchPosition === "center" ? (a(), t("div", _, [o(y.$slots, "search")])) : e("", !0)])),
|
|
69
|
+
y.$slots.actions ? (a(), t("div", v, [o(y.$slots, "actions")])) : e("", !0)
|
|
64
70
|
], 2));
|
|
65
71
|
}
|
|
66
72
|
});
|
|
@@ -59,9 +59,9 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
|
59
59
|
min: number;
|
|
60
60
|
name: string;
|
|
61
61
|
size: "small" | "normal";
|
|
62
|
+
hint: string;
|
|
62
63
|
step: number;
|
|
63
64
|
readonly: boolean;
|
|
64
|
-
hint: string;
|
|
65
65
|
errorMsg: string;
|
|
66
66
|
unit: string;
|
|
67
67
|
precision: number;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export interface Props<V> {
|
|
2
|
+
/** Native radio `name`, used as given. Cards with the same `name` form one group: arrow keys move between them. Old cloud-ui `group`. */
|
|
3
|
+
name: string;
|
|
4
|
+
/** The value this card writes to `v-model` when it's selected. */
|
|
5
|
+
value: V;
|
|
6
|
+
/** Bold line at the top of the card. */
|
|
7
|
+
title?: string;
|
|
8
|
+
/** Muted text under the title. */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** Greys the card out and stops it from being selected. */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Shows an 18px radio before the content instead of the check badge in the corner. Old cloud-ui `is-radio-show`. */
|
|
13
|
+
showRadio?: boolean;
|
|
14
|
+
/** Classes for the title, replacing `text-base font-semibold text-heading`, e.g. `text-lg font-semibold text-heading`. */
|
|
15
|
+
titleClass?: string;
|
|
16
|
+
/** Classes for the description, replacing `mt-0.5 text-xs leading-relaxed text-muted`. */
|
|
17
|
+
descriptionClass?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const __VLS_export: <T>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
20
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<(Props<T> & {
|
|
21
|
+
modelValue?: T;
|
|
22
|
+
}) & {
|
|
23
|
+
"onUpdate:modelValue"?: ((value: T | undefined) => any) | undefined;
|
|
24
|
+
onChange?: ((value: T) => any) | undefined;
|
|
25
|
+
}> & (typeof globalThis extends {
|
|
26
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
27
|
+
} ? P : {});
|
|
28
|
+
expose: (exposed: import("vue").ShallowUnwrapRef<{
|
|
29
|
+
/** Moves focus to the radio. */
|
|
30
|
+
focus: () => void | undefined;
|
|
31
|
+
}>) => void;
|
|
32
|
+
attrs: any;
|
|
33
|
+
slots: {
|
|
34
|
+
/** Replaces the whole card body (icon, title, description, features and right content). The radio and selection styles stay. Old cloud-ui `is-custom` with `#custom`. */
|
|
35
|
+
default?: () => unknown;
|
|
36
|
+
/** Icon or logo tile before the title. */
|
|
37
|
+
icon?: () => unknown;
|
|
38
|
+
/** Content after the title on the same line, e.g. a "Recommended" pill. Old cloud-ui `#subTitle`. */
|
|
39
|
+
subtitle?: () => unknown;
|
|
40
|
+
/** Pills under the description, e.g. "HA" or "PITR". */
|
|
41
|
+
features?: () => unknown;
|
|
42
|
+
/** Content on the right of the card, e.g. a price. Below 768px it moves under the text. Hides the check badge, so pair it with `show-radio`. Old cloud-ui `#rightContent`. */
|
|
43
|
+
right?: () => unknown;
|
|
44
|
+
};
|
|
45
|
+
emit: ((evt: "change", value: T) => void) & ((event: "update:modelValue", value: T | undefined) => void);
|
|
46
|
+
}>) => import("vue").VNode & {
|
|
47
|
+
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
48
|
+
};
|
|
49
|
+
declare const _default: typeof __VLS_export;
|
|
50
|
+
export default _default;
|
|
51
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
52
|
+
[K in keyof T]: T[K];
|
|
53
|
+
} : {
|
|
54
|
+
[K in keyof T as K]: T[K];
|
|
55
|
+
}) & {};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { Comment as e, Transition as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createVNode as o, defineComponent as s, mergeModels as c, mergeProps as l, normalizeClass as u, openBlock as d, ref as f, renderSlot as p, toDisplayString as m, unref as h, useAttrs as g, useId as _, useModel as v, useSlots as y, withCtx as b } from "vue";
|
|
2
|
+
import { Check as x } from "@lucide/vue";
|
|
3
|
+
//#region src/lib/components/AcRadioCard.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var S = ["aria-disabled"], C = [
|
|
5
|
+
"name",
|
|
6
|
+
"value",
|
|
7
|
+
"checked",
|
|
8
|
+
"disabled",
|
|
9
|
+
"aria-labelledby",
|
|
10
|
+
"aria-describedby"
|
|
11
|
+
], w = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "flex min-w-0 flex-1 items-start gap-3"
|
|
14
|
+
}, T = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "flex shrink-0 items-center"
|
|
17
|
+
}, E = { class: "flex min-w-0 flex-1 flex-col gap-2 md:flex-row md:items-start md:justify-between md:gap-4" }, D = { class: "block min-w-0" }, O = ["id"], k = ["id"], A = ["id"], j = ["id"], M = {
|
|
18
|
+
key: 0,
|
|
19
|
+
class: "absolute top-2 right-2 flex size-4 items-center justify-center rounded-full bg-primary text-white shadow-sm",
|
|
20
|
+
"aria-hidden": "true"
|
|
21
|
+
}, N = /*@__PURE__*/ s({
|
|
22
|
+
inheritAttrs: !1,
|
|
23
|
+
__name: "AcRadioCard",
|
|
24
|
+
props: /*@__PURE__*/ c({
|
|
25
|
+
name: {},
|
|
26
|
+
value: {},
|
|
27
|
+
title: { default: "" },
|
|
28
|
+
description: { default: "" },
|
|
29
|
+
disabled: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: !1
|
|
32
|
+
},
|
|
33
|
+
showRadio: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: !1
|
|
36
|
+
},
|
|
37
|
+
titleClass: { default: "text-base font-semibold text-heading" },
|
|
38
|
+
descriptionClass: { default: "mt-0.5 text-xs leading-relaxed text-muted" }
|
|
39
|
+
}, {
|
|
40
|
+
modelValue: {},
|
|
41
|
+
modelModifiers: {}
|
|
42
|
+
}),
|
|
43
|
+
emits: /*@__PURE__*/ c(["change"], ["update:modelValue"]),
|
|
44
|
+
setup(s, { expose: c, emit: N }) {
|
|
45
|
+
let P = s, F = v(s, "modelValue"), I = N, L = _(), R = g(), z = y(), B = f(null), V = n(() => ({
|
|
46
|
+
class: R.class,
|
|
47
|
+
style: R.style
|
|
48
|
+
})), H = n(() => {
|
|
49
|
+
let { class: e, style: t, ...n } = R;
|
|
50
|
+
return n;
|
|
51
|
+
}), U = n(() => F.value === P.value);
|
|
52
|
+
function W() {
|
|
53
|
+
return !!z.default?.().some((t) => t.type !== e);
|
|
54
|
+
}
|
|
55
|
+
function G() {
|
|
56
|
+
return !W() && (!!P.title || !!z.subtitle);
|
|
57
|
+
}
|
|
58
|
+
function K() {
|
|
59
|
+
if (!W()) return [
|
|
60
|
+
P.description && `${L}-desc`,
|
|
61
|
+
z.features && `${L}-features`,
|
|
62
|
+
z.right && `${L}-right`
|
|
63
|
+
].filter(Boolean).join(" ") || void 0;
|
|
64
|
+
}
|
|
65
|
+
function q() {
|
|
66
|
+
P.disabled || (F.value = P.value, I("change", P.value));
|
|
67
|
+
}
|
|
68
|
+
return c({ focus: () => B.value?.focus() }), (e, n) => (d(), i("label", l(V.value, {
|
|
69
|
+
class: ["group relative flex items-start gap-3 rounded-14 border p-3 transition-[border-color,background-color,box-shadow] duration-200 ease-out has-[>span>input[type=radio]:focus-visible]:ring-2 has-[>span>input[type=radio]:focus-visible]:ring-ring has-[>span>input[type=radio]:focus-visible]:ring-offset-2 has-[>span>input[type=radio]:focus-visible]:ring-offset-background motion-reduce:transition-none", [
|
|
70
|
+
s.disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer",
|
|
71
|
+
U.value ? "border-primary bg-primary/5 shadow-[inset_0_0_0_1px_var(--color-primary)]" : "border-border bg-surface",
|
|
72
|
+
!U.value && !s.disabled && "hover:border-primary/40 hover:bg-accent-hover"
|
|
73
|
+
]],
|
|
74
|
+
"aria-disabled": s.disabled || void 0,
|
|
75
|
+
"data-ac-ds": "",
|
|
76
|
+
"data-testid": "ac-radio-card"
|
|
77
|
+
}), [
|
|
78
|
+
a("span", { class: u(s.showRadio ? "relative mt-0.5 inline-flex size-[18px] shrink-0" : "sr-only") }, [a("input", l({
|
|
79
|
+
ref_key: "input",
|
|
80
|
+
ref: B,
|
|
81
|
+
type: "radio",
|
|
82
|
+
name: s.name,
|
|
83
|
+
value: s.value,
|
|
84
|
+
checked: U.value,
|
|
85
|
+
disabled: s.disabled,
|
|
86
|
+
"aria-labelledby": G() ? `${h(L)}-title` : void 0,
|
|
87
|
+
"aria-describedby": K()
|
|
88
|
+
}, H.value, {
|
|
89
|
+
class: ["peer size-[18px] appearance-none rounded-full border transition-colors duration-200 focus-visible:outline-none disabled:cursor-not-allowed motion-reduce:transition-none", [U.value ? "border-primary bg-primary" : "border-muted/70 bg-background group-hover:border-primary/60", s.disabled ? "cursor-not-allowed" : "cursor-pointer"]],
|
|
90
|
+
onChange: q
|
|
91
|
+
}), null, 16, C), a("span", {
|
|
92
|
+
class: u(["pointer-events-none absolute inset-0 m-auto size-1.5 rounded-full bg-white transition-transform duration-200 motion-reduce:transition-none", U.value ? "scale-100" : "scale-0"]),
|
|
93
|
+
"aria-hidden": "true"
|
|
94
|
+
}, null, 2)], 2),
|
|
95
|
+
W() ? p(e.$slots, "default", {}, void 0, void 0, 0) : (d(), i("span", w, [e.$slots.icon ? (d(), i("span", T, [p(e.$slots, "icon")])) : r("", !0), a("span", E, [a("span", D, [
|
|
96
|
+
G() ? (d(), i("span", {
|
|
97
|
+
key: 0,
|
|
98
|
+
id: `${h(L)}-title`,
|
|
99
|
+
class: "flex flex-wrap items-center gap-x-2 gap-y-1"
|
|
100
|
+
}, [s.title ? (d(), i("span", {
|
|
101
|
+
key: 0,
|
|
102
|
+
class: u(["block font-heading tracking-[-0.012em] text-balance", s.titleClass])
|
|
103
|
+
}, m(s.title), 3)) : r("", !0), p(e.$slots, "subtitle")], 8, O)) : r("", !0),
|
|
104
|
+
s.description ? (d(), i("span", {
|
|
105
|
+
key: 1,
|
|
106
|
+
id: `${h(L)}-desc`,
|
|
107
|
+
class: u(["block text-pretty", s.descriptionClass])
|
|
108
|
+
}, m(s.description), 11, k)) : r("", !0),
|
|
109
|
+
e.$slots.features ? (d(), i("span", {
|
|
110
|
+
key: 2,
|
|
111
|
+
id: `${h(L)}-features`,
|
|
112
|
+
class: "mt-2.5 flex flex-wrap gap-1.5"
|
|
113
|
+
}, [p(e.$slots, "features")], 8, A)) : r("", !0)
|
|
114
|
+
]), e.$slots.right ? (d(), i("span", {
|
|
115
|
+
key: 0,
|
|
116
|
+
id: `${h(L)}-right`,
|
|
117
|
+
class: "block shrink-0"
|
|
118
|
+
}, [p(e.$slots, "right")], 8, j)) : r("", !0)])])),
|
|
119
|
+
o(t, {
|
|
120
|
+
"enter-active-class": "transition duration-150 ease-out motion-reduce:transition-none",
|
|
121
|
+
"enter-from-class": "scale-50 opacity-0",
|
|
122
|
+
"leave-active-class": "transition duration-100 ease-in motion-reduce:transition-none",
|
|
123
|
+
"leave-to-class": "scale-50 opacity-0"
|
|
124
|
+
}, {
|
|
125
|
+
default: b(() => [U.value && !s.showRadio && !e.$slots.right ? (d(), i("span", M, [o(h(x), {
|
|
126
|
+
class: "size-2.5",
|
|
127
|
+
"stroke-width": 3.5
|
|
128
|
+
})])) : r("", !0)]),
|
|
129
|
+
_: 1
|
|
130
|
+
})
|
|
131
|
+
], 16, S));
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
//#endregion
|
|
135
|
+
export { N as default };
|
|
@@ -22,6 +22,8 @@ export interface Props<T> {
|
|
|
22
22
|
loading?: boolean;
|
|
23
23
|
/** Shows a refresh button that emits `refresh`. */
|
|
24
24
|
refreshable?: boolean;
|
|
25
|
+
/** With `refreshable`, spins the refresh icon while options reload. Unlike `loading`, the field stays usable. */
|
|
26
|
+
refreshing?: boolean;
|
|
25
27
|
/** Disables the field. */
|
|
26
28
|
disabled?: boolean;
|
|
27
29
|
/** Marks the field required and adds a red asterisk. */
|
|
@@ -34,14 +36,19 @@ export interface Props<T> {
|
|
|
34
36
|
size?: "compact" | "small" | "normal";
|
|
35
37
|
/** Text shown when no option matches the search. */
|
|
36
38
|
noResultText?: string;
|
|
39
|
+
/** Side of the field the list opens on: `bottom` or `top`. It flips to the other side when there isn't room. */
|
|
40
|
+
placement?: "bottom" | "top";
|
|
37
41
|
}
|
|
38
42
|
declare const __VLS_export: <V>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
39
43
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<(Props<V> & {
|
|
40
44
|
modelValue?: V | V[] | null;
|
|
45
|
+
/** Whether the list is open. Bind `v-model:open` to react when it opens or closes, e.g. to check a required field. */
|
|
46
|
+
open?: boolean;
|
|
41
47
|
}) & {
|
|
42
48
|
onSearch?: ((query: string) => any) | undefined;
|
|
43
49
|
onSelect?: ((option: SelectOption<V>) => any) | undefined;
|
|
44
50
|
"onUpdate:modelValue"?: ((value: V | V[] | null) => any) | undefined;
|
|
51
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
45
52
|
onCreate?: ((text: string) => any) | undefined;
|
|
46
53
|
onRemove?: ((option: SelectOption<V>) => any) | undefined;
|
|
47
54
|
onRefresh?: (() => any) | undefined;
|
|
@@ -60,12 +67,16 @@ declare const __VLS_export: <V>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
60
67
|
selected: boolean;
|
|
61
68
|
active: boolean;
|
|
62
69
|
}) => unknown;
|
|
70
|
+
/** Content of the closed field for the chosen option in single select, e.g. an icon and a second line. Receives the option; defaults to its label. */
|
|
71
|
+
selected?: (props: {
|
|
72
|
+
option: SelectOption<V>;
|
|
73
|
+
}) => unknown;
|
|
63
74
|
/** Content shown when the list is empty or nothing matches. */
|
|
64
75
|
empty?: (props: {
|
|
65
76
|
query: string;
|
|
66
77
|
}) => unknown;
|
|
67
78
|
};
|
|
68
|
-
emit: (((evt: "search", query: string) => void) & ((evt: "select", option: SelectOption<V>) => void) & ((evt: "create", text: string) => void) & ((evt: "remove", option: SelectOption<V>) => void) & ((evt: "refresh") => void)) & ((event: "update:modelValue", value: V | V[] | null) => void);
|
|
79
|
+
emit: (((evt: "search", query: string) => void) & ((evt: "select", option: SelectOption<V>) => void) & ((evt: "create", text: string) => void) & ((evt: "remove", option: SelectOption<V>) => void) & ((evt: "refresh") => void)) & (((event: "update:modelValue", value: V | V[] | null) => void) & ((event: "update:open", value: boolean) => void));
|
|
69
80
|
}>) => import("vue").VNode & {
|
|
70
81
|
__ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
|
|
71
82
|
};
|