@coolon/angular-ui-powerups 0.0.90 → 0.0.91
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/coolon-angular-ui-powerups.umd.js +468 -396
- 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.d.ts +19 -18
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +18 -17
- package/esm2015/lib/directives/command.directive.js +28 -5
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +2 -7
- package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +3 -8
- package/esm2015/lib/interaction/interaction-context.js +70 -14
- package/esm2015/lib/interaction/services/dialog-interaction.service.js +11 -19
- package/esm2015/lib/place/navigation-session.js +182 -39
- package/esm2015/lib/place/place-component.js +4 -19
- package/esm2015/lib/place/place-router.js +65 -31
- package/esm2015/lib/place/route/guards/enter-place-guard.service.js +2 -2
- package/esm2015/lib/place/route/guards/leave-place.guard.js +7 -177
- package/esm5/coolon-angular-ui-powerups.js +18 -17
- package/esm5/lib/directives/command.directive.js +32 -5
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js +2 -11
- package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +3 -12
- package/esm5/lib/interaction/interaction-context.js +89 -27
- package/esm5/lib/interaction/services/dialog-interaction.service.js +11 -22
- package/esm5/lib/place/navigation-session.js +225 -54
- package/esm5/lib/place/place-component.js +4 -35
- package/esm5/lib/place/place-router.js +75 -37
- package/esm5/lib/place/route/guards/enter-place-guard.service.js +2 -2
- package/esm5/lib/place/route/guards/leave-place.guard.js +7 -176
- package/fesm2015/coolon-angular-ui-powerups.js +353 -299
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +430 -359
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/directives/command.directive.d.ts +2 -0
- package/lib/interaction/components/activity-container/activity-container.component.d.ts +1 -2
- package/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.d.ts +3 -4
- package/lib/interaction/interaction-context.d.ts +6 -3
- package/lib/interaction/services/dialog-interaction.service.d.ts +3 -5
- package/lib/place/navigation-session.d.ts +26 -9
- package/lib/place/place-component.d.ts +4 -9
- package/lib/place/place-router.d.ts +6 -3
- package/lib/place/route/guards/leave-place.guard.d.ts +2 -10
- package/package.json +1 -1
|
@@ -2,6 +2,8 @@ import { AfterViewInit, ElementRef, OnDestroy, OnInit } from '@angular/core';
|
|
|
2
2
|
import { Command, GarbageCollector, UnaryCommand } from '@coolon/pectin';
|
|
3
3
|
export declare class CommandDirective<P = any> extends GarbageCollector implements OnInit, OnDestroy, AfterViewInit {
|
|
4
4
|
private elementRef;
|
|
5
|
+
private _command;
|
|
6
|
+
private _commandEnabled;
|
|
5
7
|
pectinCommand: Command<any> | UnaryCommand<P>;
|
|
6
8
|
private _commandParameter;
|
|
7
9
|
private _commandParameterProvided;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AfterViewInit, EventEmitter, OnInit, QueryList } from '@angular/core';
|
|
2
2
|
import { MatTabGroup } from '@angular/material';
|
|
3
|
-
import { Constructable,
|
|
3
|
+
import { Constructable, MutableListModel } from '@coolon/pectin';
|
|
4
4
|
import { Activity } from '../../activity';
|
|
5
5
|
import { Alert } from '../../alert';
|
|
6
6
|
import { Confirm } from '../../confirm';
|
|
@@ -39,7 +39,6 @@ export declare class ActivityContainerComponent<D, R, E> extends InteractionCont
|
|
|
39
39
|
private readonly _activityList;
|
|
40
40
|
constructor();
|
|
41
41
|
isActive(): boolean;
|
|
42
|
-
readonly activityList: ListModel<Activity<any, any, any>>;
|
|
43
42
|
readonly isFinished: boolean;
|
|
44
43
|
ngOnInit(): void;
|
|
45
44
|
ngAfterViewInit(): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AfterViewInit } from '@angular/core';
|
|
2
2
|
import { Constructable } from '@coolon/pectin';
|
|
3
3
|
import { Activity } from '../../activity';
|
|
4
4
|
import { Alert } from '../../alert';
|
|
@@ -6,12 +6,11 @@ import { Confirm } from '../../confirm';
|
|
|
6
6
|
import { InteractionContext } from '../../interaction-context';
|
|
7
7
|
import { ActivityContainerComponent } from '../activity-container/activity-container.component';
|
|
8
8
|
import { ActivityOutletContext } from '../activity-outlet/activity-outlet-context';
|
|
9
|
-
export declare class InplaceInteractionContextComponent<D, R, E> extends InteractionContext implements
|
|
9
|
+
export declare class InplaceInteractionContextComponent<D, R, E> extends InteractionContext implements AfterViewInit {
|
|
10
10
|
interactionContext: ActivityContainerComponent<any, any, any>;
|
|
11
11
|
initialActivityContext: ActivityOutletContext<D, R, E>;
|
|
12
12
|
constructor();
|
|
13
|
-
|
|
14
|
-
readonly activityList: import("@coolon/pectin").ListModel<Activity<any, any, any>>;
|
|
13
|
+
ngAfterViewInit(): void;
|
|
15
14
|
isActive(): boolean;
|
|
16
15
|
alert(alert: Alert): Promise<void>;
|
|
17
16
|
confirmOrReject(confirm: Confirm): Promise<void>;
|
|
@@ -7,20 +7,23 @@ export declare abstract class InteractionContext extends GarbageCollector {
|
|
|
7
7
|
* Returns the current list of activities that are in progress.
|
|
8
8
|
* This model is only updated in the next tick after the view has been updated.
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
private readonly _activityListDelegate;
|
|
11
|
+
private deferredGetCurrentActivity;
|
|
11
12
|
protected constructor();
|
|
13
|
+
protected setActivityList(activityList: ListModel<Activity<any, any>>): void;
|
|
14
|
+
readonly activityList: ListModel<Activity<any, any, any>>;
|
|
12
15
|
/**
|
|
13
16
|
* Returns the activity that is currently active.
|
|
14
17
|
* This model is only updated in the next tick after the view has been updated.
|
|
15
18
|
*/
|
|
16
|
-
|
|
19
|
+
getCurrentActivity(): Promise<Activity<any, any>>;
|
|
17
20
|
/**
|
|
18
21
|
* Returns true if an activity is currently running.
|
|
19
22
|
*/
|
|
20
23
|
abstract isActive(): boolean;
|
|
21
24
|
abstract startActivity<D, R, E>(activityType: Constructable<Activity<D, R, E>>, data?: D): Promise<R>;
|
|
22
|
-
abstract confirmOrReject(confirm: Confirm): Promise<void>;
|
|
23
25
|
confirm(confirm: Confirm): Promise<boolean>;
|
|
26
|
+
abstract confirmOrReject(confirm: Confirm): Promise<void>;
|
|
24
27
|
/**
|
|
25
28
|
* Presents the confirmation to the user and runs the activity only if the user confirms.
|
|
26
29
|
* @param confirm:Confirm the confirmation to display.
|
|
@@ -3,7 +3,7 @@ import { InjectionToken } from '@angular/core';
|
|
|
3
3
|
import { MatDialog } from '@angular/material';
|
|
4
4
|
import { MatDialogConfig } from '@angular/material/dialog';
|
|
5
5
|
import { Router } from '@angular/router';
|
|
6
|
-
import {
|
|
6
|
+
import { Constructable, ListModel, ValueModel } from '@coolon/pectin';
|
|
7
7
|
import { Activity } from '../activity';
|
|
8
8
|
import { Alert } from '../alert';
|
|
9
9
|
import { Confirm } from '../confirm';
|
|
@@ -15,13 +15,11 @@ export declare class DialogInteractionService extends InteractionContext {
|
|
|
15
15
|
readonly router: Router;
|
|
16
16
|
readonly dialogServiceDefaults: MatDialogConfig<any>;
|
|
17
17
|
readonly matDialogDefaultConfig: MatDialogConfig<any>;
|
|
18
|
-
private readonly _activityList;
|
|
19
18
|
private startingGuard;
|
|
20
|
-
readonly
|
|
19
|
+
private readonly _inActivityPromise;
|
|
21
20
|
constructor(dialogService: MatDialog, location: Location, router: Router, dialogServiceDefaults: MatDialogConfig<any>, matDialogDefaultConfig: MatDialogConfig<any>);
|
|
22
21
|
isActive(): boolean;
|
|
23
|
-
|
|
24
|
-
readonly activityList: ListModel<Activity<any, any>>;
|
|
22
|
+
readonly active: ValueModel<boolean>;
|
|
25
23
|
startActivity<D, R, E>(activityType: Constructable<Activity<D, R, E>>, data?: D): Promise<R>;
|
|
26
24
|
private _startActivity;
|
|
27
25
|
/**
|
|
@@ -1,26 +1,43 @@
|
|
|
1
|
+
import { InteractionContext } from '../interaction/interaction-context';
|
|
1
2
|
import { PlaceComponent } from './place-component';
|
|
2
3
|
import { PlaceDefinition } from './place-definition';
|
|
4
|
+
import { PlaceRouter } from './place-router';
|
|
3
5
|
import { Visit } from './visit';
|
|
4
6
|
export declare abstract class NavigationSession {
|
|
5
7
|
readonly firstNavigation: boolean;
|
|
8
|
+
private readonly appModalInteractionContext;
|
|
6
9
|
private _alreadyAccepted;
|
|
7
10
|
private _visits;
|
|
8
11
|
private _popStateReturnUrl;
|
|
9
12
|
abstract readonly isExternal: boolean;
|
|
10
|
-
|
|
13
|
+
readonly dialogOpenOnStart: boolean;
|
|
14
|
+
private componentDeactivationHandlers;
|
|
15
|
+
protected constructor(firstNavigation: boolean, appModalInteractionContext: InteractionContext);
|
|
11
16
|
storeVisit(visit: Visit): void;
|
|
12
17
|
getVisitFor(placeDef: PlaceDefinition): Visit;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}): NavigationSession;
|
|
16
|
-
alreadyAccepted(placeComponent: PlaceComponent): boolean;
|
|
17
|
-
rememberAcceptanceOf(component: PlaceComponent): void;
|
|
18
|
-
setPopstateReturn(url: string): void;
|
|
18
|
+
canDeactivate(component: PlaceComponent, nextState: PlaceRouter.UrlHelper): Promise<boolean>;
|
|
19
|
+
setPopstateReturnUrl(url: string): void;
|
|
19
20
|
readonly isPopState: boolean;
|
|
20
21
|
readonly popStateReturnUrl: string;
|
|
21
22
|
getVisits(): Visit[];
|
|
22
23
|
}
|
|
23
24
|
export declare namespace NavigationSession {
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
class Factory {
|
|
26
|
+
readonly appModelInteractionContext: InteractionContext;
|
|
27
|
+
constructor(appModelInteractionContext: InteractionContext);
|
|
28
|
+
createInternal(visit: Visit): NavigationSession;
|
|
29
|
+
createExternal(firstTimeRoute: boolean): NavigationSession;
|
|
30
|
+
}
|
|
31
|
+
class ComponentDeactivationHandler {
|
|
32
|
+
readonly component: PlaceComponent;
|
|
33
|
+
readonly appModelInteractionContext: InteractionContext;
|
|
34
|
+
readonly primary: boolean;
|
|
35
|
+
private alreadyAccepted;
|
|
36
|
+
constructor(component: PlaceComponent, appModelInteractionContext: InteractionContext, primary: boolean);
|
|
37
|
+
canDeactivate(nextState: PlaceRouter.UrlHelper): Promise<boolean>;
|
|
38
|
+
protected canDeactivateComponent(nextState: PlaceRouter.UrlHelper): Promise<boolean>;
|
|
39
|
+
isAppModalInteractionContext(interactionContext: InteractionContext): boolean;
|
|
40
|
+
protected cancelCurrentActivityOf(interactionContext: InteractionContext): Promise<void>;
|
|
41
|
+
protected isLeavingCurrentPlace(nextState: PlaceRouter.UrlHelper): boolean;
|
|
42
|
+
}
|
|
26
43
|
}
|
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
import { Constructable,
|
|
1
|
+
import { Constructable, ValueModel } from '@coolon/pectin';
|
|
2
2
|
import 'reflect-metadata';
|
|
3
|
+
import { DisposableComponent } from '../components/disposable-component';
|
|
3
4
|
import { InteractionContext } from '../interaction/interaction-context';
|
|
4
5
|
import { PlaceDefinition } from './place-definition';
|
|
5
6
|
import { ParameterDefinition } from './route/parameter-definition.class';
|
|
6
7
|
import { Visit } from './visit';
|
|
7
8
|
export declare const DEFINITION_META_DATA_KEY = "PLACE_DEFINITION_OPTIONS";
|
|
8
9
|
export declare const ROUTE_PARAMETER_LIST_KEY: unique symbol;
|
|
9
|
-
export declare class PlaceComponent extends
|
|
10
|
+
export declare class PlaceComponent extends DisposableComponent {
|
|
10
11
|
private visit;
|
|
11
12
|
interactionContext?: InteractionContext;
|
|
13
|
+
canDeactivate?(): boolean | Promise<boolean>;
|
|
12
14
|
constructor();
|
|
13
15
|
initialiseBindings(visit: ValueModel<Visit>): void;
|
|
14
16
|
private installBinding;
|
|
15
17
|
readonly placeDefinition: PlaceDefinition;
|
|
16
18
|
readonly childPlaces: Constructable<PlaceComponent>[];
|
|
17
|
-
canDeactivate(): boolean | Promise<boolean>;
|
|
18
19
|
onPlaceReady(): void;
|
|
19
|
-
/**
|
|
20
|
-
* Called by the place outlet after all animations have finished. We need this instead of ngOnDestroy
|
|
21
|
-
* to avoid the fact that the angular router calls it before the animations have run causing the component
|
|
22
|
-
* to loose any pectin bindings.
|
|
23
|
-
*/
|
|
24
|
-
onPlaceDestroyed(): void;
|
|
25
20
|
}
|
|
26
21
|
export declare namespace PlaceComponent {
|
|
27
22
|
function isPlaceComponentConstructor(target: any): target is Constructable<PlaceComponent>;
|
|
@@ -2,11 +2,13 @@ import { Location } from '@angular/common';
|
|
|
2
2
|
import { ActivatedRoute, ActivatedRouteSnapshot, Router, RouterStateSnapshot, UrlSegment, UrlSerializer, UrlTree } from '@angular/router';
|
|
3
3
|
import { BooleanValueModelChain, GarbageCollector, HasOneIndexChain, ListModel, ValueModel } from '@coolon/pectin';
|
|
4
4
|
import { NavigationSession } from './navigation-session';
|
|
5
|
+
import { PlaceDefinition } from './place-definition';
|
|
5
6
|
import { PlaceHistory } from './place-history';
|
|
6
7
|
import { Visit } from './visit';
|
|
7
8
|
export declare class PlaceRouter extends GarbageCollector {
|
|
8
9
|
private readonly router;
|
|
9
10
|
private readonly urlSerializer;
|
|
11
|
+
private readonly navigationSessionFactory;
|
|
10
12
|
readonly angularLocation: Location;
|
|
11
13
|
readonly placeHistory: PlaceHistory;
|
|
12
14
|
private firstRoute;
|
|
@@ -14,7 +16,7 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
14
16
|
private readonly _activeVisits;
|
|
15
17
|
readonly navigationSessionActive: BooleanValueModelChain;
|
|
16
18
|
readonly activeVisitIndex: HasOneIndexChain<'placeDefinition', Visit>;
|
|
17
|
-
constructor(router: Router, urlSerializer: UrlSerializer, angularLocation: Location, placeHistory: PlaceHistory);
|
|
19
|
+
constructor(router: Router, urlSerializer: UrlSerializer, navigationSessionFactory: NavigationSession.Factory, angularLocation: Location, placeHistory: PlaceHistory);
|
|
18
20
|
readonly navigationSession: NavigationSession;
|
|
19
21
|
readonly navigationSessionModel: ValueModel<NavigationSession>;
|
|
20
22
|
readonly activeVisits: ListModel<Visit>;
|
|
@@ -31,10 +33,10 @@ export declare class PlaceRouter extends GarbageCollector {
|
|
|
31
33
|
private onAngularRouterStarted;
|
|
32
34
|
private onAngularRouterFinished;
|
|
33
35
|
extractChildPath(activatedRoute: ActivatedRouteSnapshot): any[];
|
|
34
|
-
|
|
36
|
+
parseUrl(snapshot: RouterStateSnapshot): PlaceRouter.UrlHelper;
|
|
35
37
|
}
|
|
36
38
|
export declare namespace PlaceRouter {
|
|
37
|
-
class
|
|
39
|
+
class UrlHelper {
|
|
38
40
|
private urlTree;
|
|
39
41
|
constructor(urlTree: UrlTree);
|
|
40
42
|
cloneUrlSegmentList(): UrlSegment[];
|
|
@@ -45,5 +47,6 @@ export declare namespace PlaceRouter {
|
|
|
45
47
|
*/
|
|
46
48
|
convertToUrlSegments(visit: Visit): UrlSegment[];
|
|
47
49
|
createRedirectCommandsFor(visit: Visit): any[];
|
|
50
|
+
includesPathOf(placeDef: PlaceDefinition): UrlSegment;
|
|
48
51
|
}
|
|
49
52
|
}
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Injector } from '@angular/core';
|
|
3
|
-
import { ActivatedRouteSnapshot, CanDeactivate, Router, RouterStateSnapshot } from '@angular/router';
|
|
4
|
-
import { InteractionContext } from '../../../interaction/interaction-context';
|
|
1
|
+
import { ActivatedRouteSnapshot, CanDeactivate, RouterStateSnapshot } from '@angular/router';
|
|
5
2
|
import { PlaceComponent } from '../../place-component';
|
|
6
3
|
import { PlaceRouter } from '../../place-router';
|
|
7
4
|
export declare class LeavePlaceGuard implements CanDeactivate<PlaceComponent> {
|
|
8
|
-
private router;
|
|
9
|
-
private injector;
|
|
10
5
|
private placeRouter;
|
|
11
|
-
|
|
12
|
-
readonly angularLocation: Location;
|
|
13
|
-
constructor(router: Router, injector: Injector, placeRouter: PlaceRouter, dialogInteractionContext: InteractionContext, angularLocation: Location);
|
|
14
|
-
private isLeavingTheCurrentPlace;
|
|
6
|
+
constructor(placeRouter: PlaceRouter);
|
|
15
7
|
canDeactivate(component: PlaceComponent, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Promise<boolean>;
|
|
16
8
|
}
|