@eui/core 13.0.0-rc.37 → 13.0.0-rc.40
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 +1 -1
- package/docs/injectables/I18nLoader.html +39 -0
- package/docs/injectables/UxAppShellService.html +66 -2
- package/docs/interfaces/UIState.html +45 -0
- package/docs/js/search/search_index.js +2 -2
- package/docs/miscellaneous/variables.html +1 -0
- package/esm2020/lib/services/i18n/i18n.loader.mjs +9 -1
- package/esm2020/lib/services/i18n/i18n.service.mjs +7 -1
- package/esm2020/lib/services/ux-app-shell.service.mjs +12 -9
- package/fesm2015/eui-core.mjs +22 -5
- package/fesm2015/eui-core.mjs.map +1 -1
- package/fesm2020/eui-core.mjs +25 -8
- package/fesm2020/eui-core.mjs.map +1 -1
- package/lib/services/i18n/i18n.loader.d.ts +5 -0
- package/lib/services/i18n/i18n.loader.d.ts.map +1 -1
- package/lib/services/i18n/i18n.service.d.ts.map +1 -1
- package/lib/services/ux-app-shell.service.d.ts +3 -2
- package/lib/services/ux-app-shell.service.d.ts.map +1 -1
- package/package.json +1 -1
package/fesm2015/eui-core.mjs
CHANGED
|
@@ -624,6 +624,7 @@ class I18nLoader {
|
|
|
624
624
|
this.logService = logService;
|
|
625
625
|
this.euiAppConfig = euiAppConfig;
|
|
626
626
|
this.resources = [];
|
|
627
|
+
this.failedResources = [];
|
|
627
628
|
// create the resources from the config object
|
|
628
629
|
const i18nConfig = this.euiAppConfig.global && this.euiAppConfig.global.i18n;
|
|
629
630
|
const i18nLoaderConfig = i18nConfig && i18nConfig.i18nLoader;
|
|
@@ -636,6 +637,7 @@ class I18nLoader {
|
|
|
636
637
|
*/
|
|
637
638
|
getTranslation(lang) {
|
|
638
639
|
return this.loadResources(this.resources, lang).pipe(map((loadedResources) => {
|
|
640
|
+
this.failedResources = loadedResources.hasError ? loadedResources.errors : [];
|
|
639
641
|
return loadedResources.translations;
|
|
640
642
|
}));
|
|
641
643
|
}
|
|
@@ -696,6 +698,12 @@ class I18nLoader {
|
|
|
696
698
|
return of({ hasError: false, translations: {} });
|
|
697
699
|
}
|
|
698
700
|
}
|
|
701
|
+
/**
|
|
702
|
+
* Returns resources that failed
|
|
703
|
+
*/
|
|
704
|
+
getFailedResources() {
|
|
705
|
+
return this.failedResources;
|
|
706
|
+
}
|
|
699
707
|
/**
|
|
700
708
|
* Create resources from a config file
|
|
701
709
|
* @param config loader configuration
|
|
@@ -923,6 +931,12 @@ class I18nService extends EuiLazyService {
|
|
|
923
931
|
this.setDefaultLanguage(this.config.defaultLanguage);
|
|
924
932
|
}
|
|
925
933
|
}), map(() => {
|
|
934
|
+
if (this.translateService.currentLoader instanceof I18nLoader) {
|
|
935
|
+
const failedResources = this.translateService.currentLoader.getFailedResources();
|
|
936
|
+
if (failedResources.length > 0) {
|
|
937
|
+
return { success: false, error: failedResources };
|
|
938
|
+
}
|
|
939
|
+
}
|
|
926
940
|
return { success: true };
|
|
927
941
|
}), catchError((error) => {
|
|
928
942
|
return of({ success: false, error: error });
|
|
@@ -1035,6 +1049,7 @@ const initialState = {
|
|
|
1035
1049
|
isSidebarActive: false,
|
|
1036
1050
|
isSidebarInnerActive: false,
|
|
1037
1051
|
isSidebarStateCloseWithIcons: false,
|
|
1052
|
+
isSidebarExpandOnHover: true,
|
|
1038
1053
|
hasSidebar: false,
|
|
1039
1054
|
hasHeader: false,
|
|
1040
1055
|
hasHeaderLogo: false,
|
|
@@ -1139,7 +1154,9 @@ class UxAppShellService {
|
|
|
1139
1154
|
this.setState(Object.assign(Object.assign({}, this.state), { isSidebarOpen: isOpen }));
|
|
1140
1155
|
}
|
|
1141
1156
|
set isSidebarHover(isHover) {
|
|
1142
|
-
|
|
1157
|
+
if (this.state.isSidebarExpandOnHover) {
|
|
1158
|
+
this.setState(Object.assign(Object.assign({}, this.state), { isSidebarHover: isHover }));
|
|
1159
|
+
}
|
|
1143
1160
|
}
|
|
1144
1161
|
get isSidebarHover() {
|
|
1145
1162
|
return this.state.isSidebarHover;
|
|
@@ -1259,9 +1276,9 @@ class UxAppShellService {
|
|
|
1259
1276
|
this.setState(Object.assign(Object.assign({}, this.state), { hasHeader: true }));
|
|
1260
1277
|
this.activateHeaderCssVars();
|
|
1261
1278
|
}
|
|
1262
|
-
activateTopMessage() {
|
|
1279
|
+
activateTopMessage(height) {
|
|
1263
1280
|
this.setState(Object.assign(Object.assign({}, this.state), { hasTopMessage: true }));
|
|
1264
|
-
this.activateTopMessageCssVars();
|
|
1281
|
+
this.activateTopMessageCssVars(height);
|
|
1265
1282
|
}
|
|
1266
1283
|
activateToolbar() {
|
|
1267
1284
|
this.setState(Object.assign(Object.assign({}, this.state), { hasToolbar: true }));
|
|
@@ -1305,8 +1322,8 @@ class UxAppShellService {
|
|
|
1305
1322
|
activateHeaderCssVars() {
|
|
1306
1323
|
this.setCssVar('--eui-app-header-height-active', '--eui-app-header-height');
|
|
1307
1324
|
}
|
|
1308
|
-
activateTopMessageCssVars() {
|
|
1309
|
-
this.
|
|
1325
|
+
activateTopMessageCssVars(height) {
|
|
1326
|
+
this._setCssVarValue('--eui-app-top-message-height', `${height}px`);
|
|
1310
1327
|
}
|
|
1311
1328
|
activateToolbarCssVars() {
|
|
1312
1329
|
this.setCssVar('--eui-app-toolbar-height-active', '--eui-app-toolbar-height');
|