mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
64 lines
1.5 KiB
JavaScript
64 lines
1.5 KiB
JavaScript
|
|
|
|
|
|
export const alertConfirmationDelete = (title, type = "primary") => {
|
|
return Swal.fire({
|
|
title: '¿Está seguro?',
|
|
text: "Esta acción es irreversible.",
|
|
icon: 'warning',
|
|
showCancelButton: true,
|
|
confirmButtonColor: '#3085d6',
|
|
cancelButtonColor: '#d33',
|
|
confirmButtonText: 'Sí',
|
|
cancelButtonText: 'Cancelar',
|
|
customClass: {
|
|
confirmButton: 'btn btn-danger me-1',
|
|
cancelButton: 'btn btn-label-secondary'
|
|
},
|
|
buttonsStyling: false
|
|
})
|
|
}
|
|
|
|
export const alertSuccessMessage = (title, type = "primary") => {
|
|
return Swal.fire({
|
|
showCancelButton: false,
|
|
showConfirmButton: false,
|
|
title: title,
|
|
text: title,
|
|
icon: "success",
|
|
timer: 2000
|
|
})
|
|
}
|
|
|
|
export const alertWarningMessage = (title, message, type = "primary") => {
|
|
return Swal.fire({
|
|
title: title,
|
|
text: message,
|
|
icon: "warning",
|
|
customClass: {
|
|
confirmButton: 'btn btn-primary'
|
|
},
|
|
buttonsStyling: false
|
|
})
|
|
}
|
|
|
|
export const toastPresupuestoSummary = (value, target = 'body') => {
|
|
return Swal.mixin({
|
|
toast: true,
|
|
position: 'bottom-end',
|
|
html: `
|
|
<div class="d-flex flex-column">
|
|
<p class="fs-big">Total presupuesto</p>
|
|
<span class="badge badge-label-primary fs-large">${value}</span>
|
|
</div>`,
|
|
customClass: {
|
|
popup: 'bg-primary text-white',
|
|
},
|
|
target: target,
|
|
allowEscapeKey: false,
|
|
showConfirmButton: false,
|
|
timer: 0,
|
|
timerProgressBar: false,
|
|
stopKeydownPropagation: false,
|
|
})
|
|
} |