@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.
@@ -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, registerLocaleData } from '@angular/common';
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';
@@ -1090,6 +1090,7 @@ const initialState = {
1090
1090
  isSidebarExpandOnHover: true,
1091
1091
  hasSidebar: false,
1092
1092
  hasHeader: false,
1093
+ hasBreadcrumbs: false,
1093
1094
  hasHeaderLogo: false,
1094
1095
  hasHeaderEnvironment: false,
1095
1096
  hasToolbar: false,
@@ -1210,6 +1211,9 @@ class UxAppShellService {
1210
1211
  set isBlockDocumentActive(isActive) {
1211
1212
  this.setState(Object.assign(Object.assign({}, this.state), { isBlockDocumentActive: isActive }));
1212
1213
  }
1214
+ get hasHeader() {
1215
+ return this.state.hasHeader;
1216
+ }
1213
1217
  // Edit mode
1214
1218
  get isDimmerActive() {
1215
1219
  return this.state.isDimmerActive;
@@ -1316,6 +1320,10 @@ class UxAppShellService {
1316
1320
  this.setState(Object.assign(Object.assign({}, this.state), { hasHeader: true }));
1317
1321
  this.activateHeaderCssVars();
1318
1322
  }
1323
+ activateBreadcrumbs() {
1324
+ this.setState(Object.assign(Object.assign({}, this.state), { hasBreadcrumbs: true }));
1325
+ this.activateBreadcrumbsCssVars();
1326
+ }
1319
1327
  activateTopMessage(height) {
1320
1328
  this.setState(Object.assign(Object.assign({}, this.state), { hasTopMessage: true }));
1321
1329
  this.activateTopMessageCssVars(height);
@@ -1332,6 +1340,8 @@ class UxAppShellService {
1332
1340
  '--eui-app-header-height-default',
1333
1341
  '--eui-app-header-height-active',
1334
1342
  '--eui-app-header-height-shrink',
1343
+ '--eui-app-breadcrumbs-height-default',
1344
+ '--eui-app-breadcrumbs-height-active',
1335
1345
  '--eui-app-top-message-height-default',
1336
1346
  '--eui-app-top-message-height-active',
1337
1347
  '--eui-app-top-message-height-shrink',
@@ -1352,6 +1362,7 @@ class UxAppShellService {
1352
1362
  }
1353
1363
  initCssVars() {
1354
1364
  this.setCssVar('--eui-app-header-height-default', '--eui-app-header-height');
1365
+ this.setCssVar('--eui-app-breadcrumbs-height-default', '--eui-app-breadcrumbs-height');
1355
1366
  this.setCssVar('--eui-app-top-message-height-default', '--eui-app-top-message-height');
1356
1367
  this.setCssVar('--eui-app-toolbar-height-default', '--eui-app-toolbar-height');
1357
1368
  this.setCssVar('--eui-app-sidebar-width-default', '--eui-app-sidebar-width');
@@ -1362,6 +1373,9 @@ class UxAppShellService {
1362
1373
  activateHeaderCssVars() {
1363
1374
  this.setCssVar('--eui-app-header-height-active', '--eui-app-header-height');
1364
1375
  }
1376
+ activateBreadcrumbsCssVars() {
1377
+ this.setCssVar('--eui-app-breadcrumbs-height-active', '--eui-app-breadcrumbs-height');
1378
+ }
1365
1379
  activateTopMessageCssVars(height) {
1366
1380
  this._setCssVarValue('--eui-app-top-message-height', `${height}px`);
1367
1381
  }
@@ -4052,23 +4066,31 @@ class LocaleService extends EuiService {
4052
4066
  * @param locale array of locale to load
4053
4067
  */
4054
4068
  loadLocale(locale) {
4055
- locale = Array.isArray(locale) ? locale : [locale];
4056
- const localeImports = this.filterRegisteredLocales(locale).map(this.importDataAndExtraLocale.bind(this));
4057
- // in case localeImports array is empty because locale exists, Observable still needs to complete
4058
- if (localeImports.length < 1) {
4059
- return of({ success: true });
4060
- }
4061
- return forkJoin(...localeImports).pipe(takeUntil(this.subNotifier), map(localeData => {
4062
- // filter out null results and registerLocaleData including extra
4063
- localeData.filter(({ data }) => data)
4064
- .forEach(({ data, localeId, extraData }) => registerLocaleData(data, localeId, extraData));
4065
- return { success: true };
4066
- }), catchError(error => {
4067
- if (this.log) {
4068
- this.logger.debug(`Locale load error: ${error.message}`, error);
4069
- }
4070
- return of({ success: false, error: error });
4071
- }));
4069
+ // locale = Array.isArray(locale) ? locale : [locale];
4070
+ // const localeImports: Observable<{ data: any, localeId: string, extraData: any }>[]
4071
+ // = this.filterRegisteredLocales(locale).map(this.importDataAndExtraLocale.bind(this));
4072
+ //
4073
+ // // in case localeImports array is empty because locale exists, Observable still needs to complete
4074
+ // if (localeImports.length < 1) {
4075
+ // return of({ success: true });
4076
+ // }
4077
+ //
4078
+ // return forkJoin(...localeImports).pipe(
4079
+ // takeUntil(this.subNotifier),
4080
+ // map(localeData => {
4081
+ // // filter out null results and registerLocaleData including extra
4082
+ // localeData.filter(({ data }) => data)
4083
+ // .forEach(({ data, localeId, extraData }) => registerLocaleData(data, localeId, extraData));
4084
+ // return { success: true };
4085
+ // }),
4086
+ // catchError(error => {
4087
+ // if (this.log) {
4088
+ // this.logger.debug(`Locale load error: ${error.message}`, error);
4089
+ // }
4090
+ // return of({ success: false, error: error });
4091
+ // })
4092
+ // );
4093
+ return of({ success: true });
4072
4094
  }
4073
4095
  /**
4074
4096
  * listen for language changes and dynamically set locale accordingly. In case of non registered locale register it
@@ -4139,57 +4161,6 @@ class LocaleService extends EuiService {
4139
4161
  }
4140
4162
  });
4141
4163
  }
4142
- /**
4143
- * returns an Observable which loads the locale based on provided ID
4144
- *
4145
- * @param id the locale id e.g. en, el-CY
4146
- * @private
4147
- */
4148
- importLocale(id) {
4149
- // in case of an error, catch it and return null
4150
- return import(
4151
- /* webpackExclude: /\.d\.ts$/ */
4152
- /* webpackMode: "lazy-once" */
4153
- /* webpackChunkName: "i18n-base" */
4154
- `@/../node_modules/@angular/common/locales/${id}`)
4155
- .then(m => m.default)
4156
- .catch(error => {
4157
- if (this.log) {
4158
- this.logger.debug(`Locale with ID: "${id}" failed to load. Error: ${error.message}`, error);
4159
- }
4160
- return null;
4161
- });
4162
- }
4163
- /**
4164
- * returns a Promise which loads the locale based on provided ID
4165
- *
4166
- * @param id the locale id e.g. en, el-CY
4167
- * @private
4168
- */
4169
- importExtraLocale(id) {
4170
- // in case of an error, catch it and return null
4171
- return import(
4172
- /* webpackExclude: /\.d\.ts$/ */
4173
- /* webpackMode: "lazy-once" */
4174
- /* webpackChunkName: "i18n-extra" */
4175
- `@/../node_modules/@angular/common/locales/extra/${id}`)
4176
- .then(m => m.default)
4177
- .catch(error => {
4178
- if (this.log) {
4179
- this.logger.debug(`Extra Locale with ID: "${id}" failed to load. Error: ${error.message}`, error);
4180
- }
4181
- return null;
4182
- });
4183
- }
4184
- /**
4185
- * Imports Locale and then Extra. It returns the Object which registerLocale(...) function needs.
4186
- *
4187
- * @param localeId The id of the locale
4188
- * @private
4189
- */
4190
- importDataAndExtraLocale(localeId) {
4191
- return from(this.importLocale(localeId)).pipe(mergeMap((data) => from(this.importExtraLocale(localeId)).pipe(map((extraData) => Object.assign({}, { data, localeId, extraData }))), 1));
4192
- }
4193
4164
  }
4194
4165
  /** @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 });
4195
4166
  /** @nocollapse */ LocaleService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.0-next.4", ngImport: i0, type: LocaleService, providedIn: 'root' });