@coolon/angular-ui-powerups 14.29.2 → 14.29.3

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.
@@ -39,7 +39,7 @@ import { MatTableModule } from '@angular/material/table';
39
39
  import * as i4 from '@angular/material/tooltip';
40
40
  import { MatTooltipModule } from '@angular/material/tooltip';
41
41
  import * as i1$3 from '@coolon/pectin';
42
- import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, Functions, HasDelegate, MultipleSelectionModel, SelectionModel, AbstractComputedListModel, DirtyTrackingForm, DelegatingSelectionModel, PageController, PagedListModel, ComputedListModel, Deferred, Trace } from '@coolon/pectin';
42
+ import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, Functions, HasDelegate, MultipleSelectionModel, SelectionModel, AbstractComputedListModel, DirtyTrackingForm, DelegatingSelectionModel, PageController, PagedListModel, ComputedListModel, Deferred } from '@coolon/pectin';
43
43
  import { __decorate, __param, __metadata } from 'tslib';
44
44
  import * as i1 from '@angular/platform-browser';
45
45
  import escapeStringRegexp from 'escape-string-regexp';
@@ -7871,6 +7871,7 @@ class PlaceRouter extends GarbageCollector {
7871
7871
  });
7872
7872
  });
7873
7873
  }
7874
+ // @Trace()
7874
7875
  onPopState(event) {
7875
7876
  assert.isTruthy(event.navigationTrigger === "popstate");
7876
7877
  if (this.currentSession) {
@@ -8055,18 +8056,12 @@ class PlaceRouter extends GarbageCollector {
8055
8056
  }
8056
8057
  PlaceRouter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlaceRouter, deps: [{ token: i1$4.Router }, { token: i1$1.Location }, { token: InteractionService }, { token: UrlService }, { token: PlaceHistory }], target: i0.ɵɵFactoryTarget.Injectable });
8057
8058
  PlaceRouter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlaceRouter, providedIn: "root" });
8058
- __decorate([
8059
- Trace(),
8060
- __metadata("design:type", Function),
8061
- __metadata("design:paramtypes", [NavigationStart]),
8062
- __metadata("design:returntype", void 0)
8063
- ], PlaceRouter.prototype, "onPopState", null);
8064
8059
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlaceRouter, decorators: [{
8065
8060
  type: Injectable,
8066
8061
  args: [{
8067
8062
  providedIn: "root"
8068
8063
  }]
8069
- }], ctorParameters: function () { return [{ type: i1$4.Router }, { type: i1$1.Location }, { type: InteractionService }, { type: UrlService }, { type: PlaceHistory }]; }, propDecorators: { onPopState: [] } });
8064
+ }], ctorParameters: function () { return [{ type: i1$4.Router }, { type: i1$1.Location }, { type: InteractionService }, { type: UrlService }, { type: PlaceHistory }]; } });
8070
8065
 
8071
8066
  class ActivityTitleComponent extends DisposableComponent {
8072
8067
  /**
@@ -8285,13 +8280,17 @@ class ActivityRef {
8285
8280
  });
8286
8281
  this._activityBusy.setDelegate(this._activity.busy$);
8287
8282
  }
8288
- // @Trace()
8289
8283
  finishActivity(resolveOrReject) {
8290
- assert.isFalsey(this.isComplete());
8291
- resolveOrReject(this.deferredResult);
8292
- this._complete = true;
8293
- this.onComplete(this);
8294
- this._activityBusy.dispose();
8284
+ if (!this.isComplete()) {
8285
+ assert.isFalsey(this.isComplete());
8286
+ resolveOrReject(this.deferredResult);
8287
+ this._complete = true;
8288
+ this.onComplete(this);
8289
+ this._activityBusy.dispose();
8290
+ }
8291
+ else {
8292
+ console.warn("finishActivity called when activity has already been finished");
8293
+ }
8295
8294
  }
8296
8295
  cancel() {
8297
8296
  this.activity.cancel();
@@ -8949,7 +8948,8 @@ class PopupInteractionContextComponent extends DisposableComponent {
8949
8948
  // console.log({ element: this._element });
8950
8949
  const self = this;
8951
8950
  const overlayRef = this._overlay.create({
8952
- hasBackdrop: false,
8951
+ hasBackdrop: true,
8952
+ backdropClass: "popup-interaction-context-backdrop",
8953
8953
  disposeOnNavigation: true,
8954
8954
  panelClass: 'aup-popup-interaction-panel',
8955
8955
  positionStrategy: this._overlay.position()
@@ -8959,8 +8959,17 @@ class PopupInteractionContextComponent extends DisposableComponent {
8959
8959
  .withGrowAfterOpen(true)
8960
8960
  .withScrollableContainers(self.scrollContainers) // this isn't working. sigh.
8961
8961
  });
8962
+ const cancelEverything = async () => {
8963
+ do {
8964
+ } while (await this.interactionContext.cancelActiveActivity());
8965
+ };
8962
8966
  const subs = this.scrollContainers.map(sc => sc.elementScrolled().subscribe(() => {
8963
8967
  overlayRef.updatePosition();
8968
+ })).concat(overlayRef.backdropClick().subscribe(cancelEverything))
8969
+ .concat(overlayRef.keydownEvents().subscribe(async (event) => {
8970
+ if (this.cancelOnEscape$.value && event.code === "Escape" && this.interactionContext.isActive()) {
8971
+ await this.interactionContext.cancelActiveActivity();
8972
+ }
8964
8973
  }));
8965
8974
  const componentRef = overlayRef.attach(this.outputPortal);
8966
8975
  this.interactionContext = componentRef.instance;
@@ -9002,10 +9011,18 @@ class PopupInteractionContextComponent extends DisposableComponent {
9002
9011
  }
9003
9012
  }
9004
9013
  PopupInteractionContextComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PopupInteractionContextComponent, deps: [{ token: i0.ElementRef }, { token: i1$5.Overlay }, { token: i1$5.CdkScrollable, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component });
9005
- PopupInteractionContextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: PopupInteractionContextComponent, selector: "aup-popup-interaction-context", inputs: { anchorX: "anchorX", anchorY: "anchorY" }, host: { properties: { "class.interaction-active": "this.active" } }, usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{display:inline-block}:host.interaction-active{background:rgba(0,0,0,.05)}\n"] });
9014
+ PopupInteractionContextComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: PopupInteractionContextComponent, selector: "aup-popup-interaction-context", inputs: { anchorX: "anchorX", anchorY: "anchorY", cancelOnEscape$: "cancelOnEscape$", cancelOnEscape: "cancelOnEscape" }, host: { properties: { "class.interaction-active": "this.active" } }, usesInheritance: true, ngImport: i0, template: "<ng-content></ng-content>\n", styles: [":host{display:inline-block}:host.interaction-active{background:rgba(0,0,0,.05)}:host::ng-deep .popup-interaction-context-backdrop{background-color:#0000}\n"] });
9015
+ __decorate([
9016
+ TrackExternal({ defaultValue: true }),
9017
+ __metadata("design:type", ValueModel)
9018
+ ], PopupInteractionContextComponent.prototype, "cancelOnEscape$", void 0);
9019
+ __decorate([
9020
+ StoreInValueModel("cancelOnEscape$"),
9021
+ __metadata("design:type", Boolean)
9022
+ ], PopupInteractionContextComponent.prototype, "cancelOnEscape", void 0);
9006
9023
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PopupInteractionContextComponent, decorators: [{
9007
9024
  type: Component,
9008
- args: [{ selector: 'aup-popup-interaction-context', template: "<ng-content></ng-content>\n", styles: [":host{display:inline-block}:host.interaction-active{background:rgba(0,0,0,.05)}\n"] }]
9025
+ args: [{ selector: 'aup-popup-interaction-context', template: "<ng-content></ng-content>\n", styles: [":host{display:inline-block}:host.interaction-active{background:rgba(0,0,0,.05)}:host::ng-deep .popup-interaction-context-backdrop{background-color:#0000}\n"] }]
9009
9026
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$5.Overlay }, { type: i1$5.CdkScrollable, decorators: [{
9010
9027
  type: Optional
9011
9028
  }, {
@@ -9017,6 +9034,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
9017
9034
  type: Input
9018
9035
  }], anchorY: [{
9019
9036
  type: Input
9037
+ }], cancelOnEscape$: [{
9038
+ type: Input
9039
+ }], cancelOnEscape: [{
9040
+ type: Input
9020
9041
  }] } });
9021
9042
 
9022
9043
  class InteractionContextTriggerFor extends GarbageCollector {
@@ -9276,7 +9297,7 @@ class PopupActivityTriggerComponent extends AbstractActivityTriggerComponent {
9276
9297
  }
9277
9298
  }
9278
9299
  PopupActivityTriggerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PopupActivityTriggerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
9279
- PopupActivityTriggerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: PopupActivityTriggerComponent, selector: "aup-popup-activity-trigger", inputs: { anchorX: "anchorX", anchorY: "anchorY" }, viewQueries: [{ propertyName: "_interactionContext", first: true, predicate: PopupInteractionContextComponent, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<aup-popup-interaction-context [anchorX]=\"anchorX\" [anchorY]=\"anchorY\">\n <aup-command [command]=\"startActivityCommand\" [faceModel]=\"faceModel\" [alignFace]=\"alignFace\"></aup-command>\n</aup-popup-interaction-context>\n", styles: [":host{display:inline-block}\n"], dependencies: [{ kind: "component", type: CommandComponent, selector: "aup-command", inputs: ["command", "faceModel", "face", "busyFaceModel", "busyFace", "alignFace"] }, { kind: "component", type: PopupInteractionContextComponent, selector: "aup-popup-interaction-context", inputs: ["anchorX", "anchorY"] }] });
9300
+ PopupActivityTriggerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.2", type: PopupActivityTriggerComponent, selector: "aup-popup-activity-trigger", inputs: { anchorX: "anchorX", anchorY: "anchorY" }, viewQueries: [{ propertyName: "_interactionContext", first: true, predicate: PopupInteractionContextComponent, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<aup-popup-interaction-context [anchorX]=\"anchorX\" [anchorY]=\"anchorY\">\n <aup-command [command]=\"startActivityCommand\" [faceModel]=\"faceModel\" [alignFace]=\"alignFace\"></aup-command>\n</aup-popup-interaction-context>\n", styles: [":host{display:inline-block}\n"], dependencies: [{ kind: "component", type: CommandComponent, selector: "aup-command", inputs: ["command", "faceModel", "face", "busyFaceModel", "busyFace", "alignFace"] }, { kind: "component", type: PopupInteractionContextComponent, selector: "aup-popup-interaction-context", inputs: ["anchorX", "anchorY", "cancelOnEscape$", "cancelOnEscape"] }] });
9280
9301
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PopupActivityTriggerComponent, decorators: [{
9281
9302
  type: Component,
9282
9303
  args: [{ selector: 'aup-popup-activity-trigger', template: "<aup-popup-interaction-context [anchorX]=\"anchorX\" [anchorY]=\"anchorY\">\n <aup-command [command]=\"startActivityCommand\" [faceModel]=\"faceModel\" [alignFace]=\"alignFace\"></aup-command>\n</aup-popup-interaction-context>\n", styles: [":host{display:inline-block}\n"] }]