@makolabs/ripple 0.0.1-dev.82 → 0.0.1-dev.84
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.
|
@@ -261,6 +261,33 @@
|
|
|
261
261
|
async function handleRowClick(file: FileItem) {
|
|
262
262
|
if (file.isFolder) {
|
|
263
263
|
navigateToFolder(file.key);
|
|
264
|
+
} else {
|
|
265
|
+
// Check if this file is allowed to be selected based on actions
|
|
266
|
+
const hasAllowedAction = actions.some((action: FileAction) => {
|
|
267
|
+
// Only check single file actions for individual file selection
|
|
268
|
+
if ('action' in action && typeof action.action === 'function') {
|
|
269
|
+
return action.isAllowed(file);
|
|
270
|
+
}
|
|
271
|
+
return false;
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
// Only allow selection if the file has at least one allowed action
|
|
275
|
+
if (!hasAllowedAction) {
|
|
276
|
+
return; // Exit early if file is not allowed to be selected
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// Toggle selection for files
|
|
280
|
+
const isCurrentlySelected = selectedFiles.includes(file.key);
|
|
281
|
+
|
|
282
|
+
if (isCurrentlySelected) {
|
|
283
|
+
// Remove from selection
|
|
284
|
+
selectedFiles = selectedFiles.filter(key => key !== file.key);
|
|
285
|
+
selected = selected.filter(item => item.key !== file.key);
|
|
286
|
+
} else {
|
|
287
|
+
// Add to selection
|
|
288
|
+
selectedFiles = [...selectedFiles, file.key];
|
|
289
|
+
selected = [...selected, file];
|
|
290
|
+
}
|
|
264
291
|
}
|
|
265
292
|
}
|
|
266
293
|
|