@arsedizioni/ars-utils 18.2.8 → 18.2.10
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.
- package/clipper.common/common/definitions.d.ts +4 -2
- package/clipper.ui/ui/browser-dialog/browser-dialog.component.d.ts +4 -0
- package/clipper.ui/ui/search-result-item/search-result-item.component.d.ts +2 -1
- package/core/selectable.d.ts +4 -4
- package/esm2022/clipper.common/common/definitions.mjs +4 -4
- package/esm2022/clipper.ui/ui/browser-dialog/browser-dialog.component.mjs +11 -4
- package/esm2022/clipper.ui/ui/document/document.component.mjs +3 -3
- package/esm2022/clipper.ui/ui/document-manager/document-manager.mjs +4 -4
- package/esm2022/clipper.ui/ui/search-result-item/search-result-item.component.mjs +5 -3
- package/esm2022/clipper.ui/ui/search-result-manager/search-result-manager.mjs +7 -4
- package/esm2022/core/selectable.mjs +30 -17
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs +3 -3
- package/fesm2022/arsedizioni-ars-utils-clipper.common.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs +24 -13
- package/fesm2022/arsedizioni-ars-utils-clipper.ui.mjs.map +1 -1
- package/fesm2022/arsedizioni-ars-utils-core.mjs +29 -16
- package/fesm2022/arsedizioni-ars-utils-core.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1654,8 +1654,9 @@ class SelectableModel {
|
|
|
1654
1654
|
*/
|
|
1655
1655
|
updateCurrent(item, lookupValue) {
|
|
1656
1656
|
const p = SystemUtils.arrayFindIndexByKey(this._all, this._lookupFieldName, lookupValue);
|
|
1657
|
-
if (p != -1)
|
|
1657
|
+
if (p != -1) {
|
|
1658
1658
|
this._current.toggle(item);
|
|
1659
|
+
}
|
|
1659
1660
|
}
|
|
1660
1661
|
/**
|
|
1661
1662
|
* Select an item
|
|
@@ -1663,12 +1664,16 @@ class SelectableModel {
|
|
|
1663
1664
|
* @param lookupValue : the value
|
|
1664
1665
|
*/
|
|
1665
1666
|
toggle(item, lookupValue) {
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1667
|
+
if (lookupValue) {
|
|
1668
|
+
const p = SystemUtils.arrayFindIndexByKey(this._all, this._lookupFieldName, lookupValue);
|
|
1669
|
+
if (p == -1) {
|
|
1670
|
+
this._all.push(item);
|
|
1671
|
+
}
|
|
1672
|
+
else {
|
|
1673
|
+
this._all.splice(p, 1);
|
|
1674
|
+
}
|
|
1675
|
+
this._current.toggle(item);
|
|
1676
|
+
}
|
|
1672
1677
|
}
|
|
1673
1678
|
/**
|
|
1674
1679
|
* Select an item
|
|
@@ -1676,10 +1681,15 @@ class SelectableModel {
|
|
|
1676
1681
|
* @param lookupValue : the value
|
|
1677
1682
|
*/
|
|
1678
1683
|
select(item, lookupValue) {
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1684
|
+
if (lookupValue) {
|
|
1685
|
+
const p = SystemUtils.arrayFindIndexByKey(this._all, this._lookupFieldName, lookupValue);
|
|
1686
|
+
if (p == -1) {
|
|
1687
|
+
this._all.push(item);
|
|
1688
|
+
}
|
|
1689
|
+
else {
|
|
1690
|
+
this._current.select(item);
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1683
1693
|
}
|
|
1684
1694
|
/**
|
|
1685
1695
|
* Deselect an item
|
|
@@ -1687,10 +1697,12 @@ class SelectableModel {
|
|
|
1687
1697
|
* @param lookupValue : the value
|
|
1688
1698
|
*/
|
|
1689
1699
|
deselect(item, lookupValue) {
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1700
|
+
if (lookupValue) {
|
|
1701
|
+
const p = SystemUtils.arrayFindIndexByKey(this._all, this._lookupFieldName, lookupValue);
|
|
1702
|
+
if (p != -1) {
|
|
1703
|
+
this._all.splice(p, 1);
|
|
1704
|
+
this._current.deselect(item);
|
|
1705
|
+
}
|
|
1694
1706
|
}
|
|
1695
1707
|
}
|
|
1696
1708
|
/**
|
|
@@ -1732,7 +1744,8 @@ class SelectableModel {
|
|
|
1732
1744
|
* @returns : true if the value is selected
|
|
1733
1745
|
*/
|
|
1734
1746
|
isSelected(lookupValue) {
|
|
1735
|
-
return (
|
|
1747
|
+
return (lookupValue &&
|
|
1748
|
+
SystemUtils.arrayFindIndexByKey(this._all, this._lookupFieldName, lookupValue) != -1);
|
|
1736
1749
|
}
|
|
1737
1750
|
/**
|
|
1738
1751
|
* Checks if a selection exists
|