@coolon/angular-ui-powerups 12.3.1 → 12.4.0-alpha.1

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 (113) hide show
  1. package/bundles/coolon-angular-ui-powerups-cypress.umd.js +299 -93
  2. package/bundles/coolon-angular-ui-powerups-cypress.umd.js.map +1 -1
  3. package/bundles/coolon-angular-ui-powerups.umd.js +315 -200
  4. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  5. package/coolon-angular-ui-powerups.metadata.json +1 -1
  6. package/cypress/components/aup-command-face.d.ts +2 -5
  7. package/cypress/components/aup-command.d.ts +18 -4
  8. package/cypress/components/aup-navigation.d.ts +0 -1
  9. package/cypress/components/aup-popup-menu.d.ts +2 -0
  10. package/cypress/components/aup-table.d.ts +19 -0
  11. package/cypress/components/button-mixin.d.ts +17 -0
  12. package/cypress/components/button.d.ts +17 -3
  13. package/cypress/coolon-angular-ui-powerups-cypress.d.ts +1 -0
  14. package/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
  15. package/cypress/exports.d.ts +3 -0
  16. package/cypress/page-element.d.ts +11 -2
  17. package/cypress/page.d.ts +20 -13
  18. package/cypress/path.d.ts +26 -0
  19. package/cypress/section.d.ts +8 -1
  20. package/esm2015/cypress/components/aup-command-face.js +20 -11
  21. package/esm2015/cypress/components/aup-command-face.js.map +1 -1
  22. package/esm2015/cypress/components/aup-command-face.metadata.json +1 -1
  23. package/esm2015/cypress/components/aup-command.js +10 -7
  24. package/esm2015/cypress/components/aup-command.js.map +1 -1
  25. package/esm2015/cypress/components/aup-command.metadata.json +1 -1
  26. package/esm2015/cypress/components/aup-more-menu.js +1 -2
  27. package/esm2015/cypress/components/aup-more-menu.js.map +1 -1
  28. package/esm2015/cypress/components/aup-more-menu.metadata.json +1 -1
  29. package/esm2015/cypress/components/aup-navigation.js +1 -5
  30. package/esm2015/cypress/components/aup-navigation.js.map +1 -1
  31. package/esm2015/cypress/components/aup-popup-menu.js +12 -3
  32. package/esm2015/cypress/components/aup-popup-menu.js.map +1 -1
  33. package/esm2015/cypress/components/aup-popup-menu.metadata.json +1 -1
  34. package/esm2015/cypress/components/aup-table.js +36 -0
  35. package/esm2015/cypress/components/aup-table.js.map +1 -0
  36. package/esm2015/cypress/components/aup-table.metadata.json +1 -0
  37. package/esm2015/cypress/components/button-mixin.js +15 -0
  38. package/esm2015/cypress/components/button-mixin.js.map +1 -0
  39. package/esm2015/cypress/components/button-mixin.metadata.json +1 -0
  40. package/esm2015/cypress/components/button.js +11 -7
  41. package/esm2015/cypress/components/button.js.map +1 -1
  42. package/esm2015/cypress/components/button.metadata.json +1 -1
  43. package/esm2015/cypress/coolon-angular-ui-powerups-cypress.js.map +1 -1
  44. package/esm2015/cypress/coolon-angular-ui-powerups-cypress.metadata.json +1 -1
  45. package/esm2015/cypress/exports.js +3 -0
  46. package/esm2015/cypress/exports.js.map +1 -1
  47. package/esm2015/cypress/exports.metadata.json +1 -1
  48. package/esm2015/cypress/page-element.js +21 -5
  49. package/esm2015/cypress/page-element.js.map +1 -1
  50. package/esm2015/cypress/page-element.metadata.json +1 -1
  51. package/esm2015/cypress/page.js +34 -22
  52. package/esm2015/cypress/page.js.map +1 -1
  53. package/esm2015/cypress/page.metadata.json +1 -1
  54. package/esm2015/cypress/path.js +61 -0
  55. package/esm2015/cypress/path.js.map +1 -0
  56. package/esm2015/cypress/path.metadata.json +1 -0
  57. package/esm2015/cypress/section.js +20 -10
  58. package/esm2015/cypress/section.js.map +1 -1
  59. package/esm2015/lib/components/switch-case/switch-case.component.js +7 -0
  60. package/esm2015/lib/components/switch-case/switch-case.component.js.map +1 -1
  61. package/esm2015/lib/components/switch-case/switch-case.component.metadata.json +1 -1
  62. package/esm2015/lib/components/tables/table/table.component.js +1 -1
  63. package/esm2015/lib/components/tables/table/table.component.js.map +1 -1
  64. package/esm2015/lib/components/tables/table/table.component.metadata.json +1 -1
  65. package/esm2015/lib/components/tables/tree-table/tree-table-component.js +1 -1
  66. package/esm2015/lib/components/tables/tree-table/tree-table-component.js.map +1 -1
  67. package/esm2015/lib/components/tables/tree-table/tree-table-component.metadata.json +1 -1
  68. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
  69. package/esm2015/lib/place/components/place-outlet/place-outlet.component.metadata.json +1 -1
  70. package/esm2015/lib/place/guards/consolidated-param-map.js +7 -2
  71. package/esm2015/lib/place/guards/consolidated-param-map.js.map +1 -1
  72. package/esm2015/lib/place/guards/consolidated-param-map.metadata.json +1 -1
  73. package/esm2015/lib/place/guards/place.guard.js +1 -22
  74. package/esm2015/lib/place/guards/place.guard.js.map +1 -1
  75. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js +15 -11
  76. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js.map +1 -1
  77. package/esm2015/lib/place/navigation/place-component-deactivation-handler.metadata.json +1 -1
  78. package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.js.map +1 -1
  79. package/esm2015/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.metadata.json +1 -1
  80. package/esm2015/lib/place/place-component.js +67 -5
  81. package/esm2015/lib/place/place-component.js.map +1 -1
  82. package/esm2015/lib/place/place-component.metadata.json +1 -1
  83. package/esm2015/lib/place/place-definition.js +3 -3
  84. package/esm2015/lib/place/place-definition.js.map +1 -1
  85. package/esm2015/lib/place/place-router.js +9 -4
  86. package/esm2015/lib/place/place-router.js.map +1 -1
  87. package/esm2015/lib/place/place-router.metadata.json +1 -1
  88. package/esm2015/lib/place/route/parameter-decorators.js +13 -14
  89. package/esm2015/lib/place/route/parameter-decorators.js.map +1 -1
  90. package/esm2015/lib/place/route/parameter-decorators.metadata.json +1 -1
  91. package/esm2015/lib/place/route/parameter-definition.js +21 -3
  92. package/esm2015/lib/place/route/parameter-definition.js.map +1 -1
  93. package/esm2015/lib/place/route/parameter-definition.metadata.json +1 -1
  94. package/esm2015/lib/place/route/visit-sanitiser.js +1 -1
  95. package/esm2015/lib/place/route/visit-sanitiser.js.map +1 -1
  96. package/esm2015/lib/place/url-snapshot.js +30 -7
  97. package/esm2015/lib/place/url-snapshot.js.map +1 -1
  98. package/esm2015/lib/place/url-snapshot.metadata.json +1 -1
  99. package/esm2015/lib/place/visit.js +7 -7
  100. package/esm2015/lib/place/visit.js.map +1 -1
  101. package/esm2015/lib/place/visit.metadata.json +1 -1
  102. package/fesm2015/coolon-angular-ui-powerups-cypress.js +237 -74
  103. package/fesm2015/coolon-angular-ui-powerups-cypress.js.map +1 -1
  104. package/fesm2015/coolon-angular-ui-powerups.js +275 -180
  105. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  106. package/lib/components/switch-case/switch-case.component.d.ts +7 -0
  107. package/lib/place/guards/consolidated-param-map.d.ts +2 -2
  108. package/lib/place/navigation/place-component-deactivation-handler.d.ts +3 -1
  109. package/lib/place/place-component.d.ts +26 -3
  110. package/lib/place/route/parameter-definition.d.ts +8 -0
  111. package/lib/place/url-snapshot.d.ts +1 -0
  112. package/lib/place/visit.d.ts +4 -4
  113. package/package.json +1 -1
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"TableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-table.component","name":"AbstractTableComponent","line":72,"character":41},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":64,"character":1},"arguments":[{"selector":"aup-table","providers":[{"provide":{"__symbolic":"reference","module":"../abstract-table.component","name":"AbstractTableComponent","line":69,"character":14},"useExisting":{"__symbolic":"reference","name":"TableComponent"}}],"template":"<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"getModel().dataSource.value\" [trackBy]=\"getModel().trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"getModel().isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"getModel()\"\n [editSession]=\"getModel().getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"getModel().getRowClasses(row)\" [class.enable-hover]=\"getModel().isHoverEnabled()\"\n [attr.trackBy]=\"getModel().trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n","styles":[":host{display:flex;flex-direction:column;align-items:stretch}:host table{width:100%}:host.enable-scrolling{min-height:0}:host.enable-scrolling .scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}"]}]}],"members":{"tableModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":74,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":75,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":78,"character":26},{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":78,"character":46}]}],"getModel":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"TableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-table.component","name":"AbstractTableComponent","line":72,"character":41},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":64,"character":1},"arguments":[{"selector":"aup-table","providers":[{"provide":{"__symbolic":"reference","module":"../abstract-table.component","name":"AbstractTableComponent","line":69,"character":14},"useExisting":{"__symbolic":"reference","name":"TableComponent"}}],"template":"<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"getModel().dataSource.value\" [trackBy]=\"getModel().trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"getModel().isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"getModel()\"\n [editSession]=\"getModel().getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"getModel().getRowClasses(row)\" [class.enable-hover]=\"getModel().isHoverEnabled()\"\n [attr.aup-row-id]=\"getModel().trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n","styles":[":host{display:flex;flex-direction:column;align-items:stretch}:host table{width:100%}:host.enable-scrolling{min-height:0}:host.enable-scrolling .scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}"]}]}],"members":{"tableModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":74,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":75,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":78,"character":26},{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":78,"character":46}]}],"getModel":[{"__symbolic":"method"}]}}}}]
@@ -74,7 +74,7 @@ export class TreeTableComponent extends AbstractTableComponent {
74
74
  TreeTableComponent.decorators = [
75
75
  { type: Component, args: [{
76
76
  selector: 'aup-tree-table',
77
- template: "<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"getModel().dataSource.value\" [trackBy]=\"getModel().trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"getModel().isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"getModel()\"\n [editSession]=\"getModel().getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"getModel().getRowClasses(row)\" [class.enable-hover]=\"getModel().isHoverEnabled()\"\n [attr.trackBy]=\"getModel().trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n",
77
+ template: "<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"getModel().dataSource.value\" [trackBy]=\"getModel().trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"getModel().isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"getModel()\"\n [editSession]=\"getModel().getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"getModel().getRowClasses(row)\" [class.enable-hover]=\"getModel().isHoverEnabled()\"\n [attr.aup-row-id]=\"getModel().trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n",
78
78
  providers: [
79
79
  { provide: AbstractTableComponent, useExisting: TreeTableComponent }
80
80
  ],
@@ -1 +1 @@
1
- {"version":3,"file":"tree-table-component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/tree-table/tree-table-component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AASH,MAAM,OAAO,kBAA0C,SAAQ,sBAAyB;IAMtF,YAAY,UAAsB,EAAE,MAAc;QAChD,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;;;YApBF,SAAS,SAAC;gBACT,QAAQ,EAAE,gBAAgB;gBAC1B,+3DAAsC;gBAEtC,SAAS,EAAE;oBACT,EAAE,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,kBAAkB,EAAE;iBACrE;;aACF;;;YA1EmB,UAAU;YAAS,MAAM;;;6BA6E1C,KAAK;;AAEN;IADC,aAAa,EAAE;8BACA,cAAc;0DAAI","sourcesContent":["import { Component, ElementRef, Input, NgZone } from '@angular/core';\nimport { TrackExternal } from '@coolon/pectin';\nimport { AbstractTableModel } from '../abstract-table-model';\nimport { AbstractTableComponent } from '../abstract-table.component';\nimport { TreeNode } from './tree-node';\nimport { TreeTableModel } from './tree-table-model';\n\n/**\n * Create your model:\n * @example\n * this.heroTableModel = TableTreeModel.fromList(heroList, table => {\n * table.pluck(\"firstName\");\n * table.pluck(\"lastName\");\n * table.addCustomColumn(\"fullName\", hero => `${hero.firstName} ${hero.lastName}`);\n * table.addTemplateColumn(\"specialColumn\");\n * });\n *\n * Create your table\n * @example\n * <aup-tree-table [treeTableModel]=\"heroTableModel\"></aup-table>\n *\n * Column templates\n * @example\n * this.heroTableModel = TableModel.fromList(heroList, table => {\n * table.pluck(\"firstName\");\n * table.pluck(\"lastName\");\n * table.addTemplateColumn(\"specialColumn\");\n * });\n * <aup-table [tableModel]=\"heroTableModel\">\n * <div *aupColumnTemplate=\"let hero; columnId: 'specialColumn'; fillCell: true; padChild:false\">\n * {{hero.name}}\n * </div>\n * </aup-table>\n *\n * Styling\n * @example\n * // global settings\n * :root {\n * --aup-table-column-gap: 10px; // defaults to 24px\n * --aup-table-row-hover-background-color, rgba(0, 0, 0, 0.05)\n * --aup-table-row-selected-background-color: rebeccapurple; // defaults to transparent\n * --aup-table-first-column-padding-left: 18px // defaults to --column-gap\n * --aup-table-last-column-padding-right: 18px // defaults to --column-gap\n * }\n *\n * // per table settings.\n * aup-table {\n * --column-gap: 10px; // defaults to 24px\n * --row-hover-background-color, rgba(0, 0, 0, 0.05)\n * --row-selected-background-color: rebeccapurple; // defaults to transparent\n * --first-column-padding-left: 18px // defaults to --column-gap\n * --last-column-padding-right: 18px // defaults to --column-gap\n *\n * aup-table-header-cell-renderer,\n * aup-table-cell-renderer {\n * &.aup-col-my-dasherised-column-id {\n * // do stuff\n * }\n * &.first-visible-column {\n * // do stuff\n * }\n * &.last-visible-column {\n * // do stuff\n * }\n * }\n * }\n */\n@Component({\n selector: 'aup-tree-table',\n templateUrl: '../table.component.html',\n styleUrls: ['../table.component.scss', './tree-table.component.scss'],\n providers: [\n { provide: AbstractTableComponent, useExisting: TreeTableComponent }\n ]\n})\nexport class TreeTableComponent<T extends TreeNode<T>> extends AbstractTableComponent<T> {\n\n @Input()\n @TrackExternal()\n treeTableModel: TreeTableModel<T>;\n\n constructor(elementRef: ElementRef, ngZone: NgZone) {\n super(elementRef, ngZone);\n }\n\n getModel(): AbstractTableModel<T> {\n return this.treeTableModel;\n }\n\n}\n"]}
1
+ {"version":3,"file":"tree-table-component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/tree-table/tree-table-component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AASH,MAAM,OAAO,kBAA0C,SAAQ,sBAAyB;IAMtF,YAAY,UAAsB,EAAE,MAAc;QAChD,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAC5B,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;;;YApBF,SAAS,SAAC;gBACT,QAAQ,EAAE,gBAAgB;gBAC1B,k4DAAsC;gBAEtC,SAAS,EAAE;oBACT,EAAE,OAAO,EAAE,sBAAsB,EAAE,WAAW,EAAE,kBAAkB,EAAE;iBACrE;;aACF;;;YA1EmB,UAAU;YAAS,MAAM;;;6BA6E1C,KAAK;;AAEN;IADC,aAAa,EAAE;8BACA,cAAc;0DAAI","sourcesContent":["import { Component, ElementRef, Input, NgZone } from '@angular/core';\nimport { TrackExternal } from '@coolon/pectin';\nimport { AbstractTableModel } from '../abstract-table-model';\nimport { AbstractTableComponent } from '../abstract-table.component';\nimport { TreeNode } from './tree-node';\nimport { TreeTableModel } from './tree-table-model';\n\n/**\n * Create your model:\n * @example\n * this.heroTableModel = TableTreeModel.fromList(heroList, table => {\n * table.pluck(\"firstName\");\n * table.pluck(\"lastName\");\n * table.addCustomColumn(\"fullName\", hero => `${hero.firstName} ${hero.lastName}`);\n * table.addTemplateColumn(\"specialColumn\");\n * });\n *\n * Create your table\n * @example\n * <aup-tree-table [treeTableModel]=\"heroTableModel\"></aup-table>\n *\n * Column templates\n * @example\n * this.heroTableModel = TableModel.fromList(heroList, table => {\n * table.pluck(\"firstName\");\n * table.pluck(\"lastName\");\n * table.addTemplateColumn(\"specialColumn\");\n * });\n * <aup-table [tableModel]=\"heroTableModel\">\n * <div *aupColumnTemplate=\"let hero; columnId: 'specialColumn'; fillCell: true; padChild:false\">\n * {{hero.name}}\n * </div>\n * </aup-table>\n *\n * Styling\n * @example\n * // global settings\n * :root {\n * --aup-table-column-gap: 10px; // defaults to 24px\n * --aup-table-row-hover-background-color, rgba(0, 0, 0, 0.05)\n * --aup-table-row-selected-background-color: rebeccapurple; // defaults to transparent\n * --aup-table-first-column-padding-left: 18px // defaults to --column-gap\n * --aup-table-last-column-padding-right: 18px // defaults to --column-gap\n * }\n *\n * // per table settings.\n * aup-table {\n * --column-gap: 10px; // defaults to 24px\n * --row-hover-background-color, rgba(0, 0, 0, 0.05)\n * --row-selected-background-color: rebeccapurple; // defaults to transparent\n * --first-column-padding-left: 18px // defaults to --column-gap\n * --last-column-padding-right: 18px // defaults to --column-gap\n *\n * aup-table-header-cell-renderer,\n * aup-table-cell-renderer {\n * &.aup-col-my-dasherised-column-id {\n * // do stuff\n * }\n * &.first-visible-column {\n * // do stuff\n * }\n * &.last-visible-column {\n * // do stuff\n * }\n * }\n * }\n */\n@Component({\n selector: 'aup-tree-table',\n templateUrl: '../table.component.html',\n styleUrls: ['../table.component.scss', './tree-table.component.scss'],\n providers: [\n { provide: AbstractTableComponent, useExisting: TreeTableComponent }\n ]\n})\nexport class TreeTableComponent<T extends TreeNode<T>> extends AbstractTableComponent<T> {\n\n @Input()\n @TrackExternal()\n treeTableModel: TreeTableModel<T>;\n\n constructor(elementRef: ElementRef, ngZone: NgZone) {\n super(elementRef, ngZone);\n }\n\n getModel(): AbstractTableModel<T> {\n return this.treeTableModel;\n }\n\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"TreeTableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-table.component","name":"AbstractTableComponent","line":75,"character":63},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":67,"character":1},"arguments":[{"selector":"aup-tree-table","providers":[{"provide":{"__symbolic":"reference","module":"../abstract-table.component","name":"AbstractTableComponent","line":72,"character":15},"useExisting":{"__symbolic":"reference","name":"TreeTableComponent"}}],"template":"<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"getModel().dataSource.value\" [trackBy]=\"getModel().trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"getModel().isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"getModel()\"\n [editSession]=\"getModel().getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"getModel().getRowClasses(row)\" [class.enable-hover]=\"getModel().isHoverEnabled()\"\n [attr.trackBy]=\"getModel().trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n","styles":[":host{display:flex;flex-direction:column;align-items:stretch}:host table{width:100%}:host.enable-scrolling{min-height:0}:host.enable-scrolling .scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}","td.mat-cell{border-top-width:0!important;border-bottom-width:0!important}td.mat-column-tree-label{width:1px}aup-table-cell-renderer[column-id=tree-label]{padding-left:8px!important}aup-tree-label-cell-renderer{flex:1}"]}]}],"members":{"treeTableModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":77,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":78,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":81,"character":26},{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":81,"character":46}]}],"getModel":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"TreeTableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-table.component","name":"AbstractTableComponent","line":75,"character":63},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":67,"character":1},"arguments":[{"selector":"aup-tree-table","providers":[{"provide":{"__symbolic":"reference","module":"../abstract-table.component","name":"AbstractTableComponent","line":72,"character":15},"useExisting":{"__symbolic":"reference","name":"TreeTableComponent"}}],"template":"<div class=\"scroll-container\">\n <table mat-table [dataSource]=\"getModel().dataSource.value\" [trackBy]=\"getModel().trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\"\n [class.enable-cursor]=\"getModel().isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"getModel()\"\n [editSession]=\"getModel().getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class]=\"getColumnClasses(column.columnId)\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"getModel().getRowClasses(row)\" [class.enable-hover]=\"getModel().isHoverEnabled()\"\n [attr.aup-row-id]=\"getModel().trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n","styles":[":host{display:flex;flex-direction:column;align-items:stretch}:host table{width:100%}:host.enable-scrolling{min-height:0}:host.enable-scrolling .scroll-container{flex:1;flex-basis:0;overflow-y:auto;display:flex;flex-direction:column;align-items:stretch}","td.mat-cell{border-top-width:0!important;border-bottom-width:0!important}td.mat-column-tree-label{width:1px}aup-table-cell-renderer[column-id=tree-label]{padding-left:8px!important}aup-tree-label-cell-renderer{flex:1}"]}]}],"members":{"treeTableModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":77,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":78,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":81,"character":26},{"__symbolic":"reference","module":"@angular/core","name":"NgZone","line":81,"character":46}]}],"getModel":[{"__symbolic":"method"}]}}}}]
@@ -1 +1 @@
1
- {"version":3,"file":"place-outlet.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/place/components/place-outlet/place-outlet.component.ts"],"names":[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AAC,uCAAuC;YACrB,oBAAoB,uBAAzD,QAAQ,YAAI,QAAQ;YA7GjC,iBAAiB;;;sBA6DhB,KAAK;2BAGL,KAAK;6CAIL,KAAK,SAAC,0BAA0B;wCAIhC,KAAK,SAAC,qBAAqB;2BAG3B,MAAM;wBAGN,SAAS,SAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;2BAyGzC,WAAW,SAAC,kBAAkB;;AAzH/B;IADU,iBAAiB,CAAC,cAAc,CAAC;;qDAC1B;AAGjB;IADU,aAAa,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;8BACjC,UAAU;0DAAU;AAIlC;IADoC,aAAa,EAAE;8BACnB,SAAS;4EAAgC;AAIzE;IAD+B,gBAAgB,CAAC,gCAAgC,CAAC;;uEACtB","sourcesContent":["import { ComponentPortal } from '@angular/cdk/portal';\nimport {\n ChangeDetectorRef,\n Component,\n EventEmitter, HostBinding,\n Inject,\n InjectionToken,\n Input,\n OnInit,\n Optional,\n Output,\n SkipSelf,\n ViewChild\n} from '@angular/core';\nimport { ActivatedRoute, Router, RouterOutlet } from '@angular/router';\nimport {\n BooleanValueModelChain,\n Constructable,\n DebugContext,\n Dsl,\n lang,\n ListModel,\n ListModelChain,\n MutableValueModel,\n StoreInListModel,\n StoreInValueModel,\n TrackExternal,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { DisposableComponent } from '../../../components/disposable-component';\nimport { PlaceComponent } from '../../place-component';\n\nimport { AUP_PLACE_CONFIG, PlaceConfig } from '../../place-config';\nimport { PlaceDefinition } from '../../place-definition';\nimport { PlaceRouter } from '../../place-router';\nimport { Visit } from '../../visit';\n\nimport { NotAuthorisedNoticeComponent } from '../not-authorised-notice/not-authorised-notice.component';\nimport { LEFT_RIGHT_PLACE_ANIMATION } from './route-animations';\n\n\nexport const AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT = new InjectionToken<Constructable<any>>('AUP_UNAUTHORISED_PLACE_COMPONENT');\n\n\n// Quick hack to avoid circular references between this and PlaceComponents.\ninterface PlaceRef {\n readonly placeDefinition: PlaceDefinition\n\n initialiseBindings(param: ValueModel<Visit>): void;\n\n onPlaceReady(): void;\n}\n\n@Component({\n selector: 'aup-place-outlet',\n templateUrl: './place-outlet.component.html',\n styleUrls: ['./place-outlet.component.scss'],\n animations: [LEFT_RIGHT_PLACE_ANIMATION]\n})\nexport class PlaceOutletComponent extends DisposableComponent implements OnInit {\n\n @Input() @StoreInValueModel('animateModel')\n animate: boolean;\n\n @Input() @TrackExternal({ defaultValue: true })\n animateModel: ValueModel<boolean>;\n\n // tslint:disable-next-line:no-input-rename\n @Input('placeAnimationOrderModel') @TrackExternal()\n customPlaceAnimationOrderModel: ListModel<Constructable<PlaceComponent>>;\n\n // tslint:disable-next-line:no-input-rename\n @Input('placeAnimationOrder') @StoreInListModel('customPlaceAnimationOrderModel')\n customPlaceAnimationOrder: Constructable<PlaceComponent>[];\n\n @Output()\n readonly placeChanged = new EventEmitter<PlaceComponent>();\n\n @ViewChild('routeOutlet', { static: true })\n routerOut: RouterOutlet;\n\n private onAnimationFinishedJob: () => void;\n\n\n private outletActivated = new MutableValueModel(false);\n private readonly _activatedRouteModel = new MutableValueModel<ActivatedRoute>();\n private readonly _activePlaceModel = new MutableValueModel<PlaceComponent>();\n\n readonly _activePlaceDefinition: ValueModelChain<PlaceDefinition>;\n\n private parentOutletModel: MutableValueModel<PlaceOutletComponent>;\n public readonly activePlaceAnimationPosition: ValueModelChain<number>;\n\n private initialPlaceIndex: number = null;\n private routerVisitModel: ValueModelChain<Visit>;\n private _isPushingVisitToRoute = new MutableValueModel<boolean>(false);\n private navigationInProgress: ValueModelChain<boolean>;\n\n private isVeryFirstLoad = true;\n private placesInAnimationOrder: ListModelChain<Constructable<PlaceComponent>>;\n private animationSupported: BooleanValueModelChain;\n readonly animationEnabled: BooleanValueModelChain;\n readonly authorised: ValueModelChain<boolean>;\n readonly notAuthorisedNoticePortal: ComponentPortal<any>;\n\n constructor(private readonly router: Router,\n private readonly placeRouter: PlaceRouter,\n @Optional() @Inject(AUP_PLACE_CONFIG) readonly placeConfig: PlaceConfig,\n @Optional() @Inject(AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT) unauthorisedPlaceNotice: Constructable<any>,\n @SkipSelf() @Optional() parentOutlet: PlaceOutletComponent,\n private readonly cdr: ChangeDetectorRef) {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n\n this.parentOutletModel = new MutableValueModel(parentOutlet);\n\n const defaultPlaceAnimationOrder = chain(this.parentOutletModel)\n .pullValueModel(o => o.activePlaceModel)\n .pluck('placeDefinition')\n .pluckList('children')\n .pluck('component');\n\n const activatePlaceType = chain(this.activePlaceModel).map(p => p.constructor as Constructable<PlaceComponent>);\n\n this.placesInAnimationOrder = chain(this.customPlaceAnimationOrderModel)\n .otherwise(defaultPlaceAnimationOrder);\n\n this.activePlaceAnimationPosition = this.placesInAnimationOrder\n .reduce((placesInOrder) => {\n let placeIndex = 0;\n if (activatePlaceType.value) {\n placeIndex = placesInOrder.indexOf(activatePlaceType.value);\n if (_.isNil(this.initialPlaceIndex)) {\n this.initialPlaceIndex = placeIndex;\n }\n }\n return _.isNil(this.initialPlaceIndex) ? 0 : placeIndex - this.initialPlaceIndex;\n }, { dependsOn: activatePlaceType });\n\n this.animationSupported = this.placesInAnimationOrder.count().isGreaterThan(0);\n this.animationEnabled = valueOf.all(\n this.animateModel,\n this.animationSupported\n ).areTruthy();\n\n // Extract our visit model from the place router.\n this._activePlaceDefinition = chain(this._activePlaceModel).pluck('placeDefinition');\n this.routerVisitModel = chain(placeRouter.state).map(state => state.getVisitFor(this._activePlaceDefinition.value), { dependsOn: this._activePlaceDefinition });\n\n this.navigationInProgress = chain(this.placeRouter.navigationInProgress);\n\n when(this.navigationInProgress).becomesFalsey(() => {\n this.checkStateAndInitialise();\n });\n when(this.outletActivated).becomesTruthy(() => {\n this.checkStateAndInitialise();\n });\n\n chain(this._activePlaceModel)\n .postponeWhile(this.navigationInProgress)\n .subscribe(place => this.placeChanged.emit(place));\n\n this.authorised = chain(placeRouter.accessGuard).map(guard => guard.isAuthorised(this._activePlaceDefinition.value), {\n dependsOn: this._activePlaceDefinition,\n postponeWhile: chain(this._activePlaceDefinition).isNil()\n }).otherwise(true); // if we don't have a place def yet we need to show the outlet so we get one injected.\n\n this.notAuthorisedNoticePortal = new ComponentPortal(unauthorisedPlaceNotice ?? NotAuthorisedNoticeComponent);\n }\n\n // @Trace()\n ngOnInit() {\n }\n\n // @Trace()\n getAnimationOrder() {\n return this.activePlaceAnimationPosition.value;\n }\n\n get animationDuration() {\n return this.placeConfig && this.placeConfig.animationDuration ? this.placeConfig.animationDuration : '500ms';\n }\n\n @HostBinding(\"class.authorised\")\n get isAuthorised() {\n return this.authorised.value;\n }\n\n // @Trace()\n navigate(visit: Visit) {\n // const place = this.placesInAnimationOrder.query().findMatching(p => visit.placeDefinition.component === p);\n // if (!place) {\n // lang.illegalState()\n // }\n this.placeRouter.navigate(visit, {\n relativeTo: this.parentOutlet ? this.parentOutlet.activatedRouteModel.value : null\n });\n }\n\n get parentOutlet(): PlaceOutletComponent {\n return this.parentOutletModel.value;\n }\n\n\n get activePlaceModel(): ValueModel<PlaceComponent> {\n return this._activePlaceModel.readonly;\n }\n\n get activatedRouteModel(): ValueModel<ActivatedRoute> {\n return this._activatedRouteModel.readonly;\n }\n\n // @Trace()\n onOutletActivated(routerOutlet: RouterOutlet, place: PlaceComponent) {\n this._activatedRouteModel.value = routerOutlet.activatedRoute;\n this._activePlaceModel.value = place;\n this.validateAnimationState(place);\n this.outletActivated.value = true;\n this.checkStateAndInitialise();\n }\n\n private validateAnimationState(place: PlaceComponent) {\n if (this.animateModel.value) {\n if (this.placesInAnimationOrder.length < 1) {\n console.error('PlaceOutlet.animate === true but placeAnimationOrder has not been set. Animation is disabled.');\n } else {\n if (!this.placesInAnimationOrder.query().includes(place.placeDefinition.component)) {\n console.error(`PlaceOutlet.animate === true but placeAnimationOrder doesn't contain ${place.placeDefinition.component.name}.`);\n }\n }\n }\n }\n\n // @Trace()\n onOutletDeactivated() {\n this.outletActivated.value = false;\n this._activePlaceModel.value = null;\n this._activatedRouteModel.value = null;\n }\n\n // @Trace()\n private checkStateAndInitialise() {\n const routerVisit = this.routerVisitModel.value;\n const activePlace = this.activePlaceModel.value;\n if (routerVisit && activePlace && !activePlace.isInitialised()) {\n if (routerVisit.placeDefinition !== activePlace.placeDefinition) {\n lang.illegalState('wrong visit!!!');\n }\n this.initialisePlace(routerVisit, activePlace);\n this.cdr.detectChanges()\n }\n }\n\n private initialisePlace(routerVisit: Visit, activePlace: PlaceComponent) {\n const visitModel = new MutableValueModel<Visit>(routerVisit);\n DebugContext.tag(visitModel, `PlaceOutletComponent[${activePlace.constructor.name})].visitModel`);\n activePlace.initialiseVisit(routerVisit, (current, previous) => {\n this.pushVisitChangeToRoute(previous, current);\n });\n const finishPlaceLoad = () => {\n this._activePlaceModel.value._notifyActive(true);\n };\n if (!this.animationEnabled.value || this.isVeryFirstLoad) {\n // if animation is disabled or this is the very first load then\n // we won't get our animation done callback so we finish the\n // process here and now.\n this.isVeryFirstLoad = false;\n finishPlaceLoad();\n } else {\n this.onAnimationFinishedJob = finishPlaceLoad;\n }\n const { when, chain, valueOf } = Dsl.disposeWith(activePlace);\n when(this.routerVisitModel)\n .changes(visit => {\n activePlace.updateVisit(visit);\n }, {\n unless: valueOf.any(\n this._isPushingVisitToRoute,\n this.routerVisitModel.isNil()\n ).areTruthy()\n });\n }\n\n private pushVisitChangeToRoute(previous: Visit, current: Visit) {\n this._isPushingVisitToRoute.value = true;\n this.placeRouter.pushVisitChangesToRoute(previous, current).finally(() => {\n this._isPushingVisitToRoute.value = false;\n });\n }\n\n// @Trace()\n animationStarted() {\n // console.log({ activePlace: this._activePlaceModel.value });\n }\n\n // @Trace()\n animationDone() {\n if (this.onAnimationFinishedJob) {\n this.onAnimationFinishedJob();\n this.onAnimationFinishedJob = undefined;\n }\n }\n\n}\n"]}
1
+ {"version":3,"file":"place-outlet.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/place/components/place-outlet/place-outlet.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EACL,iBAAiB,EACjB,SAAS,EACT,YAAY,EAAE,WAAW,EACzB,MAAM,EACN,cAAc,EACd,KAAK,EAEL,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,SAAS,EACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAkB,MAAM,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAGL,YAAY,EACZ,GAAG,EACH,IAAI,EACJ,SAAS,EAET,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,UAAU,EAEX,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAG/E,OAAO,EAAE,gBAAgB,EAAe,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,OAAO,EAAE,4BAA4B,EAAE,MAAM,0DAA0D,CAAC;AACxG,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAGhE,MAAM,CAAC,MAAM,uCAAuC,GAAG,IAAI,cAAc,CAAqB,kCAAkC,CAAC,CAAC;AAQlI,MAAM,OAAO,oBAAqB,SAAQ,mBAAmB;IA8C3D,YAA6B,MAAc,EACd,WAAwB,EACM,WAAwB,EACV,uBAA2C,EAChF,YAAkC,EACzC,GAAsB;QACjD,KAAK,EAAE,CAAC;QANmB,WAAM,GAAN,MAAM,CAAQ;QACd,gBAAW,GAAX,WAAW,CAAa;QACM,gBAAW,GAAX,WAAW,CAAa;QAGtD,QAAG,GAA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C,UAAU,EAAE,CAAC,0BAA0B,CAAC;;aACzC;;;YApCwB,MAAM;YAsBtB,WAAW;4CA+DL,QAAQ,YAAI,MAAM,SAAC,gBAAgB;4CACnC,QAAQ,YAAI,MAAM,SAAC,uCAAuC;YACrB,oBAAoB,uBAAzD,QAAQ,YAAI,QAAQ;YAnGjC,iBAAiB;;;sBAmDhB,KAAK;2BAGL,KAAK;6CAIL,KAAK,SAAC,0BAA0B;wCAIhC,KAAK,SAAC,qBAAqB;2BAG3B,MAAM;wBAGN,SAAS,SAAC,aAAa,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;2BAyGzC,WAAW,SAAC,kBAAkB;;AAzH/B;IADU,iBAAiB,CAAC,cAAc,CAAC;;qDAC1B;AAGjB;IADU,aAAa,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;8BACjC,UAAU;0DAAU;AAIlC;IADoC,aAAa,EAAE;8BACnB,SAAS;4EAAgC;AAIzE;IAD+B,gBAAgB,CAAC,gCAAgC,CAAC;;uEACtB","sourcesContent":["import { ComponentPortal } from '@angular/cdk/portal';\nimport {\n ChangeDetectorRef,\n Component,\n EventEmitter, HostBinding,\n Inject,\n InjectionToken,\n Input,\n OnInit,\n Optional,\n Output,\n SkipSelf,\n ViewChild\n} from '@angular/core';\nimport { ActivatedRoute, Router, RouterOutlet } from '@angular/router';\nimport {\n BooleanValueModelChain,\n Constructable,\n DebugContext,\n Dsl,\n lang,\n ListModel,\n ListModelChain,\n MutableValueModel,\n StoreInListModel,\n StoreInValueModel,\n TrackExternal,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { DisposableComponent } from '../../../components/disposable-component';\nimport { PlaceComponent } from '../../place-component';\n\nimport { AUP_PLACE_CONFIG, PlaceConfig } from '../../place-config';\nimport { PlaceDefinition } from '../../place-definition';\nimport { PlaceRouter } from '../../place-router';\nimport { Visit } from '../../visit';\n\nimport { NotAuthorisedNoticeComponent } from '../not-authorised-notice/not-authorised-notice.component';\nimport { LEFT_RIGHT_PLACE_ANIMATION } from './route-animations';\n\n\nexport const AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT = new InjectionToken<Constructable<any>>('AUP_UNAUTHORISED_PLACE_COMPONENT');\n\n@Component({\n selector: 'aup-place-outlet',\n templateUrl: './place-outlet.component.html',\n styleUrls: ['./place-outlet.component.scss'],\n animations: [LEFT_RIGHT_PLACE_ANIMATION]\n})\nexport class PlaceOutletComponent extends DisposableComponent implements OnInit {\n\n @Input() @StoreInValueModel('animateModel')\n animate: boolean;\n\n @Input() @TrackExternal({ defaultValue: true })\n animateModel: ValueModel<boolean>;\n\n // tslint:disable-next-line:no-input-rename\n @Input('placeAnimationOrderModel') @TrackExternal()\n customPlaceAnimationOrderModel: ListModel<Constructable<PlaceComponent>>;\n\n // tslint:disable-next-line:no-input-rename\n @Input('placeAnimationOrder') @StoreInListModel('customPlaceAnimationOrderModel')\n customPlaceAnimationOrder: Constructable<PlaceComponent>[];\n\n @Output()\n readonly placeChanged = new EventEmitter<PlaceComponent>();\n\n @ViewChild('routeOutlet', { static: true })\n routerOut: RouterOutlet;\n\n private onAnimationFinishedJob: () => void;\n\n\n private outletActivated = new MutableValueModel(false);\n private readonly _activatedRouteModel = new MutableValueModel<ActivatedRoute>();\n private readonly _activePlaceModel = new MutableValueModel<PlaceComponent>();\n\n readonly _activePlaceDefinition: ValueModelChain<PlaceDefinition>;\n\n private parentOutletModel: MutableValueModel<PlaceOutletComponent>;\n public readonly activePlaceAnimationPosition: ValueModelChain<number>;\n\n private initialPlaceIndex: number = null;\n private routerVisitModel: ValueModelChain<Visit>;\n private _isPushingVisitToRoute = new MutableValueModel<boolean>(false);\n private navigationInProgress: ValueModelChain<boolean>;\n\n private isVeryFirstLoad = true;\n private placesInAnimationOrder: ListModelChain<Constructable<PlaceComponent>>;\n private animationSupported: BooleanValueModelChain;\n readonly animationEnabled: BooleanValueModelChain;\n readonly authorised: ValueModelChain<boolean>;\n readonly notAuthorisedNoticePortal: ComponentPortal<any>;\n\n constructor(private readonly router: Router,\n private readonly placeRouter: PlaceRouter,\n @Optional() @Inject(AUP_PLACE_CONFIG) readonly placeConfig: PlaceConfig,\n @Optional() @Inject(AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT) unauthorisedPlaceNotice: Constructable<any>,\n @SkipSelf() @Optional() parentOutlet: PlaceOutletComponent,\n private readonly cdr: ChangeDetectorRef) {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n\n this.parentOutletModel = new MutableValueModel(parentOutlet);\n\n const defaultPlaceAnimationOrder = chain(this.parentOutletModel)\n .pullValueModel(o => o.activePlaceModel)\n .pluck('placeDefinition')\n .pluckList('children')\n .pluck('component');\n\n const activatePlaceType = chain(this.activePlaceModel).map(p => p.constructor as Constructable<PlaceComponent>);\n\n this.placesInAnimationOrder = chain(this.customPlaceAnimationOrderModel)\n .otherwise(defaultPlaceAnimationOrder);\n\n this.activePlaceAnimationPosition = this.placesInAnimationOrder\n .reduce((placesInOrder) => {\n let placeIndex = 0;\n if (activatePlaceType.value) {\n placeIndex = placesInOrder.indexOf(activatePlaceType.value);\n if (_.isNil(this.initialPlaceIndex)) {\n this.initialPlaceIndex = placeIndex;\n }\n }\n return _.isNil(this.initialPlaceIndex) ? 0 : placeIndex - this.initialPlaceIndex;\n }, { dependsOn: activatePlaceType });\n\n this.animationSupported = this.placesInAnimationOrder.count().isGreaterThan(0);\n this.animationEnabled = valueOf.all(\n this.animateModel,\n this.animationSupported\n ).areTruthy();\n\n // Extract our visit model from the place router.\n this._activePlaceDefinition = chain(this._activePlaceModel).pluck('placeDefinition');\n this.routerVisitModel = chain(placeRouter.state).map(state => state.getVisitFor(this._activePlaceDefinition.value), { dependsOn: this._activePlaceDefinition });\n\n this.navigationInProgress = chain(this.placeRouter.navigationInProgress);\n\n when(this.navigationInProgress).becomesFalsey(() => {\n this.checkStateAndInitialise();\n });\n when(this.outletActivated).becomesTruthy(() => {\n this.checkStateAndInitialise();\n });\n\n chain(this._activePlaceModel)\n .postponeWhile(this.navigationInProgress)\n .subscribe(place => this.placeChanged.emit(place));\n\n this.authorised = chain(placeRouter.accessGuard).map(guard => guard.isAuthorised(this._activePlaceDefinition.value), {\n dependsOn: this._activePlaceDefinition,\n postponeWhile: chain(this._activePlaceDefinition).isNil()\n }).otherwise(true); // if we don't have a place def yet we need to show the outlet so we get one injected.\n\n this.notAuthorisedNoticePortal = new ComponentPortal(unauthorisedPlaceNotice ?? NotAuthorisedNoticeComponent);\n }\n\n // @Trace()\n ngOnInit() {\n }\n\n // @Trace()\n getAnimationOrder() {\n return this.activePlaceAnimationPosition.value;\n }\n\n get animationDuration() {\n return this.placeConfig && this.placeConfig.animationDuration ? this.placeConfig.animationDuration : '500ms';\n }\n\n @HostBinding(\"class.authorised\")\n get isAuthorised() {\n return this.authorised.value;\n }\n\n // @Trace()\n navigate(visit: Visit) {\n // const place = this.placesInAnimationOrder.query().findMatching(p => visit.placeDefinition.component === p);\n // if (!place) {\n // lang.illegalState()\n // }\n this.placeRouter.navigate(visit, {\n relativeTo: this.parentOutlet ? this.parentOutlet.activatedRouteModel.value : null\n });\n }\n\n get parentOutlet(): PlaceOutletComponent {\n return this.parentOutletModel.value;\n }\n\n\n get activePlaceModel(): ValueModel<PlaceComponent> {\n return this._activePlaceModel.readonly;\n }\n\n get activatedRouteModel(): ValueModel<ActivatedRoute> {\n return this._activatedRouteModel.readonly;\n }\n\n // @Trace()\n onOutletActivated(routerOutlet: RouterOutlet, place: PlaceComponent) {\n this._activatedRouteModel.value = routerOutlet.activatedRoute;\n this._activePlaceModel.value = place;\n this.validateAnimationState(place);\n this.outletActivated.value = true;\n this.checkStateAndInitialise();\n }\n\n private validateAnimationState(place: PlaceComponent) {\n if (this.animateModel.value) {\n if (this.placesInAnimationOrder.length < 1) {\n console.error('PlaceOutlet.animate === true but placeAnimationOrder has not been set. Animation is disabled.');\n } else {\n if (!this.placesInAnimationOrder.query().includes(place.placeDefinition.component)) {\n console.error(`PlaceOutlet.animate === true but placeAnimationOrder doesn't contain ${place.placeDefinition.component.name}.`);\n }\n }\n }\n }\n\n // @Trace()\n onOutletDeactivated() {\n this.outletActivated.value = false;\n this._activePlaceModel.value = null;\n this._activatedRouteModel.value = null;\n }\n\n // @Trace()\n private checkStateAndInitialise() {\n const routerVisit = this.routerVisitModel.value;\n const activePlace = this.activePlaceModel.value;\n if (routerVisit && activePlace && !activePlace.isInitialised()) {\n if (routerVisit.placeDefinition !== activePlace.placeDefinition) {\n lang.illegalState('wrong visit!!!');\n }\n this.initialisePlace(routerVisit, activePlace);\n this.cdr.detectChanges()\n }\n }\n\n private initialisePlace(routerVisit: Visit, activePlace: PlaceComponent) {\n const visitModel = new MutableValueModel<Visit>(routerVisit);\n DebugContext.tag(visitModel, `PlaceOutletComponent[${activePlace.constructor.name})].visitModel`);\n activePlace.initialiseVisit(routerVisit, (current, previous) => {\n this.pushVisitChangeToRoute(previous, current);\n });\n const finishPlaceLoad = () => {\n this._activePlaceModel.value._notifyActive(true);\n };\n if (!this.animationEnabled.value || this.isVeryFirstLoad) {\n // if animation is disabled or this is the very first load then\n // we won't get our animation done callback so we finish the\n // process here and now.\n this.isVeryFirstLoad = false;\n finishPlaceLoad();\n } else {\n this.onAnimationFinishedJob = finishPlaceLoad;\n }\n const { when, chain, valueOf } = Dsl.disposeWith(activePlace);\n when(this.routerVisitModel)\n .changes(visit => {\n activePlace.updateVisit(visit);\n }, {\n unless: valueOf.any(\n this._isPushingVisitToRoute,\n this.routerVisitModel.isNil()\n ).areTruthy()\n });\n }\n\n private pushVisitChangeToRoute(previous: Visit, current: Visit) {\n this._isPushingVisitToRoute.value = true;\n this.placeRouter.pushVisitChangesToRoute(previous, current).finally(() => {\n this._isPushingVisitToRoute.value = false;\n });\n }\n\n// @Trace()\n animationStarted() {\n // console.log({ activePlace: this._activePlaceModel.value });\n }\n\n // @Trace()\n animationDone() {\n if (this.onAnimationFinishedJob) {\n this.onAnimationFinishedJob();\n this.onAnimationFinishedJob = undefined;\n }\n }\n\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":43,"character":59},"arguments":["AUP_UNAUTHORISED_PLACE_COMPONENT"]},"PlaceOutletComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../components/disposable-component","name":"DisposableComponent","line":61,"character":42},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":55,"character":1},"arguments":[{"selector":"aup-place-outlet","animations":[{"__symbolic":"reference","module":"./route-animations","name":"LEFT_RIGHT_PLACE_ANIMATION","line":59,"character":15}],"template":"<ng-container *ngIf=\"animationEnabled.value\">\n <div class=\"router-outlet-container\"\n cdkScrollable\n [@routeAnimations]=\"{value: getAnimationOrder(), params:{duration: animationDuration}}\"\n (@routeAnimations.start)=\"animationStarted()\"\n (@routeAnimations.done)=\"animationDone()\"\n >\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated(routerOutlet, $event)\"\n (deactivate)=\"onOutletDeactivated()\">\n </router-outlet>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"!animationEnabled.value\">\n <div class=\"router-outlet-container\"\n cdkScrollable>\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated(routerOutlet, $event)\"\n (deactivate)=\"onOutletDeactivated()\">\n </router-outlet>\n </div>\n</ng-container>\n\n<div class=\"not-authorised-component-container\" *ngIf=\"!authorised.value\">\n <ng-template [cdkPortalOutlet]=\"notAuthorisedNoticePortal\"></ng-template>\n</div>\n","styles":[":host{display:flex;flex-direction:column;min-height:0}:host:not(.authorised) .router-outlet-container{display:none}.router-outlet-container{flex:1;display:block;position:relative;min-height:0;overflow-x:hidden;overflow-y:auto}router-outlet{display:none}.not-authorised-component-container{flex:1;display:grid;grid-template-columns:1fr;grid-template-rows:1fr}"]}]}],"members":{"animate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":63,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":63,"character":12},"arguments":["animateModel"]}]}],"animateModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":66,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":66,"character":12},"arguments":[{"defaultValue":true}]}]}],"customPlaceAnimationOrderModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":70,"character":3},"arguments":["placeAnimationOrderModel"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":70,"character":38}}]}],"customPlaceAnimationOrder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":74,"character":3},"arguments":["placeAnimationOrder"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInListModel","line":74,"character":33},"arguments":["customPlaceAnimationOrderModel"]}]}],"placeChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":77,"character":3}}]}],"routerOut":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":80,"character":3},"arguments":["routeOutlet",{"static":true}]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":109,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":109,"character":27},"arguments":[{"__symbolic":"reference","module":"../../place-config","name":"AUP_PLACE_CONFIG","line":109,"character":34}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":110,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":110,"character":27},"arguments":[{"__symbolic":"reference","name":"AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf","line":111,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":111,"character":27}}],null],"parameters":[{"__symbolic":"reference","module":"@angular/router","name":"Router","line":107,"character":39},{"__symbolic":"reference","module":"../../place-router","name":"PlaceRouter","line":108,"character":44},{"__symbolic":"reference","module":"../../place-config","name":"PlaceConfig","line":109,"character":74},{"__symbolic":"reference","module":"@coolon/pectin","name":"Constructable","line":110,"character":100,"arguments":[{"__symbolic":"reference","name":"any"}]},{"__symbolic":"reference","name":"PlaceOutletComponent"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":112,"character":36}]}],"ngOnInit":[{"__symbolic":"method"}],"getAnimationOrder":[{"__symbolic":"method"}],"isAuthorised":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":185,"character":3},"arguments":["class.authorised"]}]}],"navigate":[{"__symbolic":"method"}],"onOutletActivated":[{"__symbolic":"method"}],"validateAnimationState":[{"__symbolic":"method"}],"onOutletDeactivated":[{"__symbolic":"method"}],"checkStateAndInitialise":[{"__symbolic":"method"}],"initialisePlace":[{"__symbolic":"method"}],"pushVisitChangeToRoute":[{"__symbolic":"method"}],"animationStarted":[{"__symbolic":"method"}],"animationDone":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":43,"character":59},"arguments":["AUP_UNAUTHORISED_PLACE_COMPONENT"]},"PlaceOutletComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../components/disposable-component","name":"DisposableComponent","line":51,"character":42},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":45,"character":1},"arguments":[{"selector":"aup-place-outlet","animations":[{"__symbolic":"reference","module":"./route-animations","name":"LEFT_RIGHT_PLACE_ANIMATION","line":49,"character":15}],"template":"<ng-container *ngIf=\"animationEnabled.value\">\n <div class=\"router-outlet-container\"\n cdkScrollable\n [@routeAnimations]=\"{value: getAnimationOrder(), params:{duration: animationDuration}}\"\n (@routeAnimations.start)=\"animationStarted()\"\n (@routeAnimations.done)=\"animationDone()\"\n >\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated(routerOutlet, $event)\"\n (deactivate)=\"onOutletDeactivated()\">\n </router-outlet>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"!animationEnabled.value\">\n <div class=\"router-outlet-container\"\n cdkScrollable>\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated(routerOutlet, $event)\"\n (deactivate)=\"onOutletDeactivated()\">\n </router-outlet>\n </div>\n</ng-container>\n\n<div class=\"not-authorised-component-container\" *ngIf=\"!authorised.value\">\n <ng-template [cdkPortalOutlet]=\"notAuthorisedNoticePortal\"></ng-template>\n</div>\n","styles":[":host{display:flex;flex-direction:column;min-height:0}:host:not(.authorised) .router-outlet-container{display:none}.router-outlet-container{flex:1;display:block;position:relative;min-height:0;overflow-x:hidden;overflow-y:auto}router-outlet{display:none}.not-authorised-component-container{flex:1;display:grid;grid-template-columns:1fr;grid-template-rows:1fr}"]}]}],"members":{"animate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":53,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":53,"character":12},"arguments":["animateModel"]}]}],"animateModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":56,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":56,"character":12},"arguments":[{"defaultValue":true}]}]}],"customPlaceAnimationOrderModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":60,"character":3},"arguments":["placeAnimationOrderModel"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":60,"character":38}}]}],"customPlaceAnimationOrder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":64,"character":3},"arguments":["placeAnimationOrder"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInListModel","line":64,"character":33},"arguments":["customPlaceAnimationOrderModel"]}]}],"placeChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":67,"character":3}}]}],"routerOut":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":70,"character":3},"arguments":["routeOutlet",{"static":true}]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":99,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":99,"character":27},"arguments":[{"__symbolic":"reference","module":"../../place-config","name":"AUP_PLACE_CONFIG","line":99,"character":34}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":100,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":100,"character":27},"arguments":[{"__symbolic":"reference","name":"AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf","line":101,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":101,"character":27}}],null],"parameters":[{"__symbolic":"reference","module":"@angular/router","name":"Router","line":97,"character":39},{"__symbolic":"reference","module":"../../place-router","name":"PlaceRouter","line":98,"character":44},{"__symbolic":"reference","module":"../../place-config","name":"PlaceConfig","line":99,"character":74},{"__symbolic":"reference","module":"@coolon/pectin","name":"Constructable","line":100,"character":100,"arguments":[{"__symbolic":"reference","name":"any"}]},{"__symbolic":"reference","name":"PlaceOutletComponent"},{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectorRef","line":102,"character":36}]}],"ngOnInit":[{"__symbolic":"method"}],"getAnimationOrder":[{"__symbolic":"method"}],"isAuthorised":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":175,"character":3},"arguments":["class.authorised"]}]}],"navigate":[{"__symbolic":"method"}],"onOutletActivated":[{"__symbolic":"method"}],"validateAnimationState":[{"__symbolic":"method"}],"onOutletDeactivated":[{"__symbolic":"method"}],"checkStateAndInitialise":[{"__symbolic":"method"}],"initialisePlace":[{"__symbolic":"method"}],"pushVisitChangeToRoute":[{"__symbolic":"method"}],"animationStarted":[{"__symbolic":"method"}],"animationDone":[{"__symbolic":"method"}]}}}}]
@@ -6,8 +6,13 @@ import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
6
6
  * param map even when `parameter`s has content.
7
7
  */
8
8
  export class ConsolidatedParameterMap {
9
- constructor(paramMap, urlSegments) {
10
- this.paramMaps = [paramMap].concat((urlSegments || []).map(s => new ParamMapAdapter(s.parameters))).filter(m => !!m); // the activated route param map can be null
9
+ constructor(urlSegments, paramMap) {
10
+ this.paramMaps = [];
11
+ // TODO: can we get all our params from teh url segments? If so we can drop the paramMap altogether.
12
+ const segmentParams = (urlSegments || []).map(s => new ParamMapAdapter(s.parameters));
13
+ this.paramMaps = segmentParams
14
+ .concat(paramMap)
15
+ .filter(m => !!m); // the activated route param map can be null
11
16
  }
12
17
  get(name) {
13
18
  const paramMap = this.paramMaps.find(m => m.has(name));
@@ -1 +1 @@
1
- {"version":3,"file":"consolidated-param-map.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/place/guards/consolidated-param-map.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAE3E;;;;GAIG;AACH,MAAM,OAAO,wBAAwB;IAInC,YAAY,QAAkB,EAAE,WAAyB;QACvD,IAAI,CAAC,SAAS,GAAG,CAAC,QAAQ,CAAC,CAAC,MAAM,CAChC,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAChE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,4CAA4C;IAClE,CAAC;IAED,GAAG,CAAC,IAAY;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED,MAAM,CAAC,IAAY;QACjB,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QACvD,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAED,GAAG,CAAC,IAAY;QACd,OAAO,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACjD,CAAC;IAGD,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;IACnF,CAAC;CACF;AAHC;IADC,OAAO,EAAE;;;oDAGT;AAGH,MAAM,eAAe;IACnB,YAA6B,MAA+B;QAA/B,WAAM,GAAN,MAAM,CAAyB;IAC5D,CAAC;IAED,GAAG,CAAC,IAAY;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,MAAM,CAAC,IAAY;QACjB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC7B,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;IAED,GAAG,CAAC,IAAY;QACd,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED,IAAI,IAAI;QACN,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;CAEF","sourcesContent":["import { ParamMap, UrlSegment } from '@angular/router';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';\n\n/**\n * This a work around for the fact that an activated route with multiple segments doesn't\n * include the segment params in the paramMap as well as each segment returns an empty\n * param map even when `parameter`s has content.\n */\nexport class ConsolidatedParameterMap implements ParamMap {\n\n private paramMaps: ParamMap[];\n\n constructor(paramMap: ParamMap, urlSegments: UrlSegment[]) {\n this.paramMaps = [paramMap].concat(\n (urlSegments || []).map(s => new ParamMapAdapter(s.parameters))\n ).filter(m => !!m); // the activated route param map can be null\n }\n\n get(name: string): string | null {\n const paramMap = this.paramMaps.find(m => m.has(name));\n return paramMap.get(name);\n }\n\n getAll(name: string): string[] {\n const paramMap = this.paramMaps.find(m => m.has(name));\n return paramMap.getAll(name);\n }\n\n has(name: string): boolean {\n return !!this.paramMaps.find(m => m.has(name));\n }\n\n @Memoize()\n get keys(): string[] {\n return this.paramMaps.reduce((result, params) => result.concat(params.keys), []);\n }\n}\n\nclass ParamMapAdapter implements ParamMap {\n constructor(private readonly params: { [p: string]: string }) {\n }\n\n get(name: string): string | null {\n return this.params[name];\n }\n\n getAll(name: string): string[] {\n const value = this.get(name);\n return Array.isArray(value) ? value : [value];\n }\n\n has(name: string): boolean {\n return this.keys.includes(name);\n }\n\n get keys(): string[] {\n return Object.keys(this.params);\n }\n\n}\n"]}
1
+ {"version":3,"file":"consolidated-param-map.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/place/guards/consolidated-param-map.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAE3E;;;;GAIG;AACH,MAAM,OAAO,wBAAwB;IAInC,YAAY,WAAyB,EAAE,QAAmB;QAFzC,cAAS,GAAe,EAAE,CAAC;QAG1C,oGAAoG;QACpG,MAAM,aAAa,GAAG,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,eAAe,CAAC,CAAC,CAAC,UAAU,CAAC,CAAe,CAAC;QACpG,IAAI,CAAC,SAAS,GAAG,aAAa;aAC3B,MAAM,CAAC,QAAQ,CAAC;aAChB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,4CAA4C;IACnE,CAAC;IAED,GAAG,CAAC,IAAY;QACd,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC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,IAAI,IAAI;QACN,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;CAEF","sourcesContent":["import { ParamMap, UrlSegment } from '@angular/router';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';\n\n/**\n * This a work around for the fact that an activated route with multiple segments doesn't\n * include the segment params in the paramMap as well as each segment returns an empty\n * param map even when `parameter`s has content.\n */\nexport class ConsolidatedParameterMap implements ParamMap {\n\n private readonly paramMaps: ParamMap[] = [];\n\n constructor(urlSegments: UrlSegment[], paramMap?: ParamMap) {\n // TODO: can we get all our params from teh url segments? If so we can drop the paramMap altogether.\n const segmentParams = (urlSegments || []).map(s => new ParamMapAdapter(s.parameters)) as ParamMap[];\n this.paramMaps = segmentParams\n .concat(paramMap)\n .filter(m => !!m); // the activated route param map can be null\n }\n\n get(name: string): string | null {\n const paramMap = this.paramMaps.find(m => m.has(name));\n return paramMap.get(name);\n }\n\n getAll(name: string): string[] {\n const paramMap = this.paramMaps.find(m => m.has(name));\n return paramMap.getAll(name);\n }\n\n has(name: string): boolean {\n return !!this.paramMaps.find(m => m.has(name));\n }\n\n @Memoize()\n get keys(): string[] {\n return this.paramMaps.reduce((result, params) => result.concat(params.keys), []);\n }\n}\n\nclass ParamMapAdapter implements ParamMap {\n constructor(private readonly params: { [p: string]: string }) {\n }\n\n get(name: string): string | null {\n return this.params[name];\n }\n\n getAll(name: string): string[] {\n const value = this.get(name);\n return Array.isArray(value) ? value : [value];\n }\n\n has(name: string): boolean {\n return this.keys.includes(name);\n }\n\n get keys(): string[] {\n return Object.keys(this.params);\n }\n\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"ConsolidatedParameterMap":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/router","name":"ParamMap","line":12,"character":24},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"@angular/router","name":"UrlSegment","line":12,"character":47}]}]}],"get":[{"__symbolic":"method"}],"getAll":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"keys":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator/dist/src","name":"Memoize","line":32,"character":3}}]}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"ConsolidatedParameterMap":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"reference","module":"@angular/router","name":"UrlSegment","line":12,"character":27}]},{"__symbolic":"reference","module":"@angular/router","name":"ParamMap","line":12,"character":52}]}],"get":[{"__symbolic":"method"}],"getAll":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"keys":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator/dist/src","name":"Memoize","line":34,"character":3}}]}]}}}}]
@@ -43,7 +43,7 @@ export class PlaceGuard {
43
43
  }
44
44
  const result = yield this.cleanInteractionState(activatedRoute, state, () => __awaiter(this, void 0, void 0, function* () {
45
45
  // Parse our route params.
46
- const params = new ConsolidatedParameterMap(activatedRoute.paramMap, activatedRoute.url);
46
+ const params = new ConsolidatedParameterMap(activatedRoute.url, activatedRoute.paramMap);
47
47
  const parsedParams = placeDefinition.parseRouteParams(params);
48
48
  const navigationSession = this.placeRouter.navigationSession;
49
49
  const initialVisit = navigationSession.getVisitFor(placeDefinition) || new Visit(placeDefinition, parsedParams);
@@ -91,27 +91,6 @@ export class PlaceGuard {
91
91
  const visit = result instanceof Visit ? result : new Visit(PlaceComponent.getDefinition(result), {});
92
92
  return this.urlService.createUrlSnapshot(visit).urlTree;
93
93
  }
94
- // protected async ensureAuthenticatedThen(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: (placeDefinition: PlaceDefinition) => Promise<boolean | UrlTree>): Promise<boolean | UrlTree> {
95
- // const authoriseResult = placeDefinition.authenticate ? await this.isAuthorised(activatedRoute, state) : true;
96
- // if (authoriseResult === true) {
97
- // // we're authorised, now run the place guards.
98
- // return next(placeDefinition);
99
- // } else {
100
- // console.log('not authorised result', authoriseResult);
101
- // return authoriseResult;
102
- // }
103
- // }
104
- //
105
- // // @Trace()
106
- // protected async ensureAuthorisedThen(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: (placeDefinition: PlaceDefinition) => Promise<boolean | UrlTree>): Promise<boolean | UrlTree> {
107
- //
108
- // }
109
- // @Trace()
110
- // async isAuthorised(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {
111
- // const authorised = this.getAuthGuard(this.injector).canActivate(activatedRoute, state);
112
- // return (authorised instanceof Observable) ? authorised.toPromise() : authorised;
113
- // }
114
- // abstract getAuthGuard(injector: Injector): CanActivate;
115
94
  // @Trace()
116
95
  cleanInteractionState(route, state, next) {
117
96
  return __awaiter(this, void 0, void 0, function* () {
@@ -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,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IACJ,EAAE;IACF,cAAc;IACd,iNAAiN;IACjN,EAAE;IACF,IAAI;IAEJ,WAAW;IACX,uHAAuH;IACvH,4FAA4F;IAC5F,qFAAqF;IACrF,IAAI;IAEJ,0DAA0D;IAE1D,WAAW;IACL,qBAAqB,CAAC,KAA6B,EAAE,KAA0B,EAAE,IAA0C;;YAC/H,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAChD,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,IAAI,GAAG,CAAC,eAAe,EAAE,EAAE;gBAChE,iGAAiG;gBACjG,mDAAmD;gBACnD,OAAO,GAAG,CAAC,oBAAoB,EAAE,CAAC;aACnC;iBAAM;gBACL,OAAO,IAAI,EAAE,CAAC;aACf;QACH,CAAC;KAAA;;;;YApHF,UAAU,SAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;YAhBhC,MAAM;YAWC,UAAU;YAFV,WAAW;YADX,YAAY;YAHZ,kBAAkB;YAVE,QAAQ","sourcesContent":["import { Inject, Injectable, Injector } from '@angular/core';\nimport {\n ActivatedRouteSnapshot,\n CanActivate,\n CanDeactivate,\n Router,\n RouterStateSnapshot,\n UrlTree\n} from '@angular/router';\nimport { Constructable, lang } from '@coolon/pectin';\nimport { InteractionService } from '../../interaction/services/interaction.service';\nimport { PlaceComponent } from '../place-component';\nimport { PlaceDefinition } from '../place-definition';\nimport { PlaceHistory } from '../place-history';\nimport { PlaceRouter } from '../place-router';\nimport { VisitSanitiser } from '../route/visit-sanitiser';\nimport { UrlService } from '../url-service';\nimport { UrlSnapshot } from '../url-snapshot';\nimport { Visit } from '../visit';\nimport { ConsolidatedParameterMap } from './consolidated-param-map';\n\n@Injectable({ providedIn: 'root' })\nexport class PlaceGuard implements CanActivate, CanDeactivate<PlaceComponent> {\n\n\n constructor(private readonly router: Router,\n private urlService: UrlService,\n private readonly placeRouter: PlaceRouter,\n private readonly placeHistory: PlaceHistory,\n private readonly interactionService: InteractionService,\n private readonly injector: Injector) {\n }\n\n // @Trace()\n async canActivate(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n\n if (PlaceComponent.isPlaceComponentConstructor(activatedRoute.component)) {\n const placeDefinition = PlaceComponent.getDefinition(activatedRoute.component);\n\n if (placeDefinition.authenticate) {\n\n if (!await this.placeRouter.accessGuard.value.isAuthenticated()) {\n const redirectLocation = this.placeRouter.getAuthenticationFailureRedirect(activatedRoute, state);\n const nextPlaceDef = this.getPlaceDefinition(redirectLocation);\n if (nextPlaceDef.authenticate) {\n lang.illegalState(`handleNotAuthenticated hook returned place ${nextPlaceDef.component.name} that requires authentication.`);\n }\n return this.createUrlTree(redirectLocation);\n }\n }\n\n const result = await this.cleanInteractionState(activatedRoute, state, async () => {\n // Parse our route params.\n const params = new ConsolidatedParameterMap(activatedRoute.paramMap, activatedRoute.url);\n const parsedParams = placeDefinition.parseRouteParams(params);\n\n const navigationSession = this.placeRouter.navigationSession;\n const initialVisit = navigationSession.getVisitFor(placeDefinition) || new Visit(placeDefinition, parsedParams);\n const sanitiser = new VisitSanitiser(navigationSession, activatedRoute, this.router, this.placeHistory, this.injector);\n const sanitisedVisit = await sanitiser.sanitise(initialVisit.mergeRouteParameters(parsedParams));\n\n // Save the visit with any updated parameters. We need to save it so we remember any non route parameters\n navigationSession.storeVisit(sanitisedVisit);\n if (initialVisit.hasRoutingChangedFrom(sanitisedVisit)) {\n // Regenerate the url\n const urlSnapshot = this.urlService.parseUrl(state.url).updateVisitSegments(sanitisedVisit);\n // console.log('##### Place Guard Redirect', urlSnapshot);\n return urlSnapshot;\n } else {\n return true;\n }\n });\n return result instanceof UrlSnapshot ? result.urlTree : result;\n\n } else {\n return lang.illegalState(`expected component to be an instance of PlaceComponent, got ${activatedRoute.component}`);\n }\n }\n\n // @Trace()\n async canDeactivate(component: PlaceComponent, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Promise<boolean | UrlTree> {\n if (!component) {\n // this happens when the place wasn't authorised and the associated\n // router outlet was removed from the dom.\n return true;\n }\n const currentUrl = this.urlService.parseUrl(currentState.url);\n const nextUrl = this.urlService.parseUrl(nextState.url);\n const result = await this.placeRouter.navigationSession.canDeactivatePlace(component, currentUrl, nextUrl);\n return result instanceof UrlSnapshot ? result.urlTree : result;\n }\n\n private getPlaceDefinition(result: Constructable<PlaceComponent> | Visit): PlaceDefinition {\n return result instanceof Visit ?\n result.placeDefinition :\n PlaceComponent.getDefinition(result);\n }\n\n private createUrlTree(result: Constructable<PlaceComponent> | Visit) {\n const visit = result instanceof Visit ? result : new Visit(PlaceComponent.getDefinition(result), {});\n return this.urlService.createUrlSnapshot(visit).urlTree;\n }\n\n // protected async ensureAuthenticatedThen(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: (placeDefinition: PlaceDefinition) => Promise<boolean | UrlTree>): Promise<boolean | UrlTree> {\n // const authoriseResult = placeDefinition.authenticate ? await this.isAuthorised(activatedRoute, state) : true;\n // if (authoriseResult === true) {\n // // we're authorised, now run the place guards.\n // return next(placeDefinition);\n // } else {\n // console.log('not authorised result', authoriseResult);\n // return authoriseResult;\n // }\n // }\n //\n // // @Trace()\n // protected async ensureAuthorisedThen(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: (placeDefinition: PlaceDefinition) => Promise<boolean | UrlTree>): Promise<boolean | UrlTree> {\n //\n // }\n\n // @Trace()\n // async isAuthorised(activatedRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Promise<boolean | UrlTree> {\n // const authorised = this.getAuthGuard(this.injector).canActivate(activatedRoute, state);\n // return (authorised instanceof Observable) ? authorised.toPromise() : authorised;\n // }\n\n // abstract getAuthGuard(injector: Injector): CanActivate;\n\n // @Trace()\n async cleanInteractionState(route: ActivatedRouteSnapshot, state: RouterStateSnapshot, next: () => Promise<boolean | UrlSnapshot>): Promise<boolean | UrlSnapshot> {\n const url = this.urlService.parseUrl(state.url);\n if (!this.interactionService.isActive() && url.hasInteractions()) {\n // This happens if we reload the page or the url was pasted as the route should only be activated\n // after the interaction context has become active.\n return url.removeInteractionIds();\n } else {\n return next();\n }\n }\n\n}\n"]}
1
+ {"version":3,"file":"place.guard.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/place/guards/place.guard.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACrD,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,QAAkB;QALlB,WAAM,GAAN,MAAM,CAAQ;QACvB,eAAU,GAAV,UAAU,CAAY;QACb,gBAAW,GAAX,WAAW,CAAa;QACxB,iBAAY,GAAZ,YAAY,CAAc;QAC1B,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,aAAQ,GAAR,QAAQ,CAAU;IAC/C,CAAC;IAED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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.url, activatedRoute.paramMap);\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 // @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"]}
@@ -21,6 +21,9 @@ export class PlaceComponentDeactivationHandler {
21
21
  get urlService() {
22
22
  return this.navigationSession.urlService;
23
23
  }
24
+ get placeDefinition() {
25
+ return this.component.placeDefinition;
26
+ }
24
27
  // @Trace()
25
28
  canDeactivate(currentUrl, nextState) {
26
29
  return __awaiter(this, void 0, void 0, function* () {
@@ -56,25 +59,26 @@ export class PlaceComponentDeactivationHandler {
56
59
  }
57
60
  }
58
61
  }
59
- // Ok, so now we're really leaving, so we ask the component if we should.;
60
- if (this.isNotJustAChangeInRouteId(nextState)) {
61
- if (this.component.canDeactivate) {
62
- // No interaction in progress, so ask the component .
63
- // This may start an interaction, hence checking the interaction context before now. I.e. if the place pops up the dialog, and
64
- // the user clicks back again, we'll re-enter here and go bang when the component tries to open another dialog.
65
- return this.component.canDeactivate(this.navigationSession.canDeactivateInteractionContext);
66
- }
62
+ // No interaction in progress, so ask the component .
63
+ // This may start an interaction, hence checking the interaction context before now. I.e. if the place pops up the dialog, and
64
+ // the user clicks back again, we'll re-enter here and go bang when the component tries to open another dialog.
65
+ if (this.isGoingToADifferentPlace(nextState)) {
66
+ const canLeave = yield this.component._canLeavePlace(this.navigationSession.canDeactivateInteractionContext);
67
67
  // The component has an active interaction but no deactivation hook. Rather than guessing what to do
68
68
  // we'll just cancel the navigation and print a warning.
69
- if (this.routerInteractionAdapter.isComponentInteracting(this.component)) {
69
+ if (canLeave && this.routerInteractionAdapter.isComponentInteracting(this.component)) {
70
70
  console.warn('Route changed while component has active interaction, cancelling navigation');
71
71
  return false;
72
72
  }
73
+ return canLeave;
74
+ }
75
+ else {
76
+ // either an interaction or visit parameter change.
77
+ return yield this.component._canChangeRouteParameters(this.navigationSession.canDeactivateInteractionContext, nextState);
73
78
  }
74
- return true;
75
79
  });
76
80
  }
77
- isNotJustAChangeInRouteId(nextState) {
81
+ isGoingToADifferentPlace(nextState) {
78
82
  // Because places with a route-id cover two route segments we get asked to deactivate
79
83
  // if the route id is added or removed. So if our path is still present the url
80
84
  // then we shouldn't deactivate the place.
@@ -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;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,MAAM,QAAQ,GAAG,IAAI,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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":";AAAA,OAAO,EAAS,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAM5B;;;;;;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,wBAA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I,CAAC,wBAAwB,CAAC,0BAA0B,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;wBAC/E,OAAO,KAAK,CAAC;qBACd;iBACF;aACF;YAED,qDAAqD;YACrD,8HAA8H;YAC9H,+GAA+G;YAC/G,IAAI,IAAI,CAAC,wBAAwB,CAAC,SAAS,CAAC,EAAE;gBAC5C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,iBAAiB,CAAC,+BAA+B,CAAC,CAAC;gBAC7G,qGAAqG;gBACrG,wDAAwD;gBACxD,IAAI,QAAQ,IAAI,IAAI,CAAC,wBAAwB,CAAC,sBAAsB,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;oBACpF,OAAO,CAAC,IAAI,CAAC,6EAA6E,CAAC,CAAC;oBAC5F,OAAO,KAAK,CAAC;iBACd;gBAED,OAAO,QAAQ,CAAC;aACjB;iBAAM;gBACL,mDAAmD;gBACnD,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,yBAAyB,CAAC,IAAI,CAAC,iBAAiB,CAAC,+BAA+B,EAAE,SAAS,CAAC,CAAC;aAC1H;QACH,CAAC;KAAA;IAES,wBAAwB,CAAC,SAAsB;QACvD,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 { PlaceDefinition } from '../place-definition';\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 get placeDefinition():PlaceDefinition {\n return this.component.placeDefinition;\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 // 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 if (this.isGoingToADifferentPlace(nextState)) {\n const canLeave = await this.component._canLeavePlace(this.navigationSession.canDeactivateInteractionContext);\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 (canLeave && this.routerInteractionAdapter.isComponentInteracting(this.component)) {\n console.warn('Route changed while component has active interaction, cancelling navigation');\n return false;\n }\n\n return canLeave;\n } else {\n // either an interaction or visit parameter change.\n return await this.component._canChangeRouteParameters(this.navigationSession.canDeactivateInteractionContext, nextState);\n }\n }\n\n protected isGoingToADifferentPlace(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 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"PlaceComponentDeactivationHandler":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../place-component","name":"PlaceComponent","line":17,"character":34},{"__symbolic":"reference","module":"./session/navigation-session","name":"NavigationSession","line":17,"character":78},{"__symbolic":"reference","name":"boolean"}]}],"canDeactivate":[{"__symbolic":"method"}],"canDeactivateComponent":[{"__symbolic":"method"}],"isNotJustAChangeInRouteId":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"PlaceComponentDeactivationHandler":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../place-component","name":"PlaceComponent","line":18,"character":34},{"__symbolic":"reference","module":"./session/navigation-session","name":"NavigationSession","line":18,"character":78},{"__symbolic":"reference","name":"boolean"}]}],"canDeactivate":[{"__symbolic":"method"}],"canDeactivateComponent":[{"__symbolic":"method"}],"isGoingToADifferentPlace":[{"__symbolic":"method"}]}}}}]
@@ -1 +1 @@
1
- {"version":3,"file":"synchronise-interaction-context-ids-with-route.js","sourceRoot":"","sources":["../../../../../../../../../libs/angular-ui-powerups/src/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,6CAA6C,EAAE,MAAM,uDAAuD,CAAC;AAEtH,MAAM,OAAO,yCAA0C,SAAQ,iBAAiB;IAI9E,YAAY,OAA0B,EAAE,WAAmB,EAAW,sBAA+B;QACnG,KAAK,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QADwC,2BAAsB,GAAtB,sBAAsB,CAAS;QAF5F,eAAU,GAAG,KAAK,CAAC;IAI5B,CAAC;IAED,YAAY;QACV,+BAA+B;QAC/B,UAAU,CAAC,GAAG,EAAE;YACd,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACtC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,WAAW;IACX,WAAW,CAAC,KAAoB;QAC9B,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC;IACtC,CAAC;IAED,WAAW;IACX,iBAAiB,CAAC,KAAuB;QACvC,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC;IACtC,CAAC;IAED,WAAW;IACX,4BAA4B;QAC1B,MAAM,UAAU,GAAG,IAAI,CAAC,yBAAyB,CAAC,8BAA8B,EAAE,CAAC;QACnF,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,6BAA6B,EAAE,CAAC,iBAAiB,EAAE,CAAC;QACxF,2GAA2G;QAC3G,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE;YACtC,mEAAmE;YACnE,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC;SACrC;aAAM;YACL,IAAI,UAAU,CAAC,MAAM,GAAG,WAAW,CAAC,MAAM,EA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AC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAC;gBACvH,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;gBACnC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;aACxB;SACF;aAAM;YACL,6EAA6E;YAC7E,kFAAkF;YAClF,uBAAuB;YACvB,2GAA2G;YAC3G,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,WAAW,EAAE,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC;SACvF;IACH,CAAC;IAED,yCAAyC,CAAC,MAAc;QACtD,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;CAEF","sourcesContent":["import { NavigationCancel, NavigationEnd } from '@angular/router';\nimport { Trace } from '@coolon/pectin';\nimport { lang } from '@coolon/typescript-utilities';\nimport _ from 'lodash';\nimport { NavigationContext } from '../navigation-context';\nimport { NavigationSession } from '../navigation-session';\nimport { RemoveLastInteractionFromUrlNavigationSession } from './remove-last-interaction-from-url-navigation-session';\n\nexport class SynchroniseInteractionContextIdsWithRoute extends NavigationSession {\n\n readonly isPopState = false;\n\n constructor(context: NavigationContext, startingUrl: string, readonly wasTriggeredByPopState: boolean) {\n super(context, startingUrl);\n }\n\n notifyActive() {\n // TODO: Do I still need this??\n setTimeout(() => {\n this.syncInteractionIdsWithRouter();\n });\n }\n\n // @Trace()\n onRouterEnd(event: NavigationEnd): void {\n this.context.finishRoutingSession();\n }\n\n // @Trace()\n onRouterCancelled(event: NavigationCancel): void {\n this.context.finishRoutingSession();\n }\n\n // @Trace()\n syncInteractionIdsWithRouter(): void {\n const currentIds = this.interactionServiceAdapter.getActiveInteractionContextIds();\n const previousIds = this.urlService.getCurrentLocationUrlSnapshot().getInteractionIds();\n // console.log(`---> synchroniseInteractionIds`, { is: currentIds.join(','), was: previousIds.join(',') });\n if (_.isEqual(currentIds, previousIds)) {\n // console.log('### Activity context ids were the same, skipping');\n this.context.finishRoutingSession();\n } else {\n if (currentIds.length > previousIds.length) {\n const isFirstActivity = currentIds.length > previousIds.length && previousIds.length < 1;\n this.addActivityContextToRoute(currentIds, isFirstActivity);\n } else {\n this.removeActivityContextFromRoute(currentIds);\n }\n }\n }\n\n // @Trace()\n addActivityContextToRoute(activeInteractionContextIds: string[], isFirst: boolean): void {\n const urlSnapshot = this.urlService.getCurrentRouterSnapshot().updateInteractionIds(activeInteractionContextIds);\n this.context.navigateByUrl(urlSnapshot, {\n replaceUrl: !isFirst\n }).then(result => {\n if (!this.urlService.getCurrentLocationUrlSnapshot().hasInteractionIds(activeInteractionContextIds)) {\n lang.illegalState(`Expected url to be ${urlSnapshot.url} but was ${this.urlService.getCurrentLocationUrl()}`);\n // this.urlService.resetBrowserLocation(urlSnapshot.url, {replaceCurrent: !isFirst})\n }\n });\n }\n\n\n // @Trace()\n removeActivityContextFromRoute(activeInteractionContextId: string[]):void {\n const urlSnapshot = this.urlService.getCurrentRouterSnapshot().updateInteractionIds(activeInteractionContextId);\n const isRemovingLastActivity = activeInteractionContextId.length < 1;\n if (isRemovingLastActivity) {\n if (this.wasTriggeredByPopState) {\n // console.log('removal was triggered by pop state, nothing to do.');\n // noop. Our url will be back to the non interaction version now so we dont' need to do anything.\n } else {\n // now we just pop our interaction id's from the browser history.\n // console.log(`Removal of the last activity wasn't triggered by pop state so we have to trigger one to clean the history`);\n const session = new RemoveLastInteractionFromUrlNavigationSession(this.context, this.urlService.getCurrentRouterUrl());\n this.context.transitionTo(session);\n this.urlService.back();\n }\n } else {\n // we've removed an interaction, but we still have remaining activities so we\n // update the url in place if it wasn't a pop state. If it was a pop state we need\n // to push it back up.\n // this.urlService.resetBrowserLocation(urlSnapshot.url, { replaceCurrent: !this.wasTriggeredByPopState });\n this.context.navigateByUrl(urlSnapshot, { replaceUrl: !this.wasTriggeredByPopState });\n }\n }\n\n handleCanDeactivateCancelledEventScenario(newUrl: string): void {\n lang.methodNotSupported();\n }\n\n}\n"]}
1
+ {"version":3,"file":"synchronise-interaction-context-ids-with-route.js","sourceRoot":"","sources":["../../../../../../../../../libs/angular-ui-powerups/src/lib/place/navigation/session/interactions/synchronise-interaction-context-ids-with-route.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,6CAA6C,EAAE,MAAM,uDAAuD,CAAC;AAEtH,MAAM,OAAO,yCAA0C,SAAQ,iBAAiB;IAI9E,YAAY,OAA0B,EAAE,WAAmB,EAAW,sBAA+B;QACnG,KAAK,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;QADwC,2BAAsB,GAAtB,sBAAsB,CAAS;QAF5F,eAAU,GAAG,KAAK,CAAC;IAI5B,CAAC;IAED,YAAY;QACV,+BAA+B;QAC/B,UAAU,CAAC,GAAG,EAAE;YACd,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACtC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,WAAW;IACX,WAAW,CAAC,KAAoB;QAC9B,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC;IACtC,CAAC;IAED,WAAW;IACX,iBAAiB,CAAC,KAAuB;QACvC,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC;IACtC,CAAC;IAED,WAAW;IACX,4BAA4B;QAC1B,MAAM,UAAU,GAAG,IAAI,CAAC,yBAAyB,CAAC,8BAA8B,EAAE,CAAC;QACnF,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,6BAA6B,EAAE,CAAC,iBAAiB,EAAE,CAAC;QACxF,2GAA2G;QAC3G,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE;YACtC,mEAAmE;YACnE,IAAI,CAAC,OAAO,CAAC,oBAAoB,EAAE,CAAC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ACjE,4HAA4H;gBAC5H,MAAM,OAAO,GAAG,IAAI,6CAA6C,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAC;gBACvH,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;gBACnC,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;aACxB;SACF;aAAM;YACL,6EAA6E;YAC7E,kFAAkF;YAClF,uBAAuB;YACvB,2GAA2G;YAC3G,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,WAAW,EAAE,EAAE,UAAU,EAAE,CAAC,IAAI,CAAC,sBAAsB,EAAE,CAAC,CAAC;SACvF;IACH,CAAC;IAED,yCAAyC,CAAC,MAAc;QACtD,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;CAEF","sourcesContent":["import { NavigationCancel, NavigationEnd } from '@angular/router';\nimport { lang } from '@coolon/typescript-utilities';\nimport _ from 'lodash';\nimport { NavigationContext } from '../navigation-context';\nimport { NavigationSession } from '../navigation-session';\nimport { RemoveLastInteractionFromUrlNavigationSession } from './remove-last-interaction-from-url-navigation-session';\n\nexport class SynchroniseInteractionContextIdsWithRoute extends NavigationSession {\n\n readonly isPopState = false;\n\n constructor(context: NavigationContext, startingUrl: string, readonly wasTriggeredByPopState: boolean) {\n super(context, startingUrl);\n }\n\n notifyActive() {\n // TODO: Do I still need this??\n setTimeout(() => {\n this.syncInteractionIdsWithRouter();\n });\n }\n\n // @Trace()\n onRouterEnd(event: NavigationEnd): void {\n this.context.finishRoutingSession();\n }\n\n // @Trace()\n onRouterCancelled(event: NavigationCancel): void {\n this.context.finishRoutingSession();\n }\n\n // @Trace()\n syncInteractionIdsWithRouter(): void {\n const currentIds = this.interactionServiceAdapter.getActiveInteractionContextIds();\n const previousIds = this.urlService.getCurrentLocationUrlSnapshot().getInteractionIds();\n // console.log(`---> synchroniseInteractionIds`, { is: currentIds.join(','), was: previousIds.join(',') });\n if (_.isEqual(currentIds, previousIds)) {\n // console.log('### Activity context ids were the same, skipping');\n this.context.finishRoutingSession();\n } else {\n if (currentIds.length > previousIds.length) {\n const isFirstActivity = currentIds.length > previousIds.length && previousIds.length < 1;\n this.addActivityContextToRoute(currentIds, isFirstActivity);\n } else {\n this.removeActivityContextFromRoute(currentIds);\n }\n }\n }\n\n // @Trace()\n addActivityContextToRoute(activeInteractionContextIds: string[], isFirst: boolean): void {\n const urlSnapshot = this.urlService.getCurrentRouterSnapshot().updateInteractionIds(activeInteractionContextIds);\n this.context.navigateByUrl(urlSnapshot, {\n replaceUrl: !isFirst\n }).then(result => {\n if (!this.urlService.getCurrentLocationUrlSnapshot().hasInteractionIds(activeInteractionContextIds)) {\n lang.illegalState(`Expected url to be ${urlSnapshot.url} but was ${this.urlService.getCurrentLocationUrl()}`);\n // this.urlService.resetBrowserLocation(urlSnapshot.url, {replaceCurrent: !isFirst})\n }\n });\n }\n\n\n // @Trace()\n removeActivityContextFromRoute(activeInteractionContextId: string[]): void {\n const urlSnapshot = this.urlService.getCurrentRouterSnapshot().updateInteractionIds(activeInteractionContextId);\n const isRemovingLastActivity = activeInteractionContextId.length < 1;\n if (isRemovingLastActivity) {\n if (this.wasTriggeredByPopState) {\n // console.log('removal was triggered by pop state, nothing to do.');\n // noop. Our url will be back to the non interaction version now so we dont' need to do anything.\n } else {\n // now we just pop our interaction id's from the browser history.\n // console.log(`Removal of the last activity wasn't triggered by pop state so we have to trigger one to clean the history`);\n const session = new RemoveLastInteractionFromUrlNavigationSession(this.context, this.urlService.getCurrentRouterUrl());\n this.context.transitionTo(session);\n this.urlService.back();\n }\n } else {\n // we've removed an interaction, but we still have remaining activities so we\n // update the url in place if it wasn't a pop state. If it was a pop state we need\n // to push it back up.\n // this.urlService.resetBrowserLocation(urlSnapshot.url, { replaceCurrent: !this.wasTriggeredByPopState });\n this.context.navigateByUrl(urlSnapshot, { replaceUrl: !this.wasTriggeredByPopState });\n }\n }\n\n handleCanDeactivateCancelledEventScenario(newUrl: string): void {\n lang.methodNotSupported();\n }\n\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"SynchroniseInteractionContextIdsWithRoute":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../navigation-session","name":"NavigationSession","line":8,"character":63},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../navigation-context","name":"NavigationContext","line":12,"character":23},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"boolean"}]}],"notifyActive":[{"__symbolic":"method"}],"onRouterEnd":[{"__symbolic":"method"}],"onRouterCancelled":[{"__symbolic":"method"}],"syncInteractionIdsWithRouter":[{"__symbolic":"method"}],"addActivityContextToRoute":[{"__symbolic":"method"}],"removeActivityContextFromRoute":[{"__symbolic":"method"}],"handleCanDeactivateCancelledEventScenario":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"SynchroniseInteractionContextIdsWithRoute":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../navigation-session","name":"NavigationSession","line":7,"character":63},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../navigation-context","name":"NavigationContext","line":11,"character":23},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"boolean"}]}],"notifyActive":[{"__symbolic":"method"}],"onRouterEnd":[{"__symbolic":"method"}],"onRouterCancelled":[{"__symbolic":"method"}],"syncInteractionIdsWithRouter":[{"__symbolic":"method"}],"addActivityContextToRoute":[{"__symbolic":"method"}],"removeActivityContextFromRoute":[{"__symbolic":"method"}],"handleCanDeactivateCancelledEventScenario":[{"__symbolic":"method"}]}}}}]