@ai-table/grid 0.5.2 → 0.5.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.
|
@@ -11830,11 +11830,10 @@ function toggleSelectAllRecords(aiTable, checked) {
|
|
|
11830
11830
|
}
|
|
11831
11831
|
function getNextRecordByActiveCell(aiTable) {
|
|
11832
11832
|
const records = aiTable.gridData().records;
|
|
11833
|
-
const visibleRowsIndexMap = aiTable.context.visibleRowsIndexMap();
|
|
11834
11833
|
const currentId = aiTable.selection().activeCell?.[0];
|
|
11835
11834
|
if (!currentId)
|
|
11836
11835
|
return null;
|
|
11837
|
-
const currentIndex =
|
|
11836
|
+
const currentIndex = records.findIndex((item) => item._id === currentId);
|
|
11838
11837
|
if (currentIndex === -1 || currentIndex === records.length - 1) {
|
|
11839
11838
|
return null;
|
|
11840
11839
|
}
|
|
@@ -11843,11 +11842,10 @@ function getNextRecordByActiveCell(aiTable) {
|
|
|
11843
11842
|
}
|
|
11844
11843
|
function getPreviousRecordByActiveCell(aiTable) {
|
|
11845
11844
|
const records = aiTable.gridData().records;
|
|
11846
|
-
const visibleRowsIndexMap = aiTable.context.visibleRowsIndexMap();
|
|
11847
11845
|
const currentId = aiTable.selection().activeCell?.[0];
|
|
11848
11846
|
if (!currentId)
|
|
11849
11847
|
return null;
|
|
11850
|
-
const currentIndex =
|
|
11848
|
+
const currentIndex = records.findIndex((item) => item._id === currentId);
|
|
11851
11849
|
if (currentIndex <= 0) {
|
|
11852
11850
|
return null;
|
|
11853
11851
|
}
|
|
@@ -11856,8 +11854,7 @@ function getPreviousRecordByActiveCell(aiTable) {
|
|
|
11856
11854
|
}
|
|
11857
11855
|
function getRecordNavigationInfo(aiTable, recordId) {
|
|
11858
11856
|
const records = aiTable.gridData().records;
|
|
11859
|
-
const
|
|
11860
|
-
const index = visibleRowsIndexMap.get(recordId) || 0;
|
|
11857
|
+
const index = records.findIndex((item) => item._id === recordId);
|
|
11861
11858
|
if (index === -1)
|
|
11862
11859
|
return null;
|
|
11863
11860
|
return {
|