@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/fesm2020/eui-core.mjs
CHANGED
|
@@ -637,6 +637,7 @@ class I18nLoader {
|
|
|
637
637
|
this.logService = logService;
|
|
638
638
|
this.euiAppConfig = euiAppConfig;
|
|
639
639
|
this.resources = [];
|
|
640
|
+
this.failedResources = [];
|
|
640
641
|
// create the resources from the config object
|
|
641
642
|
const i18nConfig = this.euiAppConfig.global && this.euiAppConfig.global.i18n;
|
|
642
643
|
const i18nLoaderConfig = i18nConfig && i18nConfig.i18nLoader;
|
|
@@ -649,6 +650,7 @@ class I18nLoader {
|
|
|
649
650
|
*/
|
|
650
651
|
getTranslation(lang) {
|
|
651
652
|
return this.loadResources(this.resources, lang).pipe(map((loadedResources) => {
|
|
653
|
+
this.failedResources = loadedResources.hasError ? loadedResources.errors : [];
|
|
652
654
|
return loadedResources.translations;
|
|
653
655
|
}));
|
|
654
656
|
}
|
|
@@ -709,6 +711,12 @@ class I18nLoader {
|
|
|
709
711
|
return of({ hasError: false, translations: {} });
|
|
710
712
|
}
|
|
711
713
|
}
|
|
714
|
+
/**
|
|
715
|
+
* Returns resources that failed
|
|
716
|
+
*/
|
|
717
|
+
getFailedResources() {
|
|
718
|
+
return this.failedResources;
|
|
719
|
+
}
|
|
712
720
|
/**
|
|
713
721
|
* Create resources from a config file
|
|
714
722
|
* @param config loader configuration
|
|
@@ -937,6 +945,12 @@ class I18nService extends EuiLazyService {
|
|
|
937
945
|
this.setDefaultLanguage(this.config.defaultLanguage);
|
|
938
946
|
}
|
|
939
947
|
}), map(() => {
|
|
948
|
+
if (this.translateService.currentLoader instanceof I18nLoader) {
|
|
949
|
+
const failedResources = this.translateService.currentLoader.getFailedResources();
|
|
950
|
+
if (failedResources.length > 0) {
|
|
951
|
+
return { success: false, error: failedResources };
|
|
952
|
+
}
|
|
953
|
+
}
|
|
940
954
|
return { success: true };
|
|
941
955
|
}), catchError((error) => {
|
|
942
956
|
return of({ success: false, error: error });
|
|
@@ -1047,6 +1061,7 @@ const initialState = {
|
|
|
1047
1061
|
isSidebarActive: false,
|
|
1048
1062
|
isSidebarInnerActive: false,
|
|
1049
1063
|
isSidebarStateCloseWithIcons: false,
|
|
1064
|
+
isSidebarExpandOnHover: true,
|
|
1050
1065
|
hasSidebar: false,
|
|
1051
1066
|
hasHeader: false,
|
|
1052
1067
|
hasHeaderLogo: false,
|
|
@@ -1155,10 +1170,12 @@ class UxAppShellService {
|
|
|
1155
1170
|
});
|
|
1156
1171
|
}
|
|
1157
1172
|
set isSidebarHover(isHover) {
|
|
1158
|
-
this.
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1173
|
+
if (this.state.isSidebarExpandOnHover) {
|
|
1174
|
+
this.setState({
|
|
1175
|
+
...this.state,
|
|
1176
|
+
isSidebarHover: isHover,
|
|
1177
|
+
});
|
|
1178
|
+
}
|
|
1162
1179
|
}
|
|
1163
1180
|
get isSidebarHover() {
|
|
1164
1181
|
return this.state.isSidebarHover;
|
|
@@ -1314,12 +1331,12 @@ class UxAppShellService {
|
|
|
1314
1331
|
});
|
|
1315
1332
|
this.activateHeaderCssVars();
|
|
1316
1333
|
}
|
|
1317
|
-
activateTopMessage() {
|
|
1334
|
+
activateTopMessage(height) {
|
|
1318
1335
|
this.setState({
|
|
1319
1336
|
...this.state,
|
|
1320
1337
|
hasTopMessage: true,
|
|
1321
1338
|
});
|
|
1322
|
-
this.activateTopMessageCssVars();
|
|
1339
|
+
this.activateTopMessageCssVars(height);
|
|
1323
1340
|
}
|
|
1324
1341
|
activateToolbar() {
|
|
1325
1342
|
this.setState({
|
|
@@ -1369,8 +1386,8 @@ class UxAppShellService {
|
|
|
1369
1386
|
activateHeaderCssVars() {
|
|
1370
1387
|
this.setCssVar('--eui-app-header-height-active', '--eui-app-header-height');
|
|
1371
1388
|
}
|
|
1372
|
-
activateTopMessageCssVars() {
|
|
1373
|
-
this.
|
|
1389
|
+
activateTopMessageCssVars(height) {
|
|
1390
|
+
this._setCssVarValue('--eui-app-top-message-height', `${height}px`);
|
|
1374
1391
|
}
|
|
1375
1392
|
activateToolbarCssVars() {
|
|
1376
1393
|
this.setCssVar('--eui-app-toolbar-height-active', '--eui-app-toolbar-height');
|