@eui/core 19.2.2 → 19.2.3-snapshot-1747082195075

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.
@@ -175,6 +175,9 @@
175
175
  <li>
176
176
  <a href="#GrowlHttpErrorCallbackFn" title="packages/eui/packages/core/src/lib/services/errors/http-error-handler-callback-functions.ts" ><b>GrowlHttpErrorCallbackFn</b>&nbsp;&nbsp;&nbsp;(packages/.../http-error-handler-callback-functions.ts)</a>
177
177
  </li>
178
+ <li>
179
+ <a href="#injectOptional" title="packages/eui/packages/core/src/lib/helpers/injector.ts" ><b>injectOptional</b>&nbsp;&nbsp;&nbsp;(packages/.../injector.ts)</a>
180
+ </li>
178
181
  <li>
179
182
  <a href="#isArgumentsChanged" title="packages/eui/packages/core/src/lib/services/store/ngrx_kit.ts" ><b>isArgumentsChanged</b>&nbsp;&nbsp;&nbsp;(packages/.../ngrx_kit.ts)</a>
180
183
  </li>
@@ -2322,6 +2325,93 @@ Does not check only for empty object, because the config can have other (non-lo
2322
2325
  </div>
2323
2326
  <div class="io-description">
2324
2327
 
2328
+ </div>
2329
+ </td>
2330
+ </tr>
2331
+ </tbody>
2332
+ </table>
2333
+ </section> <h3>packages/eui/packages/core/src/lib/helpers/injector.ts</h3>
2334
+ <section data-compodoc="block-methods">
2335
+ <h3></h3> <table class="table table-sm table-bordered">
2336
+ <tbody>
2337
+ <tr>
2338
+ <td class="col-md-4">
2339
+ <a name="injectOptional"></a>
2340
+ <span class="name">
2341
+ <span ><b>injectOptional</b></span>
2342
+ <a href="#injectOptional"><span class="icon ion-ios-link"></span></a>
2343
+ </span>
2344
+ </td>
2345
+ </tr>
2346
+ <tr>
2347
+ <td class="col-md-4">
2348
+ <code>injectOptional(token, injector)</code>
2349
+ </td>
2350
+ </tr>
2351
+
2352
+
2353
+
2354
+
2355
+ <tr>
2356
+ <td class="col-md-4">
2357
+ <div class="io-description"><p>Safely resolves a service from the injector only when needed.
2358
+ Avoids instantiation errors that can occur with <code>inject(..., { optional: true })</code>.</p>
2359
+ </div>
2360
+
2361
+ <div class="io-description">
2362
+ <b>Parameters :</b>
2363
+
2364
+ <table class="params">
2365
+ <thead>
2366
+ <tr>
2367
+ <td>Name</td>
2368
+ <td>Optional</td>
2369
+ <td>Default value</td>
2370
+ <td>Description</td>
2371
+ </tr>
2372
+ </thead>
2373
+ <tbody>
2374
+ <tr>
2375
+ <td>token</td>
2376
+
2377
+ <td>
2378
+ No
2379
+ </td>
2380
+
2381
+ <td>
2382
+ </td>
2383
+
2384
+ <td>
2385
+ <p>The service token to inject</p>
2386
+
2387
+ </td>
2388
+ </tr>
2389
+ <tr>
2390
+ <td>injector</td>
2391
+
2392
+ <td>
2393
+ No
2394
+ </td>
2395
+
2396
+ <td>
2397
+ <code>inject(Injector)</code>
2398
+ </td>
2399
+
2400
+ <td>
2401
+ <p>The injector to use (defaults to the current injector)</p>
2402
+
2403
+ </td>
2404
+ </tr>
2405
+ </tbody>
2406
+ </table>
2407
+ </div>
2408
+ <div class="io-description">
2409
+ <b>Returns : </b> <code>T | null</code>
2410
+
2411
+ </div>
2412
+ <div class="io-description">
2413
+ <p>The service instance or null if unavailable</p>
2414
+
2325
2415
  </div>
2326
2416
  </td>
2327
2417
  </tr>
@@ -2596,6 +2596,23 @@ class CssUtils {
2596
2596
  }
2597
2597
  }
2598
2598
 
2599
+ /**
2600
+ * Safely resolves a service from the injector only when needed.
2601
+ * Avoids instantiation errors that can occur with `inject(..., { optional: true })`.
2602
+ *
2603
+ * @param token The service token to inject
2604
+ * @param injector The injector to use (defaults to the current injector)
2605
+ * @returns The service instance or null if unavailable
2606
+ */
2607
+ function injectOptional(token, injector = inject(Injector)) {
2608
+ try {
2609
+ return injector.get(token, null);
2610
+ }
2611
+ catch {
2612
+ return null;
2613
+ }
2614
+ }
2615
+
2599
2616
  /**
2600
2617
  * Service for managing user permissions within the application.
2601
2618
  * This class extends `EuiService` and is responsible for handling user rights and permissions.
@@ -5439,5 +5456,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.9", ngImpor
5439
5456
  * Generated bundle index. Do not edit.
5440
5457
  */
5441
5458
 
5442
- export { ActivatedRouteAction, AddApiQueueItemAction, AddAppLoadedConfigModulesAction, AddLangParamInterceptor, AlertHttpErrorCallbackFn, ApiQueueService, ApiQueueServiceMock, AsyncStorageService, AsyncStorageServiceMock, BASE_LOGGER_NAME_TOKEN, BASE_NAME_TOKEN, BrowserStorageType, CONFIG_TOKEN, CORE_ROOT_GUARD, CachePreventionInterceptor, ConsoleHttpErrorCallbackFn, CoreAppActionTypes, CoreI18nActionTypes, CoreLocaleActionTypes, CoreModule, CoreNotificationsActionTypes, CoreUserActionTypes, CorsSecurityInterceptor, CsrfPreventionInterceptor, CssUtils, DYNAMIC_COMPONENT_CONFIG, EUI_CONFIG_TOKEN, EUI_COUNTRIES, EUI_TIMEZONES, EmptyApiQueueAction, ErrorSubClass, EuLoginSessionTimeoutHandlingInterceptor, EuiAppShellService, EuiCoreRootGuardClass, EuiDynamicComponentService, EuiDynamicMenuService, EuiError, EuiGrowlService, EuiLoaderService, EuiPermissionService, EuiTheme, EuiThemeService, EuiTimezoneService, GLOBAL_CONFIG_TOKEN, GlobalErrorHandler, GrowlHttpErrorCallbackFn, HTTP_ERROR_HANDLER_CONFIG_TOKEN, HttpErrorHandlerInterceptor, I18nLoader, I18nResourceImpl, I18nService, InitStoreAction, LANG_PARAM_KEY, LOCALE_ID_MAPPER, LOCAL_FORAGE_SERVICE_CONFIG_TOKEN, LOG_APPENDERS_TOKEN, LOG_LEVEL_TOKEN, LocalForageService, LocalStorageService, LocaleService, LocaleServiceMock, LogHttpErrorCallbackFn, LogModule, LogService, LogServiceMock, MODULE_CONFIG_TOKEN, MODULE_NAME_TOKEN, PLATFORM_BROWSER_ID, ROOT_LOG_CONFIG_TOKEN, RemoveApiQueueItemAction, SHOW_CONNECTION_STATUS_TOKEN, SessionStorageService, Status, StorageService, StorageServiceMock, StoreService, StoreServiceMock, UX_ERROR_MAPPING_HANDLER_TOKEN, UpdateAppConnectionAction, UpdateAppStatusAction, UpdateAppVersionAction, UpdateCurrentModuleAction, UpdateI18nStateAction, UpdateLocaleStateAction, UpdateNotificationsListAction, UpdateUserDashboardAction, UpdateUserDetailsAction, UpdateUserPreferencesAction, UpdateUserRightsAction, UpdateUserStateAction, UserService, UserServiceMock, UxRequestErrorModelInterceptor, closestMatchingParent, consumeEvent, corI18nReducers, coreAppReducers, coreLocaleReducers, coreNotificationsReducers, coreUserReducers, createEuiCoreRootGuard, diffDays, diffDaysFromToday, errorCodes, euiCoreRootGuardClass, euiInitApp, formatNumber, getGlobalConfig, getHttpErrorHandlingConfig, getModuleConfig, getRootLogConfig, getShowConnectionStatus, getViewElement, handleError, isDefined, loadEuiDynamicEnvironmentConfig, loadState, localForage, localStorageSync, markControlsTouched, markFormGroupTouched, mergeAppHandlerConfigToAppConfig, mergeAppJsonConfigToAppConfig, offset, parentOffsetEl, position, preInitApp, prepareEuiAppConfigToken, provideEuiInitializer, coreReducers as reducers, sessionStorageSync, translateConfig, uniqueId, validateEmail };
5459
+ export { ActivatedRouteAction, AddApiQueueItemAction, AddAppLoadedConfigModulesAction, AddLangParamInterceptor, AlertHttpErrorCallbackFn, ApiQueueService, ApiQueueServiceMock, AsyncStorageService, AsyncStorageServiceMock, BASE_LOGGER_NAME_TOKEN, BASE_NAME_TOKEN, BrowserStorageType, CONFIG_TOKEN, CORE_ROOT_GUARD, CachePreventionInterceptor, ConsoleHttpErrorCallbackFn, CoreAppActionTypes, CoreI18nActionTypes, CoreLocaleActionTypes, CoreModule, CoreNotificationsActionTypes, CoreUserActionTypes, CorsSecurityInterceptor, CsrfPreventionInterceptor, CssUtils, DYNAMIC_COMPONENT_CONFIG, EUI_CONFIG_TOKEN, EUI_COUNTRIES, EUI_TIMEZONES, EmptyApiQueueAction, ErrorSubClass, EuLoginSessionTimeoutHandlingInterceptor, EuiAppShellService, EuiCoreRootGuardClass, EuiDynamicComponentService, EuiDynamicMenuService, EuiError, EuiGrowlService, EuiLoaderService, EuiPermissionService, EuiTheme, EuiThemeService, EuiTimezoneService, GLOBAL_CONFIG_TOKEN, GlobalErrorHandler, GrowlHttpErrorCallbackFn, HTTP_ERROR_HANDLER_CONFIG_TOKEN, HttpErrorHandlerInterceptor, I18nLoader, I18nResourceImpl, I18nService, InitStoreAction, LANG_PARAM_KEY, LOCALE_ID_MAPPER, LOCAL_FORAGE_SERVICE_CONFIG_TOKEN, LOG_APPENDERS_TOKEN, LOG_LEVEL_TOKEN, LocalForageService, LocalStorageService, LocaleService, LocaleServiceMock, LogHttpErrorCallbackFn, LogModule, LogService, LogServiceMock, MODULE_CONFIG_TOKEN, MODULE_NAME_TOKEN, PLATFORM_BROWSER_ID, ROOT_LOG_CONFIG_TOKEN, RemoveApiQueueItemAction, SHOW_CONNECTION_STATUS_TOKEN, SessionStorageService, Status, StorageService, StorageServiceMock, StoreService, StoreServiceMock, UX_ERROR_MAPPING_HANDLER_TOKEN, UpdateAppConnectionAction, UpdateAppStatusAction, UpdateAppVersionAction, UpdateCurrentModuleAction, UpdateI18nStateAction, UpdateLocaleStateAction, UpdateNotificationsListAction, UpdateUserDashboardAction, UpdateUserDetailsAction, UpdateUserPreferencesAction, UpdateUserRightsAction, UpdateUserStateAction, UserService, UserServiceMock, UxRequestErrorModelInterceptor, closestMatchingParent, consumeEvent, corI18nReducers, coreAppReducers, coreLocaleReducers, coreNotificationsReducers, coreUserReducers, createEuiCoreRootGuard, diffDays, diffDaysFromToday, errorCodes, euiCoreRootGuardClass, euiInitApp, formatNumber, getGlobalConfig, getHttpErrorHandlingConfig, getModuleConfig, getRootLogConfig, getShowConnectionStatus, getViewElement, handleError, injectOptional, isDefined, loadEuiDynamicEnvironmentConfig, loadState, localForage, localStorageSync, markControlsTouched, markFormGroupTouched, mergeAppHandlerConfigToAppConfig, mergeAppJsonConfigToAppConfig, offset, parentOffsetEl, position, preInitApp, prepareEuiAppConfigToken, provideEuiInitializer, coreReducers as reducers, sessionStorageSync, translateConfig, uniqueId, validateEmail };
5443
5460
  //# sourceMappingURL=eui-core.mjs.map