@kiva/kv-components 9.0.3 → 9.1.1
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/utils/headerMenuTiming.d.ts +6 -0
- package/dist/utils/headerMenuTiming.js +9 -0
- package/dist/utils/useHeaderMenuGroup.d.ts +27 -0
- package/dist/utils/useHeaderMenuGroup.js +68 -0
- package/dist/utils/useHeaderMenuPlacement.d.ts +6 -0
- package/dist/utils/useHeaderMenuPlacement.js +30 -0
- package/dist/utils/useHeaderMenuState.d.ts +10 -0
- package/dist/utils/useHeaderMenuState.js +21 -0
- package/dist/utils/useHoverIntent.d.ts +5 -0
- package/dist/utils/useHoverIntent.js +17 -0
- package/dist/utils/useOutsidePointerDown.d.ts +2 -0
- package/dist/utils/useOutsidePointerDown.js +19 -0
- package/dist/utils/usePointerType.d.ts +5 -0
- package/dist/utils/usePointerType.js +19 -0
- package/dist/vue/KvWwwHeader/LendMenu/KvLendMenu2.js +62 -61
- package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup.css +1 -0
- package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup.js +35 -0
- package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup.vue.d.ts +25 -0
- package/dist/vue/KvWwwHeaderBasic/HeaderMenuGroup2.js +37 -0
- package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic.css +1 -1
- package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic.js +29 -75
- package/dist/vue/KvWwwHeaderBasic/KvWwwHeaderBasic2.js +37 -92
- package/dist/vue/KvWwwHeaderBasic/LinkBar.css +1 -1
- package/dist/vue/KvWwwHeaderBasic/LinkBar.js +206 -132
- package/dist/vue/KvWwwHeaderBasic/LinkBar.vue.d.ts +226 -185
- package/dist/vue/KvWwwHeaderBasic/LinkBar2.js +69 -96
- package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/MobileLendMenu.vue.d.ts +9 -1
- package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/SearchPanel.js +12 -11
- package/dist/vue/KvWwwHeaderBasic/MobileLendMenu/SearchPanel.vue.d.ts +9 -1
- package/dist/vue/KvWwwHeaderBasic/SearchBar.js +12 -12
- package/dist/vue/KvWwwHeaderBasic/SearchBar.vue.d.ts +9 -1
- package/dist/vue/KvWwwHeaderBasic/SearchBar2.js +49 -43
- package/package.json +3 -4
- package/dist/utils/useHeaderBasicMenuState.d.ts +0 -3197
- package/dist/utils/useHeaderBasicMenuState.js +0 -30
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { HeaderMenuState } from '../../../../../../../../../src/utils/useHeaderMenuState';
|
|
3
|
+
import { HeaderMenuPlacement } from '../../../../../../../../../src/utils/useHeaderMenuPlacement';
|
|
4
|
+
export interface TriggerAttrs {
|
|
5
|
+
'aria-expanded': boolean;
|
|
6
|
+
'aria-controls': string;
|
|
7
|
+
onClick(event: Event): void;
|
|
8
|
+
}
|
|
9
|
+
export interface HeaderMenuGroupOptions {
|
|
10
|
+
panelId: Ref<string>;
|
|
11
|
+
rootRef: Ref<HTMLElement | null>;
|
|
12
|
+
menus: HeaderMenuState;
|
|
13
|
+
placement?: HeaderMenuPlacement | null;
|
|
14
|
+
}
|
|
15
|
+
export declare function useHeaderMenuGroup({ panelId, rootRef, menus, placement, }: HeaderMenuGroupOptions): {
|
|
16
|
+
approached: Ref<boolean, boolean>;
|
|
17
|
+
toggled: import('vue').ComputedRef<boolean>;
|
|
18
|
+
expanded: import('vue').ComputedRef<any>;
|
|
19
|
+
trigger: import('vue').ComputedRef<TriggerAttrs>;
|
|
20
|
+
toggle: (event?: Event) => void;
|
|
21
|
+
close: () => void;
|
|
22
|
+
onPointerEnter: (event: PointerEvent) => void;
|
|
23
|
+
onPointerLeave: () => void;
|
|
24
|
+
onFocusIn: () => void;
|
|
25
|
+
onFocusOut: (event: FocusEvent) => void;
|
|
26
|
+
onKeydown: (event: KeyboardEvent) => void;
|
|
27
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ref as k, computed as s, onMounted as m, onBeforeUnmount as x } from "vue";
|
|
2
|
+
import { MENU_OPEN_DELAY_MS as A } from "./headerMenuTiming.js";
|
|
3
|
+
import { useHoverIntent as D } from "./useHoverIntent.js";
|
|
4
|
+
import { useOutsidePointerDown as H } from "./useOutsidePointerDown.js";
|
|
5
|
+
function w({
|
|
6
|
+
panelId: l,
|
|
7
|
+
rootRef: a,
|
|
8
|
+
menus: t,
|
|
9
|
+
placement: c
|
|
10
|
+
}) {
|
|
11
|
+
const n = k(!1), f = D(A);
|
|
12
|
+
let i;
|
|
13
|
+
const o = s(() => t.toggledId.value === l.value), v = s(() => o.value || f.settled.value);
|
|
14
|
+
function d(e) {
|
|
15
|
+
if ((e == null ? void 0 : e.currentTarget) instanceof HTMLAnchorElement && e.currentTarget.hasAttribute("href")) {
|
|
16
|
+
if (t.pointerType.value !== "touch") return;
|
|
17
|
+
e.preventDefault();
|
|
18
|
+
}
|
|
19
|
+
n.value = !0, t.toggle(l.value);
|
|
20
|
+
}
|
|
21
|
+
function u() {
|
|
22
|
+
o.value && t.close();
|
|
23
|
+
}
|
|
24
|
+
H(a, o, u);
|
|
25
|
+
function p(e) {
|
|
26
|
+
n.value = !0, e.pointerType !== "touch" && (o.value || t.close(), f.enter());
|
|
27
|
+
}
|
|
28
|
+
function h() {
|
|
29
|
+
f.leave();
|
|
30
|
+
}
|
|
31
|
+
function E() {
|
|
32
|
+
n.value = !0;
|
|
33
|
+
}
|
|
34
|
+
function T(e) {
|
|
35
|
+
var r;
|
|
36
|
+
e.relatedTarget instanceof Element && ((r = a.value) != null && r.contains(e.relatedTarget) || u());
|
|
37
|
+
}
|
|
38
|
+
function y(e) {
|
|
39
|
+
var r, g;
|
|
40
|
+
e.key !== "Escape" || !o.value || (u(), (g = (r = a.value) == null ? void 0 : r.querySelector("[aria-expanded]")) == null || g.focus());
|
|
41
|
+
}
|
|
42
|
+
const M = s(() => ({
|
|
43
|
+
"aria-expanded": v.value,
|
|
44
|
+
"aria-controls": l.value,
|
|
45
|
+
onClick: d
|
|
46
|
+
}));
|
|
47
|
+
return m(() => {
|
|
48
|
+
const e = a.value;
|
|
49
|
+
e && (i = c == null ? void 0 : c.registerGroup(e), e.matches(":hover") && (n.value = !0));
|
|
50
|
+
}), x(() => {
|
|
51
|
+
i == null || i(), u();
|
|
52
|
+
}), {
|
|
53
|
+
approached: n,
|
|
54
|
+
toggled: o,
|
|
55
|
+
expanded: v,
|
|
56
|
+
trigger: M,
|
|
57
|
+
toggle: d,
|
|
58
|
+
close: u,
|
|
59
|
+
onPointerEnter: p,
|
|
60
|
+
onPointerLeave: h,
|
|
61
|
+
onFocusIn: E,
|
|
62
|
+
onFocusOut: T,
|
|
63
|
+
onKeydown: y
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
w as useHeaderMenuGroup
|
|
68
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InjectionKey, Ref } from 'vue';
|
|
2
|
+
export interface HeaderMenuPlacement {
|
|
3
|
+
registerGroup(el: HTMLElement): () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare const HEADER_MENU_PLACEMENT: InjectionKey<HeaderMenuPlacement>;
|
|
6
|
+
export declare function useHeaderMenuPlacement(rootRef: Ref<HTMLElement | null>): HeaderMenuPlacement;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { onMounted as g, onBeforeUnmount as d } from "vue";
|
|
2
|
+
const p = Symbol("headerMenuPlacement");
|
|
3
|
+
function y(c) {
|
|
4
|
+
const o = /* @__PURE__ */ new Set();
|
|
5
|
+
let e = null;
|
|
6
|
+
function a() {
|
|
7
|
+
const t = c.value, i = t == null ? void 0 : t.offsetParent;
|
|
8
|
+
if (!t || !(i instanceof HTMLElement)) return;
|
|
9
|
+
const n = i.getBoundingClientRect(), u = Array.from(o, (r) => [r, r.getBoundingClientRect()]);
|
|
10
|
+
t.style.setProperty("--nav-height", `${n.height}px`), u.forEach(([r, s]) => {
|
|
11
|
+
const f = s.left + s.width / 2;
|
|
12
|
+
r.style.setProperty("--trigger-gap-left", `${f - n.left}px`), r.style.setProperty("--trigger-gap-right", `${n.right - f}px`), r.style.setProperty("--trigger-width", `${s.width}px`);
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function l(t) {
|
|
16
|
+
return o.add(t), e == null || e.observe(t), () => {
|
|
17
|
+
o.delete(t), e == null || e.unobserve(t);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return g(() => {
|
|
21
|
+
const t = c.value, i = t == null ? void 0 : t.offsetParent;
|
|
22
|
+
typeof ResizeObserver < "u" && t && i instanceof HTMLElement && (e = new ResizeObserver(a), e.observe(i), Array.from(t.children).forEach((n) => e == null ? void 0 : e.observe(n)), o.forEach((n) => e == null ? void 0 : e.observe(n))), a();
|
|
23
|
+
}), d(() => {
|
|
24
|
+
e == null || e.disconnect(), e = null;
|
|
25
|
+
}), { registerGroup: l };
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
p as HEADER_MENU_PLACEMENT,
|
|
29
|
+
y as useHeaderMenuPlacement
|
|
30
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InjectionKey, Ref } from 'vue';
|
|
2
|
+
import { PointerType } from '../../../../../../../../../src/utils/usePointerType';
|
|
3
|
+
export interface HeaderMenuState {
|
|
4
|
+
toggledId: Readonly<Ref<string | null>>;
|
|
5
|
+
pointerType: Readonly<Ref<PointerType | null>>;
|
|
6
|
+
toggle(id: string): void;
|
|
7
|
+
close(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare const HEADER_MENU_STATE: InjectionKey<HeaderMenuState>;
|
|
10
|
+
export declare function useHeaderMenuState(pointerType: Readonly<Ref<PointerType | null>>): HeaderMenuState;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ref as u, readonly as r } from "vue";
|
|
2
|
+
const c = Symbol("headerMenuState");
|
|
3
|
+
function d(n) {
|
|
4
|
+
const e = u(null);
|
|
5
|
+
function t(l) {
|
|
6
|
+
e.value = e.value === l ? null : l;
|
|
7
|
+
}
|
|
8
|
+
function o() {
|
|
9
|
+
e.value = null;
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
toggledId: r(e),
|
|
13
|
+
pointerType: n,
|
|
14
|
+
toggle: t,
|
|
15
|
+
close: o
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
c as HEADER_MENU_STATE,
|
|
20
|
+
d as useHeaderMenuState
|
|
21
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ref as u, onBeforeUnmount as l } from "vue";
|
|
2
|
+
function a(o) {
|
|
3
|
+
const t = u(!1);
|
|
4
|
+
let e;
|
|
5
|
+
function n() {
|
|
6
|
+
clearTimeout(e), e = setTimeout(() => {
|
|
7
|
+
t.value = !0;
|
|
8
|
+
}, o);
|
|
9
|
+
}
|
|
10
|
+
function r() {
|
|
11
|
+
clearTimeout(e), t.value = !1;
|
|
12
|
+
}
|
|
13
|
+
return l(() => clearTimeout(e)), { settled: t, enter: n, leave: r };
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
a as useHoverIntent
|
|
17
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { watch as f, onMounted as a, onBeforeUnmount as c } from "vue";
|
|
2
|
+
function s(u, o, d) {
|
|
3
|
+
function e(n) {
|
|
4
|
+
var i;
|
|
5
|
+
n.target instanceof Node && ((i = u.value) != null && i.contains(n.target)) || d();
|
|
6
|
+
}
|
|
7
|
+
function t() {
|
|
8
|
+
document.addEventListener("pointerdown", e);
|
|
9
|
+
}
|
|
10
|
+
function r() {
|
|
11
|
+
document.removeEventListener("pointerdown", e);
|
|
12
|
+
}
|
|
13
|
+
f(o, (n) => n ? t() : r()), a(() => {
|
|
14
|
+
o.value && t();
|
|
15
|
+
}), c(r);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
s as useOutsidePointerDown
|
|
19
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ref as i, onMounted as a, onBeforeUnmount as p } from "vue";
|
|
2
|
+
function s(n) {
|
|
3
|
+
const o = i(null);
|
|
4
|
+
function r(t) {
|
|
5
|
+
const e = t.pointerType;
|
|
6
|
+
e && e !== o.value && (o.value = e);
|
|
7
|
+
}
|
|
8
|
+
return a(() => {
|
|
9
|
+
var e, u;
|
|
10
|
+
const t = typeof window.matchMedia == "function" && window.matchMedia("(hover: none)").matches;
|
|
11
|
+
o.value = t ? "touch" : "mouse", (e = n.value) == null || e.addEventListener("pointerdown", r, { capture: !0, passive: !0 }), (u = n.value) == null || u.addEventListener("pointermove", r, { capture: !0, passive: !0 });
|
|
12
|
+
}), p(() => {
|
|
13
|
+
var t, e;
|
|
14
|
+
(t = n.value) == null || t.removeEventListener("pointerdown", r, { capture: !0 }), (e = n.value) == null || e.removeEventListener("pointermove", r, { capture: !0 });
|
|
15
|
+
}), { pointerType: o };
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
s as usePointerType
|
|
19
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { gql as
|
|
2
|
-
import { toRefs as
|
|
3
|
-
import
|
|
1
|
+
import { gql as i } from "@apollo/client/core";
|
|
2
|
+
import { toRefs as q, ref as s, computed as g, onMounted as w } from "vue";
|
|
3
|
+
import I from "./KvLendListMenu.js";
|
|
4
4
|
import O from "./KvLendMegaMenu.js";
|
|
5
|
-
import
|
|
6
|
-
import { indexIn as
|
|
7
|
-
import { groupBy as
|
|
8
|
-
import
|
|
9
|
-
const
|
|
5
|
+
import A from "../../KvWwwHeaderBasic/MobileLendMenu/MobileLendMenu.js";
|
|
6
|
+
import { indexIn as F } from "../../../utils/comparators.js";
|
|
7
|
+
import { groupBy as N, sortBy as v } from "../../../utils/arrayUtils.js";
|
|
8
|
+
import x from "../../KvPageContainer.js";
|
|
9
|
+
const Q = {
|
|
10
10
|
components: {
|
|
11
|
-
KvLendListMenu:
|
|
11
|
+
KvLendListMenu: I,
|
|
12
12
|
KvLendMegaMenu: O,
|
|
13
|
-
MobileLendMenu:
|
|
14
|
-
KvPageContainer:
|
|
13
|
+
MobileLendMenu: A,
|
|
14
|
+
KvPageContainer: x
|
|
15
15
|
},
|
|
16
16
|
props: {
|
|
17
17
|
userId: {
|
|
@@ -52,10 +52,10 @@ const U = {
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
emits: ["load-lend-menu-data", "load-search-data", "search-submit"],
|
|
55
|
-
setup(
|
|
55
|
+
setup(C, { emit: h }) {
|
|
56
56
|
const {
|
|
57
|
-
userId:
|
|
58
|
-
} =
|
|
57
|
+
userId: l
|
|
58
|
+
} = q(C), c = s([]), m = s([]), d = s(0), y = s([]), M = [
|
|
59
59
|
"North America",
|
|
60
60
|
"Central America",
|
|
61
61
|
"South America",
|
|
@@ -64,10 +64,10 @@ const U = {
|
|
|
64
64
|
"Middle East",
|
|
65
65
|
"Asia",
|
|
66
66
|
"Oceania"
|
|
67
|
-
],
|
|
68
|
-
var o,
|
|
69
|
-
if (
|
|
70
|
-
query:
|
|
67
|
+
], p = s(!0), f = s(!0), b = async (n) => {
|
|
68
|
+
var o, r, t, a;
|
|
69
|
+
if (n.watchQuery({
|
|
70
|
+
query: i`query countryFacets {
|
|
71
71
|
lend {
|
|
72
72
|
countryFacets {
|
|
73
73
|
count
|
|
@@ -82,31 +82,32 @@ const U = {
|
|
|
82
82
|
}`
|
|
83
83
|
}).subscribe({
|
|
84
84
|
next: ({ data: e }) => {
|
|
85
|
-
var
|
|
86
|
-
|
|
85
|
+
var u;
|
|
86
|
+
m.value = ((u = e == null ? void 0 : e.lend) == null ? void 0 : u.countryFacets) ?? [], p.value = !1;
|
|
87
87
|
}
|
|
88
|
-
}),
|
|
89
|
-
query:
|
|
88
|
+
}), n.watchQuery({
|
|
89
|
+
query: i`
|
|
90
90
|
query lendMenuData {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
browsingCategories(
|
|
92
|
+
filters: { popularOnly: true, applyMinimumLoanCount: true }
|
|
93
|
+
limit: 50
|
|
94
|
+
) {
|
|
95
|
+
values {
|
|
96
|
+
id
|
|
97
|
+
name
|
|
98
|
+
url
|
|
98
99
|
}
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
`
|
|
102
103
|
}).subscribe({
|
|
103
104
|
next: ({ data: e }) => {
|
|
104
|
-
var
|
|
105
|
-
c.value = ((
|
|
105
|
+
var u;
|
|
106
|
+
c.value = ((u = e == null ? void 0 : e.browsingCategories) == null ? void 0 : u.values) ?? [], f.value = !1;
|
|
106
107
|
}
|
|
107
|
-
}),
|
|
108
|
-
const { data: e } = await
|
|
109
|
-
query:
|
|
108
|
+
}), l.value) {
|
|
109
|
+
const { data: e } = await n.query({
|
|
110
|
+
query: i`
|
|
110
111
|
query lendMenuPrivateData($userId: Int!) {
|
|
111
112
|
lend {
|
|
112
113
|
loans(limit: 1, filters: {
|
|
@@ -127,45 +128,45 @@ const U = {
|
|
|
127
128
|
}
|
|
128
129
|
`,
|
|
129
130
|
variables: {
|
|
130
|
-
userId:
|
|
131
|
+
userId: l.value
|
|
131
132
|
},
|
|
132
133
|
fetchPolicy: "network-only"
|
|
133
134
|
});
|
|
134
|
-
|
|
135
|
+
d.value = ((r = (o = e == null ? void 0 : e.lend) == null ? void 0 : o.loans) == null ? void 0 : r.totalCount) ?? 0, y.value = ((a = (t = e == null ? void 0 : e.my) == null ? void 0 : t.savedSearches) == null ? void 0 : a.values) ?? [];
|
|
135
136
|
}
|
|
136
|
-
},
|
|
137
|
-
const
|
|
138
|
-
name:
|
|
139
|
-
region:
|
|
140
|
-
isoCode:
|
|
141
|
-
count:
|
|
142
|
-
})), o =
|
|
143
|
-
for (const [
|
|
144
|
-
|
|
145
|
-
name:
|
|
146
|
-
countries:
|
|
137
|
+
}, L = g(() => {
|
|
138
|
+
const n = m.value.map((t) => ({
|
|
139
|
+
name: t.country.name,
|
|
140
|
+
region: t.country.region,
|
|
141
|
+
isoCode: t.country.isoCode.toLowerCase(),
|
|
142
|
+
count: t.count || 0
|
|
143
|
+
})), o = N(n, "region"), r = [];
|
|
144
|
+
for (const [t, a] of Object.entries(o))
|
|
145
|
+
r.push({
|
|
146
|
+
name: t,
|
|
147
|
+
countries: a.sort(v("name"))
|
|
147
148
|
});
|
|
148
|
-
return
|
|
149
|
-
}),
|
|
149
|
+
return r.sort(F(M, "name"));
|
|
150
|
+
}), S = g(() => {
|
|
150
151
|
var o;
|
|
151
|
-
return ((o = c.value) == null ? void 0 : o.map((
|
|
152
|
-
const
|
|
153
|
-
return
|
|
154
|
-
})).sort(
|
|
152
|
+
return ((o = c.value) == null ? void 0 : o.map((r) => {
|
|
153
|
+
const t = JSON.parse(JSON.stringify(r));
|
|
154
|
+
return t.url = t.url.replace("lend", "lend-by-category"), t;
|
|
155
|
+
})).sort(v("name"));
|
|
155
156
|
});
|
|
156
157
|
return w(() => {
|
|
157
|
-
|
|
158
|
+
h("load-lend-menu-data");
|
|
158
159
|
}), {
|
|
159
|
-
onLoad:
|
|
160
|
-
regions:
|
|
161
|
-
computedCategories:
|
|
160
|
+
onLoad: b,
|
|
161
|
+
regions: L,
|
|
162
|
+
computedCategories: S,
|
|
162
163
|
isChannelsLoading: f,
|
|
163
|
-
isRegionsLoading:
|
|
164
|
-
savedSearches:
|
|
165
|
-
favoritesCount:
|
|
164
|
+
isRegionsLoading: p,
|
|
165
|
+
savedSearches: y,
|
|
166
|
+
favoritesCount: d
|
|
166
167
|
};
|
|
167
168
|
}
|
|
168
169
|
};
|
|
169
170
|
export {
|
|
170
|
-
|
|
171
|
+
Q as default
|
|
171
172
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@media(min-width:45.875rem){.menu-group[data-v-22583929]{align-self:stretch}.menu-group[data-v-22583929]:hover:after{content:"";position:absolute;top:4rem;height:calc(var(--nav-height, 4rem) - 4rem);left:calc(var(--trigger-gap-left, 0px) - var(--trigger-width, 0px) / 2);width:var(--trigger-width, 0px)}}.menu-panel[data-v-22583929]{position:absolute;z-index:1400;overflow-y:auto;--tw-bg-opacity: 1;background-color:rgba(var(--bg-primary),var(--tw-bg-opacity, 1));top:var(--nav-height, 4rem);max-height:0;visibility:hidden;opacity:0;transition:opacity var(--menu-close-fade) ease var(--menu-open-delay),visibility 0s calc(var(--menu-open-delay) + var(--menu-close-fade)),max-height 0s calc(var(--menu-open-delay) + var(--menu-close-fade)),min-height 0s calc(var(--menu-open-delay) + var(--menu-close-fade))}.menu-group:has(>[aria-expanded=true])>.menu-panel[data-v-22583929],[data-pointer=mouse] .menu-group:hover>.menu-panel[data-v-22583929]{visibility:visible;opacity:1;max-height:calc(100dvh - var(--nav-height, 4rem));transition:opacity .3s ease var(--menu-open-delay),visibility 0s var(--menu-open-delay),max-height 0s var(--menu-open-delay),min-height 0s var(--menu-open-delay)}.menu-panel--full[data-v-22583929],.menu-panel--drawer[data-v-22583929]{inset-inline:0}.menu-panel--card[data-v-22583929]{border-bottom-right-radius:1rem;border-bottom-left-radius:1rem;border-width:.0625rem;border-top-width:0px;--tw-border-opacity: 1;border-color:rgba(var(--border-tertiary),var(--tw-border-opacity, 1));right:var(--trigger-gap-right, 0px);translate:clamp(calc(100% - var(--trigger-gap-left, 0px)),50%,var(--trigger-gap-right, 0px)) 0;max-width:100%}.menu-panel--drawer[data-v-22583929]{border-radius:0}.menu-group:has(>[aria-expanded=true])>.menu-panel--drawer[data-v-22583929],[data-pointer=mouse] .menu-group:hover>.menu-panel--drawer[data-v-22583929]{max-height:none;min-height:100dvh}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import s from "./HeaderMenuGroup2.js";
|
|
2
|
+
import { openBlock as d, createElementBlock as i, renderSlot as t, createElementVNode as l, normalizeClass as u, createCommentVNode as a } from "vue";
|
|
3
|
+
import "./HeaderMenuGroup.css";
|
|
4
|
+
import p from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
+
const m = ["id"];
|
|
6
|
+
function f(e, o, r, g, v, F) {
|
|
7
|
+
return d(), i("div", {
|
|
8
|
+
ref: "root",
|
|
9
|
+
class: "menu-group tw-flex tw-items-center",
|
|
10
|
+
onPointerenter: o[0] || (o[0] = (...n) => e.onPointerEnter && e.onPointerEnter(...n)),
|
|
11
|
+
onPointerleave: o[1] || (o[1] = (...n) => e.onPointerLeave && e.onPointerLeave(...n)),
|
|
12
|
+
onFocusin: o[2] || (o[2] = (...n) => e.onFocusIn && e.onFocusIn(...n)),
|
|
13
|
+
onFocusout: o[3] || (o[3] = (...n) => e.onFocusOut && e.onFocusOut(...n)),
|
|
14
|
+
onKeydown: o[4] || (o[4] = (...n) => e.onKeydown && e.onKeydown(...n))
|
|
15
|
+
}, [
|
|
16
|
+
t(e.$slots, "default", {
|
|
17
|
+
trigger: e.trigger,
|
|
18
|
+
toggle: e.toggle,
|
|
19
|
+
expanded: e.expanded
|
|
20
|
+
}, void 0, !0),
|
|
21
|
+
l("div", {
|
|
22
|
+
id: r.panelId,
|
|
23
|
+
class: u(["menu-panel", `menu-panel--${r.variant}`])
|
|
24
|
+
}, [
|
|
25
|
+
e.approached ? t(e.$slots, "panel", {
|
|
26
|
+
key: 0,
|
|
27
|
+
close: e.close
|
|
28
|
+
}, void 0, !0) : a("", !0)
|
|
29
|
+
], 10, m)
|
|
30
|
+
], 544);
|
|
31
|
+
}
|
|
32
|
+
const E = /* @__PURE__ */ p(s, [["render", f], ["__scopeId", "data-v-22583929"]]);
|
|
33
|
+
export {
|
|
34
|
+
E as default
|
|
35
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
panelId: {
|
|
3
|
+
type: StringConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
variant: {
|
|
7
|
+
type: () => "full" | "card" | "drawer";
|
|
8
|
+
default: string;
|
|
9
|
+
};
|
|
10
|
+
}>, any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("close" | "open")[], "close" | "open", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
11
|
+
panelId: {
|
|
12
|
+
type: StringConstructor;
|
|
13
|
+
required: true;
|
|
14
|
+
};
|
|
15
|
+
variant: {
|
|
16
|
+
type: () => "full" | "card" | "drawer";
|
|
17
|
+
default: string;
|
|
18
|
+
};
|
|
19
|
+
}>> & Readonly<{
|
|
20
|
+
onOpen?: (...args: any[]) => any;
|
|
21
|
+
onClose?: (...args: any[]) => any;
|
|
22
|
+
}>, {
|
|
23
|
+
variant: "card" | "full" | "drawer";
|
|
24
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { inject as t, shallowRef as s, toRef as l, watch as i } from "vue";
|
|
2
|
+
import { HEADER_MENU_STATE as E } from "../../utils/useHeaderMenuState.js";
|
|
3
|
+
import { HEADER_MENU_PLACEMENT as c } from "../../utils/useHeaderMenuPlacement.js";
|
|
4
|
+
import { useHeaderMenuGroup as d } from "../../utils/useHeaderMenuGroup.js";
|
|
5
|
+
const A = {
|
|
6
|
+
name: "HeaderMenuGroup",
|
|
7
|
+
props: {
|
|
8
|
+
/**
|
|
9
|
+
* Id for the panel element, referenced by the trigger's aria-controls. Also identifies the
|
|
10
|
+
* group in the shared toggled state.
|
|
11
|
+
*/
|
|
12
|
+
panelId: { type: String, required: !0 },
|
|
13
|
+
/**
|
|
14
|
+
* Panel shape: 'full' spans the nav, 'drawer' is the full-screen mobile drawer, 'card'
|
|
15
|
+
* centers under the trigger and clamps to the nav's edges.
|
|
16
|
+
*/
|
|
17
|
+
variant: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: "card"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
emits: ["open", "close"],
|
|
23
|
+
setup(n, { emit: p }) {
|
|
24
|
+
const e = t(E);
|
|
25
|
+
if (!e) throw new Error("HeaderMenuGroup requires a HEADER_MENU_STATE provider");
|
|
26
|
+
const a = t(c, null), r = s(null), o = d({
|
|
27
|
+
panelId: l(n, "panelId"),
|
|
28
|
+
rootRef: r,
|
|
29
|
+
menus: e,
|
|
30
|
+
placement: a
|
|
31
|
+
});
|
|
32
|
+
return i(o.expanded, (u) => p(u ? "open" : "close"), { flush: "sync" }), { root: r, ...o };
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
A as default
|
|
37
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.header-fade-enter-active[data-v-
|
|
1
|
+
.header-fade-enter-active[data-v-25e697e2]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.3s}.header-fade-leave-active[data-v-25e697e2]{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.1s}.header-fade-enter[data-v-25e697e2],.header-fade-leave-to[data-v-25e697e2]{opacity:0}.header-fade-leave[data-v-25e697e2],.header-fade-enter-to[data-v-25e697e2]{opacity:1}
|