vueless 0.0.705 → 0.0.706
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/package.json +1 -1
- package/ui.data-table/UTable.vue +12 -2
package/package.json
CHANGED
package/ui.data-table/UTable.vue
CHANGED
|
@@ -227,7 +227,7 @@ watch(
|
|
|
227
227
|
},
|
|
228
228
|
{ deep: true },
|
|
229
229
|
);
|
|
230
|
-
watch(() => tableRows.value
|
|
230
|
+
watch(() => tableRows.value, updateSelectedRows, { deep: true });
|
|
231
231
|
watch(() => props.rows, synchronizeTableItemsWithProps, { deep: true });
|
|
232
232
|
watch(isHeaderSticky, setHeaderCellWidth);
|
|
233
233
|
watch(isFooterSticky, (newValue) =>
|
|
@@ -326,7 +326,17 @@ function synchronizeTableItemsWithProps() {
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
function updateSelectedRows() {
|
|
329
|
-
|
|
329
|
+
const newSelectedRows = tableRows.value.filter((row) => row.isChecked).map((row) => row.id);
|
|
330
|
+
const isNewRowsSelected = newSelectedRows.every((newRow) => selectedRows.value.includes(newRow));
|
|
331
|
+
const isSelectedSameRows = selectedRows.value.every((selectedRow) =>
|
|
332
|
+
newSelectedRows.includes(selectedRow),
|
|
333
|
+
);
|
|
334
|
+
|
|
335
|
+
if (isNewRowsSelected && isSelectedSameRows) {
|
|
336
|
+
return;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
selectedRows.value = newSelectedRows;
|
|
330
340
|
}
|
|
331
341
|
|
|
332
342
|
function onKeyupEsc(event: KeyboardEvent) {
|