@coolon/angular-ui-powerups 12.4.0-alpha.61 → 12.4.0-alpha.62

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.
@@ -3,7 +3,6 @@ import { Component, HostBinding, Input } from '@angular/core';
3
3
  import { Dsl, MutableValueModel, StoreInValueModel } from '@coolon/pectin';
4
4
  import { DisposableComponent } from '../../../disposable-component';
5
5
  import { DecoratedTreeNode } from '../decorated-tree-node';
6
- import { TreeExpansionModel } from '../tree-expansion-model';
7
6
  import { TreeInheritanceIconComponent } from '../tree-inheritance-icon/tree-inheritance-icon.component';
8
7
  import { TreeTableModel } from '../tree-table-model';
9
8
  export class TreeLabelCellRendererComponent extends DisposableComponent {
@@ -25,17 +24,17 @@ export class TreeLabelCellRendererComponent extends DisposableComponent {
25
24
  ngOnInit() {
26
25
  const { chain } = Dsl.disposeWith(this);
27
26
  this.canExpand = chain(this.nodeModel).map(node => {
28
- return DecoratedTreeNode.getDecorator(node).hasChildren() && this.expansionModel.isCollapsed(node);
29
- }, { dependsOn: this.expansionModel.isExpandedPredicate });
27
+ return DecoratedTreeNode.getDecorator(node).hasChildren() && this.treeTableModel.isCollapsed(node);
28
+ }, { dependsOn: this.treeTableModel.treeExpansionModel.isExpandedPredicate });
30
29
  this.canCollapse = chain(this.nodeModel).map(node => {
31
- return DecoratedTreeNode.getDecorator(node).hasChildren() && !this.expansionModel.isCollapsed(node);
32
- }, { dependsOn: this.expansionModel.isExpandedPredicate });
30
+ return DecoratedTreeNode.getDecorator(node).hasChildren() && !this.treeTableModel.isCollapsed(node);
31
+ }, { dependsOn: this.treeTableModel.treeExpansionModel.isExpandedPredicate });
33
32
  this.iconModel = chain(this.nodeModel).map(node => {
34
33
  var _a;
35
- const expanded = this.expansionModel.isExpanded(this.node);
34
+ const expanded = this.treeTableModel.treeExpansionModel.isExpanded(this.node);
36
35
  const iconFactory = (_a = this.iconFactory) !== null && _a !== void 0 ? _a : TreeLabelCellRendererComponent.DEFAULT_ICON_FACTORY;
37
36
  return iconFactory(node, expanded, TreeLabelCellRendererComponent.DEFAULT_ICON_FACTORY(node, expanded, undefined));
38
- }, { dependsOn: this.expansionModel.isExpandedPredicate });
37
+ }, { dependsOn: this.treeTableModel.treeExpansionModel.isExpandedPredicate });
39
38
  }
40
39
  get isRoot() {
41
40
  return DecoratedTreeNode.getDecorator(this.node).isRoot();
@@ -50,7 +49,7 @@ export class TreeLabelCellRendererComponent extends DisposableComponent {
50
49
  expandOrCollapse($event, node) {
51
50
  $event.preventDefault();
52
51
  $event.stopPropagation();
53
- this.expansionModel.isCollapsed(node) ? this.expansionModel.expand(node) : this.expansionModel.collapse(node);
52
+ this.treeTableModel.isCollapsed(node) ? this.treeTableModel.expand(node) : this.treeTableModel.collapse(node);
54
53
  }
55
54
  }
56
55
  TreeLabelCellRendererComponent.decorators = [
@@ -65,7 +64,7 @@ TreeLabelCellRendererComponent.propDecorators = {
65
64
  value: [{ type: Input }],
66
65
  label: [{ type: Input }],
67
66
  iconFactory: [{ type: Input }],
68
- expansionModel: [{ type: Input }],
67
+ treeTableModel: [{ type: Input }],
69
68
  isRoot: [{ type: HostBinding, args: ['class.root',] }],
70
69
  isLeaf: [{ type: HostBinding, args: ['class.leaf',] }]
71
70
  };
@@ -1 +1 @@
1
- {"version":3,"file":"tree-label-cell-renderer.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,GAAG,EAAkB,iBAAiB,EAAE,iBAAiB,EAAmB,MAAM,gBAAgB,CAAC;AAC5G,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE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@angular/core';\nimport { Dsl, ListModelChain, MutableValueModel, StoreInValueModel, ValueModelChain } from '@coolon/pectin';\nimport { DisposableComponent } from '../../../disposable-component';\nimport { CellRenderer } from '../../table/cell-renderer';\nimport { DecoratedTreeNode } from '../decorated-tree-node';\nimport { TreeExpansionModel } from '../tree-expansion-model';\nimport { TreeInheritanceIconComponent } from '../tree-inheritance-icon/tree-inheritance-icon.component';\nimport { TreeTableModel } from '../tree-table-model';\n\n@Component({\n selector: 'aup-tree-label-cell-renderer',\n templateUrl: './tree-label-cell-renderer.component.html',\n styleUrls: ['./tree-label-cell-renderer.component.scss']\n})\nexport class TreeLabelCellRendererComponent<T> extends DisposableComponent implements CellRenderer<T>, OnInit {\n\n iconTypes: string[] = [];\n\n private nodeModel = new MutableValueModel<T>();\n\n @Input()\n @StoreInValueModel('nodeModel')\n value: T;\n\n @Input()\n label: string;\n\n @Input()\n iconFactory: TreeTableModel.IconFactory<T>;\n\n // TODO: Make this have a proper delegate so I can safely use it here..\n @Input()\n expansionModel: TreeExpansionModel<T>;\n\n readonly iconList: ListModelChain<string>;\n\n canExpand: ValueModelChain<boolean>;\n canCollapse: ValueModelChain<boolean>;\n iconModel: ValueModelChain<string>;\n\n constructor() {\n super();\n const { chain } = Dsl.disposeWith(this);\n this.iconList = chain(this.nodeModel).mapToList(node => {\n const icons: string[] = DecoratedTreeNode.getDecorator(node).ancestors().slice(1).map(ancestor => {\n return DecoratedTreeNode.getDecorator(ancestor).isLastChild() ? TreeInheritanceIconComponent.Type.ICON_BLANK : TreeInheritanceIconComponent.Type.ICON_THROUGH;\n });\n if (!DecoratedTreeNode.getDecorator(node).isRoot()) {\n icons.push(DecoratedTreeNode.getDecorator(node).isLastChild() ? TreeInheritanceIconComponent.Type.ICON_INHERITED_TERMINAL : TreeInheritanceIconComponent.Type.ICON_INHERITED_THROUGH_TERMINAL);\n }\n return icons;\n });\n }\n\n ngOnInit(): void {\n const { chain } = Dsl.disposeWith(this);\n this.canExpand = chain(this.nodeModel).map(node => {\n return DecoratedTreeNode.getDecorator(node).hasChildren() && this.expansionModel.isCollapsed(node);\n }, { dependsOn: this.expansionModel.isExpandedPredicate });\n\n this.canCollapse = chain(this.nodeModel).map(node => {\n return DecoratedTreeNode.getDecorator(node).hasChildren() && !this.expansionModel.isCollapsed(node);\n }, { dependsOn: this.expansionModel.isExpandedPredicate });\n\n this.iconModel = chain(this.nodeModel).map(node => {\n const expanded = this.expansionModel.isExpanded(this.node);\n const iconFactory = this.iconFactory ?? TreeLabelCellRendererComponent.DEFAULT_ICON_FACTORY;\n return iconFactory(node, expanded, TreeLabelCellRendererComponent.DEFAULT_ICON_FACTORY(node, expanded, undefined));\n }, { dependsOn: this.expansionModel.isExpandedPredicate });\n }\n\n @HostBinding('class.root')\n get isRoot() {\n return DecoratedTreeNode.getDecorator(this.node).isRoot();\n }\n\n @HostBinding('class.leaf')\n get isLeaf() {\n return DecoratedTreeNode.getDecorator(this.node).isLeaf();\n }\n\n get node() {\n return this.nodeModel.value;\n }\n\n // @Trace()\n expandOrCollapse($event: MouseEvent, node: DecoratedTreeNode<T>) {\n $event.preventDefault();\n $event.stopPropagation();\n this.expansionModel.isCollapsed(node) ? this.expansionModel.expand(node) : this.expansionModel.collapse(node);\n }\n}\n\nexport namespace TreeLabelCellRendererComponent {\n export const DEFAULT_ICON_FACTORY: TreeTableModel.IconFactory<any> = (node: any, expanded: boolean, defaultIcon: string) => {\n const isLeaf = DecoratedTreeNode.getDecorator(node).isLeaf();\n return isLeaf ?\n undefined :\n expanded ?\n 'mat:expand_more' :\n 'mat:chevron_right';\n };\n}\n"]}
1
+ {"version":3,"file":"tree-label-cell-renderer.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,GAA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,CAAC,CAAC;YACX,QAAQ,CAAC,CAAC;gBACR,iBAAiB,CAAC,CAAC;gBACnB,mBAAmB,CAAC;IAC1B,CAAC,CAAC;AACJ,CAAC,EATgB,8BAA8B,KAA9B,8BAA8B,QAS9C","sourcesContent":["import { Component, HostBinding, Input, OnInit } from '@angular/core';\nimport { Dsl, ListModelChain, MutableValueModel, StoreInValueModel, ValueModelChain } from '@coolon/pectin';\nimport { DisposableComponent } from '../../../disposable-component';\nimport { CellRenderer } from '../../table/cell-renderer';\nimport { DecoratedTreeNode } from '../decorated-tree-node';\nimport { TreeExpansionModel } from '../tree-expansion-model';\nimport { TreeInheritanceIconComponent } from '../tree-inheritance-icon/tree-inheritance-icon.component';\nimport { TreeTableModel } from '../tree-table-model';\n\n@Component({\n selector: 'aup-tree-label-cell-renderer',\n templateUrl: './tree-label-cell-renderer.component.html',\n styleUrls: ['./tree-label-cell-renderer.component.scss']\n})\nexport class TreeLabelCellRendererComponent<T> extends DisposableComponent implements CellRenderer<T>, OnInit {\n\n iconTypes: string[] = [];\n\n private nodeModel = new MutableValueModel<T>();\n\n @Input()\n @StoreInValueModel('nodeModel')\n value: T;\n\n @Input()\n label: string;\n\n @Input()\n iconFactory: TreeTableModel.IconFactory<T>;\n\n // TODO: Make this have a proper delegate so I can safely use it here..\n @Input()\n treeTableModel: TreeTableModel<T>;\n\n readonly iconList: ListModelChain<string>;\n\n canExpand: ValueModelChain<boolean>;\n canCollapse: ValueModelChain<boolean>;\n iconModel: ValueModelChain<string>;\n\n constructor() {\n super();\n const { chain } = Dsl.disposeWith(this);\n this.iconList = chain(this.nodeModel).mapToList(node => {\n const icons: string[] = DecoratedTreeNode.getDecorator(node).ancestors().slice(1).map(ancestor => {\n return DecoratedTreeNode.getDecorator(ancestor).isLastChild() ? TreeInheritanceIconComponent.Type.ICON_BLANK : TreeInheritanceIconComponent.Type.ICON_THROUGH;\n });\n if (!DecoratedTreeNode.getDecorator(node).isRoot()) {\n icons.push(DecoratedTreeNode.getDecorator(node).isLastChild() ? TreeInheritanceIconComponent.Type.ICON_INHERITED_TERMINAL : TreeInheritanceIconComponent.Type.ICON_INHERITED_THROUGH_TERMINAL);\n }\n return icons;\n });\n }\n\n ngOnInit(): void {\n const { chain } = Dsl.disposeWith(this);\n this.canExpand = chain(this.nodeModel).map(node => {\n return DecoratedTreeNode.getDecorator(node).hasChildren() && this.treeTableModel.isCollapsed(node);\n }, { dependsOn: this.treeTableModel.treeExpansionModel.isExpandedPredicate });\n\n this.canCollapse = chain(this.nodeModel).map(node => {\n return DecoratedTreeNode.getDecorator(node).hasChildren() && !this.treeTableModel.isCollapsed(node);\n }, { dependsOn: this.treeTableModel.treeExpansionModel.isExpandedPredicate });\n\n this.iconModel = chain(this.nodeModel).map(node => {\n const expanded = this.treeTableModel.treeExpansionModel.isExpanded(this.node);\n const iconFactory = this.iconFactory ?? TreeLabelCellRendererComponent.DEFAULT_ICON_FACTORY;\n return iconFactory(node, expanded, TreeLabelCellRendererComponent.DEFAULT_ICON_FACTORY(node, expanded, undefined));\n }, { dependsOn: this.treeTableModel.treeExpansionModel.isExpandedPredicate });\n }\n\n @HostBinding('class.root')\n get isRoot() {\n return DecoratedTreeNode.getDecorator(this.node).isRoot();\n }\n\n @HostBinding('class.leaf')\n get isLeaf() {\n return DecoratedTreeNode.getDecorator(this.node).isLeaf();\n }\n\n get node() {\n return this.nodeModel.value;\n }\n\n // @Trace()\n expandOrCollapse($event: MouseEvent, node: DecoratedTreeNode<T>) {\n $event.preventDefault();\n $event.stopPropagation();\n this.treeTableModel.isCollapsed(node) ? this.treeTableModel.expand(node) : this.treeTableModel.collapse(node);\n }\n}\n\nexport namespace TreeLabelCellRendererComponent {\n export const DEFAULT_ICON_FACTORY: TreeTableModel.IconFactory<any> = (node: any, expanded: boolean, defaultIcon: string) => {\n const isLeaf = DecoratedTreeNode.getDecorator(node).isLeaf();\n return isLeaf ?\n undefined :\n expanded ?\n 'mat:expand_more' :\n 'mat:chevron_right';\n };\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"TreeLabelCellRendererComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../disposable-component","name":"DisposableComponent","line":14,"character":55},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":9,"character":1},"arguments":[{"selector":"aup-tree-label-cell-renderer","template":"<div class=\"tree-icons\">\n <aup-tree-inheritance-icon *ngFor=\"let iconClass of iconList.value\" [type]=\"iconClass\"></aup-tree-inheritance-icon>\n <aup-icon *ngIf=\"iconModel.value\"\n [icon]=\"iconModel.value\"\n [class.clickable]=\"canExpand.value || canCollapse.value\"\n (click)=\"expandOrCollapse($event, node)\" ></aup-icon>\n</div>\n<div class=\"label\">{{label}}</div>\n","styles":[":host{--line-color: #ddd;--node-color: #999;display:inline-flex;flex-direction:row;align-items:stretch}:host div.label{display:flex;flex-direction:row;align-items:center;white-space:nowrap;padding-left:6px}:host div.tree-icons{display:grid;grid-auto-flow:column;grid-auto-columns:auto;grid-template-rows:1fr;align-items:stretch;justify-content:stretch}:host div.tree-icons aup-icon{align-self:center;color:var(--node-color)}:host div.tree-icons aup-icon.clickable{cursor:pointer}:host div.tree-icons aup-tree-inheritance-icon,:host div.tree-icons aup-icon{margin-left:4px}\n"]}]}],"members":{"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":21,"character":3},"arguments":["nodeModel"]}]}],"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":24,"character":3}}]}],"iconFactory":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":3}}]}],"expansionModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"isRoot":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":71,"character":3},"arguments":["class.root"]}]}],"isLeaf":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":76,"character":3},"arguments":["class.leaf"]}]}],"expandOrCollapse":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"TreeLabelCellRendererComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../../disposable-component","name":"DisposableComponent","line":14,"character":55},"arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":9,"character":1},"arguments":[{"selector":"aup-tree-label-cell-renderer","template":"<div class=\"tree-icons\">\n <aup-tree-inheritance-icon *ngFor=\"let iconClass of iconList.value\" [type]=\"iconClass\"></aup-tree-inheritance-icon>\n <aup-icon *ngIf=\"iconModel.value\"\n [icon]=\"iconModel.value\"\n [class.clickable]=\"canExpand.value || canCollapse.value\"\n (click)=\"expandOrCollapse($event, node)\" ></aup-icon>\n</div>\n<div class=\"label\">{{label}}</div>\n","styles":[":host{--line-color: #ddd;--node-color: #999;display:inline-flex;flex-direction:row;align-items:stretch}:host div.label{display:flex;flex-direction:row;align-items:center;white-space:nowrap;padding-left:6px}:host div.tree-icons{display:grid;grid-auto-flow:column;grid-auto-columns:auto;grid-template-rows:1fr;align-items:stretch;justify-content:stretch}:host div.tree-icons aup-icon{align-self:center;color:var(--node-color)}:host div.tree-icons aup-icon.clickable{cursor:pointer}:host div.tree-icons aup-tree-inheritance-icon,:host div.tree-icons aup-icon{margin-left:4px}\n"]}]}],"members":{"value":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":20,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":21,"character":3},"arguments":["nodeModel"]}]}],"label":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":24,"character":3}}]}],"iconFactory":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":27,"character":3}}]}],"treeTableModel":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":31,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor"}],"ngOnInit":[{"__symbolic":"method"}],"isRoot":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":71,"character":3},"arguments":["class.root"]}]}],"isLeaf":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":76,"character":3},"arguments":["class.leaf"]}]}],"expandOrCollapse":[{"__symbolic":"method"}]}}}}]
@@ -24,7 +24,7 @@ export class TreeLabelColumnModel extends ColumnModel {
24
24
  cellRenderer(componentType) {
25
25
  this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
26
26
  if (firstTime) {
27
- component.expansionModel = this.expansionModel;
27
+ component.treeTableModel = this.expansionModel;
28
28
  }
29
29
  component.value = rowData.row;
30
30
  component.label = _.isNil(this.labelProperty) ? undefined : rowData.row[this.labelProperty];
@@ -1 +1 @@
1
- {"version":3,"file":"tree-label-column-model.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/tree-table/tree-label-column-model.ts"],"names":[],"mappings":"AAEA,OAAO,CAAC,MAAM,QAAQ,CAAC;AACvB,OAAO,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAA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ACnD,CAAC;CAEF","sourcesContent":["import { ComponentType } from '@angular/cdk/overlay';\nimport { Types } from '@coolon/pectin';\nimport _ from 'lodash';\nimport { ComponentCellRendererPortalRef } from '../table/cell-portal-ref';\nimport { ColumnModel } from '../table/column-model';\nimport { TreeExpansionModel } from './tree-expansion-model';\nimport { TreeLabelCellRendererComponent } from './tree-label-cell-renderer/tree-label-cell-renderer.component';\nimport { TreeTableModel } from './tree-table-model';\n\nexport class TreeLabelColumnModel<Row> extends ColumnModel<Row> {\n\n private labelProperty: string | number | symbol;\n private iconFactory: TreeTableModel.IconFactory<Row>;\n\n constructor(columnId: string,\n textPropertiesProvider: ColumnModel.TextPropertiesProvider,\n readonly expansionModel: TreeExpansionModel<Row>) {\n super(columnId, textPropertiesProvider);\n this.cellRenderer(TreeLabelCellRendererComponent);\n }\n\n pluck<P extends Types.ValuePropertiesOf<Row>>(property: P) {\n this.labelProperty = property;\n }\n\n /**\n * @deprecated use #useIcon instead.\n * @param factory\n */\n addIcon<P extends Types.ValuePropertiesOf<Row>>(factory: TreeTableModel.IconFactory<Row>) {\n this.useIcon(factory);\n }\n\n useIcon<P extends Types.ValuePropertiesOf<Row>>(factory: TreeTableModel.IconFactory<Row>) {\n this.iconFactory = factory;\n }\n\n protected cellRenderer<C extends TreeLabelCellRendererComponent<Row>>(componentType: ComponentType<C>): this {\n this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {\n if (firstTime) {\n component.expansionModel = this.expansionModel;\n }\n component.value = rowData.row;\n component.label = _.isNil(this.labelProperty) ? undefined : rowData.row[this.labelProperty];\n component.iconFactory = this.iconFactory;\n }));\n return this;\n }\n\n public _selectRowOnClick(selectOnRowClick: boolean): this {\n return super._selectRowOnClick(selectOnRowClick);\n }\n\n}\n"]}
1
+ {"version":3,"file":"tree-label-column-model.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/tree-table/tree-label-column-model.ts"],"names":[],"mappings":"AAEA,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AAO,IAAI,CAAC;IACd,CAAC;IAEM,iBAAiB,CAAC,gBAAyB;QAChD,OAAO,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IACnD,CAAC;CAEF","sourcesContent":["import { ComponentType } from '@angular/cdk/overlay';\nimport { Types } from '@coolon/pectin';\nimport _ from 'lodash';\nimport { ComponentCellRendererPortalRef } from '../table/cell-portal-ref';\nimport { ColumnModel } from '../table/column-model';\nimport { TreeLabelCellRendererComponent } from './tree-label-cell-renderer/tree-label-cell-renderer.component';\nimport { TreeTableModel } from './tree-table-model';\n\nexport class TreeLabelColumnModel<Row> extends ColumnModel<Row> {\n\n private labelProperty: string | number | symbol;\n private iconFactory: TreeTableModel.IconFactory<Row>;\n\n constructor(columnId: string,\n textPropertiesProvider: ColumnModel.TextPropertiesProvider,\n readonly expansionModel: TreeTableModel<Row>) {\n super(columnId, textPropertiesProvider);\n this.cellRenderer(TreeLabelCellRendererComponent);\n }\n\n pluck<P extends Types.ValuePropertiesOf<Row>>(property: P) {\n this.labelProperty = property;\n }\n\n /**\n * @deprecated use #useIcon instead.\n * @param factory\n */\n addIcon<P extends Types.ValuePropertiesOf<Row>>(factory: TreeTableModel.IconFactory<Row>) {\n this.useIcon(factory);\n }\n\n useIcon<P extends Types.ValuePropertiesOf<Row>>(factory: TreeTableModel.IconFactory<Row>) {\n this.iconFactory = factory;\n }\n\n protected cellRenderer<C extends TreeLabelCellRendererComponent<Row>>(componentType: ComponentType<C>): this {\n this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {\n if (firstTime) {\n component.treeTableModel = this.expansionModel;\n }\n component.value = rowData.row;\n component.label = _.isNil(this.labelProperty) ? undefined : rowData.row[this.labelProperty];\n component.iconFactory = this.iconFactory;\n }));\n return this;\n }\n\n public _selectRowOnClick(selectOnRowClick: boolean): this {\n return super._selectRowOnClick(selectOnRowClick);\n }\n\n}\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"TreeLabelColumnModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../table/column-model","name":"ColumnModel","line":9,"character":47},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"select","expression":{"__symbolic":"reference","module":"../table/column-model","name":"ColumnModel","line":15,"character":38},"member":"TextPropertiesProvider"},{"__symbolic":"reference","module":"./tree-expansion-model","name":"TreeExpansionModel","line":16,"character":39,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":16,"character":58,"context":{"typeName":"Row"}}]}]}],"pluck":[{"__symbolic":"method"}],"addIcon":[{"__symbolic":"method"}],"useIcon":[{"__symbolic":"method"}],"cellRenderer":[{"__symbolic":"method"}],"_selectRowOnClick":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"TreeLabelColumnModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../table/column-model","name":"ColumnModel","line":8,"character":47},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"},{"__symbolic":"select","expression":{"__symbolic":"reference","module":"../table/column-model","name":"ColumnModel","line":14,"character":38},"member":"TextPropertiesProvider"},{"__symbolic":"reference","module":"./tree-table-model","name":"TreeTableModel","line":15,"character":39,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":15,"character":54,"context":{"typeName":"Row"}}]}]}],"pluck":[{"__symbolic":"method"}],"addIcon":[{"__symbolic":"method"}],"useIcon":[{"__symbolic":"method"}],"cellRenderer":[{"__symbolic":"method"}],"_selectRowOnClick":[{"__symbolic":"method"}]}}}}]
@@ -26,7 +26,7 @@ export class TreeTableModel extends AbstractTableModel {
26
26
  }
27
27
  treeControlColumn(builder) {
28
28
  const columnId = 'tree-label';
29
- const column = new TreeLabelColumnModel(columnId, () => this.getColumnTextProperties(columnId), this.treeExpansionModel);
29
+ const column = new TreeLabelColumnModel(columnId, () => this.getColumnTextProperties(columnId), this);
30
30
  builder(column);
31
31
  this.addColumn(column);
32
32
  }
@@ -34,7 +34,7 @@ export class TreeTableModel extends AbstractTableModel {
34
34
  this.treeExpansionModel.expand(node);
35
35
  }
36
36
  collapse(node) {
37
- this.treeExpansionModel.expand(node);
37
+ this.treeExpansionModel.collapse(node);
38
38
  }
39
39
  isCollapsed(node) {
40
40
  return this.treeExpansionModel.isCollapsed(node);
@@ -1 +1 @@
1
- {"version":3,"file":"tree-table-model.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/tree-table/tree-table-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjE,QAAQ;AACR,uBAAuB;AACvB,mCAAmC;AACnC,0DAA0D;AAC1D,uDAAuD;AACvD,+GAA+G;AAC/G,uBAAuB;AACvB,2CAA2C;AAC3C,0FAA0F;AAC1F,EAAE;AACF,MAAM,OAAO,cAAoB,SAAQ,kBAAuB;IAK9D,YAAY,MAAsB,EAAE,aAAmE,EAAE,OAA8C;QACrJ,KAAK,EAAE,CAAC;QAJD,uBAAkB,GAAG,IAAI,kBAAkB,CAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;QAKrF,IAAI,OAAO;YAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QAC3B,MAAM,cAAc,GAAG,CAAC,CAAC,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC/F,IAAI,CAAC,mB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AACF,6CAA6C;AAC7C,eAAe;AACf,kDAAkD;AAClD,MAAM;AACN,EAAE;AACF,+BAA+B;AAC/B,4BAA4B;AAC5B,MAAM;AACN,EAAE;AACF,sDAAsD;AACtD,uCAAuC;AACvC,MAAM;AACN,EAAE;AACF,gCAAgC;AAChC,0BAA0B;AAC1B,MAAM;AACN,EAAE;AACF,IAAI;AAEJ,yBAAyB;AACzB,EAAE;AACF,0CAA0C;AAC1C,EAAE;AACF,uBAAuB;AACvB,EAAE;AACF,kCAAkC;AAClC,EAAE;AACF,qDAAqD;AACrD,gCAAgC;AAChC,sEAAsE;AACtE,oDAAoD;AACpD,YAAY;AACZ,gCAAgC;AAChC,QAAQ;AACR,EAAE;AACF,gBAAgB;AAChB,4BAA4B;AAC5B,QAAQ;AACR,EAAE;AACF,EAAE;AACF,IAAI","sourcesContent":["import { ListModel, MutableValueModel, SelectionModel, ValueModel } from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { AbstractTableModel } from '../abstract-table-model';\nimport { SelectionColumnModel } from '../table/column-model';\nimport { DecoratedTreeNode } from './decorated-tree-node';\nimport { FlattenedTreeListModel } from './flattened-tree-list-model';\nimport { TreeExpansionModel } from './tree-expansion-model';\nimport { TreeLabelColumnModel } from './tree-label-column-model';\n\nexport type ChildArrayPropertiesOf<T> = { [K in keyof T]: T[K] extends T[] ? K : never }[keyof T];\n\n// TODO:\n// Selection Models:\n// - as simple navigation tree\n// - as editable grid (selecte all, even hidden etc?)\n// - fixing selection on underlying model changes.\n// - rendering selection: row highlighting, checkboxes (in the tree renderer or in separate column), both.\n// Expansion Models:\n// - Add ability to auto show to depth\n// - Add a predicate to check default expansion (i.e. has children of a certain type)\n//\nexport class TreeTableModel<Row> extends AbstractTableModel<Row> {\n\n readonly treeExpansionModel = new TreeExpansionModel<Row>(row => this.identityOf(row));\n private readonly flattenedDataSource: FlattenedTreeListModel<Row>;\n\n constructor(source: ListModel<Row>, childAccessor: ChildArrayPropertiesOf<Row> | ((node: Row) => Row[]), builder?: (model: TreeTableModel<Row>) => void) {\n super();\n if (builder) builder(this);\n const childExtractor = _.isFunction(childAccessor) ? childAccessor : row => row[childAccessor];\n this.flattenedDataSource = this.registerDisposable(new FlattenedTreeListModel<Row>(source, childExtractor, this.treeExpansionModel));\n this.setDataSource(this.flattenedDataSource);\n\n this.addRowClass('aup-node-collapsed', row => this.isCollapsed(row));\n }\n\n treeControlColumn(builder: (column: TreeLabelColumnModel<Row>) => void) {\n const columnId = 'tree-label';\n const column = new TreeLabelColumnModel<Row>(columnId, () => this.getColumnTextProperties(columnId), this.treeExpansionModel);\n builder(column);\n this.addColumn(column);\n }\n\n expand(node: Row) {\n this.treeExpansionModel.expand(node);\n }\n\n collapse(node: Row) {\n this.treeExpansionModel.expand(node);\n }\n\n isCollapsed(node: Row): boolean {\n return this.treeExpansionModel.isCollapsed(node);\n }\n\n ensureAncestorsAndSelfVisible(node: Row) {\n this.treeExpansionModel.ensureAncestorsAndSelfVisible(node);\n }\n\n addSelectionColumn(selectionModel?: SelectionModel<Row>, showSelectionColumn?: ValueModel<boolean> | boolean): SelectionColumnModel<Row> {\n return this._addSelectionColumn(selectionModel, showSelectionColumn);\n }\n\n // saveSelection() {\n // const selectionModel = this.getSelectionModel();\n // if (selectionModel) {\n // let ids: any[] = [];\n // const selectedArea = selectionModel.leadSelection.value;\n // if (selectedArea) {\n // ids.push(selectedArea.id);\n // ids = ids.concat(selectedArea.siblingsAfter().map(a => a.id));\n // ids = ids.concat(selectedArea.siblingsBefore().reverse().map(a => a.id));\n // ids = ids.concat(selectedArea.ancestorsToZone().reverse().map(a => a.id));\n // }\n // this._storedSelection = ids;\n // }\n // }\n //\n // restoreSelection() {\n // const all = this.rootNodeModel.value.selfAndDescendants();\n // for (let i = 0; i < this._storedSelection.length; i++) {\n // const id = this._storedSelection[i];\n // const found = all.find(area => area.id === id);\n // if (found) {\n // this.selectedAreaId.value = found.id;\n // break;\n // }\n // }\n // }\n //\n // collapseAll(areas: T[]) {\n // this.collapsedAreaIds.value = [].concat(this.collapsedAreaIds.value, areas.map(a => a.id));\n // }\n\n // disableSelection(disable: boolean = true) {\n // this._disableSelection.value = disable;\n // }\n\n\n}\n\n\nexport namespace TreeTableModel {\n\n export interface Options<T, K extends keyof T> {\n storeIdIn: MutableValueModel<K>\n }\n\n export type IconFactory<Row> = (node: Row, expanded: boolean, defaultIcon: string) => string;\n\n}\n\n\n// export class FlattenStrategy<T extends VisitableTree<any>> extends SelfAndDescendantsVisitor<T> {\n//\n// private _areas: T[] = [];\n// private _collapsed: Set<T>;\n//\n// constructor(private collapsedIds: T[]) {\n// super();\n// this._collapsed = new Set<T>(collapsedIds);\n// }\n//\n// protected onVisit(it: T) {\n// this._areas.push(it);\n// }\n//\n// protected shouldVisitChildrenOf(it: T): boolean {\n// return !this._collapsed.has(it);\n// }\n//\n// get flattenedAreas(): T[] {\n// return this._areas;\n// }\n//\n// }\n\n// class DecoratorCache {\n//\n// private map = new Map<number, T>();\n//\n// get(area:T): T {\n//\n// if (!area) return null;\n//\n// let decoratedArea = this.map.get(area.id);\n// if (!decoratedArea) {\n// decoratedArea = TreeModel.AreaDecorator.decorate(area);\n// this.map.set(area.id, decoratedArea);\n// }\n// return decoratedArea;\n// }\n//\n// clear() {\n// this.map.clear();\n// }\n//\n//\n// }\n\n\n\n\n"]}
1
+ {"version":3,"file":"tree-table-model.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/tables/tree-table/tree-table-model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAIjE,QAAQ;AACR,uBAAuB;AACvB,mCAAmC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C,MAAM,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED,QAAQ,CAAC,IAAS;QAChB,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAED,WAAW,CAAC,IAAS;QACnB,OAAO,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,6BAA6B,CAAC,IAAS;QACrC,IAAI,CAAC,kBAAkB,CAAC,6BAA6B,CAAC,IAAI,CAAC,CAAC;IAC9D,CAAC;IAED,kBAAkB,CAAC,cAAoC,EAAE,mBAAmD;QAC1G,OAAO,IAAI,CAAC,mBAAmB,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC;IACvE,CAAC;CAsCF;AAcD,oGAAoG;AACpG,EAAE;AACF,8BAA8B;AAC9B,gCAAgC;AAChC,EAAE;AACF,6CAA6C;AAC7C,eAAe;AACf,kDAAkD;AAClD,MAAM;AACN,EAAE;AACF,+BAA+B;AAC/B,4BAA4B;AAC5B,MAAM;AACN,EAAE;AACF,sDAAsD;AACtD,uCAAuC;AACvC,MAAM;AACN,EAAE;AACF,gCAAgC;AAChC,0BAA0B;AAC1B,MAAM;AACN,EAAE;AACF,IAAI;AAEJ,yBAAyB;AACzB,EAAE;AACF,0CAA0C;AAC1C,EAAE;AACF,uBAAuB;AACvB,EAAE;AACF,kCAAkC;AAClC,EAAE;AACF,qDAAqD;AACrD,gCAAgC;AAChC,sEAAsE;AACtE,oDAAoD;AACpD,YAAY;AACZ,gCAAgC;AAChC,QAAQ;AACR,EAAE;AACF,gBAAgB;AAChB,4BAA4B;AAC5B,QAAQ;AACR,EAAE;AACF,EAAE;AACF,IAAI","sourcesContent":["import { ListModel, MutableValueModel, SelectionModel, ValueModel } from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { AbstractTableModel } from '../abstract-table-model';\nimport { SelectionColumnModel } from '../table/column-model';\nimport { FlattenedTreeListModel } from './flattened-tree-list-model';\nimport { TreeExpansionModel } from './tree-expansion-model';\nimport { TreeLabelColumnModel } from './tree-label-column-model';\n\nexport type ChildArrayPropertiesOf<T> = { [K in keyof T]: T[K] extends T[] ? K : never }[keyof T];\n\n// TODO:\n// Selection Models:\n// - as simple navigation tree\n// - as editable grid (selecte all, even hidden etc?)\n// - fixing selection on underlying model changes.\n// - rendering selection: row highlighting, checkboxes (in the tree renderer or in separate column), both.\n// Expansion Models:\n// - Add ability to auto show to depth\n// - Add a predicate to check default expansion (i.e. has children of a certain type)\n//\nexport class TreeTableModel<Row> extends AbstractTableModel<Row> {\n\n readonly treeExpansionModel = new TreeExpansionModel<Row>(row => this.identityOf(row));\n private readonly flattenedDataSource: FlattenedTreeListModel<Row>;\n\n constructor(source: ListModel<Row>, childAccessor: ChildArrayPropertiesOf<Row> | ((node: Row) => Row[]), builder?: (model: TreeTableModel<Row>) => void) {\n super();\n if (builder) builder(this);\n const childExtractor = _.isFunction(childAccessor) ? childAccessor : row => row[childAccessor];\n this.flattenedDataSource = this.registerDisposable(new FlattenedTreeListModel<Row>(source, childExtractor, this.treeExpansionModel));\n this.setDataSource(this.flattenedDataSource);\n\n this.addRowClass('aup-node-collapsed', row => this.isCollapsed(row));\n }\n\n treeControlColumn(builder: (column: TreeLabelColumnModel<Row>) => void) {\n const columnId = 'tree-label';\n const column = new TreeLabelColumnModel<Row>(columnId, () => this.getColumnTextProperties(columnId), this);\n builder(column);\n this.addColumn(column);\n }\n\n expand(node: Row) {\n this.treeExpansionModel.expand(node);\n }\n\n collapse(node: Row) {\n this.treeExpansionModel.collapse(node);\n }\n\n isCollapsed(node: Row): boolean {\n return this.treeExpansionModel.isCollapsed(node);\n }\n\n ensureAncestorsAndSelfVisible(node: Row) {\n this.treeExpansionModel.ensureAncestorsAndSelfVisible(node);\n }\n\n addSelectionColumn(selectionModel?: SelectionModel<Row>, showSelectionColumn?: ValueModel<boolean> | boolean): SelectionColumnModel<Row> {\n return this._addSelectionColumn(selectionModel, showSelectionColumn);\n }\n\n // saveSelection() {\n // const selectionModel = this.getSelectionModel();\n // if (selectionModel) {\n // let ids: any[] = [];\n // const selectedArea = selectionModel.leadSelection.value;\n // if (selectedArea) {\n // ids.push(selectedArea.id);\n // ids = ids.concat(selectedArea.siblingsAfter().map(a => a.id));\n // ids = ids.concat(selectedArea.siblingsBefore().reverse().map(a => a.id));\n // ids = ids.concat(selectedArea.ancestorsToZone().reverse().map(a => a.id));\n // }\n // this._storedSelection = ids;\n // }\n // }\n //\n // restoreSelection() {\n // const all = this.rootNodeModel.value.selfAndDescendants();\n // for (let i = 0; i < this._storedSelection.length; i++) {\n // const id = this._storedSelection[i];\n // const found = all.find(area => area.id === id);\n // if (found) {\n // this.selectedAreaId.value = found.id;\n // break;\n // }\n // }\n // }\n //\n // collapseAll(areas: T[]) {\n // this.collapsedAreaIds.value = [].concat(this.collapsedAreaIds.value, areas.map(a => a.id));\n // }\n\n // disableSelection(disable: boolean = true) {\n // this._disableSelection.value = disable;\n // }\n\n\n}\n\n\nexport namespace TreeTableModel {\n\n export interface Options<T, K extends keyof T> {\n storeIdIn: MutableValueModel<K>;\n }\n\n export type IconFactory<Row> = (node: Row, expanded: boolean, defaultIcon: string) => string;\n\n}\n\n\n// export class FlattenStrategy<T extends VisitableTree<any>> extends SelfAndDescendantsVisitor<T> {\n//\n// private _areas: T[] = [];\n// private _collapsed: Set<T>;\n//\n// constructor(private collapsedIds: T[]) {\n// super();\n// this._collapsed = new Set<T>(collapsedIds);\n// }\n//\n// protected onVisit(it: T) {\n// this._areas.push(it);\n// }\n//\n// protected shouldVisitChildrenOf(it: T): boolean {\n// return !this._collapsed.has(it);\n// }\n//\n// get flattenedAreas(): T[] {\n// return this._areas;\n// }\n//\n// }\n\n// class DecoratorCache {\n//\n// private map = new Map<number, T>();\n//\n// get(area:T): T {\n//\n// if (!area) return null;\n//\n// let decoratedArea = this.map.get(area.id);\n// if (!decoratedArea) {\n// decoratedArea = TreeModel.AreaDecorator.decorate(area);\n// this.map.set(area.id, decoratedArea);\n// }\n// return decoratedArea;\n// }\n//\n// clear() {\n// this.map.clear();\n// }\n//\n//\n// }\n\n\n\n\n"]}
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"ChildArrayPropertiesOf":{"__symbolic":"interface"},"TreeTableModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-table-model","name":"AbstractTableModel","line":21,"character":41},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@coolon/pectin","name":"ListModel","line":26,"character":22,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":26,"character":32,"context":{"typeName":"Row"}}]},{"__symbolic":"error","message":"Could not resolve type","line":26,"character":53,"context":{"typeName":"ChildArrayPropertiesOf"}},{"__symbolic":"error","message":"Expression form not supported","line":26,"character":117}]}],"treeControlColumn":[{"__symbolic":"method"}],"expand":[{"__symbolic":"method"}],"collapse":[{"__symbolic":"method"}],"isCollapsed":[{"__symbolic":"method"}],"ensureAncestorsAndSelfVisible":[{"__symbolic":"method"}],"addSelectionColumn":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"ChildArrayPropertiesOf":{"__symbolic":"interface"},"TreeTableModel":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../abstract-table-model","name":"AbstractTableModel","line":20,"character":41},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@coolon/pectin","name":"ListModel","line":25,"character":22,"arguments":[{"__symbolic":"error","message":"Could not resolve type","line":25,"character":32,"context":{"typeName":"Row"}}]},{"__symbolic":"error","message":"Could not resolve type","line":25,"character":53,"context":{"typeName":"ChildArrayPropertiesOf"}},{"__symbolic":"error","message":"Expression form not supported","line":25,"character":117}]}],"treeControlColumn":[{"__symbolic":"method"}],"expand":[{"__symbolic":"method"}],"collapse":[{"__symbolic":"method"}],"isCollapsed":[{"__symbolic":"method"}],"ensureAncestorsAndSelfVisible":[{"__symbolic":"method"}],"addSelectionColumn":[{"__symbolic":"method"}]}}}}]
@@ -3672,6 +3672,33 @@ var DecoratedTreeNode;
3672
3672
  DecoratedTreeNode.Decorator = Decorator;
3673
3673
  })(DecoratedTreeNode || (DecoratedTreeNode = {}));
3674
3674
 
3675
+ class FlattenedTreeListModel extends ComputedListModel {
3676
+ constructor(source, childRef, expansionModel) {
3677
+ super(source, {
3678
+ initialValue: [],
3679
+ identifiedWith: row => source.identityOf(row)
3680
+ });
3681
+ this.source = source;
3682
+ this.childRef = childRef;
3683
+ this.expansionModel = expansionModel;
3684
+ this.trackSource(expansionModel.isExpandedPredicate);
3685
+ }
3686
+ compute(values) {
3687
+ const result = [];
3688
+ values.forEach(rootNode => {
3689
+ return this.addNodeAndVisibleChildren(DecoratedTreeNode.decorateRoot(rootNode, this.childRef), result);
3690
+ });
3691
+ return result;
3692
+ }
3693
+ addNodeAndVisibleChildren(node, result) {
3694
+ result.push(node);
3695
+ const decorator = node[treeNodeDecorator];
3696
+ if (decorator.hasChildren() && !this.expansionModel.isCollapsed(node)) {
3697
+ decorator.children.forEach(child => this.addNodeAndVisibleChildren(child, result));
3698
+ }
3699
+ }
3700
+ }
3701
+
3675
3702
  class TreeExpansionModel {
3676
3703
  constructor(identityOf) {
3677
3704
  this.identityOf = identityOf;
@@ -3719,33 +3746,6 @@ class TreeExpansionModel {
3719
3746
  }
3720
3747
  }
3721
3748
 
3722
- class FlattenedTreeListModel extends ComputedListModel {
3723
- constructor(source, childRef, expansionModel) {
3724
- super(source, {
3725
- initialValue: [],
3726
- identifiedWith: row => source.identityOf(row)
3727
- });
3728
- this.source = source;
3729
- this.childRef = childRef;
3730
- this.expansionModel = expansionModel;
3731
- this.trackSource(expansionModel.isExpandedPredicate);
3732
- }
3733
- compute(values) {
3734
- const result = [];
3735
- values.forEach(rootNode => {
3736
- return this.addNodeAndVisibleChildren(DecoratedTreeNode.decorateRoot(rootNode, this.childRef), result);
3737
- });
3738
- return result;
3739
- }
3740
- addNodeAndVisibleChildren(node, result) {
3741
- result.push(node);
3742
- const decorator = node[treeNodeDecorator];
3743
- if (decorator.hasChildren() && !this.expansionModel.isCollapsed(node)) {
3744
- decorator.children.forEach(child => this.addNodeAndVisibleChildren(child, result));
3745
- }
3746
- }
3747
- }
3748
-
3749
3749
  class TreeLabelColumnModel extends ColumnModel {
3750
3750
  constructor(columnId, textPropertiesProvider, expansionModel) {
3751
3751
  super(columnId, textPropertiesProvider);
@@ -3768,7 +3768,7 @@ class TreeLabelColumnModel extends ColumnModel {
3768
3768
  cellRenderer(componentType) {
3769
3769
  this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
3770
3770
  if (firstTime) {
3771
- component.expansionModel = this.expansionModel;
3771
+ component.treeTableModel = this.expansionModel;
3772
3772
  }
3773
3773
  component.value = rowData.row;
3774
3774
  component.label = ___default.isNil(this.labelProperty) ? undefined : rowData.row[this.labelProperty];
@@ -3804,7 +3804,7 @@ class TreeTableModel extends AbstractTableModel {
3804
3804
  }
3805
3805
  treeControlColumn(builder) {
3806
3806
  const columnId = 'tree-label';
3807
- const column = new TreeLabelColumnModel(columnId, () => this.getColumnTextProperties(columnId), this.treeExpansionModel);
3807
+ const column = new TreeLabelColumnModel(columnId, () => this.getColumnTextProperties(columnId), this);
3808
3808
  builder(column);
3809
3809
  this.addColumn(column);
3810
3810
  }
@@ -3812,7 +3812,7 @@ class TreeTableModel extends AbstractTableModel {
3812
3812
  this.treeExpansionModel.expand(node);
3813
3813
  }
3814
3814
  collapse(node) {
3815
- this.treeExpansionModel.expand(node);
3815
+ this.treeExpansionModel.collapse(node);
3816
3816
  }
3817
3817
  isCollapsed(node) {
3818
3818
  return this.treeExpansionModel.isCollapsed(node);
@@ -3889,17 +3889,17 @@ class TreeLabelCellRendererComponent extends DisposableComponent {
3889
3889
  ngOnInit() {
3890
3890
  const { chain } = Dsl.disposeWith(this);
3891
3891
  this.canExpand = chain(this.nodeModel).map(node => {
3892
- return DecoratedTreeNode.getDecorator(node).hasChildren() && this.expansionModel.isCollapsed(node);
3893
- }, { dependsOn: this.expansionModel.isExpandedPredicate });
3892
+ return DecoratedTreeNode.getDecorator(node).hasChildren() && this.treeTableModel.isCollapsed(node);
3893
+ }, { dependsOn: this.treeTableModel.treeExpansionModel.isExpandedPredicate });
3894
3894
  this.canCollapse = chain(this.nodeModel).map(node => {
3895
- return DecoratedTreeNode.getDecorator(node).hasChildren() && !this.expansionModel.isCollapsed(node);
3896
- }, { dependsOn: this.expansionModel.isExpandedPredicate });
3895
+ return DecoratedTreeNode.getDecorator(node).hasChildren() && !this.treeTableModel.isCollapsed(node);
3896
+ }, { dependsOn: this.treeTableModel.treeExpansionModel.isExpandedPredicate });
3897
3897
  this.iconModel = chain(this.nodeModel).map(node => {
3898
3898
  var _a;
3899
- const expanded = this.expansionModel.isExpanded(this.node);
3899
+ const expanded = this.treeTableModel.treeExpansionModel.isExpanded(this.node);
3900
3900
  const iconFactory = (_a = this.iconFactory) !== null && _a !== void 0 ? _a : TreeLabelCellRendererComponent.DEFAULT_ICON_FACTORY;
3901
3901
  return iconFactory(node, expanded, TreeLabelCellRendererComponent.DEFAULT_ICON_FACTORY(node, expanded, undefined));
3902
- }, { dependsOn: this.expansionModel.isExpandedPredicate });
3902
+ }, { dependsOn: this.treeTableModel.treeExpansionModel.isExpandedPredicate });
3903
3903
  }
3904
3904
  get isRoot() {
3905
3905
  return DecoratedTreeNode.getDecorator(this.node).isRoot();
@@ -3914,7 +3914,7 @@ class TreeLabelCellRendererComponent extends DisposableComponent {
3914
3914
  expandOrCollapse($event, node) {
3915
3915
  $event.preventDefault();
3916
3916
  $event.stopPropagation();
3917
- this.expansionModel.isCollapsed(node) ? this.expansionModel.expand(node) : this.expansionModel.collapse(node);
3917
+ this.treeTableModel.isCollapsed(node) ? this.treeTableModel.expand(node) : this.treeTableModel.collapse(node);
3918
3918
  }
3919
3919
  }
3920
3920
  TreeLabelCellRendererComponent.decorators = [
@@ -3929,7 +3929,7 @@ TreeLabelCellRendererComponent.propDecorators = {
3929
3929
  value: [{ type: Input }],
3930
3930
  label: [{ type: Input }],
3931
3931
  iconFactory: [{ type: Input }],
3932
- expansionModel: [{ type: Input }],
3932
+ treeTableModel: [{ type: Input }],
3933
3933
  isRoot: [{ type: HostBinding, args: ['class.root',] }],
3934
3934
  isLeaf: [{ type: HostBinding, args: ['class.leaf',] }]
3935
3935
  };