Skip to content

Commit

Permalink
prepare 3.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
forxer committed Jul 11, 2022
1 parent 7296b54 commit 0dc1f67
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 2 deletions.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

3.2.0 (2022-07-11)
------------------

- Add new sweetalert2 predefined view


3.1.0 (2022-02-11)
------------------

Expand Down
2 changes: 1 addition & 1 deletion config/notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
| - 'notifier::pnotify' pnotify (requiert PNotify 3) deprecated
| - 'notifier::pnotify4' pnotify4 (requiert PNotify 4) deprecated
| - 'notifier::pnotify5' pnotify5 (requiert PNotify 5)
| - 'notifier::sweetalert2' sweetalert2 (requiert SweetAlert 2) incomming
| - 'notifier::sweetalert2' sweetalert2 (requiert SweetAlert 2)
| - 'custom-vue' your cutom one
|
*/
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Il y a actuellement les templates de vue fournis par le package :
- ~~pnotify *(requiert PNotify 3)*~~ **deprecated**
- ~~pnotify4 *(requiert PNotify 4)*~~ **deprecated**
- pnotify5 *(requiert PNotify 5)*
- sweetalert2 *(requiert SweetAlert 2)* **incomming**
- sweetalert2 *(requiert SweetAlert 2)*

Selon le template utilisé des installations de dépendances peuvent êtres nécessaires.

Expand Down
77 changes: 77 additions & 0 deletions resources/views/sweetalert2.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<script>
const Toast = Swal.mixin({
toast: true,
position: 'top',
timerProgressBar: true,
width: '35em',
@if ($title)
title: '{!! $title !!}',
@endif
html: '{!! $message !!}',
icon: '{!! $type !!}',
showClass: {
popup: 'animate__animated animate__bounceInDown'
},
hideClass: {
popup: 'animate__animated animate__bounceOut'
},
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
},
buttonsStyling: false,
customClass: {
@switch ($type)
@case ('info')
timerProgressBar: 'bg-info',
confirmButton: 'btn btn-info',
htmlContainer: 'text-info'
@break
@case ('success')
timerProgressBar: 'bg-success',
confirmButton: 'btn btn-success',
htmlContainer: 'text-success'
@break
@case ('warning')
timerProgressBar: 'bg-warning',
confirmButton: 'btn btn-warning',
htmlContainer: 'text-warning'
@break
@case ('error')
timerProgressBar: 'bg-danger',
confirmButton: 'btn btn-danger',
htmlContainer: 'text-danger'
@break
@endswitch
}
})
@switch ($type)
@case ('info')
Toast.fire({
timer: 12000
})
@case ('success')
Toast.fire({
timer: 7500,
showConfirmButton: false
})
@break
@case ('warning')
Toast.fire({
timer: 12000
})
@case ('error')
Toast.fire({
timer: {!! 10000 * $errors->count() !!}
})
@break
@endswitch
</script>

0 comments on commit 0dc1f67

Please sign in to comment.