@coolon/angular-ui-powerups 3.7.0-alpha.0 → 3.7.0-alpha.10
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 +71 -0
- package/bundles/coolon-angular-ui-powerups.umd.js +423 -667
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/commands/command/command.component.js +15 -12
- package/esm2015/lib/components/commands/command/command.component.js.map +1 -1
- package/esm2015/lib/components/commands/command/command.component.metadata.json +1 -1
- package/esm2015/lib/components/commands/flex.component.js +2 -9
- package/esm2015/lib/components/commands/flex.component.js.map +1 -1
- package/esm2015/lib/components/commands/flex.component.metadata.json +1 -1
- package/esm2015/lib/components/commands/group/command-container.js +21 -0
- package/esm2015/lib/components/commands/group/command-container.js.map +1 -0
- package/esm2015/lib/components/commands/group/command-container.metadata.json +1 -0
- package/esm2015/lib/components/commands/group/popup-aware.component.js +26 -0
- package/esm2015/lib/components/commands/group/popup-aware.component.js.map +1 -0
- package/esm2015/lib/components/commands/group/popup-aware.component.metadata.json +1 -0
- package/esm2015/lib/components/commands/group/popup-container.js +3 -0
- package/esm2015/lib/components/commands/group/popup-container.js.map +1 -0
- package/esm2015/lib/components/commands/group/popup-container.metadata.json +1 -0
- package/esm2015/lib/components/commands/group/popup-menu/abstract-popup-menu.component.js +65 -0
- package/esm2015/lib/components/commands/group/popup-menu/abstract-popup-menu.component.js.map +1 -0
- package/esm2015/lib/components/commands/group/popup-menu/abstract-popup-menu.component.metadata.json +1 -0
- package/esm2015/lib/components/commands/group/popup-menu/abstract-popup-menu.component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/commands/group/popup-menu/more-menu.component.js +47 -0
- package/esm2015/lib/components/commands/group/popup-menu/more-menu.component.js.map +1 -0
- package/esm2015/lib/components/commands/group/popup-menu/more-menu.component.metadata.json +1 -0
- package/esm2015/lib/components/commands/group/popup-menu/more-menu.component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component.js +90 -0
- package/esm2015/lib/components/commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component.js.map +1 -0
- package/esm2015/lib/components/commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component.metadata.json +1 -0
- package/esm2015/lib/components/commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/commands/group/popup-menu/popup-menu.component.js +42 -0
- package/esm2015/lib/components/commands/group/popup-menu/popup-menu.component.js.map +1 -0
- package/esm2015/lib/components/commands/group/popup-menu/popup-menu.component.metadata.json +1 -0
- package/esm2015/lib/components/commands/group/popup-menu/popup-menu.component.ngfactory.js.map +1 -0
- package/esm2015/lib/components/commands/group/tool-bar/tool-bar.component.js +12 -15
- package/esm2015/lib/components/commands/group/tool-bar/tool-bar.component.js.map +1 -1
- package/esm2015/lib/components/commands/group/tool-bar/tool-bar.component.metadata.json +1 -1
- package/esm2015/lib/components/commands/group/tool-bar/tool-bar.component.scss.ngstyle.js.map +1 -0
- package/esm2015/lib/components/commands/separator.component.js +25 -14
- package/esm2015/lib/components/commands/separator.component.js.map +1 -1
- package/esm2015/lib/components/commands/separator.component.metadata.json +1 -1
- package/esm2015/lib/components/components.module.js +6 -9
- package/esm2015/lib/components/components.module.js.map +1 -1
- package/esm2015/lib/components/components.module.metadata.json +1 -1
- package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
- package/esm2015/lib/components/exports.js +7 -8
- package/esm2015/lib/components/exports.js.map +1 -1
- package/esm2015/lib/components/exports.metadata.json +1 -1
- package/esm2015/lib/interaction/interaction.module.ngfactory.js.map +1 -1
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +12 -1
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
- package/esm2015/lib/place/components/place-outlet/place-outlet.component.metadata.json +1 -1
- package/esm2015/lib/place/guards/place.guard.js +31 -41
- package/esm2015/lib/place/guards/place.guard.js.map +1 -1
- package/esm2015/lib/place/guards/place.guard.metadata.json +1 -1
- package/esm2015/lib/place/place-auth-service.js.map +1 -1
- package/esm2015/lib/place/place-auth-service.metadata.json +1 -1
- package/esm2015/lib/place/place.module.ngfactory.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +361 -562
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/commands/command/command.component.d.ts +7 -6
- package/lib/components/commands/flex.component.d.ts +1 -3
- package/lib/components/commands/group/command-container.d.ts +16 -0
- package/lib/components/commands/group/popup-aware.component.d.ts +12 -0
- package/lib/components/commands/group/popup-container.d.ts +6 -0
- package/lib/components/commands/group/popup-menu/abstract-popup-menu.component.d.ts +25 -0
- package/lib/components/commands/group/popup-menu/more-menu.component.d.ts +12 -0
- package/lib/components/commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component.d.ts +33 -0
- package/lib/components/commands/group/popup-menu/popup-menu.component.d.ts +13 -0
- package/lib/components/commands/group/tool-bar/tool-bar.component.d.ts +4 -5
- package/lib/components/commands/separator.component.d.ts +8 -7
- package/lib/components/exports.d.ts +7 -8
- package/lib/place/components/place-outlet/place-outlet.component.d.ts +3 -1
- package/lib/place/guards/place.guard.d.ts +2 -1
- package/lib/place/place-auth-service.d.ts +4 -4
- package/package.json +2 -2
- package/schematics/place-routes/index.d.ts +1 -1
- package/schematics/place-routes/index.js +9 -14
- package/schematics/place-routes/index.js.map +1 -1
- package/schematics/place-routes/place-builder.d.ts +3 -5
- package/schematics/place-routes/place-builder.js +4 -23
- package/schematics/place-routes/place-builder.js.map +1 -1
- package/schematics/place-routes/place-class-scanner.d.ts +3 -2
- package/schematics/place-routes/place-class-scanner.js.map +1 -1
- package/schematics/place-routes/place-def.d.ts +3 -2
- package/schematics/place-routes/place-def.js.map +1 -1
- package/schematics/utils/build-context.js +1 -1
- package/schematics/utils/build-context.js.map +1 -1
- package/schematics/utils/schematic-tree-file-system.d.ts +3 -2
- package/schematics/utils/schematic-tree-file-system.js +11 -2
- package/schematics/utils/schematic-tree-file-system.js.map +1 -1
- package/esm2015/lib/components/commands/group/command-group/command-group.component.js +0 -43
- package/esm2015/lib/components/commands/group/command-group/command-group.component.js.map +0 -1
- package/esm2015/lib/components/commands/group/command-group/command-group.component.metadata.json +0 -1
- package/esm2015/lib/components/commands/group/command-group/command-group.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/commands/group/command-group-menu-renderer/command-group-menu-renderer.component.js +0 -46
- package/esm2015/lib/components/commands/group/command-group-menu-renderer/command-group-menu-renderer.component.js.map +0 -1
- package/esm2015/lib/components/commands/group/command-group-menu-renderer/command-group-menu-renderer.component.metadata.json +0 -1
- package/esm2015/lib/components/commands/group/command-group-menu-renderer/command-group-menu-renderer.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/commands/group/command-group-renderer/command-group-renderer.component.js +0 -39
- package/esm2015/lib/components/commands/group/command-group-renderer/command-group-renderer.component.js.map +0 -1
- package/esm2015/lib/components/commands/group/command-group-renderer/command-group-renderer.component.metadata.json +0 -1
- package/esm2015/lib/components/commands/group/command-group-renderer/command-group-renderer.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/commands/group/command-group-renderer/command-group-renderer.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/components/commands/group/command-group.js +0 -103
- package/esm2015/lib/components/commands/group/command-group.js.map +0 -1
- package/esm2015/lib/components/commands/group/command-group.metadata.json +0 -1
- package/esm2015/lib/components/commands/group/more-menu.component.js +0 -53
- package/esm2015/lib/components/commands/group/more-menu.component.js.map +0 -1
- package/esm2015/lib/components/commands/group/more-menu.component.metadata.json +0 -1
- package/esm2015/lib/components/commands/group/more-menu.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/commands/group/popup-menu.component.js +0 -52
- package/esm2015/lib/components/commands/group/popup-menu.component.js.map +0 -1
- package/esm2015/lib/components/commands/group/popup-menu.component.metadata.json +0 -1
- package/esm2015/lib/components/commands/group/popup-menu.component.ngfactory.js.map +0 -1
- package/esm2015/lib/components/commands/group/registration.js +0 -58
- package/esm2015/lib/components/commands/group/registration.js.map +0 -1
- package/esm2015/lib/components/commands/group/registration.metadata.json +0 -1
- package/esm2015/lib/components/commands/group/tool-bar/tool-bar.component.scss.shim.ngstyle.js.map +0 -1
- package/esm2015/lib/components/commands/group/view-data.js +0 -113
- package/esm2015/lib/components/commands/group/view-data.js.map +0 -1
- package/esm2015/lib/components/commands/group/view-data.metadata.json +0 -1
- package/lib/components/commands/group/command-group/command-group.component.d.ts +0 -12
- package/lib/components/commands/group/command-group-menu-renderer/command-group-menu-renderer.component.d.ts +0 -21
- package/lib/components/commands/group/command-group-renderer/command-group-renderer.component.d.ts +0 -13
- package/lib/components/commands/group/command-group.d.ts +0 -42
- package/lib/components/commands/group/more-menu.component.d.ts +0 -14
- package/lib/components/commands/group/popup-menu.component.d.ts +0 -17
- package/lib/components/commands/group/registration.d.ts +0 -32
- package/lib/components/commands/group/view-data.d.ts +0 -41
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components.module"},{"from":"./disposable-component"},{"from":"./focusable.component"},{"from":"./resize-aware.component"},{"from":"./track-by"},{"from":"./card-container/card-container.component"},{"from":"./commands/command-face"},{"from":"./commands/flex.component"},{"from":"./commands/separator.component"},{"from":"./commands/command/command.component"},{"from":"./commands/command-face/command-face.component"},{"from":"./commands/group/command-
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./components.module"},{"from":"./disposable-component"},{"from":"./focusable.component"},{"from":"./resize-aware.component"},{"from":"./track-by"},{"from":"./card-container/card-container.component"},{"from":"./commands/command-face"},{"from":"./commands/flex.component"},{"from":"./commands/separator.component"},{"from":"./commands/command/command.component"},{"from":"./commands/command-face/command-face.component"},{"from":"./commands/group/command-container"},{"from":"./commands/group/popup-aware.component"},{"from":"./commands/group/popup-container"},{"from":"./commands/group/popup-menu/abstract-popup-menu.component"},{"from":"./commands/group/popup-menu/more-menu.component"},{"from":"./commands/group/popup-menu/popup-menu.component"},{"from":"./commands/group/popup-menu/popup-menu-renderer/popup-menu-renderer.component"},{"from":"./commands/group/tool-bar/tool-bar.component"},{"from":"./focus-container/focus-container.component"},{"from":"./forms/abstract-input.component"},{"from":"./forms/abstract-list-input.component"},{"from":"./forms/abstract-value-input.component"},{"from":"./forms/autocomplete-input/autocomplete-input.component"},{"from":"./forms/checkbox-input/checkbox-input.component"},{"from":"./forms/multiple-select-input/multiple-select-input.component"},{"from":"./forms/number-input/number-input.component"},{"from":"./forms/password-input/password-input.component"},{"from":"./forms/select-input/select-input.component"},{"from":"./forms/string-input/string-input.component"},{"from":"./forms/text-input/text-input.component"},{"from":"./icon/icon.component"},{"from":"./noop/noop.component"},{"from":"./scroll-container/scroll-container.component"},{"from":"./section-header/section-header.component"},{"from":"./switch-case/switch-case.component"},{"from":"./table/cell-editors"},{"from":"./table/cell-portal-ref"},{"from":"./table/cell-renderer"},{"from":"./table/column-model"},{"from":"./table/column-text-properties"},{"from":"./table/edit-session"},{"from":"./table/mutable-cell-renderer"},{"from":"./table/table-def"},{"from":"./table/table-model"},{"from":"./table/table.component"},{"from":"./table/column-template/column-template.directive"},{"from":"./table/default-cell-renderer/default-cell-renderer.component"},{"from":"./table/default-header-cell-renderer/default-header-cell-renderer.component"},{"from":"./table/edit-row-controls/edit-row-controls.component"},{"from":"./table/select-cell-renderer/select-cell-renderer.component"},{"from":"./table/select-header-cell-renderer/select-header-cell-renderer.component"},{"from":"./table/table-cell-renderer/table-cell-renderer.component"},{"from":"./table/table-header-cell-renderer/table-header-cell-renderer.component"},{"from":"./table/table-row-menu/table-row-menu.component"},{"from":"./types/bounds.class"},{"from":"./types/dimension.class"},{"from":"./types/point.class"},{"from":"./vertical-focus-container/vertical-focus-container.component"}]}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interaction.module.ngfactory.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/interaction/interaction.module.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\nimport * as i1 from './interaction.module';\nimport * as i2 from '@angular/common';\nimport * as i3 from '@angular/cdk/bidi';\nimport * as i4 from '@angular/material/button';\nimport * as i5 from '@angular/material/dialog';\nimport * as i6 from '@angular/material/tabs';\nimport * as i7 from '@angular/cdk/portal';\nimport * as i8 from '@angular/router';\nimport * as i9 from '@angular/material/icon';\nimport * as i10 from '../directives/command.directive';\nimport * as i11 from '../directives/focus-binding.directive';\nimport * as i12 from '@angular/flex-layout/flex';\nimport * as i13 from '@angular/flex-layout/grid';\nimport * as i14 from '../components/forms/number-input/number-input.component';\nimport * as i15 from '../components/forms/string-input/string-input.component';\nimport * as i16 from '../components/forms/text-input/text-input.component';\nimport * as i17 from '../components/forms/password-input/password-input.component';\nimport * as i18 from '../components/forms/checkbox-input/checkbox-input.component';\nimport * as i19 from '../components/forms/select-input/select-input.component';\nimport * as i20 from '../components/forms/multiple-select-input/multiple-select-input.component';\nimport * as i21 from '../components/forms/autocomplete-input/autocomplete-input.component';\nimport * as i22 from '../components/scroll-container/scroll-container.component';\nimport * as i23 from '../components/noop/noop.component';\nimport * as i24 from '../components/switch-case/switch-case.component';\nimport * as i25 from '../components/focus-container/focus-container.component';\nimport * as i26 from '../components/vertical-focus-container/vertical-focus-container.component';\nimport * as i27 from '../components/focusable.component';\nimport * as i28 from '../components/card-container/card-container.component';\nimport * as i29 from '../components/table/table.component';\nimport * as i30 from '../components/table/edit-row-controls/edit-row-controls.component';\nimport * as i31 from '../components/table/column-template/column-template.directive';\nimport * as i32 from '../components/icon/icon.component';\nimport * as i33 from '../components/section-header/section-header.component';\nimport * as i34 from '../components/table/table-row-menu/table-row-menu.component';\nimport * as i35 from '../components/commands/group/command-group/command-group.component';\nimport * as i36 from '../components/commands/group/tool-bar/tool-bar.component';\nimport * as i37 from '../components/commands/command/command.component';\nimport * as i38 from '../components/commands/group/popup-menu.component';\nimport * as i39 from '../components/commands/command-face/command-face.component';\nimport * as i40 from '../components/commands/group/more-menu.component';\nimport * as i41 from '../components/commands/separator.component';\nimport * as i42 from '../components/commands/flex.component';\nimport * as i43 from './components/activity-container/activity-container.component';\nimport * as i44 from './components/confirmation-dialog/confirmation-dialog.component';\nimport * as i45 from './components/confirm-then-dialog/confirm-then-dialog.component';\nimport * as i46 from './components/alert-dialog/alert-dialog.component';\nimport * as i47 from './components/activity-container/activity-outlet/activity-outlet.component';\nimport * as i48 from './components/inplace-interaction-context/in-place-interaction-context.component';\nimport * as i49 from './components/add-item-interaction-context/add-item-interaction-context.component';\nimport * as i50 from './components/activity-actions/activity-actions.component';\nimport * as i51 from './components/popup-interaction-context/popup-interaction-context.component';\nimport * as i52 from './components/input-activities/string-input-activity';\nimport * as i53 from './components/input-activities/select-input-activity';\nimport * as i54 from './components/input-activities/abstract-input-activity';\nimport * as i55 from './directives/interaction-context-trigger-for.directive';\nimport * as i56 from './activity';\nimport * as i57 from '../directives/directives.module';\nimport * as i58 from '../components/components.module';\nexport const InteractionModuleNgFactory:i0.NgModuleFactory<i1.InteractionModule> = (null as any);\nvar _decl0_0:i2.NgClass = (<any>(null as any));\nvar _decl0_1:i2.NgComponentOutlet = (<any>(null as any));\nvar _decl0_2:i2.NgForOf<any,any> = (<any>(null as any));\nvar _decl0_3:i2.NgIf<any> = (<any>(null as any));\nvar _decl0_4:i2.NgTemplateOutlet = (<any>(null as any));\nvar _decl0_5:i2.NgStyle = (<any>(null as any));\nvar _decl0_6:i2.NgSwitch = (<any>(null as any));\nvar _decl0_7:i2.NgSwitchCase = (<any>(null as any));\nvar _decl0_8:i2.NgSwitchDefault = (<any>(null as any));\nvar _decl0_9:i2.NgPlural = (<any>(null as any));\nvar _decl0_10:i2.NgPluralCase = (<any>(null as any));\nvar _decl0_11:i3.Dir = (<any>(null as any));\nvar _decl0_12:i4.MatButton = (<any>(null as any));\nvar _decl0_13:i4.MatAnchor = (<any>(null as any));\nvar _decl0_14:i5.MatDialogContainer = (<any>(null as any));\nvar _decl0_15:i5.MatDialogClose = (<any>(null as any));\nvar _decl0_16:i5.MatDialogTitle = (<any>(null as any));\nvar _decl0_17:i5.MatDialogContent = (<any>(null as any));\nvar _decl0_18:i5.MatDialogActions = (<any>(null as any));\nvar _decl0_19:i6.MatTabGroup = (<any>(null as any));\nvar _decl0_20:i6.MatTabLabel = (<any>(null as any));\nvar _decl0_21:i6.MatTab = (<any>(null as any));\nvar _decl0_22:i6.MatTabNav = (<any>(null as any));\nvar _decl0_23:i6.MatTabLink = (<any>(null as any));\nvar _decl0_24:i6.MatTabContent = (<any>(null as any));\nvar _decl0_25:i7.CdkPortal = (<any>(null as any));\nvar _decl0_26:i7.CdkPortalOutlet = (<any>(null as any));\nvar _decl0_27:i7.TemplatePortalDirective = (<any>(null as any));\nvar _decl0_28:i7.PortalHostDirective = (<any>(null as any));\nvar _decl0_29:i8.RouterOutlet = (<any>(null as any));\nvar _decl0_30:i8.RouterLink = (<any>(null as any));\nvar _decl0_31:i8.RouterLinkWithHref = (<any>(null as any));\nvar _decl0_32:i8.RouterLinkActive = (<any>(null as any));\nvar _decl0_33:i8.ɵangular_packages_router_router_l = (<any>(null as any));\nvar _decl0_34:i9.MatIcon = (<any>(null as any));\nvar _decl0_35:i10.CommandDirective<any> = (<any>(null as any));\nvar _decl0_36:i11.FocusBindingDirective = (<any>(null as any));\nvar _decl0_37:i12.DefaultLayoutDirective = (<any>(null as any));\nvar _decl0_38:i12.DefaultLayoutGapDirective = (<any>(null as any));\nvar _decl0_39:i12.DefaultLayoutAlignDirective = (<any>(null as any));\nvar _decl0_40:i12.DefaultFlexOrderDirective = (<any>(null as any));\nvar _decl0_41:i12.DefaultFlexOffsetDirective = (<any>(null as any));\nvar _decl0_42:i12.FlexFillDirective = (<any>(null as any));\nvar _decl0_43:i12.DefaultFlexAlignDirective = (<any>(null as any));\nvar _decl0_44:i12.DefaultFlexDirective = (<any>(null as any));\nvar _decl0_45:i13.ɵgrid_privatec = (<any>(null as any));\nvar _decl0_46:i13.ɵgrid_privatef = (<any>(null as any));\nvar _decl0_47:i13.ɵgrid_privatei = (<any>(null as any));\nvar _decl0_48:i13.ɵgrid_privatel = (<any>(null as any));\nvar _decl0_49:i13.ɵgrid_privateo = (<any>(null as any));\nvar _decl0_50:i13.ɵgrid_privater = (<any>(null as any));\nvar _decl0_51:i13.ɵgrid_privateu = (<any>(null as any));\nvar _decl0_52:i13.ɵgrid_privatex = (<any>(null as any));\nvar _decl0_53:i13.ɵgrid_privateba = (<any>(null as any));\nvar _decl0_54:i13.ɵgrid_privatebd = (<any>(null as any));\nvar _decl0_55:i13.ɵgrid_privatebg = (<any>(null as any));\nvar _decl0_56:i14.NumberInputComponent = (<any>(null as any));\nvar _decl0_57:i15.StringInputComponent = (<any>(null as any));\nvar _decl0_58:i16.TextInputComponent = (<any>(null as any));\nvar _decl0_59:i17.PasswordInputComponent = (<any>(null as any));\nvar _decl0_60:i18.CheckboxInputComponent = (<any>(null as any));\nvar _decl0_61:i19.SelectInputComponent<any> = (<any>(null as any));\nvar _decl0_62:i20.MultipleSelectInputComponent<any> = (<any>(null as any));\nvar _decl0_63:i21.AutocompleteInputComponent<any> = (<any>(null as any));\nvar _decl0_64:i22.ScrollContainerComponent = (<any>(null as any));\nvar _decl0_65:i23.NoopComponent = (<any>(null as any));\nvar _decl0_66:i24.SwitchCaseComponent<any> = (<any>(null as any));\nvar _decl0_67:i24.SwitchCaseWhenDirective<any> = (<any>(null as any));\nvar _decl0_68:i24.SwitchCaseDefaultDirective<any> = (<any>(null as any));\nvar _decl0_69:i25.FocusContainerComponent = (<any>(null as any));\nvar _decl0_70:i26.VerticalFocusContainerComponent = (<any>(null as any));\nvar _decl0_71:i27.FocusableComponent = (<any>(null as any));\nvar _decl0_72:i28.CardContainerComponent = (<any>(null as any));\nvar _decl0_73:i29.TableComponent<any> = (<any>(null as any));\nvar _decl0_74:i30.EditRowControls<any> = (<any>(null as any));\nvar _decl0_75:i31.ColumnTemplateDirective = (<any>(null as any));\nvar _decl0_76:i32.IconComponent = (<any>(null as any));\nvar _decl0_77:i33.SectionHeaderComponent = (<any>(null as any));\nvar _decl0_78:i34.TableRowMenuComponent<any> = (<any>(null as any));\nvar _decl0_79:i35.CommandGroupComponent = (<any>(null as any));\nvar _decl0_80:i36.ToolBarComponent = (<any>(null as any));\nvar _decl0_81:i37.CommandComponent = (<any>(null as any));\nvar _decl0_82:i38.PopupMenuComponent = (<any>(null as any));\nvar _decl0_83:i39.CommandFaceComponent<any> = (<any>(null as any));\nvar _decl0_84:i40.MoreMenuComponent = (<any>(null as any));\nvar _decl0_85:i41.SeparatorComponent = (<any>(null as any));\nvar _decl0_86:i42.FlexComponent = (<any>(null as any));\nvar _decl0_87:i43.ActivityContainerComponent<any,any,any> = (<any>(null as any));\nvar _decl0_88:i44.ConfirmationDialogComponent = (<any>(null as any));\nvar _decl0_89:i45.ConfirmThenDialogComponent<any,any,any> = (<any>(null as any));\nvar _decl0_90:i46.AlertDialogComponent = (<any>(null as any));\nvar _decl0_91:i47.ActivityOutletComponent<any,any,any> = (<any>(null as any));\nvar _decl0_92:i48.InPlaceInteractionContextComponent<any,any,any> = (<any>(null as any));\nvar _decl0_93:i49.AddItemInteractionContextComponent = (<any>(null as any));\nvar _decl0_94:i50.ActivityActionsComponent = (<any>(null as any));\nvar _decl0_95:i51.PopupInteractionContextComponent = (<any>(null as any));\nvar _decl0_96:i52.StringInputActivity = (<any>(null as any));\nvar _decl0_97:i53.SelectInputActivity<any> = (<any>(null as any));\nvar _decl0_98:i54.AbstractInputActivity<any,any> = (<any>(null as any));\nvar _decl0_99:i55.InteractionContextTriggerFor<any,any,any> = (<any>(null as any));\nvar _decl0_100:i56.Activity<any,any,any> = (<any>(null as any));\nvar _decl0_101:i2.AsyncPipe = (<any>(null as any));\nvar _decl0_102:i2.UpperCasePipe = (<any>(null as any));\nvar _decl0_103:i2.LowerCasePipe = (<any>(null as any));\nvar _decl0_104:i2.JsonPipe = (<any>(null as any));\nvar _decl0_105:i2.SlicePipe = (<any>(null as any));\nvar _decl0_106:i2.DecimalPipe = (<any>(null as any));\nvar _decl0_107:i2.PercentPipe = (<any>(null as any));\nvar _decl0_108:i2.TitleCasePipe = (<any>(null as any));\nvar _decl0_109:i2.CurrencyPipe = (<any>(null as any));\nvar _decl0_110:i2.DatePipe = (<any>(null as any));\nvar _decl0_111:i2.I18nPluralPipe = (<any>(null as any));\nvar _decl0_112:i2.I18nSelectPipe = (<any>(null as any));\nvar _decl0_113:i2.KeyValuePipe = (<any>(null as any));\nvar _decl0_114:i2.CommonModule = (<any>(null as any));\nvar _decl0_115:i4.MatButtonModule = (<any>(null as any));\nvar _decl0_116:i5.MatDialogModule = (<any>(null as any));\nvar _decl0_117:i6.MatTabsModule = (<any>(null as any));\nvar _decl0_118:i7.PortalModule = (<any>(null as any));\nvar _decl0_119:i8.RouterModule = (<any>(null as any));\nvar _decl0_120:i9.MatIconModule = (<any>(null as any));\nvar _decl0_121:i57.DirectivesModule = (<any>(null as any));\nvar _decl0_122:i12.FlexModule = (<any>(null as any));\nvar _decl0_123:i13.GridModule = (<any>(null as any));\nvar _decl0_124:i58.ComponentsModule = (<any>(null as any));\nvar _decl0_125:i0.TemplateRef<any> = (<any>(null as any));\nvar _decl0_126: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 = !_any.focused;\n currVal_0;\n const currVal_1:any = _decl0_87;\n currVal_1;\n const currVal_2:any = _any;\n currVal_2;\n}\nfunction _View_ActivityContainerComponent_1_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_87.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_87.dynamicHeight;\n currVal_3;\n const currVal_4:any = _decl0_87.activityRefs;\n currVal_4;\n const currVal_5:any = _decl0_87.activityIndex;\n currVal_5;\n}\nfunction _View_ConfirmationDialogComponent_Host_2_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_88.class;\n currVal_0;\n const currVal_1:any = _decl0_88.isFocused;\n currVal_1;\n}\nfunction _View_ConfirmationDialogComponent_2_1():void {\n if (_decl0_88.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_88.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_88.confirm.title;\n currVal_0;\n const currVal_1:any = _decl0_88.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_12.disabled;\n currVal_4;\n const currVal_5:any = _decl0_88.confirm.cancel();\n currVal_5;\n const currVal_6:any = (_decl0_88.isDestructive()? 'warn': 'primary');\n currVal_6;\n const currVal_7:any = (_decl0_12.disabled || null);\n currVal_7;\n const currVal_8:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_8;\n const currVal_9:any = _decl0_12.disabled;\n currVal_9;\n const currVal_10:any = _decl0_88.confirm.ok();\n currVal_10;\n const pd_11:any = ((<any>_decl0_88.cancel()) !== false);\n const pd_12:any = ((<any>_decl0_88.done()) !== false);\n}\nfunction _View_ConfirmThenDialogComponent_Host_3_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_89.class;\n currVal_0;\n const currVal_1:any = _decl0_89.isFocused;\n currVal_1;\n}\nfunction _View_ConfirmThenDialogComponent_3_1():void {\n if (_decl0_89.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_89.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_89.confirm.title;\n currVal_0;\n const currVal_1:any = _decl0_89.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_12.disabled;\n currVal_4;\n const currVal_5:any = _decl0_89.confirm.cancel();\n currVal_5;\n const currVal_6:any = (_decl0_89.isDestructive()? 'warn': 'primary');\n currVal_6;\n const currVal_7:any = (_decl0_12.disabled || null);\n currVal_7;\n const currVal_8:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_8;\n const currVal_9:any = _decl0_12.disabled;\n currVal_9;\n const currVal_10:any = _decl0_89.confirm.ok();\n currVal_10;\n const pd_11:any = ((<any>_decl0_89.cancel()) !== false);\n const pd_12:any = ((<any>_decl0_89.onConfirm()) !== false);\n}\nfunction _View_AlertDialogComponent_Host_4_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_90.class;\n currVal_0;\n const currVal_1:any = _decl0_90.isFocused;\n currVal_1;\n}\nfunction _View_AlertDialogComponent_4_1():void {\n if (_decl0_90.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_90.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_90.alert.title;\n currVal_0;\n const currVal_1:any = _decl0_90.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_12.disabled;\n currVal_5;\n const currVal_6:any = _decl0_90.alert.ok();\n currVal_6;\n const pd_7:any = ((<any>_decl0_90.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_92.isActive()? 1: 0);\n currVal_1;\n const currVal_2:any = _decl0_92.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_93.active;\n currVal_0;\n const currVal_1:any = _decl0_93.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_93.clickCommand;\n currVal_1;\n const currVal_2:any = _decl0_93.icon;\n currVal_2;\n const currVal_3:any = _decl0_93.label;\n currVal_3;\n const pd_4: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_94.alignEnd;\n currVal_0;\n const currVal_1:any = _decl0_94.alignStretch;\n currVal_1;\n}\nfunction _View_ActivityActionsComponent_8_1():void {\n if (_decl0_94.hasCancelCommand()) {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_94.cancelCommand;\n currVal_0;\n const currVal_1:any = _decl0_94.style.cancel;\n currVal_1;\n }\n}\nfunction _View_ActivityActionsComponent_8_2():void {\n if (_decl0_94.hasConfirmCommand()) {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_94.confirmCommand;\n currVal_0;\n const currVal_1:any = _decl0_94.style.confirm;\n currVal_1;\n }\n}\nfunction _View_ActivityActionsComponent_8_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_94.hasCancelCommand();\n currVal_0;\n const currVal_1:any = _decl0_94.hasConfirmCommand();\n currVal_1;\n}\nfunction _View_PopupInteractionContextComponent_Host_9_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_95.active;\n currVal_0;\n}\nfunction _View_PopupInteractionContextComponent_9_0():void {\n var _any:any = (null as any);\n}\nfunction _View_StringInputActivity_Host_10_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_96.class;\n currVal_0;\n const currVal_1:any = _decl0_96.isFocused;\n currVal_1;\n}\nfunction _View_StringInputActivity_10_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_96.data.label;\n currVal_0;\n const currVal_1:any = _decl0_96.data.placeholder;\n currVal_1;\n const currVal_2:any = _decl0_96.confirmCommand;\n currVal_2;\n const currVal_3:any = _decl0_96.cancelCommand;\n currVal_3;\n const currVal_4:any = _decl0_96.valueModel;\n currVal_4;\n const currVal_5:any = _decl0_57.dense;\n currVal_5;\n const currVal_6:any = _decl0_57.baseClassName;\n currVal_6;\n const currVal_7:any = _decl0_96.confirmCommand;\n currVal_7;\n const currVal_8:any = _decl0_96.cancelCommand;\n currVal_8;\n const currVal_9:any = _decl0_96.data.buttonStyle;\n currVal_9;\n const currVal_10:any = 'end';\n currVal_10;\n const currVal_11:any = _decl0_94.alignEnd;\n currVal_11;\n const currVal_12:any = _decl0_94.alignStretch;\n currVal_12;\n const pd_13:any = ((<any>_decl0_57.notifyClick()) !== false);\n const pd_14:any = ((<any>_decl0_57.notifyFocusIn()) !== false);\n const pd_15:any = ((<any>_decl0_57.notifyFocusOut()) !== false);\n}\nfunction _View_SelectInputActivity_Host_11_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_97.class;\n currVal_0;\n const currVal_1:any = _decl0_97.isFocused;\n currVal_1;\n}\nfunction _View_SelectInputActivity_11_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_97.data.label;\n currVal_0;\n const currVal_1:any = _decl0_97.data.placeholder;\n currVal_1;\n const currVal_2:any = _decl0_97.confirmCommand;\n currVal_2;\n const currVal_3:any = _decl0_97.cancelCommand;\n currVal_3;\n const currVal_4:any = _decl0_97.valueModel;\n currVal_4;\n const currVal_5:any = _decl0_97.options;\n currVal_5;\n const currVal_6:any = _decl0_97.optionLabelFormat;\n currVal_6;\n const currVal_7:any = _decl0_61.dense;\n currVal_7;\n const currVal_8:any = _decl0_61.baseClassName;\n currVal_8;\n const currVal_9:any = _decl0_97.confirmCommand;\n currVal_9;\n const currVal_10:any = _decl0_97.cancelCommand;\n currVal_10;\n const currVal_11:any = _decl0_97.data.buttonStyle;\n currVal_11;\n const currVal_12:any = 'end';\n currVal_12;\n const currVal_13:any = _decl0_94.alignEnd;\n currVal_13;\n const currVal_14:any = _decl0_94.alignStretch;\n currVal_14;\n const pd_15:any = ((<any>_decl0_61.notifyClick()) !== false);\n const pd_16:any = ((<any>_decl0_61.notifyFocusIn()) !== false);\n const pd_17:any = ((<any>_decl0_61.notifyFocusOut()) !== false);\n}\nfunction _View_AbstractInputActivity_Host_12_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_98.class;\n currVal_0;\n const currVal_1:any = _decl0_98.isFocused;\n currVal_1;\n}\nfunction _View_AbstractInputActivity_12_0():void {\n var _any:any = (null as any);\n}\nfunction _View_Activity_Host_13_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_100.class;\n currVal_0;\n const currVal_1:any = _decl0_100.isFocused;\n currVal_1;\n}\nfunction _View_Activity_13_0():void {\n var _any:any = (null as any);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interaction.module.ngfactory.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/interaction/interaction.module.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\nimport * as i1 from './interaction.module';\nimport * as i2 from '@angular/common';\nimport * as i3 from '@angular/cdk/bidi';\nimport * as i4 from '@angular/material/button';\nimport * as i5 from '@angular/material/dialog';\nimport * as i6 from '@angular/material/tabs';\nimport * as i7 from '@angular/cdk/portal';\nimport * as i8 from '@angular/router';\nimport * as i9 from '@angular/material/icon';\nimport * as i10 from '../directives/command.directive';\nimport * as i11 from '../directives/focus-binding.directive';\nimport * as i12 from '@angular/flex-layout/flex';\nimport * as i13 from '@angular/flex-layout/grid';\nimport * as i14 from '../components/forms/number-input/number-input.component';\nimport * as i15 from '../components/forms/string-input/string-input.component';\nimport * as i16 from '../components/forms/text-input/text-input.component';\nimport * as i17 from '../components/forms/password-input/password-input.component';\nimport * as i18 from '../components/forms/checkbox-input/checkbox-input.component';\nimport * as i19 from '../components/forms/select-input/select-input.component';\nimport * as i20 from '../components/forms/multiple-select-input/multiple-select-input.component';\nimport * as i21 from '../components/forms/autocomplete-input/autocomplete-input.component';\nimport * as i22 from '../components/scroll-container/scroll-container.component';\nimport * as i23 from '../components/noop/noop.component';\nimport * as i24 from '../components/switch-case/switch-case.component';\nimport * as i25 from '../components/focus-container/focus-container.component';\nimport * as i26 from '../components/vertical-focus-container/vertical-focus-container.component';\nimport * as i27 from '../components/focusable.component';\nimport * as i28 from '../components/card-container/card-container.component';\nimport * as i29 from '../components/table/table.component';\nimport * as i30 from '../components/table/edit-row-controls/edit-row-controls.component';\nimport * as i31 from '../components/table/column-template/column-template.directive';\nimport * as i32 from '../components/icon/icon.component';\nimport * as i33 from '../components/section-header/section-header.component';\nimport * as i34 from '../components/table/table-row-menu/table-row-menu.component';\nimport * as i35 from '../components/commands/group/tool-bar/tool-bar.component';\nimport * as i36 from '../components/commands/command/command.component';\nimport * as i37 from '../components/commands/group/popup-menu/popup-menu.component';\nimport * as i38 from '../components/commands/command-face/command-face.component';\nimport * as i39 from '../components/commands/group/popup-menu/more-menu.component';\nimport * as i40 from '../components/commands/separator.component';\nimport * as i41 from '../components/commands/flex.component';\nimport * as i42 from './components/activity-container/activity-container.component';\nimport * as i43 from './components/confirmation-dialog/confirmation-dialog.component';\nimport * as i44 from './components/confirm-then-dialog/confirm-then-dialog.component';\nimport * as i45 from './components/alert-dialog/alert-dialog.component';\nimport * as i46 from './components/activity-container/activity-outlet/activity-outlet.component';\nimport * as i47 from './components/inplace-interaction-context/in-place-interaction-context.component';\nimport * as i48 from './components/add-item-interaction-context/add-item-interaction-context.component';\nimport * as i49 from './components/activity-actions/activity-actions.component';\nimport * as i50 from './components/popup-interaction-context/popup-interaction-context.component';\nimport * as i51 from './components/input-activities/string-input-activity';\nimport * as i52 from './components/input-activities/select-input-activity';\nimport * as i53 from './components/input-activities/abstract-input-activity';\nimport * as i54 from './directives/interaction-context-trigger-for.directive';\nimport * as i55 from './activity';\nimport * as i56 from '../directives/directives.module';\nimport * as i57 from '../components/components.module';\nexport const InteractionModuleNgFactory:i0.NgModuleFactory<i1.InteractionModule> = (null as any);\nvar _decl0_0:i2.NgClass = (<any>(null as any));\nvar _decl0_1:i2.NgComponentOutlet = (<any>(null as any));\nvar _decl0_2:i2.NgForOf<any,any> = (<any>(null as any));\nvar _decl0_3:i2.NgIf<any> = (<any>(null as any));\nvar _decl0_4:i2.NgTemplateOutlet = (<any>(null as any));\nvar _decl0_5:i2.NgStyle = (<any>(null as any));\nvar _decl0_6:i2.NgSwitch = (<any>(null as any));\nvar _decl0_7:i2.NgSwitchCase = (<any>(null as any));\nvar _decl0_8:i2.NgSwitchDefault = (<any>(null as any));\nvar _decl0_9:i2.NgPlural = (<any>(null as any));\nvar _decl0_10:i2.NgPluralCase = (<any>(null as any));\nvar _decl0_11:i3.Dir = (<any>(null as any));\nvar _decl0_12:i4.MatButton = (<any>(null as any));\nvar _decl0_13:i4.MatAnchor = (<any>(null as any));\nvar _decl0_14:i5.MatDialogContainer = (<any>(null as any));\nvar _decl0_15:i5.MatDialogClose = (<any>(null as any));\nvar _decl0_16:i5.MatDialogTitle = (<any>(null as any));\nvar _decl0_17:i5.MatDialogContent = (<any>(null as any));\nvar _decl0_18:i5.MatDialogActions = (<any>(null as any));\nvar _decl0_19:i6.MatTabGroup = (<any>(null as any));\nvar _decl0_20:i6.MatTabLabel = (<any>(null as any));\nvar _decl0_21:i6.MatTab = (<any>(null as any));\nvar _decl0_22:i6.MatTabNav = (<any>(null as any));\nvar _decl0_23:i6.MatTabLink = (<any>(null as any));\nvar _decl0_24:i6.MatTabContent = (<any>(null as any));\nvar _decl0_25:i7.CdkPortal = (<any>(null as any));\nvar _decl0_26:i7.CdkPortalOutlet = (<any>(null as any));\nvar _decl0_27:i7.TemplatePortalDirective = (<any>(null as any));\nvar _decl0_28:i7.PortalHostDirective = (<any>(null as any));\nvar _decl0_29:i8.RouterOutlet = (<any>(null as any));\nvar _decl0_30:i8.RouterLink = (<any>(null as any));\nvar _decl0_31:i8.RouterLinkWithHref = (<any>(null as any));\nvar _decl0_32:i8.RouterLinkActive = (<any>(null as any));\nvar _decl0_33:i8.ɵangular_packages_router_router_l = (<any>(null as any));\nvar _decl0_34:i9.MatIcon = (<any>(null as any));\nvar _decl0_35:i10.CommandDirective<any> = (<any>(null as any));\nvar _decl0_36:i11.FocusBindingDirective = (<any>(null as any));\nvar _decl0_37:i12.DefaultLayoutDirective = (<any>(null as any));\nvar _decl0_38:i12.DefaultLayoutGapDirective = (<any>(null as any));\nvar _decl0_39:i12.DefaultLayoutAlignDirective = (<any>(null as any));\nvar _decl0_40:i12.DefaultFlexOrderDirective = (<any>(null as any));\nvar _decl0_41:i12.DefaultFlexOffsetDirective = (<any>(null as any));\nvar _decl0_42:i12.FlexFillDirective = (<any>(null as any));\nvar _decl0_43:i12.DefaultFlexAlignDirective = (<any>(null as any));\nvar _decl0_44:i12.DefaultFlexDirective = (<any>(null as any));\nvar _decl0_45:i13.ɵgrid_privatec = (<any>(null as any));\nvar _decl0_46:i13.ɵgrid_privatef = (<any>(null as any));\nvar _decl0_47:i13.ɵgrid_privatei = (<any>(null as any));\nvar _decl0_48:i13.ɵgrid_privatel = (<any>(null as any));\nvar _decl0_49:i13.ɵgrid_privateo = (<any>(null as any));\nvar _decl0_50:i13.ɵgrid_privater = (<any>(null as any));\nvar _decl0_51:i13.ɵgrid_privateu = (<any>(null as any));\nvar _decl0_52:i13.ɵgrid_privatex = (<any>(null as any));\nvar _decl0_53:i13.ɵgrid_privateba = (<any>(null as any));\nvar _decl0_54:i13.ɵgrid_privatebd = (<any>(null as any));\nvar _decl0_55:i13.ɵgrid_privatebg = (<any>(null as any));\nvar _decl0_56:i14.NumberInputComponent = (<any>(null as any));\nvar _decl0_57:i15.StringInputComponent = (<any>(null as any));\nvar _decl0_58:i16.TextInputComponent = (<any>(null as any));\nvar _decl0_59:i17.PasswordInputComponent = (<any>(null as any));\nvar _decl0_60:i18.CheckboxInputComponent = (<any>(null as any));\nvar _decl0_61:i19.SelectInputComponent<any> = (<any>(null as any));\nvar _decl0_62:i20.MultipleSelectInputComponent<any> = (<any>(null as any));\nvar _decl0_63:i21.AutocompleteInputComponent<any> = (<any>(null as any));\nvar _decl0_64:i22.ScrollContainerComponent = (<any>(null as any));\nvar _decl0_65:i23.NoopComponent = (<any>(null as any));\nvar _decl0_66:i24.SwitchCaseComponent<any> = (<any>(null as any));\nvar _decl0_67:i24.SwitchCaseWhenDirective<any> = (<any>(null as any));\nvar _decl0_68:i24.SwitchCaseDefaultDirective<any> = (<any>(null as any));\nvar _decl0_69:i25.FocusContainerComponent = (<any>(null as any));\nvar _decl0_70:i26.VerticalFocusContainerComponent = (<any>(null as any));\nvar _decl0_71:i27.FocusableComponent = (<any>(null as any));\nvar _decl0_72:i28.CardContainerComponent = (<any>(null as any));\nvar _decl0_73:i29.TableComponent<any> = (<any>(null as any));\nvar _decl0_74:i30.EditRowControls<any> = (<any>(null as any));\nvar _decl0_75:i31.ColumnTemplateDirective = (<any>(null as any));\nvar _decl0_76:i32.IconComponent = (<any>(null as any));\nvar _decl0_77:i33.SectionHeaderComponent = (<any>(null as any));\nvar _decl0_78:i34.TableRowMenuComponent<any> = (<any>(null as any));\nvar _decl0_79:i35.ToolBarComponent = (<any>(null as any));\nvar _decl0_80:i36.CommandComponent = (<any>(null as any));\nvar _decl0_81:i37.PopupMenuComponent = (<any>(null as any));\nvar _decl0_82:i38.CommandFaceComponent<any> = (<any>(null as any));\nvar _decl0_83:i39.MoreMenuComponent = (<any>(null as any));\nvar _decl0_84:i40.SeparatorComponent = (<any>(null as any));\nvar _decl0_85:i41.FlexComponent = (<any>(null as any));\nvar _decl0_86:i42.ActivityContainerComponent<any,any,any> = (<any>(null as any));\nvar _decl0_87:i43.ConfirmationDialogComponent = (<any>(null as any));\nvar _decl0_88:i44.ConfirmThenDialogComponent<any,any,any> = (<any>(null as any));\nvar _decl0_89:i45.AlertDialogComponent = (<any>(null as any));\nvar _decl0_90:i46.ActivityOutletComponent<any,any,any> = (<any>(null as any));\nvar _decl0_91:i47.InPlaceInteractionContextComponent<any,any,any> = (<any>(null as any));\nvar _decl0_92:i48.AddItemInteractionContextComponent = (<any>(null as any));\nvar _decl0_93:i49.ActivityActionsComponent = (<any>(null as any));\nvar _decl0_94:i50.PopupInteractionContextComponent = (<any>(null as any));\nvar _decl0_95:i51.StringInputActivity = (<any>(null as any));\nvar _decl0_96:i52.SelectInputActivity<any> = (<any>(null as any));\nvar _decl0_97:i53.AbstractInputActivity<any,any> = (<any>(null as any));\nvar _decl0_98:i54.InteractionContextTriggerFor<any,any,any> = (<any>(null as any));\nvar _decl0_99:i55.Activity<any,any,any> = (<any>(null as any));\nvar _decl0_100:i2.AsyncPipe = (<any>(null as any));\nvar _decl0_101:i2.UpperCasePipe = (<any>(null as any));\nvar _decl0_102:i2.LowerCasePipe = (<any>(null as any));\nvar _decl0_103:i2.JsonPipe = (<any>(null as any));\nvar _decl0_104:i2.SlicePipe = (<any>(null as any));\nvar _decl0_105:i2.DecimalPipe = (<any>(null as any));\nvar _decl0_106:i2.PercentPipe = (<any>(null as any));\nvar _decl0_107:i2.TitleCasePipe = (<any>(null as any));\nvar _decl0_108:i2.CurrencyPipe = (<any>(null as any));\nvar _decl0_109:i2.DatePipe = (<any>(null as any));\nvar _decl0_110:i2.I18nPluralPipe = (<any>(null as any));\nvar _decl0_111:i2.I18nSelectPipe = (<any>(null as any));\nvar _decl0_112:i2.KeyValuePipe = (<any>(null as any));\nvar _decl0_113:i2.CommonModule = (<any>(null as any));\nvar _decl0_114:i4.MatButtonModule = (<any>(null as any));\nvar _decl0_115:i5.MatDialogModule = (<any>(null as any));\nvar _decl0_116:i6.MatTabsModule = (<any>(null as any));\nvar _decl0_117:i7.PortalModule = (<any>(null as any));\nvar _decl0_118:i8.RouterModule = (<any>(null as any));\nvar _decl0_119:i9.MatIconModule = (<any>(null as any));\nvar _decl0_120:i56.DirectivesModule = (<any>(null as any));\nvar _decl0_121:i12.FlexModule = (<any>(null as any));\nvar _decl0_122:i13.GridModule = (<any>(null as any));\nvar _decl0_123:i57.ComponentsModule = (<any>(null as any));\nvar _decl0_124:i0.TemplateRef<any> = (<any>(null as any));\nvar _decl0_125: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 = !_any.focused;\n currVal_0;\n const currVal_1:any = _decl0_86;\n currVal_1;\n const currVal_2:any = _any;\n currVal_2;\n}\nfunction _View_ActivityContainerComponent_1_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_86.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_86.dynamicHeight;\n currVal_3;\n const currVal_4:any = _decl0_86.activityRefs;\n currVal_4;\n const currVal_5:any = _decl0_86.activityIndex;\n currVal_5;\n}\nfunction _View_ConfirmationDialogComponent_Host_2_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_87.class;\n currVal_0;\n const currVal_1:any = _decl0_87.isFocused;\n currVal_1;\n}\nfunction _View_ConfirmationDialogComponent_2_1():void {\n if (_decl0_87.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_87.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_87.confirm.title;\n currVal_0;\n const currVal_1:any = _decl0_87.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_12.disabled;\n currVal_4;\n const currVal_5:any = _decl0_87.confirm.cancel();\n currVal_5;\n const currVal_6:any = (_decl0_87.isDestructive()? 'warn': 'primary');\n currVal_6;\n const currVal_7:any = (_decl0_12.disabled || null);\n currVal_7;\n const currVal_8:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_8;\n const currVal_9:any = _decl0_12.disabled;\n currVal_9;\n const currVal_10:any = _decl0_87.confirm.ok();\n currVal_10;\n const pd_11:any = ((<any>_decl0_87.cancel()) !== false);\n const pd_12:any = ((<any>_decl0_87.done()) !== false);\n}\nfunction _View_ConfirmThenDialogComponent_Host_3_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_88.class;\n currVal_0;\n const currVal_1:any = _decl0_88.isFocused;\n currVal_1;\n}\nfunction _View_ConfirmThenDialogComponent_3_1():void {\n if (_decl0_88.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_88.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_88.confirm.title;\n currVal_0;\n const currVal_1:any = _decl0_88.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_12.disabled;\n currVal_4;\n const currVal_5:any = _decl0_88.confirm.cancel();\n currVal_5;\n const currVal_6:any = (_decl0_88.isDestructive()? 'warn': 'primary');\n currVal_6;\n const currVal_7:any = (_decl0_12.disabled || null);\n currVal_7;\n const currVal_8:any = (_decl0_12._animationMode === 'NoopAnimations');\n currVal_8;\n const currVal_9:any = _decl0_12.disabled;\n currVal_9;\n const currVal_10:any = _decl0_88.confirm.ok();\n currVal_10;\n const pd_11:any = ((<any>_decl0_88.cancel()) !== false);\n const pd_12:any = ((<any>_decl0_88.onConfirm()) !== false);\n}\nfunction _View_AlertDialogComponent_Host_4_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_89.class;\n currVal_0;\n const currVal_1:any = _decl0_89.isFocused;\n currVal_1;\n}\nfunction _View_AlertDialogComponent_4_1():void {\n if (_decl0_89.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_89.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_89.alert.title;\n currVal_0;\n const currVal_1:any = _decl0_89.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_12.disabled;\n currVal_5;\n const currVal_6:any = _decl0_89.alert.ok();\n currVal_6;\n const pd_7:any = ((<any>_decl0_89.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_91.isActive()? 1: 0);\n currVal_1;\n const currVal_2:any = _decl0_91.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_92.active;\n currVal_0;\n const currVal_1:any = _decl0_92.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_92.clickCommand;\n currVal_1;\n const currVal_2:any = _decl0_92.icon;\n currVal_2;\n const currVal_3:any = _decl0_92.label;\n currVal_3;\n const pd_4: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_93.alignEnd;\n currVal_0;\n const currVal_1:any = _decl0_93.alignStretch;\n currVal_1;\n}\nfunction _View_ActivityActionsComponent_8_1():void {\n if (_decl0_93.hasCancelCommand()) {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_93.cancelCommand;\n currVal_0;\n const currVal_1:any = _decl0_93.style.cancel;\n currVal_1;\n }\n}\nfunction _View_ActivityActionsComponent_8_2():void {\n if (_decl0_93.hasConfirmCommand()) {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_93.confirmCommand;\n currVal_0;\n const currVal_1:any = _decl0_93.style.confirm;\n currVal_1;\n }\n}\nfunction _View_ActivityActionsComponent_8_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_93.hasCancelCommand();\n currVal_0;\n const currVal_1:any = _decl0_93.hasConfirmCommand();\n currVal_1;\n}\nfunction _View_PopupInteractionContextComponent_Host_9_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_94.active;\n currVal_0;\n}\nfunction _View_PopupInteractionContextComponent_9_0():void {\n var _any:any = (null as any);\n}\nfunction _View_StringInputActivity_Host_10_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_95.class;\n currVal_0;\n const currVal_1:any = _decl0_95.isFocused;\n currVal_1;\n}\nfunction _View_StringInputActivity_10_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_95.data.label;\n currVal_0;\n const currVal_1:any = _decl0_95.data.placeholder;\n currVal_1;\n const currVal_2:any = _decl0_95.confirmCommand;\n currVal_2;\n const currVal_3:any = _decl0_95.cancelCommand;\n currVal_3;\n const currVal_4:any = _decl0_95.valueModel;\n currVal_4;\n const currVal_5:any = _decl0_57.dense;\n currVal_5;\n const currVal_6:any = _decl0_57.baseClassName;\n currVal_6;\n const currVal_7:any = _decl0_95.confirmCommand;\n currVal_7;\n const currVal_8:any = _decl0_95.cancelCommand;\n currVal_8;\n const currVal_9:any = _decl0_95.data.buttonStyle;\n currVal_9;\n const currVal_10:any = 'end';\n currVal_10;\n const currVal_11:any = _decl0_93.alignEnd;\n currVal_11;\n const currVal_12:any = _decl0_93.alignStretch;\n currVal_12;\n const pd_13:any = ((<any>_decl0_57.notifyClick()) !== false);\n const pd_14:any = ((<any>_decl0_57.notifyFocusIn()) !== false);\n const pd_15:any = ((<any>_decl0_57.notifyFocusOut()) !== false);\n}\nfunction _View_SelectInputActivity_Host_11_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_96.class;\n currVal_0;\n const currVal_1:any = _decl0_96.isFocused;\n currVal_1;\n}\nfunction _View_SelectInputActivity_11_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_96.data.label;\n currVal_0;\n const currVal_1:any = _decl0_96.data.placeholder;\n currVal_1;\n const currVal_2:any = _decl0_96.confirmCommand;\n currVal_2;\n const currVal_3:any = _decl0_96.cancelCommand;\n currVal_3;\n const currVal_4:any = _decl0_96.valueModel;\n currVal_4;\n const currVal_5:any = _decl0_96.options;\n currVal_5;\n const currVal_6:any = _decl0_96.optionLabelFormat;\n currVal_6;\n const currVal_7:any = _decl0_61.dense;\n currVal_7;\n const currVal_8:any = _decl0_61.baseClassName;\n currVal_8;\n const currVal_9:any = _decl0_96.confirmCommand;\n currVal_9;\n const currVal_10:any = _decl0_96.cancelCommand;\n currVal_10;\n const currVal_11:any = _decl0_96.data.buttonStyle;\n currVal_11;\n const currVal_12:any = 'end';\n currVal_12;\n const currVal_13:any = _decl0_93.alignEnd;\n currVal_13;\n const currVal_14:any = _decl0_93.alignStretch;\n currVal_14;\n const pd_15:any = ((<any>_decl0_61.notifyClick()) !== false);\n const pd_16:any = ((<any>_decl0_61.notifyFocusIn()) !== false);\n const pd_17:any = ((<any>_decl0_61.notifyFocusOut()) !== false);\n}\nfunction _View_AbstractInputActivity_Host_12_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_97.class;\n currVal_0;\n const currVal_1:any = _decl0_97.isFocused;\n currVal_1;\n}\nfunction _View_AbstractInputActivity_12_0():void {\n var _any:any = (null as any);\n}\nfunction _View_Activity_Host_13_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_99.class;\n currVal_0;\n const currVal_1:any = _decl0_99.isFocused;\n currVal_1;\n}\nfunction _View_Activity_13_0():void {\n var _any:any = (null as any);\n}\n"]}
|
|
@@ -4,15 +4,18 @@ import { Router, RouterOutlet } from '@angular/router';
|
|
|
4
4
|
import { DebugContext, Dsl, lang, ListModel, MutableValueModel, StoreInListModel, StoreInValueModel, Trace, TrackExternal, ValueModel } from '@coolon/pectin';
|
|
5
5
|
import * as _ from 'lodash';
|
|
6
6
|
import { DisposableComponent } from '../../../components/disposable-component';
|
|
7
|
+
import { PLACE_AUTH_SERVICE } from '../../place-auth-service';
|
|
7
8
|
import { PlaceComponent } from '../../place-component';
|
|
8
9
|
import { AUP_PLACE_CONFIG } from '../../place-config';
|
|
9
10
|
import { PlaceRouter } from '../../place-router';
|
|
11
|
+
import { Visit } from '../../visit';
|
|
10
12
|
import { LEFT_RIGHT_PLACE_ANIMATION } from './route-animations';
|
|
11
13
|
export class PlaceOutletComponent extends DisposableComponent {
|
|
12
|
-
constructor(router, placeRouter, placeConfig, parentOutlet) {
|
|
14
|
+
constructor(router, placeRouter, placeAuthService, placeConfig, parentOutlet) {
|
|
13
15
|
super();
|
|
14
16
|
this.router = router;
|
|
15
17
|
this.placeRouter = placeRouter;
|
|
18
|
+
this.placeAuthService = placeAuthService;
|
|
16
19
|
this.placeConfig = placeConfig;
|
|
17
20
|
this.placeChanged = new EventEmitter();
|
|
18
21
|
this.outletActivated = new MutableValueModel(false);
|
|
@@ -57,6 +60,13 @@ export class PlaceOutletComponent extends DisposableComponent {
|
|
|
57
60
|
chain(this._activePlaceModel)
|
|
58
61
|
.postponeWhile(this.navigationInProgress)
|
|
59
62
|
.subscribe(place => this.placeChanged.emit(place));
|
|
63
|
+
when(placeAuthService.authoriserModel).changes(isAuthorised => {
|
|
64
|
+
const activePlace = this._activePlaceModel.value;
|
|
65
|
+
if (activePlace && !isAuthorised(activePlace.placeDefinition)) {
|
|
66
|
+
const visitOrPlace = placeAuthService.handleNotAuthorised(this._activatedRouteModel.value.snapshot, this.router.routerState.snapshot);
|
|
67
|
+
this.placeRouter.navigate(visitOrPlace instanceof Visit ? visitOrPlace : new Visit(PlaceComponent.getDefinition(visitOrPlace)));
|
|
68
|
+
}
|
|
69
|
+
});
|
|
60
70
|
}
|
|
61
71
|
// @Trace()
|
|
62
72
|
ngOnInit() {
|
|
@@ -178,6 +188,7 @@ PlaceOutletComponent.decorators = [
|
|
|
178
188
|
PlaceOutletComponent.ctorParameters = () => [
|
|
179
189
|
{ type: Router },
|
|
180
190
|
{ type: PlaceRouter },
|
|
191
|
+
{ type: undefined, decorators: [{ type: Inject, args: [PLACE_AUTH_SERVICE,] }] },
|
|
181
192
|
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [AUP_PLACE_CONFIG,] }] },
|
|
182
193
|
{ type: PlaceOutletComponent, decorators: [{ type: SkipSelf }, { type: Optional }] }
|
|
183
194
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place-outlet.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/place/components/place-outlet/place-outlet.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAU,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACtH,OAAO,EAAkB,MAAM,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAGL,YAAY,EACZ,GAAG,EACH,IAAI,EACJ,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EAAE,KAAK,EACxB,aAAa,EACb,UAAU,EAEX,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,C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,IAAI,EAAE;;AAhB1C;IADU,iBAAiB,CAAC,cAAc,CAAC;;qDAC1B;AAGjB;IADU,aAAa,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;8BACjC,UAAU;0DAAU;AAIlC;IADoC,aAAa,EAAE;8BACnB,SAAS;4EAAgC;AAIzE;IAD+B,gBAAgB,CAAC,gCAAgC,CAAC;;uEACtB;AA4H3D;IADC,KAAK,EAAE;;qCACwB,YAAY,EAAS,cAAc;;6DAMlE;AAeD;IADC,KAAK,EAAE;;;;+DAKP","sourcesContent":["import { Component, EventEmitter, Inject, Input, OnInit, Optional, Output, SkipSelf, ViewChild } from '@angular/core';\nimport { ActivatedRoute, Router, RouterOutlet } from '@angular/router';\nimport {\n BooleanValueModelChain,\n Constructable,\n DebugContext,\n Dsl,\n lang,\n ListModel, ListModelChain,\n MutableValueModel,\n StoreInListModel,\n StoreInValueModel, Trace,\n TrackExternal,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { DisposableComponent } from '../../../components/disposable-component';\nimport { PlaceComponent } from '../../place-component';\nimport { AUP_PLACE_CONFIG, PlaceConfig } from '../../place-config';\nimport { PlaceDefinition } from '../../place-definition';\nimport { PlaceRouter } from '../../place-router';\n\nimport { Visit } from '../../visit';\nimport { LEFT_RIGHT_PLACE_ANIMATION } from './route-animations';\n\n// Quick hack to avoid circular references between this and PlaceComponents.\ninterface PlaceRef {\n readonly placeDefinition: PlaceDefinition\n\n initialiseBindings(param: ValueModel<Visit>): void;\n\n onPlaceReady(): void;\n}\n\n@Component({\n selector: 'aup-place-outlet',\n templateUrl: './place-outlet.component.html',\n styleUrls: ['./place-outlet.component.scss'],\n animations: [LEFT_RIGHT_PLACE_ANIMATION]\n})\nexport class PlaceOutletComponent extends DisposableComponent implements OnInit {\n\n @Input() @StoreInValueModel('animateModel')\n animate: boolean;\n\n @Input() @TrackExternal({ defaultValue: true })\n animateModel: ValueModel<boolean>;\n\n // tslint:disable-next-line:no-input-rename\n @Input('placeAnimationOrderModel') @TrackExternal()\n customPlaceAnimationOrderModel: ListModel<Constructable<PlaceComponent>>;\n\n // tslint:disable-next-line:no-input-rename\n @Input('placeAnimationOrder') @StoreInListModel('customPlaceAnimationOrderModel')\n customPlaceAnimationOrder: Constructable<PlaceComponent>[];\n\n @Output()\n readonly placeChanged = new EventEmitter<PlaceComponent>();\n\n @ViewChild('routeOutlet', { static: true })\n routerOut: RouterOutlet;\n\n private onAnimationFinishedJob: () => void;\n\n\n private outletActivated = new MutableValueModel(false);\n private readonly _activatedRouteModel = new MutableValueModel<ActivatedRoute>();\n private readonly _activePlaceModel = new MutableValueModel<PlaceComponent>();\n private readonly _activePlaceDefinition: ValueModelChain<PlaceDefinition>;\n\n private parentOutletModel: MutableValueModel<PlaceOutletComponent>;\n public readonly activePlaceAnimationPosition: ValueModelChain<number>;\n\n private initialPlaceIndex: number = null;\n private routerVisitModel: ValueModelChain<Visit>;\n private _isPushingVisitToRoute = new MutableValueModel<boolean>(false);\n private navigationInProgress: ValueModelChain<boolean>;\n\n private isVeryFirstLoad = true;\n private placesInAnimationOrder: ListModelChain<Constructable<PlaceComponent>>;\n private animationSupported: BooleanValueModelChain;\n readonly animationEnabled: BooleanValueModelChain;\n\n constructor(private readonly router: Router,\n private readonly placeRouter: PlaceRouter,\n @Optional() @Inject(AUP_PLACE_CONFIG) readonly placeConfig: PlaceConfig,\n @SkipSelf() @Optional() parentOutlet: PlaceOutletComponent) {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n\n this.parentOutletModel = new MutableValueModel(parentOutlet);\n\n const defaultPlaceAnimationOrder = chain(this.parentOutletModel)\n .pullValueModel(o => o.activePlaceModel)\n .pluck('placeDefinition')\n .pluckList('children')\n .pluck('component');\n\n const activatePlaceType = chain(this.activePlaceModel).map(p => p.constructor as Constructable<PlaceComponent>);\n\n this.placesInAnimationOrder = chain(this.customPlaceAnimationOrderModel)\n .otherwise(defaultPlaceAnimationOrder);\n\n this.activePlaceAnimationPosition = this.placesInAnimationOrder\n .reduce((placesInOrder) => {\n let placeIndex = 0;\n if (activatePlaceType.value) {\n placeIndex = placesInOrder.indexOf(activatePlaceType.value);\n if (_.isNil(this.initialPlaceIndex)) {\n this.initialPlaceIndex = placeIndex;\n }\n }\n return _.isNil(this.initialPlaceIndex) ? 0 : placeIndex - this.initialPlaceIndex;\n }, { dependsOn: activatePlaceType });\n\n this.animationSupported = this.placesInAnimationOrder.count().isGreaterThan(0);\n this.animationEnabled = valueOf.all(\n this.animateModel,\n this.animationSupported\n ).areTruthy();\n\n // Extract our visit model from the place router.\n this._activePlaceDefinition = chain(this._activePlaceModel).pluck('placeDefinition');\n this.routerVisitModel = this._activePlaceDefinition.findIn(chain(placeRouter.activeVisitsByPlaceDefinition));\n\n this.navigationInProgress = chain(this.placeRouter.navigationInProgress);\n\n when(this.navigationInProgress).becomesFalsey(() => {\n this.checkStateAndInitialise();\n });\n when(this.outletActivated).becomesTruthy(() => {\n this.checkStateAndInitialise();\n });\n\n chain(this._activePlaceModel)\n .postponeWhile(this.navigationInProgress)\n .subscribe(place => this.placeChanged.emit(place));\n\n }\n\n // @Trace()\n ngOnInit() {\n }\n\n // @Trace()\n getAnimationOrder() {\n return this.activePlaceAnimationPosition.value;\n }\n\n get animationDuration() {\n return this.placeConfig && this.placeConfig.animationDuration ? this.placeConfig.animationDuration : '500ms';\n }\n\n // @Trace()\n navigate(visit: Visit) {\n // const place = this.placesInAnimationOrder.query().findMatching(p => visit.placeDefinition.component === p);\n // if (!place) {\n // lang.illegalState()\n // }\n this.placeRouter.navigate(visit, {\n relativeTo: this.parentOutlet ? this.parentOutlet.activatedRouteModel.value : null\n });\n }\n\n get parentOutlet(): PlaceOutletComponent {\n return this.parentOutletModel.value;\n }\n\n\n get activePlaceModel(): ValueModel<PlaceComponent> {\n return this._activePlaceModel.readonly;\n }\n\n get activatedRouteModel(): ValueModel<ActivatedRoute> {\n return this._activatedRouteModel.readonly;\n }\n\n @Trace()\n onOutletActivated(routerOutlet: RouterOutlet, place: PlaceComponent) {\n this._activatedRouteModel.value = routerOutlet.activatedRoute;\n this._activePlaceModel.value = place;\n this.validateAnimationState(place);\n this.outletActivated.value = true;\n this.checkStateAndInitialise();\n }\n\n private validateAnimationState(place: PlaceComponent) {\n if (this.animateModel.value) {\n if (this.placesInAnimationOrder.length < 1) {\n console.error('PlaceOutlet.animate === true but placeAnimationOrder has not been set. Animation is disabled.');\n } else {\n if (!this.placesInAnimationOrder.query().includes(place.placeDefinition.component)) {\n console.error(`PlaceOutlet.animate === true but placeAnimationOrder doesn't contain ${place.placeDefinition.component.name}.`);\n }\n }\n }\n }\n\n @Trace()\n onOutletDeactivated() {\n this.outletActivated.value = false;\n this._activePlaceModel.value = null;\n this._activatedRouteModel.value = null;\n }\n\n // @Trace()\n private checkStateAndInitialise() {\n const routerVisit = this.routerVisitModel.value;\n const activePlace = this.activePlaceModel.value;\n if (routerVisit && activePlace && !activePlace.isInitialised()) {\n if (routerVisit.placeDefinition !== activePlace.placeDefinition) {\n lang.illegalState('wrong visit!!!');\n }\n this.initialisePlace(routerVisit, activePlace);\n }\n }\n\n private initialisePlace(routerVisit: Visit, activePlace: PlaceComponent) {\n const visitModel = new MutableValueModel<Visit>(routerVisit);\n DebugContext.tag(visitModel, `PlaceOutletComponent[${activePlace.constructor.name})].visitModel`);\n activePlace.initialiseVisit(routerVisit, (current, previous) => {\n this.pushVisitChangeToRoute(previous, current);\n });\n const finishPlaceLoad = () => {\n this._activePlaceModel.value._notifyActive(true);\n }\n if (!this.animationEnabled.value || this.isVeryFirstLoad) {\n // if animation is disabled or this is the very first load then\n // we won't get our animation done callback so we finish the\n // process here and now.\n this.isVeryFirstLoad = false;\n finishPlaceLoad()\n } else {\n this.onAnimationFinishedJob = finishPlaceLoad;\n }\n const { when, chain, valueOf } = Dsl.disposeWith(activePlace);\n when(this.routerVisitModel)\n .changes(visit => {\n activePlace.updateVisit(visit);\n }, {\n unless: valueOf.any(\n this._isPushingVisitToRoute,\n this.routerVisitModel.isNil()\n ).areTruthy()\n });\n }\n\n private pushVisitChangeToRoute(previous: Visit, current: Visit) {\n this._isPushingVisitToRoute.value = true;\n this.placeRouter.pushVisitChangesToRoute(previous, current).finally(() => {\n this._isPushingVisitToRoute.value = false;\n });\n }\n\n// @Trace()\n animationStarted() {\n // console.log({ activePlace: this._activePlaceModel.value });\n }\n\n // @Trace()\n animationDone() {\n if (this.onAnimationFinishedJob) {\n this.onAnimationFinishedJob();\n this.onAnimationFinishedJob = undefined;\n }\n }\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"place-outlet.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/place/components/place-outlet/place-outlet.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAU,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACtH,OAAO,EAAkB,MAAM,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAGL,YAAY,EACZ,GAAG,EACH,IAAI,EACJ,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EAAE,KAAK,EACxB,aAAa,EACb,UAAU,EAEX,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAoB,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAe,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,0BAA0B,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;YAC9B,IAAI,CAAC,sBAAsB,GAAG,SAAS,CAAC;SACzC;IACH,CAAC;;;YAhPF,SAAS,SAAC;gBACT,QAAQ,EAAE,kBAAkB;gBAC5B,i4BAA4C;gBAE5C,UAAU,EAAE,CAAC,0BAA0B,CAAC;;aACzC;;;YAxCwB,MAAM;YAqBtB,WAAW;4CAiEL,MAAM,SAAC,kBAAkB;4CACzB,QAAQ,YAAI,MAAM,SAAC,gBAAgB;YACE,oBAAoB,uBAAzD,QAAQ,YAAI,QAAQ;;;sBA7ChC,KAAK;2BAGL,KAAK;6CAIL,KAAK,SAAC,0BAA0B;wCAIhC,KAAK,SAAC,qBAAqB;2BAG3B,MAAM;wBAGN,SAAS,SAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;AAhB1C;IADU,iBAAiB,CAAC,cAAc,CAAC;;qDAC1B;AAGjB;IADU,aAAa,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;8BACjC,UAAU;0DAAU;AAIlC;IADoC,aAAa,EAAE;8BACnB,SAAS;4EAAgC;AAIzE;IAD+B,gBAAgB,CAAC,gCAAgC,CAAC;;uEACtB;AAqI3D;IADC,KAAK,EAAE;;qCACwB,YAAY,EAAS,cAAc;;6DAMlE;AAeD;IADC,KAAK,EAAE;;;;+DAKP","sourcesContent":["import { Component, EventEmitter, Inject, Input, OnInit, Optional, Output, SkipSelf, ViewChild } from '@angular/core';\nimport { ActivatedRoute, Router, RouterOutlet } from '@angular/router';\nimport {\n BooleanValueModelChain,\n Constructable,\n DebugContext,\n Dsl,\n lang,\n ListModel, ListModelChain,\n MutableValueModel,\n StoreInListModel,\n StoreInValueModel, Trace,\n TrackExternal,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { DisposableComponent } from '../../../components/disposable-component';\nimport { PLACE_AUTH_SERVICE, PlaceAuthService } from '../../place-auth-service';\nimport { PlaceComponent } from '../../place-component';\nimport { AUP_PLACE_CONFIG, PlaceConfig } from '../../place-config';\nimport { PlaceDefinition } from '../../place-definition';\nimport { PlaceRouter } from '../../place-router';\n\nimport { Visit } from '../../visit';\nimport { LEFT_RIGHT_PLACE_ANIMATION } from './route-animations';\n\n// Quick hack to avoid circular references between this and PlaceComponents.\ninterface PlaceRef {\n readonly placeDefinition: PlaceDefinition\n\n initialiseBindings(param: ValueModel<Visit>): void;\n\n onPlaceReady(): void;\n}\n\n@Component({\n selector: 'aup-place-outlet',\n templateUrl: './place-outlet.component.html',\n styleUrls: ['./place-outlet.component.scss'],\n animations: [LEFT_RIGHT_PLACE_ANIMATION]\n})\nexport class PlaceOutletComponent extends DisposableComponent implements OnInit {\n\n @Input() @StoreInValueModel('animateModel')\n animate: boolean;\n\n @Input() @TrackExternal({ defaultValue: true })\n animateModel: ValueModel<boolean>;\n\n // tslint:disable-next-line:no-input-rename\n @Input('placeAnimationOrderModel') @TrackExternal()\n customPlaceAnimationOrderModel: ListModel<Constructable<PlaceComponent>>;\n\n // tslint:disable-next-line:no-input-rename\n @Input('placeAnimationOrder') @StoreInListModel('customPlaceAnimationOrderModel')\n customPlaceAnimationOrder: Constructable<PlaceComponent>[];\n\n @Output()\n readonly placeChanged = new EventEmitter<PlaceComponent>();\n\n @ViewChild('routeOutlet', { static: true })\n routerOut: RouterOutlet;\n\n private onAnimationFinishedJob: () => void;\n\n\n private outletActivated = new MutableValueModel(false);\n private readonly _activatedRouteModel = new MutableValueModel<ActivatedRoute>();\n private readonly _activePlaceModel = new MutableValueModel<PlaceComponent>();\n private readonly _activePlaceDefinition: ValueModelChain<PlaceDefinition>;\n\n private parentOutletModel: MutableValueModel<PlaceOutletComponent>;\n public readonly activePlaceAnimationPosition: ValueModelChain<number>;\n\n private initialPlaceIndex: number = null;\n private routerVisitModel: ValueModelChain<Visit>;\n private _isPushingVisitToRoute = new MutableValueModel<boolean>(false);\n private navigationInProgress: ValueModelChain<boolean>;\n\n private isVeryFirstLoad = true;\n private placesInAnimationOrder: ListModelChain<Constructable<PlaceComponent>>;\n private animationSupported: BooleanValueModelChain;\n readonly animationEnabled: BooleanValueModelChain;\n\n constructor(private readonly router: Router,\n private readonly placeRouter: PlaceRouter,\n @Inject(PLACE_AUTH_SERVICE) private readonly placeAuthService: PlaceAuthService,\n @Optional() @Inject(AUP_PLACE_CONFIG) readonly placeConfig: PlaceConfig,\n @SkipSelf() @Optional() parentOutlet: PlaceOutletComponent) {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n\n this.parentOutletModel = new MutableValueModel(parentOutlet);\n\n const defaultPlaceAnimationOrder = chain(this.parentOutletModel)\n .pullValueModel(o => o.activePlaceModel)\n .pluck('placeDefinition')\n .pluckList('children')\n .pluck('component');\n\n const activatePlaceType = chain(this.activePlaceModel).map(p => p.constructor as Constructable<PlaceComponent>);\n\n this.placesInAnimationOrder = chain(this.customPlaceAnimationOrderModel)\n .otherwise(defaultPlaceAnimationOrder);\n\n this.activePlaceAnimationPosition = this.placesInAnimationOrder\n .reduce((placesInOrder) => {\n let placeIndex = 0;\n if (activatePlaceType.value) {\n placeIndex = placesInOrder.indexOf(activatePlaceType.value);\n if (_.isNil(this.initialPlaceIndex)) {\n this.initialPlaceIndex = placeIndex;\n }\n }\n return _.isNil(this.initialPlaceIndex) ? 0 : placeIndex - this.initialPlaceIndex;\n }, { dependsOn: activatePlaceType });\n\n this.animationSupported = this.placesInAnimationOrder.count().isGreaterThan(0);\n this.animationEnabled = valueOf.all(\n this.animateModel,\n this.animationSupported\n ).areTruthy();\n\n // Extract our visit model from the place router.\n this._activePlaceDefinition = chain(this._activePlaceModel).pluck('placeDefinition');\n this.routerVisitModel = this._activePlaceDefinition.findIn(chain(placeRouter.activeVisitsByPlaceDefinition));\n\n this.navigationInProgress = chain(this.placeRouter.navigationInProgress);\n\n when(this.navigationInProgress).becomesFalsey(() => {\n this.checkStateAndInitialise();\n });\n when(this.outletActivated).becomesTruthy(() => {\n this.checkStateAndInitialise();\n });\n\n chain(this._activePlaceModel)\n .postponeWhile(this.navigationInProgress)\n .subscribe(place => this.placeChanged.emit(place));\n\n when(placeAuthService.authoriserModel).changes(isAuthorised => {\n const activePlace = this._activePlaceModel.value;\n if (activePlace && !isAuthorised(activePlace.placeDefinition)) {\n const visitOrPlace = placeAuthService.handleNotAuthorised(this._activatedRouteModel.value.snapshot, this.router.routerState.snapshot);\n this.placeRouter.navigate(visitOrPlace instanceof Visit ? visitOrPlace : new Visit(PlaceComponent.getDefinition(visitOrPlace)))\n }\n });\n\n }\n\n // @Trace()\n ngOnInit() {\n }\n\n // @Trace()\n getAnimationOrder() {\n return this.activePlaceAnimationPosition.value;\n }\n\n get animationDuration() {\n return this.placeConfig && this.placeConfig.animationDuration ? this.placeConfig.animationDuration : '500ms';\n }\n\n // @Trace()\n navigate(visit: Visit) {\n // const place = this.placesInAnimationOrder.query().findMatching(p => visit.placeDefinition.component === p);\n // if (!place) {\n // lang.illegalState()\n // }\n this.placeRouter.navigate(visit, {\n relativeTo: this.parentOutlet ? this.parentOutlet.activatedRouteModel.value : null\n });\n }\n\n get parentOutlet(): PlaceOutletComponent {\n return this.parentOutletModel.value;\n }\n\n\n get activePlaceModel(): ValueModel<PlaceComponent> {\n return this._activePlaceModel.readonly;\n }\n\n get activatedRouteModel(): ValueModel<ActivatedRoute> {\n return this._activatedRouteModel.readonly;\n }\n\n @Trace()\n onOutletActivated(routerOutlet: RouterOutlet, place: PlaceComponent) {\n this._activatedRouteModel.value = routerOutlet.activatedRoute;\n this._activePlaceModel.value = place;\n this.validateAnimationState(place);\n this.outletActivated.value = true;\n this.checkStateAndInitialise();\n }\n\n private validateAnimationState(place: PlaceComponent) {\n if (this.animateModel.value) {\n if (this.placesInAnimationOrder.length < 1) {\n console.error('PlaceOutlet.animate === true but placeAnimationOrder has not been set. Animation is disabled.');\n } else {\n if (!this.placesInAnimationOrder.query().includes(place.placeDefinition.component)) {\n console.error(`PlaceOutlet.animate === true but placeAnimationOrder doesn't contain ${place.placeDefinition.component.name}.`);\n }\n }\n }\n }\n\n @Trace()\n onOutletDeactivated() {\n this.outletActivated.value = false;\n this._activePlaceModel.value = null;\n this._activatedRouteModel.value = null;\n }\n\n // @Trace()\n private checkStateAndInitialise() {\n const routerVisit = this.routerVisitModel.value;\n const activePlace = this.activePlaceModel.value;\n if (routerVisit && activePlace && !activePlace.isInitialised()) {\n if (routerVisit.placeDefinition !== activePlace.placeDefinition) {\n lang.illegalState('wrong visit!!!');\n }\n this.initialisePlace(routerVisit, activePlace);\n }\n }\n\n private initialisePlace(routerVisit: Visit, activePlace: PlaceComponent) {\n const visitModel = new MutableValueModel<Visit>(routerVisit);\n DebugContext.tag(visitModel, `PlaceOutletComponent[${activePlace.constructor.name})].visitModel`);\n activePlace.initialiseVisit(routerVisit, (current, previous) => {\n this.pushVisitChangeToRoute(previous, current);\n });\n const finishPlaceLoad = () => {\n this._activePlaceModel.value._notifyActive(true);\n }\n if (!this.animationEnabled.value || this.isVeryFirstLoad) {\n // if animation is disabled or this is the very first load then\n // we won't get our animation done callback so we finish the\n // process here and now.\n this.isVeryFirstLoad = false;\n finishPlaceLoad()\n } else {\n this.onAnimationFinishedJob = finishPlaceLoad;\n }\n const { when, chain, valueOf } = Dsl.disposeWith(activePlace);\n when(this.routerVisitModel)\n .changes(visit => {\n activePlace.updateVisit(visit);\n }, {\n unless: valueOf.any(\n this._isPushingVisitToRoute,\n this.routerVisitModel.isNil()\n ).areTruthy()\n });\n }\n\n private pushVisitChangeToRoute(previous: Visit, current: Visit) {\n this._isPushingVisitToRoute.value = true;\n this.placeRouter.pushVisitChangesToRoute(previous, current).finally(() => {\n this._isPushingVisitToRoute.value = false;\n });\n }\n\n// @Trace()\n animationStarted() {\n // console.log({ activePlace: this._activePlaceModel.value });\n }\n\n // @Trace()\n animationDone() {\n if (this.onAnimationFinishedJob) {\n this.onAnimationFinishedJob();\n this.onAnimationFinishedJob = undefined;\n }\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"PlaceOutletComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../components/disposable-component","name":"DisposableComponent","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"PlaceOutletComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../components/disposable-component","name":"DisposableComponent","line":42,"character":42},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":36,"character":1},"arguments":[{"selector":"aup-place-outlet","animations":[{"__symbolic":"reference","module":"./route-animations","name":"LEFT_RIGHT_PLACE_ANIMATION","line":40,"character":15}],"template":"<ng-container *ngIf=\"animationEnabled.value\">\n <div class=\"router-outlet-container\" cdkScrollable\n [@routeAnimations]=\"{value: getAnimationOrder(), params:{duration: animationDuration}}\"\n (@routeAnimations.start)=\"animationStarted()\"\n (@routeAnimations.done)=\"animationDone()\"\n >\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated(routerOutlet, $event)\"\n (deactivate)=\"onOutletDeactivated()\">\n </router-outlet>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"!animationEnabled.value\">\n <div class=\"router-outlet-container\" cdkScrollable>\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated(routerOutlet, $event)\"\n (deactivate)=\"onOutletDeactivated()\">\n </router-outlet>\n </div>\n</ng-container>\n\n","styles":[":host{display:flex;flex-direction:column;min-height:0}.router-outlet-container{display:block;flex:1;min-height:0;overflow-x:hidden;overflow-y:scroll;position:relative}router-outlet{display:none}"]}]}],"members":{"animate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":44,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":44,"character":12},"arguments":["animateModel"]}]}],"animateModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":47,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":47,"character":12},"arguments":[{"defaultValue":true}]}]}],"customPlaceAnimationOrderModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":51,"character":3},"arguments":["placeAnimationOrderModel"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":51,"character":38}}]}],"customPlaceAnimationOrder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":55,"character":3},"arguments":["placeAnimationOrder"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInListModel","line":55,"character":33},"arguments":["customPlaceAnimationOrderModel"]}]}],"placeChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":58,"character":3}}]}],"routerOut":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":61,"character":3},"arguments":["routeOutlet",{"static":true}]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":87,"character":15},"arguments":[{"__symbolic":"reference","module":"../../place-auth-service","name":"PLACE_AUTH_SERVICE","line":87,"character":22}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":88,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":88,"character":27},"arguments":[{"__symbolic":"reference","module":"../../place-config","name":"AUP_PLACE_CONFIG","line":88,"character":34}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf","line":89,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":89,"character":27}}]],"parameters":[{"__symbolic":"reference","module":"@angular/router","name":"Router","line":85,"character":39},{"__symbolic":"reference","module":"../../place-router","name":"PlaceRouter","line":86,"character":44},{"__symbolic":"reference","module":"../../place-auth-service","name":"PlaceAuthService","line":87,"character":77},{"__symbolic":"reference","module":"../../place-config","name":"PlaceConfig","line":88,"character":74},{"__symbolic":"reference","name":"PlaceOutletComponent"}]}],"ngOnInit":[{"__symbolic":"method"}],"getAnimationOrder":[{"__symbolic":"method"}],"navigate":[{"__symbolic":"method"}],"onOutletActivated":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"Trace","line":188,"character":3}}]}],"validateAnimationState":[{"__symbolic":"method"}],"onOutletDeactivated":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"Trace","line":209,"character":3}}]}],"checkStateAndInitialise":[{"__symbolic":"method"}],"initialisePlace":[{"__symbolic":"method"}],"pushVisitChangeToRoute":[{"__symbolic":"method"}],"animationStarted":[{"__symbolic":"method"}],"animationDone":[{"__symbolic":"method"}]}}}}]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { __awaiter
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
2
|
import { Inject, Injectable, Injector } from '@angular/core';
|
|
3
|
-
import {
|
|
4
|
-
import { lang
|
|
3
|
+
import { Router } from '@angular/router';
|
|
4
|
+
import { lang } from '@coolon/pectin';
|
|
5
5
|
import { InteractionService } from '../../interaction/services/interaction.service';
|
|
6
6
|
import { PLACE_AUTH_SERVICE } from '../place-auth-service';
|
|
7
7
|
import { PlaceComponent } from '../place-component';
|
|
@@ -29,17 +29,28 @@ export class PlaceGuard {
|
|
|
29
29
|
this.interactionService = interactionService;
|
|
30
30
|
this.injector = injector;
|
|
31
31
|
}
|
|
32
|
+
// @Trace()
|
|
32
33
|
canActivate(activatedRoute, state) {
|
|
33
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
35
|
if (PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {
|
|
35
36
|
const placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
if (placeDefinition.authenticate) {
|
|
38
|
+
if (!(yield this.placeAuthService.isAuthenticated())) {
|
|
39
|
+
const redirectLocation = this.placeAuthService.handleNotAuthenticated(activatedRoute, state);
|
|
40
|
+
const nextPlaceDef = this.getPlaceDefinition(redirectLocation);
|
|
41
|
+
if (nextPlaceDef.authenticate) {
|
|
42
|
+
lang.illegalState(`handleNotAuthenticated hook returned place ${nextPlaceDef.component.name} that requires authentication.`);
|
|
43
|
+
}
|
|
44
|
+
return this.createUrlTree(redirectLocation);
|
|
45
|
+
}
|
|
46
|
+
if (!this.placeAuthService.isAuthorised(placeDefinition)) {
|
|
47
|
+
const redirectLocation = this.placeAuthService.handleNotAuthorised(activatedRoute, state);
|
|
48
|
+
const nextPlaceDef = this.getPlaceDefinition(redirectLocation);
|
|
49
|
+
if (!this.placeAuthService.isAuthorised(nextPlaceDef)) {
|
|
50
|
+
lang.illegalState(`handleNotAuthorised hook returned place ${nextPlaceDef.component.name} that is not authorised for the current user.`);
|
|
51
|
+
}
|
|
52
|
+
return this.createUrlTree(redirectLocation);
|
|
53
|
+
}
|
|
43
54
|
}
|
|
44
55
|
const result = yield this.cleanInteractionState(activatedRoute, state, () => __awaiter(this, void 0, void 0, function* () {
|
|
45
56
|
// Parse our route params.
|
|
@@ -68,6 +79,7 @@ export class PlaceGuard {
|
|
|
68
79
|
}
|
|
69
80
|
});
|
|
70
81
|
}
|
|
82
|
+
// @Trace()
|
|
71
83
|
canDeactivate(component, currentRoute, currentState, nextState) {
|
|
72
84
|
return __awaiter(this, void 0, void 0, function* () {
|
|
73
85
|
const currentUrl = this.urlService.parseUrl(currentState.url);
|
|
@@ -76,13 +88,14 @@ export class PlaceGuard {
|
|
|
76
88
|
return result instanceof UrlSnapshot ? result.urlTree : result;
|
|
77
89
|
});
|
|
78
90
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
91
|
+
getPlaceDefinition(result) {
|
|
92
|
+
return result instanceof Visit ?
|
|
93
|
+
result.placeDefinition :
|
|
94
|
+
PlaceComponent.getDefinition(result);
|
|
95
|
+
}
|
|
96
|
+
createUrlTree(result) {
|
|
97
|
+
const visit = result instanceof Visit ? result : new Visit(PlaceComponent.getDefinition(result), {});
|
|
98
|
+
return this.urlService.createUrlSnapshot(visit).urlTree;
|
|
86
99
|
}
|
|
87
100
|
// protected async ensureAuthenticatedThen(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: (placeDefinition: PlaceDefinition) => Promise<boolean | UrlTree>): Promise<boolean | UrlTree> {
|
|
88
101
|
// const authoriseResult = placeDefinition.authenticate ? await this.isAuthorised(activatedRoute, state) : true;
|
|
@@ -105,6 +118,7 @@ export class PlaceGuard {
|
|
|
105
118
|
// return (authorised instanceof Observable) ? authorised.toPromise() : authorised;
|
|
106
119
|
// }
|
|
107
120
|
// abstract getAuthGuard(injector: Injector): CanActivate;
|
|
121
|
+
// @Trace()
|
|
108
122
|
cleanInteractionState(route, state, next) {
|
|
109
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
110
124
|
const url = this.urlService.parseUrl(state.url);
|
|
@@ -132,28 +146,4 @@ PlaceGuard.ctorParameters = () => [
|
|
|
132
146
|
{ type: InteractionService },
|
|
133
147
|
{ type: Injector }
|
|
134
148
|
];
|
|
135
|
-
__decorate([
|
|
136
|
-
Trace(),
|
|
137
|
-
__metadata("design:type", Function),
|
|
138
|
-
__metadata("design:paramtypes", [ActivatedRouteSnapshot, RouterStateSnapshot]),
|
|
139
|
-
__metadata("design:returntype", Promise)
|
|
140
|
-
], PlaceGuard.prototype, "canActivate", null);
|
|
141
|
-
__decorate([
|
|
142
|
-
Trace(),
|
|
143
|
-
__metadata("design:type", Function),
|
|
144
|
-
__metadata("design:paramtypes", [PlaceComponent, ActivatedRouteSnapshot, RouterStateSnapshot, RouterStateSnapshot]),
|
|
145
|
-
__metadata("design:returntype", Promise)
|
|
146
|
-
], PlaceGuard.prototype, "canDeactivate", null);
|
|
147
|
-
__decorate([
|
|
148
|
-
Trace(),
|
|
149
|
-
__metadata("design:type", Function),
|
|
150
|
-
__metadata("design:paramtypes", [Object]),
|
|
151
|
-
__metadata("design:returntype", void 0)
|
|
152
|
-
], PlaceGuard.prototype, "handleGuardResult", null);
|
|
153
|
-
__decorate([
|
|
154
|
-
Trace(),
|
|
155
|
-
__metadata("design:type", Function),
|
|
156
|
-
__metadata("design:paramtypes", [ActivatedRouteSnapshot, RouterStateSnapshot, Function]),
|
|
157
|
-
__metadata("design:returntype", Promise)
|
|
158
|
-
], PlaceGuard.prototype, "cleanInteractionState", null);
|
|
159
149
|
//# sourceMappingURL=place.guard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place.guard.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/place/guards/place.guard.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EACL,sBAAsB,EAGtB,MAAM,EACN,mBAAmB,EAEpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAoB,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EA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A0B,EAAE,IAA0C;;YAC/H,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAChD,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,eAAe,EAAE,EAAE;gBAChE,iGAAiG;gBACjG,mDAAmD;gBACnD,OAAO,GAAG,CAAC,oBAAoB,EAAE,CAAC;aACnC;iBAAM;gBACL,OAAO,IAAI,EAAE,CAAC;aACf;QACH,CAAC;KAAA;;;;YA7GF,UAAU,SAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;YAhBhC,MAAM;YAWC,UAAU;YAFV,WAAW;YADX,YAAY;4CAgBN,MAAM,SAAC,kBAAkB;YAnB/B,kBAAkB;YAVE,QAAQ;;AAmCnC;IADC,KAAK,EAAE;;qCAC0B,sBAAsB,EAAS,mBAAmB;;6CA0CnF;AAGD;IADC,KAAK,EAAE;;qCACuB,cAAc,EAAgB,sBAAsB,EAAgB,mBAAmB,EAAc,mBAAmB;;+CAKtJ;AAGD;IADC,KAAK,EAAE;;;;mDAOP;AA2BD;IADC,KAAK,EAAE;;qCAC2B,sBAAsB,EAAS,mBAAmB;;uDASpF","sourcesContent":["import { Inject, Injectable, Injector } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n CanActivate,\n CanDeactivate,\n Router,\n RouterStateSnapshot,\n UrlTree\n} from '@angular/router';\nimport { lang, Trace } from '@coolon/pectin';\nimport { InteractionService } from '../../interaction/services/interaction.service';\nimport { PLACE_AUTH_SERVICE, PlaceAuthService } from '../place-auth-service';\nimport { PlaceComponent } from '../place-component';\nimport { PlaceHistory } from '../place-history';\nimport { PlaceRouter } from '../place-router';\nimport { VisitSanitiser } from '../route/visit-sanitiser';\nimport { UrlService } from '../url-service';\nimport { UrlSnapshot } from '../url-snapshot';\nimport { Visit } from '../visit';\nimport { ConsolidatedParameterMap } from './consolidated-param-map';\n\n@Injectable({ providedIn: 'root' })\nexport class PlaceGuard implements CanActivate, CanDeactivate<PlaceComponent> {\n\n\n constructor(private readonly router: Router,\n private urlService: UrlService,\n private readonly placeRouter: PlaceRouter,\n private readonly placeHistory: PlaceHistory,\n @Inject(PLACE_AUTH_SERVICE) private readonly placeAuthService: PlaceAuthService,\n private readonly interactionService: InteractionService,\n private readonly injector: Injector) {\n }\n\n @Trace()\n async canActivate(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n\n if (PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {\n const placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);\n\n const needsAuth = placeDefinition.authenticate;\n\n const proceed = !needsAuth || await this.placeAuthService.isAuthenticated();\n if (!proceed) {\n return this.handleGuardResult(this.placeAuthService.handleNotAuthenticated(activatedRoute, state));\n }\n\n if (!this.placeAuthService.isAuthorised(placeDefinition)) {\n return this.handleGuardResult(this.placeAuthService.handleNotAuthorisation(activatedRoute, state));\n }\n\n const result = await this.cleanInteractionState(activatedRoute, state, async () => {\n // Parse our route params.\n const params = new ConsolidatedParameterMap(activatedRoute.paramMap, activatedRoute.url);\n const parsedParams = placeDefinition.parseRouteParams(params);\n\n const navigationSession = this.placeRouter.navigationSession;\n const initialVisit = navigationSession.getVisitFor(placeDefinition) || new Visit(placeDefinition, parsedParams);\n const sanitiser = new VisitSanitiser(navigationSession, activatedRoute, this.router, this.placeHistory, this.injector);\n const sanitisedVisit = await sanitiser.sanitise(initialVisit.mergeRouteParameters(parsedParams));\n\n // Save the visit with any updated parameters. We need to save it so we remember any non route parameters\n navigationSession.storeVisit(sanitisedVisit);\n if (initialVisit.hasRoutingChangedFrom(sanitisedVisit)) {\n // Regenerate the url\n const urlSnapshot = this.urlService.parseUrl(state.url).updateVisitSegments(sanitisedVisit);\n // console.log('##### Place Guard Redirect', urlSnapshot);\n return urlSnapshot;\n } else {\n return true;\n }\n });\n return result instanceof UrlSnapshot ? result.urlTree : result;\n\n } else {\n return lang.illegalState(`expected component to be an instance of PlaceComponent, got ${activatedRoute.component}`);\n }\n }\n\n @Trace()\n async canDeactivate(component: PlaceComponent, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Promise<boolean | UrlTree> {\n const currentUrl = this.urlService.parseUrl(currentState.url);\n const nextUrl = this.urlService.parseUrl(nextState.url);\n const result = await this.placeRouter.navigationSession.canDeactivatePlace(component, currentUrl, nextUrl);\n return result instanceof UrlSnapshot ? result.urlTree : result;\n }\n\n @Trace()\n private handleGuardResult(result: UrlSnapshot | Visit) {\n if (result instanceof UrlSnapshot) {\n return result.urlTree;\n } else {\n return this.urlService.createUrlSnapshot(result).urlTree\n }\n }\n\n // protected async ensureAuthenticatedThen(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: (placeDefinition: PlaceDefinition) => Promise<boolean | UrlTree>): Promise<boolean | UrlTree> {\n // const authoriseResult = placeDefinition.authenticate ? await this.isAuthorised(activatedRoute, state) : true;\n // if (authoriseResult === true) {\n // // we're authorised, now run the place guards.\n // return next(placeDefinition);\n // } else {\n // console.log('not authorised result', authoriseResult);\n // return authoriseResult;\n // }\n // }\n //\n // // @Trace()\n // protected async ensureAuthorisedThen(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: (placeDefinition: PlaceDefinition) => Promise<boolean | UrlTree>): Promise<boolean | UrlTree> {\n //\n // }\n\n // @Trace()\n // async isAuthorised(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n // const authorised = this.getAuthGuard(this.injector).canActivate(activatedRoute, state);\n // return (authorised instanceof Observable) ? authorised.toPromise() : authorised;\n // }\n\n // abstract getAuthGuard(injector: Injector): CanActivate;\n\n @Trace()\n async cleanInteractionState(route: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: () => Promise<boolean | UrlSnapshot>): Promise<boolean | UrlSnapshot> {\n const url = this.urlService.parseUrl(state.url);\n if (!this.interactionService.isActive() && url.hasInteractions()) {\n // This happens if we reload the page or the url was pasted as the route should only be activated\n // after the interaction context has become active.\n return url.removeInteractionIds();\n } else {\n return next();\n }\n }\n\n}\n"]}
|
|
1
|
+
{"version":3,"file":"place.guard.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/place/guards/place.guard.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAIL,MAAM,EAGP,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAiB,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAoB,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;;;;;;;;AAGpE,MAAM,OAAO,UAAU;IAGrB,YAA6B,MAAc,EACvB,UAAsB,EACb,WAAwB,EACxB,YAA0B,EACE,gBAAkC,EAC9D,kBAAsC,EACtC,QAAkB;QANlB,WAAM,GAAN,MAAM,CAAQ;QACvB,eAAU,GAAV,UAAU,CAAY;QACb,gBAAW,GAAX,WAAW,CAAa;QACxB,iBAAY,GAAZ,YAAY,CAAc;QACE,qBAAgB,GAAhB,gBAAgB,CAAkB;QAC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cAAc;IACd,iNAAiN;IACjN,EAAE;IACF,IAAI;IAEJ,WAAW;IACX,uHAAuH;IACvH,4FAA4F;IAC5F,qFAAqF;IACrF,IAAI;IAEJ,0DAA0D;IAE1D,WAAW;IACL,qBAAqB,CAAC,KAA6B,EAAE,KAA0B,EAAE,IAA0C;;YAC/H,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAChD,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,eAAe,EAAE,EAAE;gBAChE,iGAAiG;gBACjG,mDAAmD;gBACnD,OAAO,GAAG,CAAC,oBAAoB,EAAE,CAAC;aACnC;iBAAM;gBACL,OAAO,IAAI,EAAE,CAAC;aACf;QACH,CAAC;KAAA;;;;YAzHF,UAAU,SAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;YAjBhC,MAAM;YAYC,UAAU;YAFV,WAAW;YADX,YAAY;4CAgBN,MAAM,SAAC,kBAAkB;YApB/B,kBAAkB;YAVE,QAAQ","sourcesContent":["import { Inject, Injectable, Injector } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n CanActivate,\n CanDeactivate,\n Router,\n RouterStateSnapshot,\n UrlTree\n} from '@angular/router';\nimport { Constructable, lang } from '@coolon/pectin';\nimport { InteractionService } from '../../interaction/services/interaction.service';\nimport { PLACE_AUTH_SERVICE, PlaceAuthService } from '../place-auth-service';\nimport { PlaceComponent } from '../place-component';\nimport { PlaceDefinition } from '../place-definition';\nimport { PlaceHistory } from '../place-history';\nimport { PlaceRouter } from '../place-router';\nimport { VisitSanitiser } from '../route/visit-sanitiser';\nimport { UrlService } from '../url-service';\nimport { UrlSnapshot } from '../url-snapshot';\nimport { Visit } from '../visit';\nimport { ConsolidatedParameterMap } from './consolidated-param-map';\n\n@Injectable({ providedIn: 'root' })\nexport class PlaceGuard implements CanActivate, CanDeactivate<PlaceComponent> {\n\n\n constructor(private readonly router: Router,\n private urlService: UrlService,\n private readonly placeRouter: PlaceRouter,\n private readonly placeHistory: PlaceHistory,\n @Inject(PLACE_AUTH_SERVICE) private readonly placeAuthService: PlaceAuthService,\n private readonly interactionService: InteractionService,\n private readonly injector: Injector) {\n }\n\n // @Trace()\n async canActivate(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n\n if (PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {\n const placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);\n\n if (placeDefinition.authenticate) {\n\n if (!await this.placeAuthService.isAuthenticated()) {\n const redirectLocation = this.placeAuthService.handleNotAuthenticated(activatedRoute, state);\n const nextPlaceDef = this.getPlaceDefinition(redirectLocation);\n if (nextPlaceDef.authenticate) {\n lang.illegalState(`handleNotAuthenticated hook returned place ${nextPlaceDef.component.name} that requires authentication.`);\n }\n return this.createUrlTree(redirectLocation);\n }\n\n if (!this.placeAuthService.isAuthorised(placeDefinition)) {\n const redirectLocation = this.placeAuthService.handleNotAuthorised(activatedRoute, state);\n const nextPlaceDef = this.getPlaceDefinition(redirectLocation);\n if (!this.placeAuthService.isAuthorised(nextPlaceDef)) {\n lang.illegalState(`handleNotAuthorised hook returned place ${nextPlaceDef.component.name} that is not authorised for the current user.`);\n }\n return this.createUrlTree(redirectLocation);\n }\n }\n\n const result = await this.cleanInteractionState(activatedRoute, state, async () => {\n // Parse our route params.\n const params = new ConsolidatedParameterMap(activatedRoute.paramMap, activatedRoute.url);\n const parsedParams = placeDefinition.parseRouteParams(params);\n\n const navigationSession = this.placeRouter.navigationSession;\n const initialVisit = navigationSession.getVisitFor(placeDefinition) || new Visit(placeDefinition, parsedParams);\n const sanitiser = new VisitSanitiser(navigationSession, activatedRoute, this.router, this.placeHistory, this.injector);\n const sanitisedVisit = await sanitiser.sanitise(initialVisit.mergeRouteParameters(parsedParams));\n\n // Save the visit with any updated parameters. We need to save it so we remember any non route parameters\n navigationSession.storeVisit(sanitisedVisit);\n if (initialVisit.hasRoutingChangedFrom(sanitisedVisit)) {\n // Regenerate the url\n const urlSnapshot = this.urlService.parseUrl(state.url).updateVisitSegments(sanitisedVisit);\n // console.log('##### Place Guard Redirect', urlSnapshot);\n return urlSnapshot;\n } else {\n return true;\n }\n });\n return result instanceof UrlSnapshot ? result.urlTree : result;\n\n } else {\n return lang.illegalState(`expected component to be an instance of PlaceComponent, got ${activatedRoute.component}`);\n }\n }\n\n // @Trace()\n async canDeactivate(component: PlaceComponent, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Promise<boolean | UrlTree> {\n const currentUrl = this.urlService.parseUrl(currentState.url);\n const nextUrl = this.urlService.parseUrl(nextState.url);\n const result = await this.placeRouter.navigationSession.canDeactivatePlace(component, currentUrl, nextUrl);\n return result instanceof UrlSnapshot ? result.urlTree : result;\n }\n\n private getPlaceDefinition(result: Constructable<PlaceComponent> | Visit): PlaceDefinition {\n return result instanceof Visit ?\n result.placeDefinition :\n PlaceComponent.getDefinition(result);\n }\n\n private createUrlTree(result: Constructable<PlaceComponent> | Visit) {\n const visit = result instanceof Visit ? result : new Visit(PlaceComponent.getDefinition(result), {});\n return this.urlService.createUrlSnapshot(visit).urlTree;\n }\n\n // protected async ensureAuthenticatedThen(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: (placeDefinition: PlaceDefinition) => Promise<boolean | UrlTree>): Promise<boolean | UrlTree> {\n // const authoriseResult = placeDefinition.authenticate ? await this.isAuthorised(activatedRoute, state) : true;\n // if (authoriseResult === true) {\n // // we're authorised, now run the place guards.\n // return next(placeDefinition);\n // } else {\n // console.log('not authorised result', authoriseResult);\n // return authoriseResult;\n // }\n // }\n //\n // // @Trace()\n // protected async ensureAuthorisedThen(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: (placeDefinition: PlaceDefinition) => Promise<boolean | UrlTree>): Promise<boolean | UrlTree> {\n //\n // }\n\n // @Trace()\n // async isAuthorised(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n // const authorised = this.getAuthGuard(this.injector).canActivate(activatedRoute, state);\n // return (authorised instanceof Observable) ? authorised.toPromise() : authorised;\n // }\n\n // abstract getAuthGuard(injector: Injector): CanActivate;\n\n // @Trace()\n async cleanInteractionState(route: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: () => Promise<boolean | UrlSnapshot>): Promise<boolean | UrlSnapshot> {\n const url = this.urlService.parseUrl(state.url);\n if (!this.interactionService.isActive() && url.hasInteractions()) {\n // This happens if we reload the page or the url was pasted as the route should only be activated\n // after the interaction context has become active.\n return url.removeInteractionIds();\n } else {\n return next();\n }\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"PlaceGuard":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"PlaceGuard":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":22,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":30,"character":15},"arguments":[{"__symbolic":"reference","module":"../place-auth-service","name":"PLACE_AUTH_SERVICE","line":30,"character":22}]}],null,null],"parameters":[{"__symbolic":"reference","module":"@angular/router","name":"Router","line":26,"character":39},{"__symbolic":"reference","module":"../url-service","name":"UrlService","line":27,"character":34},{"__symbolic":"reference","module":"../place-router","name":"PlaceRouter","line":28,"character":44},{"__symbolic":"reference","module":"../place-history","name":"PlaceHistory","line":29,"character":45},{"__symbolic":"reference","module":"../place-auth-service","name":"PlaceAuthService","line":30,"character":77},{"__symbolic":"reference","module":"../../interaction/services/interaction.service","name":"InteractionService","line":31,"character":51},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":32,"character":41}]}],"canActivate":[{"__symbolic":"method"}],"canDeactivate":[{"__symbolic":"method"}],"getPlaceDefinition":[{"__symbolic":"method"}],"createUrlTree":[{"__symbolic":"method"}],"cleanInteractionState":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}}}}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place-auth-service.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/place-auth-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"place-auth-service.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/place-auth-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAQ/C,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,cAAc,CAAmB,kBAAkB,CAAC,CAAA","sourcesContent":["import { InjectionToken } from '@angular/core';\nimport { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';\nimport { Constructable, ValueModel } from '@coolon/pectin';\nimport { PlaceComponent } from './place-component';\nimport { PlaceDefinition } from './place-definition';\nimport { UrlSnapshot } from './url-snapshot';\nimport { Visit } from './visit';\n\nexport const PLACE_AUTH_SERVICE = new InjectionToken<PlaceAuthService>(\"PlaceAuthService\")\n\n\n/**\n * This interface provides auth services to the routing layer and splits authn and authz into two\n * separate calls so that authentication can be promised based where as authorisation is not. This\n * allows components to check authorisation without having to deal with the promised based nature\n * of authentication.\n */\nexport interface PlaceAuthService {\n\n /**\n * An observable model containing the authoriser function. This allows places to react to changes\n * in permissions when any underlying auth logic changes, e.g. a role being removed from a user.\n */\n readonly authoriserModel: ValueModel<PlaceAuthService.AuthoriserCallback>;\n\n /**\n * Checks if the current user is authenticated. If true the router will proceed to\n * check if the user is authorised. Otherwise it will invoke #handleAuthenticatedFailure.\n */\n isAuthenticated(): boolean | Promise<boolean>;\n\n /**\n * Checks if the current user is authorised. If true the router will proceed to route sanitisation\n * and view loading, otherwise it will invoke #handleAuthorisationFailure.\n * @param placeDefinition\n */\n isAuthorised(placeDefinition: PlaceDefinition): boolean;\n\n handleNotAuthenticated(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Constructable<PlaceComponent> | Visit;\n\n handleNotAuthorised(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Constructable<PlaceComponent> | Visit;\n}\n\nexport namespace PlaceAuthService {\n export type AuthoriserCallback = (placeDef: PlaceDefinition) => boolean;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"PLACE_AUTH_SERVICE":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"PLACE_AUTH_SERVICE":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":8,"character":38},"arguments":["PlaceAuthService"]},"PlaceAuthService":{"__symbolic":"interface"}}}]
|