@stemy/ngx-utils 19.7.26 → 19.7.27
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/fesm2022/stemy-ngx-utils.mjs +60 -21
- 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 +1 -1
- 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 -1
- package/ngx-utils/services/static-language.service.d.ts +6 -2
- package/package.json +1 -1
- package/public_api.d.ts +1 -1
|
@@ -55,8 +55,9 @@ export interface ITranslation {
|
|
|
55
55
|
translation: string;
|
|
56
56
|
}
|
|
57
57
|
export interface ITranslations {
|
|
58
|
-
[key: string]:
|
|
58
|
+
[key: string]: string;
|
|
59
59
|
}
|
|
60
|
+
export type GlobalTranslations = Record<string, ITranslations>;
|
|
60
61
|
export interface ILanguageSetting {
|
|
61
62
|
unavailable?: string;
|
|
62
63
|
[key: string]: string | boolean | number;
|
|
@@ -64,7 +64,7 @@ import { UploadComponent } from "./components/upload/upload.component";
|
|
|
64
64
|
export declare const pipes: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof SyncAsyncPipe | typeof TranslatePipe)[];
|
|
65
65
|
export declare const directives: (typeof AsyncMethodBase | typeof AsyncMethodTargetDirective | typeof BackgroundDirective | typeof ComponentLoaderDirective | typeof DynamicTableTemplateDirective | typeof GlobalTemplateDirective | typeof IconDirective | typeof NgxTemplateOutletDirective | typeof PaginationDirective | typeof PaginationItemDirective | typeof ResourceIfDirective | typeof StickyDirective | typeof StickyClassDirective | typeof DropdownDirective | typeof DropdownContentDirective | typeof TabsItemDirective | typeof UnorderedListItemDirective | typeof UnorderedListTemplateDirective)[];
|
|
66
66
|
export declare const components: (typeof ChipsComponent | typeof CloseBtnComponent | typeof DropListComponent | typeof DynamicTableComponent | typeof PaginationMenuComponent | typeof UnorderedListComponent | typeof UploadComponent)[];
|
|
67
|
-
export declare const providers: (typeof
|
|
67
|
+
export declare const providers: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof IncludesPipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof SyncAsyncPipe | typeof TranslatePipe | typeof BaseHttpClient | typeof BaseHttpService | typeof AuthGuard | typeof AclService | typeof StaticAuthService | typeof ConfigService | typeof BaseDialogService | typeof ErrorHandlerService | typeof EventsService | typeof FormatterService | typeof GlobalTemplateService | typeof IconService | typeof StaticLanguageService | typeof OpenApiService | typeof PromiseService | typeof SocketService | typeof StateService | typeof StorageService | typeof BaseToasterService | typeof CacheService | typeof ComponentLoaderService | typeof TranslatedUrlSerializer | typeof UniversalService | typeof DeviceDetectorService | {
|
|
68
68
|
provide: import("@angular/core").InjectionToken<import("@angular/platform-browser").EventManagerPlugin[]>;
|
|
69
69
|
useClass: typeof DragDropEventPlugin;
|
|
70
70
|
multi: boolean;
|
|
@@ -4,6 +4,7 @@ export declare class EventsService {
|
|
|
4
4
|
readonly eventForwarded: Subject<Event>;
|
|
5
5
|
readonly stickyUpdated: Subject<boolean>;
|
|
6
6
|
readonly languageChanged: Subject<string>;
|
|
7
|
+
readonly editLanguageChanged: Subject<string>;
|
|
7
8
|
readonly translationsEnabled: Subject<boolean>;
|
|
8
9
|
readonly userChanged: Subject<any>;
|
|
9
10
|
private sticky;
|
|
@@ -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;
|
|
@@ -13,6 +13,7 @@ export declare class LanguageService extends StaticLanguageService {
|
|
|
13
13
|
protected initService(): void;
|
|
14
14
|
initFromSettings(): Promise<any>;
|
|
15
15
|
protected useLanguage(lang: string): Promise<ITranslations>;
|
|
16
|
+
getDictionary(lang: string): Promise<ITranslations>;
|
|
16
17
|
protected loadDictionary(): Promise<ITranslations>;
|
|
17
18
|
protected loadSettings(): Promise<ILanguageSettings>;
|
|
18
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<LanguageService, never>;
|
|
@@ -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";
|
|
@@ -30,11 +30,14 @@ export declare class StaticLanguageService implements ILanguageService {
|
|
|
30
30
|
protected currentLang: string;
|
|
31
31
|
protected enableTrans: boolean;
|
|
32
32
|
protected languageList: string[];
|
|
33
|
-
protected readonly translations:
|
|
33
|
+
protected readonly translations: GlobalTranslations;
|
|
34
|
+
protected overrideTranslations: GlobalTranslations;
|
|
35
|
+
protected mergedTranslations: GlobalTranslations;
|
|
34
36
|
constructor(events: EventsService, storage: StorageService, configs: IConfigService, promises: IPromiseService, client: BaseHttpClient);
|
|
35
37
|
protected initService(): void;
|
|
36
38
|
replaceLanguages(languages: string[]): void;
|
|
37
39
|
addLanguages(languages: string[]): void;
|
|
40
|
+
setOverrideTranslations(translations: GlobalTranslations): void;
|
|
38
41
|
getTranslationSync(key: string, params?: Object): string;
|
|
39
42
|
getTranslation(key: string, params?: any): Promise<string>;
|
|
40
43
|
getTranslations(...keys: string[]): Promise<ITranslations>;
|
|
@@ -45,6 +48,7 @@ export declare class StaticLanguageService implements ILanguageService {
|
|
|
45
48
|
protected interpolate(expr: string | Function, params?: Object): string;
|
|
46
49
|
protected interpolateString(expr: string, params?: Object): string;
|
|
47
50
|
protected getDefaultLanguage(): string;
|
|
51
|
+
protected mergeTranslations(): void;
|
|
48
52
|
static ɵfac: i0.ɵɵFactoryDeclaration<StaticLanguageService, never>;
|
|
49
53
|
static ɵprov: i0.ɵɵInjectableDeclaration<StaticLanguageService>;
|
|
50
54
|
}
|
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "zone.js";
|
|
2
2
|
export { MaybePromise, MaybeArray, KeysOfType, ObjOfType, StringKeys, CapitalizeFirst, CamelJoin, PrefixedPick } from "./ngx-utils/helper-types";
|
|
3
|
-
export { DurationUnit, TypedFactoryProvider, TypedValueProvider, TypedExistingProvider, TypedClassProvider, TypedTokenProvider, TypedProvider, CachedFactory, ResolveFactory, IResolveFactory, CanvasColor, IIconService, ITranslation, ITranslations, ILanguageSetting, ILanguageSettings, ILanguageService, IUserData, IAuthService, RouteValidator, IRouteData, IRoute, IAclComponent, IDialogButtonConfig, IDialogConfig, IConfirmMessageConfig, IConfirmDialogConfig, IDialogService, IPromiseService, IRouteStateInfo, NavigationUrlParam, StorageMode, ToastType, IToasterService, IAsyncMessage, AsyncMethod, IconMap, IconProps, ButtonType, ButtonSize, ButtonProps, TabValue, TabOption, ChipValue, ChipStatus, ChipOption, DropdownAttachTo, UnorderedListTemplate, UnorderedListTemplates, UnorderedListStyle, UploadType, IFileUploadResult, IFileUploadProcess, IAjaxRequestDetails, AjaxRequestCallback, ScriptType, ILoadableElement, ILoaderPromises, ISearchObservable, FactoryDependencies, ObjectType, ITimer, IExtraProperties, IGroupMap, TranslationQuery, IPageInfo, IPaginationData, PaginationDataLoader, PaginationItemContext, IPoint, ShapeIntersection, ShapeDistance, IShape, CanvasResizeMode, CanvasItemDirection, CanvasPaintFunc, RangeCoords, RectCoords, Frame, InteractiveCanvasParams, InteractiveCanvasItem, InteractiveCanvasItems, InteractiveCanvas, InteractiveCanvasRenderer, InteractivePanEvent, InteractiveCanvasPointer, HttpRequestHeaders, HttpRequestQuery, HttpClientRequestOptions, HttpRequestOptions, UploadData, IIssueContext, IProgress, ProgressListener, CacheExpireMode, IHttpService, SvgSourceModifier, IBaseHttpClient, IApiService, DynamicSchemaRef, OpenApiSchemaProperty, OpenApiSchema, OpenApiSchemas, TableFilterType, ITableOrders, ITableColumn, ITableColumns, TableColumns, ITableTemplate, ITableTemplates, ITableDataQuery, TableDataItems, TableDataLoader, DragDropEvent, DragEventHandler, ITableDragEvent, DynamicTableDragHandler, ResourceIfContext, CssSelector, CssSelectorList, DynamicComponentLocation, DynamicModuleInfo, DynamicEntryComponents, IConfiguration, IConfigService, ResizeEventStrategy, ErrorHandlerCallback, GlobalComponentModifier, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
|
|
3
|
+
export { DurationUnit, TypedFactoryProvider, TypedValueProvider, TypedExistingProvider, TypedClassProvider, TypedTokenProvider, TypedProvider, CachedFactory, ResolveFactory, IResolveFactory, CanvasColor, IIconService, ITranslation, ITranslations, GlobalTranslations, ILanguageSetting, ILanguageSettings, ILanguageService, IUserData, IAuthService, RouteValidator, IRouteData, IRoute, IAclComponent, IDialogButtonConfig, IDialogConfig, IConfirmMessageConfig, IConfirmDialogConfig, IDialogService, IPromiseService, IRouteStateInfo, NavigationUrlParam, StorageMode, ToastType, IToasterService, IAsyncMessage, AsyncMethod, IconMap, IconProps, ButtonType, ButtonSize, ButtonProps, TabValue, TabOption, ChipValue, ChipStatus, ChipOption, DropdownAttachTo, UnorderedListTemplate, UnorderedListTemplates, UnorderedListStyle, UploadType, IFileUploadResult, IFileUploadProcess, IAjaxRequestDetails, AjaxRequestCallback, ScriptType, ILoadableElement, ILoaderPromises, ISearchObservable, FactoryDependencies, ObjectType, ITimer, IExtraProperties, IGroupMap, TranslationQuery, IPageInfo, IPaginationData, PaginationDataLoader, PaginationItemContext, IPoint, ShapeIntersection, ShapeDistance, IShape, CanvasResizeMode, CanvasItemDirection, CanvasPaintFunc, RangeCoords, RectCoords, Frame, InteractiveCanvasParams, InteractiveCanvasItem, InteractiveCanvasItems, InteractiveCanvas, InteractiveCanvasRenderer, InteractivePanEvent, InteractiveCanvasPointer, HttpRequestHeaders, HttpRequestQuery, HttpClientRequestOptions, HttpRequestOptions, UploadData, IIssueContext, IProgress, ProgressListener, CacheExpireMode, IHttpService, SvgSourceModifier, IBaseHttpClient, IApiService, DynamicSchemaRef, OpenApiSchemaProperty, OpenApiSchema, OpenApiSchemas, TableFilterType, ITableOrders, ITableColumn, ITableColumns, TableColumns, ITableTemplate, ITableTemplates, ITableDataQuery, TableDataItems, TableDataLoader, DragDropEvent, DragEventHandler, ITableDragEvent, DynamicTableDragHandler, ResourceIfContext, CssSelector, CssSelectorList, DynamicComponentLocation, DynamicModuleInfo, DynamicEntryComponents, IConfiguration, IConfigService, ResizeEventStrategy, ErrorHandlerCallback, GlobalComponentModifier, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
|
|
4
4
|
export { ICON_TYPE, ICON_MAP, BUTTON_TYPE, ERROR_HANDLER, STATIC_SCHEMAS, RESIZE_STRATEGY, RESIZE_DELAY, ROOT_ELEMENT, SCRIPT_PARAMS, BASE_CONFIG, CONFIG_SERVICE, APP_BASE_URL, API_SERVICE, EXPRESS_REQUEST, PROMISE_SERVICE, DIALOG_SERVICE, TOASTER_SERVICE, AUTH_SERVICE, LANGUAGE_SERVICE, ICON_SERVICE, OPTIONS_TOKEN } from "./ngx-utils/tokens";
|
|
5
5
|
export { AjaxRequestHandler } from "./ngx-utils/utils/ajax-request-handler";
|
|
6
6
|
export { ArrayUtils } from "./ngx-utils/utils/array.utils";
|