script> document.addEventListener("DOMContentLoaded", () => { const wrappers = document.querySelectorAll(".library_list-wrapper"); function applyLayout(wrapper) { const items = Array.from(wrapper.children).filter(el => el.nodeType === 1 && getComputedStyle(el).display !== "none"); const count = items.length; // Reset avant d'appliquer wrapper.style.display = "grid"; items.forEach(el => { el.style.maxWidth = ""; el.style.width = "100%"; }); if (count === 1) { // 1 item → max 1/3 wrapper.style.gridTemplateColumns = "1fr"; items[0].style.maxWidth = "33.333%"; } else if (count === 2) { // 2 items → chacun max 1/3, centrés → total 2/3 wrapper.style.gridTemplateColumns = "repeat(2, 1fr)"; items.forEach(el => el.style.maxWidth = "33.333%"); } else { // 3 ou + → 3 colonnes normales wrapper.style.gridTemplateColumns = "repeat(3, 1fr)"; } } wrappers.forEach(applyLayout); // Observer pour s'adapter si des items sont filtrés/masqués const mo = new MutationObserver(() => { wrappers.forEach(applyLayout); }); wrappers.forEach(w => mo.observe(w, { childList: true, subtree: true, attributes: true, attributeFilter: ["style", "class"] })); }); /script>

Templates Library

Discover how Phacet adapts to your team’s challenges with concrete, automated, and intelligent workflows.

Finance & Accounting

Procurement & Treasury

Admin & Legal

Business Leaders & Operations