panels-origin/web-panel/composables/useTableSearch.ts
2026-08-21 16:55:01 -05:00

11 lines
294 B
TypeScript

export function useTableSearch() {
const tableQ = ref("");
function matches(...parts: unknown[]) {
const q = tableQ.value.trim().toLowerCase();
if (!q) return true;
return parts.some((part) => String(part ?? "").toLowerCase().includes(q));
}
return { tableQ, matches };
}