Ei kuvausta
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sweetalert.php 10.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Theme
  6. |--------------------------------------------------------------------------
  7. | The theme to use for SweetAlert2 popups.
  8. | Available themes: dark, minimal, borderless, bootstrap-4, material-ui, wordpress-admin, bulma.
  9. |
  10. */
  11. 'theme' => env('SWEET_ALERT_THEME', 'default'),
  12. /*
  13. |--------------------------------------------------------------------------
  14. | CDN LINK
  15. |--------------------------------------------------------------------------
  16. | By default SweetAlert2 use its local sweetalert.all.js
  17. | file.
  18. | However, you can use its cdn if you want.
  19. |
  20. */
  21. 'cdn' => env('SWEET_ALERT_CDN'),
  22. /*
  23. |--------------------------------------------------------------------------
  24. | Always load the sweetalert.all.js
  25. |--------------------------------------------------------------------------
  26. | There might be situations where you will always want the sweet alert
  27. | js package to be there for you. (for eg. you might use it heavily to
  28. | show notifications or you might want to use the native js) then this
  29. | might be handy.
  30. |
  31. */
  32. 'alwaysLoadJS' => env('SWEET_ALERT_ALWAYS_LOAD_JS', false),
  33. /*
  34. |--------------------------------------------------------------------------
  35. | Never load the sweetalert.all.js
  36. |--------------------------------------------------------------------------
  37. | If you want to handle the sweet alert js package by yourself
  38. | (for eg. you might want to use laravel mix) then this can be
  39. | handy.
  40. | If you set always load js to true & never load js to false,
  41. | it's going to prioritize the never load js.
  42. |
  43. | alwaysLoadJs = true & neverLoadJs = true => js will not be loaded
  44. | alwaysLoadJs = true & neverLoadJs = false => js will be loaded
  45. | alwaysLoadJs = false & neverLoadJs = false => js will be loaded when
  46. | you set alert/toast by using the facade/helper functions.
  47. */
  48. 'neverLoadJS' => env('SWEET_ALERT_NEVER_LOAD_JS', false),
  49. /*
  50. |--------------------------------------------------------------------------
  51. | AutoClose Timer
  52. |--------------------------------------------------------------------------
  53. |
  54. | This is for the all Modal windows.
  55. | For specific modal just use the autoClose() helper method.
  56. |
  57. */
  58. 'timer' => env('SWEET_ALERT_TIMER', 5000),
  59. /*
  60. |--------------------------------------------------------------------------
  61. | Width
  62. |--------------------------------------------------------------------------
  63. |
  64. | Modal window width, including paddings (box-sizing: border-box).
  65. | Can be in px or %.
  66. | The default width is 32rem.
  67. | This is for the all Modal windows.
  68. | for particular modal just use the width() helper method.
  69. */
  70. 'width' => env('SWEET_ALERT_WIDTH', '32rem'),
  71. /*
  72. |--------------------------------------------------------------------------
  73. | Height Auto
  74. |--------------------------------------------------------------------------
  75. | By default, SweetAlert2 sets html's and body's CSS height to auto !important.
  76. | If this behavior isn't compatible with your project's layout,
  77. | set heightAuto to false.
  78. |
  79. */
  80. 'height_auto' => env('SWEET_ALERT_HEIGHT_AUTO', true),
  81. /*
  82. |--------------------------------------------------------------------------
  83. | Padding
  84. |--------------------------------------------------------------------------
  85. |
  86. | Modal window padding.
  87. | Can be in px or %.
  88. | The default padding is 1.25rem.
  89. | This is for the all Modal windows.
  90. | for particular modal just use the padding() helper method.
  91. */
  92. 'padding' => env('SWEET_ALERT_PADDING', '1.25rem'),
  93. /*
  94. |--------------------------------------------------------------------------
  95. | Background
  96. |--------------------------------------------------------------------------
  97. |
  98. | Modal window background
  99. | (CSS background property).
  100. | The default background is '#fff'.
  101. */
  102. 'background' => env('SWEET_ALERT_BACKGROUND', '#fff'),
  103. /*
  104. |--------------------------------------------------------------------------
  105. | Animation
  106. |--------------------------------------------------------------------------
  107. | Custom animation with [Animate.css](https://daneden.github.io/animate.css/)
  108. | If set to false, modal CSS animation will be use default ones.
  109. | For specific modal just use the animation() helper method.
  110. |
  111. */
  112. 'animation' => [
  113. 'enable' => env('SWEET_ALERT_ANIMATION_ENABLE', false),
  114. ],
  115. 'animatecss' => env('SWEET_ALERT_ANIMATECSS', 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css'),
  116. /*
  117. |--------------------------------------------------------------------------
  118. | ShowConfirmButton
  119. |--------------------------------------------------------------------------
  120. | If set to false, a "Confirm"-button will not be shown.
  121. | It can be useful when you're using custom HTML description.
  122. | This is for the all Modal windows.
  123. | For specific modal just use the showConfirmButton() helper method.
  124. |
  125. */
  126. 'show_confirm_button' => env('SWEET_ALERT_CONFIRM_BUTTON', true),
  127. /*
  128. |--------------------------------------------------------------------------
  129. | ShowCloseButton
  130. |--------------------------------------------------------------------------
  131. | If set to true, a "Close"-button will be shown,
  132. | which the user can click on to dismiss the modal.
  133. | This is for the all Modal windows.
  134. | For specific modal just use the showCloseButton() helper method.
  135. |
  136. */
  137. 'show_close_button' => env('SWEET_ALERT_CLOSE_BUTTON', false),
  138. /*
  139. |-----------------------------------------------------------------------
  140. | Confirm/Cancel Button Text
  141. |-----------------------------------------------------------------------
  142. | Change the default text of the modal buttons.
  143. | The texts translations will be handled by Laravel at runtime.
  144. | This is for the all Modal windows.
  145. | For specific modal just use the confirmButtonText() and
  146. | cancelButtonText() helper methods.
  147. */
  148. 'button_text' => [
  149. 'confirm' => env('SWEET_ALERT_CONFIRM_BUTTON_TEXT', 'OK'),
  150. 'cancel' => env('SWEET_ALERT_CANCEL_BUTTON_TEXT', 'Cancel'),
  151. ],
  152. /*
  153. |--------------------------------------------------------------------------
  154. | Toast position
  155. |--------------------------------------------------------------------------
  156. | Modal window or toast position, can be 'top',
  157. | 'top-start', 'top-end', 'center', 'center-start',
  158. | 'center-end', 'bottom', 'bottom-start', or 'bottom-end'.
  159. | For specific modal just use the position() helper method.
  160. |
  161. */
  162. 'toast_position' => env('SWEET_ALERT_TOAST_POSITION', 'top-end'),
  163. /*
  164. |--------------------------------------------------------------------------
  165. | Progress Bar
  166. |--------------------------------------------------------------------------
  167. | If set to true, a progress bar at the bottom of a popup will be shown.
  168. | It can be useful with toasts.
  169. |
  170. */
  171. 'timer_progress_bar' => env('SWEET_ALERT_TIMER_PROGRESS_BAR', false),
  172. /*
  173. |--------------------------------------------------------------------------
  174. | Middleware
  175. |--------------------------------------------------------------------------
  176. | Modal window or toast, config for the Middleware
  177. |
  178. */
  179. 'middleware' => [
  180. 'autoClose' => env('SWEET_ALERT_MIDDLEWARE_AUTO_CLOSE', false),
  181. 'toast_position' => env('SWEET_ALERT_MIDDLEWARE_TOAST_POSITION', 'top-end'),
  182. 'toast_close_button' => env('SWEET_ALERT_MIDDLEWARE_TOAST_CLOSE_BUTTON', true),
  183. 'timer' => env('SWEET_ALERT_MIDDLEWARE_ALERT_CLOSE_TIME', 6000),
  184. 'auto_display_error_messages' => env('SWEET_ALERT_AUTO_DISPLAY_ERROR_MESSAGES', true),
  185. ],
  186. /*
  187. |--------------------------------------------------------------------------
  188. | Custom Class
  189. |--------------------------------------------------------------------------
  190. | A custom CSS class for the modal:
  191. |
  192. */
  193. 'customClass' => [
  194. 'container' => env('SWEET_ALERT_CONTAINER_CLASS'),
  195. 'popup' => env('SWEET_ALERT_POPUP_CLASS'),
  196. 'header' => env('SWEET_ALERT_HEADER_CLASS'),
  197. 'title' => env('SWEET_ALERT_TITLE_CLASS'),
  198. 'closeButton' => env('SWEET_ALERT_CLOSE_BUTTON_CLASS'),
  199. 'icon' => env('SWEET_ALERT_ICON_CLASS'),
  200. 'image' => env('SWEET_ALERT_IMAGE_CLASS'),
  201. 'content' => env('SWEET_ALERT_CONTENT_CLASS'),
  202. 'input' => env('SWEET_ALERT_INPUT_CLASS'),
  203. 'actions' => env('SWEET_ALERT_ACTIONS_CLASS'),
  204. 'confirmButton' => env('SWEET_ALERT_CONFIRM_BUTTON_CLASS'),
  205. 'cancelButton' => env('SWEET_ALERT_CANCEL_BUTTON_CLASS'),
  206. 'footer' => env('SWEET_ALERT_FOOTER_CLASS'),
  207. ],
  208. /*
  209. |--------------------------------------------------------------------------
  210. | confirmDelete
  211. |--------------------------------------------------------------------------
  212. | customize the configuration options of the confirmation popup.
  213. |
  214. */
  215. 'confirm_delete_confirm_button_text' => env('SWEET_ALERT_CONFIRM_DELETE_CONFIRM_BUTTON_TEXT', 'Yes, delete it!'),
  216. 'confirm_delete_confirm_button_color' => env('SWEET_ALERT_CONFIRM_DELETE_CONFIRM_BUTTON_COLOR'),
  217. 'confirm_delete_cancel_button_color' => env('SWEET_ALERT_CONFIRM_DELETE_CANCEL_BUTTON_COLOR', '#d33'),
  218. 'confirm_delete_cancel_button_text' => env('SWEET_ALERT_CONFIRM_DELETE_CANCEL_BUTTON_TEXT', 'Cancel'),
  219. 'confirm_delete_show_cancel_button' => env('SWEET_ALERT_CONFIRM_DELETE_SHOW_CANCEL_BUTTON', true),
  220. 'confirm_delete_show_close_button' => env('SWEET_ALERT_CONFIRM_DELETE_SHOW_CLOSE_BUTTON', false),
  221. 'confirm_delete_icon' => env('SWEET_ALERT_CONFIRM_DELETE_ICON', 'warning'),
  222. 'confirm_delete_show_loader_on_confirm' => env('SWEET_ALERT_CONFIRM_DELETE_SHOW_LOADER_ON_CONFIRM', true),
  223. ];