iryx-ui 0.25.0 → 0.27.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/AppShell.vue.d.ts +12 -11
- package/dist/components/AppShell.vue_vue_type_script_setup_true_lang.js +76 -61
- package/dist/components/Breadcrumb.vue_vue_type_script_setup_true_lang.js +2 -1
- 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/DateRangePicker.vue.d.ts +14 -2
- package/dist/components/DateRangePicker.vue_vue_type_script_setup_true_lang.js +111 -70
- package/dist/components/DropdownMenu.vue_vue_type_script_setup_true_lang.js +19 -18
- package/dist/components/DropdownMenuItems.vue_vue_type_script_setup_true_lang.js +12 -8
- package/dist/components/Sidebar.vue.d.ts +11 -5
- package/dist/components/Sidebar.vue_vue_type_script_setup_true_lang.js +172 -92
- 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/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/dropdown-menu.d.ts +3 -1
- package/dist/composables/scroll-fade.d.ts +1 -1
- package/dist/composables/sidebar.d.ts +3 -0
- package/dist/composables/sidebar.js +7 -6
- package/dist/index.js +166 -166
- package/dist/theme/app-shell.d.ts +27 -6
- package/dist/theme/app-shell.js +26 -9
- package/dist/theme/avatar.js +1 -1
- package/dist/theme/date-picker.d.ts +9 -0
- package/dist/theme/date-picker.js +3 -0
- package/dist/theme/presets.d.ts +1 -0
- package/dist/theme/presets.js +1 -0
- package/dist/theme/sidebar.d.ts +24 -0
- package/dist/theme/sidebar.js +9 -2
- package/dist/theme/tabs.d.ts +18 -3
- package/dist/theme/tabs.js +20 -12
- package/package.json +1 -1
- package/theme.css +4 -0
|
@@ -25,6 +25,7 @@ export interface AppShellProps {
|
|
|
25
25
|
header?: string;
|
|
26
26
|
body?: string;
|
|
27
27
|
sidebar?: string;
|
|
28
|
+
panel?: string;
|
|
28
29
|
headerRow?: string;
|
|
29
30
|
headerContent?: string;
|
|
30
31
|
navTrigger?: string;
|
|
@@ -34,24 +35,24 @@ export interface AppShellProps {
|
|
|
34
35
|
footer?: string;
|
|
35
36
|
};
|
|
36
37
|
}
|
|
37
|
-
declare var
|
|
38
|
-
navOpen: boolean;
|
|
39
|
-
toggleNav: () => boolean;
|
|
40
|
-
}, __VLS_21: {
|
|
38
|
+
declare var __VLS_20: {
|
|
41
39
|
inDrawer: boolean;
|
|
42
|
-
},
|
|
40
|
+
}, __VLS_28: {
|
|
43
41
|
inDrawer: boolean;
|
|
44
|
-
},
|
|
42
|
+
}, __VLS_35: {
|
|
43
|
+
navOpen: boolean;
|
|
44
|
+
toggleNav: () => boolean;
|
|
45
|
+
}, __VLS_37: {}, __VLS_39: {};
|
|
45
46
|
type __VLS_Slots = {} & {
|
|
46
|
-
|
|
47
|
+
sidebar?: (props: typeof __VLS_20) => any;
|
|
47
48
|
} & {
|
|
48
|
-
sidebar?: (props: typeof
|
|
49
|
+
sidebar?: (props: typeof __VLS_28) => any;
|
|
49
50
|
} & {
|
|
50
|
-
|
|
51
|
+
header?: (props: typeof __VLS_35) => any;
|
|
51
52
|
} & {
|
|
52
|
-
default?: (props: typeof
|
|
53
|
+
default?: (props: typeof __VLS_37) => any;
|
|
53
54
|
} & {
|
|
54
|
-
footer?: (props: typeof
|
|
55
|
+
footer?: (props: typeof __VLS_39) => any;
|
|
55
56
|
};
|
|
56
57
|
declare const __VLS_base: import("vue").DefineComponent<AppShellProps, {
|
|
57
58
|
/** Open or close the mobile navigation drawer from the outside. */
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { useIryxUiConfig as e } from "../config.js";
|
|
2
2
|
import t from "./Icon.js";
|
|
3
3
|
import { useElementSize as n } from "../composables/element-size.js";
|
|
4
|
-
import {
|
|
5
|
-
import i from "
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { sidebarPlacementKey as r } from "../composables/sidebar.js";
|
|
5
|
+
import { appShellTheme as i } from "../theme/app-shell.js";
|
|
6
|
+
import a from "./Drawer.js";
|
|
7
|
+
import { computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createVNode as d, defineComponent as f, normalizeClass as p, normalizeStyle as m, openBlock as h, provide as g, ref as _, renderSlot as v, unref as y, useSlots as b, withCtx as x } from "vue";
|
|
8
|
+
import { Menu01Icon as S } from "@hugeicons/core-free-icons";
|
|
9
|
+
import { Primitive as C } from "reka-ui";
|
|
9
10
|
//#region src/components/AppShell.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
11
|
+
var w = ["aria-label", "aria-expanded"], T = /*@__PURE__*/ f({
|
|
11
12
|
__name: "AppShell",
|
|
12
13
|
props: {
|
|
13
14
|
as: { default: "div" },
|
|
@@ -30,68 +31,82 @@ var S = ["aria-label", "aria-expanded"], C = /*@__PURE__*/ d({
|
|
|
30
31
|
] },
|
|
31
32
|
ui: {}
|
|
32
33
|
},
|
|
33
|
-
setup(
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
setup(T, { expose: E }) {
|
|
35
|
+
let D = T, O = b(), k = e(), A = o(() => D.unstyled ?? k.unstyled), j = _(), { height: M } = n(j), N = o(() => D.scroll === "page" && O.header ? { "--iryx-shell-header-height": `${M.value}px` } : void 0), P = _(!1), F = f({
|
|
36
|
+
props: { placement: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: !0
|
|
39
|
+
} },
|
|
40
|
+
setup(e, { slots: t }) {
|
|
41
|
+
return g(r, e.placement), () => t.default?.();
|
|
42
|
+
}
|
|
43
|
+
}), I = o(() => D.mobileNav && !!O.sidebar), L = o(() => i({
|
|
44
|
+
scroll: D.scroll,
|
|
45
|
+
sidebarPosition: D.sidebarPosition,
|
|
46
|
+
mobileNav: I.value,
|
|
47
|
+
hasSidebar: !!O.sidebar
|
|
38
48
|
}));
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
let t =
|
|
42
|
-
return
|
|
49
|
+
E({ navOpen: P });
|
|
50
|
+
function R(e) {
|
|
51
|
+
let t = D.ui?.[e];
|
|
52
|
+
return A.value ? t : L.value[e]({ class: t });
|
|
43
53
|
}
|
|
44
|
-
return (e, n) => (
|
|
45
|
-
as:
|
|
46
|
-
style:
|
|
47
|
-
class:
|
|
54
|
+
return (e, n) => (h(), s(y(C), {
|
|
55
|
+
as: D.as,
|
|
56
|
+
style: m(N.value),
|
|
57
|
+
class: p(A.value ? [D.ui?.root, D.class] : L.value.root({ class: [D.ui?.root, D.class] }))
|
|
48
58
|
}, {
|
|
49
|
-
default:
|
|
50
|
-
|
|
59
|
+
default: x(() => [I.value ? (h(), s(a, {
|
|
60
|
+
key: 0,
|
|
61
|
+
open: P.value,
|
|
62
|
+
"onUpdate:open": n[0] ||= (e) => P.value = e,
|
|
63
|
+
side: "left",
|
|
64
|
+
size: "sm",
|
|
65
|
+
class: p(R("navDrawer")),
|
|
66
|
+
ui: {
|
|
67
|
+
body: R("navDrawerBody"),
|
|
68
|
+
overlay: "md:hidden",
|
|
69
|
+
content: "md:hidden"
|
|
70
|
+
}
|
|
71
|
+
}, {
|
|
72
|
+
default: x(() => [d(y(F), { placement: "drawer" }, {
|
|
73
|
+
default: x(() => [v(e.$slots, "sidebar", { inDrawer: !0 })]),
|
|
74
|
+
_: 3
|
|
75
|
+
})]),
|
|
76
|
+
_: 3
|
|
77
|
+
}, 8, [
|
|
78
|
+
"open",
|
|
79
|
+
"class",
|
|
80
|
+
"ui"
|
|
81
|
+
])) : c("", !0), u("div", { class: p(R("body")) }, [e.$slots.sidebar ? (h(), l("div", {
|
|
82
|
+
key: 0,
|
|
83
|
+
class: p(R("sidebar"))
|
|
84
|
+
}, [d(y(F), { placement: "column" }, {
|
|
85
|
+
default: x(() => [v(e.$slots, "sidebar", { inDrawer: !1 })]),
|
|
86
|
+
_: 3
|
|
87
|
+
})], 2)) : c("", !0), u("div", { class: p(R("panel")) }, [
|
|
88
|
+
e.$slots.header ? (h(), l("div", {
|
|
51
89
|
key: 0,
|
|
52
90
|
ref_key: "header",
|
|
53
|
-
ref:
|
|
54
|
-
class:
|
|
55
|
-
}, [
|
|
91
|
+
ref: j,
|
|
92
|
+
class: p(R("header"))
|
|
93
|
+
}, [u("div", { class: p(R("headerRow")) }, [I.value ? (h(), l("button", {
|
|
56
94
|
key: 0,
|
|
57
95
|
type: "button",
|
|
58
|
-
"aria-label":
|
|
59
|
-
"aria-expanded":
|
|
60
|
-
class:
|
|
61
|
-
onClick: n[
|
|
62
|
-
}, [
|
|
63
|
-
navOpen:
|
|
64
|
-
toggleNav: () =>
|
|
65
|
-
})], 2)], 2)], 2)) :
|
|
66
|
-
|
|
96
|
+
"aria-label": D.navLabel,
|
|
97
|
+
"aria-expanded": P.value,
|
|
98
|
+
class: p(R("navTrigger")),
|
|
99
|
+
onClick: n[1] ||= (e) => P.value = !0
|
|
100
|
+
}, [d(t, { icon: y(S) }, null, 8, ["icon"])], 10, w)) : c("", !0), u("div", { class: p(R("headerContent")) }, [v(e.$slots, "header", {
|
|
101
|
+
navOpen: P.value,
|
|
102
|
+
toggleNav: () => P.value = !P.value
|
|
103
|
+
})], 2)], 2)], 2)) : c("", !0),
|
|
104
|
+
u("main", { class: p(R("main")) }, [v(e.$slots, "default")], 2),
|
|
105
|
+
e.$slots.footer ? (h(), l("div", {
|
|
67
106
|
key: 1,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
size: "sm",
|
|
72
|
-
class: f(P("navDrawer")),
|
|
73
|
-
ui: {
|
|
74
|
-
body: P("navDrawerBody"),
|
|
75
|
-
overlay: "md:hidden",
|
|
76
|
-
content: "md:hidden"
|
|
77
|
-
}
|
|
78
|
-
}, {
|
|
79
|
-
default: y(() => [g(e.$slots, "sidebar", { inDrawer: !0 })]),
|
|
80
|
-
_: 3
|
|
81
|
-
}, 8, [
|
|
82
|
-
"open",
|
|
83
|
-
"class",
|
|
84
|
-
"ui"
|
|
85
|
-
])) : s("", !0),
|
|
86
|
-
l("div", { class: f(P("body")) }, [e.$slots.sidebar ? (m(), c("div", {
|
|
87
|
-
key: 0,
|
|
88
|
-
class: f(P("sidebar"))
|
|
89
|
-
}, [g(e.$slots, "sidebar", { inDrawer: !1 })], 2)) : s("", !0), l("main", { class: f(P("main")) }, [g(e.$slots, "default")], 2)], 2),
|
|
90
|
-
e.$slots.footer ? (m(), c("div", {
|
|
91
|
-
key: 2,
|
|
92
|
-
class: f(P("footer"))
|
|
93
|
-
}, [g(e.$slots, "footer")], 2)) : s("", !0)
|
|
94
|
-
]),
|
|
107
|
+
class: p(R("footer"))
|
|
108
|
+
}, [v(e.$slots, "footer")], 2)) : c("", !0)
|
|
109
|
+
], 2)], 2)]),
|
|
95
110
|
_: 3
|
|
96
111
|
}, 8, [
|
|
97
112
|
"as",
|
|
@@ -101,4 +116,4 @@ var S = ["aria-label", "aria-expanded"], C = /*@__PURE__*/ d({
|
|
|
101
116
|
}
|
|
102
117
|
});
|
|
103
118
|
//#endregion
|
|
104
|
-
export {
|
|
119
|
+
export { T as default };
|
|
@@ -43,7 +43,8 @@ var w = ["aria-label"], T = /*@__PURE__*/ f({
|
|
|
43
43
|
}), M = a(() => O.value.slice(1, 1 + A.value).map((e) => ({
|
|
44
44
|
label: e.label,
|
|
45
45
|
icon: e.icon,
|
|
46
|
-
|
|
46
|
+
href: e.href,
|
|
47
|
+
onSelect: e.onSelect
|
|
47
48
|
}))), N = a(() => n());
|
|
48
49
|
function P(e) {
|
|
49
50
|
let t = T.ui?.[e];
|
|
@@ -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 };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ClassValue } from '../class-value';
|
|
2
|
+
import type { DateRangePreset } from '../composables/date';
|
|
2
3
|
/** Both ends are ISO `YYYY-MM-DD` strings, and either may be absent. */
|
|
3
4
|
export interface DateRange {
|
|
4
5
|
start: string | null;
|
|
@@ -21,8 +22,18 @@ export interface DateRangePickerProps {
|
|
|
21
22
|
format?: Intl.DateTimeFormatOptions;
|
|
22
23
|
/** 0 is Sunday. Defaults to the locale's own convention. */
|
|
23
24
|
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
24
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Months shown side by side. Two makes picking a span across a boundary
|
|
27
|
+
* sane. Narrow screens always get one.
|
|
28
|
+
*/
|
|
25
29
|
months?: number;
|
|
30
|
+
/**
|
|
31
|
+
* Shortcuts beside the calendar — "Last 7 days", "This month". Picking one
|
|
32
|
+
* fills the range and closes. `commonDateRangePresets()` builds the usual set.
|
|
33
|
+
*/
|
|
34
|
+
presets?: DateRangePreset[];
|
|
35
|
+
/** Accessible name for the preset list — override for non-English apps. */
|
|
36
|
+
presetsLabel?: string;
|
|
26
37
|
/** Offer a "clear" action in the footer. */
|
|
27
38
|
clearable?: boolean;
|
|
28
39
|
/** Separator between the two dates on the trigger. */
|
|
@@ -36,7 +47,7 @@ export interface DateRangePickerProps {
|
|
|
36
47
|
/** Applied to the trigger, which is the element carrying the field chrome. */
|
|
37
48
|
class?: ClassValue;
|
|
38
49
|
/** Override classes per element, e.g. `{ content: 'p-4' }`. */
|
|
39
|
-
ui?: Partial<Record<'trigger' | 'placeholder' | 'content' | 'header' | 'heading' | 'nav' | 'months' | 'grid' | 'headCell' | 'cell' | 'cellTrigger' | 'footer' | 'action', string>>;
|
|
50
|
+
ui?: Partial<Record<'trigger' | 'placeholder' | 'content' | 'panel' | 'presets' | 'preset' | 'header' | 'heading' | 'nav' | 'months' | 'grid' | 'headCell' | 'cell' | 'cellTrigger' | 'footer' | 'action', string>>;
|
|
40
51
|
}
|
|
41
52
|
type __VLS_Props = DateRangePickerProps;
|
|
42
53
|
type __VLS_ModelProps = {
|
|
@@ -56,6 +67,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {},
|
|
|
56
67
|
nextLabel: string;
|
|
57
68
|
invalid: boolean;
|
|
58
69
|
clearLabel: string;
|
|
70
|
+
presetsLabel: string;
|
|
59
71
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
60
72
|
declare const _default: typeof __VLS_export;
|
|
61
73
|
export default _default;
|