@functionalcms/svelte-components 4.2.5 → 4.2.6
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/components/form/Button.svelte +9 -8
- package/dist/components/form/Button.svelte.d.ts +2 -2
- package/dist/components/menu/DynamicMenu.svelte +16 -16
- package/dist/components/menu/HamburgerMenu.svelte +8 -17
- package/dist/components/presentation/Drawer.svelte +15 -13
- package/package.json +1 -1
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
ariaSelected?: boolean;
|
|
26
26
|
ariaControls?: string;
|
|
27
27
|
tabIndex?: number;
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
click?: () => void;
|
|
29
|
+
keydown?: (e: KeyboardEvent) => void;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
let {
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
ariaSelected = undefined,
|
|
53
53
|
ariaControls = undefined,
|
|
54
54
|
tabIndex = 0,
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
click = undefined,
|
|
56
|
+
keydown = undefined,
|
|
57
57
|
...restProps
|
|
58
58
|
}: Partial<Props> = $props();
|
|
59
59
|
|
|
@@ -74,6 +74,7 @@
|
|
|
74
74
|
css ? `${css}` : ''
|
|
75
75
|
)
|
|
76
76
|
);
|
|
77
|
+
|
|
77
78
|
</script>
|
|
78
79
|
|
|
79
80
|
{#if type == 'link'}
|
|
@@ -86,8 +87,8 @@
|
|
|
86
87
|
aria-selected={ariaSelected}
|
|
87
88
|
aria-controls={ariaControls}
|
|
88
89
|
tabindex={tabIndex}
|
|
89
|
-
{onclick}
|
|
90
|
-
{onkeydown}
|
|
90
|
+
onclick={onclick}
|
|
91
|
+
onkeydown={onkeydown}
|
|
91
92
|
{...restProps}
|
|
92
93
|
>
|
|
93
94
|
{@render children?.()}
|
|
@@ -102,8 +103,8 @@
|
|
|
102
103
|
aria-controls={ariaControls}
|
|
103
104
|
tabindex={tabIndex}
|
|
104
105
|
disabled={isDisabled}
|
|
105
|
-
{onclick}
|
|
106
|
-
{onkeydown}
|
|
106
|
+
onclick={onclick}
|
|
107
|
+
onkeydown={onkeydown}
|
|
107
108
|
{...restProps}
|
|
108
109
|
>
|
|
109
110
|
{@render children?.()}
|
|
@@ -22,8 +22,8 @@ declare const Button: import("svelte").Component<Partial<{
|
|
|
22
22
|
ariaSelected?: boolean;
|
|
23
23
|
ariaControls?: string;
|
|
24
24
|
tabIndex?: number;
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
click?: () => void;
|
|
26
|
+
keydown?: (e: KeyboardEvent) => void;
|
|
27
27
|
}>, {}, "">;
|
|
28
28
|
type Button = ReturnType<typeof Button>;
|
|
29
29
|
export default Button;
|
|
@@ -37,19 +37,19 @@
|
|
|
37
37
|
</div>
|
|
38
38
|
</nav>
|
|
39
39
|
|
|
40
|
-
<style
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
</style>
|
|
40
|
+
<style>.desktop {
|
|
41
|
+
display: none !important;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.mobile {
|
|
45
|
+
display: block !important;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@media (min-width: 960px) {
|
|
49
|
+
.desktop {
|
|
50
|
+
display: block !important;
|
|
51
|
+
}
|
|
52
|
+
.mobile {
|
|
53
|
+
display: none !important;
|
|
54
|
+
}
|
|
55
|
+
}</style>
|
|
@@ -27,12 +27,19 @@
|
|
|
27
27
|
|
|
28
28
|
let isOpen = $state(false);
|
|
29
29
|
let buttonCss = $derived(cn('hamburger-handle', css.buttonCss));
|
|
30
|
+
|
|
31
|
+
$inspect(isOpen);
|
|
32
|
+
function toggleDrawer(){
|
|
33
|
+
console.log('clicked');
|
|
34
|
+
isOpen = !isOpen;
|
|
35
|
+
}
|
|
30
36
|
</script>
|
|
31
37
|
|
|
32
38
|
<Button
|
|
33
39
|
type="button"
|
|
34
|
-
|
|
40
|
+
isPrimary
|
|
35
41
|
css={buttonCss}
|
|
42
|
+
onclick={() => console.log('clicked')}
|
|
36
43
|
>
|
|
37
44
|
☰
|
|
38
45
|
</Button>
|
|
@@ -41,22 +48,6 @@
|
|
|
41
48
|
<Menu {localPages} {css}>
|
|
42
49
|
</Menu>
|
|
43
50
|
</Drawer>
|
|
44
|
-
<!-- <Drawer
|
|
45
|
-
id="hamburger-menu"
|
|
46
|
-
drawerRoot="#drawer-root"
|
|
47
|
-
{placement}
|
|
48
|
-
on:instance={assignDrawerRef}
|
|
49
|
-
title="Menu"
|
|
50
|
-
>
|
|
51
|
-
<ColumnMenu {localPages} orientation={Orientation.Column} css={cssClasses}>
|
|
52
|
-
<ColumnMenu
|
|
53
|
-
slot="subItems"
|
|
54
|
-
localPages={subpages}
|
|
55
|
-
let:subpages
|
|
56
|
-
css={{ container: ['submenu'], link: css.link }}
|
|
57
|
-
/>
|
|
58
|
-
</ColumnMenu>
|
|
59
|
-
</Drawer> -->
|
|
60
51
|
|
|
61
52
|
<style>
|
|
62
53
|
:global(#hamburger-menu) {
|
|
@@ -20,27 +20,27 @@
|
|
|
20
20
|
children,
|
|
21
21
|
}: Props = $props();
|
|
22
22
|
|
|
23
|
-
let mounted = $state(false);
|
|
23
|
+
// let mounted = $state(false);
|
|
24
24
|
|
|
25
25
|
let style = $derived('--duration: ' + duration + 's; --size: ' + size + ';');
|
|
26
26
|
|
|
27
|
-
function scrollLock(open: boolean) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
27
|
+
// function scrollLock(open: boolean) {
|
|
28
|
+
// if (mounted) {
|
|
29
|
+
// const body = document.querySelector('body');
|
|
30
|
+
// if (body != null) {
|
|
31
|
+
// body.style.overflow = open ? 'hidden' : 'auto';
|
|
32
|
+
// }
|
|
33
|
+
// }
|
|
34
|
+
// }
|
|
35
35
|
|
|
36
36
|
function handleClickAway() {
|
|
37
37
|
clickAway();
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
onMount(() => {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
});
|
|
40
|
+
// onMount(() => {
|
|
41
|
+
// mounted = true;
|
|
42
|
+
// scrollLock(open);
|
|
43
|
+
// });
|
|
44
44
|
</script>
|
|
45
45
|
|
|
46
46
|
<aside class="drawer" class:open {style}>
|
|
@@ -62,10 +62,12 @@
|
|
|
62
62
|
width: 100%;
|
|
63
63
|
z-index: -1;
|
|
64
64
|
transition: z-index var(--duration) step-end;
|
|
65
|
+
display: none;
|
|
65
66
|
}
|
|
66
67
|
|
|
67
68
|
.drawer.open {
|
|
68
69
|
z-index: 99;
|
|
70
|
+
display: block;
|
|
69
71
|
transition: z-index var(--duration) step-start;
|
|
70
72
|
}
|
|
71
73
|
|