co-dialog
Version:
这是一个简洁,智能,个性化的JAVASCRIPT弹出框
1 lines • 22.7 kB
JavaScript
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):(t="undefined"!=typeof globalThis?globalThis:t||self).Coog=n()}(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 r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function o(t,n){for(var e=0;e<n.length;e++){var o=n[e];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function t(t,n,e){return n&&o(t.prototype,n),e&&o(t,e),t}function d(){return(d=Object.assign||function(t){for(var n=1;n<arguments.length;n++){var e,o=arguments[n];for(e in o)Object.prototype.hasOwnProperty.call(o,e)&&(t[e]=o[e])}return t}).apply(this,arguments)}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function c(t,n){return(c=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t})(t,n)}function l(t,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)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 n(e){var o=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,n=a(e);return l(this,o?(t=a(this).constructor,Reflect.construct(n,arguments,t)):n.apply(this,arguments))}}function s(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,o=new Array(n);e<n;e++)o[e]=t[e];return o}function u(t,n){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=function(t,n){if(t){if("string"==typeof t)return s(t,n);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,n):void 0}}(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var o=0,n=function(){};return{s:n,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:n}}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,r=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return r=t.done,t},e:function(t){a=!0,i=t},f:function(){try{r||null==e.return||e.return()}finally{if(a)throw i}}}}function e(t){return void 0===t}function m(t){return g(t)&&"[object Object]"==Object.prototype.toString.call(t)}function f(t){return g(t)&&t instanceof Array}function p(t,n){return!!(v(t)&&t.search(n)+1)}function h(t,n){for(var e in n)if(g(t.style[e]))return n[e]}var g=function(t){return!e(t)},y=function(t){return g(t)&&"function"==typeof t},b=function(t){return g(t)&&"[object Null]"==Object.prototype.toString.call(t)},v=function(t){return g(t)&&"string"==typeof t},w=function(t){return g(t)&&"boolean"==typeof t},x=function(t){return g(t)&&"number"==typeof t},k=function(t){return w(t)&&t},B=function(t){return w(t)&&!t},A=function(t){return p(t," ")?t.replace(/(\s*)/g,""):t},O=function(t,n,e){if(g(t))if(y(t.forEach))t.forEach(n,e||{});else for(var o=0;o<t.length;o++)y(n)?n.call(e||null,t[o],o):nul},C=function(t){return Array.isArray?Array.isArray(t):!!f(t)},E=Object.freeze({__proto__:null,isUndefined:e,isExist:g,isNan:function(t){return isNaN(t)},isFun:y,isObj:m,isNull:b,isArr:f,isStr:v,isBoolean:w,isNum:x,isTrue:k,isFalse:B,isEmptyObj:function(t){for(var n in t)return!1;return!0},search:p,trim:A,forEach:O,clone:function(t){if(t instanceof Object)return g(JSON)?JSON.parse(JSON.stringify(t)):t},objectKey:function(t){if(!t)return null;if(Object.keys)return Object.keys(t);var n,e=[];for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.push(n);return e},inArray:function(t,n){if(v(t)||x(n)){for(var e=0,o=n.length;e<o;e++)if(n[e]==t)return 1;return!1}return!1},isArray:C}),S=["onHeader","onBody","onFooter"],T=function(t){return g(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,n,e){t.addEventListener?t.addEventListener(n,e,!1):t.attachEvent&&t.attachEvent("on".concat(n),e)},L=function(t,n,e){t.removeEventListener?t.removeEventListener(n,e,!1):t.detachEvent("on".concat(n),e)},D={_class:function(t,n){t.classList?t.setAttribute("class",n):t.className=n},_id:function(t,n){t.setAttribute("id",n)}};function R(t,n){var e,o=u(t);try{for(o.s();!(e=o.n()).done;){var i=e.value;i.classList?i.setAttribute("class",n(i.classList.value)):items.className&&i.setAttribute("class",n(i.className.value))}}catch(t){o.e(t)}finally{o.f()}}var N={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"],_={excuteAnimation:"animationstart",OAnimation:"oAnimationStart",MozAnimation:"animationstart",WebkitAnimation:"webkitAnimationStart",MSAnimation:"MSAnimationStart"},z={excuteAnimation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd",MSAnimation:"MSAnimationEnd"},U={},M=function(){function e(t){r(this,e),this.animationElement=[],this.animationName="bounceOut"}return t(e,[{key:"animate",value:function(t){this.animationElement=[t];var n=this;return H.map(function(t){e.prototype[t]=n.callAnimationApi}),this}},{key:"callAnimationApi",value:function(t,n){return this.animationName=t,"start"===(U=n).type&&y(U.callback)&&U.callback(),this}},{key:"excuteAnimation",value:function(n){var e=this,o=document.querySelector(this.animationElement[0]),i=h(o,z),r=h(o,_);"end"==n.type.toLowerCase()&&R([o],function(t){return"".concat(t," ").concat(e.animationName," animatedHalf")}),"start"==n.type.toLowerCase()&&R([o],function(t){return"".concat(t," ").concat(e.animationName," animated")});var a=function(){return L(o,r,t)},t=function t(){"end"===n.type.toLowerCase()&&(n.callback(e.animationName),R([o],function(t){return t.replace(new RegExp(" ".concat(e.animationName," animatedHalf"),"gm"),"")}),"function"==typeof e.waitConfirmCallback&&e.waitConfirmCallback()),"start"===n.type.toLowerCase()&&R([o],function(t){return t.replace(new RegExp(" ".concat(e.animationName," animated"),"gm"),"")}),L(o,i,t),L(o,r,a)};j(o,i,t),j(o,r,a)}},{key:"render",value:function(){this.excuteAnimation(U)}}]),e}(),$=["header","body","footer"];function F(t,n,e,o,i){(t.onDialogBefore||t.onHeaderBefore||t.onBodyBefore||t.onFooterBefore)&&(y(t.onDialogBefore)&&t.onDialogBefore.call(n,n),y(t.onHeaderBefore)&&t.onHeaderBefore.call(e,e),y(t.onBodyBefore)&&t.onBodyBefore.call(o,o),y(t.onFooterBefore)&&t.onFooterBefore.call(i,i))}function P(t,n){x(n.timeout)&&0<Number(n.timeout)&&t.hide({timeout:n.timeout})}function G(t,n,e){B(n.isMask)&&t.find(e,"[mask]")&&(t.find(e,"[mask]").style.backgroundColor="transparent")}function q(e,t,o){var i,r,a,c;k(t.isDrag)&&(i=!0,r={},a={},c={},k(t.isGesture)?o.style.cursor="move":o.style.cursor="unset",j(o,"mousedown",function(t){r={x:o.offsetLeft-document.body.scrollLeft,y:o.offsetTop-document.body.scrollTop},a={x:t.screenX,y:t.screenY},i=!0;function n(t){i&&(c={x:t.screenX,y:t.screenY},r.x+=c.x-a.x,r.y+=c.y-a.y,a=c,o.style.left="".concat(r.x,"px"),o.style.top="".concat(r.y,"px"))}j(e.$(document),"mousemove",n),j(e.$(document),"mouseup",function(t){L(o.ownerDocument,"mouseover",n),i=!1,I(t)}),I(t)}))}function W(t,n,e){e=t.find(e,"[textGroup]"),v(n.footerText)&&e?e.innerHTML=n.footerText:C(n.footerText)&&e?0<n.footerText.length&&(e.innerHTML=n.footerText.concat().join("")):e&&T(e)}function X(t,n,e,o,i){var r;(r=t.find(e,"[title]"))&&r&&(r.innerHTML=n.title,r.style.color=n.titleColor),(r=t.find(o,"[message]"))&&r&&(r.innerHTML=t.message||n.message,r.style.color=n.messageColor),(r=t.find(i,"[confirm]"))&&r&&(r.textContent=n.confirmButtonText,r.style.color=n.confirmButtonColor,"#51BF8C"==n.confirmButtonBackground||(r.style.backgroundColor=n.confirmButtonBackground)),(r=t.find(i,"[cancle]"))&&r&&(r.textContent=n.cancleButtonText,r.style.color=n.cancleButtonColor,"#aaa"==n.cancleButtonBackground||(r.style.backgroundColor=n.cancleButtonBackground)),(r=t.find(e,"[close]"))&&r&&(r.style.color=n.closeColor)}function Y(n,t,e){var o,i;v(t.type)&&(o=["success","error","warning","info","question"],i=t.type.replace(/\s*/gi,"").toLowerCase(),-1!=o.indexOf(i)&&o.map(function(t){n.find(e,".codialog-icon-".concat(t)).style.display=i===t?"flex":"none"}))}function J(e,t,o,i){y(t.methods)&&(O(S,function(t,n){e[o[n]]=e[t]({children:e.find(i,"[".concat(o[n],"]"))})}),t.methods.call(e,i))}function V(o,i,t,n){var e;k(i.isClose)&&(o.$(o.dialogElement),e=[],t=o.find(t,"[close]"),b(t)||e.push(t),t=o.find(n,"[cancle]"),b(n),g(t)&&e.push(t),t=o.find(n,"[confirm]"),b(n),b(t)||e.push(t),0<e.length&&O(e,function(t,n){var e=t;e.onclick=function(t){o.setTimer&&clearTimeout(o.setTimer),v(e.getAttribute("confirm"))&&y(i.confirmCallback)?o.waitConfirmCallback=i.confirmCallback:v(e.getAttribute("cancle"))&&y(i.cancleCallback)&&(o.waitCancleCallback=i.cancleCallback),o.hide(),o.closeBackValue=!0}}))}function K(t,n,e,o){var i,r,a;B(n.showCloseButton)&&(i=t.find(e,"[close]"))&&g(i)&&(i.style.display="none"),k(n.showCancleButton)&&(r=t.find(o,"[cancle]"))&&g(r)&&(r.style.display="inline-block"),B(n.showConfirmButton)&&(a=t.find(o,"[confirm]"))&&g(a)&&(a.style.display="none")}function Z(t,n,e,o,i){(t.onDialogAfter||t.onHeaderAfter||t.onBodyAfter||t.onFooterAfter)&&(y(t.onDialogAfter)&&t.onDialogAfter.call(n,n),y(t.onHeaderAfter)&&t.onHeaderAfter.call(e,e),y(t.onBodyAfter)&&t.onBodyAfter.call(o,o),y(t.onFooterAfter)&&t.onFooterAfter.call(i,i))}function Q(u,f,d){function t(){var t=(document.documentElement||document.body).clientWidth,n=(document.documentElement||document.body).clientHeight,e=!1;"block"!=d.style.display&&(d.style.zIndex="-9999",d.style.display="block",e=!0);var o=f.offsetWidth,i=f.offsetHeight,e=e&&!(d.style.display="none");d.style.zIndex="9999";var r=t/2,a=n/2,c=o/2,l=i/2,e=u.layout.toLowerCase().split(" ");function s(){f.style.left="".concat(r-c,"px"),f.style.top="".concat(a-l,"px")}if(1==(e=e.filter(function(t){return t.length})).length)switch(e=A(e[0])){case"center":s();break;case"left":f.style.left="".concat(10,"px"),f.style.top="".concat(a-l,"px");break;case"right":f.style.left="".concat(t-o-10,"px"),f.style.top="".concat(a-l,"px");break;case"top":f.style.left="".concat(r-c,"px"),f.style.top="".concat(10,"px");break;case"bottom":f.style.left="".concat(r-c,"px"),f.style.top="".concat(n-i-10,"px");break;default:s()}else 1<e.length&&("left top"==(e=e.join(" "))||"top left"==e?(f.style.left="".concat(10,"px"),f.style.top="".concat(10,"px")):"left bottom"==e||"bottom left"==e?(f.style.left="".concat(10,"px"),f.style.top="".concat(n-i-10,"px")):"right top"==e||"top right"==e?(f.style.left="".concat(t-o+10,"px"),f.style.top="".concat(10,"px")):"right bottom"==e||"bottom right"==e?(f.style.left="".concat(t-o,"px"),f.style.top="".concat(n-i-10,"px")):s())}v(u.layout)&&u.layout.length&&t(),k(u.onResize)&&(window.onresize=t)}function tt(t,n,e){w(n.animation)&&e&&(n.animation?t.hasAnimation=!0:v(n.customAnimation)&&(t.hasAnimation=!1,t.customAnimation=n.customAnimation))}function nt(t){if(t.search(/^(\.|\#)/),t.slice(1).search(/^[\_|(a-zA-Z)]/)+1){e=(n=t,e=document.createElement("div"),"."==n.charAt(0)&&D._class(e,n.slice(1)),"#"==n.charAt(0)&&D._id(e,n.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 n,e}function et(n){var t=document.body,e=document.documentElement,o=t.offsetWidth;"add"===n.name&&(R([t,e],function(t){return t+n.value}),t.style.paddingRight="".concat(t.offsetWidth-o,"px")),"remove"===n.name&&(R([t,e],function(t){return t.replace(new RegExp(n.value,"gm"),"")}),t.style.paddingRight=0)}function ot(t,n){var e=this.$(this.dialogElement);if(e&&(t=this.find(e,t)))return t[n]}function it(t,n){var e=this.$(this.dialogElement);if(e&&(t=this.find(e,t)))return t.style[n]}function rt(t,n,e){var o=this.$(this.dialogElement);o&&(t=this.find(o,t))&&(t.style[n]=e)}var at,ct=Object.freeze({__proto__:null,getContent:function(){return ot.call(this,"[message]","innerHTML")},getTitle:function(){return ot.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 rt.call(this,"[close]","color",t)},setCancleButtonColor:function(t){return it.call(this,"[cancle]","color",t)},setConfirmButtonColor:function(t){return rt.call(this,"[confirm]","color",t)},setTitleColor:function(t){return rt.call(this,"[title]","color",t)}}),lt=!1,st=function(){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&c(t,n)}(o,M);var e=n(o);function o(t){var n;return r(this,o),(n=e.call(this,t)).name="Coog",n.xString=[],n.setTimer=null,n.tracker=!1,n.version="v2.1.7",n.hasAnimation=!0,n.closeBackValue=!1,n.cacheDialogElement=[],n.customAnimation="bounceOut",n.dialogElement=t||null,n}return t(o,[{key:"app",value:function(t){var n;if(this.tracker=!1,(n=this.$(t))!==document.body&&document.body.contains(n))this.dialogElement=t,this.tracker=!0;else if(!nt.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 n,e,o,i=this.$(this.dialogElement);return this.isObj(t)?(n=this,e=i,x((o=t).timeout)&&(n.setTimer=setTimeout(function(){n.setTimer&&clearTimeout(n.setTimer),e.style.display="none",et({name:"remove",value:" codialog-show"})},o.timeout)),y(o.callback)&&o.callback(e)):this.isUndefined(t)&&function(t,n){null!=h(n,z)?this.animate(t).fadeOut("fadeOut",{type:"end",callback:function(){n.style.display="none",et({name:"remove",value:" codialog-show"})}}).render():(n.style.display="none",et({name:"remove",value:" codialog-show"}))}.call(this,"".concat(this.dialogElement," [mask]"),i),this}},{key:"show",value:function(t){var n,e,o,i=this.$(this.dialogElement);return this.isObj(t)?(n=this,e=i,x((o=t).timeout)&&(n.setTimer=setTimeout(function(){n.setTimer&&clearTimeout(n.setTimer),e.style.display="block",et({name:"add",value:" codialog-show"}),o.timeout=null},o.timeout)),y(o.callback)&&o.callback(e)):this.isUndefined(t)&&function(t,n){var e="bounceIn";null!=h(n,z)?(B(this.hasAnimation)&&(e=this.customAnimation||e),this.animate(t)[e](e,{type:"start",callback:function(){n.style.display="block",et({name:"add",value:" codialog-show"})}}).render()):(n.style.display="block",et({name:"add",value:" codialog-show"}))}.call(this,"".concat(this.dialogElement," [dialog]"),i),this}},{key:"use",value:function(t,n){var e,o,i,r=this.$(this.dialogElement),a=this.find(r,"[dialog]"),c=this.find(r,"[mask]"),l=this.find(r,"[header]"),s=this.find(r,"[body]"),u=this.find(r,"[footer]"),f=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=d(this.clone(N),t),function(){var t=(a=arguments.length<=0?void 0:arguments[0]).obj,n=a.dialog;a.mask;var e=a.header,o=a.body,i=a.footer,r=a.footerButtonGroup,a=a.currentDialogElement;m(t)&&F(t,n,e,o,i),P(this,t),q(this,t,n),W(this,t,i),G(this,t,a),X(this,t,e,o,r),Y(this,t,o),J(this,t,$,a),V(this,t,e,r),K(this,t,e,r),Z(t,n,e,o,i),Q(t,n,a),tt(this,t,a)}.apply(this,[{obj:t,dialog:a,mask:c,header:l,body:s,footer:u,footerButtonGroup:f,currentDialogElement:r}]),e=this,o=a,(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"}))},o.onmousedown=function(){i.onmouseup=function(t){i.onmouseup=null,((t=t||window.event).target||t.srcElement)==i&&(lt=!0)}},i.onmousedown=function(){o.onmouseup=function(t){o.onmouseup=null,((t=t||window.event).target||t.srcElement)!=o&&!o.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,n,e){if("object"==(void 0===t?"undefined":i(t))&&this.isStr(n))return this.isArr(e)?(t||t.ownerDocument).querySelectorAll("".concat(n)):(t||t.ownerDocument).querySelector("".concat(n))}}]),o}();function ut(){}at=st.prototype,S.map(function(t){at[t]=function(t){var n,e;return{$refs:(n=this,t=t,e=new Object,t=n.find(t.children,"[ref]",[]),O(t,function(t){t.getAttribute("ref")&&(e[t.getAttribute("ref")]=t)}),e)}}}),d(st.prototype,E,ct),ut.app=function(t){return(new st).app(t)},ut.$=function(t){return(new st).$(t)};ct=function t(n){r(this,t)};return d(ct,ut),d(ct.prototype,st.prototype),ct});