@greghowe79/the-lib 2.6.9 → 2.7.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.
|
@@ -16,6 +16,10 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
|
|
|
16
16
|
menuList?.classList.remove("no-transition");
|
|
17
17
|
}, 50);
|
|
18
18
|
}));
|
|
19
|
+
qwik.useVisibleTask$(({ track }) => {
|
|
20
|
+
track(() => location.url.pathname);
|
|
21
|
+
isOpen.value = false;
|
|
22
|
+
});
|
|
19
23
|
return /* @__PURE__ */ jsxRuntime.jsx("nav", {
|
|
20
24
|
class: `menu ${isOpen.value ? "open" : ""}`,
|
|
21
25
|
"aria-label": ariaLabel,
|
|
@@ -28,12 +32,10 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
|
|
|
28
32
|
logoReload ? /* @__PURE__ */ jsxRuntime.jsx("a", {
|
|
29
33
|
href: `/${locale}`,
|
|
30
34
|
"aria-label": "Homepage",
|
|
31
|
-
onClick$: () => isOpen.value = false,
|
|
32
35
|
children: logoComponent && logoComponent({}, null, 0)
|
|
33
36
|
}) : /* @__PURE__ */ jsxRuntime.jsx(qwikCity.Link, {
|
|
34
37
|
href: `/${locale}`,
|
|
35
38
|
"aria-label": "Homepage",
|
|
36
|
-
onClick$: () => isOpen.value = false,
|
|
37
39
|
children: logoComponent && logoComponent({}, null, 0)
|
|
38
40
|
}),
|
|
39
41
|
/* @__PURE__ */ jsxRuntime.jsxs("button", {
|
|
@@ -63,7 +65,6 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
|
|
|
63
65
|
target: item.target,
|
|
64
66
|
rel: item.rel,
|
|
65
67
|
class: "menu-link",
|
|
66
|
-
onClick$: () => isOpen.value = false,
|
|
67
68
|
children: item.label
|
|
68
69
|
})
|
|
69
70
|
}, item.label);
|
|
@@ -73,7 +74,6 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
|
|
|
73
74
|
children: /* @__PURE__ */ jsxRuntime.jsx("a", {
|
|
74
75
|
href: item.href,
|
|
75
76
|
class: location.url.pathname === item.href ? "active" : "menu-link",
|
|
76
|
-
onClick$: () => isOpen.value = false,
|
|
77
77
|
children: item.label
|
|
78
78
|
})
|
|
79
79
|
}, item.label);
|
|
@@ -82,7 +82,6 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
|
|
|
82
82
|
children: /* @__PURE__ */ jsxRuntime.jsx(qwikCity.Link, {
|
|
83
83
|
href: item.href,
|
|
84
84
|
class: location.url.pathname === item.href ? "active" : "menu-link",
|
|
85
|
-
onClick$: () => isOpen.value = false,
|
|
86
85
|
children: item.label
|
|
87
86
|
})
|
|
88
87
|
}, item.label);
|
|
@@ -94,8 +93,11 @@ const NavigationMenu = qwik.component$(({ ariaLabel, logoComponent, listItems, a
|
|
|
94
93
|
return /* @__PURE__ */ jsxRuntime.jsx(button.Button, {
|
|
95
94
|
id,
|
|
96
95
|
label: label ?? "",
|
|
96
|
+
// onClick$={() => {
|
|
97
|
+
// isOpen.value = false;
|
|
98
|
+
// onClick$?.();
|
|
99
|
+
// }}
|
|
97
100
|
onClick$: () => {
|
|
98
|
-
isOpen.value = false;
|
|
99
101
|
onClick$?.();
|
|
100
102
|
},
|
|
101
103
|
icon,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
-
import { component$, useSignal, useStyles$, useOnWindow, $ } from "@builder.io/qwik";
|
|
2
|
+
import { component$, useSignal, useStyles$, useOnWindow, $, useVisibleTask$ } from "@builder.io/qwik";
|
|
3
3
|
import { useLocation, Link } from "@builder.io/qwik-city";
|
|
4
4
|
import styles from "./styles.css.qwik.mjs";
|
|
5
5
|
import { Button } from "../button/button.qwik.mjs";
|
|
@@ -14,6 +14,10 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
|
|
|
14
14
|
menuList?.classList.remove("no-transition");
|
|
15
15
|
}, 50);
|
|
16
16
|
}));
|
|
17
|
+
useVisibleTask$(({ track }) => {
|
|
18
|
+
track(() => location.url.pathname);
|
|
19
|
+
isOpen.value = false;
|
|
20
|
+
});
|
|
17
21
|
return /* @__PURE__ */ jsx("nav", {
|
|
18
22
|
class: `menu ${isOpen.value ? "open" : ""}`,
|
|
19
23
|
"aria-label": ariaLabel,
|
|
@@ -26,12 +30,10 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
|
|
|
26
30
|
logoReload ? /* @__PURE__ */ jsx("a", {
|
|
27
31
|
href: `/${locale}`,
|
|
28
32
|
"aria-label": "Homepage",
|
|
29
|
-
onClick$: () => isOpen.value = false,
|
|
30
33
|
children: logoComponent && logoComponent({}, null, 0)
|
|
31
34
|
}) : /* @__PURE__ */ jsx(Link, {
|
|
32
35
|
href: `/${locale}`,
|
|
33
36
|
"aria-label": "Homepage",
|
|
34
|
-
onClick$: () => isOpen.value = false,
|
|
35
37
|
children: logoComponent && logoComponent({}, null, 0)
|
|
36
38
|
}),
|
|
37
39
|
/* @__PURE__ */ jsxs("button", {
|
|
@@ -61,7 +63,6 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
|
|
|
61
63
|
target: item.target,
|
|
62
64
|
rel: item.rel,
|
|
63
65
|
class: "menu-link",
|
|
64
|
-
onClick$: () => isOpen.value = false,
|
|
65
66
|
children: item.label
|
|
66
67
|
})
|
|
67
68
|
}, item.label);
|
|
@@ -71,7 +72,6 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
|
|
|
71
72
|
children: /* @__PURE__ */ jsx("a", {
|
|
72
73
|
href: item.href,
|
|
73
74
|
class: location.url.pathname === item.href ? "active" : "menu-link",
|
|
74
|
-
onClick$: () => isOpen.value = false,
|
|
75
75
|
children: item.label
|
|
76
76
|
})
|
|
77
77
|
}, item.label);
|
|
@@ -80,7 +80,6 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
|
|
|
80
80
|
children: /* @__PURE__ */ jsx(Link, {
|
|
81
81
|
href: item.href,
|
|
82
82
|
class: location.url.pathname === item.href ? "active" : "menu-link",
|
|
83
|
-
onClick$: () => isOpen.value = false,
|
|
84
83
|
children: item.label
|
|
85
84
|
})
|
|
86
85
|
}, item.label);
|
|
@@ -92,8 +91,11 @@ const NavigationMenu = component$(({ ariaLabel, logoComponent, listItems, action
|
|
|
92
91
|
return /* @__PURE__ */ jsx(Button, {
|
|
93
92
|
id,
|
|
94
93
|
label: label ?? "",
|
|
94
|
+
// onClick$={() => {
|
|
95
|
+
// isOpen.value = false;
|
|
96
|
+
// onClick$?.();
|
|
97
|
+
// }}
|
|
95
98
|
onClick$: () => {
|
|
96
|
-
isOpen.value = false;
|
|
97
99
|
onClick$?.();
|
|
98
100
|
},
|
|
99
101
|
icon,
|