flowbite-svelte 1.11.4 → 1.11.5
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/navbar/NavLi.svelte
CHANGED
|
@@ -8,12 +8,24 @@
|
|
|
8
8
|
let navState = getContext<NavbarState>("navState");
|
|
9
9
|
let navBreakpoint = getContext<NavbarBreakpoint>("breakpoint");
|
|
10
10
|
|
|
11
|
-
let { children, activeClass, nonActiveClass, class: className, ...restProps }: NavLiProps = $props();
|
|
11
|
+
let { children, onclick, activeClass, nonActiveClass, class: className, ...restProps }: NavLiProps = $props();
|
|
12
12
|
|
|
13
13
|
const theme = getTheme("navbarLi");
|
|
14
14
|
|
|
15
15
|
let active = $derived(navState.activeUrl ? restProps.href === navState.activeUrl : false);
|
|
16
16
|
let liClass = $derived(navbarLi({ breakpoint: navBreakpoint, hidden: navState.hidden, class: clsx(active ? (activeClass ?? navState.activeClass) : (nonActiveClass ?? navState.nonActiveClass), theme, className) }));
|
|
17
|
+
|
|
18
|
+
function handleClick(event: any) {
|
|
19
|
+
// Close the mobile menu when a link is clicked
|
|
20
|
+
if (restProps.href !== undefined && !navState.hidden) {
|
|
21
|
+
navState.hidden = true;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// Call original onclick handler if provided
|
|
25
|
+
if (onclick) {
|
|
26
|
+
onclick(event);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
17
29
|
</script>
|
|
18
30
|
|
|
19
31
|
<li>
|
|
@@ -22,7 +34,7 @@
|
|
|
22
34
|
{@render children?.()}
|
|
23
35
|
</button>
|
|
24
36
|
{:else}
|
|
25
|
-
<a {...restProps} class={liClass}>
|
|
37
|
+
<a {...restProps} class={liClass} onclick={handleClick}>
|
|
26
38
|
{@render children?.()}
|
|
27
39
|
</a>
|
|
28
40
|
{/if}
|
|
@@ -35,6 +47,7 @@
|
|
|
35
47
|
[NavLiProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1109)
|
|
36
48
|
## Props
|
|
37
49
|
@prop children
|
|
50
|
+
@prop onclick
|
|
38
51
|
@prop activeClass
|
|
39
52
|
@prop nonActiveClass
|
|
40
53
|
@prop class: className
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
import type { NavbarState, NavbarProps } from "../types";
|
|
7
7
|
import { getTheme } from "../theme/themeUtils";
|
|
8
8
|
|
|
9
|
-
// propagate props type from underlying Frame
|
|
10
|
-
|
|
11
9
|
let { children, fluid, navContainerClass, class: className, closeOnClickOutside = true, breakpoint = "md", ...restProps }: NavbarProps = $props();
|
|
12
10
|
|
|
13
11
|
const theme = getTheme("navbar");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.5",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"author": {
|
|
@@ -15,18 +15,18 @@
|
|
|
15
15
|
"@changesets/cli": "2.29.5",
|
|
16
16
|
"@docsearch/css": "^3.9.0",
|
|
17
17
|
"@docsearch/js": "^3.9.0",
|
|
18
|
-
"@eslint/compat": "^1.3.
|
|
19
|
-
"@eslint/js": "^9.
|
|
18
|
+
"@eslint/compat": "^1.3.2",
|
|
19
|
+
"@eslint/js": "^9.33.0",
|
|
20
20
|
"@flowbite-svelte-plugins/chart": "^0.2.4",
|
|
21
21
|
"@flowbite-svelte-plugins/datatable": "^0.4.0",
|
|
22
22
|
"@flowbite-svelte-plugins/texteditor": "^0.25.3",
|
|
23
23
|
"@playwright/test": "^1.54.2",
|
|
24
|
-
"@sveltejs/adapter-auto": "^6.0.
|
|
25
|
-
"@sveltejs/adapter-vercel": "^5.8.
|
|
24
|
+
"@sveltejs/adapter-auto": "^6.0.2",
|
|
25
|
+
"@sveltejs/adapter-vercel": "^5.8.2",
|
|
26
26
|
"@sveltejs/enhanced-img": "^0.6.1",
|
|
27
|
-
"@sveltejs/kit": "^2.27.
|
|
27
|
+
"@sveltejs/kit": "^2.27.3",
|
|
28
28
|
"@sveltejs/package": "2.4.0",
|
|
29
|
-
"@sveltejs/vite-plugin-svelte": "^6.1.
|
|
29
|
+
"@sveltejs/vite-plugin-svelte": "^6.1.1",
|
|
30
30
|
"@svitejs/changesets-changelog-github-compact": "^1.2.0",
|
|
31
31
|
"@tailwindcss/vite": "^4.1.11",
|
|
32
32
|
"@testing-library/jest-dom": "^6.6.4",
|
|
@@ -35,9 +35,10 @@
|
|
|
35
35
|
"@tiptap/core": "3.0.9",
|
|
36
36
|
"dayjs": "^1.11.13",
|
|
37
37
|
"deepmerge": "^4.3.1",
|
|
38
|
-
"eslint": "^9.
|
|
38
|
+
"eslint": "^9.33.0",
|
|
39
39
|
"eslint-config-prettier": "^10.1.8",
|
|
40
40
|
"eslint-plugin-svelte": "^3.11.0",
|
|
41
|
+
"flowbite-svelte-admin-dashboard": "^1.1.1",
|
|
41
42
|
"flowbite-svelte-blocks": "^2.1.0",
|
|
42
43
|
"flowbite-svelte-icons": "^2.2.1",
|
|
43
44
|
"flowbite-svelte-illustrations": "^1.0.4",
|
|
@@ -54,13 +55,15 @@
|
|
|
54
55
|
"prettier-plugin-tailwindcss": "^0.6.14",
|
|
55
56
|
"prism-themes": "^1.9.0",
|
|
56
57
|
"publint": "^0.3.12",
|
|
58
|
+
"runatics": "^0.1.4",
|
|
59
|
+
"runes-meta-tags": "^0.4.4",
|
|
57
60
|
"simple-datatables": "^10.0.0",
|
|
58
|
-
"svelte": "^5.
|
|
61
|
+
"svelte": "^5.38.0",
|
|
59
62
|
"svelte-check": "^4.3.1",
|
|
60
63
|
"svelte-doc-llm": "^0.2.2",
|
|
61
64
|
"svelte-lib-helpers": "^0.4.30",
|
|
62
65
|
"svelte-meta-tags": "^4.4.0",
|
|
63
|
-
"svelte-rune-highlight": "^0.6.
|
|
66
|
+
"svelte-rune-highlight": "^0.6.9",
|
|
64
67
|
"tailwindcss": "^4.1.11",
|
|
65
68
|
"tsx": "^4.20.3",
|
|
66
69
|
"typescript": "^5.9.2",
|