UNPKG

co-dialog

Version:

这是一个简洁,智能,个性化的JAVASCRIPT弹出框

1 lines 29.3 kB
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(t="undefined"!=typeof globalThis?globalThis:t||self).Coog=o()}(this,function(){"use strict";function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}function n(t,o){for(var e=0;e<o.length;e++){var n=o[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function t(t,o,e){return o&&n(t.prototype,o),e&&n(t,e),t}function f(){return(f=Object.assign||function(t){for(var o=1;o<arguments.length;o++){var e,n=arguments[o];for(e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e])}return t}).apply(this,arguments)}function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t,o){return(c=Object.setPrototypeOf||function(t,o){return t.__proto__=o,t})(t,o)}function l(t,o){if(o&&("object"==typeof o||"function"==typeof o))return o;if(void 0!==o)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function o(e){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var t,o=r(e);return l(this,n?(t=r(this).constructor,Reflect.construct(o,arguments,t)):o.apply(this,arguments))}}function s(t,o){(null==o||o>t.length)&&(o=t.length);for(var e=0,n=new Array(o);e<o;e++)n[e]=t[e];return n}function u(t,o){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t,o){if(t){if("string"==typeof t)return s(t,o);var e=Object.prototype.toString.call(t).slice(8,-1);return"Map"===(e="Object"===e&&t.constructor?t.constructor.name:e)||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?s(t,o):void 0}}(t))||o&&t&&"number"==typeof t.length){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,r=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return a=t.done,t},e:function(t){r=!0,i=t},f:function(){try{a||null==e.return||e.return()}finally{if(r)throw i}}}}function e(t){return void 0===t}function m(t){return h(t)&&"[object Object]"==Object.prototype.toString.call(t)}function d(t){return h(t)&&t instanceof Array}function g(t,o){return!!(x(t)&&t.search(o)+1)}function p(t,o){for(var e in o)if(h(t.style[e]))return o[e]}var h=function(t){return!e(t)},b=function(t){return h(t)&&"function"==typeof t},y=function(t){return h(t)&&"[object Null]"==Object.prototype.toString.call(t)},x=function(t){return h(t)&&"string"==typeof t},v=function(t){return h(t)&&"boolean"==typeof t},w=function(t){return h(t)&&"number"==typeof t},k=function(t){return v(t)&&t},B=function(t){return v(t)&&!t},O=function(t){return g(t," ")?t.replace(/(\s*)/g,""):t},A=function(t,o,e){if(h(t))if(b(t.forEach))t.forEach(o,e||{});else for(var n=0;n<t.length;n++)b(o)?o.call(e||null,t[n],n):nul},C=function(t){return Array.isArray?Array.isArray(t):!!d(t)},E=Object.freeze({__proto__:null,isUndefined:e,isExist:h,isNan:function(t){return isNaN(t)},isFun:b,isObj:m,isNull:y,isArr:d,isStr:x,isBoolean:v,isNum:w,isTrue:k,isFalse:B,isEmptyObj:function(t){for(var o in t)return!1;return!0},search:g,trim:O,forEach:A,clone:function(t){if(t instanceof Object)return h(JSON)?JSON.parse(JSON.stringify(t)):t},objectKey:function(t){if(!t)return null;if(Object.keys)return Object.keys(t);var o,e=[];for(o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.push(o);return e},inArray:function(t,o){if(x(t)||w(o)){for(var e=0,n=o.length;e<n;e++)if(o[e]==t)return 1;return!1}return!1},isArray:C}),T=["onHeader","onBody","onFooter"],S=function(t){return h(t)?null:t.parentElement.removeChild?t.parentElement.removeChild(t):t.parentElement.removeNode(t)},I=function(t){if(t.preventDefault)t.preventDefault();else{if(!t.stopPropagation)return!1;t.stopPropagation()}},j=function(t,o,e){t.addEventListener?t.addEventListener(o,e,!1):t.attachEvent&&t.attachEvent("on".concat(o),e)},L=function(t,o,e){t.removeEventListener?t.removeEventListener(o,e,!1):t.detachEvent("on".concat(o),e)},z={_class:function(t,o){t.classList?t.setAttribute("class",o):t.className=o},_id:function(t,o){t.setAttribute("id",o)}};function D(t,o){var e,n=u(t);try{for(n.s();!(e=n.n()).done;){var i=e.value;i.classList?i.setAttribute("class",o(i.classList.value)):items.className&&i.setAttribute("class",o(i.className.value))}}catch(t){n.e(t)}finally{n.f()}}var R={title:"",message:"",footerText:"",layout:"center",timeout:0,isGesture:!0,isDrag:!1,isClose:!0,onResize:!0,type:"",isMask:!0,animation:!0,customAnimation:"bounceIn",titleColor:"#9A9B9C",closeColor:"#9A9B9C",messageColor:"#696969",showCloseButton:!0,showCancleButton:!1,showConfirmButton:!0,cancleButtonText:"取消",confirmButtonText:"确定",cancleButtonColor:"#fff",confirmButtonColor:"#fff",cancleButtonBackground:"#aaa",confirmButtonBackground:"#51BF8C",methods:function(){},onDialogBefore:function(){},onHeaderBefore:function(){},onBodyBefore:function(){},onFooterBefore:function(){},onDialogAfter:function(){},onHeaderAfter:function(){},onBodyAfter:function(){},onFooterAfter:function(){},confirmCallback:function(){},cancleCallback:function(){}},H=["bounce","flash","pulse","rubberBand","shake","headShake","bounceOutLeft","swing","tada","wobble","jello","bounceIn","bounceInDown","fadeInDownBig","bounceInLeft","bounceInRight","bounceInUp","bounceOut","bounceOutDown","bounceOutRight","bounceOutUp","fadeIn","fadeInDown","rotateInUpLeft","fadeInLeftBig","fadeInRight","fadeInRightBig","fadeInUp","fadeInUpBig","fadeOutDown","fadeOutDownBig","fadeOutLeft","fadeOutLeftBig","fadeOutRight","fadeOutUp","fadeOutUpBig","flipInX","flipInY","flipOutX","flipOutY","fadeInLeft","lightSpeedIn","lightSpeedOut","rotateIn","rotateInDownLeft","rotateInDownRight","rotateInUpRight","rotateOut","rotateOutDownLeft","rotateOutDownRight","zoomOutLeft","hinge","jackInTheBox","rollIn","rollOut","zoomIn","zoomInDown","rotateOutUpRight","zoomInLeft","zoomInRight","zoomInUp","zoomOut","zoomOutDown","rotateOutUpLeft","zoomOutRight","zoomOutUp","slideInDown","slideInLeft","slideInRight","slideInUp","slideOutDown","slideOutLeft","slideOutRight","fadeOutRightBig","fadeOut","slideOutUp"],N={excuteAnimation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"animationstart",WebkitAnimation:"webkitAnimationStart",MSAnimation:"MSAnimationStart"},_={excuteAnimation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd",MSAnimation:"MSAnimationEnd"},M={},U=function(){function e(t){a(this,e),this.animationElement=[],this.animationName="bounceOut"}return t(e,[{key:"animate",value:function(t){this.animationElement=[t];var o=this;return H.map(function(t){e.prototype[t]=o.callAnimationApi}),this}},{key:"callAnimationApi",value:function(t,o){return this.animationName=t,"start"===(M=o).type&&b(M.callback)&&M.callback(),this}},{key:"excuteAnimation",value:function(o){var e=this,n=document.querySelector(this.animationElement[0]),i=p(n,_),a=p(n,N);"end"==o.type.toLowerCase()&&D([n],function(t){return"".concat(t," ").concat(e.animationName," animatedHalf")}),"start"==o.type.toLowerCase()&&D([n],function(t){return"".concat(t," ").concat(e.animationName," animated")});var r=function(){return L(n,a,t)},t=function t(){"end"===o.type.toLowerCase()&&(o.callback(e.animationName),D([n],function(t){return t.replace(new RegExp(" ".concat(e.animationName," animatedHalf"),"gm"),"")}),"function"==typeof e.waitConfirmCallback&&e.waitConfirmCallback()),"start"===o.type.toLowerCase()&&D([n],function(t){return t.replace(new RegExp(" ".concat(e.animationName," animated"),"gm"),"")}),L(n,i,t),L(n,a,r)};j(n,i,t),j(n,a,r)}},{key:"render",value:function(){this.excuteAnimation(M)}}]),e}(),$=["header","body","footer"];function F(t,o,e,n,i){(t.onDialogBefore||t.onHeaderBefore||t.onBodyBefore||t.onFooterBefore)&&(b(t.onDialogBefore)&&t.onDialogBefore.call(o,o),b(t.onHeaderBefore)&&t.onHeaderBefore.call(e,e),b(t.onBodyBefore)&&t.onBodyBefore.call(n,n),b(t.onFooterBefore)&&t.onFooterBefore.call(i,i))}function P(t,o){w(o.timeout)&&0<Number(o.timeout)&&t.hide({timeout:o.timeout})}function q(t,o,e){B(o.isMask)&&t.find(e,"[mask]")&&(t.find(e,"[mask]").style.backgroundColor="transparent")}function G(e,t,n){var i,a,r,c;k(t.isDrag)&&(i=!0,a={},r={},c={},k(t.isGesture)?n.style.cursor="move":n.style.cursor="unset",j(n,"mousedown",function(t){a={x:n.offsetLeft-document.body.scrollLeft,y:n.offsetTop-document.body.scrollTop},r={x:t.screenX,y:t.screenY},i=!0;function o(t){i&&(c={x:t.screenX,y:t.screenY},a.x+=c.x-r.x,a.y+=c.y-r.y,r=c,n.style.left="".concat(a.x,"px"),n.style.top="".concat(a.y,"px"))}j(e.$(document),"mousemove",o),j(e.$(document),"mouseup",function(t){L(n.ownerDocument,"mouseover",o),i=!1,I(t)}),I(t)}))}function W(t,o,e){e=t.find(e,"[textGroup]"),x(o.footerText)&&e?e.innerHTML=o.footerText:C(o.footerText)&&e?0<o.footerText.length&&(e.innerHTML=o.footerText.concat().join("")):e&&S(e)}function X(t,o,e,n,i){var a;(a=t.find(e,"[title]"))&&a&&(a.innerHTML=o.title,a.style.color=o.titleColor),(a=t.find(n,"[message]"))&&a&&(a.innerHTML=t.message||o.message,a.style.color=o.messageColor),(a=t.find(i,"[confirm]"))&&a&&(a.textContent=o.confirmButtonText,a.style.color=o.confirmButtonColor,"#51BF8C"==o.confirmButtonBackground||(a.style.backgroundColor=o.confirmButtonBackground)),(a=t.find(i,"[cancle]"))&&a&&(a.textContent=o.cancleButtonText,a.style.color=o.cancleButtonColor,"#aaa"==o.cancleButtonBackground||(a.style.backgroundColor=o.cancleButtonBackground)),(a=t.find(e,"[close]"))&&a&&(a.style.color=o.closeColor)}function Y(o,t,e){var n,i;x(t.type)&&(n=["success","error","warning","info","question"],i=t.type.replace(/\s*/gi,"").toLowerCase(),-1!=n.indexOf(i)&&n.map(function(t){o.find(e,".codialog-icon-".concat(t)).style.display=i===t?"flex":"none"}))}function J(e,t,n,i){b(t.methods)&&(A(T,function(t,o){e[n[o]]=e[t]({children:e.find(i,"[".concat(n[o],"]"))})}),t.methods.call(e,i))}function V(n,i,t,o){var e;k(i.isClose)&&(n.$(n.dialogElement),e=[],t=n.find(t,"[close]"),y(t)||e.push(t),t=n.find(o,"[cancle]"),y(o),h(t)&&e.push(t),t=n.find(o,"[confirm]"),y(o),y(t)||e.push(t),0<e.length&&A(e,function(t,o){var e=t;e.onclick=function(t){n.setTimer&&clearTimeout(n.setTimer),x(e.getAttribute("confirm"))&&b(i.confirmCallback)?n.waitConfirmCallback=i.confirmCallback:x(e.getAttribute("cancle"))&&b(i.cancleCallback)&&(n.waitCancleCallback=i.cancleCallback),n.hide(),n.closeBackValue=!0}}))}function K(t,o,e,n){var i,a,r;B(o.showCloseButton)&&(i=t.find(e,"[close]"))&&h(i)&&(i.style.display="none"),k(o.showCancleButton)&&(a=t.find(n,"[cancle]"))&&h(a)&&(a.style.display="inline-block"),B(o.showConfirmButton)&&(r=t.find(n,"[confirm]"))&&h(r)&&(r.style.display="none")}function Z(t,o,e,n,i){(t.onDialogAfter||t.onHeaderAfter||t.onBodyAfter||t.onFooterAfter)&&(b(t.onDialogAfter)&&t.onDialogAfter.call(o,o),b(t.onHeaderAfter)&&t.onHeaderAfter.call(e,e),b(t.onBodyAfter)&&t.onBodyAfter.call(n,n),b(t.onFooterAfter)&&t.onFooterAfter.call(i,i))}function Q(u,d,f){function t(){var t=(document.documentElement||document.body).clientWidth,o=(document.documentElement||document.body).clientHeight,e=!1;"block"!=f.style.display&&(f.style.zIndex="-9999",f.style.display="block",e=!0);var n=d.offsetWidth,i=d.offsetHeight,e=e&&!(f.style.display="none");f.style.zIndex="9999";var a=t/2,r=o/2,c=n/2,l=i/2,e=u.layout.toLowerCase().split(" ");function s(){d.style.left="".concat(a-c,"px"),d.style.top="".concat(r-l,"px")}if(1==(e=e.filter(function(t){return t.length})).length)switch(e=O(e[0])){case"center":s();break;case"left":d.style.left="".concat(10,"px"),d.style.top="".concat(r-l,"px");break;case"right":d.style.left="".concat(t-n-10,"px"),d.style.top="".concat(r-l,"px");break;case"top":d.style.left="".concat(a-c,"px"),d.style.top="".concat(10,"px");break;case"bottom":d.style.left="".concat(a-c,"px"),d.style.top="".concat(o-i-10,"px");break;default:s()}else 1<e.length&&("left top"==(e=e.join(" "))||"top left"==e?(d.style.left="".concat(10,"px"),d.style.top="".concat(10,"px")):"left bottom"==e||"bottom left"==e?(d.style.left="".concat(10,"px"),d.style.top="".concat(o-i-10,"px")):"right top"==e||"top right"==e?(d.style.left="".concat(t-n+10,"px"),d.style.top="".concat(10,"px")):"right bottom"==e||"bottom right"==e?(d.style.left="".concat(t-n,"px"),d.style.top="".concat(o-i-10,"px")):s())}x(u.layout)&&u.layout.length&&t(),k(u.onResize)&&(window.onresize=t)}function tt(t,o,e){v(o.animation)&&e&&(o.animation?t.hasAnimation=!0:x(o.customAnimation)&&(t.hasAnimation=!1,t.customAnimation=o.customAnimation))}function ot(t){if(t.search(/^(\.|\#)/),t.slice(1).search(/^[\_|(a-zA-Z)]/)+1){e=(o=t,e=document.createElement("div"),"."==o.charAt(0)&&z._class(e,o.slice(1)),"#"==o.charAt(0)&&z._id(e,o.slice(1)),e);return e.innerHTML='\n<div mask="" class="codialog-mask" aria-hidden="false">\n <div dialog="" class="codialog-frame" role="dialog" aria-dialog="true">\n <div aria-dialogBox="true" class="codialog-box">\n <div class="codialog-styles">\n <div header="" class="codialog-styles-head dialog-header">\n <div class="codialog-head-content">\n <div title="" ref="title" class="codialog-head-title codialog-head-info">\n <span ></span>\n </div>\n <div close="" ref="close" class="codialog-head-close">\n <button type="button" class="addClose">×</button>\n </div>\n </div>\n </div>\n <div body="" class="codialog-styles-content dialog-body">\n <div class="codialog-content-message" dialog-body-overflow>\n <div class="codialog-icon codialog-icon-success">\n <div class="codialog-success-ring"></div>\n <span class="codialog-icon-success--line-small"></span>\n <span class="codialog-icon-success--line-long"></span>\n </div>\n <div class="codialog-icon codialog-icon-error">\n <span class="codialog-icon-error--line-left"></span>\n <span class="codialog-icon-error--line-right"></span>\n </div>\n <div class="codialog-icon codialog-icon-warning">\n <span class="codialog-icon-error--text">!</span>\n </div>\n <div class="codialog-icon codialog-icon-info">\n <span class="codialog-icon-info--text">!</span>\n </div>\n <div class="codialog-icon codialog-icon-question">\n <span class="codialog-icon-question--text">?</span>\n </div>\n <div message="" ref="message" class="codialog-message-text message-text codialog-text">\n <span></span>\n </div>\n </div>\n </div>\n <div footer="" class="codialog-styles-foot dialog-footer">\n <div class="codialog-foot-button codialog-foot-text">\n <div textGroup="" ref="text" class="codialog-text-group"></div>\n <div buttonGroup="" ref="button" class="codialog-button-group">\n <button type="button" confirm="" class="primary codialog-group-btn">确定</button>\n <button type="button" cancle="" class="cancle codialog-group-btn">取消</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n'.replace(/(^|\n)\s*/g,""),document.body.appendChild(e),this.dialogElement=t||null,this.cacheDialogElement.push(t),!0}return!1;var o,e}function et(o){var t=document.body,e=document.documentElement,n=t.offsetWidth;"add"===o.name&&(D([t,e],function(t){return t+o.value}),t.style.paddingRight="".concat(t.offsetWidth-n,"px")),"remove"===o.name&&(D([t,e],function(t){return t.replace(new RegExp(o.value,"gm"),"")}),t.style.paddingRight=0)}function nt(t,o){var e=this.$(this.dialogElement);if(e&&(t=this.find(e,t)))return t[o]}function it(t,o){var e=this.$(this.dialogElement);if(e&&(t=this.find(e,t)))return t.style[o]}function at(t,o,e){var n=this.$(this.dialogElement);n&&(t=this.find(n,t))&&(t.style[o]=e)}var rt,ct=Object.freeze({__proto__:null,getContent:function(){return nt.call(this,"[message]","innerHTML")},getTitle:function(){return nt.call(this,"[title]","innerHTML")},getTitleColor:function(){return it.call(this,"[title]","color")},getConfirmButtonColor:function(){return it.call(this,"[confirm]","color")},getCancleButtonColor:function(){return it.call(this,"[cancle]","color")},getCloseColor:function(){return it.call(this,"[close]","color")},setCloseColor:function(t){return at.call(this,"[close]","color",t)},setCancleButtonColor:function(t){return it.call(this,"[cancle]","color",t)},setConfirmButtonColor:function(t){return at.call(this,"[confirm]","color",t)},setTitleColor:function(t){return at.call(this,"[title]","color",t)}}),lt=!1,st=function(){!function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(o&&o.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),o&&c(t,o)}(n,U);var e=o(n);function n(t){var o;return a(this,n),(o=e.call(this,t)).name="Coog",o.xString=[],o.setTimer=null,o.tracker=!1,o.version="v2.1.7",o.hasAnimation=!0,o.closeBackValue=!1,o.cacheDialogElement=[],o.customAnimation="bounceOut",o.dialogElement=t||null,o}return t(n,[{key:"app",value:function(t){var o;if(this.tracker=!1,(o=this.$(t))!==document.body&&document.body.contains(o))this.dialogElement=t,this.tracker=!0;else if(!ot.call(this,t))return this.tracker=!1,window.console.warn('this methods .app("'.concat(t,'") accepts wrong parameters.you must define correct "class" and "id" and "_"'))&&!1;return this}},{key:"hide",value:function(t){var o,e,n,i=this.$(this.dialogElement);return this.isObj(t)?(o=this,e=i,w((n=t).timeout)&&(o.setTimer=setTimeout(function(){o.setTimer&&clearTimeout(o.setTimer),e.style.display="none",et({name:"remove",value:" codialog-show"})},n.timeout)),b(n.callback)&&n.callback(e)):this.isUndefined(t)&&function(t,o){null!=p(o,_)?this.animate(t).fadeOut("fadeOut",{type:"end",callback:function(){o.style.display="none",et({name:"remove",value:" codialog-show"})}}).render():(o.style.display="none",et({name:"remove",value:" codialog-show"}))}.call(this,"".concat(this.dialogElement," [mask]"),i),this}},{key:"show",value:function(t){var o,e,n,i=this.$(this.dialogElement);return this.isObj(t)?(o=this,e=i,w((n=t).timeout)&&(o.setTimer=setTimeout(function(){o.setTimer&&clearTimeout(o.setTimer),e.style.display="block",et({name:"add",value:" codialog-show"}),n.timeout=null},n.timeout)),b(n.callback)&&n.callback(e)):this.isUndefined(t)&&function(t,o){var e="bounceIn";null!=p(o,_)?(B(this.hasAnimation)&&(e=this.customAnimation||e),this.animate(t)[e](e,{type:"start",callback:function(){o.style.display="block",et({name:"add",value:" codialog-show"})}}).render()):(o.style.display="block",et({name:"add",value:" codialog-show"}))}.call(this,"".concat(this.dialogElement," [dialog]"),i),this}},{key:"use",value:function(t,o){var e,n,i,a=this.$(this.dialogElement),r=this.find(a,"[dialog]"),c=this.find(a,"[mask]"),l=this.find(a,"[header]"),s=this.find(a,"[body]"),u=this.find(a,"[footer]"),d=this.find(u,"[buttonGroup]");if(this.isStr(t)&&(this.xString=arguments,this.xString)){switch(this.xString.length){case 1:t={message:this.xString[0],onHeaderBefore:function(){this.style.display="none"}};break;case 2:t={title:this.xString[0],message:this.isStr(this.xString[1])?this.xString[1]:"No message text"};break;default:t={title:this.xString[0],message:this.isStr(this.xString[1])?this.xString[1]:"No message",type:this.isStr(this.xString[2])?this.xString[2]:""}}this.xString=[]}return t=f(this.clone(R),t),function(){var t=(r=arguments.length<=0?void 0:arguments[0]).obj,o=r.dialog;r.mask;var e=r.header,n=r.body,i=r.footer,a=r.footerButtonGroup,r=r.currentDialogElement;m(t)&&F(t,o,e,n,i),P(this,t),G(this,t,o),W(this,t,i),q(this,t,r),X(this,t,e,n,a),Y(this,t,n),J(this,t,$,r),V(this,t,e,a),K(this,t,e,a),Z(t,o,e,n,i),Q(t,o,r),tt(this,t,r)}.apply(this,[{obj:t,dialog:r,mask:c,header:l,body:s,footer:u,footerButtonGroup:d,currentDialogElement:a}]),e=this,n=r,(i=c).onclick=function(t){if(lt)return lt=!1,null;((t=t||window.event).target||t.srcElement)==i&&(e.setTimer&&clearTimeout(e.setTimer),e.$(e.dialogElement).style.display="none",et({name:"remove",value:" codialog-show"}))},n.onmousedown=function(){i.onmouseup=function(t){i.onmouseup=null,((t=t||window.event).target||t.srcElement)==i&&(lt=!0)}},i.onmousedown=function(){n.onmouseup=function(t){n.onmouseup=null,((t=t||window.event).target||t.srcElement)!=n&&!n.contains(t.target||t.srcElement)||(lt=!0)}},this}},{key:"$",value:function(t){return 9===t.nodeType?t.documentElement:this.isFun(t.HTMLDocument)?t:this.find(document.body,t)}},{key:"find",value:function(t,o,e){if("object"==(void 0===t?"undefined":i(t))&&this.isStr(o))return this.isArr(e)?(t||t.ownerDocument).querySelectorAll("".concat(o)):(t||t.ownerDocument).querySelector("".concat(o))}}]),n}();function ut(){}rt=st.prototype,T.map(function(t){rt[t]=function(t){var o,e;return{$refs:(o=this,t=t,e=new Object,t=o.find(t.children,"[ref]",[]),A(t,function(t){t.getAttribute("ref")&&(e[t.getAttribute("ref")]=t)}),e)}}}),f(st.prototype,E,ct),ut.app=function(t){return(new st).app(t)},ut.$=function(t){return(new st).$(t)};ct=function t(o){a(this,t)};return f(ct,ut),f(ct.prototype,st.prototype),ct}),"undefined"!=typeof document&&function(t,o){var e=t.createElement("style");if(t.getElementsByTagName("head")[0].appendChild(e),e.styleSheet)e.styleSheet.disabled||(e.styleSheet.cssText=o);else try{e.innerHTML=o}catch(t){e.innerText=o}}(document,".codialog-mask{position:fixed;left:0;right:0;top:0;bottom:0;align-items:center;text-align:center;z-index:999;background-color:rgba(0,0,0,.4)}.codialog-show{overflow-y:hidden;height:auto!important}.codialog-frame{display:flex;position:absolute;background-color:#fff;border-radius:6px;overflow:hidden;box-shadow:0 0 12px rgba(0,0,0,.5);border:calc(0px);pointer-events:auto;z-index:99999}.codialog-frame .codialog-box{display:block;width:520px;max-width:100%;height:100%}.codialog-box .codialog-styles{height:inherit}.codialog-styles .codialog-styles-head{padding:15px 19px;box-shadow:-2px 7px 19px #f9f9f9 inset;border-bottom:1px solid #e0e0e0}.codialog-styles-head .codialog-head-content{display:table;width:100%;clear:both;text-align:left!important}.codialog-head-content .codialog-head-close,.codialog-head-content .codialog-head-title{display:table-cell;position:relative;vertical-align:middle}.codialog-head-content .codialog-head-title{float:left;text-align:left;color:#9a9b9c}.codialog-head-content .codialog-head-close{float:right;text-align:right;color:#ccc}.codialog-head-content .codialog-head-close>button,.codialog-head-content .codialog-head-title>span{display:inline-block;font-weight:700;font-size:16px}.codialog-head-content .codialog-head-title>span{margin-left:0;color:inherit;font-weight:400}.codialog-head-content .codialog-head-close>button{position:relative;justify-content:center;width:19px;height:19px;margin:0;padding:0;transition:color .1s ease-out;border:none;border-radius:0;background:0 0;color:inherit;font-family:serif;font-size:17px;line-height:19px;cursor:pointer;overflow:hidden}.codialog-styles .codialog-styles-content{display:block;margin-top:28px;margin-left:64px;margin-right:64px;font-size:28px;overflow-y:hidden;color:#696969;text-align:center}.codialog-styles-content .codialog-content-message{position:relative}.codialog-icon{position:relative;display:flex;margin:0 auto 20px;height:76px;width:76px;line-height:76px;border-radius:50%;border:4px solid transparent;text-align:center;user-select:none;justify-content:center}.codialog-success-ring{position:absolute;width:100%;height:100%;border:4px solid hsla(98,55%,69%,.2);border-radius:50%;box-sizing:content-box;z-index:2;left:-4px;top:-4px}.codialog-icon-success .codialog-icon-success--line-small{position:absolute;display:inline-block;top:48px;left:16px;width:20px;height:5px;background-color:#a5dc86;transform:rotate(45deg)}.codialog-icon-success .codialog-icon-success--line-long{position:absolute;display:inline-block;top:41px;left:25px;width:42px;height:5px;background-color:#a5dc86;transform:rotate(135deg)}.codialog-icon-error{border-color:#f27474}.codialog-icon-error--line-left{position:absolute;display:inline-block;top:38px;width:45px;height:5px;border-radius:.125em;transform:rotate(45deg);left:15px;background-color:#f27474}.codialog-icon-error--line-right{position:absolute;display:inline-block;top:38px;width:45px;height:5px;border-radius:.125em;transform:rotate(-45deg);right:17px;background-color:#f27474}.codialog-icon-warning{border-color:#facea8;color:#f8bb86}.codialog-icon-error--text{color:#f8bb86;font-size:56px}.codialog-icon-info{border-color:#9de0f6}.codialog-icon-info--text{color:#3fc3ee;font-size:56px;transform:rotate(180deg)}.codialog-icon-question{border-color:#c9dae1;color:#87adbd}.codialog-icon-question--text{font-size:56px}.codialog-icon-error,.codialog-icon-info,.codialog-icon-question,.codialog-icon-success,.codialog-icon-warning{display:none}.codialog-content-message .codialog-message-text{width:100%;font-size:inherit}.codialog-styles .codialog-styles-foot{display:block;margin-top:30px;padding-bottom:22px}.codialog-styles-foot .codialog-foot-button{display:block}.codialog-foot-button .codialog-button-group{text-align:center}.codialog-button-group .codialog-group-btn{display:inline-block;margin:0 8px;padding:10px 32px;font-size:16px;font-weight:500;outline:0;border:none;cursor:pointer;-moz-border-radius:6px;-webkit-border-radius:6px;-ms-border-radius:6px;border-radius:6px;transition:background-color ease-in-out .2s}.codialog-foot-button .codialog-button-group button[confirm]{background-color:#51bf8c}.codialog-foot-button .codialog-button-group button[confirm]:hover{background-color:#45b680}.codialog-foot-button .codialog-button-group button[cancle]{display:none;background-color:#16aeee;background-color:#16aeee;color:#fff}.codialog-foot-button .codialog-text-group{text-align:center;color:#585858}@media only screen and (max-width:801px){.codialog-frame{width:96%}.codialog-frame .codialog-box{width:100%}}.animatedHalf{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both}.animated{-webkit-animation-duration:1s;animation-duration:1s;-webkit-animation-fill-mode:both;animation-fill-mode:both}@-webkit-keyframes bounceIn{20%,40%,60%,80%,from,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}20%{-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}40%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}60%{opacity:1;-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}80%{-webkit-transform:scale3d(.97,.97,.97);transform:scale3d(.97,.97,.97)}to{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}}@keyframes bounceIn{20%,40%,60%,80%,from,to{-webkit-animation-timing-function:cubic-bezier(.215,.61,.355,1);animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;-webkit-transform:scale3d(.3,.3,.3);transform:scale3d(.3,.3,.3)}20%{-webkit-transform:scale3d(1.1,1.1,1.1);transform:scale3d(1.1,1.1,1.1)}40%{-webkit-transform:scale3d(.9,.9,.9);transform:scale3d(.9,.9,.9)}60%{opacity:1;-webkit-transform:scale3d(1.03,1.03,1.03);transform:scale3d(1.03,1.03,1.03)}80%{-webkit-transform:scale3d(.97,.97,.97);transform:scale3d(.97,.97,.97)}to{opacity:1;-webkit-transform:scale3d(1,1,1);transform:scale3d(1,1,1)}}.bounceIn{-webkit-animation-duration:.75s;animation-duration:.75s;-webkit-animation-name:bounceIn;animation-name:bounceIn}@-webkit-keyframes fadeOut{from{opacity:1}to{opacity:0}}@keyframes fadeOut{from{opacity:1}to{opacity:0}}.fadeOut{-webkit-animation-name:fadeOut;animation-name:fadeOut}");