@softwareone/spi-sv5-library 1.7.4 → 1.7.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.
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
interface FooterProps {
|
|
3
3
|
homeUrl?: string;
|
|
4
|
+
logoUrl?: string;
|
|
4
5
|
}
|
|
5
|
-
let { homeUrl = '/' }: FooterProps = $props();
|
|
6
|
+
let { homeUrl = '/', logoUrl = '/softwareone-logo-white.svg' }: FooterProps = $props();
|
|
6
7
|
</script>
|
|
7
8
|
|
|
8
9
|
<footer class="footer-section">
|
|
9
10
|
<a href={homeUrl} title="Home">
|
|
10
|
-
<img alt="SoftwareOne logo" class="logo-image" src=
|
|
11
|
+
<img alt="SoftwareOne logo" class="logo-image" src={logoUrl} />
|
|
11
12
|
</a>
|
|
12
13
|
<ul class="links">
|
|
13
14
|
<li>
|
package/dist/Menu/Menu.svelte
CHANGED
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
const isActiveMenuItem = (url: string) => {
|
|
22
|
-
const
|
|
22
|
+
const pathname = page.url.pathname.replace(/^\/v\d+\//, '/');
|
|
23
|
+
const firstSegmentUrl = pathname.split('/')[1];
|
|
23
24
|
return existRoute(`/${firstSegmentUrl}`, url);
|
|
24
25
|
};
|
|
25
26
|
|
|
@@ -28,7 +29,6 @@
|
|
|
28
29
|
return regex.test(pathname);
|
|
29
30
|
};
|
|
30
31
|
|
|
31
|
-
|
|
32
32
|
const onHandleMenu = () => {
|
|
33
33
|
showMenu = !showMenu;
|
|
34
34
|
};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
export const getSubMenuItemsFromMenu = (items, url, excludedRoutes) => {
|
|
2
|
-
|
|
2
|
+
const cleanUrl = url.replace(/^\/v\d+\//, '/');
|
|
3
|
+
if (excludedRoutes?.includes(cleanUrl))
|
|
3
4
|
return [];
|
|
4
|
-
const matchedPath = /^\/[^/]+/.exec(
|
|
5
|
+
const matchedPath = /^\/[^/]+/.exec(cleanUrl);
|
|
5
6
|
const urlValue = matchedPath?.[0] ?? '';
|
|
6
|
-
|
|
7
|
+
const matchedMenu = items.find((menu) => {
|
|
8
|
+
const regex = new RegExp(`${urlValue}(?![\\w-])`);
|
|
9
|
+
return regex.test(menu.url);
|
|
10
|
+
});
|
|
11
|
+
return matchedMenu?.children ?? [];
|
|
7
12
|
};
|