@eui/core 18.0.0-rc.3 → 18.0.0-rc.31

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.
Files changed (111) hide show
  1. package/docs/classes/ActivatedRouteAction.html +13 -9
  2. package/docs/classes/AddApiQueueItemAction.html +13 -9
  3. package/docs/classes/AddAppLoadedConfigModulesAction.html +13 -9
  4. package/docs/classes/ApiQueueServiceMock.html +13 -9
  5. package/docs/classes/AsyncStorageService.html +13 -9
  6. package/docs/classes/AsyncStorageServiceMock.html +13 -9
  7. package/docs/classes/CssUtils.html +13 -9
  8. package/docs/classes/EmptyApiQueueAction.html +13 -9
  9. package/docs/classes/ErrorSubClass.html +13 -9
  10. package/docs/classes/EuiCoreRootGuardClass.html +13 -9
  11. package/docs/classes/EuiError.html +13 -9
  12. package/docs/classes/I18nResourceImpl.html +13 -9
  13. package/docs/classes/InitStoreAction.html +13 -9
  14. package/docs/classes/LogServiceMock.html +13 -9
  15. package/docs/classes/RemoveApiQueueItemAction.html +13 -9
  16. package/docs/classes/RouterMock.html +13 -9
  17. package/docs/classes/StorageService.html +13 -9
  18. package/docs/classes/StorageServiceMock.html +13 -9
  19. package/docs/classes/StoreMock.html +13 -9
  20. package/docs/classes/TranslateServiceMock.html +13 -9
  21. package/docs/classes/UpdateAppConnectionAction.html +13 -9
  22. package/docs/classes/UpdateAppStatusAction.html +13 -9
  23. package/docs/classes/UpdateAppVersionAction.html +13 -9
  24. package/docs/classes/UpdateCurrentModuleAction.html +13 -9
  25. package/docs/classes/UpdateI18nStateAction.html +13 -9
  26. package/docs/classes/UpdateLocaleStateAction.html +13 -9
  27. package/docs/classes/UpdateNotificationsListAction.html +13 -9
  28. package/docs/classes/UpdateUserDashboardAction.html +13 -9
  29. package/docs/classes/UpdateUserDetailsAction.html +13 -9
  30. package/docs/classes/UpdateUserPreferencesAction.html +13 -9
  31. package/docs/classes/UpdateUserRightsAction.html +13 -9
  32. package/docs/classes/UpdateUserStateAction.html +13 -9
  33. package/docs/dependencies.html +36 -32
  34. package/docs/directives/TranslateMockDirective.html +13 -9
  35. package/docs/index.html +14 -10
  36. package/docs/injectables/ApiQueueService.html +13 -9
  37. package/docs/injectables/CoreAppEffects.html +13 -9
  38. package/docs/injectables/EuiAppShellService.html +13 -9
  39. package/docs/injectables/EuiDynamicComponentService.html +13 -9
  40. package/docs/injectables/EuiDynamicMenuService.html +15 -11
  41. package/docs/injectables/EuiGrowlService.html +13 -9
  42. package/docs/injectables/EuiLoaderService.html +13 -9
  43. package/docs/injectables/EuiPermissionService.html +13 -9
  44. package/docs/injectables/EuiThemeService.html +310 -105
  45. package/docs/injectables/EuiTimezoneService.html +13 -9
  46. package/docs/injectables/GlobalErrorHandler.html +13 -9
  47. package/docs/injectables/I18nLoader.html +13 -9
  48. package/docs/injectables/I18nService.html +13 -9
  49. package/docs/injectables/I18nServiceMock.html +13 -9
  50. package/docs/injectables/LocalForageService.html +13 -9
  51. package/docs/injectables/LocalStorageService.html +13 -9
  52. package/docs/injectables/LocaleService.html +13 -9
  53. package/docs/injectables/LocaleServiceMock.html +13 -9
  54. package/docs/injectables/LogService.html +13 -9
  55. package/docs/injectables/SessionStorageService.html +13 -9
  56. package/docs/injectables/StoreService.html +13 -9
  57. package/docs/injectables/StoreServiceMock.html +13 -9
  58. package/docs/injectables/UserService.html +13 -9
  59. package/docs/injectables/UserServiceMock.html +13 -9
  60. package/docs/interceptors/AddLangParamInterceptor.html +13 -9
  61. package/docs/interceptors/CachePreventionInterceptor.html +13 -9
  62. package/docs/interceptors/CorsSecurityInterceptor.html +13 -9
  63. package/docs/interceptors/CsrfPreventionInterceptor.html +13 -9
  64. package/docs/interceptors/EuLoginSessionTimeoutHandlingInterceptor.html +13 -9
  65. package/docs/interceptors/HttpErrorHandlerInterceptor.html +13 -9
  66. package/docs/interceptors/UxRequestErrorModelInterceptor.html +13 -9
  67. package/docs/interfaces/Dependency.html +13 -9
  68. package/docs/interfaces/EuiTimeZone.html +13 -9
  69. package/docs/interfaces/IEuiTheme.html +387 -0
  70. package/docs/interfaces/Library.html +13 -9
  71. package/docs/interfaces/LoadedResources.html +13 -9
  72. package/docs/interfaces/LoadedResourcesError.html +13 -9
  73. package/docs/interfaces/ModuleLoadEvent.html +13 -9
  74. package/docs/interfaces/Policy.html +13 -9
  75. package/docs/interfaces/ResourceError.html +13 -9
  76. package/docs/interfaces/ThemeState.html +309 -0
  77. package/docs/interfaces/UIState.html +13 -9
  78. package/docs/js/libs/bootstrap-native.js +1 -1
  79. package/docs/js/menu-wc.js +6 -0
  80. package/docs/js/menu-wc_es5.js +1 -1
  81. package/docs/js/search/search_index.js +2 -2
  82. package/docs/license.html +13 -9
  83. package/docs/miscellaneous/enumerations.html +79 -15
  84. package/docs/miscellaneous/functions.html +13 -9
  85. package/docs/miscellaneous/typealiases.html +13 -9
  86. package/docs/miscellaneous/variables.html +68 -9
  87. package/docs/modules/CoreModule.html +13 -9
  88. package/docs/modules/I18nModule.html +13 -9
  89. package/docs/modules/LogModule.html +13 -9
  90. package/docs/modules/TranslateMockModule.html +13 -9
  91. package/docs/modules.html +13 -9
  92. package/docs/pipes/TranslateMockPipe.html +13 -9
  93. package/docs/properties.html +13 -9
  94. package/esm2022/index.mjs +3 -1
  95. package/esm2022/lib/services/dynamic-menu/dynamic-menu.service.mjs +2 -5
  96. package/esm2022/lib/services/eui-theme.service.mjs +186 -26
  97. package/esm2022/lib/services/locale/locale.service.mjs +2 -1
  98. package/fesm2022/eui-core.mjs +203 -46
  99. package/fesm2022/eui-core.mjs.map +1 -1
  100. package/index.d.ts +1 -0
  101. package/index.d.ts.map +1 -1
  102. package/lib/helpers/dom-helpers.d.ts.map +1 -1
  103. package/lib/helpers/form-helpers.d.ts +2 -2
  104. package/lib/helpers/form-helpers.d.ts.map +1 -1
  105. package/lib/services/dynamic-menu/dynamic-menu.service.d.ts +5 -5
  106. package/lib/services/dynamic-menu/dynamic-menu.service.d.ts.map +1 -1
  107. package/lib/services/eui-theme.service.d.ts +41 -15
  108. package/lib/services/eui-theme.service.d.ts.map +1 -1
  109. package/lib/services/locale/locale.service.d.ts +1 -0
  110. package/lib/services/locale/locale.service.d.ts.map +1 -1
  111. package/package.json +4 -4
@@ -1,13 +1,14 @@
1
+ import * as i1 from '@eui/base';
2
+ import { LogLevel, ConsoleAppender, initialAppState, initialUserState, initialNotificationsState, initialI18nState, initialLocaleState, Logger, LoggerMock, xhr, getApiQueue, getApiQueueItem, mergeAll, getI18nLoaderConfig, EuiLazyService, getI18nServiceConfigFromBase, getI18nState, getLastAddedModule, getBrowserDefaultLanguage, EuiEuLanguages, getActiveLang, EuiService, getUserRights, getUserState, getLocaleServiceConfigFromBase, getLocaleState, transformToUxHttpResponse } from '@eui/base';
3
+ export * from '@eui/base';
1
4
  import * as i0 from '@angular/core';
2
5
  import { InjectionToken, Injectable, Inject, Injector, NgModule, Optional, APP_INITIALIZER, SkipSelf, ErrorHandler, PLATFORM_ID, LOCALE_ID } from '@angular/core';
3
6
  import * as extendProxy from 'extend';
4
- import * as i1$2 from '@eui/base';
5
- import { LogLevel, ConsoleAppender, initialAppState, initialUserState, initialNotificationsState, initialI18nState, initialLocaleState, Logger, LoggerMock, xhr, getApiQueue, getApiQueueItem, mergeAll, getI18nLoaderConfig, EuiLazyService, getI18nServiceConfigFromBase, getI18nState, getLastAddedModule, getBrowserDefaultLanguage, EuiEuLanguages, getActiveLang, EuiService, getUserRights, getUserState, getLocaleServiceConfigFromBase, getLocaleState, transformToUxHttpResponse } from '@eui/base';
6
- import * as i1 from '@ngrx/effects';
7
+ import * as i1$1 from '@ngrx/effects';
7
8
  import { createEffect, ofType } from '@ngrx/effects';
8
- import { merge, fromEvent, throwError, of, forkJoin, from, BehaviorSubject, defer, firstValueFrom, ReplaySubject, map as map$1, Subject } from 'rxjs';
9
+ import { merge, fromEvent, throwError, of, forkJoin, from, BehaviorSubject, defer, firstValueFrom, Subject } from 'rxjs';
9
10
  import { mapTo, map, mergeMap, tap, debounceTime, distinctUntilChanged, take, switchMap, catchError, concatMap, filter, takeUntil } from 'rxjs/operators';
10
- import * as i1$1 from '@ngx-translate/core';
11
+ import * as i1$2 from '@ngx-translate/core';
11
12
  import { TranslateLoader } from '@ngx-translate/core';
12
13
  import * as i1$3 from '@ngrx/store';
13
14
  import { createSelector } from '@ngrx/store';
@@ -427,15 +428,15 @@ class CoreAppEffects {
427
428
  }
428
429
  })), { dispatch: false });
429
430
  }
430
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: CoreAppEffects, deps: [{ token: i1.Actions }, { token: SHOW_CONNECTION_STATUS_TOKEN }, { token: i1$1.TranslateService }, { token: EuiGrowlService }], target: i0.ɵɵFactoryTarget.Injectable }); }
431
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: CoreAppEffects, deps: [{ token: i1$1.Actions }, { token: SHOW_CONNECTION_STATUS_TOKEN }, { token: i1$2.TranslateService }, { token: EuiGrowlService }], target: i0.ɵɵFactoryTarget.Injectable }); }
431
432
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: CoreAppEffects }); }
432
433
  }
433
434
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: CoreAppEffects, decorators: [{
434
435
  type: Injectable
435
- }], ctorParameters: () => [{ type: i1.Actions }, { type: undefined, decorators: [{
436
+ }], ctorParameters: () => [{ type: i1$1.Actions }, { type: undefined, decorators: [{
436
437
  type: Inject,
437
438
  args: [SHOW_CONNECTION_STATUS_TOKEN]
438
- }] }, { type: i1$1.TranslateService }, { type: EuiGrowlService }] });
439
+ }] }, { type: i1$2.TranslateService }, { type: EuiGrowlService }] });
439
440
 
440
441
  const CoreModuleEffects = [CoreAppEffects];
441
442
 
@@ -711,7 +712,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImpor
711
712
  }], ctorParameters: () => [{ type: undefined, decorators: [{
712
713
  type: Inject,
713
714
  args: [BASE_LOGGER_NAME_TOKEN]
714
- }] }, { type: i1$2.LogLevel, decorators: [{
715
+ }] }, { type: i1.LogLevel, decorators: [{
715
716
  type: Inject,
716
717
  args: [LOG_LEVEL_TOKEN]
717
718
  }] }, { type: undefined, decorators: [{
@@ -2044,7 +2045,7 @@ class I18nService extends EuiLazyService {
2044
2045
  updateHTMLDOMLang(lang) {
2045
2046
  this.document.documentElement.lang = lang;
2046
2047
  }
2047
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: I18nService, deps: [{ token: GLOBAL_CONFIG_TOKEN }, { token: i1$1.TranslateService }, { token: LogService, optional: true }, { token: StoreService }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
2048
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: I18nService, deps: [{ token: GLOBAL_CONFIG_TOKEN }, { token: i1$2.TranslateService }, { token: LogService, optional: true }, { token: StoreService }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable }); }
2048
2049
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: I18nService, providedIn: 'root' }); }
2049
2050
  }
2050
2051
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: I18nService, decorators: [{
@@ -2055,7 +2056,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImpor
2055
2056
  }], ctorParameters: () => [{ type: undefined, decorators: [{
2056
2057
  type: Inject,
2057
2058
  args: [GLOBAL_CONFIG_TOKEN]
2058
- }] }, { type: i1$1.TranslateService }, { type: LogService, decorators: [{
2059
+ }] }, { type: i1$2.TranslateService }, { type: LogService, decorators: [{
2059
2060
  type: Optional
2060
2061
  }] }, { type: StoreService }, { type: Document, decorators: [{
2061
2062
  type: Inject,
@@ -2650,11 +2651,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImpor
2650
2651
  type: Optional
2651
2652
  }] }, { type: StoreService }] });
2652
2653
 
2653
- // TODO: Type of LINK should be UxLink or something relevant. Do we need that service anymore?
2654
- // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html
2655
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
2656
2654
  class EuiDynamicMenuService {
2657
- // TODO: it should be moved euiservice, or it should be static
2655
+ // TODO: it should be moved euiService, or it should be static
2658
2656
  // TODO: can we moved that service inside the module of the component that's using it?
2659
2657
  constructor(euiPermission, store) {
2660
2658
  this.euiPermission = euiPermission;
@@ -2779,7 +2777,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImpor
2779
2777
  type: Injectable
2780
2778
  }], ctorParameters: () => [{ type: i0.ComponentFactoryResolver }, { type: i0.Injector }, { type: i0.ApplicationRef }] });
2781
2779
 
2782
- const initialState = {
2780
+ const initialState$1 = {
2783
2781
  appName: '',
2784
2782
  appShortName: '',
2785
2783
  appSubTitle: '',
@@ -2902,9 +2900,9 @@ class EuiAppShellService {
2902
2900
  this.router = router;
2903
2901
  this.storeService = storeService;
2904
2902
  this.i18nService = i18nService;
2905
- let stateWithConfig = initialState;
2906
- const languages = config?.i18n?.i18nService?.languages || initialState.languages;
2907
- const defaultLanguage = config?.i18n?.i18nService?.defaultLanguage || initialState.activeLanguage;
2903
+ let stateWithConfig = initialState$1;
2904
+ const languages = config?.i18n?.i18nService?.languages || initialState$1.languages;
2905
+ const defaultLanguage = config?.i18n?.i18nService?.defaultLanguage || initialState$1.activeLanguage;
2908
2906
  stateWithConfig = {
2909
2907
  ...stateWithConfig,
2910
2908
  ...{
@@ -3893,46 +3891,204 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImpor
3893
3891
 
3894
3892
  var EuiTheme;
3895
3893
  (function (EuiTheme) {
3896
- EuiTheme["EC"] = "ec";
3897
- EuiTheme["EU"] = "eu";
3898
- EuiTheme["EUI"] = "eui";
3894
+ EuiTheme["DEFAULT"] = "default";
3895
+ EuiTheme["ECL_EC"] = "ecl-ec";
3896
+ EuiTheme["ECL_EC_RTL"] = "ecl-ec-rtl";
3897
+ EuiTheme["ECL_EU"] = "ecl-eu";
3898
+ EuiTheme["ECL_EU_RTL"] = "ecl-eu-rtl";
3899
+ EuiTheme["EUI_LEGACY"] = "eui-legacy";
3900
+ EuiTheme["EUI_LEGACY_HC"] = "eui-legacy-high-contrast";
3901
+ EuiTheme["DARK"] = "dark";
3902
+ EuiTheme["COMPACT"] = "compact";
3899
3903
  })(EuiTheme || (EuiTheme = {}));
3904
+ ;
3905
+ ;
3906
+ const initialState = {
3907
+ themes: [
3908
+ { name: EuiTheme.DEFAULT, isActive: false, styleSheet: null, cssClass: null },
3909
+ { name: EuiTheme.ECL_EC, isActive: false, styleSheet: 'eui-ecl-ec.css', cssClass: null },
3910
+ { name: EuiTheme.ECL_EC_RTL, isActive: false, styleSheet: 'eui-ecl-ec-rtl.css', cssClass: null },
3911
+ { name: EuiTheme.ECL_EU, isActive: false, styleSheet: 'eui-ecl-eu.css', cssClass: null },
3912
+ { name: EuiTheme.ECL_EU_RTL, isActive: false, styleSheet: 'eui-ecl-eu-rtl.css', cssClass: null },
3913
+ { name: EuiTheme.EUI_LEGACY, isActive: false, styleSheet: null, cssClass: 'eui-t-eui-legacy' },
3914
+ { name: EuiTheme.EUI_LEGACY_HC, isActive: false, styleSheet: null, cssClass: 'eui-t-high-contrast' },
3915
+ { name: EuiTheme.DARK, isActive: false, styleSheet: null, cssClass: 'eui-t-dark' },
3916
+ { name: EuiTheme.COMPACT, isActive: false, styleSheet: null, cssClass: 'eui-t-compact' },
3917
+ ],
3918
+ theme: {
3919
+ isDefault: false,
3920
+ isEclEc: false,
3921
+ isEclEcRtl: false,
3922
+ isEclEu: false,
3923
+ isEclEuRtl: false,
3924
+ isEuiLegacy: false,
3925
+ isEuiLegacyHc: false,
3926
+ isDark: false,
3927
+ isCompact: false,
3928
+ },
3929
+ };
3900
3930
  class EuiThemeService {
3901
- constructor(config) {
3931
+ constructor(document, config, asService) {
3932
+ this.document = document;
3902
3933
  this.config = config;
3903
- this.theme = EuiTheme.EC;
3904
- this.themeSubject = new ReplaySubject();
3905
- this.theme$ = this.themeSubject.asObservable();
3906
- this.isEU$ = this.theme$.pipe(map$1((theme) => EuiTheme.EU === theme));
3907
- this.isEC$ = this.theme$.pipe(map$1((theme) => EuiTheme.EC === theme));
3908
- const theme = this.config?.eui?.theme || EuiTheme.EC;
3909
- this.setTheme(theme);
3934
+ this.asService = asService;
3935
+ this._state$ = new BehaviorSubject(initialState);
3936
+ const themeName = this.config?.eui?.theme || EuiTheme.DEFAULT;
3937
+ this.setActiveTheme(themeName, true);
3938
+ }
3939
+ get state$() {
3940
+ return this._state$.asObservable();
3941
+ }
3942
+ get state() {
3943
+ return this._state$.getValue();
3944
+ }
3945
+ isDefault() {
3946
+ return this.state.theme.isDefault;
3947
+ }
3948
+ isEclEc() {
3949
+ return this.state.theme.isEclEc;
3950
+ }
3951
+ isEclEcRtl() {
3952
+ return this.state.theme.isEclEcRtl;
3910
3953
  }
3911
- isECTheme() {
3912
- return EuiTheme.EC === this.theme;
3954
+ isEclEu() {
3955
+ return this.state.theme.isEclEu;
3913
3956
  }
3914
- isEUTheme() {
3915
- return EuiTheme.EU === this.theme;
3957
+ isEclEuRtl() {
3958
+ return this.state.theme.isEclEuRtl;
3959
+ }
3960
+ isEuiLegacy() {
3961
+ return this.state.theme.isEuiLegacy;
3962
+ }
3963
+ isEuiLegacyHc() {
3964
+ return this.state.theme.isEuiLegacyHc;
3965
+ }
3966
+ isDark() {
3967
+ return this.state.theme.isDark;
3968
+ }
3969
+ isCompact() {
3970
+ return this.state.theme.isCompact;
3971
+ }
3972
+ setActiveTheme(theme, isActive) {
3973
+ const themes = this.state.themes;
3974
+ const themeIdx = themes.findIndex(t => t.name === theme);
3975
+ if (themeIdx < 0) {
3976
+ throw new Error('NO_THEME_FOUND');
3977
+ }
3978
+ else {
3979
+ themes[themeIdx].isActive = isActive;
3980
+ const themeFound = themes[themeIdx];
3981
+ const status = initialState.theme;
3982
+ switch (theme) {
3983
+ case EuiTheme.DEFAULT: {
3984
+ status.isDefault = isActive;
3985
+ break;
3986
+ }
3987
+ case EuiTheme.ECL_EC: {
3988
+ status.isEclEc = isActive;
3989
+ break;
3990
+ }
3991
+ case EuiTheme.ECL_EC_RTL: {
3992
+ status.isEclEcRtl = isActive;
3993
+ break;
3994
+ }
3995
+ case EuiTheme.ECL_EU: {
3996
+ status.isEclEu = isActive;
3997
+ break;
3998
+ }
3999
+ case EuiTheme.ECL_EU_RTL: {
4000
+ status.isEclEuRtl = isActive;
4001
+ break;
4002
+ }
4003
+ case EuiTheme.DARK: {
4004
+ status.isDark = isActive;
4005
+ break;
4006
+ }
4007
+ case EuiTheme.COMPACT: {
4008
+ status.isCompact = isActive;
4009
+ break;
4010
+ }
4011
+ case EuiTheme.EUI_LEGACY: {
4012
+ status.isEuiLegacy = isActive;
4013
+ break;
4014
+ }
4015
+ case EuiTheme.EUI_LEGACY_HC: {
4016
+ status.isEuiLegacyHc = isActive;
4017
+ break;
4018
+ }
4019
+ }
4020
+ this._state$.next({
4021
+ themes,
4022
+ theme: status,
4023
+ });
4024
+ this._renderTheme(themeFound, isActive);
4025
+ }
3916
4026
  }
3917
- getTheme() {
3918
- return this.theme;
4027
+ _renderTheme(themeFound, isActive) {
4028
+ if (themeFound.name === EuiTheme.COMPACT) {
4029
+ if (isActive) {
4030
+ this.asService.setBaseFontSize('14px');
4031
+ }
4032
+ else {
4033
+ this.asService.setBaseFontSize('16px');
4034
+ }
4035
+ }
4036
+ else if (themeFound.name === EuiTheme.ECL_EC_RTL || themeFound.name === EuiTheme.ECL_EU_RTL) {
4037
+ const rtlLink = this.document.getElementById('rtl-theme');
4038
+ this._renderThemeCss(themeFound, isActive, rtlLink);
4039
+ }
4040
+ else {
4041
+ const themeLink = this.document.getElementById('eui-theme');
4042
+ this._renderThemeCss(themeFound, isActive, themeLink);
4043
+ }
3919
4044
  }
3920
- setTheme(theme) {
3921
- this.theme = theme;
3922
- this.themeSubject.next(theme);
4045
+ _renderThemeCss(themeFound, isActive, link) {
4046
+ const head = this.document.getElementsByTagName('head')[0];
4047
+ if (isActive) {
4048
+ if (themeFound.cssClass) {
4049
+ document.querySelector('html').classList.add(themeFound.cssClass);
4050
+ }
4051
+ if (themeFound.styleSheet) {
4052
+ if (link) {
4053
+ link.href = themeFound.styleSheet;
4054
+ }
4055
+ else {
4056
+ const style = this.document.createElement('link');
4057
+ style.id = 'eui-theme';
4058
+ style.rel = 'stylesheet';
4059
+ style.href = `assets/${themeFound.styleSheet}`;
4060
+ head.appendChild(style);
4061
+ }
4062
+ }
4063
+ }
4064
+ else {
4065
+ if (themeFound.cssClass) {
4066
+ document.querySelector('html').classList.remove(themeFound.cssClass);
4067
+ }
4068
+ if (themeFound.styleSheet) {
4069
+ if (link) {
4070
+ link.media = '';
4071
+ }
4072
+ }
4073
+ }
3923
4074
  }
3924
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: EuiThemeService, deps: [{ token: GLOBAL_CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
4075
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: EuiThemeService, deps: [{ token: DOCUMENT }, { token: GLOBAL_CONFIG_TOKEN, optional: true }, { token: EuiAppShellService }], target: i0.ɵɵFactoryTarget.Injectable }); }
3925
4076
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: EuiThemeService, providedIn: 'root' }); }
3926
4077
  }
3927
4078
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: EuiThemeService, decorators: [{
3928
4079
  type: Injectable,
3929
- args: [{ providedIn: 'root' }]
3930
- }], ctorParameters: () => [{ type: undefined, decorators: [{
4080
+ args: [{
4081
+ providedIn: 'root',
4082
+ }]
4083
+ }], ctorParameters: () => [{ type: Document, decorators: [{
4084
+ type: Inject,
4085
+ args: [DOCUMENT]
4086
+ }] }, { type: undefined, decorators: [{
3931
4087
  type: Optional
3932
4088
  }, {
3933
4089
  type: Inject,
3934
4090
  args: [GLOBAL_CONFIG_TOKEN]
3935
- }] }] });
4091
+ }] }, { type: EuiAppShellService }] });
3936
4092
 
3937
4093
  /**
3938
4094
  * Generic storage service. Concrete storage services must extend this class
@@ -4267,6 +4423,7 @@ const LOCALE_ID_MAPPER = new InjectionToken('localeIdMapper');
4267
4423
  * - Updating the Angular LOCALE_ID token.
4268
4424
  *
4269
4425
  * @template T - Extends LocaleState, representing the state structure for locales.
4426
+ * @template L - The type of the locale data.
4270
4427
  * @extends EuiService<T | LocaleState>
4271
4428
  */
4272
4429
  class LocaleService extends EuiService {
@@ -4921,12 +5078,12 @@ class AddLangParamInterceptor {
4921
5078
  params: req.params.set(langParam, langValue),
4922
5079
  }));
4923
5080
  }
4924
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AddLangParamInterceptor, deps: [{ token: i1$1.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
5081
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AddLangParamInterceptor, deps: [{ token: i1$2.TranslateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
4925
5082
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AddLangParamInterceptor }); }
4926
5083
  }
4927
5084
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: AddLangParamInterceptor, decorators: [{
4928
5085
  type: Injectable
4929
- }], ctorParameters: () => [{ type: i1$1.TranslateService }] });
5086
+ }], ctorParameters: () => [{ type: i1$2.TranslateService }] });
4930
5087
 
4931
5088
  class CachePreventionInterceptor {
4932
5089
  intercept(req, next) {
@@ -5078,7 +5235,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImpor
5078
5235
  args: [UX_ERROR_MAPPING_HANDLER_TOKEN]
5079
5236
  }] }] });
5080
5237
 
5081
- /* CORE MODULES */
5238
+ /* BASE PACKAGE */
5082
5239
 
5083
5240
  /**
5084
5241
  * Generated bundle index. Do not edit.