diff --git a/dist/simplert.bundle.js b/dist/simplert.bundle.js index 674ee90..456bdf0 100644 --- a/dist/simplert.bundle.js +++ b/dist/simplert.bundle.js @@ -1,5 +1,5 @@ /*! - * Vue2-Simplert v.0.5.6 + * Vue2-Simplert v.0.5.7 * Irfan Maulana (https://github.com/mazipan) */ !function(n,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("Vue")):"function"==typeof define&&define.amd?define("Simplert",["Vue"],r):"object"==typeof exports?exports.Simplert=r(require("Vue")):n.Simplert=r(n.Vue)}(this,function(n){return function(n){function r(t){if(e[t])return e[t].exports;var i=e[t]={i:t,l:!1,exports:{}};return n[t].call(i.exports,i,i.exports,r),i.l=!0,i.exports}var e={};return r.m=n,r.c=e,r.i=function(n){return n},r.d=function(n,e,t){r.o(n,e)||Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:t})},r.n=function(n){var e=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(e,"a",e),e},r.o=function(n,r){return Object.prototype.hasOwnProperty.call(n,r)},r.p="/dist",r(r.s=2)}([function(n,r,e){var t=e(3);"string"==typeof t&&(t=[[n.i,t,""]]),t.locals&&(n.exports=t.locals);e(5)("1e24e68c",t,!0)},function(r,e){r.exports=n},function(n,r,e){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var t=e(1),i=e.n(t);e(0),i.a.component("simplert",{template:'\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n {{ title }}\n
\n
\n
\n
\n \n
\n
\n ',props:{useRadius:{type:Boolean,default:!0},useIcon:{type:Boolean,default:!0}},data:function(){return{DEFAULT_TYPE:"info",DEFAULT_BTN_CLOSE_TEXT:"Close",DEFAULT_BTN_CONFIRM_TEXT:"Confirm",INVALID_TYPE:"INVALID_TYPE",showSimplert:!1,title:"",message:"",type:this.DEFAULT_TYPE,customClass:"",customIconUrl:"",onOpen:null,customCloseBtnText:this.DEFAULT_BTN_CLOSE_TEXT,customCloseBtnClass:"",onClose:null,useConfirmBtn:!1,customConfirmBtnText:this.DEFAULT_BTN_CONFIRM_TEXT,customConfirmBtnClass:"",onConfirm:null,disableOverlayClick:!1,hideAllButton:!1,showXclose:!1}},computed:{classSimplert:function(){var n=this.customClass;return this.showSimplert&&(n=this.customClass+" simplert--shown"),n},classContent:function(){var n="";return this.useRadius&&(n="simplert__content--radius"),n},classBtnClose:function(){var n="simplert__close";return this.useRadius&&(n="simplert__close simplert__close--radius"),this.customCloseBtnClass&&(n=this.customCloseBtnClass),n},classBtnConfirm:function(){var n="simplert__confirm";return this.useRadius&&(n="simplert__confirm simplert__confirm--radius"),this.customConfirmBtnClass&&(n=this.customConfirmBtnClass),n}},methods:{justCloseSimplert:function(){this.showSimplert=!1},closeOverlay:function(n){var r=this;n.target.className.indexOf("simplert--shown")>0&&!r.disableOverlayClick&&(r.showSimplert=!1)},whenConfirm:function(n){var r=this;n.preventDefault(),r.showSimplert=!1,null!==r.onConfirm&&r.onConfirm()},closeSimplert:function(n){var r=this;n.preventDefault(),r.showSimplert=!1,null!==r.onClose&&r.onClose()},openSimplert:function(n){var r=this;void 0!==n&&(r.showSimplert=!0,r.title=n.title,void 0!==n.message?r.message=n.message:r.message="",void 0!==n.type?r.type=n.type:r.type=r.DEFAULT_TYPE,void 0!==n.customClass?r.customClass=n.customClass:r.customClass="",void 0!==n.customIconUrl&&""!==n.customCloseBtnText?(r.customIconUrl=n.customIconUrl,r.type=r.INVALID_TYPE):r.customIconUrl="",void 0!==n.customCloseBtnText&&""!==n.customCloseBtnText?r.customCloseBtnText=n.customCloseBtnText:r.customCloseBtnText=r.DEFAULT_BTN_CLOSE_TEXT,void 0!==n.customCloseBtnClass?r.customCloseBtnClass=n.customCloseBtnClass:r.customCloseBtnClass="",void 0!==n.onClose&&null!==n.onClose?r.onClose=n.onClose:r.onClose=null,void 0!==n.useConfirmBtn?r.useConfirmBtn=n.useConfirmBtn:r.useConfirmBtn=!1,void 0!==n.customConfirmBtnText&&""!==n.customConfirmBtnText?r.customConfirmBtnText=n.customConfirmBtnText:r.customConfirmBtnText=r.DEFAULT_BTN_CONFIRM_TEXT,void 0!==n.customConfirmBtnClass?r.customConfirmBtnClass=n.customConfirmBtnClass:r.customConfirmBtnClass="",void 0!==n.onConfirm&&null!==n.onConfirm?r.onConfirm=n.onConfirm:r.onConfirm=null,void 0!==n.disableOverlayClick?r.disableOverlayClick=n.disableOverlayClick:r.disableOverlayClick=!1,void 0!==n.hideAllButton?r.hideAllButton=n.hideAllButton:r.hideAllButton=!1,void 0!==n.showXclose?r.showXclose=n.showXclose:r.showXclose=!1,void 0!==n.onOpen?r.onOpen=n.onOpen:r.onOpen=null,null!==r.onOpen&&r.onOpen())}}})},function(n,r,e){r=n.exports=e(4)(),r.push([n.i,".simplert {\r\n box-sizing: border-box;\r\n font-size: 14px;\r\n line-height: 1.15;\r\n}\r\n\r\n.simplert *, .simplert *:before, .simplert *:after {\r\n box-sizing: inherit;\r\n}\r\n\r\n.simplert {\r\n position: fixed;\r\n z-index: 999;\r\n top: 0;\r\n left: 0;\r\n display: none;\r\n overflow: auto;\r\n width: 100%;\r\n height: 100%;\r\n text-align: center;\r\n background-color: black;\r\n background-color: rgba(0, 0, 0, 0.4);\r\n}\r\n.simplert--shown {\r\n display: flex;\r\n align-items: center;\r\n}\r\n.simplert--shown .simplert__content {\r\n animation-name: zoomIn;\r\n animation-duration: .3s;\r\n animation-fill-mode: both;\r\n}\r\n.simplert__x{\r\n position: absolute;\r\n right: 15px;\r\n top: 15px;\r\n cursor: pointer;\r\n color: #b3aaaa;\r\n font-weight: bold;\r\n font-size: 11px;\r\n}\r\n.simplert__header {\r\n padding: 2em 0;\r\n}\r\n.simplert__title {\r\n font-size: 30px;\r\n display: block;\r\n}\r\n.simplert__content {\r\n position: relative;\r\n width: 90%;\r\n max-width: 400px;\r\n margin: 0 auto;\r\n padding: 0 20px;\r\n background-color: #fff;\r\n box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);\r\n}\r\n@media only screen and (min-width: 768px) {\r\n .simplert__content {\r\n width: 30%;\r\n }\r\n}\r\n.simplert__content--radius {\r\n -webkit-border-radius: 0.3em;\r\n -moz-border-radius: 0.3em;\r\n border-radius: 0.3em;\r\n}\r\n.simplert__body {\r\n padding-bottom: 1em;\r\n}\r\n.simplert__icon {\r\n position: relative;\r\n width: 80px;\r\n height: 80px;\r\n margin: 10px auto;\r\n -webkit-border-radius: 50%;\r\n -moz-border-radius: 50%;\r\n border-radius: 50%;\r\n}\r\n.simplert__icon--info {\r\n border: 4px solid #c9dae1;\r\n}\r\n.simplert__icon--success {\r\n border: 4px solid #a5dc86;\r\n}\r\n.simplert__icon--warning {\r\n border: 4px solid #f8bb86;\r\n}\r\n.simplert__icon--error {\r\n border: 4px solid #f27474;\r\n}\r\n.simplert__icon img {\r\n width: 80px;\r\n height: 80px;\r\n}\r\n.simplert__line {\r\n position: absolute;\r\n z-index: 2;\r\n display: block;\r\n height: 5px;\r\n border-radius: 2px;\r\n}\r\n.simplert__line--info {\r\n position: absolute;\r\n top: 19px;\r\n left: 50%;\r\n width: 7px;\r\n height: 7px;\r\n margin-left: -3px;\r\n border-radius: 50%;\r\n background-color: #c9dae1;\r\n}\r\n.simplert__line--info-2 {\r\n position: absolute;\r\n bottom: 15px;\r\n left: 50%;\r\n width: 5px;\r\n height: 29px;\r\n margin-left: -2px;\r\n border-radius: 2px;\r\n background-color: #c9dae1;\r\n}\r\n.simplert__line--success {\r\n top: 44px;\r\n left: 6px;\r\n width: 25px;\r\n -webkit-transform: rotate(45deg);\r\n transform: rotate(45deg);\r\n background-color: #a5dc86;\r\n}\r\n.simplert__line--success-2 {\r\n top: 38px;\r\n right: 6px;\r\n width: 47px;\r\n -webkit-transform: rotate(-45deg);\r\n transform: rotate(-45deg);\r\n background-color: #a5dc86;\r\n}\r\n.simplert__line--warning {\r\n position: absolute;\r\n top: 10px;\r\n left: 50%;\r\n width: 5px;\r\n height: 35px;\r\n margin-left: -2px;\r\n -webkit-border-radius: 2px;\r\n border-radius: 2px;\r\n background-color: #f8bb86;\r\n}\r\n.simplert__line--warning-2 {\r\n position: absolute;\r\n bottom: 10px;\r\n left: 50%;\r\n width: 7px;\r\n height: 7px;\r\n margin-left: -3px;\r\n -webkit-border-radius: 50%;\r\n border-radius: 50%;\r\n background-color: #f8bb86;\r\n}\r\n.simplert__line--error {\r\n top: 35px;\r\n left: 13px;\r\n width: 47px;\r\n -webkit-transform: rotate(45deg);\r\n transform: rotate(45deg);\r\n background-color: #f27474;\r\n}\r\n.simplert__line--error-2 {\r\n top: 35px;\r\n right: 13px;\r\n width: 47px;\r\n -webkit-transform: rotate(-45deg);\r\n transform: rotate(-45deg);\r\n background-color: #f27474;\r\n}\r\n.simplert__footer {\r\n padding: 1em 0;\r\n}\r\n.simplert__close, .simplert__confirm {\r\n display: inline-block;\r\n margin: 0 .5em;\r\n padding: 10px 20px;\r\n cursor: pointer;\r\n text-align: center;\r\n color: #fff;\r\n border: none;\r\n outline: none;\r\n background-color: #068ac9;\r\n -webkit-appearance: none;\r\n -moz-appearance: none;\r\n}\r\n.simplert__close--radius, .simplert__confirm--radius {\r\n -webkit-border-radius: 0.3em;\r\n -moz-border-radius: 0.3em;\r\n border-radius: 0.3em;\r\n}\r\n\r\n@keyframes zoomIn {\r\n from {\r\n transform: scale3d(0.3, 0.3, 0.3);\r\n opacity: 0;\r\n }\r\n 50% {\r\n opacity: 1;\r\n }\r\n}\r\n",""])},function(n,r){n.exports=function(){var n=[];return n.toString=function(){for(var n=[],r=0;re.parts.length&&(t.parts.length=e.parts.length)}else{for(var s=[],i=0;i