@stemy/ngx-utils 17.4.1 → 17.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/ngx-utils/common-types.mjs +1 -1
- package/esm2022/ngx-utils/pipes/translate.pipe.mjs +7 -5
- package/esm2022/ngx-utils/services/events.service.mjs +2 -1
- package/esm2022/ngx-utils/services/language.service.mjs +23 -29
- package/esm2022/ngx-utils/services/static-language.service.mjs +34 -7
- package/esm2022/public_api.mjs +1 -1
- package/fesm2022/stemy-ngx-utils.mjs +62 -38
- package/fesm2022/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +2 -1
- package/ngx-utils/ngx-utils.imports.d.ts +2 -2
- package/ngx-utils/pipes/translate.pipe.d.ts +1 -1
- package/ngx-utils/services/events.service.d.ts +1 -0
- package/ngx-utils/services/language.service.d.ts +2 -2
- package/ngx-utils/services/static-language.service.d.ts +6 -2
- package/package.json +1 -1
- package/public_api.d.ts +1 -1
|
@@ -35,8 +35,9 @@ export interface ITranslation {
|
|
|
35
35
|
translation: string;
|
|
36
36
|
}
|
|
37
37
|
export interface ITranslations {
|
|
38
|
-
[key: string]:
|
|
38
|
+
[key: string]: string;
|
|
39
39
|
}
|
|
40
|
+
export type GlobalTranslations = Record<string, ITranslations>;
|
|
40
41
|
export interface ILanguageSetting {
|
|
41
42
|
unavailable?: string;
|
|
42
43
|
[key: string]: string | boolean | number;
|
|
@@ -54,8 +54,8 @@ import { PaginationMenuComponent } from "./components/pagination-menu/pagination
|
|
|
54
54
|
import { UnorderedListComponent } from "./components/unordered-list/unordered-list.component";
|
|
55
55
|
export declare const pipes: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe)[];
|
|
56
56
|
export declare const directives: (typeof AsyncMethodBase | typeof BackgroundDirective | typeof DropdownDirective | typeof DropdownContentDirective | typeof DropdownToggleDirective | typeof DynamicTableTemplateDirective | typeof GlobalTemplateDirective | typeof IconDirective | typeof NgxTemplateOutletDirective | typeof PaginationDirective | typeof PaginationItemDirective | typeof ResourceIfDirective | typeof StickyDirective | typeof StickyClassDirective | typeof UnorderedListItemDirective | typeof UnorderedListTemplateDirective)[];
|
|
57
|
-
export declare const components: (typeof
|
|
58
|
-
export declare const providers: (typeof
|
|
57
|
+
export declare const components: (typeof UnorderedListComponent | typeof DropdownBoxComponent | typeof DynamicTableComponent | typeof PaginationMenuComponent)[];
|
|
58
|
+
export declare const providers: (typeof UniversalService | typeof StateService | typeof AuthGuard | typeof BaseHttpClient | typeof StorageService | typeof BaseHttpService | typeof WasmService | typeof AclService | typeof StaticAuthService | typeof ConfigService | typeof ErrorHandlerService | typeof EventsService | typeof FormatterService | typeof GlobalTemplateService | typeof IconService | typeof StaticLanguageService | typeof OpenApiService | typeof ConsoleToasterService | typeof TranslatedUrlSerializer | typeof PromiseService | typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe | typeof DeviceDetectorService | {
|
|
59
59
|
provide: import("@angular/core").InjectionToken<import("@angular/platform-browser").EventManagerPlugin[]>;
|
|
60
60
|
useClass: typeof ResizeEventPlugin;
|
|
61
61
|
multi: boolean;
|
|
@@ -4,6 +4,7 @@ export declare class EventsService {
|
|
|
4
4
|
readonly eventForwarded: EventEmitter<Event>;
|
|
5
5
|
readonly stickyUpdated: EventEmitter<boolean>;
|
|
6
6
|
readonly languageChanged: EventEmitter<string>;
|
|
7
|
+
readonly editLanguageChanged: EventEmitter<string>;
|
|
7
8
|
private sticky;
|
|
8
9
|
get isSticky(): boolean;
|
|
9
10
|
constructor();
|
|
@@ -3,7 +3,7 @@ import { ILanguageSetting, ILanguageSettings, ITranslations } from "../common-ty
|
|
|
3
3
|
import { StaticLanguageService } from "./static-language.service";
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export declare class LanguageService extends StaticLanguageService {
|
|
6
|
-
protected translationRequests: ITranslations
|
|
6
|
+
protected translationRequests: Record<string, Promise<ITranslations>>;
|
|
7
7
|
protected settingsPromise: Promise<ILanguageSettings>;
|
|
8
8
|
protected languageSettings: BehaviorSubject<ILanguageSettings>;
|
|
9
9
|
get currentLanguage(): string;
|
|
@@ -14,7 +14,7 @@ export declare class LanguageService extends StaticLanguageService {
|
|
|
14
14
|
initFromSettings(): Promise<any>;
|
|
15
15
|
getTranslation(key: string, params?: any): Promise<string>;
|
|
16
16
|
protected useLanguage(lang: string): Promise<ITranslations>;
|
|
17
|
-
|
|
17
|
+
getDictionary(lang?: string): Promise<ITranslations>;
|
|
18
18
|
protected loadSettings(): Promise<ILanguageSettings>;
|
|
19
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<LanguageService, never>;
|
|
20
20
|
static ɵprov: i0.ɵɵInjectableDeclaration<LanguageService>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IConfigService, IConfiguration, ILanguageService, IPromiseService, ITranslation, ITranslations } from "../common-types";
|
|
1
|
+
import { GlobalTranslations, IConfigService, IConfiguration, ILanguageService, IPromiseService, ITranslation, ITranslations } from "../common-types";
|
|
2
2
|
import { EventsService } from "./events.service";
|
|
3
3
|
import { StorageService } from "./storage.service";
|
|
4
4
|
import { UniversalService } from "./universal.service";
|
|
@@ -28,11 +28,14 @@ export declare class StaticLanguageService implements ILanguageService {
|
|
|
28
28
|
protected currentLang: string;
|
|
29
29
|
protected disableTrans: boolean;
|
|
30
30
|
protected languageList: string[];
|
|
31
|
-
protected readonly translations:
|
|
31
|
+
protected readonly translations: GlobalTranslations;
|
|
32
|
+
protected overrideTranslations: GlobalTranslations;
|
|
33
|
+
protected mergedTranslations: GlobalTranslations;
|
|
32
34
|
constructor(events: EventsService, storage: StorageService, configs: IConfigService, promises: IPromiseService, client: BaseHttpClient);
|
|
33
35
|
protected initService(): void;
|
|
34
36
|
replaceLanguages(languages: string[]): void;
|
|
35
37
|
addLanguages(languages: string[]): void;
|
|
38
|
+
setOverrideTranslations(translations: GlobalTranslations): void;
|
|
36
39
|
getTranslationSync(key: string, params?: any): string;
|
|
37
40
|
getTranslation(key: string, params?: any): Promise<string>;
|
|
38
41
|
getTranslations(...keys: string[]): Promise<ITranslations>;
|
|
@@ -41,6 +44,7 @@ export declare class StaticLanguageService implements ILanguageService {
|
|
|
41
44
|
protected interpolate(expr: string | Function, params?: any): string;
|
|
42
45
|
protected interpolateString(expr: string, params?: any): string;
|
|
43
46
|
protected getDefaultLanguage(): string;
|
|
47
|
+
protected mergeTranslations(): void;
|
|
44
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<StaticLanguageService, never>;
|
|
45
49
|
static ɵprov: i0.ɵɵInjectableDeclaration<StaticLanguageService>;
|
|
46
50
|
}
|
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { TypedFactoryProvider, TypedValueProvider, CachedProvider, CachedFactory, OPTIONS_TOKEN, IResolveFactory, CanvasColor, IIconService, ICON_SERVICE, ITranslation, ITranslations, ILanguageSetting, ILanguageSettings, ILanguageService, LANGUAGE_SERVICE, IAuthService, RouteValidator, IRouteData, IRoute, AUTH_SERVICE, IAclComponent, IPromiseService, PROMISE_SERVICE, IWasi, IWasmExports, IWasm, IWasmAsync, WASI_IMPLEMENTATION, IRouteStateInfo, NavigationUrlParam, StorageMode, IToasterService, TOASTER_SERVICE, IAsyncMessage, AsyncMethod, DropdownAttachTo, UnorderedListTemplate, UnorderedListTemplates, UnorderedListStyle, IAjaxRequestDetails, AjaxRequestCallback, ScriptType, IScriptPromises, IStylePromises, ISearchObservable, FactoryDependencies, ObjectType, ITimer, IExtraProperties, IGroupMap, TranslationQuery, IPageInfo, IPaginationData, PaginationDataLoader, PaginationItemContext, IHttpHeaders, IHttpParams, IRequestOptions, IIssueContext, IProgress, ProgressListener, PromiseExecutor, HttpPromise, IHttpService, EXPRESS_REQUEST, IBaseHttpClient, IApiService, API_SERVICE, IOpenApiSchemaProperty, IOpenApiSchema, IOpenApiSchemas, ITableOrders, ITableColumn, ITableColumns, TableColumns, ITableTemplate, ITableTemplates, ITableDataQuery, TableDataLoader, ResourceIfContext, APP_BASE_URL, IConfiguration, IConfigService, CONFIG_SERVICE, BASE_CONFIG, SCRIPT_PARAMS, ROOT_ELEMENT, RESIZE_DELAY, ResizeEventStrategy, RESIZE_STRATEGY, ErrorHandlerCallback, ERROR_HANDLER, GlobalComponentModifier, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
|
|
1
|
+
export { TypedFactoryProvider, TypedValueProvider, CachedProvider, CachedFactory, OPTIONS_TOKEN, IResolveFactory, CanvasColor, IIconService, ICON_SERVICE, ITranslation, ITranslations, GlobalTranslations, ILanguageSetting, ILanguageSettings, ILanguageService, LANGUAGE_SERVICE, IAuthService, RouteValidator, IRouteData, IRoute, AUTH_SERVICE, IAclComponent, IPromiseService, PROMISE_SERVICE, IWasi, IWasmExports, IWasm, IWasmAsync, WASI_IMPLEMENTATION, IRouteStateInfo, NavigationUrlParam, StorageMode, IToasterService, TOASTER_SERVICE, IAsyncMessage, AsyncMethod, DropdownAttachTo, UnorderedListTemplate, UnorderedListTemplates, UnorderedListStyle, IAjaxRequestDetails, AjaxRequestCallback, ScriptType, IScriptPromises, IStylePromises, ISearchObservable, FactoryDependencies, ObjectType, ITimer, IExtraProperties, IGroupMap, TranslationQuery, IPageInfo, IPaginationData, PaginationDataLoader, PaginationItemContext, IHttpHeaders, IHttpParams, IRequestOptions, IIssueContext, IProgress, ProgressListener, PromiseExecutor, HttpPromise, IHttpService, EXPRESS_REQUEST, IBaseHttpClient, IApiService, API_SERVICE, IOpenApiSchemaProperty, IOpenApiSchema, IOpenApiSchemas, ITableOrders, ITableColumn, ITableColumns, TableColumns, ITableTemplate, ITableTemplates, ITableDataQuery, TableDataLoader, ResourceIfContext, APP_BASE_URL, IConfiguration, IConfigService, CONFIG_SERVICE, BASE_CONFIG, SCRIPT_PARAMS, ROOT_ELEMENT, RESIZE_DELAY, ResizeEventStrategy, RESIZE_STRATEGY, ErrorHandlerCallback, ERROR_HANDLER, GlobalComponentModifier, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
|
|
2
2
|
export { AjaxRequestHandler } from "./ngx-utils/utils/ajax-request-handler";
|
|
3
3
|
export { ArrayUtils } from "./ngx-utils/utils/array.utils";
|
|
4
4
|
export { AuthGuard } from "./ngx-utils/utils/auth.guard";
|