Replies: 4 comments 1 reply
-
Hey @ale1981, Currently, it is not in our plan but please help us by giving some info on Sweet Alert 2, a brief comparison would help us to consider it! Thanks, Ale |
Beta Was this translation helpful? Give feedback.
-
I believe the current package is no longer actively developed? SweetAlert2 allows you to create custom modals beyond basic alerts. For instance, you can create a modal with a progress indicator:
SweetAlert2 enables you to create input modals with validation, allowing users to input data and validate it before proceeding:
You can create a sequence of modals using SweetAlert2, where one modal follows another:
|
Beta Was this translation helpful? Give feedback.
-
Hey @ale1981 Thanks for the all info, I appreciate your efforts. Hey @tabacitu please consider the above. Thanks |
Beta Was this translation helpful? Give feedback.
-
Hey @ale1981 I was exploring the possibility to add that package, but it seems they are listed in the synk vunerability and gihub advisory pages because they have some kind of overwritten behavior for some domains like I am concerned by pushing a change like this to all our customers. I can see me using it in my projects, that I know for sure are not hosted on You can use it in your project by overwriting the The initialization and some configurations keys are different, so you have to either: I think b) is the easiest and with less overwrites so let me brief you a little on how to do it: Remove previous sweetalert from line 4 in the previous mentioned file, and add the following at the @push('after_scripts')
@basset(base_path('vendor/backpack/crud/src/resources/assets/js/common.js'))
@basset('https://cdn.jsdelivr.net/npm/[email protected]/dist/sweetalert2.all.min.js')
@bassetBlock('sweetalert-to-sweetalert2')
<script>
function swal(options = {}) {
return Swal.fire(options);
}
</script>
@endBassetBlock
@endpush As you see, this only transforms the backpack function swal(options = {}) {
if(options.buttons) {
// check what buttons are inside the array
// use the appropriate sw2 functions for those buttons. for example if backpack `buttons` contains the `Cancel` button, you need to set:
option.buttons.forEach(function(button) {
if (button === 'Cancel') {
options.showCancelButton = true;
options.showCancelButtonText = button;
}
})
return Swal.fire(options);
} Hope that helps. Cheers |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Are there any plans to update to the Sweet Alert 2 https://sweetalert2.github.io/ package or let users choose which to use?
Beta Was this translation helpful? Give feedback.
All reactions