| Current Path : /home/emeraadmin/public_html/4d695/ |
| Current File : /home/emeraadmin/public_html/4d695/sweetalert2.zip |
PK
[�\"�Y�" " 2 src/instanceMethods/show-reset-validation-error.jsnu �[��� import * as dom from '../utils/dom/index.js'
import { swalClasses } from '../utils/classes.js'
import privateProps from '../privateProps.js'
// Show block with validation message
export function showValidationMessage (error) {
const domCache = privateProps.domCache.get(this)
dom.setInnerHtml(domCache.validationMessage, error)
const popupComputedStyle = window.getComputedStyle(domCache.popup)
domCache.validationMessage.style.marginLeft = `-${popupComputedStyle.getPropertyValue('padding-left')}`
domCache.validationMessage.style.marginRight = `-${popupComputedStyle.getPropertyValue('padding-right')}`
dom.show(domCache.validationMessage)
const input = this.getInput()
if (input) {
input.setAttribute('aria-invalid', true)
input.setAttribute('aria-describedBy', swalClasses['validation-message'])
dom.focusInput(input)
dom.addClass(input, swalClasses.inputerror)
}
}
// Hide block with validation message
export function resetValidationMessage () {
const domCache = privateProps.domCache.get(this)
if (domCache.validationMessage) {
dom.hide(domCache.validationMessage)
}
const input = this.getInput()
if (input) {
input.removeAttribute('aria-invalid')
input.removeAttribute('aria-describedBy')
dom.removeClass(input, swalClasses.inputerror)
}
}
PK
[�\Np� � src/instanceMethods/_destroy.jsnu �[��� import globalState from '../globalState.js'
import privateProps from '../privateProps.js'
import privateMethods from '../privateMethods.js'
export function _destroy () {
const domCache = privateProps.domCache.get(this)
const innerParams = privateProps.innerParams.get(this)
if (!innerParams) {
return // This instance has already been destroyed
}
// Check if there is another Swal closing
if (domCache.popup && globalState.swalCloseEventFinishedCallback) {
globalState.swalCloseEventFinishedCallback()
delete globalState.swalCloseEventFinishedCallback
}
// Check if there is a swal disposal defer timer
if (globalState.deferDisposalTimer) {
clearTimeout(globalState.deferDisposalTimer)
delete globalState.deferDisposalTimer
}
runDidDestroy(innerParams)
disposeSwal(this)
}
const runDidDestroy = (innerParams) => {
if (typeof innerParams.didDestroy === 'function') {
innerParams.didDestroy()
} else if (typeof innerParams.onDestroy === 'function') {
innerParams.onDestroy() // @deprecated
}
}
const disposeSwal = (instance) => {
// Unset this.params so GC will dispose it (#1569)
delete instance.params
// Unset globalState props so GC will dispose globalState (#1569)
delete globalState.keydownHandler
delete globalState.keydownTarget
// Unset WeakMaps so GC will be able to dispose them (#1569)
unsetWeakMaps(privateProps)
unsetWeakMaps(privateMethods)
}
const unsetWeakMaps = (obj) => {
for (const i in obj) {
obj[i] = new WeakMap()
}
}
PK
[�\P�/�� � * src/instanceMethods/popup-click-handler.jsnu �[��� import { callIfFunction } from '../utils/utils.js'
import { DismissReason } from '../utils/DismissReason.js'
import privateProps from '../privateProps.js'
export const handlePopupClick = (instance, domCache, dismissWith) => {
const innerParams = privateProps.innerParams.get(instance)
if (innerParams.toast) {
handleToastClick(instance, domCache, dismissWith)
} else {
// Ignore click events that had mousedown on the popup but mouseup on the container
// This can happen when the user drags a slider
handleModalMousedown(domCache)
// Ignore click events that had mousedown on the container but mouseup on the popup
handleContainerMousedown(domCache)
handleModalClick(instance, domCache, dismissWith)
}
}
const handleToastClick = (instance, domCache, dismissWith) => {
// Closing toast by internal click
domCache.popup.onclick = () => {
const innerParams = privateProps.innerParams.get(instance)
if (
innerParams.showConfirmButton ||
innerParams.showDenyButton ||
innerParams.showCancelButton ||
innerParams.showCloseButton ||
innerParams.input
) {
return
}
dismissWith(DismissReason.close)
}
}
let ignoreOutsideClick = false
const handleModalMousedown = (domCache) => {
domCache.popup.onmousedown = () => {
domCache.container.onmouseup = function (e) {
domCache.container.onmouseup = undefined
// We only check if the mouseup target is the container because usually it doesn't
// have any other direct children aside of the popup
if (e.target === domCache.container) {
ignoreOutsideClick = true
}
}
}
}
const handleContainerMousedown = (domCache) => {
domCache.container.onmousedown = () => {
domCache.popup.onmouseup = function (e) {
domCache.popup.onmouseup = undefined
// We also need to check if the mouseup target is a child of the popup
if (e.target === domCache.popup || domCache.popup.contains(e.target)) {
ignoreOutsideClick = true
}
}
}
}
const handleModalClick = (instance, domCache, dismissWith) => {
domCache.container.onclick = (e) => {
const innerParams = privateProps.innerParams.get(instance)
if (ignoreOutsideClick) {
ignoreOutsideClick = false
return
}
if (e.target === domCache.container && callIfFunction(innerParams.allowOutsideClick)) {
dismissWith(DismissReason.backdrop)
}
}
}
PK
[�\��p�� � &