@coolon/angular-ui-powerups 1.8.0 → 1.9.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 +7 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +350 -231
- 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/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 +13 -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/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 +13 -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 +303 -204
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +346 -233
- 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/add-item-interaction-context/add-item-interaction-context.component.d.ts +17 -0
- package/lib/interaction/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -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,CAAC;AAEvD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
|
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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;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 { 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 ],\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 './components/activity-container/activity-container.component';\nimport * as i13 from './components/confirmation-dialog/confirmation-dialog.component';\nimport * as i14 from './components/confirm-then-dialog/confirm-then-dialog.component';\nimport * as i15 from './components/alert-dialog/alert-dialog.component';\nimport * as i16 from './components/activity-container/activity-outlet/activity-outlet.component';\nimport * as i17 from './components/inplace-interaction-context/in-place-interaction-context.component';\nimport * as i18 from './components/add-item-interaction-context/add-item-interaction-context.component';\nimport * as i19 from './components/activity-actions/activity-actions.component';\nimport * as i20 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.ActivityContainerComponent<any,any,any> = (<any>(null as any));\nvar _decl0_38:i13.ConfirmationDialogComponent = (<any>(null as any));\nvar _decl0_39:i14.ConfirmThenDialogComponent<any,any,any> = (<any>(null as any));\nvar _decl0_40:i15.AlertDialogComponent = (<any>(null as any));\nvar _decl0_41:i16.ActivityOutletComponent<any,any,any> = (<any>(null as any));\nvar _decl0_42:i17.InPlaceInteractionContextComponent<any,any,any> = (<any>(null as any));\nvar _decl0_43:i18.AddItemInteractionContextComponent = (<any>(null as any));\nvar _decl0_44:i19.ActivityActionsComponent = (<any>(null as any));\nvar _decl0_45:i2.AsyncPipe = (<any>(null as any));\nvar _decl0_46:i2.UpperCasePipe = (<any>(null as any));\nvar _decl0_47:i2.LowerCasePipe = (<any>(null as any));\nvar _decl0_48:i2.JsonPipe = (<any>(null as any));\nvar _decl0_49:i2.SlicePipe = (<any>(null as any));\nvar _decl0_50:i2.DecimalPipe = (<any>(null as any));\nvar _decl0_51:i2.PercentPipe = (<any>(null as any));\nvar _decl0_52:i2.TitleCasePipe = (<any>(null as any));\nvar _decl0_53:i2.CurrencyPipe = (<any>(null as any));\nvar _decl0_54:i2.DatePipe = (<any>(null as any));\nvar _decl0_55:i2.I18nPluralPipe = (<any>(null as any));\nvar _decl0_56:i2.I18nSelectPipe = (<any>(null as any));\nvar _decl0_57:i2.KeyValuePipe = (<any>(null as any));\nvar _decl0_58:i2.CommonModule = (<any>(null as any));\nvar _decl0_59:i4.MatButtonModule = (<any>(null as any));\nvar _decl0_60:i5.MatDialogModule = (<any>(null as any));\nvar _decl0_61:i6.MatTabsModule = (<any>(null as any));\nvar _decl0_62:i7.PortalModule = (<any>(null as any));\nvar _decl0_63:i8.RouterModule = (<any>(null as any));\nvar _decl0_64:i9.MatIconModule = (<any>(null as any));\nvar _decl0_65:i20.DirectivesModule = (<any>(null as any));\nvar _decl0_66:i0.TemplateRef<any> = (<any>(null as any));\nvar _decl0_67: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_37;\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_37.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_37.dynamicHeight;\n currVal_3;\n const currVal_4:any = _decl0_37.activityTabs;\n currVal_4;\n const currVal_5:any = _decl0_37.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_38.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_38.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_38.confirm.title;\n currVal_0;\n const currVal_1:any = _decl0_38.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_38.confirm.cancel();\n currVal_4;\n const currVal_5:any = (_decl0_38.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_38.confirm.ok();\n currVal_8;\n const pd_9:any = ((<any>_decl0_38.cancel()) !== false);\n const pd_10:any = ((<any>_decl0_38.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_39.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_39.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_39.confirm.title;\n currVal_0;\n const currVal_1:any = _decl0_39.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_39.confirm.cancel();\n currVal_4;\n const currVal_5:any = (_decl0_39.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_39.confirm.ok();\n currVal_8;\n const pd_9:any = ((<any>_decl0_39.cancel()) !== false);\n const pd_10:any = ((<any>_decl0_39.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_40.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_40.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_40.alert.title;\n currVal_0;\n const currVal_1:any = _decl0_40.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_40.alert.ok();\n currVal_5;\n const pd_6:any = ((<any>_decl0_40.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_42.isActive()? 1: 0);\n currVal_1;\n const currVal_2:any = _decl0_42.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_43.active;\n currVal_0;\n const currVal_1:any = _decl0_43.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_43.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_43.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_44.alignEnd;\n currVal_0;\n}\nfunction _View_ActivityActionsComponent_8_1():void {\n if (!_decl0_44.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_44.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_44.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_44.confirmCommand;\n currVal_2;\n const currVal_3:any = _decl0_44.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_44.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_44.hasConfirmText();\n currVal_5;\n const currVal_6:any = _decl0_44.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;QAYxF,IAAA,kCAA0F,EAAxF,gBAAK,EAAE,oBAAO,EAAE,kBAAM,EAAE,cAAI,EAAE,gBAAK,EAAE,oBAAO,EAAE,sBAA0C,CAAC;QAEjG,IAAI,CAAC,4BAA4B,GAAG,IAAI,oBAAkB,CAAC,eAAe,EAAE,CAAC;QAC7E,IAAI,CAAC,wBAAwB,GAAG,IAAI,oBAAkB,CAAC,eAAe,EAAE,CAAC;QACzE,IAAI,CAAC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CAAC;QACH,sBAAC;IAAD,CAAC,AAjCD,CAAqC,gBAAgB,GAiCpD;IAjCY,kCAAe,kBAiC3B,CAAA;IAED;QAEE,oBAA6B,WAAwB,EAAmB,eAAgC;YAA3E,gBAAW,GAAX,WAAW,CAAa;YAAmB,oBAAe,GAAf,eAAe,CAAiB;QACxG,CAAC;QAED,WAAW;QACX,iCAAY,GAAZ,UAAa,OAA2B;YACtC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YACpC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YACpC,OAAO,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,mCAAmC,EAAE,CAAC;QACpH,CAAC;QAED,WAAW;QACH,2CAAsB,GAA9B;YACE,OAAO,IAAI,CAAC,WAAW,CAAC,oBAAoB,CAAC,KAAK,CAAC;QACrD,CAAC;QAED,WAAW;QACX,mCAAc,GAAd,UAAe,OAA2B;YACxC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACrC,kBAAkB;YAClB,8GAA8G;YAC9G,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 // 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,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,s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U,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"]}
|