@likable-hair/svelte 4.0.16 → 4.0.18
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.
|
@@ -49,13 +49,23 @@ function toggleSidebar() {
|
|
|
49
49
|
/>
|
|
50
50
|
</div>
|
|
51
51
|
{:else if !sidebarExpanded}
|
|
52
|
-
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
{#if !sidebarExpanded}
|
|
53
|
+
<div style:margin-right="2rem">
|
|
54
|
+
<Icon
|
|
55
|
+
name="mdi-dock-left"
|
|
56
|
+
--icon-default-size="1.5rem"
|
|
57
|
+
onclick={toggleSidebar}
|
|
58
|
+
/>
|
|
59
|
+
</div>
|
|
60
|
+
{:else}
|
|
61
|
+
<div style:margin-right="2rem">
|
|
62
|
+
<Icon
|
|
63
|
+
name="mdi-dock-left"
|
|
64
|
+
--icon-default-size="1.5rem"
|
|
65
|
+
onclick={toggleSidebar}
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
{/if}
|
|
59
69
|
{/if}
|
|
60
70
|
{#if innerMenuSnippet}
|
|
61
71
|
{@render innerMenuSnippet({ hamburgerVisible: mAndDown })}
|
|
@@ -87,17 +97,6 @@ function toggleSidebar() {
|
|
|
87
97
|
<div class="logo">Logo</div>
|
|
88
98
|
{/if}
|
|
89
99
|
</div>
|
|
90
|
-
<div class="pin-container">
|
|
91
|
-
{#if sidebarExpanded}
|
|
92
|
-
<div class="sidebar-close-button">
|
|
93
|
-
<Icon
|
|
94
|
-
name="mdi-menu-open"
|
|
95
|
-
--icon-default-size="1.5rem"
|
|
96
|
-
onclick={toggleSidebar}
|
|
97
|
-
/>
|
|
98
|
-
</div>
|
|
99
|
-
{/if}
|
|
100
|
-
</div>
|
|
101
100
|
</div>
|
|
102
101
|
{#if menuSnippet}
|
|
103
102
|
{@render menuSnippet({ hamburgerVisible: mAndDown, sidebarExpanded })}
|
|
@@ -188,15 +187,6 @@ function toggleSidebar() {
|
|
|
188
187
|
margin-bottom: 1rem;
|
|
189
188
|
}
|
|
190
189
|
|
|
191
|
-
.pin-container {
|
|
192
|
-
display: flex;
|
|
193
|
-
justify-content: flex-end;
|
|
194
|
-
align-items: center;
|
|
195
|
-
width: 30%;
|
|
196
|
-
margin-bottom: 1rem;
|
|
197
|
-
margin-right: 1rem;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
190
|
.sidebar-close-button {
|
|
201
191
|
cursor: pointer;
|
|
202
192
|
display: flex;
|
|
@@ -117,6 +117,7 @@ function calcScrollY(elem) {
|
|
|
117
117
|
}
|
|
118
118
|
return scroll;
|
|
119
119
|
}
|
|
120
|
+
let positionedAncestor = undefined;
|
|
120
121
|
$effect(() => {
|
|
121
122
|
if (open) {
|
|
122
123
|
if (!menuElement || !activator)
|
|
@@ -165,6 +166,11 @@ $effect(() => {
|
|
|
165
166
|
calculateMenuPosition({ activator, menuElement });
|
|
166
167
|
if (maxZIndex)
|
|
167
168
|
zIndex = maxZIndex + 2;
|
|
169
|
+
if (!!menuElement && !!activator) {
|
|
170
|
+
let elem = getPositionedAncestor(menuElement.parentElement);
|
|
171
|
+
positionedAncestor = elem == null ? undefined : elem;
|
|
172
|
+
calculateMenuPosition({ menuElement, activator });
|
|
173
|
+
}
|
|
168
174
|
}
|
|
169
175
|
});
|
|
170
176
|
$effect(() => {
|
|
@@ -205,14 +211,6 @@ $effect(() => {
|
|
|
205
211
|
});
|
|
206
212
|
}
|
|
207
213
|
});
|
|
208
|
-
let positionedAncestor = undefined;
|
|
209
|
-
$effect(() => {
|
|
210
|
-
if (!!menuElement && !!activator) {
|
|
211
|
-
let elem = getPositionedAncestor(menuElement.parentElement);
|
|
212
|
-
positionedAncestor = elem == null ? undefined : elem;
|
|
213
|
-
calculateMenuPosition({ menuElement, activator });
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
214
|
function getPositionedAncestor(elem, positions = ['fixed', 'absolute', 'sticky', 'relative']) {
|
|
217
215
|
if (!elem)
|
|
218
216
|
return null;
|