@arsedizioni/ars-utils 18.2.89 → 18.2.91

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.
@@ -1642,6 +1642,7 @@ class SelectableModel {
1642
1642
  return this._current;
1643
1643
  }
1644
1644
  constructor(allowMultiSelect = true, lookupFieldName = "id") {
1645
+ this.changed = new EventEmitter();
1645
1646
  this._all = [];
1646
1647
  this._current = new SelectionModel(allowMultiSelect, []);
1647
1648
  this._all = [];
@@ -1656,6 +1657,7 @@ class SelectableModel {
1656
1657
  const p = SystemUtils.arrayFindIndexByKey(this._all, this._lookupFieldName, lookupValue);
1657
1658
  if (p != -1) {
1658
1659
  this._current.toggle(item);
1660
+ this.changed.emit(item);
1659
1661
  }
1660
1662
  }
1661
1663
  /**
@@ -1673,6 +1675,7 @@ class SelectableModel {
1673
1675
  this._all.splice(p, 1);
1674
1676
  }
1675
1677
  this._current.toggle(item);
1678
+ this.changed.emit(item);
1676
1679
  }
1677
1680
  }
1678
1681
  /**
@@ -1689,6 +1692,7 @@ class SelectableModel {
1689
1692
  else {
1690
1693
  this._current.select(item);
1691
1694
  }
1695
+ this.changed.emit(item);
1692
1696
  }
1693
1697
  }
1694
1698
  /**
@@ -1702,6 +1706,7 @@ class SelectableModel {
1702
1706
  if (p != -1) {
1703
1707
  this._all.splice(p, 1);
1704
1708
  this._current.deselect(item);
1709
+ this.changed.emit(item);
1705
1710
  }
1706
1711
  }
1707
1712
  }
@@ -1718,6 +1723,7 @@ class SelectableModel {
1718
1723
  let item = this._all[p];
1719
1724
  this._all.splice(p, 1);
1720
1725
  this._current.deselect(item);
1726
+ this.changed.emit(item);
1721
1727
  }
1722
1728
  });
1723
1729
  }
@@ -1730,6 +1736,7 @@ class SelectableModel {
1730
1736
  clearFunc(n);
1731
1737
  });
1732
1738
  this._current.clear();
1739
+ this.changed.emit();
1733
1740
  }
1734
1741
  /**
1735
1742
  * Deselect all items
@@ -1737,6 +1744,7 @@ class SelectableModel {
1737
1744
  clear() {
1738
1745
  this._all = [];
1739
1746
  this._current.clear();
1747
+ this.changed.emit();
1740
1748
  }
1741
1749
  /**
1742
1750
  * Checks if an item is selected using its lookup value