@coolon/angular-ui-powerups 13.0.2 → 13.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.
Files changed (26) hide show
  1. package/esm2020/lib/components/forms/abstract-list-input.component.mjs +8 -8
  2. package/esm2020/lib/components/forms/abstract-value-input.component.mjs +2 -2
  3. package/esm2020/lib/interaction/activity-ref.mjs +9 -2
  4. package/esm2020/lib/interaction/components/activity-container/activity-container.component.mjs +50 -29
  5. package/esm2020/lib/interaction/services/interaction.service.mjs +16 -7
  6. package/esm2020/lib/place/components/abstract-place-navigation.component.mjs +3 -3
  7. package/esm2020/lib/place/components/place-outlet/place-outlet.component.mjs +3 -3
  8. package/esm2020/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.mjs +4 -1
  9. package/esm2020/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.mjs +4 -1
  10. package/esm2020/lib/place/navigation/session/navigation-session.mjs +10 -7
  11. package/esm2020/lib/place/place-router.mjs +83 -56
  12. package/fesm2015/coolon-angular-ui-powerups.mjs +3204 -3133
  13. package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
  14. package/fesm2020/coolon-angular-ui-powerups.mjs +3385 -3318
  15. package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
  16. package/lib/components/forms/abstract-list-input.component.d.ts +4 -4
  17. package/lib/components/forms/abstract-value-input.component.d.ts +2 -2
  18. package/lib/interaction/components/activity-container/activity-container.component.d.ts +11 -9
  19. package/lib/interaction/services/interaction.service.d.ts +2 -2
  20. package/lib/place/navigation/session/interactions/remove-last-interaction-from-url-navigation-session.d.ts +1 -0
  21. package/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.d.ts +1 -0
  22. package/lib/place/navigation/session/navigation-session.d.ts +11 -10
  23. package/lib/place/place-router.d.ts +20 -18
  24. package/package.json +1 -1
  25. package/schematics/bootstrap-app/templates/src/app/app.component.ts.template +1 -2
  26. package/schematics/bootstrap-app/templates/src/styles.scss.template +59 -7
@@ -1,9 +1,9 @@
1
- import { EventEmitter, OnInit } from '@angular/core';
2
- import { Form, MutableListModel } from '@coolon/pectin';
3
- import { AbstractInputComponent } from './abstract-input.component';
1
+ import { EventEmitter, OnInit } from "@angular/core";
2
+ import { ConvertedFormListModel, Form, MutableListModel } from "@coolon/pectin";
3
+ import { AbstractInputComponent } from "./abstract-input.component";
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class AbstractListInputComponent<T> extends AbstractInputComponent<T[]> implements OnInit {
6
- listModel: Form.ListModelBase<T> | MutableListModel<T>;
6
+ listModel: Form.ListModelBase<T> | ConvertedFormListModel<T, any> | MutableListModel<T>;
7
7
  /**
8
8
  * A backing model for all our @Input() valueModel properties which should be defined as follows.
9
9
  *
@@ -1,9 +1,9 @@
1
1
  import { EventEmitter, OnInit } from '@angular/core';
2
- import { Form, Guard, MutableValueModel } from '@coolon/pectin';
2
+ import { ConvertedFormValueModel, Form, Guard, MutableValueModel } from "@coolon/pectin";
3
3
  import { AbstractInputComponent } from './abstract-input.component';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class AbstractValueInputComponent<T> extends AbstractInputComponent<T> implements OnInit {
6
- valueModel: Form.ValueModelBase<T> | MutableValueModel<T>;
6
+ valueModel: Form.ValueModelBase<T> | ConvertedFormValueModel<T, any> | MutableValueModel<T>;
7
7
  /**
8
8
  * A backing model for all our @Input() valueModel properties which should be defined as follows.
9
9
  *
@@ -1,13 +1,15 @@
1
- import { AfterViewInit, OnInit, QueryList } from '@angular/core';
2
- import { MatTabGroup } from '@angular/material/tabs';
3
- import { Constructable, DelegatingValueModel, Disposable, MutableValueModel } from '@coolon/pectin';
4
- import { AbstractInteractionContext } from '../../abstract-interaction-context';
5
- import { Activity } from '../../activity';
6
- import { ActivityRef } from '../../activity-ref';
7
- import { InteractionService } from '../../services/interaction.service';
8
- import { ActivityOutletComponent } from './activity-outlet/activity-outlet.component';
1
+ import { AfterViewInit, OnInit, QueryList } from "@angular/core";
2
+ import { MatTabGroup } from "@angular/material/tabs";
3
+ import { Constructable, DelegatingValueModel, Disposable, MutableValueModel } from "@coolon/pectin";
4
+ import { PlaceRouter } from "../../../place/place-router";
5
+ import { AbstractInteractionContext } from "../../abstract-interaction-context";
6
+ import { Activity } from "../../activity";
7
+ import { ActivityRef } from "../../activity-ref";
8
+ import { InteractionService } from "../../services/interaction.service";
9
+ import { ActivityOutletComponent } from "./activity-outlet/activity-outlet.component";
9
10
  import * as i0 from "@angular/core";
10
11
  export declare class ActivityContainerComponent<D, R, E> extends AbstractInteractionContext implements OnInit, AfterViewInit {
12
+ readonly placeRouter: PlaceRouter;
11
13
  dynamicHeight: boolean;
12
14
  tabs: MatTabGroup;
13
15
  activityOutlets: QueryList<ActivityOutletComponent<any, any, any>>;
@@ -20,7 +22,7 @@ export declare class ActivityContainerComponent<D, R, E> extends AbstractInterac
20
22
  private onAnimationFinishedJob;
21
23
  readonly inAnimation: MutableValueModel<boolean>;
22
24
  readonly busy: DelegatingValueModel<boolean>;
23
- constructor();
25
+ constructor(placeRouter: PlaceRouter);
24
26
  ngOnInit(): void;
25
27
  ngAfterViewInit(): void;
26
28
  initialise(identifier: string, api: InteractionService.Api): void;
@@ -53,7 +53,7 @@ export declare namespace InteractionService {
53
53
  /**
54
54
  * Notifies the interaction service that a particular interactionContext has become idle. The interaction
55
55
  * services will then push changes to the router to track state. If the router is idle, the promise will
56
- * resolve when the routing has finished updating. Otherwise it will return immediately.
56
+ * resolve when the routing has finished updating. Otherwise, it will return immediately.
57
57
  * @param interactionContext
58
58
  */
59
59
  notifyFinished(interactionContext: InteractionContext): Promise<unknown>;
@@ -75,7 +75,7 @@ export declare namespace InteractionService {
75
75
  isActive(): boolean;
76
76
  disableWhen(disabled: ValueModel<boolean>): void;
77
77
  }
78
- class ApiAdapter implements Api {
78
+ class ApiAdapter extends GarbageCollector implements Api {
79
79
  private readonly placeRouter;
80
80
  private readonly contextRegistry;
81
81
  constructor(placeRouter: PlaceRouter, contextRegistry: ContextRegistry);
@@ -13,6 +13,7 @@ export declare class RemoveLastInteractionFromUrlNavigationSession extends Navig
13
13
  private finished;
14
14
  private gotPopState;
15
15
  constructor(context: NavigationContext, startingUrl: string);
16
+ get isInteractionSync(): boolean;
16
17
  onPopState(event: NavigationStart): void;
17
18
  onRouterStarted(event: NavigationStart): void;
18
19
  onRouterCancelled(event: NavigationCancel): void;
@@ -5,6 +5,7 @@ export declare class SynchroniseInteractionContextIdsWithRoute extends Navigatio
5
5
  readonly wasTriggeredByPopState: boolean;
6
6
  readonly isPopState = false;
7
7
  constructor(context: NavigationContext, startingUrl: string, wasTriggeredByPopState: boolean);
8
+ get isInteractionSync(): boolean;
8
9
  notifyActive(): void;
9
10
  onRouterEnd(event: NavigationEnd): void;
10
11
  onRouterCancelled(event: NavigationCancel): void;
@@ -1,13 +1,13 @@
1
- import { NavigationCancel, NavigationEnd, NavigationError, NavigationStart, RouterEvent } from '@angular/router';
2
- import { GarbageCollector } from '@coolon/pectin';
3
- import { InteractionContext } from '../../../interaction/interaction-context';
4
- import { InteractionServiceRoutingAdapter } from '../../../interaction/services/interaction-service-routing-adapter';
5
- import { PlaceComponent } from '../../place-component';
6
- import { PlaceDefinition } from '../../place-definition';
7
- import { UrlService } from '../../url-service';
8
- import { UrlSnapshot } from '../../url-snapshot';
9
- import { Visit } from '../../visit';
10
- import { NavigationContext } from './navigation-context';
1
+ import { NavigationCancel, NavigationEnd, NavigationError, NavigationStart, RouterEvent } from "@angular/router";
2
+ import { GarbageCollector } from "@coolon/pectin";
3
+ import { InteractionContext } from "../../../interaction/interaction-context";
4
+ import { InteractionServiceRoutingAdapter } from "../../../interaction/services/interaction-service-routing-adapter";
5
+ import { PlaceComponent } from "../../place-component";
6
+ import { PlaceDefinition } from "../../place-definition";
7
+ import { UrlService } from "../../url-service";
8
+ import { UrlSnapshot } from "../../url-snapshot";
9
+ import { Visit } from "../../visit";
10
+ import { NavigationContext } from "./navigation-context";
11
11
  /**
12
12
  * Transient states
13
13
  */
@@ -20,6 +20,7 @@ export declare abstract class NavigationSession extends GarbageCollector {
20
20
  abstract readonly isPopState: boolean;
21
21
  private _interactionContext;
22
22
  constructor(context: NavigationContext, startingUrl: string);
23
+ get isInteractionSync(): boolean;
23
24
  get name(): string;
24
25
  get urlService(): UrlService;
25
26
  get interactionServiceAdapter(): InteractionServiceRoutingAdapter;
@@ -1,14 +1,14 @@
1
- import { Location } from '@angular/common';
2
- import { ActivatedRoute, ActivatedRouteSnapshot, NavigationCancel, NavigationEnd, NavigationError, NavigationExtras, NavigationStart, Router, RouterStateSnapshot } from '@angular/router';
3
- import { GarbageCollector, ListModel, MutableValueModel, ValueModel, ValueModelChain } from '@coolon/pectin';
4
- import { InteractionService } from '../interaction/services/interaction.service';
5
- import { NavigationSession } from './navigation/session/navigation-session';
6
- import { PlaceAccessGuard } from './place-access-guard';
7
- import { PlaceDefinition } from './place-definition';
8
- import { PlaceHistory } from './place-history';
9
- import { UrlService } from './url-service';
10
- import { UrlSnapshot } from './url-snapshot';
11
- import { Visit } from './visit';
1
+ import { Location } from "@angular/common";
2
+ import { ActivatedRoute, ActivatedRouteSnapshot, NavigationCancel, NavigationEnd, NavigationError, NavigationExtras, NavigationStart, Router, RouterStateSnapshot } from "@angular/router";
3
+ import { GarbageCollector, ListModel, MutableValueModel, ValueModel, ValueModelChain } from "@coolon/pectin";
4
+ import { InteractionService } from "../interaction/services/interaction.service";
5
+ import { NavigationSession } from "./navigation/session/navigation-session";
6
+ import { PlaceAccessGuard } from "./place-access-guard";
7
+ import { PlaceDefinition } from "./place-definition";
8
+ import { PlaceHistory } from "./place-history";
9
+ import { UrlService } from "./url-service";
10
+ import { UrlSnapshot } from "./url-snapshot";
11
+ import { Visit } from "./visit";
12
12
  import * as i0 from "@angular/core";
13
13
  export declare class PlaceRouter extends GarbageCollector {
14
14
  private readonly angularRouter;
@@ -16,14 +16,15 @@ export declare class PlaceRouter extends GarbageCollector {
16
16
  private readonly interactionService;
17
17
  private readonly urlService;
18
18
  private readonly placeHistory;
19
- readonly navigationSessionModel: MutableValueModel<NavigationSession>;
20
- readonly navigationInProgress: ValueModelChain<boolean>;
21
- readonly navigationSessionName: ValueModelChain<string>;
19
+ readonly navigationSession$: MutableValueModel<NavigationSession>;
20
+ readonly navigationInProgress$: ValueModelChain<boolean>;
21
+ readonly navigationSessionName$: ValueModelChain<string>;
22
+ readonly interactionSyncInProgress$: ValueModel<boolean>;
22
23
  private readonly navigationContext;
23
- private readonly _activeVisits;
24
+ private readonly _activeVisits$;
24
25
  private readonly routerInteractionAdapter;
25
26
  private sessionFinishedJobs;
26
- readonly state: ValueModel<PlaceRouter.State>;
27
+ readonly state$: ValueModel<PlaceRouter.State>;
27
28
  /**
28
29
  * An observable model containing the authoriser function. This allows places to react to changes
29
30
  * in permissions when any underlying auth logic changes, e.g. a role being removed from a user.
@@ -38,6 +39,7 @@ export declare class PlaceRouter extends GarbageCollector {
38
39
  get currentSession(): NavigationSession;
39
40
  isNavigating(): boolean;
40
41
  waitUntilIdle(): Promise<this>;
42
+ waitActivitiesSynchronised(): Promise<this>;
41
43
  onPopState(event: NavigationStart): void;
42
44
  onRouterStarted(event: NavigationStart): void;
43
45
  onUrlChanged(newUrl: string): void;
@@ -49,7 +51,7 @@ export declare class PlaceRouter extends GarbageCollector {
49
51
  }): Promise<void>;
50
52
  doNavigation(visit: Visit | Visit[], runNavigationCommands: (router: Router) => any): Promise<void>;
51
53
  navigateByUrl(urlSnapshot: UrlSnapshot, navigationExtras?: NavigationExtras): Promise<boolean>;
52
- get activeVisits(): ListModel<Visit>;
54
+ get activeVisits$(): ListModel<Visit>;
53
55
  pushVisitChangesToRoute(previous: Visit, next: Visit): Promise<void>;
54
56
  private createNavigationSession;
55
57
  protected transitionTo(next: NavigationSession): void;
@@ -60,7 +62,7 @@ export declare class PlaceRouter extends GarbageCollector {
60
62
  * to be able to capture the back button on the first page. If we don't then the back click will exit
61
63
  * the app directly and we don't get to ask.
62
64
  */
63
- syncInteractionContextIdsWithRouter(): Promise<void>;
65
+ syncInteractionContextIdsWithRouter(onSyncComplete?: () => void): Promise<void>;
64
66
  private createRouteParameters;
65
67
  static ɵfac: i0.ɵɵFactoryDeclaration<PlaceRouter, never>;
66
68
  static ɵprov: i0.ɵɵInjectableDeclaration<PlaceRouter>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coolon/angular-ui-powerups",
3
- "version": "13.0.2",
3
+ "version": "13.0.4",
4
4
  "schematics": "./schematics/collection.json",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^13.2.3",
@@ -9,8 +9,7 @@ import {Dsl} from "@coolon/pectin";
9
9
  })
10
10
  export class AppComponent extends DisposableComponent {
11
11
 
12
- readonly places = [
13
- ];
12
+ readonly places: Constructable<PlaceComponent>[] = [];
14
13
 
15
14
  constructor() {
16
15
  super();
@@ -1,13 +1,66 @@
1
- /* You can add global styles to this file, and also import other style files */
1
+ @use 'sass:map';
2
+ @use '@angular/material' as mat;
3
+ @use '@angular/material/theming';
2
4
 
3
- @use '@angular/material/theming' as ng;
4
- @use "@coolon/angular-ui-powerups/assets/styles" as aup;
5
+ @use "node_modules/@coolon/angular-ui-powerups/assets/styles" as aup;
5
6
  @use "./styles/global-variables";
6
7
 
7
- $primary: ng.mat-palette(ng.$mat-indigo);
8
- $accent: ng.mat-palette(ng.$mat-pink);
8
+ $success-palette: (
9
+ 50 : #e4feea,
10
+ 100 : #bbfdcc,
11
+ 200 : #8efbaa,
12
+ 300 : #61f987,
13
+ 400 : #3ff86e,
14
+ 500 : #1df754,
15
+ 600 : #1af64d,
16
+ 700 : #15f543,
17
+ 800 : #11f33a,
18
+ 900 : #0af129,
19
+ A100 : #ffffff,
20
+ A200 : #e7ffea,
21
+ A400 : #b4ffbc,
22
+ A700 : #9bffa5,
23
+ contrast: (
24
+ 50 : #000000,
25
+ 100 : #000000,
26
+ 200 : #000000,
27
+ 300 : #000000,
28
+ 400 : #000000,
29
+ 500 : #000000,
30
+ 600 : #000000,
31
+ 700 : #000000,
32
+ 800 : #000000,
33
+ 900 : #000000,
34
+ A100 : #000000,
35
+ A200 : #000000,
36
+ A400 : #000000,
37
+ A700 : #000000,
38
+ )
39
+ );
40
+
41
+ $typography: mat.define-typography-config();
42
+
43
+ $primary: mat.define-palette(mat.$indigo-palette);
44
+ $accent: mat.define-palette(mat.$yellow-palette);
45
+ $warn: mat.define-palette(mat.$red-palette);
46
+ $success: mat.define-palette($success-palette);
47
+
48
+ $theme: mat.define-light-theme((
49
+ color: (
50
+ primary: $primary,
51
+ accent: $accent,
52
+ warn: $warn,
53
+ )
54
+ ));
55
+
56
+ $background: map.get($theme, background);
57
+ $foreground: map.get($theme, foreground);
58
+
59
+ @include mat.core($typography);
60
+ @include mat.all-component-themes($theme);
61
+
62
+ @include aup.apply-light-theme($theme, $typography);
9
63
 
10
- @include aup.apply-light-theme($primary, $accent);
11
64
 
12
65
  @import "./assets/fonts/material-design-icons/material-icons.css";
13
66
 
@@ -30,4 +83,3 @@ body {
30
83
  body > *:first-child {
31
84
  flex: 1;
32
85
  }
33
-