@coolon/angular-ui-powerups 12.3.0 → 12.4.0-alpha.0
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-cypress.umd.js +297 -93
- package/bundles/coolon-angular-ui-powerups-cypress.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.js +410 -290
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/cypress/components/aup-command-face.d.ts +2 -5
- package/cypress/components/aup-command.d.ts +18 -4
- package/cypress/components/aup-navigation.d.ts +0 -1
- package/cypress/components/aup-popup-menu.d.ts +2 -0
- package/cypress/components/aup-table.d.ts +19 -0
- package/cypress/components/button-mixin.d.ts +17 -0
- package/cypress/components/button.d.ts +17 -3
- package/cypress/coolon-angular-ui-powerups-cypress.d.ts +1 -0
- package/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
- package/cypress/exports.d.ts +3 -0
- package/cypress/page-element.d.ts +11 -2
- package/cypress/page.d.ts +16 -13
- package/cypress/path.d.ts +26 -0
- package/cypress/section.d.ts +8 -1
- package/esm2015/cypress/components/aup-command-face.js +20 -11
- package/esm2015/cypress/components/aup-command-face.js.map +1 -1
- package/esm2015/cypress/components/aup-command-face.metadata.json +1 -1
- package/esm2015/cypress/components/aup-command.js +10 -7
- package/esm2015/cypress/components/aup-command.js.map +1 -1
- package/esm2015/cypress/components/aup-command.metadata.json +1 -1
- package/esm2015/cypress/components/aup-more-menu.js +1 -2
- package/esm2015/cypress/components/aup-more-menu.js.map +1 -1
- package/esm2015/cypress/components/aup-more-menu.metadata.json +1 -1
- package/esm2015/cypress/components/aup-navigation.js +1 -5
- package/esm2015/cypress/components/aup-navigation.js.map +1 -1
- package/esm2015/cypress/components/aup-popup-menu.js +12 -3
- package/esm2015/cypress/components/aup-popup-menu.js.map +1 -1
- package/esm2015/cypress/components/aup-popup-menu.metadata.json +1 -1
- package/esm2015/cypress/components/aup-table.js +36 -0
- package/esm2015/cypress/components/aup-table.js.map +1 -0
- package/esm2015/cypress/components/aup-table.metadata.json +1 -0
- package/esm2015/cypress/components/button-mixin.js +15 -0
- package/esm2015/cypress/components/button-mixin.js.map +1 -0
- package/esm2015/cypress/components/button-mixin.metadata.json +1 -0
- package/esm2015/cypress/components/button.js +11 -7
- package/esm2015/cypress/components/button.js.map +1 -1
- package/esm2015/cypress/components/button.metadata.json +1 -1
- package/esm2015/cypress/coolon-angular-ui-powerups-cypress.js.map +1 -1
- package/esm2015/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
- package/esm2015/cypress/exports.js +3 -0
- package/esm2015/cypress/exports.js.map +1 -1
- package/esm2015/cypress/exports.metadata.json +1 -1
- package/esm2015/cypress/page-element.js +21 -5
- package/esm2015/cypress/page-element.js.map +1 -1
- package/esm2015/cypress/page-element.metadata.json +1 -1
- package/esm2015/cypress/page.js +32 -22
- package/esm2015/cypress/page.js.map +1 -1
- package/esm2015/cypress/page.metadata.json +1 -1
- package/esm2015/cypress/path.js +61 -0
- package/esm2015/cypress/path.js.map +1 -0
- package/esm2015/cypress/path.metadata.json +1 -0
- package/esm2015/cypress/section.js +20 -10
- package/esm2015/cypress/section.js.map +1 -1
- package/esm2015/lib/components/switch-case/switch-case.component.js +7 -0
- package/esm2015/lib/components/switch-case/switch-case.component.js.map +1 -1
- package/esm2015/lib/components/switch-case/switch-case.component.metadata.json +1 -1
- package/esm2015/lib/components/tables/abstract-table.component.js +1 -1
- package/esm2015/lib/components/tables/abstract-table.component.js.map +1 -1
- package/esm2015/lib/components/tables/table/table.component.js +1 -1
- package/esm2015/lib/components/tables/table/table.component.js.map +1 -1
- package/esm2015/lib/components/tables/table/table.component.metadata.json +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-table-component.js +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-table-component.js.map +1 -1
- package/esm2015/lib/components/tables/tree-table/tree-table-component.metadata.json +1 -1
- package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.js +1 -1
- package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.metadata.json +1 -1
- 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/guards/consolidated-param-map.js +7 -2
- package/esm2015/lib/place/guards/consolidated-param-map.js.map +1 -1
- package/esm2015/lib/place/guards/consolidated-param-map.metadata.json +1 -1
- package/esm2015/lib/place/guards/place.guard.js +1 -22
- package/esm2015/lib/place/guards/place.guard.js.map +1 -1
- package/esm2015/lib/place/navigation/place-component-deactivation-handler.js +24 -14
- package/esm2015/lib/place/navigation/place-component-deactivation-handler.js.map +1 -1
- package/esm2015/lib/place/navigation/place-component-deactivation-handler.metadata.json +1 -1
- package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js.map +1 -1
- package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.metadata.json +1 -1
- package/esm2015/lib/place/place-component.js +67 -5
- package/esm2015/lib/place/place-component.js.map +1 -1
- package/esm2015/lib/place/place-component.metadata.json +1 -1
- package/esm2015/lib/place/place-definition.js +3 -3
- package/esm2015/lib/place/place-definition.js.map +1 -1
- package/esm2015/lib/place/place-router.js +9 -4
- package/esm2015/lib/place/place-router.js.map +1 -1
- package/esm2015/lib/place/place-router.metadata.json +1 -1
- package/esm2015/lib/place/route/parameter-decorators.js +13 -14
- package/esm2015/lib/place/route/parameter-decorators.js.map +1 -1
- package/esm2015/lib/place/route/parameter-decorators.metadata.json +1 -1
- package/esm2015/lib/place/route/parameter-definition.js +21 -3
- package/esm2015/lib/place/route/parameter-definition.js.map +1 -1
- package/esm2015/lib/place/route/parameter-definition.metadata.json +1 -1
- package/esm2015/lib/place/route/visit-sanitiser.js +1 -1
- package/esm2015/lib/place/route/visit-sanitiser.js.map +1 -1
- package/esm2015/lib/place/url-snapshot.js +30 -7
- package/esm2015/lib/place/url-snapshot.js.map +1 -1
- package/esm2015/lib/place/url-snapshot.metadata.json +1 -1
- package/esm2015/lib/place/visit.js +7 -7
- package/esm2015/lib/place/visit.js.map +1 -1
- package/esm2015/lib/place/visit.metadata.json +1 -1
- package/fesm2015/coolon-angular-ui-powerups-cypress.js +235 -74
- package/fesm2015/coolon-angular-ui-powerups-cypress.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +369 -269
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/switch-case/switch-case.component.d.ts +7 -0
- package/lib/place/guards/consolidated-param-map.d.ts +2 -2
- package/lib/place/navigation/place-component-deactivation-handler.d.ts +3 -1
- package/lib/place/place-component.d.ts +26 -3
- package/lib/place/route/parameter-definition.d.ts +8 -0
- package/lib/place/url-snapshot.d.ts +1 -0
- package/lib/place/visit.d.ts +4 -4
- package/package.json +1 -1
- package/schematics/activity/schema.json +1 -1
- package/schematics/activity/templates/component/__name@dasherize__.component.html.template +1 -1
- package/schematics/activity/templates/component/__name@dasherize__.component.ts.template +2 -2
- package/schematics/aup-i18n/schema.json +1 -1
- package/schematics/bootstrap-app/schema.json +1 -1
- package/schematics/component/schema.json +1 -1
- package/schematics/place-add/schema.json +1 -1
- package/schematics/place-bootstrap/schema.json +1 -1
- package/schematics/place-routes/schema.json +1 -1
|
@@ -19,6 +19,13 @@ export declare class SwitchCaseDefaultDirective<T> extends SwitchCaseOption<T> {
|
|
|
19
19
|
constructor(templateRef: TemplateRef<Object>);
|
|
20
20
|
matches(value: T): boolean;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* @example
|
|
24
|
+
* <aup-switch-case [switchModel]="booleanModel">
|
|
25
|
+
* <div *aupSwitchCaseWhen="true"></div>
|
|
26
|
+
* <div *aupSwitchCaseDefault>The default content</div>
|
|
27
|
+
* </aup-switch-case>
|
|
28
|
+
*/
|
|
22
29
|
export declare class SwitchCaseComponent<T> extends DisposableComponent implements OnInit, AfterContentInit {
|
|
23
30
|
private cdr;
|
|
24
31
|
switchModel: ValueModel<T>;
|
|
@@ -5,8 +5,8 @@ import { ParamMap, UrlSegment } from '@angular/router';
|
|
|
5
5
|
* param map even when `parameter`s has content.
|
|
6
6
|
*/
|
|
7
7
|
export declare class ConsolidatedParameterMap implements ParamMap {
|
|
8
|
-
private paramMaps;
|
|
9
|
-
constructor(
|
|
8
|
+
private readonly paramMaps;
|
|
9
|
+
constructor(urlSegments: UrlSegment[], paramMap?: ParamMap);
|
|
10
10
|
get(name: string): string | null;
|
|
11
11
|
getAll(name: string): string[];
|
|
12
12
|
has(name: string): boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PlaceComponent } from '../place-component';
|
|
2
|
+
import { PlaceDefinition } from '../place-definition';
|
|
2
3
|
import { UrlSnapshot } from '../url-snapshot';
|
|
3
4
|
import { NavigationSession } from './session/navigation-session';
|
|
4
5
|
/**
|
|
@@ -16,7 +17,8 @@ export declare class PlaceComponentDeactivationHandler {
|
|
|
16
17
|
constructor(component: PlaceComponent, navigationSession: NavigationSession, isPrimaryComponent: boolean);
|
|
17
18
|
get routerInteractionAdapter(): import("../../interaction/exports").InteractionServiceRoutingAdapter;
|
|
18
19
|
get urlService(): import("../url-service").UrlService;
|
|
20
|
+
get placeDefinition(): PlaceDefinition;
|
|
19
21
|
canDeactivate(currentUrl: UrlSnapshot, nextState: UrlSnapshot): Promise<boolean | UrlSnapshot>;
|
|
20
22
|
protected canDeactivateComponent(currentUrl: UrlSnapshot, nextState: UrlSnapshot): Promise<UrlSnapshot | boolean>;
|
|
21
|
-
protected
|
|
23
|
+
protected isGoingToADifferentPlace(nextState: UrlSnapshot): boolean;
|
|
22
24
|
}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { ActivatedRouteSnapshot } from '@angular/router';
|
|
2
|
-
import { Constructable } from '@coolon/pectin';
|
|
2
|
+
import { Constructable, ValueModel } from '@coolon/pectin';
|
|
3
3
|
import 'reflect-metadata';
|
|
4
4
|
import { DisposableComponent } from '../components/disposable-component';
|
|
5
5
|
import { InteractionContext } from '../interaction/interaction-context';
|
|
6
6
|
import { PlaceDefinition } from './place-definition';
|
|
7
7
|
import { ParameterDefinition } from './route/parameter-definition';
|
|
8
|
+
import { UrlSnapshot } from './url-snapshot';
|
|
8
9
|
import { Visit } from './visit';
|
|
9
10
|
export declare const DEFINITION_META_DATA_KEY = "PLACE_DEFINITION_OPTIONS";
|
|
10
11
|
export declare const ROUTE_PARAMETER_LIST_KEY: unique symbol;
|
|
11
12
|
export declare class PlaceComponent extends DisposableComponent {
|
|
13
|
+
private readonly _placeReadyCallbacks;
|
|
12
14
|
private visitModel;
|
|
13
15
|
private _inVisitUpdate;
|
|
14
16
|
private _active;
|
|
15
17
|
interactionContext?: InteractionContext;
|
|
16
18
|
readonly childPlaces: ReadonlyArray<Constructable<PlaceComponent>>;
|
|
19
|
+
private readonly _parameterChangeInterceptors;
|
|
17
20
|
canDeactivate?(interactionContext: InteractionContext): boolean | Promise<boolean>;
|
|
18
21
|
constructor();
|
|
19
22
|
initialiseVisit(visit: Visit, notifyVisitChanged: (current: Visit, previous: Visit) => void): void;
|
|
@@ -21,16 +24,36 @@ export declare class PlaceComponent extends DisposableComponent {
|
|
|
21
24
|
isInitialised(): boolean;
|
|
22
25
|
private installBinding;
|
|
23
26
|
get placeDefinition(): PlaceDefinition;
|
|
24
|
-
get active():
|
|
27
|
+
get active(): ValueModel<boolean>;
|
|
28
|
+
/**
|
|
29
|
+
* Called by the router to see if this component can deactivate. This isn't called for route parameter changes.
|
|
30
|
+
* @param interactionContext
|
|
31
|
+
*/
|
|
32
|
+
_canLeavePlace(interactionContext: InteractionContext): Promise<boolean>;
|
|
33
|
+
/**
|
|
34
|
+
* Called by the router to see if this component can deactivate. This isn't called for route parameter changes.
|
|
35
|
+
* @param interactionContext
|
|
36
|
+
* @param nextState
|
|
37
|
+
*/
|
|
38
|
+
_canChangeRouteParameters(interactionContext: InteractionContext, nextState: UrlSnapshot): Promise<boolean>;
|
|
25
39
|
/**
|
|
26
40
|
* Called by the router when the place is ready to interact after any animations have run.
|
|
27
41
|
*/
|
|
28
42
|
_notifyActive(active: boolean): void;
|
|
29
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Called by the router when the place is ready to interact after any animations have run.
|
|
45
|
+
*/
|
|
46
|
+
_notifyPlaceReady(): void;
|
|
47
|
+
onPlaceReady(callback: () => void): void;
|
|
48
|
+
interceptVisitParameterChange<T>(model: ValueModel<T>, callback: PlaceComponent.InterceptCallback<T>, options?: PlaceComponent.InterceptOptions): void;
|
|
30
49
|
}
|
|
31
50
|
export declare namespace PlaceComponent {
|
|
32
51
|
function isPlaceComponentConstructor(target: any): target is Constructable<PlaceComponent>;
|
|
33
52
|
function getRouteParameters(klass: Constructable<PlaceComponent>): ParameterDefinition<any>[];
|
|
34
53
|
function getDefinition(snapshotOrConstructor: ActivatedRouteSnapshot | Constructable<PlaceComponent>): PlaceDefinition;
|
|
35
54
|
function injectDefinition(klass: Constructable<PlaceComponent>, definition: PlaceDefinition): void;
|
|
55
|
+
type InterceptCallback<T> = (is: T, was: T, interactionContext: InteractionContext) => boolean | Promise<boolean>;
|
|
56
|
+
interface InterceptOptions {
|
|
57
|
+
initialValue: 'evaluationUnlessNil' | 'evaluate';
|
|
58
|
+
}
|
|
36
59
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Injector } from '@angular/core';
|
|
2
|
+
import { HasValue, ListModel, MutableListModel, MutableValueModel, ValueModel } from '@coolon/pectin';
|
|
2
3
|
import { PlaceHistory } from '../place-history';
|
|
3
4
|
import { Visit } from '../visit';
|
|
4
5
|
import { Formatter } from './formatter';
|
|
@@ -10,11 +11,13 @@ export declare abstract class ParameterDefinition<T, E = T> {
|
|
|
10
11
|
readonly remember: boolean;
|
|
11
12
|
readonly defaultValue: T;
|
|
12
13
|
private options;
|
|
14
|
+
protected abstract backingModelFactory: () => HasValue<T>;
|
|
13
15
|
constructor(propertyName: string, options: ParameterDefinition.Options<T>, urlFormat?: Formatter<E>);
|
|
14
16
|
get name(): string;
|
|
15
17
|
get isRouteParameter(): boolean;
|
|
16
18
|
abstract isEmptyValue(value: T): boolean;
|
|
17
19
|
abstract hasChanged(a: any, b: any): boolean;
|
|
20
|
+
createBackingModel(): HasValue<T>;
|
|
18
21
|
protected getOptionValue<K extends keyof ParameterDefinition.Options<T>>(key: K): ParameterDefinition.Options<T>[K];
|
|
19
22
|
sanitise(value: T, visit: Visit, placeHistory: PlaceHistory, injector: Injector, isPopState: boolean): Promise<T>;
|
|
20
23
|
private isMissingFrom;
|
|
@@ -29,20 +32,25 @@ export declare namespace ParameterDefinition {
|
|
|
29
32
|
class RouteId<T> extends ParameterDefinition<T> {
|
|
30
33
|
readonly isRouteId = true;
|
|
31
34
|
readonly isArray = false;
|
|
35
|
+
protected backingModelFactory: () => MutableValueModel<T>;
|
|
32
36
|
isEmptyValue(value: T): boolean;
|
|
33
37
|
hasChanged(a: any, b: any): boolean;
|
|
34
38
|
}
|
|
35
39
|
class ValueParameter<T> extends ParameterDefinition<T> {
|
|
36
40
|
readonly isRouteId = false;
|
|
37
41
|
readonly isArray = false;
|
|
42
|
+
protected backingModelFactory: () => MutableValueModel<T>;
|
|
38
43
|
isEmptyValue(value: T): boolean;
|
|
39
44
|
hasChanged(a: any, b: any): boolean;
|
|
40
45
|
}
|
|
41
46
|
class ArrayParameter<T> extends ParameterDefinition<T[], T> {
|
|
42
47
|
readonly isRouteId = false;
|
|
43
48
|
readonly isArray = true;
|
|
49
|
+
protected backingModelFactory: () => MutableListModel<T>;
|
|
44
50
|
constructor(parameterName: string, options: Options<T[]>, urlFormat: Formatter<T>);
|
|
45
51
|
isEmptyValue(value: T[]): boolean;
|
|
46
52
|
hasChanged(a: T[], b: T[]): boolean;
|
|
47
53
|
}
|
|
54
|
+
function get<T>(model: ValueModel<T>): ParameterDefinition.ValueParameter<T>;
|
|
55
|
+
function get<T>(model: ListModel<T>): ParameterDefinition.ArrayParameter<T>;
|
|
48
56
|
}
|
|
@@ -14,6 +14,7 @@ export declare class UrlSnapshot {
|
|
|
14
14
|
*/
|
|
15
15
|
protected getSegmentsFor(visit: Visit): UrlSegment[];
|
|
16
16
|
includesPathOf(placeDef: PlaceDefinition): UrlSegment;
|
|
17
|
+
createVisitFor(placeDef: PlaceDefinition): Visit;
|
|
17
18
|
getInteractionIds(): string[];
|
|
18
19
|
hasInteractions(): boolean;
|
|
19
20
|
hasInteractionIds(ids: string[]): boolean;
|
package/lib/place/visit.d.ts
CHANGED
|
@@ -13,11 +13,11 @@ export declare class Visit {
|
|
|
13
13
|
* Returns the value of the place parameter with the specified name. The parameter
|
|
14
14
|
* name is taken from the `as` option, e.g. {as: 'aCustomName'} otherwise it is the
|
|
15
15
|
* same as the the ValueModel property name.
|
|
16
|
-
* @param
|
|
16
|
+
* @param parameterDef the visit parameter definition
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
|
-
hasParameter(
|
|
20
|
-
replace<
|
|
18
|
+
getParameterValue<T, S>(parameterDef: ParameterDefinition<T, S>): T;
|
|
19
|
+
hasParameter(parameterDef: ParameterDefinition<any>): boolean;
|
|
20
|
+
replace<T>(parameter: ParameterDefinition<T, any>, value: T): Visit;
|
|
21
21
|
mergeRouteParameters<S>(routeParams: {
|
|
22
22
|
[p: string]: any;
|
|
23
23
|
}): Visit;
|
package/package.json
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
<aup-activity-body>
|
|
3
3
|
<p><%=name%> works!</p>
|
|
4
4
|
</aup-activity-body>
|
|
5
|
-
<aup-activity-
|
|
5
|
+
<aup-activity-actions [confirmFace]="i18n.actions.confirm" [cancelFace]="i18n.actions.cancel"></aup-activity-actions>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Dsl } from '@coolon/pectin';
|
|
1
|
+
import {Component, Inject, OnInit} from '@angular/core';
|
|
2
|
+
import { Dsl, Command } from '@coolon/pectin';
|
|
3
3
|
import {Activity, ACTIVITY_DATA} from "@coolon/angular-ui-powerups";
|
|
4
4
|
import { I18n } from '<%=pathToRoot%>/i18n';
|
|
5
5
|
|