@coolon/angular-ui-powerups 12.4.0-alpha.40 → 12.4.0-alpha.42
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/assets/{activities.scss → activities/activities.scss} +15 -11
- package/assets/activities/input-activities.scss +20 -0
- package/assets/interaction.scss +3 -4
- package/assets/mixins.scss +5 -7
- package/assets/styles.scss +5 -5
- package/bundles/coolon-angular-ui-powerups.umd.js +42 -14
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/components/cards/card-container/card-container.component.js +8 -2
- package/esm2015/lib/components/cards/card-container/card-container.component.js.map +1 -1
- package/esm2015/lib/components/cards/card-container/card-container.component.metadata.json +1 -1
- package/esm2015/lib/components/cards/card-stack/card-stack.component.js +1 -1
- package/esm2015/lib/components/cards/card-stack/card-stack.component.metadata.json +1 -1
- package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm2015/lib/interaction/components/activity-container/activity-container.component.js +1 -1
- 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-triggers/abstract-activity-trigger.component.js.map +1 -1
- package/esm2015/lib/interaction/components/activity-triggers/abstract-activity-trigger.component.metadata.json +1 -1
- package/esm2015/lib/interaction/components/add-card-activity/add-card-activity.component.js +1 -1
- package/esm2015/lib/interaction/components/add-card-activity/add-card-activity.component.metadata.json +1 -1
- package/esm2015/lib/interaction/components/editors/inline-string-editor/inline-string-editor.component.js +2 -1
- package/esm2015/lib/interaction/components/editors/inline-string-editor/inline-string-editor.component.js.map +1 -1
- package/esm2015/lib/interaction/components/input-activities/input-activity.js +21 -2
- package/esm2015/lib/interaction/components/input-activities/input-activity.js.map +1 -1
- package/esm2015/lib/interaction/components/input-activities/input-activity.metadata.json +1 -1
- package/esm2015/lib/interaction/components/input-activities/select-input-activity.js +3 -1
- package/esm2015/lib/interaction/components/input-activities/select-input-activity.js.map +1 -1
- package/esm2015/lib/interaction/components/input-activities/select-input-activity.metadata.json +1 -1
- package/esm2015/lib/interaction/components/input-activities/string-input-activity.js +4 -1
- package/esm2015/lib/interaction/components/input-activities/string-input-activity.js.map +1 -1
- package/esm2015/lib/interaction/components/input-activities/string-input-activity.metadata.json +1 -1
- package/esm2015/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.js +1 -0
- package/esm2015/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.js.map +1 -1
- package/esm2015/lib/interaction/interaction.module.js +2 -0
- 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/fesm2015/coolon-angular-ui-powerups.js +42 -9
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/cards/card-container/card-container.component.d.ts +5 -0
- package/lib/interaction/components/input-activities/input-activity.d.ts +8 -2
- package/lib/interaction/components/input-activities/string-input-activity.d.ts +4 -0
- package/package.json +1 -1
- package/assets/interaction/input-activity.scss +0 -12
package/esm2015/lib/interaction/components/activity-container/activity-container.component.js
CHANGED
|
@@ -190,7 +190,7 @@ export class ActivityContainerComponent extends AbstractInteractionContext {
|
|
|
190
190
|
ActivityContainerComponent.decorators = [
|
|
191
191
|
{ type: Component, args: [{
|
|
192
192
|
selector: 'aup-activity-container',
|
|
193
|
-
template: "<mat-tab-group #tabs no-tab-header\n [dynamicHeight]=\"dynamicHeight\"\n [class.full-height-tabs]=\"!dynamicHeight\">\n <mat-tab *ngFor=\"let activityRef of activityRefs; let i = index; trackBy: activityIndex\">\n <aup-busy-overlay [busyModel]=\"busy\">\n <!--\n We have issues where angular is triggering a leave animation when an\n new activity is started, but is not running the enter animation\n when it is scrolled back into view. So we track the tab changes and\n disable all animations inside the tab while we're animating.\n -->\n <div class=\"activity-outlet-wrapper\" [@.disabled]=\"!activityRef.focused\">\n <aup-activity-outlet [nestedInteractionContext]=\"this\" [activityRef]=\"activityRef\"></aup-activity-outlet>\n </div>\n </aup-busy-overlay>\n </mat-tab>\n</mat-tab-group>\n",
|
|
193
|
+
template: "<mat-tab-group #tabs no-tab-header\n [dynamicHeight]=\"dynamicHeight\"\n [class.full-height-tabs]=\"!dynamicHeight\">\n <mat-tab *ngFor=\"let activityRef of activityRefs; let i = index; trackBy: activityIndex\">\n <aup-busy-overlay [busyModel]=\"busy\" cdkTrapFocus cdkTrapFocusAutoCapture>\n <!--\n We have issues where angular is triggering a leave animation when an\n new activity is started, but is not running the enter animation\n when it is scrolled back into view. So we track the tab changes and\n disable all animations inside the tab while we're animating.\n -->\n <div class=\"activity-outlet-wrapper\" [@.disabled]=\"!activityRef.focused\">\n <aup-activity-outlet [nestedInteractionContext]=\"this\" [activityRef]=\"activityRef\"></aup-activity-outlet>\n </div>\n </aup-busy-overlay>\n </mat-tab>\n</mat-tab-group>\n",
|
|
194
194
|
styles: [":host{display:flex;flex-direction:column}aup-busy-overlay,mat-tab-group{flex:1}"]
|
|
195
195
|
},] }
|
|
196
196
|
];
|
package/esm2015/lib/interaction/components/activity-container/activity-container.component.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-container.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/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,EACL,MAAM,EAEN,oBAAoB,EAEpB,GAAG,EACH,gBAAgB,EAChB,iBAAiB,EAElB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,O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AAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC;gBACvE,IAAI,CAAC,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC;gBAC/B,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;oBACvC,GAAG,CAAC,UAAU,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAA;gBACpC,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC;SACH;IACH,CAAC;IAEO,iBAAiB;QACvB,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IACjE,CAAC;IAED,WAAW;IACX,mBAAmB;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC;IACjC,CAAC;IAED,WAAW;IACH,yBAAyB;QAC/B,IAAI,IAAI,CAAC,sBAAsB,EAAE;YAC/B,YAAY,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;SAC3C;QACD,IAAI,CAAC,sBAAsB,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5C,IAAI,CAAC,sBAAsB,GAAG,IAAI,CAAC;YACnC,IAAI,CAAC,2BAA2B,EAAE,CAAC;QACrC,CAAC,EAAE,EAAE,CAAC,CAAC;IACT,CAAC;;;YA1NF,SAAS,SAAC;gBACT,QAAQ,EAAE,wBAAwB;gBAClC,w3BAAkD;;aAEnD;;;;4BAGE,KAAK;mBAGL,SAAS,SAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;8BAGlC,YAAY,SAAC,uBAAuB","sourcesContent":["import { AfterViewInit, Component, Input, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core';\nimport { MatTabGroup } from '@angular/material/tabs';\nimport {\n assert,\n Constructable,\n DelegatingValueModel,\n Disposable,\n Dsl,\n GarbageCollector,\n MutableValueModel,\n Trace\n} from '@coolon/pectin';\nimport { lang } from '@coolon/typescript-utilities';\nimport _ from 'lodash';\nimport { slideDownOnEnterAnimation } from '../../../animations/slide-animations';\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 activityRefs: 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 readonly inAnimation = new MutableValueModel<boolean>(false);\n\n readonly busy = new DelegatingValueModel<boolean>().withDefault(false);\n\n constructor() {\n super();\n this.registerDisposable(this.busy);\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.activityRefs, 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.activityRefs.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.activityRefs.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.activityRefs = [];\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.activityRefs.filter(tab => !tab.isComplete());\n this.activityRefs = cleanedTabs.concat(activityRef);\n this.synchroniseSelectedTabIndex();\n }\n\n activityIndex(index: number, activityRef: ActivityRef<any, any, any>) {\n return index;\n };\n\n // @Trace()\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 // @Trace()\n private synchroniseSelectedTabIndex(): void {\n const previousIndex = this.tabs.selectedIndex;\n const newIndex = this.getActiveActivityCount() - 1;\n if (previousIndex !== newIndex) {\n this.inAnimation.value = true;\n this.activityRefs[newIndex].setFocused(false);\n this.busy.setDelegate(this.activityRefs[newIndex].activityBusy)\n this.tabs.selectedIndex = newIndex;\n this.onAnimationFinishedJob = () => {\n this.activityRefs = this.activityRefs.filter(tab => !tab.isComplete());\n this.inAnimation.value = false;\n this.activityRefs.forEach((ref, index) => {\n ref.setFocused(index === newIndex)\n })\n };\n }\n }\n\n private getSelectedOutlet() {\n return this.activityOutlets.toArray()[this.tabs.selectedIndex];\n }\n\n // @Trace()\n getSelectedTabIndex() {\n return 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":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/interaction/components/activity-container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BAAwB;gBAClC,65BAAkD;;aAEnD;;;;4BAGE,KAAK;mBAGL,SAAS,SAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;8BAGlC,YAAY,SAAC,uBAAuB","sourcesContent":["import { AfterViewInit, Component, Input, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core';\nimport { MatTabGroup } from '@angular/material/tabs';\nimport {\n assert,\n Constructable,\n DelegatingValueModel,\n Disposable,\n Dsl,\n GarbageCollector,\n MutableValueModel,\n Trace\n} from '@coolon/pectin';\nimport { lang } from '@coolon/typescript-utilities';\nimport _ from 'lodash';\nimport { slideDownOnEnterAnimation } from '../../../animations/slide-animations';\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 activityRefs: 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 readonly inAnimation = new MutableValueModel<boolean>(false);\n\n readonly busy = new DelegatingValueModel<boolean>().withDefault(false);\n\n constructor() {\n super();\n this.registerDisposable(this.busy);\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.activityRefs, 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.activityRefs.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.activityRefs.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.activityRefs = [];\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.activityRefs.filter(tab => !tab.isComplete());\n this.activityRefs = cleanedTabs.concat(activityRef);\n this.synchroniseSelectedTabIndex();\n }\n\n activityIndex(index: number, activityRef: ActivityRef<any, any, any>) {\n return index;\n };\n\n // @Trace()\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 // @Trace()\n private synchroniseSelectedTabIndex(): void {\n const previousIndex = this.tabs.selectedIndex;\n const newIndex = this.getActiveActivityCount() - 1;\n if (previousIndex !== newIndex) {\n this.inAnimation.value = true;\n this.activityRefs[newIndex].setFocused(false);\n this.busy.setDelegate(this.activityRefs[newIndex].activityBusy)\n this.tabs.selectedIndex = newIndex;\n this.onAnimationFinishedJob = () => {\n this.activityRefs = this.activityRefs.filter(tab => !tab.isComplete());\n this.inAnimation.value = false;\n this.activityRefs.forEach((ref, index) => {\n ref.setFocused(index === newIndex)\n })\n };\n }\n }\n\n private getSelectedOutlet() {\n return this.activityOutlets.toArray()[this.tabs.selectedIndex];\n }\n\n // @Trace()\n getSelectedTabIndex() {\n return 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
|
-
[{"__symbolic":"module","version":4,"metadata":{"ActivityContainerComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../abstract-interaction-context","name":"AbstractInteractionContext","line":26,"character":57},"arity":3,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":21,"character":1},"arguments":[{"selector":"aup-activity-container","template":"<mat-tab-group #tabs no-tab-header\n [dynamicHeight]=\"dynamicHeight\"\n [class.full-height-tabs]=\"!dynamicHeight\">\n <mat-tab *ngFor=\"let activityRef of activityRefs; let i = index; trackBy: activityIndex\">\n <aup-busy-overlay [busyModel]=\"busy\">\n <!--\n We have issues where angular is triggering a leave animation when an\n new activity is started, but is not running the enter animation\n when it is scrolled back into view. So we track the tab changes and\n disable all animations inside the tab while we're animating.\n -->\n <div class=\"activity-outlet-wrapper\" [@.disabled]=\"!activityRef.focused\">\n <aup-activity-outlet [nestedInteractionContext]=\"this\" [activityRef]=\"activityRef\"></aup-activity-outlet>\n </div>\n </aup-busy-overlay>\n </mat-tab>\n</mat-tab-group>\n","styles":[":host{display:flex;flex-direction:column}aup-busy-overlay,mat-tab-group{flex:1}"]}]}],"members":{"dynamicHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":28,"character":3}}]}],"tabs":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":31,"character":3},"arguments":["tabs",{"static":true}]}]}],"activityOutlets":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChildren","line":34,"character":3},"arguments":[{"__symbolic":"reference","module":"./activity-outlet/activity-outlet.component","name":"ActivityOutletComponent","line":34,"character":16}]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"initialise":[{"__symbolic":"method"}],"isInitialised":[{"__symbolic":"method"}],"isActive":[{"__symbolic":"method"}],"registerDisposable":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}],"getActiveActivityRef":[{"__symbolic":"method"}],"cancelActiveActivity":[{"__symbolic":"method"}],"createAndLaunchActivity":[{"__symbolic":"method"}],"getActiveActivityCount":[{"__symbolic":"method"}],"isCleaningUp":[{"__symbolic":"method"}],"waitForInteractionContextCleanupToFinish":[{"__symbolic":"method"}],"finishAndStartCleanup":[{"__symbolic":"method"}],"launchActivity":[{"__symbolic":"method"}],"activityIndex":[{"__symbolic":"method"}],"onAnimationFinished":[{"__symbolic":"method"}],"synchroniseSelectedTabIndex":[{"__symbolic":"method"}],"getSelectedOutlet":[{"__symbolic":"method"}],"getSelectedTabIndex":[{"__symbolic":"method"}],"triggerTabSynchronisation":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"ActivityContainerComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../abstract-interaction-context","name":"AbstractInteractionContext","line":26,"character":57},"arity":3,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":21,"character":1},"arguments":[{"selector":"aup-activity-container","template":"<mat-tab-group #tabs no-tab-header\n [dynamicHeight]=\"dynamicHeight\"\n [class.full-height-tabs]=\"!dynamicHeight\">\n <mat-tab *ngFor=\"let activityRef of activityRefs; let i = index; trackBy: activityIndex\">\n <aup-busy-overlay [busyModel]=\"busy\" cdkTrapFocus cdkTrapFocusAutoCapture>\n <!--\n We have issues where angular is triggering a leave animation when an\n new activity is started, but is not running the enter animation\n when it is scrolled back into view. So we track the tab changes and\n disable all animations inside the tab while we're animating.\n -->\n <div class=\"activity-outlet-wrapper\" [@.disabled]=\"!activityRef.focused\">\n <aup-activity-outlet [nestedInteractionContext]=\"this\" [activityRef]=\"activityRef\"></aup-activity-outlet>\n </div>\n </aup-busy-overlay>\n </mat-tab>\n</mat-tab-group>\n","styles":[":host{display:flex;flex-direction:column}aup-busy-overlay,mat-tab-group{flex:1}"]}]}],"members":{"dynamicHeight":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":28,"character":3}}]}],"tabs":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":31,"character":3},"arguments":["tabs",{"static":true}]}]}],"activityOutlets":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChildren","line":34,"character":3},"arguments":[{"__symbolic":"reference","module":"./activity-outlet/activity-outlet.component","name":"ActivityOutletComponent","line":34,"character":16}]}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"ngAfterViewInit":[{"__symbolic":"method"}],"initialise":[{"__symbolic":"method"}],"isInitialised":[{"__symbolic":"method"}],"isActive":[{"__symbolic":"method"}],"registerDisposable":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}],"getActiveActivityRef":[{"__symbolic":"method"}],"cancelActiveActivity":[{"__symbolic":"method"}],"createAndLaunchActivity":[{"__symbolic":"method"}],"getActiveActivityCount":[{"__symbolic":"method"}],"isCleaningUp":[{"__symbolic":"method"}],"waitForInteractionContextCleanupToFinish":[{"__symbolic":"method"}],"finishAndStartCleanup":[{"__symbolic":"method"}],"launchActivity":[{"__symbolic":"method"}],"activityIndex":[{"__symbolic":"method"}],"onAnimationFinished":[{"__symbolic":"method"}],"synchroniseSelectedTabIndex":[{"__symbolic":"method"}],"getSelectedOutlet":[{"__symbolic":"method"}],"getSelectedTabIndex":[{"__symbolic":"method"}],"triggerTabSynchronisation":[{"__symbolic":"method"}]}}}}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstract-activity-trigger.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/interaction/components/activity-triggers/abstract-activity-trigger.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAE,MAAM,EAAE,OAAO,EAAiB,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC9G,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;
|
|
1
|
+
{"version":3,"file":"abstract-activity-trigger.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/interaction/components/activity-triggers/abstract-activity-trigger.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAU,MAAM,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAE,MAAM,EAAE,OAAO,EAAiB,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC9G,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAS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iB,CAAC,oBAAoB,CAAC;;uEACQ;AAIhD;IADC,aAAa,EAAE;8BACI,UAAU;4EAAmC;AAIjE;IADC,iBAAiB,CAAC,mBAAmB,CAAC;;sEACvB;AAIhB;IADC,aAAa,EAAE;8BACG,UAAU;2EAAI;AAIjC;IADC,iBAAiB,CAAC,WAAW,CAAC;;8DACb;AAIlB;IADC,aAAa,EAAE;8BACL,UAAU;mEAAc","sourcesContent":["import { Component, EventEmitter, HostBinding, Input, OnInit, Output } from '@angular/core';\nimport { assert, Command, Constructable, StoreInValueModel, TrackExternal, ValueModel } from '@coolon/pectin';\nimport { lang } from '@coolon/typescript-utilities';\nimport { HorizontalAlignment } from '../../../components/alignment';\nimport { CommandFace } from '../../../components/commands/command-face';\nimport { DisposableComponent } from '../../../components/disposable-component';\nimport { Activity } from '../../activity';\nimport { InteractionContext } from '../../interaction-context';\nimport { InputActivity } from '../input-activities/input-activity';\n\n@Component({\n selector: 'aup-abstract-activity-trigger',\n template: ''\n})\nexport class AbstractActivityTriggerComponent<D = any, R = any, E = any> extends DisposableComponent implements OnInit {\n\n @Input()\n @StoreInValueModel('activityClassModel')\n activityClass: Constructable<Activity<D, R, E>>;\n\n @Input()\n @TrackExternal()\n activityClassModel: ValueModel<Constructable<Activity<D, R, E>>>;\n\n @Input()\n @StoreInValueModel('activityDataModel')\n activityData: D;\n\n @Input()\n @TrackExternal()\n activityDataModel: ValueModel<D>;\n \n @Input()\n @StoreInValueModel('faceModel')\n face: CommandFace;\n\n @Input()\n @TrackExternal()\n faceModel: ValueModel<CommandFace>;\n\n @Input()\n alignFace: HorizontalAlignment = HorizontalAlignment.CENTER;\n\n readonly startActivityCommand: Command<unknown>;\n\n get interactionContext(): InteractionContext {\n return lang.abstractMethod(this.constructor)\n }\n\n @Output()\n confirmEvent = new EventEmitter<R>();\n\n @Output()\n cancelEvent = new EventEmitter<E>();\n\n constructor() {\n super();\n this.startActivityCommand = Command.create(() => {\n assert.notNil(this.activityClass);\n assert.notNil(this.interactionContext);\n this.interactionContext.startActivity(this.activityClass, this.activityData)\n .then(result => {\n this.confirmEvent.emit(result);\n }).catch(error => {\n this.cancelEvent.emit(error);\n });\n });\n }\n\n ngOnInit(): void {\n }\n\n @HostBinding('class.active')\n get isActive() {\n return this.interactionContext?.isActive();\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"AbstractActivityTriggerComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../components/disposable-component","name":"DisposableComponent","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AbstractActivityTriggerComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../components/disposable-component","name":"DisposableComponent","line":14,"character":81},"arity":3,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":10,"character":1},"arguments":[{"selector":"aup-abstract-activity-trigger","template":""}]}],"members":{"activityClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":16,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":17,"character":3},"arguments":["activityClassModel"]}]}],"activityClassModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":21,"character":3}}]}],"activityData":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":24,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":25,"character":3},"arguments":["activityDataModel"]}]}],"activityDataModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":28,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":29,"character":3}}]}],"face":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":33,"character":3},"arguments":["faceModel"]}]}],"faceModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":37,"character":3}}]}],"alignFace":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":40,"character":3}}]}],"confirmEvent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":49,"character":3}}]}],"cancelEvent":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":52,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"isActive":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":72,"character":3},"arguments":["class.active"]}]}]}}}}]
|
|
@@ -50,7 +50,7 @@ AddCardActivityComponent.decorators = [
|
|
|
50
50
|
{ type: Component, args: [{
|
|
51
51
|
selector: 'aup-add-card-activity',
|
|
52
52
|
template: "<aup-in-place-interaction-context [animateFirstActivity]=\"false\" [pectinCommand]=\"startActivityCommand\">\n <aup-command *ngIf=\"isRenderAsButton()\" [command]=\"startActivityCommand\" [faceModel]=\"faceModel\" [alignFace]=\"alignFace\"></aup-command>\n <section *ngIf=\"isRenderAsCard()\" class=\"face-wrapper\">\n <aup-command-face class=\"mat-button\" [faces]=\"faceList.value\"></aup-command-face>\n </section>\n</aup-in-place-interaction-context>\n",
|
|
53
|
-
styles: [":host{display:flex;flex-direction:column;align-items:stretch;background-color:#fff}:host[interactionStyle=inline][renderas=card]:not(.active){box-sizing:border-box;border:2px dashed rgba(0,0,0,.1);border-radius:6px;font-weight:300;cursor:pointer;color:rgba(0,0,0,.54);background-color:hsla(0,0%,100%,.8)
|
|
53
|
+
styles: [":host{display:flex;flex-direction:column;align-items:stretch;background-color:#fff}:host[interactionStyle=inline][renderas=card]:not(.active){transition:box-shadow .28s cubic-bezier(.4,0,.2,1);box-sizing:border-box;border:2px dashed rgba(0,0,0,.1);border-radius:6px;font-weight:300;cursor:pointer;color:rgba(0,0,0,.54);background-color:hsla(0,0%,100%,.8)}:host[interactionStyle=inline][renderas=card]:not(.active):hover{box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}:host[interactionStyle=inline][renderas=card]:not(.active):hover{border-color:transparent;background-color:#fff;color:rgba(0,0,0,.54)}:host[interactionStyle=modal][renderas=card]{transition:box-shadow .28s cubic-bezier(.4,0,.2,1);box-sizing:border-box;border:2px dashed rgba(0,0,0,.1);border-radius:6px;font-weight:300;cursor:pointer;color:rgba(0,0,0,.54);background-color:hsla(0,0%,100%,.8)}:host[interactionStyle=modal][renderas=card]:hover{box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}:host[interactionStyle=modal][renderas=card]:hover{border-color:transparent;background-color:#fff;color:rgba(0,0,0,.54)}:host-context(aup-card-container)[renderas=button]{align-self:start}section.face-wrapper{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}aup-in-place-interaction-context{flex:1}aup-in-place-interaction-context.active{border:3px solid #6273c7;border-radius:4px;overflow:hidden}"]
|
|
54
54
|
},] }
|
|
55
55
|
];
|
|
56
56
|
AddCardActivityComponent.ctorParameters = () => [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"AddCardActivityComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../activity-triggers/abstract-activity-trigger.component","name":"AbstractActivityTriggerComponent","line":17,"character":46},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":12,"character":1},"arguments":[{"selector":"aup-add-card-activity","template":"<aup-in-place-interaction-context [animateFirstActivity]=\"false\" [pectinCommand]=\"startActivityCommand\">\n <aup-command *ngIf=\"isRenderAsButton()\" [command]=\"startActivityCommand\" [faceModel]=\"faceModel\" [alignFace]=\"alignFace\"></aup-command>\n <section *ngIf=\"isRenderAsCard()\" class=\"face-wrapper\">\n <aup-command-face class=\"mat-button\" [faces]=\"faceList.value\"></aup-command-face>\n </section>\n</aup-in-place-interaction-context>\n","styles":[":host{display:flex;flex-direction:column;align-items:stretch;background-color:#fff}:host[interactionStyle=inline][renderas=card]:not(.active){box-sizing:border-box;border:2px dashed rgba(0,0,0,.1);border-radius:6px;font-weight:300;cursor:pointer;color:rgba(0,0,0,.54);background-color:hsla(0,0%,100%,.8)
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AddCardActivityComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../activity-triggers/abstract-activity-trigger.component","name":"AbstractActivityTriggerComponent","line":17,"character":46},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":12,"character":1},"arguments":[{"selector":"aup-add-card-activity","template":"<aup-in-place-interaction-context [animateFirstActivity]=\"false\" [pectinCommand]=\"startActivityCommand\">\n <aup-command *ngIf=\"isRenderAsButton()\" [command]=\"startActivityCommand\" [faceModel]=\"faceModel\" [alignFace]=\"alignFace\"></aup-command>\n <section *ngIf=\"isRenderAsCard()\" class=\"face-wrapper\">\n <aup-command-face class=\"mat-button\" [faces]=\"faceList.value\"></aup-command-face>\n </section>\n</aup-in-place-interaction-context>\n","styles":[":host{display:flex;flex-direction:column;align-items:stretch;background-color:#fff}:host[interactionStyle=inline][renderas=card]:not(.active){transition:box-shadow .28s cubic-bezier(.4,0,.2,1);box-sizing:border-box;border:2px dashed rgba(0,0,0,.1);border-radius:6px;font-weight:300;cursor:pointer;color:rgba(0,0,0,.54);background-color:hsla(0,0%,100%,.8)}:host[interactionStyle=inline][renderas=card]:not(.active):hover{box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}:host[interactionStyle=inline][renderas=card]:not(.active):hover{border-color:transparent;background-color:#fff;color:rgba(0,0,0,.54)}:host[interactionStyle=modal][renderas=card]{transition:box-shadow .28s cubic-bezier(.4,0,.2,1);box-sizing:border-box;border:2px dashed rgba(0,0,0,.1);border-radius:6px;font-weight:300;cursor:pointer;color:rgba(0,0,0,.54);background-color:hsla(0,0%,100%,.8)}:host[interactionStyle=modal][renderas=card]:hover{box-shadow:0 3px 1px -2px rgba(0,0,0,.2),0 2px 2px 0 rgba(0,0,0,.14),0 1px 5px 0 rgba(0,0,0,.12)}:host[interactionStyle=modal][renderas=card]:hover{border-color:transparent;background-color:#fff;color:rgba(0,0,0,.54)}:host-context(aup-card-container)[renderas=button]{align-self:start}section.face-wrapper{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center}aup-in-place-interaction-context{flex:1}aup-in-place-interaction-context.active{border:3px solid #6273c7;border-radius:4px;overflow:hidden}"]}]}],"members":{"inlineInteractionContext":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":21,"character":3},"arguments":[{"__symbolic":"reference","module":"../inplace-interaction-context/in-place-interaction-context.component","name":"InPlaceInteractionContextComponent","line":21,"character":13},{"static":true}]}]}],"interactionStyle":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":24,"character":3}}]}],"renderAs":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":28,"character":3},"arguments":["class"]}]}],"notCard":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":31,"character":3},"arguments":["class.not-card"]}]}],"renderAsClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":36,"character":3},"arguments":["class"]}]}],"activityTypeClass":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":41,"character":3},"arguments":["class"]}]}],"isRenderAsCard":[{"__symbolic":"method"}],"isRenderAsButton":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../services/interaction.service","name":"InteractionService","line":54,"character":34}]}],"ngOnInit":[{"__symbolic":"method"}],"isModal":[{"__symbolic":"method"}],"isInline":[{"__symbolic":"method"}]}}}}]
|
|
@@ -77,7 +77,8 @@ export class InlineStringEditorComponent extends DisposableComponent {
|
|
|
77
77
|
const self = this;
|
|
78
78
|
return {
|
|
79
79
|
initialValue: self.editorModel.valueModel.value,
|
|
80
|
-
|
|
80
|
+
confirmFace: self.saveFace.value,
|
|
81
|
+
cancelFace: self.cancelFace.value,
|
|
81
82
|
placeholder: self.placeHolderModel.value,
|
|
82
83
|
label: self.label,
|
|
83
84
|
layout: InputActivity.Layout.INLINE,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline-string-editor.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/angular-ui-powerups/src/lib/interaction/components/editors/inline-string-editor/inline-string-editor.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAe,KAAK,EAAU,SAAS,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAEL,OAAO,EAAE,oBAAoB,EAC7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ular/core';\nimport {\n BooleanValueModelChain,\n Command, DelegatingValueModel,\n Dsl,\n StoreInValueModel,\n TrackExternal,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport { lang } from '@coolon/typescript-utilities';\nimport * as _ from 'lodash';\nimport { CommandFace } from '../../../../components/commands/command-face';\nimport { DisposableComponent } from '../../../../components/disposable-component';\nimport { InteractionService } from '../../../services/interaction.service';\nimport { InPlaceInteractionContextComponent } from '../../inplace-interaction-context/in-place-interaction-context.component';\nimport { InputActivity } from '../../input-activities/input-activity';\nimport { StringInputActivity } from '../../input-activities/string-input-activity';\nimport { InlineEditorModel } from './inline-editor-model';\n\n/**\n * @example\n * const source: ValueModel<string> = ...;\n * const model = InlineEditorModel.create(source, {\n * save(updated:string, context: EditContext) => {\n * try {\n * try and save the thing...\n * } catch(error) {\n * context.injectError(error)\n * }\n * }).validateUsing(Validator.present(\"We'll need a value\");\n *\n * # in the view\n * <aup-inline-string-editor\n * label=\"My field\"\n * placeHolder=\"I'm ready for a string...\"\n * [editorModel]=\"model\"></aup-inline-string-editor>\n */\n@Component({\n selector: 'aup-inline-string-editor',\n templateUrl: './inline-string-editor.component.html',\n styleUrls: [] // See assets/interaction/editor/inline-string-editor.scss\n})\nexport class InlineStringEditorComponent extends DisposableComponent implements OnInit {\n\n @Input()\n @TrackExternal()\n editorModel: InlineEditorModel<string>;\n\n @Input()\n @TrackExternal()\n facesModel: ValueModel<InlineStringEditorComponent.Faces>;\n\n @Input()\n @StoreInValueModel('facesModel')\n faces: InlineStringEditorComponent.Faces;\n\n @ViewChild(InPlaceInteractionContextComponent)\n interactionContext: InPlaceInteractionContextComponent<any, any, any>;\n\n @Input()\n label: string;\n\n @Input()\n @StoreInValueModel('placeHolderModel')\n placeHolder: string;\n\n @Input()\n @TrackExternal()\n placeHolderModel: ValueModel<string>;\n\n readonly description: ValueModelChain<string>;\n empty: BooleanValueModelChain;\n readonly editCommand: Command<void>;\n\n displayValue: ValueModelChain<string>;\n readonly editFaceModel: ValueModelChain<CommandFace>;\n readonly saveFace: ValueModelChain<CommandFace>;\n readonly cancelFace: ValueModelChain<CommandFace>;\n\n readonly editingEnabled = this.registerDisposable(new DelegatingValueModel<boolean>());\n\n constructor(interactionService: InteractionService) {\n super();\n const { chain, when, valueOf } = Dsl.disposeWith(this);\n const modalIC = interactionService.createModalInteractionContextDisposedWith(this);\n\n const resolvedFacesModel = chain(this.facesModel).map(userFaces => {\n return {\n ...InlineStringEditorComponent.DEFAULT_FACES, // todo: should really inject app wide defaults as well\n ...userFaces\n };\n }, { allowNil: true });\n\n this.editFaceModel = resolvedFacesModel.pluck('edit');\n this.saveFace = resolvedFacesModel.pluck('save');\n this.cancelFace = resolvedFacesModel.pluck('cancel');\n\n const self = this;\n this.editCommand = Command.create(async () => {\n this.editorModel.editing.value = true;\n try {\n await this.interactionContext.startActivity(StringInputActivity, this.createInputActivityData());\n } catch (e) {\n // don't care if they cancelled, just hiding the console errors\n } finally {\n this.editorModel.editing.value = false;\n }\n }).enableWhile(this.editingEnabled);\n\n this.onDispose(() => this.cancelEdit());\n\n }\n\n\n ngOnInit(): void {\n // our editor model is a one time binding without delegates so we can only\n // use it once we've been initialised\n const { chain, when, valueOf } = Dsl.disposeWith(this);\n\n if (!this.editorModel) {\n lang.illegalState('editorModel is required');\n }\n\n this.editingEnabled.setDelegate(this.editorModel.editingEnabled);\n\n when(this.editorModel.editing).becomesTruthy(() => {\n this.editCommand.execute();\n }, { asLongAs: this.editCommand.enabled });\n\n when(this.editorModel.editing).becomesFalsey(() => this.cancelEdit());\n\n this.empty = valueOf.any(\n chain.stringValue(this.editorModel.valueModel).isBlank()\n // deviceDescription.isNil()\n ).areTruthy();\n\n this.displayValue = chain(this.editorModel.valueModel).map(v => {\n return _.isEmpty(v) ? this.placeHolderModel.value : v;\n }, { dependsOn: this.placeHolderModel, allowNil: true });\n\n }\n\n\n private createInputActivityData(): InputActivity.Data<string> {\n const self = this;\n return {\n initialValue: self.editorModel.valueModel.value,\n buttonStyle: { confirm: self.saveFace.value, cancel: self.cancelFace.value },\n placeholder: self.placeHolderModel.value,\n label: self.label,\n layout: InputActivity.Layout.INLINE,\n validators: self.editorModel.validators.value,\n async save(value: string, inputContext: InputActivity.Context): Promise<void> {\n await self.editorModel.saveCallback(value, inputContext);\n }\n };\n }\n\n cancelEdit() {\n if (this.isEditing()) {\n this.interactionContext.cancelActiveActivity();\n }\n }\n\n startEdit() {\n if (!this.isEditing() && this.editCommand.enabled.value) {\n this.editCommand.execute();\n }\n }\n\n private isEditing() {\n return this.interactionContext.isActive();\n }\n\n isEmpty(): boolean {\n return this.empty.value;\n }\n\n\n}\n\nexport namespace InlineStringEditorComponent {\n\n export interface Faces {\n edit?: CommandFace;\n save?: CommandFace;\n cancel?: CommandFace;\n }\n\n export const DEFAULT_FACES: Faces = {\n edit: {\n icon: () => 'mat:edit'\n },\n save: {\n icon: () => 'mat:check'\n },\n cancel: {\n icon: () => 'mat:clear'\n }\n };\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"inline-string-editor.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/angular-ui-powerups/src/lib/interaction/components/editors/inline-string-editor/inline-string-editor.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAe,KAAK,EAAU,SAAS,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAEL,OAAO,EAAE,oBAAoB,EAC7B,GAAG,EACH,iBAAiB,EACjB,aAAa,EACb,UAAU,EAEX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAC;AAClF,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,kCAAkC,EAAE,MAAM,0EAA0E,CAAC;AAC9H,OAAO,EAAE,aAAa,EAAE,MAAM,uCAA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OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;IAC1B,CAAC;;;YA5IF,SAAS,SAAC;gBACT,QAAQ,EAAE,0BAA0B;gBACpC,w7BAAoD;aAErD;;;YA5BQ,kBAAkB;;;0BA+BxB,KAAK;yBAIL,KAAK;oBAIL,KAAK;iCAIL,SAAS,SAAC,kCAAkC;oBAG5C,KAAK;0BAGL,KAAK;+BAIL,KAAK;;AApBN;IADC,aAAa,EAAE;8BACH,iBAAiB;gEAAS;AAIvC;IADC,aAAa,EAAE;8BACJ,UAAU;+DAAoC;AAI1D;IADC,iBAAiB,CAAC,YAAY,CAAC;;0DACS;AAUzC;IADC,iBAAiB,CAAC,kBAAkB,CAAC;;gEAClB;AAIpB;IADC,aAAa,EAAE;8BACE,UAAU;qEAAS;AAkHvC,WAAiB,2BAA2B;IAQ7B,yCAAa,GAAU;QAClC,IAAI,EAAE;YACJ,IAAI,EAAE,GAAG,EAAE,CAAC,UAAU;SACvB;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,GAAG,EAAE,CAAC,WAAW;SACxB;QACD,MAAM,EAAE;YACN,IAAI,EAAE,GAAG,EAAE,CAAC,WAAW;SACxB;KACF,CAAC;AAEJ,CAAC,EApBgB,2BAA2B,KAA3B,2BAA2B,QAoB3C","sourcesContent":["import { Component, HostBinding, Input, OnInit, ViewChild } from '@angular/core';\nimport {\n BooleanValueModelChain,\n Command, DelegatingValueModel,\n Dsl,\n StoreInValueModel,\n TrackExternal,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport { lang } from '@coolon/typescript-utilities';\nimport * as _ from 'lodash';\nimport { CommandFace } from '../../../../components/commands/command-face';\nimport { DisposableComponent } from '../../../../components/disposable-component';\nimport { InteractionService } from '../../../services/interaction.service';\nimport { InPlaceInteractionContextComponent } from '../../inplace-interaction-context/in-place-interaction-context.component';\nimport { InputActivity } from '../../input-activities/input-activity';\nimport { StringInputActivity } from '../../input-activities/string-input-activity';\nimport { InlineEditorModel } from './inline-editor-model';\n\n/**\n * @example\n * const source: ValueModel<string> = ...;\n * const model = InlineEditorModel.create(source, {\n * save(updated:string, context: EditContext) => {\n * try {\n * try and save the thing...\n * } catch(error) {\n * context.injectError(error)\n * }\n * }).validateUsing(Validator.present(\"We'll need a value\");\n *\n * # in the view\n * <aup-inline-string-editor\n * label=\"My field\"\n * placeHolder=\"I'm ready for a string...\"\n * [editorModel]=\"model\"></aup-inline-string-editor>\n */\n@Component({\n selector: 'aup-inline-string-editor',\n templateUrl: './inline-string-editor.component.html',\n styleUrls: [] // See assets/interaction/editor/inline-string-editor.scss\n})\nexport class InlineStringEditorComponent extends DisposableComponent implements OnInit {\n\n @Input()\n @TrackExternal()\n editorModel: InlineEditorModel<string>;\n\n @Input()\n @TrackExternal()\n facesModel: ValueModel<InlineStringEditorComponent.Faces>;\n\n @Input()\n @StoreInValueModel('facesModel')\n faces: InlineStringEditorComponent.Faces;\n\n @ViewChild(InPlaceInteractionContextComponent)\n interactionContext: InPlaceInteractionContextComponent<any, any, any>;\n\n @Input()\n label: string;\n\n @Input()\n @StoreInValueModel('placeHolderModel')\n placeHolder: string;\n\n @Input()\n @TrackExternal()\n placeHolderModel: ValueModel<string>;\n\n readonly description: ValueModelChain<string>;\n empty: BooleanValueModelChain;\n readonly editCommand: Command<void>;\n\n displayValue: ValueModelChain<string>;\n readonly editFaceModel: ValueModelChain<CommandFace>;\n readonly saveFace: ValueModelChain<CommandFace>;\n readonly cancelFace: ValueModelChain<CommandFace>;\n\n readonly editingEnabled = this.registerDisposable(new DelegatingValueModel<boolean>());\n\n constructor(interactionService: InteractionService) {\n super();\n const { chain, when, valueOf } = Dsl.disposeWith(this);\n const modalIC = interactionService.createModalInteractionContextDisposedWith(this);\n\n const resolvedFacesModel = chain(this.facesModel).map(userFaces => {\n return {\n ...InlineStringEditorComponent.DEFAULT_FACES, // todo: should really inject app wide defaults as well\n ...userFaces\n };\n }, { allowNil: true });\n\n this.editFaceModel = resolvedFacesModel.pluck('edit');\n this.saveFace = resolvedFacesModel.pluck('save');\n this.cancelFace = resolvedFacesModel.pluck('cancel');\n\n const self = this;\n this.editCommand = Command.create(async () => {\n this.editorModel.editing.value = true;\n try {\n await this.interactionContext.startActivity(StringInputActivity, this.createInputActivityData());\n } catch (e) {\n // don't care if they cancelled, just hiding the console errors\n } finally {\n this.editorModel.editing.value = false;\n }\n }).enableWhile(this.editingEnabled);\n\n this.onDispose(() => this.cancelEdit());\n\n }\n\n\n ngOnInit(): void {\n // our editor model is a one time binding without delegates so we can only\n // use it once we've been initialised\n const { chain, when, valueOf } = Dsl.disposeWith(this);\n\n if (!this.editorModel) {\n lang.illegalState('editorModel is required');\n }\n\n this.editingEnabled.setDelegate(this.editorModel.editingEnabled);\n\n when(this.editorModel.editing).becomesTruthy(() => {\n this.editCommand.execute();\n }, { asLongAs: this.editCommand.enabled });\n\n when(this.editorModel.editing).becomesFalsey(() => this.cancelEdit());\n\n this.empty = valueOf.any(\n chain.stringValue(this.editorModel.valueModel).isBlank()\n // deviceDescription.isNil()\n ).areTruthy();\n\n this.displayValue = chain(this.editorModel.valueModel).map(v => {\n return _.isEmpty(v) ? this.placeHolderModel.value : v;\n }, { dependsOn: this.placeHolderModel, allowNil: true });\n\n }\n\n\n private createInputActivityData(): InputActivity.Data<string> {\n const self = this;\n return {\n initialValue: self.editorModel.valueModel.value,\n confirmFace: self.saveFace.value,\n cancelFace: self.cancelFace.value,\n placeholder: self.placeHolderModel.value,\n label: self.label,\n layout: InputActivity.Layout.INLINE,\n validators: self.editorModel.validators.value,\n async save(value: string, inputContext: InputActivity.Context): Promise<void> {\n await self.editorModel.saveCallback(value, inputContext);\n }\n };\n }\n\n cancelEdit() {\n if (this.isEditing()) {\n this.interactionContext.cancelActiveActivity();\n }\n }\n\n startEdit() {\n if (!this.isEditing() && this.editCommand.enabled.value) {\n this.editCommand.execute();\n }\n }\n\n private isEditing() {\n return this.interactionContext.isActive();\n }\n\n isEmpty(): boolean {\n return this.empty.value;\n }\n\n\n}\n\nexport namespace InlineStringEditorComponent {\n\n export interface Faces {\n edit?: CommandFace;\n save?: CommandFace;\n cancel?: CommandFace;\n }\n\n export const DEFAULT_FACES: Faces = {\n edit: {\n icon: () => 'mat:edit'\n },\n save: {\n icon: () => 'mat:check'\n },\n cancel: {\n icon: () => 'mat:clear'\n }\n };\n\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
|
-
import { Component, HostBinding, Inject, Input } from '@angular/core';
|
|
2
|
+
import { Component, HostBinding, HostListener, Inject, Input } from '@angular/core';
|
|
3
3
|
import { Command, DirtyTrackingForm } from '@coolon/pectin';
|
|
4
|
+
import * as _ from 'lodash';
|
|
4
5
|
import { Enum } from 'typescript-string-enums';
|
|
5
6
|
import { Activity, ACTIVITY_DATA } from '../../activity';
|
|
6
7
|
// @see https://github.com/ng-packagr/ng-packagr/issues/641 and https://github.com/angular/angular/issues/21123
|
|
@@ -8,12 +9,20 @@ import { Activity, ACTIVITY_DATA } from '../../activity';
|
|
|
8
9
|
// @dynamic
|
|
9
10
|
export class InputActivity extends Activity {
|
|
10
11
|
constructor(data) {
|
|
12
|
+
var _a, _b;
|
|
11
13
|
super();
|
|
12
14
|
this.data = data;
|
|
13
15
|
this.class = 'aup-input-activity';
|
|
14
16
|
const form = new DirtyTrackingForm();
|
|
15
17
|
this.valueModel = form.valueModel(this.data.initialValue);
|
|
16
18
|
this.valueModel.validateUsing(data.validators || []);
|
|
19
|
+
// TODO: move to global configuration
|
|
20
|
+
this.confirmFace = (_a = data.confirmFace) !== null && _a !== void 0 ? _a : {
|
|
21
|
+
icon: () => 'mat:check'
|
|
22
|
+
};
|
|
23
|
+
this.cancelFace = (_b = data.cancelFace) !== null && _b !== void 0 ? _b : {
|
|
24
|
+
icon: () => 'mat:clear'
|
|
25
|
+
};
|
|
17
26
|
this.confirmCommand = Command.create(() => __awaiter(this, void 0, void 0, function* () {
|
|
18
27
|
if (this.valueModel.validate()) {
|
|
19
28
|
if (data.save) {
|
|
@@ -51,6 +60,15 @@ export class InputActivity extends Activity {
|
|
|
51
60
|
onActivityReady() {
|
|
52
61
|
this.valueModel.focusContext.requestFocus();
|
|
53
62
|
}
|
|
63
|
+
onEscape() {
|
|
64
|
+
if (this.shouldCancelOnEscape() && this.cancelCommand.enabled.value) {
|
|
65
|
+
this.cancelCommand.execute();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
shouldCancelOnEscape() {
|
|
69
|
+
return _.isNil(this.data.cancelOnEscape) // we default to true..
|
|
70
|
+
|| this.data.cancelOnEscape;
|
|
71
|
+
}
|
|
54
72
|
}
|
|
55
73
|
InputActivity.decorators = [
|
|
56
74
|
{ type: Component, args: [{ template: `` },] }
|
|
@@ -60,7 +78,8 @@ InputActivity.ctorParameters = () => [
|
|
|
60
78
|
];
|
|
61
79
|
InputActivity.propDecorators = {
|
|
62
80
|
class: [{ type: HostBinding, args: ['class',] }],
|
|
63
|
-
layout: [{ type: Input }, { type: HostBinding, args: ['attr.layout',] }]
|
|
81
|
+
layout: [{ type: Input }, { type: HostBinding, args: ['attr.layout',] }],
|
|
82
|
+
onEscape: [{ type: HostListener, args: ['keydown.escape',] }]
|
|
64
83
|
};
|
|
65
84
|
(function (InputActivity) {
|
|
66
85
|
InputActivity.Layout = Enum({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-activity.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/interaction/components/input-activities/input-activity.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"input-activity.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/interaction/components/input-activities/input-activity.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EA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cAAc,CAAC;IAChC,CAAC;;;YA9EF,SAAS,SAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;;;4CAkBZ,MAAM,SAAC,aAAa;;;oBAXhC,WAAW,SAAC,OAAO;qBAKnB,KAAK,YACL,WAAW,SAAC,aAAa;uBAuDzB,YAAY,SAAC,gBAAgB;;AAchC,WAAiB,aAAa;IAEf,oBAAM,GAAG,IAAI,CAAC;QACzB,MAAM,EAAE,QAAQ;QAChB,KAAK,EAAE,OAAO;KACf,CAAC,CAAC;AAmBL,CAAC,EAxBgB,aAAa,KAAb,aAAa,QAwB7B","sourcesContent":["import { Component, HostBinding, HostListener, Inject, Input } from '@angular/core';\nimport { Command, DirtyTrackingForm, Form, Validator } from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { Enum } from 'typescript-string-enums';\nimport { CommandFace } from '../../../components/commands/command-face';\nimport { Activity, ACTIVITY_DATA } from '../../activity';\n\n// @see https://github.com/ng-packagr/ng-packagr/issues/641 and https://github.com/angular/angular/issues/21123\n// we're getting a metadata error for D for no reason that I can find and only during the build (ng serve works fine)\n// @dynamic\n@Component({ template: `` })\nexport class InputActivity<T, D extends InputActivity.Data<T> = InputActivity.Data<T>> extends Activity<D, T> {\n\n readonly confirmCommand: Command<void>;\n readonly cancelCommand: Command<void>;\n readonly valueModel: Form.ValueModelBase<T>;\n\n @HostBinding('class') class = 'aup-input-activity';\n\n readonly confirmFace: CommandFace;\n readonly cancelFace: CommandFace;\n\n @Input()\n @HostBinding('attr.layout')\n get layout(): InputActivity.Layout {\n return this.data?.layout ?? InputActivity.Layout.BLOCK;\n }\n\n constructor(@Inject(ACTIVITY_DATA) readonly data: D) {\n super();\n\n const form = new DirtyTrackingForm();\n this.valueModel = form.valueModel<T>(this.data.initialValue);\n this.valueModel.validateUsing(data.validators || []);\n\n // TODO: move to global configuration\n this.confirmFace = data.confirmFace ?? {\n icon: () => 'mat:check'\n };\n this.cancelFace = data.cancelFace ?? {\n icon: () => 'mat:clear'\n };\n\n this.confirmCommand = Command.create(async () => {\n if (this.valueModel.validate()) {\n if (data.save) {\n const self = this;\n try {\n let allGood = true;\n const result = await data.save(this.valueModel.value, {\n injectError(error: string) {\n allGood = false;\n self.valueModel.injectErrors([error]);\n }\n });\n if (allGood) {\n this.done(this.valueModel.value);\n }\n } catch (e) {\n console.error(e);\n }\n } else {\n this.done(this.valueModel.value);\n }\n\n }\n });\n this.cancelCommand = Command.create(() => {\n this.cancel();\n });\n\n this.busyWhile(this.confirmCommand.busy);\n }\n\n onActivityReady() {\n this.valueModel.focusContext.requestFocus();\n }\n\n @HostListener('keydown.escape')\n onEscape() {\n if (this.shouldCancelOnEscape() && this.cancelCommand.enabled.value) {\n this.cancelCommand.execute();\n }\n }\n\n shouldCancelOnEscape(): boolean {\n return _.isNil(this.data.cancelOnEscape) // we default to true..\n || this.data.cancelOnEscape;\n }\n\n}\n\nexport namespace InputActivity {\n\n export const Layout = Enum({\n INLINE: 'inline',\n BLOCK: 'block'\n });\n export type Layout = Enum<typeof Layout>;\n\n export interface Context {\n injectError(error: string);\n }\n\n export interface Data<T> {\n initialValue: T;\n label?: string;\n placeholder?: string;\n layout?: InputActivity.Layout\n confirmFace?: CommandFace,\n cancelFace?: CommandFace,\n validators?: Validator<T>[],\n cancelOnEscape?: boolean,\n\n save?(valueModel: T, interactionContext?: Context): void | Promise<void>\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"InputActivity":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../activity","name":"Activity","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"InputActivity":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../activity","name":"Activity","line":11,"character":95},"arity":2,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":10,"character":1},"arguments":[{"template":""}]}],"members":{"class":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":17,"character":3},"arguments":["class"]}]}],"layout":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":22,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":23,"character":3},"arguments":["attr.layout"]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":28,"character":15},"arguments":[{"__symbolic":"reference","module":"../../activity","name":"ACTIVITY_DATA","line":28,"character":22}]}]],"parameters":[{"__symbolic":"error","message":"Could not resolve type","line":28,"character":52,"context":{"typeName":"D"}}]}],"onActivityReady":[{"__symbolic":"method"}],"onEscape":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostListener","line":78,"character":3},"arguments":["keydown.escape"]}]}],"shouldCancelOnEscape":[{"__symbolic":"method"}]}}}}]
|
|
@@ -28,7 +28,9 @@ SelectInputActivity.decorators = [
|
|
|
28
28
|
[options]="options"
|
|
29
29
|
[optionLabelFormat]="optionLabelFormat"
|
|
30
30
|
></aup-select-input>
|
|
31
|
-
<aup-activity-actions [layout]="layout" align="end"
|
|
31
|
+
<aup-activity-actions [layout]="layout" align="end"
|
|
32
|
+
[confirmFace]="confirmFace"
|
|
33
|
+
[cancelFace]="cancelFace"
|
|
32
34
|
></aup-activity-actions>
|
|
33
35
|
`
|
|
34
36
|
},] }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-input-activity.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/interaction/components/input-activities/select-input-activity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"select-input-activity.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/interaction/components/input-activities/select-input-activity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAmBjD,MAAM,OAAO,mBAAuB,SAAQ,aAA6C;IAjBzF;;QAmBW,6BAAwB,GAAG,CAAC,MAAS,EAAE,EAAE;YAChD,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;QACxE,CAAC,CAAC;IASJ,CAAC;IAPC,IAAI,iBAAiB;;QACnB,OAAO,MAAA,IAAI,CAAC,IAAI,CAAC,iBAAiB,mCAAI,IAAI,CAAC,wBAAwB,CAAC;IACtE,CAAC;IAED,IAAI,OAAO;;QACT,OAAO,CAAA,MAAA,IAAI,CAAC,IAAI,CAAC,YAAY,0CAAE,KAAK,KAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC5D,CAAC;;;YA7BF,SAAS,SAAC;gBACT,QAAQ,EAAE,2BAA2B;gBACrC,QAAQ,EAAE;;;;;;;;;;;;;GAaT;aACF","sourcesContent":["import { Component } from '@angular/core';\nimport { ListModel } from '@coolon/pectin';\nimport { InputActivity } from './input-activity';\n\n@Component({\n selector: 'aup-select-input-activity',\n template: `\n <aup-select-input [valueModel]=\"valueModel\"\n [label]=\"data.label\"\n [placeholder]=\"data.placeholder\"\n [command.enter]=\"confirmCommand\"\n [command.escape]=\"cancelCommand\"\n [options]=\"options\"\n [optionLabelFormat]=\"optionLabelFormat\"\n ></aup-select-input>\n <aup-activity-actions [layout]=\"layout\" align=\"end\"\n [confirmFace]=\"confirmFace\"\n [cancelFace]=\"cancelFace\"\n ></aup-activity-actions>\n `\n})\nexport class SelectInputActivity<T> extends InputActivity<T, SelectInputActivity.Data<T>> {\n\n readonly defaultOptionLabelFormat = (option: T) => {\n return this.data.optionLabel ? option[this.data.optionLabel] : option;\n };\n\n get optionLabelFormat() {\n return this.data.optionLabelFormat ?? this.defaultOptionLabelFormat;\n }\n\n get options(): T[] {\n return this.data.optionsModel?.value || this.data.options;\n }\n}\n\nexport namespace SelectInputActivity {\n export interface Data<T> extends InputActivity.Data<T> {\n options?: T[];\n optionsModel?: ListModel<T>;\n optionLabel?: keyof T;\n optionLabelFormat?: (option: T) => any;\n }\n}\n"]}
|
package/esm2015/lib/interaction/components/input-activities/select-input-activity.metadata.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"SelectInputActivity":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./input-activity","name":"InputActivity","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"SelectInputActivity":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./input-activity","name":"InputActivity","line":21,"character":44},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"aup-select-input-activity","template":"\n <aup-select-input [valueModel]=\"valueModel\"\n [label]=\"data.label\"\n [placeholder]=\"data.placeholder\"\n [command.enter]=\"confirmCommand\"\n [command.escape]=\"cancelCommand\"\n [options]=\"options\"\n [optionLabelFormat]=\"optionLabelFormat\"\n ></aup-select-input>\n <aup-activity-actions [layout]=\"layout\" align=\"end\"\n [confirmFace]=\"confirmFace\"\n [cancelFace]=\"cancelFace\"\n ></aup-activity-actions>\n "}]}]}}}]
|
|
@@ -11,7 +11,10 @@ StringInputActivity.decorators = [
|
|
|
11
11
|
[placeholder]="data.placeholder"
|
|
12
12
|
[command.enter]="confirmCommand"
|
|
13
13
|
[command.escape]="cancelCommand"></aup-string-input>
|
|
14
|
-
<aup-activity-actions [layout]="layout" align="end"
|
|
14
|
+
<aup-activity-actions [layout]="layout" align="end"
|
|
15
|
+
[confirmFace]="confirmFace"
|
|
16
|
+
[cancelFace]="cancelFace"
|
|
17
|
+
></aup-activity-actions>
|
|
15
18
|
`
|
|
16
19
|
},] }
|
|
17
20
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string-input-activity.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/interaction/components/input-activities/string-input-activity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"string-input-activity.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/interaction/components/input-activities/string-input-activity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAiBjD,MAAM,OAAO,mBAAoB,SAAQ,aAAqB;;;YAd7D,SAAS,SAAC;gBACT,QAAQ,EAAE,2BAA2B;gBACrC,QAAQ,EAAE;;;;;;;;;;GAUT;aACF","sourcesContent":["import { Component } from '@angular/core';\nimport { InputActivity } from './input-activity';\n\n\n@Component({\n selector: 'aup-string-input-activity',\n template: `\n <aup-string-input [valueModel]=\"valueModel\"\n [label]=\"data.label\"\n [placeholder]=\"data.placeholder\"\n [command.enter]=\"confirmCommand\"\n [command.escape]=\"cancelCommand\"></aup-string-input>\n <aup-activity-actions [layout]=\"layout\" align=\"end\"\n [confirmFace]=\"confirmFace\"\n [cancelFace]=\"cancelFace\"\n ></aup-activity-actions>\n `\n})\nexport class StringInputActivity extends InputActivity<string> {\n}\n\nexport namespace StringInputActivity {\n export interface Data extends InputActivity.Data<String> {\n }\n}\n"]}
|
package/esm2015/lib/interaction/components/input-activities/string-input-activity.metadata.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"StringInputActivity":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./input-activity","name":"InputActivity","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"StringInputActivity":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"./input-activity","name":"InputActivity","line":18,"character":41},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"aup-string-input-activity","template":"\n <aup-string-input [valueModel]=\"valueModel\"\n [label]=\"data.label\"\n [placeholder]=\"data.placeholder\"\n [command.enter]=\"confirmCommand\"\n [command.escape]=\"cancelCommand\"></aup-string-input>\n <aup-activity-actions [layout]=\"layout\" align=\"end\"\n [confirmFace]=\"confirmFace\"\n [cancelFace]=\"cancelFace\"\n ></aup-activity-actions>\n "}]}]}}}]
|
|
@@ -31,6 +31,7 @@ export class PopupInteractionContextComponent extends DisposableComponent {
|
|
|
31
31
|
const self = this;
|
|
32
32
|
const overlayRef = this._overlay.create({
|
|
33
33
|
hasBackdrop: false,
|
|
34
|
+
disposeOnNavigation: true,
|
|
34
35
|
panelClass: 'aup-popup-interaction-panel',
|
|
35
36
|
positionStrategy: this._overlay.position()
|
|
36
37
|
.flexibleConnectedTo(this._element)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popup-interaction-context.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAqB,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAU,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEtG,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E,OAAO,EAAE,kCAAkC,EAAE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oB;QAClB,OAAO,IAAI,CAAC,kBAAkB,CAAC,oBAAoB,EAAE,CAAC;IACxD,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC;IACvE,CAAC;IAED,QAAQ;IACR,CAAC;;;
|
|
1
|
+
{"version":3,"file":"popup-interaction-context.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/interaction/components/popup-interaction-context/popup-interaction-context.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAqB,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAU,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEtG,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E,OAAO,EAAE,kCAAkC,EAAE,MAAM,uEAAuE,CAAC;AAE3H;;;;;;;;;GASG;AAMH,MAAM,OAAO,gCAAiC,SAAQ,mBAAmB;IAkBvE,YAAoB,QAAoB,EAAU,QAAiB,EAA0B,UAAyB;QACpH,KAAK,EAAE,CAAC;QADU,aAAQ,GAAR,QAAQ,CAAY;QAAU,aAAQ,GAAR,QAAQ,CAAS;QAR1D,iBAAY,GAAG,IAAI,eAAe,CAAoD,kCAAkC,CAAC,CAAC;QAGnI,YAAO,GAAoB,OAAO,CAAC;QAGnC,YAAO,GAAqB,QAAQ,CAAC;QAInC,IAAI,CAAC,gBAAgB,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACzD,CAAC;IAhBD,IACW,MAAM;QACf,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IACzB,CAAC;IAeD,aAAa,CAAU,YAA8C,EAAE,IAAQ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AAE,CAAC;gBACvB,CAAC,CAAC,CAAC;gBACL,UAAU,CAAC,GAAG,EAAE;oBACd,UAAU,CAAC,cAAc,EAAE,CAAC;gBAC9B,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAC;QAEL,CAAC,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;QAC5D,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;QAC3D,OAAO;YACL,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE;YACxF,8CAA8C;YAC9C,+EAA+E;YAC/E,2EAA2E;YAC3E,+EAA+E;YAC/E,0EAA0E;SAC3E,CAAC;IACJ,CAAC;IAED,oBAAoB;QAClB,OAAO,IAAI,CAAC,kBAAkB,CAAC,oBAAoB,EAAE,CAAC;IACxD,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC;IACvE,CAAC;IAED,QAAQ;IACR,CAAC;;;YA3FF,SAAS,SAAC;gBACT,QAAQ,EAAE,+BAA+B;gBACzC,uCAAyD;;aAE1D;;;YApBmB,UAAU;YAFa,OAAO;YAAzC,aAAa,uBAyCkD,QAAQ,YAAI,QAAQ;;;qBAbzF,WAAW,SAAC,0BAA0B;sBAOtC,KAAK;sBAGL,KAAK","sourcesContent":["import { CdkScrollable, ConnectedPosition, Overlay } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { Component, ElementRef, HostBinding, Input, OnInit, Optional, SkipSelf } from '@angular/core';\nimport { Constructable } from '@coolon/pectin';\nimport { DisposableComponent } from '../../../components/disposable-component';\nimport { Activity } from '../../activity';\nimport { InPlaceInteractionContextComponent } from '../inplace-interaction-context/in-place-interaction-context.component';\n\n/**\n * <aup-popup-interaction-context #ctx></aup-popup-interaction-context>\n *\n * in your component\n * @ViewChild('inPlaceInteractionContext', { static: true })\n * interactionContext: InteractionContext;\n * or\n * @ViewChild('ctx', { static: true })\n * interactionContext: InteractionContext;\n */\n@Component({\n selector: 'aup-popup-interaction-context',\n templateUrl: './popup-interaction-context.component.html',\n styleUrls: ['./popup-interaction-context.component.scss']\n})\nexport class PopupInteractionContextComponent extends DisposableComponent implements OnInit {\n\n private interactionContext: InPlaceInteractionContextComponent<any, any, any>;\n private scrollContainers: CdkScrollable[];\n\n @HostBinding('class.interaction-active')\n public get active(): boolean {\n return this.isActive();\n }\n\n readonly outputPortal = new ComponentPortal<InPlaceInteractionContextComponent<any, any, any>>(InPlaceInteractionContextComponent);\n\n @Input()\n anchorX: 'start' | 'end' = 'start';\n\n @Input()\n anchorY: 'top' | 'bottom' = 'bottom';\n\n constructor(private _element: ElementRef, private _overlay: Overlay, @Optional() @SkipSelf() scrollable: CdkScrollable) {\n super();\n this.scrollContainers = scrollable ? [scrollable] : [];\n }\n\n startActivity<D, R, E>(activityType: Constructable<Activity<D, R, E>>, data?: D): Promise<R> {\n // console.log({ element: this._element });\n const self = this;\n const overlayRef = this._overlay.create({\n hasBackdrop: false,\n disposeOnNavigation: true,\n panelClass: 'aup-popup-interaction-panel',\n positionStrategy: this._overlay.position()\n .flexibleConnectedTo(this._element)\n .withPush(true)\n .withPositions(this.computePositions())\n .withGrowAfterOpen(true)\n .withScrollableContainers(self.scrollContainers) // this isn't working. sigh.\n });\n\n const subs = this.scrollContainers.map(sc => sc.elementScrolled().subscribe(() => {\n overlayRef.updatePosition();\n }))\n\n\n const componentRef = overlayRef.attach(this.outputPortal);\n this.interactionContext = componentRef.instance;\n\n return new Promise((resolve, reject) => {\n // HACK: afterViewInit won't have been called yet. Need to add when(interactionContext.ready).becomesTruthy(...)\n setTimeout(() => {\n this.interactionContext.startActivity(activityType, data)\n .then(resolve)\n .catch(reject)\n .finally(() => {\n subs.forEach(s => s.unsubscribe())\n overlayRef.dispose();\n });\n setTimeout(() => {\n overlayRef.updatePosition();\n })\n });\n\n });\n }\n\n computePositions(): ConnectedPosition[] {\n const overlayX = this.anchorX === 'start' ? 'start' : 'end';\n const overlayY = this.anchorY === 'top' ? 'bottom' : 'top';\n return [\n { originX: this.anchorX, originY: this.anchorY, overlayX: overlayX, overlayY: overlayY }\n // TODO: compute some meaningful alternatives.\n // { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },\n // { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top' },\n // { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' },\n // { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom' }\n ];\n }\n\n cancelActiveActivity(): Promise<boolean> {\n return this.interactionContext.cancelActiveActivity();\n }\n\n isActive(): boolean {\n return this.interactionContext && this.interactionContext.isActive();\n }\n\n ngOnInit() {\n }\n\n\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { A11yModule } from '@angular/cdk/a11y';
|
|
1
2
|
import { PortalModule } from '@angular/cdk/portal';
|
|
2
3
|
import { CommonModule } from '@angular/common';
|
|
3
4
|
import { NgModule } from '@angular/core';
|
|
@@ -54,6 +55,7 @@ InteractionModule.decorators = [
|
|
|
54
55
|
FormsModule,
|
|
55
56
|
MatInputModule,
|
|
56
57
|
MatFormFieldModule,
|
|
58
|
+
A11yModule
|
|
57
59
|
],
|
|
58
60
|
declarations: [
|
|
59
61
|
ActivityContainerComponent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction.module.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/interaction/interaction.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE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EAAgE,CAAC;AAC5G,OAAO,EAAE,2BAA2B,EAAE,MAAM,gEAAgE,CAAC;AAC7G,OAAO,EAAE,8BAA8B,EAAE,MAAM,0FAA0F,CAAC;AAC1I,OAAO,EAAE,kCAAkC,EAAE,MAAM,iFAAiF,CAAC;AACrI,OAAO,EAAE,gCAAgC,EAAE,MAAM,4EAA4E,CAAC;AAC9H,OAAO,EAAE,4BAA4B,EAAE,MAAM,wDAAwD,CAAC;AACtG,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EAAE,mBAAmB,EAAE,MAAM,qDAAqD,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,wFAAwF,CAAC;AACvI,OAAO,EAAE,2BAA2B,EAAE,MAAM,0EAA0E,CAAC;AACvH,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"interaction.module.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/interaction/interaction.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,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,UAAU,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,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C7B,8BAA8B;oBAC9B,6BAA6B;oBAC7B,wBAAwB;oBACxB,2BAA2B;iBAC5B;gBACD,eAAe,EAAE;oBACf,0BAA0B;oBAC1B,2BAA2B;oBAC3B,0BAA0B;oBAC1B,oBAAoB;iBACrB;gBACD,SAAS,EAAE;oBACT,kBAAkB;oBAClB,IAAI;oBACJ,oEAAoE;oBACpE,IAAI;iBACL;aACF","sourcesContent":["import { A11yModule } from '@angular/cdk/a11y';\nimport { PortalModule } from '@angular/cdk/portal';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FlexModule, GridModule } from '@angular/flex-layout';\nimport { FormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { RouterModule } from '@angular/router';\nimport { DirectivesModule } from '../directives/directives.module';\nimport { Activity } from './activity';\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 { ActivityBodyComponent } from './components/activity-body/activity-body.component';\nimport { ActivityTitleComponent } from './components/activity-title/activity-title.component';\nimport { AbstractActivityTriggerComponent } from './components/activity-triggers/abstract-activity-trigger.component';\nimport { ModalActivityTriggerComponent } from './components/activity-triggers/modal-activity-trigger/modal-activity-trigger.component';\nimport { AddCardActivityComponent } from './components/add-card-activity/add-card-activity.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 { InlineActivityTriggerComponent } from './components/activity-triggers/inline-activity-trigger/inline-activity-trigger.component';\nimport { InPlaceInteractionContextComponent } from './components/inplace-interaction-context/in-place-interaction-context.component';\nimport { PopupInteractionContextComponent } from './components/popup-interaction-context/popup-interaction-context.component';\nimport { InteractionContextTriggerFor } from './directives/interaction-context-trigger-for.directive';\nimport { InteractionService } from './services/interaction.service';\nimport { StringInputActivity } from './components/input-activities/string-input-activity';\nimport { SelectInputActivity } from './components/input-activities/select-input-activity';\nimport { InputActivity } from './components/input-activities/input-activity';\nimport { ComponentsModule } from '../components/exports';\nimport { PopupActivityTriggerComponent } from './components/activity-triggers/popup-activity-trigger/popup-activity-trigger.component';\nimport { InlineStringEditorComponent } from './components/editors/inline-string-editor/inline-string-editor.component';\nimport { MatFormFieldModule } from '@angular/material/form-field';\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 ComponentsModule,\n FormsModule,\n MatInputModule,\n MatFormFieldModule,\n A11yModule\n ],\n declarations: [\n ActivityContainerComponent,\n ConfirmationDialogComponent,\n ConfirmThenDialogComponent,\n AlertDialogComponent,\n ActivityOutletComponent,\n InPlaceInteractionContextComponent,\n AddItemInteractionContextComponent,\n ActivityActionsComponent,\n PopupInteractionContextComponent,\n StringInputActivity,\n SelectInputActivity,\n InputActivity,\n InteractionContextTriggerFor,\n Activity,\n ActivityTitleComponent,\n ActivityBodyComponent,\n ActivityActionsComponent,\n AbstractActivityTriggerComponent,\n PopupActivityTriggerComponent,\n InlineActivityTriggerComponent,\n ModalActivityTriggerComponent,\n AddCardActivityComponent,\n InlineStringEditorComponent,\n ],\n exports: [\n ActivityContainerComponent,\n ActivityOutletComponent,\n ActivityTitleComponent,\n InPlaceInteractionContextComponent,\n AddItemInteractionContextComponent,\n ActivityActionsComponent,\n PopupInteractionContextComponent,\n InteractionContextTriggerFor,\n StringInputActivity,\n SelectInputActivity,\n ActivityBodyComponent,\n PopupActivityTriggerComponent,\n InlineActivityTriggerComponent,\n ModalActivityTriggerComponent,\n AddCardActivityComponent,\n InlineStringEditorComponent,\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"]}
|