1 line
21 KiB
JavaScript
1 line
21 KiB
JavaScript
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Sweetalert2=t()}(this,function(){"use strict";var e="swal2-",t=function(t){var n={};for(var o in t)n[t[o]]=e+t[o];return n},n=t(["container","in","iosfix","modal","overlay","fade","show","hide","noanimation","close","title","content","spacer","confirm","cancel","icon","image","input","file","range","select","radio","checkbox","textarea","inputerror","validationerror","progresssteps","activeprogressstep","progresscircle","progressline","loading","styled"]),o=t(["success","warning","info","question","error"]),r={title:"",text:"",html:"",type:null,customClass:"",animation:!0,allowOutsideClick:!0,allowEscapeKey:!0,showConfirmButton:!0,showCancelButton:!1,preConfirm:null,confirmButtonText:"OK",confirmButtonColor:"#3085d6",confirmButtonClass:null,cancelButtonText:"Cancel",cancelButtonColor:"#aaa",cancelButtonClass:null,buttonsStyling:!0,reverseButtons:!1,focusCancel:!1,showCloseButton:!1,showLoaderOnConfirm:!1,imageUrl:null,imageWidth:null,imageHeight:null,imageClass:null,timer:null,width:500,padding:20,background:"#fff",input:null,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputClass:null,inputAttributes:{},inputValidator:null,progressSteps:[],currentProgressStep:null,progressStepsDistance:"40px",onOpen:null,onClose:null},i=('\n <div class="'+n.modal+'" style="display: none" tabIndex="-1">\n <ul class="'+n.progresssteps+'"></ul>\n <div class="'+n.icon+" "+o.error+'">\n <span class="x-mark"><span class="line left"></span><span class="line right"></span></span>\n </div>\n <div class="'+n.icon+" "+o.question+'">?</div>\n <div class="'+n.icon+" "+o.warning+'">!</div>\n <div class="'+n.icon+" "+o.info+'">i</div>\n <div class="'+n.icon+" "+o.success+'">\n <span class="line tip"></span> <span class="line long"></span>\n <div class="placeholder"></div> <div class="fix"></div>\n </div>\n <img class="'+n.image+'">\n <h2 class="'+n.title+'"></h2>\n <div class="'+n.content+'"></div>\n <input class="'+n.input+'">\n <input type="file" class="'+n.file+'">\n <div class="'+n.range+'">\n <output></output>\n <input type="range">\n </div>\n <select class="'+n.select+'"></select>\n <div class="'+n.radio+'"></div>\n <label for="'+n.checkbox+'" class="'+n.checkbox+'">\n <input type="checkbox">\n </label>\n <textarea class="'+n.textarea+'"></textarea>\n <div class="'+n.validationerror+'"></div>\n <hr class="'+n.spacer+'">\n <button type="button" class="'+n.confirm+'">OK</button>\n <button type="button" class="'+n.cancel+'">Cancel</button>\n <span class="'+n.close+'">×</span>\n </div>\n').replace(/(^|\n)\s*/g,""),a=void 0,l=document.getElementsByClassName(n.container);l.length?a=l[0]:(a=document.createElement("div"),a.className=n.container,a.innerHTML=i);var s=function(e,t){e=String(e).replace(/[^0-9a-f]/gi,""),e.length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),t=t||0;for(var n="#",o=0;o<3;o++){var r=parseInt(e.substr(2*o,2),16);r=Math.round(Math.min(Math.max(0,r+r*t),255)).toString(16),n+=("00"+r).substr(r.length)}return n},c={previousWindowKeyDown:null,previousActiveElement:null,previousBodyPadding:null},u=function(){if("undefined"==typeof document)return void console.error("SweetAlert2 requires document to initialize");if(!document.getElementsByClassName(n.container).length){document.body.appendChild(a);var e=p(),t=P(e,n.input),o=P(e,n.file),r=e.querySelector("."+n.range+" input"),i=e.querySelector("."+n.range+" output"),l=P(e,n.select),s=e.querySelector("."+n.checkbox+" input"),c=P(e,n.textarea);return t.oninput=function(){F.resetValidationError()},t.onkeydown=function(e){setTimeout(function(){13===e.keyCode&&(e.stopPropagation(),F.clickConfirm())},0)},o.onchange=function(){F.resetValidationError()},r.oninput=function(){F.resetValidationError(),i.value=r.value},r.onchange=function(){F.resetValidationError(),r.previousSibling.value=r.value},l.onchange=function(){F.resetValidationErr
|