feature: form edit

This commit is contained in:
antv
2026-07-10 08:16:20 +07:00
parent 326e1f1028
commit a1ad7e738b
14 changed files with 509 additions and 165 deletions
+37
View File
@@ -142,7 +142,44 @@
overlay.addEventListener('click', closeSidebar);
}
});
window.showToast = function(message) {
const toast = document.getElementById('global-toast');
if (!toast) return;
const msgEl = toast.querySelector('.text-sm');
if (msgEl) msgEl.textContent = message;
toast.classList.remove('hidden');
toast.classList.add('flex');
requestAnimationFrame(() => {
toast.classList.remove('opacity-0', 'translate-y-[-10px]');
toast.classList.add('opacity-100', 'translate-y-0');
});
if (toast.dataset.timeoutId) {
clearTimeout(toast.dataset.timeoutId);
}
toast.dataset.timeoutId = setTimeout(() => {
window.closeToast('global-toast');
}, 3000);
};
window.closeToast = function(id) {
const toast = document.getElementById(id);
if (!toast) return;
toast.classList.remove('opacity-100', 'translate-y-0');
toast.classList.add('opacity-0', 'translate-y-[-10px]');
setTimeout(() => {
toast.classList.add('hidden');
toast.classList.remove('flex');
}, 300);
};
</script>
<x-toast id="global-toast" type="success" message="" />
@stack('scripts')
</body>
</html>