@coolon/angular-ui-powerups 3.8.0 → 3.10.0

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 (107) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/assets/activities.scss +9 -0
  3. package/assets/styles.scss +2 -0
  4. package/assets/table.scss +18 -0
  5. package/assets/typography.scss +5 -0
  6. package/bundles/coolon-angular-ui-powerups.umd.js +1219 -502
  7. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  8. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  9. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  10. package/coolon-angular-ui-powerups.metadata.json +1 -1
  11. package/esm2015/lib/angular-ui-powerups.module.ngfactory.js.map +1 -1
  12. package/esm2015/lib/components/card-container/card-container.component.js +1 -1
  13. package/esm2015/lib/components/card-container/card-container.component.metadata.json +1 -1
  14. package/esm2015/lib/components/components.module.js +13 -5
  15. package/esm2015/lib/components/components.module.js.map +1 -1
  16. package/esm2015/lib/components/components.module.metadata.json +1 -1
  17. package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
  18. package/esm2015/lib/components/exports.js +11 -0
  19. package/esm2015/lib/components/exports.js.map +1 -1
  20. package/esm2015/lib/components/exports.metadata.json +1 -1
  21. package/esm2015/lib/components/table/abstract-table-model.js +173 -0
  22. package/esm2015/lib/components/table/abstract-table-model.js.map +1 -0
  23. package/esm2015/lib/components/table/abstract-table-model.metadata.json +1 -0
  24. package/esm2015/lib/components/table/column-model.js +6 -3
  25. package/esm2015/lib/components/table/column-model.js.map +1 -1
  26. package/esm2015/lib/components/table/column-model.metadata.json +1 -1
  27. package/esm2015/lib/components/table/table-model.js +7 -171
  28. package/esm2015/lib/components/table/table-model.js.map +1 -1
  29. package/esm2015/lib/components/table/table-model.metadata.json +1 -1
  30. package/esm2015/lib/components/table/table.component.js +3 -3
  31. package/esm2015/lib/components/table/table.component.js.map +1 -1
  32. package/esm2015/lib/components/table/table.component.metadata.json +1 -1
  33. package/esm2015/lib/components/tree-table/decorated-tree-node.js +169 -0
  34. package/esm2015/lib/components/tree-table/decorated-tree-node.js.map +1 -0
  35. package/esm2015/lib/components/tree-table/decorated-tree-node.metadata.json +1 -0
  36. package/esm2015/lib/components/tree-table/tree-expansion-model.js +48 -0
  37. package/esm2015/lib/components/tree-table/tree-expansion-model.js.map +1 -0
  38. package/esm2015/lib/components/tree-table/tree-expansion-model.metadata.json +1 -0
  39. package/esm2015/lib/components/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.js +68 -0
  40. package/esm2015/lib/components/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.js.map +1 -0
  41. package/esm2015/lib/components/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.metadata.json +1 -0
  42. package/esm2015/lib/components/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.ngfactory.js.map +1 -0
  43. package/esm2015/lib/components/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.scss.shim.ngstyle.js.map +1 -0
  44. package/esm2015/lib/components/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.js +71 -0
  45. package/esm2015/lib/components/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.js.map +1 -0
  46. package/esm2015/lib/components/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.metadata.json +1 -0
  47. package/esm2015/lib/components/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.ngfactory.js.map +1 -0
  48. package/esm2015/lib/components/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.scss.shim.ngstyle.js.map +1 -0
  49. package/esm2015/lib/components/tree-table/tree-label-column-model.js +33 -0
  50. package/esm2015/lib/components/tree-table/tree-label-column-model.js.map +1 -0
  51. package/esm2015/lib/components/tree-table/tree-label-column-model.metadata.json +1 -0
  52. package/esm2015/lib/components/tree-table/tree-node.js +2 -0
  53. package/esm2015/lib/components/tree-table/tree-node.js.map +1 -0
  54. package/esm2015/lib/components/tree-table/tree-node.metadata.json +1 -0
  55. package/esm2015/lib/components/tree-table/tree-table-component.js +63 -0
  56. package/esm2015/lib/components/tree-table/tree-table-component.js.map +1 -0
  57. package/esm2015/lib/components/tree-table/tree-table-component.metadata.json +1 -0
  58. package/esm2015/lib/components/tree-table/tree-table-component.ngfactory.js.map +1 -0
  59. package/esm2015/lib/components/tree-table/tree-table-model.js +90 -0
  60. package/esm2015/lib/components/tree-table/tree-table-model.js.map +1 -0
  61. package/esm2015/lib/components/tree-table/tree-table-model.metadata.json +1 -0
  62. package/esm2015/lib/components/tree-table/tree-table.component.scss.ngstyle.js.map +1 -0
  63. package/esm2015/lib/components/tree-table/tree-to-list-model.js +25 -0
  64. package/esm2015/lib/components/tree-table/tree-to-list-model.js.map +1 -0
  65. package/esm2015/lib/components/tree-table/tree-to-list-model.metadata.json +1 -0
  66. package/esm2015/lib/components/tree-table/visitable.class.js +26 -0
  67. package/esm2015/lib/components/tree-table/visitable.class.js.map +1 -0
  68. package/esm2015/lib/components/tree-table/visitable.class.metadata.json +1 -0
  69. package/esm2015/lib/interaction/components/activity-title/activity-title.component.js +26 -0
  70. package/esm2015/lib/interaction/components/activity-title/activity-title.component.js.map +1 -0
  71. package/esm2015/lib/interaction/components/activity-title/activity-title.component.metadata.json +1 -0
  72. package/esm2015/lib/interaction/components/activity-title/activity-title.component.ngfactory.js.map +1 -0
  73. package/esm2015/lib/interaction/components/activity-title/activity-title.component.scss.shim.ngstyle.js.map +1 -0
  74. package/esm2015/lib/interaction/exports.js +1 -0
  75. package/esm2015/lib/interaction/exports.js.map +1 -1
  76. package/esm2015/lib/interaction/exports.metadata.json +1 -1
  77. package/esm2015/lib/interaction/interaction.module.js +4 -1
  78. package/esm2015/lib/interaction/interaction.module.js.map +1 -1
  79. package/esm2015/lib/interaction/interaction.module.metadata.json +1 -1
  80. package/esm2015/lib/interaction/interaction.module.ngfactory.js.map +1 -1
  81. package/esm2015/lib/place/place.module.ngfactory.js.map +1 -1
  82. package/fesm2015/coolon-angular-ui-powerups.js +981 -380
  83. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  84. package/lib/components/exports.d.ts +11 -0
  85. package/lib/components/table/abstract-table-model.d.ts +61 -0
  86. package/lib/components/table/column-model.d.ts +11 -12
  87. package/lib/components/table/table-model.d.ts +4 -59
  88. package/lib/components/table/table.component.d.ts +2 -2
  89. package/lib/components/tree-table/decorated-tree-node.d.ts +43 -0
  90. package/lib/components/tree-table/tree-expansion-model.d.ts +18 -0
  91. package/lib/components/tree-table/tree-inheritance-icon/tree-inheritance-icon.component.d.ts +28 -0
  92. package/lib/components/tree-table/tree-label-cell-renderer/tree-label-cell-renderer.component.d.ts +25 -0
  93. package/lib/components/tree-table/tree-label-column-model.d.ts +20 -0
  94. package/lib/components/tree-table/tree-node.d.ts +3 -0
  95. package/lib/components/tree-table/tree-table-component.d.ts +7 -0
  96. package/lib/components/tree-table/tree-table-model.d.ts +32 -0
  97. package/lib/components/tree-table/tree-to-list-model.d.ts +12 -0
  98. package/lib/components/tree-table/visitable.class.d.ts +22 -0
  99. package/lib/interaction/components/activity-title/activity-title.component.d.ts +5 -0
  100. package/lib/interaction/exports.d.ts +1 -0
  101. package/package.json +1 -1
  102. package/schematics/place-routes/place-builder.js +1 -1
  103. package/schematics/place-routes/place-builder.js.map +1 -1
  104. package/schematics/utils/build-context.js +0 -2
  105. package/schematics/utils/build-context.js.map +1 -1
  106. package/schematics/utils/schematic-tree-file-system.js +6 -2
  107. package/schematics/utils/schematic-tree-file-system.js.map +1 -1
@@ -1,5 +1,5 @@
1
1
  import { DOCUMENT, CommonModule, Location } from '@angular/common';
2
- import { Directive, ElementRef, Inject, Host, Optional, Input, HostListener, NgZone, ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule, Component, ContentChild, InjectionToken, ViewEncapsulation, HostBinding, ViewChildren, SkipSelf, EventEmitter, ViewChild, Output, Self, TemplateRef, ChangeDetectorRef, ContentChildren, ViewContainerRef, Injector, ComponentFactoryResolver, INJECTOR } from '@angular/core';
2
+ import { Directive, ElementRef, Inject, Host, Optional, Input, HostListener, NgZone, ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule, Component, ContentChild, ViewEncapsulation, HostBinding, InjectionToken, ViewChildren, SkipSelf, EventEmitter, ViewChild, Output, Self, TemplateRef, ChangeDetectorRef, ContentChildren, ViewContainerRef, Injector, ComponentFactoryResolver, INJECTOR } from '@angular/core';
3
3
  import { FormsModule } from '@angular/forms';
4
4
  import { MatFormFieldModule } from '@angular/material/form-field';
5
5
  import { MatInputModule } from '@angular/material/input';
@@ -18,12 +18,12 @@ import { MatTableModule } from '@angular/material/table';
18
18
  import { MatTooltipModule } from '@angular/material/tooltip';
19
19
  import { FontAwesomeModule, FaIconLibrary } from '@fortawesome/angular-fontawesome';
20
20
  import { fas } from '@fortawesome/free-solid-svg-icons';
21
- import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, Command, ValueModel, StoreInValueModel, MutableListModel, Disposable, DelegatingListModel, StoreInListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, MultipleSelectionModel, DirtyTrackingForm, DelegatingCommand, Deferred, Trace, Functions } from '@coolon/pectin';
21
+ import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, Command, MutableListModel, StoreInListModel, ValueModel, StoreInValueModel, Disposable, MutableValueModel, DelegatingListModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, MultipleSelectionModel, DirtyTrackingForm, ComputedListModel, DelegatingCommand, Deferred, Trace, Functions } from '@coolon/pectin';
22
22
  import { __decorate, __metadata, __awaiter } from 'tslib';
23
23
  import { Memoize } from '@typescript-plus/fast-memoize-decorator/dist/src';
24
- import _, { isEqual, isNil } from 'lodash';
24
+ import _, { find, filter, each, isNil, isEqual } from 'lodash';
25
25
  import { Enum } from 'typescript-string-enums';
26
- import { assert as assert$1, Opts, lang as lang$1, Klass } from '@coolon/typescript-utilities';
26
+ import { assert as assert$1, Mixin, Opts, lang as lang$1, Klass } from '@coolon/typescript-utilities';
27
27
  import produce from 'immer';
28
28
  import { FlexModule, GridModule } from '@angular/flex-layout';
29
29
  import { MatDialogModule, MatDialog, MAT_DIALOG_DEFAULT_OPTIONS, MatDialogConfig } from '@angular/material/dialog';
@@ -492,7 +492,7 @@ CardContainerComponent.decorators = [
492
492
  { type: Component, args: [{
493
493
  selector: 'aup-card-container',
494
494
  template: "<div class=\"card-container\">\n <ng-content></ng-content>\n\n <div class=\"add-card-container\" *ngIf=\"addCardCommand.enabled.value\" [pectinCommand]=\"addCardCommand\">\n <aup-command-face *ngIf=\"addCardFace\" [faces]=\"[addCardFace]\"></aup-command-face>\n <aup-icon *ngIf=\"!addCardFace\" icon=\"mat:add\"></aup-icon>\n </div>\n\n <div class=\"add-card-template\" *ngIf=\"addCardTemplate\">\n <ng-container [ngTemplateOutlet]=\"addCardTemplate\"></ng-container>\n </div>\n\n</div>\n",
495
- styles: [":root{--aup-default-background:#fff;--aup-default-padding:var(--default-padding,18px)}.router-outlet-container>*{bottom:0;left:0;position:absolute;right:0;top:0}[no-tab-header]>mat-tab-header{display:none}[full-height-tabs] .mat-tab-body-wrapper,mat-tab-group.full-height-tabs .mat-tab-body-wrapper{flex:1}[full-height-tabs] .mat-tab-body-wrapper .mat-tab-body-content,[full-height-tabs] .mat-tab-body-wrapper mat-tab-body,mat-tab-group.full-height-tabs .mat-tab-body-wrapper .mat-tab-body-content,mat-tab-group.full-height-tabs .mat-tab-body-wrapper mat-tab-body{display:flex;flex-direction:column;justify-content:stretch}.dialog-interaction-context,.dialog-interaction-context mat-dialog-container{max-height:95vh!important;max-width:95vw!important}.dialog-interaction-context mat-dialog-container{padding:0}.activity-outlet-wrapper{align-items:stretch;display:flex;flex-direction:column}.aup-popup-interaction-panel{background:var(--aup-default-background,#fff);box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);transition:box-shadow .28s cubic-bezier(.4,0,.2,1)}.aup-input-activity{padding:calc(var(--aup-default-padding)/2)}.aup-input-component{display:block}.aup-input-component input,.aup-input-component mat-form-field{width:100%}.aup-input-component input mat-hint.faux-error,.aup-input-component mat-form-field mat-hint.faux-error{color:#f44336}.aup-input-component.dense mat-form-field .mat-form-field-infix{border-top:none}.aup-input-component.dense mat-form-field .mat-form-field-flex{padding-top:0}.aup-input-component.dense mat-form-field .mat-form-field-wrapper{border-bottom:0;padding-bottom:0}.aup-input-component.dense mat-form-field .mat-form-field-underline{bottom:0}.aup-input-component.dense mat-form-field.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-label-wrapper{display:none}.aup-input-component.dense mat-form-field.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(0)}aup-table-cell-renderer>.aup-input-component .mat-form-field-flex{padding-top:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-infix{width:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-label-wrapper{display:none}aup-table{--default-column-gap:var(--column-gap,24px);--resolved-row-hover-background-color:var(--row-hover-background-color,rgba(0,0,0,0.05))}aup-table .mat-table td.mat-cell:first-of-type,aup-table .mat-table td.mat-footer-cell:first-of-type,aup-table .mat-table th.mat-header-cell:first-of-type{padding-left:0}aup-table .mat-table tr.enable-hover:hover{background-color:var(--resolved-row-hover-background-color)}aup-table .mat-table td.enable-cursor{cursor:pointer}aup-table aup-table-cell-renderer,aup-table aup-table-header-cell-renderer{align-items:stretch;display:flex;flex-direction:column;height:100%;justify-content:center;min-height:47px}aup-table aup-table-cell-renderer.first-column,aup-table aup-table-cell-renderer:not(.first-column),aup-table aup-table-header-cell-renderer.first-column,aup-table aup-table-header-cell-renderer:not(.first-column){padding-left:var(--default-column-gap)}aup-table aup-table-cell-renderer.fillCell{justify-content:stretch;padding-left:0!important}aup-table aup-table-cell-renderer.padChild>:first-child{flex:1;padding-left:var(--default-column-gap)}:root{--aup-command-face-icon-gap:8px;--aup-fa-icon-width:18px;--aup-icon-width:24px}aup-icon{--fa-icon-offset:calc((var(--aup-icon-width) - var(--aup-fa-icon-width))/2);position:relative}aup-icon fa-icon .svg-inline--fa{height:var(--aup-fa-icon-width)!important;left:var(--fa-icon-offset);position:absolute;top:var(--fa-icon-offset);width:var(--aup-fa-icon-width)!important}.mat-menu-panel aup-icon .svg-inline--fa{opacity:.54}:host{--resolved-card-background:var(--card-background,#fcfcfb);--resolved-card-gap:var(--card-gap,16px);--resolved-card-height:var(--card-height,auto);--resolved-card-min-height:var(--card-min-height,auto);--resolved-card-width:var(--card-width,300px);background:var(--resolved-card-background);display:block;flex:1}.card-container{box-sizing:border-box;display:-ms-grid;display:grid;grid-gap:var(--resolved-card-gap);grid-template-columns:repeat(auto-fill,var(--resolved-card-width));grid-template-rows:repeat(auto-fit,minmax(var(--resolved-card-min-height),var(--resolved-card-height)));max-width:100%;min-height:calc(var(--resolved-card-height) + 2*var(--resolved-card-gap));min-width:calc(var(--resolved-card-width) + 2*var(--resolved-card-gap));padding:var(--resolved-card-gap);width:calc((var(--resolved-card-width) + var(--resolved-card-gap))*2 + var(--grid-gap))}.add-card-container{align-items:center;background-color:hsla(0,0%,100%,.8);border:2px dashed rgba(0,0,0,.1);border-radius:6px;box-sizing:border-box;color:rgba(0,0,0,.54);cursor:pointer;display:flex;flex-direction:column;font-weight:300;height:var(--resolved-card-height);justify-content:center;min-height:var(--resolved-card-min-height);transition:all .28s cubic-bezier(.4,0,.2,1);width:var(--resolved-card-width)}.add-card-container mat-icon{font-size:200%}.add-card-container:hover{background-color:#fff;border-color:transparent;color:rgba(0,0,0,.54);transition:box-shadow .28s cubic-bezier(.4,0,.2,1);transition:all .28s cubic-bezier(.4,0,.2,1)}.add-card-container:hover:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.add-card-template-container{align-items:stretch;display:flex;flex-direction:column;height:var(--resolved-card-height);justify-content:stretch;width:var(--resolved-card-width)}"]
495
+ styles: [":root{--aup-default-background:#fff;--aup-default-padding:var(--default-padding,18px)}aup-activity-title{font-family:Roboto,Helvetica Neue,sans-serif;font-size:20px;letter-spacing:normal;line-height:32px;margin-bottom:var(--default-padding)}.router-outlet-container>*{bottom:0;left:0;position:absolute;right:0;top:0}[no-tab-header]>mat-tab-header{display:none}[full-height-tabs] .mat-tab-body-wrapper,mat-tab-group.full-height-tabs .mat-tab-body-wrapper{flex:1}[full-height-tabs] .mat-tab-body-wrapper .mat-tab-body-content,[full-height-tabs] .mat-tab-body-wrapper mat-tab-body,mat-tab-group.full-height-tabs .mat-tab-body-wrapper .mat-tab-body-content,mat-tab-group.full-height-tabs .mat-tab-body-wrapper mat-tab-body{display:flex;flex-direction:column;justify-content:stretch}.dialog-interaction-context,.dialog-interaction-context mat-dialog-container{max-height:95vh!important;max-width:95vw!important}.dialog-interaction-context mat-dialog-container{padding:0}.activity-outlet-wrapper{align-items:stretch;display:flex;flex-direction:column}.aup-popup-interaction-panel{background:var(--aup-default-background,#fff);box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12);transition:box-shadow .28s cubic-bezier(.4,0,.2,1)}.aup-input-activity{padding:calc(var(--aup-default-padding)/2)}.aup-input-component{display:block}.aup-input-component input,.aup-input-component mat-form-field{width:100%}.aup-input-component input mat-hint.faux-error,.aup-input-component mat-form-field mat-hint.faux-error{color:#f44336}.aup-input-component.dense mat-form-field .mat-form-field-infix{border-top:none}.aup-input-component.dense mat-form-field .mat-form-field-flex{padding-top:0}.aup-input-component.dense mat-form-field .mat-form-field-wrapper{border-bottom:0;padding-bottom:0}.aup-input-component.dense mat-form-field .mat-form-field-underline{bottom:0}.aup-input-component.dense mat-form-field.mat-form-field-can-float.mat-form-field-should-float .mat-form-field-label-wrapper{display:none}.aup-input-component.dense mat-form-field.mat-form-field-appearance-standard.mat-form-field-has-label .mat-select:not(.mat-select-empty) .mat-select-arrow-wrapper{transform:translateY(0)}aup-table-cell-renderer>.aup-input-component .mat-form-field-flex{padding-top:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-infix{width:0}aup-table-cell-renderer>.aup-input-component .mat-form-field-label-wrapper{display:none}aup-table{--default-column-gap:var(--column-gap,24px);--resolved-row-hover-background-color:var(--row-hover-background-color,rgba(0,0,0,0.05))}aup-table .mat-table td.mat-cell:first-of-type,aup-table .mat-table td.mat-footer-cell:first-of-type,aup-table .mat-table th.mat-header-cell:first-of-type{padding-left:0}aup-table .mat-table tr.enable-hover:hover{background-color:var(--resolved-row-hover-background-color)}aup-table .mat-table td.enable-cursor{cursor:pointer}aup-table aup-table-cell-renderer,aup-table aup-table-header-cell-renderer{align-items:stretch;display:flex;flex-direction:column;height:100%;justify-content:center;min-height:47px}aup-table aup-table-cell-renderer.first-column,aup-table aup-table-cell-renderer:not(.first-column),aup-table aup-table-header-cell-renderer.first-column,aup-table aup-table-header-cell-renderer:not(.first-column){padding-left:var(--default-column-gap)}aup-table aup-table-cell-renderer.fillCell{justify-content:stretch;padding-left:0!important}aup-table aup-table-cell-renderer.padChild>:first-child{flex:1;padding-left:var(--default-column-gap)}:root{--aup-command-face-icon-gap:8px;--aup-fa-icon-width:18px;--aup-icon-width:24px}aup-icon{--fa-icon-offset:calc((var(--aup-icon-width) - var(--aup-fa-icon-width))/2);position:relative}aup-icon fa-icon .svg-inline--fa{height:var(--aup-fa-icon-width)!important;left:var(--fa-icon-offset);position:absolute;top:var(--fa-icon-offset);width:var(--aup-fa-icon-width)!important}.mat-menu-panel aup-icon .svg-inline--fa{opacity:.54}:host{--resolved-card-background:var(--card-background,#fcfcfb);--resolved-card-gap:var(--card-gap,16px);--resolved-card-height:var(--card-height,auto);--resolved-card-min-height:var(--card-min-height,auto);--resolved-card-width:var(--card-width,300px);background:var(--resolved-card-background);display:block;flex:1}.card-container{box-sizing:border-box;display:-ms-grid;display:grid;grid-gap:var(--resolved-card-gap);grid-template-columns:repeat(auto-fill,var(--resolved-card-width));grid-template-rows:repeat(auto-fit,minmax(var(--resolved-card-min-height),var(--resolved-card-height)));max-width:100%;min-height:calc(var(--resolved-card-height) + 2*var(--resolved-card-gap));min-width:calc(var(--resolved-card-width) + 2*var(--resolved-card-gap));padding:var(--resolved-card-gap);width:calc((var(--resolved-card-width) + var(--resolved-card-gap))*2 + var(--grid-gap))}.add-card-container{align-items:center;background-color:hsla(0,0%,100%,.8);border:2px dashed rgba(0,0,0,.1);border-radius:6px;box-sizing:border-box;color:rgba(0,0,0,.54);cursor:pointer;display:flex;flex-direction:column;font-weight:300;height:var(--resolved-card-height);justify-content:center;min-height:var(--resolved-card-min-height);transition:all .28s cubic-bezier(.4,0,.2,1);width:var(--resolved-card-width)}.add-card-container mat-icon{font-size:200%}.add-card-container:hover{background-color:#fff;border-color:transparent;color:rgba(0,0,0,.54);transition:box-shadow .28s cubic-bezier(.4,0,.2,1);transition:all .28s cubic-bezier(.4,0,.2,1)}.add-card-container:hover:hover{box-shadow:0 2px 4px -1px rgba(0,0,0,.2),0 4px 5px 0 rgba(0,0,0,.14),0 1px 10px 0 rgba(0,0,0,.12)}.add-card-template-container{align-items:stretch;display:flex;flex-direction:column;height:var(--resolved-card-height);justify-content:stretch;width:var(--resolved-card-width)}"]
496
496
  },] }
497
497
  ];
498
498
  CardContainerComponent.ctorParameters = () => [];
@@ -506,10 +506,68 @@ __decorate([
506
506
  __metadata("design:type", Command)
507
507
  ], CardContainerComponent.prototype, "addCardCommand", void 0);
508
508
 
509
- var TrackBy;
510
- (function (TrackBy) {
511
- TrackBy.byIndex = (data, index) => index;
512
- })(TrackBy || (TrackBy = {}));
509
+ /**
510
+ * Custom CSS:
511
+ * @example
512
+ * root: { // globally
513
+ * --aup-command-face-icon-gap: 8px;
514
+ * }
515
+ * aup-command-face { // per instance
516
+ * --icon-gap: 4px;
517
+ * }
518
+ */
519
+ class CommandFaceComponent extends DisposableComponent {
520
+ constructor() {
521
+ super();
522
+ this.facesModel = new MutableListModel();
523
+ this.ignoreIcon = false;
524
+ this.ignoreText = false;
525
+ this.includeMissingIconInLayout = false;
526
+ const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
527
+ this.faceAdapters = chain(this.facesModel).map(face => new CommandFace.Adapter(face));
528
+ const activeFace = this.faceAdapters.first();
529
+ this.activeIcon = activeFace.pluck("icon");
530
+ this.activeColor = activeFace.pluck("color");
531
+ }
532
+ get requiresMissingIconInLayout() {
533
+ return this.includeMissingIconInLayout && !this.activeIcon.value;
534
+ }
535
+ ngOnInit() {
536
+ }
537
+ shouldIncludeIcon(face) {
538
+ return (!this.ignoreIcon && face.icon) || this.includeMissingIconInLayout;
539
+ }
540
+ hasIconStart(face) {
541
+ return this.shouldIncludeIcon(face) && (!face.iconPosition || face.iconPosition === CommandFace.Position.START);
542
+ }
543
+ hasIconEnd(face) {
544
+ return this.shouldIncludeIcon(face) && face.iconPosition === CommandFace.Position.END;
545
+ }
546
+ get color() {
547
+ return this.activeColor.value;
548
+ }
549
+ }
550
+ CommandFaceComponent.decorators = [
551
+ { type: Component, args: [{
552
+ selector: 'aup-command-face',
553
+ template: "<div class=\"face-container\" *ngFor=\"let face of faceAdapters.value\">\n <aup-icon *ngIf=\"hasIconStart(face)\" [icon]=\"face.icon\"></aup-icon>\n <span *ngIf=\"face.text\">{{face.text}}</span>\n <aup-icon *ngIf=\"hasIconEnd(face)\" [icon]=\"face.icon\"></aup-icon>\n</div>\n",
554
+ encapsulation: ViewEncapsulation.None,
555
+ styles: ["aup-command-face{--icon-gap:var(--aup-command-face-icon-gap);display:-ms-inline-grid;display:inline-grid}aup-command-face>.face-container{-ms-grid-column:1;-ms-grid-row:1;align-items:center;display:inline-flex;flex-direction:row;grid-column:1;grid-row:1}aup-command-face>.face-container:not(:first-child){visibility:hidden}aup-command-face>.face-container *+*{margin-left:var(--icon-gap)}aup-command-face.hide-icon aup-icon{visibility:hidden}aup-command-face.centered{justify-items:center}"]
556
+ },] }
557
+ ];
558
+ CommandFaceComponent.ctorParameters = () => [];
559
+ CommandFaceComponent.propDecorators = {
560
+ _rawFaces: [{ type: Input, args: ['faces',] }],
561
+ ignoreIcon: [{ type: Input }],
562
+ ignoreText: [{ type: Input }],
563
+ includeMissingIconInLayout: [{ type: Input }],
564
+ requiresMissingIconInLayout: [{ type: HostBinding, args: ['class.hide-icon',] }],
565
+ color: [{ type: HostBinding, args: ['attr.color',] }]
566
+ };
567
+ __decorate([
568
+ StoreInListModel('facesModel'),
569
+ __metadata("design:type", Array)
570
+ ], CommandFaceComponent.prototype, "_rawFaces", void 0);
513
571
 
514
572
  class PopupAwareComponent extends DisposableComponent {
515
573
  constructor(element, parent) {
@@ -607,92 +665,23 @@ __decorate([
607
665
  __metadata("design:type", Object)
608
666
  ], CommandComponent.prototype, "busyFace", void 0);
609
667
 
610
- class CommandContainer extends GarbageCollector {
611
- constructor(parent) {
612
- super();
613
- this.parent = parent;
614
- }
615
- get depth() {
616
- return this.hasParent() ? this.parent.depth + 1 : 0;
617
- }
618
- hasParent() {
619
- return !!this.parent;
620
- }
621
- get orientation() {
622
- return CommandContainer.Orientation.VERTICAL;
623
- }
624
- }
625
- (function (CommandContainer) {
626
- CommandContainer.Orientation = Enum({ HORIZONTAL: 'horizontal', VERTICAL: 'vertical' });
627
- })(CommandContainer || (CommandContainer = {}));
628
-
629
668
  /**
630
669
  *
631
670
  */
632
- class ToolBarComponent extends CommandContainer {
671
+ class FlexComponent extends DisposableComponent {
633
672
  constructor() {
634
673
  super();
635
674
  }
636
- get orientation() {
637
- return CommandContainer.Orientation.HORIZONTAL;
638
- }
639
- // @Trace()
640
- ngOnInit() {
641
- }
642
- // @Trace()
643
- ngAfterContentInit() {
644
- // this.group.initialise();
645
- }
646
- // @Trace()
647
- ngAfterViewInit() {
648
- }
649
- }
650
- ToolBarComponent.decorators = [
651
- { type: Component, args: [{
652
- selector: 'aup-tool-bar',
653
- template: '<div class="toolbar-content"><ng-content></ng-content></div>',
654
- encapsulation: ViewEncapsulation.None,
655
- styles: [":host{display:inline-block}.toolbar-content{align-items:center;display:inline-flex;flex-direction:row}.toolbar-content>aup-separator{-ms-grid-row-align:stretch;align-self:stretch;margin:4px 0 4px 8px}.toolbar-content>aup-flex{flex:1}.toolbar-content>*+*{margin-left:8px}"]
656
- },] }
657
- ];
658
- ToolBarComponent.ctorParameters = () => [];
659
-
660
- /**
661
- *
662
- */
663
- class SeparatorComponent extends PopupAwareComponent {
664
- constructor(element, popupContainer, containerParent) {
665
- super(element, popupContainer);
666
- this.containerParent = containerParent;
667
- }
668
- isHorizontalContainer() {
669
- return this.containerParent instanceof ToolBarComponent && this.containerParent.orientation === CommandContainer.Orientation.HORIZONTAL;
670
- }
671
675
  ngOnInit() {
672
676
  }
673
677
  }
674
- SeparatorComponent.decorators = [
678
+ FlexComponent.decorators = [
675
679
  { type: Component, args: [{
676
- selector: 'aup-separator',
677
- template: `
678
- <mat-divider [vertical]="!isHorizontalContainer()"></mat-divider>`,
679
- styles: [`:host {
680
- }`,
681
- `:host(.horizontal-container) {
682
- display: inline-flex;
683
- flex-direction: row;
684
- align-items: stretch;
685
- }`]
680
+ selector: 'aup-flex',
681
+ template: ``
686
682
  },] }
687
683
  ];
688
- SeparatorComponent.ctorParameters = () => [
689
- { type: ElementRef },
690
- { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [POPUP_CONTAINER,] }] },
691
- { type: CommandContainer, decorators: [{ type: Optional }] }
692
- ];
693
- SeparatorComponent.propDecorators = {
694
- isHorizontalContainer: [{ type: HostBinding, args: ['class.horizontal-container',] }]
695
- };
684
+ FlexComponent.ctorParameters = () => [];
696
685
 
697
686
  /**
698
687
  *
@@ -760,241 +749,252 @@ AbstractPopupMenuComponent.propDecorators = {
760
749
  /**
761
750
  *
762
751
  */
763
- class PopupMenuComponent extends AbstractPopupMenuComponent {
752
+ class MoreMenuComponent extends AbstractPopupMenuComponent {
764
753
  constructor(element, parent) {
765
754
  super(element, parent);
755
+ this.tooltipModel = new MutableValueModel();
766
756
  const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
767
- // group.faceListModel = chain(this.faceModel).mapToList(face => [face]);
757
+ this.faceModelDelegate.setDelegate(chain(this.tooltipModel).map(tooltip => {
758
+ return {
759
+ icon: () => 'mat:more_vert',
760
+ tooltip() {
761
+ return tooltip;
762
+ }
763
+ };
764
+ }, { allowNil: true }));
765
+ }
766
+ get face() {
767
+ return this.faceModelDelegate.value;
768
768
  }
769
769
  }
770
- PopupMenuComponent.decorators = [
770
+ MoreMenuComponent.decorators = [
771
771
  { type: Component, args: [{
772
- selector: 'aup-popup-menu',
772
+ selector: 'aup-more-menu',
773
773
  template: "<div class=\"content\" style=\"display: none\">\n <ng-content></ng-content>\n</div>\n<ng-container *ngIf=\"isRoot()\">\n <ng-container *ngIf=\"faceAdapter.text\" [ngSwitch]=\"faceAdapter.style\">\n <ng-container *ngSwitchCase=\"'stroked'\">\n <button matMenuTrigger\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"faceAdapter.tooltip\"\n [color]=\"faceAdapter.color\"\n mat-stroked-button>\n <aup-command-face [faces]=\"[face]\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #subMenu\n [parent]=\"this\"\n (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'raised'\">\n <button matMenuTrigger\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"faceAdapter.tooltip\"\n [color]=\"faceAdapter.color\"\n mat-raised-button>\n <aup-command-face [faces]=\"[face]\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #subMenu\n [parent]=\"this\"\n (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <button matMenuTrigger\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"faceAdapter.tooltip\"\n [color]=\"faceAdapter.color\"\n mat-button>\n <aup-command-face [faces]=\"[face]\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #subMenu [parent]=\"this\" (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n\n </ng-container>\n\n <ng-container *ngIf=\"!faceAdapter.text\">\n <button matMenuTrigger\n mat-icon-button\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"faceAdapter.tooltip\"\n [color]=\"faceAdapter.color\"\n >\n <aup-command-face [faces]=\"[face]\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #subMenu\n [parent]=\"this\"\n (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n</ng-container>\n",
774
774
  providers: [
775
- { provide: POPUP_CONTAINER, useExisting: PopupMenuComponent }
775
+ { provide: POPUP_CONTAINER, useExisting: MoreMenuComponent }
776
776
  ]
777
777
  },] }
778
778
  ];
779
- PopupMenuComponent.ctorParameters = () => [
779
+ MoreMenuComponent.ctorParameters = () => [
780
780
  { type: ElementRef },
781
781
  { type: undefined, decorators: [{ type: Inject, args: [POPUP_CONTAINER,] }, { type: Optional }, { type: SkipSelf }] }
782
782
  ];
783
- PopupMenuComponent.propDecorators = {
784
- faceModel: [{ type: Input }],
785
- face: [{ type: Input }]
783
+ MoreMenuComponent.propDecorators = {
784
+ tooltip: [{ type: Input }]
786
785
  };
787
786
  __decorate([
788
- TrackExternal({ delegateTo: 'faceModelDelegate' }),
789
- __metadata("design:type", ValueModel)
790
- ], PopupMenuComponent.prototype, "faceModel", void 0);
791
- __decorate([
792
- StoreInValueModel('faceModel'),
793
- __metadata("design:type", Object)
794
- ], PopupMenuComponent.prototype, "face", void 0);
787
+ StoreInValueModel('tooltipModel'),
788
+ __metadata("design:type", String)
789
+ ], MoreMenuComponent.prototype, "tooltip", void 0);
795
790
 
796
- class PopupMenuRendererComponent extends DisposableComponent {
797
- constructor() {
791
+ var TrackBy;
792
+ (function (TrackBy) {
793
+ TrackBy.byIndex = (data, index) => index;
794
+ })(TrackBy || (TrackBy = {}));
795
+
796
+ class CommandContainer extends GarbageCollector {
797
+ constructor(parent) {
798
798
  super();
799
- this._childList = new DelegatingListModel();
800
- this.commandFired = new EventEmitter();
801
- this.TrackBy = TrackBy;
802
- const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
803
- // this.children = chain(this.groupViewDataModel).pluckList('children');
804
- // this.hasMixedIcons = chain(this.groupViewDataModel).pluck('hasMixedIcons');
805
- const faces = chain(this._childList).map(child => {
806
- return child.getFace();
807
- }).rejectNil();
808
- const icons = faces.select(face => !!CommandFace.getIconOf(face));
809
- const iconCount = icons.count();
810
- const totalFaces = faces.count();
811
- this.hasMixedIcons = valueOf.all(iconCount.isGreaterThan(0), totalFaces.doesNotEqual(iconCount)).areTruthy();
812
- }
813
- get parent() {
814
- return this._parentComponent;
815
- }
816
- set parent(comp) {
817
- this._parentComponent = comp;
818
- this._childList.setDelegate(comp.children);
819
- }
820
- get children() {
821
- return this.parent.children.value;
822
- }
823
- executeCommand(data) {
824
- if (this.isCommand(data)) {
825
- data.command.execute().finally(() => {
826
- this.commandFired.emit();
827
- });
828
- }
829
- }
830
- isEnabled(data) {
831
- return true; //ViewData.getCommand(data).enabled.value;
832
- }
833
- // @Trace()
834
- onCommandFired() {
835
- this.commandFired.emit();
836
- this.triggers.forEach(trigger => {
837
- if (trigger.menuOpen) {
838
- trigger.closeMenu();
839
- }
840
- });
841
- }
842
- isCommand(child) {
843
- return child instanceof CommandComponent;
844
- }
845
- isPopupMenu(child) {
846
- return child instanceof AbstractPopupMenuComponent;
799
+ this.parent = parent;
847
800
  }
848
- isSeparator(child) {
849
- return child instanceof SeparatorComponent;
801
+ get depth() {
802
+ return this.hasParent() ? this.parent.depth + 1 : 0;
850
803
  }
851
- getTooltip(child) {
852
- return this.isCommand(child) ? CommandFace.getTooltipOf(child.face) : undefined;
804
+ hasParent() {
805
+ return !!this.parent;
853
806
  }
854
- getFaces(child) {
855
- return this.isCommand(child) ?
856
- child.faces.value :
857
- this.isPopupMenu(child) ?
858
- [child.faceAdapter.face] :
859
- undefined;
807
+ get orientation() {
808
+ return CommandContainer.Orientation.VERTICAL;
860
809
  }
861
810
  }
862
- PopupMenuRendererComponent.decorators = [
863
- { type: Component, args: [{
864
- selector: 'aup-popup-menu-renderer',
865
- template: "<mat-menu #menu [xPosition]=\"parent.xPosition\" [yPosition]=\"parent.yPosition\">\n <ng-template matMenuContent>\n <ng-container *ngFor=\"let child of children; trackBy: TrackBy.byIndex\" >\n <button *ngIf=\"isCommand(child)\"\n (click)=\"executeCommand(child)\"\n [disabled]=\"!isEnabled(child)\"\n [matTooltip]=\"getTooltip(child)\"\n mat-menu-item>\n <aup-command-face [faces]=\"getFaces(child)\"\n [includeMissingIconInLayout]=\"hasMixedIcons.value\"></aup-command-face>\n </button>\n\n <ng-container *ngIf=\"isPopupMenu(child)\">\n <button mat-menu-item\n matMenuTrigger\n [matMenuTriggerFor]=\"innerPanel.menuComponent\"\n >\n <aup-command-face [faces]=\"getFaces(child)\"\n [includeMissingIconInLayout]=\"hasMixedIcons.value\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #innerPanel\n [parent]=\"child\"\n (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n\n <mat-divider *ngIf=\"isSeparator(child)\"></mat-divider>\n\n </ng-container>\n\n </ng-template>\n</mat-menu>\n"
866
- },] }
867
- ];
868
- PopupMenuRendererComponent.ctorParameters = () => [];
869
- PopupMenuRendererComponent.propDecorators = {
870
- parent: [{ type: Input }],
871
- menuComponent: [{ type: ViewChild, args: ['menu', { static: true },] }],
872
- commandFired: [{ type: Output }],
873
- triggers: [{ type: ViewChildren, args: [MatMenuTrigger,] }]
874
- };
811
+ (function (CommandContainer) {
812
+ CommandContainer.Orientation = Enum({ HORIZONTAL: 'horizontal', VERTICAL: 'vertical' });
813
+ })(CommandContainer || (CommandContainer = {}));
875
814
 
876
815
  /**
877
- * Custom CSS:
878
- * @example
879
- * root: { // globally
880
- * --aup-command-face-icon-gap: 8px;
881
- * }
882
- * aup-command-face { // per instance
883
- * --icon-gap: 4px;
884
- * }
816
+ *
885
817
  */
886
- class CommandFaceComponent extends DisposableComponent {
818
+ class ToolBarComponent extends CommandContainer {
887
819
  constructor() {
888
820
  super();
889
- this.facesModel = new MutableListModel();
890
- this.ignoreIcon = false;
891
- this.ignoreText = false;
892
- this.includeMissingIconInLayout = false;
893
- const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
894
- this.faceAdapters = chain(this.facesModel).map(face => new CommandFace.Adapter(face));
895
- const activeFace = this.faceAdapters.first();
896
- this.activeIcon = activeFace.pluck("icon");
897
- this.activeColor = activeFace.pluck("color");
898
821
  }
899
- get requiresMissingIconInLayout() {
900
- return this.includeMissingIconInLayout && !this.activeIcon.value;
822
+ get orientation() {
823
+ return CommandContainer.Orientation.HORIZONTAL;
901
824
  }
825
+ // @Trace()
902
826
  ngOnInit() {
903
827
  }
904
- shouldIncludeIcon(face) {
905
- return (!this.ignoreIcon && face.icon) || this.includeMissingIconInLayout;
906
- }
907
- hasIconStart(face) {
908
- return this.shouldIncludeIcon(face) && (!face.iconPosition || face.iconPosition === CommandFace.Position.START);
909
- }
910
- hasIconEnd(face) {
911
- return this.shouldIncludeIcon(face) && face.iconPosition === CommandFace.Position.END;
828
+ // @Trace()
829
+ ngAfterContentInit() {
830
+ // this.group.initialise();
912
831
  }
913
- get color() {
914
- return this.activeColor.value;
832
+ // @Trace()
833
+ ngAfterViewInit() {
915
834
  }
916
835
  }
917
- CommandFaceComponent.decorators = [
836
+ ToolBarComponent.decorators = [
918
837
  { type: Component, args: [{
919
- selector: 'aup-command-face',
920
- template: "<div class=\"face-container\" *ngFor=\"let face of faceAdapters.value\">\n <aup-icon *ngIf=\"hasIconStart(face)\" [icon]=\"face.icon\"></aup-icon>\n <span *ngIf=\"face.text\">{{face.text}}</span>\n <aup-icon *ngIf=\"hasIconEnd(face)\" [icon]=\"face.icon\"></aup-icon>\n</div>\n",
838
+ selector: 'aup-tool-bar',
839
+ template: '<div class="toolbar-content"><ng-content></ng-content></div>',
921
840
  encapsulation: ViewEncapsulation.None,
922
- styles: ["aup-command-face{--icon-gap:var(--aup-command-face-icon-gap);display:-ms-inline-grid;display:inline-grid}aup-command-face>.face-container{-ms-grid-column:1;-ms-grid-row:1;align-items:center;display:inline-flex;flex-direction:row;grid-column:1;grid-row:1}aup-command-face>.face-container:not(:first-child){visibility:hidden}aup-command-face>.face-container *+*{margin-left:var(--icon-gap)}aup-command-face.hide-icon aup-icon{visibility:hidden}aup-command-face.centered{justify-items:center}"]
841
+ styles: [":host{display:inline-block}.toolbar-content{align-items:center;display:inline-flex;flex-direction:row}.toolbar-content>aup-separator{-ms-grid-row-align:stretch;align-self:stretch;margin:4px 0 4px 8px}.toolbar-content>aup-flex{flex:1}.toolbar-content>*+*{margin-left:8px}"]
923
842
  },] }
924
843
  ];
925
- CommandFaceComponent.ctorParameters = () => [];
926
- CommandFaceComponent.propDecorators = {
927
- _rawFaces: [{ type: Input, args: ['faces',] }],
928
- ignoreIcon: [{ type: Input }],
929
- ignoreText: [{ type: Input }],
930
- includeMissingIconInLayout: [{ type: Input }],
931
- requiresMissingIconInLayout: [{ type: HostBinding, args: ['class.hide-icon',] }],
932
- color: [{ type: HostBinding, args: ['attr.color',] }]
933
- };
934
- __decorate([
935
- StoreInListModel('facesModel'),
936
- __metadata("design:type", Array)
937
- ], CommandFaceComponent.prototype, "_rawFaces", void 0);
844
+ ToolBarComponent.ctorParameters = () => [];
938
845
 
939
846
  /**
940
847
  *
941
848
  */
942
- class FlexComponent extends DisposableComponent {
943
- constructor() {
944
- super();
849
+ class SeparatorComponent extends PopupAwareComponent {
850
+ constructor(element, popupContainer, containerParent) {
851
+ super(element, popupContainer);
852
+ this.containerParent = containerParent;
853
+ }
854
+ isHorizontalContainer() {
855
+ return this.containerParent instanceof ToolBarComponent && this.containerParent.orientation === CommandContainer.Orientation.HORIZONTAL;
945
856
  }
946
857
  ngOnInit() {
947
858
  }
948
859
  }
949
- FlexComponent.decorators = [
860
+ SeparatorComponent.decorators = [
950
861
  { type: Component, args: [{
951
- selector: 'aup-flex',
952
- template: ``
862
+ selector: 'aup-separator',
863
+ template: `
864
+ <mat-divider [vertical]="!isHorizontalContainer()"></mat-divider>`,
865
+ styles: [`:host {
866
+ }`,
867
+ `:host(.horizontal-container) {
868
+ display: inline-flex;
869
+ flex-direction: row;
870
+ align-items: stretch;
871
+ }`]
953
872
  },] }
954
873
  ];
955
- FlexComponent.ctorParameters = () => [];
874
+ SeparatorComponent.ctorParameters = () => [
875
+ { type: ElementRef },
876
+ { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [POPUP_CONTAINER,] }] },
877
+ { type: CommandContainer, decorators: [{ type: Optional }] }
878
+ ];
879
+ SeparatorComponent.propDecorators = {
880
+ isHorizontalContainer: [{ type: HostBinding, args: ['class.horizontal-container',] }]
881
+ };
956
882
 
957
- /**
958
- *
959
- */
960
- class MoreMenuComponent extends AbstractPopupMenuComponent {
961
- constructor(element, parent) {
962
- super(element, parent);
963
- this.tooltipModel = new MutableValueModel();
964
- const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
965
- this.faceModelDelegate.setDelegate(chain(this.tooltipModel).map(tooltip => {
966
- return {
967
- icon: () => 'mat:more_vert',
968
- tooltip() {
969
- return tooltip;
970
- }
971
- };
972
- }, { allowNil: true }));
973
- }
974
- get face() {
975
- return this.faceModelDelegate.value;
883
+ /**
884
+ *
885
+ */
886
+ class PopupMenuComponent extends AbstractPopupMenuComponent {
887
+ constructor(element, parent) {
888
+ super(element, parent);
889
+ const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
890
+ // group.faceListModel = chain(this.faceModel).mapToList(face => [face]);
976
891
  }
977
892
  }
978
- MoreMenuComponent.decorators = [
893
+ PopupMenuComponent.decorators = [
979
894
  { type: Component, args: [{
980
- selector: 'aup-more-menu',
895
+ selector: 'aup-popup-menu',
981
896
  template: "<div class=\"content\" style=\"display: none\">\n <ng-content></ng-content>\n</div>\n<ng-container *ngIf=\"isRoot()\">\n <ng-container *ngIf=\"faceAdapter.text\" [ngSwitch]=\"faceAdapter.style\">\n <ng-container *ngSwitchCase=\"'stroked'\">\n <button matMenuTrigger\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"faceAdapter.tooltip\"\n [color]=\"faceAdapter.color\"\n mat-stroked-button>\n <aup-command-face [faces]=\"[face]\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #subMenu\n [parent]=\"this\"\n (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n\n <ng-container *ngSwitchCase=\"'raised'\">\n <button matMenuTrigger\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"faceAdapter.tooltip\"\n [color]=\"faceAdapter.color\"\n mat-raised-button>\n <aup-command-face [faces]=\"[face]\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #subMenu\n [parent]=\"this\"\n (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <button matMenuTrigger\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"faceAdapter.tooltip\"\n [color]=\"faceAdapter.color\"\n mat-button>\n <aup-command-face [faces]=\"[face]\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #subMenu [parent]=\"this\" (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n\n </ng-container>\n\n <ng-container *ngIf=\"!faceAdapter.text\">\n <button matMenuTrigger\n mat-icon-button\n [matMenuTriggerFor]=\"subMenu.menuComponent\"\n [matTooltip]=\"faceAdapter.tooltip\"\n [color]=\"faceAdapter.color\"\n >\n <aup-command-face [faces]=\"[face]\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #subMenu\n [parent]=\"this\"\n (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n</ng-container>\n",
982
897
  providers: [
983
- { provide: POPUP_CONTAINER, useExisting: MoreMenuComponent }
898
+ { provide: POPUP_CONTAINER, useExisting: PopupMenuComponent }
984
899
  ]
985
900
  },] }
986
901
  ];
987
- MoreMenuComponent.ctorParameters = () => [
902
+ PopupMenuComponent.ctorParameters = () => [
988
903
  { type: ElementRef },
989
904
  { type: undefined, decorators: [{ type: Inject, args: [POPUP_CONTAINER,] }, { type: Optional }, { type: SkipSelf }] }
990
905
  ];
991
- MoreMenuComponent.propDecorators = {
992
- tooltip: [{ type: Input }]
906
+ PopupMenuComponent.propDecorators = {
907
+ faceModel: [{ type: Input }],
908
+ face: [{ type: Input }]
993
909
  };
994
910
  __decorate([
995
- StoreInValueModel('tooltipModel'),
996
- __metadata("design:type", String)
997
- ], MoreMenuComponent.prototype, "tooltip", void 0);
911
+ TrackExternal({ delegateTo: 'faceModelDelegate' }),
912
+ __metadata("design:type", ValueModel)
913
+ ], PopupMenuComponent.prototype, "faceModel", void 0);
914
+ __decorate([
915
+ StoreInValueModel('faceModel'),
916
+ __metadata("design:type", Object)
917
+ ], PopupMenuComponent.prototype, "face", void 0);
918
+
919
+ class PopupMenuRendererComponent extends DisposableComponent {
920
+ constructor() {
921
+ super();
922
+ this._childList = new DelegatingListModel();
923
+ this.commandFired = new EventEmitter();
924
+ this.TrackBy = TrackBy;
925
+ const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
926
+ // this.children = chain(this.groupViewDataModel).pluckList('children');
927
+ // this.hasMixedIcons = chain(this.groupViewDataModel).pluck('hasMixedIcons');
928
+ const faces = chain(this._childList).map(child => {
929
+ return child.getFace();
930
+ }).rejectNil();
931
+ const icons = faces.select(face => !!CommandFace.getIconOf(face));
932
+ const iconCount = icons.count();
933
+ const totalFaces = faces.count();
934
+ this.hasMixedIcons = valueOf.all(iconCount.isGreaterThan(0), totalFaces.doesNotEqual(iconCount)).areTruthy();
935
+ }
936
+ get parent() {
937
+ return this._parentComponent;
938
+ }
939
+ set parent(comp) {
940
+ this._parentComponent = comp;
941
+ this._childList.setDelegate(comp.children);
942
+ }
943
+ get children() {
944
+ return this.parent.children.value;
945
+ }
946
+ executeCommand(data) {
947
+ if (this.isCommand(data)) {
948
+ data.command.execute().finally(() => {
949
+ this.commandFired.emit();
950
+ });
951
+ }
952
+ }
953
+ isEnabled(data) {
954
+ return true; //ViewData.getCommand(data).enabled.value;
955
+ }
956
+ // @Trace()
957
+ onCommandFired() {
958
+ this.commandFired.emit();
959
+ this.triggers.forEach(trigger => {
960
+ if (trigger.menuOpen) {
961
+ trigger.closeMenu();
962
+ }
963
+ });
964
+ }
965
+ isCommand(child) {
966
+ return child instanceof CommandComponent;
967
+ }
968
+ isPopupMenu(child) {
969
+ return child instanceof AbstractPopupMenuComponent;
970
+ }
971
+ isSeparator(child) {
972
+ return child instanceof SeparatorComponent;
973
+ }
974
+ getTooltip(child) {
975
+ return this.isCommand(child) ? CommandFace.getTooltipOf(child.face) : undefined;
976
+ }
977
+ getFaces(child) {
978
+ return this.isCommand(child) ?
979
+ child.faces.value :
980
+ this.isPopupMenu(child) ?
981
+ [child.faceAdapter.face] :
982
+ undefined;
983
+ }
984
+ }
985
+ PopupMenuRendererComponent.decorators = [
986
+ { type: Component, args: [{
987
+ selector: 'aup-popup-menu-renderer',
988
+ template: "<mat-menu #menu [xPosition]=\"parent.xPosition\" [yPosition]=\"parent.yPosition\">\n <ng-template matMenuContent>\n <ng-container *ngFor=\"let child of children; trackBy: TrackBy.byIndex\" >\n <button *ngIf=\"isCommand(child)\"\n (click)=\"executeCommand(child)\"\n [disabled]=\"!isEnabled(child)\"\n [matTooltip]=\"getTooltip(child)\"\n mat-menu-item>\n <aup-command-face [faces]=\"getFaces(child)\"\n [includeMissingIconInLayout]=\"hasMixedIcons.value\"></aup-command-face>\n </button>\n\n <ng-container *ngIf=\"isPopupMenu(child)\">\n <button mat-menu-item\n matMenuTrigger\n [matMenuTriggerFor]=\"innerPanel.menuComponent\"\n >\n <aup-command-face [faces]=\"getFaces(child)\"\n [includeMissingIconInLayout]=\"hasMixedIcons.value\"></aup-command-face>\n </button>\n <aup-popup-menu-renderer #innerPanel\n [parent]=\"child\"\n (commandFired)=\"onCommandFired()\"></aup-popup-menu-renderer>\n </ng-container>\n\n <mat-divider *ngIf=\"isSeparator(child)\"></mat-divider>\n\n </ng-container>\n\n </ng-template>\n</mat-menu>\n"
989
+ },] }
990
+ ];
991
+ PopupMenuRendererComponent.ctorParameters = () => [];
992
+ PopupMenuRendererComponent.propDecorators = {
993
+ parent: [{ type: Input }],
994
+ menuComponent: [{ type: ViewChild, args: ['menu', { static: true },] }],
995
+ commandFired: [{ type: Output }],
996
+ triggers: [{ type: ViewChildren, args: [MatMenuTrigger,] }]
997
+ };
998
998
 
999
999
  class FocusContainerComponent extends DisposableComponent {
1000
1000
  constructor(focusManager) {
@@ -2006,10 +2006,13 @@ const noop = () => {
2006
2006
  const ɵ0 = noop;
2007
2007
  const CELL_RENDERER_COMPONENT_ROW_CACHE = Symbol("aup-cell-renderer:row-data-cache");
2008
2008
  class ColumnModel {
2009
- constructor(columnId, defaults) {
2009
+ constructor(columnId, textPropertiesProvider) {
2010
2010
  this.columnId = columnId;
2011
- this.defaults = defaults;
2011
+ this.textPropertiesProvider = textPropertiesProvider;
2012
2012
  this._selectRowOnClick = undefined;
2013
+ this.installHeaderRenderer();
2014
+ }
2015
+ installHeaderRenderer() {
2013
2016
  this.cellHeaderRenderer(DefaultHeaderCellRendererComponent, (component, column) => {
2014
2017
  component.headerText = column.getHeaderText();
2015
2018
  });
@@ -2022,7 +2025,7 @@ class ColumnModel {
2022
2025
  return this.columnId;
2023
2026
  }
2024
2027
  getColumnTextProperties() {
2025
- return this._columnTextProperties || this.defaults.getColumnTextProperties(this);
2028
+ return this._columnTextProperties || this.textPropertiesProvider();
2026
2029
  }
2027
2030
  textProperties(columnTextProperties) {
2028
2031
  this._columnTextProperties = columnTextProperties;
@@ -2311,7 +2314,6 @@ class SelectionColumnModel extends ColumnModel {
2311
2314
  }
2312
2315
  }
2313
2316
 
2314
- var TableModel_1;
2315
2317
  // export type StringPropertiesOf<T> = { [K in keyof T]: T[K] extends string ? K : never }[keyof T];
2316
2318
  // export type NumberPropertiesOf<T> = { [K in keyof T]: T[K] extends number ? K : never }[keyof T];
2317
2319
  class RowClass {
@@ -2320,80 +2322,10 @@ class RowClass {
2320
2322
  this.matches = matches;
2321
2323
  }
2322
2324
  }
2323
- /**
2324
- * Example:
2325
- * @example
2326
- * const model = TableModel.fromList(heroList, table => {
2327
- * table.pluck("firstName");
2328
- * table.pluck("lastName");
2329
- * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
2330
- * });
2331
- *
2332
- * Editable tables
2333
- * @example
2334
- * const saveCommand = UnaryCommand.create((form: Form<Hero>) => {
2335
- * if (form.validate()) {
2336
- * // normal form save stuff
2337
- * return true; // finish editing
2338
- * }
2339
- * return false; // continue editiing
2340
- * }
2341
- * const colorsNames: ListModel<string> = ...;
2342
- * const model = TableModel.fromList(heroList, table => {
2343
- * table.pluck("firstName").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
2344
- * table.pluck("lastName").cellEditor(StringInputComponent, {
2345
- * validators: [Validator.present("We need a last name")]
2346
- * });
2347
- * table.pluck("age").cellEditor(NumberInputComponent);
2348
- * table.pluck("favoriteColor").cellEditor(SelectInputComponent, {
2349
- * initialiseComponent(component: SelectInputComponent) {
2350
- * selectInput.optionsModel = colorsNames; // <- initialise our component
2351
- * }
2352
- * });
2353
- * table.addEditControls(saveCommand); // <- required to enable editing
2354
- * });
2355
- *
2356
- * Selection models
2357
- * @example
2358
- * const model = TableModel.fromList(heroList, table => {
2359
- * table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
2360
- * table.pluck("firstName");
2361
- * table.pluck("lastName");
2362
- * });
2363
- *
2364
- * Custom cell renderers and editors
2365
- * @example
2366
- * const model = TableModel.fromList(heroList, table => {
2367
- * table.pluck("favoriteColor")
2368
- * .cellHeaderRenderer(CellHeaderRendererComponent, (component, column) => {
2369
- * // configure your component with what ever you need.
2370
- * });
2371
- * .cellRenderer(CellRendererComponent) // <-- interface CellEditor { value: string; }
2372
- * .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
2373
- * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
2374
- * });
2375
- *
2376
- * I18n
2377
- * @example
2378
- * [table.yml]
2379
- * table:
2380
- * columns(ColumnTextProperties[]):
2381
- * firstName:
2382
- * headerText: "First Name"
2383
- * fullName:
2384
- * headerText: "Full Name"
2385
- *
2386
- * const model = TableModel.fromList(heroList, table => {
2387
- * table.pluck("favoriteColor").cellRenderer(...).cellEditor(...);
2388
- * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
2389
- *
2390
- * table.columnTextProperties(I18n.table.columns); // <- configures all columns
2391
- * });
2392
- */
2393
- let TableModel = TableModel_1 = class TableModel {
2325
+ let AbstractTableModel = class AbstractTableModel extends GarbageCollector {
2394
2326
  constructor(sourceOfTruth) {
2327
+ super();
2395
2328
  this.sourceOfTruth = sourceOfTruth;
2396
- this._garbage = new GarbageCollector();
2397
2329
  this._columns = new MutableListModel();
2398
2330
  this._editorSessions = new MutableListModel();
2399
2331
  this.rowClassNamePredicates = [];
@@ -2403,7 +2335,7 @@ let TableModel = TableModel_1 = class TableModel {
2403
2335
  return this.identityOf ? this.identityOf(item) : index;
2404
2336
  };
2405
2337
  this.identityOf = sourceOfTruth.identityOf;
2406
- const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this._garbage);
2338
+ const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
2407
2339
  this._columnsById = chain(this._columns).indexBy('columnId');
2408
2340
  this._rowsBeingEdited = new MutableListModel([], {
2409
2341
  identifiedWith: this.identityOf
@@ -2414,11 +2346,6 @@ let TableModel = TableModel_1 = class TableModel {
2414
2346
  this.firstEditableColumn = chain(this.columns).select(c => c.hasEditorPortal()).first();
2415
2347
  this.hasColumnsWithRowSelectionExplicitlyEnabled = chain(this._columns).findIndex(column => column.isRowSelectionExplicitlyEnabled()).isGreaterThanOrEqualTo(0);
2416
2348
  }
2417
- static fromList(sourceOfTruth, builder) {
2418
- const model = new TableModel_1(sourceOfTruth);
2419
- builder(model);
2420
- return model;
2421
- }
2422
2349
  get rowsBeingEdited() {
2423
2350
  return this._rowsBeingEdited.readonly;
2424
2351
  }
@@ -2426,28 +2353,32 @@ let TableModel = TableModel_1 = class TableModel {
2426
2353
  return this._columns.readonly;
2427
2354
  }
2428
2355
  pluck(property, options) {
2429
- return this.addColumn(new PropertyColumnModel((options === null || options === void 0 ? void 0 : options.columnId) || property.toString(), property, this));
2356
+ const columnId = (options === null || options === void 0 ? void 0 : options.columnId) || property.toString();
2357
+ return this.addColumn(new PropertyColumnModel(columnId, property, () => this.getColumnTextProperties(columnId)));
2430
2358
  }
2431
2359
  pluckList(property, options) {
2432
- return this.addColumn(new ListPropertyColumnModel((options === null || options === void 0 ? void 0 : options.columnId) || property.toString(), property, this));
2360
+ const columnId = (options === null || options === void 0 ? void 0 : options.columnId) || property.toString();
2361
+ return this.addColumn(new ListPropertyColumnModel(columnId, property, () => this.getColumnTextProperties(columnId)));
2433
2362
  }
2434
- addSelectionColumn(selectionModel) {
2363
+ _addSelectionColumn(selectionModel) {
2435
2364
  assert.isNil(this.selectionColumnModel);
2436
- this.selectionColumnModel = new SelectionColumnModel('selection', this, selectionModel);
2365
+ const columnId = 'selection-column';
2366
+ this.selectionColumnModel = new SelectionColumnModel(columnId, () => this.getColumnTextProperties(columnId), selectionModel);
2437
2367
  return this.addColumn(this.selectionColumnModel);
2438
2368
  }
2439
2369
  addEditControls(saveCommand) {
2440
2370
  this.saveCommand = saveCommand;
2441
- return this.addColumn(new EditorControlColumnModel('editControls', saveCommand, this));
2371
+ const columnId = 'editControls';
2372
+ return this.addColumn(new EditorControlColumnModel(columnId, saveCommand, () => this.getColumnTextProperties(columnId)));
2442
2373
  }
2443
2374
  addCustomColumn(columnId, dataAccessor) {
2444
- return this.addColumn(new CustomValueColumnModel(columnId, this, dataAccessor));
2375
+ return this.addColumn(new CustomValueColumnModel(columnId, () => this.getColumnTextProperties(columnId), dataAccessor));
2445
2376
  }
2446
2377
  addComponentColumn(columnId, component, onComponentInitOrOptions) {
2447
- return this.addColumn(new CustomValueColumnModel(columnId, this, row => row)).cellRenderer(component, onComponentInitOrOptions);
2378
+ return this.addColumn(new CustomValueColumnModel(columnId, () => this.getColumnTextProperties(columnId), row => row)).cellRenderer(component, onComponentInitOrOptions);
2448
2379
  }
2449
2380
  addTemplateColumn(columnId) {
2450
- return this.addColumn(new CustomTemplateColumnModel(columnId, this));
2381
+ return this.addColumn(new CustomTemplateColumnModel(columnId, () => this.getColumnTextProperties(columnId)));
2451
2382
  }
2452
2383
  addRowClass(className, predicate) {
2453
2384
  this.rowClassNamePredicates.push(new RowClass(className, predicate));
@@ -2474,14 +2405,18 @@ let TableModel = TableModel_1 = class TableModel {
2474
2405
  }
2475
2406
  return column;
2476
2407
  }
2408
+ get selectionModel() {
2409
+ var _a;
2410
+ return (_a = this.selectionColumnModel) === null || _a === void 0 ? void 0 : _a.selectionModel;
2411
+ }
2477
2412
  // removeColumn(column: ColumnModel<Row>) {
2478
2413
  //
2479
2414
  // }
2480
2415
  columnTextProperties(columnTextProperties) {
2481
2416
  this._columnTextPropertiesLookup = columnTextProperties;
2482
2417
  }
2483
- getColumnTextProperties(column) {
2484
- return this._columnTextPropertiesLookup ? this._columnTextPropertiesLookup[column.columnId] : undefined;
2418
+ getColumnTextProperties(columnId) {
2419
+ return this._columnTextPropertiesLookup ? this._columnTextPropertiesLookup[columnId] : undefined;
2485
2420
  }
2486
2421
  startEditSession(row) {
2487
2422
  const rowId = this.identityOf(row);
@@ -2526,11 +2461,6 @@ let TableModel = TableModel_1 = class TableModel {
2526
2461
  return this.isRowSelectionEnabled() || this.rowClickListeners.listenerCount > 0;
2527
2462
  }
2528
2463
  isCursorEnabled(column) {
2529
- // console.log({
2530
- // column: column.columnId,
2531
- // rowSelectionEnabled: this.isRowSelectionEnabledFor(column),
2532
- // hasRowListeners: this.rowClickListeners.listenerCount > 0
2533
- // });
2534
2464
  return this.isRowSelectionEnabledFor(column) || this.rowClickListeners.listenerCount > 0;
2535
2465
  }
2536
2466
  selectRow(row) {
@@ -2540,7 +2470,6 @@ let TableModel = TableModel_1 = class TableModel {
2540
2470
  onRowClicked(callback) {
2541
2471
  return this.rowClickListeners.add(callback);
2542
2472
  }
2543
- // @Trace()
2544
2473
  _notifyCellClicked(columnModel, row) {
2545
2474
  if (this.isRowSelectionEnabledFor(columnModel)) {
2546
2475
  this.selectRow(row);
@@ -2548,10 +2477,10 @@ let TableModel = TableModel_1 = class TableModel {
2548
2477
  this.rowClickListeners.fire(l => l(row));
2549
2478
  }
2550
2479
  };
2551
- TableModel = TableModel_1 = __decorate([
2480
+ AbstractTableModel = __decorate([
2552
2481
  TrackExternal.Strategy(new TrackExternal.OneTimeBinding()),
2553
2482
  __metadata("design:paramtypes", [ListModel])
2554
- ], TableModel);
2483
+ ], AbstractTableModel);
2555
2484
 
2556
2485
  /**
2557
2486
  * Create your model:
@@ -2607,7 +2536,7 @@ TableComponent.decorators = [
2607
2536
  { type: Component, args: [{
2608
2537
  selector: 'aup-table',
2609
2538
  template: "<table mat-table [dataSource]=\"tableModel.dataSource.value\" [trackBy]=\"tableModel.trackBy\">\n\n <ng-container *ngFor=\"let column of columns.value; index as index; first as first; last as last\" matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef>\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-header-cell-renderer>\n </th>\n <td mat-cell *matCellDef=\"let row\" (click)=\"notifyCellClicked(column, row)\" [class.enable-cursor]=\"tableModel.isCursorEnabled(column)\">\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"tableModel\"\n [editSession]=\"tableModel.getEditSessionFor(row)\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.first-column]=\"first\"\n [class.last-column]=\"last\"\n ></aup-table-cell-renderer>\n </td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"columnIds.value\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: columnIds.value; let i = index\"\n [ngClass]=\"tableModel.getRowClasses(row)\" [class.enable-hover]=\"tableModel.isHoverEnabled()\" [attr.trackBy]=\"tableModel.trackBy(i, row)\"\n ></tr>\n\n</table>\n",
2610
- styles: [":host{align-items:stretch;display:flex;flex-direction:column}:host table{flex:1;width:100%}"]
2539
+ styles: [":host{align-items:stretch;display:flex;flex-direction:column}:host table{flex:1;width:100%}.mat-column-selection-column{width:1px!important}"]
2611
2540
  },] }
2612
2541
  ];
2613
2542
  TableComponent.ctorParameters = () => [];
@@ -2616,7 +2545,7 @@ TableComponent.propDecorators = {
2616
2545
  };
2617
2546
  __decorate([
2618
2547
  TrackExternal(),
2619
- __metadata("design:type", TableModel)
2548
+ __metadata("design:type", AbstractTableModel)
2620
2549
  ], TableComponent.prototype, "tableModel", void 0);
2621
2550
 
2622
2551
  class ColumnTemplateDirective {
@@ -2627,28 +2556,110 @@ class ColumnTemplateDirective {
2627
2556
  this.aupColumnTemplateFillCell = false;
2628
2557
  this.aupColumnTemplateAutoPadChild = undefined;
2629
2558
  }
2630
- ngOnInit() {
2631
- var _a;
2632
- assert.isTruthy(this.aupColumnTemplateColumnId);
2633
- this.host.registerColumnTemplate(this.aupColumnTemplateColumnId, this.templateRef, this.viewContainer, this.aupColumnTemplateFillCell, (_a = this.aupColumnTemplateAutoPadChild) !== null && _a !== void 0 ? _a : this.aupColumnTemplateFillCell);
2559
+ ngOnInit() {
2560
+ var _a;
2561
+ assert.isTruthy(this.aupColumnTemplateColumnId);
2562
+ this.host.registerColumnTemplate(this.aupColumnTemplateColumnId, this.templateRef, this.viewContainer, this.aupColumnTemplateFillCell, (_a = this.aupColumnTemplateAutoPadChild) !== null && _a !== void 0 ? _a : this.aupColumnTemplateFillCell);
2563
+ }
2564
+ }
2565
+ ColumnTemplateDirective.decorators = [
2566
+ { type: Directive, args: [{
2567
+ selector: '[aupColumnTemplate]'
2568
+ },] }
2569
+ ];
2570
+ ColumnTemplateDirective.ctorParameters = () => [
2571
+ { type: TableComponent },
2572
+ { type: TemplateRef },
2573
+ { type: ViewContainerRef }
2574
+ ];
2575
+ ColumnTemplateDirective.propDecorators = {
2576
+ aupColumnTemplate: [{ type: Input }],
2577
+ aupColumnTemplateColumnId: [{ type: Input }],
2578
+ aupColumnTemplateFillCell: [{ type: Input }],
2579
+ aupColumnTemplateAutoPadChild: [{ type: Input }]
2580
+ };
2581
+
2582
+ /**
2583
+ * Example:
2584
+ * @example
2585
+ * const model = TableModel.fromList(heroList, table => {
2586
+ * table.pluck("firstName");
2587
+ * table.pluck("lastName");
2588
+ * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
2589
+ * });
2590
+ *
2591
+ * Editable tables
2592
+ * @example
2593
+ * const saveCommand = UnaryCommand.create((form: Form<Hero>) => {
2594
+ * if (form.validate()) {
2595
+ * // normal form save stuff
2596
+ * return true; // finish editing
2597
+ * }
2598
+ * return false; // continue editiing
2599
+ * }
2600
+ * const colorsNames: ListModel<string> = ...;
2601
+ * const model = TableModel.fromList(heroList, table => {
2602
+ * table.pluck("firstName").cellEditor(StringInputComponent); <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
2603
+ * table.pluck("lastName").cellEditor(StringInputComponent, {
2604
+ * validators: [Validator.present("We need a last name")]
2605
+ * });
2606
+ * table.pluck("age").cellEditor(NumberInputComponent);
2607
+ * table.pluck("favoriteColor").cellEditor(SelectInputComponent, {
2608
+ * initialiseComponent(component: SelectInputComponent) {
2609
+ * selectInput.optionsModel = colorsNames; // <- initialise our component
2610
+ * }
2611
+ * });
2612
+ * table.addEditControls(saveCommand); // <- required to enable editing
2613
+ * });
2614
+ *
2615
+ * Selection models
2616
+ * @example
2617
+ * const model = TableModel.fromList(heroList, table => {
2618
+ * table.addSelectionColumn(selectionModel); // <- can be single or multiple selection model
2619
+ * table.pluck("firstName");
2620
+ * table.pluck("lastName");
2621
+ * });
2622
+ *
2623
+ * Custom cell renderers and editors
2624
+ * @example
2625
+ * const model = TableModel.fromList(heroList, table => {
2626
+ * table.pluck("favoriteColor")
2627
+ * .cellHeaderRenderer(CellHeaderRendererComponent, (component, column) => {
2628
+ * // configure your component with what ever you need.
2629
+ * });
2630
+ * .cellRenderer(CellRendererComponent) // <-- interface CellEditor { value: string; }
2631
+ * .cellEditor(CellEditorComponent.); // <-- interface CellEditor { valueModel: DirtyTrackingForm.ValueModel<string> | ValueModel<string>; }
2632
+ * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
2633
+ * });
2634
+ *
2635
+ * I18n
2636
+ * @example
2637
+ * [table.yml]
2638
+ * table:
2639
+ * columns(ColumnTextProperties[]):
2640
+ * firstName:
2641
+ * headerText: "First Name"
2642
+ * fullName:
2643
+ * headerText: "Full Name"
2644
+ *
2645
+ * const model = TableModel.fromList(heroList, table => {
2646
+ * table.pluck("favoriteColor").cellRenderer(...).cellEditor(...);
2647
+ * table.addCustomColumn("fullName", hero => `${hero.firstName} ${hero.lastName}`);
2648
+ *
2649
+ * table.columnTextProperties(I18n.table.columns); // <- configures all columns
2650
+ * });
2651
+ */
2652
+ class TableModel extends AbstractTableModel {
2653
+ static fromList(sourceOfTruth, builder) {
2654
+ const model = new TableModel(sourceOfTruth);
2655
+ if (builder)
2656
+ builder(model);
2657
+ return model;
2658
+ }
2659
+ addSelectionColumn(selectionModel) {
2660
+ return this._addSelectionColumn(selectionModel);
2634
2661
  }
2635
2662
  }
2636
- ColumnTemplateDirective.decorators = [
2637
- { type: Directive, args: [{
2638
- selector: '[aupColumnTemplate]'
2639
- },] }
2640
- ];
2641
- ColumnTemplateDirective.ctorParameters = () => [
2642
- { type: TableComponent },
2643
- { type: TemplateRef },
2644
- { type: ViewContainerRef }
2645
- ];
2646
- ColumnTemplateDirective.propDecorators = {
2647
- aupColumnTemplate: [{ type: Input }],
2648
- aupColumnTemplateColumnId: [{ type: Input }],
2649
- aupColumnTemplateFillCell: [{ type: Input }],
2650
- aupColumnTemplateAutoPadChild: [{ type: Input }]
2651
- };
2652
2663
 
2653
2664
  class TableCellRendererComponent extends DisposableComponent {
2654
2665
  constructor() {
@@ -2815,6 +2826,565 @@ TableRowMenuComponent.propDecorators = {
2815
2826
  menu: [{ type: ViewChild, args: [MatMenuTrigger,] }]
2816
2827
  };
2817
2828
 
2829
+ const SVG_HEIGHT = 60;
2830
+ class TreeInheritanceIconComponent {
2831
+ constructor() {
2832
+ this.pixelWidth = 24;
2833
+ this.pixelHeight = 48;
2834
+ }
2835
+ get heightOffset() {
2836
+ return SVG_HEIGHT - this.pixelHeight;
2837
+ }
2838
+ get viewBox() {
2839
+ return `${0} ${this.heightOffset} ${this.pixelWidth} ${this.pixelHeight - this.heightOffset}`;
2840
+ }
2841
+ hasHead() {
2842
+ return TreeInheritanceIconComponent.HAS_HEAD.includes(this.type);
2843
+ }
2844
+ hasTerminal() {
2845
+ return TreeInheritanceIconComponent.HAS_TERMINAL.includes(this.type);
2846
+ }
2847
+ hasLeadIn() {
2848
+ return TreeInheritanceIconComponent.HAS_LEAD_IN.includes(this.type);
2849
+ }
2850
+ hasTail() {
2851
+ return TreeInheritanceIconComponent.HAS_TAIL.includes(this.type);
2852
+ }
2853
+ }
2854
+ TreeInheritanceIconComponent.decorators = [
2855
+ { type: Component, args: [{
2856
+ selector: 'aup-tree-inheritance-icon',
2857
+ template: "<svg xmlns=\"http://www.w3.org/2000/svg\" [attr.width]=\"pixelWidth\" [attr.height]=\"pixelHeight\" [attr.viewBox]=\"viewBox\">\n <g fill=\"none\" fill-rule=\"evenodd\">\n <rect *ngIf=\"hasHead()\" width=\"1\" height=\"32.5\" x=\"11.5\" fill=\"currentColor\"/>\n <rect *ngIf=\"hasTail()\" width=\"1\" height=\"32.5\" x=\"11.5\" y=\"31.5\" fill=\"currentColor\"/>\n\n <rect *ngIf=\"hasLeadIn()\" width=\"12\" height=\"1\" y=\"31.5\" fill=\"currentColor\"/>\n <rect *ngIf=\"hasTerminal()\" width=\"12\" height=\"1\" x=\"12\" y=\"31.5\" fill=\"currentColor\"/>\n </g>\n</svg>\n",
2858
+ styles: [":host{color:inherit;position:relative}svg{color:var(--line-color);display:block}"]
2859
+ },] }
2860
+ ];
2861
+ TreeInheritanceIconComponent.ctorParameters = () => [];
2862
+ TreeInheritanceIconComponent.propDecorators = {
2863
+ type: [{ type: Input }, { type: HostBinding, args: ["class",] }],
2864
+ pixelWidth: [{ type: Input }],
2865
+ pixelHeight: [{ type: Input }]
2866
+ };
2867
+ (function (TreeInheritanceIconComponent) {
2868
+ TreeInheritanceIconComponent.Type = Enum({
2869
+ ICON_BLANK: 'blank',
2870
+ ICON_PARENT: 'parent',
2871
+ ICON_INHERITED_TERMINAL: 'inherited_terminal',
2872
+ ICON_INHERITED_THROUGH_TERMINAL: 'inherited_through_terminal',
2873
+ ICON_THROUGH: 'through' // |
2874
+ });
2875
+ TreeInheritanceIconComponent.HAS_LEAD_IN = [
2876
+ TreeInheritanceIconComponent.Type.ICON_PARENT
2877
+ ];
2878
+ TreeInheritanceIconComponent.HAS_TERMINAL = [
2879
+ TreeInheritanceIconComponent.Type.ICON_INHERITED_TERMINAL,
2880
+ TreeInheritanceIconComponent.Type.ICON_INHERITED_THROUGH_TERMINAL,
2881
+ TreeInheritanceIconComponent.Type.ICON_PARENT
2882
+ ];
2883
+ TreeInheritanceIconComponent.HAS_HEAD = [
2884
+ TreeInheritanceIconComponent.Type.ICON_THROUGH,
2885
+ TreeInheritanceIconComponent.Type.ICON_INHERITED_TERMINAL,
2886
+ TreeInheritanceIconComponent.Type.ICON_INHERITED_THROUGH_TERMINAL
2887
+ ];
2888
+ TreeInheritanceIconComponent.HAS_TAIL = [
2889
+ TreeInheritanceIconComponent.Type.ICON_PARENT,
2890
+ TreeInheritanceIconComponent.Type.ICON_THROUGH,
2891
+ TreeInheritanceIconComponent.Type.ICON_INHERITED_THROUGH_TERMINAL
2892
+ ];
2893
+ })(TreeInheritanceIconComponent || (TreeInheritanceIconComponent = {}));
2894
+
2895
+ class SelfAndDescendantsVisitor {
2896
+ constructor() {
2897
+ }
2898
+ visit(it) {
2899
+ this.onVisit(it);
2900
+ if (this.shouldVisitChildrenOf(it)) {
2901
+ it.visitChildren(this);
2902
+ }
2903
+ }
2904
+ shouldVisitChildrenOf(it) {
2905
+ return true;
2906
+ }
2907
+ }
2908
+ (function (SelfAndDescendantsVisitor) {
2909
+ class Each extends SelfAndDescendantsVisitor {
2910
+ constructor(callback) {
2911
+ super();
2912
+ this.callback = callback;
2913
+ }
2914
+ onVisit(it) {
2915
+ this.callback(it);
2916
+ }
2917
+ }
2918
+ SelfAndDescendantsVisitor.Each = Each;
2919
+ })(SelfAndDescendantsVisitor || (SelfAndDescendantsVisitor = {}));
2920
+
2921
+ class DecoratedTreeNodeMixin {
2922
+ constructor(parent, node) {
2923
+ this.parent = parent;
2924
+ this.node = node;
2925
+ }
2926
+ get decoratedSelf() {
2927
+ return this.memoize("decoratedSelf", () => {
2928
+ return this.parent ? this.parent.children.find(child => child.node === this.node) : DecoratedTreeNode.createRoot(this.node);
2929
+ });
2930
+ }
2931
+ get children() {
2932
+ return this.memoize("children", () => {
2933
+ return this.node.children ? this.node.children.map(child => {
2934
+ return Mixin.createProxy(child, new DecoratedTreeNodeMixin(this.decoratedSelf, child));
2935
+ }) : [];
2936
+ });
2937
+ }
2938
+ descendants() {
2939
+ return this.memoize("descendants", () => {
2940
+ const result = [];
2941
+ this.visitDescendants(child => result.push(child));
2942
+ return result;
2943
+ });
2944
+ }
2945
+ selfAndDescendants() {
2946
+ return this.memoize("selfAndDescendants", () => {
2947
+ const result = [];
2948
+ this.visitSelfAndDescendants(child => result.push(child));
2949
+ return result;
2950
+ });
2951
+ }
2952
+ siblingsBefore() {
2953
+ return this.memoize('siblingsBefore', () => {
2954
+ if (this.parent) {
2955
+ return this.parent.children.slice(0, this.myIndex());
2956
+ }
2957
+ else {
2958
+ return [];
2959
+ }
2960
+ });
2961
+ }
2962
+ siblingsAfter() {
2963
+ return this.memoize('siblingsAfter', () => {
2964
+ if (this.parent) {
2965
+ return this.parent.children.slice(1 + this.myIndex());
2966
+ }
2967
+ else {
2968
+ return [];
2969
+ }
2970
+ });
2971
+ }
2972
+ siblings() {
2973
+ return this.memoize('siblings', () => [].concat(this.siblingsBefore(), this.siblingsAfter()));
2974
+ }
2975
+ isFirstChild() {
2976
+ return this.memoize('isFirstChild', () => this.parent ? this.myIndex() === 0 : false);
2977
+ }
2978
+ myIndex() {
2979
+ return this.memoize('myIndex', () => {
2980
+ const myIndex = this.parent.children.findIndex(child => child.node === this.node);
2981
+ assert.isTruthy(myIndex >= 0, 'illegal state, expected index to be >= 0');
2982
+ return myIndex;
2983
+ });
2984
+ }
2985
+ isLastChild() {
2986
+ return this.memoize('isLastChild', () => {
2987
+ return this.parent ? this.myIndex() === this.parent.children.length - 1 : false;
2988
+ });
2989
+ }
2990
+ hasSiblings() {
2991
+ return this.parent ? this.node.children.length > 1 : false;
2992
+ }
2993
+ find(predicate) {
2994
+ return find(this.descendants(), predicate);
2995
+ }
2996
+ select(predicate) {
2997
+ return filter(this.descendants(), predicate);
2998
+ }
2999
+ flattenInto(array) {
3000
+ this.visitSelfAndDescendants(child => array.push(child));
3001
+ return array;
3002
+ }
3003
+ ancestors() {
3004
+ return this.memoize('ancestors', () => {
3005
+ return this.parent ? this.parent.ancestors().concat([this.parent]) : [];
3006
+ });
3007
+ }
3008
+ ancestorsAndSelf() {
3009
+ return this.memoize("ancestorsAndSelf", () => {
3010
+ return this.ancestors().concat([(this.decoratedSelf)]);
3011
+ });
3012
+ }
3013
+ pathToParent(parent) {
3014
+ return this.memoize("pathToParent", () => {
3015
+ if (this.node === parent.node) {
3016
+ return [];
3017
+ }
3018
+ else if (this.parent) {
3019
+ return this.parent.pathToParent(parent).concat([this.parent]);
3020
+ }
3021
+ else {
3022
+ throw new Error('parent is not an ancestor');
3023
+ }
3024
+ });
3025
+ }
3026
+ pathToParentAndSelf(parent) {
3027
+ return this.memoize("pathToParentAndSelf", () => {
3028
+ return this.pathToParent(parent).concat([this.decoratedSelf]);
3029
+ });
3030
+ }
3031
+ isRoot() {
3032
+ return !this.parent;
3033
+ }
3034
+ get depth() {
3035
+ return this.isRoot() ? 0 : this.parent.depth + 1;
3036
+ }
3037
+ isLeaf() {
3038
+ return !this.isRoot() && this.node.children.length < 1;
3039
+ }
3040
+ hasChildren() {
3041
+ return this.node.children.length > 0;
3042
+ }
3043
+ depthFromParent(parent) {
3044
+ return this.pathToParent(parent).length;
3045
+ }
3046
+ treeDepth() {
3047
+ return this.memoize("treeDepth", () => {
3048
+ return 1 + this.descendants().map(child => child.depthFromParent(this)).reduce((prev, current) => Math.max(prev, current));
3049
+ });
3050
+ }
3051
+ flatten() {
3052
+ return this.memoize("flatten", () => {
3053
+ return this.flattenInto([]);
3054
+ });
3055
+ }
3056
+ visit(visitor) {
3057
+ visitor.visit(this);
3058
+ return visitor;
3059
+ }
3060
+ visitChildren(visitor) {
3061
+ each(this.children, child => child.visit(visitor));
3062
+ return visitor;
3063
+ }
3064
+ visitSelfAndDescendants(callback) {
3065
+ this.visit(new SelfAndDescendantsVisitor.Each(callback));
3066
+ }
3067
+ visitDescendants(callback) {
3068
+ this.visitChildren(new SelfAndDescendantsVisitor.Each(callback));
3069
+ }
3070
+ memoize(property, factory) {
3071
+ const key = `__${property}`;
3072
+ if (isNil(this[key])) {
3073
+ this[key] = factory();
3074
+ }
3075
+ return this[key];
3076
+ }
3077
+ }
3078
+ var DecoratedTreeNode;
3079
+ (function (DecoratedTreeNode) {
3080
+ function createRoot(node) {
3081
+ return Mixin.createProxy(node, new DecoratedTreeNodeMixin(undefined, node));
3082
+ }
3083
+ DecoratedTreeNode.createRoot = createRoot;
3084
+ })(DecoratedTreeNode || (DecoratedTreeNode = {}));
3085
+
3086
+ class TreeExpansionModel {
3087
+ constructor(identityOf) {
3088
+ this.identityOf = identityOf;
3089
+ this.collapsedIds = new Set();
3090
+ this._isExpandedPredicate = new MutableValueModel(() => true);
3091
+ this.updatePredicate();
3092
+ }
3093
+ get isExpandedPredicate() {
3094
+ return this._isExpandedPredicate.readonly;
3095
+ }
3096
+ // @Trace()
3097
+ expand(node) {
3098
+ if (this.isCollapsed(node)) {
3099
+ this.collapsedIds.delete(this.identityOf(node.node));
3100
+ this.updatePredicate();
3101
+ }
3102
+ }
3103
+ // @Trace()
3104
+ collapse(node) {
3105
+ if (!this.isCollapsed(node)) {
3106
+ this.collapsedIds.add(this.identityOf(node.node));
3107
+ this.updatePredicate();
3108
+ }
3109
+ }
3110
+ canExpand(node) {
3111
+ return node.hasChildren() && this.isCollapsed(node);
3112
+ }
3113
+ canCollapse(node) {
3114
+ return node.hasChildren() && !this.isCollapsed(node);
3115
+ }
3116
+ isCollapsed(node) {
3117
+ return this.collapsedIds.has(this.identityOf(node.node));
3118
+ }
3119
+ isExpanded(node) {
3120
+ return !this.isCollapsed(node);
3121
+ }
3122
+ ensureAncestorsAndSelfVisible(node) {
3123
+ node.ancestors()
3124
+ .map(a => this.identityOf(node.node))
3125
+ .forEach(id => this.collapsedIds.delete(id));
3126
+ this.updatePredicate();
3127
+ }
3128
+ updatePredicate() {
3129
+ this._isExpandedPredicate.value = (node) => !this.collapsedIds.has(this.identityOf(node.node));
3130
+ }
3131
+ }
3132
+
3133
+ class TreeLabelColumnModel extends ColumnModel {
3134
+ constructor(columnId, textPropertiesProvider, expansionModel) {
3135
+ super(columnId, textPropertiesProvider);
3136
+ this.expansionModel = expansionModel;
3137
+ this.iconFactory = (node, expanded) => expanded ? 'mat:folder_open' : 'mat:folder';
3138
+ this.cellRenderer(TreeLabelCellRendererComponent);
3139
+ }
3140
+ pluck(property) {
3141
+ this.labelProperty = property;
3142
+ }
3143
+ addIcon(factory) {
3144
+ this.iconFactory = factory;
3145
+ }
3146
+ cellRenderer(componentType) {
3147
+ this.configureCellRenderer(new ComponentCellRendererPortalRef(componentType, (component, rowData, firstTime) => {
3148
+ if (firstTime) {
3149
+ component.expansionModel = this.expansionModel;
3150
+ }
3151
+ component.value = rowData.row;
3152
+ component.label = _.isNil(this.labelProperty) ? undefined : rowData.row[this.labelProperty];
3153
+ component.iconFactory = this.iconFactory;
3154
+ }));
3155
+ return this;
3156
+ }
3157
+ selectRowOnClick(selectOnRowClick) {
3158
+ return super.selectRowOnClick(selectOnRowClick);
3159
+ }
3160
+ }
3161
+
3162
+ class TreeLabelCellRendererComponent extends DisposableComponent {
3163
+ constructor() {
3164
+ super();
3165
+ this.iconTypes = [];
3166
+ this.nodeModel = new MutableValueModel();
3167
+ const { chain } = Dsl.disposeWith(this);
3168
+ this.iconList = chain(this.nodeModel).mapToList(node => {
3169
+ const icons = node.ancestors().slice(1).map(ancestor => {
3170
+ return ancestor.isLastChild() ? TreeInheritanceIconComponent.Type.ICON_BLANK : TreeInheritanceIconComponent.Type.ICON_THROUGH;
3171
+ });
3172
+ if (!node.isRoot()) {
3173
+ icons.push(node.isLastChild() ? TreeInheritanceIconComponent.Type.ICON_INHERITED_TERMINAL : TreeInheritanceIconComponent.Type.ICON_INHERITED_THROUGH_TERMINAL);
3174
+ }
3175
+ return icons;
3176
+ });
3177
+ }
3178
+ ngOnInit() {
3179
+ const { chain } = Dsl.disposeWith(this);
3180
+ this.canExpand = chain(this.nodeModel).map(node => {
3181
+ return node.hasChildren() && this.expansionModel.isCollapsed(node);
3182
+ }, { dependsOn: this.expansionModel.isExpandedPredicate });
3183
+ this.canCollapse = chain(this.nodeModel).map(node => {
3184
+ return node.hasChildren() && !this.expansionModel.isCollapsed(node);
3185
+ }, { dependsOn: this.expansionModel.isExpandedPredicate });
3186
+ this.iconModel = chain(this.nodeModel).map(node => {
3187
+ return this.node.isLeaf() ? undefined : this.iconFactory(node, this.expansionModel.isExpanded(this.node));
3188
+ }, { dependsOn: this.expansionModel.isExpandedPredicate });
3189
+ }
3190
+ get isRoot() {
3191
+ return this.node.isRoot();
3192
+ }
3193
+ get isLeaf() {
3194
+ return this.node.isLeaf();
3195
+ }
3196
+ get node() {
3197
+ return this.nodeModel.value;
3198
+ }
3199
+ // @Trace()
3200
+ expandOrCollapse(node) {
3201
+ this.expansionModel.isCollapsed(node) ? this.expansionModel.expand(node) : this.expansionModel.collapse(node);
3202
+ }
3203
+ }
3204
+ TreeLabelCellRendererComponent.decorators = [
3205
+ { type: Component, args: [{
3206
+ selector: 'aup-tree-label-cell-renderer',
3207
+ 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(node)\" ></aup-icon>\n</div>\n<div class=\"label\">{{label}}</div>\n",
3208
+ styles: [":host{--line-color:#ddd;--node-color:#999;align-items:stretch;display:inline-flex;flex-direction:row}:host div.label{align-items:center;display:flex;flex-direction:row;padding-left:6px;white-space:nowrap}:host div.tree-icons{-ms-grid-rows:1fr;align-items:stretch;display:-ms-grid;display:grid;grid-auto-columns:auto;grid-auto-flow:column;grid-template-rows:1fr;justify-content:stretch}:host div.tree-icons aup-icon{-ms-grid-row-align:center;align-self:center;color:var(--node-color)}:host div.tree-icons aup-icon.clickable{cursor:pointer}:host div.tree-icons aup-icon,:host div.tree-icons aup-tree-inheritance-icon{margin-left:4px}"]
3209
+ },] }
3210
+ ];
3211
+ TreeLabelCellRendererComponent.ctorParameters = () => [];
3212
+ TreeLabelCellRendererComponent.propDecorators = {
3213
+ value: [{ type: Input }],
3214
+ label: [{ type: Input }],
3215
+ iconFactory: [{ type: Input }],
3216
+ expansionModel: [{ type: Input }],
3217
+ isRoot: [{ type: HostBinding, args: ['class.root',] }],
3218
+ isLeaf: [{ type: HostBinding, args: ['class.leaf',] }]
3219
+ };
3220
+ __decorate([
3221
+ StoreInValueModel('nodeModel'),
3222
+ __metadata("design:type", Object)
3223
+ ], TreeLabelCellRendererComponent.prototype, "value", void 0);
3224
+
3225
+ class TreeToListModel extends ComputedListModel {
3226
+ constructor(source, expansionModel) {
3227
+ super(source);
3228
+ this.source = source;
3229
+ this.expansionModel = expansionModel;
3230
+ this.trackSource(this.expansionModel.isExpandedPredicate);
3231
+ }
3232
+ getIdentityOf(item) {
3233
+ return this.source.identityOf(item.node);
3234
+ }
3235
+ compute(values) {
3236
+ const result = [];
3237
+ values.forEach(value => this.addNodeAndVisibleChildren(DecoratedTreeNode.createRoot(value), result));
3238
+ return result;
3239
+ }
3240
+ addNodeAndVisibleChildren(node, result) {
3241
+ result.push(node);
3242
+ if (node.hasChildren() && !this.expansionModel.isCollapsed(node)) {
3243
+ node.children.forEach(child => this.addNodeAndVisibleChildren(child, result));
3244
+ }
3245
+ }
3246
+ }
3247
+
3248
+ // import {T } from '@client/api/light-architect/model/area/area.class';
3249
+ class TreeTableModel extends AbstractTableModel {
3250
+ constructor(source, treeExpansionModel) {
3251
+ super(source);
3252
+ this.treeExpansionModel = treeExpansionModel;
3253
+ }
3254
+ static fromChildrenOf(sourceOfTruth, builder) {
3255
+ const garbage = new GarbageCollector();
3256
+ const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(garbage);
3257
+ const children = chain(sourceOfTruth).mapToList(root => root.children); // for some reason pluck list can't see 'children'
3258
+ const model = this.fromList(children, builder);
3259
+ model.registerDisposable(garbage);
3260
+ return model;
3261
+ }
3262
+ static fromList(sourceOfTruth, builder) {
3263
+ const treeExpansionModel = new TreeExpansionModel(sourceOfTruth.identityOf);
3264
+ const nodes = new TreeToListModel(sourceOfTruth, treeExpansionModel);
3265
+ const model = new TreeTableModel(nodes, treeExpansionModel);
3266
+ model.registerDisposable(nodes);
3267
+ if (builder)
3268
+ builder(model);
3269
+ return model;
3270
+ }
3271
+ treeControlColumn(builder) {
3272
+ const columnId = 'tree-label';
3273
+ const column = new TreeLabelColumnModel(columnId, () => this.getColumnTextProperties(columnId), this.treeExpansionModel);
3274
+ builder(column);
3275
+ this.addColumn(column);
3276
+ }
3277
+ expand(node) {
3278
+ this.treeExpansionModel.expand(node);
3279
+ }
3280
+ collapse(node) {
3281
+ this.treeExpansionModel.expand(node);
3282
+ }
3283
+ isCollapsed(node) {
3284
+ return this.treeExpansionModel.isCollapsed(node);
3285
+ }
3286
+ ensureAncestorsAndSelfVisible(node) {
3287
+ this.treeExpansionModel.ensureAncestorsAndSelfVisible(node);
3288
+ }
3289
+ }
3290
+ class FlattenStrategy extends SelfAndDescendantsVisitor {
3291
+ constructor(collapsedIds) {
3292
+ super();
3293
+ this.collapsedIds = collapsedIds;
3294
+ this._areas = [];
3295
+ this._collapsed = new Set(collapsedIds);
3296
+ }
3297
+ onVisit(it) {
3298
+ this._areas.push(it);
3299
+ }
3300
+ shouldVisitChildrenOf(it) {
3301
+ return !this._collapsed.has(it);
3302
+ }
3303
+ get flattenedAreas() {
3304
+ return this._areas;
3305
+ }
3306
+ }
3307
+ // class DecoratorCache {
3308
+ //
3309
+ // private map = new Map<number, T>();
3310
+ //
3311
+ // get(area:T): T {
3312
+ //
3313
+ // if (!area) return null;
3314
+ //
3315
+ // let decoratedArea = this.map.get(area.id);
3316
+ // if (!decoratedArea) {
3317
+ // decoratedArea = TreeModel.AreaDecorator.decorate(area);
3318
+ // this.map.set(area.id, decoratedArea);
3319
+ // }
3320
+ // return decoratedArea;
3321
+ // }
3322
+ //
3323
+ // clear() {
3324
+ // this.map.clear();
3325
+ // }
3326
+ //
3327
+ //
3328
+ // }
3329
+
3330
+ //
3331
+ // const template = `
3332
+ // <table-component list-model="zoneTreeController.visibleAreas"
3333
+ // selection-model="zoneTreeController.selectionModel"
3334
+ // selection-command="zoneTreeController.selectionCommand"
3335
+ // hover-model="zoneTreeController.decoratedHoverModel"
3336
+ // no-hover="zoneTreeController.noHover"
3337
+ // no-lines="true" no-scroll>
3338
+ //
3339
+ // <row-attr name="parent-id" value="{{item.parent.id}}"></row-attr>
3340
+ // <row-attr name="area-id" value="{{item.id}}"></row-attr>
3341
+ // <row-attr name="area-name" value="{{item.name}}"></row-attr>
3342
+ // <row-attr name="area-depth" value="{{item.depthFromZone()}}"></row-attr>
3343
+ // <row-attr name="collapsed" value="{{zoneTreeController.isCollapsed(item)}}"></row-attr>
3344
+ //
3345
+ // <column class="area" ng-class="{root: item.isZone(), parent: item.isGroup()}" class="allow-squish">
3346
+ // <!--<label>Rooms in {{zoneTreeController.zoneModel.value.name}}</label>-->
3347
+ // <label>Rooms</label>
3348
+ // <div layout="row" layout-align="start center">
3349
+ // <tree-icons tree-item="item"></tree-icons>
3350
+ // <area-icon area="item"></area-icon>
3351
+ // <span ng-if="item.isZone()">Zone ({{item.name}})</span>
3352
+ // <span ng-if="!item.isZone()">{{item.name}}</span>
3353
+ // </div>
3354
+ // </column>
3355
+ // <column class="expand-collapse" ng-class="{collapsed: zoneTreeController.isCollapsed(item)}">
3356
+ // <md-button class="md-icon-button"
3357
+ // ng-if="zoneTreeController.canCollapse(item)"
3358
+ // ng-click="zoneTreeController.toggleCollapse(item)">
3359
+ // <md-icon>keyboard_arrow_up</md-icon>
3360
+ // </md-button>
3361
+ // </column>
3362
+ //
3363
+ // </table-component>
3364
+ // `;
3365
+ class TreeTableComponent extends DisposableComponent {
3366
+ constructor() {
3367
+ super();
3368
+ }
3369
+ }
3370
+ TreeTableComponent.decorators = [
3371
+ { type: Component, args: [{
3372
+ selector: "aup-tree-table",
3373
+ template: "<aup-table [tableModel]=\"treeTableModel\"></aup-table>\n",
3374
+ encapsulation: ViewEncapsulation.None // allow us to target nested table styles
3375
+ ,
3376
+ styles: ["td.mat-cell{border-bottom-width:0!important;border-top-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}"]
3377
+ },] }
3378
+ ];
3379
+ TreeTableComponent.ctorParameters = () => [];
3380
+ TreeTableComponent.propDecorators = {
3381
+ treeTableModel: [{ type: Input }]
3382
+ };
3383
+ __decorate([
3384
+ TrackExternal(),
3385
+ __metadata("design:type", TreeTableModel)
3386
+ ], TreeTableComponent.prototype, "treeTableModel", void 0);
3387
+
2818
3388
  class VerticalFocusContainerComponent extends FocusContainerComponent {
2819
3389
  constructor(focusManager) {
2820
3390
  super(focusManager);
@@ -2925,7 +3495,11 @@ ComponentsModule.decorators = [
2925
3495
  SeparatorComponent,
2926
3496
  FlexComponent,
2927
3497
  AbstractPopupMenuComponent,
2928
- PopupMenuRendererComponent
3498
+ PopupMenuRendererComponent,
3499
+ TreeTableComponent,
3500
+ TreeInheritanceIconComponent,
3501
+ TreeLabelCellRendererComponent,
3502
+ IconComponent
2929
3503
  ],
2930
3504
  imports: [
2931
3505
  CommonModule,
@@ -2978,7 +3552,8 @@ ComponentsModule.decorators = [
2978
3552
  CommandFaceComponent,
2979
3553
  MoreMenuComponent,
2980
3554
  SeparatorComponent,
2981
- FlexComponent
3555
+ FlexComponent,
3556
+ TreeTableComponent
2982
3557
  ],
2983
3558
  providers: [
2984
3559
  FocusBindingFactory
@@ -3531,6 +4106,30 @@ ActivityContainerComponent.propDecorators = {
3531
4106
  activityOutlets: [{ type: ViewChildren, args: [ActivityOutletComponent,] }]
3532
4107
  };
3533
4108
 
4109
+ class ActivityTitleComponent extends DisposableComponent {
4110
+ // @Input()
4111
+ // align: 'start' | 'end' | 'stretch' = 'start';
4112
+ //
4113
+ // @HostBinding('class.align-end')
4114
+ // get alignEnd():boolean {
4115
+ // return this.align === 'end'
4116
+ // }
4117
+ //
4118
+ // @HostBinding('class.align-stretch')
4119
+ // get alignStretch():boolean {
4120
+ // return this.align === 'stretch'
4121
+ // }
4122
+ ngOnInit() {
4123
+ }
4124
+ }
4125
+ ActivityTitleComponent.decorators = [
4126
+ { type: Component, args: [{
4127
+ selector: 'aup-activity-title',
4128
+ template: "<ng-content></ng-content>\n",
4129
+ styles: [":host{display:block}"]
4130
+ },] }
4131
+ ];
4132
+
3534
4133
  class InteractionServiceRoutingAdapter {
3535
4134
  constructor(activeInteractionContextIds, activeModalContext, createExclusiveInteractionContext) {
3536
4135
  this.activeInteractionContextIds = activeInteractionContextIds;
@@ -4191,11 +4790,13 @@ InteractionModule.decorators = [
4191
4790
  SelectInputActivity,
4192
4791
  AbstractInputActivity,
4193
4792
  InteractionContextTriggerFor,
4194
- Activity
4793
+ Activity,
4794
+ ActivityTitleComponent
4195
4795
  ],
4196
4796
  exports: [
4197
4797
  ActivityContainerComponent,
4198
4798
  ActivityOutletComponent,
4799
+ ActivityTitleComponent,
4199
4800
  InPlaceInteractionContextComponent,
4200
4801
  AddItemInteractionContextComponent,
4201
4802
  ActivityActionsComponent,
@@ -6990,5 +7591,5 @@ function VisitParameterList(options) {
6990
7591
  * Generated bundle index. Do not edit.
6991
7592
  */
6992
7593
 
6993
- export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AbstractInputActivity, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractPopupMenuComponent, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, AddItemInteractionContextComponent, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnModel, ColumnTemplateDirective, CommandComponent, CommandContainer, CommandDirective, CommandFace, CommandFaceComponent, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EventCleanUpSession, FlexComponent, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, HEADER_CELL_RENDERER_PORTAL, IconComponent, InPlaceInteractionContextComponent, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, ListPlaceNavComponent, ListPropertyColumnModel, ModalInteractionContextFactory, MoreMenuComponent, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NumberInputComponent, POPUP_CONTAINER, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, ParameterDefinition, PasswordInputComponent, Place, PlaceAccessGuard, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupAwareComponent, PopupInteractionContextComponent, PopupMenuComponent, PopupMenuRendererComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectCellRendererComponent, SelectHeaderCellRendererComponent, SelectInputActivity, SelectInputComponent, SelectionColumnModel, SeparatorComponent, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableCellRendererComponent, TableComponent, TableHeaderCellRendererComponent, TableModel, TableRowMenuComponent, TemplateCellRendererPortalRef, TextInputComponent, ToolBarComponent, TrackBy, UrlService, UrlSnapshot, VerticalFocusContainerComponent, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationTypeDetermined, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, ɵ0 };
7594
+ export { ACTIVITY_DATA, AUP_PLACE_CONFIG, AbstractInputActivity, AbstractInputComponent, AbstractInteractionContext, AbstractListInputComponent, AbstractPlaceNavigationComponent, AbstractPopStateNavigation, AbstractPopupMenuComponent, AbstractTableModel, AbstractValueInputComponent, Activity, ActivityActionsComponent, ActivityContainerComponent, ActivityOutletComponent, ActivityRef, ActivityTitleComponent, AddItemInteractionContextComponent, AlertDialogComponent, AngularUiPowerupsModule, AutocompleteInputComponent, Bounds, BusyOverlayComponent, CELL_EDITOR_PORTAL, CELL_RENDERER_PORTAL, CardContainerComponent, CellEditorPortalRef, CellHeaderPortalRef, CellPortalRef, CellRendererPortalRef, CheckboxInputComponent, ColumnModel, ColumnTemplateDirective, CommandComponent, CommandContainer, CommandDirective, CommandFace, CommandFaceComponent, ComponentCellRendererPortalRef, ComponentsModule, ConfirmThenDialogComponent, ConfirmationDialogComponent, ConsolidatedParameterMap, CustomTemplateColumnModel, CustomValueColumnModel, DEFINITION_META_DATA_KEY, DIALOG_INTERACTION_SERVICE_DEFAULTS, DecoratedTreeNode, DefaultCellRendererComponent, DefaultHeaderCellRendererComponent, DialogInteractionContext, DialogInteractionContextFactory, Dimension, DirectivesModule, DisposableComponent, EditRowControls, EditSession, EditorControlColumnModel, EmptyStateComponent, EventCleanUpSession, FlattenStrategy, FlexComponent, FocusBinding, FocusBindingDirective, FocusBindingFactory, FocusContainerComponent, FocusableComponent, Formatter, HEADER_CELL_RENDERER_PORTAL, IconComponent, InPlaceInteractionContextComponent, InteractionContextTriggerFor, InteractionModule, InteractionService, InteractionServiceRoutingAdapter, LEFT_RIGHT_PLACE_ANIMATION, ListPlaceNavComponent, ListPropertyColumnModel, ModalInteractionContextFactory, MoreMenuComponent, MultipleSelectInputComponent, Navigating, NavigatingDuringInteraction, NavigationContext, NavigationSession, NoopAuthGuard, NoopComponent, NumberInputComponent, POPUP_CONTAINER, PORTAL_EDITOR_COMPONENT, PORTAL_RENDERER_COMPONENT, ParameterDefinition, PasswordInputComponent, Place, PlaceAccessGuard, PlaceComponent, PlaceComponentDeactivationHandler, PlaceDefinition, PlaceGuard, PlaceHistory, PlaceModule, PlaceOutletComponent, PlaceRouter, Point, PopStateDuringInteractionNavigation, PopStateNavigation, PopupAwareComponent, PopupInteractionContextComponent, PopupMenuComponent, PopupMenuRendererComponent, PropertyColumnModel, ROUTE_PARAMETER_LIST_KEY, RemoveLastInteractionFromUrlNavigationSession, ResizeAwareComponent, RouteId, ScrollContainerComponent, SectionHeaderComponent, SelectCellRendererComponent, SelectHeaderCellRendererComponent, SelectInputActivity, SelectInputComponent, SelectionColumnModel, SelfAndDescendantsVisitor, SeparatorComponent, SidePlaceNavigationComponent, StringInputActivity, StringInputComponent, SwitchCaseComponent, SwitchCaseDefaultDirective, SwitchCaseOption, SwitchCaseWhenDirective, SynchroniseInteractionContextIdsWithRoute, TabbedPlaceNavigationComponent, TableCellRendererComponent, TableComponent, TableHeaderCellRendererComponent, TableModel, TableRowMenuComponent, TemplateCellRendererPortalRef, TextInputComponent, ToolBarComponent, TrackBy, TreeExpansionModel, TreeInheritanceIconComponent, TreeLabelCellRendererComponent, TreeLabelColumnModel, TreeTableComponent, TreeTableModel, TreeToListModel, UrlService, UrlSnapshot, VerticalFocusContainerComponent, Visit, VisitParameter, VisitParameterList, VisitSanitiser, WaitUntilLeavingInteractionTransitionCancelled, WaitUntilLinkTriggeredNavigationInteractionCancellationTypeDetermined, WaitUntilPopStateDuringCanDeactivateInteractionFinishes, leftRightPlaceAnimation, slideDownOnEnterAnimation, slideRightOnEnterAnimation, ɵ0 };
6994
7595
  //# sourceMappingURL=coolon-angular-ui-powerups.js.map