@noxlovette/material 0.1.30 → 0.1.31
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.
|
@@ -18,12 +18,14 @@ A single destination within a navigation bar.
|
|
|
18
18
|
label,
|
|
19
19
|
badge = 0,
|
|
20
20
|
class: className,
|
|
21
|
+
selected,
|
|
21
22
|
iconProps,
|
|
22
23
|
...rest
|
|
23
24
|
}: NavItemProps = $props();
|
|
24
25
|
|
|
25
26
|
const isActive = $derived(
|
|
26
|
-
|
|
27
|
+
selected ||
|
|
28
|
+
page.url.pathname === href ||
|
|
27
29
|
(href !== '/' && page.url.href.startsWith(href)) ||
|
|
28
30
|
page.url.href == href
|
|
29
31
|
);
|
|
@@ -17,6 +17,8 @@ export type NavItemProps = NavItemVariants & HTMLAttributes<HTMLAnchorElement> &
|
|
|
17
17
|
href: string;
|
|
18
18
|
/** Props passed to the Icon component. */
|
|
19
19
|
iconProps: IconProps;
|
|
20
|
+
/** Whether the item is manually forced into a selected state. */
|
|
21
|
+
selected?: boolean;
|
|
20
22
|
};
|
|
21
23
|
/**
|
|
22
24
|
* Props for the Navbar component.
|
|
@@ -15,7 +15,7 @@ A single destination within a navigation rail.
|
|
|
15
15
|
|
|
16
16
|
let {
|
|
17
17
|
href = '/',
|
|
18
|
-
|
|
18
|
+
label,
|
|
19
19
|
external = false,
|
|
20
20
|
badge = 0,
|
|
21
21
|
class: className,
|
|
@@ -99,7 +99,7 @@ A single destination within a navigation rail.
|
|
|
99
99
|
{/if}
|
|
100
100
|
</div>
|
|
101
101
|
<p class={labelClass()}>
|
|
102
|
-
{
|
|
102
|
+
{label}
|
|
103
103
|
</p>
|
|
104
104
|
</div>
|
|
105
105
|
</a>
|
|
@@ -17,7 +17,7 @@ export interface RailItemProps extends RailItemVariants, HTMLAttributes<HTMLAnch
|
|
|
17
17
|
/** Whether the item is manually forced into a selected state. */
|
|
18
18
|
selected?: boolean;
|
|
19
19
|
/** The text label for the item. */
|
|
20
|
-
|
|
20
|
+
label: string;
|
|
21
21
|
/** Whether the rail is collapsed, affecting label visibility. */
|
|
22
22
|
collapsed?: boolean;
|
|
23
23
|
/** Whether the item is disabled. */
|