noph-ui 0.18.5 → 0.18.7
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/menu/Menu.svelte +4 -21
- package/package.json +12 -12
package/dist/menu/Menu.svelte
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import type { MenuProps } from './types.ts'
|
|
3
3
|
|
|
4
4
|
let {
|
|
5
|
-
anchor,
|
|
6
5
|
children,
|
|
7
6
|
element = $bindable(),
|
|
8
7
|
showPopover = $bindable(),
|
|
9
8
|
hidePopover = $bindable(),
|
|
10
9
|
style,
|
|
11
10
|
popover = 'auto',
|
|
11
|
+
anchor,
|
|
12
12
|
...attributes
|
|
13
13
|
}: MenuProps = $props()
|
|
14
14
|
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
hidePopover = () => {
|
|
25
25
|
element?.hidePopover()
|
|
26
26
|
}
|
|
27
|
-
|
|
28
27
|
const refreshValues = () => {
|
|
29
28
|
if (element && anchor && menuOpen) {
|
|
30
29
|
const anchorRect = anchor.getBoundingClientRect()
|
|
@@ -83,28 +82,11 @@
|
|
|
83
82
|
}
|
|
84
83
|
|
|
85
84
|
$effect(() => {
|
|
86
|
-
if (
|
|
87
|
-
if (style) {
|
|
88
|
-
const styleEntries = style
|
|
89
|
-
.split(';')
|
|
90
|
-
.filter(Boolean)
|
|
91
|
-
.map((entry) => entry.split(':').map((str) => str.trim()))
|
|
92
|
-
styleEntries.forEach(([key, value]) => {
|
|
93
|
-
element?.style.setProperty(key, value)
|
|
94
|
-
})
|
|
95
|
-
}
|
|
85
|
+
if (element) {
|
|
96
86
|
getScrollableParent(element).addEventListener('scroll', onScroll, { passive: true })
|
|
97
|
-
if (
|
|
98
|
-
'anchorName' in document.documentElement.style &&
|
|
99
|
-
!anchor.style.getPropertyValue('anchor-name')
|
|
100
|
-
) {
|
|
101
|
-
const generatedId = `--${crypto.randomUUID()}`
|
|
102
|
-
element.style.setProperty('position-anchor', generatedId)
|
|
103
|
-
anchor.style.setProperty('anchor-name', generatedId)
|
|
104
|
-
}
|
|
105
87
|
}
|
|
106
88
|
return () => {
|
|
107
|
-
if (element) {
|
|
89
|
+
if (element && !('anchorName' in document.documentElement.style)) {
|
|
108
90
|
getScrollableParent(element).removeEventListener('scroll', onScroll)
|
|
109
91
|
}
|
|
110
92
|
}
|
|
@@ -125,6 +107,7 @@
|
|
|
125
107
|
}}
|
|
126
108
|
{popover}
|
|
127
109
|
class={['np-menu-container', attributes.class]}
|
|
110
|
+
{style}
|
|
128
111
|
>
|
|
129
112
|
<div class="np-menu">
|
|
130
113
|
{@render children()}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "noph-ui",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://noph.dev",
|
|
6
6
|
"repository": {
|
|
@@ -53,26 +53,26 @@
|
|
|
53
53
|
"svelte": "^5.32.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@eslint/js": "^9.
|
|
56
|
+
"@eslint/js": "^9.30.1",
|
|
57
57
|
"@material/material-color-utilities": "^0.3.0",
|
|
58
|
-
"@playwright/test": "^1.53.
|
|
58
|
+
"@playwright/test": "^1.53.2",
|
|
59
59
|
"@sveltejs/adapter-vercel": "^5.7.2",
|
|
60
|
-
"@sveltejs/kit": "^2.22.
|
|
61
|
-
"@sveltejs/package": "^2.3.
|
|
60
|
+
"@sveltejs/kit": "^2.22.2",
|
|
61
|
+
"@sveltejs/package": "^2.3.12",
|
|
62
62
|
"@sveltejs/vite-plugin-svelte": "^5.1.0",
|
|
63
63
|
"@types/eslint": "^9.6.1",
|
|
64
|
-
"eslint": "^9.
|
|
64
|
+
"eslint": "^9.30.1",
|
|
65
65
|
"eslint-config-prettier": "^10.1.5",
|
|
66
|
-
"eslint-plugin-svelte": "^3.
|
|
67
|
-
"globals": "^16.
|
|
68
|
-
"prettier": "^3.6.
|
|
66
|
+
"eslint-plugin-svelte": "^3.10.1",
|
|
67
|
+
"globals": "^16.3.0",
|
|
68
|
+
"prettier": "^3.6.2",
|
|
69
69
|
"prettier-plugin-svelte": "^3.4.0",
|
|
70
70
|
"publint": "^0.3.12",
|
|
71
|
-
"svelte": "^5.
|
|
71
|
+
"svelte": "^5.35.2",
|
|
72
72
|
"svelte-check": "^4.2.2",
|
|
73
73
|
"typescript": "^5.8.3",
|
|
74
|
-
"typescript-eslint": "^8.35.
|
|
75
|
-
"vite": "^
|
|
74
|
+
"typescript-eslint": "^8.35.1",
|
|
75
|
+
"vite": "^7.0.2",
|
|
76
76
|
"vitest": "^3.2.4"
|
|
77
77
|
},
|
|
78
78
|
"svelte": "./dist/index.js",
|