@stemy/ngx-utils 19.9.1 → 19.9.3

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.
@@ -105,10 +105,6 @@ export interface IRouteData extends Data {
105
105
  export interface IRoute extends Route {
106
106
  data?: IRouteData;
107
107
  }
108
- export interface IAclComponent {
109
- onUserInitialized(): void;
110
- onUserChanged(): void;
111
- }
112
108
  export interface IRouteStateInfo {
113
109
  route: IRoute;
114
110
  guard: any;
@@ -116,6 +112,21 @@ export interface IRouteStateInfo {
116
112
  first: boolean;
117
113
  component?: any;
118
114
  }
115
+ export interface MenuItem {
116
+ path: string;
117
+ page: string;
118
+ label: string;
119
+ side: string;
120
+ external: boolean;
121
+ data: IRouteData;
122
+ }
123
+ export interface IAclComponent {
124
+ onUserInitialized(): void;
125
+ onUserChanged(): void;
126
+ }
127
+ export interface IAclService {
128
+ getCurrentMenu(): Promise<ReadonlyArray<MenuItem>>;
129
+ }
119
130
  export type NavigationUrlParam = any[] | string | UrlTree;
120
131
  export declare enum StorageMode {
121
132
  Local = 0,
@@ -1,14 +1,15 @@
1
1
  import { Injector } from "@angular/core";
2
2
  import { StateService } from "./state.service";
3
- import { IRouteStateInfo } from "../common-types";
3
+ import { IAclService, IRouteStateInfo, MenuItem } from "../common-types";
4
4
  import { EventsService } from "./events.service";
5
5
  import * as i0 from "@angular/core";
6
- export declare class AclService {
6
+ export declare class AclService implements IAclService {
7
7
  readonly injector: Injector;
8
8
  readonly state: StateService;
9
9
  readonly events: EventsService;
10
10
  protected components: IRouteStateInfo[];
11
11
  constructor(injector: Injector, state: StateService, events: EventsService);
12
+ getCurrentMenu(): Promise<MenuItem[]>;
12
13
  protected getStateInfo(): IRouteStateInfo;
13
14
  static ɵfac: i0.ɵɵFactoryDeclaration<AclService, never>;
14
15
  static ɵprov: i0.ɵɵInjectableDeclaration<AclService>;
@@ -43,6 +43,8 @@ export declare class StateService {
43
43
  open(url: NavigationUrlParam, target?: string, navigationExtras?: NavigationExtras): Promise<boolean>;
44
44
  subscribeImmediately(next?: (value: ActivatedRouteSnapshot) => void, error?: (error: any) => void): Subscription;
45
45
  subscribe(osOrNext?: Partial<Observer<ActivatedRouteSnapshot>> | ((value: ActivatedRouteSnapshot) => void)): Subscription;
46
+ getConfig(route: IRoute, path?: string[]): ReadonlyArray<IRoute>;
47
+ protected getConfigRecursive(route: IRoute, config: IRoute[], path: string[]): IRoute[];
46
48
  protected openInNewWindow(tree: UrlTree, target: string): boolean;
47
49
  protected createUrlTree(url: NavigationUrlParam, extras?: NavigationExtras): [UrlTree, NavigationExtras];
48
50
  static ɵfac: i0.ɵɵFactoryDeclaration<StateService, [null, null, null, { optional: true; }, { optional: true; }]>;
@@ -21,9 +21,8 @@ export declare class AuthGuard implements CanActivate {
21
21
  checkRouteMenu(route: IRoute): Promise<boolean>;
22
22
  checkRoute(route: IRoute, next?: ActivatedRouteSnapshot): Promise<boolean>;
23
23
  canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean>;
24
- getConfig(route: IRoute, config: IRoute[], path: string[]): IRoute[];
25
24
  getReturnState(route: IRoute): Promise<string[]>;
26
- private getReturnStateRecursive;
25
+ protected getReturnStateRecursive(config: ReadonlyArray<IRoute>, c?: number): Promise<string[]>;
27
26
  static ɵfac: i0.ɵɵFactoryDeclaration<AuthGuard, never>;
28
27
  static ɵprov: i0.ɵɵInjectableDeclaration<AuthGuard>;
29
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stemy/ngx-utils",
3
- "version": "19.9.1",
3
+ "version": "19.9.3",
4
4
  "license": "MIT",
5
5
  "public": true,
6
6
  "repository": "https://github.com/stemyke/ngx-utils.git",
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, RequireAtLeastOne } from "./ngx-utils/helper-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, OpenApiSchemaSelector, 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, IDialogButtonConfig, IDialogConfig, IConfirmMessageConfig, IConfirmDialogConfig, IDialogService, IPromiseService, IRouteStateInfo, MenuItem, IAclComponent, IAclService, 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, OpenApiSchemaSelector, 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, SCHEMA_SELECTOR, 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";