ldc-boutique-cnc/resources/ts/bootstrap.ts
2023-02-23 17:09:10 +01:00

43 lines
1.2 KiB
TypeScript

import Swal from "sweetalert2";
import Popper from "popper.js";
import * as bootstrap from "bootstrap";
import axios from "axios";
/**
* We'll load the axios HTTP library which allows us to easily issue requests
* to our Laravel back-end. This library automatically handles sending the
* CSRF token as a header based on the value of the "XSRF" token cookie.
*/
axios.defaults.headers.common = {
Accept: "application/json, text/plain, */*",
"X-Requested-With": "XMLHttpRequest",
"X-CSRF-TOKEN": document
.querySelector("meta[name=\"csrf-token\"]")!
.getAttribute("content"),
};
window.axios = axios;
Swal.mixin({
customClass: {
confirmButton: "btn btn-lg btn-success ms-3 me-3",
cancelButton: "btn btn-lg btn-danger ms-3 me-3",
},
});
window.Swal = Swal;
window.bootstrap = bootstrap;
window.Popper = Popper;
// enable bs tooltips
[].slice
.call(document.querySelectorAll("[data-bs-toggle=\"tooltip\"]"))
.map(function (tooltipTriggerEl) {
return new bootstrap.Tooltip(tooltipTriggerEl, {
customClass: "large-tooltip",
delay: {
show: 250,
hide: 0,
},
});
});