@coolon/angular-ui-powerups 14.29.1 → 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';
@@ -6527,9 +6527,9 @@ class Visit {
6527
6527
  return this;
6528
6528
  }
6529
6529
  get segments() {
6530
- return this.resolveSegments(this.definedSegments);
6530
+ return this.resolveSegments([this.definedSegments]);
6531
6531
  }
6532
- resolveSegments(...defaults) {
6532
+ resolveSegments(defaults) {
6533
6533
  return this.destinationPlaceDef.ancestorsAndSelf()
6534
6534
  .map(a => {
6535
6535
  const visit = new VisitSegment(a, {});
@@ -6540,8 +6540,11 @@ class Visit {
6540
6540
  });
6541
6541
  }
6542
6542
  copyWithDefaultsFrom(other) {
6543
- const segments = this.resolveSegments(this.definedSegments, other.definedSegments);
6544
- return new Visit(segments);
6543
+ const defaults = [this.definedSegments];
6544
+ if (other) {
6545
+ defaults.push(other.definedSegments);
6546
+ }
6547
+ return new Visit(this.resolveSegments(defaults));
6545
6548
  }
6546
6549
  copyAndReplaceSegment(replace) {
6547
6550
  // console.log("copyAndReplaceSegment", replace.toDebugString());
@@ -7868,6 +7871,7 @@ class PlaceRouter extends GarbageCollector {
7868
7871
  });
7869
7872
  });
7870
7873
  }
7874
+ // @Trace()
7871
7875
  onPopState(event) {
7872
7876
  assert.isTruthy(event.navigationTrigger === "popstate");
7873
7877
  if (this.currentSession) {
@@ -8052,18 +8056,12 @@ class PlaceRouter extends GarbageCollector {
8052
8056
  }
8053
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 });
8054
8058
  PlaceRouter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlaceRouter, providedIn: "root" });
8055
- __decorate([
8056
- Trace(),
8057
- __metadata("design:type", Function),
8058
- __metadata("design:paramtypes", [NavigationStart]),
8059
- __metadata("design:returntype", void 0)
8060
- ], PlaceRouter.prototype, "onPopState", null);
8061
8059
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlaceRouter, decorators: [{
8062
8060
  type: Injectable,
8063
8061
  args: [{
8064
8062
  providedIn: "root"
8065
8063
  }]
8066
- }], 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 }]; } });
8067
8065
 
8068
8066
  class ActivityTitleComponent extends DisposableComponent {
8069
8067
  /**
@@ -8282,13 +8280,17 @@ class ActivityRef {
8282
8280
  });
8283
8281
  this._activityBusy.setDelegate(this._activity.busy$);
8284
8282
  }
8285
- // @Trace()
8286
8283
  finishActivity(resolveOrReject) {
8287
- assert.isFalsey(this.isComplete());
8288
- resolveOrReject(this.deferredResult);
8289
- this._complete = true;
8290
- this.onComplete(this);
8291
- 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
+ }
8292
8294
  }
8293
8295
  cancel() {
8294
8296
  this.activity.cancel();
@@ -8946,7 +8948,8 @@ class PopupInteractionContextComponent extends DisposableComponent {
8946
8948
  // console.log({ element: this._element });
8947
8949
  const self = this;
8948
8950
  const overlayRef = this._overlay.create({
8949
- hasBackdrop: false,
8951
+ hasBackdrop: true,
8952
+ backdropClass: "popup-interaction-context-backdrop",
8950
8953
  disposeOnNavigation: true,
8951
8954
  panelClass: 'aup-popup-interaction-panel',
8952
8955
  positionStrategy: this._overlay.position()
@@ -8956,8 +8959,17 @@ class PopupInteractionContextComponent extends DisposableComponent {
8956
8959
  .withGrowAfterOpen(true)
8957
8960
  .withScrollableContainers(self.scrollContainers) // this isn't working. sigh.
8958
8961
  });
8962
+ const cancelEverything = async () => {
8963
+ do {
8964
+ } while (await this.interactionContext.cancelActiveActivity());
8965
+ };
8959
8966
  const subs = this.scrollContainers.map(sc => sc.elementScrolled().subscribe(() => {
8960
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
+ }
8961
8973
  }));
8962
8974
  const componentRef = overlayRef.attach(this.outputPortal);
8963
8975
  this.interactionContext = componentRef.instance;
@@ -8999,10 +9011,18 @@ class PopupInteractionContextComponent extends DisposableComponent {
8999
9011
  }
9000
9012
  }
9001
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 });
9002
- 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);
9003
9023
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PopupInteractionContextComponent, decorators: [{
9004
9024
  type: Component,
9005
- 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"] }]
9006
9026
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i1$5.Overlay }, { type: i1$5.CdkScrollable, decorators: [{
9007
9027
  type: Optional
9008
9028
  }, {
@@ -9014,6 +9034,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
9014
9034
  type: Input
9015
9035
  }], anchorY: [{
9016
9036
  type: Input
9037
+ }], cancelOnEscape$: [{
9038
+ type: Input
9039
+ }], cancelOnEscape: [{
9040
+ type: Input
9017
9041
  }] } });
9018
9042
 
9019
9043
  class InteractionContextTriggerFor extends GarbageCollector {
@@ -9273,7 +9297,7 @@ class PopupActivityTriggerComponent extends AbstractActivityTriggerComponent {
9273
9297
  }
9274
9298
  }
9275
9299
  PopupActivityTriggerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PopupActivityTriggerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
9276
- 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"] }] });
9277
9301
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PopupActivityTriggerComponent, decorators: [{
9278
9302
  type: Component,
9279
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"] }]