@coolon/angular-ui-powerups 14.25.0 → 14.27.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/esm2020/lib/components/tables/paginator/paginator.component.mjs +8 -4
- package/esm2020/lib/components/tables/table-row-menu/table-row-menu.component.mjs +1 -1
- package/esm2020/lib/place/components/abstract-place-navigation.component.mjs +7 -5
- package/esm2020/lib/place/components/place-outlet/place-outlet.component.mjs +2 -2
- package/esm2020/lib/place/guards/place.guard.mjs +12 -4
- package/esm2020/lib/place/place-router.mjs +10 -6
- package/fesm2015/coolon-angular-ui-powerups.mjs +33 -15
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +33 -15
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/components/tables/paginator/paginator.component.d.ts +1 -0
- package/lib/components/tables/table-row-menu/table-row-menu.component.d.ts +2 -2
- package/lib/place/place-router.d.ts +16 -2
- package/package.json +2 -2
|
@@ -3970,9 +3970,13 @@ class TableModel extends AbstractTableModel {
|
|
|
3970
3970
|
class PaginatorComponent extends DisposableComponent {
|
|
3971
3971
|
constructor() {
|
|
3972
3972
|
super();
|
|
3973
|
+
const { chain } = Dsl.disposeWith(this);
|
|
3973
3974
|
}
|
|
3974
3975
|
ngOnInit() {
|
|
3975
3976
|
}
|
|
3977
|
+
get totalItems() {
|
|
3978
|
+
return this.pageController.totalItems$.value;
|
|
3979
|
+
}
|
|
3976
3980
|
get totalPages() {
|
|
3977
3981
|
return this.pageController.totalPages$.value;
|
|
3978
3982
|
}
|
|
@@ -3987,14 +3991,14 @@ class PaginatorComponent extends DisposableComponent {
|
|
|
3987
3991
|
}
|
|
3988
3992
|
}
|
|
3989
3993
|
PaginatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PaginatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3990
|
-
PaginatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: PaginatorComponent, selector: "aup-paginator", inputs: { pageController: "pageController" }, usesInheritance: true, ngImport: i0, template: "<p>Page {{pageNumber}} of {{totalPages}}</p>\n<button mat-icon-button [pectinCommand]=\"previousCommand\"><aup-icon icon=\"mat:keyboard_arrow_left\"></aup-icon></button>\n<button mat-icon-button [pectinCommand]=\"nextCommand\"><aup-icon icon=\"mat:keyboard_arrow_right\"></aup-icon></button>\n\n", styles: [":host{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;font-size:12px;padding:0 8px;color:#0009}:host p{color:inherit;margin:0 8px 0 0}:host button.md-button.md-icon-button{padding:0;margin:0;width:30px;height:30px}\n"], dependencies: [{ kind: "directive", type: CommandDirective, selector: "[pectinCommand]", inputs: ["pectinCommand", "commandParameter"] }, { kind: "component", type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: IconComponent, selector: "aup-icon", inputs: ["icon"] }] });
|
|
3994
|
+
PaginatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: PaginatorComponent, selector: "aup-paginator", inputs: { pageController: "pageController" }, usesInheritance: true, ngImport: i0, template: "<p>Items {{totalItems}}<span class=\"spacer\"></span>Page {{pageNumber}} of {{totalPages}}</p>\n<button mat-icon-button [pectinCommand]=\"previousCommand\"><aup-icon icon=\"mat:keyboard_arrow_left\"></aup-icon></button>\n<button mat-icon-button [pectinCommand]=\"nextCommand\"><aup-icon icon=\"mat:keyboard_arrow_right\"></aup-icon></button>\n\n", styles: [":host{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;font-size:12px;padding:0 8px;color:#0009}:host p{color:inherit;margin:0 8px 0 0}:host span.spacer{padding:0 calc(var(--default-padding) / 2)}:host span.spacer:before{content:\"|\";opacity:.35}:host button.md-button.md-icon-button{padding:0;margin:0;width:30px;height:30px}\n"], dependencies: [{ kind: "directive", type: CommandDirective, selector: "[pectinCommand]", inputs: ["pectinCommand", "commandParameter"] }, { kind: "component", type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: IconComponent, selector: "aup-icon", inputs: ["icon"] }] });
|
|
3991
3995
|
__decorate([
|
|
3992
3996
|
TrackExternal(),
|
|
3993
3997
|
__metadata("design:type", PageController)
|
|
3994
3998
|
], PaginatorComponent.prototype, "pageController", void 0);
|
|
3995
3999
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PaginatorComponent, decorators: [{
|
|
3996
4000
|
type: Component,
|
|
3997
|
-
args: [{ selector: 'aup-paginator', template: "<p>Page {{pageNumber}} of {{totalPages}}</p>\n<button mat-icon-button [pectinCommand]=\"previousCommand\"><aup-icon icon=\"mat:keyboard_arrow_left\"></aup-icon></button>\n<button mat-icon-button [pectinCommand]=\"nextCommand\"><aup-icon icon=\"mat:keyboard_arrow_right\"></aup-icon></button>\n\n", styles: [":host{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;font-size:12px;padding:0 8px;color:#0009}:host p{color:inherit;margin:0 8px 0 0}:host button.md-button.md-icon-button{padding:0;margin:0;width:30px;height:30px}\n"] }]
|
|
4001
|
+
args: [{ selector: 'aup-paginator', template: "<p>Items {{totalItems}}<span class=\"spacer\"></span>Page {{pageNumber}} of {{totalPages}}</p>\n<button mat-icon-button [pectinCommand]=\"previousCommand\"><aup-icon icon=\"mat:keyboard_arrow_left\"></aup-icon></button>\n<button mat-icon-button [pectinCommand]=\"nextCommand\"><aup-icon icon=\"mat:keyboard_arrow_right\"></aup-icon></button>\n\n", styles: [":host{display:flex;flex-direction:row;justify-content:flex-end;align-items:center;font-size:12px;padding:0 8px;color:#0009}:host p{color:inherit;margin:0 8px 0 0}:host span.spacer{padding:0 calc(var(--default-padding) / 2)}:host span.spacer:before{content:\"|\";opacity:.35}:host button.md-button.md-icon-button{padding:0;margin:0;width:30px;height:30px}\n"] }]
|
|
3998
4002
|
}], ctorParameters: function () { return []; }, propDecorators: { pageController: [{
|
|
3999
4003
|
type: Input
|
|
4000
4004
|
}] } });
|
|
@@ -7124,7 +7128,7 @@ class PlaceRouter extends GarbageCollector {
|
|
|
7124
7128
|
* An observable model containing the authoriser function. This allows places to react to changes
|
|
7125
7129
|
* in permissions when any underlying auth logic changes, e.g. a role being removed from a user.
|
|
7126
7130
|
*/
|
|
7127
|
-
this._accessGuard = this.registerDisposable(new DelegatingValueModel().withDefault(new PlaceAccessGuard.NoAuth()));
|
|
7131
|
+
this._accessGuard$ = this.registerDisposable(new DelegatingValueModel().withDefault(new PlaceAccessGuard.NoAuth()));
|
|
7128
7132
|
if (window["Cypress"]) {
|
|
7129
7133
|
window["aup.PlaceRouter"] = this;
|
|
7130
7134
|
}
|
|
@@ -7184,8 +7188,8 @@ class PlaceRouter extends GarbageCollector {
|
|
|
7184
7188
|
// the back button was clicked.
|
|
7185
7189
|
angularLocation.onUrlChange(url => this.onUrlChanged(url));
|
|
7186
7190
|
}
|
|
7187
|
-
get accessGuard() {
|
|
7188
|
-
return this._accessGuard
|
|
7191
|
+
get accessGuard$() {
|
|
7192
|
+
return this._accessGuard$.readonly;
|
|
7189
7193
|
}
|
|
7190
7194
|
// @Trace()
|
|
7191
7195
|
configureAuth(accessGrant, redirections) {
|
|
@@ -7198,12 +7202,15 @@ class PlaceRouter extends GarbageCollector {
|
|
|
7198
7202
|
toLeft: (rightValue) => rightValue
|
|
7199
7203
|
});
|
|
7200
7204
|
binding.writeLeft();
|
|
7201
|
-
this._accessGuard
|
|
7205
|
+
this._accessGuard$.setDelegate(hackyMutableModel);
|
|
7202
7206
|
this.redirections = redirections;
|
|
7203
7207
|
}
|
|
7204
7208
|
getAuthenticationFailureRedirect(activatedRoute, state) {
|
|
7205
7209
|
return this.redirections.onAuthenticationFailure(activatedRoute, state);
|
|
7206
7210
|
}
|
|
7211
|
+
getAuthorisationFailureRedirectOptions(component) {
|
|
7212
|
+
return this.redirections.onAuthorisationFailure(component);
|
|
7213
|
+
}
|
|
7207
7214
|
get navigationSession() {
|
|
7208
7215
|
return this.navigationSession$.value;
|
|
7209
7216
|
}
|
|
@@ -7383,7 +7390,8 @@ class PlaceRouter extends GarbageCollector {
|
|
|
7383
7390
|
* the app directly and we don't get to ask.
|
|
7384
7391
|
*/
|
|
7385
7392
|
// @Trace()
|
|
7386
|
-
syncInteractionContextIdsWithRouter(onSyncComplete = () => {
|
|
7393
|
+
syncInteractionContextIdsWithRouter(onSyncComplete = () => {
|
|
7394
|
+
}) {
|
|
7387
7395
|
if (this.navigationSession) {
|
|
7388
7396
|
// console.log(`Navigation active -> ${this.navigationSession.toString()}, sync delayed until finished.`);
|
|
7389
7397
|
const session = this.navigationSession;
|
|
@@ -9569,7 +9577,7 @@ class PlaceOutletComponent extends DisposableComponent {
|
|
|
9569
9577
|
chain(this._activePlaceModel)
|
|
9570
9578
|
.postponeWhile(this.navigationInProgress)
|
|
9571
9579
|
.subscribe(place => this.placeChanged.emit(place));
|
|
9572
|
-
this.authorised = chain(placeRouter.accessGuard).map(guard => guard.isAuthorised(this._activePlaceDefinition.value), {
|
|
9580
|
+
this.authorised = chain(placeRouter.accessGuard$).map(guard => guard.isAuthorised(this._activePlaceDefinition.value), {
|
|
9573
9581
|
dependsOn: this._activePlaceDefinition,
|
|
9574
9582
|
postponeWhile: chain(this._activePlaceDefinition).isNil()
|
|
9575
9583
|
}).otherwise(true); // if we don't have a place def yet we need to show the outlet so we get one injected.
|
|
@@ -9767,10 +9775,12 @@ class AbstractPlaceNavigationComponent extends DisposableComponent {
|
|
|
9767
9775
|
this.placeDefinitions = chain(this.placesModel)
|
|
9768
9776
|
.map(c => PlaceComponent.getDefinition(c))
|
|
9769
9777
|
.select(d => {
|
|
9770
|
-
const guard = placeRouter.accessGuard
|
|
9771
|
-
|
|
9772
|
-
|
|
9773
|
-
|
|
9778
|
+
const guard = placeRouter.accessGuard$.value;
|
|
9779
|
+
return guard.isAuthorised(d);
|
|
9780
|
+
}, {
|
|
9781
|
+
postponeWhile: placeRouter.navigationInProgress$,
|
|
9782
|
+
dependsOn: [placeRouter.accessGuard$, placeRouter.state$]
|
|
9783
|
+
});
|
|
9774
9784
|
this.commandFactory = Command.createFactory((placeDefinition) => {
|
|
9775
9785
|
this.placeOutlet.navigate(new Visit(placeDefinition));
|
|
9776
9786
|
});
|
|
@@ -10300,17 +10310,25 @@ class PlaceGuard {
|
|
|
10300
10310
|
async canActivate(activatedRoute, state) {
|
|
10301
10311
|
if (PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {
|
|
10302
10312
|
const placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);
|
|
10303
|
-
const accessGuard = this.placeRouter.accessGuard
|
|
10313
|
+
const accessGuard = this.placeRouter.accessGuard$.value;
|
|
10304
10314
|
if (placeDefinition.authenticate) {
|
|
10305
10315
|
const authenticated = await accessGuard.isAuthenticated();
|
|
10306
|
-
if (!authenticated
|
|
10316
|
+
if (!authenticated) {
|
|
10307
10317
|
const redirectLocation = this.placeRouter.getAuthenticationFailureRedirect(activatedRoute, state);
|
|
10308
10318
|
const nextPlaceDef = this.getPlaceDefinition(redirectLocation);
|
|
10309
10319
|
if (nextPlaceDef.authenticate) {
|
|
10310
|
-
lang.illegalState(`
|
|
10320
|
+
lang.illegalState(`onAuthenticationFailure hook returned place ${nextPlaceDef.component.name} that requires authentication.`);
|
|
10311
10321
|
}
|
|
10312
10322
|
return this.createUrlTree(redirectLocation);
|
|
10313
10323
|
}
|
|
10324
|
+
if (!accessGuard.isAuthorised(placeDefinition)) {
|
|
10325
|
+
const redirectOptions = this.placeRouter.getAuthorisationFailureRedirectOptions(activatedRoute.component);
|
|
10326
|
+
const nextRedirect = redirectOptions.find(it => accessGuard.isAuthorised(this.getPlaceDefinition(it)));
|
|
10327
|
+
if (!nextRedirect) {
|
|
10328
|
+
lang.illegalState(`onAuthorisationFailure hook didn't return any authorised locations: ${redirectOptions.map(it => this.getPlaceDefinition(it).component.name).join(', ')}`);
|
|
10329
|
+
}
|
|
10330
|
+
return this.createUrlTree(nextRedirect);
|
|
10331
|
+
}
|
|
10314
10332
|
}
|
|
10315
10333
|
const result = await this.cleanInteractionState(activatedRoute, state, async () => {
|
|
10316
10334
|
const navigationSession = this.placeRouter.navigationSession;
|