@coolon/angular-ui-powerups 3.7.1 → 3.7.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.
- package/CHANGELOG.md +15 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +176 -114
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/components/commands/group/popup-menu/abstract-popup-menu.component.js +2 -2
- package/esm2015/lib/components/commands/group/popup-menu/abstract-popup-menu.component.js.map +1 -1
- package/esm2015/lib/components/forms/number-input/number-input.component.js.map +1 -1
- package/esm2015/lib/components/table/column-model.js +8 -0
- package/esm2015/lib/components/table/column-model.js.map +1 -1
- package/esm2015/lib/components/table/column-model.metadata.json +1 -1
- package/esm2015/lib/components/table/table.component.js +1 -1
- package/esm2015/lib/components/table/table.component.metadata.json +1 -1
- package/esm2015/lib/place/components/abstract-place-navigation.component.js +9 -5
- package/esm2015/lib/place/components/abstract-place-navigation.component.js.map +1 -1
- package/esm2015/lib/place/components/abstract-place-navigation.component.metadata.json +1 -1
- package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js +5 -5
- package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js.map +1 -1
- package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.metadata.json +1 -1
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +6 -16
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.metadata.json +1 -1
- package/esm2015/lib/place/components/side-place-navigation/side-place-navigation.component.js +5 -8
- package/esm2015/lib/place/components/side-place-navigation/side-place-navigation.component.js.map +1 -1
- package/esm2015/lib/place/components/side-place-navigation/side-place-navigation.component.metadata.json +1 -1
- package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +5 -5
- package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js.map +1 -1
- package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.metadata.json +1 -1
- package/esm2015/lib/place/exports.js +1 -1
- package/esm2015/lib/place/exports.js.map +1 -1
- package/esm2015/lib/place/exports.metadata.json +1 -1
- package/esm2015/lib/place/guards/place.guard.js +9 -13
- package/esm2015/lib/place/guards/place.guard.js.map +1 -1
- package/esm2015/lib/place/guards/place.guard.metadata.json +1 -1
- package/esm2015/lib/place/place-access-guard.js +28 -0
- package/esm2015/lib/place/place-access-guard.js.map +1 -0
- package/esm2015/lib/place/place-access-guard.metadata.json +1 -0
- package/esm2015/lib/place/place-router.js +36 -2
- package/esm2015/lib/place/place-router.js.map +1 -1
- package/esm2015/lib/place/place-router.metadata.json +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +167 -110
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/table/column-model.d.ts +6 -0
- package/lib/place/components/abstract-place-navigation.component.d.ts +3 -2
- package/lib/place/components/list-place-nav/list-place-nav.component.d.ts +2 -2
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +1 -3
- package/lib/place/components/side-place-navigation/side-place-navigation.component.d.ts +2 -4
- package/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.d.ts +2 -2
- package/lib/place/exports.d.ts +1 -1
- package/lib/place/guards/place.guard.d.ts +1 -3
- package/lib/place/place-access-guard.d.ts +11 -0
- package/lib/place/place-router.d.ts +18 -4
- package/package.json +1 -1
- package/esm2015/lib/place/place-auth-service.js +0 -3
- package/esm2015/lib/place/place-auth-service.js.map +0 -1
- package/esm2015/lib/place/place-auth-service.metadata.json +0 -1
- package/lib/place/place-auth-service.d.ts +0 -36
|
@@ -62,6 +62,12 @@ export declare class PropertyColumnModel<Row, P extends Types.ValuePropertiesOf<
|
|
|
62
62
|
constructor(id: string, property: P, defaults: ColumnModel.Defaults);
|
|
63
63
|
cellRenderer<E extends CellRenderer<Row[P]>>(componentType: ComponentType<E>, options?: CellRendererOptions<Row, E>): this;
|
|
64
64
|
cellRenderer<E extends CellRenderer<Row[P]>>(componentType: ComponentType<E>, onComponentInit?: OnComponentInit<E>): this;
|
|
65
|
+
liveEditCellRenderer<E extends MutableCellRenderer<Row[P]>>(componentType: ComponentType<E>, options: MutableCellRendererOptions<Row, E, P>): this;
|
|
66
|
+
/**
|
|
67
|
+
* Deprecated. Use #liveEditCellRenderer instead.
|
|
68
|
+
* @param componentType
|
|
69
|
+
* @param options
|
|
70
|
+
*/
|
|
65
71
|
mutableCellRenderer<E extends MutableCellRenderer<Row[P]>>(componentType: ComponentType<E>, options: MutableCellRendererOptions<Row, E, P>): this;
|
|
66
72
|
cellEditor<E extends CellEditorComponent<Row[P]>>(editor: ComponentType<E>, validators?: Validator<Row[P]>[], initialiseComponent?: (component: E) => void): this;
|
|
67
73
|
cellEditor<E extends CellEditorComponent<Row[P]>>(editor: ComponentType<E>, initialiseComponent?: (component: E) => void): this;
|
|
@@ -2,11 +2,12 @@ import { OnInit } from '@angular/core';
|
|
|
2
2
|
import { Command, Constructable, DelegatingValueModel, ListModel, ListModelChain, ValueModel } from '@coolon/pectin';
|
|
3
3
|
import { CommandFace } from '../../components/commands/command-face';
|
|
4
4
|
import { DisposableComponent } from '../../components/disposable-component';
|
|
5
|
-
import { PlaceAuthService } from '../place-auth-service';
|
|
6
5
|
import { PlaceComponent } from '../place-component';
|
|
7
6
|
import { PlaceDefinition } from '../place-definition';
|
|
7
|
+
import { PlaceRouter } from '../place-router';
|
|
8
8
|
import { PlaceOutletComponent } from './place-outlet/place-outlet.component';
|
|
9
9
|
export declare class AbstractPlaceNavigationComponent extends DisposableComponent implements OnInit {
|
|
10
|
+
readonly placeRouter: PlaceRouter;
|
|
10
11
|
places: Constructable<PlaceComponent>[];
|
|
11
12
|
placesModel: ListModel<Constructable<PlaceComponent>>;
|
|
12
13
|
placeOutlet: PlaceOutletComponent;
|
|
@@ -15,7 +16,7 @@ export declare class AbstractPlaceNavigationComponent extends DisposableComponen
|
|
|
15
16
|
readonly commandFactory: Command.Factory<PlaceDefinition, void>;
|
|
16
17
|
readonly _activePlaceComponent: DelegatingValueModel<PlaceComponent>;
|
|
17
18
|
private activePlaceDefinition;
|
|
18
|
-
constructor(
|
|
19
|
+
constructor(placeRouter: PlaceRouter);
|
|
19
20
|
getNavigationFace(placeDef: PlaceDefinition): CommandFace;
|
|
20
21
|
isActive(place: PlaceDefinition): boolean;
|
|
21
22
|
ngOnInit(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PlaceRouter } from '../../place-router';
|
|
2
2
|
import { AbstractPlaceNavigationComponent } from '../abstract-place-navigation.component';
|
|
3
3
|
export declare class ListPlaceNavComponent extends AbstractPlaceNavigationComponent {
|
|
4
|
-
constructor(
|
|
4
|
+
constructor(router: PlaceRouter);
|
|
5
5
|
}
|
|
@@ -2,7 +2,6 @@ import { EventEmitter, OnInit } from '@angular/core';
|
|
|
2
2
|
import { ActivatedRoute, Router, RouterOutlet } from '@angular/router';
|
|
3
3
|
import { BooleanValueModelChain, Constructable, ListModel, ValueModel, ValueModelChain } from '@coolon/pectin';
|
|
4
4
|
import { DisposableComponent } from '../../../components/disposable-component';
|
|
5
|
-
import { PlaceAuthService } from '../../place-auth-service';
|
|
6
5
|
import { PlaceComponent } from '../../place-component';
|
|
7
6
|
import { PlaceConfig } from '../../place-config';
|
|
8
7
|
import { PlaceRouter } from '../../place-router';
|
|
@@ -10,7 +9,6 @@ import { Visit } from '../../visit';
|
|
|
10
9
|
export declare class PlaceOutletComponent extends DisposableComponent implements OnInit {
|
|
11
10
|
private readonly router;
|
|
12
11
|
private readonly placeRouter;
|
|
13
|
-
private readonly placeAuthService;
|
|
14
12
|
readonly placeConfig: PlaceConfig;
|
|
15
13
|
animate: boolean;
|
|
16
14
|
animateModel: ValueModel<boolean>;
|
|
@@ -33,7 +31,7 @@ export declare class PlaceOutletComponent extends DisposableComponent implements
|
|
|
33
31
|
private placesInAnimationOrder;
|
|
34
32
|
private animationSupported;
|
|
35
33
|
readonly animationEnabled: BooleanValueModelChain;
|
|
36
|
-
constructor(router: Router, placeRouter: PlaceRouter,
|
|
34
|
+
constructor(router: Router, placeRouter: PlaceRouter, placeConfig: PlaceConfig, parentOutlet: PlaceOutletComponent);
|
|
37
35
|
ngOnInit(): void;
|
|
38
36
|
getAnimationOrder(): number;
|
|
39
37
|
get animationDuration(): string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { TemplateRef } from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import { PlaceAuthService } from '../../place-auth-service';
|
|
2
|
+
import { PlaceRouter } from '../../place-router';
|
|
4
3
|
import { AbstractPlaceNavigationComponent } from '../abstract-place-navigation.component';
|
|
5
4
|
/**
|
|
6
5
|
* @example
|
|
@@ -45,10 +44,9 @@ import { AbstractPlaceNavigationComponent } from '../abstract-place-navigation.c
|
|
|
45
44
|
* })
|
|
46
45
|
*/
|
|
47
46
|
export declare class SidePlaceNavigationComponent extends AbstractPlaceNavigationComponent {
|
|
48
|
-
readonly router: Router;
|
|
49
47
|
expanded: boolean;
|
|
50
48
|
navEndTemplate: TemplateRef<any>;
|
|
51
|
-
constructor(router:
|
|
49
|
+
constructor(router: PlaceRouter);
|
|
52
50
|
expandMenu(): void;
|
|
53
51
|
collapseMenu(): void;
|
|
54
52
|
toggleMenu(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PlaceRouter } from '../../place-router';
|
|
2
2
|
import { AbstractPlaceNavigationComponent } from '../abstract-place-navigation.component';
|
|
3
3
|
export declare class TabbedPlaceNavigationComponent extends AbstractPlaceNavigationComponent {
|
|
4
|
-
constructor(
|
|
4
|
+
constructor(router: PlaceRouter);
|
|
5
5
|
}
|
package/lib/place/exports.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @file Automatically generated by barrelsby.
|
|
3
3
|
*/
|
|
4
4
|
export * from "./nav-item";
|
|
5
|
-
export * from "./place-
|
|
5
|
+
export * from "./place-access-guard";
|
|
6
6
|
export * from "./place-component";
|
|
7
7
|
export * from "./place-config";
|
|
8
8
|
export * from "./place-definition";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Injector } from '@angular/core';
|
|
2
2
|
import { ActivatedRouteSnapshot, CanActivate, CanDeactivate, Router, RouterStateSnapshot, UrlTree } from '@angular/router';
|
|
3
3
|
import { InteractionService } from '../../interaction/services/interaction.service';
|
|
4
|
-
import { PlaceAuthService } from '../place-auth-service';
|
|
5
4
|
import { PlaceComponent } from '../place-component';
|
|
6
5
|
import { PlaceHistory } from '../place-history';
|
|
7
6
|
import { PlaceRouter } from '../place-router';
|
|
@@ -12,10 +11,9 @@ export declare class PlaceGuard implements CanActivate, CanDeactivate<PlaceCompo
|
|
|
12
11
|
private urlService;
|
|
13
12
|
private readonly placeRouter;
|
|
14
13
|
private readonly placeHistory;
|
|
15
|
-
private readonly placeAuthService;
|
|
16
14
|
private readonly interactionService;
|
|
17
15
|
private readonly injector;
|
|
18
|
-
constructor(router: Router, urlService: UrlService, placeRouter: PlaceRouter, placeHistory: PlaceHistory,
|
|
16
|
+
constructor(router: Router, urlService: UrlService, placeRouter: PlaceRouter, placeHistory: PlaceHistory, interactionService: InteractionService, injector: Injector);
|
|
19
17
|
canActivate(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree>;
|
|
20
18
|
canDeactivate(component: PlaceComponent, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Promise<boolean | UrlTree>;
|
|
21
19
|
private getPlaceDefinition;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PlaceDefinition } from './place-definition';
|
|
2
|
+
export interface PlaceAccessGuard {
|
|
3
|
+
isAuthenticated(): boolean | Promise<boolean>;
|
|
4
|
+
isAuthorised(placeDefinition: PlaceDefinition): boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare namespace PlaceAccessGuard {
|
|
7
|
+
class NoAuth implements PlaceAccessGuard {
|
|
8
|
+
isAuthenticated(): boolean | Promise<boolean>;
|
|
9
|
+
isAuthorised(placeDefinition: PlaceDefinition): boolean;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Location } from '@angular/common';
|
|
2
|
-
import { ActivatedRoute, NavigationCancel, NavigationEnd, NavigationError, NavigationExtras, NavigationStart, Router } from '@angular/router';
|
|
3
|
-
import { GarbageCollector, ListModel, MapModelChain, MutableValueModel, ValueModelChain } from '@coolon/pectin';
|
|
2
|
+
import { ActivatedRoute, ActivatedRouteSnapshot, NavigationCancel, NavigationEnd, NavigationError, NavigationExtras, NavigationStart, Router, RouterStateSnapshot } from '@angular/router';
|
|
3
|
+
import { GarbageCollector, ListModel, MapModelChain, MutableValueModel, ValueModel, ValueModelChain } from '@coolon/pectin';
|
|
4
4
|
import { InteractionService } from '../interaction/services/interaction.service';
|
|
5
5
|
import { NavigationSession } from './navigation/session/navigation-session';
|
|
6
|
+
import { PlaceAccessGuard } from './place-access-guard';
|
|
6
7
|
import { PlaceDefinition } from './place-definition';
|
|
7
8
|
import { PlaceHistory } from './place-history';
|
|
8
9
|
import { UrlService } from './url-service';
|
|
@@ -22,7 +23,17 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
22
23
|
readonly activeVisitsByPlaceDefinition: MapModelChain<PlaceDefinition, Visit>;
|
|
23
24
|
private routerInteractionAdapter;
|
|
24
25
|
private sessionFinishedJobs;
|
|
26
|
+
/**
|
|
27
|
+
* An observable model containing the authoriser function. This allows places to react to changes
|
|
28
|
+
* in permissions when any underlying auth logic changes, e.g. a role being removed from a user.
|
|
29
|
+
*/
|
|
30
|
+
private _accessGuard;
|
|
31
|
+
private redirections;
|
|
25
32
|
constructor(angularRouter: Router, angularLocation: Location, interactionService: InteractionService, urlService: UrlService, placeHistory: PlaceHistory);
|
|
33
|
+
get accessGuard(): ValueModel<PlaceAccessGuard>;
|
|
34
|
+
configureAuth(accessGrant: ValueModel<PlaceAccessGuard>, redirections: PlaceRouter.Redirections): void;
|
|
35
|
+
getAuthenticationFailureRedirect(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Visit;
|
|
36
|
+
getAuthorisationFailureRedirect(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Visit;
|
|
26
37
|
get navigationSession(): NavigationSession;
|
|
27
38
|
get currentSession(): NavigationSession;
|
|
28
39
|
isNavigating(): boolean;
|
|
@@ -51,6 +62,9 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
51
62
|
syncInteractionContextIdsWithRouter(): Promise<unknown>;
|
|
52
63
|
private createRouteParameters;
|
|
53
64
|
}
|
|
54
|
-
export declare namespace
|
|
55
|
-
|
|
65
|
+
export declare namespace PlaceRouter {
|
|
66
|
+
interface Redirections {
|
|
67
|
+
onAuthenticationFailure(activatedRoute?: ActivatedRouteSnapshot, state?: RouterStateSnapshot): Visit;
|
|
68
|
+
onAuthorisationFailure(activatedRoute?: ActivatedRouteSnapshot, state?: RouterStateSnapshot): Visit;
|
|
69
|
+
}
|
|
56
70
|
}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"place-auth-service.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/place-auth-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAQ/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAmB,kBAAkB,CAAC,CAAA","sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';\nimport { Constructable, ValueModel } from '@coolon/pectin';\nimport { PlaceComponent } from './place-component';\nimport { PlaceDefinition } from './place-definition';\nimport { UrlSnapshot } from './url-snapshot';\nimport { Visit } from './visit';\n\nexport const PLACE_AUTH_SERVICE = new InjectionToken<PlaceAuthService>(\"PlaceAuthService\")\n\n\n/**\n * This interface provides auth services to the routing layer and splits authn and authz into two\n * separate calls so that authentication can be promised based where as authorisation is not. This\n * allows components to check authorisation without having to deal with the promised based nature\n * of authentication.\n */\nexport interface PlaceAuthService {\n\n /**\n * An observable model containing the authoriser function. This allows places to react to changes\n * in permissions when any underlying auth logic changes, e.g. a role being removed from a user.\n */\n readonly authoriserModel: ValueModel<PlaceAuthService.AuthoriserCallback>;\n\n /**\n * Checks if the current user is authenticated. If true the router will proceed to\n * check if the user is authorised. Otherwise it will invoke #handleAuthenticatedFailure.\n */\n isAuthenticated(): boolean | Promise<boolean>;\n\n /**\n * Checks if the current user is authorised. If true the router will proceed to route sanitisation\n * and view loading, otherwise it will invoke #handleAuthorisationFailure.\n * @param placeDefinition\n */\n isAuthorised(placeDefinition: PlaceDefinition): boolean;\n\n handleNotAuthenticated(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Constructable<PlaceComponent> | Visit;\n\n handleNotAuthorised(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Constructable<PlaceComponent> | Visit;\n}\n\nexport namespace PlaceAuthService {\n export type AuthoriserCallback = (placeDef: PlaceDefinition) => boolean;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"PLACE_AUTH_SERVICE":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":8,"character":38},"arguments":["PlaceAuthService"]},"PlaceAuthService":{"__symbolic":"interface"}}}]
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { InjectionToken } from '@angular/core';
|
|
2
|
-
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
|
3
|
-
import { Constructable, ValueModel } from '@coolon/pectin';
|
|
4
|
-
import { PlaceComponent } from './place-component';
|
|
5
|
-
import { PlaceDefinition } from './place-definition';
|
|
6
|
-
import { Visit } from './visit';
|
|
7
|
-
export declare const PLACE_AUTH_SERVICE: InjectionToken<PlaceAuthService>;
|
|
8
|
-
/**
|
|
9
|
-
* This interface provides auth services to the routing layer and splits authn and authz into two
|
|
10
|
-
* separate calls so that authentication can be promised based where as authorisation is not. This
|
|
11
|
-
* allows components to check authorisation without having to deal with the promised based nature
|
|
12
|
-
* of authentication.
|
|
13
|
-
*/
|
|
14
|
-
export interface PlaceAuthService {
|
|
15
|
-
/**
|
|
16
|
-
* An observable model containing the authoriser function. This allows places to react to changes
|
|
17
|
-
* in permissions when any underlying auth logic changes, e.g. a role being removed from a user.
|
|
18
|
-
*/
|
|
19
|
-
readonly authoriserModel: ValueModel<PlaceAuthService.AuthoriserCallback>;
|
|
20
|
-
/**
|
|
21
|
-
* Checks if the current user is authenticated. If true the router will proceed to
|
|
22
|
-
* check if the user is authorised. Otherwise it will invoke #handleAuthenticatedFailure.
|
|
23
|
-
*/
|
|
24
|
-
isAuthenticated(): boolean | Promise<boolean>;
|
|
25
|
-
/**
|
|
26
|
-
* Checks if the current user is authorised. If true the router will proceed to route sanitisation
|
|
27
|
-
* and view loading, otherwise it will invoke #handleAuthorisationFailure.
|
|
28
|
-
* @param placeDefinition
|
|
29
|
-
*/
|
|
30
|
-
isAuthorised(placeDefinition: PlaceDefinition): boolean;
|
|
31
|
-
handleNotAuthenticated(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Constructable<PlaceComponent> | Visit;
|
|
32
|
-
handleNotAuthorised(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Constructable<PlaceComponent> | Visit;
|
|
33
|
-
}
|
|
34
|
-
export declare namespace PlaceAuthService {
|
|
35
|
-
type AuthoriserCallback = (placeDef: PlaceDefinition) => boolean;
|
|
36
|
-
}
|