@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.
- package/bundles/coolon-angular-ui-powerups.umd.js +283 -73
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.d.ts +2 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +4 -3
- package/esm2015/index.js +2 -2
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +71 -48
- package/esm2015/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +128 -0
- package/esm2015/lib/interaction/index.js +2 -1
- package/esm2015/lib/interaction/interaction.module.js +6 -3
- package/esm2015/lib/interaction/services/dialog-interaction.service.js +10 -9
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +15 -10
- package/esm2015/lib/place/place-component.js +3 -1
- package/esm2015/lib/place/route/guards/leave-place.guard.js +4 -4
- package/esm2015/public_api.js +2 -2
- package/esm5/coolon-angular-ui-powerups.js +4 -3
- package/esm5/index.js +2 -2
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js +79 -49
- package/esm5/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.js +171 -0
- package/esm5/lib/interaction/index.js +2 -1
- package/esm5/lib/interaction/interaction.module.js +6 -3
- package/esm5/lib/interaction/services/dialog-interaction.service.js +10 -9
- package/esm5/lib/place/components/place-outlet/place-outlet.component.js +19 -11
- package/esm5/lib/place/place-component.js +3 -1
- package/esm5/lib/place/route/guards/leave-place.guard.js +4 -4
- package/esm5/public_api.js +2 -2
- package/fesm2015/coolon-angular-ui-powerups.js +224 -68
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +277 -70
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/interaction/components/activity-container/activity-container.component.d.ts +9 -6
- package/lib/interaction/components/inplace-interaction-context/inplace-interaction-context.component.d.ts +21 -0
- package/lib/interaction/index.d.ts +1 -0
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +1 -0
- package/lib/place/place-component.d.ts +2 -0
- package/package.json +1 -1
- package/styles/styles.scss +6 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material'), require('@angular/material/tabs'), require('@angular/platform-browser/animations'), require('@coolon/pectin'), require('@angular/cdk/portal'), require('@angular/router'), require('lodash'), require('@coolon/typescript-utilities'), require('@angular/material/dialog'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@coolon/angular-ui-powerups', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material', '@angular/material/tabs', '@angular/platform-browser/animations', '@coolon/pectin', '@angular/cdk/portal', '@angular/router', 'lodash', '@coolon/typescript-utilities', '@angular/material/dialog', '
|
|
4
|
-
(global = global || self, factory((global.coolon = global.coolon || {}, global.coolon['angular-ui-powerups'] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material, global.ng.material.tabs, global.ng.platformBrowser.animations, global.pectin, global.ng.cdk.portal, global.ng.router, global.___default, global.typescriptUtilities, global.ng.material.dialog, global.
|
|
5
|
-
}(this, function (exports, common, core, forms, material, tabs, animations, pectin, portal, router, ___default, typescriptUtilities, dialog,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('@angular/material'), require('@angular/material/tabs'), require('@angular/platform-browser/animations'), require('@coolon/pectin'), require('@angular/cdk/portal'), require('@angular/router'), require('lodash'), require('@coolon/typescript-utilities'), require('@angular/material/dialog'), require('@angular/material/icon'), require('@angular/material/list'), require('@angular/material/tooltip'), require('@typescript-plus/fast-memoize-decorator/dist/src'), require('@typescript-plus/fast-memoize-decorator'), require('reflect-metadata'), require('@angular/animations'), require('resize-observer-polyfill')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@coolon/angular-ui-powerups', ['exports', '@angular/common', '@angular/core', '@angular/forms', '@angular/material', '@angular/material/tabs', '@angular/platform-browser/animations', '@coolon/pectin', '@angular/cdk/portal', '@angular/router', 'lodash', '@coolon/typescript-utilities', '@angular/material/dialog', '@angular/material/icon', '@angular/material/list', '@angular/material/tooltip', '@typescript-plus/fast-memoize-decorator/dist/src', '@typescript-plus/fast-memoize-decorator', 'reflect-metadata', '@angular/animations', 'resize-observer-polyfill'], factory) :
|
|
4
|
+
(global = global || self, factory((global.coolon = global.coolon || {}, global.coolon['angular-ui-powerups'] = {}), global.ng.common, global.ng.core, global.ng.forms, global.ng.material, global.ng.material.tabs, global.ng.platformBrowser.animations, global.pectin, global.ng.cdk.portal, global.ng.router, global.___default, global.typescriptUtilities, global.ng.material.dialog, global.ng.material.icon, global.ng.material.list, global.ng.material.tooltip, global.src, global.fastMemoizeDecorator, null, global.ng.animations, global.ResizeObserver));
|
|
5
|
+
}(this, function (exports, common, core, forms, material, tabs, animations, pectin, portal, router, ___default, typescriptUtilities, dialog, icon, list, tooltip, src, fastMemoizeDecorator, reflectMetadata, animations$1, ResizeObserver) { 'use strict';
|
|
6
6
|
|
|
7
7
|
var ___default__default = 'default' in ___default ? ___default['default'] : ___default;
|
|
8
8
|
ResizeObserver = ResizeObserver && ResizeObserver.hasOwnProperty('default') ? ResizeObserver['default'] : ResizeObserver;
|
|
@@ -1734,15 +1734,17 @@
|
|
|
1734
1734
|
__extends(ActivityContainerComponent, _super);
|
|
1735
1735
|
function ActivityContainerComponent() {
|
|
1736
1736
|
var _this = _super.call(this) || this;
|
|
1737
|
-
_this.
|
|
1737
|
+
_this.throttledNestedActivityFinishEvents = new pectin.MutableStream();
|
|
1738
|
+
// tslint:disable-next-line:no-output-rename
|
|
1739
|
+
_this.initialActivityOutletContextEvent = new core.EventEmitter();
|
|
1740
|
+
_this.dynamicHeight = false;
|
|
1738
1741
|
_this.activityTabs = new pectin.MutableListModel();
|
|
1739
|
-
_this.finished = false;
|
|
1740
1742
|
_this._activityList = new pectin.MutableListModel();
|
|
1741
1743
|
var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
1742
|
-
chain(_this.
|
|
1744
|
+
chain(_this.throttledNestedActivityFinishEvents).throttle(50).subscribe((/**
|
|
1743
1745
|
* @return {?}
|
|
1744
1746
|
*/
|
|
1745
|
-
function () { return _this.
|
|
1747
|
+
function () { return _this.onNestedActivityFinished(); }));
|
|
1746
1748
|
return _this;
|
|
1747
1749
|
}
|
|
1748
1750
|
Object.defineProperty(ActivityContainerComponent.prototype, "initialActivityOutletContext", {
|
|
@@ -1750,33 +1752,37 @@
|
|
|
1750
1752
|
* @return {?}
|
|
1751
1753
|
*/
|
|
1752
1754
|
function () {
|
|
1753
|
-
return this.
|
|
1755
|
+
return this._initialActivityOutletContext;
|
|
1754
1756
|
},
|
|
1755
1757
|
set: /**
|
|
1756
1758
|
* @param {?} initialContext
|
|
1757
1759
|
* @return {?}
|
|
1758
1760
|
*/
|
|
1759
1761
|
function (initialContext) {
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1762
|
+
pectin.assert.isNil(this._initialActivityOutletContext);
|
|
1763
|
+
/** @type {?} */
|
|
1764
|
+
var self = this;
|
|
1765
|
+
if (initialContext) {
|
|
1766
|
+
this._initialActivityOutletContext = initialContext;
|
|
1767
|
+
this.activityTabs.push(new TabContext(initialContext.activityData, initialContext.activityClass, this, {
|
|
1768
|
+
onDone: (/**
|
|
1769
|
+
* @param {?} result
|
|
1770
|
+
* @return {?}
|
|
1771
|
+
*/
|
|
1772
|
+
function (result) {
|
|
1773
|
+
self.finishInitialActivity();
|
|
1774
|
+
initialContext.onDone(result);
|
|
1775
|
+
}),
|
|
1776
|
+
onCancel: (/**
|
|
1777
|
+
* @param {?} error
|
|
1778
|
+
* @return {?}
|
|
1779
|
+
*/
|
|
1780
|
+
function (error) {
|
|
1781
|
+
self.finishInitialActivity();
|
|
1782
|
+
initialContext.onCancel(error);
|
|
1783
|
+
})
|
|
1784
|
+
}));
|
|
1785
|
+
}
|
|
1780
1786
|
},
|
|
1781
1787
|
enumerable: true,
|
|
1782
1788
|
configurable: true
|
|
@@ -1788,7 +1794,7 @@
|
|
|
1788
1794
|
* @return {?}
|
|
1789
1795
|
*/
|
|
1790
1796
|
function () {
|
|
1791
|
-
return this.
|
|
1797
|
+
return this._activityList.length > 0;
|
|
1792
1798
|
};
|
|
1793
1799
|
Object.defineProperty(ActivityContainerComponent.prototype, "activityList", {
|
|
1794
1800
|
get: /**
|
|
@@ -1800,6 +1806,16 @@
|
|
|
1800
1806
|
enumerable: true,
|
|
1801
1807
|
configurable: true
|
|
1802
1808
|
});
|
|
1809
|
+
Object.defineProperty(ActivityContainerComponent.prototype, "isFinished", {
|
|
1810
|
+
get: /**
|
|
1811
|
+
* @return {?}
|
|
1812
|
+
*/
|
|
1813
|
+
function () {
|
|
1814
|
+
return !this._initialActivityOutletContext;
|
|
1815
|
+
},
|
|
1816
|
+
enumerable: true,
|
|
1817
|
+
configurable: true
|
|
1818
|
+
});
|
|
1803
1819
|
/**
|
|
1804
1820
|
* @return {?}
|
|
1805
1821
|
*/
|
|
@@ -1860,7 +1876,7 @@
|
|
|
1860
1876
|
*/
|
|
1861
1877
|
function (result) {
|
|
1862
1878
|
resolve(result);
|
|
1863
|
-
self.
|
|
1879
|
+
self.throttledNestedActivityFinishEvents.publish({});
|
|
1864
1880
|
}),
|
|
1865
1881
|
onCancel: (/**
|
|
1866
1882
|
* @param {?} error
|
|
@@ -1868,7 +1884,7 @@
|
|
|
1868
1884
|
*/
|
|
1869
1885
|
function (error) {
|
|
1870
1886
|
reject(error);
|
|
1871
|
-
self.
|
|
1887
|
+
self.throttledNestedActivityFinishEvents.publish({});
|
|
1872
1888
|
})
|
|
1873
1889
|
});
|
|
1874
1890
|
self.activityTabs.push(context);
|
|
@@ -1918,13 +1934,27 @@
|
|
|
1918
1934
|
data: data
|
|
1919
1935
|
});
|
|
1920
1936
|
};
|
|
1937
|
+
/**
|
|
1938
|
+
* @private
|
|
1939
|
+
* @return {?}
|
|
1940
|
+
*/
|
|
1941
|
+
ActivityContainerComponent.prototype.finishInitialActivity = /**
|
|
1942
|
+
* @private
|
|
1943
|
+
* @return {?}
|
|
1944
|
+
*/
|
|
1945
|
+
function () {
|
|
1946
|
+
this._initialActivityOutletContext = null;
|
|
1947
|
+
this.activityTabs.value = [];
|
|
1948
|
+
this._activityList.value = [];
|
|
1949
|
+
this.initialActivityOutletContextEvent.emit(null);
|
|
1950
|
+
};
|
|
1921
1951
|
// @Trace()
|
|
1922
1952
|
// @Trace()
|
|
1923
1953
|
/**
|
|
1924
1954
|
* @private
|
|
1925
1955
|
* @return {?}
|
|
1926
1956
|
*/
|
|
1927
|
-
ActivityContainerComponent.prototype.
|
|
1957
|
+
ActivityContainerComponent.prototype.onNestedActivityFinished =
|
|
1928
1958
|
// @Trace()
|
|
1929
1959
|
/**
|
|
1930
1960
|
* @private
|
|
@@ -1932,12 +1962,10 @@
|
|
|
1932
1962
|
*/
|
|
1933
1963
|
function () {
|
|
1934
1964
|
// don't do anything if job already queued up.
|
|
1935
|
-
if (
|
|
1936
|
-
|
|
1937
|
-
this.cleanupStaleActivities();
|
|
1938
|
-
}
|
|
1939
|
-
this.updateActivityList();
|
|
1965
|
+
if (this.synchroniseSelectedTabIndex()) {
|
|
1966
|
+
this.cleanupStaleNestedActivities();
|
|
1940
1967
|
}
|
|
1968
|
+
this.updateActivityList();
|
|
1941
1969
|
};
|
|
1942
1970
|
// @Trace()
|
|
1943
1971
|
// @Trace()
|
|
@@ -1945,7 +1973,7 @@
|
|
|
1945
1973
|
* @private
|
|
1946
1974
|
* @return {?}
|
|
1947
1975
|
*/
|
|
1948
|
-
ActivityContainerComponent.prototype.
|
|
1976
|
+
ActivityContainerComponent.prototype.cleanupStaleNestedActivities =
|
|
1949
1977
|
// @Trace()
|
|
1950
1978
|
/**
|
|
1951
1979
|
* @private
|
|
@@ -1953,7 +1981,6 @@
|
|
|
1953
1981
|
*/
|
|
1954
1982
|
function () {
|
|
1955
1983
|
var _this = this;
|
|
1956
|
-
// clean up old tabs
|
|
1957
1984
|
if (this.tabs.selectedIndex < this.activityTabs.length - 1) {
|
|
1958
1985
|
this.activityTabs.runInTransaction((/**
|
|
1959
1986
|
* @param {?} draft
|
|
@@ -2006,7 +2033,7 @@
|
|
|
2006
2033
|
*/
|
|
2007
2034
|
function () {
|
|
2008
2035
|
this.getSelectedOutlet().component.onActivityReady();
|
|
2009
|
-
this.
|
|
2036
|
+
this.cleanupStaleNestedActivities();
|
|
2010
2037
|
this.updateActivityList();
|
|
2011
2038
|
};
|
|
2012
2039
|
/**
|
|
@@ -2042,15 +2069,16 @@
|
|
|
2042
2069
|
ActivityContainerComponent.decorators = [
|
|
2043
2070
|
{ type: core.Component, args: [{
|
|
2044
2071
|
selector: 'aup-activity-container',
|
|
2045
|
-
template: "<mat-tab-group #tabs no-tab-header [dynamicHeight]=\"
|
|
2046
|
-
styles: [":host{display:
|
|
2072
|
+
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",
|
|
2073
|
+
styles: [":host{display:flex;flex-direction:column}mat-tab-group{flex:1}"]
|
|
2047
2074
|
}] }
|
|
2048
2075
|
];
|
|
2049
2076
|
/** @nocollapse */
|
|
2050
2077
|
ActivityContainerComponent.ctorParameters = function () { return []; };
|
|
2051
2078
|
ActivityContainerComponent.propDecorators = {
|
|
2052
|
-
parentInteractionContext: [{ type: core.Input }],
|
|
2053
2079
|
initialActivityOutletContext: [{ type: core.Input }],
|
|
2080
|
+
initialActivityOutletContextEvent: [{ type: core.Output, args: ['initialActivityOutletContext',] }],
|
|
2081
|
+
dynamicHeight: [{ type: core.Input }],
|
|
2054
2082
|
tabs: [{ type: core.ViewChild, args: ['tabs', { static: true },] }],
|
|
2055
2083
|
outlets: [{ type: core.ViewChildren, args: [ActivityOutletComponent,] }]
|
|
2056
2084
|
};
|
|
@@ -2061,9 +2089,16 @@
|
|
|
2061
2089
|
* @type {?}
|
|
2062
2090
|
* @private
|
|
2063
2091
|
*/
|
|
2064
|
-
ActivityContainerComponent.prototype.
|
|
2092
|
+
ActivityContainerComponent.prototype.throttledNestedActivityFinishEvents;
|
|
2093
|
+
/**
|
|
2094
|
+
* @type {?}
|
|
2095
|
+
* @private
|
|
2096
|
+
*/
|
|
2097
|
+
ActivityContainerComponent.prototype._initialActivityOutletContext;
|
|
2098
|
+
/** @type {?} */
|
|
2099
|
+
ActivityContainerComponent.prototype.initialActivityOutletContextEvent;
|
|
2065
2100
|
/** @type {?} */
|
|
2066
|
-
ActivityContainerComponent.prototype.
|
|
2101
|
+
ActivityContainerComponent.prototype.dynamicHeight;
|
|
2067
2102
|
/** @type {?} */
|
|
2068
2103
|
ActivityContainerComponent.prototype.tabs;
|
|
2069
2104
|
/** @type {?} */
|
|
@@ -2074,12 +2109,170 @@
|
|
|
2074
2109
|
* @type {?}
|
|
2075
2110
|
* @private
|
|
2076
2111
|
*/
|
|
2077
|
-
ActivityContainerComponent.prototype.
|
|
2112
|
+
ActivityContainerComponent.prototype._activityList;
|
|
2113
|
+
}
|
|
2114
|
+
|
|
2115
|
+
/**
|
|
2116
|
+
* @fileoverview added by tsickle
|
|
2117
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2118
|
+
*/
|
|
2119
|
+
/**
|
|
2120
|
+
* @template D, R, E
|
|
2121
|
+
*/
|
|
2122
|
+
var InplaceInteractionContextComponent = /** @class */ (function (_super) {
|
|
2123
|
+
__extends(InplaceInteractionContextComponent, _super);
|
|
2124
|
+
function InplaceInteractionContextComponent() {
|
|
2125
|
+
return _super.call(this) || this;
|
|
2126
|
+
}
|
|
2078
2127
|
/**
|
|
2079
|
-
* @
|
|
2080
|
-
* @private
|
|
2128
|
+
* @return {?}
|
|
2081
2129
|
*/
|
|
2082
|
-
|
|
2130
|
+
InplaceInteractionContextComponent.prototype.ngOnInit = /**
|
|
2131
|
+
* @return {?}
|
|
2132
|
+
*/
|
|
2133
|
+
function () {
|
|
2134
|
+
};
|
|
2135
|
+
Object.defineProperty(InplaceInteractionContextComponent.prototype, "activityList", {
|
|
2136
|
+
get: /**
|
|
2137
|
+
* @return {?}
|
|
2138
|
+
*/
|
|
2139
|
+
function () {
|
|
2140
|
+
return this.interactionContext.activityList;
|
|
2141
|
+
},
|
|
2142
|
+
enumerable: true,
|
|
2143
|
+
configurable: true
|
|
2144
|
+
});
|
|
2145
|
+
/**
|
|
2146
|
+
* @return {?}
|
|
2147
|
+
*/
|
|
2148
|
+
InplaceInteractionContextComponent.prototype.isActive = /**
|
|
2149
|
+
* @return {?}
|
|
2150
|
+
*/
|
|
2151
|
+
function () {
|
|
2152
|
+
return this.interactionContext.isActive();
|
|
2153
|
+
};
|
|
2154
|
+
/**
|
|
2155
|
+
* @param {?} alert
|
|
2156
|
+
* @return {?}
|
|
2157
|
+
*/
|
|
2158
|
+
InplaceInteractionContextComponent.prototype.alert = /**
|
|
2159
|
+
* @param {?} alert
|
|
2160
|
+
* @return {?}
|
|
2161
|
+
*/
|
|
2162
|
+
function (alert) {
|
|
2163
|
+
// TODO: Test disableClose === false
|
|
2164
|
+
return this._startActivity(AlertDialogComponent, alert);
|
|
2165
|
+
};
|
|
2166
|
+
/**
|
|
2167
|
+
* @param {?} confirm
|
|
2168
|
+
* @return {?}
|
|
2169
|
+
*/
|
|
2170
|
+
InplaceInteractionContextComponent.prototype.confirm = /**
|
|
2171
|
+
* @param {?} confirm
|
|
2172
|
+
* @return {?}
|
|
2173
|
+
*/
|
|
2174
|
+
function (confirm) {
|
|
2175
|
+
return this._startActivity(ConfirmationDialogComponent, confirm);
|
|
2176
|
+
};
|
|
2177
|
+
/**
|
|
2178
|
+
* @template D1, R1, E1
|
|
2179
|
+
* @param {?} confirm
|
|
2180
|
+
* @param {?} activityType
|
|
2181
|
+
* @param {?=} data
|
|
2182
|
+
* @return {?}
|
|
2183
|
+
*/
|
|
2184
|
+
InplaceInteractionContextComponent.prototype.confirmThen = /**
|
|
2185
|
+
* @template D1, R1, E1
|
|
2186
|
+
* @param {?} confirm
|
|
2187
|
+
* @param {?} activityType
|
|
2188
|
+
* @param {?=} data
|
|
2189
|
+
* @return {?}
|
|
2190
|
+
*/
|
|
2191
|
+
function (confirm, activityType, data) {
|
|
2192
|
+
return this._startActivity(exports.ɵbf, {
|
|
2193
|
+
confirm: confirm,
|
|
2194
|
+
activityType: activityType,
|
|
2195
|
+
data: data
|
|
2196
|
+
});
|
|
2197
|
+
};
|
|
2198
|
+
/**
|
|
2199
|
+
* @template D1, R1, E1
|
|
2200
|
+
* @param {?} activityType
|
|
2201
|
+
* @param {?=} data
|
|
2202
|
+
* @return {?}
|
|
2203
|
+
*/
|
|
2204
|
+
InplaceInteractionContextComponent.prototype.startActivity = /**
|
|
2205
|
+
* @template D1, R1, E1
|
|
2206
|
+
* @param {?} activityType
|
|
2207
|
+
* @param {?=} data
|
|
2208
|
+
* @return {?}
|
|
2209
|
+
*/
|
|
2210
|
+
function (activityType, data) {
|
|
2211
|
+
return this._startActivity(activityType, data);
|
|
2212
|
+
};
|
|
2213
|
+
/**
|
|
2214
|
+
* @protected
|
|
2215
|
+
* @template D1, R1, E1
|
|
2216
|
+
* @param {?} activityType
|
|
2217
|
+
* @param {?=} data
|
|
2218
|
+
* @return {?}
|
|
2219
|
+
*/
|
|
2220
|
+
InplaceInteractionContextComponent.prototype._startActivity = /**
|
|
2221
|
+
* @protected
|
|
2222
|
+
* @template D1, R1, E1
|
|
2223
|
+
* @param {?} activityType
|
|
2224
|
+
* @param {?=} data
|
|
2225
|
+
* @return {?}
|
|
2226
|
+
*/
|
|
2227
|
+
function (activityType, data) {
|
|
2228
|
+
var _this = this;
|
|
2229
|
+
/** @type {?} */
|
|
2230
|
+
var self = this;
|
|
2231
|
+
return new Promise((/**
|
|
2232
|
+
* @param {?} resolve
|
|
2233
|
+
* @param {?} reject
|
|
2234
|
+
* @return {?}
|
|
2235
|
+
*/
|
|
2236
|
+
function (resolve, reject) {
|
|
2237
|
+
_this.interactionContext.initialActivityOutletContext = {
|
|
2238
|
+
activityClass: activityType,
|
|
2239
|
+
activityData: data,
|
|
2240
|
+
onDone: /**
|
|
2241
|
+
* @param {?} result
|
|
2242
|
+
* @return {?}
|
|
2243
|
+
*/
|
|
2244
|
+
function (result) {
|
|
2245
|
+
resolve(result);
|
|
2246
|
+
},
|
|
2247
|
+
onCancel: /**
|
|
2248
|
+
* @param {?} error
|
|
2249
|
+
* @return {?}
|
|
2250
|
+
*/
|
|
2251
|
+
function (error) {
|
|
2252
|
+
reject(error);
|
|
2253
|
+
}
|
|
2254
|
+
};
|
|
2255
|
+
}));
|
|
2256
|
+
};
|
|
2257
|
+
InplaceInteractionContextComponent.decorators = [
|
|
2258
|
+
{ type: core.Component, args: [{
|
|
2259
|
+
selector: 'aup-inplace-interaction-context',
|
|
2260
|
+
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",
|
|
2261
|
+
styles: [":host{display:flex;flex-direction:column}mat-tab-group{flex:1}"]
|
|
2262
|
+
}] }
|
|
2263
|
+
];
|
|
2264
|
+
/** @nocollapse */
|
|
2265
|
+
InplaceInteractionContextComponent.ctorParameters = function () { return []; };
|
|
2266
|
+
InplaceInteractionContextComponent.propDecorators = {
|
|
2267
|
+
interactionContext: [{ type: core.ViewChild, args: ["activityContainer", { static: true },] }]
|
|
2268
|
+
};
|
|
2269
|
+
return InplaceInteractionContextComponent;
|
|
2270
|
+
}(InteractionContext));
|
|
2271
|
+
if (false) {
|
|
2272
|
+
/** @type {?} */
|
|
2273
|
+
InplaceInteractionContextComponent.prototype.interactionContext;
|
|
2274
|
+
/** @type {?} */
|
|
2275
|
+
InplaceInteractionContextComponent.prototype.initialActivityContext;
|
|
2083
2276
|
}
|
|
2084
2277
|
|
|
2085
2278
|
/**
|
|
@@ -2180,7 +2373,7 @@
|
|
|
2180
2373
|
* @return {?}
|
|
2181
2374
|
*/
|
|
2182
2375
|
function () {
|
|
2183
|
-
return
|
|
2376
|
+
return this._activityList.length > 0;
|
|
2184
2377
|
};
|
|
2185
2378
|
/**
|
|
2186
2379
|
* @return {?}
|
|
@@ -2246,8 +2439,8 @@
|
|
|
2246
2439
|
* @return {?}
|
|
2247
2440
|
*/
|
|
2248
2441
|
function () {
|
|
2249
|
-
console.log(
|
|
2250
|
-
|
|
2442
|
+
console.log('###### STARTING');
|
|
2443
|
+
// this.currentActivityId = uuid.v1();
|
|
2251
2444
|
// this.location.go(this.router.routerState.snapshot.url, "aup");
|
|
2252
2445
|
/** @type {?} */
|
|
2253
2446
|
var self = _this;
|
|
@@ -2267,7 +2460,6 @@
|
|
|
2267
2460
|
function (resolve, reject) {
|
|
2268
2461
|
/** @type {?} */
|
|
2269
2462
|
var activityContainer = matDialogRef.componentInstance;
|
|
2270
|
-
activityContainer.parentInteractionContext = _this;
|
|
2271
2463
|
self.safelyUpdateActivityListDelegate(activityContainer.activityList);
|
|
2272
2464
|
activityContainer.initialActivityOutletContext = {
|
|
2273
2465
|
activityClass: activityType,
|
|
@@ -2289,13 +2481,16 @@
|
|
|
2289
2481
|
matDialogRef.close(true); // return true to let the after close listener know we've already handled it.
|
|
2290
2482
|
}
|
|
2291
2483
|
};
|
|
2484
|
+
// we need to check if our onDone/onCancel methods above we called or if we were
|
|
2485
|
+
// closed by the user clicking the backdrop. If the later then we need to reject
|
|
2486
|
+
// our promise.
|
|
2292
2487
|
matDialogRef.afterClosed().subscribe((/**
|
|
2293
2488
|
* @param {?} promiseAlreadyFinished
|
|
2294
2489
|
* @return {?}
|
|
2295
2490
|
*/
|
|
2296
2491
|
function (promiseAlreadyFinished) {
|
|
2297
2492
|
if (!promiseAlreadyFinished) {
|
|
2298
|
-
reject(
|
|
2493
|
+
reject('auto-closed');
|
|
2299
2494
|
}
|
|
2300
2495
|
}));
|
|
2301
2496
|
matDialogRef.updateSize();
|
|
@@ -2303,8 +2498,8 @@
|
|
|
2303
2498
|
* @return {?}
|
|
2304
2499
|
*/
|
|
2305
2500
|
function () {
|
|
2306
|
-
console.log(
|
|
2307
|
-
|
|
2501
|
+
console.log('###### FINISHED');
|
|
2502
|
+
// this.currentActivityId = null;
|
|
2308
2503
|
self.safelyUpdateActivityListDelegate(null);
|
|
2309
2504
|
}));
|
|
2310
2505
|
}));
|
|
@@ -2444,12 +2639,14 @@
|
|
|
2444
2639
|
exports.ɵbf,
|
|
2445
2640
|
AlertDialogComponent,
|
|
2446
2641
|
ActivityOutletComponent,
|
|
2447
|
-
InteractionOutletComponent
|
|
2642
|
+
InteractionOutletComponent,
|
|
2643
|
+
InplaceInteractionContextComponent
|
|
2448
2644
|
],
|
|
2449
2645
|
exports: [
|
|
2450
2646
|
ActivityContainerComponent,
|
|
2451
2647
|
ActivityOutletComponent,
|
|
2452
|
-
InteractionOutletComponent
|
|
2648
|
+
InteractionOutletComponent,
|
|
2649
|
+
InplaceInteractionContextComponent
|
|
2453
2650
|
],
|
|
2454
2651
|
entryComponents: [
|
|
2455
2652
|
ActivityContainerComponent,
|
|
@@ -3302,6 +3499,8 @@
|
|
|
3302
3499
|
* @private
|
|
3303
3500
|
*/
|
|
3304
3501
|
exports.PlaceComponent.prototype.visit;
|
|
3502
|
+
/** @type {?} */
|
|
3503
|
+
exports.PlaceComponent.prototype.interactionContext;
|
|
3305
3504
|
}
|
|
3306
3505
|
(function (PlaceComponent) {
|
|
3307
3506
|
/**
|
|
@@ -4234,6 +4433,7 @@
|
|
|
4234
4433
|
_this._inOutletUpdate = new pectin.Guard();
|
|
4235
4434
|
_this._activatedRouteModel = new pectin.MutableValueModel();
|
|
4236
4435
|
_this._placeDefinition = new pectin.MutableValueModel();
|
|
4436
|
+
_this.isOnInitialPlace = true;
|
|
4237
4437
|
var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
|
|
4238
4438
|
_this.parentOutletModel = new pectin.MutableValueModel(parentOutlet);
|
|
4239
4439
|
/** @type {?} */
|
|
@@ -4259,8 +4459,12 @@
|
|
|
4259
4459
|
* @param {?} order
|
|
4260
4460
|
* @return {?}
|
|
4261
4461
|
*/
|
|
4262
|
-
function (order) {
|
|
4263
|
-
|
|
4462
|
+
function (order) {
|
|
4463
|
+
// we get -1 on the first load which triggers an animation to the first page, so alway pin it to 0
|
|
4464
|
+
// if we're animating.
|
|
4465
|
+
return _this.isOnInitialPlace ? 0 :
|
|
4466
|
+
_this.animate ? Math.max(order, 0) : 0;
|
|
4467
|
+
}));
|
|
4264
4468
|
// Push incoming changes into the component
|
|
4265
4469
|
/** @type {?} */
|
|
4266
4470
|
var routeVisit = chain(_this._activePlace).pluck('placeDefinition').findIn(placeRouter.activeVisitIndex);
|
|
@@ -4369,12 +4573,16 @@
|
|
|
4369
4573
|
enumerable: true,
|
|
4370
4574
|
configurable: true
|
|
4371
4575
|
});
|
|
4576
|
+
// @Trace()
|
|
4577
|
+
// @Trace()
|
|
4372
4578
|
/**
|
|
4373
4579
|
* @param {?} routerOutlet
|
|
4374
4580
|
* @param {?} place
|
|
4375
4581
|
* @return {?}
|
|
4376
4582
|
*/
|
|
4377
|
-
PlaceOutletComponent.prototype.onOutletActivated =
|
|
4583
|
+
PlaceOutletComponent.prototype.onOutletActivated =
|
|
4584
|
+
// @Trace()
|
|
4585
|
+
/**
|
|
4378
4586
|
* @param {?} routerOutlet
|
|
4379
4587
|
* @param {?} place
|
|
4380
4588
|
* @return {?}
|
|
@@ -4420,6 +4628,7 @@
|
|
|
4420
4628
|
* @return {?}
|
|
4421
4629
|
*/
|
|
4422
4630
|
function () {
|
|
4631
|
+
_this.isOnInitialPlace = false;
|
|
4423
4632
|
_this._activePlace.value = null;
|
|
4424
4633
|
_this._activatedRouteModel.value = null;
|
|
4425
4634
|
_this._placeDefinition.value = null;
|
|
@@ -4471,12 +4680,6 @@
|
|
|
4471
4680
|
__metadata("design:paramtypes", [Visit]),
|
|
4472
4681
|
__metadata("design:returntype", void 0)
|
|
4473
4682
|
], PlaceOutletComponent.prototype, "navigate", null);
|
|
4474
|
-
__decorate([
|
|
4475
|
-
pectin.Trace(),
|
|
4476
|
-
__metadata("design:type", Function),
|
|
4477
|
-
__metadata("design:paramtypes", [router.RouterOutlet, exports.PlaceComponent]),
|
|
4478
|
-
__metadata("design:returntype", void 0)
|
|
4479
|
-
], PlaceOutletComponent.prototype, "onOutletActivated", null);
|
|
4480
4683
|
return PlaceOutletComponent;
|
|
4481
4684
|
}(DisposableComponent));
|
|
4482
4685
|
if (false) {
|
|
@@ -4522,6 +4725,11 @@
|
|
|
4522
4725
|
PlaceOutletComponent.prototype.parentOutletModel;
|
|
4523
4726
|
/** @type {?} */
|
|
4524
4727
|
PlaceOutletComponent.prototype.placeAnimationOrder;
|
|
4728
|
+
/**
|
|
4729
|
+
* @type {?}
|
|
4730
|
+
* @private
|
|
4731
|
+
*/
|
|
4732
|
+
PlaceOutletComponent.prototype.isOnInitialPlace;
|
|
4525
4733
|
/**
|
|
4526
4734
|
* @type {?}
|
|
4527
4735
|
* @private
|
|
@@ -6097,10 +6305,10 @@
|
|
|
6097
6305
|
// we check the interaction first, so that components that don't need to check if they're in an
|
|
6098
6306
|
// interaction during the canDeactivate cycle.
|
|
6099
6307
|
// TODO: Add tests: show dialog -> hit back -> same route
|
|
6100
|
-
if (
|
|
6308
|
+
if (component.interactionContext && component.interactionContext.isActive()) {
|
|
6101
6309
|
canLeave = false;
|
|
6102
|
-
console.log('cancelling', { activity:
|
|
6103
|
-
|
|
6310
|
+
console.log('cancelling', { activity: component.interactionContext.currentActivity });
|
|
6311
|
+
component.interactionContext.currentActivity.cancel(null);
|
|
6104
6312
|
}
|
|
6105
6313
|
if (!canLeave) return [3 /*break*/, 3];
|
|
6106
6314
|
return [4 /*yield*/, component.canDeactivate()];
|
|
@@ -6204,6 +6412,7 @@
|
|
|
6204
6412
|
exports.DisposableComponent = DisposableComponent;
|
|
6205
6413
|
exports.EmptyStateComponent = EmptyStateComponent;
|
|
6206
6414
|
exports.FocusBindingDirective = FocusBindingDirective;
|
|
6415
|
+
exports.InplaceInteractionContextComponent = InplaceInteractionContextComponent;
|
|
6207
6416
|
exports.InteractionContext = InteractionContext;
|
|
6208
6417
|
exports.InteractionGuard = InteractionGuard;
|
|
6209
6418
|
exports.InteractionModule = InteractionModule;
|
|
@@ -6239,8 +6448,9 @@
|
|
|
6239
6448
|
exports.ɵbc = ACTIVITY_DATA;
|
|
6240
6449
|
exports.ɵbg = AlertDialogComponent;
|
|
6241
6450
|
exports.ɵbi = InteractionOutletComponent;
|
|
6242
|
-
exports.ɵbj =
|
|
6243
|
-
exports.ɵbk =
|
|
6451
|
+
exports.ɵbj = InplaceInteractionContextComponent;
|
|
6452
|
+
exports.ɵbk = DIALOG_INTERACTION_SERVICE_DEFAULTS;
|
|
6453
|
+
exports.ɵbl = DialogInteractionService;
|
|
6244
6454
|
exports.ɵc = FocusBindingDirective;
|
|
6245
6455
|
exports.ɵd = DisposableComponent;
|
|
6246
6456
|
exports.ɵe = ComponentsModule;
|