@eui/core 15.0.0-next.9 → 15.0.0-rc.2
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 +8 -2
- package/docs/injectables/UxAppShellService.html +94 -0
- 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/locale/locale.service.mjs +29 -72
- package/esm2020/lib/services/ux-app-shell.service.mjs +18 -1
- package/fesm2015/eui-core.mjs +40 -69
- package/fesm2015/eui-core.mjs.map +1 -1
- package/fesm2020/eui-core.mjs +43 -69
- package/fesm2020/eui-core.mjs.map +1 -1
- package/lib/services/locale/locale.service.d.ts +0 -21
- package/lib/services/locale/locale.service.d.ts.map +1 -1
- package/lib/services/ux-app-shell.service.d.ts +4 -0
- package/lib/services/ux-app-shell.service.d.ts.map +1 -1
- package/package.json +1 -1
package/fesm2020/eui-core.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { InjectionToken, Injectable, Inject, Injector, NgModule, Optional, APP_I
|
|
|
6
6
|
import * as extendProxy from 'extend';
|
|
7
7
|
import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core';
|
|
8
8
|
import { MomentDateAdapter } from '@angular/material-moment-adapter';
|
|
9
|
-
import { LOCATION_INITIALIZED, DOCUMENT, isPlatformBrowser, getLocaleId
|
|
9
|
+
import { LOCATION_INITIALIZED, DOCUMENT, isPlatformBrowser, getLocaleId } from '@angular/common';
|
|
10
10
|
import { throwError, forkJoin, of, BehaviorSubject, defer, merge, fromEvent, Observable, Subject, from } from 'rxjs';
|
|
11
11
|
import { debounceTime, distinctUntilChanged, map, catchError, switchMap, tap, filter, take, mapTo, mergeMap, concatMap, takeUntil } from 'rxjs/operators';
|
|
12
12
|
import * as i1$1 from '@ngrx/store';
|
|
@@ -1101,6 +1101,7 @@ const initialState = {
|
|
|
1101
1101
|
isSidebarExpandOnHover: true,
|
|
1102
1102
|
hasSidebar: false,
|
|
1103
1103
|
hasHeader: false,
|
|
1104
|
+
hasBreadcrumbs: false,
|
|
1104
1105
|
hasHeaderLogo: false,
|
|
1105
1106
|
hasHeaderEnvironment: false,
|
|
1106
1107
|
hasToolbar: false,
|
|
@@ -1243,6 +1244,9 @@ class UxAppShellService {
|
|
|
1243
1244
|
isBlockDocumentActive: isActive,
|
|
1244
1245
|
});
|
|
1245
1246
|
}
|
|
1247
|
+
get hasHeader() {
|
|
1248
|
+
return this.state.hasHeader;
|
|
1249
|
+
}
|
|
1246
1250
|
// Edit mode
|
|
1247
1251
|
get isDimmerActive() {
|
|
1248
1252
|
return this.state.isDimmerActive;
|
|
@@ -1370,6 +1374,13 @@ class UxAppShellService {
|
|
|
1370
1374
|
});
|
|
1371
1375
|
this.activateHeaderCssVars();
|
|
1372
1376
|
}
|
|
1377
|
+
activateBreadcrumbs() {
|
|
1378
|
+
this.setState({
|
|
1379
|
+
...this.state,
|
|
1380
|
+
hasBreadcrumbs: true,
|
|
1381
|
+
});
|
|
1382
|
+
this.activateBreadcrumbsCssVars();
|
|
1383
|
+
}
|
|
1373
1384
|
activateTopMessage(height) {
|
|
1374
1385
|
this.setState({
|
|
1375
1386
|
...this.state,
|
|
@@ -1395,6 +1406,8 @@ class UxAppShellService {
|
|
|
1395
1406
|
'--eui-app-header-height-default',
|
|
1396
1407
|
'--eui-app-header-height-active',
|
|
1397
1408
|
'--eui-app-header-height-shrink',
|
|
1409
|
+
'--eui-app-breadcrumbs-height-default',
|
|
1410
|
+
'--eui-app-breadcrumbs-height-active',
|
|
1398
1411
|
'--eui-app-top-message-height-default',
|
|
1399
1412
|
'--eui-app-top-message-height-active',
|
|
1400
1413
|
'--eui-app-top-message-height-shrink',
|
|
@@ -1415,6 +1428,7 @@ class UxAppShellService {
|
|
|
1415
1428
|
}
|
|
1416
1429
|
initCssVars() {
|
|
1417
1430
|
this.setCssVar('--eui-app-header-height-default', '--eui-app-header-height');
|
|
1431
|
+
this.setCssVar('--eui-app-breadcrumbs-height-default', '--eui-app-breadcrumbs-height');
|
|
1418
1432
|
this.setCssVar('--eui-app-top-message-height-default', '--eui-app-top-message-height');
|
|
1419
1433
|
this.setCssVar('--eui-app-toolbar-height-default', '--eui-app-toolbar-height');
|
|
1420
1434
|
this.setCssVar('--eui-app-sidebar-width-default', '--eui-app-sidebar-width');
|
|
@@ -1425,6 +1439,9 @@ class UxAppShellService {
|
|
|
1425
1439
|
activateHeaderCssVars() {
|
|
1426
1440
|
this.setCssVar('--eui-app-header-height-active', '--eui-app-header-height');
|
|
1427
1441
|
}
|
|
1442
|
+
activateBreadcrumbsCssVars() {
|
|
1443
|
+
this.setCssVar('--eui-app-breadcrumbs-height-active', '--eui-app-breadcrumbs-height');
|
|
1444
|
+
}
|
|
1428
1445
|
activateTopMessageCssVars(height) {
|
|
1429
1446
|
this._setCssVarValue('--eui-app-top-message-height', `${height}px`);
|
|
1430
1447
|
}
|
|
@@ -4107,23 +4124,31 @@ class LocaleService extends EuiService {
|
|
|
4107
4124
|
* @param locale array of locale to load
|
|
4108
4125
|
*/
|
|
4109
4126
|
loadLocale(locale) {
|
|
4110
|
-
locale = Array.isArray(locale) ? locale : [locale];
|
|
4111
|
-
const localeImports
|
|
4112
|
-
//
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
return
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
})
|
|
4127
|
+
// locale = Array.isArray(locale) ? locale : [locale];
|
|
4128
|
+
// const localeImports: Observable<{ data: any, localeId: string, extraData: any }>[]
|
|
4129
|
+
// = this.filterRegisteredLocales(locale).map(this.importDataAndExtraLocale.bind(this));
|
|
4130
|
+
//
|
|
4131
|
+
// // in case localeImports array is empty because locale exists, Observable still needs to complete
|
|
4132
|
+
// if (localeImports.length < 1) {
|
|
4133
|
+
// return of({ success: true });
|
|
4134
|
+
// }
|
|
4135
|
+
//
|
|
4136
|
+
// return forkJoin(...localeImports).pipe(
|
|
4137
|
+
// takeUntil(this.subNotifier),
|
|
4138
|
+
// map(localeData => {
|
|
4139
|
+
// // filter out null results and registerLocaleData including extra
|
|
4140
|
+
// localeData.filter(({ data }) => data)
|
|
4141
|
+
// .forEach(({ data, localeId, extraData }) => registerLocaleData(data, localeId, extraData));
|
|
4142
|
+
// return { success: true };
|
|
4143
|
+
// }),
|
|
4144
|
+
// catchError(error => {
|
|
4145
|
+
// if (this.log) {
|
|
4146
|
+
// this.logger.debug(`Locale load error: ${error.message}`, error);
|
|
4147
|
+
// }
|
|
4148
|
+
// return of({ success: false, error: error });
|
|
4149
|
+
// })
|
|
4150
|
+
// );
|
|
4151
|
+
return of({ success: true });
|
|
4127
4152
|
}
|
|
4128
4153
|
/**
|
|
4129
4154
|
* listen for language changes and dynamically set locale accordingly. In case of non registered locale register it
|
|
@@ -4194,57 +4219,6 @@ class LocaleService extends EuiService {
|
|
|
4194
4219
|
}
|
|
4195
4220
|
});
|
|
4196
4221
|
}
|
|
4197
|
-
/**
|
|
4198
|
-
* returns an Observable which loads the locale based on provided ID
|
|
4199
|
-
*
|
|
4200
|
-
* @param id the locale id e.g. en, el-CY
|
|
4201
|
-
* @private
|
|
4202
|
-
*/
|
|
4203
|
-
importLocale(id) {
|
|
4204
|
-
// in case of an error, catch it and return null
|
|
4205
|
-
return import(
|
|
4206
|
-
/* webpackExclude: /\.d\.ts$/ */
|
|
4207
|
-
/* webpackMode: "lazy-once" */
|
|
4208
|
-
/* webpackChunkName: "i18n-base" */
|
|
4209
|
-
`@/../node_modules/@angular/common/locales/${id}`)
|
|
4210
|
-
.then(m => m.default)
|
|
4211
|
-
.catch(error => {
|
|
4212
|
-
if (this.log) {
|
|
4213
|
-
this.logger.debug(`Locale with ID: "${id}" failed to load. Error: ${error.message}`, error);
|
|
4214
|
-
}
|
|
4215
|
-
return null;
|
|
4216
|
-
});
|
|
4217
|
-
}
|
|
4218
|
-
/**
|
|
4219
|
-
* returns a Promise which loads the locale based on provided ID
|
|
4220
|
-
*
|
|
4221
|
-
* @param id the locale id e.g. en, el-CY
|
|
4222
|
-
* @private
|
|
4223
|
-
*/
|
|
4224
|
-
importExtraLocale(id) {
|
|
4225
|
-
// in case of an error, catch it and return null
|
|
4226
|
-
return import(
|
|
4227
|
-
/* webpackExclude: /\.d\.ts$/ */
|
|
4228
|
-
/* webpackMode: "lazy-once" */
|
|
4229
|
-
/* webpackChunkName: "i18n-extra" */
|
|
4230
|
-
`@/../node_modules/@angular/common/locales/extra/${id}`)
|
|
4231
|
-
.then(m => m.default)
|
|
4232
|
-
.catch(error => {
|
|
4233
|
-
if (this.log) {
|
|
4234
|
-
this.logger.debug(`Extra Locale with ID: "${id}" failed to load. Error: ${error.message}`, error);
|
|
4235
|
-
}
|
|
4236
|
-
return null;
|
|
4237
|
-
});
|
|
4238
|
-
}
|
|
4239
|
-
/**
|
|
4240
|
-
* Imports Locale and then Extra. It returns the Object which registerLocale(...) function needs.
|
|
4241
|
-
*
|
|
4242
|
-
* @param localeId The id of the locale
|
|
4243
|
-
* @private
|
|
4244
|
-
*/
|
|
4245
|
-
importDataAndExtraLocale(localeId) {
|
|
4246
|
-
return from(this.importLocale(localeId)).pipe(mergeMap((data) => from(this.importExtraLocale(localeId)).pipe(map((extraData) => Object.assign({}, { data, localeId, extraData }))), 1));
|
|
4247
|
-
}
|
|
4248
4222
|
}
|
|
4249
4223
|
/** @nocollapse */ LocaleService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.4", ngImport: i0, type: LocaleService, deps: [{ token: StoreService }, { token: GLOBAL_CONFIG_TOKEN }, { token: LOCALE_ID }, { token: LOCALE_ID_MAPPER, optional: true }, { token: I18nService, optional: true }, { token: LogService, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
4250
4224
|
/** @nocollapse */ LocaleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.4", ngImport: i0, type: LocaleService, providedIn: 'root' });
|