[#7759] added shift+click bulk selection

This commit is contained in:
Gani Georgiev committed 2026-07-18 10:17:38 +03:00
1 parent 09af56b342
commit 7964a8ce43
11 files changed
+113 -29

No files matched your search

+27 -14
View File
@@ -78,18 +78,6 @@ export function pageExportCollections(route) {
}
}
function toggleSelectCollection(collection) {
const bulkSelected = JSON.parse(JSON.stringify(data.bulkSelected));
if (!data.bulkSelected[collection.id]) {
bulkSelected[collection.id] = collection;
} else {
delete bulkSelected[collection.id];
}
// reassign to trigger the getter's Object.keys
data.bulkSelected = bulkSelected;
}
return t.div(
{
pbEvent: "pageExportCollections",
@@ -150,8 +138,33 @@ export function pageExportCollections(route) {
id: checkboxId,
type: "checkbox",
checked: () => !!data.bulkSelected[collection.id],
onchange: () => {
toggleSelectCollection(collection);
onclick: (e) => {
e.target.__shiftKey = e.shiftKey;
},
onchange: (e) => {
let bulkSelected = Object.assign({}, data.bulkSelected);
// range select
if (e.target.__shiftKey) {
e.target.__shiftKey = false;
app.utils.bulkSelectRange(
data.collections,
bulkSelected,
collection,
e.target.checked,
);
}
// toggle current collection
if (e.target.checked) {
bulkSelected[collection.id] = collection;
} else {
delete bulkSelected[collection.id];
}
// reassign to trigger the getter's Object.keys
data.bulkSelected = bulkSelected;
},
}),
t.label({ htmlFor: checkboxId }, collection.name),