@stemy/ngx-utils 19.0.2 → 19.0.4
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 +94 -17
- package/fesm2022/stemy-ngx-utils.mjs.map +1 -1
- package/ngx-utils/common-types.d.ts +48 -4
- package/ngx-utils/ngx-utils.imports.d.ts +4 -3
- package/ngx-utils/services/dialog.service.d.ts +10 -0
- package/ngx-utils/services/toaster.service.d.ts +12 -9
- package/package.json +1 -1
- package/public_api.d.ts +3 -2
|
@@ -96,13 +96,56 @@ export declare enum StorageMode {
|
|
|
96
96
|
Local = 0,
|
|
97
97
|
Session = 1
|
|
98
98
|
}
|
|
99
|
+
export type ToastType = "info" | "success" | "warning" | "error";
|
|
99
100
|
export interface IToasterService {
|
|
100
|
-
error(message: string, params?: any
|
|
101
|
-
info(message: string, params?: any
|
|
102
|
-
success(message: string, params?: any
|
|
103
|
-
warning(message: string, params?: any
|
|
101
|
+
error(message: string, params?: any): void;
|
|
102
|
+
info(message: string, params?: any): void;
|
|
103
|
+
success(message: string, params?: any): void;
|
|
104
|
+
warning(message: string, params?: any): void;
|
|
105
|
+
handleAsyncMethod(method: AsyncMethod, context?: any): void;
|
|
104
106
|
}
|
|
105
107
|
export declare const TOASTER_SERVICE: InjectionToken<IToasterService>;
|
|
108
|
+
export interface IDialogButtonConfig {
|
|
109
|
+
icon?: string;
|
|
110
|
+
text?: string;
|
|
111
|
+
classes?: string;
|
|
112
|
+
method?: AsyncMethod;
|
|
113
|
+
}
|
|
114
|
+
export interface IDialogConfig {
|
|
115
|
+
id?: string;
|
|
116
|
+
title?: string;
|
|
117
|
+
message: string;
|
|
118
|
+
messageContext?: any;
|
|
119
|
+
buttons?: IDialogButtonConfig[];
|
|
120
|
+
onClose?: AsyncMethod;
|
|
121
|
+
size?: string;
|
|
122
|
+
type?: string;
|
|
123
|
+
templates?: {
|
|
124
|
+
[id: string]: TemplateRef<any>;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
export interface IConfirmDialogConfig {
|
|
128
|
+
id?: string;
|
|
129
|
+
title?: string;
|
|
130
|
+
message: string;
|
|
131
|
+
messageContext?: any;
|
|
132
|
+
buttons?: IDialogButtonConfig[];
|
|
133
|
+
method?: AsyncMethod;
|
|
134
|
+
cancelMethod?: AsyncMethod;
|
|
135
|
+
size?: string;
|
|
136
|
+
templates?: {
|
|
137
|
+
[id: string]: TemplateRef<any>;
|
|
138
|
+
};
|
|
139
|
+
okText?: string;
|
|
140
|
+
okClasses?: string;
|
|
141
|
+
cancelText?: string;
|
|
142
|
+
cancelClasses?: string;
|
|
143
|
+
}
|
|
144
|
+
export interface IDialogService {
|
|
145
|
+
dialog(config: IDialogConfig): void;
|
|
146
|
+
confirm(config: IConfirmDialogConfig): void;
|
|
147
|
+
}
|
|
148
|
+
export declare const DIALOG_SERVICE: InjectionToken<IDialogService>;
|
|
106
149
|
export interface IPromiseService {
|
|
107
150
|
zone: NgZone;
|
|
108
151
|
count: number;
|
|
@@ -359,6 +402,7 @@ export interface IModuleConfig {
|
|
|
359
402
|
toasterService?: Type<IToasterService>;
|
|
360
403
|
promiseService?: Type<IPromiseService>;
|
|
361
404
|
configService?: Type<IConfigService>;
|
|
405
|
+
dialogService?: Type<IDialogService>;
|
|
362
406
|
wasiImplementation?: Type<IWasi>;
|
|
363
407
|
initializeApp?: (injector: Injector) => AppInitializerFunc;
|
|
364
408
|
baseUrl?: (injector: Injector) => string;
|
|
@@ -8,6 +8,7 @@ import { StaticAuthService } from "./services/auth.service";
|
|
|
8
8
|
import { BaseHttpClient } from "./services/base-http.client";
|
|
9
9
|
import { BaseHttpService } from "./services/base-http.service";
|
|
10
10
|
import { ConfigService } from "./services/config.service";
|
|
11
|
+
import { DialogService } from "./services/dialog.service";
|
|
11
12
|
import { ErrorHandlerService } from "./services/error-handler.service";
|
|
12
13
|
import { EventsService } from "./services/events.service";
|
|
13
14
|
import { FormatterService } from "./services/formatter.service";
|
|
@@ -18,7 +19,7 @@ import { OpenApiService } from "./services/open-api.service";
|
|
|
18
19
|
import { StateService } from "./services/state.service";
|
|
19
20
|
import { StaticLanguageService } from "./services/static-language.service";
|
|
20
21
|
import { StorageService } from "./services/storage.service";
|
|
21
|
-
import {
|
|
22
|
+
import { BaseToasterService } from "./services/toaster.service";
|
|
22
23
|
import { TranslatedUrlSerializer } from "./services/translated-url.serializer";
|
|
23
24
|
import { UniversalService } from "./services/universal.service";
|
|
24
25
|
import { WasmService } from "./services/wasm.service";
|
|
@@ -49,8 +50,8 @@ import { PaginationMenuComponent } from "./components/pagination-menu/pagination
|
|
|
49
50
|
import { UnorderedListComponent } from "./components/unordered-list/unordered-list.component";
|
|
50
51
|
export declare const pipes: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe)[];
|
|
51
52
|
export declare const directives: (typeof AsyncMethodBase | typeof BackgroundDirective | typeof DynamicTableTemplateDirective | typeof GlobalTemplateDirective | typeof IconDirective | typeof NgxTemplateOutletDirective | typeof PaginationDirective | typeof PaginationItemDirective | typeof ResourceIfDirective | typeof StickyDirective | typeof StickyClassDirective | typeof UnorderedListItemDirective | typeof UnorderedListTemplateDirective)[];
|
|
52
|
-
export declare const components: (typeof
|
|
53
|
-
export declare const providers: (typeof
|
|
53
|
+
export declare const components: (typeof UnorderedListComponent | typeof DynamicTableComponent | typeof PaginationMenuComponent)[];
|
|
54
|
+
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 DialogService | typeof ErrorHandlerService | typeof EventsService | typeof FormatterService | typeof GlobalTemplateService | typeof IconService | typeof StaticLanguageService | typeof OpenApiService | typeof BaseToasterService | typeof TranslatedUrlSerializer | typeof PromiseService | typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe | typeof DeviceDetectorService | {
|
|
54
55
|
provide: import("@angular/core").InjectionToken<import("@angular/platform-browser").EventManagerPlugin[]>;
|
|
55
56
|
useClass: typeof ResizeEventPlugin;
|
|
56
57
|
multi: boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IConfirmDialogConfig, IDialogConfig, IDialogService, IToasterService } from "../common-types";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class DialogService implements IDialogService {
|
|
4
|
+
readonly toaster: IToasterService;
|
|
5
|
+
constructor(toaster: IToasterService);
|
|
6
|
+
dialog(config: IDialogConfig): void;
|
|
7
|
+
confirm(config: IConfirmDialogConfig): void;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DialogService, never>;
|
|
9
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DialogService>;
|
|
10
|
+
}
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { ILanguageService, IToasterService } from "../common-types";
|
|
1
|
+
import { AsyncMethod, ILanguageService, IToasterService, ToastType } from "../common-types";
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class BaseToasterService implements IToasterService {
|
|
4
4
|
private language;
|
|
5
|
+
protected colorMap: Record<ToastType, string>;
|
|
5
6
|
constructor(language: ILanguageService);
|
|
6
|
-
error(message: string, params?: any
|
|
7
|
-
info(message: string, params?: any
|
|
8
|
-
success(message: string, params?: any
|
|
9
|
-
warning(message: string, params?: any
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
error(message: string, params?: any): void;
|
|
8
|
+
info(message: string, params?: any): void;
|
|
9
|
+
success(message: string, params?: any): void;
|
|
10
|
+
warning(message: string, params?: any): void;
|
|
11
|
+
handleAsyncMethod(method: AsyncMethod): void;
|
|
12
|
+
protected translateMessage(message: string, params: any, type: ToastType): void;
|
|
13
|
+
protected show(message: string, type: ToastType): any;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseToasterService, never>;
|
|
15
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<BaseToasterService>;
|
|
13
16
|
}
|
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, 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, 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, ILanguageSetting, ILanguageSettings, ILanguageService, LANGUAGE_SERVICE, IAuthService, RouteValidator, IRouteData, IRoute, AUTH_SERVICE, IAclComponent, IDialogButtonConfig, IDialogConfig, IConfirmDialogConfig, IDialogService, DIALOG_SERVICE, IPromiseService, PROMISE_SERVICE, IWasi, IWasmExports, IWasm, IWasmAsync, WASI_IMPLEMENTATION, IRouteStateInfo, NavigationUrlParam, StorageMode, ToastType, IToasterService, TOASTER_SERVICE, IAsyncMessage, AsyncMethod, 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, 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";
|
|
@@ -31,6 +31,7 @@ export { StaticAuthService } from "./ngx-utils/services/auth.service";
|
|
|
31
31
|
export { BaseHttpClient } from "./ngx-utils/services/base-http.client";
|
|
32
32
|
export { BaseHttpService } from "./ngx-utils/services/base-http.service";
|
|
33
33
|
export { ConfigService } from "./ngx-utils/services/config.service";
|
|
34
|
+
export { DialogService } from "./ngx-utils/services/dialog.service";
|
|
34
35
|
export { ErrorHandlerService } from "./ngx-utils/services/error-handler.service";
|
|
35
36
|
export { EventsService } from "./ngx-utils/services/events.service";
|
|
36
37
|
export { FormatterService } from "./ngx-utils/services/formatter.service";
|
|
@@ -42,7 +43,7 @@ export { OpenApiService } from "./ngx-utils/services/open-api.service";
|
|
|
42
43
|
export { IStateInfo, StateService } from "./ngx-utils/services/state.service";
|
|
43
44
|
export { StaticLanguageService } from "./ngx-utils/services/static-language.service";
|
|
44
45
|
export { StorageService } from "./ngx-utils/services/storage.service";
|
|
45
|
-
export {
|
|
46
|
+
export { BaseToasterService } from "./ngx-utils/services/toaster.service";
|
|
46
47
|
export { IUrlDictionary, TranslatedUrlSerializer } from "./ngx-utils/services/translated-url.serializer";
|
|
47
48
|
export { PromiseService } from "./ngx-utils/services/promise.service";
|
|
48
49
|
export { ResizeEventPlugin } from "./ngx-utils/plugins/resize-event.plugin";
|