@coolon/angular-ui-powerups 0.0.74 → 0.0.75

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.
Files changed (39) hide show
  1. package/bundles/coolon-angular-ui-powerups.umd.js +283 -73
  2. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  3. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  5. package/coolon-angular-ui-powerups.d.ts +2 -1
  6. package/coolon-angular-ui-powerups.metadata.json +1 -1
  7. package/esm2015/coolon-angular-ui-powerups.js +4 -3
  8. package/esm2015/index.js +2 -2
  9. package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +71 -48
  10. package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +128 -0
  11. package/esm2015/lib/interaction/index.js +2 -1
  12. package/esm2015/lib/interaction/interaction.module.js +6 -3
  13. package/esm2015/lib/interaction/services/dialog-interaction.service.js +10 -9
  14. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +15 -10
  15. package/esm2015/lib/place/place-component.js +3 -1
  16. package/esm2015/lib/place/route/guards/leave-place.guard.js +4 -4
  17. package/esm2015/public_api.js +2 -2
  18. package/esm5/coolon-angular-ui-powerups.js +4 -3
  19. package/esm5/index.js +2 -2
  20. package/esm5/lib/interaction/components/activity-container/activity-container.component.js +79 -49
  21. package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +171 -0
  22. package/esm5/lib/interaction/index.js +2 -1
  23. package/esm5/lib/interaction/interaction.module.js +6 -3
  24. package/esm5/lib/interaction/services/dialog-interaction.service.js +10 -9
  25. package/esm5/lib/place/components/place-outlet/place-outlet.component.js +19 -11
  26. package/esm5/lib/place/place-component.js +3 -1
  27. package/esm5/lib/place/route/guards/leave-place.guard.js +4 -4
  28. package/esm5/public_api.js +2 -2
  29. package/fesm2015/coolon-angular-ui-powerups.js +224 -68
  30. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  31. package/fesm5/coolon-angular-ui-powerups.js +277 -70
  32. package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
  33. package/lib/interaction/components/activity-container/activity-container.component.d.ts +9 -6
  34. package/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.d.ts +21 -0
  35. package/lib/interaction/index.d.ts +1 -0
  36. package/lib/place/components/place-outlet/place-outlet.component.d.ts +1 -0
  37. package/lib/place/place-component.d.ts +2 -0
  38. package/package.json +1 -1
  39. package/styles/styles.scss +6 -1
@@ -7,11 +7,10 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
7
7
  import { __extends, __decorate, __metadata, __assign, __awaiter, __generator, __spread } from 'tslib';
8
8
  import { assert, UnaryCommand, lang, Dsl, GarbageCollector, Logger, DelegatingFormValueModel, UseDelegate, ValueModel, ListModel, StoreInListModel, DelegatingValueModel, MutableStream, MutableListModel, DelegatingListModel, StoreInValueModel, Binding, MutableValueModel, Trace, Guard as Guard$1, Command, OptionsHelper, ValueHolder } from '@coolon/pectin';
9
9
  import { PortalModule } from '@angular/cdk/portal';
10
- import { Router, RouterModule, UrlSegment, NavigationStart, NavigationEnd, NavigationError, RouterOutlet, ActivatedRouteSnapshot, RouterStateSnapshot, UrlSerializer } from '@angular/router';
10
+ import { Router, RouterModule, UrlSegment, NavigationStart, NavigationEnd, NavigationError, ActivatedRouteSnapshot, RouterStateSnapshot, UrlSerializer } from '@angular/router';
11
11
  import ___default, { last, isNil, isEqual } from 'lodash';
12
12
  import { assert as assert$1, Opts, Klass } from '@coolon/typescript-utilities';
13
13
  import { MatDialogConfig, MAT_DIALOG_DEFAULT_OPTIONS, MatDialog as MatDialog$1 } from '@angular/material/dialog';
14
- import { v1 } from 'uuid';
15
14
  import { MatIconModule } from '@angular/material/icon';
16
15
  import { MatListModule } from '@angular/material/list';
17
16
  import { MatTooltipModule } from '@angular/material/tooltip';
@@ -1551,15 +1550,17 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
1551
1550
  __extends(ActivityContainerComponent, _super);
1552
1551
  function ActivityContainerComponent() {
1553
1552
  var _this = _super.call(this) || this;
1554
- _this.activityFinishedEvents = new MutableStream();
1553
+ _this.throttledNestedActivityFinishEvents = new MutableStream();
1554
+ // tslint:disable-next-line:no-output-rename
1555
+ _this.initialActivityOutletContextEvent = new EventEmitter();
1556
+ _this.dynamicHeight = false;
1555
1557
  _this.activityTabs = new MutableListModel();
1556
- _this.finished = false;
1557
1558
  _this._activityList = new MutableListModel();
1558
1559
  var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
1559
- chain(_this.activityFinishedEvents).throttle(50).subscribe((/**
1560
+ chain(_this.throttledNestedActivityFinishEvents).throttle(50).subscribe((/**
1560
1561
  * @return {?}
1561
1562
  */
1562
- function () { return _this.onActivityFinished(); }));
1563
+ function () { return _this.onNestedActivityFinished(); }));
1563
1564
  return _this;
1564
1565
  }
1565
1566
  Object.defineProperty(ActivityContainerComponent.prototype, "initialActivityOutletContext", {
@@ -1567,33 +1568,37 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
1567
1568
  * @return {?}
1568
1569
  */
1569
1570
  function () {
1570
- return this.activityTabs.length > 0 ? this.activityTabs.value[0] : null;
1571
+ return this._initialActivityOutletContext;
1571
1572
  },
1572
1573
  set: /**
1573
1574
  * @param {?} initialContext
1574
1575
  * @return {?}
1575
1576
  */
1576
1577
  function (initialContext) {
1577
- var _this = this;
1578
- assert.isNil(this.initialActivityOutletContext);
1579
- this.activityTabs.push(new TabContext(initialContext.activityData, initialContext.activityClass, this, {
1580
- onDone: (/**
1581
- * @param {?} result
1582
- * @return {?}
1583
- */
1584
- function (result) {
1585
- _this.finished = true;
1586
- return initialContext.onDone(result);
1587
- }),
1588
- onCancel: (/**
1589
- * @param {?} error
1590
- * @return {?}
1591
- */
1592
- function (error) {
1593
- _this.finished = true;
1594
- return initialContext.onCancel(error);
1595
- })
1596
- }));
1578
+ assert.isNil(this._initialActivityOutletContext);
1579
+ /** @type {?} */
1580
+ var self = this;
1581
+ if (initialContext) {
1582
+ this._initialActivityOutletContext = initialContext;
1583
+ this.activityTabs.push(new TabContext(initialContext.activityData, initialContext.activityClass, this, {
1584
+ onDone: (/**
1585
+ * @param {?} result
1586
+ * @return {?}
1587
+ */
1588
+ function (result) {
1589
+ self.finishInitialActivity();
1590
+ initialContext.onDone(result);
1591
+ }),
1592
+ onCancel: (/**
1593
+ * @param {?} error
1594
+ * @return {?}
1595
+ */
1596
+ function (error) {
1597
+ self.finishInitialActivity();
1598
+ initialContext.onCancel(error);
1599
+ })
1600
+ }));
1601
+ }
1597
1602
  },
1598
1603
  enumerable: true,
1599
1604
  configurable: true
@@ -1605,7 +1610,7 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
1605
1610
  * @return {?}
1606
1611
  */
1607
1612
  function () {
1608
- return this.parentInteractionContext.isActive();
1613
+ return this._activityList.length > 0;
1609
1614
  };
1610
1615
  Object.defineProperty(ActivityContainerComponent.prototype, "activityList", {
1611
1616
  get: /**
@@ -1617,6 +1622,16 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
1617
1622
  enumerable: true,
1618
1623
  configurable: true
1619
1624
  });
1625
+ Object.defineProperty(ActivityContainerComponent.prototype, "isFinished", {
1626
+ get: /**
1627
+ * @return {?}
1628
+ */
1629
+ function () {
1630
+ return !this._initialActivityOutletContext;
1631
+ },
1632
+ enumerable: true,
1633
+ configurable: true
1634
+ });
1620
1635
  /**
1621
1636
  * @return {?}
1622
1637
  */
@@ -1677,7 +1692,7 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
1677
1692
  */
1678
1693
  function (result) {
1679
1694
  resolve(result);
1680
- self.activityFinishedEvents.publish({});
1695
+ self.throttledNestedActivityFinishEvents.publish({});
1681
1696
  }),
1682
1697
  onCancel: (/**
1683
1698
  * @param {?} error
@@ -1685,7 +1700,7 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
1685
1700
  */
1686
1701
  function (error) {
1687
1702
  reject(error);
1688
- self.activityFinishedEvents.publish({});
1703
+ self.throttledNestedActivityFinishEvents.publish({});
1689
1704
  })
1690
1705
  });
1691
1706
  self.activityTabs.push(context);
@@ -1735,13 +1750,27 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
1735
1750
  data: data
1736
1751
  });
1737
1752
  };
1753
+ /**
1754
+ * @private
1755
+ * @return {?}
1756
+ */
1757
+ ActivityContainerComponent.prototype.finishInitialActivity = /**
1758
+ * @private
1759
+ * @return {?}
1760
+ */
1761
+ function () {
1762
+ this._initialActivityOutletContext = null;
1763
+ this.activityTabs.value = [];
1764
+ this._activityList.value = [];
1765
+ this.initialActivityOutletContextEvent.emit(null);
1766
+ };
1738
1767
  // @Trace()
1739
1768
  // @Trace()
1740
1769
  /**
1741
1770
  * @private
1742
1771
  * @return {?}
1743
1772
  */
1744
- ActivityContainerComponent.prototype.onActivityFinished =
1773
+ ActivityContainerComponent.prototype.onNestedActivityFinished =
1745
1774
  // @Trace()
1746
1775
  /**
1747
1776
  * @private
@@ -1749,12 +1778,10 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
1749
1778
  */
1750
1779
  function () {
1751
1780
  // don't do anything if job already queued up.
1752
- if (!this.finished) {
1753
- if (this.synchroniseSelectedTabIndex()) {
1754
- this.cleanupStaleActivities();
1755
- }
1756
- this.updateActivityList();
1781
+ if (this.synchroniseSelectedTabIndex()) {
1782
+ this.cleanupStaleNestedActivities();
1757
1783
  }
1784
+ this.updateActivityList();
1758
1785
  };
1759
1786
  // @Trace()
1760
1787
  // @Trace()
@@ -1762,7 +1789,7 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
1762
1789
  * @private
1763
1790
  * @return {?}
1764
1791
  */
1765
- ActivityContainerComponent.prototype.cleanupStaleActivities =
1792
+ ActivityContainerComponent.prototype.cleanupStaleNestedActivities =
1766
1793
  // @Trace()
1767
1794
  /**
1768
1795
  * @private
@@ -1770,7 +1797,6 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
1770
1797
  */
1771
1798
  function () {
1772
1799
  var _this = this;
1773
- // clean up old tabs
1774
1800
  if (this.tabs.selectedIndex < this.activityTabs.length - 1) {
1775
1801
  this.activityTabs.runInTransaction((/**
1776
1802
  * @param {?} draft
@@ -1823,7 +1849,7 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
1823
1849
  */
1824
1850
  function () {
1825
1851
  this.getSelectedOutlet().component.onActivityReady();
1826
- this.cleanupStaleActivities();
1852
+ this.cleanupStaleNestedActivities();
1827
1853
  this.updateActivityList();
1828
1854
  };
1829
1855
  /**
@@ -1859,15 +1885,16 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
1859
1885
  ActivityContainerComponent.decorators = [
1860
1886
  { type: Component, args: [{
1861
1887
  selector: 'aup-activity-container',
1862
- template: "<mat-tab-group #tabs no-tab-header [dynamicHeight]=\"true\">\n <mat-tab *ngFor=\"let tab of activityTabs.value\">\n <aup-activity-outlet [interactionContext]=\"this\"\n [activityContext]=\"tab\"></aup-activity-outlet>\n </mat-tab>\n</mat-tab-group>\n",
1863
- styles: [":host{display:block}"]
1888
+ template: "<mat-tab-group #tabs no-tab-header [dynamicHeight]=\"dynamicHeight\" [class.full-height-tabs]=\"!dynamicHeight\">\n <mat-tab *ngFor=\"let tab of activityTabs.value\">\n <aup-activity-outlet [interactionContext]=\"this\" [activityContext]=\"tab\"></aup-activity-outlet>\n </mat-tab>\n</mat-tab-group>\n",
1889
+ styles: [":host{display:flex;flex-direction:column}mat-tab-group{flex:1}"]
1864
1890
  }] }
1865
1891
  ];
1866
1892
  /** @nocollapse */
1867
1893
  ActivityContainerComponent.ctorParameters = function () { return []; };
1868
1894
  ActivityContainerComponent.propDecorators = {
1869
- parentInteractionContext: [{ type: Input }],
1870
1895
  initialActivityOutletContext: [{ type: Input }],
1896
+ initialActivityOutletContextEvent: [{ type: Output, args: ['initialActivityOutletContext',] }],
1897
+ dynamicHeight: [{ type: Input }],
1871
1898
  tabs: [{ type: ViewChild, args: ['tabs', { static: true },] }],
1872
1899
  outlets: [{ type: ViewChildren, args: [ActivityOutletComponent,] }]
1873
1900
  };
@@ -1878,9 +1905,16 @@ if (false) {
1878
1905
  * @type {?}
1879
1906
  * @private
1880
1907
  */
1881
- ActivityContainerComponent.prototype.activityFinishedEvents;
1908
+ ActivityContainerComponent.prototype.throttledNestedActivityFinishEvents;
1909
+ /**
1910
+ * @type {?}
1911
+ * @private
1912
+ */
1913
+ ActivityContainerComponent.prototype._initialActivityOutletContext;
1914
+ /** @type {?} */
1915
+ ActivityContainerComponent.prototype.initialActivityOutletContextEvent;
1882
1916
  /** @type {?} */
1883
- ActivityContainerComponent.prototype.parentInteractionContext;
1917
+ ActivityContainerComponent.prototype.dynamicHeight;
1884
1918
  /** @type {?} */
1885
1919
  ActivityContainerComponent.prototype.tabs;
1886
1920
  /** @type {?} */
@@ -1891,12 +1925,170 @@ if (false) {
1891
1925
  * @type {?}
1892
1926
  * @private
1893
1927
  */
1894
- ActivityContainerComponent.prototype.finished;
1928
+ ActivityContainerComponent.prototype._activityList;
1929
+ }
1930
+
1931
+ /**
1932
+ * @fileoverview added by tsickle
1933
+ * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1934
+ */
1935
+ /**
1936
+ * @template D, R, E
1937
+ */
1938
+ var InplaceInteractionContextComponent = /** @class */ (function (_super) {
1939
+ __extends(InplaceInteractionContextComponent, _super);
1940
+ function InplaceInteractionContextComponent() {
1941
+ return _super.call(this) || this;
1942
+ }
1895
1943
  /**
1896
- * @type {?}
1897
- * @private
1944
+ * @return {?}
1898
1945
  */
1899
- ActivityContainerComponent.prototype._activityList;
1946
+ InplaceInteractionContextComponent.prototype.ngOnInit = /**
1947
+ * @return {?}
1948
+ */
1949
+ function () {
1950
+ };
1951
+ Object.defineProperty(InplaceInteractionContextComponent.prototype, "activityList", {
1952
+ get: /**
1953
+ * @return {?}
1954
+ */
1955
+ function () {
1956
+ return this.interactionContext.activityList;
1957
+ },
1958
+ enumerable: true,
1959
+ configurable: true
1960
+ });
1961
+ /**
1962
+ * @return {?}
1963
+ */
1964
+ InplaceInteractionContextComponent.prototype.isActive = /**
1965
+ * @return {?}
1966
+ */
1967
+ function () {
1968
+ return this.interactionContext.isActive();
1969
+ };
1970
+ /**
1971
+ * @param {?} alert
1972
+ * @return {?}
1973
+ */
1974
+ InplaceInteractionContextComponent.prototype.alert = /**
1975
+ * @param {?} alert
1976
+ * @return {?}
1977
+ */
1978
+ function (alert) {
1979
+ // TODO: Test disableClose === false
1980
+ return this._startActivity(AlertDialogComponent, alert);
1981
+ };
1982
+ /**
1983
+ * @param {?} confirm
1984
+ * @return {?}
1985
+ */
1986
+ InplaceInteractionContextComponent.prototype.confirm = /**
1987
+ * @param {?} confirm
1988
+ * @return {?}
1989
+ */
1990
+ function (confirm) {
1991
+ return this._startActivity(ConfirmationDialogComponent, confirm);
1992
+ };
1993
+ /**
1994
+ * @template D1, R1, E1
1995
+ * @param {?} confirm
1996
+ * @param {?} activityType
1997
+ * @param {?=} data
1998
+ * @return {?}
1999
+ */
2000
+ InplaceInteractionContextComponent.prototype.confirmThen = /**
2001
+ * @template D1, R1, E1
2002
+ * @param {?} confirm
2003
+ * @param {?} activityType
2004
+ * @param {?=} data
2005
+ * @return {?}
2006
+ */
2007
+ function (confirm, activityType, data) {
2008
+ return this._startActivity(ConfirmThenDialogComponent, {
2009
+ confirm: confirm,
2010
+ activityType: activityType,
2011
+ data: data
2012
+ });
2013
+ };
2014
+ /**
2015
+ * @template D1, R1, E1
2016
+ * @param {?} activityType
2017
+ * @param {?=} data
2018
+ * @return {?}
2019
+ */
2020
+ InplaceInteractionContextComponent.prototype.startActivity = /**
2021
+ * @template D1, R1, E1
2022
+ * @param {?} activityType
2023
+ * @param {?=} data
2024
+ * @return {?}
2025
+ */
2026
+ function (activityType, data) {
2027
+ return this._startActivity(activityType, data);
2028
+ };
2029
+ /**
2030
+ * @protected
2031
+ * @template D1, R1, E1
2032
+ * @param {?} activityType
2033
+ * @param {?=} data
2034
+ * @return {?}
2035
+ */
2036
+ InplaceInteractionContextComponent.prototype._startActivity = /**
2037
+ * @protected
2038
+ * @template D1, R1, E1
2039
+ * @param {?} activityType
2040
+ * @param {?=} data
2041
+ * @return {?}
2042
+ */
2043
+ function (activityType, data) {
2044
+ var _this = this;
2045
+ /** @type {?} */
2046
+ var self = this;
2047
+ return new Promise((/**
2048
+ * @param {?} resolve
2049
+ * @param {?} reject
2050
+ * @return {?}
2051
+ */
2052
+ function (resolve, reject) {
2053
+ _this.interactionContext.initialActivityOutletContext = {
2054
+ activityClass: activityType,
2055
+ activityData: data,
2056
+ onDone: /**
2057
+ * @param {?} result
2058
+ * @return {?}
2059
+ */
2060
+ function (result) {
2061
+ resolve(result);
2062
+ },
2063
+ onCancel: /**
2064
+ * @param {?} error
2065
+ * @return {?}
2066
+ */
2067
+ function (error) {
2068
+ reject(error);
2069
+ }
2070
+ };
2071
+ }));
2072
+ };
2073
+ InplaceInteractionContextComponent.decorators = [
2074
+ { type: Component, args: [{
2075
+ selector: 'aup-inplace-interaction-context',
2076
+ template: "<mat-tab-group no-tab-header [selectedIndex]=\"isActive() ? 1 : 0\" full-height-tabs [dynamicHeight]=\"false\">\n <mat-tab>\n <ng-content></ng-content>\n </mat-tab>\n <mat-tab>\n <aup-activity-container #activityContainer\n [(initialActivityOutletContext)]=\"initialActivityContext\"\n [dynamicHeight]=\"false\"></aup-activity-container>\n </mat-tab>\n</mat-tab-group>\n\n",
2077
+ styles: [":host{display:flex;flex-direction:column}mat-tab-group{flex:1}"]
2078
+ }] }
2079
+ ];
2080
+ /** @nocollapse */
2081
+ InplaceInteractionContextComponent.ctorParameters = function () { return []; };
2082
+ InplaceInteractionContextComponent.propDecorators = {
2083
+ interactionContext: [{ type: ViewChild, args: ["activityContainer", { static: true },] }]
2084
+ };
2085
+ return InplaceInteractionContextComponent;
2086
+ }(InteractionContext));
2087
+ if (false) {
2088
+ /** @type {?} */
2089
+ InplaceInteractionContextComponent.prototype.interactionContext;
2090
+ /** @type {?} */
2091
+ InplaceInteractionContextComponent.prototype.initialActivityContext;
1900
2092
  }
1901
2093
 
1902
2094
  /**
@@ -1997,7 +2189,7 @@ var DialogInteractionService = /** @class */ (function (_super) {
1997
2189
  * @return {?}
1998
2190
  */
1999
2191
  function () {
2000
- return !!this.currentActivityId;
2192
+ return this._activityList.length > 0;
2001
2193
  };
2002
2194
  /**
2003
2195
  * @return {?}
@@ -2063,8 +2255,8 @@ var DialogInteractionService = /** @class */ (function (_super) {
2063
2255
  * @return {?}
2064
2256
  */
2065
2257
  function () {
2066
- console.log("###### STARTING");
2067
- _this.currentActivityId = v1();
2258
+ console.log('###### STARTING');
2259
+ // this.currentActivityId = uuid.v1();
2068
2260
  // this.location.go(this.router.routerState.snapshot.url, "aup");
2069
2261
  /** @type {?} */
2070
2262
  var self = _this;
@@ -2084,7 +2276,6 @@ var DialogInteractionService = /** @class */ (function (_super) {
2084
2276
  function (resolve, reject) {
2085
2277
  /** @type {?} */
2086
2278
  var activityContainer = matDialogRef.componentInstance;
2087
- activityContainer.parentInteractionContext = _this;
2088
2279
  self.safelyUpdateActivityListDelegate(activityContainer.activityList);
2089
2280
  activityContainer.initialActivityOutletContext = {
2090
2281
  activityClass: activityType,
@@ -2106,13 +2297,16 @@ var DialogInteractionService = /** @class */ (function (_super) {
2106
2297
  matDialogRef.close(true); // return true to let the after close listener know we've already handled it.
2107
2298
  }
2108
2299
  };
2300
+ // we need to check if our onDone/onCancel methods above we called or if we were
2301
+ // closed by the user clicking the backdrop. If the later then we need to reject
2302
+ // our promise.
2109
2303
  matDialogRef.afterClosed().subscribe((/**
2110
2304
  * @param {?} promiseAlreadyFinished
2111
2305
  * @return {?}
2112
2306
  */
2113
2307
  function (promiseAlreadyFinished) {
2114
2308
  if (!promiseAlreadyFinished) {
2115
- reject("auto-closed");
2309
+ reject('auto-closed');
2116
2310
  }
2117
2311
  }));
2118
2312
  matDialogRef.updateSize();
@@ -2120,8 +2314,8 @@ var DialogInteractionService = /** @class */ (function (_super) {
2120
2314
  * @return {?}
2121
2315
  */
2122
2316
  function () {
2123
- console.log("###### FINISHED");
2124
- _this.currentActivityId = null;
2317
+ console.log('###### FINISHED');
2318
+ // this.currentActivityId = null;
2125
2319
  self.safelyUpdateActivityListDelegate(null);
2126
2320
  }));
2127
2321
  }));
@@ -2261,12 +2455,14 @@ var InteractionModule = /** @class */ (function () {
2261
2455
  ConfirmThenDialogComponent,
2262
2456
  AlertDialogComponent,
2263
2457
  ActivityOutletComponent,
2264
- InteractionOutletComponent
2458
+ InteractionOutletComponent,
2459
+ InplaceInteractionContextComponent
2265
2460
  ],
2266
2461
  exports: [
2267
2462
  ActivityContainerComponent,
2268
2463
  ActivityOutletComponent,
2269
- InteractionOutletComponent
2464
+ InteractionOutletComponent,
2465
+ InplaceInteractionContextComponent
2270
2466
  ],
2271
2467
  entryComponents: [
2272
2468
  ActivityContainerComponent,
@@ -3119,6 +3315,8 @@ if (false) {
3119
3315
  * @private
3120
3316
  */
3121
3317
  PlaceComponent.prototype.visit;
3318
+ /** @type {?} */
3319
+ PlaceComponent.prototype.interactionContext;
3122
3320
  }
3123
3321
  (function (PlaceComponent) {
3124
3322
  /**
@@ -4051,6 +4249,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4051
4249
  _this._inOutletUpdate = new Guard$1();
4052
4250
  _this._activatedRouteModel = new MutableValueModel();
4053
4251
  _this._placeDefinition = new MutableValueModel();
4252
+ _this.isOnInitialPlace = true;
4054
4253
  var _a = Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
4055
4254
  _this.parentOutletModel = new MutableValueModel(parentOutlet);
4056
4255
  /** @type {?} */
@@ -4076,8 +4275,12 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4076
4275
  * @param {?} order
4077
4276
  * @return {?}
4078
4277
  */
4079
- function (order) { return Math.max(order, 0); })); // we get -1 on the first load which triggers an animation to the first page, so alway pin it to 0.
4080
- // we get -1 on the first load which triggers an animation to the first page, so alway pin it to 0.
4278
+ function (order) {
4279
+ // we get -1 on the first load which triggers an animation to the first page, so alway pin it to 0
4280
+ // if we're animating.
4281
+ return _this.isOnInitialPlace ? 0 :
4282
+ _this.animate ? Math.max(order, 0) : 0;
4283
+ }));
4081
4284
  // Push incoming changes into the component
4082
4285
  /** @type {?} */
4083
4286
  var routeVisit = chain(_this._activePlace).pluck('placeDefinition').findIn(placeRouter.activeVisitIndex);
@@ -4186,12 +4389,16 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4186
4389
  enumerable: true,
4187
4390
  configurable: true
4188
4391
  });
4392
+ // @Trace()
4393
+ // @Trace()
4189
4394
  /**
4190
4395
  * @param {?} routerOutlet
4191
4396
  * @param {?} place
4192
4397
  * @return {?}
4193
4398
  */
4194
- PlaceOutletComponent.prototype.onOutletActivated = /**
4399
+ PlaceOutletComponent.prototype.onOutletActivated =
4400
+ // @Trace()
4401
+ /**
4195
4402
  * @param {?} routerOutlet
4196
4403
  * @param {?} place
4197
4404
  * @return {?}
@@ -4237,6 +4444,7 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4237
4444
  * @return {?}
4238
4445
  */
4239
4446
  function () {
4447
+ _this.isOnInitialPlace = false;
4240
4448
  _this._activePlace.value = null;
4241
4449
  _this._activatedRouteModel.value = null;
4242
4450
  _this._placeDefinition.value = null;
@@ -4288,12 +4496,6 @@ var PlaceOutletComponent = /** @class */ (function (_super) {
4288
4496
  __metadata("design:paramtypes", [Visit]),
4289
4497
  __metadata("design:returntype", void 0)
4290
4498
  ], PlaceOutletComponent.prototype, "navigate", null);
4291
- __decorate([
4292
- Trace(),
4293
- __metadata("design:type", Function),
4294
- __metadata("design:paramtypes", [RouterOutlet, PlaceComponent]),
4295
- __metadata("design:returntype", void 0)
4296
- ], PlaceOutletComponent.prototype, "onOutletActivated", null);
4297
4499
  return PlaceOutletComponent;
4298
4500
  }(DisposableComponent));
4299
4501
  if (false) {
@@ -4339,6 +4541,11 @@ if (false) {
4339
4541
  PlaceOutletComponent.prototype.parentOutletModel;
4340
4542
  /** @type {?} */
4341
4543
  PlaceOutletComponent.prototype.placeAnimationOrder;
4544
+ /**
4545
+ * @type {?}
4546
+ * @private
4547
+ */
4548
+ PlaceOutletComponent.prototype.isOnInitialPlace;
4342
4549
  /**
4343
4550
  * @type {?}
4344
4551
  * @private
@@ -5914,10 +6121,10 @@ var LeavePlaceGuard = /** @class */ (function () {
5914
6121
  // we check the interaction first, so that components that don't need to check if they're in an
5915
6122
  // interaction during the canDeactivate cycle.
5916
6123
  // TODO: Add tests: show dialog -> hit back -> same route
5917
- if (this.interactionContext.isActive()) {
6124
+ if (component.interactionContext && component.interactionContext.isActive()) {
5918
6125
  canLeave = false;
5919
- console.log('cancelling', { activity: this.interactionContext.currentActivity });
5920
- this.interactionContext.currentActivity.cancel(null);
6126
+ console.log('cancelling', { activity: component.interactionContext.currentActivity });
6127
+ component.interactionContext.currentActivity.cancel(null);
5921
6128
  }
5922
6129
  if (!canLeave) return [3 /*break*/, 3];
5923
6130
  return [4 /*yield*/, component.canDeactivate()];
@@ -6019,5 +6226,5 @@ if (false) {
6019
6226
  * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
6020
6227
  */
6021
6228
 
6022
- export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceNavigationComponent, Activity, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DialogInteractionService, Dimension, DirectivesModule, DisposableComponent, EmptyStateComponent, EnterPlaceGuard, FocusBindingDirective, Formatter, InteractionContext, InteractionGuard, InteractionModule, InteractionOutletComponent, LEFT_RIGHT_PLACE_ANIMATION, LeavePlaceGuard, ListPlaceNavComponent, NavigationSession, NoopComponent, NumberInputComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceComponent, PlaceDefinition, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, ROUTE_PARAMETER_LIST_KEY, ResizeAwareComponent, RouteId, SelectInputComponent, StringInputComponent, TabbedPlaceNavigationComponent, Visit, VisitParameter, VisitParameterList, VisitSanitiser, leftRightPlaceAnimation, slideDownAndUpAnimation, DirectivesModule as ɵa, CommandDirective as ɵb, ConfirmationDialogComponent as ɵba, AbstractActivity as ɵbb, ACTIVITY_DATA as ɵbc, Activity as ɵbd, ConfirmThenDialogComponent as ɵbf, AlertDialogComponent as ɵbg, InteractionOutletComponent as ɵbi, DIALOG_INTERACTION_SERVICE_DEFAULTS as ɵbj, DialogInteractionService as ɵbk, FocusBindingDirective as ɵc, DisposableComponent as ɵd, ComponentsModule as ɵe, NumberInputComponent as ɵf, AbstractInputComponent as ɵg, StringInputComponent as ɵh, PasswordInputComponent as ɵi, SelectInputComponent as ɵj, NoopComponent as ɵk, PlaceModule as ɵl, EmptyStateComponent as ɵm, BusyOverlayComponent as ɵn, PlaceOutletComponent as ɵo, leftRightPlaceAnimation as ɵp, LEFT_RIGHT_PLACE_ANIMATION as ɵq, PlaceRouter as ɵr, PlaceHistory as ɵs, TabbedPlaceNavigationComponent as ɵt, AbstractPlaceNavigationComponent as ɵu, ListPlaceNavComponent as ɵv, InteractionModule as ɵw, ActivityContainerComponent as ɵx, InteractionContext as ɵy, ActivityOutletComponent as ɵz };
6229
+ export { ACTIVITY_DATA, AbstractActivity, AbstractInputComponent, AbstractPlaceNavigationComponent, Activity, ActivityContainerComponent, ActivityOutletComponent, AlertDialogComponent, AngularUiPowerupsModule, Bounds, BusyOverlayComponent, CommandDirective, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DialogInteractionService, Dimension, DirectivesModule, DisposableComponent, EmptyStateComponent, EnterPlaceGuard, FocusBindingDirective, Formatter, InplaceInteractionContextComponent, InteractionContext, InteractionGuard, InteractionModule, InteractionOutletComponent, LEFT_RIGHT_PLACE_ANIMATION, LeavePlaceGuard, ListPlaceNavComponent, NavigationSession, NoopComponent, NumberInputComponent, ParameterDefinition, PasswordInputComponent, Place, PlaceComponent, PlaceDefinition, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, ROUTE_PARAMETER_LIST_KEY, ResizeAwareComponent, RouteId, SelectInputComponent, StringInputComponent, TabbedPlaceNavigationComponent, Visit, VisitParameter, VisitParameterList, VisitSanitiser, leftRightPlaceAnimation, slideDownAndUpAnimation, DirectivesModule as ɵa, CommandDirective as ɵb, ConfirmationDialogComponent as ɵba, AbstractActivity as ɵbb, ACTIVITY_DATA as ɵbc, Activity as ɵbd, ConfirmThenDialogComponent as ɵbf, AlertDialogComponent as ɵbg, InteractionOutletComponent as ɵbi, InplaceInteractionContextComponent as ɵbj, DIALOG_INTERACTION_SERVICE_DEFAULTS as ɵbk, DialogInteractionService as ɵbl, FocusBindingDirective as ɵc, DisposableComponent as ɵd, ComponentsModule as ɵe, NumberInputComponent as ɵf, AbstractInputComponent as ɵg, StringInputComponent as ɵh, PasswordInputComponent as ɵi, SelectInputComponent as ɵj, NoopComponent as ɵk, PlaceModule as ɵl, EmptyStateComponent as ɵm, BusyOverlayComponent as ɵn, PlaceOutletComponent as ɵo, leftRightPlaceAnimation as ɵp, LEFT_RIGHT_PLACE_ANIMATION as ɵq, PlaceRouter as ɵr, PlaceHistory as ɵs, TabbedPlaceNavigationComponent as ɵt, AbstractPlaceNavigationComponent as ɵu, ListPlaceNavComponent as ɵv, InteractionModule as ɵw, ActivityContainerComponent as ɵx, InteractionContext as ɵy, ActivityOutletComponent as ɵz };
6023
6230
  //# sourceMappingURL=coolon-angular-ui-powerups.js.map