@coolon/angular-ui-powerups 14.23.0 → 14.24.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.
@@ -39,7 +39,7 @@ import { MatTableModule } from '@angular/material/table';
39
39
  import * as i4 from '@angular/material/tooltip';
40
40
  import { MatTooltipModule } from '@angular/material/tooltip';
41
41
  import * as i1$3 from '@coolon/pectin';
42
- import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, Functions, HasDelegate, MultipleSelectionModel, SelectionModel, AbstractComputedListModel, DelegatingSelectionModel, DirtyTrackingForm, PageController, PagedListModel, ComputedListModel, Deferred } from '@coolon/pectin';
42
+ import { GarbageCollector, DelegatingValueModel, assert, UnaryCommand, lang, Dsl, Logger, TrackExternal, ValueModel, StoreInValueModel, Command, MutableListModel, StoreInListModel, Disposable, DelegatingListModel, MutableValueModel, FocusManager, EventListenerList, Form, Guard, Binding, DebugContext, ListModel, Functions, HasDelegate, MultipleSelectionModel, SelectionModel, AbstractComputedListModel, DirtyTrackingForm, DelegatingSelectionModel, PageController, PagedListModel, ComputedListModel, Deferred } from '@coolon/pectin';
43
43
  import { __decorate, __param, __metadata } from 'tslib';
44
44
  import * as i1 from '@angular/platform-browser';
45
45
  import escapeStringRegexp from 'escape-string-regexp';
@@ -3367,9 +3367,9 @@ class PropertyColumnModel extends ColumnModel {
3367
3367
  class SelectionColumnModel extends ColumnModel {
3368
3368
  constructor(columnId, defaults, selectionModel) {
3369
3369
  super(columnId, defaults);
3370
+ this.selectionModel = selectionModel;
3370
3371
  this._enableHeaderControls = true;
3371
3372
  this._color = "accent";
3372
- this.selectionModel = DelegatingSelectionModel.createDelegate();
3373
3373
  const { chain } = Dsl.disposeWith(this);
3374
3374
  this._selectRowOnClick(false);
3375
3375
  this.cellHeaderRenderer(SelectionHeaderCellComponent, (component) => {
@@ -3382,11 +3382,10 @@ class SelectionColumnModel extends ColumnModel {
3382
3382
  component.selectionModel = this.selectionModel;
3383
3383
  component.color = this._color;
3384
3384
  }));
3385
- this.setSelectionModel(selectionModel);
3386
3385
  this.setMasterVisibility(this.selectionModel.enabled$);
3387
3386
  this.setDefaultVisibility(chain(this.selectionModel.mode$).equals(SelectionModel.Mode.MULTIPLE));
3388
3387
  }
3389
- setSelectionModel(selectionModel) {
3388
+ useSelectionModel(selectionModel) {
3390
3389
  this.selectionModel.setDelegate(selectionModel);
3391
3390
  }
3392
3391
  getDefaultHeaderText() {
@@ -3431,6 +3430,7 @@ class AbstractTableModel extends GarbageCollector {
3431
3430
  this.rowClassNamePredicates = [];
3432
3431
  this.rowClickListeners = new EventListenerList();
3433
3432
  this._createForm = (row) => new DirtyTrackingForm();
3433
+ this.delegatingSelectionModel = DelegatingSelectionModel.createDelegate();
3434
3434
  const { chain, valueOf, before, when, after, observe, switchOn } = Dsl.disposeWith(this);
3435
3435
  this._rowsBeingEdited$ = new MutableListModel([], {
3436
3436
  identifiedWith: row => this.identityOf(row)
@@ -3447,6 +3447,9 @@ class AbstractTableModel extends GarbageCollector {
3447
3447
  this.lastVisibleColumn$ = chain(this._columnList).last();
3448
3448
  this.rowSelectionDisabledOnAllColumns$ = chain(this._columnList).select(column => column.isRowSelectionEnabled()).count().equals(0);
3449
3449
  this.dataSourceEmpty$ = chain(this.dataSource$).isEmpty();
3450
+ this.selectedItems$ = this.delegatingSelectionModel.selectedItems$;
3451
+ this.leadSelection$ = this.delegatingSelectionModel.leadSelection$;
3452
+ this.hasSelection$ = chain(this.selectedItems$).isNotEmpty();
3450
3453
  }
3451
3454
  setDataSource(dataSource$) {
3452
3455
  this._dataSource$.setDelegate(dataSource$);
@@ -3536,7 +3539,8 @@ class AbstractTableModel extends GarbageCollector {
3536
3539
  _addSelectionColumn(selectionModel, visible) {
3537
3540
  assert.isNil(this.selectionColumnModel);
3538
3541
  const columnId = "selection-column";
3539
- this.selectionColumnModel = new SelectionColumnModel(columnId, () => this.getColumnTextProperties(columnId), selectionModel);
3542
+ this.selectionColumnModel = new SelectionColumnModel(columnId, () => this.getColumnTextProperties(columnId), this.delegatingSelectionModel);
3543
+ this.selectionColumnModel.useSelectionModel(selectionModel);
3540
3544
  this.addRowClass("aup-row-selected", row => this.selectionColumnModel.isSelected(row));
3541
3545
  const selectionColumnModel = this.addColumn(this.selectionColumnModel, 0);
3542
3546
  if (!isNil$1(visible)) {