@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, __awaiter } from 'tslib';
44
44
  import escapeStringRegexp from 'escape-string-regexp';
45
45
  import { isEmpty, isString, isFunction, isNil, isInteger, isObject, isEqual, join, uniq, last as last$1, first, isNumber, isNaN as isNaN$1 } from 'lodash';
@@ -6014,13 +6014,17 @@ class ActivityRef {
6014
6014
  });
6015
6015
  this._activityBusy.setDelegate(this._activity.busy$);
6016
6016
  }
6017
- // @Trace()
6018
6017
  finishActivity(resolveOrReject) {
6019
- assert.isFalsey(this.isComplete());
6020
- resolveOrReject(this.deferredResult);
6021
- this._complete = true;
6022
- this.onComplete(this);
6023
- this._activityBusy.dispose();
6018
+ if (!this.isComplete()) {
6019
+ assert.isFalsey(this.isComplete());
6020
+ resolveOrReject(this.deferredResult);
6021
+ this._complete = true;
6022
+ this.onComplete(this);
6023
+ this._activityBusy.dispose();
6024
+ }
6025
+ else {
6026
+ console.warn("finishActivity called when activity has already been finished");
6027
+ }
6024
6028
  }
6025
6029
  cancel() {
6026
6030
  this.activity.cancel();
@@ -6713,9 +6717,9 @@ class Visit {
6713
6717
  return this;
6714
6718
  }
6715
6719
  get segments() {
6716
- return this.resolveSegments(this.definedSegments);
6720
+ return this.resolveSegments([this.definedSegments]);
6717
6721
  }
6718
- resolveSegments(...defaults) {
6722
+ resolveSegments(defaults) {
6719
6723
  return this.destinationPlaceDef.ancestorsAndSelf()
6720
6724
  .map(a => {
6721
6725
  const visit = new VisitSegment(a, {});
@@ -6726,8 +6730,11 @@ class Visit {
6726
6730
  });
6727
6731
  }
6728
6732
  copyWithDefaultsFrom(other) {
6729
- const segments = this.resolveSegments(this.definedSegments, other.definedSegments);
6730
- return new Visit(segments);
6733
+ const defaults = [this.definedSegments];
6734
+ if (other) {
6735
+ defaults.push(other.definedSegments);
6736
+ }
6737
+ return new Visit(this.resolveSegments(defaults));
6731
6738
  }
6732
6739
  copyAndReplaceSegment(replace) {
6733
6740
  // console.log("copyAndReplaceSegment", replace.toDebugString());
@@ -8243,6 +8250,7 @@ class PlaceRouter extends GarbageCollector {
8243
8250
  });
8244
8251
  });
8245
8252
  }
8253
+ // @Trace()
8246
8254
  onPopState(event) {
8247
8255
  assert.isTruthy(event.navigationTrigger === "popstate");
8248
8256
  if (this.currentSession) {
@@ -8433,18 +8441,12 @@ class PlaceRouter extends GarbageCollector {
8433
8441
  }
8434
8442
  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 });
8435
8443
  PlaceRouter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlaceRouter, providedIn: "root" });
8436
- __decorate([
8437
- Trace(),
8438
- __metadata("design:type", Function),
8439
- __metadata("design:paramtypes", [NavigationStart]),
8440
- __metadata("design:returntype", void 0)
8441
- ], PlaceRouter.prototype, "onPopState", null);
8442
8444
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PlaceRouter, decorators: [{
8443
8445
  type: Injectable,
8444
8446
  args: [{
8445
8447
  providedIn: "root"
8446
8448
  }]
8447
- }], ctorParameters: function () { return [{ type: i1$4.Router }, { type: i1$1.Location }, { type: InteractionService }, { type: UrlService }, { type: PlaceHistory }]; }, propDecorators: { onPopState: [] } });
8449
+ }], ctorParameters: function () { return [{ type: i1$4.Router }, { type: i1$1.Location }, { type: InteractionService }, { type: UrlService }, { type: PlaceHistory }]; } });
8448
8450
 
8449
8451
  class ActivityContainerComponent extends AbstractInteractionContext {
8450
8452
  constructor(placeRouter) {
@@ -9051,7 +9053,8 @@ class PopupInteractionContextComponent extends DisposableComponent {
9051
9053
  // console.log({ element: this._element });
9052
9054
  const self = this;
9053
9055
  const overlayRef = this._overlay.create({
9054
- hasBackdrop: false,
9056
+ hasBackdrop: true,
9057
+ backdropClass: "popup-interaction-context-backdrop",
9055
9058
  disposeOnNavigation: true,
9056
9059
  panelClass: 'aup-popup-interaction-panel',
9057
9060
  positionStrategy: this._overlay.position()
@@ -9061,9 +9064,18 @@ class PopupInteractionContextComponent extends DisposableComponent {
9061
9064
  .withGrowAfterOpen(true)
9062
9065
  .withScrollableContainers(self.scrollContainers) // this isn't working. sigh.
9063
9066
  });
9067
+ const cancelEverything = () => __awaiter(this, void 0, void 0, function* () {
9068
+ do {
9069
+ } while (yield this.interactionContext.cancelActiveActivity());
9070
+ });
9064
9071
  const subs = this.scrollContainers.map(sc => sc.elementScrolled().subscribe(() => {
9065
9072
  overlayRef.updatePosition();
9066
- }));
9073
+ })).concat(overlayRef.backdropClick().subscribe(cancelEverything))
9074
+ .concat(overlayRef.keydownEvents().subscribe((event) => __awaiter(this, void 0, void 0, function* () {
9075
+ if (this.cancelOnEscape$.value && event.code === "Escape" && this.interactionContext.isActive()) {
9076
+ yield this.interactionContext.cancelActiveActivity();
9077
+ }
9078
+ })));
9067
9079
  const componentRef = overlayRef.attach(this.outputPortal);
9068
9080
  this.interactionContext = componentRef.instance;
9069
9081
  return new Promise((resolve, reject) => {
@@ -9104,10 +9116,18 @@ class PopupInteractionContextComponent extends DisposableComponent {
9104
9116
  }
9105
9117
  }
9106
9118
  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 });
9107
- 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"] });
9119
+ 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"] });
9120
+ __decorate([
9121
+ TrackExternal({ defaultValue: true }),
9122
+ __metadata("design:type", ValueModel)
9123
+ ], PopupInteractionContextComponent.prototype, "cancelOnEscape$", void 0);
9124
+ __decorate([
9125
+ StoreInValueModel("cancelOnEscape$"),
9126
+ __metadata("design:type", Boolean)
9127
+ ], PopupInteractionContextComponent.prototype, "cancelOnEscape", void 0);
9108
9128
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PopupInteractionContextComponent, decorators: [{
9109
9129
  type: Component,
9110
- 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"] }]
9130
+ 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"] }]
9111
9131
  }], ctorParameters: function () {
9112
9132
  return [{ type: i0.ElementRef }, { type: i1$5.Overlay }, { type: i1$5.CdkScrollable, decorators: [{
9113
9133
  type: Optional
@@ -9121,6 +9141,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImpor
9121
9141
  type: Input
9122
9142
  }], anchorY: [{
9123
9143
  type: Input
9144
+ }], cancelOnEscape$: [{
9145
+ type: Input
9146
+ }], cancelOnEscape: [{
9147
+ type: Input
9124
9148
  }] } });
9125
9149
 
9126
9150
  class InteractionContextTriggerFor extends GarbageCollector {
@@ -9385,7 +9409,7 @@ class PopupActivityTriggerComponent extends AbstractActivityTriggerComponent {
9385
9409
  }
9386
9410
  }
9387
9411
  PopupActivityTriggerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PopupActivityTriggerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
9388
- 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"] }] });
9412
+ 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"] }] });
9389
9413
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.2", ngImport: i0, type: PopupActivityTriggerComponent, decorators: [{
9390
9414
  type: Component,
9391
9415
  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"] }]