Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/inventory.picotech.app/public_html/node_modules/sweetalert2/src/utils/ drwxr-xr-x | |
| Viewing file: Select action/file-type: import { warn, warnAboutDepreation } from '../utils/utils.js'
export const defaultParams = {
title: '',
titleText: '',
text: '',
html: '',
footer: '',
icon: undefined,
iconHtml: undefined,
toast: false,
animation: true,
showClass: {
popup: 'swal2-show',
backdrop: 'swal2-backdrop-show',
icon: 'swal2-icon-show',
},
hideClass: {
popup: 'swal2-hide',
backdrop: 'swal2-backdrop-hide',
icon: 'swal2-icon-hide',
},
customClass: undefined,
target: 'body',
backdrop: true,
heightAuto: true,
allowOutsideClick: true,
allowEscapeKey: true,
allowEnterKey: true,
stopKeydownPropagation: true,
keydownListenerCapture: false,
showConfirmButton: true,
showCancelButton: false,
preConfirm: undefined,
confirmButtonText: 'OK',
confirmButtonAriaLabel: '',
confirmButtonColor: undefined,
cancelButtonText: 'Cancel',
cancelButtonAriaLabel: '',
cancelButtonColor: undefined,
buttonsStyling: true,
reverseButtons: false,
focusConfirm: true,
focusCancel: false,
showCloseButton: false,
closeButtonHtml: '×',
closeButtonAriaLabel: 'Close this dialog',
showLoaderOnConfirm: false,
imageUrl: undefined,
imageWidth: undefined,
imageHeight: undefined,
imageAlt: '',
timer: undefined,
timerProgressBar: false,
width: undefined,
padding: undefined,
background: undefined,
input: undefined,
inputPlaceholder: '',
inputValue: '',
inputOptions: {},
inputAutoTrim: true,
inputAttributes: {},
inputValidator: undefined,
validationMessage: undefined,
grow: false,
position: 'center',
progressSteps: [],
currentProgressStep: undefined,
progressStepsDistance: undefined,
onBeforeOpen: undefined,
onOpen: undefined,
onRender: undefined,
onClose: undefined,
onAfterClose: undefined,
onDestroy: undefined,
scrollbarPadding: true
}
export const updatableParams = [
'allowEscapeKey',
'allowOutsideClick',
'buttonsStyling',
'cancelButtonAriaLabel',
'cancelButtonColor',
'cancelButtonText',
'closeButtonAriaLabel',
'closeButtonHtml',
'confirmButtonAriaLabel',
'confirmButtonColor',
'confirmButtonText',
'currentProgressStep',
'customClass',
'footer',
'hideClass',
'html',
'icon',
'imageAlt',
'imageHeight',
'imageUrl',
'imageWidth',
'onAfterClose',
'onClose',
'onDestroy',
'progressSteps',
'reverseButtons',
'showCancelButton',
'showCloseButton',
'showConfirmButton',
'text',
'title',
'titleText',
]
export const deprecatedParams = {
animation: 'showClass" and "hideClass',
}
const toastIncompatibleParams = [
'allowOutsideClick',
'allowEnterKey',
'backdrop',
'focusConfirm',
'focusCancel',
'heightAuto',
'keydownListenerCapture'
]
/**
* Is valid parameter
* @param {String} paramName
*/
export const isValidParameter = (paramName) => {
return Object.prototype.hasOwnProperty.call(defaultParams, paramName)
}
/**
* Is valid parameter for Swal.update() method
* @param {String} paramName
*/
export const isUpdatableParameter = (paramName) => {
return updatableParams.indexOf(paramName) !== -1
}
/**
* Is deprecated parameter
* @param {String} paramName
*/
export const isDeprecatedParameter = (paramName) => {
return deprecatedParams[paramName]
}
const checkIfParamIsValid = (param) => {
if (!isValidParameter(param)) {
warn(`Unknown parameter "${param}"`)
}
}
const checkIfToastParamIsValid = (param) => {
if (toastIncompatibleParams.includes(param)) {
warn(`The parameter "${param}" is incompatible with toasts`)
}
}
const checkIfParamIsDeprecated = (param) => {
if (isDeprecatedParameter(param)) {
warnAboutDepreation(param, isDeprecatedParameter(param))
}
}
/**
* Show relevant warnings for given params
*
* @param params
*/
export const showWarningsForParams = (params) => {
for (const param in params) {
checkIfParamIsValid(param)
if (params.toast) {
checkIfToastParamIsValid(param)
}
checkIfParamIsDeprecated(param)
}
}
export default defaultParams
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0053 ]-- |