@stemy/ngx-utils 12.0.1 → 12.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/bundles/stemy-ngx-utils.umd.js +210 -152
- package/bundles/stemy-ngx-utils.umd.js.map +1 -1
- package/esm2015/ngx-utils/common-types.js +2 -1
- package/esm2015/ngx-utils/directives/global-template.directive.js +8 -8
- package/esm2015/ngx-utils/ngx-utils.module.js +6 -2
- package/esm2015/ngx-utils/pipes/global-template.pipe.js +7 -5
- package/esm2015/ngx-utils/services/global-template.service.js +2 -2
- package/esm2015/ngx-utils/services/state.service.js +53 -15
- package/esm2015/public_api.js +2 -2
- package/fesm2015/stemy-ngx-utils.js +140 -96
- package/fesm2015/stemy-ngx-utils.js.map +1 -1
- package/ngx-utils/common-types.d.ts +12 -1
- package/ngx-utils/directives/global-template.directive.d.ts +3 -3
- package/ngx-utils/ngx-utils.module.d.ts +1 -1
- package/ngx-utils/pipes/global-template.pipe.d.ts +3 -3
- package/ngx-utils/services/global-template.service.d.ts +2 -2
- package/ngx-utils/services/state.service.d.ts +11 -6
- package/package.json +1 -1
- package/public_api.d.ts +1 -1
- package/stemy-ngx-utils.metadata.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, InjectionToken, Injector, NgZone, Provider, TemplateRef, Type } from "@angular/core";
|
|
2
2
|
import { HttpClient, HttpErrorResponse, HttpHeaders } from "@angular/common/http";
|
|
3
|
-
import { ActivatedRouteSnapshot, Data, Route } from "@angular/router";
|
|
3
|
+
import { ActivatedRouteSnapshot, Data, Route, UrlTree } from "@angular/router";
|
|
4
4
|
import { Request } from "express";
|
|
5
5
|
export interface IResolveFactory {
|
|
6
6
|
func: Function;
|
|
@@ -75,6 +75,7 @@ export interface IRouteStateInfo {
|
|
|
75
75
|
first: boolean;
|
|
76
76
|
component?: any;
|
|
77
77
|
}
|
|
78
|
+
export declare type NavigationUrlParam = any[] | string | UrlTree;
|
|
78
79
|
export declare enum StorageMode {
|
|
79
80
|
Local = 0,
|
|
80
81
|
Session = 1
|
|
@@ -277,6 +278,15 @@ export declare const SCRIPT_PARAMS: InjectionToken<any>;
|
|
|
277
278
|
export declare const ROOT_ELEMENT: InjectionToken<HTMLElement>;
|
|
278
279
|
export declare type ErrorHandlerCallback = (error: string) => any;
|
|
279
280
|
export declare const ERROR_HANDLER: InjectionToken<ErrorHandlerCallback>;
|
|
281
|
+
export declare type GlobalComponentModifier = (component: any) => any;
|
|
282
|
+
export interface IGlobalTemplates {
|
|
283
|
+
readonly templatesUpdated: EventEmitter<void>;
|
|
284
|
+
get(id: string, component?: any): TemplateRef<any>;
|
|
285
|
+
add(id: string, template: TemplateRef<any>): void;
|
|
286
|
+
remove(id: string): void;
|
|
287
|
+
addComponentModifier(id: string, modifier: GlobalComponentModifier): void;
|
|
288
|
+
}
|
|
289
|
+
export declare const GLOBAL_TEMPLATES: InjectionToken<ErrorHandlerCallback>;
|
|
280
290
|
export declare type AppInitializerFunc = () => Promise<void> | void;
|
|
281
291
|
export interface IModuleConfig {
|
|
282
292
|
apiService?: Type<IApiService>;
|
|
@@ -286,6 +296,7 @@ export interface IModuleConfig {
|
|
|
286
296
|
toasterService?: Type<IToasterService>;
|
|
287
297
|
promiseService?: Type<IPromiseService>;
|
|
288
298
|
configService?: Type<IConfigService>;
|
|
299
|
+
globalTemplates?: Type<IGlobalTemplates>;
|
|
289
300
|
initializeApp?: (injector: Injector) => AppInitializerFunc;
|
|
290
301
|
}
|
|
291
302
|
export declare class ValuedPromise<T> extends Promise<T> {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { OnDestroy, OnInit, TemplateRef } from "@angular/core";
|
|
2
|
-
import {
|
|
2
|
+
import { IGlobalTemplates } from "../common-types";
|
|
3
3
|
export declare class GlobalTemplateDirective implements OnInit, OnDestroy {
|
|
4
|
-
readonly
|
|
4
|
+
readonly globalTemplates: IGlobalTemplates;
|
|
5
5
|
readonly template: TemplateRef<any>;
|
|
6
6
|
id: string;
|
|
7
|
-
constructor(
|
|
7
|
+
constructor(globalTemplates: IGlobalTemplates, template: TemplateRef<any>);
|
|
8
8
|
ngOnInit(): void;
|
|
9
9
|
ngOnDestroy(): void;
|
|
10
10
|
}
|
|
@@ -49,7 +49,7 @@ import { UnorderedListComponent } from "./components/unordered-list/unordered-li
|
|
|
49
49
|
export declare const pipes: (typeof FilterPipe | typeof FormatNumberPipe | typeof GlobalTemplatePipe | typeof ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe)[];
|
|
50
50
|
export declare const directives: (typeof AsyncMethodDirective | typeof BackgroundDirective | typeof DynamicTableTemplateDirective | typeof GlobalTemplateDirective | typeof IconDirective | typeof NgxTemplateOutletDirective | typeof PaginationDirective | typeof PaginationItemDirective | typeof ResourceIfDirective | typeof StickyDirective | typeof UnorderedListItemDirective | typeof UnorderedListTemplateDirective | typeof StickyClassDirective)[];
|
|
51
51
|
export declare const components: (typeof UnorderedListComponent | typeof DynamicTableComponent | typeof PaginationMenuComponent)[];
|
|
52
|
-
export declare const providers: (typeof
|
|
52
|
+
export declare const providers: (typeof UniversalService | typeof StateService | typeof AuthGuard | typeof AclService | typeof BaseHttpClient | typeof StorageService | typeof BaseHttpService | 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 ReducePipe | typeof RoundPipe | typeof SafeHtmlPipe | typeof TranslatePipe | typeof DeviceDetectorService | {
|
|
53
53
|
provide: import("@angular/core").InjectionToken<import("@angular/platform-browser").ɵangular_packages_platform_browser_platform_browser_g[]>;
|
|
54
54
|
useClass: typeof ResizeEventPlugin;
|
|
55
55
|
multi: boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { OnDestroy, OnInit, PipeTransform, TemplateRef } from "@angular/core";
|
|
2
2
|
import { Subscription } from "rxjs";
|
|
3
|
-
import {
|
|
3
|
+
import { IGlobalTemplates } from "../common-types";
|
|
4
4
|
export declare class GlobalTemplatePipe implements PipeTransform, OnInit, OnDestroy {
|
|
5
|
-
protected globalTemplates:
|
|
5
|
+
protected globalTemplates: IGlobalTemplates;
|
|
6
6
|
protected templatesUpdated: Subscription;
|
|
7
7
|
protected cachedTemplateId: string;
|
|
8
8
|
protected cachedTemplate: TemplateRef<any>;
|
|
9
|
-
constructor(globalTemplates:
|
|
9
|
+
constructor(globalTemplates: IGlobalTemplates);
|
|
10
10
|
ngOnInit(): void;
|
|
11
11
|
ngOnDestroy(): void;
|
|
12
12
|
transform(templateId: string, component?: any): TemplateRef<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, TemplateRef } from "@angular/core";
|
|
2
|
-
|
|
3
|
-
export declare class GlobalTemplateService {
|
|
2
|
+
import { GlobalComponentModifier, IGlobalTemplates } from "../common-types";
|
|
3
|
+
export declare class GlobalTemplateService implements IGlobalTemplates {
|
|
4
4
|
readonly templatesUpdated: EventEmitter<void>;
|
|
5
5
|
protected globalTemplates: {
|
|
6
6
|
[id: string]: TemplateRef<any>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Injector, NgZone } from "@angular/core";
|
|
2
|
-
import { ActivatedRouteSnapshot, Data, NavigationExtras, Params, Route, Router, UrlSegment, UrlTree } from "@angular/router";
|
|
2
|
+
import { ActivatedRouteSnapshot, Data, Event, NavigationExtras, Params, Route, Router, UrlSegment, UrlTree } from "@angular/router";
|
|
3
3
|
import { BehaviorSubject, Subscription } from "rxjs";
|
|
4
|
-
import { IRoute } from "../common-types";
|
|
4
|
+
import { IRoute, NavigationUrlParam } from "../common-types";
|
|
5
|
+
import { UniversalService } from "./universal.service";
|
|
5
6
|
export declare const emptySnapshot: ActivatedRouteSnapshot;
|
|
6
7
|
export declare const emptyData: Data;
|
|
7
8
|
export declare const emptyParams: Params;
|
|
@@ -15,6 +16,7 @@ export interface IStateInfo {
|
|
|
15
16
|
export declare class StateService extends BehaviorSubject<any> {
|
|
16
17
|
readonly injector: Injector;
|
|
17
18
|
readonly zone: NgZone;
|
|
19
|
+
readonly universal: UniversalService;
|
|
18
20
|
readonly router: Router;
|
|
19
21
|
readonly globalExtras: NavigationExtras;
|
|
20
22
|
private shot;
|
|
@@ -32,10 +34,13 @@ export declare class StateService extends BehaviorSubject<any> {
|
|
|
32
34
|
get urlSegments(): UrlSegment[];
|
|
33
35
|
get components(): any[];
|
|
34
36
|
get routerConfig(): IRoute[];
|
|
35
|
-
constructor(injector: Injector, zone: NgZone, router?: Router);
|
|
37
|
+
constructor(injector: Injector, zone: NgZone, universal: UniversalService, router?: Router);
|
|
36
38
|
reload(): Promise<any>;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
navigateByUrl(url: string | UrlTree, navigationExtras?: NavigationExtras): Promise<boolean>;
|
|
40
|
+
navigate(url: NavigationUrlParam, navigationExtras?: NavigationExtras): Promise<boolean>;
|
|
41
|
+
open(url: NavigationUrlParam, target?: string, navigationExtras?: NavigationExtras): Promise<boolean>;
|
|
39
42
|
subscribeImmediately(next?: (value: ActivatedRouteSnapshot) => void, error?: (error: any) => void, complete?: () => void): Subscription;
|
|
40
|
-
|
|
43
|
+
protected openInNewWindow(tree: UrlTree, target: string): boolean;
|
|
44
|
+
protected createUrlTree(url: NavigationUrlParam, extras?: NavigationExtras): [UrlTree, NavigationExtras];
|
|
45
|
+
protected handleRouterEvent: (event: Event) => void;
|
|
41
46
|
}
|
package/package.json
CHANGED
package/public_api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { IResolveFactory, CanvasColor, IIconService, ICON_SERVICE, ITranslation, ITranslations, ILanguageSettings, ILanguageService, LANGUAGE_SERVICE, IAuthService, RouteValidator, IRouteData, IRoute, AUTH_SERVICE, IAclComponent, IPromiseService, PROMISE_SERVICE, IRouteStateInfo, StorageMode, IToasterService, TOASTER_SERVICE, IAsyncMessage, AsyncMethod, UnorederedListTemplate, UnorderedListTemplates, UnorderedListStyle, IAjaxRequestDetails, AjaxRequestCallback, IScriptPromises, IStylePromises, ISearchObservable, FactoryDependencies, 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, ITableColumns, ITableTemplate, ITableTemplates, TableDataLoader, ResourceIfContext, IConfiguration, IConfigService, CONFIG_SERVICE, BASE_CONFIG, SCRIPT_PARAMS, ROOT_ELEMENT, ErrorHandlerCallback, ERROR_HANDLER, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
|
|
1
|
+
export { IResolveFactory, CanvasColor, IIconService, ICON_SERVICE, ITranslation, ITranslations, ILanguageSettings, ILanguageService, LANGUAGE_SERVICE, IAuthService, RouteValidator, IRouteData, IRoute, AUTH_SERVICE, IAclComponent, IPromiseService, PROMISE_SERVICE, IRouteStateInfo, NavigationUrlParam, StorageMode, IToasterService, TOASTER_SERVICE, IAsyncMessage, AsyncMethod, UnorederedListTemplate, UnorderedListTemplates, UnorderedListStyle, IAjaxRequestDetails, AjaxRequestCallback, IScriptPromises, IStylePromises, ISearchObservable, FactoryDependencies, 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, ITableColumns, ITableTemplate, ITableTemplates, TableDataLoader, ResourceIfContext, IConfiguration, IConfigService, CONFIG_SERVICE, BASE_CONFIG, SCRIPT_PARAMS, ROOT_ELEMENT, ErrorHandlerCallback, ERROR_HANDLER, GlobalComponentModifier, IGlobalTemplates, GLOBAL_TEMPLATES, AppInitializerFunc, IModuleConfig, ValuedPromise } from "./ngx-utils/common-types";
|
|
2
2
|
export { AjaxRequestHandler } from "./ngx-utils/utils/ajax-request-handler";
|
|
3
3
|
export { ObjectUtils } from "./ngx-utils/utils/object.utils";
|
|
4
4
|
export { DateUtils } from "./ngx-utils/utils/date.utils";
|