sweetalert2 11.1.7 → 11.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/README.md +22 -223
- package/dist/sweetalert2.all.js +129 -45
- package/dist/sweetalert2.all.min.js +2 -2
- package/dist/sweetalert2.css +84 -0
- package/dist/sweetalert2.js +128 -44
- package/dist/sweetalert2.min.css +1 -1
- package/dist/sweetalert2.min.js +1 -1
- package/package.json +16 -15
- package/src/SweetAlert.js +1 -1
- package/src/instanceMethods/_destroy.js +15 -6
- package/src/instanceMethods/_main.js +2 -1
- package/src/instanceMethods/buttons-handlers.js +8 -2
- package/src/instanceMethods/close.js +47 -9
- package/src/privateMethods.js +3 -2
- package/src/privateProps.js +2 -1
- package/src/scss/_animations.scss +39 -0
- package/src/scss/_core.scss +33 -0
- package/src/utils/dom/renderers/renderActions.js +21 -10
|
@@ -5,9 +5,6 @@ import { capitalizeFirstLetter } from '../../utils.js'
|
|
|
5
5
|
export const renderActions = (instance, params) => {
|
|
6
6
|
const actions = dom.getActions()
|
|
7
7
|
const loader = dom.getLoader()
|
|
8
|
-
const confirmButton = dom.getConfirmButton()
|
|
9
|
-
const denyButton = dom.getDenyButton()
|
|
10
|
-
const cancelButton = dom.getCancelButton()
|
|
11
8
|
|
|
12
9
|
// Actions (buttons) wrapper
|
|
13
10
|
if (!params.showConfirmButton && !params.showDenyButton && !params.showCancelButton) {
|
|
@@ -19,6 +16,19 @@ export const renderActions = (instance, params) => {
|
|
|
19
16
|
// Custom class
|
|
20
17
|
dom.applyCustomClass(actions, params, 'actions')
|
|
21
18
|
|
|
19
|
+
// Render all the buttons
|
|
20
|
+
renderButtons(actions, loader, params)
|
|
21
|
+
|
|
22
|
+
// Loader
|
|
23
|
+
dom.setInnerHtml(loader, params.loaderHtml)
|
|
24
|
+
dom.applyCustomClass(loader, params, 'loader')
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function renderButtons (actions, loader, params) {
|
|
28
|
+
const confirmButton = dom.getConfirmButton()
|
|
29
|
+
const denyButton = dom.getDenyButton()
|
|
30
|
+
const cancelButton = dom.getCancelButton()
|
|
31
|
+
|
|
22
32
|
// Render buttons
|
|
23
33
|
renderButton(confirmButton, 'confirm', params)
|
|
24
34
|
renderButton(denyButton, 'deny', params)
|
|
@@ -26,14 +36,15 @@ export const renderActions = (instance, params) => {
|
|
|
26
36
|
handleButtonsStyling(confirmButton, denyButton, cancelButton, params)
|
|
27
37
|
|
|
28
38
|
if (params.reverseButtons) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
39
|
+
if (params.toast) {
|
|
40
|
+
actions.insertBefore(cancelButton, confirmButton)
|
|
41
|
+
actions.insertBefore(denyButton, confirmButton)
|
|
42
|
+
} else {
|
|
43
|
+
actions.insertBefore(cancelButton, loader)
|
|
44
|
+
actions.insertBefore(denyButton, loader)
|
|
45
|
+
actions.insertBefore(confirmButton, loader)
|
|
46
|
+
}
|
|
32
47
|
}
|
|
33
|
-
|
|
34
|
-
// Loader
|
|
35
|
-
dom.setInnerHtml(loader, params.loaderHtml)
|
|
36
|
-
dom.applyCustomClass(loader, params, 'loader')
|
|
37
48
|
}
|
|
38
49
|
|
|
39
50
|
function handleButtonsStyling (confirmButton, denyButton, cancelButton, params) {
|