@coolon/angular-ui-powerups 3.13.0 → 3.15.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 (36) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/assets/table.scss +5 -0
  3. package/bundles/coolon-angular-ui-powerups.umd.js +55 -26
  4. package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
  5. package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
  6. package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
  7. package/coolon-angular-ui-powerups.metadata.json +1 -1
  8. package/esm2015/lib/components/card-container/card-container.component.js +1 -1
  9. package/esm2015/lib/components/card-container/card-container.component.metadata.json +1 -1
  10. package/esm2015/lib/components/components.module.ngfactory.js.map +1 -1
  11. package/esm2015/lib/components/resize-aware.component.js +1 -1
  12. package/esm2015/lib/components/resize-aware.component.js.map +1 -1
  13. package/esm2015/lib/components/table/abstract-table-model.js +1 -5
  14. package/esm2015/lib/components/table/abstract-table-model.js.map +1 -1
  15. package/esm2015/lib/components/table/abstract-table-model.metadata.json +1 -1
  16. package/esm2015/lib/components/table/column-model.js +29 -10
  17. package/esm2015/lib/components/table/column-model.js.map +1 -1
  18. package/esm2015/lib/components/table/column-model.metadata.json +1 -1
  19. package/esm2015/lib/components/table/select-cell-renderer/select-cell-renderer.component.js +4 -2
  20. package/esm2015/lib/components/table/select-cell-renderer/select-cell-renderer.component.js.map +1 -1
  21. package/esm2015/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.js +5 -2
  22. package/esm2015/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.js.map +1 -1
  23. package/esm2015/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.metadata.json +1 -1
  24. package/esm2015/lib/components/table/table-model.js.map +1 -1
  25. package/esm2015/lib/components/table/table.component.js +12 -3
  26. package/esm2015/lib/components/table/table.component.js.map +1 -1
  27. package/esm2015/lib/components/table/table.component.metadata.json +1 -1
  28. package/fesm2015/coolon-angular-ui-powerups.js +52 -23
  29. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  30. package/lib/components/table/abstract-table-model.d.ts +1 -2
  31. package/lib/components/table/column-model.d.ts +9 -2
  32. package/lib/components/table/select-cell-renderer/select-cell-renderer.component.d.ts +2 -2
  33. package/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.d.ts +4 -3
  34. package/lib/components/table/table-model.d.ts +1 -1
  35. package/lib/components/table/table.component.d.ts +6 -0
  36. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ## [3.15.0](https://bitbucket.org/coolon/angular-ui-powerups/compare/v3.14.0...v3.15.0) (2021-02-23)
6
+
7
+
8
+ ### Features
9
+
10
+ * added aup-table enableScrolling property ([e2ec5c2](https://bitbucket.org/coolon/angular-ui-powerups/commit/e2ec5c2fe023bc645809d9278214a6956d38b19d))
11
+
12
+ ## [3.14.0](https://bitbucket.org/coolon/angular-ui-powerups/compare/v3.13.0...v3.14.0) (2021-02-23)
13
+
14
+
15
+ ### Features
16
+
17
+ * added aup-table column visibility and late selection model binding ([29ffa80](https://bitbucket.org/coolon/angular-ui-powerups/commit/29ffa803bc627b0c0b33777ebed13dbbb14ade97))
18
+
5
19
  ## [3.13.0](https://bitbucket.org/coolon/angular-ui-powerups/compare/v3.12.0...v3.13.0) (2021-02-22)
6
20
 
7
21
 
package/assets/table.scss CHANGED
@@ -10,6 +10,11 @@ aup-table {
10
10
  }
11
11
 
12
12
  .mat-table {
13
+ td, th {
14
+ &.hide {
15
+ display: none;
16
+ }
17
+ }
13
18
 
14
19
  th.mat-header-cell:first-of-type, td.mat-cell:first-of-type, td.mat-footer-cell:first-of-type {
15
20
  padding-left: 0;
@@ -729,7 +729,7 @@
729
729
  { type: i0.Component, args: [{
730
730
  selector: 'aup-card-container',
731
731
  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",
732
- 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));--resolved-row-selected-background-color:var(--row-selected-background-color,rgba(0,0,255,0.04))}aup-table.hide-header .mat-table thead{display:none}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 tr.aup-row-selected,aup-table .mat-table tr.aup-row-selected.enable-hover:hover{background-color:var(--resolved-row-selected-background-color)}aup-table .mat-table td.enable-cursor{cursor:pointer}aup-table .mat-table .mat-cell:not(.flex),aup-table .mat-table .mat-header-cell:not(.flex){white-space:nowrap;width:1px}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)}"]
732
+ 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));--resolved-row-selected-background-color:var(--row-selected-background-color,rgba(0,0,255,0.04))}aup-table.hide-header .mat-table thead,aup-table .mat-table td.hide,aup-table .mat-table th.hide{display:none}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 tr.aup-row-selected,aup-table .mat-table tr.aup-row-selected.enable-hover:hover{background-color:var(--resolved-row-selected-background-color)}aup-table .mat-table td.enable-cursor{cursor:pointer}aup-table .mat-table .mat-cell:not(.flex),aup-table .mat-table .mat-header-cell:not(.flex){white-space:nowrap;width:1px}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)}"]
733
733
  },] }
734
734
  ];
735
735
  CardContainerComponent.ctorParameters = function () { return []; };
@@ -2389,13 +2389,13 @@
2389
2389
  }
2390
2390
  ResizeAwareComponent.prototype.ngAfterViewInit = function () {
2391
2391
  var _this = this;
2392
- this._updateBounds();
2393
2392
  var element = this.elementRef.nativeElement;
2394
2393
  var ro = new ResizeObserver__default['default'](function (entries, observer) {
2395
2394
  _this.ngZone.run(function () { return _this._updateBounds(); });
2396
2395
  });
2397
2396
  ro.observe(element);
2398
2397
  this.onDispose(function () { return ro.disconnect(); });
2398
+ setTimeout(function () { return _this._updateBounds(); });
2399
2399
  };
2400
2400
  Object.defineProperty(ResizeAwareComponent.prototype, "boundsModel", {
2401
2401
  get: function () {
@@ -2639,12 +2639,14 @@
2639
2639
  function SelectCellRendererComponent() {
2640
2640
  var _this = _super.call(this) || this;
2641
2641
  _this.selectCommand = pectin.Command.create(function () {
2642
- _this.selectionModel.selectCommand.execute(_this.row);
2642
+ var _a;
2643
+ (_a = _this.selectionModel) === null || _a === void 0 ? void 0 : _a.selectCommand.execute(_this.row);
2643
2644
  });
2644
2645
  return _this;
2645
2646
  }
2646
2647
  SelectCellRendererComponent.prototype.isSelected = function () {
2647
- return this.selectionModel.isSelected(this.row);
2648
+ var _a;
2649
+ return (_a = this.selectionModel) === null || _a === void 0 ? void 0 : _a.isSelected(this.row);
2648
2650
  };
2649
2651
  return SelectCellRendererComponent;
2650
2652
  }(DisposableComponent));
@@ -2677,12 +2679,15 @@
2677
2679
  var _a;
2678
2680
  return ((_a = this.selectionModel) === null || _a === void 0 ? void 0 : _a.someSelected.value) || false;
2679
2681
  };
2682
+ SelectHeaderCellRendererComponent.prototype.isVisible = function () {
2683
+ return this.enableHeaderControls && this.selectionModel.getDelegate() instanceof pectin.MultipleSelectionModel;
2684
+ };
2680
2685
  return SelectHeaderCellRendererComponent;
2681
2686
  }(DisposableComponent));
2682
2687
  SelectHeaderCellRendererComponent.decorators = [
2683
2688
  { type: i0.Component, args: [{
2684
2689
  selector: 'aup-select-header-cell-renderer',
2685
- template: "<mat-checkbox *ngIf=\"enableHeaderControls\" [pectinCommand]=\"selectCommand\" [checked]=\"isSelected()\" [indeterminate]=\"this.isIntermediate()\"></mat-checkbox>\n",
2690
+ template: "<mat-checkbox *ngIf=\"isVisible()\" [pectinCommand]=\"selectCommand\" [checked]=\"isSelected()\" [indeterminate]=\"this.isIntermediate()\"></mat-checkbox>\n",
2686
2691
  styles: [""]
2687
2692
  },] }
2688
2693
  ];
@@ -2691,13 +2696,14 @@
2691
2696
  var noop = function () {
2692
2697
  };
2693
2698
  var ɵ0 = noop;
2694
- var CELL_RENDERER_COMPONENT_ROW_CACHE = Symbol("aup-cell-renderer:row-data-cache");
2699
+ var CELL_RENDERER_COMPONENT_ROW_CACHE = Symbol('aup-cell-renderer:row-data-cache');
2695
2700
  var ColumnModel = /** @class */ (function () {
2696
2701
  function ColumnModel(columnId, textPropertiesProvider) {
2697
2702
  this.columnId = columnId;
2698
2703
  this.textPropertiesProvider = textPropertiesProvider;
2699
2704
  this._selectRowOnClick = undefined;
2700
2705
  this._flex = false;
2706
+ this._visibleModel = new pectin.DelegatingValueModel().withDefault(true);
2701
2707
  this.installHeaderRenderer();
2702
2708
  }
2703
2709
  ColumnModel.prototype.installHeaderRenderer = function () {
@@ -2709,6 +2715,20 @@
2709
2715
  var _a;
2710
2716
  return ((_a = this.getColumnTextProperties()) === null || _a === void 0 ? void 0 : _a.headerText()) || this.getDefaultHeaderText();
2711
2717
  };
2718
+ ColumnModel.prototype.isVisible = function () {
2719
+ return this.visible.value;
2720
+ };
2721
+ Object.defineProperty(ColumnModel.prototype, "visible", {
2722
+ get: function () {
2723
+ return this._visibleModel.readonly;
2724
+ },
2725
+ enumerable: false,
2726
+ configurable: true
2727
+ });
2728
+ ColumnModel.prototype.visibleWhile = function (visible) {
2729
+ this._visibleModel.setDelegate(visible);
2730
+ return this;
2731
+ };
2712
2732
  ColumnModel.prototype.getDefaultHeaderText = function () {
2713
2733
  return this.columnId;
2714
2734
  };
@@ -2998,21 +3018,26 @@
2998
3018
  __extends(SelectionColumnModel, _super);
2999
3019
  function SelectionColumnModel(columnId, defaults, selectionModel) {
3000
3020
  var _this = _super.call(this, columnId, defaults) || this;
3001
- _this.selectionModel = selectionModel;
3002
3021
  _this._enableHeaderControls = true;
3022
+ _this.selectionModel = pectin.DelegatingSelectionModel.createDelegate();
3023
+ _this.hasSelectionModel = new pectin.MutableValueModel(false);
3003
3024
  _this.selectOnRowClick(false);
3004
- if (selectionModel instanceof pectin.MultipleSelectionModel) {
3005
- _this.cellHeaderRenderer(SelectHeaderCellRendererComponent, function (component) {
3006
- component.selectionModel = selectionModel;
3007
- component.enableHeaderControls = _this._enableHeaderControls;
3008
- });
3009
- }
3025
+ _this.cellHeaderRenderer(SelectHeaderCellRendererComponent, function (component) {
3026
+ component.selectionModel = _this.selectionModel;
3027
+ component.enableHeaderControls = _this._enableHeaderControls;
3028
+ });
3010
3029
  _this.configureCellRenderer(new ComponentCellRendererPortalRef(SelectCellRendererComponent, function (component, rowData) {
3011
3030
  component.row = rowData.row;
3012
- component.selectionModel = selectionModel;
3031
+ component.selectionModel = _this.selectionModel;
3013
3032
  }));
3033
+ _this.setSelectionModel(selectionModel);
3034
+ _this.visibleWhile(_this.hasSelectionModel);
3014
3035
  return _this;
3015
3036
  }
3037
+ SelectionColumnModel.prototype.setSelectionModel = function (selectionModel) {
3038
+ this.selectionModel.setDelegate(selectionModel);
3039
+ this.hasSelectionModel.value = !!selectionModel;
3040
+ };
3016
3041
  SelectionColumnModel.prototype.getDefaultHeaderText = function () {
3017
3042
  return '';
3018
3043
  };
@@ -3031,6 +3056,9 @@
3031
3056
  SelectionColumnModel.prototype.selectRow = function (row) {
3032
3057
  this.selectionModel.selectCommand.execute(row);
3033
3058
  };
3059
+ SelectionColumnModel.prototype.isSelected = function (row) {
3060
+ return this.selectionModel.isSelected(row);
3061
+ };
3034
3062
  return SelectionColumnModel;
3035
3063
  }(ColumnModel));
3036
3064
 
@@ -3122,7 +3150,7 @@
3122
3150
  pectin.assert.isNil(this.selectionColumnModel);
3123
3151
  var columnId = 'selection-column';
3124
3152
  this.selectionColumnModel = new SelectionColumnModel(columnId, function () { return _this.getColumnTextProperties(columnId); }, selectionModel);
3125
- this.addRowClass("aup-row-selected", function (row) { return selectionModel.isSelected(row); });
3153
+ this.addRowClass("aup-row-selected", function (row) { return _this.selectionColumnModel.isSelected(row); });
3126
3154
  return this.addColumn(this.selectionColumnModel);
3127
3155
  };
3128
3156
  AbstractTableModel.prototype.addEditControls = function (saveCommand) {
@@ -3168,14 +3196,6 @@
3168
3196
  }
3169
3197
  return column;
3170
3198
  };
3171
- Object.defineProperty(AbstractTableModel.prototype, "selectionModel", {
3172
- get: function () {
3173
- var _a;
3174
- return (_a = this.selectionColumnModel) === null || _a === void 0 ? void 0 : _a.selectionModel;
3175
- },
3176
- enumerable: false,
3177
- configurable: true
3178
- });
3179
3199
  // removeColumn(column: ColumnModel<Row>) {
3180
3200
  //
3181
3201
  // }
@@ -3285,6 +3305,12 @@
3285
3305
  __extends(TableComponent, _super);
3286
3306
  function TableComponent(elementRef, ngZone) {
3287
3307
  var _this = _super.call(this, elementRef, ngZone) || this;
3308
+ /**
3309
+ * Set to true to enable scrolling. Once enabled the table will have 0 implicit height. You will either
3310
+ * need to set it explicitly e.g. height: 400px; or by using flex or grid layout to make it fill it's
3311
+ * containment area.
3312
+ */
3313
+ _this.enableScrolling = false;
3288
3314
  // TODO: support user defined header and row heights via css vars.
3289
3315
  _this.headerHeight = new pectin.MutableValueModel(56);
3290
3316
  _this.rowHeight = new pectin.MutableValueModel(48);
@@ -3295,7 +3321,9 @@
3295
3321
  _this.visibleRowCount = chain(_this.boundsModel).map(function (bounds) {
3296
3322
  // TODO: this doesn't take into account any css styling adjustments etc. Will invistigate if it's an issue.
3297
3323
  var rawRowCount = (bounds.height - actualHeaderHeight.value) / _this.rowHeight.value;
3298
- return rawRowCount < 1 ? 0 : Math.floor(rawRowCount);
3324
+ var rowCount = rawRowCount < 1 ? 0 : Math.floor(rawRowCount);
3325
+ console.log({ rowCount: rowCount });
3326
+ return rowCount;
3299
3327
  }, {
3300
3328
  dependsOn: [actualHeaderHeight, _this.rowHeight],
3301
3329
  postponeWhile: chain(_this.boundsModel).pluckNumeric('height').isLessThan(1)
@@ -3332,8 +3360,8 @@
3332
3360
  TableComponent.decorators = [
3333
3361
  { type: i0.Component, args: [{
3334
3362
  selector: 'aup-table',
3335
- 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\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\">\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)\"\n [class.enable-cursor]=\"tableModel.isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n >\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()\"\n [attr.trackBy]=\"tableModel.trackBy(i, row)\"\n ></tr>\n\n</table>\n",
3336
- styles: [":host{align-items:stretch;display:flex;flex-direction:column}:host table{width:100%}"]
3363
+ template: "<div class=\"scroll-container\">\n <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\"\n matColumnDef=\"{{column.columnId}}\">\n <th mat-header-cell *matHeaderCellDef [class.flex]=\"column.isFlex()\" [class.hide]=\"!column.isVisible()\">\n <aup-table-header-cell-renderer [column]=\"column\"\n [attr.column-index]=\"index\"\n [attr.column-id]=\"column.columnId\"\n [class.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)\"\n [class.enable-cursor]=\"tableModel.isCursorEnabled(column)\"\n [class.flex]=\"column.isFlex()\"\n [class.hide]=\"!column.isVisible()\"\n >\n <aup-table-cell-renderer [column]=\"column\"\n [row]=\"row\"\n [tableModel]=\"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()\"\n [attr.trackBy]=\"tableModel.trackBy(i, row)\"\n ></tr>\n\n </table>\n</div>\n",
3364
+ styles: [":host{align-items:stretch;display:flex;flex-direction:column}:host table{width:100%}:host.enable-scrolling{min-height:0}:host.enable-scrolling .scroll-container{align-items:stretch;display:flex;flex:1;flex-basis:0;flex-direction:column;overflow-y:scroll}"]
3337
3365
  },] }
3338
3366
  ];
3339
3367
  TableComponent.ctorParameters = function () { return [
@@ -3344,6 +3372,7 @@
3344
3372
  tableModel: [{ type: i0.Input }],
3345
3373
  showHeaderModel: [{ type: i0.Input }],
3346
3374
  showHeader: [{ type: i0.Input }],
3375
+ enableScrolling: [{ type: i0.Input }, { type: i0.HostBinding, args: ["class.enable-scrolling",] }],
3347
3376
  hideHeader: [{ type: i0.HostBinding, args: ["class.hide-header",] }]
3348
3377
  };
3349
3378
  __decorate([