@coolon/angular-ui-powerups 14.41.1 → 14.42.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/place/components/abstract-place-navigation.component.mjs +10 -18
- package/esm2020/lib/place/place-component.mjs +22 -5
- package/fesm2015/coolon-angular-ui-powerups.mjs +27 -19
- package/fesm2015/coolon-angular-ui-powerups.mjs.map +1 -1
- package/fesm2020/coolon-angular-ui-powerups.mjs +26 -18
- package/fesm2020/coolon-angular-ui-powerups.mjs.map +1 -1
- package/lib/place/components/abstract-place-navigation.component.d.ts +3 -3
- package/lib/place/place-component.d.ts +9 -2
- package/package.json +1 -1
|
@@ -6403,9 +6403,19 @@ class PlaceComponent extends DisposableComponent {
|
|
|
6403
6403
|
this._inVisitUpdate = new Guard();
|
|
6404
6404
|
this._active = new MutableValueModel(false);
|
|
6405
6405
|
this._parameterChangeInterceptors = [];
|
|
6406
|
+
this.placeRouter = inject(PlaceRouter);
|
|
6406
6407
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
6407
6408
|
when(this._active).becomesTruthy(() => this._notifyPlaceReady());
|
|
6408
|
-
this.childPlaces = this.placeDefinition.children.map(d => d.component);
|
|
6409
|
+
this.childPlaces$ = ListModel.constant(this.placeDefinition.children.map(d => d.component));
|
|
6410
|
+
this.authorisedChildPlaces$ = chain(this.childPlaces$)
|
|
6411
|
+
.select(placeType => {
|
|
6412
|
+
const definition = PlaceComponent.getDefinition(placeType);
|
|
6413
|
+
const guard = this.placeRouter.accessGuard$.value;
|
|
6414
|
+
return guard.isAuthorised(definition) || this.placeRouter.activeVisit$.value?.isPlaceActive(definition);
|
|
6415
|
+
}, {
|
|
6416
|
+
postponeWhile: this.placeRouter.navigationInProgress$,
|
|
6417
|
+
dependsOn: [this.placeRouter.accessGuard$, this.placeRouter.activeVisit$]
|
|
6418
|
+
});
|
|
6409
6419
|
}
|
|
6410
6420
|
initialiseVisit(visit, notifyVisitChanged) {
|
|
6411
6421
|
assert.isNil(this.visitModel.value);
|
|
@@ -6429,6 +6439,12 @@ class PlaceComponent extends DisposableComponent {
|
|
|
6429
6439
|
// notifyVisitChanged(this.visitModel.value, visit)
|
|
6430
6440
|
// }
|
|
6431
6441
|
}
|
|
6442
|
+
/**
|
|
6443
|
+
* @deprecated use authorisedChildPlaces$ instead
|
|
6444
|
+
*/
|
|
6445
|
+
get childPlaces() {
|
|
6446
|
+
return this.authorisedChildPlaces$.value;
|
|
6447
|
+
}
|
|
6432
6448
|
updateVisit(visit) {
|
|
6433
6449
|
assert.isTruthy(this.isInitialised());
|
|
6434
6450
|
assert.notNil(visit);
|
|
@@ -10174,19 +10190,11 @@ class AbstractPlaceNavigationComponent extends DisposableComponent {
|
|
|
10174
10190
|
this.placeFaces = new Map();
|
|
10175
10191
|
this.trackByPlaceDef = (index, data) => data.place;
|
|
10176
10192
|
const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
|
|
10177
|
-
this.placeDefinitions = chain(this.
|
|
10178
|
-
.map(c => PlaceComponent.getDefinition(c))
|
|
10179
|
-
.select(d => {
|
|
10180
|
-
const guard = placeRouter.accessGuard$.value;
|
|
10181
|
-
return guard.isAuthorised(d) || placeRouter.activeVisit$.value?.isPlaceActive(d);
|
|
10182
|
-
}, {
|
|
10183
|
-
postponeWhile: placeRouter.navigationInProgress$,
|
|
10184
|
-
dependsOn: [placeRouter.accessGuard$, placeRouter.activeVisit$]
|
|
10185
|
-
});
|
|
10193
|
+
this.placeDefinitions = chain(this.places$).map(c => PlaceComponent.getDefinition(c));
|
|
10186
10194
|
this.commandFactory = Command.createFactory((placeDefinition) => {
|
|
10187
10195
|
this.placeRouter.navigate(placeDefinition.component);
|
|
10188
10196
|
});
|
|
10189
|
-
when(this.
|
|
10197
|
+
when(this.placeOutlet$).changes(outlet => this.handlePlaceOutLetChanged(outlet), { initialValue: "triggerChange" });
|
|
10190
10198
|
this.activePlaceDefinition = chain(this._activePlaceComponent).pluck('placeDefinition');
|
|
10191
10199
|
this.menuItems = chain(this.placeDefinitions).map(d => {
|
|
10192
10200
|
return {
|
|
@@ -10225,23 +10233,23 @@ class AbstractPlaceNavigationComponent extends DisposableComponent {
|
|
|
10225
10233
|
}
|
|
10226
10234
|
}
|
|
10227
10235
|
AbstractPlaceNavigationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: AbstractPlaceNavigationComponent, deps: [{ token: PlaceRouter }], target: i0.ɵɵFactoryTarget.Component });
|
|
10228
|
-
AbstractPlaceNavigationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: AbstractPlaceNavigationComponent, selector: "ng-component", inputs: { places: "places",
|
|
10236
|
+
AbstractPlaceNavigationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: AbstractPlaceNavigationComponent, selector: "ng-component", inputs: { places: "places", places$: "places$", placeOutlet: "placeOutlet", placeOutlet$: "placeOutlet$" }, usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
10229
10237
|
__decorate([
|
|
10230
|
-
StoreInListModel('
|
|
10238
|
+
StoreInListModel('places$'),
|
|
10231
10239
|
__metadata("design:type", Array)
|
|
10232
10240
|
], AbstractPlaceNavigationComponent.prototype, "places", void 0);
|
|
10233
10241
|
__decorate([
|
|
10234
10242
|
TrackExternal(),
|
|
10235
10243
|
__metadata("design:type", ListModel)
|
|
10236
|
-
], AbstractPlaceNavigationComponent.prototype, "
|
|
10244
|
+
], AbstractPlaceNavigationComponent.prototype, "places$", void 0);
|
|
10237
10245
|
__decorate([
|
|
10238
|
-
StoreInValueModel('
|
|
10246
|
+
StoreInValueModel('placeOutlet$'),
|
|
10239
10247
|
__metadata("design:type", PlaceOutletComponent)
|
|
10240
10248
|
], AbstractPlaceNavigationComponent.prototype, "placeOutlet", void 0);
|
|
10241
10249
|
__decorate([
|
|
10242
10250
|
TrackExternal(),
|
|
10243
10251
|
__metadata("design:type", ValueModel)
|
|
10244
|
-
], AbstractPlaceNavigationComponent.prototype, "
|
|
10252
|
+
], AbstractPlaceNavigationComponent.prototype, "placeOutlet$", void 0);
|
|
10245
10253
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: AbstractPlaceNavigationComponent, decorators: [{
|
|
10246
10254
|
type: Component,
|
|
10247
10255
|
args: [{
|
|
@@ -10249,11 +10257,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
10249
10257
|
}]
|
|
10250
10258
|
}], ctorParameters: function () { return [{ type: PlaceRouter }]; }, propDecorators: { places: [{
|
|
10251
10259
|
type: Input
|
|
10252
|
-
}],
|
|
10260
|
+
}], places$: [{
|
|
10253
10261
|
type: Input
|
|
10254
10262
|
}], placeOutlet: [{
|
|
10255
10263
|
type: Input
|
|
10256
|
-
}],
|
|
10264
|
+
}], placeOutlet$: [{
|
|
10257
10265
|
type: Input
|
|
10258
10266
|
}] } });
|
|
10259
10267
|
|