@hyvor/design 1.1.7 → 1.1.8
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.
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
icon?: boolean;
|
|
17
17
|
size?: 'medium' | 'small';
|
|
18
18
|
staticPage?: boolean;
|
|
19
|
+
goto?: Function; // sveltekit goto function, required for static pages
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
let {
|
|
@@ -24,7 +25,8 @@
|
|
|
24
25
|
caret = IconCaretDown,
|
|
25
26
|
icon = false,
|
|
26
27
|
size = 'medium',
|
|
27
|
-
staticPage = false
|
|
28
|
+
staticPage = false,
|
|
29
|
+
goto,
|
|
28
30
|
}: Props = $props();
|
|
29
31
|
|
|
30
32
|
const i18n = getContext<InternationalizationService>('i18n');
|
|
@@ -43,11 +45,12 @@
|
|
|
43
45
|
}
|
|
44
46
|
const url = new URL(window.location.href);
|
|
45
47
|
url.pathname = url.pathname.replace(`/${currentLocale}`, `/${language.code}`);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
await import('$app/navigation').then(({ goto }) => {
|
|
48
|
+
|
|
49
|
+
if (goto) {
|
|
49
50
|
goto(url.toString());
|
|
50
|
-
}
|
|
51
|
+
} else {
|
|
52
|
+
window.location.href = url.toString();
|
|
53
|
+
}
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
i18n.setLocale(language.code);
|
package/package.json
CHANGED