iryx-ui 0.24.1 → 0.26.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/components/AvatarGroup.vue.d.ts +8 -2
- package/dist/components/AvatarGroup.vue_vue_type_script_setup_true_lang.js +57 -23
- package/dist/components/Breadcrumb.vue.d.ts +10 -2
- package/dist/components/Breadcrumb.vue_vue_type_script_setup_true_lang.js +66 -34
- package/dist/components/CommandPalette.vue.d.ts +12 -0
- package/dist/components/CommandPalette.vue_vue_type_script_setup_true_lang.js +122 -85
- package/dist/components/ConfirmPopover.vue.d.ts +1 -1
- package/dist/components/DateRangePicker.vue.d.ts +14 -2
- package/dist/components/DateRangePicker.vue_vue_type_script_setup_true_lang.js +111 -70
- package/dist/components/FileUpload.vue.d.ts +23 -1
- package/dist/components/FileUpload.vue_vue_type_script_setup_true_lang.js +139 -96
- package/dist/components/Input.vue.d.ts +14 -0
- package/dist/components/Input.vue_vue_type_script_setup_true_lang.js +86 -69
- package/dist/components/SignaturePad.vue.d.ts +1 -1
- package/dist/components/Tabs.vue.d.ts +7 -6
- package/dist/components/Tabs.vue_vue_type_script_setup_true_lang.js +65 -30
- package/dist/components/Textarea.vue.d.ts +14 -0
- package/dist/components/Textarea.vue_vue_type_script_setup_true_lang.js +90 -42
- package/dist/components/Toaster.vue_vue_type_script_setup_true_lang.js +42 -41
- package/dist/components/index.js +144 -144
- package/dist/composables/character-count.d.ts +6 -0
- package/dist/composables/character-count.js +18 -0
- package/dist/composables/command-palette.d.ts +7 -0
- package/dist/composables/command-palette.js +8 -2
- package/dist/composables/date.d.ts +25 -0
- package/dist/composables/date.js +59 -16
- package/dist/composables/scroll-fade.d.ts +1 -1
- package/dist/composables/toast.d.ts +16 -1
- package/dist/composables/toast.js +23 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +154 -154
- package/dist/theme/avatar.d.ts +21 -0
- package/dist/theme/avatar.js +28 -21
- package/dist/theme/bar-chart.d.ts +3 -3
- package/dist/theme/date-picker.d.ts +9 -0
- package/dist/theme/date-picker.js +3 -0
- package/dist/theme/donut-chart.d.ts +3 -3
- package/dist/theme/file-upload.d.ts +24 -0
- package/dist/theme/file-upload.js +6 -2
- package/dist/theme/input.d.ts +46 -0
- package/dist/theme/input.js +10 -2
- package/dist/theme/line-chart.d.ts +3 -3
- package/dist/theme/tabs.d.ts +18 -3
- package/dist/theme/tabs.js +20 -12
- package/dist/theme/toast.d.ts +9 -0
- package/dist/theme/toast.js +2 -1
- package/package.json +1 -1
|
@@ -11,21 +11,27 @@ export interface AvatarGroupProps {
|
|
|
11
11
|
max?: number;
|
|
12
12
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
13
13
|
shape?: 'circle' | 'square';
|
|
14
|
+
/**
|
|
15
|
+
* Show each person's `name` in a tooltip, and lift the avatar under the
|
|
16
|
+
* pointer or focus out of the stack.
|
|
17
|
+
*/
|
|
18
|
+
tooltip?: boolean;
|
|
14
19
|
/** Skip built-in classes; you take over styling entirely. */
|
|
15
20
|
unstyled?: boolean;
|
|
16
21
|
class?: ClassValue;
|
|
17
22
|
/** Override classes per element, e.g. `{ overflow: 'bg-primary' }`. */
|
|
18
23
|
ui?: {
|
|
19
24
|
root?: string;
|
|
25
|
+
trigger?: string;
|
|
20
26
|
item?: string;
|
|
21
27
|
overflow?: string;
|
|
22
28
|
};
|
|
23
29
|
}
|
|
24
|
-
declare var
|
|
30
|
+
declare var __VLS_8: {
|
|
25
31
|
count: number;
|
|
26
32
|
};
|
|
27
33
|
type __VLS_Slots = {} & {
|
|
28
|
-
overflow?: (props: typeof
|
|
34
|
+
overflow?: (props: typeof __VLS_8) => any;
|
|
29
35
|
};
|
|
30
36
|
declare const __VLS_base: import("vue").DefineComponent<AvatarGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvatarGroupProps> & Readonly<{}>, {
|
|
31
37
|
unstyled: boolean;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
2
|
import { avatarGroupTheme as t } from "../theme/avatar.js";
|
|
3
3
|
import n from "./Avatar.js";
|
|
4
|
-
import
|
|
4
|
+
import r from "./Tooltip.js";
|
|
5
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, mergeProps as p, normalizeClass as m, openBlock as h, renderList as g, renderSlot as _, toDisplayString as v, withCtx as y } from "vue";
|
|
5
6
|
//#region src/components/AvatarGroup.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
-
var
|
|
7
|
+
var b = ["tabindex"], x = ["tabindex"], S = /*@__PURE__*/ f({
|
|
7
8
|
__name: "AvatarGroup",
|
|
8
9
|
props: {
|
|
9
10
|
items: {},
|
|
10
11
|
max: {},
|
|
11
12
|
size: {},
|
|
12
13
|
shape: {},
|
|
14
|
+
tooltip: { type: Boolean },
|
|
13
15
|
unstyled: {
|
|
14
16
|
type: Boolean,
|
|
15
17
|
default: void 0
|
|
@@ -22,29 +24,61 @@ var g = /*@__PURE__*/ l({
|
|
|
22
24
|
] },
|
|
23
25
|
ui: {}
|
|
24
26
|
},
|
|
25
|
-
setup(
|
|
26
|
-
let
|
|
27
|
-
let e =
|
|
28
|
-
return [...e !== void 0 &&
|
|
29
|
-
}),
|
|
30
|
-
let e =
|
|
31
|
-
return e === void 0 ||
|
|
32
|
-
}),
|
|
33
|
-
|
|
27
|
+
setup(f) {
|
|
28
|
+
let S = f, C = a(() => S.items ?? []), w = a(() => {
|
|
29
|
+
let e = S.max;
|
|
30
|
+
return [...e !== void 0 && C.value.length > e ? C.value.slice(0, e) : C.value].reverse();
|
|
31
|
+
}), T = a(() => {
|
|
32
|
+
let e = S.max;
|
|
33
|
+
return e === void 0 || C.value.length <= e ? 0 : C.value.length - e;
|
|
34
|
+
}), E = a(() => C.value.slice(C.value.length - T.value).map((e) => e.name).filter(Boolean).join(", ")), D = e(), O = a(() => S.unstyled ?? D.unstyled), k = a(() => t({
|
|
35
|
+
size: S.size,
|
|
36
|
+
tooltip: S.tooltip
|
|
37
|
+
})), A = a(() => O.value ? [S.ui?.root, S.class] : k.value.root({ class: [S.ui?.root, S.class] })), j = a(() => O.value ? S.ui?.trigger : k.value.trigger({ class: S.ui?.trigger })), M = a(() => O.value ? S.ui?.item : k.value.item({ class: S.ui?.item })), N = a(() => O.value ? S.ui?.overflow : k.value.overflow({ class: S.ui?.overflow }));
|
|
38
|
+
return (e, t) => (h(), c("div", { class: m(A.value) }, [T.value ? (h(), o(r, {
|
|
34
39
|
key: 0,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
text: E.value,
|
|
41
|
+
disabled: !S.tooltip || !E.value,
|
|
42
|
+
"side-offset": 10,
|
|
43
|
+
unstyled: O.value
|
|
44
|
+
}, {
|
|
45
|
+
trigger: y(() => [l("span", {
|
|
46
|
+
class: m(N.value),
|
|
47
|
+
tabindex: S.tooltip && E.value ? 0 : void 0
|
|
48
|
+
}, [_(e.$slots, "overflow", { count: T.value }, () => [u("+" + v(T.value), 1)])], 10, b)]),
|
|
49
|
+
_: 3
|
|
50
|
+
}, 8, [
|
|
51
|
+
"text",
|
|
52
|
+
"disabled",
|
|
53
|
+
"unstyled"
|
|
54
|
+
])) : s("", !0), (h(!0), c(i, null, g(w.value, (e, t) => (h(), o(r, {
|
|
55
|
+
key: t,
|
|
56
|
+
text: e.name,
|
|
57
|
+
disabled: !S.tooltip || !e.name,
|
|
58
|
+
"side-offset": 10,
|
|
59
|
+
unstyled: O.value
|
|
60
|
+
}, {
|
|
61
|
+
trigger: y(() => [l("span", {
|
|
62
|
+
class: m(j.value),
|
|
63
|
+
tabindex: S.tooltip && e.name ? 0 : void 0
|
|
64
|
+
}, [d(n, p({ ref_for: !0 }, e, {
|
|
65
|
+
size: S.size,
|
|
66
|
+
shape: S.shape,
|
|
67
|
+
unstyled: O.value,
|
|
68
|
+
class: M.value
|
|
69
|
+
}), null, 16, [
|
|
70
|
+
"size",
|
|
71
|
+
"shape",
|
|
72
|
+
"unstyled",
|
|
73
|
+
"class"
|
|
74
|
+
])], 10, x)]),
|
|
75
|
+
_: 2
|
|
76
|
+
}, 1032, [
|
|
77
|
+
"text",
|
|
78
|
+
"disabled",
|
|
79
|
+
"unstyled"
|
|
46
80
|
]))), 128))], 2));
|
|
47
81
|
}
|
|
48
82
|
});
|
|
49
83
|
//#endregion
|
|
50
|
-
export {
|
|
84
|
+
export { S as default };
|
|
@@ -15,6 +15,13 @@ export interface BreadcrumbProps {
|
|
|
15
15
|
* apps.
|
|
16
16
|
*/
|
|
17
17
|
label?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Show at most this many crumbs: the first, then a "…" menu holding the
|
|
20
|
+
* middle, then the last `max - 1`. Below 2 it is treated as 2.
|
|
21
|
+
*/
|
|
22
|
+
max?: number;
|
|
23
|
+
/** Accessible name for the "…" button — override for non-English apps. */
|
|
24
|
+
moreLabel?: string;
|
|
18
25
|
/** Skip built-in classes; you take over styling entirely. */
|
|
19
26
|
unstyled?: boolean;
|
|
20
27
|
class?: ClassValue;
|
|
@@ -28,13 +35,14 @@ export interface BreadcrumbProps {
|
|
|
28
35
|
separator?: string;
|
|
29
36
|
};
|
|
30
37
|
}
|
|
31
|
-
declare var
|
|
38
|
+
declare var __VLS_38: {};
|
|
32
39
|
type __VLS_Slots = {} & {
|
|
33
|
-
separator?: (props: typeof
|
|
40
|
+
separator?: (props: typeof __VLS_38) => any;
|
|
34
41
|
};
|
|
35
42
|
declare const __VLS_base: import("vue").DefineComponent<BreadcrumbProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BreadcrumbProps> & Readonly<{}>, {
|
|
36
43
|
label: string;
|
|
37
44
|
unstyled: boolean;
|
|
45
|
+
moreLabel: string;
|
|
38
46
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
39
47
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
40
48
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
2
|
import t from "./Icon.js";
|
|
3
3
|
import { breadcrumbTheme as n } from "../theme/breadcrumb.js";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import r from "./DropdownMenu.js";
|
|
5
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, normalizeClass as p, openBlock as m, renderList as h, renderSlot as g, resolveDynamicComponent as _, toDisplayString as v, unref as y, withCtx as b } from "vue";
|
|
6
|
+
import { ArrowRight01Icon as x, MoreHorizontalIcon as S } from "@hugeicons/core-free-icons";
|
|
7
|
+
import { Primitive as C } from "reka-ui";
|
|
7
8
|
//#region src/components/Breadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
8
|
-
var
|
|
9
|
+
var w = ["aria-label"], T = /*@__PURE__*/ f({
|
|
9
10
|
__name: "Breadcrumb",
|
|
10
11
|
props: {
|
|
11
12
|
items: {},
|
|
12
13
|
label: { default: "Breadcrumb" },
|
|
14
|
+
max: {},
|
|
15
|
+
moreLabel: { default: "Show hidden pages" },
|
|
13
16
|
unstyled: {
|
|
14
17
|
type: Boolean,
|
|
15
18
|
default: void 0
|
|
@@ -22,52 +25,81 @@ var S = /*@__PURE__*/ d({
|
|
|
22
25
|
] },
|
|
23
26
|
ui: {}
|
|
24
27
|
},
|
|
25
|
-
setup(
|
|
26
|
-
let
|
|
27
|
-
|
|
28
|
-
let
|
|
29
|
-
return
|
|
28
|
+
setup(f) {
|
|
29
|
+
let T = f, E = e(), D = a(() => T.unstyled ?? E.unstyled), O = a(() => T.items ?? []), k = a(() => O.value.length - 1), A = a(() => {
|
|
30
|
+
if (T.max === void 0) return 0;
|
|
31
|
+
let e = Math.max(T.max, 2);
|
|
32
|
+
return O.value.length > e ? O.value.length - e : 0;
|
|
33
|
+
}), j = a(() => {
|
|
34
|
+
let e = O.value.map((e, t) => ({
|
|
35
|
+
item: e,
|
|
36
|
+
index: t
|
|
37
|
+
}));
|
|
38
|
+
return A.value ? [
|
|
39
|
+
e[0],
|
|
40
|
+
null,
|
|
41
|
+
...e.slice(1 + A.value)
|
|
42
|
+
] : e;
|
|
43
|
+
}), M = a(() => O.value.slice(1, 1 + A.value).map((e) => ({
|
|
44
|
+
label: e.label,
|
|
45
|
+
icon: e.icon,
|
|
46
|
+
onSelect: e.onSelect ?? (e.href ? () => window.location.assign(e.href) : void 0)
|
|
47
|
+
}))), N = a(() => n());
|
|
48
|
+
function P(e) {
|
|
49
|
+
let t = T.ui?.[e];
|
|
50
|
+
return D.value ? t : N.value[e]({ class: t });
|
|
30
51
|
}
|
|
31
|
-
return (e, n) => (
|
|
52
|
+
return (e, n) => (m(), o(y(C), {
|
|
32
53
|
as: "nav",
|
|
33
|
-
"aria-label":
|
|
34
|
-
class:
|
|
54
|
+
"aria-label": T.label,
|
|
55
|
+
class: p(D.value ? [T.ui?.root, T.class] : N.value.root({ class: [T.ui?.root, T.class] }))
|
|
35
56
|
}, {
|
|
36
|
-
default:
|
|
37
|
-
key:
|
|
38
|
-
class:
|
|
39
|
-
}, [
|
|
40
|
-
key:
|
|
57
|
+
default: b(() => [l("ol", { class: p(P("list")) }, [(m(!0), c(i, null, h(j.value, (n) => (m(), c("li", {
|
|
58
|
+
key: n?.index ?? "more",
|
|
59
|
+
class: p(P("item"))
|
|
60
|
+
}, [n ? n.index === k.value ? (m(), c("span", {
|
|
61
|
+
key: 1,
|
|
41
62
|
"aria-current": "page",
|
|
42
|
-
class:
|
|
43
|
-
}, [n.icon ? (
|
|
63
|
+
class: p(P("current"))
|
|
64
|
+
}, [n.item.icon ? (m(), o(t, {
|
|
44
65
|
key: 0,
|
|
45
|
-
icon: n.icon
|
|
46
|
-
}, null, 8, ["icon"])) :
|
|
47
|
-
key:
|
|
48
|
-
href: n.href,
|
|
49
|
-
type: n.href ? void 0 : "button",
|
|
50
|
-
class:
|
|
51
|
-
onClick: (e) => n.onSelect?.()
|
|
66
|
+
icon: n.item.icon
|
|
67
|
+
}, null, 8, ["icon"])) : s("", !0), u(" " + v(n.item.label), 1)], 2)) : (m(), o(_(n.item.href ? "a" : "button"), {
|
|
68
|
+
key: 2,
|
|
69
|
+
href: n.item.href,
|
|
70
|
+
type: n.item.href ? void 0 : "button",
|
|
71
|
+
class: p(P("link")),
|
|
72
|
+
onClick: (e) => n.item.onSelect?.()
|
|
52
73
|
}, {
|
|
53
|
-
default:
|
|
74
|
+
default: b(() => [n.item.icon ? (m(), o(t, {
|
|
54
75
|
key: 0,
|
|
55
|
-
icon: n.icon
|
|
56
|
-
}, null, 8, ["icon"])) :
|
|
76
|
+
icon: n.item.icon
|
|
77
|
+
}, null, 8, ["icon"])) : s("", !0), u(" " + v(n.item.label), 1)]),
|
|
57
78
|
_: 2
|
|
58
79
|
}, 1032, [
|
|
59
80
|
"href",
|
|
60
81
|
"type",
|
|
61
82
|
"class",
|
|
62
83
|
"onClick"
|
|
63
|
-
]))
|
|
64
|
-
key:
|
|
84
|
+
])) : (m(), o(r, {
|
|
85
|
+
key: 0,
|
|
86
|
+
items: M.value,
|
|
87
|
+
unstyled: D.value
|
|
88
|
+
}, {
|
|
89
|
+
trigger: b(() => [l("button", {
|
|
90
|
+
type: "button",
|
|
91
|
+
"aria-label": T.moreLabel,
|
|
92
|
+
class: p(P("link"))
|
|
93
|
+
}, [d(t, { icon: y(S) }, null, 8, ["icon"])], 10, w)]),
|
|
94
|
+
_: 1
|
|
95
|
+
}, 8, ["items", "unstyled"])), n?.index === k.value ? s("", !0) : (m(), c("span", {
|
|
96
|
+
key: 3,
|
|
65
97
|
"aria-hidden": "true",
|
|
66
|
-
class:
|
|
67
|
-
}, [
|
|
98
|
+
class: p(P("separator"))
|
|
99
|
+
}, [g(e.$slots, "separator", {}, () => [d(t, { icon: y(x) }, null, 8, ["icon"])])], 2))], 2))), 128))], 2)]),
|
|
68
100
|
_: 3
|
|
69
101
|
}, 8, ["aria-label", "class"]));
|
|
70
102
|
}
|
|
71
103
|
});
|
|
72
104
|
//#endregion
|
|
73
|
-
export {
|
|
105
|
+
export { T as default };
|
|
@@ -15,6 +15,16 @@ export interface CommandPaletteProps {
|
|
|
15
15
|
hotkey?: string | null;
|
|
16
16
|
/** Close once a command is chosen. */
|
|
17
17
|
closeOnSelect?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Remember recently chosen commands under this `localStorage` key and list
|
|
20
|
+
* them first while the search is empty. Unset (the default) remembers
|
|
21
|
+
* nothing. Use a different key per palette.
|
|
22
|
+
*/
|
|
23
|
+
recentKey?: string;
|
|
24
|
+
/** How many recent commands to keep. */
|
|
25
|
+
recentLimit?: number;
|
|
26
|
+
/** Heading over the recent commands. Override for non-English apps. */
|
|
27
|
+
recentLabel?: string;
|
|
18
28
|
/** Hint row along the bottom. Set `false` to drop it. */
|
|
19
29
|
footer?: boolean;
|
|
20
30
|
/** Skip built-in classes; you take over styling entirely. */
|
|
@@ -53,6 +63,8 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
53
63
|
emptyText: string;
|
|
54
64
|
hotkey: string | null;
|
|
55
65
|
closeOnSelect: boolean;
|
|
66
|
+
recentLimit: number;
|
|
67
|
+
recentLabel: string;
|
|
56
68
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
57
69
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
58
70
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
2
|
import t from "./Icon.js";
|
|
3
|
-
import { commandHaystack as n,
|
|
4
|
-
import { commandPaletteTheme as
|
|
5
|
-
import
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { Search01Icon as
|
|
8
|
-
import { DialogContent as
|
|
3
|
+
import { commandHaystack as n, commandId as r, matchesHotkey as i, pushRecent as a, toCommandGroups as o } from "../composables/command-palette.js";
|
|
4
|
+
import { commandPaletteTheme as s } from "../theme/command-palette.js";
|
|
5
|
+
import c from "./Kbd.js";
|
|
6
|
+
import { Fragment as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as h, createVNode as g, defineComponent as _, mergeModels as v, normalizeClass as y, onBeforeUnmount as b, onMounted as x, openBlock as S, ref as C, renderList as w, renderSlot as T, toDisplayString as E, unref as D, useModel as O, watch as k, withCtx as A } from "vue";
|
|
7
|
+
import { Search01Icon as j } from "@hugeicons/core-free-icons";
|
|
8
|
+
import { DialogContent as M, DialogOverlay as ee, DialogPortal as te, DialogRoot as ne, DialogTitle as re, ListboxContent as ie, ListboxFilter as ae, ListboxGroup as oe, ListboxGroupLabel as se, ListboxItem as N, ListboxRoot as P, VisuallyHidden as F, useFilter as I } from "reka-ui";
|
|
9
9
|
//#region src/components/CommandPalette.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
10
|
+
var L = /*@__PURE__*/ _({
|
|
11
11
|
__name: "CommandPalette",
|
|
12
|
-
props: /*@__PURE__*/
|
|
12
|
+
props: /*@__PURE__*/ v({
|
|
13
13
|
items: {},
|
|
14
14
|
placeholder: { default: "Search commands…" },
|
|
15
15
|
emptyText: { default: "No matching commands." },
|
|
@@ -19,6 +19,9 @@ var B = /*@__PURE__*/ h({
|
|
|
19
19
|
type: Boolean,
|
|
20
20
|
default: !0
|
|
21
21
|
},
|
|
22
|
+
recentKey: {},
|
|
23
|
+
recentLimit: { default: 5 },
|
|
24
|
+
recentLabel: { default: "Recent" },
|
|
22
25
|
footer: {
|
|
23
26
|
type: Boolean,
|
|
24
27
|
default: !0
|
|
@@ -41,109 +44,143 @@ var B = /*@__PURE__*/ h({
|
|
|
41
44
|
},
|
|
42
45
|
openModifiers: {}
|
|
43
46
|
}),
|
|
44
|
-
emits: /*@__PURE__*/
|
|
45
|
-
setup(
|
|
46
|
-
let
|
|
47
|
-
|
|
48
|
-
e || (
|
|
47
|
+
emits: /*@__PURE__*/ v(["select"], ["update:open"]),
|
|
48
|
+
setup(_, { emit: v }) {
|
|
49
|
+
let L = _, R = v, z = O(_, "open"), B = C("");
|
|
50
|
+
k(z, (e) => {
|
|
51
|
+
e || (B.value = "");
|
|
49
52
|
});
|
|
50
|
-
let { contains:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
+
let { contains: V } = I({ sensitivity: "base" }), H = u(() => o(L.items)), U = C([]);
|
|
54
|
+
function W() {
|
|
55
|
+
if (L.recentKey) try {
|
|
56
|
+
let e = JSON.parse(window.localStorage.getItem(L.recentKey) ?? "[]");
|
|
57
|
+
U.value = Array.isArray(e) ? e.filter((e) => typeof e == "string") : [];
|
|
58
|
+
} catch {
|
|
59
|
+
U.value = [];
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function G(e, t) {
|
|
63
|
+
if (L.recentKey) {
|
|
64
|
+
U.value = a(U.value, r(e, t), L.recentLimit);
|
|
65
|
+
try {
|
|
66
|
+
window.localStorage.setItem(L.recentKey, JSON.stringify(U.value));
|
|
67
|
+
} catch {}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
x(W), k(() => L.recentKey, W);
|
|
71
|
+
let K = u(() => {
|
|
72
|
+
if (!L.recentKey || !U.value.length) return;
|
|
73
|
+
let e = /* @__PURE__ */ new Map();
|
|
74
|
+
for (let t of H.value) for (let n of t.items) e.set(r(n, t.label), {
|
|
75
|
+
item: n,
|
|
76
|
+
group: t.label
|
|
77
|
+
});
|
|
78
|
+
let t = U.value.slice(0, L.recentLimit).map((t) => e.get(t)).filter((e) => !!e && !e.item.disabled);
|
|
79
|
+
return t.length ? {
|
|
80
|
+
label: L.recentLabel,
|
|
81
|
+
items: t.map((e) => e.item),
|
|
82
|
+
sources: t.map((e) => e.group)
|
|
83
|
+
} : void 0;
|
|
84
|
+
}), q = u(() => {
|
|
85
|
+
let e = B.value.trim(), t = H.value.map((t) => ({
|
|
53
86
|
...t,
|
|
54
|
-
items: e ? t.items.filter((r) =>
|
|
87
|
+
items: e ? t.items.filter((r) => V(n(r, t.label), e)) : t.items
|
|
88
|
+
})).map((e) => ({
|
|
89
|
+
...e,
|
|
90
|
+
sources: e.items.map(() => e.label)
|
|
55
91
|
})).filter((e) => e.items.length > 0);
|
|
56
|
-
|
|
92
|
+
return !e && K.value ? [K.value, ...t] : t;
|
|
93
|
+
}), ce = u(() => q.value.length === 0);
|
|
57
94
|
function J(e, t) {
|
|
58
95
|
return `${e}:${t}`;
|
|
59
96
|
}
|
|
60
|
-
function
|
|
61
|
-
e.disabled || (
|
|
97
|
+
function le(e, t) {
|
|
98
|
+
e.disabled || (G(e, t), R("select", e), e.onSelect?.(), L.closeOnSelect && (z.value = !1));
|
|
62
99
|
}
|
|
63
|
-
function
|
|
64
|
-
|
|
100
|
+
function Y(e) {
|
|
101
|
+
L.hotkey && i(e, L.hotkey) && (e.preventDefault(), z.value = !z.value);
|
|
65
102
|
}
|
|
66
|
-
|
|
67
|
-
let
|
|
103
|
+
x(() => window.addEventListener("keydown", Y)), b(() => window.removeEventListener("keydown", Y));
|
|
104
|
+
let X = e(), Z = u(() => L.unstyled ?? X.unstyled), Q = u(() => s());
|
|
68
105
|
function $(e, t) {
|
|
69
|
-
let n =
|
|
106
|
+
let n = L.ui?.[e];
|
|
70
107
|
return Z.value ? [n, t].filter(Boolean).join(" ") : Q.value[e]({ class: [n, t] });
|
|
71
108
|
}
|
|
72
|
-
function
|
|
109
|
+
function ue(e) {
|
|
73
110
|
return e.split(" ").filter(Boolean);
|
|
74
111
|
}
|
|
75
|
-
return (e, n) => (
|
|
76
|
-
open:
|
|
77
|
-
"onUpdate:open": n[1] ||= (e) =>
|
|
112
|
+
return (e, n) => (S(), d(D(ne), {
|
|
113
|
+
open: z.value,
|
|
114
|
+
"onUpdate:open": n[1] ||= (e) => z.value = e
|
|
78
115
|
}, {
|
|
79
|
-
default:
|
|
80
|
-
default:
|
|
81
|
-
class:
|
|
82
|
-
"aria-label":
|
|
116
|
+
default: A(() => [g(D(te), null, {
|
|
117
|
+
default: A(() => [g(D(ee), { class: y($("overlay")) }, null, 8, ["class"]), g(D(M), {
|
|
118
|
+
class: y(Z.value ? [L.ui?.content, L.class] : Q.value.content({ class: [L.ui?.content, L.class] })),
|
|
119
|
+
"aria-label": L.label,
|
|
83
120
|
"aria-describedby": void 0
|
|
84
121
|
}, {
|
|
85
|
-
default:
|
|
86
|
-
|
|
87
|
-
default:
|
|
88
|
-
default:
|
|
122
|
+
default: A(() => [
|
|
123
|
+
g(D(F), null, {
|
|
124
|
+
default: A(() => [g(D(re), null, {
|
|
125
|
+
default: A(() => [h(E(L.label), 1)]),
|
|
89
126
|
_: 1
|
|
90
127
|
})]),
|
|
91
128
|
_: 1
|
|
92
129
|
}),
|
|
93
|
-
|
|
130
|
+
g(D(P), {
|
|
94
131
|
"highlight-on-hover": "",
|
|
95
|
-
class:
|
|
132
|
+
class: y($("list"))
|
|
96
133
|
}, {
|
|
97
|
-
default:
|
|
98
|
-
modelValue:
|
|
99
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
134
|
+
default: A(() => [m("div", { class: y($("header")) }, [m("span", { class: y($("icon")) }, [g(t, { icon: D(j) }, null, 8, ["icon"])], 2), g(D(ae), {
|
|
135
|
+
modelValue: B.value,
|
|
136
|
+
"onUpdate:modelValue": n[0] ||= (e) => B.value = e,
|
|
100
137
|
"auto-focus": "",
|
|
101
|
-
placeholder:
|
|
102
|
-
class:
|
|
138
|
+
placeholder: L.placeholder,
|
|
139
|
+
class: y($("input"))
|
|
103
140
|
}, null, 8, [
|
|
104
141
|
"modelValue",
|
|
105
142
|
"placeholder",
|
|
106
143
|
"class"
|
|
107
|
-
])], 2),
|
|
108
|
-
default:
|
|
144
|
+
])], 2), g(D(ie), { class: y($("viewport")) }, {
|
|
145
|
+
default: A(() => [ce.value ? (S(), p("p", {
|
|
109
146
|
key: 0,
|
|
110
|
-
class:
|
|
111
|
-
}, [
|
|
147
|
+
class: y($("empty"))
|
|
148
|
+
}, [T(e.$slots, "empty", { query: B.value }, () => [h(E(L.emptyText), 1)])], 2)) : f("", !0), (S(!0), p(l, null, w(q.value, (n, r) => (S(), d(D(oe), {
|
|
112
149
|
key: n.label || r,
|
|
113
|
-
class:
|
|
150
|
+
class: y($("group"))
|
|
114
151
|
}, {
|
|
115
|
-
default:
|
|
152
|
+
default: A(() => [n.label ? (S(), d(D(se), {
|
|
116
153
|
key: 0,
|
|
117
|
-
class:
|
|
154
|
+
class: y($("groupLabel"))
|
|
118
155
|
}, {
|
|
119
|
-
default:
|
|
156
|
+
default: A(() => [h(E(n.label), 1)]),
|
|
120
157
|
_: 2
|
|
121
|
-
}, 1032, ["class"])) :
|
|
122
|
-
key: J(r,
|
|
123
|
-
value: J(r,
|
|
124
|
-
disabled:
|
|
125
|
-
"aria-disabled":
|
|
126
|
-
as:
|
|
127
|
-
href:
|
|
128
|
-
class:
|
|
129
|
-
onSelect: (e) =>
|
|
158
|
+
}, 1032, ["class"])) : f("", !0), (S(!0), p(l, null, w(n.items, (i, a) => (S(), d(D(N), {
|
|
159
|
+
key: J(r, a),
|
|
160
|
+
value: J(r, a),
|
|
161
|
+
disabled: i.disabled,
|
|
162
|
+
"aria-disabled": i.disabled || void 0,
|
|
163
|
+
as: i.href ? "a" : "div",
|
|
164
|
+
href: i.href,
|
|
165
|
+
class: y($("item")),
|
|
166
|
+
onSelect: (e) => le(i, n.sources[a] ?? n.label)
|
|
130
167
|
}, {
|
|
131
|
-
default:
|
|
132
|
-
|
|
168
|
+
default: A(() => [T(e.$slots, "item", { item: i }, () => [
|
|
169
|
+
i.icon ? (S(), p("span", {
|
|
133
170
|
key: 0,
|
|
134
|
-
class:
|
|
135
|
-
}, [
|
|
136
|
-
|
|
137
|
-
|
|
171
|
+
class: y($("itemIcon"))
|
|
172
|
+
}, [g(t, { icon: i.icon }, null, 8, ["icon"])], 2)) : f("", !0),
|
|
173
|
+
m("span", { class: y($("itemLabel")) }, E(i.label), 3),
|
|
174
|
+
i.shortcut ? (S(), d(c, {
|
|
138
175
|
key: 1,
|
|
139
|
-
keys:
|
|
140
|
-
class:
|
|
141
|
-
ui: { key:
|
|
176
|
+
keys: ue(i.shortcut),
|
|
177
|
+
class: y($("shortcut")),
|
|
178
|
+
ui: { key: L.ui?.key }
|
|
142
179
|
}, null, 8, [
|
|
143
180
|
"keys",
|
|
144
181
|
"class",
|
|
145
182
|
"ui"
|
|
146
|
-
])) :
|
|
183
|
+
])) : f("", !0)
|
|
147
184
|
])]),
|
|
148
185
|
_: 2
|
|
149
186
|
}, 1032, [
|
|
@@ -161,23 +198,23 @@ var B = /*@__PURE__*/ h({
|
|
|
161
198
|
}, 8, ["class"])]),
|
|
162
199
|
_: 3
|
|
163
200
|
}, 8, ["class"]),
|
|
164
|
-
|
|
201
|
+
L.footer ? (S(), p("div", {
|
|
165
202
|
key: 0,
|
|
166
|
-
class:
|
|
167
|
-
}, [
|
|
168
|
-
|
|
203
|
+
class: y($("footer"))
|
|
204
|
+
}, [T(e.$slots, "footer", {}, () => [
|
|
205
|
+
m("span", null, [g(c, {
|
|
169
206
|
keys: ["up", "down"],
|
|
170
|
-
ui: { key:
|
|
171
|
-
}, null, 8, ["ui"]), n[2] ||=
|
|
172
|
-
|
|
207
|
+
ui: { key: L.ui?.key }
|
|
208
|
+
}, null, 8, ["ui"]), n[2] ||= h(" to navigate", -1)]),
|
|
209
|
+
m("span", null, [g(c, {
|
|
173
210
|
keys: "enter",
|
|
174
|
-
ui: { key:
|
|
175
|
-
}, null, 8, ["ui"]), n[3] ||=
|
|
176
|
-
|
|
211
|
+
ui: { key: L.ui?.key }
|
|
212
|
+
}, null, 8, ["ui"]), n[3] ||= h(" to select", -1)]),
|
|
213
|
+
m("span", null, [g(c, {
|
|
177
214
|
keys: "escape",
|
|
178
|
-
ui: { key:
|
|
179
|
-
}, null, 8, ["ui"]), n[4] ||=
|
|
180
|
-
])], 2)) :
|
|
215
|
+
ui: { key: L.ui?.key }
|
|
216
|
+
}, null, 8, ["ui"]), n[4] ||= h(" to close", -1)])
|
|
217
|
+
])], 2)) : f("", !0)
|
|
181
218
|
]),
|
|
182
219
|
_: 3
|
|
183
220
|
}, 8, ["class", "aria-label"])]),
|
|
@@ -188,4 +225,4 @@ var B = /*@__PURE__*/ h({
|
|
|
188
225
|
}
|
|
189
226
|
});
|
|
190
227
|
//#endregion
|
|
191
|
-
export {
|
|
228
|
+
export { L as default };
|
|
@@ -48,10 +48,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {
|
|
|
48
48
|
}>, {
|
|
49
49
|
unstyled: boolean;
|
|
50
50
|
side: "top" | "right" | "bottom" | "left";
|
|
51
|
+
arrow: boolean;
|
|
51
52
|
sideOffset: number;
|
|
52
53
|
confirmLabel: string;
|
|
53
54
|
cancelLabel: string;
|
|
54
|
-
arrow: boolean;
|
|
55
55
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
56
56
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
57
57
|
declare const _default: typeof __VLS_export;
|