/*!
 DMXzone Bootstrap 5 Toasts
 Version: 1.0.1
 (c) 2021 DMXzone.com
 @build 2021-06-07 16:21:31
 */
dmx.bs5toast={defaults:{iconType:"image",position:"top",align:"right","offset-x":15,"offset-y":15,"z-index":1e4,"min-width":240,"max-width":350,animation:!0,autohide:!0,closable:!0,delay:5e3},container:null,setup:function(t){t=Object.assign(dmx.bs5toast.defaults,t),dmx.bs5toast.container||(dmx.bs5toast.container=document.createElement("div"),document.body.appendChild(dmx.bs5toast.container));var e=dmx.bs5toast.container;e.style.removeProperty("top"),e.style.removeProperty("left"),e.style.removeProperty("right"),e.style.removeProperty("bottom"),e.style.removeProperty("max-width"),e.style.setProperty("position","fixed"),e.style.setProperty("z-index",t["z-index"]),e.style.setProperty(t.align,t["offset-x"]+"px"),e.style.setProperty(t.position,t["offset-y"]+"px"),t["max-width"]&&e.style.setProperty("max-width",t["max-width"]+"px")},clear:function(){dmx.bs5toast.container&&(dmx.bs5toast.container.textContent="")},show:function(t){t=Object.assign({},dmx.bs5toast.defaults,t),dmx.bs5toast.container||dmx.bs5toast.setup();var e=dmx.bs5toast.create(t);dmx.bs5toast.container.appendChild(e);var s=new bootstrap.Toast(e,t);e.addEventListener("hidden.bs.toast",function(){dmx.bs5toast.container.removeChild(e)}),s.show()},create:function(t){var e='<div class="toast"'+(t["min-width"]?' style="min-width: '+t["min-width"]+'px"':"")+' role="alert" aria-live="assertive" aria-atomic="true" data-bs-delay="'+(t.delay||this.props.delay)+'">';if(t.icon||t.title||t.subtitle||t.closable){if(e+='<div class="toast-header">',t.icon)switch(t.iconType){case"fontawesome":e+='<i class="'+t.icon+' me-2"></i>';break;default:e+='<img src="'+t.icon+'" height="20" class="rounded me-2" alt="'+(t.alt||"")+'">'}e+='<strong class="me-auto">'+(t.title||"")+"</strong>",t.subtitle&&(e+='<small class="text-muted">'+t.subtitle+"</small>"),t.closable&&(e+='<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button>'),e+="</div>"}e+='<div class="toast-body">'+(t.message||"")+"</div>",e+="</div>";var s=document.createElement("div");return s.innerHTML=e,s.firstChild}},dmx.Actions({"toast.setup":function(t){dmx.bs5toast.setup(this.parse(t))},"toast.show":function(t){dmx.bs5toast.show(this.parse(t))},"toast.clear":function(){dmx.bs5toast.clear()}}),dmx.Component("bs5-toasts",{attributes:{position:{type:String,default:"top"},align:{type:String,default:"right"},"offset-x":{type:Number,default:15},"offset-y":{type:Number,default:15},"min-width":{type:Number,default:240},"max-width":{type:Number,default:350},"z-index":{type:Number,default:1e4},delay:{type:Number,default:5e3}},methods:{clear:function(){this.clear()},show:function(t){this.show(t)}},render:function(t){this.update({})},update:function(t){dmx.equal(t,this.props)||dmx.bs5toast.setup(this.props)},clear:function(){dmx.bs5toast.clear()},show:function(t){dmx.bs5toast.show(t)}});
//# sourceMappingURL=../maps/dmxBootstrap5Toasts.js.map
