@coolon/angular-ui-powerups 3.18.0 → 11.0.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.
Files changed (135) hide show
  1. package/assets/activities.scss +2 -1
  2. package/assets/styles.scss +1 -2
  3. package/assets/table.scss +13 -6
  4. package/bundles/coolon-angular-ui-powerups-cypress.umd.js.map +1 -1
  5. package/bundles/coolon-angular-ui-powerups.umd.js +207 -110
  6. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  7. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  8. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  9. package/coolon-angular-ui-powerups.metadata.json +1 -1
  10. package/cypress/package.json +1 -1
  11. package/esm2015/lib/components/busy-overlay/busy-overlay.component.js +1 -1
  12. package/esm2015/lib/components/busy-overlay/busy-overlay.component.metadata.json +1 -1
  13. package/esm2015/lib/components/card-container/card-container.component.js +1 -1
  14. package/esm2015/lib/components/card-container/card-container.component.metadata.json +1 -1
  15. package/esm2015/lib/components/commands/command/command.component.js +5 -1
  16. package/esm2015/lib/components/commands/command/command.component.js.map +1 -1
  17. package/esm2015/lib/components/commands/command/command.component.metadata.json +1 -1
  18. package/esm2015/lib/components/commands/command-face/command-face.component.js +1 -1
  19. package/esm2015/lib/components/commands/command-face/command-face.component.metadata.json +1 -1
  20. package/esm2015/lib/components/commands/group/tool-bar/tool-bar.component.js +1 -1
  21. package/esm2015/lib/components/commands/group/tool-bar/tool-bar.component.metadata.json +1 -1
  22. package/esm2015/lib/components/components.module.js +0 -3
  23. package/esm2015/lib/components/components.module.js.map +1 -1
  24. package/esm2015/lib/components/components.module.metadata.json +1 -1
  25. package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
  26. package/esm2015/lib/components/empty-state/empty-state.component.js +1 -1
  27. package/esm2015/lib/components/empty-state/empty-state.component.metadata.json +1 -1
  28. package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.js +1 -1
  29. package/esm2015/lib/components/forms/checkbox-input/checkbox-input.component.metadata.json +1 -1
  30. package/esm2015/lib/components/icon/icon.component.js +1 -1
  31. package/esm2015/lib/components/icon/icon.component.metadata.json +1 -1
  32. package/esm2015/lib/components/scroll-container/scroll-container.component.js +1 -1
  33. package/esm2015/lib/components/scroll-container/scroll-container.component.metadata.json +1 -1
  34. package/esm2015/lib/components/section-header/section-header.component.js +1 -1
  35. package/esm2015/lib/components/section-header/section-header.component.metadata.json +1 -1
  36. package/esm2015/lib/components/switch-case/switch-case.component.js +1 -1
  37. package/esm2015/lib/components/switch-case/switch-case.component.metadata.json +1 -1
  38. package/esm2015/lib/components/table/column-model.js +2 -1
  39. package/esm2015/lib/components/table/column-model.js.map +1 -1
  40. package/esm2015/lib/components/table/column-model.metadata.json +1 -1
  41. package/esm2015/lib/components/table/paginator/paginator.component.js +1 -1
  42. package/esm2015/lib/components/table/paginator/paginator.component.metadata.json +1 -1
  43. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
  44. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.metadata.json +1 -1
  45. package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.js +1 -1
  46. package/esm2015/lib/components/table/table-header-cell-renderer/table-header-cell-renderer.component.metadata.json +1 -1
  47. package/esm2015/lib/components/table/table-model.js +9 -0
  48. package/esm2015/lib/components/table/table-model.js.map +1 -1
  49. package/esm2015/lib/components/table/table-model.metadata.json +1 -1
  50. package/esm2015/lib/components/table/table.component.js +31 -4
  51. package/esm2015/lib/components/table/table.component.js.map +1 -1
  52. package/esm2015/lib/components/table/table.component.metadata.json +1 -1
  53. package/esm2015/lib/components/tree-table/decorated-tree-node.js +19 -22
  54. package/esm2015/lib/components/tree-table/decorated-tree-node.js.map +1 -1
  55. package/esm2015/lib/components/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.js +1 -1
  56. package/esm2015/lib/components/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.metadata.json +1 -1
  57. package/esm2015/lib/components/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.js +1 -1
  58. package/esm2015/lib/components/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.metadata.json +1 -1
  59. package/esm2015/lib/components/tree-table/tree-table-component.js +22 -5
  60. package/esm2015/lib/components/tree-table/tree-table-component.js.map +1 -1
  61. package/esm2015/lib/components/tree-table/tree-table-component.metadata.json +1 -1
  62. package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.js +1 -1
  63. package/esm2015/lib/interaction/components/activity-actions/activity-actions.component.metadata.json +1 -1
  64. package/esm2015/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.js +1 -1
  65. package/esm2015/lib/interaction/components/add-item-interaction-context/add-item-interaction-context.component.metadata.json +1 -1
  66. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.js +1 -1
  67. package/esm2015/lib/interaction/components/alert-dialog/alert-dialog.component.metadata.json +1 -1
  68. package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.js +1 -1
  69. package/esm2015/lib/interaction/components/confirm-then-dialog/confirm-then-dialog.component.metadata.json +1 -1
  70. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.js +1 -1
  71. package/esm2015/lib/interaction/components/confirmation-dialog/confirmation-dialog.component.metadata.json +1 -1
  72. package/esm2015/lib/place/components/abstract-place-navigation.component.js +18 -3
  73. package/esm2015/lib/place/components/abstract-place-navigation.component.js.map +1 -1
  74. package/esm2015/lib/place/components/abstract-place-navigation.component.metadata.json +1 -1
  75. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js +2 -2
  76. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js.map +1 -1
  77. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.metadata.json +1 -1
  78. package/esm2015/lib/place/components/not-authorised-notice/not-authorised-notice.component.js +14 -0
  79. package/esm2015/lib/place/components/not-authorised-notice/not-authorised-notice.component.js.map +1 -0
  80. package/esm2015/lib/place/components/not-authorised-notice/not-authorised-notice.component.metadata.json +1 -0
  81. package/esm2015/lib/place/components/not-authorised-notice/not-authorised-notice.component.ngfactory.js.map +1 -0
  82. package/esm2015/lib/place/components/not-authorised-notice/not-authorised-notice.component.scss.shim.ngstyle.js.map +1 -0
  83. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +23 -14
  84. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
  85. package/esm2015/lib/place/components/place-outlet/place-outlet.component.metadata.json +1 -1
  86. package/esm2015/lib/place/components/side-place-navigation/side-place-navigation.component.js +2 -2
  87. package/esm2015/lib/place/components/side-place-navigation/side-place-navigation.component.js.map +1 -1
  88. package/esm2015/lib/place/components/side-place-navigation/side-place-navigation.component.metadata.json +1 -1
  89. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +1 -1
  90. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js.map +1 -1
  91. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.metadata.json +1 -1
  92. package/esm2015/lib/place/exports.js +1 -0
  93. package/esm2015/lib/place/exports.js.map +1 -1
  94. package/esm2015/lib/place/exports.metadata.json +1 -1
  95. package/esm2015/lib/place/guards/place.guard.js +5 -8
  96. package/esm2015/lib/place/guards/place.guard.js.map +1 -1
  97. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js +2 -0
  98. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js.map +1 -1
  99. package/esm2015/lib/place/place-component.js +1 -3
  100. package/esm2015/lib/place/place-component.js.map +1 -1
  101. package/esm2015/lib/place/place-component.metadata.json +1 -1
  102. package/esm2015/lib/place/place-router.js +15 -4
  103. package/esm2015/lib/place/place-router.js.map +1 -1
  104. package/esm2015/lib/place/place-router.metadata.json +1 -1
  105. package/esm2015/lib/place/place.module.js +6 -2
  106. package/esm2015/lib/place/place.module.js.map +1 -1
  107. package/esm2015/lib/place/place.module.metadata.json +1 -1
  108. package/esm2015/lib/place/place.module.ngfactory.js.map +1 -1
  109. package/fesm2015/coolon-angular-ui-powerups.js +187 -92
  110. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  111. package/lib/components/commands/command/command.component.d.ts +2 -1
  112. package/lib/components/table/column-model.d.ts +1 -0
  113. package/lib/components/table/table-model.d.ts +9 -0
  114. package/lib/components/table/table.component.d.ts +24 -6
  115. package/lib/components/tree-table/tree-table-component.d.ts +9 -0
  116. package/lib/place/components/abstract-place-navigation.component.d.ts +8 -1
  117. package/lib/place/components/not-authorised-notice/not-authorised-notice.component.d.ts +3 -0
  118. package/lib/place/components/place-outlet/place-outlet.component.d.ts +10 -3
  119. package/lib/place/exports.d.ts +1 -0
  120. package/lib/place/place-component.d.ts +1 -1
  121. package/lib/place/place-router.d.ts +10 -6
  122. package/package.json +22 -20
  123. package/schematics/bootstrap-app/templates/styles/global-variables.scss.template +1 -0
  124. package/schematics/bootstrap-app/templates/styles.scss.template +10 -3
  125. package/schematics/ng-add/index.js +1 -1
  126. package/schematics/ng-add/index.js.map +1 -1
  127. package/schematics/place-add/index.js +7 -10
  128. package/schematics/place-add/index.js.map +1 -1
  129. package/schematics/utils/build-context.d.ts +4 -5
  130. package/schematics/utils/template-utilities.js +1 -9
  131. package/schematics/utils/template-utilities.js.map +1 -1
  132. package/schematics/utils/workspace.d.ts +3 -4
  133. package/schematics/utils/workspace.js.map +1 -1
  134. package/CHANGELOG.md +0 -1369
  135. package/schematics/bootstrap-app/templates/styles/theme.scss.template +0 -37
@@ -40,14 +40,6 @@ export class PlaceGuard {
40
40
  }
41
41
  return this.createUrlTree(redirectLocation);
42
42
  }
43
- if (!(this.placeRouter.accessGuard.value ? this.placeRouter.accessGuard.value.isAuthorised(placeDefinition) : true)) {
44
- const redirectLocation = this.placeRouter.getAuthorisationFailureRedirect(activatedRoute, state);
45
- const nextPlaceDef = this.getPlaceDefinition(redirectLocation);
46
- if (!(this.placeRouter.accessGuard.value ? this.placeRouter.accessGuard.value.isAuthorised(nextPlaceDef) : true)) {
47
- lang.illegalState(`handleNotAuthorised hook returned place ${nextPlaceDef.component.name} that is not authorised for the current user.`);
48
- }
49
- return this.createUrlTree(redirectLocation);
50
- }
51
43
  }
52
44
  const result = yield this.cleanInteractionState(activatedRoute, state, () => __awaiter(this, void 0, void 0, function* () {
53
45
  // Parse our route params.
@@ -79,6 +71,11 @@ export class PlaceGuard {
79
71
  // @Trace()
80
72
  canDeactivate(component, currentRoute, currentState, nextState) {
81
73
  return __awaiter(this, void 0, void 0, function* () {
74
+ if (!component) {
75
+ // this happens when the place wasn't authorised and the associated
76
+ // router outlet was removed from the dom.
77
+ return true;
78
+ }
82
79
  const currentUrl = this.urlService.parseUrl(currentState.url);
83
80
  const nextUrl = this.urlService.parseUrl(nextState.url);
84
81
  const result = yield this.placeRouter.navigationSession.canDeactivatePlace(component, currentUrl, nextUrl);
@@ -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,EAAU,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,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;AAC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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 { 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 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.placeRouter.accessGuard.value.isAuthenticated()) {\n const redirectLocation = this.placeRouter.getAuthenticationFailureRedirect(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.placeRouter.accessGuard.value ? this.placeRouter.accessGuard.value.isAuthorised(placeDefinition) : true)) {\n const redirectLocation = this.placeRouter.getAuthorisationFailureRedirect(activatedRoute, state);\n const nextPlaceDef = this.getPlaceDefinition(redirectLocation);\n if (!(this.placeRouter.accessGuard.value ? this.placeRouter.accessGuard.value.isAuthorised(nextPlaceDef) : true)) {\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
+ {"version":3,"file":"place.guard.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/place/guards/place.guard.ts"],"names":[],"mappings":";AAAA,OAAO,EAAU,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAIL,MAAM,EAGP,MAAM,iBAAiB,CAAC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,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;QACrG,OAAO,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;IAC1D,CAAC;IAED,oNAAoN;IACpN,kHAAkH;IAClH,oCAAoC;IACpC,qDAAqD;IACrD,oCAAoC;IACpC,aAAa;IACb,6DAA6D;IAC7D,8BAA8B;IAC9B,MAAM;IACN,IAAI;IACJ,EAAE;IACF,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;;;;YApHF,UAAU,SAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;YAhBhC,MAAM;YAWC,UAAU;YAFV,WAAW;YADX,YAAY;YAHZ,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 { 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 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.placeRouter.accessGuard.value.isAuthenticated()) {\n const redirectLocation = this.placeRouter.getAuthenticationFailureRedirect(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\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 if (!component) {\n // this happens when the place wasn't authorised and the associated\n // router outlet was removed from the dom.\n return true;\n }\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,4 +1,5 @@
1
1
  import { __awaiter } from "tslib";
2
+ import { assert } from '@coolon/pectin';
2
3
  import * as _ from 'lodash';
3
4
  /**
4
5
  * This class handles the logic around canDeactivate for a given router state transition. It's core responsibilities are:
@@ -12,6 +13,7 @@ export class PlaceComponentDeactivationHandler {
12
13
  this.component = component;
13
14
  this.navigationSession = navigationSession;
14
15
  this.isPrimaryComponent = isPrimaryComponent;
16
+ assert.notNil(component);
15
17
  }
16
18
  get routerInteractionAdapter() {
17
19
  return this.navigationSession.interactionServiceAdapter;
@@ -1 +1 @@
1
- {"version":3,"file":"place-component-deactivation-handler.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/place/navigation/place-component-deactivation-handler.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAK5B;;;;;;GAMG;AACH,MAAM,OAAO,iCAAiC;IAI5C,YAAqB,SAAyB,EAAW,iBAAoC,EAAW,kBAA2B;QAA9G,cAAS,GAAT,SAAS,CAAgB;QAAW,sBAAiB,GAAjB,iBAAiB,CAAmB;QAAW,uBAA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BAA0B,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;wBAC/E,OAAO,KAAK,CAAC;qBACd;iBACF;aACF;YAGD,0EAA0E;YAC1E,IAAI,IAAI,CAAC,yBAAyB,CAAC,SAAS,CAAC,EAAE;gBAE7C,IAAI,IAAI,CAAC,SAAS,CAAC,aAAa,EAAE;oBAChC,qDAAqD;oBACrD,8HAA8H;oBAC9H,+GAA+G;oBAC/G,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,CAAC,iBAAiB,CAAC,+BAA+B,CAAC,CAAC;iBAC7F;gBAED,qGAAqG;gBACrG,wDAAwD;gBACxD,IAAI,IAAI,CAAC,wBAAwB,CAAC,sBAAsB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;oBACxE,OAAO,CAAC,IAAI,CAAC,6EAA6E,CAAC,CAAC;oBAC5F,OAAO,KAAK,CAAC;iBACd;aAEF;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;IAES,yBAAyB,CAAC,SAAsB;QACxD,qFAAqF;QACrF,gFAAgF;QAChF,0CAA0C;QAC1C,OAAO,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IACnE,CAAC;CACF","sourcesContent":["import { Trace } from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { PlaceComponent } from '../place-component';\nimport { UrlSnapshot } from '../url-snapshot';\nimport { NavigationSession } from './session/navigation-session';\n\n/**\n * This class handles the logic around canDeactivate for a given router state transition. It's core responsibilities are:\n * 1. Ensure we only ask the component to deactivate once on a given navigation cycle (since visit sanitisation can result in multiple round trips to through the router.)\n * 2. Ensure only the primary place component is asked when there are nested places. The primary component is the one at the top\n * of the routing change tree.\n * 3. Automatically handle standard interaction scenarios on the components behalf.\n */\nexport class PlaceComponentDeactivationHandler {\n\n private canDeactivatePromise: Promise<boolean | UrlSnapshot>;\n\n constructor(readonly component: PlaceComponent, readonly navigationSession: NavigationSession, readonly isPrimaryComponent: boolean) {\n }\n\n get routerInteractionAdapter() {\n return this.navigationSession.interactionServiceAdapter;\n }\n\n get urlService() {\n return this.navigationSession.urlService;\n }\n\n // @Trace()\n async canDeactivate(currentUrl: UrlSnapshot, nextState: UrlSnapshot): Promise<boolean | UrlSnapshot> {\n // We'll get called multiple times if there's any parameter sanitisation so\n // we always return true if we accepted promise from a previous cycle of the current\n // navigation session.\n if (!this.canDeactivatePromise) {\n // console.log(`creating deactivate promise for -> ${this.component.constructor.name}`);\n this.canDeactivatePromise = this.canDeactivateComponent(currentUrl, nextState);\n }\n return this.canDeactivatePromise;\n }\n\n\n // @Trace()\n protected async canDeactivateComponent(currentUrl: UrlSnapshot, nextState: UrlSnapshot): Promise<UrlSnapshot | boolean> {\n // Automatically cancel any active activities if the navigation session was triggered by the back button.\n // If we handled more than just the pop state then it leads to the UI ignoring clicks and just cancelling things which is deeply disconcerting.\n if (this.navigationSession.isPopState) {\n\n if (this.isPrimaryComponent && this.routerInteractionAdapter.isModalActive()) {\n const routeIds = this.urlService.getActiveInteractionIdsFromUrl(nextState.url);\n const currentIds = this.routerInteractionAdapter.getActiveInteractionContextIds();\n if (!_.isEqual(currentIds, routeIds)) { // why am I checking this????\n await this.routerInteractionAdapter.cancelCurrentModalInteraction();\n return false;\n }\n } else {\n // check if the component has an in place interaction\n if (this.routerInteractionAdapter.isComponentInteracting(this.component)) {\n await this.routerInteractionAdapter.cancelComponentInteraction(this.component);\n return false;\n }\n }\n }\n\n\n // Ok, so now we're really leaving, so we ask the component if we should.;\n if (this.isNotJustAChangeInRouteId(nextState)) {\n\n if (this.component.canDeactivate) {\n // No interaction in progress, so ask the component .\n // This may start an interaction, hence checking the interaction context before now. I.e. if the place pops up the dialog, and\n // the user clicks back again, we'll re-enter here and go bang when the component tries to open another dialog.\n return this.component.canDeactivate(this.navigationSession.canDeactivateInteractionContext);\n }\n\n // The component has an active interaction but no deactivation hook. Rather than guessing what to do\n // we'll just cancel the navigation and print a warning.\n if (this.routerInteractionAdapter.isComponentInteracting(this.component)) {\n console.warn('Route changed while component has active interaction, cancelling navigation');\n return false;\n }\n\n }\n return true;\n }\n\n protected isNotJustAChangeInRouteId(nextState: UrlSnapshot) {\n // Because places with a route-id cover two route segments we get asked to deactivate\n // if the route id is added or removed. So if our path is still present the url\n // then we shouldn't deactivate the place.\n return !nextState.includesPathOf(this.component.placeDefinition);\n }\n}\n"]}
1
+ {"version":3,"file":"place-component-deactivation-handler.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/place/navigation/place-component-deactivation-handler.ts"],"names":[],"mappings":";AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAK5B;;;;;;GAMG;AACH,MAAM,OAAO,iCAAiC;IAI5C,YAAqB,SAAyB,EAAW,iBAAoC,EAAW,kBAA2B;QAA9G,cAAS,GAAT,SAAS,CAAgB;QAAW,sBAAiB,GAAjB,iBAAiB,CAAmB;QAAW,uBAAkB,GAAlB,kBAAkB,CAAS;QACjI,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;IAED,IAAI,wBAAwB;QAC1B,OAAO,IAAI,CAAC,iBAAiB,CAAC,yBAAyB,CAAC;IAC1D,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC;IAC3C,CAAC;IAED,WAAW;IACL,aAAa,CAAC,UAAuB,EAAE,SAAsB;;YACjE,2EAA2E;YAC3E,oFAAoF;YACpF,sBAAsB;YACtB,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE;gBAC9B,wFAAwF;gBACxF,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,sBAAsB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;aAChF;YACD,OAAO,IAAI,CAAC,oBAAoB,CAAC;QACnC,CAAC;KAAA;IAGD,WAAW;IACK,sBAAsB,CA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AAO,KAAK,CAAC;iBACd;aAEF;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;IAES,yBAAyB,CAAC,SAAsB;QACxD,qFAAqF;QACrF,gFAAgF;QAChF,0CAA0C;QAC1C,OAAO,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IACnE,CAAC;CACF","sourcesContent":["import { Trace, assert } from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { PlaceComponent } from '../place-component';\nimport { UrlSnapshot } from '../url-snapshot';\nimport { NavigationSession } from './session/navigation-session';\n\n/**\n * This class handles the logic around canDeactivate for a given router state transition. It's core responsibilities are:\n * 1. Ensure we only ask the component to deactivate once on a given navigation cycle (since visit sanitisation can result in multiple round trips to through the router.)\n * 2. Ensure only the primary place component is asked when there are nested places. The primary component is the one at the top\n * of the routing change tree.\n * 3. Automatically handle standard interaction scenarios on the components behalf.\n */\nexport class PlaceComponentDeactivationHandler {\n\n private canDeactivatePromise: Promise<boolean | UrlSnapshot>;\n\n constructor(readonly component: PlaceComponent, readonly navigationSession: NavigationSession, readonly isPrimaryComponent: boolean) {\n assert.notNil(component);\n }\n\n get routerInteractionAdapter() {\n return this.navigationSession.interactionServiceAdapter;\n }\n\n get urlService() {\n return this.navigationSession.urlService;\n }\n\n // @Trace()\n async canDeactivate(currentUrl: UrlSnapshot, nextState: UrlSnapshot): Promise<boolean | UrlSnapshot> {\n // We'll get called multiple times if there's any parameter sanitisation so\n // we always return true if we accepted promise from a previous cycle of the current\n // navigation session.\n if (!this.canDeactivatePromise) {\n // console.log(`creating deactivate promise for -> ${this.component.constructor.name}`);\n this.canDeactivatePromise = this.canDeactivateComponent(currentUrl, nextState);\n }\n return this.canDeactivatePromise;\n }\n\n\n // @Trace()\n protected async canDeactivateComponent(currentUrl: UrlSnapshot, nextState: UrlSnapshot): Promise<UrlSnapshot | boolean> {\n // Automatically cancel any active activities if the navigation session was triggered by the back button.\n // If we handled more than just the pop state then it leads to the UI ignoring clicks and just cancelling things which is deeply disconcerting.\n if (this.navigationSession.isPopState) {\n\n if (this.isPrimaryComponent && this.routerInteractionAdapter.isModalActive()) {\n const routeIds = this.urlService.getActiveInteractionIdsFromUrl(nextState.url);\n const currentIds = this.routerInteractionAdapter.getActiveInteractionContextIds();\n if (!_.isEqual(currentIds, routeIds)) { // why am I checking this????\n await this.routerInteractionAdapter.cancelCurrentModalInteraction();\n return false;\n }\n } else {\n // check if the component has an in place interaction\n if (this.routerInteractionAdapter.isComponentInteracting(this.component)) {\n await this.routerInteractionAdapter.cancelComponentInteraction(this.component);\n return false;\n }\n }\n }\n\n\n // Ok, so now we're really leaving, so we ask the component if we should.;\n if (this.isNotJustAChangeInRouteId(nextState)) {\n\n if (this.component.canDeactivate) {\n // No interaction in progress, so ask the component .\n // This may start an interaction, hence checking the interaction context before now. I.e. if the place pops up the dialog, and\n // the user clicks back again, we'll re-enter here and go bang when the component tries to open another dialog.\n return this.component.canDeactivate(this.navigationSession.canDeactivateInteractionContext);\n }\n\n // The component has an active interaction but no deactivation hook. Rather than guessing what to do\n // we'll just cancel the navigation and print a warning.\n if (this.routerInteractionAdapter.isComponentInteracting(this.component)) {\n console.warn('Route changed while component has active interaction, cancelling navigation');\n return false;\n }\n\n }\n return true;\n }\n\n protected isNotJustAChangeInRouteId(nextState: UrlSnapshot) {\n // Because places with a route-id cover two route segments we get asked to deactivate\n // if the route id is added or removed. So if our path is still present the url\n // then we shouldn't deactivate the place.\n return !nextState.includesPathOf(this.component.placeDefinition);\n }\n}\n"]}
@@ -19,6 +19,7 @@ export class PlaceComponent extends DisposableComponent {
19
19
  this._active = new MutableValueModel(false);
20
20
  const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
21
21
  when(this._active).becomesTruthy(() => this.onPlaceReady());
22
+ this.childPlaces = this.placeDefinition.children.map(d => d.component);
22
23
  }
23
24
  // @Trace()
24
25
  initialiseVisit(visit, notifyVisitChanged) {
@@ -61,9 +62,6 @@ export class PlaceComponent extends DisposableComponent {
61
62
  get placeDefinition() {
62
63
  return PlaceComponent.getDefinition(this.constructor);
63
64
  }
64
- get childPlaces() {
65
- return this.placeDefinition.children.map(d => d.component);
66
- }
67
65
  get active() {
68
66
  return this._active.readonly;
69
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"place-component.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/place-component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EACL,MAAM,EACN,OAAO,EAEP,YAAY,EACZ,GAAG,EACH,KAAK,EAEL,IAAI,EACJ,iBAAiB,EAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAClE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,8CAA8C;AAC9C,MAAM,CAAC,MAAM,wBAAwB,GAAG,0BAA0B,CAAC;AACnE,qBAAqB;AACrB,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAGzE,MAAM,OAAO,cAAe,SAAQ,mBAAmB;IAUrD;QACE,KAAK,EAAE,CAAC;QATF,eAAU,GAAG,IAAI,iBAAiB,EAAS,CAAC;QAC5C,mBAAc,GAAG,IAAI,KAAK,EAAE,CAAC;QAC7B,YAAO,GAAG,IAAI,iBAAiB,CAAU,KAAK,CAAC,CAAC;QAQtD,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,GAAG,CA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;IADC,OAAO,EAAE;8BACa,eAAe;;qDAErC;AAsBH,WAAiB,cAAc;IAE7B,SAAgB,2BAA2B,CAAC,MAAW;QACrD,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAA4B,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IACtF,CAAC;IAFe,0CAA2B,8BAE1C,CAAA;IAED,SAAgB,kBAAkB,CAAC,KAAoC;QACrE,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,wBAAwB,CAA+B,CAAC;IAClG,CAAC;IAFe,iCAAkB,qBAEjC,CAAA;IAED,SAAgB,aAAa,CAAC,qBAA6E;QACzG,IAAI,qBAAqB,YAAY,sBAAsB,EAAE;YAC3D,MAAM,SAAS,GAAG,qBAAqB,CAAC,SAAS,CAAC;YAClD,IAAI,CAAC,2BAA2B,CAAC,SAAS,CAAC,EAAE;gBAC3C,MAAM,IAAI,KAAK,CAAC,iEAAiE,SAAS,EAAE,CAAC,CAAC;aAC/F;YACD,OAAO,OAAO,CAAC,WAAW,CAAC,wBAAwB,EAAE,SAAS,CAAC,CAAA;SAChE;aAAM;YACL,OAAO,OAAO,CAAC,WAAW,CAAC,wBAAwB,EAAE,qBAAqB,CAAC,CAAC;SAC7E;IACH,CAAC;IAVe,4BAAa,gBAU5B,CAAA;IAED,SAAgB,gBAAgB,CAAC,KAAoC,EAAE,UAA2B;QAChG,OAAO,CAAC,cAAc,CAAC,wBAAwB,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;IAFe,+BAAgB,mBAE/B,CAAA;AAEH,CAAC,EA1BgB,cAAc,KAAd,cAAc,QA0B9B","sourcesContent":["import { Directive } from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\nimport {\n assert,\n Binding,\n Constructable,\n DebugContext,\n Dsl,\n Guard,\n IMutableHasValue,\n lang,\n MutableValueModel\n} from '@coolon/pectin';\nimport { Klass } from '@coolon/typescript-utilities';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator';\nimport 'reflect-metadata';\nimport { DisposableComponent } from '../components/disposable-component';\nimport { InteractionContext } from '../interaction/interaction-context';\nimport { PlaceDefinition } from './place-definition';\nimport { ParameterDefinition } from './route/parameter-definition.class';\nimport { Visit } from './visit';\n\n// RAKE: making this Symbol(...) broke things.\nexport const DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';\n// this one seems ok.\nexport const ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');\n\n@Directive()\nexport class PlaceComponent extends DisposableComponent {\n\n private visitModel = new MutableValueModel<Visit>();\n private _inVisitUpdate = new Guard();\n private _active = new MutableValueModel<boolean>(false);\n\n interactionContext?: InteractionContext;\n\n canDeactivate?(interactionContext: InteractionContext): boolean | Promise<boolean>;\n\n constructor() {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n when(this._active).becomesTruthy(() => this.onPlaceReady());\n }\n\n // @Trace()\n public initialiseVisit(visit: Visit, notifyVisitChanged: (current: Visit, previous: Visit) => void) {\n assert.isNil(this.visitModel.value);\n\n const { when } = Dsl.disposeWith(this);\n\n this.visitModel.value = visit;\n DebugContext.getOrCreate(this.visitModel).tag(`${this.placeDefinition.component.name}.visitModel`);\n this.placeDefinition.getVisitParameterDefs().forEach(parameterDef => this.installBinding(parameterDef));\n when(this.visitModel).changes((current, previous) => {\n notifyVisitChanged(current, previous);\n }, { unless: this._inVisitUpdate });\n }\n\n public updateVisit(visit: Visit) {\n assert.isTruthy(this.isInitialised());\n assert.notNil(visit);\n this._inVisitUpdate.whileTrue(() => {\n this.visitModel.value = visit;\n });\n }\n\n isInitialised() {\n return !!this.visitModel.value;\n }\n\n // @Trace()\n private installBinding<T, S>(parameterDef: ParameterDefinition<T, S>) {\n const model = this[parameterDef.propertyName] as IMutableHasValue<S>;\n DebugContext.tag(model, `${this.placeDefinition.component.name}.${parameterDef.propertyName}`);\n const binding = this.registerDisposable(new Binding(this.visitModel, model, {\n toRight(visit: Visit): S {\n const value = visit.getParameter(parameterDef.name);\n // console.log('push to component', { name: parameterDef.name, value, visit });\n return value;\n },\n toLeft(value: S, currentVisit?: Visit): Visit {\n // console.log('push to route', { name: parameterDef.name, value, currentVisit });\n return currentVisit.replace(parameterDef, value);\n }\n }));\n\n binding.writeRight();\n }\n\n @Memoize()\n get placeDefinition(): PlaceDefinition {\n return PlaceComponent.getDefinition(this.constructor as any as Constructable<PlaceComponent>);\n }\n\n get childPlaces(): Constructable<PlaceComponent>[] {\n return this.placeDefinition.children.map(d => d.component);\n }\n\n get active() {\n return this._active.readonly;\n }\n\n /**\n * Called by the router when the place is ready to interact after any animations have run.\n */\n _notifyActive(active: boolean) {\n this._active.value = active;\n }\n\n onPlaceReady() {\n }\n\n}\n\nexport namespace PlaceComponent {\n\n export function isPlaceComponentConstructor(target: any): target is Constructable<PlaceComponent> {\n return lang.constructorChain(target as Constructable<any>).includes(PlaceComponent);\n }\n\n export function getRouteParameters(klass: Constructable<PlaceComponent>): ParameterDefinition<any>[] {\n return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY) as ParameterDefinition<any>[];\n }\n\n export function getDefinition(snapshotOrConstructor: ActivatedRouteSnapshot | Constructable<PlaceComponent>): PlaceDefinition {\n if (snapshotOrConstructor instanceof ActivatedRouteSnapshot) {\n const component = snapshotOrConstructor.component;\n if (!isPlaceComponentConstructor(component)) {\n throw new Error(`ActivatedRouteSnapshot component is not a PlaceComponent, got ${component}`);\n }\n return Reflect.getMetadata(DEFINITION_META_DATA_KEY, component)\n } else {\n return Reflect.getMetadata(DEFINITION_META_DATA_KEY, snapshotOrConstructor);\n }\n }\n\n export function injectDefinition(klass: Constructable<PlaceComponent>, definition: PlaceDefinition) {\n Reflect.defineMetadata(DEFINITION_META_DATA_KEY, definition, klass);\n }\n\n}\n"]}
1
+ {"version":3,"file":"place-component.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/place-component.ts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,GAAG,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,wBAAwB,CAA+B,CAAC;IAClG,CAAC;IAFe,iCAAkB,qBAEjC,CAAA;IAED,SAAgB,aAAa,CAAC,qBAA6E;QACzG,IAAI,qBAAqB,YAAY,sBAAsB,EAAE;YAC3D,MAAM,SAAS,GAAG,qBAAqB,CAAC,SAAS,CAAC;YAClD,IAAI,CAAC,2BAA2B,CAAC,SAAS,CAAC,EAAE;gBAC3C,MAAM,IAAI,KAAK,CAAC,iEAAiE,SAAS,EAAE,CAAC,CAAC;aAC/F;YACD,OAAO,OAAO,CAAC,WAAW,CAAC,wBAAwB,EAAE,SAAS,CAAC,CAAA;SAChE;aAAM;YACL,OAAO,OAAO,CAAC,WAAW,CAAC,wBAAwB,EAAE,qBAAqB,CAAC,CAAC;SAC7E;IACH,CAAC;IAVe,4BAAa,gBAU5B,CAAA;IAED,SAAgB,gBAAgB,CAAC,KAAoC,EAAE,UAA2B;QAChG,OAAO,CAAC,cAAc,CAAC,wBAAwB,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;IAFe,+BAAgB,mBAE/B,CAAA;AAEH,CAAC,EA1BgB,cAAc,KAAd,cAAc,QA0B9B","sourcesContent":["import { Directive } from '@angular/core';\nimport { ActivatedRouteSnapshot } from '@angular/router';\nimport {\n assert,\n Binding,\n Constructable,\n DebugContext,\n Dsl,\n Guard,\n IMutableHasValue,\n lang,\n MutableValueModel\n} from '@coolon/pectin';\nimport { Klass } from '@coolon/typescript-utilities';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator';\nimport 'reflect-metadata';\nimport { DisposableComponent } from '../components/disposable-component';\nimport { InteractionContext } from '../interaction/interaction-context';\nimport { PlaceDefinition } from './place-definition';\nimport { ParameterDefinition } from './route/parameter-definition.class';\nimport { Visit } from './visit';\n\n// RAKE: making this Symbol(...) broke things.\nexport const DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';\n// this one seems ok.\nexport const ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');\n\n@Directive()\nexport class PlaceComponent extends DisposableComponent {\n\n private visitModel = new MutableValueModel<Visit>();\n private _inVisitUpdate = new Guard();\n private _active = new MutableValueModel<boolean>(false);\n\n interactionContext?: InteractionContext;\n readonly childPlaces: ReadonlyArray<Constructable<PlaceComponent>>;\n\n canDeactivate?(interactionContext: InteractionContext): boolean | Promise<boolean>;\n\n constructor() {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n when(this._active).becomesTruthy(() => this.onPlaceReady());\n this.childPlaces = this.placeDefinition.children.map(d => d.component);\n }\n\n // @Trace()\n public initialiseVisit(visit: Visit, notifyVisitChanged: (current: Visit, previous: Visit) => void) {\n assert.isNil(this.visitModel.value);\n\n const { when } = Dsl.disposeWith(this);\n\n this.visitModel.value = visit;\n DebugContext.getOrCreate(this.visitModel).tag(`${this.placeDefinition.component.name}.visitModel`);\n this.placeDefinition.getVisitParameterDefs().forEach(parameterDef => this.installBinding(parameterDef));\n when(this.visitModel).changes((current, previous) => {\n notifyVisitChanged(current, previous);\n }, { unless: this._inVisitUpdate });\n }\n\n public updateVisit(visit: Visit) {\n assert.isTruthy(this.isInitialised());\n assert.notNil(visit);\n this._inVisitUpdate.whileTrue(() => {\n this.visitModel.value = visit;\n });\n }\n\n isInitialised() {\n return !!this.visitModel.value;\n }\n\n // @Trace()\n private installBinding<T, S>(parameterDef: ParameterDefinition<T, S>) {\n const model = this[parameterDef.propertyName] as IMutableHasValue<S>;\n DebugContext.tag(model, `${this.placeDefinition.component.name}.${parameterDef.propertyName}`);\n const binding = this.registerDisposable(new Binding(this.visitModel, model, {\n toRight(visit: Visit): S {\n const value = visit.getParameter(parameterDef.name);\n // console.log('push to component', { name: parameterDef.name, value, visit });\n return value;\n },\n toLeft(value: S, currentVisit?: Visit): Visit {\n // console.log('push to route', { name: parameterDef.name, value, currentVisit });\n return currentVisit.replace(parameterDef, value);\n }\n }));\n\n binding.writeRight();\n }\n\n @Memoize()\n get placeDefinition(): PlaceDefinition {\n return PlaceComponent.getDefinition(this.constructor as any as Constructable<PlaceComponent>);\n }\n\n get active() {\n return this._active.readonly;\n }\n\n /**\n * Called by the router when the place is ready to interact after any animations have run.\n */\n _notifyActive(active: boolean) {\n this._active.value = active;\n }\n\n onPlaceReady() {\n }\n\n}\n\nexport namespace PlaceComponent {\n\n export function isPlaceComponentConstructor(target: any): target is Constructable<PlaceComponent> {\n return lang.constructorChain(target as Constructable<any>).includes(PlaceComponent);\n }\n\n export function getRouteParameters(klass: Constructable<PlaceComponent>): ParameterDefinition<any>[] {\n return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY) as ParameterDefinition<any>[];\n }\n\n export function getDefinition(snapshotOrConstructor: ActivatedRouteSnapshot | Constructable<PlaceComponent>): PlaceDefinition {\n if (snapshotOrConstructor instanceof ActivatedRouteSnapshot) {\n const component = snapshotOrConstructor.component;\n if (!isPlaceComponentConstructor(component)) {\n throw new Error(`ActivatedRouteSnapshot component is not a PlaceComponent, got ${component}`);\n }\n return Reflect.getMetadata(DEFINITION_META_DATA_KEY, component)\n } else {\n return Reflect.getMetadata(DEFINITION_META_DATA_KEY, snapshotOrConstructor);\n }\n }\n\n export function injectDefinition(klass: Constructable<PlaceComponent>, definition: PlaceDefinition) {\n Reflect.defineMetadata(DEFINITION_META_DATA_KEY, definition, klass);\n }\n\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"DEFINITION_META_DATA_KEY":"PLACE_DEFINITION_OPTIONS","ROUTE_PARAMETER_LIST_KEY":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"Symbol"},"arguments":["place:route:parameters"]},"PlaceComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../components/disposable-component","name":"DisposableComponent","line":28,"character":36},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":27,"character":1}}],"members":{"canDeactivate":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor"}],"initialiseVisit":[{"__symbolic":"method"}],"updateVisit":[{"__symbolic":"method"}],"isInitialised":[{"__symbolic":"method"}],"installBinding":[{"__symbolic":"method"}],"placeDefinition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator","name":"Memoize","line":89,"character":3}}]}],"_notifyActive":[{"__symbolic":"method"}],"onPlaceReady":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"DEFINITION_META_DATA_KEY":"PLACE_DEFINITION_OPTIONS","ROUTE_PARAMETER_LIST_KEY":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"Symbol"},"arguments":["place:route:parameters"]},"PlaceComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../components/disposable-component","name":"DisposableComponent","line":28,"character":36},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":27,"character":1}}],"members":{"canDeactivate":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor"}],"initialiseVisit":[{"__symbolic":"method"}],"updateVisit":[{"__symbolic":"method"}],"isInitialised":[{"__symbolic":"method"}],"installBinding":[{"__symbolic":"method"}],"placeDefinition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator","name":"Memoize","line":91,"character":3}}]}],"_notifyActive":[{"__symbolic":"method"}],"onPlaceReady":[{"__symbolic":"method"}]}}}}]
@@ -54,7 +54,7 @@ export class PlaceRouter extends GarbageCollector {
54
54
  .pluck('name')
55
55
  .otherwise(idleStateName);
56
56
  DebugContext.tag(this._activeVisits, 'PlaceRouter.activeVisits');
57
- this.activeVisitsByPlaceDefinition = chain(this._activeVisits).indexBy('placeDefinition');
57
+ this.state = chain(this._activeVisits).reduce(visits => new PlaceRouter.State(visits));
58
58
  // TODO: make setup the callbacks in during module initiation to make this testable.
59
59
  angularRouter.events.subscribe(event => {
60
60
  // Routing event sequence
@@ -113,9 +113,6 @@ export class PlaceRouter extends GarbageCollector {
113
113
  getAuthenticationFailureRedirect(activatedRoute, state) {
114
114
  return this.redirections.onAuthenticationFailure(activatedRoute, state);
115
115
  }
116
- getAuthorisationFailureRedirect(activatedRoute, state) {
117
- return this.redirections.onAuthorisationFailure(activatedRoute, state);
118
- }
119
116
  get navigationSession() {
120
117
  return this.navigationSessionModel.value;
121
118
  }
@@ -325,4 +322,18 @@ PlaceRouter.ctorParameters = () => [
325
322
  { type: UrlService },
326
323
  { type: PlaceHistory }
327
324
  ];
325
+ (function (PlaceRouter) {
326
+ class State {
327
+ constructor(activeVisits) {
328
+ this.activeVisits = activeVisits;
329
+ }
330
+ isPlaceActive(placeDefinition) {
331
+ return !!this.getVisitFor(placeDefinition);
332
+ }
333
+ getVisitFor(placeDefinition) {
334
+ return this.activeVisits.find(v => v.placeDefinition === placeDefinition);
335
+ }
336
+ }
337
+ PlaceRouter.State = State;
338
+ })(PlaceRouter || (PlaceRouter = {}));
328
339
  //# sourceMappingURL=place-router.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"place-router.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/place-router.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAGL,gBAAgB,EAChB,aAAa,EACb,eAAe,EAEf,eAAe,EACf,MAAM,EAEP,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,MAAM,EACN,OAAO,EACP,YAAY,EACZ,oBAAoB,EACpB,GAAG,EACH,gBAAgB,EAChB,IAAI,EAGJ,gBAAgB,EAChB,iBAAiB,EAGlB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,2B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,CAAC,2BAA2B,CAAC,KAAK,CAAC,CAAC,CAAC;IAC7C,CAAC;;;;YAlVF,UAAU,SAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;;YApCC,MAAM;YAVC,QAAQ;YA6BR,kBAAkB;YAWlB,UAAU;YADV,YAAY","sourcesContent":["import { Location } from '@angular/common';\nimport { Injectable } from '@angular/core';\nimport {\n ActivatedRoute,\n ActivatedRouteSnapshot,\n NavigationCancel,\n NavigationEnd,\n NavigationError,\n NavigationExtras,\n NavigationStart,\n Router,\n RouterStateSnapshot\n} from '@angular/router';\nimport {\n assert,\n Binding,\n DebugContext,\n DelegatingValueModel,\n Dsl,\n GarbageCollector,\n lang,\n ListModel,\n MapModelChain,\n MutableListModel,\n MutableValueModel,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport { InteractionServiceRoutingAdapter } from '../interaction/services/interaction-service-routing-adapter';\nimport { InteractionService } from '../interaction/services/interaction.service';\nimport { NavigatingDuringInteraction } from './navigation/session/interactions/navigating-during-interaction';\nimport { PopStateDuringInteractionNavigation } from './navigation/session/interactions/pop-state-during-interaction-navigation';\nimport { SynchroniseInteractionContextIdsWithRoute } from './navigation/session/interactions/synchronise-interaction-context-ids-with-route';\nimport { Navigating } from './navigation/session/navigating';\nimport { NavigationContext } from './navigation/session/navigation-context';\nimport { NavigationSession } from './navigation/session/navigation-session';\nimport { PopStateNavigation } from './navigation/session/pop-state-navigation';\nimport { PlaceAccessGuard } from './place-access-guard';\nimport { PlaceDefinition } from './place-definition';\nimport { PlaceHistory } from './place-history';\nimport { UrlService } from './url-service';\nimport { UrlSnapshot } from './url-snapshot';\nimport { Visit } from './visit';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class PlaceRouter extends GarbageCollector {\n\n readonly navigationSessionModel = new MutableValueModel<NavigationSession>();\n readonly navigationInProgress: ValueModelChain<boolean>;\n readonly navigationSessionName: ValueModelChain<string>; // used by tests\n\n private readonly navigationContext: NavigationContext.Impl;\n\n private readonly _activeVisits = new MutableListModel<Visit>();\n readonly activeVisitsByPlaceDefinition: MapModelChain<PlaceDefinition, Visit>;\n private routerInteractionAdapter: InteractionServiceRoutingAdapter;\n private sessionFinishedJobs: (() => void)[] = [];\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 private _accessGuard = new DelegatingValueModel<PlaceAccessGuard>().withDefault(new PlaceAccessGuard.NoAuth());\n private redirections: PlaceRouter.Redirections;\n\n constructor(private readonly angularRouter: Router,\n private readonly angularLocation: Location,\n private readonly interactionService: InteractionService,\n private readonly urlService: UrlService,\n private readonly placeHistory: PlaceHistory) {\n super();\n\n if (window['Cypress']) {\n window['aup.PlaceRouter'] = this;\n }\n\n this.routerInteractionAdapter = interactionService.registerPlaceRouter(this);\n\n // TODO: Make this an interface and use 'this' instead.\n this.navigationContext = new NavigationContext.Impl(\n this.urlService,\n this.routerInteractionAdapter,\n (urlSnapshot: UrlSnapshot, options: { replaceUrl: boolean }) => {\n return this.navigateByUrl(urlSnapshot, options);\n },\n state => {\n this.transitionTo(state);\n },\n visits => {\n this.routingSessionFinished(visits);\n });\n\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this.navigationInProgress = chain(this.navigationSessionModel).isNotNil();\n\n const idleStateName = chain(this.interactionService.active).map(active => active ? 'IdleDuringInteraction' : 'Idle');\n this.navigationSessionName = chain(this.navigationSessionModel)\n .pluck('name')\n .otherwise(idleStateName);\n\n DebugContext.tag(this._activeVisits, 'PlaceRouter.activeVisits');\n this.activeVisitsByPlaceDefinition = chain(this._activeVisits).indexBy('placeDefinition');\n\n // TODO: make setup the callbacks in during module initiation to make this testable.\n angularRouter.events.subscribe(event => {\n // Routing event sequence\n // ======================\n // NavigationStart -> .... -> NavigationCancel --> redirect, go around again in the same session\n // NavigationStart -> .... -> NavigationEnd --> navigation complete, end session.\n // NavigationStart -> .... -> NavigationError --> navigation aborted, end session.\n // =======================\n if (event instanceof NavigationStart) {\n // console.log(`---> NavigationStart[${event.id}]: ${event.url} (${event.navigationTrigger})`);\n if (event.navigationTrigger === 'popstate') {\n this.onPopState(event);\n } else {\n this.onRouterStarted(event);\n }\n // console.log(`<--- NavigationStart[${event.id}]: ${event.url} (${event.navigationTrigger})`);\n }\n if (event instanceof NavigationEnd) {\n // console.log(`---> NavigationEnd[${event.id}]: ${event.url}`);\n this.onRouterEnd(event);\n // console.log(`<--- NavigationEnd[${event.id}]: ${event.url}`);\n }\n if (event instanceof NavigationError) {\n // console.log(`---> NavigationError[${event.id}]: ${event.url}`);\n this.onRouterError(event);\n // console.log(`<--- NavigationError[${event.id}]: ${event.url}`);\n }\n if (event instanceof NavigationCancel) {\n // console.log(`---> NavigationCancel[${event.id}]: ${event.url}`);\n this.onRouterCancelled(event);\n // console.log(`<--- NavigationCancel[${event.id}]: ${event.url}`);\n }\n });\n\n // The router needs to know about url changes and in some cases they are the only way the router can know if\n // the back button was clicked.\n angularLocation.onUrlChange(url => this.onUrlChanged(url));\n\n }\n\n get accessGuard(): ValueModel<PlaceAccessGuard> {\n return this._accessGuard.readonly;\n }\n\n // @Trace()\n configureAuth(accessGrant: ValueModel<PlaceAccessGuard>, redirections: PlaceRouter.Redirections) {\n // We need a shitty mutable model until setDelegate is clever enough to work with readonly models.\n const hackyMutableModel = new MutableValueModel<PlaceAccessGuard>();\n const binding = new Binding(hackyMutableModel, accessGrant, {\n toRight(leftValue: PlaceAccessGuard) {\n return lang.illegalState('hackyMutableModel is read only');\n },\n toLeft: (rightValue: PlaceAccessGuard) => rightValue\n });\n binding.writeLeft();\n this._accessGuard.setDelegate(hackyMutableModel);\n this.redirections = redirections;\n }\n\n getAuthenticationFailureRedirect(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Visit {\n return this.redirections.onAuthenticationFailure(activatedRoute, state);\n }\n\n getAuthorisationFailureRedirect(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Visit {\n return this.redirections.onAuthorisationFailure(activatedRoute, state);\n }\n\n get navigationSession() {\n return this.navigationSessionModel.value;\n }\n\n get currentSession() {\n return this.navigationSessionModel.value;\n }\n\n isNavigating(): boolean {\n return this.navigationInProgress.value;\n }\n\n waitUntilIdle(): Promise<this> {\n const { when } = Dsl.disposeWith(this);\n return new Promise<this>(resolve => {\n when(this.navigationInProgress).becomesFalsey(() => resolve(this), {\n initialValue: 'evaluate',\n once: true\n })\n })\n }\n\n // @Trace()\n onPopState(event: NavigationStart) {\n assert.isTruthy(event.navigationTrigger === 'popstate');\n if (this.currentSession) {\n this.currentSession.onPopState(event);\n } else {\n const poppedHistoryUrl = event.url;\n const currentRouterUrl = this.urlService.getCurrentRouterUrl();\n const session = this.interactionService.isActive() ?\n new PopStateDuringInteractionNavigation(this.navigationContext, currentRouterUrl, poppedHistoryUrl) :\n new PopStateNavigation(this.navigationContext, currentRouterUrl, poppedHistoryUrl);\n this.transitionTo(session);\n }\n }\n\n // @Trace()\n onRouterStarted(event: NavigationStart) {\n assert.isFalsey(event.navigationTrigger === 'popstate');\n const inInteraction = this.interactionService.isActive();\n if (this.currentSession) {\n this.currentSession.onRouterStarted(event);\n } else {\n this.transitionTo(this.createNavigationSession(this.urlService.getCurrentRouterUrl()));\n }\n }\n\n // @Trace()\n onUrlChanged(newUrl: string) {\n // the back button can trigger a url change without a navigation session in progress so we\n // console.log(`---> Url Changed ${newUrl}`);\n if (this.currentSession) {\n this.currentSession.onUrlChange(newUrl);\n } else {\n console.log('FYI: url changed without a navigation session in progress');\n }\n // console.log(`<--- Url Changed`);\n }\n\n // @Trace()\n onRouterCancelled(event: NavigationCancel) {\n this.currentSession.onRouterCancelled(event);\n }\n\n // @Trace()\n onRouterError(event: NavigationError) {\n this.currentSession.onRouterError(event);\n }\n\n // @Trace()\n onRouterEnd(event: NavigationEnd) {\n this.currentSession.onRouterEnd(event);\n }\n\n navigate(visit: Visit, options?: { relativeTo: ActivatedRoute }) {\n return this.doNavigation(visit, async router => {\n const commands = [\n visit.placeDefinition.path,\n ...this.createRouteParameters(visit)\n ];\n await this.angularRouter.navigate(commands, {\n relativeTo: options ? options.relativeTo : null\n });\n });\n }\n\n // @Trace()\n async doNavigation(visit: Visit, runNavigationCommands: (router: Router) => any) {\n if (this.navigationInProgress.value) {\n lang.illegalState('Navigation already in progress');\n }\n const navigation = this.createNavigationSession(this.urlService.getCurrentRouterUrl());\n navigation.storeVisit(visit);\n this.transitionTo(navigation);\n try {\n await runNavigationCommands(this.angularRouter);\n } finally {\n // Check if the router has finished (in the case where no router change required) and we're still in a\n // transient state and finish of the transition.\n if (!this.angularRouter.getCurrentNavigation() && this.currentSession) {\n this.currentSession.onRouterEnd(new NavigationEnd(-1, '', ''));\n }\n }\n }\n\n navigateByUrl(urlSnapshot: UrlSnapshot, navigationExtras?: NavigationExtras) {\n // console.log(`### navigationByUrl -> ${urlSnapshot.urlTree.toString()}`);\n return this.angularRouter.navigateByUrl(urlSnapshot.urlTree, navigationExtras);\n }\n\n get activeVisits(): ListModel<Visit> {\n return this._activeVisits.readonly;\n }\n\n // @Trace()\n async pushVisitChangesToRoute(previous: Visit, next: Visit): Promise<void> {\n this.placeHistory.updateVisit(next);\n\n // FIXME: no route id -> route id duplicates route parameters\n if (next.hasRoutingChangedFrom(previous)) {\n return this.doNavigation(next, router => {\n const urlSnapshot = this.urlService.parseUrl(this.angularRouter.routerState.snapshot.url).updateVisitSegments(next);\n // console.log('### Push Changes to route Redirect', { commands: urlSnapshot.url });\n return this.navigateByUrl(urlSnapshot);\n });\n }\n }\n\n\n private createNavigationSession(currentRouterUrl: string): NavigationSession {\n const inInteraction = this.interactionService.isActive();\n return inInteraction ?\n new NavigatingDuringInteraction(this.navigationContext, currentRouterUrl) :\n new Navigating(this.navigationContext, currentRouterUrl);\n }\n\n // @Trace()\n protected transitionTo(next: NavigationSession) {\n const previous = this.navigationSessionModel.value;\n if (!previous) {\n this.placeHistory.notifyNavigationStarted();\n }\n assert.isTruthy(next !== previous);\n // Logger.get(this).info(`### Router State Transition: ${previous ? previous.toString() : 'null'} -> ${next.toString()}`);\n this.navigationSessionModel.value = next;\n if (!!previous) {\n previous.dispose();\n }\n next.notifyActive();\n }\n\n // @Trace()\n private routingSessionFinished(visits: Visit[]) {\n if (visits && visits.length > 0) {\n assert.isTruthy(this.navigationInProgress.value);\n this.placeHistory.notifyNavigationFinished(visits);\n // We update the active visits before we finish the session so the\n // place outlets can ignore the incoming changes until things are\n // settled. TODO: can we removed the event'ness here and just do a push?\n this._activeVisits.value = visits;\n }\n const session = this.currentSession;\n session.dispose();\n this.navigationSessionModel.value = null;\n // console.log(`### Router Session Finished (was ${session.toString()})`);\n this.sessionFinishedJobs.forEach(job => job());\n this.sessionFinishedJobs = [];\n }\n\n private runAfterRoutingSessionFinishes(func: () => void) {\n assert.isTruthy(this.navigationInProgress);\n this.sessionFinishedJobs.push(func);\n }\n\n\n /**\n * Sync's the current interaction state with the URL. We need to push something in the URL in order\n * to be able to capture the back button on the first page. If we don't then the back click will exit\n * the app directly and we don't get to ask.\n */\n // @Trace()\n syncInteractionContextIdsWithRouter(): Promise<unknown> {\n if (this.navigationSession) {\n // console.log(`Navigation active -> ${this.navigationSession.toString()}, sync delayed until finished.`);\n const session = this.navigationSession;\n return new Promise((resolve, reject) => {\n this.runAfterRoutingSessionFinishes(() => {\n this.runAfterRoutingSessionFinishes(resolve);\n const syncSession = new SynchroniseInteractionContextIdsWithRoute(this.navigationContext, this.urlService.getCurrentRouterUrl(), false);\n this.transitionTo(syncSession);\n });\n });\n } else {\n return new Promise<unknown>(((resolve, reject) => {\n // console.log(`No navigation in progress, starting synchronisation job`);\n this.runAfterRoutingSessionFinishes(resolve);\n const session = new SynchroniseInteractionContextIdsWithRoute(this.navigationContext, this.urlService.getCurrentRouterUrl(), false);\n this.transitionTo(session);\n }));\n\n }\n }\n\n\n private createRouteParameters(visit: Visit) {\n const def = visit.placeDefinition;\n return visit.hasRouteId() ?\n [def.getFormattedRouteId(visit), def.getFormattedRouteParameters(visit)] :\n [def.getFormattedRouteParameters(visit)];\n }\n\n}\n\nexport namespace PlaceRouter {\n\n export interface Redirections {\n onAuthenticationFailure(activatedRoute?: ActivatedRouteSnapshot, state?: RouterStateSnapshot): Visit;\n\n onAuthorisationFailure(activatedRoute?: ActivatedRouteSnapshot, state?: RouterStateSnapshot): Visit;\n }\n\n}\n"]}
1
+ {"version":3,"file":"place-router.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/place-router.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAGL,gBAAgB,EAChB,aAAa,EACb,eAAe,EAEf,eAAe,EACf,MAAM,EAEP,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,MAAM,EACN,OAAO,EACP,YAAY,EACZ,oBAAoB,EACpB,GAAG,EACH,gBAAgB,EAChB,IAAI,EAGJ,gBAAgB,EAChB,iBAAiB,EAGlB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,EAAE,2BAA2B,EAAE,MAAM,iEAAiE,CAAC;AAC9G,OAAO,EAAE,mCAAmC,EAAE,MAAM,2EAA2E,CAAC;AAChI,OAAO,EAAE,yCAAyC,EAAE,MAAM,kFAAkF,CAAC;AAC7I,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAE5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;;;;;;;AAO3C,MAAM,OAAO,WAAY,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jB,CAAA;AAEH,CAAC,EAnBgB,WAAW,KAAX,WAAW,QAmB3B","sourcesContent":["import { Location } from '@angular/common';\nimport { Injectable } from '@angular/core';\nimport {\n ActivatedRoute,\n ActivatedRouteSnapshot,\n NavigationCancel,\n NavigationEnd,\n NavigationError,\n NavigationExtras,\n NavigationStart,\n Router,\n RouterStateSnapshot\n} from '@angular/router';\nimport {\n assert,\n Binding,\n DebugContext,\n DelegatingValueModel,\n Dsl,\n GarbageCollector,\n lang,\n ListModel,\n MapModelChain,\n MutableListModel,\n MutableValueModel,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport { InteractionServiceRoutingAdapter } from '../interaction/services/interaction-service-routing-adapter';\nimport { InteractionService } from '../interaction/services/interaction.service';\nimport { NavigatingDuringInteraction } from './navigation/session/interactions/navigating-during-interaction';\nimport { PopStateDuringInteractionNavigation } from './navigation/session/interactions/pop-state-during-interaction-navigation';\nimport { SynchroniseInteractionContextIdsWithRoute } from './navigation/session/interactions/synchronise-interaction-context-ids-with-route';\nimport { Navigating } from './navigation/session/navigating';\nimport { NavigationContext } from './navigation/session/navigation-context';\nimport { NavigationSession } from './navigation/session/navigation-session';\nimport { PopStateNavigation } from './navigation/session/pop-state-navigation';\nimport { PlaceAccessGuard } from './place-access-guard';\nimport { PlaceDefinition } from './place-definition';\nimport { PlaceHistory } from './place-history';\nimport { UrlService } from './url-service';\nimport { UrlSnapshot } from './url-snapshot';\nimport { Visit } from './visit';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class PlaceRouter extends GarbageCollector {\n\n readonly navigationSessionModel = new MutableValueModel<NavigationSession>();\n readonly navigationInProgress: ValueModelChain<boolean>;\n readonly navigationSessionName: ValueModelChain<string>; // used by tests\n\n private readonly navigationContext: NavigationContext.Impl;\n\n private readonly _activeVisits = new MutableListModel<Visit>();\n private readonly routerInteractionAdapter: InteractionServiceRoutingAdapter;\n private sessionFinishedJobs: (() => void)[] = [];\n\n public readonly state: ValueModel<PlaceRouter.State>;\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 private readonly _accessGuard = new DelegatingValueModel<PlaceAccessGuard>().withDefault(new PlaceAccessGuard.NoAuth());\n private redirections: PlaceRouter.Redirections;\n\n constructor(private readonly angularRouter: Router,\n private readonly angularLocation: Location,\n private readonly interactionService: InteractionService,\n private readonly urlService: UrlService,\n private readonly placeHistory: PlaceHistory) {\n super();\n\n if (window['Cypress']) {\n window['aup.PlaceRouter'] = this;\n }\n\n this.routerInteractionAdapter = interactionService.registerPlaceRouter(this);\n\n // TODO: Make this an interface and use 'this' instead.\n this.navigationContext = new NavigationContext.Impl(\n this.urlService,\n this.routerInteractionAdapter,\n (urlSnapshot: UrlSnapshot, options: { replaceUrl: boolean }) => {\n return this.navigateByUrl(urlSnapshot, options);\n },\n state => {\n this.transitionTo(state);\n },\n visits => {\n this.routingSessionFinished(visits);\n });\n\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this.navigationInProgress = chain(this.navigationSessionModel).isNotNil();\n\n const idleStateName = chain(this.interactionService.active).map(active => active ? 'IdleDuringInteraction' : 'Idle');\n this.navigationSessionName = chain(this.navigationSessionModel)\n .pluck('name')\n .otherwise(idleStateName);\n\n DebugContext.tag(this._activeVisits, 'PlaceRouter.activeVisits');\n this.state = chain(this._activeVisits).reduce(visits => new PlaceRouter.State(visits));\n\n // TODO: make setup the callbacks in during module initiation to make this testable.\n angularRouter.events.subscribe(event => {\n // Routing event sequence\n // ======================\n // NavigationStart -> .... -> NavigationCancel --> redirect, go around again in the same session\n // NavigationStart -> .... -> NavigationEnd --> navigation complete, end session.\n // NavigationStart -> .... -> NavigationError --> navigation aborted, end session.\n // =======================\n if (event instanceof NavigationStart) {\n // console.log(`---> NavigationStart[${event.id}]: ${event.url} (${event.navigationTrigger})`);\n if (event.navigationTrigger === 'popstate') {\n this.onPopState(event);\n } else {\n this.onRouterStarted(event);\n }\n // console.log(`<--- NavigationStart[${event.id}]: ${event.url} (${event.navigationTrigger})`);\n }\n if (event instanceof NavigationEnd) {\n // console.log(`---> NavigationEnd[${event.id}]: ${event.url}`);\n this.onRouterEnd(event);\n // console.log(`<--- NavigationEnd[${event.id}]: ${event.url}`);\n }\n if (event instanceof NavigationError) {\n // console.log(`---> NavigationError[${event.id}]: ${event.url}`);\n this.onRouterError(event);\n // console.log(`<--- NavigationError[${event.id}]: ${event.url}`);\n }\n if (event instanceof NavigationCancel) {\n // console.log(`---> NavigationCancel[${event.id}]: ${event.url}`);\n this.onRouterCancelled(event);\n // console.log(`<--- NavigationCancel[${event.id}]: ${event.url}`);\n }\n });\n\n // The router needs to know about url changes and in some cases they are the only way the router can know if\n // the back button was clicked.\n angularLocation.onUrlChange(url => this.onUrlChanged(url));\n\n }\n\n get accessGuard(): ValueModel<PlaceAccessGuard> {\n return this._accessGuard.readonly;\n }\n\n // @Trace()\n configureAuth(accessGrant: ValueModel<PlaceAccessGuard>, redirections: PlaceRouter.Redirections) {\n // We need a shitty mutable model until setDelegate is clever enough to work with readonly models.\n const hackyMutableModel = new MutableValueModel<PlaceAccessGuard>();\n const binding = new Binding(hackyMutableModel, accessGrant, {\n toRight(leftValue: PlaceAccessGuard) {\n return lang.illegalState('hackyMutableModel is read only');\n },\n toLeft: (rightValue: PlaceAccessGuard) => rightValue\n });\n binding.writeLeft();\n this._accessGuard.setDelegate(hackyMutableModel);\n this.redirections = redirections;\n }\n\n getAuthenticationFailureRedirect(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Visit {\n return this.redirections.onAuthenticationFailure(activatedRoute, state);\n }\n\n get navigationSession() {\n return this.navigationSessionModel.value;\n }\n\n get currentSession() {\n return this.navigationSessionModel.value;\n }\n\n isNavigating(): boolean {\n return this.navigationInProgress.value;\n }\n\n waitUntilIdle(): Promise<this> {\n const { when } = Dsl.disposeWith(this);\n return new Promise<this>(resolve => {\n when(this.navigationInProgress).becomesFalsey(() => resolve(this), {\n initialValue: 'evaluate',\n once: true\n });\n });\n }\n\n // @Trace()\n onPopState(event: NavigationStart) {\n assert.isTruthy(event.navigationTrigger === 'popstate');\n if (this.currentSession) {\n this.currentSession.onPopState(event);\n } else {\n const poppedHistoryUrl = event.url;\n const currentRouterUrl = this.urlService.getCurrentRouterUrl();\n const session = this.interactionService.isActive() ?\n new PopStateDuringInteractionNavigation(this.navigationContext, currentRouterUrl, poppedHistoryUrl) :\n new PopStateNavigation(this.navigationContext, currentRouterUrl, poppedHistoryUrl);\n this.transitionTo(session);\n }\n }\n\n // @Trace()\n onRouterStarted(event: NavigationStart) {\n assert.isFalsey(event.navigationTrigger === 'popstate');\n const inInteraction = this.interactionService.isActive();\n if (this.currentSession) {\n this.currentSession.onRouterStarted(event);\n } else {\n this.transitionTo(this.createNavigationSession(this.urlService.getCurrentRouterUrl()));\n }\n }\n\n // @Trace()\n onUrlChanged(newUrl: string) {\n // the back button can trigger a url change without a navigation session in progress so we\n // console.log(`---> Url Changed ${newUrl}`);\n if (this.currentSession) {\n this.currentSession.onUrlChange(newUrl);\n } else {\n console.log('FYI: url changed without a navigation session in progress');\n }\n // console.log(`<--- Url Changed`);\n }\n\n // @Trace()\n onRouterCancelled(event: NavigationCancel) {\n this.currentSession.onRouterCancelled(event);\n }\n\n // @Trace()\n onRouterError(event: NavigationError) {\n this.currentSession.onRouterError(event);\n }\n\n // @Trace()\n onRouterEnd(event: NavigationEnd) {\n this.currentSession.onRouterEnd(event);\n }\n\n navigate(visit: Visit, options?: { relativeTo: ActivatedRoute }) {\n return this.doNavigation(visit, async router => {\n const commands = [\n visit.placeDefinition.path,\n ...this.createRouteParameters(visit)\n ];\n await this.angularRouter.navigate(commands, {\n relativeTo: options ? options.relativeTo : null\n });\n });\n }\n\n // @Trace()\n async doNavigation(visit: Visit, runNavigationCommands: (router: Router) => any) {\n if (this.navigationInProgress.value) {\n lang.illegalState('Navigation already in progress');\n }\n const navigation = this.createNavigationSession(this.urlService.getCurrentRouterUrl());\n navigation.storeVisit(visit);\n this.transitionTo(navigation);\n try {\n await runNavigationCommands(this.angularRouter);\n } finally {\n // Check if the router has finished (in the case where no router change required) and we're still in a\n // transient state and finish of the transition.\n if (!this.angularRouter.getCurrentNavigation() && this.currentSession) {\n this.currentSession.onRouterEnd(new NavigationEnd(-1, '', ''));\n }\n }\n }\n\n navigateByUrl(urlSnapshot: UrlSnapshot, navigationExtras?: NavigationExtras) {\n // console.log(`### navigationByUrl -> ${urlSnapshot.urlTree.toString()}`);\n return this.angularRouter.navigateByUrl(urlSnapshot.urlTree, navigationExtras);\n }\n\n get activeVisits(): ListModel<Visit> {\n return this._activeVisits.readonly;\n }\n\n // @Trace()\n async pushVisitChangesToRoute(previous: Visit, next: Visit): Promise<void> {\n this.placeHistory.updateVisit(next);\n\n // FIXME: no route id -> route id duplicates route parameters\n if (next.hasRoutingChangedFrom(previous)) {\n return this.doNavigation(next, router => {\n const urlSnapshot = this.urlService.parseUrl(this.angularRouter.routerState.snapshot.url).updateVisitSegments(next);\n // console.log('### Push Changes to route Redirect', { commands: urlSnapshot.url });\n return this.navigateByUrl(urlSnapshot);\n });\n }\n }\n\n\n private createNavigationSession(currentRouterUrl: string): NavigationSession {\n const inInteraction = this.interactionService.isActive();\n return inInteraction ?\n new NavigatingDuringInteraction(this.navigationContext, currentRouterUrl) :\n new Navigating(this.navigationContext, currentRouterUrl);\n }\n\n // @Trace()\n protected transitionTo(next: NavigationSession) {\n const previous = this.navigationSessionModel.value;\n if (!previous) {\n this.placeHistory.notifyNavigationStarted();\n }\n assert.isTruthy(next !== previous);\n // Logger.get(this).info(`### Router State Transition: ${previous ? previous.toString() : 'null'} -> ${next.toString()}`);\n this.navigationSessionModel.value = next;\n if (!!previous) {\n previous.dispose();\n }\n next.notifyActive();\n }\n\n // @Trace()\n private routingSessionFinished(visits: Visit[]) {\n if (visits && visits.length > 0) {\n assert.isTruthy(this.navigationInProgress.value);\n this.placeHistory.notifyNavigationFinished(visits);\n // We update the active visits before we finish the session so the\n // place outlets can ignore the incoming changes until things are\n // settled. TODO: can we removed the event'ness here and just do a push?\n this._activeVisits.value = visits;\n }\n const session = this.currentSession;\n session.dispose();\n this.navigationSessionModel.value = null;\n // console.log(`### Router Session Finished (was ${session.toString()})`);\n this.sessionFinishedJobs.forEach(job => job());\n this.sessionFinishedJobs = [];\n }\n\n private runAfterRoutingSessionFinishes(func: () => void) {\n assert.isTruthy(this.navigationInProgress);\n this.sessionFinishedJobs.push(func);\n }\n\n\n /**\n * Sync's the current interaction state with the URL. We need to push something in the URL in order\n * to be able to capture the back button on the first page. If we don't then the back click will exit\n * the app directly and we don't get to ask.\n */\n // @Trace()\n syncInteractionContextIdsWithRouter(): Promise<unknown> {\n if (this.navigationSession) {\n // console.log(`Navigation active -> ${this.navigationSession.toString()}, sync delayed until finished.`);\n const session = this.navigationSession;\n return new Promise((resolve, reject) => {\n this.runAfterRoutingSessionFinishes(() => {\n this.runAfterRoutingSessionFinishes(resolve);\n const syncSession = new SynchroniseInteractionContextIdsWithRoute(this.navigationContext, this.urlService.getCurrentRouterUrl(), false);\n this.transitionTo(syncSession);\n });\n });\n } else {\n return new Promise<unknown>(((resolve, reject) => {\n // console.log(`No navigation in progress, starting synchronisation job`);\n this.runAfterRoutingSessionFinishes(resolve);\n const session = new SynchroniseInteractionContextIdsWithRoute(this.navigationContext, this.urlService.getCurrentRouterUrl(), false);\n this.transitionTo(session);\n }));\n\n }\n }\n\n\n private createRouteParameters(visit: Visit) {\n const def = visit.placeDefinition;\n return visit.hasRouteId() ?\n [def.getFormattedRouteId(visit), def.getFormattedRouteParameters(visit)] :\n [def.getFormattedRouteParameters(visit)];\n }\n\n}\n\nexport namespace PlaceRouter {\n\n export interface Redirections {\n onAuthenticationFailure(activatedRoute?: ActivatedRouteSnapshot, state?: RouterStateSnapshot): Visit;\n }\n\n export class State {\n constructor(private readonly activeVisits: Visit[]) {\n }\n\n isPlaceActive(placeDefinition: PlaceDefinition): boolean {\n return !!this.getVisitFor(placeDefinition);\n }\n\n getVisitFor(placeDefinition: PlaceDefinition): Visit {\n return this.activeVisits.find(v => v.placeDefinition === placeDefinition);\n }\n }\n\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"PlaceRouter":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@coolon/pectin","name":"GarbageCollector","line":47,"character":33},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":44,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/router","name":"Router","line":67,"character":46},{"__symbolic":"reference","module":"@angular/common","name":"Location","line":68,"character":48},{"__symbolic":"reference","module":"../interaction/services/interaction.service","name":"InteractionService","line":69,"character":51},{"__symbolic":"reference","module":"./url-service","name":"UrlService","line":70,"character":43},{"__symbolic":"reference","module":"./place-history","name":"PlaceHistory","line":71,"character":45}]}],"configureAuth":[{"__symbolic":"method"}],"getAuthenticationFailureRedirect":[{"__symbolic":"method"}],"getAuthorisationFailureRedirect":[{"__symbolic":"method"}],"isNavigating":[{"__symbolic":"method"}],"waitUntilIdle":[{"__symbolic":"method"}],"onPopState":[{"__symbolic":"method"}],"onRouterStarted":[{"__symbolic":"method"}],"onUrlChanged":[{"__symbolic":"method"}],"onRouterCancelled":[{"__symbolic":"method"}],"onRouterError":[{"__symbolic":"method"}],"onRouterEnd":[{"__symbolic":"method"}],"navigate":[{"__symbolic":"method"}],"doNavigation":[{"__symbolic":"method"}],"navigateByUrl":[{"__symbolic":"method"}],"pushVisitChangesToRoute":[{"__symbolic":"method"}],"createNavigationSession":[{"__symbolic":"method"}],"transitionTo":[{"__symbolic":"method"}],"routingSessionFinished":[{"__symbolic":"method"}],"runAfterRoutingSessionFinishes":[{"__symbolic":"method"}],"syncInteractionContextIdsWithRouter":[{"__symbolic":"method"}],"createRouteParameters":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"PlaceRouter":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@coolon/pectin","name":"GarbageCollector","line":47,"character":33},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":44,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/router","name":"Router","line":68,"character":46},{"__symbolic":"reference","module":"@angular/common","name":"Location","line":69,"character":48},{"__symbolic":"reference","module":"../interaction/services/interaction.service","name":"InteractionService","line":70,"character":51},{"__symbolic":"reference","module":"./url-service","name":"UrlService","line":71,"character":43},{"__symbolic":"reference","module":"./place-history","name":"PlaceHistory","line":72,"character":45}]}],"configureAuth":[{"__symbolic":"method"}],"getAuthenticationFailureRedirect":[{"__symbolic":"method"}],"isNavigating":[{"__symbolic":"method"}],"waitUntilIdle":[{"__symbolic":"method"}],"onPopState":[{"__symbolic":"method"}],"onRouterStarted":[{"__symbolic":"method"}],"onUrlChanged":[{"__symbolic":"method"}],"onRouterCancelled":[{"__symbolic":"method"}],"onRouterError":[{"__symbolic":"method"}],"onRouterEnd":[{"__symbolic":"method"}],"navigate":[{"__symbolic":"method"}],"doNavigation":[{"__symbolic":"method"}],"navigateByUrl":[{"__symbolic":"method"}],"pushVisitChangesToRoute":[{"__symbolic":"method"}],"createNavigationSession":[{"__symbolic":"method"}],"transitionTo":[{"__symbolic":"method"}],"routingSessionFinished":[{"__symbolic":"method"}],"runAfterRoutingSessionFinishes":[{"__symbolic":"method"}],"syncInteractionContextIdsWithRouter":[{"__symbolic":"method"}],"createRouteParameters":[{"__symbolic":"method"}]},"statics":{"ɵprov":{}}}}}]
@@ -1,3 +1,4 @@
1
+ import { PortalModule } from '@angular/cdk/portal';
1
2
  import { CommonModule } from '@angular/common';
2
3
  import { NgModule } from '@angular/core';
3
4
  import { FlexModule } from '@angular/flex-layout';
@@ -12,6 +13,7 @@ import { ComponentsModule } from '../components/exports';
12
13
  import { DirectivesModule } from '../directives/directives.module';
13
14
  import { AbstractPlaceNavigationComponent } from './components/abstract-place-navigation.component';
14
15
  import { ListPlaceNavComponent } from './components/list-place-nav/list-place-nav.component';
16
+ import { NotAuthorisedNoticeComponent } from './components/not-authorised-notice/not-authorised-notice.component';
15
17
  import { PlaceOutletComponent } from './components/place-outlet/place-outlet.component';
16
18
  import { SidePlaceNavigationComponent } from './components/side-place-navigation/side-place-navigation.component';
17
19
  import { TabbedPlaceNavigationComponent } from './components/tabbed-place-navigation/tabbed-place-navigation.component';
@@ -30,14 +32,16 @@ PlaceModule.decorators = [
30
32
  MatIconModule,
31
33
  DirectivesModule,
32
34
  FlexModule,
33
- ComponentsModule
35
+ ComponentsModule,
36
+ PortalModule
34
37
  ],
35
38
  declarations: [
36
39
  PlaceOutletComponent,
37
40
  TabbedPlaceNavigationComponent,
38
41
  ListPlaceNavComponent,
39
42
  SidePlaceNavigationComponent,
40
- AbstractPlaceNavigationComponent
43
+ AbstractPlaceNavigationComponent,
44
+ NotAuthorisedNoticeComponent
41
45
  ],
42
46
  entryComponents: [],
43
47
  exports: [
@@ -1 +1 @@
1
- {"version":3,"file":"place.module.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/place.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,gCAAgC,EAAE,MAAM,kDAAkD,CAAC;AACpG,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,4BAA4B,EAAE,MAAM,oEAAoE,CAAC;AAClH,OAAO,EAAE,8BAA8B,EAAE,MAAM,wEAAwE,CAAC;AAmCxH,MAAM,OAAO,WAAW;;;YAjCvB,QAAQ,SAAC;gBACR,OAAO,EAAE;oBACP,YAAY;oBACZ,uBAAuB;oBACvB,wBAAwB;oBACxB,YAAY;oBACZ,aAAa;oBACb,aAAa;oBACb,gBAAgB;oBAChB,aAAa;oBACb,gBAAgB;oBAChB,UAAU;oBACV,gBAAgB;iBACjB;gBACD,YAAY,EAAE;oBACZ,oBAAoB;oBACpB,8BAA8B;oBAC9B,qBAAqB;oBACrB,4BAA4B;oBAC5B,gCAAgC;iBACjC;gBACD,eAAe,EAAE,EAAE;gBACnB,OAAO,EAAE;oBACP,oBAAoB;oBACpB,8BAA8B;oBAC9B,qBAAqB;oBACrB,4BAA4B;oBAC5B,gCAAgC;iBACjC;gBACD,SAAS,EAAE;gBACT,uEAAuE;iBACxE;aACF","sourcesContent":["import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FlexModule } from '@angular/flex-layout';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatListModule } from '@angular/material/list';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\nimport { RouterModule } from '@angular/router';\nimport { ComponentsModule } from '../components/exports';\nimport { DirectivesModule } from '../directives/directives.module';\nimport { AbstractPlaceNavigationComponent } from './components/abstract-place-navigation.component';\nimport { ListPlaceNavComponent } from './components/list-place-nav/list-place-nav.component';\nimport { PlaceOutletComponent } from './components/place-outlet/place-outlet.component';\nimport { SidePlaceNavigationComponent } from './components/side-place-navigation/side-place-navigation.component';\nimport { TabbedPlaceNavigationComponent } from './components/tabbed-place-navigation/tabbed-place-navigation.component';\n\n@NgModule({\n imports: [\n CommonModule,\n BrowserAnimationsModule,\n MatProgressSpinnerModule,\n RouterModule,\n MatTabsModule,\n MatListModule,\n MatTooltipModule,\n MatIconModule,\n DirectivesModule,\n FlexModule,\n ComponentsModule\n ],\n declarations: [\n PlaceOutletComponent,\n TabbedPlaceNavigationComponent,\n ListPlaceNavComponent,\n SidePlaceNavigationComponent,\n AbstractPlaceNavigationComponent\n ],\n entryComponents: [],\n exports: [\n PlaceOutletComponent,\n TabbedPlaceNavigationComponent,\n ListPlaceNavComponent,\n SidePlaceNavigationComponent,\n AbstractPlaceNavigationComponent\n ],\n providers: [\n // {provide: AUP_PLACE_CONFIG, useValue: {animationDuration: \"2000ms\"}}\n ]\n})\nexport class PlaceModule {\n\n}\n"]}
1
+ {"version":3,"file":"place.module.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/place.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAkB,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,wB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cdk/portal';\nimport { CommonModule } from '@angular/common';\nimport { InjectionToken, NgModule } from '@angular/core';\nimport { FlexModule } from '@angular/flex-layout';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatListModule } from '@angular/material/list';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatTabsModule } from '@angular/material/tabs';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { BrowserAnimationsModule } from '@angular/platform-browser/animations';\nimport { RouterModule } from '@angular/router';\nimport { Constructable } from '@coolon/pectin';\nimport { ComponentsModule } from '../components/exports';\nimport { DirectivesModule } from '../directives/directives.module';\nimport { AbstractPlaceNavigationComponent } from './components/abstract-place-navigation.component';\nimport { ListPlaceNavComponent } from './components/list-place-nav/list-place-nav.component';\nimport { NotAuthorisedNoticeComponent } from './components/not-authorised-notice/not-authorised-notice.component';\nimport { PlaceOutletComponent } from './components/place-outlet/place-outlet.component';\nimport { SidePlaceNavigationComponent } from './components/side-place-navigation/side-place-navigation.component';\nimport { TabbedPlaceNavigationComponent } from './components/tabbed-place-navigation/tabbed-place-navigation.component';\n\n\n@NgModule({\n imports: [\n CommonModule,\n BrowserAnimationsModule,\n MatProgressSpinnerModule,\n RouterModule,\n MatTabsModule,\n MatListModule,\n MatTooltipModule,\n MatIconModule,\n DirectivesModule,\n FlexModule,\n ComponentsModule,\n PortalModule\n ],\n declarations: [\n PlaceOutletComponent,\n TabbedPlaceNavigationComponent,\n ListPlaceNavComponent,\n SidePlaceNavigationComponent,\n AbstractPlaceNavigationComponent,\n NotAuthorisedNoticeComponent\n ],\n entryComponents: [],\n exports: [\n PlaceOutletComponent,\n TabbedPlaceNavigationComponent,\n ListPlaceNavComponent,\n SidePlaceNavigationComponent,\n AbstractPlaceNavigationComponent\n ],\n providers: [\n // {provide: AUP_PLACE_CONFIG, useValue: {animationDuration: \"2000ms\"}}\n ]\n})\nexport class PlaceModule {\n\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"PlaceModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":18,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":20,"character":4},{"__symbolic":"reference","module":"@angular/platform-browser/animations","name":"BrowserAnimationsModule","line":21,"character":4},{"__symbolic":"reference","module":"@angular/material/progress-spinner","name":"MatProgressSpinnerModule","line":22,"character":4},{"__symbolic":"reference","module":"@angular/router","name":"RouterModule","line":23,"character":4},{"__symbolic":"reference","module":"@angular/material/tabs","name":"MatTabsModule","line":24,"character":4},{"__symbolic":"reference","module":"@angular/material/list","name":"MatListModule","line":25,"character":4},{"__symbolic":"reference","module":"@angular/material/tooltip","name":"MatTooltipModule","line":26,"character":4},{"__symbolic":"reference","module":"@angular/material/icon","name":"MatIconModule","line":27,"character":4},{"__symbolic":"reference","module":"../directives/directives.module","name":"DirectivesModule","line":28,"character":4},{"__symbolic":"reference","module":"@angular/flex-layout","name":"FlexModule","line":29,"character":4},{"__symbolic":"reference","module":"../components/exports","name":"ComponentsModule","line":30,"character":4}],"declarations":[{"__symbolic":"reference","module":"./components/place-outlet/place-outlet.component","name":"PlaceOutletComponent","line":33,"character":4},{"__symbolic":"reference","module":"./components/tabbed-place-navigation/tabbed-place-navigation.component","name":"TabbedPlaceNavigationComponent","line":34,"character":4},{"__symbolic":"reference","module":"./components/list-place-nav/list-place-nav.component","name":"ListPlaceNavComponent","line":35,"character":4},{"__symbolic":"reference","module":"./components/side-place-navigation/side-place-navigation.component","name":"SidePlaceNavigationComponent","line":36,"character":4},{"__symbolic":"reference","module":"./components/abstract-place-navigation.component","name":"AbstractPlaceNavigationComponent","line":37,"character":4}],"entryComponents":[],"exports":[{"__symbolic":"reference","module":"./components/place-outlet/place-outlet.component","name":"PlaceOutletComponent","line":41,"character":4},{"__symbolic":"reference","module":"./components/tabbed-place-navigation/tabbed-place-navigation.component","name":"TabbedPlaceNavigationComponent","line":42,"character":4},{"__symbolic":"reference","module":"./components/list-place-nav/list-place-nav.component","name":"ListPlaceNavComponent","line":43,"character":4},{"__symbolic":"reference","module":"./components/side-place-navigation/side-place-navigation.component","name":"SidePlaceNavigationComponent","line":44,"character":4},{"__symbolic":"reference","module":"./components/abstract-place-navigation.component","name":"AbstractPlaceNavigationComponent","line":45,"character":4}],"providers":[]}]}]}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"PlaceModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":22,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":24,"character":4},{"__symbolic":"reference","module":"@angular/platform-browser/animations","name":"BrowserAnimationsModule","line":25,"character":4},{"__symbolic":"reference","module":"@angular/material/progress-spinner","name":"MatProgressSpinnerModule","line":26,"character":4},{"__symbolic":"reference","module":"@angular/router","name":"RouterModule","line":27,"character":4},{"__symbolic":"reference","module":"@angular/material/tabs","name":"MatTabsModule","line":28,"character":4},{"__symbolic":"reference","module":"@angular/material/list","name":"MatListModule","line":29,"character":4},{"__symbolic":"reference","module":"@angular/material/tooltip","name":"MatTooltipModule","line":30,"character":4},{"__symbolic":"reference","module":"@angular/material/icon","name":"MatIconModule","line":31,"character":4},{"__symbolic":"reference","module":"../directives/directives.module","name":"DirectivesModule","line":32,"character":4},{"__symbolic":"reference","module":"@angular/flex-layout","name":"FlexModule","line":33,"character":4},{"__symbolic":"reference","module":"../components/exports","name":"ComponentsModule","line":34,"character":4},{"__symbolic":"reference","module":"@angular/cdk/portal","name":"PortalModule","line":35,"character":4}],"declarations":[{"__symbolic":"reference","module":"./components/place-outlet/place-outlet.component","name":"PlaceOutletComponent","line":38,"character":4},{"__symbolic":"reference","module":"./components/tabbed-place-navigation/tabbed-place-navigation.component","name":"TabbedPlaceNavigationComponent","line":39,"character":4},{"__symbolic":"reference","module":"./components/list-place-nav/list-place-nav.component","name":"ListPlaceNavComponent","line":40,"character":4},{"__symbolic":"reference","module":"./components/side-place-navigation/side-place-navigation.component","name":"SidePlaceNavigationComponent","line":41,"character":4},{"__symbolic":"reference","module":"./components/abstract-place-navigation.component","name":"AbstractPlaceNavigationComponent","line":42,"character":4},{"__symbolic":"reference","module":"./components/not-authorised-notice/not-authorised-notice.component","name":"NotAuthorisedNoticeComponent","line":43,"character":4}],"entryComponents":[],"exports":[{"__symbolic":"reference","module":"./components/place-outlet/place-outlet.component","name":"PlaceOutletComponent","line":47,"character":4},{"__symbolic":"reference","module":"./components/tabbed-place-navigation/tabbed-place-navigation.component","name":"TabbedPlaceNavigationComponent","line":48,"character":4},{"__symbolic":"reference","module":"./components/list-place-nav/list-place-nav.component","name":"ListPlaceNavComponent","line":49,"character":4},{"__symbolic":"reference","module":"./components/side-place-navigation/side-place-navigation.component","name":"SidePlaceNavigationComponent","line":50,"character":4},{"__symbolic":"reference","module":"./components/abstract-place-navigation.component","name":"AbstractPlaceNavigationComponent","line":51,"character":4}],"providers":[]}]}]}}}]
@@ -1 +1 @@
1
- {"version":3,"file":"place.module.ngfactory.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/place.module.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\nimport * as i1 from './place.module';\nimport * as i2 from '@angular/common';\nimport * as i3 from '@angular/cdk/bidi';\nimport * as i4 from '@angular/material/progress-spinner';\nimport * as i5 from '@angular/router';\nimport * as i6 from '@angular/material/tabs';\nimport * as i7 from '@angular/material/core';\nimport * as i8 from '@angular/material/divider';\nimport * as i9 from '@angular/material/list';\nimport * as i10 from '@angular/cdk/scrolling';\nimport * as i11 from '@angular/material/tooltip';\nimport * as i12 from '@angular/material/icon';\nimport * as i13 from '../directives/command.directive';\nimport * as i14 from '../directives/focus-binding.directive';\nimport * as i15 from '@angular/flex-layout/flex';\nimport * as i16 from '../components/forms/number-input/number-input.component';\nimport * as i17 from '../components/forms/string-input/string-input.component';\nimport * as i18 from '../components/forms/text-input/text-input.component';\nimport * as i19 from '../components/forms/password-input/password-input.component';\nimport * as i20 from '../components/forms/checkbox-input/checkbox-input.component';\nimport * as i21 from '../components/forms/select-input/select-input.component';\nimport * as i22 from '../components/forms/multiple-select-input/multiple-select-input.component';\nimport * as i23 from '../components/forms/autocomplete-input/autocomplete-input.component';\nimport * as i24 from '../components/scroll-container/scroll-container.component';\nimport * as i25 from '../components/noop/noop.component';\nimport * as i26 from '../components/switch-case/switch-case.component';\nimport * as i27 from '../components/focus-container/focus-container.component';\nimport * as i28 from '../components/vertical-focus-container/vertical-focus-container.component';\nimport * as i29 from '../components/focusable.component';\nimport * as i30 from '../components/card-container/card-container.component';\nimport * as i31 from '../components/table/table.component';\nimport * as i32 from '../components/table/edit-row-controls/edit-row-controls.component';\nimport * as i33 from '../components/table/column-template/column-template.directive';\nimport * as i34 from '../components/icon/icon.component';\nimport * as i35 from '../components/section-header/section-header.component';\nimport * as i36 from '../components/table/table-row-menu/table-row-menu.component';\nimport * as i37 from '../components/commands/group/tool-bar/tool-bar.component';\nimport * as i38 from '../components/commands/command/command.component';\nimport * as i39 from '../components/commands/group/popup-menu/popup-menu.component';\nimport * as i40 from '../components/commands/command-face/command-face.component';\nimport * as i41 from '../components/commands/group/popup-menu/more-menu.component';\nimport * as i42 from '../components/commands/separator.component';\nimport * as i43 from '../components/commands/flex.component';\nimport * as i44 from '../components/tree-table/tree-table-component';\nimport * as i45 from '../components/busy-overlay/busy-overlay.component';\nimport * as i46 from '../components/empty-state/empty-state.component';\nimport * as i47 from '../components/table/paginator/paginator.component';\nimport * as i48 from './components/place-outlet/place-outlet.component';\nimport * as i49 from './components/tabbed-place-navigation/tabbed-place-navigation.component';\nimport * as i50 from './components/list-place-nav/list-place-nav.component';\nimport * as i51 from './components/side-place-navigation/side-place-navigation.component';\nimport * as i52 from './components/abstract-place-navigation.component';\nimport * as i53 from '@angular/platform-browser/animations';\nimport * as i54 from '../directives/directives.module';\nimport * as i55 from '../components/components.module';\nexport const PlaceModuleNgFactory:i0.NgModuleFactory<i1.PlaceModule> = (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.MatProgressSpinner = (<any>(null as any));\nvar _decl0_13:i4.MatSpinner = (<any>(null as any));\nvar _decl0_14:i5.RouterOutlet = (<any>(null as any));\nvar _decl0_15:i5.RouterLink = (<any>(null as any));\nvar _decl0_16:i5.RouterLinkWithHref = (<any>(null as any));\nvar _decl0_17:i5.RouterLinkActive = (<any>(null as any));\nvar _decl0_18:i5.ɵangular_packages_router_router_l = (<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.MatLine = (<any>(null as any));\nvar _decl0_26:i7.MatPseudoCheckbox = (<any>(null as any));\nvar _decl0_27:i8.MatDivider = (<any>(null as any));\nvar _decl0_28:i9.MatList = (<any>(null as any));\nvar _decl0_29:i9.MatNavList = (<any>(null as any));\nvar _decl0_30:i9.MatListItem = (<any>(null as any));\nvar _decl0_31:i9.MatListAvatarCssMatStyler = (<any>(null as any));\nvar _decl0_32:i9.MatListIconCssMatStyler = (<any>(null as any));\nvar _decl0_33:i9.MatListSubheaderCssMatStyler = (<any>(null as any));\nvar _decl0_34:i9.MatSelectionList = (<any>(null as any));\nvar _decl0_35:i9.MatListOption = (<any>(null as any));\nvar _decl0_36:i10.CdkScrollable = (<any>(null as any));\nvar _decl0_37:i11.MatTooltip = (<any>(null as any));\nvar _decl0_38:i11.TooltipComponent = (<any>(null as any));\nvar _decl0_39:i12.MatIcon = (<any>(null as any));\nvar _decl0_40:i13.CommandDirective<any> = (<any>(null as any));\nvar _decl0_41:i14.FocusBindingDirective = (<any>(null as any));\nvar _decl0_42:i15.DefaultLayoutDirective = (<any>(null as any));\nvar _decl0_43:i15.DefaultLayoutGapDirective = (<any>(null as any));\nvar _decl0_44:i15.DefaultLayoutAlignDirective = (<any>(null as any));\nvar _decl0_45:i15.DefaultFlexOrderDirective = (<any>(null as any));\nvar _decl0_46:i15.DefaultFlexOffsetDirective = (<any>(null as any));\nvar _decl0_47:i15.FlexFillDirective = (<any>(null as any));\nvar _decl0_48:i15.DefaultFlexAlignDirective = (<any>(null as any));\nvar _decl0_49:i15.DefaultFlexDirective = (<any>(null as any));\nvar _decl0_50:i16.NumberInputComponent = (<any>(null as any));\nvar _decl0_51:i17.StringInputComponent = (<any>(null as any));\nvar _decl0_52:i18.TextInputComponent = (<any>(null as any));\nvar _decl0_53:i19.PasswordInputComponent = (<any>(null as any));\nvar _decl0_54:i20.CheckboxInputComponent = (<any>(null as any));\nvar _decl0_55:i21.SelectInputComponent<any> = (<any>(null as any));\nvar _decl0_56:i22.MultipleSelectInputComponent<any> = (<any>(null as any));\nvar _decl0_57:i23.AutocompleteInputComponent<any> = (<any>(null as any));\nvar _decl0_58:i24.ScrollContainerComponent = (<any>(null as any));\nvar _decl0_59:i25.NoopComponent = (<any>(null as any));\nvar _decl0_60:i26.SwitchCaseComponent<any> = (<any>(null as any));\nvar _decl0_61:i26.SwitchCaseWhenDirective<any> = (<any>(null as any));\nvar _decl0_62:i26.SwitchCaseDefaultDirective<any> = (<any>(null as any));\nvar _decl0_63:i27.FocusContainerComponent = (<any>(null as any));\nvar _decl0_64:i28.VerticalFocusContainerComponent = (<any>(null as any));\nvar _decl0_65:i29.FocusableComponent = (<any>(null as any));\nvar _decl0_66:i30.CardContainerComponent = (<any>(null as any));\nvar _decl0_67:i31.TableComponent<any> = (<any>(null as any));\nvar _decl0_68:i32.EditRowControls<any> = (<any>(null as any));\nvar _decl0_69:i33.ColumnTemplateDirective = (<any>(null as any));\nvar _decl0_70:i34.IconComponent = (<any>(null as any));\nvar _decl0_71:i35.SectionHeaderComponent = (<any>(null as any));\nvar _decl0_72:i36.TableRowMenuComponent<any> = (<any>(null as any));\nvar _decl0_73:i37.ToolBarComponent = (<any>(null as any));\nvar _decl0_74:i38.CommandComponent = (<any>(null as any));\nvar _decl0_75:i39.PopupMenuComponent = (<any>(null as any));\nvar _decl0_76:i40.CommandFaceComponent<any> = (<any>(null as any));\nvar _decl0_77:i41.MoreMenuComponent = (<any>(null as any));\nvar _decl0_78:i42.SeparatorComponent = (<any>(null as any));\nvar _decl0_79:i43.FlexComponent = (<any>(null as any));\nvar _decl0_80:i44.TreeTableComponent<any> = (<any>(null as any));\nvar _decl0_81:i45.BusyOverlayComponent = (<any>(null as any));\nvar _decl0_82:i46.EmptyStateComponent = (<any>(null as any));\nvar _decl0_83:i47.PaginatorComponent = (<any>(null as any));\nvar _decl0_84:i48.PlaceOutletComponent = (<any>(null as any));\nvar _decl0_85:i49.TabbedPlaceNavigationComponent = (<any>(null as any));\nvar _decl0_86:i50.ListPlaceNavComponent = (<any>(null as any));\nvar _decl0_87:i51.SidePlaceNavigationComponent = (<any>(null as any));\nvar _decl0_88:i52.AbstractPlaceNavigationComponent = (<any>(null as any));\nvar _decl0_89:i2.AsyncPipe = (<any>(null as any));\nvar _decl0_90:i2.UpperCasePipe = (<any>(null as any));\nvar _decl0_91:i2.LowerCasePipe = (<any>(null as any));\nvar _decl0_92:i2.JsonPipe = (<any>(null as any));\nvar _decl0_93:i2.SlicePipe = (<any>(null as any));\nvar _decl0_94:i2.DecimalPipe = (<any>(null as any));\nvar _decl0_95:i2.PercentPipe = (<any>(null as any));\nvar _decl0_96:i2.TitleCasePipe = (<any>(null as any));\nvar _decl0_97:i2.CurrencyPipe = (<any>(null as any));\nvar _decl0_98:i2.DatePipe = (<any>(null as any));\nvar _decl0_99:i2.I18nPluralPipe = (<any>(null as any));\nvar _decl0_100:i2.I18nSelectPipe = (<any>(null as any));\nvar _decl0_101:i2.KeyValuePipe = (<any>(null as any));\nvar _decl0_102:i2.CommonModule = (<any>(null as any));\nvar _decl0_103:i53.BrowserAnimationsModule = (<any>(null as any));\nvar _decl0_104:i4.MatProgressSpinnerModule = (<any>(null as any));\nvar _decl0_105:i5.RouterModule = (<any>(null as any));\nvar _decl0_106:i6.MatTabsModule = (<any>(null as any));\nvar _decl0_107:i9.MatListModule = (<any>(null as any));\nvar _decl0_108:i11.MatTooltipModule = (<any>(null as any));\nvar _decl0_109:i12.MatIconModule = (<any>(null as any));\nvar _decl0_110:i54.DirectivesModule = (<any>(null as any));\nvar _decl0_111:i15.FlexModule = (<any>(null as any));\nvar _decl0_112:i55.ComponentsModule = (<any>(null as any));\nvar _decl0_113:i0.TemplateRef<any> = (<any>(null as any));\nvar _decl0_114:i0.ElementRef<any> = (<any>(null as any));\nfunction _View_PlaceOutletComponent_Host_1_0():void {\n var _any:any = (null as any);\n}\nfunction _View_PlaceOutletComponent_1_1():void {\n if (_decl0_84.animationEnabled.value) {\n var _any:any = (null as any);\n const currVal_0:any = {value:_decl0_84.getAnimationOrder(),params:{duration:_decl0_84.animationDuration}};\n currVal_0;\n const pd_1:any = ((<any>_decl0_84.animationStarted()) !== false);\n const pd_2:any = ((<any>_decl0_84.animationDone()) !== false);\n const pd_3:any = ((<any>_decl0_84.onOutletActivated(_decl0_14,_any)) !== false);\n const pd_4:any = ((<any>_decl0_84.onOutletDeactivated()) !== false);\n }\n}\nfunction _View_PlaceOutletComponent_1_2():void {\n if (!_decl0_84.animationEnabled.value) {\n var _any:any = (null as any);\n const pd_0:any = ((<any>_decl0_84.onOutletActivated(_decl0_14,_any)) !== false);\n const pd_1:any = ((<any>_decl0_84.onOutletDeactivated()) !== false);\n }\n}\nfunction _View_PlaceOutletComponent_1_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_84.animationEnabled.value;\n currVal_0;\n const currVal_1:any = !_decl0_84.animationEnabled.value;\n currVal_1;\n}\nfunction _View_TabbedPlaceNavigationComponent_Host_2_0():void {\n var _any:any = (null as any);\n}\nfunction _View_TabbedPlaceNavigationComponent_2_1():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_85.isActive(_any);\n currVal_0;\n const currVal_1:any = (_decl0_23.active? 'page': null);\n currVal_1;\n const currVal_2:any = _decl0_23.disabled;\n currVal_2;\n const currVal_3:any = _decl0_23.tabIndex;\n currVal_3;\n const currVal_4:any = _decl0_23.disabled;\n currVal_4;\n const currVal_5:any = _decl0_23.active;\n currVal_5;\n const currVal_6:any = _decl0_85.getNavigationFace(_any).tooltip();\n currVal_6;\n const currVal_7:any = _decl0_85.commandFactory.create(_any);\n currVal_7;\n const currVal_8:any = [_decl0_85.getNavigationFace(_any)];\n currVal_8;\n const currVal_9:any = _decl0_76.requiresMissingIconInLayout;\n currVal_9;\n const currVal_10:any = _decl0_76.color;\n currVal_10;\n const pd_11:any = ((<any>_decl0_40.notifyClick(_any)) !== false);\n}\nfunction _View_TabbedPlaceNavigationComponent_2_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_22._showPaginationControls;\n currVal_0;\n const currVal_1:any = (_decl0_22._getLayoutDirection() == 'rtl');\n currVal_1;\n const currVal_2:any = ((_decl0_22.color !== 'warn') && (_decl0_22.color !== 'accent'));\n currVal_2;\n const currVal_3:any = (_decl0_22.color === 'accent');\n currVal_3;\n const currVal_4:any = (_decl0_22.color === 'warn');\n currVal_4;\n const currVal_5:any = _decl0_85.placeDefinitions.value;\n currVal_5;\n}\nfunction _View_ListPlaceNavComponent_Host_3_0():void {\n var _any:any = (null as any);\n}\nfunction _View_ListPlaceNavComponent_3_1():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_30.disabled;\n currVal_0;\n const currVal_1:any = (_decl0_30._avatar || _decl0_30._icon);\n currVal_1;\n const currVal_2:any = (_decl0_30._avatar || _decl0_30._icon);\n currVal_2;\n const currVal_3:any = _decl0_86.getNavigationFace(_any).tooltip();\n currVal_3;\n const currVal_4:any = _decl0_86.commandFactory.create(_any);\n currVal_4;\n const currVal_5:any = _decl0_86.isActive(_any);\n currVal_5;\n const currVal_6:any = [_decl0_86.getNavigationFace(_any)];\n currVal_6;\n const currVal_7:any = _decl0_76.requiresMissingIconInLayout;\n currVal_7;\n const currVal_8:any = _decl0_76.color;\n currVal_8;\n const pd_9:any = ((<any>_decl0_40.notifyClick(_any)) !== false);\n}\nfunction _View_ListPlaceNavComponent_3_0():void {\n var _any:any = (null as any);\n const currVal_0:any = '';\n currVal_0;\n const currVal_1:any = _decl0_86.placeDefinitions.value;\n currVal_1;\n}\nfunction _View_SidePlaceNavigationComponent_Host_4_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_87.expanded;\n currVal_0;\n}\nfunction _View_SidePlaceNavigationComponent_4_2():void {\n if (_decl0_87.getNavigationFace(_any).icon()) {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_87.getNavigationFace(_any).icon();\n currVal_0;\n }\n}\nfunction _View_SidePlaceNavigationComponent_4_1():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_30.disabled;\n currVal_0;\n const currVal_1:any = (_decl0_30._avatar || _decl0_30._icon);\n currVal_1;\n const currVal_2:any = (_decl0_30._avatar || _decl0_30._icon);\n currVal_2;\n const currVal_3:any = _decl0_87.getNavigationFace(_any).tooltip();\n currVal_3;\n const currVal_4:any = _decl0_87.commandFactory.create(_any);\n currVal_4;\n const currVal_5:any = _decl0_87.isActive(_any);\n currVal_5;\n const currVal_6:any = _decl0_87.getNavigationFace(_any).icon();\n currVal_6;\n const currVal_7:any = _decl0_87.getNavigationFace(_any).text();\n currVal_7;\n const pd_8:any = ((<any>_decl0_40.notifyClick(_any)) !== false);\n}\nfunction _View_SidePlaceNavigationComponent_4_3():void {\n if (_decl0_87.navEndTemplate) {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_87.navEndTemplate;\n currVal_0;\n }\n}\nfunction _View_SidePlaceNavigationComponent_4_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_30.disabled;\n currVal_0;\n const currVal_1:any = (_decl0_30._avatar || _decl0_30._icon);\n currVal_1;\n const currVal_2:any = (_decl0_30._avatar || _decl0_30._icon);\n currVal_2;\n const currVal_3:any = 'mat:menu';\n currVal_3;\n const currVal_4:any = 'mat:arrow_back';\n currVal_4;\n const currVal_5:any = _decl0_87.placeDefinitions.value;\n currVal_5;\n const currVal_6:any = 1;\n currVal_6;\n const currVal_7:any = _decl0_87.navEndTemplate;\n currVal_7;\n const pd_8:any = ((<any>_decl0_87.toggleMenu()) !== false);\n}\nfunction _View_AbstractPlaceNavigationComponent_Host_5_0():void {\n var _any:any = (null as any);\n}\nfunction _View_AbstractPlaceNavigationComponent_5_0():void {\n var _any:any = (null as any);\n}\n"]}
1
+ {"version":3,"file":"place.module.ngfactory.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/place.module.ngfactory.ts"],"names":[],"mappings":"","sourcesContent":["import * as i0 from '@angular/core';\nimport * as i1 from './place.module';\nimport * as i2 from '@angular/common';\nimport * as i3 from '@angular/cdk/bidi';\nimport * as i4 from '@angular/material/progress-spinner';\nimport * as i5 from '@angular/router';\nimport * as i6 from '@angular/material/tabs';\nimport * as i7 from '@angular/material/core';\nimport * as i8 from '@angular/material/divider';\nimport * as i9 from '@angular/material/list';\nimport * as i10 from '@angular/cdk/scrolling';\nimport * as i11 from '@angular/material/tooltip';\nimport * as i12 from '@angular/material/icon';\nimport * as i13 from '../directives/command.directive';\nimport * as i14 from '../directives/focus-binding.directive';\nimport * as i15 from '@angular/flex-layout/flex';\nimport * as i16 from '../components/forms/number-input/number-input.component';\nimport * as i17 from '../components/forms/string-input/string-input.component';\nimport * as i18 from '../components/forms/text-input/text-input.component';\nimport * as i19 from '../components/forms/password-input/password-input.component';\nimport * as i20 from '../components/forms/checkbox-input/checkbox-input.component';\nimport * as i21 from '../components/forms/select-input/select-input.component';\nimport * as i22 from '../components/forms/multiple-select-input/multiple-select-input.component';\nimport * as i23 from '../components/forms/autocomplete-input/autocomplete-input.component';\nimport * as i24 from '../components/scroll-container/scroll-container.component';\nimport * as i25 from '../components/noop/noop.component';\nimport * as i26 from '../components/switch-case/switch-case.component';\nimport * as i27 from '../components/focus-container/focus-container.component';\nimport * as i28 from '../components/vertical-focus-container/vertical-focus-container.component';\nimport * as i29 from '../components/focusable.component';\nimport * as i30 from '../components/card-container/card-container.component';\nimport * as i31 from '../components/table/table.component';\nimport * as i32 from '../components/table/edit-row-controls/edit-row-controls.component';\nimport * as i33 from '../components/table/column-template/column-template.directive';\nimport * as i34 from '../components/icon/icon.component';\nimport * as i35 from '../components/section-header/section-header.component';\nimport * as i36 from '../components/table/table-row-menu/table-row-menu.component';\nimport * as i37 from '../components/commands/group/tool-bar/tool-bar.component';\nimport * as i38 from '../components/commands/command/command.component';\nimport * as i39 from '../components/commands/group/popup-menu/popup-menu.component';\nimport * as i40 from '../components/commands/command-face/command-face.component';\nimport * as i41 from '../components/commands/group/popup-menu/more-menu.component';\nimport * as i42 from '../components/commands/separator.component';\nimport * as i43 from '../components/commands/flex.component';\nimport * as i44 from '../components/tree-table/tree-table-component';\nimport * as i45 from '../components/busy-overlay/busy-overlay.component';\nimport * as i46 from '../components/empty-state/empty-state.component';\nimport * as i47 from '../components/table/paginator/paginator.component';\nimport * as i48 from '@angular/cdk/portal';\nimport * as i49 from './components/place-outlet/place-outlet.component';\nimport * as i50 from './components/tabbed-place-navigation/tabbed-place-navigation.component';\nimport * as i51 from './components/list-place-nav/list-place-nav.component';\nimport * as i52 from './components/side-place-navigation/side-place-navigation.component';\nimport * as i53 from './components/abstract-place-navigation.component';\nimport * as i54 from './components/not-authorised-notice/not-authorised-notice.component';\nimport * as i55 from '@angular/platform-browser/animations';\nimport * as i56 from '../directives/directives.module';\nimport * as i57 from '../components/components.module';\nexport const PlaceModuleNgFactory:i0.NgModuleFactory<i1.PlaceModule> = (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.MatProgressSpinner = (<any>(null as any));\nvar _decl0_13:i4.MatSpinner = (<any>(null as any));\nvar _decl0_14:i5.RouterOutlet = (<any>(null as any));\nvar _decl0_15:i5.RouterLink = (<any>(null as any));\nvar _decl0_16:i5.RouterLinkWithHref = (<any>(null as any));\nvar _decl0_17:i5.RouterLinkActive = (<any>(null as any));\nvar _decl0_18:i5.ɵangular_packages_router_router_l = (<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.MatLine = (<any>(null as any));\nvar _decl0_26:i7.MatPseudoCheckbox = (<any>(null as any));\nvar _decl0_27:i8.MatDivider = (<any>(null as any));\nvar _decl0_28:i9.MatList = (<any>(null as any));\nvar _decl0_29:i9.MatNavList = (<any>(null as any));\nvar _decl0_30:i9.MatListItem = (<any>(null as any));\nvar _decl0_31:i9.MatListAvatarCssMatStyler = (<any>(null as any));\nvar _decl0_32:i9.MatListIconCssMatStyler = (<any>(null as any));\nvar _decl0_33:i9.MatListSubheaderCssMatStyler = (<any>(null as any));\nvar _decl0_34:i9.MatSelectionList = (<any>(null as any));\nvar _decl0_35:i9.MatListOption = (<any>(null as any));\nvar _decl0_36:i10.CdkScrollable = (<any>(null as any));\nvar _decl0_37:i11.MatTooltip = (<any>(null as any));\nvar _decl0_38:i11.TooltipComponent = (<any>(null as any));\nvar _decl0_39:i12.MatIcon = (<any>(null as any));\nvar _decl0_40:i13.CommandDirective<any> = (<any>(null as any));\nvar _decl0_41:i14.FocusBindingDirective = (<any>(null as any));\nvar _decl0_42:i15.DefaultLayoutDirective = (<any>(null as any));\nvar _decl0_43:i15.DefaultLayoutGapDirective = (<any>(null as any));\nvar _decl0_44:i15.DefaultLayoutAlignDirective = (<any>(null as any));\nvar _decl0_45:i15.DefaultFlexOrderDirective = (<any>(null as any));\nvar _decl0_46:i15.DefaultFlexOffsetDirective = (<any>(null as any));\nvar _decl0_47:i15.FlexFillDirective = (<any>(null as any));\nvar _decl0_48:i15.DefaultFlexAlignDirective = (<any>(null as any));\nvar _decl0_49:i15.DefaultFlexDirective = (<any>(null as any));\nvar _decl0_50:i16.NumberInputComponent = (<any>(null as any));\nvar _decl0_51:i17.StringInputComponent = (<any>(null as any));\nvar _decl0_52:i18.TextInputComponent = (<any>(null as any));\nvar _decl0_53:i19.PasswordInputComponent = (<any>(null as any));\nvar _decl0_54:i20.CheckboxInputComponent = (<any>(null as any));\nvar _decl0_55:i21.SelectInputComponent<any> = (<any>(null as any));\nvar _decl0_56:i22.MultipleSelectInputComponent<any> = (<any>(null as any));\nvar _decl0_57:i23.AutocompleteInputComponent<any> = (<any>(null as any));\nvar _decl0_58:i24.ScrollContainerComponent = (<any>(null as any));\nvar _decl0_59:i25.NoopComponent = (<any>(null as any));\nvar _decl0_60:i26.SwitchCaseComponent<any> = (<any>(null as any));\nvar _decl0_61:i26.SwitchCaseWhenDirective<any> = (<any>(null as any));\nvar _decl0_62:i26.SwitchCaseDefaultDirective<any> = (<any>(null as any));\nvar _decl0_63:i27.FocusContainerComponent = (<any>(null as any));\nvar _decl0_64:i28.VerticalFocusContainerComponent = (<any>(null as any));\nvar _decl0_65:i29.FocusableComponent = (<any>(null as any));\nvar _decl0_66:i30.CardContainerComponent = (<any>(null as any));\nvar _decl0_67:i31.TableComponent<any> = (<any>(null as any));\nvar _decl0_68:i32.EditRowControls<any> = (<any>(null as any));\nvar _decl0_69:i33.ColumnTemplateDirective = (<any>(null as any));\nvar _decl0_70:i34.IconComponent = (<any>(null as any));\nvar _decl0_71:i35.SectionHeaderComponent = (<any>(null as any));\nvar _decl0_72:i36.TableRowMenuComponent<any> = (<any>(null as any));\nvar _decl0_73:i37.ToolBarComponent = (<any>(null as any));\nvar _decl0_74:i38.CommandComponent = (<any>(null as any));\nvar _decl0_75:i39.PopupMenuComponent = (<any>(null as any));\nvar _decl0_76:i40.CommandFaceComponent<any> = (<any>(null as any));\nvar _decl0_77:i41.MoreMenuComponent = (<any>(null as any));\nvar _decl0_78:i42.SeparatorComponent = (<any>(null as any));\nvar _decl0_79:i43.FlexComponent = (<any>(null as any));\nvar _decl0_80:i44.TreeTableComponent<any> = (<any>(null as any));\nvar _decl0_81:i45.BusyOverlayComponent = (<any>(null as any));\nvar _decl0_82:i46.EmptyStateComponent = (<any>(null as any));\nvar _decl0_83:i47.PaginatorComponent = (<any>(null as any));\nvar _decl0_84:i48.CdkPortal = (<any>(null as any));\nvar _decl0_85:i48.CdkPortalOutlet = (<any>(null as any));\nvar _decl0_86:i48.TemplatePortalDirective = (<any>(null as any));\nvar _decl0_87:i48.PortalHostDirective = (<any>(null as any));\nvar _decl0_88:i49.PlaceOutletComponent = (<any>(null as any));\nvar _decl0_89:i50.TabbedPlaceNavigationComponent = (<any>(null as any));\nvar _decl0_90:i51.ListPlaceNavComponent = (<any>(null as any));\nvar _decl0_91:i52.SidePlaceNavigationComponent = (<any>(null as any));\nvar _decl0_92:i53.AbstractPlaceNavigationComponent = (<any>(null as any));\nvar _decl0_93:i54.NotAuthorisedNoticeComponent = (<any>(null as any));\nvar _decl0_94:i2.AsyncPipe = (<any>(null as any));\nvar _decl0_95:i2.UpperCasePipe = (<any>(null as any));\nvar _decl0_96:i2.LowerCasePipe = (<any>(null as any));\nvar _decl0_97:i2.JsonPipe = (<any>(null as any));\nvar _decl0_98:i2.SlicePipe = (<any>(null as any));\nvar _decl0_99:i2.DecimalPipe = (<any>(null as any));\nvar _decl0_100:i2.PercentPipe = (<any>(null as any));\nvar _decl0_101:i2.TitleCasePipe = (<any>(null as any));\nvar _decl0_102:i2.CurrencyPipe = (<any>(null as any));\nvar _decl0_103:i2.DatePipe = (<any>(null as any));\nvar _decl0_104:i2.I18nPluralPipe = (<any>(null as any));\nvar _decl0_105:i2.I18nSelectPipe = (<any>(null as any));\nvar _decl0_106:i2.KeyValuePipe = (<any>(null as any));\nvar _decl0_107:i2.CommonModule = (<any>(null as any));\nvar _decl0_108:i55.BrowserAnimationsModule = (<any>(null as any));\nvar _decl0_109:i4.MatProgressSpinnerModule = (<any>(null as any));\nvar _decl0_110:i5.RouterModule = (<any>(null as any));\nvar _decl0_111:i6.MatTabsModule = (<any>(null as any));\nvar _decl0_112:i9.MatListModule = (<any>(null as any));\nvar _decl0_113:i11.MatTooltipModule = (<any>(null as any));\nvar _decl0_114:i12.MatIconModule = (<any>(null as any));\nvar _decl0_115:i56.DirectivesModule = (<any>(null as any));\nvar _decl0_116:i15.FlexModule = (<any>(null as any));\nvar _decl0_117:i57.ComponentsModule = (<any>(null as any));\nvar _decl0_118:i48.PortalModule = (<any>(null as any));\nvar _decl0_119:i0.TemplateRef<any> = (<any>(null as any));\nvar _decl0_120:i0.ElementRef<any> = (<any>(null as any));\nfunction _View_PlaceOutletComponent_Host_1_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_88.isAuthorised;\n currVal_0;\n}\nfunction _View_PlaceOutletComponent_1_1():void {\n if (_decl0_88.animationEnabled.value) {\n var _any:any = (null as any);\n const currVal_0:any = {value:_decl0_88.getAnimationOrder(),params:{duration:_decl0_88.animationDuration}};\n currVal_0;\n const pd_1:any = ((<any>_decl0_88.animationStarted()) !== false);\n const pd_2:any = ((<any>_decl0_88.animationDone()) !== false);\n const pd_3:any = ((<any>_decl0_88.onOutletActivated(_decl0_14,_any)) !== false);\n const pd_4:any = ((<any>_decl0_88.onOutletDeactivated()) !== false);\n }\n}\nfunction _View_PlaceOutletComponent_1_2():void {\n if (!_decl0_88.animationEnabled.value) {\n var _any:any = (null as any);\n const pd_0:any = ((<any>_decl0_88.onOutletActivated(_decl0_14,_any)) !== false);\n const pd_1:any = ((<any>_decl0_88.onOutletDeactivated()) !== false);\n }\n}\nfunction _View_PlaceOutletComponent_1_4():void {\n if (!_decl0_88.authorised.value) { var _any:any = (null as any); }\n}\nfunction _View_PlaceOutletComponent_1_3():void {\n if (!_decl0_88.authorised.value) {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_88.notAuthorisedNoticePortal;\n currVal_0;\n }\n}\nfunction _View_PlaceOutletComponent_1_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_88.animationEnabled.value;\n currVal_0;\n const currVal_1:any = !_decl0_88.animationEnabled.value;\n currVal_1;\n const currVal_2:any = !_decl0_88.authorised.value;\n currVal_2;\n}\nfunction _View_TabbedPlaceNavigationComponent_Host_2_0():void {\n var _any:any = (null as any);\n}\nfunction _View_TabbedPlaceNavigationComponent_2_1():void {\n var _any:any = (null as any);\n const currVal_0:any = _any.active;\n currVal_0;\n const currVal_1:any = (_decl0_23.active? 'page': null);\n currVal_1;\n const currVal_2:any = _decl0_23.disabled;\n currVal_2;\n const currVal_3:any = _decl0_23.tabIndex;\n currVal_3;\n const currVal_4:any = _decl0_23.disabled;\n currVal_4;\n const currVal_5:any = _decl0_23.active;\n currVal_5;\n const currVal_6:any = _decl0_89.getNavigationFace(_any.place).tooltip();\n currVal_6;\n const currVal_7:any = _decl0_89.commandFactory.create(_any.place);\n currVal_7;\n const currVal_8:any = [_decl0_89.getNavigationFace(_any.place)];\n currVal_8;\n const currVal_9:any = _decl0_76.requiresMissingIconInLayout;\n currVal_9;\n const currVal_10:any = _decl0_76.color;\n currVal_10;\n const pd_11:any = ((<any>_decl0_40.notifyClick(_any)) !== false);\n}\nfunction _View_TabbedPlaceNavigationComponent_2_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_22._showPaginationControls;\n currVal_0;\n const currVal_1:any = (_decl0_22._getLayoutDirection() == 'rtl');\n currVal_1;\n const currVal_2:any = ((_decl0_22.color !== 'warn') && (_decl0_22.color !== 'accent'));\n currVal_2;\n const currVal_3:any = (_decl0_22.color === 'accent');\n currVal_3;\n const currVal_4:any = (_decl0_22.color === 'warn');\n currVal_4;\n const currVal_5:any = _decl0_89.menuItems.value;\n currVal_5;\n const currVal_6:any = _decl0_89.trackByPlaceDef;\n currVal_6;\n}\nfunction _View_ListPlaceNavComponent_Host_3_0():void {\n var _any:any = (null as any);\n}\nfunction _View_ListPlaceNavComponent_3_1():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_30.disabled;\n currVal_0;\n const currVal_1:any = (_decl0_30._avatar || _decl0_30._icon);\n currVal_1;\n const currVal_2:any = (_decl0_30._avatar || _decl0_30._icon);\n currVal_2;\n const currVal_3:any = _decl0_90.getNavigationFace(_any.place).tooltip();\n currVal_3;\n const currVal_4:any = _decl0_90.commandFactory.create(_any.place);\n currVal_4;\n const currVal_5:any = _any.active;\n currVal_5;\n const currVal_6:any = [_decl0_90.getNavigationFace(_any.place)];\n currVal_6;\n const currVal_7:any = _decl0_76.requiresMissingIconInLayout;\n currVal_7;\n const currVal_8:any = _decl0_76.color;\n currVal_8;\n const pd_9:any = ((<any>_decl0_40.notifyClick(_any)) !== false);\n}\nfunction _View_ListPlaceNavComponent_3_0():void {\n var _any:any = (null as any);\n const currVal_0:any = '';\n currVal_0;\n const currVal_1:any = _decl0_90.menuItems.value;\n currVal_1;\n const currVal_2:any = _decl0_90.trackByPlaceDef;\n currVal_2;\n}\nfunction _View_SidePlaceNavigationComponent_Host_4_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_91.expanded;\n currVal_0;\n}\nfunction _View_SidePlaceNavigationComponent_4_2():void {\n if (_decl0_91.getNavigationFace(_any.place).icon()) {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_91.getNavigationFace(_any.place).icon();\n currVal_0;\n }\n}\nfunction _View_SidePlaceNavigationComponent_4_1():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_30.disabled;\n currVal_0;\n const currVal_1:any = (_decl0_30._avatar || _decl0_30._icon);\n currVal_1;\n const currVal_2:any = (_decl0_30._avatar || _decl0_30._icon);\n currVal_2;\n const currVal_3:any = _decl0_91.getNavigationFace(_any.place).tooltip();\n currVal_3;\n const currVal_4:any = _decl0_91.commandFactory.create(_any.place);\n currVal_4;\n const currVal_5:any = _any.active;\n currVal_5;\n const currVal_6:any = _decl0_91.getNavigationFace(_any.place).icon();\n currVal_6;\n const currVal_7:any = _decl0_91.getNavigationFace(_any.place).text();\n currVal_7;\n const pd_8:any = ((<any>_decl0_40.notifyClick(_any)) !== false);\n}\nfunction _View_SidePlaceNavigationComponent_4_3():void {\n if (_decl0_91.navEndTemplate) {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_91.navEndTemplate;\n currVal_0;\n }\n}\nfunction _View_SidePlaceNavigationComponent_4_0():void {\n var _any:any = (null as any);\n const currVal_0:any = _decl0_30.disabled;\n currVal_0;\n const currVal_1:any = (_decl0_30._avatar || _decl0_30._icon);\n currVal_1;\n const currVal_2:any = (_decl0_30._avatar || _decl0_30._icon);\n currVal_2;\n const currVal_3:any = 'mat:menu';\n currVal_3;\n const currVal_4:any = 'mat:arrow_back';\n currVal_4;\n const currVal_5:any = _decl0_91.menuItems.value;\n currVal_5;\n const currVal_6:any = _decl0_91.trackByPlaceDef;\n currVal_6;\n const currVal_7:any = 1;\n currVal_7;\n const currVal_8:any = _decl0_91.navEndTemplate;\n currVal_8;\n const pd_9:any = ((<any>_decl0_91.toggleMenu()) !== false);\n}\nfunction _View_AbstractPlaceNavigationComponent_Host_5_0():void {\n var _any:any = (null as any);\n}\nfunction _View_AbstractPlaceNavigationComponent_5_0():void {\n var _any:any = (null as any);\n}\nfunction _View_NotAuthorisedNoticeComponent_Host_6_0():void {\n var _any:any = (null as any);\n}\nfunction _View_NotAuthorisedNoticeComponent_6_0():void {\n var _any:any = (null as any);\n}\n"]}