@coolon/angular-ui-powerups 11.0.0-alpha.16 → 11.0.0-alpha.2

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 (121) hide show
  1. package/assets/table.scss +6 -13
  2. package/bundles/coolon-angular-ui-powerups.umd.js +97 -193
  3. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  5. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  6. package/coolon-angular-ui-powerups.metadata.json +1 -1
  7. package/esm2015/lib/components/card-container/card-container.component.js +1 -1
  8. package/esm2015/lib/components/card-container/card-container.component.metadata.json +1 -1
  9. package/esm2015/lib/components/commands/command/command.component.js +1 -5
  10. package/esm2015/lib/components/commands/command/command.component.js.map +1 -1
  11. package/esm2015/lib/components/commands/command/command.component.metadata.json +1 -1
  12. package/esm2015/lib/components/components.module.js +3 -0
  13. package/esm2015/lib/components/components.module.js.map +1 -1
  14. package/esm2015/lib/components/components.module.metadata.json +1 -1
  15. package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
  16. package/esm2015/lib/components/table/column-model.js +1 -2
  17. package/esm2015/lib/components/table/column-model.js.map +1 -1
  18. package/esm2015/lib/components/table/column-model.metadata.json +1 -1
  19. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
  20. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.metadata.json +1 -1
  21. package/esm2015/lib/components/table/table-model.js +0 -9
  22. package/esm2015/lib/components/table/table-model.js.map +1 -1
  23. package/esm2015/lib/components/table/table-model.metadata.json +1 -1
  24. package/esm2015/lib/components/table/table.component.js +3 -30
  25. package/esm2015/lib/components/table/table.component.js.map +1 -1
  26. package/esm2015/lib/components/table/table.component.metadata.json +1 -1
  27. package/esm2015/lib/components/track-by.js +1 -5
  28. package/esm2015/lib/components/track-by.js.map +1 -1
  29. package/esm2015/lib/components/tree-table/decorated-tree-node.js +22 -19
  30. package/esm2015/lib/components/tree-table/decorated-tree-node.js.map +1 -1
  31. package/esm2015/lib/components/tree-table/tree-table-component.js +4 -21
  32. package/esm2015/lib/components/tree-table/tree-table-component.js.map +1 -1
  33. package/esm2015/lib/components/tree-table/tree-table-component.metadata.json +1 -1
  34. package/esm2015/lib/place/components/abstract-place-navigation.component.js +11 -21
  35. package/esm2015/lib/place/components/abstract-place-navigation.component.js.map +1 -1
  36. package/esm2015/lib/place/components/abstract-place-navigation.component.metadata.json +1 -1
  37. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js +1 -1
  38. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js.map +1 -1
  39. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.metadata.json +1 -1
  40. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +14 -23
  41. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
  42. package/esm2015/lib/place/components/place-outlet/place-outlet.component.metadata.json +1 -1
  43. package/esm2015/lib/place/components/side-place-navigation/side-place-navigation.component.js +1 -1
  44. package/esm2015/lib/place/components/side-place-navigation/side-place-navigation.component.js.map +1 -1
  45. package/esm2015/lib/place/components/side-place-navigation/side-place-navigation.component.metadata.json +1 -1
  46. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +1 -1
  47. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js.map +1 -1
  48. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.metadata.json +1 -1
  49. package/esm2015/lib/place/exports.js +0 -1
  50. package/esm2015/lib/place/exports.js.map +1 -1
  51. package/esm2015/lib/place/exports.metadata.json +1 -1
  52. package/esm2015/lib/place/guards/place.guard.js +8 -5
  53. package/esm2015/lib/place/guards/place.guard.js.map +1 -1
  54. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js +0 -2
  55. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js.map +1 -1
  56. package/esm2015/lib/place/place-component.js +3 -1
  57. package/esm2015/lib/place/place-component.js.map +1 -1
  58. package/esm2015/lib/place/place-component.metadata.json +1 -1
  59. package/esm2015/lib/place/place-router.js +4 -15
  60. package/esm2015/lib/place/place-router.js.map +1 -1
  61. package/esm2015/lib/place/place-router.metadata.json +1 -1
  62. package/esm2015/lib/place/place.module.js +2 -6
  63. package/esm2015/lib/place/place.module.js.map +1 -1
  64. package/esm2015/lib/place/place.module.metadata.json +1 -1
  65. package/esm2015/lib/place/place.module.ngfactory.js.map +1 -1
  66. package/fesm2015/coolon-angular-ui-powerups.js +79 -173
  67. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  68. package/lib/components/commands/command/command.component.d.ts +1 -2
  69. package/lib/components/table/column-model.d.ts +0 -1
  70. package/lib/components/table/table-model.d.ts +0 -9
  71. package/lib/components/table/table.component.d.ts +6 -24
  72. package/lib/components/track-by.d.ts +1 -3
  73. package/lib/components/tree-table/tree-table-component.d.ts +0 -9
  74. package/lib/place/components/abstract-place-navigation.component.d.ts +2 -9
  75. package/lib/place/components/place-outlet/place-outlet.component.d.ts +3 -10
  76. package/lib/place/exports.d.ts +0 -1
  77. package/lib/place/place-component.d.ts +1 -1
  78. package/lib/place/place-router.d.ts +6 -10
  79. package/package.json +1 -1
  80. package/schematics/aup-i18n/index.js +28 -8
  81. package/schematics/aup-i18n/index.js.map +1 -1
  82. package/schematics/aup-i18n/templates/i18n/aup/components.yml.template +69 -0
  83. package/schematics/bootstrap-app/index.js +4 -5
  84. package/schematics/bootstrap-app/index.js.map +1 -1
  85. package/schematics/bootstrap-app/templates/{i18n.config.json.template → i18n/config.json.template} +0 -2
  86. package/schematics/bootstrap-app/templates/i18n/notifications.yml.template +19 -0
  87. package/schematics/ng-add/index.js +2 -2
  88. package/schematics/ng-add/index.js.map +1 -1
  89. package/schematics/place-add/index.js +5 -4
  90. package/schematics/place-add/index.js.map +1 -1
  91. package/schematics/place-add/templates/component/__name@dasherize__.component.ts.template +1 -3
  92. package/schematics/place-add/templates/files/i18n/places/__name@dasherize__.yml.template +7 -0
  93. package/schematics/utils/build-context.d.ts +5 -4
  94. package/schematics/utils/workspace.d.ts +4 -3
  95. package/schematics/utils/workspace.js.map +1 -1
  96. package/esm2015/lib/place/components/not-authorised-notice/not-authorised-notice.component.js +0 -14
  97. package/esm2015/lib/place/components/not-authorised-notice/not-authorised-notice.component.js.map +0 -1
  98. package/esm2015/lib/place/components/not-authorised-notice/not-authorised-notice.component.metadata.json +0 -1
  99. package/esm2015/lib/place/components/not-authorised-notice/not-authorised-notice.component.ngfactory.js.map +0 -1
  100. package/esm2015/lib/place/components/not-authorised-notice/not-authorised-notice.component.scss.shim.ngstyle.js.map +0 -1
  101. package/lib/place/components/not-authorised-notice/not-authorised-notice.component.d.ts +0 -3
  102. package/schematics/aup-i18n/templates/app/aup.i18n.yml.template +0 -80
  103. package/schematics/place-add/templates/component/__name@dasherize__.i18n.yml.template +0 -5
  104. /package/schematics/bootstrap-app/templates/{src/app → app}/app-routing.module.ts.template +0 -0
  105. /package/schematics/bootstrap-app/templates/{src/app → app}/app.component.html.template +0 -0
  106. /package/schematics/bootstrap-app/templates/{src/app → app}/app.component.scss.template +0 -0
  107. /package/schematics/bootstrap-app/templates/{src/app → app}/app.component.ts.template +0 -0
  108. /package/schematics/bootstrap-app/templates/{src/app → app}/app.module.ts.template +0 -0
  109. /package/schematics/bootstrap-app/templates/{src/app → app}/i18n.ts.template +0 -0
  110. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/MaterialIcons-Regular.eot +0 -0
  111. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/MaterialIcons-Regular.ijmap +0 -0
  112. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/MaterialIcons-Regular.svg +0 -0
  113. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/MaterialIcons-Regular.ttf +0 -0
  114. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/MaterialIcons-Regular.woff +0 -0
  115. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/MaterialIcons-Regular.woff2 +0 -0
  116. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/README.md +0 -0
  117. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/codepoints +0 -0
  118. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/material-icons.css +0 -0
  119. /package/schematics/bootstrap-app/templates/{src/index.html.template → index.html.template} +0 -0
  120. /package/schematics/bootstrap-app/templates/{src/styles → styles}/global-variables.scss.template +0 -0
  121. /package/schematics/bootstrap-app/templates/{src/styles.scss.template → styles.scss.template} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"side-place-navigation.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/place/components/side-place-navigation/side-place-navigation.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAE1F,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAG1F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAMH,MAAM,OAAO,4BAA6B,SAAQ,gCAAgC;IAQhF,YAAY,MAAmB;QAC7B,KAAK,CAAC,MAAM,CAAC,CAAC;QANT,aAAQ,GAAG,KAAK,CAAC;IAOxB,CAAC;IAED,UAAU;QACR,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,YAAY;QACV,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IAED,UAAU;QACR,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;IACjC,CAAC;;;YA3BF,SAAS,SAAC;gBACT,QAAQ,EAAE,2BAA2B;gBACrC,i4BAAqD;;aAEtD;;;YAlDQ,WAAW;;;uBAqDjB,WAAW,SAAC,gBAAgB;6BAG5B,YAAY,SAAC,gBAAgB","sourcesContent":["import { Component, ContentChild, HostBinding, Inject, TemplateRef } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { PlaceRouter } from '../../place-router';\nimport { AbstractPlaceNavigationComponent } from '../abstract-place-navigation.component';\n\n\n/**\n * @example\n * // Usage\n * <aup-vertical-place-navigation [places]=\"placeConstructorArray\"\n * [placeOutlet]=\"placeOutletComponent\">\n * </aup-vertical-place-navigation>\n * <aup-place-outlet #placeOutletComponent></aup-place-outlet>\n *\n * // CSS overrides:\n * aup-side-place-navigation {\n * --nav-width: 56px\n * --nav-expanded-width: 235px\n * --nav-item-height: var(--nav-width)\n * --nav-background-color: #555;\n * --nav-color: rgba(255, 255, 255, 0.9);\n * }\n *\n * // Content Templates:\n * #navEndTemplate\n * <ng-template #navEndTemplate>\n * <a mat-list-item (click)=\"logout()\" matTooltip=\"Logout\">\n * <mat-icon>exit_to_app</mat-icon>\n * <span *ngIf=\"sideNav.expanded\">Logout</span>\n * </a>\n * </nav-template>\n *\n * // Place nav item in an i18n.yml\n * places:\n * myPlace:\n * nav(NavItem):\n * title: \"Activities\"\n * icon: \"build\"\n * tooltip: \"Alerts, confirms and dialogs\"\n *\n * // In your place\n * (at)Place({\n * path: 'myPlace',\n * data: {\n * nav: I18n.places.myPlace.nav\n * }\n * })\n */\n@Component({\n selector: 'aup-side-place-navigation',\n templateUrl: './side-place-navigation.component.html',\n styleUrls: ['./side-place-navigation.component.scss']\n})\nexport class SidePlaceNavigationComponent extends AbstractPlaceNavigationComponent {\n\n @HostBinding('class.expanded')\n public expanded = false;\n\n @ContentChild('navEndTemplate')\n navEndTemplate: TemplateRef<any>;\n\n constructor(router: PlaceRouter) {\n super(router);\n }\n\n expandMenu() {\n this.expanded = true;\n }\n\n collapseMenu() {\n this.expanded = false;\n }\n\n toggleMenu() {\n this.expanded = !this.expanded;\n }\n}\n"]}
1
+ {"version":3,"file":"side-place-navigation.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/place/components/side-place-navigation/side-place-navigation.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,WAAW,EAAU,WAAW,EAAE,MAAM,eAAe,CAAC;AAE1F,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAG1F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAMH,MAAM,OAAO,4BAA6B,SAAQ,gCAAgC;IAQhF,YAAY,MAAmB;QAC7B,KAAK,CAAC,MAAM,CAAC,CAAC;QANT,aAAQ,GAAG,KAAK,CAAC;IAOxB,CAAC;IAED,UAAU;QACR,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvB,CAAC;IAED,YAAY;QACV,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;IACxB,CAAC;IAED,UAAU;QACR,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC;IACjC,CAAC;;;YA3BF,SAAS,SAAC;gBACT,QAAQ,EAAE,2BAA2B;gBACrC,g6BAAqD;;aAEtD;;;YAlDQ,WAAW;;;uBAqDjB,WAAW,SAAC,gBAAgB;6BAG5B,YAAY,SAAC,gBAAgB","sourcesContent":["import { Component, ContentChild, HostBinding, Inject, TemplateRef } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { PlaceRouter } from '../../place-router';\nimport { AbstractPlaceNavigationComponent } from '../abstract-place-navigation.component';\n\n\n/**\n * @example\n * // Usage\n * <aup-vertical-place-navigation [places]=\"placeConstructorArray\"\n * [placeOutlet]=\"placeOutletComponent\">\n * </aup-vertical-place-navigation>\n * <aup-place-outlet #placeOutletComponent></aup-place-outlet>\n *\n * // CSS overrides:\n * aup-side-place-navigation {\n * --nav-width: 56px\n * --nav-expanded-width: 235px\n * --nav-item-height: var(--nav-width)\n * --nav-background-color: #555;\n * --nav-color: rgba(255, 255, 255, 0.9);\n * }\n *\n * // Content Templates:\n * #navEndTemplate\n * <ng-template #navEndTemplate>\n * <a mat-list-item (click)=\"logout()\" matTooltip=\"Logout\">\n * <mat-icon>exit_to_app</mat-icon>\n * <span *ngIf=\"sideNav.expanded\">Logout</span>\n * </a>\n * </nav-template>\n *\n * // Place nav item in an i18n.yml\n * places:\n * myPlace:\n * nav(NavItem):\n * title: \"Activities\"\n * icon: \"build\"\n * tooltip: \"Alerts, confirms and dialogs\"\n *\n * // In your place\n * (at)Place({\n * path: 'myPlace',\n * data: {\n * nav: I18n.places.myPlace.nav\n * }\n * })\n */\n@Component({\n selector: 'aup-side-place-navigation',\n templateUrl: './side-place-navigation.component.html',\n styleUrls: ['./side-place-navigation.component.scss']\n})\nexport class SidePlaceNavigationComponent extends AbstractPlaceNavigationComponent {\n\n @HostBinding('class.expanded')\n public expanded = false;\n\n @ContentChild('navEndTemplate')\n navEndTemplate: TemplateRef<any>;\n\n constructor(router: PlaceRouter) {\n super(router);\n }\n\n expandMenu() {\n this.expanded = true;\n }\n\n collapseMenu() {\n this.expanded = false;\n }\n\n toggleMenu() {\n this.expanded = !this.expanded;\n }\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"SidePlaceNavigationComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-place-navigation.component","name":"AbstractPlaceNavigationComponent","line":53,"character":50},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":48,"character":1},"arguments":[{"selector":"aup-side-place-navigation","template":"<mat-nav-list>\n <a mat-list-item (click)=\"toggleMenu()\" class=\"home\">\n <aup-icon class=\"collapsed-only\" icon=\"mat:menu\"></aup-icon>\n <aup-icon class=\"expanded-only\" icon=\"mat:arrow_back\"></aup-icon>\n <span class=\"expanded-only\">Menu</span>\n </a>\n <a mat-list-item *ngFor=\"let item of menuItems.value; trackBy: trackByPlaceDef\"\n [pectinCommand]=\"commandFactory.create(item.place)\"\n [class.active]=\"item.active\"\n [matTooltip]=\"getNavigationFace(item.place).tooltip()\">\n <aup-icon *ngIf=\"getNavigationFace(item.place).icon()\" [icon]=\"getNavigationFace(item.place).icon()\"></aup-icon>\n <span class=\"expanded-only\">{{getNavigationFace(item.place).text()}}</span>\n </a>\n <span [style.flex]=\"1\"></span>\n <ng-container *ngIf=\"navEndTemplate\" [ngTemplateOutlet]=\"navEndTemplate\"></ng-container>\n</mat-nav-list>\n","styles":[":host{display:flex;flex-direction:column;--resolved-nav-item-width:var(--nav-width,56px);--resolved-nav-item-height:var(--nav-item-height,var(--resolved-nav-item-width));--resolved-expanded-width:var(--nav-expanded-width,235px);--resolved-color:var(--nav-color,hsla(0,0%,100%,0.9));--resolved-background-color:var(--nav-background-color,#555);width:var(--resolved-nav-item-width);transition:width 125ms linear;background-color:var(--resolved-background-color);color:var(--resolved-color)}:host.expanded{width:var(--resolved-expanded-width);max-width:var(--resolved-expanded-width)}:host-context(.expanded) .expanded-only{max-width:100%}:host-context(.expanded) .collapsed-only{max-width:0}:host-context(.expanded) .mat-list-item aup-icon:not(.collapsed-only){margin-right:12px}:host-context(.expanded) .mat-list-item span{text-wrap:none;white-space:nowrap}.expanded-only{max-width:0;overflow:hidden}.collapsed-only{max-width:100%;overflow:hidden}mat-nav-list{flex:1;display:flex;flex-direction:column}.mat-list-item{width:var(--resolved-nav-item-width);height:var(--resolved-nav-item-height);color:inherit}.mat-list-item.active{background-color:#444}.mat-list-item.home{text-align:left}mat-icon{color:inherit}mat-icon.flip-horizontal{transform:scaleX(-1)}"]}]}],"members":{"expanded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":55,"character":3},"arguments":["class.expanded"]}]}],"navEndTemplate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":58,"character":3},"arguments":["navEndTemplate"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../place-router","name":"PlaceRouter","line":61,"character":22}]}],"expandMenu":[{"__symbolic":"method"}],"collapseMenu":[{"__symbolic":"method"}],"toggleMenu":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"SidePlaceNavigationComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-place-navigation.component","name":"AbstractPlaceNavigationComponent","line":53,"character":50},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":48,"character":1},"arguments":[{"selector":"aup-side-place-navigation","template":"<mat-nav-list>\n <a mat-list-item (click)=\"toggleMenu()\" class=\"home\">\n <aup-icon class=\"collapsed-only\" icon=\"mat:menu\"></aup-icon>\n <aup-icon class=\"expanded-only\" icon=\"mat:arrow_back\"></aup-icon>\n <span class=\"expanded-only\">Menu</span>\n </a>\n <a mat-list-item *ngFor=\"let placeDefinition of placeDefinitions.value\"\n [pectinCommand]=\"commandFactory.create(placeDefinition)\"\n [class.active]=\"isActive(placeDefinition)\"\n [matTooltip]=\"getNavigationFace(placeDefinition).tooltip()\">\n <aup-icon *ngIf=\"getNavigationFace(placeDefinition).icon()\" [icon]=\"getNavigationFace(placeDefinition).icon()\"></aup-icon>\n <span class=\"expanded-only\">{{getNavigationFace(placeDefinition).text()}}</span>\n </a>\n <span [style.flex]=\"1\"></span>\n <ng-container *ngIf=\"navEndTemplate\" [ngTemplateOutlet]=\"navEndTemplate\"></ng-container>\n</mat-nav-list>\n","styles":[":host{display:flex;flex-direction:column;--resolved-nav-item-width:var(--nav-width,56px);--resolved-nav-item-height:var(--nav-item-height,var(--resolved-nav-item-width));--resolved-expanded-width:var(--nav-expanded-width,235px);--resolved-color:var(--nav-color,hsla(0,0%,100%,0.9));--resolved-background-color:var(--nav-background-color,#555);width:var(--resolved-nav-item-width);transition:width 125ms linear;background-color:var(--resolved-background-color);color:var(--resolved-color)}:host.expanded{width:var(--resolved-expanded-width);max-width:var(--resolved-expanded-width)}:host-context(.expanded) .expanded-only{max-width:100%}:host-context(.expanded) .collapsed-only{max-width:0}:host-context(.expanded) .mat-list-item aup-icon:not(.collapsed-only){margin-right:12px}:host-context(.expanded) .mat-list-item span{text-wrap:none;white-space:nowrap}.expanded-only{max-width:0;overflow:hidden}.collapsed-only{max-width:100%;overflow:hidden}mat-nav-list{flex:1;display:flex;flex-direction:column}.mat-list-item{width:var(--resolved-nav-item-width);height:var(--resolved-nav-item-height);color:inherit}.mat-list-item.active{background-color:#444}.mat-list-item.home{text-align:left}mat-icon{color:inherit}mat-icon.flip-horizontal{transform:scaleX(-1)}"]}]}],"members":{"expanded":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":55,"character":3},"arguments":["class.expanded"]}]}],"navEndTemplate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ContentChild","line":58,"character":3},"arguments":["navEndTemplate"]}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../place-router","name":"PlaceRouter","line":61,"character":22}]}],"expandMenu":[{"__symbolic":"method"}],"collapseMenu":[{"__symbolic":"method"}],"toggleMenu":[{"__symbolic":"method"}]}}}}]
@@ -9,7 +9,7 @@ export class TabbedPlaceNavigationComponent extends AbstractPlaceNavigationCompo
9
9
  TabbedPlaceNavigationComponent.decorators = [
10
10
  { type: Component, args: [{
11
11
  selector: 'aup-tabbed-place-navigation',
12
- template: "<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let item of menuItems.value; trackBy: trackByPlaceDef\"\n [pectinCommand]=\"commandFactory.create(item.place)\"\n [active]=\"item.active\"\n [matTooltip]=\"getNavigationFace(item.place).tooltip()\">\n <aup-command-face [faces]=\"[getNavigationFace(item.place)]\"></aup-command-face>\n </a>\n</nav>\n",
12
+ template: "<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let placeDefinition of placeDefinitions.value\"\n [pectinCommand]=\"commandFactory.create(placeDefinition)\"\n [active]=\"isActive(placeDefinition)\"\n [matTooltip]=\"getNavigationFace(placeDefinition).tooltip()\">\n <aup-command-face [faces]=\"[getNavigationFace(placeDefinition)]\"></aup-command-face>\n </a>\n</nav>\n",
13
13
  styles: [""]
14
14
  },] }
15
15
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"tabbed-place-navigation.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAO1F,MAAM,OAAO,8BAA+B,SAAQ,gCAAgC;IAClF,YAAY,MAAmB;QAC7B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;;;YARF,SAAS,SAAC;gBACT,QAAQ,EAAE,6BAA6B;gBACvC,yXAAuD;;aAExD;;;YAPQ,WAAW","sourcesContent":["import { Component } from '@angular/core';\nimport { PlaceRouter } from '../../place-router';\nimport { AbstractPlaceNavigationComponent } from '../abstract-place-navigation.component';\n\n@Component({\n selector: 'aup-tabbed-place-navigation',\n templateUrl: './tabbed-place-navigation.component.html',\n styleUrls: ['./tabbed-place-navigation.component.scss']\n})\nexport class TabbedPlaceNavigationComponent extends AbstractPlaceNavigationComponent {\n constructor(router: PlaceRouter) {\n super(router);\n }\n}\n"]}
1
+ {"version":3,"file":"tabbed-place-navigation.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAO1F,MAAM,OAAO,8BAA+B,SAAQ,gCAAgC;IAClF,YAAY,MAAmB;QAC7B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;;;YARF,SAAS,SAAC;gBACT,QAAQ,EAAE,6BAA6B;gBACvC,8YAAuD;;aAExD;;;YAPQ,WAAW","sourcesContent":["import { Component } from '@angular/core';\nimport { PlaceRouter } from '../../place-router';\nimport { AbstractPlaceNavigationComponent } from '../abstract-place-navigation.component';\n\n@Component({\n selector: 'aup-tabbed-place-navigation',\n templateUrl: './tabbed-place-navigation.component.html',\n styleUrls: ['./tabbed-place-navigation.component.scss']\n})\nexport class TabbedPlaceNavigationComponent extends AbstractPlaceNavigationComponent {\n constructor(router: PlaceRouter) {\n super(router);\n }\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"TabbedPlaceNavigationComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-place-navigation.component","name":"AbstractPlaceNavigationComponent","line":9,"character":52},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"aup-tabbed-place-navigation","template":"<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let item of menuItems.value; trackBy: trackByPlaceDef\"\n [pectinCommand]=\"commandFactory.create(item.place)\"\n [active]=\"item.active\"\n [matTooltip]=\"getNavigationFace(item.place).tooltip()\">\n <aup-command-face [faces]=\"[getNavigationFace(item.place)]\"></aup-command-face>\n </a>\n</nav>\n","styles":[""]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../place-router","name":"PlaceRouter","line":10,"character":22}]}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"TabbedPlaceNavigationComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-place-navigation.component","name":"AbstractPlaceNavigationComponent","line":9,"character":52},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"aup-tabbed-place-navigation","template":"<nav mat-tab-nav-bar>\n <a mat-tab-link *ngFor=\"let placeDefinition of placeDefinitions.value\"\n [pectinCommand]=\"commandFactory.create(placeDefinition)\"\n [active]=\"isActive(placeDefinition)\"\n [matTooltip]=\"getNavigationFace(placeDefinition).tooltip()\">\n <aup-command-face [faces]=\"[getNavigationFace(placeDefinition)]\"></aup-command-face>\n </a>\n</nav>\n","styles":[""]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../place-router","name":"PlaceRouter","line":10,"character":22}]}]}}}}]
@@ -15,7 +15,6 @@ export * from "./url-snapshot";
15
15
  export * from "./visit";
16
16
  export * from "./components/abstract-place-navigation.component";
17
17
  export * from "./components/list-place-nav/list-place-nav.component";
18
- export * from "./components/not-authorised-notice/not-authorised-notice.component";
19
18
  export * from "./components/place-outlet/place-outlet.component";
20
19
  export * from "./components/place-outlet/route-animations";
21
20
  export * from "./components/side-place-navigation/side-place-navigation.component";
@@ -1 +1 @@
1
- {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/exports.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,kDAAkD,CAAC;AACjE,cAAc,sDAAsD,CAAC;AACrE,cAAc,oEAAoE,CAAC;AACnF,cAAc,kDAAkD,CAAC;AACjE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oEAAoE,CAAC;AACnF,cAAc,wEAAwE,CAAC;AACvF,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,sBAAsB,CAAC;AACrC,cAAc,mDAAmD,CAAC;AAClE,cAAc,oDAAoD,CAAC;AACnE,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2DAA2D,CAAC;AAC1E,cAAc,wFAAwF,CAAC;AACvG,cAAc,iHAAiH,CAAC;AAChI,cAAc,kGAAkG,CAAC;AACjH,cAAc,iEAAiE,CAAC;AAChF,cAAc,2EAA2E,CAAC;AAC1F,cAAc,uFAAuF,CAAC;AACtG,cAAc,kFAAkF,CAAC;AACjG,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./nav-item\";\nexport * from \"./place-access-guard\";\nexport * from \"./place-component\";\nexport * from \"./place-config\";\nexport * from \"./place-definition\";\nexport * from \"./place-history\";\nexport * from \"./place-router\";\nexport * from \"./place.decorator\";\nexport * from \"./place.module\";\nexport * from \"./url-service\";\nexport * from \"./url-snapshot\";\nexport * from \"./visit\";\nexport * from \"./components/abstract-place-navigation.component\";\nexport * from \"./components/list-place-nav/list-place-nav.component\";\nexport * from \"./components/not-authorised-notice/not-authorised-notice.component\";\nexport * from \"./components/place-outlet/place-outlet.component\";\nexport * from \"./components/place-outlet/route-animations\";\nexport * from \"./components/side-place-navigation/side-place-navigation.component\";\nexport * from \"./components/tabbed-place-navigation/tabbed-place-navigation.component\";\nexport * from \"./guards/consolidated-param-map\";\nexport * from \"./guards/noop-auth-guard.service\";\nexport * from \"./guards/place.guard\";\nexport * from \"./navigation/place-component-deactivation-handler\";\nexport * from \"./navigation/session/abstract-pop-state-navigation\";\nexport * from \"./navigation/session/navigating\";\nexport * from \"./navigation/session/navigation-context\";\nexport * from \"./navigation/session/navigation-session\";\nexport * from \"./navigation/session/pop-state-navigation\";\nexport * from \"./navigation/session/event-cleanup/event-clean-up-session\";\nexport * from \"./navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled\";\nexport * from \"./navigation/session/event-cleanup/wait-until-link-triggered-navigation-interaction-cancelation-type-determined\";\nexport * from \"./navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes\";\nexport * from \"./navigation/session/interactions/navigating-during-interaction\";\nexport * from \"./navigation/session/interactions/pop-state-during-interaction-navigation\";\nexport * from \"./navigation/session/interactions/remove-last-interaction-from-url-navigation-session\";\nexport * from \"./navigation/session/interactions/synchronise-interaction-context-ids-with-route\";\nexport * from \"./route/formatter\";\nexport * from \"./route/json-types\";\nexport * from \"./route/parameter-decorators\";\nexport * from \"./route/parameter-definition.class\";\nexport * from \"./route/parameter-sanitiser\";\nexport * from \"./route/parameter-snapshot\";\nexport * from \"./route/visit-sanitiser\";\n"]}
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/exports.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,kDAAkD,CAAC;AACjE,cAAc,sDAAsD,CAAC;AACrE,cAAc,kDAAkD,CAAC;AACjE,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oEAAoE,CAAC;AACnF,cAAc,wEAAwE,CAAC;AACvF,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,sBAAsB,CAAC;AACrC,cAAc,mDAAmD,CAAC;AAClE,cAAc,oDAAoD,CAAC;AACnE,cAAc,iCAAiC,CAAC;AAChD,cAAc,yCAAyC,CAAC;AACxD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,2DAA2D,CAAC;AAC1E,cAAc,wFAAwF,CAAC;AACvG,cAAc,iHAAiH,CAAC;AAChI,cAAc,kGAAkG,CAAC;AACjH,cAAc,iEAAiE,CAAC;AAChF,cAAc,2EAA2E,CAAC;AAC1F,cAAc,uFAAuF,CAAC;AACtG,cAAc,kFAAkF,CAAC;AACjG,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oCAAoC,CAAC;AACnD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./nav-item\";\nexport * from \"./place-access-guard\";\nexport * from \"./place-component\";\nexport * from \"./place-config\";\nexport * from \"./place-definition\";\nexport * from \"./place-history\";\nexport * from \"./place-router\";\nexport * from \"./place.decorator\";\nexport * from \"./place.module\";\nexport * from \"./url-service\";\nexport * from \"./url-snapshot\";\nexport * from \"./visit\";\nexport * from \"./components/abstract-place-navigation.component\";\nexport * from \"./components/list-place-nav/list-place-nav.component\";\nexport * from \"./components/place-outlet/place-outlet.component\";\nexport * from \"./components/place-outlet/route-animations\";\nexport * from \"./components/side-place-navigation/side-place-navigation.component\";\nexport * from \"./components/tabbed-place-navigation/tabbed-place-navigation.component\";\nexport * from \"./guards/consolidated-param-map\";\nexport * from \"./guards/noop-auth-guard.service\";\nexport * from \"./guards/place.guard\";\nexport * from \"./navigation/place-component-deactivation-handler\";\nexport * from \"./navigation/session/abstract-pop-state-navigation\";\nexport * from \"./navigation/session/navigating\";\nexport * from \"./navigation/session/navigation-context\";\nexport * from \"./navigation/session/navigation-session\";\nexport * from \"./navigation/session/pop-state-navigation\";\nexport * from \"./navigation/session/event-cleanup/event-clean-up-session\";\nexport * from \"./navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled\";\nexport * from \"./navigation/session/event-cleanup/wait-until-link-triggered-navigation-interaction-cancelation-type-determined\";\nexport * from \"./navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes\";\nexport * from \"./navigation/session/interactions/navigating-during-interaction\";\nexport * from \"./navigation/session/interactions/pop-state-during-interaction-navigation\";\nexport * from \"./navigation/session/interactions/remove-last-interaction-from-url-navigation-session\";\nexport * from \"./navigation/session/interactions/synchronise-interaction-context-ids-with-route\";\nexport * from \"./route/formatter\";\nexport * from \"./route/json-types\";\nexport * from \"./route/parameter-decorators\";\nexport * from \"./route/parameter-definition.class\";\nexport * from \"./route/parameter-sanitiser\";\nexport * from \"./route/parameter-snapshot\";\nexport * from \"./route/visit-sanitiser\";\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./nav-item"},{"from":"./place-access-guard"},{"from":"./place-component"},{"from":"./place-config"},{"from":"./place-definition"},{"from":"./place-history"},{"from":"./place-router"},{"from":"./place.decorator"},{"from":"./place.module"},{"from":"./url-service"},{"from":"./url-snapshot"},{"from":"./visit"},{"from":"./components/abstract-place-navigation.component"},{"from":"./components/list-place-nav/list-place-nav.component"},{"from":"./components/not-authorised-notice/not-authorised-notice.component"},{"from":"./components/place-outlet/place-outlet.component"},{"from":"./components/place-outlet/route-animations"},{"from":"./components/side-place-navigation/side-place-navigation.component"},{"from":"./components/tabbed-place-navigation/tabbed-place-navigation.component"},{"from":"./guards/consolidated-param-map"},{"from":"./guards/noop-auth-guard.service"},{"from":"./guards/place.guard"},{"from":"./navigation/place-component-deactivation-handler"},{"from":"./navigation/session/abstract-pop-state-navigation"},{"from":"./navigation/session/navigating"},{"from":"./navigation/session/navigation-context"},{"from":"./navigation/session/navigation-session"},{"from":"./navigation/session/pop-state-navigation"},{"from":"./navigation/session/event-cleanup/event-clean-up-session"},{"from":"./navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled"},{"from":"./navigation/session/event-cleanup/wait-until-link-triggered-navigation-interaction-cancelation-type-determined"},{"from":"./navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes"},{"from":"./navigation/session/interactions/navigating-during-interaction"},{"from":"./navigation/session/interactions/pop-state-during-interaction-navigation"},{"from":"./navigation/session/interactions/remove-last-interaction-from-url-navigation-session"},{"from":"./navigation/session/interactions/synchronise-interaction-context-ids-with-route"},{"from":"./route/formatter"},{"from":"./route/json-types"},{"from":"./route/parameter-decorators"},{"from":"./route/parameter-definition.class"},{"from":"./route/parameter-sanitiser"},{"from":"./route/parameter-snapshot"},{"from":"./route/visit-sanitiser"}]}]
1
+ [{"__symbolic":"module","version":4,"metadata":{},"exports":[{"from":"./nav-item"},{"from":"./place-access-guard"},{"from":"./place-component"},{"from":"./place-config"},{"from":"./place-definition"},{"from":"./place-history"},{"from":"./place-router"},{"from":"./place.decorator"},{"from":"./place.module"},{"from":"./url-service"},{"from":"./url-snapshot"},{"from":"./visit"},{"from":"./components/abstract-place-navigation.component"},{"from":"./components/list-place-nav/list-place-nav.component"},{"from":"./components/place-outlet/place-outlet.component"},{"from":"./components/place-outlet/route-animations"},{"from":"./components/side-place-navigation/side-place-navigation.component"},{"from":"./components/tabbed-place-navigation/tabbed-place-navigation.component"},{"from":"./guards/consolidated-param-map"},{"from":"./guards/noop-auth-guard.service"},{"from":"./guards/place.guard"},{"from":"./navigation/place-component-deactivation-handler"},{"from":"./navigation/session/abstract-pop-state-navigation"},{"from":"./navigation/session/navigating"},{"from":"./navigation/session/navigation-context"},{"from":"./navigation/session/navigation-session"},{"from":"./navigation/session/pop-state-navigation"},{"from":"./navigation/session/event-cleanup/event-clean-up-session"},{"from":"./navigation/session/event-cleanup/wait-until-leaving-interaction-transition-cancelled"},{"from":"./navigation/session/event-cleanup/wait-until-link-triggered-navigation-interaction-cancelation-type-determined"},{"from":"./navigation/session/event-cleanup/wait-until-popstate-during-can-deactivate-transition-finishes"},{"from":"./navigation/session/interactions/navigating-during-interaction"},{"from":"./navigation/session/interactions/pop-state-during-interaction-navigation"},{"from":"./navigation/session/interactions/remove-last-interaction-from-url-navigation-session"},{"from":"./navigation/session/interactions/synchronise-interaction-context-ids-with-route"},{"from":"./route/formatter"},{"from":"./route/json-types"},{"from":"./route/parameter-decorators"},{"from":"./route/parameter-definition.class"},{"from":"./route/parameter-sanitiser"},{"from":"./route/parameter-snapshot"},{"from":"./route/visit-sanitiser"}]}]
@@ -40,6 +40,14 @@ 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
+ }
43
51
  }
44
52
  const result = yield this.cleanInteractionState(activatedRoute, state, () => __awaiter(this, void 0, void 0, function* () {
45
53
  // Parse our route params.
@@ -71,11 +79,6 @@ export class PlaceGuard {
71
79
  // @Trace()
72
80
  canDeactivate(component, currentRoute, currentState, nextState) {
73
81
  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
- }
79
82
  const currentUrl = this.urlService.parseUrl(currentState.url);
80
83
  const nextUrl = this.urlService.parseUrl(nextState.url);
81
84
  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;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;;;;;;;AAGpE,MAAM,OAAO,UAAU;IAGrB,YAA6B,MAAc,EACvB,UAAsB,EACb,WAAwB,EACxB,YAA0B,EAC1B,kBAAsC,EACtC,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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
+ {"version":3,"file":"place.guard.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/place/guards/place.guard.ts"],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FAAqF;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;;;;YAxHF,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 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,5 +1,4 @@
1
1
  import { __awaiter } from "tslib";
2
- import { assert } from '@coolon/pectin';
3
2
  import * as _ from 'lodash';
4
3
  /**
5
4
  * This class handles the logic around canDeactivate for a given router state transition. It's core responsibilities are:
@@ -13,7 +12,6 @@ export class PlaceComponentDeactivationHandler {
13
12
  this.component = component;
14
13
  this.navigationSession = navigationSession;
15
14
  this.isPrimaryComponent = isPrimaryComponent;
16
- assert.notNil(component);
17
15
  }
18
16
  get routerInteractionAdapter() {
19
17
  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":";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;I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I,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, 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"]}
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,uBAAkB,GAAlB,kBAAkB,CAAS;IACnI,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,CAAC,UAAuB,EAAE,SAAsB;;YACpF,yGAAyG;YACzG,+IAA+I;YAC/I,IAAI,IAAI,CAAC,iBAAiB,CAAC,UAAU,EAAE;gBAErC,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,wBAAwB,CAAC,aAAa,EAAE,EAAE;oBAC5E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S,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"]}
@@ -19,7 +19,6 @@ 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);
23
22
  }
24
23
  // @Trace()
25
24
  initialiseVisit(visit, notifyVisitChanged) {
@@ -62,6 +61,9 @@ export class PlaceComponent extends DisposableComponent {
62
61
  get placeDefinition() {
63
62
  return PlaceComponent.getDefinition(this.constructor);
64
63
  }
64
+ get childPlaces() {
65
+ return this.placeDefinition.children.map(d => d.component);
66
+ }
65
67
  get active() {
66
68
  return this._active.readonly;
67
69
  }
@@ -1 +1 @@
1
- {"version":3,"file":"place-component.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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 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
+ {"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,iBAAi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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 +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":91,"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":89,"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.state = chain(this._activeVisits).reduce(visits => new PlaceRouter.State(visits));
57
+ this.activeVisitsByPlaceDefinition = chain(this._activeVisits).indexBy('placeDefinition');
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,6 +113,9 @@ 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
+ }
116
119
  get navigationSession() {
117
120
  return this.navigationSessionModel.value;
118
121
  }
@@ -322,18 +325,4 @@ PlaceRouter.ctorParameters = () => [
322
325
  { type: UrlService },
323
326
  { type: PlaceHistory }
324
327
  ];
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 = {}));
339
328
  //# 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,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,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AAgC;YAC5C,OAAO,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QAC7C,CAAC;QAED,WAAW,CAAC,eAAgC;YAC1C,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,KAAK,eAAe,CAAC,CAAC;QAC5E,CAAC;KACF;IAXY,iBAAK,QAWjB,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
+ {"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,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AAC,CAAC;oBAC7C,MAAM,WAAW,GAAG,IAAI,yCAAyC,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,UAAU,CAAC,mBAAmB,EAAE,EAAE,KAAK,CAAC,CAAC;oBACxI,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;gBACjC,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;SACJ;aAAM;YACL,OAAO,IAAI,OAAO,CAAU,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;gBAC/C,0EAA0E;gBAC1E,IAAI,CAAC,8BAA8B,CAAC,OAAO,CAAC,CAAC;gBAC7C,MAAM,OAAO,GAAG,IAAI,yCAAyC,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,UAAU,CAAC,mBAAmB,EAAE,EAAE,KAAK,CAAC,CAAC;gBACpI,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YAC7B,CAAC,CAAC,CAAC,CAAC;SAEL;IACH,CAAC;IAGO,qBAAqB,CAAC,KAAY;QACxC,MAAM,GAAG,GAAG,KAAK,CAAC,eAAe,CAAC;QAClC,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC;YACzB,CAAC,GAAG,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,2BAA2B,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC1E,CAAC,GAAG,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 +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":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
+ [{"__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,4 +1,3 @@
1
- import { PortalModule } from '@angular/cdk/portal';
2
1
  import { CommonModule } from '@angular/common';
3
2
  import { NgModule } from '@angular/core';
4
3
  import { FlexModule } from '@angular/flex-layout';
@@ -13,7 +12,6 @@ import { ComponentsModule } from '../components/exports';
13
12
  import { DirectivesModule } from '../directives/directives.module';
14
13
  import { AbstractPlaceNavigationComponent } from './components/abstract-place-navigation.component';
15
14
  import { ListPlaceNavComponent } from './components/list-place-nav/list-place-nav.component';
16
- import { NotAuthorisedNoticeComponent } from './components/not-authorised-notice/not-authorised-notice.component';
17
15
  import { PlaceOutletComponent } from './components/place-outlet/place-outlet.component';
18
16
  import { SidePlaceNavigationComponent } from './components/side-place-navigation/side-place-navigation.component';
19
17
  import { TabbedPlaceNavigationComponent } from './components/tabbed-place-navigation/tabbed-place-navigation.component';
@@ -32,16 +30,14 @@ PlaceModule.decorators = [
32
30
  MatIconModule,
33
31
  DirectivesModule,
34
32
  FlexModule,
35
- ComponentsModule,
36
- PortalModule
33
+ ComponentsModule
37
34
  ],
38
35
  declarations: [
39
36
  PlaceOutletComponent,
40
37
  TabbedPlaceNavigationComponent,
41
38
  ListPlaceNavComponent,
42
39
  SidePlaceNavigationComponent,
43
- AbstractPlaceNavigationComponent,
44
- NotAuthorisedNoticeComponent
40
+ AbstractPlaceNavigationComponent
45
41
  ],
46
42
  entryComponents: [],
47
43
  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,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,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;AAE/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,4BAA4B,EAAE,MAAM,oEAAoE,CAAC;AAClH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AACxF,OAAO,EAAE,4BAA4B,EAAE,MAAM,oEAAoE,CAAC;AAClH,OAAO,EAAE,8BAA8B,EAAE,MAAM,wEAAwE,CAAC;AAsCxH,MAAM,OAAO,WAAW;;;YAnCvB,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;oBAChB,YAAY;iBACb;gBACD,YAAY,EAAE;oBACZ,oBAAoB;oBACpB,8BAA8B;oBAC9B,qBAAqB;oBACrB,4BAA4B;oBAC5B,gCAAgC;oBAChC,4BAA4B;iBAC7B;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 { PortalModule } from '@angular/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
+ {"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"]}