@djcali570/component-lib 0.1.98 → 0.1.100
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/README.md +8 -0
- package/dist/ContextMenu5.svelte +8 -4
- package/dist/ContextMenu5.svelte.d.ts +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Svelte Component library
|
|
2
2
|
|
|
3
|
+
0.1.100
|
|
4
|
+
|
|
5
|
+
- Removed padding from context menu content container.
|
|
6
|
+
|
|
7
|
+
0.1.99
|
|
8
|
+
|
|
9
|
+
- Updated Context Menu to use an on open change callback. (Useful for multiple menus using same open state)
|
|
10
|
+
|
|
3
11
|
0.1.98
|
|
4
12
|
|
|
5
13
|
- Updated default colors for most components. Triggered by checkbox not that visible with
|
package/dist/ContextMenu5.svelte
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
ariaLabel = 'Open context menu',
|
|
26
26
|
menuAlign = 'right',
|
|
27
27
|
open = $bindable(),
|
|
28
|
+
onOpenChange,
|
|
28
29
|
iconSize = '20px'
|
|
29
30
|
}: {
|
|
30
31
|
icon?: Snippet;
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
ariaLabel?: string;
|
|
34
35
|
menuAlign?: 'left' | 'right';
|
|
35
36
|
open?: boolean;
|
|
37
|
+
onOpenChange?: (open: boolean) => void;
|
|
36
38
|
iconSize?: string;
|
|
37
39
|
} = $props();
|
|
38
40
|
|
|
@@ -75,9 +77,11 @@
|
|
|
75
77
|
|
|
76
78
|
// Toggle menu
|
|
77
79
|
function toggle() {
|
|
78
|
-
|
|
80
|
+
const next = !open;
|
|
81
|
+
open = next;
|
|
82
|
+
onOpenChange?.(next); // 👈 notify parent
|
|
79
83
|
|
|
80
|
-
if (
|
|
84
|
+
if (next) {
|
|
81
85
|
updatePosition();
|
|
82
86
|
}
|
|
83
87
|
}
|
|
@@ -85,6 +89,7 @@
|
|
|
85
89
|
// Close menu
|
|
86
90
|
function closeMenu() {
|
|
87
91
|
open = false;
|
|
92
|
+
onOpenChange?.(false); // 👈 notify parent
|
|
88
93
|
}
|
|
89
94
|
|
|
90
95
|
// Click outside
|
|
@@ -230,8 +235,7 @@ top:{position.y}px;
|
|
|
230
235
|
|
|
231
236
|
.context5__content {
|
|
232
237
|
background-color: var(--context5__ContentBgColor);
|
|
233
|
-
border-radius: 0.5rem;
|
|
234
|
-
padding: 0.5rem;
|
|
238
|
+
border-radius: 0.5rem;
|
|
235
239
|
border: 1px solid var(--context5__ContentBorderColor);
|
|
236
240
|
}
|
|
237
241
|
</style>
|