@coolon/angular-ui-powerups 3.12.0 → 3.14.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 (38) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/assets/table.scss +11 -0
  3. package/bundles/coolon-angular-ui-powerups.umd.js +72 -31
  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 +3 -3
  12. package/esm2015/lib/components/resize-aware.component.js.map +1 -1
  13. package/esm2015/lib/components/resize-aware.component.metadata.json +1 -1
  14. package/esm2015/lib/components/table/abstract-table-model.js +1 -5
  15. package/esm2015/lib/components/table/abstract-table-model.js.map +1 -1
  16. package/esm2015/lib/components/table/abstract-table-model.metadata.json +1 -1
  17. package/esm2015/lib/components/table/column-model.js +29 -10
  18. package/esm2015/lib/components/table/column-model.js.map +1 -1
  19. package/esm2015/lib/components/table/column-model.metadata.json +1 -1
  20. package/esm2015/lib/components/table/select-cell-renderer/select-cell-renderer.component.js +4 -2
  21. package/esm2015/lib/components/table/select-cell-renderer/select-cell-renderer.component.js.map +1 -1
  22. package/esm2015/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.js +5 -2
  23. package/esm2015/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.js.map +1 -1
  24. package/esm2015/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.metadata.json +1 -1
  25. package/esm2015/lib/components/table/table-model.js.map +1 -1
  26. package/esm2015/lib/components/table/table.component.js +25 -8
  27. package/esm2015/lib/components/table/table.component.js.map +1 -1
  28. package/esm2015/lib/components/table/table.component.metadata.json +1 -1
  29. package/fesm2015/coolon-angular-ui-powerups.js +65 -28
  30. package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
  31. package/lib/components/resize-aware.component.d.ts +1 -1
  32. package/lib/components/table/abstract-table-model.d.ts +1 -2
  33. package/lib/components/table/column-model.d.ts +9 -2
  34. package/lib/components/table/select-cell-renderer/select-cell-renderer.component.d.ts +2 -2
  35. package/lib/components/table/select-header-cell-renderer/select-header-cell-renderer.component.d.ts +4 -3
  36. package/lib/components/table/table-model.d.ts +1 -1
  37. package/lib/components/table/table.component.d.ts +3 -0
  38. 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.14.0](https://bitbucket.org/coolon/angular-ui-powerups/compare/v3.13.0...v3.14.0) (2021-02-23)
6
+
7
+
8
+ ### Features
9
+
10
+ * added aup-table column visibility and late selection model binding ([29ffa80](https://bitbucket.org/coolon/angular-ui-powerups/commit/29ffa803bc627b0c0b33777ebed13dbbb14ade97))
11
+
12
+ ## [3.13.0](https://bitbucket.org/coolon/angular-ui-powerups/compare/v3.12.0...v3.13.0) (2021-02-22)
13
+
14
+
15
+ ### Features
16
+
17
+ * added [showHeader] property to aup-table ([1146932](https://bitbucket.org/coolon/angular-ui-powerups/commit/11469328c1b7381a32bad67b09caef194823ea6e))
18
+
5
19
  ## [3.12.0](https://bitbucket.org/coolon/angular-ui-powerups/compare/v3.11.2...v3.12.0) (2021-02-22)
6
20
 
7
21
 
package/assets/table.scss CHANGED
@@ -3,7 +3,18 @@ aup-table {
3
3
  --resolved-row-selected-background-color: var(--row-selected-background-color, rgba(0, 0, 255, 0.04));
4
4
  --resolved-row-hover-background-color: var(--row-hover-background-color, rgba(0, 0, 0, 0.05));
5
5
 
6
+ &.hide-header {
7
+ .mat-table thead {
8
+ display: none;
9
+ }
10
+ }
11
+
6
12
  .mat-table {
13
+ td, th {
14
+ &.hide {
15
+ display: none;
16
+ }
17
+ }
7
18
 
8
19
  th.mat-header-cell:first-of-type, td.mat-cell:first-of-type, td.mat-footer-cell:first-of-type {
9
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 .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,10 +2389,10 @@
2389
2389
  }
2390
2390
  ResizeAwareComponent.prototype.ngAfterViewInit = function () {
2391
2391
  var _this = this;
2392
- this.updateBounds();
2392
+ this._updateBounds();
2393
2393
  var element = this.elementRef.nativeElement;
2394
2394
  var ro = new ResizeObserver__default['default'](function (entries, observer) {
2395
- _this.ngZone.run(function () { return _this.updateBounds(); });
2395
+ _this.ngZone.run(function () { return _this._updateBounds(); });
2396
2396
  });
2397
2397
  ro.observe(element);
2398
2398
  this.onDispose(function () { return ro.disconnect(); });
@@ -2422,7 +2422,7 @@
2422
2422
  enumerable: false,
2423
2423
  configurable: true
2424
2424
  });
2425
- ResizeAwareComponent.prototype.updateBounds = function () {
2425
+ ResizeAwareComponent.prototype._updateBounds = function () {
2426
2426
  this._boundsModel.value = exports.Bounds.ofElement(this.nativeElement);
2427
2427
  };
2428
2428
  return ResizeAwareComponent;
@@ -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
  // }
@@ -3288,17 +3308,27 @@
3288
3308
  // TODO: support user defined header and row heights via css vars.
3289
3309
  _this.headerHeight = new pectin.MutableValueModel(56);
3290
3310
  _this.rowHeight = new pectin.MutableValueModel(48);
3291
- var chain = pectin.Dsl.disposeWith(_this).chain;
3311
+ var _a = pectin.Dsl.disposeWith(_this), chain = _a.chain, when = _a.when;
3312
+ var actualHeaderHeight = chain(_this.showHeaderModel).map(function (show) {
3313
+ return show ? _this.headerHeight.value : 0;
3314
+ }, { dependsOn: _this.headerHeight });
3292
3315
  _this.visibleRowCount = chain(_this.boundsModel).map(function (bounds) {
3293
3316
  // TODO: this doesn't take into account any css styling adjustments etc. Will invistigate if it's an issue.
3294
- var rawRowCount = (bounds.height - _this.headerHeight.value) / _this.rowHeight.value;
3317
+ var rawRowCount = (bounds.height - actualHeaderHeight.value) / _this.rowHeight.value;
3295
3318
  return rawRowCount < 1 ? 0 : Math.floor(rawRowCount);
3296
3319
  }, {
3297
- dependsOn: [_this.headerHeight, _this.rowHeight],
3320
+ dependsOn: [actualHeaderHeight, _this.rowHeight],
3298
3321
  postponeWhile: chain(_this.boundsModel).pluckNumeric('height').isLessThan(1)
3299
3322
  });
3300
3323
  return _this;
3301
3324
  }
3325
+ Object.defineProperty(TableComponent.prototype, "hideHeader", {
3326
+ get: function () {
3327
+ return !this.showHeader;
3328
+ },
3329
+ enumerable: false,
3330
+ configurable: true
3331
+ });
3302
3332
  TableComponent.prototype.ngOnInit = function () {
3303
3333
  var _a = pectin.Dsl.disposeWith(this), chain = _a.chain, valueOf = _a.valueOf, before = _a.before, when = _a.when, after = _a.after, observe = _a.observe, switchOn = _a.switchOn;
3304
3334
  this.columns = chain(this.tableModel.columns);
@@ -3322,8 +3352,8 @@
3322
3352
  TableComponent.decorators = [
3323
3353
  { type: i0.Component, args: [{
3324
3354
  selector: 'aup-table',
3325
- 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",
3326
- styles: [":host{align-items:stretch;display:flex;flex-direction:column}:host table{flex:1;width:100%}"]
3355
+ 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()\" [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",
3356
+ styles: [":host{align-items:stretch;display:flex;flex-direction:column}:host table{width:100%}"]
3327
3357
  },] }
3328
3358
  ];
3329
3359
  TableComponent.ctorParameters = function () { return [
@@ -3331,12 +3361,23 @@
3331
3361
  { type: i0.NgZone }
3332
3362
  ]; };
3333
3363
  TableComponent.propDecorators = {
3334
- tableModel: [{ type: i0.Input }]
3364
+ tableModel: [{ type: i0.Input }],
3365
+ showHeaderModel: [{ type: i0.Input }],
3366
+ showHeader: [{ type: i0.Input }],
3367
+ hideHeader: [{ type: i0.HostBinding, args: ["class.hide-header",] }]
3335
3368
  };
3336
3369
  __decorate([
3337
3370
  pectin.TrackExternal(),
3338
3371
  __metadata("design:type", exports.AbstractTableModel)
3339
3372
  ], TableComponent.prototype, "tableModel", void 0);
3373
+ __decorate([
3374
+ pectin.TrackExternal({ defaultValue: true }),
3375
+ __metadata("design:type", pectin.ValueModel)
3376
+ ], TableComponent.prototype, "showHeaderModel", void 0);
3377
+ __decorate([
3378
+ pectin.StoreInValueModel("showHeaderModel"),
3379
+ __metadata("design:type", Boolean)
3380
+ ], TableComponent.prototype, "showHeader", void 0);
3340
3381
 
3341
3382
  var ColumnTemplateDirective = /** @class */ (function () {
3342
3383
  function ColumnTemplateDirective(host, templateRef, viewContainer) {