@coolon/angular-ui-powerups 1.8.0 → 1.10.0
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/CHANGELOG.md +19 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +375 -240
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +2 -2
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.d.ts +4 -0
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/coolon-angular-ui-powerups.js +4 -0
- package/esm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/esm2015/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/forms/text-input/text-input.component.js +1 -1
- package/esm2015/lib/components/forms/text-input/text-input.component.js.map +1 -1
- package/esm2015/lib/components/forms/text-input/text-input.component.metadata.json +1 -1
- package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.js +51 -0
- package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.js.map +1 -0
- package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.metadata.json +1 -0
- package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.ngfactory.js.map +1 -0
- package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.scss.shim.ngstyle.js.map +1 -0
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +22 -9
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.metadata.json +1 -1
- package/esm2015/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.js.map +1 -1
- package/esm2015/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.js +69 -0
- package/esm2015/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.js.map +1 -0
- package/esm2015/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.metadata.json +1 -0
- package/esm2015/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.ngfactory.js.map +1 -0
- package/esm2015/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.scss.shim.ngstyle.js.map +1 -0
- package/esm2015/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js.map +1 -1
- package/esm2015/lib/interaction/index.js +2 -0
- package/esm2015/lib/interaction/index.js.map +1 -1
- package/esm2015/lib/interaction/index.metadata.json +1 -1
- package/esm2015/lib/interaction/interaction.module.js +16 -3
- package/esm2015/lib/interaction/interaction.module.js.map +1 -1
- package/esm2015/lib/interaction/interaction.module.metadata.json +1 -1
- package/esm2015/lib/interaction/interaction.module.ngfactory.js.map +1 -1
- package/esm2015/lib/interaction/services/interaction.service.js +0 -15
- package/esm2015/lib/interaction/services/interaction.service.js.map +1 -1
- package/esm5/coolon-angular-ui-powerups.js +4 -0
- package/esm5/coolon-angular-ui-powerups.js.map +1 -1
- package/esm5/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
- package/esm5/lib/components/forms/text-input/text-input.component.js +1 -1
- package/esm5/lib/components/forms/text-input/text-input.component.js.map +1 -1
- package/esm5/lib/interaction/components/activity-actions/activity-actions.component.js +58 -0
- package/esm5/lib/interaction/components/activity-actions/activity-actions.component.js.map +1 -0
- package/esm5/lib/interaction/components/activity-actions/activity-actions.component.ngfactory.js.map +1 -0
- package/esm5/lib/interaction/components/activity-actions/activity-actions.component.scss.shim.ngstyle.js.map +1 -0
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js +23 -9
- package/esm5/lib/interaction/components/activity-container/activity-container.component.js.map +1 -1
- package/esm5/lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.js.map +1 -1
- package/esm5/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.js +76 -0
- package/esm5/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.js.map +1 -0
- package/esm5/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.ngfactory.js.map +1 -0
- package/esm5/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.scss.shim.ngstyle.js.map +1 -0
- package/esm5/lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.js.map +1 -1
- package/esm5/lib/interaction/index.js +2 -0
- package/esm5/lib/interaction/index.js.map +1 -1
- package/esm5/lib/interaction/interaction.module.js +16 -3
- package/esm5/lib/interaction/interaction.module.js.map +1 -1
- package/esm5/lib/interaction/interaction.module.ngfactory.js.map +1 -1
- package/esm5/lib/interaction/services/interaction.service.js +0 -15
- package/esm5/lib/interaction/services/interaction.service.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +328 -214
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +372 -243
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/interaction/components/activity-actions/activity-actions.component.d.ts +12 -0
- package/lib/interaction/components/activity-container/activity-container.component.d.ts +2 -1
- package/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.d.ts +17 -0
- package/lib/interaction/index.d.ts +2 -0
- package/package.json +3 -3
|
@@ -21,6 +21,8 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
|
|
|
21
21
|
ActivityContainerComponent.prototype.ngAfterViewInit = function () {
|
|
22
22
|
var _this = this;
|
|
23
23
|
var _a = Dsl.disposeWith(this), chain = _a.chain, observe = _a.observe;
|
|
24
|
+
// using the component directly rather than (animationDone)=.. allows us
|
|
25
|
+
// to keep our callback private.
|
|
24
26
|
observe.valuesFrom(this.tabs.animationDone).subscribe(function () { return _this.onAnimationFinished(); });
|
|
25
27
|
};
|
|
26
28
|
ActivityContainerComponent.prototype.initialise = function (identifier, api) {
|
|
@@ -127,6 +129,12 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
|
|
|
127
129
|
ActivityContainerComponent.prototype.finishAndStartCleanup = function () {
|
|
128
130
|
var _this = this;
|
|
129
131
|
if (!this._deferredCleanUp) {
|
|
132
|
+
// Important:
|
|
133
|
+
// Clear our tabs so the next activity triggers a tab change.
|
|
134
|
+
// Without this our animation done wasn't called when a single
|
|
135
|
+
// new activity followed a single tab activity (since we're tracking
|
|
136
|
+
// by activity index)
|
|
137
|
+
this.activityTabs = [];
|
|
130
138
|
var promise = this.interactionServiceApi.notifyFinished(this);
|
|
131
139
|
this._deferredCleanUp = promise
|
|
132
140
|
.finally(function () {
|
|
@@ -138,26 +146,32 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
|
|
|
138
146
|
ActivityContainerComponent.prototype.launchActivity = function (activityRef) {
|
|
139
147
|
var cleanedTabs = this.activityTabs.filter(function (tab) { return !tab.isComplete(); });
|
|
140
148
|
this.activityTabs = cleanedTabs.concat(activityRef);
|
|
141
|
-
this.
|
|
149
|
+
this.synchroniseSelectedTabIndex();
|
|
142
150
|
};
|
|
143
151
|
ActivityContainerComponent.prototype.activityIndex = function (index, activityRef) {
|
|
144
152
|
return index;
|
|
145
153
|
};
|
|
146
154
|
;
|
|
147
|
-
// @Trace()
|
|
148
155
|
ActivityContainerComponent.prototype.onAnimationFinished = function () {
|
|
149
|
-
this.
|
|
150
|
-
|
|
156
|
+
if (this.onAnimationFinishedJob) {
|
|
157
|
+
this.onAnimationFinishedJob();
|
|
158
|
+
this.onAnimationFinishedJob = undefined;
|
|
159
|
+
}
|
|
151
160
|
};
|
|
152
161
|
/**
|
|
153
|
-
* Synchronises the selected tab index.
|
|
162
|
+
* Synchronises the selected tab index.
|
|
154
163
|
*/
|
|
155
|
-
// @Trace()
|
|
156
164
|
ActivityContainerComponent.prototype.synchroniseSelectedTabIndex = function () {
|
|
165
|
+
var _this = this;
|
|
157
166
|
var previousIndex = this.tabs.selectedIndex;
|
|
158
167
|
var newIndex = this.getActiveActivityCount() - 1;
|
|
159
|
-
|
|
160
|
-
|
|
168
|
+
if (previousIndex !== newIndex) {
|
|
169
|
+
this.tabs.selectedIndex = newIndex;
|
|
170
|
+
this.onAnimationFinishedJob = function () {
|
|
171
|
+
_this.getSelectedOutlet().component.onActivityReady();
|
|
172
|
+
_this.activityTabs = _this.activityTabs.filter(function (tab) { return !tab.isComplete(); });
|
|
173
|
+
};
|
|
174
|
+
}
|
|
161
175
|
};
|
|
162
176
|
ActivityContainerComponent.prototype.getSelectedOutlet = function () {
|
|
163
177
|
return this.activityOutlets.toArray()[this.tabs.selectedIndex];
|
|
@@ -194,7 +208,7 @@ var ActivityContainerComponent = /** @class */ (function (_super) {
|
|
|
194
208
|
ActivityContainerComponent = __decorate([
|
|
195
209
|
Component({
|
|
196
210
|
selector: 'aup-activity-container',
|
|
197
|
-
template: "<mat-tab-group #tabs no-tab-header
|
|
211
|
+
template: "<mat-tab-group #tabs no-tab-header\n [dynamicHeight]=\"dynamicHeight\"\n [class.full-height-tabs]=\"!dynamicHeight\">\n <mat-tab *ngFor=\"let tab of activityTabs; trackBy: activityIndex\" >\n <aup-activity-outlet [nestedInteractionContext]=\"this\" [activityRef]=\"tab\"></aup-activity-outlet>\n </mat-tab>\n</mat-tab-group>\n",
|
|
198
212
|
styles: [":host{display:flex;flex-direction:column}mat-tab-group{flex:1}"]
|
|
199
213
|
}),
|
|
200
214
|
__metadata("design:paramtypes", [])
|
package/esm5/lib/interaction/components/activity-container/activity-container.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-container.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/components/activity-container/activity-container.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAiB,SAAS,EAAE,KAAK,EAAU,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,MAAM,EAA6B,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAc,MAAM,gBAAgB,CAAC;AAC7G,OAAO,EAAE,IAAI,E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AA2B,EAAE,CAAC;QACrC,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;IAnLD;QADC,KAAK,EAAE;;qEACc;IAGtB;QADC,SAAS,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;kCAC9B,WAAW;4DAAC;IAGlB;QADC,YAAY,CAAC,uBAAuB,CAAC;kCACrB,SAAS;uEAAyC;IAoDnE;QADC,KAAK,EAAE;;;;6DAMP;IAlEU,0BAA0B;QALtC,SAAS,CAAC;YACT,QAAQ,EAAE,wBAAwB;YAClC,mVAAkD;;SAEnD,CAAC;;OACW,0BAA0B,CAuLtC;IAAD,iCAAC;CAAA,AAvLD,CAAyD,0BAA0B,GAuLlF;SAvLY,0BAA0B","sourcesContent":["import { AfterViewInit, Component, Input, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core';\nimport { MatTabGroup } from '@angular/material/tabs';\nimport { assert, Constructable, Disposable, Dsl, GarbageCollector, Trace, ValueModel } from '@coolon/pectin';\nimport { lang } from '@coolon/typescript-utilities';\nimport _ from 'lodash';\nimport { AbstractInteractionContext } from '../../abstract-interaction-context';\nimport { Activity } from '../../activity';\nimport { ActivityRef } from '../../activity-ref';\nimport { InteractionService } from '../../services/interaction.service';\nimport { ActivityOutletComponent } from './activity-outlet/activity-outlet.component';\n\n@Component({\n selector: 'aup-activity-container',\n templateUrl: './activity-container.component.html',\n styleUrls: ['./activity-container.component.scss']\n})\nexport class ActivityContainerComponent<D, R, E> extends AbstractInteractionContext implements OnInit, AfterViewInit {\n\n @Input()\n dynamicHeight = false;\n\n @ViewChild('tabs', { static: true })\n tabs: MatTabGroup;\n\n @ViewChildren(ActivityOutletComponent)\n activityOutlets: QueryList<ActivityOutletComponent<any, any, any>>;\n\n activityTabs: ActivityRef<any, any, any>[] = [];\n\n private _identifier: string;\n private _deferredCleanUp: Promise<any>;\n\n private interactionServiceApi: InteractionService.Api;\n\n private garbage = new GarbageCollector();\n private syncSelectedTabTimeout: any;\n\n constructor() {\n super();\n }\n\n ngOnInit() {\n }\n\n ngAfterViewInit(): void {\n const { chain, observe } = Dsl.disposeWith(this);\n observe.valuesFrom(this.tabs.animationDone).subscribe(() => this.onAnimationFinished());\n }\n\n initialise(identifier: string, api: InteractionService.Api) {\n assert.isFalsey(this.isInitialised());\n assert.notNil(identifier);\n assert.notNil(api);\n this._identifier = identifier;\n this.interactionServiceApi = api;\n }\n\n get identifier() {\n return this._identifier;\n }\n\n isInitialised() {\n return !!this.identifier;\n }\n\n /**\n * Returns true if an activity is currently running.\n */\n isActive(): boolean {\n return this.getActiveActivityCount() > 0;\n }\n\n registerDisposable<T extends Disposable>(disposable: T): T {\n return this.garbage.registerDisposable(disposable);\n }\n\n @Trace()\n dispose(): void {\n // TODO: think about auto cancelling any outstanding activity on dispose.\n // See NavigationState.Navigating for a use-case.\n assert.isFalsey(this.isActive());\n this.garbage.dispose();\n }\n\n getActiveActivityRef(): ActivityRef<any, any, any> {\n if (!this.isActive()) {\n lang.illegalState('no activity in progress');\n }\n return _.findLast(this.activityTabs, tab => !tab.isComplete());\n }\n\n /**\n * Cancels the current activity and returns true the context is no longer active, false if\n * there is still another activity running.\n */\n // @Trace()\n async cancelActiveActivity(): Promise<boolean> {\n const activity = this.getActiveActivityRef();\n activity.cancel();\n if (this.isCleaningUp()) {\n return this.waitForInteractionContextCleanupToFinish();\n } else {\n return !this.isActive();\n }\n }\n\n // TODO: this handling of multiple nested activities is only used by the activity component and is not a general case.\n // @Trace()\n protected createAndLaunchActivity<D1, R1, E1>(activityType: Constructable<Activity<D1, R1, E1>>, data: D1, disableClose: boolean): Promise<R1> {\n assert.isTruthy(this.isInitialised()); // make sure we've been initialised\n const activityRef = new ActivityRef<D1, R1, E1>(activityType, data, () => {\n const activeActivityCount = this.getActiveActivityCount() > 0;\n if (activeActivityCount) {\n this.triggerTabSynchronisation();\n } else {\n this.finishAndStartCleanup();\n }\n });\n this.launchActivity(activityRef);\n // if this is the first activity let the interaction service know.\n if (this.activityTabs.length === 1) {\n // console.log('Now active!!!');\n this.interactionServiceApi.notifyActive(this);\n }\n return activityRef.activityResult;\n }\n\n private getActiveActivityCount(): number {\n return this.activityTabs.filter(ref => !ref.isComplete()).length;\n }\n\n /**\n * Checks if this interaction context has finished an is in the process of waiting\n * for all the infrastructure (including route updates) to be completed.\n */\n isCleaningUp(): boolean {\n return !!this._deferredCleanUp;\n }\n\n async waitForInteractionContextCleanupToFinish(): Promise<any> {\n return this._deferredCleanUp ?\n this._deferredCleanUp :\n true;\n }\n\n // @Trace()\n private finishAndStartCleanup(): void {\n if (!this._deferredCleanUp) {\n const promise = this.interactionServiceApi.notifyFinished(this);\n this._deferredCleanUp = promise\n .finally(() => {\n this._deferredCleanUp = null;\n });\n }\n }\n\n// @Trace()\n launchActivity<D1, R1, E1>(activityRef: ActivityRef<D1, R1, E1>) {\n const cleanedTabs = this.activityTabs.filter(tab => !tab.isComplete());\n this.activityTabs = cleanedTabs.concat(activityRef);\n this.tabs.selectedIndex = this.activityTabs.length;\n }\n\n activityIndex(index: number, activityRef: ActivityRef<any, any, any>) {\n return index;\n };\n\n\n // @Trace()\n private onAnimationFinished() {\n this.getSelectedOutlet().component.onActivityReady();\n this.activityTabs = this.activityTabs.filter(tab => !tab.isComplete());\n }\n\n /**\n * Synchronises the selected tab index. Returns true if there was no change to the selected index.\n */\n // @Trace()\n private synchroniseSelectedTabIndex(): boolean {\n const previousIndex = this.tabs.selectedIndex;\n const newIndex = this.getActiveActivityCount() - 1;\n this.tabs.selectedIndex = newIndex;\n return previousIndex === newIndex;\n }\n\n private getSelectedOutlet() {\n return this.activityOutlets.toArray()[this.tabs.selectedIndex];\n }\n\n // @Trace()\n private triggerTabSynchronisation() {\n if (this.syncSelectedTabTimeout) {\n clearTimeout(this.syncSelectedTabTimeout);\n }\n this.syncSelectedTabTimeout = setTimeout(() => {\n this.syncSelectedTabTimeout = null;\n this.synchroniseSelectedTabIndex();\n }, 75);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"activity-container.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/components/activity-container/activity-container.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAiB,SAAS,EAAE,KAAK,EAAU,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC5G,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,MAAM,EAA6B,GAAG,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACjG,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AAOtF;IAAyD,8CAA0B;IAsBjF;QAAA,YACE,iBAAO,SACR;QArBD,mBAAa,GAAG,KAAK,CAAC;QAQtB,kBAAY,GAAiC,EAAE,CAAC;QAOxC,aAAO,GAAG,IAAI,gBAAgB,EAAE,CAAC;;IAMzC,CAAC;IAED,6CAAQ,GAAR;IACA,CAAC;IAED,oDAAe,GAAf;QAAA,iBAKC;QAJO,IAAA,0BAA0C,EAAxC,gBAAK,EAAE,oBAAiC,CAAC;QACjD,wEAAwE;QACxE,gCAAgC;QAChC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,SAAS,CAAC,cAAM,OAAA,KAAI,CAAC,mBAAmB,EAAE,EAA1B,CAA0B,CAAC,CAAC;IAC1F,CAAC;IAED,+CAAU,GAAV,UAAW,UAAkB,EAAE,GAA2B;QACxD,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QACtC,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC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sBAAsB,GAAG;gBAC5B,KAAI,CAAC,iBAAiB,EAAE,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC;gBACrD,KAAI,CAAC,YAAY,GAAG,KAAI,CAAC,YAAY,CAAC,MAAM,CAAC,UAAA,GAAG,IAAI,OAAA,CAAC,GAAG,CAAC,UAAU,EAAE,EAAjB,CAAiB,CAAC,CAAC;YACzE,CAAC,CAAA;SACF;IACH,CAAC;IAEO,sDAAiB,GAAzB;QACE,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACjE,CAAC;IAED,WAAW;IACH,8DAAyB,GAAjC;QAAA,iBAQC;QAPC,IAAI,IAAI,CAAC,sBAAsB,EAAE;YAC/B,YAAY,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;SAC3C;QACD,IAAI,CAAC,sBAAsB,GAAG,UAAU,CAAC;YACvC,KAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC;YACnC,KAAI,CAAC,2BAA2B,EAAE,CAAC;QACrC,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;IAhMD;QADC,KAAK,EAAE;;qEACc;IAGtB;QADC,SAAS,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;kCAC9B,WAAW;4DAAC;IAGlB;QADC,YAAY,CAAC,uBAAuB,CAAC;kCACrB,SAAS;uEAAyC;IAuDnE;QADC,KAAK,EAAE;;;;6DAMP;IArEU,0BAA0B;QALtC,SAAS,CAAC;YACT,QAAQ,EAAE,wBAAwB;YAClC,mXAAkD;;SAEnD,CAAC;;OACW,0BAA0B,CAoMtC;IAAD,iCAAC;CAAA,AApMD,CAAyD,0BAA0B,GAoMlF;SApMY,0BAA0B","sourcesContent":["import { AfterViewInit, Component, Input, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core';\nimport { MatTabGroup } from '@angular/material/tabs';\nimport { assert, Constructable, Disposable, Dsl, GarbageCollector, Trace } from '@coolon/pectin';\nimport { lang } from '@coolon/typescript-utilities';\nimport _ from 'lodash';\nimport { AbstractInteractionContext } from '../../abstract-interaction-context';\nimport { Activity } from '../../activity';\nimport { ActivityRef } from '../../activity-ref';\nimport { InteractionService } from '../../services/interaction.service';\nimport { ActivityOutletComponent } from './activity-outlet/activity-outlet.component';\n\n@Component({\n selector: 'aup-activity-container',\n templateUrl: './activity-container.component.html',\n styleUrls: ['./activity-container.component.scss']\n})\nexport class ActivityContainerComponent<D, R, E> extends AbstractInteractionContext implements OnInit, AfterViewInit {\n\n @Input()\n dynamicHeight = false;\n\n @ViewChild('tabs', { static: true })\n tabs: MatTabGroup;\n\n @ViewChildren(ActivityOutletComponent)\n activityOutlets: QueryList<ActivityOutletComponent<any, any, any>>;\n\n activityTabs: ActivityRef<any, any, any>[] = [];\n\n private _identifier: string;\n private _deferredCleanUp: Promise<any>;\n\n private interactionServiceApi: InteractionService.Api;\n\n private garbage = new GarbageCollector();\n private syncSelectedTabTimeout: any;\n private onAnimationFinishedJob: () => void;\n\n constructor() {\n super();\n }\n\n ngOnInit() {\n }\n\n ngAfterViewInit(): void {\n const { chain, observe } = Dsl.disposeWith(this);\n // using the component directly rather than (animationDone)=.. allows us\n // to keep our callback private.\n observe.valuesFrom(this.tabs.animationDone).subscribe(() => this.onAnimationFinished());\n }\n\n initialise(identifier: string, api: InteractionService.Api) {\n assert.isFalsey(this.isInitialised());\n assert.notNil(identifier);\n assert.notNil(api);\n this._identifier = identifier;\n this.interactionServiceApi = api;\n }\n\n get identifier() {\n return this._identifier;\n }\n\n isInitialised() {\n return !!this.identifier;\n }\n\n /**\n * Returns true if an activity is currently running.\n */\n isActive(): boolean {\n return this.getActiveActivityCount() > 0;\n }\n\n registerDisposable<T extends Disposable>(disposable: T): T {\n return this.garbage.registerDisposable(disposable);\n }\n\n @Trace()\n dispose(): void {\n // TODO: think about auto cancelling any outstanding activity on dispose.\n // See NavigationState.Navigating for a use-case.\n assert.isFalsey(this.isActive());\n this.garbage.dispose();\n }\n\n getActiveActivityRef(): ActivityRef<any, any, any> {\n if (!this.isActive()) {\n lang.illegalState('no activity in progress');\n }\n return _.findLast(this.activityTabs, tab => !tab.isComplete());\n }\n\n /**\n * Cancels the current activity and returns true the context is no longer active, false if\n * there is still another activity running.\n */\n // @Trace()\n async cancelActiveActivity(): Promise<boolean> {\n const activity = this.getActiveActivityRef();\n activity.cancel();\n if (this.isCleaningUp()) {\n return this.waitForInteractionContextCleanupToFinish();\n } else {\n return !this.isActive();\n }\n }\n\n // TODO: this handling of multiple nested activities is only used by the activity component and is not a general case.\n // @Trace()\n protected createAndLaunchActivity<D1, R1, E1>(activityType: Constructable<Activity<D1, R1, E1>>, data: D1, disableClose: boolean): Promise<R1> {\n assert.isTruthy(this.isInitialised()); // make sure we've been initialised\n const activityRef = new ActivityRef<D1, R1, E1>(activityType, data, () => {\n const activeActivityCount = this.getActiveActivityCount() > 0;\n if (activeActivityCount) {\n this.triggerTabSynchronisation();\n } else {\n this.finishAndStartCleanup();\n }\n });\n this.launchActivity(activityRef);\n // if this is the first activity let the interaction service know.\n if (this.activityTabs.length === 1) {\n // console.log('Now active!!!');\n this.interactionServiceApi.notifyActive(this);\n }\n return activityRef.activityResult;\n }\n\n private getActiveActivityCount(): number {\n return this.activityTabs.filter(ref => !ref.isComplete()).length;\n }\n\n /**\n * Checks if this interaction context has finished an is in the process of waiting\n * for all the infrastructure (including route updates) to be completed.\n */\n isCleaningUp(): boolean {\n return !!this._deferredCleanUp;\n }\n\n async waitForInteractionContextCleanupToFinish(): Promise<any> {\n return this._deferredCleanUp ?\n this._deferredCleanUp :\n true;\n }\n\n // @Trace()\n private finishAndStartCleanup(): void {\n if (!this._deferredCleanUp) {\n // Important:\n // Clear our tabs so the next activity triggers a tab change.\n // Without this our animation done wasn't called when a single\n // new activity followed a single tab activity (since we're tracking\n // by activity index)\n this.activityTabs = [];\n const promise = this.interactionServiceApi.notifyFinished(this);\n this._deferredCleanUp = promise\n .finally(() => {\n this._deferredCleanUp = null;\n });\n }\n }\n\n// @Trace()\n launchActivity<D1, R1, E1>(activityRef: ActivityRef<D1, R1, E1>) {\n const cleanedTabs = this.activityTabs.filter(tab => !tab.isComplete());\n this.activityTabs = cleanedTabs.concat(activityRef);\n this.synchroniseSelectedTabIndex();\n }\n\n activityIndex(index: number, activityRef: ActivityRef<any, any, any>) {\n return index;\n };\n\n private onAnimationFinished() {\n if (this.onAnimationFinishedJob) {\n this.onAnimationFinishedJob();\n this.onAnimationFinishedJob = undefined;\n }\n }\n\n /**\n * Synchronises the selected tab index.\n */\n private synchroniseSelectedTabIndex(): void {\n const previousIndex = this.tabs.selectedIndex;\n const newIndex = this.getActiveActivityCount() - 1;\n if (previousIndex !== newIndex) {\n this.tabs.selectedIndex = newIndex;\n this.onAnimationFinishedJob = () => {\n this.getSelectedOutlet().component.onActivityReady();\n this.activityTabs = this.activityTabs.filter(tab => !tab.isComplete());\n }\n }\n }\n\n private getSelectedOutlet() {\n return this.activityOutlets.toArray()[this.tabs.selectedIndex];\n }\n\n // @Trace()\n private triggerTabSynchronisation() {\n if (this.syncSelectedTabTimeout) {\n clearTimeout(this.syncSelectedTabTimeout);\n }\n this.syncSelectedTabTimeout = setTimeout(() => {\n this.syncSelectedTabTimeout = null;\n this.synchroniseSelectedTabIndex();\n }, 75);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-outlet.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,wBAAwB,EACxB,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,MAAM,EACN,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAY,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EA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AAC,wBAAwB,CAAC,CAAC;IAC5G,CAAC;IAED,sBAAI,8CAAS;aAAb;YACE,OAAO,IAAI,CAAC,oBAAoB,CAAC,QAAQ,CAAC;QAC5C,CAAC;;;OAAA;;gBAzBmC,wBAAwB;gBAChC,gBAAgB;gBACxB,QAAQ;;IApB5B;QADC,KAAK,EAAE;;6EACqC;IAK7C;QADC,KAAK,EAAE;kCACqB,WAAW;yCAAX,WAAW;8DAMvC;IAhBU,uBAAuB;QALnC,SAAS,CAAC;YACT,QAAQ,EAAE,qBAAqB;YAC/B,QAAQ,EAAE,EAAE;;SAEb,CAAC;yCAwBoC,wBAAwB;YAChC,gBAAgB;YACxB,QAAQ;OAzBjB,uBAAuB,CAkDnC;IAAD,8BAAC;CAAA,AAlDD,IAkDC;SAlDY,uBAAuB","sourcesContent":["import {\n Component,\n ComponentFactoryResolver,\n ComponentRef,\n Injector,\n Input,\n OnInit,\n ViewContainerRef\n} from '@angular/core';\nimport { assert } from '@coolon/pectin';\nimport { lang } from '@coolon/typescript-utilities';\nimport { Activity, ACTIVITY_DATA } from '../../../activity';\nimport { ActivityRef } from '../../../activity-ref';\nimport { InteractionContext } from '../../../interaction-context';\n\n/**\n * ActivityOutletComponent creates and displays an activity and delegates the interaction context functionality to an\n * external service.\n */\n@Component({\n selector: 'aup-activity-outlet',\n template: '',\n styleUrls: ['./activity-outlet.component.scss']\n})\nexport class ActivityOutletComponent<D, R, E> implements OnInit {\n\n private activityComponentRef: ComponentRef<Activity<D, R, E>>;\n\n @Input()\n nestedInteractionContext: InteractionContext;\n\n private _activityRef: ActivityRef<D, R, E>;\n\n @Input()\n set activityRef(activityRef: ActivityRef<D, R, E>) {\n if (this.activityRef && !this.activityRef.isComplete()) {\n lang.illegalState(\"changing activity before previous one has completed\")\n }\n this._activityRef = activityRef;\n this.loadActivity(activityRef);\n };\n\n get activityRef(): ActivityRef<D, R, E> {\n return this._activityRef;\n }\n\n constructor(\n private componentFactoryResolver: ComponentFactoryResolver,\n private viewContainerRef: ViewContainerRef,\n private injector: Injector\n ) {\n }\n\n ngOnInit() {\n }\n\n loadActivity(activityRef: ActivityRef<D, R, E>) {\n const injector = Injector.create({\n providers: [\n { provide: ACTIVITY_DATA, useValue: activityRef.activityData }\n ],\n parent: this.injector\n });\n const componentFactory = this.componentFactoryResolver.resolveComponentFactory(activityRef.activityClass);\n this.viewContainerRef.clear();\n // console.log(`creating component -> ${activityRef.activityClass.name}`);\n this.activityComponentRef = this.viewContainerRef.createComponent(componentFactory, 0, injector);\n this.activityRef.notifyActivityCreated(this.activityComponentRef.instance, this.nestedInteractionContext);\n }\n\n get component(): Activity<D, R, E> {\n return this.activityComponentRef.instance;\n }\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"activity-outlet.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/components/activity-container/activity-outlet/activity-outlet.component.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,EACT,wBAAwB,EACxB,YAAY,EACZ,QAAQ,EACR,KAAK,EACL,MAAM,EACN,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAY,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD;;;GAGG;AAMH;IAsBE,iCACU,wBAAkD,EAClD,gBAAkC,EAClC,QAAkB;QAFlB,6BAAwB,GAAxB,wBAAwB,CAA0B;QAClD,qBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,aAAQ,GAAR,QAAQ,CAAU;IAE5B,CAAC;IAjBD,sBAAI,gDAAW;aAQf;YACE,OAAO,IAAI,CAAC,YAAY,CAAC;QAC3B,CAAC;aAVD,UAAgB,WAAiC;YAC/C,IAAI,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,UAAU,EAAE,EAAE;gBACtD,IAAI,CAAC,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B,uBAAuB,CAkDnC;IAAD,8BAAC;CAAA,AAlDD,IAkDC;SAlDY,uBAAuB","sourcesContent":["import {\n Component,\n ComponentFactoryResolver,\n ComponentRef,\n Injector,\n Input,\n OnInit,\n ViewContainerRef\n} from '@angular/core';\nimport { assert, Trace } from '@coolon/pectin';\nimport { lang } from '@coolon/typescript-utilities';\nimport { Activity, ACTIVITY_DATA } from '../../../activity';\nimport { ActivityRef } from '../../../activity-ref';\nimport { InteractionContext } from '../../../interaction-context';\n\n/**\n * ActivityOutletComponent creates and displays an activity and delegates the interaction context functionality to an\n * external service.\n */\n@Component({\n selector: 'aup-activity-outlet',\n template: '',\n styleUrls: ['./activity-outlet.component.scss']\n})\nexport class ActivityOutletComponent<D, R, E> implements OnInit {\n\n private activityComponentRef: ComponentRef<Activity<D, R, E>>;\n\n @Input()\n nestedInteractionContext: InteractionContext;\n\n private _activityRef: ActivityRef<D, R, E>;\n\n @Input()\n set activityRef(activityRef: ActivityRef<D, R, E>) {\n if (this.activityRef && !this.activityRef.isComplete()) {\n lang.illegalState(\"changing activity before previous one has completed\")\n }\n this._activityRef = activityRef;\n this.loadActivity(activityRef);\n };\n\n get activityRef(): ActivityRef<D, R, E> {\n return this._activityRef;\n }\n\n constructor(\n private componentFactoryResolver: ComponentFactoryResolver,\n private viewContainerRef: ViewContainerRef,\n private injector: Injector\n ) {\n }\n\n ngOnInit() {\n }\n\n loadActivity(activityRef: ActivityRef<D, R, E>) {\n const injector = Injector.create({\n providers: [\n { provide: ACTIVITY_DATA, useValue: activityRef.activityData }\n ],\n parent: this.injector\n });\n const componentFactory = this.componentFactoryResolver.resolveComponentFactory(activityRef.activityClass);\n this.viewContainerRef.clear();\n // console.log(`creating component -> ${activityRef.activityClass.name}`);\n this.activityComponentRef = this.viewContainerRef.createComponent(componentFactory, 0, injector);\n this.activityRef.notifyActivityCreated(this.activityComponentRef.instance, this.nestedInteractionContext);\n }\n\n get component(): Activity<D, R, E> {\n return this.activityComponentRef.instance;\n }\n\n}\n"]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { __decorate, __extends, __metadata } from "tslib";
|
|
2
|
+
import { Component, HostBinding, Input, ViewChild } from '@angular/core';
|
|
3
|
+
import { Command, TrackExternal } from '@coolon/pectin';
|
|
4
|
+
import { InPlaceInteractionContextComponent } from '../..';
|
|
5
|
+
import { DisposableComponent } from '../../../components';
|
|
6
|
+
var AddItemInteractionContextComponent = /** @class */ (function (_super) {
|
|
7
|
+
__extends(AddItemInteractionContextComponent, _super);
|
|
8
|
+
function AddItemInteractionContextComponent() {
|
|
9
|
+
var _this = _super.call(this) || this;
|
|
10
|
+
_this.tabindex = 0;
|
|
11
|
+
_this.clickCommand = Command.create(function (context) {
|
|
12
|
+
if (_this.activityClass) {
|
|
13
|
+
_this.startActivity(_this.activityClass, _this.activityData).catch(function (e) {
|
|
14
|
+
// don't care.
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
_this.addCommand.withContext(context).execute();
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return _this;
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(AddItemInteractionContextComponent.prototype, "active", {
|
|
24
|
+
get: function () {
|
|
25
|
+
return this.interactionContext ? this.interactionContext.isActive() : false;
|
|
26
|
+
},
|
|
27
|
+
enumerable: true,
|
|
28
|
+
configurable: true
|
|
29
|
+
});
|
|
30
|
+
AddItemInteractionContextComponent.prototype.startActivity = function (activityType, data) {
|
|
31
|
+
return this.interactionContext.startActivity(activityType, data);
|
|
32
|
+
};
|
|
33
|
+
AddItemInteractionContextComponent.prototype.ngOnInit = function () {
|
|
34
|
+
};
|
|
35
|
+
__decorate([
|
|
36
|
+
Input(),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], AddItemInteractionContextComponent.prototype, "label", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
Input(),
|
|
41
|
+
__metadata("design:type", Object)
|
|
42
|
+
], AddItemInteractionContextComponent.prototype, "activityClass", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
Input(),
|
|
45
|
+
__metadata("design:type", Object)
|
|
46
|
+
], AddItemInteractionContextComponent.prototype, "activityData", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
Input(),
|
|
49
|
+
TrackExternal(),
|
|
50
|
+
__metadata("design:type", Command)
|
|
51
|
+
], AddItemInteractionContextComponent.prototype, "addCommand", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
ViewChild(InPlaceInteractionContextComponent),
|
|
54
|
+
__metadata("design:type", InPlaceInteractionContextComponent)
|
|
55
|
+
], AddItemInteractionContextComponent.prototype, "interactionContext", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
HostBinding('class.interaction-active'),
|
|
58
|
+
__metadata("design:type", Boolean),
|
|
59
|
+
__metadata("design:paramtypes", [])
|
|
60
|
+
], AddItemInteractionContextComponent.prototype, "active", null);
|
|
61
|
+
__decorate([
|
|
62
|
+
HostBinding('tabindex'),
|
|
63
|
+
__metadata("design:type", Object)
|
|
64
|
+
], AddItemInteractionContextComponent.prototype, "tabindex", void 0);
|
|
65
|
+
AddItemInteractionContextComponent = __decorate([
|
|
66
|
+
Component({
|
|
67
|
+
selector: 'aup-add-item-interaction-context',
|
|
68
|
+
template: "<aup-in-place-interaction-context #interactionContext [animateFirstActivity]=\"false\">\n <a part=\"link\" class=\"link\" [pectinCommand]=\"clickCommand\"><mat-icon>add</mat-icon> {{label}}</a>\n</aup-in-place-interaction-context>\n",
|
|
69
|
+
styles: [":host{--def-link-color:var(--link-color, currentColor);--def-link-backgound:var(--link-background, rgba(0, 0, 0, 0.05));--def-link-border-radius:var(--link-border-radius, 4px);--def-link-padding:var(--link-padding, calc(var(--aup-default-padding) / 2));display:flex;flex-direction:column;border-radius:var(--def-link-border-radius);box-sizing:border-box;outline:0}:host:hover{--link-background:rgba(0,0,0,0.1)}aup-in-place-interaction-context{border-radius:var(--def-link-border-radius)}a.link{display:flex;flex-direction:row;align-items:center;border-radius:var(--def-link-border-radius);color:var(--def-link-color);background:var(--def-link-backgound);padding:var(--def-link-padding);cursor:pointer;text-decoration:none}a.link mat-icon{margin-right:8px}"]
|
|
70
|
+
}),
|
|
71
|
+
__metadata("design:paramtypes", [])
|
|
72
|
+
], AddItemInteractionContextComponent);
|
|
73
|
+
return AddItemInteractionContextComponent;
|
|
74
|
+
}(DisposableComponent));
|
|
75
|
+
export { AddItemInteractionContextComponent };
|
|
76
|
+
//# sourceMappingURL=add-item-interaction-context.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-item-interaction-context.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAU,SAAS,EAAqB,MAAM,eAAe,CAAC;AACpG,OAAO,EAAE,OAAO,EAAiB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAY,kCAAkC,EAAE,MAAM,OAAO,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAO1D;IAAwD,sDAAmB;IA4BzE;QAAA,YACE,iBAAO,SAWR;QAdQ,cAAQ,GAAG,CAAC,CAAC;QAKpB,KAAI,CAAC,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,UAAC,OAAO;YACzC,IAAI,KAAI,CAAC,aAAa,EAAE;gBACtB,KAAI,CAAC,aAAa,CAAC,KAAI,CAAC,aAAa,EAAE,KAAI,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,UAAA,CAAC;oBACjE,eAAe;gBACf,CAAC,CAAC,CAAC;aACJ;iBAAM;gBACL,KAAI,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC;aAChD;QACH,CAAC,CAAC,CAAC;;IACL,CAAC;IAnBD,sBAAW,sDAAM;aAAjB;YACE,OAAO,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;QAC9E,CAAC;;;OAAA;IAmBD,0DAAa,GAAb,UAAuB,YAA8C,EAAE,IAAQ;QAC7E,OAAO,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IACnE,CAAC;IAED,qDAAQ,GAAR;IACA,CAAC;IA5CD;QADC,KAAK,EAAE;;qEACM;IAGd;QADC,KAAK,EAAE;;6EAC8C;IAGtD;QADC,KAAK,EAAE;;4EACU;IAIlB;QAFC,KAAK,EAAE;QACP,aAAa,EAAE;kCACJ,OAAO;0EAAM;IAGzB;QADC,SAAS,CAAC,kCAAkC,CAAC;kCAChB,kCAAkC;kFAAgB;IAKhF;QADC,WAAW,CAAC,0BAA0B,CAAC;;;oEAGvC;IAGD;QADC,WAAW,CAAC,UAAU,CAAC;;wEACF;IA1BX,kCAAkC;QAL9C,SAAS,CAAC;YACT,QAAQ,EAAE,kCAAkC;YAC5C,uPAA4D;;SAE7D,CAAC;;OACW,kCAAkC,CAkD9C;IAAD,yCAAC;CAAA,AAlDD,CAAwD,mBAAmB,GAkD1E;SAlDY,kCAAkC","sourcesContent":["import { Component, HostBinding, Input, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';\nimport { Command, Constructable, TrackExternal } from '@coolon/pectin';\nimport { Activity, InPlaceInteractionContextComponent } from '../..';\nimport { DisposableComponent } from '../../../components';\n\n@Component({\n selector: 'aup-add-item-interaction-context',\n templateUrl: './add-item-interaction-context.component.html',\n styleUrls: ['./add-item-interaction-context.component.scss']\n})\nexport class AddItemInteractionContextComponent extends DisposableComponent implements OnInit {\n\n @Input()\n label: string;\n\n @Input()\n activityClass: Constructable<Activity<any, any, any>>;\n\n @Input()\n activityData: any;\n\n @Input()\n @TrackExternal()\n addCommand: Command<any>;\n\n @ViewChild(InPlaceInteractionContextComponent)\n protected interactionContext: InPlaceInteractionContextComponent<any, any, any>;\n\n readonly clickCommand: Command<void>;\n\n @HostBinding('class.interaction-active')\n public get active(): boolean {\n return this.interactionContext ? this.interactionContext.isActive() : false;\n }\n\n @HostBinding('tabindex')\n readonly tabindex = 0;\n\n constructor() {\n super();\n\n this.clickCommand = Command.create((context) => {\n if (this.activityClass) {\n this.startActivity(this.activityClass, this.activityData).catch(e => {\n // don't care.\n });\n } else {\n this.addCommand.withContext(context).execute();\n }\n });\n }\n\n startActivity<D, R, E>(activityType: Constructable<Activity<D, R, E>>, data?: D): Promise<R> {\n return this.interactionContext.startActivity(activityType, data);\n }\n\n ngOnInit() {\n }\n\n\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-item-interaction-context.component.ngfactory.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-item-interaction-context.component.scss.shim.ngstyle.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.scss.shim.ngstyle.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\ni0.ComponentFactory;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"in-place-interaction-context.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAiB,SAAS,
|
|
1
|
+
{"version":3,"file":"in-place-interaction-context.component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/components/inplace-interaction-context/in-place-interaction-context.component.ts"],"names":[],"mappings":";AAAA,OAAO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;IAED,oDAAO,GAAP,UAAQ,OAAgB;QACtB,OAAO,IAAI,CAAC,0BAA0B,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED,4DAAe,GAAf,UAAgB,OAAgB;QAC9B,OAAO,IAAI,CAAC,0BAA0B,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAClE,CAAC;IAED,wDAAW,GAAX,UAAwB,OAAgB,EAAE,YAAiD,EAAE,IAAS;QACpG,OAAO,IAAI,CAAC,0BAA0B,CAAC,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC5E,CAAC;IAED,qDAAQ,GAAR;QACE,OAAO,IAAI,CAAC,0BAA0B,CAAC,QAAQ,EAAE,CAAC;IACpD,CAAC;IAED,0DAAa,GAAb,UAA0B,YAAiD,EAAE,IAAS;QACpF,OAAO,IAAI,CAAC,0BAA0B,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IAC3E,CAAC;;gBA1CwC,kBAAkB;gDAAG,MAAM,SAAC,eAAe,cAAG,QAAQ;;IAb/F;QADC,SAAS,CAAC,mBAAmB,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;kCACrB,0BAA0B;0FAAgB;IAOtE;QADC,KAAK,EAAE;;oFACoB;IAVjB,kCAAkC;QAL9C,SAAS,CAAC;YACT,QAAQ,EAAE,kCAAkC;YAC5C,oXAA4D;;SAE7D,CAAC;QAiB8D,WAAA,MAAM,CAAC,eAAe,CAAC,CAAA,EAAE,WAAA,QAAQ,EAAE,CAAA;yCAAxD,kBAAkB;OAhBhD,kCAAkC,CA6D9C;IAAD,yCAAC;CAAA,AA7DD,CAAiE,mBAAmB,GA6DnF;SA7DY,kCAAkC","sourcesContent":["import { AfterViewInit, Component, Inject, Input, Optional, ViewChild, ViewEncapsulation } from '@angular/core';\nimport { MAT_TABS_CONFIG, MatTabsConfig } from '@angular/material/tabs';\nimport { Constructable } from '@coolon/pectin';\nimport { DisposableComponent } from '../../../components/disposable-component';\nimport { Activity } from '../../activity';\nimport { Alert } from '../../alert';\nimport { Confirm } from '../../confirm';\nimport { InteractionContext } from '../../interaction-context';\nimport { InteractionService } from '../../services/interaction.service';\nimport { ActivityContainerComponent } from '../activity-container/activity-container.component';\n\n@Component({\n selector: 'aup-in-place-interaction-context',\n templateUrl: './in-place-interaction-context.component.html',\n styleUrls: ['./in-place-interaction-context.component.scss'],\n})\nexport class InPlaceInteractionContextComponent<D, R, E> extends DisposableComponent implements InteractionContext, AfterViewInit {\n\n @ViewChild('activityContainer', { static: true })\n activityContainerComponent: ActivityContainerComponent<any, any, any>;\n\n /**\n * If true then the first startActivity call will slide the activity into view. If false\n * the activity will replace the existing content immediately.\n */\n @Input()\n animateFirstActivity = true;\n\n get animationDuration():string {\n return this.animateFirstActivity ? (this.tabConfig?.animationDuration || '500ms') : \"0ms\";\n }\n\n constructor(readonly interactionService: InteractionService, @Inject(MAT_TABS_CONFIG) @Optional() private readonly tabConfig: MatTabsConfig) {\n super();\n }\n\n ngAfterViewInit(): void {\n this.interactionService.registerInplaceInteractionContext(this);\n }\n\n initialise(id: string, api: InteractionService.Api) {\n this.activityContainerComponent.initialise(id, api);\n }\n\n get identifier() {\n return this.activityContainerComponent.identifier;\n }\n\n alert(alert: Alert): Promise<void> {\n return this.activityContainerComponent.alert(alert);\n }\n\n cancelActiveActivity(): Promise<boolean> {\n return this.activityContainerComponent.cancelActiveActivity();\n }\n\n confirm(confirm: Confirm): Promise<boolean> {\n return this.activityContainerComponent.confirm(confirm);\n }\n\n confirmOrReject(confirm: Confirm): Promise<void> {\n return this.activityContainerComponent.confirmOrReject(confirm);\n }\n\n confirmThen<D1, R1, E1>(confirm: Confirm, activityType: Constructable<Activity<D1, R1, E1>>, data?: D1): Promise<R1> {\n return this.activityContainerComponent.confirmThen(confirm, activityType);\n }\n\n isActive(): boolean {\n return this.activityContainerComponent.isActive();\n }\n\n startActivity<D1, R1, E1>(activityType: Constructable<Activity<D1, R1, E1>>, data?: D1): Promise<R1> {\n return this.activityContainerComponent.startActivity(activityType, data);\n }\n\n\n}\n"]}
|
|
@@ -5,8 +5,10 @@ export * from "./abstract-interaction-context";
|
|
|
5
5
|
export * from "./activity-ref";
|
|
6
6
|
export * from "./activity";
|
|
7
7
|
export * from "./interaction.module";
|
|
8
|
+
export * from "./components/activity-actions/activity-actions.component";
|
|
8
9
|
export * from "./components/activity-container/activity-container.component";
|
|
9
10
|
export * from "./components/activity-container/activity-outlet/activity-outlet.component";
|
|
11
|
+
export * from "./components/add-item-interaction-context/add-item-interaction-context.component";
|
|
10
12
|
export * from "./components/alert-dialog/alert-dialog.component";
|
|
11
13
|
export * from "./components/confirm-then-dialog/confirm-then-dialog.component";
|
|
12
14
|
export * from "./components/confirmation-dialog/confirmation-dialog.component";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAI3B,cAAc,sBAAsB,CAAC;AAGrC,cAAc,8DAA8D,CAAC;AAC7E,cAAc,2EAA2E,CAAC;AAC1F,cAAc,kDAAkD,CAAC;AACjE,cAAc,gEAAgE,CAAC;AAC/E,cAAc,gEAAgE,CAAC;AAC/E,cAAc,iFAAiF,CAAC;AAChG,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8CAA8C,CAAC;AAC7D,cAAc,sEAAsE,CAAC;AACrF,cAAc,8DAA8D,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./abstract-interaction-context\";\nexport * from \"./activity-ref\";\nexport * from \"./activity\";\nexport * from \"./alert\";\nexport * from \"./confirm\";\nexport * from \"./interaction-context\";\nexport * from \"./interaction.module\";\nexport * from \"./result\";\nexport * from \"./route-synchronisation-adapter\";\nexport * from \"./components/activity-container/activity-container.component\";\nexport * from \"./components/activity-container/activity-outlet/activity-outlet.component\";\nexport * from \"./components/alert-dialog/alert-dialog.component\";\nexport * from \"./components/confirm-then-dialog/confirm-then-dialog.component\";\nexport * from \"./components/confirmation-dialog/confirmation-dialog.component\";\nexport * from \"./components/inplace-interaction-context/in-place-interaction-context.component\";\nexport * from \"./services/interaction-service-routing-adapter\";\nexport * from \"./services/interaction.service\";\nexport * from \"./services/modal-interaction-context.factory\";\nexport * from \"./services/mat-dialog-interaction/dialog-interaction-context-factory\";\nexport * from \"./services/mat-dialog-interaction/dialog-interaction-context\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAI3B,cAAc,sBAAsB,CAAC;AAGrC,cAAc,0DAA0D,CAAC;AACzE,cAAc,8DAA8D,CAAC;AAC7E,cAAc,2EAA2E,CAAC;AAC1F,cAAc,kFAAkF,CAAC;AACjG,cAAc,kDAAkD,CAAC;AACjE,cAAc,gEAAgE,CAAC;AAC/E,cAAc,gEAAgE,CAAC;AAC/E,cAAc,iFAAiF,CAAC;AAChG,cAAc,gDAAgD,CAAC;AAC/D,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8CAA8C,CAAC;AAC7D,cAAc,sEAAsE,CAAC;AACrF,cAAc,8DAA8D,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./abstract-interaction-context\";\nexport * from \"./activity-ref\";\nexport * from \"./activity\";\nexport * from \"./alert\";\nexport * from \"./confirm\";\nexport * from \"./interaction-context\";\nexport * from \"./interaction.module\";\nexport * from \"./result\";\nexport * from \"./route-synchronisation-adapter\";\nexport * from \"./components/activity-actions/activity-actions.component\";\nexport * from \"./components/activity-container/activity-container.component\";\nexport * from \"./components/activity-container/activity-outlet/activity-outlet.component\";\nexport * from \"./components/add-item-interaction-context/add-item-interaction-context.component\";\nexport * from \"./components/alert-dialog/alert-dialog.component\";\nexport * from \"./components/confirm-then-dialog/confirm-then-dialog.component\";\nexport * from \"./components/confirmation-dialog/confirmation-dialog.component\";\nexport * from \"./components/inplace-interaction-context/in-place-interaction-context.component\";\nexport * from \"./services/interaction-service-routing-adapter\";\nexport * from \"./services/interaction.service\";\nexport * from \"./services/modal-interaction-context.factory\";\nexport * from \"./services/mat-dialog-interaction/dialog-interaction-context-factory\";\nexport * from \"./services/mat-dialog-interaction/dialog-interaction-context\";\n"]}
|
|
@@ -2,12 +2,17 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { PortalModule } from '@angular/cdk/portal';
|
|
3
3
|
import { CommonModule } from '@angular/common';
|
|
4
4
|
import { NgModule } from '@angular/core';
|
|
5
|
+
import { FlexModule, GridModule } from '@angular/flex-layout';
|
|
5
6
|
import { MatButtonModule } from '@angular/material/button';
|
|
6
7
|
import { MatDialogModule } from '@angular/material/dialog';
|
|
8
|
+
import { MatIconModule } from '@angular/material/icon';
|
|
7
9
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
8
10
|
import { RouterModule } from '@angular/router';
|
|
11
|
+
import { DirectivesModule } from '../directives/directives.module';
|
|
12
|
+
import { ActivityActionsComponent } from './components/activity-actions/activity-actions.component';
|
|
9
13
|
import { ActivityContainerComponent } from './components/activity-container/activity-container.component';
|
|
10
14
|
import { ActivityOutletComponent } from './components/activity-container/activity-outlet/activity-outlet.component';
|
|
15
|
+
import { AddItemInteractionContextComponent } from './components/add-item-interaction-context/add-item-interaction-context.component';
|
|
11
16
|
import { AlertDialogComponent } from './components/alert-dialog/alert-dialog.component';
|
|
12
17
|
import { ConfirmThenDialogComponent } from './components/confirm-then-dialog/confirm-then-dialog.component';
|
|
13
18
|
import { ConfirmationDialogComponent } from './components/confirmation-dialog/confirmation-dialog.component';
|
|
@@ -24,7 +29,11 @@ var InteractionModule = /** @class */ (function () {
|
|
|
24
29
|
MatDialogModule,
|
|
25
30
|
MatTabsModule,
|
|
26
31
|
PortalModule,
|
|
27
|
-
RouterModule
|
|
32
|
+
RouterModule,
|
|
33
|
+
MatIconModule,
|
|
34
|
+
DirectivesModule,
|
|
35
|
+
FlexModule,
|
|
36
|
+
GridModule
|
|
28
37
|
],
|
|
29
38
|
declarations: [
|
|
30
39
|
ActivityContainerComponent,
|
|
@@ -32,12 +41,16 @@ var InteractionModule = /** @class */ (function () {
|
|
|
32
41
|
ConfirmThenDialogComponent,
|
|
33
42
|
AlertDialogComponent,
|
|
34
43
|
ActivityOutletComponent,
|
|
35
|
-
InPlaceInteractionContextComponent
|
|
44
|
+
InPlaceInteractionContextComponent,
|
|
45
|
+
AddItemInteractionContextComponent,
|
|
46
|
+
ActivityActionsComponent
|
|
36
47
|
],
|
|
37
48
|
exports: [
|
|
38
49
|
ActivityContainerComponent,
|
|
39
50
|
ActivityOutletComponent,
|
|
40
|
-
InPlaceInteractionContextComponent
|
|
51
|
+
InPlaceInteractionContextComponent,
|
|
52
|
+
AddItemInteractionContextComponent,
|
|
53
|
+
ActivityActionsComponent
|
|
41
54
|
],
|
|
42
55
|
entryComponents: [
|
|
43
56
|
ActivityContainerComponent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction.module.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/interaction.module.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,C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R,OAAO,EAAE;gBACP,YAAY;gBACZ,eAAe;gBACf,eAAe;gBACf,aAAa;gBACb,YAAY;gBACZ,YAAY;gBACZ,aAAa;gBACb,gBAAgB;gBAChB,UAAU;gBACV,UAAU;aACX;YACD,YAAY,EAAE;gBACZ,0BAA0B;gBAC1B,2BAA2B;gBAC3B,0BAA0B;gBAC1B,oBAAoB;gBACpB,uBAAuB;gBACvB,kCAAkC;gBAClC,kCAAkC;gBAClC,wBAAwB;aACzB;YACD,OAAO,EAAE;gBACP,0BAA0B;gBAC1B,uBAAuB;gBACvB,kCAAkC;gBAClC,kCAAkC;gBAClC,wBAAwB;aACzB;YACD,eAAe,EAAE;gBACf,0BAA0B;gBAC1B,2BAA2B;gBAC3B,0BAA0B;gBAC1B,oBAAoB;aACrB;YACD,SAAS,EAAE;gBACT,kBAAkB;aAInB;SACF,CAAC;OACW,iBAAiB,CAC7B;IAAD,wBAAC;CAAA,AADD,IACC;SADY,iBAAiB","sourcesContent":["import { PortalModule } from '@angular/cdk/portal';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FlexModule, GridModule } from '@angular/flex-layout';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { MAT_TABS_CONFIG } from '@angular/material/tabs';\nimport { RouterModule } from '@angular/router';\nimport { DirectivesModule } from '../directives/directives.module';\nimport { PlaceModule } from '../place/place.module';\nimport { ActivityActionsComponent } from './components/activity-actions/activity-actions.component';\nimport { ActivityContainerComponent } from './components/activity-container/activity-container.component';\nimport { ActivityOutletComponent } from './components/activity-container/activity-outlet/activity-outlet.component';\nimport { AddItemInteractionContextComponent } from './components/add-item-interaction-context/add-item-interaction-context.component';\nimport { AlertDialogComponent } from './components/alert-dialog/alert-dialog.component';\nimport { ConfirmThenDialogComponent } from './components/confirm-then-dialog/confirm-then-dialog.component';\nimport { ConfirmationDialogComponent } from './components/confirmation-dialog/confirmation-dialog.component';\nimport { InPlaceInteractionContextComponent } from './components/inplace-interaction-context/in-place-interaction-context.component';\nimport { InteractionService } from './services/interaction.service';\n\n@NgModule({\n imports: [\n CommonModule,\n MatButtonModule,\n MatDialogModule,\n MatTabsModule,\n PortalModule,\n RouterModule,\n MatIconModule,\n DirectivesModule,\n FlexModule,\n GridModule\n ],\n declarations: [\n ActivityContainerComponent,\n ConfirmationDialogComponent,\n ConfirmThenDialogComponent,\n AlertDialogComponent,\n ActivityOutletComponent,\n InPlaceInteractionContextComponent,\n AddItemInteractionContextComponent,\n ActivityActionsComponent\n ],\n exports: [\n ActivityContainerComponent,\n ActivityOutletComponent,\n InPlaceInteractionContextComponent,\n AddItemInteractionContextComponent,\n ActivityActionsComponent\n ],\n entryComponents: [\n ActivityContainerComponent,\n ConfirmationDialogComponent,\n ConfirmThenDialogComponent,\n AlertDialogComponent\n ],\n providers: [\n InteractionService,\n // {\n // provide: MAT_TABS_CONFIG, useValue: { animationDuration: \"2s\" }\n // }\n ]\n})\nexport class InteractionModule {\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction.module.ngfactory.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/interaction.module.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\nimport * as i1 from './interaction.module';\nimport * as i2 from '@angular/common';\nimport * as i3 from '@angular/cdk/bidi';\nimport * as i4 from '@angular/material/button';\nimport * as i5 from '@angular/material/dialog';\nimport * as i6 from '@angular/material/tabs';\nimport * as i7 from '@angular/cdk/portal';\nimport * as i8 from '@angular/router';\nimport * as i9 from './components/activity-container/activity-container.component';\nimport * as i10 from './components/confirmation-dialog/confirmation-dialog.component';\nimport * as i11 from './components/confirm-then-dialog/confirm-then-dialog.component';\nimport * as i12 from './components/alert-dialog/alert-dialog.component';\nimport * as i13 from './components/activity-container/activity-outlet/activity-outlet.component';\nimport * as i14 from './components/inplace-interaction-context/in-place-interaction-context.component';\nexport const InteractionModuleNgFactory:i0.NgModuleFactory<i1.InteractionModule> = (null as any);\nvar _decl0_0:i2.NgClass = (<any>(null as any));\nvar _decl0_1:i2.NgComponentOutlet = (<any>(null as any));\nvar _decl0_2:i2.NgForOf<any,any> = (<any>(null as any));\nvar _decl0_3:i2.NgIf<any> = (<any>(null as any));\nvar _decl0_4:i2.NgTemplateOutlet = (<any>(null as any));\nvar _decl0_5:i2.NgStyle = (<any>(null as any));\nvar _decl0_6:i2.NgSwitch = (<any>(null as any));\nvar _decl0_7:i2.NgSwitchCase = (<any>(null as any));\nvar _decl0_8:i2.NgSwitchDefault = (<any>(null as any));\nvar _decl0_9:i2.NgPlural = (<any>(null as any));\nvar _decl0_10:i2.NgPluralCase = (<any>(null as any));\nvar _decl0_11:i3.Dir = (<any>(null as any));\nvar _decl0_12:i4.MatButton = (<any>(null as any));\nvar _decl0_13:i4.MatAnchor = (<any>(null as any));\nvar _decl0_14:i5.MatDialogContainer = (<any>(null as any));\nvar _decl0_15:i5.MatDialogClose = (<any>(null as any));\nvar _decl0_16:i5.MatDialogTitle = (<any>(null as any));\nvar _decl0_17:i5.MatDialogContent = (<any>(null as any));\nvar _decl0_18:i5.MatDialogActions = (<any>(null as any));\nvar _decl0_19:i6.MatTabGroup = (<any>(null as any));\nvar _decl0_20:i6.MatTabLabel = (<any>(null as any));\nvar _decl0_21:i6.MatTab = (<any>(null as any));\nvar _decl0_22:i6.MatTabNav = (<any>(null as any));\nvar _decl0_23:i6.MatTabLink = (<any>(null as any));\nvar _decl0_24:i6.MatTabContent = (<any>(null as any));\nvar _decl0_25:i7.CdkPortal = (<any>(null as any));\nvar _decl0_26:i7.CdkPortalOutlet = (<any>(null as any));\nvar _decl0_27:i7.TemplatePortalDirective = (<any>(null as any));\nvar _decl0_28:i7.PortalHostDirective = (<any>(null as any));\nvar _decl0_29:i8.RouterOutlet = (<any>(null as any));\nvar _decl0_30:i8.RouterLink = (<any>(null as any));\nvar _decl0_31:i8.RouterLinkWithHref = (<any>(null as any));\nvar _decl0_32:i8.RouterLinkActive = (<any>(null as any));\nvar _decl0_33:i8.ɵangular_packages_router_router_l = (<any>(null as any));\nvar _decl0_34:i9.ActivityContainerComponent<any,any,any> = (<any>(null as any));\nvar _decl0_35:i10.ConfirmationDialogComponent = (<any>(null as any));\nvar _decl0_36:i11.ConfirmThenDialogComponent<any,any,any> = (<any>(null as any));\nvar _decl0_37:i12.AlertDialogComponent = (<any>(null as any));\nvar _decl0_38:i13.ActivityOutletComponent<any,any,any> = (<any>(null as any));\nvar _decl0_39:i14.InPlaceInteractionContextComponent<any,any,any> = (<any>(null as any));\nvar _decl0_40:i2.AsyncPipe = (<any>(null as any));\nvar _decl0_41:i2.UpperCasePipe = (<any>(null as any));\nvar _decl0_42:i2.LowerCasePipe = (<any>(null as any));\nvar _decl0_43:i2.JsonPipe = (<any>(null as any));\nvar _decl0_44:i2.SlicePipe = (<any>(null as any));\nvar _decl0_45:i2.DecimalPipe = (<any>(null as any));\nvar _decl0_46:i2.PercentPipe = (<any>(null as any));\nvar _decl0_47:i2.TitleCasePipe = (<any>(null as any));\nvar _decl0_48:i2.CurrencyPipe = (<any>(null as any));\nvar _decl0_49:i2.DatePipe = (<any>(null as any));\nvar _decl0_50:i2.I18nPluralPipe = (<any>(null as any));\nvar _decl0_51:i2.I18nSelectPipe = (<any>(null as any));\nvar _decl0_52:i2.KeyValuePipe = (<any>(null as any));\nvar _decl0_53:i2.CommonModule = (<any>(null as any));\nvar _decl0_54:i4.MatButtonModule = (<any>(null as any));\nvar _decl0_55:i5.MatDialogModule = (<any>(null as any));\nvar _decl0_56:i6.MatTabsModule = (<any>(null as any));\nvar _decl0_57:i7.PortalModule = (<any>(null as any));\nvar _decl0_58:i8.RouterModule = (<any>(null as any));\nvar _decl0_59:i0.TemplateRef<any> = (<any>(null as any));\nvar _decl0_60:i0.ElementRef<any> = (<any>(null as any));\nfunction _View_ActivityContainerComponent_Host_1_0():void {\n var _any:any = (null as any);\n}\nfunction _View_ActivityContainerComponent_1_1():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_34;\n currVal_0;\n const currVal_1:any = _any;\n currVal_1;\n}\nfunction _View_ActivityContainerComponent_1_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_34.dynamicHeight;\n currVal_0;\n const currVal_1:any = _decl0_19.dynamicHeight;\n currVal_1;\n const currVal_2:any = (_decl0_19.headerPosition === 'below');\n currVal_2;\n const currVal_3:any = !_decl0_34.dynamicHeight;\n currVal_3;\n const currVal_4:any = _decl0_34.activityTabs;\n currVal_4;\n const currVal_5:any = _decl0_34.activityIndex;\n currVal_5;\n}\nfunction _View_ConfirmationDialogComponent_Host_2_0():void {\n var _any:any = (null as any);\n}\nfunction _View_ConfirmationDialogComponent_2_1():void {\n if (_decl0_35.confirm.title) {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_16.id;\n currVal_0;\n const currVal_1:any = _decl0_35.confirm.title();\n currVal_1;\n }\n}\nfunction _View_ConfirmationDialogComponent_2_2():void {\n var _any:any = (null as any);\n const currVal_0:any = _any;\n currVal_0;\n}\nfunction _View_ConfirmationDialogComponent_2_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_35.confirm.title;\n currVal_0;\n const currVal_1:any = _decl0_35.confirm.content();\n currVal_1;\n const currVal_2:any = (_decl0_12.disabled || null);\n currVal_2;\n const currVal_3:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_3;\n const currVal_4:any = _decl0_35.confirm.cancel();\n currVal_4;\n const currVal_5:any = (_decl0_35.isDestructive()? 'warn': 'primary');\n currVal_5;\n const currVal_6:any = (_decl0_12.disabled || null);\n currVal_6;\n const currVal_7:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_7;\n const currVal_8:any = _decl0_35.confirm.ok();\n currVal_8;\n const pd_9:any = ((<any>_decl0_35.cancel()) !== false);\n const pd_10:any = ((<any>_decl0_35.done()) !== false);\n}\nfunction _View_ConfirmThenDialogComponent_Host_3_0():void {\n var _any:any = (null as any);\n}\nfunction _View_ConfirmThenDialogComponent_3_1():void {\n if (_decl0_36.confirm.title) {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_16.id;\n currVal_0;\n const currVal_1:any = _decl0_36.confirm.title();\n currVal_1;\n }\n}\nfunction _View_ConfirmThenDialogComponent_3_2():void {\n var _any:any = (null as any);\n const currVal_0:any = _any;\n currVal_0;\n}\nfunction _View_ConfirmThenDialogComponent_3_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_36.confirm.title;\n currVal_0;\n const currVal_1:any = _decl0_36.confirm.content();\n currVal_1;\n const currVal_2:any = (_decl0_12.disabled || null);\n currVal_2;\n const currVal_3:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_3;\n const currVal_4:any = _decl0_36.confirm.cancel();\n currVal_4;\n const currVal_5:any = (_decl0_36.isDestructive()? 'warn': 'primary');\n currVal_5;\n const currVal_6:any = (_decl0_12.disabled || null);\n currVal_6;\n const currVal_7:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_7;\n const currVal_8:any = _decl0_36.confirm.ok();\n currVal_8;\n const pd_9:any = ((<any>_decl0_36.cancel()) !== false);\n const pd_10:any = ((<any>_decl0_36.onConfirm()) !== false);\n}\nfunction _View_AlertDialogComponent_Host_4_0():void {\n var _any:any = (null as any);\n}\nfunction _View_AlertDialogComponent_4_1():void {\n if (_decl0_37.alert.title) {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_16.id;\n currVal_0;\n const currVal_1:any = _decl0_37.alert.title();\n currVal_1;\n }\n}\nfunction _View_AlertDialogComponent_4_2():void {\n var _any:any = (null as any);\n const currVal_0:any = _any;\n currVal_0;\n}\nfunction _View_AlertDialogComponent_4_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_37.alert.title;\n currVal_0;\n const currVal_1:any = _decl0_37.alert.content();\n currVal_1;\n const currVal_2:any = 'primary';\n currVal_2;\n const currVal_3:any = (_decl0_12.disabled || null);\n currVal_3;\n const currVal_4:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_4;\n const currVal_5:any = _decl0_37.alert.ok();\n currVal_5;\n const pd_6:any = ((<any>_decl0_37.done()) !== false);\n}\nfunction _View_ActivityOutletComponent_Host_5_0():void {\n var _any:any = (null as any);\n}\nfunction _View_ActivityOutletComponent_5_0():void {\n var _any:any = (null as any);\n}\nfunction _View_InPlaceInteractionContextComponent_Host_6_0():void {\n var _any:any = (null as any);\n}\nfunction _View_InPlaceInteractionContextComponent_6_0():void {\n var _any:any = (null as any);\n const currVal_0:any = false;\n currVal_0;\n const currVal_1:any = (_decl0_39.isActive()? 1: 0);\n currVal_1;\n const currVal_2:any = _decl0_39.animationDuration;\n currVal_2;\n const currVal_3:any = _decl0_19.dynamicHeight;\n currVal_3;\n const currVal_4:any = (_decl0_19.headerPosition === 'below');\n currVal_4;\n const currVal_5:any = false;\n currVal_5;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interaction.module.ngfactory.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/interaction.module.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\nimport * as i1 from './interaction.module';\nimport * as i2 from '@angular/common';\nimport * as i3 from '@angular/cdk/bidi';\nimport * as i4 from '@angular/material/button';\nimport * as i5 from '@angular/material/dialog';\nimport * as i6 from '@angular/material/tabs';\nimport * as i7 from '@angular/cdk/portal';\nimport * as i8 from '@angular/router';\nimport * as i9 from '@angular/material/icon';\nimport * as i10 from '../directives/command.directive';\nimport * as i11 from '../directives/focus-binding.directive';\nimport * as i12 from '@angular/flex-layout/flex';\nimport * as i13 from '@angular/flex-layout/grid';\nimport * as i14 from './components/activity-container/activity-container.component';\nimport * as i15 from './components/confirmation-dialog/confirmation-dialog.component';\nimport * as i16 from './components/confirm-then-dialog/confirm-then-dialog.component';\nimport * as i17 from './components/alert-dialog/alert-dialog.component';\nimport * as i18 from './components/activity-container/activity-outlet/activity-outlet.component';\nimport * as i19 from './components/inplace-interaction-context/in-place-interaction-context.component';\nimport * as i20 from './components/add-item-interaction-context/add-item-interaction-context.component';\nimport * as i21 from './components/activity-actions/activity-actions.component';\nimport * as i22 from '../directives/directives.module';\nexport const InteractionModuleNgFactory:i0.NgModuleFactory<i1.InteractionModule> = (null as any);\nvar _decl0_0:i2.NgClass = (<any>(null as any));\nvar _decl0_1:i2.NgComponentOutlet = (<any>(null as any));\nvar _decl0_2:i2.NgForOf<any,any> = (<any>(null as any));\nvar _decl0_3:i2.NgIf<any> = (<any>(null as any));\nvar _decl0_4:i2.NgTemplateOutlet = (<any>(null as any));\nvar _decl0_5:i2.NgStyle = (<any>(null as any));\nvar _decl0_6:i2.NgSwitch = (<any>(null as any));\nvar _decl0_7:i2.NgSwitchCase = (<any>(null as any));\nvar _decl0_8:i2.NgSwitchDefault = (<any>(null as any));\nvar _decl0_9:i2.NgPlural = (<any>(null as any));\nvar _decl0_10:i2.NgPluralCase = (<any>(null as any));\nvar _decl0_11:i3.Dir = (<any>(null as any));\nvar _decl0_12:i4.MatButton = (<any>(null as any));\nvar _decl0_13:i4.MatAnchor = (<any>(null as any));\nvar _decl0_14:i5.MatDialogContainer = (<any>(null as any));\nvar _decl0_15:i5.MatDialogClose = (<any>(null as any));\nvar _decl0_16:i5.MatDialogTitle = (<any>(null as any));\nvar _decl0_17:i5.MatDialogContent = (<any>(null as any));\nvar _decl0_18:i5.MatDialogActions = (<any>(null as any));\nvar _decl0_19:i6.MatTabGroup = (<any>(null as any));\nvar _decl0_20:i6.MatTabLabel = (<any>(null as any));\nvar _decl0_21:i6.MatTab = (<any>(null as any));\nvar _decl0_22:i6.MatTabNav = (<any>(null as any));\nvar _decl0_23:i6.MatTabLink = (<any>(null as any));\nvar _decl0_24:i6.MatTabContent = (<any>(null as any));\nvar _decl0_25:i7.CdkPortal = (<any>(null as any));\nvar _decl0_26:i7.CdkPortalOutlet = (<any>(null as any));\nvar _decl0_27:i7.TemplatePortalDirective = (<any>(null as any));\nvar _decl0_28:i7.PortalHostDirective = (<any>(null as any));\nvar _decl0_29:i8.RouterOutlet = (<any>(null as any));\nvar _decl0_30:i8.RouterLink = (<any>(null as any));\nvar _decl0_31:i8.RouterLinkWithHref = (<any>(null as any));\nvar _decl0_32:i8.RouterLinkActive = (<any>(null as any));\nvar _decl0_33:i8.ɵangular_packages_router_router_l = (<any>(null as any));\nvar _decl0_34:i9.MatIcon = (<any>(null as any));\nvar _decl0_35:i10.CommandDirective<any> = (<any>(null as any));\nvar _decl0_36:i11.FocusBindingDirective = (<any>(null as any));\nvar _decl0_37:i12.DefaultLayoutDirective = (<any>(null as any));\nvar _decl0_38:i12.DefaultLayoutGapDirective = (<any>(null as any));\nvar _decl0_39:i12.DefaultLayoutAlignDirective = (<any>(null as any));\nvar _decl0_40:i12.DefaultFlexOrderDirective = (<any>(null as any));\nvar _decl0_41:i12.DefaultFlexOffsetDirective = (<any>(null as any));\nvar _decl0_42:i12.FlexFillDirective = (<any>(null as any));\nvar _decl0_43:i12.DefaultFlexAlignDirective = (<any>(null as any));\nvar _decl0_44:i12.DefaultFlexDirective = (<any>(null as any));\nvar _decl0_45:i13.ɵgrid_privatec = (<any>(null as any));\nvar _decl0_46:i13.ɵgrid_privatef = (<any>(null as any));\nvar _decl0_47:i13.ɵgrid_privatei = (<any>(null as any));\nvar _decl0_48:i13.ɵgrid_privatel = (<any>(null as any));\nvar _decl0_49:i13.ɵgrid_privateo = (<any>(null as any));\nvar _decl0_50:i13.ɵgrid_privater = (<any>(null as any));\nvar _decl0_51:i13.ɵgrid_privateu = (<any>(null as any));\nvar _decl0_52:i13.ɵgrid_privatex = (<any>(null as any));\nvar _decl0_53:i13.ɵgrid_privateba = (<any>(null as any));\nvar _decl0_54:i13.ɵgrid_privatebd = (<any>(null as any));\nvar _decl0_55:i13.ɵgrid_privatebg = (<any>(null as any));\nvar _decl0_56:i14.ActivityContainerComponent<any,any,any> = (<any>(null as any));\nvar _decl0_57:i15.ConfirmationDialogComponent = (<any>(null as any));\nvar _decl0_58:i16.ConfirmThenDialogComponent<any,any,any> = (<any>(null as any));\nvar _decl0_59:i17.AlertDialogComponent = (<any>(null as any));\nvar _decl0_60:i18.ActivityOutletComponent<any,any,any> = (<any>(null as any));\nvar _decl0_61:i19.InPlaceInteractionContextComponent<any,any,any> = (<any>(null as any));\nvar _decl0_62:i20.AddItemInteractionContextComponent = (<any>(null as any));\nvar _decl0_63:i21.ActivityActionsComponent = (<any>(null as any));\nvar _decl0_64:i2.AsyncPipe = (<any>(null as any));\nvar _decl0_65:i2.UpperCasePipe = (<any>(null as any));\nvar _decl0_66:i2.LowerCasePipe = (<any>(null as any));\nvar _decl0_67:i2.JsonPipe = (<any>(null as any));\nvar _decl0_68:i2.SlicePipe = (<any>(null as any));\nvar _decl0_69:i2.DecimalPipe = (<any>(null as any));\nvar _decl0_70:i2.PercentPipe = (<any>(null as any));\nvar _decl0_71:i2.TitleCasePipe = (<any>(null as any));\nvar _decl0_72:i2.CurrencyPipe = (<any>(null as any));\nvar _decl0_73:i2.DatePipe = (<any>(null as any));\nvar _decl0_74:i2.I18nPluralPipe = (<any>(null as any));\nvar _decl0_75:i2.I18nSelectPipe = (<any>(null as any));\nvar _decl0_76:i2.KeyValuePipe = (<any>(null as any));\nvar _decl0_77:i2.CommonModule = (<any>(null as any));\nvar _decl0_78:i4.MatButtonModule = (<any>(null as any));\nvar _decl0_79:i5.MatDialogModule = (<any>(null as any));\nvar _decl0_80:i6.MatTabsModule = (<any>(null as any));\nvar _decl0_81:i7.PortalModule = (<any>(null as any));\nvar _decl0_82:i8.RouterModule = (<any>(null as any));\nvar _decl0_83:i9.MatIconModule = (<any>(null as any));\nvar _decl0_84:i22.DirectivesModule = (<any>(null as any));\nvar _decl0_85:i12.FlexModule = (<any>(null as any));\nvar _decl0_86:i13.GridModule = (<any>(null as any));\nvar _decl0_87:i0.TemplateRef<any> = (<any>(null as any));\nvar _decl0_88:i0.ElementRef<any> = (<any>(null as any));\nfunction _View_ActivityContainerComponent_Host_1_0():void {\n var _any:any = (null as any);\n}\nfunction _View_ActivityContainerComponent_1_1():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_56;\n currVal_0;\n const currVal_1:any = _any;\n currVal_1;\n}\nfunction _View_ActivityContainerComponent_1_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_56.dynamicHeight;\n currVal_0;\n const currVal_1:any = _decl0_19.dynamicHeight;\n currVal_1;\n const currVal_2:any = (_decl0_19.headerPosition === 'below');\n currVal_2;\n const currVal_3:any = !_decl0_56.dynamicHeight;\n currVal_3;\n const currVal_4:any = _decl0_56.activityTabs;\n currVal_4;\n const currVal_5:any = _decl0_56.activityIndex;\n currVal_5;\n}\nfunction _View_ConfirmationDialogComponent_Host_2_0():void {\n var _any:any = (null as any);\n}\nfunction _View_ConfirmationDialogComponent_2_1():void {\n if (_decl0_57.confirm.title) {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_16.id;\n currVal_0;\n const currVal_1:any = _decl0_57.confirm.title();\n currVal_1;\n }\n}\nfunction _View_ConfirmationDialogComponent_2_2():void {\n var _any:any = (null as any);\n const currVal_0:any = _any;\n currVal_0;\n}\nfunction _View_ConfirmationDialogComponent_2_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_57.confirm.title;\n currVal_0;\n const currVal_1:any = _decl0_57.confirm.content();\n currVal_1;\n const currVal_2:any = (_decl0_12.disabled || null);\n currVal_2;\n const currVal_3:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_3;\n const currVal_4:any = _decl0_57.confirm.cancel();\n currVal_4;\n const currVal_5:any = (_decl0_57.isDestructive()? 'warn': 'primary');\n currVal_5;\n const currVal_6:any = (_decl0_12.disabled || null);\n currVal_6;\n const currVal_7:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_7;\n const currVal_8:any = _decl0_57.confirm.ok();\n currVal_8;\n const pd_9:any = ((<any>_decl0_57.cancel()) !== false);\n const pd_10:any = ((<any>_decl0_57.done()) !== false);\n}\nfunction _View_ConfirmThenDialogComponent_Host_3_0():void {\n var _any:any = (null as any);\n}\nfunction _View_ConfirmThenDialogComponent_3_1():void {\n if (_decl0_58.confirm.title) {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_16.id;\n currVal_0;\n const currVal_1:any = _decl0_58.confirm.title();\n currVal_1;\n }\n}\nfunction _View_ConfirmThenDialogComponent_3_2():void {\n var _any:any = (null as any);\n const currVal_0:any = _any;\n currVal_0;\n}\nfunction _View_ConfirmThenDialogComponent_3_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_58.confirm.title;\n currVal_0;\n const currVal_1:any = _decl0_58.confirm.content();\n currVal_1;\n const currVal_2:any = (_decl0_12.disabled || null);\n currVal_2;\n const currVal_3:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_3;\n const currVal_4:any = _decl0_58.confirm.cancel();\n currVal_4;\n const currVal_5:any = (_decl0_58.isDestructive()? 'warn': 'primary');\n currVal_5;\n const currVal_6:any = (_decl0_12.disabled || null);\n currVal_6;\n const currVal_7:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_7;\n const currVal_8:any = _decl0_58.confirm.ok();\n currVal_8;\n const pd_9:any = ((<any>_decl0_58.cancel()) !== false);\n const pd_10:any = ((<any>_decl0_58.onConfirm()) !== false);\n}\nfunction _View_AlertDialogComponent_Host_4_0():void {\n var _any:any = (null as any);\n}\nfunction _View_AlertDialogComponent_4_1():void {\n if (_decl0_59.alert.title) {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_16.id;\n currVal_0;\n const currVal_1:any = _decl0_59.alert.title();\n currVal_1;\n }\n}\nfunction _View_AlertDialogComponent_4_2():void {\n var _any:any = (null as any);\n const currVal_0:any = _any;\n currVal_0;\n}\nfunction _View_AlertDialogComponent_4_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_59.alert.title;\n currVal_0;\n const currVal_1:any = _decl0_59.alert.content();\n currVal_1;\n const currVal_2:any = 'primary';\n currVal_2;\n const currVal_3:any = (_decl0_12.disabled || null);\n currVal_3;\n const currVal_4:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_4;\n const currVal_5:any = _decl0_59.alert.ok();\n currVal_5;\n const pd_6:any = ((<any>_decl0_59.done()) !== false);\n}\nfunction _View_ActivityOutletComponent_Host_5_0():void {\n var _any:any = (null as any);\n}\nfunction _View_ActivityOutletComponent_5_0():void {\n var _any:any = (null as any);\n}\nfunction _View_InPlaceInteractionContextComponent_Host_6_0():void {\n var _any:any = (null as any);\n}\nfunction _View_InPlaceInteractionContextComponent_6_0():void {\n var _any:any = (null as any);\n const currVal_0:any = false;\n currVal_0;\n const currVal_1:any = (_decl0_61.isActive()? 1: 0);\n currVal_1;\n const currVal_2:any = _decl0_61.animationDuration;\n currVal_2;\n const currVal_3:any = _decl0_19.dynamicHeight;\n currVal_3;\n const currVal_4:any = (_decl0_19.headerPosition === 'below');\n currVal_4;\n const currVal_5:any = false;\n currVal_5;\n}\nfunction _View_AddItemInteractionContextComponent_Host_7_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_62.active;\n currVal_0;\n const currVal_1:any = _decl0_62.tabindex;\n currVal_1;\n}\nfunction _View_AddItemInteractionContextComponent_7_0():void {\n var _any:any = (null as any);\n const currVal_0:any = false;\n currVal_0;\n const currVal_1:any = _decl0_62.clickCommand;\n currVal_1;\n const currVal_2:any = _decl0_34.inline;\n currVal_2;\n const currVal_3:any = (((_decl0_34.color !== 'primary') && (_decl0_34.color !== 'accent')) && (_decl0_34.color !== 'warn'));\n currVal_3;\n const currVal_4:any = _decl0_62.label;\n currVal_4;\n const pd_5:any = ((<any>_decl0_35.notifyClick(_any)) !== false);\n}\nfunction _View_ActivityActionsComponent_Host_8_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_63.alignEnd;\n currVal_0;\n}\nfunction _View_ActivityActionsComponent_8_1():void {\n if (!_decl0_63.hasConfirmText()) {\n var _any:any = (null as any);\n const currVal_0:any = (_decl0_12.disabled || null);\n currVal_0;\n const currVal_1:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_1;\n const currVal_2:any = _decl0_63.confirmCommand;\n currVal_2;\n const currVal_3:any = _decl0_34.inline;\n currVal_3;\n const currVal_4:any = (((_decl0_34.color !== 'primary') && (_decl0_34.color !== 'accent')) && (_decl0_34.color !== 'warn'));\n currVal_4;\n const pd_5:any = ((<any>_decl0_35.notifyClick(_any)) !== false);\n }\n}\nfunction _View_ActivityActionsComponent_8_2():void {\n if (_decl0_63.hasConfirmText()) {\n var _any:any = (null as any);\n const currVal_0:any = (_decl0_12.disabled || null);\n currVal_0;\n const currVal_1:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_1;\n const currVal_2:any = _decl0_63.confirmCommand;\n currVal_2;\n const currVal_3:any = _decl0_63.confirmText;\n currVal_3;\n const pd_4:any = ((<any>_decl0_35.notifyClick(_any)) !== false);\n }\n}\nfunction _View_ActivityActionsComponent_8_0():void {\n var _any:any = (null as any);\n const currVal_0:any = (_decl0_12.disabled || null);\n currVal_0;\n const currVal_1:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_1;\n const currVal_2:any = _decl0_63.cancelCommand;\n currVal_2;\n const currVal_3:any = _decl0_34.inline;\n currVal_3;\n const currVal_4:any = (((_decl0_34.color !== 'primary') && (_decl0_34.color !== 'accent')) && (_decl0_34.color !== 'warn'));\n currVal_4;\n const currVal_5:any = !_decl0_63.hasConfirmText();\n currVal_5;\n const currVal_6:any = _decl0_63.hasConfirmText();\n currVal_6;\n const pd_7:any = ((<any>_decl0_35.notifyClick(_any)) !== false);\n}\n"]}
|
|
@@ -53,21 +53,6 @@ var InteractionService = /** @class */ (function () {
|
|
|
53
53
|
// Todo: allow multiple inplace interactions..
|
|
54
54
|
interactionContext.initialise("ip" + ++inplaceMonitorCount, new InteractionService_1.ApiAdapter(this.placeRouter, this.inPlaceInteractionRegistry));
|
|
55
55
|
};
|
|
56
|
-
// private assertModalCanStart() {
|
|
57
|
-
// assert.isFalsey(this.inExclusiveInteraction.value);
|
|
58
|
-
// assert.isFalsey(this.modalActive.value);
|
|
59
|
-
// }
|
|
60
|
-
//
|
|
61
|
-
// private assertInPlaceCanStart() {
|
|
62
|
-
// assert.isFalsey(this.inExclusiveInteraction.value);
|
|
63
|
-
// assert.isFalsey(this.modalActive.value);
|
|
64
|
-
// assert.isFalsey(this._activeInlineContext.value);
|
|
65
|
-
// }
|
|
66
|
-
// // @Trace()
|
|
67
|
-
// getActiveContext(): InteractionContext {
|
|
68
|
-
// assert.isTruthy(this.isActive());
|
|
69
|
-
// return this._activeContext.value;
|
|
70
|
-
// }
|
|
71
56
|
/**
|
|
72
57
|
* Creates an interaction context that will prevent any other contexts from starting an
|
|
73
58
|
* activity until it is disposed. This is intended for use by the router for passing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction.service.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/services/interaction.service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAEL,oBAAoB,EAEpB,GAAG,EACH,gBAAgB,EAEhB,gBAAgB,EAIjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAItD,OAAO,EAAE,gCAAgC,EAAE,MAAM,uCAAuC,CAAC;AAEzF,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;;;AAErF,IAAI,mBAAmB,GAAG,CAAC,CAAC;AAK5B;IAmBE,4BAAqB,8BAA8D;QAA9D,mCAA8B,GAA9B,8BAA8B,CAAgC;QAjBlE,YAAO,GAAG,IAAI,gBAAgB,EAAE,CAAC;QAGlD,sFAAsF;QACtF,uFAAuF;QACvF,wEAAwE;QACvD,0BAAqB,GAAG,IAAI,oBAAoB,EAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAYx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AW,CAAC,mCAAmC,EAAE,CAAC;QACpH,CAAC;QACH,iBAAC;IAAD,CAAC,AA7BD,IA6BC;IA7BY,6BAAU,aA6BtB,CAAA;AAEH,CAAC,EA5FgB,kBAAkB,KAAlB,kBAAkB,QA4FlC","sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n BooleanValueModelChain,\n DelegatingValueModel,\n Disposable,\n Dsl,\n GarbageCollector, ListModel,\n ListModelChain,\n MutableListModel,\n MutableValueModel, Trace,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport { assert } from '@coolon/typescript-utilities';\nimport { PlaceRouter } from '../../place/place-router';\nimport { InPlaceInteractionContextComponent } from '../components/inplace-interaction-context/in-place-interaction-context.component';\nimport { InteractionContext } from '../interaction-context';\nimport { InteractionServiceRoutingAdapter } from './interaction-service-routing-adapter';\n\nimport { ModalInteractionContextFactory } from './modal-interaction-context.factory';\n\nlet inplaceMonitorCount = 0;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class InteractionService {\n\n private readonly garbage = new GarbageCollector();\n readonly active: BooleanValueModelChain;\n\n // private readonly _activeModalContext = new MutableValueModel<InteractionContext>();\n // private readonly _activeInlineContext = new MutableValueModel<InteractionContext>();\n // private readonly _activeContext: ValueModelChain<InteractionContext>;\n private readonly _navigationInProgress = new DelegatingValueModel<boolean>().withDefault(false);\n\n private placeRouter: PlaceRouter;\n private exclusiveInteractionRegistry: InteractionService.ContextRegistry;\n private modalInteractionRegistry: InteractionService.ContextRegistry;\n private inPlaceInteractionRegistry: InteractionService.ContextRegistry;\n private activeModalContext: ValueModelChain<InteractionContext>;\n\n readonly activeInteractionContextIds: ListModelChain<string>;\n readonly inModalInteraction: BooleanValueModelChain;\n\n constructor(readonly modelInteractionContextFactory: ModalInteractionContextFactory) {\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this.garbage);\n\n this.exclusiveInteractionRegistry = new InteractionService.ContextRegistry();\n this.modalInteractionRegistry = new InteractionService.ContextRegistry();\n this.inPlaceInteractionRegistry = new InteractionService.ContextRegistry();\n\n this.modalInteractionRegistry.disableWhen(valueOf.any(\n this.exclusiveInteractionRegistry.active,\n this.modalInteractionRegistry.active\n ).areTruthy());\n\n this.inPlaceInteractionRegistry.disableWhen(valueOf.any(\n this.exclusiveInteractionRegistry.active,\n this.modalInteractionRegistry.active,\n this.inPlaceInteractionRegistry.active\n ).areTruthy());\n\n this.active = valueOf.any(\n this.inPlaceInteractionRegistry.active,\n this.modalInteractionRegistry.active\n ).areTruthy();\n\n\n // TODO: chain.concat(listOrValueModels) would be nice.\n this.activeInteractionContextIds = chain(this.inPlaceInteractionRegistry.interactionContextIds)\n .concat(this.modalInteractionRegistry.interactionContextIds);\n\n this.activeModalContext = chain(this.modalInteractionRegistry.interactionContexts).first();\n this.inModalInteraction = chain(this.activeModalContext).isNotNil();\n\n }\n\n isActive(): boolean {\n return this.active.value;\n }\n\n /**\n * @deprecated use #createModalInteractionContextDisposedWith instead.\n * @param disposable\n */\n createModalInteractionContextFor(disposable: Disposable.Collector): InteractionContext {\n return this.createModalInteractionContextDisposedWith(disposable);\n }\n\n /**\n * Creates a new model interaction context that will be disposed along with the component.\n * @param disposable\n */\n createModalInteractionContextDisposedWith(disposable: Disposable.Collector): InteractionContext {\n // TODO: look at making the registry the factory..\n return this.modelInteractionContextFactory.createInteractionContext('modal', new InteractionService.ApiAdapter(this.placeRouter, this.modalInteractionRegistry));\n }\n\n registerInplaceInteractionContext(interactionContext: InPlaceInteractionContextComponent<any, any, any>) {\n // TODO: look at making the registry the factory..\n // Todo: check for double registration.\n // Todo: allow multiple inplace interactions..\n interactionContext.initialise(`ip${++inplaceMonitorCount}`, new InteractionService.ApiAdapter(this.placeRouter, this.inPlaceInteractionRegistry));\n }\n\n\n // private assertModalCanStart() {\n // assert.isFalsey(this.inExclusiveInteraction.value);\n // assert.isFalsey(this.modalActive.value);\n // }\n //\n // private assertInPlaceCanStart() {\n // assert.isFalsey(this.inExclusiveInteraction.value);\n // assert.isFalsey(this.modalActive.value);\n // assert.isFalsey(this._activeInlineContext.value);\n // }\n\n\n // // @Trace()\n // getActiveContext(): InteractionContext {\n // assert.isTruthy(this.isActive());\n // return this._activeContext.value;\n // }\n\n /**\n * Creates an interaction context that will prevent any other contexts from starting an\n * activity until it is disposed. This is intended for use by the router for passing\n * to PlaceComponent.canDeactivate(interactionContext). This ensures components don't\n * try and interact in a way that we can't track and synchronise with the browser back\n * button.\n */\n registerPlaceRouter(router: PlaceRouter): InteractionServiceRoutingAdapter {\n assert.isFalsey(this.placeRouter);\n this.placeRouter = router;\n this._navigationInProgress.setDelegate(this.placeRouter.navigationInProgress);\n const self = this;\n return new InteractionServiceRoutingAdapter(\n this.activeInteractionContextIds,\n this.activeModalContext,\n () => {\n return self.modelInteractionContextFactory.createInteractionContext('exclusive', new InteractionService.ApiAdapter(this.placeRouter, this.exclusiveInteractionRegistry));\n });\n }\n\n}\n\nexport namespace InteractionService {\n\n export interface Api {\n\n /**\n * Notifies the interaction service that a particular interactionContext has become active. The interaction\n * services will then push changes to the router to track state. If the router is idle, the promise will\n * resolve when the routing has finished updating. Otherwise it will return immediately.\n * @param interactionContext\n */\n notifyActive(interactionContext: InteractionContext): Promise<unknown>;\n\n /**\n * Notifies the interaction service that a particular interactionContext has become idle. The interaction\n * services will then push changes to the router to track state. If the router is idle, the promise will\n * resolve when the routing has finished updating. Otherwise it will return immediately.\n * @param interactionContext\n */\n notifyFinished(interactionContext: InteractionContext): Promise<unknown>;\n }\n\n /**\n * Provides a mechanism for the service to keep track of what the API adapters are doing to\n * ensure the rules are followed, i.e. modal or in-place interaction aren't started while\n * an exclusive routing interaction is active.\n */\n export class ContextRegistry extends GarbageCollector {\n\n private _interactions = new MutableListModel<InteractionContext>();\n private _disabledDelegate = new DelegatingValueModel<boolean>().withDefault(false);\n readonly active: BooleanValueModelChain;\n readonly interactionContextIds: ListModelChain<string>;\n\n constructor() {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this.active = chain(this._interactions).isNotEmpty();\n this.interactionContextIds = chain(this._interactions).pluck(\"identifier\");\n }\n\n get interactionContexts():ListModel<InteractionContext> {\n return this._interactions.readonly;\n }\n\n start(context: InteractionContext) {\n this._interactions.push(context);\n }\n\n finish(context: InteractionContext) {\n this._interactions.remove(context);\n }\n\n isActive() {\n return this.active.value;\n }\n\n disableWhen(disabled: ValueModel<boolean>) {\n this._disabledDelegate.setDelegate(disabled);\n }\n }\n\n export class ApiAdapter implements Api {\n\n constructor(private readonly placeRouter: PlaceRouter, private readonly contextRegistry: ContextRegistry) {\n }\n\n // @Trace()\n notifyActive(context: InteractionContext): Promise<any> {\n assert.isTruthy(context.identifier);\n this.contextRegistry.start(context);\n return this.isNavigationInProgress() ? Promise.resolve() : this.placeRouter.syncInteractionContextIdsWithRouter();\n }\n\n // @Trace()\n private isNavigationInProgress() {\n return this.placeRouter.navigationInProgress.value;\n }\n\n // @Trace()\n notifyFinished(context: InteractionContext): Promise<any> {\n this.contextRegistry.finish(context);\n // :: Important ::\n // This method will be traversed by both the place router (during can canDeactivate guards) and user land code\n // (both when routing is idle and while it is active in PlaceComponent.canDeactivate()).\n // The result of pushInteractionIdsToRoute will not start until after the current route finishes, and the\n // current route won't finish until after this promise returns... Deadlock.\n // So in order to keep this logic out of the activities we perform the check here and ensure that\n // any interactions with the context while routing is active returns immediately.\n return this.isNavigationInProgress() ? Promise.resolve() : this.placeRouter.syncInteractionContextIdsWithRouter();\n }\n }\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interaction.service.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/interaction/services/interaction.service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAEL,oBAAoB,EAEpB,GAAG,EACH,gBAAgB,EAEhB,gBAAgB,EAIjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,C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C9G,wFAAwF;YACxF,yGAAyG;YACzG,2EAA2E;YAC3E,iGAAiG;YACjG,iFAAiF;YACjF,OAAO,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,mCAAmC,EAAE,CAAC;QACpH,CAAC;QACH,iBAAC;IAAD,CAAC,AA7BD,IA6BC;IA7BY,6BAAU,aA6BtB,CAAA;AAEH,CAAC,EA5FgB,kBAAkB,KAAlB,kBAAkB,QA4FlC","sourcesContent":["import { Injectable } from '@angular/core';\nimport {\n BooleanValueModelChain,\n DelegatingValueModel,\n Disposable,\n Dsl,\n GarbageCollector, ListModel,\n ListModelChain,\n MutableListModel,\n MutableValueModel, Trace,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport { assert } from '@coolon/typescript-utilities';\nimport { PlaceRouter } from '../../place/place-router';\nimport { InPlaceInteractionContextComponent } from '../components/inplace-interaction-context/in-place-interaction-context.component';\nimport { InteractionContext } from '../interaction-context';\nimport { InteractionServiceRoutingAdapter } from './interaction-service-routing-adapter';\n\nimport { ModalInteractionContextFactory } from './modal-interaction-context.factory';\n\nlet inplaceMonitorCount = 0;\n\n@Injectable({\n providedIn: 'root'\n})\nexport class InteractionService {\n\n private readonly garbage = new GarbageCollector();\n readonly active: BooleanValueModelChain;\n\n // private readonly _activeModalContext = new MutableValueModel<InteractionContext>();\n // private readonly _activeInlineContext = new MutableValueModel<InteractionContext>();\n // private readonly _activeContext: ValueModelChain<InteractionContext>;\n private readonly _navigationInProgress = new DelegatingValueModel<boolean>().withDefault(false);\n\n private placeRouter: PlaceRouter;\n private exclusiveInteractionRegistry: InteractionService.ContextRegistry;\n private modalInteractionRegistry: InteractionService.ContextRegistry;\n private inPlaceInteractionRegistry: InteractionService.ContextRegistry;\n private activeModalContext: ValueModelChain<InteractionContext>;\n\n readonly activeInteractionContextIds: ListModelChain<string>;\n readonly inModalInteraction: BooleanValueModelChain;\n\n constructor(readonly modelInteractionContextFactory: ModalInteractionContextFactory) {\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this.garbage);\n\n this.exclusiveInteractionRegistry = new InteractionService.ContextRegistry();\n this.modalInteractionRegistry = new InteractionService.ContextRegistry();\n this.inPlaceInteractionRegistry = new InteractionService.ContextRegistry();\n\n this.modalInteractionRegistry.disableWhen(valueOf.any(\n this.exclusiveInteractionRegistry.active,\n this.modalInteractionRegistry.active\n ).areTruthy());\n\n this.inPlaceInteractionRegistry.disableWhen(valueOf.any(\n this.exclusiveInteractionRegistry.active,\n this.modalInteractionRegistry.active,\n this.inPlaceInteractionRegistry.active\n ).areTruthy());\n\n this.active = valueOf.any(\n this.inPlaceInteractionRegistry.active,\n this.modalInteractionRegistry.active\n ).areTruthy();\n\n\n // TODO: chain.concat(listOrValueModels) would be nice.\n this.activeInteractionContextIds = chain(this.inPlaceInteractionRegistry.interactionContextIds)\n .concat(this.modalInteractionRegistry.interactionContextIds);\n\n this.activeModalContext = chain(this.modalInteractionRegistry.interactionContexts).first();\n this.inModalInteraction = chain(this.activeModalContext).isNotNil();\n\n }\n\n isActive(): boolean {\n return this.active.value;\n }\n\n /**\n * @deprecated use #createModalInteractionContextDisposedWith instead.\n * @param disposable\n */\n createModalInteractionContextFor(disposable: Disposable.Collector): InteractionContext {\n return this.createModalInteractionContextDisposedWith(disposable);\n }\n\n /**\n * Creates a new model interaction context that will be disposed along with the component.\n * @param disposable\n */\n createModalInteractionContextDisposedWith(disposable: Disposable.Collector): InteractionContext {\n // TODO: look at making the registry the factory..\n return this.modelInteractionContextFactory.createInteractionContext('modal', new InteractionService.ApiAdapter(this.placeRouter, this.modalInteractionRegistry));\n }\n\n registerInplaceInteractionContext(interactionContext: InPlaceInteractionContextComponent<any, any, any>) {\n // TODO: look at making the registry the factory..\n // Todo: check for double registration.\n // Todo: allow multiple inplace interactions..\n interactionContext.initialise(`ip${++inplaceMonitorCount}`, new InteractionService.ApiAdapter(this.placeRouter, this.inPlaceInteractionRegistry));\n }\n\n\n /**\n * Creates an interaction context that will prevent any other contexts from starting an\n * activity until it is disposed. This is intended for use by the router for passing\n * to PlaceComponent.canDeactivate(interactionContext). This ensures components don't\n * try and interact in a way that we can't track and synchronise with the browser back\n * button.\n */\n registerPlaceRouter(router: PlaceRouter): InteractionServiceRoutingAdapter {\n assert.isFalsey(this.placeRouter);\n this.placeRouter = router;\n this._navigationInProgress.setDelegate(this.placeRouter.navigationInProgress);\n const self = this;\n return new InteractionServiceRoutingAdapter(\n this.activeInteractionContextIds,\n this.activeModalContext,\n () => {\n return self.modelInteractionContextFactory.createInteractionContext('exclusive', new InteractionService.ApiAdapter(this.placeRouter, this.exclusiveInteractionRegistry));\n });\n }\n\n}\n\nexport namespace InteractionService {\n\n export interface Api {\n\n /**\n * Notifies the interaction service that a particular interactionContext has become active. The interaction\n * services will then push changes to the router to track state. If the router is idle, the promise will\n * resolve when the routing has finished updating. Otherwise it will return immediately.\n * @param interactionContext\n */\n notifyActive(interactionContext: InteractionContext): Promise<unknown>;\n\n /**\n * Notifies the interaction service that a particular interactionContext has become idle. The interaction\n * services will then push changes to the router to track state. If the router is idle, the promise will\n * resolve when the routing has finished updating. Otherwise it will return immediately.\n * @param interactionContext\n */\n notifyFinished(interactionContext: InteractionContext): Promise<unknown>;\n }\n\n /**\n * Provides a mechanism for the service to keep track of what the API adapters are doing to\n * ensure the rules are followed, i.e. modal or in-place interaction aren't started while\n * an exclusive routing interaction is active.\n */\n export class ContextRegistry extends GarbageCollector {\n\n private _interactions = new MutableListModel<InteractionContext>();\n private _disabledDelegate = new DelegatingValueModel<boolean>().withDefault(false);\n readonly active: BooleanValueModelChain;\n readonly interactionContextIds: ListModelChain<string>;\n\n constructor() {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this.active = chain(this._interactions).isNotEmpty();\n this.interactionContextIds = chain(this._interactions).pluck(\"identifier\");\n }\n\n get interactionContexts():ListModel<InteractionContext> {\n return this._interactions.readonly;\n }\n\n start(context: InteractionContext) {\n this._interactions.push(context);\n }\n\n finish(context: InteractionContext) {\n this._interactions.remove(context);\n }\n\n isActive() {\n return this.active.value;\n }\n\n disableWhen(disabled: ValueModel<boolean>) {\n this._disabledDelegate.setDelegate(disabled);\n }\n }\n\n export class ApiAdapter implements Api {\n\n constructor(private readonly placeRouter: PlaceRouter, private readonly contextRegistry: ContextRegistry) {\n }\n\n // @Trace()\n notifyActive(context: InteractionContext): Promise<any> {\n assert.isTruthy(context.identifier);\n this.contextRegistry.start(context);\n return this.isNavigationInProgress() ? Promise.resolve() : this.placeRouter.syncInteractionContextIdsWithRouter();\n }\n\n // @Trace()\n private isNavigationInProgress() {\n return this.placeRouter.navigationInProgress.value;\n }\n\n // @Trace()\n notifyFinished(context: InteractionContext): Promise<any> {\n this.contextRegistry.finish(context);\n // :: Important ::\n // This method will be traversed by both the place router (during can canDeactivate guards) and user land code\n // (both when routing is idle and while it is active in PlaceComponent.canDeactivate()).\n // The result of pushInteractionIdsToRoute will not start until after the current route finishes, and the\n // current route won't finish until after this promise returns... Deadlock.\n // So in order to keep this logic out of the activities we perform the check here and ensure that\n // any interactions with the context while routing is active returns immediately.\n return this.isNavigationInProgress() ? Promise.resolve() : this.placeRouter.syncInteractionContextIdsWithRouter();\n }\n }\n\n}\n"]}
|