@odx/angular 12.21.0 → 12.21.1
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/CHANGELOG.md
CHANGED
|
@@ -53,9 +53,12 @@ export class LocalizationService {
|
|
|
53
53
|
setActiveLanguage(language) {
|
|
54
54
|
try {
|
|
55
55
|
const locale = new Intl.Locale(language);
|
|
56
|
-
if (this.availableLanguages.includes(locale.baseName)
|
|
56
|
+
if (this.availableLanguages.includes(locale.baseName)) {
|
|
57
57
|
this.localeState$.next(locale);
|
|
58
58
|
}
|
|
59
|
+
else if (this.availableLanguages.includes(locale.language)) {
|
|
60
|
+
this.localeState$.next(new Intl.Locale(locale.language));
|
|
61
|
+
}
|
|
59
62
|
else {
|
|
60
63
|
throw new Error(`Unrecognizable language '${language}'. Make sure it's a part of availableLanguages inside LocalizationService config.`);
|
|
61
64
|
}
|
|
@@ -95,4 +98,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
95
98
|
type: Injectable,
|
|
96
99
|
args: [{ providedIn: 'root' }]
|
|
97
100
|
}] });
|
|
98
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
101
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxpemF0aW9uLnNlcnZpY2UuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2FuZ3VsYXIvbG9jYWxpemF0aW9uL3NyYy9saWIvbG9jYWxpemF0aW9uLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFVBQVUsRUFBRSxRQUFRLEVBQUUsTUFBTSxFQUFFLHFCQUFxQixFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQ3BGLE9BQU8sRUFBRSxlQUFlLEVBQWMsb0JBQW9CLEVBQUUsTUF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G9hZGVyPy4oKTtcbiAgICBpZiAoaXNPYnNlcnZhYmxlKGxhbmd1YWdlKSkge1xuICAgICAgcmV0dXJuIGxhbmd1YWdlO1xuICAgIH1cbiAgICBpZiAobGFuZ3VhZ2UgaW5zdGFuY2VvZiBQcm9taXNlKSB7XG4gICAgICByZXR1cm4gZnJvbShsYW5ndWFnZSk7XG4gICAgfVxuICAgIHJldHVybiBvZihsYW5ndWFnZSk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -145,9 +145,12 @@ class LocalizationService {
|
|
|
145
145
|
setActiveLanguage(language) {
|
|
146
146
|
try {
|
|
147
147
|
const locale = new Intl.Locale(language);
|
|
148
|
-
if (this.availableLanguages.includes(locale.baseName)
|
|
148
|
+
if (this.availableLanguages.includes(locale.baseName)) {
|
|
149
149
|
this.localeState$.next(locale);
|
|
150
150
|
}
|
|
151
|
+
else if (this.availableLanguages.includes(locale.language)) {
|
|
152
|
+
this.localeState$.next(new Intl.Locale(locale.language));
|
|
153
|
+
}
|
|
151
154
|
else {
|
|
152
155
|
throw new Error(`Unrecognizable language '${language}'. Make sure it's a part of availableLanguages inside LocalizationService config.`);
|
|
153
156
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odx-angular-localization.mjs","sources":["../../../../libs/angular/localization/src/lib/localization.config.ts","../../../../libs/angular/localization/src/lib/localization.logger.ts","../../../../libs/angular/localization/src/lib/localization.service.ts","../../../../libs/angular/localization/src/lib/models/localization-feature.ts","../../../../libs/angular/localization/src/lib/features/with-http-language-header.ts","../../../../libs/angular/localization/src/lib/features/with-http-language-query-param.ts","../../../../libs/angular/localization/src/lib/loaders/browser-language-loader.ts","../../../../libs/angular/localization/src/odx-angular-localization.ts"],"sourcesContent":["import { APP_INITIALIZER, EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { createConfigTokens } from '@odx/angular/utils';\nimport { LocalizationService } from './localization.service';\nimport { LanguageLoaderFn, LocalizationFeature } from './models';\n\nexport const DEFAULT_AVAILABLE_LANGUAGES = ['en-US', 'en-GB', 'en', 'de-DE', 'de', 'es-ES', 'es', 'fr-FR', 'fr-CA', 'fr'];\n\n/**\n * Defines the structure for the localization configuration used throughout the application.\n * It allows specifying available languages, and includes an optional loader\n * function for dynamically determining the active language.\n *\n * @property {LanguageLoaderFn} [activeLanguageLoader] Optional function for loading the\n * active language dynamically, useful for scenarios where the application's language\n * needs to be determined based on user settings, browser settings, or external data.\n * @property {string[]} availableLanguages An array of language codes representing the\n * languages available in the application.\n */\nexport interface LocalizationConfig {\n activeLanguageLoader?: LanguageLoaderFn;\n availableLanguages: string[];\n}\n\n/**\n * Utilizes `createConfigTokens` to generate configuration tokens and related utilities for the\n * localization settings within the application. It defines a structured and type-safe approach\n * for managing localization configurations, such as available languages, and potentially\n * a dynamic loader for the active language. The generated tokens and utilities facilitate accessing\n * and providing these configurations throughout the application.\n *\n * @const {InjectionToken<LocalizationConfig>} LocalizationConfig - An InjectionToken for accessing\n * the localization configuration within Angular's dependency injection framework. Use this token to inject\n * localization configurations into services, components, or other tokens.\n *\n * @const {LocalizationConfig} LocalizationDefaultConfig - The default configuration values for localization,\n * based on the provided settings. Includes the default available languages.\n *\n * @const {Function} injectLocalizationConfig - A utility function that returns the injected value of\n * `LocalizationConfig` token. Use this function to access the current localization configuration in\n * a type-safe manner.\n *\n * @const {Function} provideLocalizationConfig - A utility function to provide the `LocalizationConfig` token\n * with specific values. Use this function to configure and override default localization settings within\n * an Angular module or component.\n *\n * @example\n * ```ts\n * // Providing localization settings in an Angular module\n * @NgModule({\n * providers: [\n * provideLocalizationConfig({\n * availableLanguages: ['en', 'es', 'fr'],\n * })\n * ]\n * })\n * export class AppModule { }\n *\n * // Injecting and using the localization configuration in a service\n * @Injectable({ providedIn: 'root' })\n * export class MyLocalizationService {\n * constructor(@Inject(LocalizationConfig) private config: LocalizationConfig) {\n * console.log('Available languages:', config.availableLanguages);\n * }\n * }\n * ```\n */\nexport const { LocalizationConfig, LocalizationDefaultConfig, injectLocalizationConfig, provideLocalizationConfig } = createConfigTokens(\n 'Localization',\n '@odx/angular/internal/translate',\n {\n availableLanguages: DEFAULT_AVAILABLE_LANGUAGES,\n } as LocalizationConfig,\n);\n\n/**\n * Sets up the localization configuration for the application and initializes the localization\n * system with the provided configuration and features. This function is typically called\n * within the main module or a core module of the application to ensure localization settings\n * are available and active as early as possible.\n *\n * @param {Partial<LocalizationConfig>} config The localization configuration settings, including\n * available languages and optionally, a custom loader for the active language.\n * @param {...LocalizationFeature[]} features Additional localization features or configurations\n * to be registered as part of the application's environment providers.\n * @returns {EnvironmentProviders} A collection of providers for setting up the application's\n * localization environment, to be used with Angular's environment-specific injector configuration.\n * @example\n * ```ts\n * // Example of providing localization settings in an Angular module\n * @NgModule({\n * imports: [...],\n * providers: [\n * provideLocalization({\n * availableLanguages: ['en', 'es', 'fr'],\n * activeLanguageLoader: () => fetch('/api/user/language').then(res => res.text()),\n * }),\n * ],\n * })\n * export class AppModule {}\n * ```\n */\nexport function provideLocalization(config: Partial<LocalizationConfig>, ...features: LocalizationFeature[]): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideLocalizationConfig(config),\n {\n provide: APP_INITIALIZER,\n useFactory: (localizationService: LocalizationService) => () => localizationService.loadActiveLanguage(),\n deps: [LocalizationService],\n multi: true,\n },\n features,\n ]);\n}\n","import { Logger } from '@odx/angular/internal';\n\nexport default new Logger('@odx/angular/localization');\n","import { Injectable, Injector, inject, runInInjectionContext } from '@angular/core';\nimport { BehaviorSubject, Observable, distinctUntilChanged, filter, firstValueFrom, from, isObservable, map, of, shareReplay } from 'rxjs';\nimport { injectLocalizationConfig } from './localization.config';\nimport logger from './localization.logger';\n\n@Injectable({ providedIn: 'root' })\nexport class LocalizationService {\n private readonly localizationConfig = injectLocalizationConfig();\n private readonly injector = inject(Injector);\n private readonly localeState$ = new BehaviorSubject<Intl.Locale | undefined>(new Intl.Locale(this.localizationConfig.availableLanguages[0]));\n\n /**\n * Represents an observable stream of the active language in the localization service.\n * The active language is determined by the locale state.\n *\n * @emits {string} The active language.\n */\n public readonly activeLanguage$ = this.localeState$.pipe(\n filter(Boolean),\n map((x) => x.baseName),\n distinctUntilChanged(),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n\n /**\n * Gets the list of available languages for localization.\n *\n * @type {string[]} The list of available languages.\n */\n public readonly availableLanguages = this.localizationConfig.availableLanguages;\n\n /** Default language derived from the first entry in the available languages list.\n *\n * @type {string}\n */\n public readonly defaultLanguage = this.availableLanguages[0];\n\n /**\n * Retrieves the currently active language. Falls back to the default language if\n * no active language is set.\n *\n * @returns {string} Full locale name e.g. 'en-US' or just 'en' if no region info is attached.\n */\n public getActiveLanguage(): string {\n return this.localeState$.getValue()?.baseName ?? new Intl.Locale(this.defaultLanguage).baseName;\n }\n\n /**\n * Retrieves the active language subtag.\n *\n * @returns {string} The two-digit language subtag, e.g. 'en', 'fr'.\n */\n public getActiveLanguageSubtag(): string {\n return this.localeState$.getValue()?.language ?? new Intl.Locale(this.defaultLanguage).language;\n }\n\n /**\n * Sets the active language based on the provided language code. If the language is not\n * recognized, it logs an error and does not change the active language.\n *\n * @param {string} language The language code to set as the active language.\n */\n public setActiveLanguage(language: string): void {\n try {\n const locale = new Intl.Locale(language);\n if (this.availableLanguages.includes(locale.baseName) || this.availableLanguages.includes(locale.language)) {\n this.localeState$.next(locale);\n } else {\n throw new Error(`Unrecognizable language '${language}'. Make sure it's a part of availableLanguages inside LocalizationService config.`);\n }\n } catch (error) {\n logger.error(error);\n }\n }\n\n /**\n * Loads the active language for the localization service.\n * This method runs in an injection context and sets the active language based on the result of the active language loader.\n * If the active language loader fails, the default language is set as the active language.\n *\n * @returns {Promise<void>} A promise that resolves when the active language is loaded and set.\n */\n public async loadActiveLanguage(): Promise<void> {\n return runInInjectionContext(this.injector, async () => {\n const activeLanguageLoader$ = this.createActiveLanguageLoader$();\n const activeLanguage = await firstValueFrom(activeLanguageLoader$).catch(() => null);\n this.setActiveLanguage(activeLanguage ?? this.defaultLanguage);\n });\n }\n\n private createActiveLanguageLoader$(): Observable<string | undefined> {\n const language = this.localizationConfig.activeLanguageLoader?.();\n if (isObservable(language)) {\n return language;\n }\n if (language instanceof Promise) {\n return from(language);\n }\n return of(language);\n }\n}\n","import { EnvironmentProviders, Provider } from '@angular/core';\n\nexport type LocalizationFeature = EnvironmentProviders & { ɵodxBrand: '@odx/angular/localization::LocalizationFeature' };\n\n/**\n * @internal\n * Creates a feature provider for the localization module.\n *\n * @param {Provider[] | EnvironmentProviders} provider - The providers to be used for the localization feature.\n * @returns {LocalizationFeature} The localization feature provider.\n */\nexport function makeLocalizationFeature(provider: Provider[] | EnvironmentProviders): LocalizationFeature {\n return provider as never as LocalizationFeature;\n}\n","import { HttpInterceptorFn, provideHttpClient, withInterceptors } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { matchUrl } from '@odx/angular/utils';\nimport { switchMap, take } from 'rxjs';\nimport { LocalizationService } from '../localization.service';\nimport { LocalizationFeature, makeLocalizationFeature } from '../models';\n\nexport const HTTP_LANGUAGE_HEADER = 'Accept-Language';\n\n/**\n * Configuration object for the HTTP language header interceptor. It specifies which URLs\n * the interceptor should apply to and allows customizing the name of the header used to transmit\n * the current language setting.\n *\n * @property {Array<string | RegExp>} allowedUrls - An array of strings or RegExp patterns\n * indicating the URLs to which the language header should be added.\n * @property {string} [headerName=HTTP_LANGUAGE_HEADER] - Optional. The name of the HTTP header\n * through which the current language setting will be transmitted. Defaults to 'Accept-Language'.\n */\nexport interface HttpLanguageHeaderInterceptorConfig {\n allowedUrls: Array<string | RegExp>;\n headerName?: string;\n}\n\n/**\n * Creates an HTTP interceptor function that adds a language header to outgoing HTTP requests,\n * but only for URLs matching the provided criteria. This allows the server to respond with\n * resources localized in the user's current language.\n *\n * @param {HttpLanguageHeaderInterceptorConfig} config - The configuration for the interceptor,\n * including the list of allowed URLs and optionally a custom header name.\n * @returns {HttpInterceptorFn} An Angular HTTP interceptor function that conditionally adds\n * the current language as an HTTP header based on the request URL.\n *\n * @example\n * ```ts\n * // Use in HTTP client module setup\n * import { HttpClientModule } from '@angular/common/http';\n * import { httpLanguageHeaderInterceptor, HTTP_LANGUAGE_HEADER } from '@odx/angular/localization';\n *\n * @NgModule({\n * imports: [HttpClientModule],\n * providers: [\n * provideHttpClient(withInterceptors([\n * httpLanguageHeaderInterceptor({ allowedUrls: ['/api'], headerName: HTTP_LANGUAGE_HEADER })\n * ]))\n * ]\n * })\n * export class AppModule {}\n * ```\n */\nexport function httpLanguageHeaderInterceptor({ allowedUrls, headerName }: HttpLanguageHeaderInterceptorConfig): HttpInterceptorFn {\n return (req, next) => {\n const language$ = inject(LocalizationService).activeLanguage$.pipe(take(1));\n for (const allowedUrl of allowedUrls) {\n if (!matchUrl(req.url, allowedUrl)) continue;\n return language$.pipe(switchMap((language) => next(req.clone({ setHeaders: { [headerName ?? HTTP_LANGUAGE_HEADER]: language } }))));\n }\n return next(req);\n };\n}\n\n/**\n * Provides a localization feature that automatically adds a language header to HTTP requests\n * for specified URLs, using the current active language. This function simplifies setting up\n * the HTTP language header interceptor by wrapping it into a LocalizationFeature, making it easy\n * to integrate with the application's localization infrastructure.\n *\n * @param {HttpLanguageHeaderInterceptorConfig} config - The configuration for the language header\n * interceptor, specifying which URLs should include the language header and optionally defining a\n * custom header name.\n * @returns {LocalizationFeature} A localization feature object that can be used to configure\n * the application's localization settings to include automatic language header addition for HTTP requests.\n *\n * @example\n * ```ts\n * // Example usage with the localization provider\n * import { provideLocalization, LocalizationModule, withHttpLanguageHeader } from '@odx/angular/localization';\n *\n * @NgModule({\n * imports: [LocalizationModule],\n * providers: [\n * provideLocalization({}, withHttpLanguageHeader({ allowedUrls: ['/api'] }))\n * ]\n * })\n * export class AppModule {}\n * ```\n */\nexport function withHttpLanguageHeader(config: HttpLanguageHeaderInterceptorConfig): LocalizationFeature {\n const providers = provideHttpClient(withInterceptors([httpLanguageHeaderInterceptor(config)]));\n\n return makeLocalizationFeature(providers);\n}\n","import { HttpInterceptorFn, provideHttpClient, withInterceptors } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { matchUrl } from '@odx/angular/utils';\nimport { switchMap, take } from 'rxjs';\nimport { LocalizationService } from '../localization.service';\nimport { LocalizationFeature, makeLocalizationFeature } from '../models';\n\nexport const HTTP_LANGUAGE_QUERY = 'language';\n\n/**\n * Defines the configuration options for the HTTP interceptor that appends the current\n * language setting as a query parameter to outgoing requests. This configuration specifies\n * which requests should have the language parameter appended based on their URLs.\n *\n * @property {Array<string | RegExp>} allowedUrls - URLs (or patterns matching URLs) to which\n * the language query parameter should be appended.\n * @property {string} [queryParamName=HTTP_LANGUAGE_QUERY] - The name of the query parameter\n * used to transmit the current language. Defaults to 'language'.\n */\nexport interface HttpLanguageQueryParamInterceptorConfig {\n allowedUrls: Array<string | RegExp>;\n queryParamName?: string;\n}\n\n/**\n * Creates an HTTP interceptor function that appends the current language as a query parameter\n * to outgoing HTTP requests that match specified URLs. This interceptor enables dynamic content\n * localization by informing the backend of the user's preferred language.\n *\n * @param {HttpLanguageQueryParamInterceptorConfig} config - Configuration for the interceptor,\n * including allowed URLs and an optional custom name for the query parameter.\n * @returns {HttpInterceptorFn} The interceptor function ready to be applied to the HTTP client.\n *\n * @example\n * ```ts\n * // Applying the interceptor in an Angular module\n * import { HttpClientModule } from '@angular/common/http';\n * import { withHttpLanguageQueryParam } from '@odx/angular/localization';\n *\n * @NgModule({\n * imports: [HttpClientModule],\n * providers: [\n * provideHttpClient(withInterceptors([\n * withHttpLanguageQueryParam({ allowedUrls: ['/api/resources'] })\n * ]))\n * ]\n * })\n * export class ApiModule {}\n * ```\n */\nexport function withHttpLanguageQueryParamInterceptor({ allowedUrls, queryParamName }: HttpLanguageQueryParamInterceptorConfig): HttpInterceptorFn {\n return (req, next) => {\n const language$ = inject(LocalizationService).activeLanguage$.pipe(take(1));\n for (const allowedUrl of allowedUrls) {\n if (!matchUrl(req.url, allowedUrl)) continue;\n return language$.pipe(switchMap((language) => next(req.clone({ setParams: { [queryParamName ?? HTTP_LANGUAGE_QUERY]: language } }))));\n }\n return next(req);\n };\n}\n\n/**\n * Registers the HTTP interceptor that appends the current language as a query parameter to\n * outgoing requests for configured URLs as a localization feature. This utility function\n * simplifies the setup by bundling the interceptor into a feature that can be easily integrated\n * with localization configurations.\n *\n * @param {HttpLanguageQueryParamInterceptorConfig} config - Configuration for appending the\n * language query parameter, including allowed URLs and an optional parameter name.\n * @returns {LocalizationFeature} A localization feature encapsulating the interceptor, ready\n * for integration with the application's localization setup.\n *\n * @example\n * ```ts\n * // Integrating the localization feature in an Angular module\n * import { provideLocalization } from '@angular/core';\n * import { withHttpLanguageQueryParam } from '@odx/angular/localization';\n *\n * @NgModule({\n * providers: [\n * provideLocalization({}, withHttpLanguageQueryParam({ allowedUrls: ['/api'] }))\n * ]\n * })\n * export class AppModule {}\n * ```\n */\nexport function withHttpLanguageQueryParam(config: HttpLanguageQueryParamInterceptorConfig): LocalizationFeature {\n const providers = provideHttpClient(withInterceptors([withHttpLanguageQueryParamInterceptor(config)]));\n\n return makeLocalizationFeature(providers);\n}\n","import { inject } from '@angular/core';\nimport { WindowRef } from '@odx/angular';\nimport { LanguageLoaderFn } from '../models';\n\n/**\n * Asynchronously loads the browser's current language setting by utilizing the `WindowRef` service.\n * This function is intended to be used as a dynamic language loader within a localization configuration,\n * allowing applications to automatically adapt to the user's preferred language as specified in their\n * browser settings.\n *\n * The `WindowRef` service abstracts window-related operations, making it easier to interact with global\n * browser properties and methods in a testable and platform-agnostic way. This function makes use of\n * `WindowRef` to access the navigator's language setting in a safe and Angular-friendly manner.\n *\n * @returns {Promise<string>} A promise that resolves to the language code (e.g., 'en', 'fr') of the\n * browser's currently configured language. This can then be used to set the active language in a\n * localization configuration.\n *\n * @example\n * ```ts\n * // Example usage in a localization configuration\n * import { provideLocalization } from '@odx/angular/utils';\n * import { browserLanguageLoader } from '@odx/angular/localization';\n *\n * @NgModule({\n * providers: [\n * provideLocalization({\n * activeLanguageLoader: browserLanguageLoader,\n * availableLanguages: ['en', 'es', 'fr'],\n * availableLocales: ['en-US', 'es-ES', 'fr-FR']\n * })\n * ]\n * })\n * export class AppModule { }\n * ```\n */\nexport const browserLanguageLoader: LanguageLoaderFn = async () => {\n return inject(WindowRef).getLanguage();\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAKa,MAAA,2BAA2B,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAkB1H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CG;AACU,MAAA,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,GAAG,kBAAkB,CACtI,cAAc,EACd,iCAAiC,EACjC;AACE,IAAA,kBAAkB,EAAE,2BAA2B;AAC1B,CAAA,EACvB;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;SACa,mBAAmB,CAAC,MAAmC,EAAE,GAAG,QAA+B,EAAA;AACzG,IAAA,OAAO,wBAAwB,CAAC;QAC9B,yBAAyB,CAAC,MAAM,CAAC;AACjC,QAAA;AACE,YAAA,OAAO,EAAE,eAAe;AACxB,YAAA,UAAU,EAAE,CAAC,mBAAwC,KAAK,MAAM,mBAAmB,CAAC,kBAAkB,EAAE;YACxG,IAAI,EAAE,CAAC,mBAAmB,CAAC;AAC3B,YAAA,KAAK,EAAE,IAAI;AACZ,SAAA;QACD,QAAQ;AACT,KAAA,CAAC,CAAC;AACL;;AC9GA,aAAe,IAAI,MAAM,CAAC,2BAA2B,CAAC;;MCIzC,mBAAmB,CAAA;AADhC,IAAA,WAAA,GAAA;QAEmB,IAAkB,CAAA,kBAAA,GAAG,wBAAwB,EAAE,CAAC;AAChD,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CA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AAS,CAAC,CAAC,WAAW,EAAE,CAAC;AACzC;;ACtCA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"odx-angular-localization.mjs","sources":["../../../../libs/angular/localization/src/lib/localization.config.ts","../../../../libs/angular/localization/src/lib/localization.logger.ts","../../../../libs/angular/localization/src/lib/localization.service.ts","../../../../libs/angular/localization/src/lib/models/localization-feature.ts","../../../../libs/angular/localization/src/lib/features/with-http-language-header.ts","../../../../libs/angular/localization/src/lib/features/with-http-language-query-param.ts","../../../../libs/angular/localization/src/lib/loaders/browser-language-loader.ts","../../../../libs/angular/localization/src/odx-angular-localization.ts"],"sourcesContent":["import { APP_INITIALIZER, EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { createConfigTokens } from '@odx/angular/utils';\nimport { LocalizationService } from './localization.service';\nimport { LanguageLoaderFn, LocalizationFeature } from './models';\n\nexport const DEFAULT_AVAILABLE_LANGUAGES = ['en-US', 'en-GB', 'en', 'de-DE', 'de', 'es-ES', 'es', 'fr-FR', 'fr-CA', 'fr'];\n\n/**\n * Defines the structure for the localization configuration used throughout the application.\n * It allows specifying available languages, and includes an optional loader\n * function for dynamically determining the active language.\n *\n * @property {LanguageLoaderFn} [activeLanguageLoader] Optional function for loading the\n * active language dynamically, useful for scenarios where the application's language\n * needs to be determined based on user settings, browser settings, or external data.\n * @property {string[]} availableLanguages An array of language codes representing the\n * languages available in the application.\n */\nexport interface LocalizationConfig {\n activeLanguageLoader?: LanguageLoaderFn;\n availableLanguages: string[];\n}\n\n/**\n * Utilizes `createConfigTokens` to generate configuration tokens and related utilities for the\n * localization settings within the application. It defines a structured and type-safe approach\n * for managing localization configurations, such as available languages, and potentially\n * a dynamic loader for the active language. The generated tokens and utilities facilitate accessing\n * and providing these configurations throughout the application.\n *\n * @const {InjectionToken<LocalizationConfig>} LocalizationConfig - An InjectionToken for accessing\n * the localization configuration within Angular's dependency injection framework. Use this token to inject\n * localization configurations into services, components, or other tokens.\n *\n * @const {LocalizationConfig} LocalizationDefaultConfig - The default configuration values for localization,\n * based on the provided settings. Includes the default available languages.\n *\n * @const {Function} injectLocalizationConfig - A utility function that returns the injected value of\n * `LocalizationConfig` token. Use this function to access the current localization configuration in\n * a type-safe manner.\n *\n * @const {Function} provideLocalizationConfig - A utility function to provide the `LocalizationConfig` token\n * with specific values. Use this function to configure and override default localization settings within\n * an Angular module or component.\n *\n * @example\n * ```ts\n * // Providing localization settings in an Angular module\n * @NgModule({\n * providers: [\n * provideLocalizationConfig({\n * availableLanguages: ['en', 'es', 'fr'],\n * })\n * ]\n * })\n * export class AppModule { }\n *\n * // Injecting and using the localization configuration in a service\n * @Injectable({ providedIn: 'root' })\n * export class MyLocalizationService {\n * constructor(@Inject(LocalizationConfig) private config: LocalizationConfig) {\n * console.log('Available languages:', config.availableLanguages);\n * }\n * }\n * ```\n */\nexport const { LocalizationConfig, LocalizationDefaultConfig, injectLocalizationConfig, provideLocalizationConfig } = createConfigTokens(\n 'Localization',\n '@odx/angular/internal/translate',\n {\n availableLanguages: DEFAULT_AVAILABLE_LANGUAGES,\n } as LocalizationConfig,\n);\n\n/**\n * Sets up the localization configuration for the application and initializes the localization\n * system with the provided configuration and features. This function is typically called\n * within the main module or a core module of the application to ensure localization settings\n * are available and active as early as possible.\n *\n * @param {Partial<LocalizationConfig>} config The localization configuration settings, including\n * available languages and optionally, a custom loader for the active language.\n * @param {...LocalizationFeature[]} features Additional localization features or configurations\n * to be registered as part of the application's environment providers.\n * @returns {EnvironmentProviders} A collection of providers for setting up the application's\n * localization environment, to be used with Angular's environment-specific injector configuration.\n * @example\n * ```ts\n * // Example of providing localization settings in an Angular module\n * @NgModule({\n * imports: [...],\n * providers: [\n * provideLocalization({\n * availableLanguages: ['en', 'es', 'fr'],\n * activeLanguageLoader: () => fetch('/api/user/language').then(res => res.text()),\n * }),\n * ],\n * })\n * export class AppModule {}\n * ```\n */\nexport function provideLocalization(config: Partial<LocalizationConfig>, ...features: LocalizationFeature[]): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideLocalizationConfig(config),\n {\n provide: APP_INITIALIZER,\n useFactory: (localizationService: LocalizationService) => () => localizationService.loadActiveLanguage(),\n deps: [LocalizationService],\n multi: true,\n },\n features,\n ]);\n}\n","import { Logger } from '@odx/angular/internal';\n\nexport default new Logger('@odx/angular/localization');\n","import { Injectable, Injector, inject, runInInjectionContext } from '@angular/core';\nimport { BehaviorSubject, Observable, distinctUntilChanged, filter, firstValueFrom, from, isObservable, map, of, shareReplay } from 'rxjs';\nimport { injectLocalizationConfig } from './localization.config';\nimport logger from './localization.logger';\n\n@Injectable({ providedIn: 'root' })\nexport class LocalizationService {\n private readonly localizationConfig = injectLocalizationConfig();\n private readonly injector = inject(Injector);\n private readonly localeState$ = new BehaviorSubject<Intl.Locale | undefined>(new Intl.Locale(this.localizationConfig.availableLanguages[0]));\n\n /**\n * Represents an observable stream of the active language in the localization service.\n * The active language is determined by the locale state.\n *\n * @emits {string} The active language.\n */\n public readonly activeLanguage$ = this.localeState$.pipe(\n filter(Boolean),\n map((x) => x.baseName),\n distinctUntilChanged(),\n shareReplay({ bufferSize: 1, refCount: true }),\n );\n\n /**\n * Gets the list of available languages for localization.\n *\n * @type {string[]} The list of available languages.\n */\n public readonly availableLanguages = this.localizationConfig.availableLanguages;\n\n /** Default language derived from the first entry in the available languages list.\n *\n * @type {string}\n */\n public readonly defaultLanguage = this.availableLanguages[0];\n\n /**\n * Retrieves the currently active language. Falls back to the default language if\n * no active language is set.\n *\n * @returns {string} Full locale name e.g. 'en-US' or just 'en' if no region info is attached.\n */\n public getActiveLanguage(): string {\n return this.localeState$.getValue()?.baseName ?? new Intl.Locale(this.defaultLanguage).baseName;\n }\n\n /**\n * Retrieves the active language subtag.\n *\n * @returns {string} The two-digit language subtag, e.g. 'en', 'fr'.\n */\n public getActiveLanguageSubtag(): string {\n return this.localeState$.getValue()?.language ?? new Intl.Locale(this.defaultLanguage).language;\n }\n\n /**\n * Sets the active language based on the provided language code. If the language is not\n * recognized, it logs an error and does not change the active language.\n *\n * @param {string} language The language code to set as the active language.\n */\n public setActiveLanguage(language: string): void {\n try {\n const locale = new Intl.Locale(language);\n if (this.availableLanguages.includes(locale.baseName)) {\n this.localeState$.next(locale);\n } else if (this.availableLanguages.includes(locale.language)) {\n this.localeState$.next(new Intl.Locale(locale.language));\n } else {\n throw new Error(`Unrecognizable language '${language}'. Make sure it's a part of availableLanguages inside LocalizationService config.`);\n }\n } catch (error) {\n logger.error(error);\n }\n }\n\n /**\n * Loads the active language for the localization service.\n * This method runs in an injection context and sets the active language based on the result of the active language loader.\n * If the active language loader fails, the default language is set as the active language.\n *\n * @returns {Promise<void>} A promise that resolves when the active language is loaded and set.\n */\n public async loadActiveLanguage(): Promise<void> {\n return runInInjectionContext(this.injector, async () => {\n const activeLanguageLoader$ = this.createActiveLanguageLoader$();\n const activeLanguage = await firstValueFrom(activeLanguageLoader$).catch(() => null);\n this.setActiveLanguage(activeLanguage ?? this.defaultLanguage);\n });\n }\n\n private createActiveLanguageLoader$(): Observable<string | undefined> {\n const language = this.localizationConfig.activeLanguageLoader?.();\n if (isObservable(language)) {\n return language;\n }\n if (language instanceof Promise) {\n return from(language);\n }\n return of(language);\n }\n}\n","import { EnvironmentProviders, Provider } from '@angular/core';\n\nexport type LocalizationFeature = EnvironmentProviders & { ɵodxBrand: '@odx/angular/localization::LocalizationFeature' };\n\n/**\n * @internal\n * Creates a feature provider for the localization module.\n *\n * @param {Provider[] | EnvironmentProviders} provider - The providers to be used for the localization feature.\n * @returns {LocalizationFeature} The localization feature provider.\n */\nexport function makeLocalizationFeature(provider: Provider[] | EnvironmentProviders): LocalizationFeature {\n return provider as never as LocalizationFeature;\n}\n","import { HttpInterceptorFn, provideHttpClient, withInterceptors } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { matchUrl } from '@odx/angular/utils';\nimport { switchMap, take } from 'rxjs';\nimport { LocalizationService } from '../localization.service';\nimport { LocalizationFeature, makeLocalizationFeature } from '../models';\n\nexport const HTTP_LANGUAGE_HEADER = 'Accept-Language';\n\n/**\n * Configuration object for the HTTP language header interceptor. It specifies which URLs\n * the interceptor should apply to and allows customizing the name of the header used to transmit\n * the current language setting.\n *\n * @property {Array<string | RegExp>} allowedUrls - An array of strings or RegExp patterns\n * indicating the URLs to which the language header should be added.\n * @property {string} [headerName=HTTP_LANGUAGE_HEADER] - Optional. The name of the HTTP header\n * through which the current language setting will be transmitted. Defaults to 'Accept-Language'.\n */\nexport interface HttpLanguageHeaderInterceptorConfig {\n allowedUrls: Array<string | RegExp>;\n headerName?: string;\n}\n\n/**\n * Creates an HTTP interceptor function that adds a language header to outgoing HTTP requests,\n * but only for URLs matching the provided criteria. This allows the server to respond with\n * resources localized in the user's current language.\n *\n * @param {HttpLanguageHeaderInterceptorConfig} config - The configuration for the interceptor,\n * including the list of allowed URLs and optionally a custom header name.\n * @returns {HttpInterceptorFn} An Angular HTTP interceptor function that conditionally adds\n * the current language as an HTTP header based on the request URL.\n *\n * @example\n * ```ts\n * // Use in HTTP client module setup\n * import { HttpClientModule } from '@angular/common/http';\n * import { httpLanguageHeaderInterceptor, HTTP_LANGUAGE_HEADER } from '@odx/angular/localization';\n *\n * @NgModule({\n * imports: [HttpClientModule],\n * providers: [\n * provideHttpClient(withInterceptors([\n * httpLanguageHeaderInterceptor({ allowedUrls: ['/api'], headerName: HTTP_LANGUAGE_HEADER })\n * ]))\n * ]\n * })\n * export class AppModule {}\n * ```\n */\nexport function httpLanguageHeaderInterceptor({ allowedUrls, headerName }: HttpLanguageHeaderInterceptorConfig): HttpInterceptorFn {\n return (req, next) => {\n const language$ = inject(LocalizationService).activeLanguage$.pipe(take(1));\n for (const allowedUrl of allowedUrls) {\n if (!matchUrl(req.url, allowedUrl)) continue;\n return language$.pipe(switchMap((language) => next(req.clone({ setHeaders: { [headerName ?? HTTP_LANGUAGE_HEADER]: language } }))));\n }\n return next(req);\n };\n}\n\n/**\n * Provides a localization feature that automatically adds a language header to HTTP requests\n * for specified URLs, using the current active language. This function simplifies setting up\n * the HTTP language header interceptor by wrapping it into a LocalizationFeature, making it easy\n * to integrate with the application's localization infrastructure.\n *\n * @param {HttpLanguageHeaderInterceptorConfig} config - The configuration for the language header\n * interceptor, specifying which URLs should include the language header and optionally defining a\n * custom header name.\n * @returns {LocalizationFeature} A localization feature object that can be used to configure\n * the application's localization settings to include automatic language header addition for HTTP requests.\n *\n * @example\n * ```ts\n * // Example usage with the localization provider\n * import { provideLocalization, LocalizationModule, withHttpLanguageHeader } from '@odx/angular/localization';\n *\n * @NgModule({\n * imports: [LocalizationModule],\n * providers: [\n * provideLocalization({}, withHttpLanguageHeader({ allowedUrls: ['/api'] }))\n * ]\n * })\n * export class AppModule {}\n * ```\n */\nexport function withHttpLanguageHeader(config: HttpLanguageHeaderInterceptorConfig): LocalizationFeature {\n const providers = provideHttpClient(withInterceptors([httpLanguageHeaderInterceptor(config)]));\n\n return makeLocalizationFeature(providers);\n}\n","import { HttpInterceptorFn, provideHttpClient, withInterceptors } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { matchUrl } from '@odx/angular/utils';\nimport { switchMap, take } from 'rxjs';\nimport { LocalizationService } from '../localization.service';\nimport { LocalizationFeature, makeLocalizationFeature } from '../models';\n\nexport const HTTP_LANGUAGE_QUERY = 'language';\n\n/**\n * Defines the configuration options for the HTTP interceptor that appends the current\n * language setting as a query parameter to outgoing requests. This configuration specifies\n * which requests should have the language parameter appended based on their URLs.\n *\n * @property {Array<string | RegExp>} allowedUrls - URLs (or patterns matching URLs) to which\n * the language query parameter should be appended.\n * @property {string} [queryParamName=HTTP_LANGUAGE_QUERY] - The name of the query parameter\n * used to transmit the current language. Defaults to 'language'.\n */\nexport interface HttpLanguageQueryParamInterceptorConfig {\n allowedUrls: Array<string | RegExp>;\n queryParamName?: string;\n}\n\n/**\n * Creates an HTTP interceptor function that appends the current language as a query parameter\n * to outgoing HTTP requests that match specified URLs. This interceptor enables dynamic content\n * localization by informing the backend of the user's preferred language.\n *\n * @param {HttpLanguageQueryParamInterceptorConfig} config - Configuration for the interceptor,\n * including allowed URLs and an optional custom name for the query parameter.\n * @returns {HttpInterceptorFn} The interceptor function ready to be applied to the HTTP client.\n *\n * @example\n * ```ts\n * // Applying the interceptor in an Angular module\n * import { HttpClientModule } from '@angular/common/http';\n * import { withHttpLanguageQueryParam } from '@odx/angular/localization';\n *\n * @NgModule({\n * imports: [HttpClientModule],\n * providers: [\n * provideHttpClient(withInterceptors([\n * withHttpLanguageQueryParam({ allowedUrls: ['/api/resources'] })\n * ]))\n * ]\n * })\n * export class ApiModule {}\n * ```\n */\nexport function withHttpLanguageQueryParamInterceptor({ allowedUrls, queryParamName }: HttpLanguageQueryParamInterceptorConfig): HttpInterceptorFn {\n return (req, next) => {\n const language$ = inject(LocalizationService).activeLanguage$.pipe(take(1));\n for (const allowedUrl of allowedUrls) {\n if (!matchUrl(req.url, allowedUrl)) continue;\n return language$.pipe(switchMap((language) => next(req.clone({ setParams: { [queryParamName ?? HTTP_LANGUAGE_QUERY]: language } }))));\n }\n return next(req);\n };\n}\n\n/**\n * Registers the HTTP interceptor that appends the current language as a query parameter to\n * outgoing requests for configured URLs as a localization feature. This utility function\n * simplifies the setup by bundling the interceptor into a feature that can be easily integrated\n * with localization configurations.\n *\n * @param {HttpLanguageQueryParamInterceptorConfig} config - Configuration for appending the\n * language query parameter, including allowed URLs and an optional parameter name.\n * @returns {LocalizationFeature} A localization feature encapsulating the interceptor, ready\n * for integration with the application's localization setup.\n *\n * @example\n * ```ts\n * // Integrating the localization feature in an Angular module\n * import { provideLocalization } from '@angular/core';\n * import { withHttpLanguageQueryParam } from '@odx/angular/localization';\n *\n * @NgModule({\n * providers: [\n * provideLocalization({}, withHttpLanguageQueryParam({ allowedUrls: ['/api'] }))\n * ]\n * })\n * export class AppModule {}\n * ```\n */\nexport function withHttpLanguageQueryParam(config: HttpLanguageQueryParamInterceptorConfig): LocalizationFeature {\n const providers = provideHttpClient(withInterceptors([withHttpLanguageQueryParamInterceptor(config)]));\n\n return makeLocalizationFeature(providers);\n}\n","import { inject } from '@angular/core';\nimport { WindowRef } from '@odx/angular';\nimport { LanguageLoaderFn } from '../models';\n\n/**\n * Asynchronously loads the browser's current language setting by utilizing the `WindowRef` service.\n * This function is intended to be used as a dynamic language loader within a localization configuration,\n * allowing applications to automatically adapt to the user's preferred language as specified in their\n * browser settings.\n *\n * The `WindowRef` service abstracts window-related operations, making it easier to interact with global\n * browser properties and methods in a testable and platform-agnostic way. This function makes use of\n * `WindowRef` to access the navigator's language setting in a safe and Angular-friendly manner.\n *\n * @returns {Promise<string>} A promise that resolves to the language code (e.g., 'en', 'fr') of the\n * browser's currently configured language. This can then be used to set the active language in a\n * localization configuration.\n *\n * @example\n * ```ts\n * // Example usage in a localization configuration\n * import { provideLocalization } from '@odx/angular/utils';\n * import { browserLanguageLoader } from '@odx/angular/localization';\n *\n * @NgModule({\n * providers: [\n * provideLocalization({\n * activeLanguageLoader: browserLanguageLoader,\n * availableLanguages: ['en', 'es', 'fr'],\n * availableLocales: ['en-US', 'es-ES', 'fr-FR']\n * })\n * ]\n * })\n * export class AppModule { }\n * ```\n */\nexport const browserLanguageLoader: LanguageLoaderFn = async () => {\n return inject(WindowRef).getLanguage();\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAKa,MAAA,2BAA2B,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAkB1H;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CG;AACU,MAAA,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,GAAG,kBAAkB,CACtI,cAAc,EACd,iCAAiC,EACjC;AACE,IAAA,kBAAkB,EAAE,2BAA2B;AAC1B,CAAA,EACvB;AAEF;;;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,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC;gBAAE,SAAS;AAC7C,YAAA,OAAO,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,EAAE,CAAC,cAAc,IAAI,mBAAmB,GAAG,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;SACvI;AACD,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;AACnB,KAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AACG,SAAU,0BAA0B,CAAC,MAA+C,EAAA;AACxF,IAAA,MAAM,SAAS,GAAG,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,qCAAqC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAEvG,IAAA,OAAO,uBAAuB,CAAC,SAAS,CAAC,CAAC;AAC5C;;ACtFA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;AACU,MAAA,qBAAqB,GAAqB,YAAW;AAChE,IAAA,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,CAAC;AACzC;;ACtCA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@odx/angular",
|
|
3
|
-
"version": "12.21.
|
|
3
|
+
"version": "12.21.1",
|
|
4
4
|
"author": "Drägerwerk AG & Co.KGaA",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"peerDependencies": {
|
|
@@ -214,18 +214,18 @@
|
|
|
214
214
|
"esm": "./esm2022/components/bar/odx-angular-components-bar.mjs",
|
|
215
215
|
"default": "./fesm2022/odx-angular-components-bar.mjs"
|
|
216
216
|
},
|
|
217
|
-
"./components/breadcrumbs": {
|
|
218
|
-
"types": "./components/breadcrumbs/index.d.ts",
|
|
219
|
-
"esm2022": "./esm2022/components/breadcrumbs/odx-angular-components-breadcrumbs.mjs",
|
|
220
|
-
"esm": "./esm2022/components/breadcrumbs/odx-angular-components-breadcrumbs.mjs",
|
|
221
|
-
"default": "./fesm2022/odx-angular-components-breadcrumbs.mjs"
|
|
222
|
-
},
|
|
223
217
|
"./components/button": {
|
|
224
218
|
"types": "./components/button/index.d.ts",
|
|
225
219
|
"esm2022": "./esm2022/components/button/odx-angular-components-button.mjs",
|
|
226
220
|
"esm": "./esm2022/components/button/odx-angular-components-button.mjs",
|
|
227
221
|
"default": "./fesm2022/odx-angular-components-button.mjs"
|
|
228
222
|
},
|
|
223
|
+
"./components/breadcrumbs": {
|
|
224
|
+
"types": "./components/breadcrumbs/index.d.ts",
|
|
225
|
+
"esm2022": "./esm2022/components/breadcrumbs/odx-angular-components-breadcrumbs.mjs",
|
|
226
|
+
"esm": "./esm2022/components/breadcrumbs/odx-angular-components-breadcrumbs.mjs",
|
|
227
|
+
"default": "./fesm2022/odx-angular-components-breadcrumbs.mjs"
|
|
228
|
+
},
|
|
229
229
|
"./components/button-group": {
|
|
230
230
|
"types": "./components/button-group/index.d.ts",
|
|
231
231
|
"esm2022": "./esm2022/components/button-group/odx-angular-components-button-group.mjs",
|
|
@@ -358,18 +358,18 @@
|
|
|
358
358
|
"esm": "./esm2022/components/logo/odx-angular-components-logo.mjs",
|
|
359
359
|
"default": "./fesm2022/odx-angular-components-logo.mjs"
|
|
360
360
|
},
|
|
361
|
-
"./components/mainfilter-group": {
|
|
362
|
-
"types": "./components/mainfilter-group/index.d.ts",
|
|
363
|
-
"esm2022": "./esm2022/components/mainfilter-group/odx-angular-components-mainfilter-group.mjs",
|
|
364
|
-
"esm": "./esm2022/components/mainfilter-group/odx-angular-components-mainfilter-group.mjs",
|
|
365
|
-
"default": "./fesm2022/odx-angular-components-mainfilter-group.mjs"
|
|
366
|
-
},
|
|
367
361
|
"./components/main-menu": {
|
|
368
362
|
"types": "./components/main-menu/index.d.ts",
|
|
369
363
|
"esm2022": "./esm2022/components/main-menu/odx-angular-components-main-menu.mjs",
|
|
370
364
|
"esm": "./esm2022/components/main-menu/odx-angular-components-main-menu.mjs",
|
|
371
365
|
"default": "./fesm2022/odx-angular-components-main-menu.mjs"
|
|
372
366
|
},
|
|
367
|
+
"./components/mainfilter-group": {
|
|
368
|
+
"types": "./components/mainfilter-group/index.d.ts",
|
|
369
|
+
"esm2022": "./esm2022/components/mainfilter-group/odx-angular-components-mainfilter-group.mjs",
|
|
370
|
+
"esm": "./esm2022/components/mainfilter-group/odx-angular-components-mainfilter-group.mjs",
|
|
371
|
+
"default": "./fesm2022/odx-angular-components-mainfilter-group.mjs"
|
|
372
|
+
},
|
|
373
373
|
"./components/menu": {
|
|
374
374
|
"types": "./components/menu/index.d.ts",
|
|
375
375
|
"esm2022": "./esm2022/components/menu/odx-angular-components-menu.mjs",
|