@eui/core 19.0.0-next.15 → 19.0.0-next.17
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/docs/dependencies.html +2 -2
- package/docs/index.html +1 -1
- package/docs/injectables/I18nService.html +200 -4
- package/docs/injectables/LocaleService.html +36 -2
- package/docs/interfaces/TranslationKeys.html +223 -0
- package/docs/js/menu-wc.js +3 -0
- package/docs/js/menu-wc_es5.js +1 -1
- package/docs/js/search/search_index.js +2 -2
- package/fesm2022/eui-core.mjs +5 -10
- package/fesm2022/eui-core.mjs.map +1 -1
- package/lib/services/i18n/i18n.loader.d.ts +10 -1
- package/lib/services/i18n/i18n.loader.d.ts.map +1 -1
- package/lib/services/i18n/i18n.service.d.ts +14 -3
- package/lib/services/i18n/i18n.service.d.ts.map +1 -1
- package/lib/services/locale/locale.service.d.ts +2 -1
- package/lib/services/locale/locale.service.d.ts.map +1 -1
- package/package.json +2 -2
package/fesm2022/eui-core.mjs
CHANGED
|
@@ -1955,20 +1955,13 @@ class I18nLoader {
|
|
|
1955
1955
|
* @param lang the resource language to load
|
|
1956
1956
|
* @returns Observable<any>
|
|
1957
1957
|
*/
|
|
1958
|
-
// TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
|
|
1959
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1960
1958
|
loadResource(resource, lang) {
|
|
1961
1959
|
// the path to the resource
|
|
1962
1960
|
const path = resource.getPath(lang);
|
|
1963
1961
|
// load the translations from the path
|
|
1964
1962
|
return this.http.get(path).pipe(
|
|
1965
1963
|
// preprocess the translations using the resource compiler
|
|
1966
|
-
|
|
1967
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1968
|
-
map((translations) => resource.compileTranslations(translations, lang)),
|
|
1969
|
-
// TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
|
|
1970
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1971
|
-
map((translations) => {
|
|
1964
|
+
map((translations) => resource.compileTranslations(translations, lang)), map((translations) => {
|
|
1972
1965
|
// resource loaded properly, send a info message
|
|
1973
1966
|
this.logger?.info(`I18n resource loaded from path ${path}`);
|
|
1974
1967
|
// return the translations
|
|
@@ -2058,8 +2051,10 @@ class I18nService extends EuiLazyService {
|
|
|
2058
2051
|
// Use `runInInjectionContext` to ensure `toObservable` is within Angular injection context
|
|
2059
2052
|
return runInInjectionContext(this.injector, () => toObservable(computedState).pipe(takeUntil(this.subNotifier), distinctUntilChanged((x, y) => isEqual(x, y))));
|
|
2060
2053
|
}
|
|
2061
|
-
updateState(state) {
|
|
2062
|
-
|
|
2054
|
+
updateState(state, reducer) {
|
|
2055
|
+
if (state.activeLang) {
|
|
2056
|
+
this.updateHTMLDOMLang(state.activeLang);
|
|
2057
|
+
}
|
|
2063
2058
|
this.state.update(currentState => super.deepMerge(currentState, { ...state }));
|
|
2064
2059
|
}
|
|
2065
2060
|
/**
|