@coolon/angular-ui-powerups 16.1.0-aplpha.146 → 16.1.0-aplpha.148

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.
@@ -6939,7 +6939,6 @@ class ActivityContext extends InteractionContextProvider {
6939
6939
  * </aup-activity-actions>
6940
6940
  */
6941
6941
  class ActivityActionsComponent extends DisposableComponent {
6942
- activityContext;
6943
6942
  confirmCommandComponent;
6944
6943
  cancelCommandComponent;
6945
6944
  #confirmCommand_accessor_storage = proxify((Command));
@@ -6969,13 +6968,14 @@ class ActivityActionsComponent extends DisposableComponent {
6969
6968
  layout = ActivityActionsComponent.Layout.BLOCK;
6970
6969
  align = ActivityActionsComponent.Align.STRETCH;
6971
6970
  alignContent = ActivityActionsComponent.AlignContent.CENTER;
6972
- constructor(activityContext) {
6971
+ activityContext = this.inject(ActivityContext, {
6972
+ optional: true
6973
+ });
6974
+ constructor() {
6973
6975
  super();
6974
- this.activityContext = activityContext;
6975
- console.log(activityContext);
6976
- if (activityContext) {
6977
- this.confirmCommand = activityContext.confirmCommand;
6978
- this.cancelCommand = activityContext.cancelCommand;
6976
+ if (this.activityContext) {
6977
+ this.confirmCommand = this.activityContext.confirmCommand;
6978
+ this.cancelCommand = this.activityContext.cancelCommand;
6979
6979
  }
6980
6980
  }
6981
6981
  hasConfirmFace() {
@@ -6990,7 +6990,7 @@ class ActivityActionsComponent extends DisposableComponent {
6990
6990
  focusCancel() {
6991
6991
  this.cancelCommandComponent.requestFocus();
6992
6992
  }
6993
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: ActivityActionsComponent, deps: [{ token: ActivityContext, optional: true }], target: i0.ɵɵFactoryTarget.Component });
6993
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: ActivityActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
6994
6994
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.9", type: ActivityActionsComponent, selector: "aup-activity-actions", inputs: { confirmCommand: "confirmCommand", cancelCommand: "cancelCommand", faces: "faces", confirmFace: "confirmFace", cancelFace: "cancelFace", style: "style", layout: "layout", align: "align", alignContent: "alignContent" }, host: { properties: { "attr.layout": "this.layout", "attr.align": "this.align", "attr.align-content": "this.alignContent" } }, viewQueries: [{ propertyName: "confirmCommandComponent", first: true, predicate: ["confirmCommandComponent"], descendants: true }, { propertyName: "cancelCommandComponent", first: true, predicate: ["cancelCommandComponent"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"content\">\n <ng-content></ng-content>\n</div>\n<ng-container *ngIf=\"hasCancelFace()\">\n <aup-command #cancelCommandComponent class=\"cancel\" [command]=\"cancelCommand\" [face]=\"cancelFace\" data-cy=\"cancel-command\"></aup-command>\n</ng-container>\n<ng-container *ngIf=\"hasConfirmFace()\">\n <aup-command #confirmCommandComponent class=\"confirm\" [command]=\"confirmCommand\" [face]=\"confirmFace\" data-cy=\"confirm-command\"></aup-command>\n</ng-container>\n", styles: [":host{display:grid;grid-template-rows:auto;align-items:center;justify-content:end;--resolved-activity-actions-gap: var(--activity-actions-gap, 8px);grid-gap:var(--resolved-activity-actions-gap)}:host[layout=block][align=start]{grid-template-areas:\"cancel confirm content\";grid-template-columns:auto auto 1fr}:host[layout=block][align=start] .confirm{margin-left:var(--resolved-activity-actions-gap)}:host[layout=block][align=end]{grid-template-areas:\"content cancel confirm\";grid-template-columns:1fr auto auto}:host[layout=block][align=end] .confirm{margin-left:var(--resolved-activity-actions-gap)}:host[layout=block][align=stretch]{grid-template-areas:\"cancel content confirm\";grid-template-columns:auto 1fr auto}:host[layout=inline]{grid-template-areas:\"confirm cancel content\";grid-template-columns:auto auto 1fr}:host[layout=inline] .cancel{margin-left:var(--resolved-activity-actions-gap)}:host .cancel{grid-area:cancel}:host .confirm{grid-area:confirm}:host .content{display:flex;flex-direction:row;align-items:center}:host[align-content=start] .content{justify-items:start}:host[align-content=end]{justify-items:end}:host[align-content=center]{justify-items:center}\n"], dependencies: [{ kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CommandComponent, selector: "aup-command", inputs: ["command", "face$", "face", "busyFace$", "busyFace", "alignFace"] }] });
6995
6995
  }
6996
6996
  __decorate([
@@ -7004,9 +7004,7 @@ __decorate([
7004
7004
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: ActivityActionsComponent, decorators: [{
7005
7005
  type: Component,
7006
7006
  args: [{ selector: 'aup-activity-actions', template: "<div class=\"content\">\n <ng-content></ng-content>\n</div>\n<ng-container *ngIf=\"hasCancelFace()\">\n <aup-command #cancelCommandComponent class=\"cancel\" [command]=\"cancelCommand\" [face]=\"cancelFace\" data-cy=\"cancel-command\"></aup-command>\n</ng-container>\n<ng-container *ngIf=\"hasConfirmFace()\">\n <aup-command #confirmCommandComponent class=\"confirm\" [command]=\"confirmCommand\" [face]=\"confirmFace\" data-cy=\"confirm-command\"></aup-command>\n</ng-container>\n", styles: [":host{display:grid;grid-template-rows:auto;align-items:center;justify-content:end;--resolved-activity-actions-gap: var(--activity-actions-gap, 8px);grid-gap:var(--resolved-activity-actions-gap)}:host[layout=block][align=start]{grid-template-areas:\"cancel confirm content\";grid-template-columns:auto auto 1fr}:host[layout=block][align=start] .confirm{margin-left:var(--resolved-activity-actions-gap)}:host[layout=block][align=end]{grid-template-areas:\"content cancel confirm\";grid-template-columns:1fr auto auto}:host[layout=block][align=end] .confirm{margin-left:var(--resolved-activity-actions-gap)}:host[layout=block][align=stretch]{grid-template-areas:\"cancel content confirm\";grid-template-columns:auto 1fr auto}:host[layout=inline]{grid-template-areas:\"confirm cancel content\";grid-template-columns:auto auto 1fr}:host[layout=inline] .cancel{margin-left:var(--resolved-activity-actions-gap)}:host .cancel{grid-area:cancel}:host .confirm{grid-area:confirm}:host .content{display:flex;flex-direction:row;align-items:center}:host[align-content=start] .content{justify-items:start}:host[align-content=end]{justify-items:end}:host[align-content=center]{justify-items:center}\n"] }]
7007
- }], ctorParameters: function () { return [{ type: ActivityContext, decorators: [{
7008
- type: Optional
7009
- }] }]; }, propDecorators: { confirmCommandComponent: [{
7007
+ }], ctorParameters: function () { return []; }, propDecorators: { confirmCommandComponent: [{
7010
7008
  type: ViewChild,
7011
7009
  args: ["confirmCommandComponent"]
7012
7010
  }], cancelCommandComponent: [{
@@ -7075,11 +7073,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.9", ngImpor
7075
7073
  class InteractionServiceRoutingAdapter {
7076
7074
  activeInteractionContextIds;
7077
7075
  activeModalContext;
7078
- createExclusiveInteractionContext;
7079
- constructor(activeInteractionContextIds, activeModalContext, createExclusiveInteractionContext) {
7076
+ createNavigationSessionInteractionContext;
7077
+ constructor(activeInteractionContextIds, activeModalContext, createNavigationSessionInteractionContext) {
7080
7078
  this.activeInteractionContextIds = activeInteractionContextIds;
7081
7079
  this.activeModalContext = activeModalContext;
7082
- this.createExclusiveInteractionContext = createExclusiveInteractionContext;
7080
+ this.createNavigationSessionInteractionContext = createNavigationSessionInteractionContext;
7083
7081
  }
7084
7082
  isActive() {
7085
7083
  return this.getActiveInteractionContextIds().length > 0;
@@ -7117,7 +7115,7 @@ class InteractionService {
7117
7115
  // private readonly _activeContext: ValueModelChain<InteractionContext>;
7118
7116
  _navigationInProgress = new DelegatingValueModel().withDefault(false);
7119
7117
  placeRouter;
7120
- exclusiveInteractionRegistry;
7118
+ navigationSessionInteractionRegistry;
7121
7119
  modalInteractionRegistry;
7122
7120
  inPlaceInteractionRegistry;
7123
7121
  activeModalContext;
@@ -7126,11 +7124,11 @@ class InteractionService {
7126
7124
  constructor(modelInteractionContextFactory) {
7127
7125
  this.modelInteractionContextFactory = modelInteractionContextFactory;
7128
7126
  const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this.garbage);
7129
- this.exclusiveInteractionRegistry = new InteractionService.ContextRegistry();
7127
+ this.navigationSessionInteractionRegistry = new InteractionService.ContextRegistry();
7130
7128
  this.modalInteractionRegistry = new InteractionService.ContextRegistry();
7131
7129
  this.inPlaceInteractionRegistry = new InteractionService.ContextRegistry();
7132
- this.modalInteractionRegistry.disableWhen(valueOf.any(this.exclusiveInteractionRegistry.active, this.modalInteractionRegistry.active).areTruthy());
7133
- this.inPlaceInteractionRegistry.disableWhen(valueOf.any(this.exclusiveInteractionRegistry.active, this.modalInteractionRegistry.active, this.inPlaceInteractionRegistry.active).areTruthy());
7130
+ this.modalInteractionRegistry.disableWhen(valueOf.any(this.navigationSessionInteractionRegistry.active, this.modalInteractionRegistry.active).areTruthy());
7131
+ this.inPlaceInteractionRegistry.disableWhen(valueOf.any(this.navigationSessionInteractionRegistry.active, this.modalInteractionRegistry.active, this.inPlaceInteractionRegistry.active).areTruthy());
7134
7132
  this.active = valueOf.any(this.inPlaceInteractionRegistry.active, this.modalInteractionRegistry.active).areTruthy();
7135
7133
  // TODO: chain.concat(listOrValueModels) would be nice.
7136
7134
  this.activeInteractionContextIds = chain(this.inPlaceInteractionRegistry.interactionContextIds)
@@ -7141,6 +7139,18 @@ class InteractionService {
7141
7139
  isActive() {
7142
7140
  return this.active.value;
7143
7141
  }
7142
+ cancelAllActivities() {
7143
+ this.modalInteractionRegistry.interactionContexts.value.forEach(async (interaction) => {
7144
+ while (interaction.isActive()) {
7145
+ await interaction.cancelActiveActivity();
7146
+ }
7147
+ });
7148
+ this.inPlaceInteractionRegistry.interactionContexts.value.forEach(async (interaction) => {
7149
+ while (interaction.isActive()) {
7150
+ await interaction.cancelActiveActivity();
7151
+ }
7152
+ });
7153
+ }
7144
7154
  /**
7145
7155
  * @deprecated use #createModalInteractionContextDisposedWith instead.
7146
7156
  * @param disposable
@@ -7175,7 +7185,7 @@ class InteractionService {
7175
7185
  this._navigationInProgress.setDelegate(this.placeRouter.navigationInProgress$);
7176
7186
  // const self = this;
7177
7187
  return new InteractionServiceRoutingAdapter(this.activeInteractionContextIds, this.activeModalContext, () => {
7178
- return this.modelInteractionContextFactory.createInteractionContext("exclusive", new InteractionService.ApiAdapter(this.placeRouter, this.exclusiveInteractionRegistry));
7188
+ return this.modelInteractionContextFactory.createInteractionContext("exclusive", new InteractionService.ApiAdapter(this.placeRouter, this.navigationSessionInteractionRegistry));
7179
7189
  });
7180
7190
  }
7181
7191
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.9", ngImport: i0, type: InteractionService, deps: [{ token: ModalInteractionContextFactory }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -8074,7 +8084,7 @@ class NavigationSession extends GarbageCollector {
8074
8084
  this.startingUrl = startingUrl;
8075
8085
  // console.log(`new ${this.constructor.name}`)
8076
8086
  // TODO: can I get away without creating one every time?
8077
- this._interactionContext = this.context.routerInteractionAdapter.createExclusiveInteractionContext();
8087
+ this._interactionContext = this.context.routerInteractionAdapter.createNavigationSessionInteractionContext();
8078
8088
  this.onDispose(() => {
8079
8089
  // the interaction context can be detached during the back button cancellation state transition
8080
8090
  // as the transition is synchronous and activityCancellation isn't. Otherwise dispose will be
@@ -9935,7 +9945,7 @@ class ActivityContextImpl extends ActivityContext {
9935
9945
  return this.activityContainer;
9936
9946
  }
9937
9947
  getInteractionContext() {
9938
- return this.interactionContext;
9948
+ return this.activityContainer;
9939
9949
  }
9940
9950
  onActivityReady(callback) {
9941
9951
  if (this.activity) {
@@ -9975,12 +9985,12 @@ class ActivityOutletComponent {
9975
9985
  }
9976
9986
  loadActivity(activityRef) {
9977
9987
  this.viewContainerRef.clear();
9978
- const activityContext = new ActivityContextImpl(this.interactionContext);
9988
+ const activityContext = new ActivityContextImpl(this.nestedInteractionContext);
9979
9989
  const injector = Injector.create({
9980
9990
  providers: [
9981
9991
  { provide: ACTIVITY_DATA, useValue: activityRef.activityData },
9982
9992
  { provide: ActivityContext, useValue: activityContext },
9983
- { provide: INTERACTION_CONTEXT, useValue: this.interactionContext },
9993
+ { provide: INTERACTION_CONTEXT, useValue: this.nestedInteractionContext },
9984
9994
  { provide: InteractionContextProvider, useValue: activityContext },
9985
9995
  ],
9986
9996
  parent: this.injector