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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/assets/table.scss +6 -13
  2. package/bundles/coolon-angular-ui-powerups.umd.js +97 -193
  3. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  4. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  5. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  6. package/coolon-angular-ui-powerups.metadata.json +1 -1
  7. package/esm2015/lib/components/card-container/card-container.component.js +1 -1
  8. package/esm2015/lib/components/card-container/card-container.component.metadata.json +1 -1
  9. package/esm2015/lib/components/commands/command/command.component.js +1 -5
  10. package/esm2015/lib/components/commands/command/command.component.js.map +1 -1
  11. package/esm2015/lib/components/commands/command/command.component.metadata.json +1 -1
  12. package/esm2015/lib/components/components.module.js +3 -0
  13. package/esm2015/lib/components/components.module.js.map +1 -1
  14. package/esm2015/lib/components/components.module.metadata.json +1 -1
  15. package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
  16. package/esm2015/lib/components/table/column-model.js +1 -2
  17. package/esm2015/lib/components/table/column-model.js.map +1 -1
  18. package/esm2015/lib/components/table/column-model.metadata.json +1 -1
  19. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.js.map +1 -1
  20. package/esm2015/lib/components/table/table-cell-renderer/table-cell-renderer.component.metadata.json +1 -1
  21. package/esm2015/lib/components/table/table-model.js +0 -9
  22. package/esm2015/lib/components/table/table-model.js.map +1 -1
  23. package/esm2015/lib/components/table/table-model.metadata.json +1 -1
  24. package/esm2015/lib/components/table/table.component.js +3 -30
  25. package/esm2015/lib/components/table/table.component.js.map +1 -1
  26. package/esm2015/lib/components/table/table.component.metadata.json +1 -1
  27. package/esm2015/lib/components/track-by.js +1 -5
  28. package/esm2015/lib/components/track-by.js.map +1 -1
  29. package/esm2015/lib/components/tree-table/decorated-tree-node.js +22 -19
  30. package/esm2015/lib/components/tree-table/decorated-tree-node.js.map +1 -1
  31. package/esm2015/lib/components/tree-table/tree-table-component.js +4 -21
  32. package/esm2015/lib/components/tree-table/tree-table-component.js.map +1 -1
  33. package/esm2015/lib/components/tree-table/tree-table-component.metadata.json +1 -1
  34. package/esm2015/lib/place/components/abstract-place-navigation.component.js +11 -21
  35. package/esm2015/lib/place/components/abstract-place-navigation.component.js.map +1 -1
  36. package/esm2015/lib/place/components/abstract-place-navigation.component.metadata.json +1 -1
  37. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js +1 -1
  38. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.js.map +1 -1
  39. package/esm2015/lib/place/components/list-place-nav/list-place-nav.component.metadata.json +1 -1
  40. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js +14 -23
  41. package/esm2015/lib/place/components/place-outlet/place-outlet.component.js.map +1 -1
  42. package/esm2015/lib/place/components/place-outlet/place-outlet.component.metadata.json +1 -1
  43. package/esm2015/lib/place/components/side-place-navigation/side-place-navigation.component.js +1 -1
  44. package/esm2015/lib/place/components/side-place-navigation/side-place-navigation.component.js.map +1 -1
  45. package/esm2015/lib/place/components/side-place-navigation/side-place-navigation.component.metadata.json +1 -1
  46. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js +1 -1
  47. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.js.map +1 -1
  48. package/esm2015/lib/place/components/tabbed-place-navigation/tabbed-place-navigation.component.metadata.json +1 -1
  49. package/esm2015/lib/place/exports.js +0 -1
  50. package/esm2015/lib/place/exports.js.map +1 -1
  51. package/esm2015/lib/place/exports.metadata.json +1 -1
  52. package/esm2015/lib/place/guards/place.guard.js +8 -5
  53. package/esm2015/lib/place/guards/place.guard.js.map +1 -1
  54. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js +0 -2
  55. package/esm2015/lib/place/navigation/place-component-deactivation-handler.js.map +1 -1
  56. package/esm2015/lib/place/place-component.js +3 -1
  57. package/esm2015/lib/place/place-component.js.map +1 -1
  58. package/esm2015/lib/place/place-component.metadata.json +1 -1
  59. package/esm2015/lib/place/place-router.js +4 -15
  60. package/esm2015/lib/place/place-router.js.map +1 -1
  61. package/esm2015/lib/place/place-router.metadata.json +1 -1
  62. package/esm2015/lib/place/place.module.js +2 -6
  63. package/esm2015/lib/place/place.module.js.map +1 -1
  64. package/esm2015/lib/place/place.module.metadata.json +1 -1
  65. package/esm2015/lib/place/place.module.ngfactory.js.map +1 -1
  66. package/fesm2015/coolon-angular-ui-powerups.js +79 -173
  67. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  68. package/lib/components/commands/command/command.component.d.ts +1 -2
  69. package/lib/components/table/column-model.d.ts +0 -1
  70. package/lib/components/table/table-model.d.ts +0 -9
  71. package/lib/components/table/table.component.d.ts +6 -24
  72. package/lib/components/track-by.d.ts +1 -3
  73. package/lib/components/tree-table/tree-table-component.d.ts +0 -9
  74. package/lib/place/components/abstract-place-navigation.component.d.ts +2 -9
  75. package/lib/place/components/place-outlet/place-outlet.component.d.ts +3 -10
  76. package/lib/place/exports.d.ts +0 -1
  77. package/lib/place/place-component.d.ts +1 -1
  78. package/lib/place/place-router.d.ts +6 -10
  79. package/package.json +1 -1
  80. package/schematics/aup-i18n/index.js +28 -8
  81. package/schematics/aup-i18n/index.js.map +1 -1
  82. package/schematics/aup-i18n/templates/i18n/aup/components.yml.template +69 -0
  83. package/schematics/bootstrap-app/index.js +4 -5
  84. package/schematics/bootstrap-app/index.js.map +1 -1
  85. package/schematics/bootstrap-app/templates/{i18n.config.json.template → i18n/config.json.template} +0 -2
  86. package/schematics/bootstrap-app/templates/i18n/notifications.yml.template +19 -0
  87. package/schematics/ng-add/index.js +2 -2
  88. package/schematics/ng-add/index.js.map +1 -1
  89. package/schematics/place-add/index.js +5 -4
  90. package/schematics/place-add/index.js.map +1 -1
  91. package/schematics/place-add/templates/component/__name@dasherize__.component.ts.template +1 -3
  92. package/schematics/place-add/templates/files/i18n/places/__name@dasherize__.yml.template +7 -0
  93. package/schematics/utils/build-context.d.ts +5 -4
  94. package/schematics/utils/workspace.d.ts +4 -3
  95. package/schematics/utils/workspace.js.map +1 -1
  96. package/esm2015/lib/place/components/not-authorised-notice/not-authorised-notice.component.js +0 -14
  97. package/esm2015/lib/place/components/not-authorised-notice/not-authorised-notice.component.js.map +0 -1
  98. package/esm2015/lib/place/components/not-authorised-notice/not-authorised-notice.component.metadata.json +0 -1
  99. package/esm2015/lib/place/components/not-authorised-notice/not-authorised-notice.component.ngfactory.js.map +0 -1
  100. package/esm2015/lib/place/components/not-authorised-notice/not-authorised-notice.component.scss.shim.ngstyle.js.map +0 -1
  101. package/lib/place/components/not-authorised-notice/not-authorised-notice.component.d.ts +0 -3
  102. package/schematics/aup-i18n/templates/app/aup.i18n.yml.template +0 -80
  103. package/schematics/place-add/templates/component/__name@dasherize__.i18n.yml.template +0 -5
  104. /package/schematics/bootstrap-app/templates/{src/app → app}/app-routing.module.ts.template +0 -0
  105. /package/schematics/bootstrap-app/templates/{src/app → app}/app.component.html.template +0 -0
  106. /package/schematics/bootstrap-app/templates/{src/app → app}/app.component.scss.template +0 -0
  107. /package/schematics/bootstrap-app/templates/{src/app → app}/app.component.ts.template +0 -0
  108. /package/schematics/bootstrap-app/templates/{src/app → app}/app.module.ts.template +0 -0
  109. /package/schematics/bootstrap-app/templates/{src/app → app}/i18n.ts.template +0 -0
  110. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/MaterialIcons-Regular.eot +0 -0
  111. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/MaterialIcons-Regular.ijmap +0 -0
  112. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/MaterialIcons-Regular.svg +0 -0
  113. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/MaterialIcons-Regular.ttf +0 -0
  114. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/MaterialIcons-Regular.woff +0 -0
  115. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/MaterialIcons-Regular.woff2 +0 -0
  116. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/README.md +0 -0
  117. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/codepoints +0 -0
  118. /package/schematics/bootstrap-app/templates/{src/assets → assets}/fonts/material-design-icons/material-icons.css +0 -0
  119. /package/schematics/bootstrap-app/templates/{src/index.html.template → index.html.template} +0 -0
  120. /package/schematics/bootstrap-app/templates/{src/styles → styles}/global-variables.scss.template +0 -0
  121. /package/schematics/bootstrap-app/templates/{src/styles.scss.template → styles.scss.template} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"decorated-tree-node.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/tree-table/decorated-tree-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,yBAAyB,EAAW,MAAM,mBAAmB,CAAC;AAEvE,MAAM,sBAAsB;IAE1B,YAAqB,MAAwC,EAAW,IAAO;QAA1D,WAAM,GAAN,MAAM,CAAkC;QAAW,SAAI,GAAJ,IAAI,CAAG;IAC/E,CAAC;IAED,IAAI,aAAa;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE,GAAG,EAAE;YACxC,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,iBAAiB,CAAC,UAA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AM,KAAW,iBAAiB,CAIjC;AAJD,WAAiB,iBAAiB;IAChC,SAAgB,UAAU,CAAwB,IAAO;QACvD,OAAO,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,sBAAsB,CAAI,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IACjF,CAAC;IAFe,4BAAU,aAEzB,CAAA;AACH,CAAC,EAJgB,iBAAiB,KAAjB,iBAAiB,QAIjC","sourcesContent":["import { assert, Predicate } from '@coolon/pectin';\nimport { Mixin } from '@coolon/typescript-utilities';\nimport * as _ from 'lodash';\nimport { TreeNode } from './tree-node';\nimport { SelfAndDescendantsVisitor, Visitor } from './visitable.class';\n\nclass DecoratedTreeNodeMixin<T extends TreeNode<T>> {\n\n constructor(readonly parent: DecoratedTreeNode<T> | undefined, readonly node: T) {\n }\n\n get decoratedSelf(): DecoratedTreeNode<T> {\n return this.memoize('decoratedSelf', () => {\n return this.parent ? this.parent.children.find(child => child.node === this.node) : DecoratedTreeNode.createRoot(this.node);\n });\n }\n\n get children(): DecoratedTreeNode<T>[] {\n return this.memoize('children', () => {\n return this.node.children ? this.node.children.map(child => {\n return Mixin.createProxy(child, new DecoratedTreeNodeMixin<T>(this.decoratedSelf, child));\n }) : [];\n });\n }\n\n descendants(): DecoratedTreeNode<T>[] {\n return this.memoize('descendants', () => {\n const result = [];\n this.visitDescendants(child => result.push(child));\n return result;\n });\n }\n\n selfAndDescendants(): DecoratedTreeNode<T>[] {\n return this.memoize('selfAndDescendants', () => {\n const result = [];\n this.visitSelfAndDescendants(child => result.push(child));\n return result;\n });\n }\n\n siblingsBefore(): DecoratedTreeNode<T>[] {\n return this.memoize('siblingsBefore', () => {\n if (this.parent) {\n return this.parent.children.slice(0, this.myIndex());\n } else {\n return [];\n }\n });\n }\n\n siblingsAfter(): DecoratedTreeNode<T>[] {\n return this.memoize('siblingsAfter', () => {\n if (this.parent) {\n return this.parent.children.slice(1 + this.myIndex());\n } else {\n return [];\n }\n });\n }\n\n siblings(): DecoratedTreeNode<T>[] {\n return this.memoize('siblings', () => [].concat(this.siblingsBefore(), this.siblingsAfter()));\n }\n\n isFirstChild(): boolean {\n return this.memoize('isFirstChild', () => this.parent ? this.myIndex() === 0 : false);\n }\n\n protected myIndex() {\n return this.memoize('myIndex', () => {\n const myIndex = this.parent.children.findIndex(child => child.node === this.node);\n assert.isTruthy(myIndex >= 0, 'illegal state, expected index to be >= 0');\n return myIndex;\n });\n }\n\n isLastChild(): boolean {\n return this.memoize('isLastChild', () => {\n return this.parent ? this.myIndex() === this.parent.children.length - 1 : false;\n });\n }\n\n hasSiblings(): boolean {\n return this.parent ? this.node.children.length > 1 : false;\n }\n\n find(predicate: Predicate<DecoratedTreeNode<T>>): DecoratedTreeNode<T> {\n return _.find(this.descendants(), predicate);\n }\n\n select(predicate: Predicate<DecoratedTreeNode<T>>): DecoratedTreeNode<T>[] {\n return _.filter(this.descendants(), predicate);\n }\n\n flattenInto(array: DecoratedTreeNode<T>[]): DecoratedTreeNode<T>[] {\n this.visitSelfAndDescendants(child => array.push(child));\n return array;\n }\n\n ancestors(): DecoratedTreeNode<T>[] {\n return this.memoize('ancestors', () => {\n return this.parent ? this.parent.ancestors().concat([this.parent]) : [];\n });\n }\n\n ancestorsAndSelf(): DecoratedTreeNode<T>[] {\n return this.memoize('ancestorsAndSelf', () => {\n return this.ancestors().concat([(this.decoratedSelf)]);\n });\n }\n\n pathToParent(parent: DecoratedTreeNode<T>): DecoratedTreeNode<T>[] {\n if (this.node === parent.node) {\n return [];\n } else if (this.parent) {\n const pathToParent = this.parent.pathToParent(parent);\n return pathToParent.concat([this.parent]);\n } else {\n throw new Error('parent is not an ancestor');\n }\n }\n\n pathToParentAndSelf(parent): DecoratedTreeNode<T>[] {\n return this.pathToParent(parent).concat([this.decoratedSelf]);\n }\n\n isRoot(): boolean {\n return !this.parent;\n }\n\n get depth(): number {\n return this.isRoot() ? 0 : this.parent.depth + 1;\n }\n\n isLeaf(): boolean {\n return !this.isRoot() && this.node.children.length < 1;\n }\n\n hasChildren(): boolean {\n return this.node.children && this.node.children.length > 0;\n }\n\n depthFromParent(parent): number {\n return this.pathToParent(parent).length;\n }\n\n treeDepth(): number {\n return this.memoize('treeDepth', () => {\n return 1 + this.descendants().map(child => child.depthFromParent(this)).reduce((prev, current) => Math.max(prev, current));\n });\n }\n\n flatten(): DecoratedTreeNode<T>[] {\n return this.memoize('flatten', () => {\n return this.flattenInto([]);\n });\n }\n\n visit<V extends Visitor<DecoratedTreeNode<T>>>(visitor: V): V {\n visitor.visit(this as any as DecoratedTreeNode<T>);\n return visitor;\n }\n\n visitChildren<V extends Visitor<DecoratedTreeNode<T>>>(visitor: V): V {\n _.each(this.children, child => child.visit(visitor));\n return visitor;\n }\n\n visitSelfAndDescendants(callback: (it: DecoratedTreeNode<T>) => void) {\n this.visit(new SelfAndDescendantsVisitor.Each<DecoratedTreeNode<T>>(callback));\n }\n\n visitDescendants(callback: (it: DecoratedTreeNode<T>) => void) {\n this.visitChildren(new SelfAndDescendantsVisitor.Each<DecoratedTreeNode<T>>(callback));\n }\n\n\n protected memoize<V>(property: string, factory: () => V) {\n const key = `__${property}`;\n if (_.isNil(this[key])) {\n this[key] = factory();\n }\n return this[key];\n }\n\n}\n\nexport type DecoratedTreeNode<T extends TreeNode<T>> = Omit<T, 'children'> & DecoratedTreeNodeMixin<T>;\n\nexport namespace DecoratedTreeNode {\n export function createRoot<T extends TreeNode<T>>(node: T): DecoratedTreeNode<T> {\n return Mixin.createProxy(node, new DecoratedTreeNodeMixin<T>(undefined, node));\n }\n}\n"]}
1
+ {"version":3,"file":"decorated-tree-node.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/tree-table/decorated-tree-node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAa,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAErD,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE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O,OAAO,CAAC;IACjB,CAAC;IAED,uBAAuB,CAAC,QAA4C;QAClE,IAAI,CAAC,KAAK,CAAC,IAAI,yBAAyB,CAAC,IAAI,CAAuB,QAAQ,CAAC,CAAC,CAAC;IACjF,CAAC;IAED,gBAAgB,CAAC,QAA4C;QAC3D,IAAI,CAAC,aAAa,CAAC,IAAI,yBAAyB,CAAC,IAAI,CAAuB,QAAQ,CAAC,CAAC,CAAC;IACzF,CAAC;IAGS,OAAO,CAAI,QAAgB,EAAE,OAAgB;QACrD,MAAM,GAAG,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE;YACtB,IAAI,CAAC,GAAG,CAAC,GAAG,OAAO,EAAE,CAAC;SACvB;QACD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC;CAEF;AAID,MAAM,KAAW,iBAAiB,CAIjC;AAJD,WAAiB,iBAAiB;IAChC,SAAgB,UAAU,CAAwB,IAAO;QACvD,OAAO,KAAK,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,sBAAsB,CAAI,SAAS,EAAE,IAAI,CAAC,CAAC,CAAC;IACjF,CAAC;IAFe,4BAAU,aAEzB,CAAA;AACH,CAAC,EAJgB,iBAAiB,KAAjB,iBAAiB,QAIjC","sourcesContent":["import { assert, Predicate } from '@coolon/pectin';\nimport { Mixin } from '@coolon/typescript-utilities';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';\nimport * as _ from 'lodash';\nimport { TreeNode } from './tree-node';\nimport { SelfAndDescendantsVisitor, Visitor } from './visitable.class';\n\nclass DecoratedTreeNodeMixin<T extends TreeNode<T>> {\n\n constructor(readonly parent: DecoratedTreeNode<T> | undefined, readonly node: T) {\n }\n\n get decoratedSelf(): DecoratedTreeNode<T> {\n return this.memoize(\"decoratedSelf\", () => {\n return this.parent ? this.parent.children.find(child => child.node === this.node) : DecoratedTreeNode.createRoot(this.node);\n });\n }\n\n get children(): DecoratedTreeNode<T>[] {\n return this.memoize(\"children\", () => {\n return this.node.children ? this.node.children.map(child => {\n return Mixin.createProxy(child, new DecoratedTreeNodeMixin<T>(this.decoratedSelf, child));\n }) : [];\n });\n }\n\n descendants(): DecoratedTreeNode<T>[] {\n return this.memoize(\"descendants\", () => {\n const result = [];\n this.visitDescendants(child => result.push(child));\n return result;\n });\n }\n\n selfAndDescendants(): DecoratedTreeNode<T>[] {\n return this.memoize(\"selfAndDescendants\", () => {\n const result = [];\n this.visitSelfAndDescendants(child => result.push(child));\n return result;\n });\n }\n\n siblingsBefore(): DecoratedTreeNode<T>[] {\n return this.memoize('siblingsBefore', () => {\n if (this.parent) {\n return this.parent.children.slice(0, this.myIndex());\n } else {\n return [];\n }\n });\n }\n\n siblingsAfter(): DecoratedTreeNode<T>[] {\n return this.memoize('siblingsAfter', () => {\n if (this.parent) {\n return this.parent.children.slice(1 + this.myIndex());\n } else {\n return [];\n }\n });\n }\n\n siblings(): DecoratedTreeNode<T>[] {\n return this.memoize('siblings', () => [].concat(this.siblingsBefore(), this.siblingsAfter()));\n }\n\n isFirstChild(): boolean {\n return this.memoize('isFirstChild', () => this.parent ? this.myIndex() === 0 : false);\n }\n\n protected myIndex() {\n return this.memoize('myIndex', () => {\n const myIndex = this.parent.children.findIndex(child => child.node === this.node);\n assert.isTruthy(myIndex >= 0, 'illegal state, expected index to be >= 0');\n return myIndex;\n });\n }\n\n isLastChild(): boolean {\n return this.memoize('isLastChild', () => {\n return this.parent ? this.myIndex() === this.parent.children.length - 1 : false;\n });\n }\n\n hasSiblings(): boolean {\n return this.parent ? this.node.children.length > 1 : false;\n }\n\n find(predicate: Predicate<DecoratedTreeNode<T>>): DecoratedTreeNode<T> {\n return _.find(this.descendants(), predicate);\n }\n\n select(predicate: Predicate<DecoratedTreeNode<T>>): DecoratedTreeNode<T>[] {\n return _.filter(this.descendants(), predicate);\n }\n\n flattenInto(array: DecoratedTreeNode<T>[]): DecoratedTreeNode<T>[] {\n this.visitSelfAndDescendants(child => array.push(child));\n return array;\n }\n\n ancestors(): DecoratedTreeNode<T>[] {\n return this.memoize('ancestors', () => {\n return this.parent ? this.parent.ancestors().concat([this.parent]) : [];\n });\n }\n\n ancestorsAndSelf(): DecoratedTreeNode<T>[] {\n return this.memoize(\"ancestorsAndSelf\", () => {\n return this.ancestors().concat([(this.decoratedSelf)]);\n })\n }\n\n pathToParent(parent: DecoratedTreeNode<T>): DecoratedTreeNode<T>[] {\n return this.memoize(\"pathToParent\", () => {\n if (this.node === parent.node) {\n return [];\n } else if (this.parent) {\n return this.parent.pathToParent(parent).concat([this.parent]);\n } else {\n throw new Error('parent is not an ancestor');\n }\n })\n }\n\n pathToParentAndSelf(parent): DecoratedTreeNode<T>[] {\n return this.memoize(\"pathToParentAndSelf\", () => {\n return this.pathToParent(parent).concat([this.decoratedSelf]);\n });\n }\n\n isRoot(): boolean {\n return !this.parent;\n }\n\n get depth(): number {\n return this.isRoot() ? 0 : this.parent.depth + 1;\n }\n\n isLeaf(): boolean {\n return !this.isRoot() && this.node.children.length < 1;\n }\n\n hasChildren(): boolean {\n return this.node.children.length > 0;\n }\n\n depthFromParent(parent): number {\n return this.pathToParent(parent).length;\n }\n\n treeDepth(): number {\n return this.memoize(\"treeDepth\", () => {\n return 1 + this.descendants().map(child => child.depthFromParent(this)).reduce((prev, current) => Math.max(prev, current));\n })\n }\n\n flatten(): DecoratedTreeNode<T>[] {\n return this.memoize(\"flatten\", () => {\n return this.flattenInto([]);\n })\n }\n\n visit<V extends Visitor<DecoratedTreeNode<T>>>(visitor: V): V {\n visitor.visit(this as any as DecoratedTreeNode<T>);\n return visitor;\n }\n\n visitChildren<V extends Visitor<DecoratedTreeNode<T>>>(visitor: V): V {\n _.each(this.children, child => child.visit(visitor));\n return visitor;\n }\n\n visitSelfAndDescendants(callback: (it: DecoratedTreeNode<T>) => void) {\n this.visit(new SelfAndDescendantsVisitor.Each<DecoratedTreeNode<T>>(callback));\n }\n\n visitDescendants(callback: (it: DecoratedTreeNode<T>) => void) {\n this.visitChildren(new SelfAndDescendantsVisitor.Each<DecoratedTreeNode<T>>(callback));\n }\n\n\n protected memoize<V>(property: string, factory: () => V) {\n const key = `__${property}`;\n if (_.isNil(this[key])) {\n this[key] = factory();\n }\n return this[key];\n }\n\n}\n\nexport type DecoratedTreeNode<T extends TreeNode<T>> = Omit<T, 'children'> & DecoratedTreeNodeMixin<T>;\n\nexport namespace DecoratedTreeNode {\n export function createRoot<T extends TreeNode<T>>(node: T): DecoratedTreeNode<T> {\n return Mixin.createProxy(node, new DecoratedTreeNodeMixin<T>(undefined, node));\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
- import { Component, HostBinding, Input, ViewEncapsulation } from '@angular/core';
3
- import { StoreInValueModel, TrackExternal, ValueModel } from '@coolon/pectin';
2
+ import { Component, Input, ViewEncapsulation } from '@angular/core';
3
+ import { TrackExternal } from '@coolon/pectin';
4
4
  import { DisposableComponent } from '../disposable-component';
5
5
  import { TreeTableModel } from './tree-table-model';
6
6
  //
@@ -41,18 +41,12 @@ import { TreeTableModel } from './tree-table-model';
41
41
  export class TreeTableComponent extends DisposableComponent {
42
42
  constructor() {
43
43
  super();
44
- /**
45
- * Set to true to enable scrolling. Once enabled the table will have 0 implicit height. You will either
46
- * need to set it explicitly e.g. height: 400px; or by using flex or grid layout to make it fill it's
47
- * containment area.
48
- */
49
- this.enableScrolling = false;
50
44
  }
51
45
  }
52
46
  TreeTableComponent.decorators = [
53
47
  { type: Component, args: [{
54
48
  selector: "aup-tree-table",
55
- template: "<aup-table [tableModel]=\"treeTableModel\" [showHeaderModel]=\"showHeaderModel\" [enableScrolling]=\"enableScrolling\"></aup-table>\n",
49
+ template: "<aup-table [tableModel]=\"treeTableModel\"></aup-table>\n",
56
50
  encapsulation: ViewEncapsulation.None // allow us to target nested table styles
57
51
  ,
58
52
  styles: ["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}"]
@@ -60,21 +54,10 @@ TreeTableComponent.decorators = [
60
54
  ];
61
55
  TreeTableComponent.ctorParameters = () => [];
62
56
  TreeTableComponent.propDecorators = {
63
- treeTableModel: [{ type: Input }],
64
- showHeaderModel: [{ type: Input }],
65
- showHeader: [{ type: Input }],
66
- enableScrolling: [{ type: Input }, { type: HostBinding, args: ['class.enable-scrolling',] }]
57
+ treeTableModel: [{ type: Input }]
67
58
  };
68
59
  __decorate([
69
60
  TrackExternal(),
70
61
  __metadata("design:type", TreeTableModel)
71
62
  ], TreeTableComponent.prototype, "treeTableModel", void 0);
72
- __decorate([
73
- TrackExternal({ defaultValue: true }),
74
- __metadata("design:type", ValueModel)
75
- ], TreeTableComponent.prototype, "showHeaderModel", void 0);
76
- __decorate([
77
- StoreInValueModel('showHeaderModel'),
78
- __metadata("design:type", Boolean)
79
- ], TreeTableComponent.prototype, "showHeader", void 0);
80
63
  //# sourceMappingURL=tree-table-component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tree-table-component.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/tree-table/tree-table-component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,EAAE;AACF,qBAAqB;AACrB,gEAAgE;AAChE,uEAAuE;AACvE,2EAA2E;AAC3E,wEAAwE;AACxE,yDAAyD;AACzD,8CAA8C;AAC9C,EAAE;AACF,wEAAwE;AACxE,+DAA+D;AAC/D,mEAAmE;AACnE,+EAA+E;AAC/E,8FAA8F;AAC9F,EAAE;AACF,0GAA0G;AAC1G,qFAAqF;AACrF,+BAA+B;AAC/B,yDAAyD;AACzD,yDAAyD;AACzD,kDAAkD;AAClD,sEAAsE;AACtE,gEAAgE;AAChE,iBAAiB;AACjB,gBAAgB;AAChB,oGAAoG;AACpG,4CAA4C;AAC5C,2DAA2D;AAC3D,kEAAkE;AAClE,mDAAmD;AACnD,uBAAuB;AACvB,gBAAgB;AAChB,EAAE;AACF,qBAAqB;AACrB,KAAK;AASL,MAAM,OAAO,kBAA0C,SAAQ,mBAAmB;IAyBhF;QACE,KAAK,EAAE,CAAC;QAXV;;;;WAIG;QAGH,oBAAe,GAAG,KAAK,CAAC;IAKxB,CAAC;;;YAjCF,SAAS,SAAC;gBACT,QAAQ,EAAE,gBAAgB;gBAC1B,iJAA0C;gBAE1C,aAAa,EAAE,iBAAiB,CAAC,IAAI,CAAC,yCAAyC;;;aAChF;;;;6BAGE,KAAK;8BAKL,KAAK;yBAIL,KAAK;8BASL,KAAK,YACL,WAAW,SAAC,wBAAwB;;AAjBrC;IADC,aAAa,EAAE;8BACA,cAAc;0DAAI;AAKlC;IADC,aAAa,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC;8BACrB,UAAU;2DAAU;AAIrC;IADC,iBAAiB,CAAC,iBAAiB,CAAC;;sDACjB","sourcesContent":["import { Component, HostBinding, Input, ViewEncapsulation } from '@angular/core';\nimport { StoreInValueModel, TrackExternal, ValueModel } from '@coolon/pectin';\nimport { DisposableComponent } from '../disposable-component';\nimport { TreeNode } from './tree-node';\nimport { TreeTableModel } from './tree-table-model';\n//\n// const template = `\n// <table-component list-model=\"zoneTreeController.visibleAreas\"\n// selection-model=\"zoneTreeController.selectionModel\"\n// selection-command=\"zoneTreeController.selectionCommand\"\n// hover-model=\"zoneTreeController.decoratedHoverModel\"\n// no-hover=\"zoneTreeController.noHover\"\n// no-lines=\"true\" no-scroll>\n//\n// <row-attr name=\"parent-id\" value=\"{{item.parent.id}}\"></row-attr>\n// <row-attr name=\"area-id\" value=\"{{item.id}}\"></row-attr>\n// <row-attr name=\"area-name\" value=\"{{item.name}}\"></row-attr>\n// <row-attr name=\"area-depth\" value=\"{{item.depthFromZone()}}\"></row-attr>\n// <row-attr name=\"collapsed\" value=\"{{zoneTreeController.isCollapsed(item)}}\"></row-attr>\n//\n// <column class=\"area\" ng-class=\"{root: item.isZone(), parent: item.isGroup()}\" class=\"allow-squish\">\n// <!--<label>Rooms in {{zoneTreeController.zoneModel.value.name}}</label>-->\n// <label>Rooms</label>\n// <div layout=\"row\" layout-align=\"start center\">\n// <tree-icons tree-item=\"item\"></tree-icons>\n// <area-icon area=\"item\"></area-icon>\n// <span ng-if=\"item.isZone()\">Zone ({{item.name}})</span>\n// <span ng-if=\"!item.isZone()\">{{item.name}}</span>\n// </div>\n// </column>\n// <column class=\"expand-collapse\" ng-class=\"{collapsed: zoneTreeController.isCollapsed(item)}\">\n// <md-button class=\"md-icon-button\"\n// ng-if=\"zoneTreeController.canCollapse(item)\"\n// ng-click=\"zoneTreeController.toggleCollapse(item)\">\n// <md-icon>keyboard_arrow_up</md-icon>\n// </md-button>\n// </column>\n//\n// </table-component>\n// `;\n\n\n@Component({\n selector: \"aup-tree-table\",\n templateUrl: './tree-table.component.html',\n styleUrls: ['./tree-table.component.scss'],\n encapsulation: ViewEncapsulation.None // allow us to target nested table styles\n})\nexport class TreeTableComponent<T extends TreeNode<T>> extends DisposableComponent {\n\n @Input()\n @TrackExternal()\n treeTableModel: TreeTableModel<T>;\n\n\n @Input()\n @TrackExternal({ defaultValue: true })\n showHeaderModel: ValueModel<boolean>;\n\n @Input()\n @StoreInValueModel('showHeaderModel')\n showHeader: boolean;\n\n /**\n * Set to true to enable scrolling. Once enabled the table will have 0 implicit height. You will either\n * need to set it explicitly e.g. height: 400px; or by using flex or grid layout to make it fill it's\n * containment area.\n */\n @Input()\n @HostBinding('class.enable-scrolling')\n enableScrolling = false;\n\n\n constructor() {\n super();\n }\n\n // zoneTreeModel: TreeModel<T>;\n // noHover: boolean;\n //\n // static compile(tElement, tAttrs, $compile) {\n // const newContent = angular.element(template);\n //\n // // // find methods don't work here... sigh. and this is sensetive to whitespace in the template BEWARE!!\n // // let table = angular.element(newContent[2]);\n //\n // tElement.find('column').each((index, el) => newContent.append(el));\n // tElement.contents().remove();\n //\n // const transclude = $compile(newContent);\n // return (scope, element, attrs, ctrl) => {\n // transclude(scope, function(clone) {\n // element.append(clone);\n // });\n // };\n // }\n //\n // constructor() {\n // super();\n // }\n //\n // get zoneModel() {\n // return this.zoneTreeModel.rootNodeModel;\n // }\n //\n // get visibleAreas() {\n // return this.zoneTreeModel.decoratedVisibleAreas;\n // }\n //\n // get selectionModel() {\n // return this.zoneTreeModel.decoratedSelectionModel;\n // }\n //\n // selectArea(decoratedArea: TreeModel.DecoratedArea) {\n // this.zoneTreeModel.select(decoratedArea);\n // }\n //\n // get decoratedHoverModel() {\n // return this.zoneTreeModel.decoratedHoverModel;\n // }\n //\n // canCollapse(area: TreeModel.DecoratedArea) {\n // // @ts-ignore\n // return area && !area.isZone() && (area.isGroup() && area.hasChildren());\n // }\n //\n // isCollapsed(area: TreeModel.DecoratedArea): boolean {\n // return area && this.zoneTreeModel.isCollapsed(area);\n // }\n //\n // toggleCollapse(area: TreeModel.DecoratedArea) {\n // if (this.isCollapsed(area)) {\n // this.zoneTreeModel.expand(area);\n // } else {\n // this.zoneTreeModel.collapse(area);\n // }\n // }\n\n}\n"]}
1
+ {"version":3,"file":"tree-table-component.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/components/tree-table/tree-table-component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,EAAE;AACF,qBAAqB;AACrB,gEAAgE;AAChE,uEAAuE;AACvE,2EAA2E;AAC3E,wEAAwE;AACxE,yDAAyD;AACzD,8CAA8C;AAC9C,EAAE;AACF,wEAAwE;AACxE,+DAA+D;AAC/D,mEAAmE;AACnE,+EAA+E;AAC/E,8FAA8F;AAC9F,EAAE;AACF,0GAA0G;AAC1G,qFAAqF;AACrF,+BAA+B;AAC/B,yDAAyD;AACzD,yDAAyD;AACzD,kDAAkD;AAClD,sEAAsE;AACtE,gEAAgE;AAChE,iBAAiB;AACjB,gBAAgB;AAChB,oGAAoG;AACpG,4CAA4C;AAC5C,2DAA2D;AAC3D,kEAAkE;AAClE,mDAAmD;AACnD,uBAAuB;AACvB,gBAAgB;AAChB,EAAE;AACF,qBAAqB;AACrB,KAAK;AASL,MAAM,OAAO,kBAA0C,SAAQ,mBAAmB;IAMhF;QACE,KAAK,EAAE,CAAC;IACV,CAAC;;;YAdF,SAAS,SAAC;gBACT,QAAQ,EAAE,gBAAgB;gBAC1B,qEAA0C;gBAE1C,aAAa,EAAE,iBAAiB,CAAC,IAAI,CAAC,yCAAyC;;;aAChF;;;;6BAGE,KAAK;;AAEN;IADC,aAAa,EAAE;8BACA,cAAc;0DAAI","sourcesContent":["import { Component, Input, ViewEncapsulation } from '@angular/core';\nimport { TrackExternal } from '@coolon/pectin';\nimport { DisposableComponent } from '../disposable-component';\nimport { TreeNode } from './tree-node';\nimport { TreeTableModel } from './tree-table-model';\n//\n// const template = `\n// <table-component list-model=\"zoneTreeController.visibleAreas\"\n// selection-model=\"zoneTreeController.selectionModel\"\n// selection-command=\"zoneTreeController.selectionCommand\"\n// hover-model=\"zoneTreeController.decoratedHoverModel\"\n// no-hover=\"zoneTreeController.noHover\"\n// no-lines=\"true\" no-scroll>\n//\n// <row-attr name=\"parent-id\" value=\"{{item.parent.id}}\"></row-attr>\n// <row-attr name=\"area-id\" value=\"{{item.id}}\"></row-attr>\n// <row-attr name=\"area-name\" value=\"{{item.name}}\"></row-attr>\n// <row-attr name=\"area-depth\" value=\"{{item.depthFromZone()}}\"></row-attr>\n// <row-attr name=\"collapsed\" value=\"{{zoneTreeController.isCollapsed(item)}}\"></row-attr>\n//\n// <column class=\"area\" ng-class=\"{root: item.isZone(), parent: item.isGroup()}\" class=\"allow-squish\">\n// <!--<label>Rooms in {{zoneTreeController.zoneModel.value.name}}</label>-->\n// <label>Rooms</label>\n// <div layout=\"row\" layout-align=\"start center\">\n// <tree-icons tree-item=\"item\"></tree-icons>\n// <area-icon area=\"item\"></area-icon>\n// <span ng-if=\"item.isZone()\">Zone ({{item.name}})</span>\n// <span ng-if=\"!item.isZone()\">{{item.name}}</span>\n// </div>\n// </column>\n// <column class=\"expand-collapse\" ng-class=\"{collapsed: zoneTreeController.isCollapsed(item)}\">\n// <md-button class=\"md-icon-button\"\n// ng-if=\"zoneTreeController.canCollapse(item)\"\n// ng-click=\"zoneTreeController.toggleCollapse(item)\">\n// <md-icon>keyboard_arrow_up</md-icon>\n// </md-button>\n// </column>\n//\n// </table-component>\n// `;\n\n\n@Component({\n selector: \"aup-tree-table\",\n templateUrl: './tree-table.component.html',\n styleUrls: ['./tree-table.component.scss'],\n encapsulation: ViewEncapsulation.None // allow us to target nested table styles\n})\nexport class TreeTableComponent<T extends TreeNode<T>> extends DisposableComponent {\n\n @Input()\n @TrackExternal()\n treeTableModel: TreeTableModel<T>;\n\n constructor() {\n super();\n }\n\n // zoneTreeModel: TreeModel<T>;\n // noHover: boolean;\n //\n // static compile(tElement, tAttrs, $compile) {\n // const newContent = angular.element(template);\n //\n // // // find methods don't work here... sigh. and this is sensetive to whitespace in the template BEWARE!!\n // // let table = angular.element(newContent[2]);\n //\n // tElement.find('column').each((index, el) => newContent.append(el));\n // tElement.contents().remove();\n //\n // const transclude = $compile(newContent);\n // return (scope, element, attrs, ctrl) => {\n // transclude(scope, function(clone) {\n // element.append(clone);\n // });\n // };\n // }\n //\n // constructor() {\n // super();\n // }\n //\n // get zoneModel() {\n // return this.zoneTreeModel.rootNodeModel;\n // }\n //\n // get visibleAreas() {\n // return this.zoneTreeModel.decoratedVisibleAreas;\n // }\n //\n // get selectionModel() {\n // return this.zoneTreeModel.decoratedSelectionModel;\n // }\n //\n // selectArea(decoratedArea: TreeModel.DecoratedArea) {\n // this.zoneTreeModel.select(decoratedArea);\n // }\n //\n // get decoratedHoverModel() {\n // return this.zoneTreeModel.decoratedHoverModel;\n // }\n //\n // canCollapse(area: TreeModel.DecoratedArea) {\n // // @ts-ignore\n // return area && !area.isZone() && (area.isGroup() && area.hasChildren());\n // }\n //\n // isCollapsed(area: TreeModel.DecoratedArea): boolean {\n // return area && this.zoneTreeModel.isCollapsed(area);\n // }\n //\n // toggleCollapse(area: TreeModel.DecoratedArea) {\n // if (this.isCollapsed(area)) {\n // this.zoneTreeModel.expand(area);\n // } else {\n // this.zoneTreeModel.collapse(area);\n // }\n // }\n\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"TreeTableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../disposable-component","name":"DisposableComponent","line":48,"character":63},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":42,"character":1},"arguments":[{"selector":"aup-tree-table","encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation","line":46,"character":17},"member":"None"},"template":"<aup-table [tableModel]=\"treeTableModel\" [showHeaderModel]=\"showHeaderModel\" [enableScrolling]=\"enableScrolling\"></aup-table>\n","styles":["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":50,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":51,"character":3}}]}],"showHeaderModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":55,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":56,"character":3},"arguments":[{"defaultValue":true}]}]}],"showHeader":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":59,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":60,"character":3},"arguments":["showHeaderModel"]}]}],"enableScrolling":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":68,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":69,"character":3},"arguments":["class.enable-scrolling"]}]}],"__ctor__":[{"__symbolic":"constructor"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"TreeTableComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../disposable-component","name":"DisposableComponent","line":48,"character":63},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":42,"character":1},"arguments":[{"selector":"aup-tree-table","encapsulation":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewEncapsulation","line":46,"character":17},"member":"None"},"template":"<aup-table [tableModel]=\"treeTableModel\"></aup-table>\n","styles":["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":50,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":51,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}]}}}}]
@@ -14,36 +14,23 @@ export class AbstractPlaceNavigationComponent extends DisposableComponent {
14
14
  super();
15
15
  this.placeRouter = placeRouter;
16
16
  this._activePlaceComponent = new DelegatingValueModel();
17
- this.trackByPlaceDef = (data) => data.place;
18
17
  const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
19
18
  this.placeDefinitions = chain(this.placesModel)
20
19
  .map(c => PlaceComponent.getDefinition(c))
21
20
  .select(d => {
22
21
  const guard = placeRouter.accessGuard.value;
23
- const state = placeRouter.state.value;
24
- return guard.isAuthorised(d) || state.isPlaceActive(d);
25
- }, { dependsOn: [placeRouter.accessGuard, placeRouter.state] });
22
+ return guard.isAuthorised(d);
23
+ }, { dependsOn: placeRouter.accessGuard });
26
24
  this.commandFactory = Command.createFactory((placeDefinition) => {
27
25
  this.placeOutlet.navigate(new Visit(placeDefinition));
28
26
  });
29
- when(this.placeOutletModel).changes(outlet => this.handlePlaceOutLetChanged(outlet), { initialValue: "triggerChange" });
30
- this.activePlaceDefinition = chain(this._activePlaceComponent).pluck('placeDefinition');
31
- this.menuItems = chain(this.placeDefinitions).map(d => {
32
- return {
33
- place: d,
34
- active: this.activePlaceDefinition.value === d
35
- };
36
- }, {
37
- dependsOn: this.activePlaceDefinition
27
+ when(this.placeOutletModel).changes(outlet => {
28
+ // NOTE: this updates during a change cycle and causes our isActiveMethod to return 2 different
29
+ // values in the one change detection cycle. So instead we delay the update to a different
30
+ // tick.
31
+ setTimeout(() => this._activePlaceComponent.setDelegate(outlet ? outlet.activePlaceModel : null));
38
32
  });
39
- // const txo = new TransactionObserver({ verbose: true }).onEvent(e => console.log(e.name, e.payload));
40
- // txo.observe('this.placesModel', this.placesModel);
41
- // txo.observe('this.placeDefinitions', this.placeDefinitions);
42
- // txo.observe('this.activePlaceDefinition', this.activePlaceDefinition);
43
- // txo.observe('this.menuItems', this.menuItems);
44
- }
45
- handlePlaceOutLetChanged(outlet) {
46
- this._activePlaceComponent.setDelegate(outlet ? outlet.activePlaceModel : null);
33
+ this.activePlaceDefinition = chain(this._activePlaceComponent).pluck('placeDefinition');
47
34
  }
48
35
  getNavigationFace(placeDef) {
49
36
  const navItem = placeDef.getPlaceData('nav');
@@ -53,6 +40,9 @@ export class AbstractPlaceNavigationComponent extends DisposableComponent {
53
40
  icon: () => navItem && navItem.icon ? navItem.icon() : placeDef.getPlaceData('navIcon', null)
54
41
  };
55
42
  }
43
+ isActive(place) {
44
+ return this.activePlaceDefinition.query().equals(place);
45
+ }
56
46
  ngOnInit() {
57
47
  }
58
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"abstract-place-navigation.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/place/components/abstract-place-navigation.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AACzD,OAAO,EACL,OAAO,EAEP,oBAAoB,EACpB,GAAG,EACH,SAAS,EAET,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EAEb,UAAU,EAEX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAG5E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAU7E,MAAM,OAAO,gCAAiC,SAAQ,mBAAmB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AC,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC;SAC9F,CAAC;IACJ,CAAC;IAED,QAAQ;IACR,CAAC;;;YA5EF,SAAS,SAAC;gBACT,QAAQ,EAAE,EAAE;aACb;;;YAXQ,WAAW;;;qBAcjB,KAAK;0BAGL,KAAK;0BAIL,KAAK;+BAGL,KAAK;;AATN;IADU,gBAAgB,CAAC,aAAa,CAAC;;gEACD;AAGxC;IADU,aAAa,EAAE;8BACZ,SAAS;qEAAgC;AAItD;IADU,iBAAiB,CAAC,kBAAkB,CAAC;8BAClC,oBAAoB;qEAAC;AAGlC;IADU,aAAa,EAAE;8BACP,UAAU;0EAAuB;AAkDnD;IADC,OAAO,EAAE;;qCACkB,eAAe;;yEAO1C","sourcesContent":["import { Component, Input, OnInit } from '@angular/core';\nimport {\n Command,\n Constructable,\n DelegatingValueModel,\n Dsl,\n ListModel,\n ListModelChain,\n StoreInListModel,\n StoreInValueModel,\n TrackExternal,\n TransactionObserver,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';\nimport { CommandFace } from '../../components/commands/command-face';\nimport { DisposableComponent } from '../../components/disposable-component';\nimport { TrackBy } from '../../components/track-by';\nimport { NavItem } from '../nav-item';\nimport { PlaceComponent } from '../place-component';\nimport { PlaceDefinition } from '../place-definition';\nimport { PlaceRouter } from '../place-router';\nimport { Visit } from '../visit';\nimport { PlaceOutletComponent } from './place-outlet/place-outlet.component';\n\ninterface MenuItem {\n active: boolean;\n place: PlaceDefinition\n}\n\n@Component({\n template: ''\n})\nexport class AbstractPlaceNavigationComponent extends DisposableComponent implements OnInit {\n\n @Input() @StoreInListModel('placesModel')\n places: Constructable<PlaceComponent>[];\n\n @Input() @TrackExternal()\n placesModel: ListModel<Constructable<PlaceComponent>>;\n\n\n @Input() @StoreInValueModel('placeOutletModel')\n placeOutlet: PlaceOutletComponent;\n\n @Input() @TrackExternal()\n placeOutletModel: ValueModel<PlaceOutletComponent>;\n\n private readonly placeDefinitions: ListModelChain<PlaceDefinition>;\n readonly menuItems: ListModelChain<MenuItem>;\n\n readonly commandFactory: Command.Factory<PlaceDefinition, void>;\n readonly _activePlaceComponent = new DelegatingValueModel<PlaceComponent>();\n private activePlaceDefinition: ValueModelChain<PlaceDefinition>;\n\n readonly trackByPlaceDef = (data:MenuItem) => data.place;\n\n constructor(readonly placeRouter: PlaceRouter) {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this.placeDefinitions = chain(this.placesModel)\n .map(c => PlaceComponent.getDefinition(c))\n .select(d => {\n const guard = placeRouter.accessGuard.value;\n const state = placeRouter.state.value;\n return guard.isAuthorised(d) || state.isPlaceActive(d);\n }, { dependsOn: [placeRouter.accessGuard, placeRouter.state] });\n\n this.commandFactory = Command.createFactory((placeDefinition: PlaceDefinition) => {\n this.placeOutlet.navigate(new Visit(placeDefinition));\n });\n\n when(this.placeOutletModel).changes(outlet => this.handlePlaceOutLetChanged(outlet), {initialValue: \"triggerChange\"});\n this.activePlaceDefinition = chain(this._activePlaceComponent).pluck('placeDefinition');\n\n this.menuItems = chain(this.placeDefinitions).map(d => {\n return {\n place: d,\n active: this.activePlaceDefinition.value === d\n };\n }, {\n dependsOn: this.activePlaceDefinition\n });\n\n // const txo = new TransactionObserver({ verbose: true }).onEvent(e => console.log(e.name, e.payload));\n // txo.observe('this.placesModel', this.placesModel);\n // txo.observe('this.placeDefinitions', this.placeDefinitions);\n // txo.observe('this.activePlaceDefinition', this.activePlaceDefinition);\n // txo.observe('this.menuItems', this.menuItems);\n }\n\n protected handlePlaceOutLetChanged(outlet: PlaceOutletComponent) {\n this._activePlaceComponent.setDelegate(outlet ? outlet.activePlaceModel : null)\n }\n\n @Memoize()\n getNavigationFace(placeDef: PlaceDefinition): CommandFace {\n const navItem = placeDef.getPlaceData('nav') as NavItem;\n return {\n text: () => navItem ? navItem.title() : placeDef.searchPlaceData(['navTitle', 'title']),\n tooltip: () => navItem && navItem.tooltip ? navItem.tooltip() : placeDef.getPlaceData('navTooltip', null),\n icon: () => navItem && navItem.icon ? navItem.icon() : placeDef.getPlaceData('navIcon', null)\n };\n }\n\n ngOnInit() {\n }\n\n}\n"]}
1
+ {"version":3,"file":"abstract-place-navigation.component.js","sourceRoot":"","sources":["../../../../../../../libs/angular-ui-powerups/src/lib/place/components/abstract-place-navigation.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AACzD,OAAO,EACL,OAAO,EAEP,oBAAoB,EACpB,GAAG,EACH,SAAS,EAET,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,UAAU,EAEX,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,kDAAkD,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAE5E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAK7E,MAAM,OAAO,gCAAiC,SAAQ,mBAAmB;IAqBvE,YAAqB,WAAwB;QAC3C,KAAK,EAAE,CAAC;QADW,gBAAW,GAAX,WAAW,CAAa;QAHpC,0BAAqB,GAAG,IAAI,oBAAoB,EAAkB,CAAC;QAK1E,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACzF,IAAI,CAAC,gBAAgB,GAAG,KAAK,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ACvF,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC;YACzG,IAAI,EAAE,GAAG,EAAE,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,SAAS,EAAE,IAAI,CAAC;SAC9F,CAAC;IACJ,CAAC;IAED,QAAQ,CAAC,KAAsB;QAC7B,OAAO,IAAI,CAAC,qBAAqB,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC1D,CAAC;IAED,QAAQ;IACR,CAAC;;;YA/DF,SAAS,SAAC;gBACT,QAAQ,EAAE,EAAE;aACb;;;YANQ,WAAW;;;qBASjB,KAAK;0BAGL,KAAK;0BAIL,KAAK;+BAGL,KAAK;;AATN;IADU,gBAAgB,CAAC,aAAa,CAAC;;gEACD;AAGxC;IADU,aAAa,EAAE;8BACZ,SAAS;qEAAgC;AAItD;IADU,iBAAiB,CAAC,kBAAkB,CAAC;8BAClC,oBAAoB;qEAAC;AAGlC;IADU,aAAa,EAAE;8BACP,UAAU;0EAAuB;AAiCnD;IADC,OAAO,EAAE;;qCACkB,eAAe;;yEAO1C","sourcesContent":["import { Component, Input, OnInit } from '@angular/core';\nimport {\n Command,\n Constructable,\n DelegatingValueModel,\n Dsl,\n ListModel,\n ListModelChain,\n StoreInListModel,\n StoreInValueModel,\n TrackExternal, TransactionObserver,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';\nimport { CommandFace } from '../../components/commands/command-face';\nimport { DisposableComponent } from '../../components/disposable-component';\nimport { NavItem } from '../nav-item';\nimport { PlaceComponent } from '../place-component';\nimport { PlaceDefinition } from '../place-definition';\nimport { PlaceRouter } from '../place-router';\nimport { Visit } from '../visit';\nimport { PlaceOutletComponent } from './place-outlet/place-outlet.component';\n\n@Component({\n template: ''\n})\nexport class AbstractPlaceNavigationComponent extends DisposableComponent implements OnInit {\n\n @Input() @StoreInListModel('placesModel')\n places: Constructable<PlaceComponent>[];\n\n @Input() @TrackExternal()\n placesModel: ListModel<Constructable<PlaceComponent>>;\n\n\n @Input() @StoreInValueModel('placeOutletModel')\n placeOutlet: PlaceOutletComponent;\n\n @Input() @TrackExternal()\n placeOutletModel: ValueModel<PlaceOutletComponent>;\n\n readonly placeDefinitions: ListModelChain<PlaceDefinition>;\n\n readonly commandFactory: Command.Factory<PlaceDefinition, void>;\n readonly _activePlaceComponent = new DelegatingValueModel<PlaceComponent>();\n private activePlaceDefinition: ValueModelChain<PlaceDefinition>;\n\n constructor(readonly placeRouter: PlaceRouter) {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n this.placeDefinitions = chain(this.placesModel)\n .map(c => PlaceComponent.getDefinition(c))\n .select(d => {\n const guard = placeRouter.accessGuard.value;\n return guard.isAuthorised(d);\n }, { dependsOn: placeRouter.accessGuard });\n\n this.commandFactory = Command.createFactory((placeDefinition: PlaceDefinition) => {\n this.placeOutlet.navigate(new Visit(placeDefinition));\n });\n\n when(this.placeOutletModel).changes(outlet => {\n // NOTE: this updates during a change cycle and causes our isActiveMethod to return 2 different\n // values in the one change detection cycle. So instead we delay the update to a different\n // tick.\n setTimeout(() => this._activePlaceComponent.setDelegate(outlet ? outlet.activePlaceModel : null));\n });\n this.activePlaceDefinition = chain(this._activePlaceComponent).pluck('placeDefinition');\n }\n\n\n @Memoize()\n getNavigationFace(placeDef: PlaceDefinition): CommandFace {\n const navItem = placeDef.getPlaceData('nav') as NavItem;\n return {\n text: () => navItem ? navItem.title() : placeDef.searchPlaceData(['navTitle', 'title']),\n tooltip: () => navItem && navItem.tooltip ? navItem.tooltip() : placeDef.getPlaceData('navTooltip', null),\n icon: () => navItem && navItem.icon ? navItem.icon() : placeDef.getPlaceData('navIcon', null)\n };\n }\n\n isActive(place: PlaceDefinition): boolean {\n return this.activePlaceDefinition.query().equals(place);\n }\n\n ngOnInit() {\n }\n\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"AbstractPlaceNavigationComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../components/disposable-component","name":"DisposableComponent","line":34,"character":54},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":31,"character":1},"arguments":[{"template":""}]}],"members":{"places":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInListModel","line":36,"character":12},"arguments":["placesModel"]}]}],"placesModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":39,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":39,"character":12}}]}],"placeOutlet":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":43,"character":12},"arguments":["placeOutletModel"]}]}],"placeOutletModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":46,"character":12}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../place-router","name":"PlaceRouter","line":58,"character":36}]}],"handlePlaceOutLetChanged":[{"__symbolic":"method"}],"getNavigationFace":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator/dist/src","name":"Memoize","line":96,"character":3}}]}],"ngOnInit":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"AbstractPlaceNavigationComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../components/disposable-component","name":"DisposableComponent","line":27,"character":54},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":24,"character":1},"arguments":[{"template":""}]}],"members":{"places":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":29,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInListModel","line":29,"character":12},"arguments":["placesModel"]}]}],"placesModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":32,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":32,"character":12}}]}],"placeOutlet":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":36,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":36,"character":12},"arguments":["placeOutletModel"]}]}],"placeOutletModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":39,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":39,"character":12}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../place-router","name":"PlaceRouter","line":48,"character":36}]}],"getNavigationFace":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator/dist/src","name":"Memoize","line":72,"character":3}}]}],"isActive":[{"__symbolic":"method"}],"ngOnInit":[{"__symbolic":"method"}]}}}}]
@@ -9,7 +9,7 @@ export class ListPlaceNavComponent extends AbstractPlaceNavigationComponent {
9
9
  ListPlaceNavComponent.decorators = [
10
10
  { type: Component, args: [{
11
11
  selector: 'aup-list-place-nav',
12
- template: "<mat-nav-list fxFlex>\n <a mat-list-item *ngFor=\"let item of menuItems.value; trackBy: trackByPlaceDef\"\n [pectinCommand]=\"commandFactory.create(item.place)\"\n [class.active]=\"item.active\"\n [matTooltip]=\"getNavigationFace(item.place).tooltip()\">\n <aup-command-face [faces]=\"[getNavigationFace(item.place)]\"></aup-command-face>\n </a>\n</mat-nav-list>\n",
12
+ template: "<mat-nav-list fxFlex>\n <a mat-list-item *ngFor=\"let placeDefinition of placeDefinitions.value\"\n [pectinCommand]=\"commandFactory.create(placeDefinition)\"\n [class.active]=\"isActive(placeDefinition)\"\n [matTooltip]=\"getNavigationFace(placeDefinition).tooltip()\">\n <aup-command-face [faces]=\"[getNavigationFace(placeDefinition)]\"></aup-command-face>\n </a>\n</mat-nav-list>\n",
13
13
  styles: [":host{display:flex;flex-direction:column;--selected-border-color:#838383;--selected-color:inherit;--selected-background:#f1f1f1}mat-nav-list{padding-top:0}a{border-right:2px solid transparent}a.active{border-right:2px solid var(--selected-border-color);background:var(--selected-background);color:var(--selected-color)}"]
14
14
  },] }
15
15
  ];
@@ -1 +1 @@
1
- {"version":3,"file":"list-place-nav.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/place/components/list-place-nav/list-place-nav.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAO1F,MAAM,OAAO,qBAAsB,SAAQ,gCAAgC;IAEzE,YAAY,MAAmB;QAC7B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;;;YATF,SAAS,SAAC;gBACT,QAAQ,EAAE,oBAAoB;gBAC9B,yYAA8C;;aAE/C;;;YAPQ,WAAW","sourcesContent":["import { Component } from '@angular/core';\nimport { PlaceRouter } from '../../place-router';\nimport { AbstractPlaceNavigationComponent } from '../abstract-place-navigation.component';\n\n@Component({\n selector: 'aup-list-place-nav',\n templateUrl: './list-place-nav.component.html',\n styleUrls: ['./list-place-nav.component.scss']\n})\nexport class ListPlaceNavComponent extends AbstractPlaceNavigationComponent {\n\n constructor(router: PlaceRouter) {\n super(router);\n }\n}\n"]}
1
+ {"version":3,"file":"list-place-nav.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/place/components/list-place-nav/list-place-nav.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAO1F,MAAM,OAAO,qBAAsB,SAAQ,gCAAgC;IAEzE,YAAY,MAAmB;QAC7B,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;;;YATF,SAAS,SAAC;gBACT,QAAQ,EAAE,oBAAoB;gBAC9B,8ZAA8C;;aAE/C;;;YAPQ,WAAW","sourcesContent":["import { Component } from '@angular/core';\nimport { PlaceRouter } from '../../place-router';\nimport { AbstractPlaceNavigationComponent } from '../abstract-place-navigation.component';\n\n@Component({\n selector: 'aup-list-place-nav',\n templateUrl: './list-place-nav.component.html',\n styleUrls: ['./list-place-nav.component.scss']\n})\nexport class ListPlaceNavComponent extends AbstractPlaceNavigationComponent {\n\n constructor(router: PlaceRouter) {\n super(router);\n }\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"ListPlaceNavComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-place-navigation.component","name":"AbstractPlaceNavigationComponent","line":9,"character":43},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"aup-list-place-nav","template":"<mat-nav-list fxFlex>\n <a mat-list-item *ngFor=\"let item of menuItems.value; trackBy: trackByPlaceDef\"\n [pectinCommand]=\"commandFactory.create(item.place)\"\n [class.active]=\"item.active\"\n [matTooltip]=\"getNavigationFace(item.place).tooltip()\">\n <aup-command-face [faces]=\"[getNavigationFace(item.place)]\"></aup-command-face>\n </a>\n</mat-nav-list>\n","styles":[":host{display:flex;flex-direction:column;--selected-border-color:#838383;--selected-color:inherit;--selected-background:#f1f1f1}mat-nav-list{padding-top:0}a{border-right:2px solid transparent}a.active{border-right:2px solid var(--selected-border-color);background:var(--selected-background);color:var(--selected-color)}"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../place-router","name":"PlaceRouter","line":11,"character":22}]}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"ListPlaceNavComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-place-navigation.component","name":"AbstractPlaceNavigationComponent","line":9,"character":43},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":4,"character":1},"arguments":[{"selector":"aup-list-place-nav","template":"<mat-nav-list fxFlex>\n <a mat-list-item *ngFor=\"let placeDefinition of placeDefinitions.value\"\n [pectinCommand]=\"commandFactory.create(placeDefinition)\"\n [class.active]=\"isActive(placeDefinition)\"\n [matTooltip]=\"getNavigationFace(placeDefinition).tooltip()\">\n <aup-command-face [faces]=\"[getNavigationFace(placeDefinition)]\"></aup-command-face>\n </a>\n</mat-nav-list>\n","styles":[":host{display:flex;flex-direction:column;--selected-border-color:#838383;--selected-color:inherit;--selected-background:#f1f1f1}mat-nav-list{padding-top:0}a{border-right:2px solid transparent}a.active{border-right:2px solid var(--selected-border-color);background:var(--selected-background);color:var(--selected-color)}"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"../../place-router","name":"PlaceRouter","line":11,"character":22}]}]}}}}]
@@ -1,22 +1,18 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
- import { ComponentPortal } from '@angular/cdk/portal';
3
- import { ChangeDetectorRef, Component, EventEmitter, HostBinding, Inject, InjectionToken, Input, Optional, Output, SkipSelf, ViewChild } from '@angular/core';
2
+ import { Component, EventEmitter, Inject, Input, Optional, Output, SkipSelf, ViewChild } from '@angular/core';
4
3
  import { Router, RouterOutlet } from '@angular/router';
5
4
  import { DebugContext, Dsl, lang, ListModel, MutableValueModel, StoreInListModel, StoreInValueModel, TrackExternal, ValueModel } from '@coolon/pectin';
6
5
  import * as _ from 'lodash';
7
6
  import { DisposableComponent } from '../../../components/disposable-component';
8
7
  import { AUP_PLACE_CONFIG } from '../../place-config';
9
8
  import { PlaceRouter } from '../../place-router';
10
- import { NotAuthorisedNoticeComponent } from '../not-authorised-notice/not-authorised-notice.component';
11
9
  import { LEFT_RIGHT_PLACE_ANIMATION } from './route-animations';
12
- export const AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT = new InjectionToken('AUP_UNAUTHORISED_PLACE_COMPONENT');
13
10
  export class PlaceOutletComponent extends DisposableComponent {
14
- constructor(router, placeRouter, placeConfig, unauthorisedPlaceNotice, parentOutlet, cdr) {
11
+ constructor(router, placeRouter, placeConfig, parentOutlet) {
15
12
  super();
16
13
  this.router = router;
17
14
  this.placeRouter = placeRouter;
18
15
  this.placeConfig = placeConfig;
19
- this.cdr = cdr;
20
16
  this.placeChanged = new EventEmitter();
21
17
  this.outletActivated = new MutableValueModel(false);
22
18
  this._activatedRouteModel = new MutableValueModel();
@@ -49,7 +45,7 @@ export class PlaceOutletComponent extends DisposableComponent {
49
45
  this.animationEnabled = valueOf.all(this.animateModel, this.animationSupported).areTruthy();
50
46
  // Extract our visit model from the place router.
51
47
  this._activePlaceDefinition = chain(this._activePlaceModel).pluck('placeDefinition');
52
- this.routerVisitModel = chain(placeRouter.state).map(state => state.getVisitFor(this._activePlaceDefinition.value), { dependsOn: this._activePlaceDefinition });
48
+ this.routerVisitModel = this._activePlaceDefinition.findIn(chain(placeRouter.activeVisitsByPlaceDefinition));
53
49
  this.navigationInProgress = chain(this.placeRouter.navigationInProgress);
54
50
  when(this.navigationInProgress).becomesFalsey(() => {
55
51
  this.checkStateAndInitialise();
@@ -60,11 +56,13 @@ export class PlaceOutletComponent extends DisposableComponent {
60
56
  chain(this._activePlaceModel)
61
57
  .postponeWhile(this.navigationInProgress)
62
58
  .subscribe(place => this.placeChanged.emit(place));
63
- this.authorised = chain(placeRouter.accessGuard).map(guard => guard.isAuthorised(this._activePlaceDefinition.value), {
64
- dependsOn: this._activePlaceDefinition,
65
- postponeWhile: chain(this._activePlaceDefinition).isNil()
66
- }).otherwise(true); // if we don't have a place def yet we need to show the outlet so we get one injected.
67
- this.notAuthorisedNoticePortal = new ComponentPortal(unauthorisedPlaceNotice !== null && unauthorisedPlaceNotice !== void 0 ? unauthorisedPlaceNotice : NotAuthorisedNoticeComponent);
59
+ when(placeRouter.accessGuard).changes(guard => {
60
+ const activePlace = this._activePlaceModel.value;
61
+ if (activePlace && !guard.isAuthorised(activePlace.placeDefinition)) {
62
+ const visit = placeRouter.getAuthorisationFailureRedirect(this._activatedRouteModel.value.snapshot, this.router.routerState.snapshot);
63
+ this.placeRouter.navigate(visit);
64
+ }
65
+ });
68
66
  }
69
67
  // @Trace()
70
68
  ngOnInit() {
@@ -76,9 +74,6 @@ export class PlaceOutletComponent extends DisposableComponent {
76
74
  get animationDuration() {
77
75
  return this.placeConfig && this.placeConfig.animationDuration ? this.placeConfig.animationDuration : '500ms';
78
76
  }
79
- get isAuthorised() {
80
- return this.authorised.value;
81
- }
82
77
  // @Trace()
83
78
  navigate(visit) {
84
79
  // const place = this.placesInAnimationOrder.query().findMatching(p => visit.placeDefinition.component === p);
@@ -133,7 +128,6 @@ export class PlaceOutletComponent extends DisposableComponent {
133
128
  lang.illegalState('wrong visit!!!');
134
129
  }
135
130
  this.initialisePlace(routerVisit, activePlace);
136
- this.cdr.detectChanges();
137
131
  }
138
132
  }
139
133
  initialisePlace(routerVisit, activePlace) {
@@ -184,18 +178,16 @@ export class PlaceOutletComponent extends DisposableComponent {
184
178
  PlaceOutletComponent.decorators = [
185
179
  { type: Component, args: [{
186
180
  selector: 'aup-place-outlet',
187
- 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",
181
+ template: "<ng-container *ngIf=\"animationEnabled.value\">\n <div class=\"router-outlet-container\" cdkScrollable\n [@routeAnimations]=\"{value: getAnimationOrder(), params:{duration: animationDuration}}\"\n (@routeAnimations.start)=\"animationStarted()\"\n (@routeAnimations.done)=\"animationDone()\"\n >\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated(routerOutlet, $event)\"\n (deactivate)=\"onOutletDeactivated()\">\n </router-outlet>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"!animationEnabled.value\">\n <div class=\"router-outlet-container\" cdkScrollable>\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated(routerOutlet, $event)\"\n (deactivate)=\"onOutletDeactivated()\">\n </router-outlet>\n </div>\n</ng-container>\n\n",
188
182
  animations: [LEFT_RIGHT_PLACE_ANIMATION],
189
- 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:scroll}router-outlet{display:none}.not-authorised-component-container{flex:1;display:grid;grid-template-columns:1fr;grid-template-rows:1fr}"]
183
+ styles: [":host{display:flex;flex-direction:column;min-height:0}.router-outlet-container{flex:1;display:block;position:relative;min-height:0;overflow-x:hidden;overflow-y:scroll}router-outlet{display:none}"]
190
184
  },] }
191
185
  ];
192
186
  PlaceOutletComponent.ctorParameters = () => [
193
187
  { type: Router },
194
188
  { type: PlaceRouter },
195
189
  { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [AUP_PLACE_CONFIG,] }] },
196
- { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [AUP_UNAUTHORISED_PLACE_NOTICE_COMPONENT,] }] },
197
- { type: PlaceOutletComponent, decorators: [{ type: SkipSelf }, { type: Optional }] },
198
- { type: ChangeDetectorRef }
190
+ { type: PlaceOutletComponent, decorators: [{ type: SkipSelf }, { type: Optional }] }
199
191
  ];
200
192
  PlaceOutletComponent.propDecorators = {
201
193
  animate: [{ type: Input }],
@@ -203,8 +195,7 @@ PlaceOutletComponent.propDecorators = {
203
195
  customPlaceAnimationOrderModel: [{ type: Input, args: ['placeAnimationOrderModel',] }],
204
196
  customPlaceAnimationOrder: [{ type: Input, args: ['placeAnimationOrder',] }],
205
197
  placeChanged: [{ type: Output }],
206
- routerOut: [{ type: ViewChild, args: ['routeOutlet', { static: true },] }],
207
- isAuthorised: [{ type: HostBinding, args: ["class.authorised",] }]
198
+ routerOut: [{ type: ViewChild, args: ['routeOutlet', { static: true },] }]
208
199
  };
209
200
  __decorate([
210
201
  StoreInValueModel('animateModel'),
@@ -1 +1 @@
1
- {"version":3,"file":"place-outlet.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/place/components/place-outlet/place-outlet.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,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;AAkBlI,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,GAAH,GAAG,CAAmB;QAlC1C,iB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B,CAAC;;aACzC;;;YA9CwB,MAAM;YAsBtB,WAAW;4CAyEL,QAAQ,YAAI,MAAM,SAAC,gBAAgB;4CACnC,QAAQ,YAAI,MAAM,SAAC,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,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAU,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACtH,OAAO,EAAkB,MAAM,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAGL,YAAY,EACZ,GAAG,EACH,IAAI,EACJ,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,aAAa,EACb,UAAU,EAEX,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAe,MAAM,oBAAoB,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAiBhE,MAAM,OAAO,oBAAqB,SAAQ,mBAAmB;IA2C3D,YAA6B,MAAc,EACd,WAAwB,EACM,WAAwB,EAC/C,YAAkC;QACpE,KAAK,EAAE,CAAC;QAJmB,WAAM,GAAN,MAAM,CAAQ;QACd,gBAAW,GAAX,WAAW,CAAa;QACM,gBAAW,GAAX,WAAW,CAAa;QA5B1E,iBAAY,GAAG,IAAI,YAAY,EAAkB,CAAC;QAQnD,oBAAe,GAAG,IAAI,iBAAiB,CAAC,KAAK,CAAC,CAAC;QACtC,yBAAoB,GAAG,IAAI,iB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AAa,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 { Component, EventEmitter, Inject, Input, OnInit, Optional, Output, SkipSelf, ViewChild } from '@angular/core';\nimport { ActivatedRoute, Router, RouterOutlet } from '@angular/router';\nimport {\n BooleanValueModelChain,\n Constructable,\n DebugContext,\n Dsl,\n lang,\n ListModel, ListModelChain,\n MutableValueModel,\n StoreInListModel,\n StoreInValueModel, Trace,\n TrackExternal,\n ValueModel,\n ValueModelChain\n} from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { DisposableComponent } from '../../../components/disposable-component';\nimport { PlaceComponent } from '../../place-component';\nimport { AUP_PLACE_CONFIG, PlaceConfig } from '../../place-config';\nimport { PlaceDefinition } from '../../place-definition';\nimport { PlaceRouter } from '../../place-router';\n\nimport { Visit } from '../../visit';\nimport { LEFT_RIGHT_PLACE_ANIMATION } from './route-animations';\n\n// Quick hack to avoid circular references between this and PlaceComponents.\ninterface PlaceRef {\n readonly placeDefinition: PlaceDefinition\n\n initialiseBindings(param: ValueModel<Visit>): void;\n\n onPlaceReady(): void;\n}\n\n@Component({\n selector: 'aup-place-outlet',\n templateUrl: './place-outlet.component.html',\n styleUrls: ['./place-outlet.component.scss'],\n animations: [LEFT_RIGHT_PLACE_ANIMATION]\n})\nexport class PlaceOutletComponent extends DisposableComponent implements OnInit {\n\n @Input() @StoreInValueModel('animateModel')\n animate: boolean;\n\n @Input() @TrackExternal({ defaultValue: true })\n animateModel: ValueModel<boolean>;\n\n // tslint:disable-next-line:no-input-rename\n @Input('placeAnimationOrderModel') @TrackExternal()\n customPlaceAnimationOrderModel: ListModel<Constructable<PlaceComponent>>;\n\n // tslint:disable-next-line:no-input-rename\n @Input('placeAnimationOrder') @StoreInListModel('customPlaceAnimationOrderModel')\n customPlaceAnimationOrder: Constructable<PlaceComponent>[];\n\n @Output()\n readonly placeChanged = new EventEmitter<PlaceComponent>();\n\n @ViewChild('routeOutlet', { static: true })\n routerOut: RouterOutlet;\n\n private onAnimationFinishedJob: () => void;\n\n\n private outletActivated = new MutableValueModel(false);\n private readonly _activatedRouteModel = new MutableValueModel<ActivatedRoute>();\n private readonly _activePlaceModel = new MutableValueModel<PlaceComponent>();\n private readonly _activePlaceDefinition: ValueModelChain<PlaceDefinition>;\n\n private parentOutletModel: MutableValueModel<PlaceOutletComponent>;\n public readonly activePlaceAnimationPosition: ValueModelChain<number>;\n\n private initialPlaceIndex: number = null;\n private routerVisitModel: ValueModelChain<Visit>;\n private _isPushingVisitToRoute = new MutableValueModel<boolean>(false);\n private navigationInProgress: ValueModelChain<boolean>;\n\n private isVeryFirstLoad = true;\n private placesInAnimationOrder: ListModelChain<Constructable<PlaceComponent>>;\n private animationSupported: BooleanValueModelChain;\n readonly animationEnabled: BooleanValueModelChain;\n\n constructor(private readonly router: Router,\n private readonly placeRouter: PlaceRouter,\n @Optional() @Inject(AUP_PLACE_CONFIG) readonly placeConfig: PlaceConfig,\n @SkipSelf() @Optional() parentOutlet: PlaceOutletComponent) {\n super();\n const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);\n\n this.parentOutletModel = new MutableValueModel(parentOutlet);\n\n const defaultPlaceAnimationOrder = chain(this.parentOutletModel)\n .pullValueModel(o => o.activePlaceModel)\n .pluck('placeDefinition')\n .pluckList('children')\n .pluck('component');\n\n const activatePlaceType = chain(this.activePlaceModel).map(p => p.constructor as Constructable<PlaceComponent>);\n\n this.placesInAnimationOrder = chain(this.customPlaceAnimationOrderModel)\n .otherwise(defaultPlaceAnimationOrder);\n\n this.activePlaceAnimationPosition = this.placesInAnimationOrder\n .reduce((placesInOrder) => {\n let placeIndex = 0;\n if (activatePlaceType.value) {\n placeIndex = placesInOrder.indexOf(activatePlaceType.value);\n if (_.isNil(this.initialPlaceIndex)) {\n this.initialPlaceIndex = placeIndex;\n }\n }\n return _.isNil(this.initialPlaceIndex) ? 0 : placeIndex - this.initialPlaceIndex;\n }, { dependsOn: activatePlaceType });\n\n this.animationSupported = this.placesInAnimationOrder.count().isGreaterThan(0);\n this.animationEnabled = valueOf.all(\n this.animateModel,\n this.animationSupported\n ).areTruthy();\n\n // Extract our visit model from the place router.\n this._activePlaceDefinition = chain(this._activePlaceModel).pluck('placeDefinition');\n this.routerVisitModel = this._activePlaceDefinition.findIn(chain(placeRouter.activeVisitsByPlaceDefinition));\n\n this.navigationInProgress = chain(this.placeRouter.navigationInProgress);\n\n when(this.navigationInProgress).becomesFalsey(() => {\n this.checkStateAndInitialise();\n });\n when(this.outletActivated).becomesTruthy(() => {\n this.checkStateAndInitialise();\n });\n\n chain(this._activePlaceModel)\n .postponeWhile(this.navigationInProgress)\n .subscribe(place => this.placeChanged.emit(place));\n\n when(placeRouter.accessGuard).changes(guard => {\n const activePlace = this._activePlaceModel.value;\n if (activePlace && !guard.isAuthorised(activePlace.placeDefinition)) {\n const visit = placeRouter.getAuthorisationFailureRedirect(this._activatedRouteModel.value.snapshot, this.router.routerState.snapshot);\n this.placeRouter.navigate(visit)\n }\n });\n\n }\n\n // @Trace()\n ngOnInit() {\n }\n\n // @Trace()\n getAnimationOrder() {\n return this.activePlaceAnimationPosition.value;\n }\n\n get animationDuration() {\n return this.placeConfig && this.placeConfig.animationDuration ? this.placeConfig.animationDuration : '500ms';\n }\n\n // @Trace()\n navigate(visit: Visit) {\n // const place = this.placesInAnimationOrder.query().findMatching(p => visit.placeDefinition.component === p);\n // if (!place) {\n // lang.illegalState()\n // }\n this.placeRouter.navigate(visit, {\n relativeTo: this.parentOutlet ? this.parentOutlet.activatedRouteModel.value : null\n });\n }\n\n get parentOutlet(): PlaceOutletComponent {\n return this.parentOutletModel.value;\n }\n\n\n get activePlaceModel(): ValueModel<PlaceComponent> {\n return this._activePlaceModel.readonly;\n }\n\n get activatedRouteModel(): ValueModel<ActivatedRoute> {\n return this._activatedRouteModel.readonly;\n }\n\n // @Trace()\n onOutletActivated(routerOutlet: RouterOutlet, place: PlaceComponent) {\n this._activatedRouteModel.value = routerOutlet.activatedRoute;\n this._activePlaceModel.value = place;\n this.validateAnimationState(place);\n this.outletActivated.value = true;\n this.checkStateAndInitialise();\n }\n\n private validateAnimationState(place: PlaceComponent) {\n if (this.animateModel.value) {\n if (this.placesInAnimationOrder.length < 1) {\n console.error('PlaceOutlet.animate === true but placeAnimationOrder has not been set. Animation is disabled.');\n } else {\n if (!this.placesInAnimationOrder.query().includes(place.placeDefinition.component)) {\n console.error(`PlaceOutlet.animate === true but placeAnimationOrder doesn't contain ${place.placeDefinition.component.name}.`);\n }\n }\n }\n }\n\n // @Trace()\n onOutletDeactivated() {\n this.outletActivated.value = false;\n this._activePlaceModel.value = null;\n this._activatedRouteModel.value = null;\n }\n\n // @Trace()\n private checkStateAndInitialise() {\n const routerVisit = this.routerVisitModel.value;\n const activePlace = this.activePlaceModel.value;\n if (routerVisit && activePlace && !activePlace.isInitialised()) {\n if (routerVisit.placeDefinition !== activePlace.placeDefinition) {\n lang.illegalState('wrong visit!!!');\n }\n this.initialisePlace(routerVisit, activePlace);\n }\n }\n\n private initialisePlace(routerVisit: Visit, activePlace: PlaceComponent) {\n const visitModel = new MutableValueModel<Visit>(routerVisit);\n DebugContext.tag(visitModel, `PlaceOutletComponent[${activePlace.constructor.name})].visitModel`);\n activePlace.initialiseVisit(routerVisit, (current, previous) => {\n this.pushVisitChangeToRoute(previous, current);\n });\n const finishPlaceLoad = () => {\n this._activePlaceModel.value._notifyActive(true);\n }\n if (!this.animationEnabled.value || this.isVeryFirstLoad) {\n // if animation is disabled or this is the very first load then\n // we won't get our animation done callback so we finish the\n // process here and now.\n this.isVeryFirstLoad = false;\n finishPlaceLoad()\n } else {\n this.onAnimationFinishedJob = finishPlaceLoad;\n }\n const { when, chain, valueOf } = Dsl.disposeWith(activePlace);\n when(this.routerVisitModel)\n .changes(visit => {\n activePlace.updateVisit(visit);\n }, {\n unless: valueOf.any(\n this._isPushingVisitToRoute,\n this.routerVisitModel.isNil()\n ).areTruthy()\n });\n }\n\n private pushVisitChangeToRoute(previous: Visit, current: Visit) {\n this._isPushingVisitToRoute.value = true;\n this.placeRouter.pushVisitChangesToRoute(previous, current).finally(() => {\n this._isPushingVisitToRoute.value = false;\n });\n }\n\n// @Trace()\n animationStarted() {\n // console.log({ activePlace: this._activePlaceModel.value });\n }\n\n // @Trace()\n animationDone() {\n if (this.onAnimationFinishedJob) {\n this.onAnimationFinishedJob();\n this.onAnimationFinishedJob = undefined;\n }\n }\n\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"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:scroll}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":{"PlaceOutletComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../components/disposable-component","name":"DisposableComponent","line":41,"character":42},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":35,"character":1},"arguments":[{"selector":"aup-place-outlet","animations":[{"__symbolic":"reference","module":"./route-animations","name":"LEFT_RIGHT_PLACE_ANIMATION","line":39,"character":15}],"template":"<ng-container *ngIf=\"animationEnabled.value\">\n <div class=\"router-outlet-container\" cdkScrollable\n [@routeAnimations]=\"{value: getAnimationOrder(), params:{duration: animationDuration}}\"\n (@routeAnimations.start)=\"animationStarted()\"\n (@routeAnimations.done)=\"animationDone()\"\n >\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated(routerOutlet, $event)\"\n (deactivate)=\"onOutletDeactivated()\">\n </router-outlet>\n </div>\n</ng-container>\n\n<ng-container *ngIf=\"!animationEnabled.value\">\n <div class=\"router-outlet-container\" cdkScrollable>\n <router-outlet #routerOutlet=\"outlet\"\n (activate)=\"onOutletActivated(routerOutlet, $event)\"\n (deactivate)=\"onOutletDeactivated()\">\n </router-outlet>\n </div>\n</ng-container>\n\n","styles":[":host{display:flex;flex-direction:column;min-height:0}.router-outlet-container{flex:1;display:block;position:relative;min-height:0;overflow-x:hidden;overflow-y:scroll}router-outlet{display:none}"]}]}],"members":{"animate":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":43,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":43,"character":12},"arguments":["animateModel"]}]}],"animateModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":46,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":46,"character":12},"arguments":[{"defaultValue":true}]}]}],"customPlaceAnimationOrderModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":50,"character":3},"arguments":["placeAnimationOrderModel"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":50,"character":38}}]}],"customPlaceAnimationOrder":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":54,"character":3},"arguments":["placeAnimationOrder"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInListModel","line":54,"character":33},"arguments":["customPlaceAnimationOrderModel"]}]}],"placeChanged":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Output","line":57,"character":3}}]}],"routerOut":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"ViewChild","line":60,"character":3},"arguments":["routeOutlet",{"static":true}]}]}],"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[null,null,[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":86,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":86,"character":27},"arguments":[{"__symbolic":"reference","module":"../../place-config","name":"AUP_PLACE_CONFIG","line":86,"character":34}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"SkipSelf","line":87,"character":15}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Optional","line":87,"character":27}}]],"parameters":[{"__symbolic":"reference","module":"@angular/router","name":"Router","line":84,"character":39},{"__symbolic":"reference","module":"../../place-router","name":"PlaceRouter","line":85,"character":44},{"__symbolic":"reference","module":"../../place-config","name":"PlaceConfig","line":86,"character":74},{"__symbolic":"reference","name":"PlaceOutletComponent"}]}],"ngOnInit":[{"__symbolic":"method"}],"getAnimationOrder":[{"__symbolic":"method"}],"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"}]}}}}]
@@ -61,7 +61,7 @@ export class SidePlaceNavigationComponent extends AbstractPlaceNavigationCompone
61
61
  SidePlaceNavigationComponent.decorators = [
62
62
  { type: Component, args: [{
63
63
  selector: 'aup-side-place-navigation',
64
- template: "<mat-nav-list>\n <a mat-list-item (click)=\"toggleMenu()\" class=\"home\">\n <aup-icon class=\"collapsed-only\" icon=\"mat:menu\"></aup-icon>\n <aup-icon class=\"expanded-only\" icon=\"mat:arrow_back\"></aup-icon>\n <span class=\"expanded-only\">Menu</span>\n </a>\n <a mat-list-item *ngFor=\"let item of menuItems.value; trackBy: trackByPlaceDef\"\n [pectinCommand]=\"commandFactory.create(item.place)\"\n [class.active]=\"item.active\"\n [matTooltip]=\"getNavigationFace(item.place).tooltip()\">\n <aup-icon *ngIf=\"getNavigationFace(item.place).icon()\" [icon]=\"getNavigationFace(item.place).icon()\"></aup-icon>\n <span class=\"expanded-only\">{{getNavigationFace(item.place).text()}}</span>\n </a>\n <span [style.flex]=\"1\"></span>\n <ng-container *ngIf=\"navEndTemplate\" [ngTemplateOutlet]=\"navEndTemplate\"></ng-container>\n</mat-nav-list>\n",
64
+ template: "<mat-nav-list>\n <a mat-list-item (click)=\"toggleMenu()\" class=\"home\">\n <aup-icon class=\"collapsed-only\" icon=\"mat:menu\"></aup-icon>\n <aup-icon class=\"expanded-only\" icon=\"mat:arrow_back\"></aup-icon>\n <span class=\"expanded-only\">Menu</span>\n </a>\n <a mat-list-item *ngFor=\"let placeDefinition of placeDefinitions.value\"\n [pectinCommand]=\"commandFactory.create(placeDefinition)\"\n [class.active]=\"isActive(placeDefinition)\"\n [matTooltip]=\"getNavigationFace(placeDefinition).tooltip()\">\n <aup-icon *ngIf=\"getNavigationFace(placeDefinition).icon()\" [icon]=\"getNavigationFace(placeDefinition).icon()\"></aup-icon>\n <span class=\"expanded-only\">{{getNavigationFace(placeDefinition).text()}}</span>\n </a>\n <span [style.flex]=\"1\"></span>\n <ng-container *ngIf=\"navEndTemplate\" [ngTemplateOutlet]=\"navEndTemplate\"></ng-container>\n</mat-nav-list>\n",
65
65
  styles: [":host{display:flex;flex-direction:column;--resolved-nav-item-width:var(--nav-width,56px);--resolved-nav-item-height:var(--nav-item-height,var(--resolved-nav-item-width));--resolved-expanded-width:var(--nav-expanded-width,235px);--resolved-color:var(--nav-color,hsla(0,0%,100%,0.9));--resolved-background-color:var(--nav-background-color,#555);width:var(--resolved-nav-item-width);transition:width 125ms linear;background-color:var(--resolved-background-color);color:var(--resolved-color)}:host.expanded{width:var(--resolved-expanded-width);max-width:var(--resolved-expanded-width)}:host-context(.expanded) .expanded-only{max-width:100%}:host-context(.expanded) .collapsed-only{max-width:0}:host-context(.expanded) .mat-list-item aup-icon:not(.collapsed-only){margin-right:12px}:host-context(.expanded) .mat-list-item span{text-wrap:none;white-space:nowrap}.expanded-only{max-width:0;overflow:hidden}.collapsed-only{max-width:100%;overflow:hidden}mat-nav-list{flex:1;display:flex;flex-direction:column}.mat-list-item{width:var(--resolved-nav-item-width);height:var(--resolved-nav-item-height);color:inherit}.mat-list-item.active{background-color:#444}.mat-list-item.home{text-align:left}mat-icon{color:inherit}mat-icon.flip-horizontal{transform:scaleX(-1)}"]
66
66
  },] }
67
67
  ];