@elderbyte/ngx-starter 20.4.2 → 20.4.3

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.
@@ -8414,11 +8414,12 @@ var SelectionEventSource;
8414
8414
  SelectionEventSource["SYSTEM"] = "SYSTEM";
8415
8415
  })(SelectionEventSource || (SelectionEventSource = {}));
8416
8416
  class SelectionChangedEvent {
8417
- constructor(after, addedById, removed, source, info) {
8417
+ constructor(after, addedById, removed, source, multiSelection, info) {
8418
8418
  this.after = after;
8419
8419
  this.addedById = addedById;
8420
8420
  this.removed = removed;
8421
8421
  this.source = source;
8422
+ this.multiSelection = multiSelection;
8422
8423
  this.info = info;
8423
8424
  }
8424
8425
  get isUserSource() {
@@ -8593,17 +8594,18 @@ class SelectionModel {
8593
8594
  set isMultipleSelection(multiple) {
8594
8595
  if (multiple !== this._multiple) {
8595
8596
  this._multiple = multiple;
8597
+ const before = this.snapshotInnerSelection();
8596
8598
  if (!this._multiple) {
8597
8599
  const selected = this.selectionSnapshot;
8598
8600
  if (selected.length > 1) {
8599
8601
  this.log.debug('Multiple selection was deactivated but there where more than one selected items present, fixing now!');
8600
- this.select([selected[0]], {
8601
- source: SelectionEventSource.SYSTEM,
8602
- info: 'Multi selection was deactivated',
8603
- });
8602
+ this.selectInternal([selected[0]]);
8604
8603
  }
8605
8604
  }
8606
- // TODO this.selectionChanged('multi-selection-toggle')
8605
+ this.selectionChanged(this.buildChangeEvent(before, {
8606
+ source: SelectionEventSource.SYSTEM,
8607
+ info: 'set:isMultipleSelection',
8608
+ }));
8607
8609
  }
8608
8610
  }
8609
8611
  /***************************************************************************
@@ -8615,7 +8617,7 @@ class SelectionModel {
8615
8617
  const options = this.coerceOptions(customOptions);
8616
8618
  const after = this.snapshotInnerSelection();
8617
8619
  const delta = this.deltaIds(before, after);
8618
- return new SelectionChangedEvent(this.mapValues(after), delta.added, delta.removed, options.source, options.info);
8620
+ return new SelectionChangedEvent(this.mapValues(after), delta.added, delta.removed, options.source, this._multiple, options.info);
8619
8621
  }
8620
8622
  deltaIds(beforeById, afterById) {
8621
8623
  return EntityDelta.buildDelta(new Set(beforeById.keys()), afterById);