| Current Path : /var/www/homesaver/www/bitrix/js/ui/notification-panel/dist/ |
| Current File : /var/www/homesaver/www/bitrix/js/ui/notification-panel/dist/notification-panel.bundle.min.js |
this.BX=this.BX||{};(function(e,t,i,s,o){"use strict";let n=e=>e,a,l,r,c,p,d,h,u;var v=babelHelpers.classPrivateFieldLooseKey("panel");var b=babelHelpers.classPrivateFieldLooseKey("popup");var f=babelHelpers.classPrivateFieldLooseKey("container");var P=babelHelpers.classPrivateFieldLooseKey("createPanel");var g=babelHelpers.classPrivateFieldLooseKey("handlePopupShow");var B=babelHelpers.classPrivateFieldLooseKey("handlePopupClose");class F extends s.EventEmitter{constructor(e){var i,s;super();Object.defineProperty(this,B,{value:_});Object.defineProperty(this,g,{value:y});Object.defineProperty(this,P,{value:H});Object.defineProperty(this,v,{writable:true,value:null});Object.defineProperty(this,b,{writable:true,value:null});Object.defineProperty(this,f,{writable:true,value:void 0});this.setEventNamespace("UI:NotificationPanel");this.options={...this.getDefaultOptions(),...t.Type.isPlainObject(e)?e:{}};(s=(i=this.options).id)!=null?s:i.id=t.Text.getRandom()}getDefaultOptions(){return{backgroundColor:"#F2FEE2",leftIcon:null,rightButtons:[],showCloseIcon:true,events:{}}}getContainer(){if(babelHelpers.classPrivateFieldLooseBase(this,f)[f]){return babelHelpers.classPrivateFieldLooseBase(this,f)[f]}babelHelpers.classPrivateFieldLooseBase(this,f)[f]=t.Tag.render(a||(a=n`
<div class="ui-notification-panel__container">
${0}
${0}
</div>
`),this.getContent(),this.getFooter());return babelHelpers.classPrivateFieldLooseBase(this,f)[f]}getButtonsContainer(e){const i=t.Tag.render(l||(l=n`<div class="ui-notification-panel__buttons-container"></div>`));e.forEach((e=>{e.renderTo(i)}));return i}getContent(){const e=t.Tag.render(r||(r=n`<div class="ui-notification-panel__content"></div>`));if(this.options.leftIcon){this.options.leftIcon.size=28;this.options.leftIcon.renderTo(e);t.Dom.append(t.Tag.render(c||(c=n`<div class="ui-notification-panel__left-icon-divider"></div>`)),e)}if(t.Type.isElementNode(this.options.content)){t.Dom.append(this.options.content,e)}else if(t.Type.isString(this.options.content)){t.Dom.append(t.Tag.render(p||(p=n`<div class="ui-notification-panel__text">${0}</div>`),this.options.content),e)}t.Dom.append(this.getFooter(),e);return e}getFooter(){const e=t.Tag.render(d||(d=n`<div class="ui-notification-panel__footer"></div>`));if(this.options.rightButtons){t.Dom.append(this.getButtonsContainer(this.options.rightButtons),e)}if(this.options.showCloseIcon){t.Dom.append(this.getCloseButton(),e)}return e}getCloseButton(){return t.Tag.render(h||(h=n`
<div
class="ui-notification-panel__close-button ui-icon-set --cross-45"
onclick="${0}"
>
</div>
`),this.hide.bind(this))}getPopup(){var e,t;(t=(e=babelHelpers.classPrivateFieldLooseBase(this,b))[b])!=null?t:e[b]=o.PopupWindowManager.create({id:this.options.id,content:this.getContent(),background:this.options.backgroundColor,targetContainer:babelHelpers.classPrivateFieldLooseBase(this,v)[v],className:"ui-notification-panel__container",animation:{showClassName:"ui-notification-panel__show",closeClassName:"ui-notification-panel__hide",closeAnimationType:"transition"},events:{onShow:babelHelpers.classPrivateFieldLooseBase(this,g)[g].bind(this),onClose:babelHelpers.classPrivateFieldLooseBase(this,B)[B].bind(this)},zIndexOptions:{alwaysOnTop:true}});return babelHelpers.classPrivateFieldLooseBase(this,b)[b]}show(){if(!babelHelpers.classPrivateFieldLooseBase(this,v)[v]){babelHelpers.classPrivateFieldLooseBase(this,P)[P]()}this.getPopup().show()}hide(){this.getPopup().close()}}function H(){babelHelpers.classPrivateFieldLooseBase(this,v)[v]=t.Tag.render(u||(u=n`<div class="ui-notification-panel" id="notification-panel-${0}"></div>`),this.options.id);const e=document.body.querySelector(".bx-layout-table");t.Dom.insertBefore(babelHelpers.classPrivateFieldLooseBase(this,v)[v],e)}function y(){var e;(e=this.options.events)==null?void 0:e.onShow==null?void 0:e.onShow();this.emit("onShow")}function _(){var e;(e=this.options.events)==null?void 0:e.onHide==null?void 0:e.onHide();this.emit("onHide")}e.NotificationPanel=F})(this.BX.UI=this.BX.UI||{},BX,BX.UI.IconSet,BX.Event,BX.Main);
//# sourceMappingURL=notification-panel.bundle.map.js