Current Path : /var/www/www-root/data/www/info.monolith-realty.ru/bitrix/js/ui/tabs/dist/ |
Current File : /var/www/www-root/data/www/info.monolith-realty.ru/bitrix/js/ui/tabs/dist/tabs.bundle.min.js |
this.BX=this.BX||{};(function(e,t,a,i,l){"use strict";var s,r,n,b,d;function o(e,t){v(e,t);t.add(e)}function c(e,t,a){v(e,t);t.set(e,a)}function v(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function p(e,t,a){if(!t.has(e)){throw new TypeError("attempted to get private field on non-instance")}return a}var u={localId:0,localSorting:0};var h=new WeakMap;var H=new WeakMap;var f=new WeakMap;var T=new WeakMap;var P=new WeakMap;var F=new WeakMap;var g=new WeakMap;var I=new WeakMap;var m=new WeakMap;var y=new WeakMap;var w=new WeakMap;var k=new WeakSet;var G=new WeakSet;var z=new WeakSet;var S=new WeakSet;var C=new WeakSet;var _=function(e){babelHelpers.inherits(t,e);function t(e){var i;var l=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;babelHelpers.classCallCheck(this,t);i=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,{}));o(babelHelpers.assertThisInitialized(i),C);o(babelHelpers.assertThisInitialized(i),S);o(babelHelpers.assertThisInitialized(i),z);o(babelHelpers.assertThisInitialized(i),G);o(babelHelpers.assertThisInitialized(i),k);c(babelHelpers.assertThisInitialized(i),h,{writable:true,value:void 0});c(babelHelpers.assertThisInitialized(i),H,{writable:true,value:void 0});c(babelHelpers.assertThisInitialized(i),f,{writable:true,value:0});c(babelHelpers.assertThisInitialized(i),T,{writable:true,value:void 0});c(babelHelpers.assertThisInitialized(i),P,{writable:true,value:void 0});c(babelHelpers.assertThisInitialized(i),F,{writable:true,value:void 0});c(babelHelpers.assertThisInitialized(i),g,{writable:true,value:false});c(babelHelpers.assertThisInitialized(i),I,{writable:true,value:true});c(babelHelpers.assertThisInitialized(i),m,{writable:true,value:null});c(babelHelpers.assertThisInitialized(i),y,{writable:true,value:null});c(babelHelpers.assertThisInitialized(i),w,{writable:true,value:null});i.setEventNamespace("UI:Tabs:");i.setParent(l);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(i),H,a.Type.isStringFilled(e.id)?e.id:"TabId"+ ++u.localId);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(i),f,a.Type.isInteger(e.sort)?e.sort:++u.localSorting);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(i),g,a.Type.isBoolean(e.active)?e.active:false);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(i),I,e.restricted===true);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(i),m,a.Type.isStringFilled(e.bannerCode)?e.bannerCode:null);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(i),y,a.Type.isStringFilled(e.helpDeskCode)?e.helpDeskCode:null);p(babelHelpers.assertThisInitialized(i),k,B).call(babelHelpers.assertThisInitialized(i),e.head);p(babelHelpers.assertThisInitialized(i),G,D).call(babelHelpers.assertThisInitialized(i),e.body);return i}babelHelpers.createClass(t,[{key:"getId",value:function e(){return babelHelpers.classPrivateFieldGet(this,H)}},{key:"getSort",value:function e(){return babelHelpers.classPrivateFieldGet(this,f)}},{key:"setParent",value:function e(t){if(t instanceof J){babelHelpers.classPrivateFieldSet(this,h,t)}}},{key:"isRestricted",value:function e(){return babelHelpers.classPrivateFieldGet(this,I)}},{key:"getBannerCode",value:function e(){return babelHelpers.classPrivateFieldGet(this,m)}},{key:"showBanner",value:function e(t){if(this.getBannerCode()){BX.UI.InfoHelper.show(this.getBannerCode())}if(t){t.stopPropagation();t.preventDefault()}}},{key:"getHeader",value:function e(){return babelHelpers.classPrivateFieldGet(this,T)}},{key:"getBody",value:function e(){return babelHelpers.classPrivateFieldGet(this,P)}},{key:"getBodyDataContainer",value:function e(){return babelHelpers.classPrivateFieldGet(this,F)}},{key:"inactivate",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;a.Dom.removeClass(babelHelpers.classPrivateFieldGet(this,P),"ui-tabs__tab-active-animation");if(t!==false){a.Dom.addClass(babelHelpers.classPrivateFieldGet(this,P),"ui-tabs__tab-active-animation")}if(babelHelpers.classPrivateFieldGet(this,g)===true){a.Dom.removeClass(babelHelpers.classPrivateFieldGet(this,T),"--header-active");a.Dom.removeClass(babelHelpers.classPrivateFieldGet(this,P),"--body-active");babelHelpers.classPrivateFieldSet(this,g,false);this.emit("onInactive")}return this}},{key:"activate",value:function e(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;a.Dom.removeClass(babelHelpers.classPrivateFieldGet(this,P),"ui-tabs__tab-active-animation");if(t!==false){a.Dom.addClass(babelHelpers.classPrivateFieldGet(this,P),"ui-tabs__tab-active-animation")}if(babelHelpers.classPrivateFieldGet(this,g)!==true){a.Dom.addClass(babelHelpers.classPrivateFieldGet(this,T),"--header-active");a.Dom.addClass(babelHelpers.classPrivateFieldGet(this,P),"--body-active");babelHelpers.classPrivateFieldSet(this,g,true);this.emit("onActive")}return this}},{key:"isActive",value:function e(){return babelHelpers.classPrivateFieldGet(this,g)}},{key:"showError",value:function e(t){var i=t.message,l=t.code;var s=this.getBody().querySelector('[data-bx-role="error-container"]');if(s){s.innerText=i||l}a.Dom.addClass(this.getBodyContainer(),"ui-avatar-editor--error")}}]);return t}(i.EventEmitter);function B(e){var t,i=this;var l=a.Type.isPlainObject(e)?e:a.Type.isStringFilled(e)?{title:e}:{};var b;if(a.Type.isDomNode(e)){b=e}else if(babelHelpers.classPrivateFieldGet(this,I)!==true){var d,o;b=a.Tag.render(s||(s=babelHelpers.taggedTemplateLiteral(['<div title="','">',"</div>"])),a.Text.encode((d=l.description)!==null&&d!==void 0?d:""),(o=a.Text.encode(l.title))!==null&&o!==void 0?o:" ")}else{var c;b=a.Tag.render(r||(r=babelHelpers.taggedTemplateLiteral(['<div class="ui-tabs__tab-header-container-inner" title="','">\n\t\t\t\t<div class="ui-tabs__tab-header-container-inner-title">','</div>\n\t\t\t\t<div class="ui-tabs__tab-header-container-inner-lockbox"><span class="ui-icon-set --lock field-has-lock"></span></div>\n\t\t\t</div>'])),a.Text.encode((c=l.description)!==null&&c!==void 0?c:""),a.Text.encode(l.title));a.Event.bind(b,"click",this.showBanner.bind(this))}babelHelpers.classPrivateFieldSet(this,T,a.Tag.render(n||(n=babelHelpers.taggedTemplateLiteral(['<span class="ui-tabs__tab-header-container ','" data-bx-role="tab-header" data-bx-name="','">',"</span>"])),a.Text.encode((t=l.className)!==null&&t!==void 0?t:""),a.Text.encode(babelHelpers.classPrivateFieldGet(this,H)),b));a.Event.bind(babelHelpers.classPrivateFieldGet(this,T),"click",(function(){i.emit("changeTab")}))}function D(e){var t=this;babelHelpers.classPrivateFieldSet(this,F,a.Tag.render(b||(b=babelHelpers.taggedTemplateLiteral(['<div class="ui-tabs__tab-body_data"></div>']))));babelHelpers.classPrivateFieldSet(this,P,a.Tag.render(d||(d=babelHelpers.taggedTemplateLiteral(['<div class="ui-tabs__tab-body_inner"></div>']))));babelHelpers.classPrivateFieldGet(this,P).dataset.id=babelHelpers.classPrivateFieldGet(this,H);babelHelpers.classPrivateFieldGet(this,P).dataset.role="body";babelHelpers.classPrivateFieldGet(this,P).appendChild(babelHelpers.classPrivateFieldGet(this,F));if(e){this.subscribe("onActive",(function(){p(t,z,W).call(t,e)}))}}function W(e){var t=this;var i=e;if(a.Type.isFunction(e)){i=e(this)}var l;if(!i||Object.prototype.toString.call(i)==="[object Promise]"||i.toString()==="[object BX.Promise]"){l=i;p(this,S,M).call(this)}else{l=Promise.resolve(i)}l.then((function(e){p(t,C,E).call(t);if(a.Type.isDomNode(e)){babelHelpers.classPrivateFieldGet(t,F).appendChild(e)}else if(a.Type.isString(e)){babelHelpers.classPrivateFieldGet(t,F).innerHTML=e}else{throw new Error("Tab body has to be a text or a dom-element.")}t.emit("onLoad")}),(function(e){console.log("reason: ",e);p(t,C,E).call(t);babelHelpers.classPrivateFieldGet(t,F).innerHTML=e;t.emit("onLoadErrored")}))}function M(){babelHelpers.classPrivateFieldSet(this,w,new l.Loader({target:babelHelpers.classPrivateFieldGet(this,F),color:"rgba(82, 92, 105, 0.9)",mode:"inline"}));babelHelpers.classPrivateFieldGet(this,w).show().then((function(){console.log("The loader is shown")}))}function E(){if(babelHelpers.classPrivateFieldGet(this,w)){babelHelpers.classPrivateFieldGet(this,w).destroy();babelHelpers.classPrivateFieldSet(this,w,null)}}var x,L;function X(e,t,a){j(e,t);t.set(e,a)}function j(e,t){if(t.has(e)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}var A={localId:0};var O=new WeakMap;var N=new WeakMap;var U=new WeakMap;var R=new WeakMap;var q=new WeakMap;var J=function(e){babelHelpers.inherits(i,e);function i(e){var l;var s;babelHelpers.classCallCheck(this,i);s=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(i).call(this));X(babelHelpers.assertThisInitialized(s),O,{writable:true,value:void 0});X(babelHelpers.assertThisInitialized(s),N,{writable:true,value:void 0});X(babelHelpers.assertThisInitialized(s),U,{writable:true,value:void 0});X(babelHelpers.assertThisInitialized(s),R,{writable:true,value:null});X(babelHelpers.assertThisInitialized(s),q,{writable:true,value:void 0});e=a.Type.isObjectLike(e)?e:{};babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),O,++A.localId);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),N,a.Type.isStringFilled(e.id)?e.id:"TabsId"+babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),O));s.setEventNamespace("UI:Tabs:"+e.id);babelHelpers.classPrivateFieldSet(babelHelpers.assertThisInitialized(s),U,new t.OrderedArray((function(e,t){return e.getSort()>t.getSort()?1:-1})));Array.from((l=e.items)!==null&&l!==void 0?l:[]).forEach((function(e){return s.addItem(new _(e))}));s.activateItemDebounced=a.Runtime.debounce(s.activateItemDebounced,100,babelHelpers.assertThisInitialized(s));if(babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),U).count()>0&&!(babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),R)instanceof _)){s.activateItem(babelHelpers.classPrivateFieldGet(babelHelpers.assertThisInitialized(s),U).getFirst())}return s}babelHelpers.createClass(i,[{key:"getIndex",value:function e(){return babelHelpers.classPrivateFieldGet(this,O)}},{key:"getId",value:function e(){return babelHelpers.classPrivateFieldGet(this,N)}},{key:"addItem",value:function e(t){var a=this;babelHelpers.classPrivateFieldGet(this,U).add(t);t.setParent(this);if(t.isActive()){this.activateItem(t)}t.subscribe("changeTab",(function(){a.activateItem(t)}))}},{key:"activateItem",value:function e(t){var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;if(babelHelpers.classPrivateFieldGet(this,U).has(t)&&babelHelpers.classPrivateFieldGet(this,R)!==t){var i=null;if(babelHelpers.classPrivateFieldGet(this,R)instanceof _){i=babelHelpers.classPrivateFieldGet(this,R)}babelHelpers.classPrivateFieldSet(this,R,t);this.activateItemDebounced(t,i,a)}}},{key:"activateItemDebounced",value:function e(t){var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var i=arguments.length>2&&arguments[2]!==undefined?arguments[2]:true;if(a){a.inactivate(i)}t.activate(i)}},{key:"getBodyContainer",value:function e(){if(!babelHelpers.classPrivateFieldGet(this,q)){babelHelpers.classPrivateFieldSet(this,q,a.Tag.render(x||(x=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-tabs__tabs-body-container" data-bx-role="bodies"></div>\n\t\t\t']))))}return babelHelpers.classPrivateFieldGet(this,q)}},{key:"getContainer",value:function e(){var t=this;if(this.content){return this.content}this.content=a.Tag.render(L||(L=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="ui-tabs__tabs-container">\n\t\t\t\t<div class="ui-tabs__tabs-header-container" data-bx-role="headers"></div>\n\t\t\t\t',"\n\t\t\t</div>"])),this.getBodyContainer());var i=this.content.querySelector('[data-bx-role="headers"]');babelHelpers.classPrivateFieldGet(this,U).forEach((function(e){a.Dom.append(e.getHeader(),i);a.Dom.append(e.getBody(),t.getBodyContainer())}));return this.content}},{key:"getItems",value:function e(){return babelHelpers.classPrivateFieldGet(this,U)}}]);return i}(i.EventEmitter);e.Tabs=J;e.Tab=_})(this.BX.UI=this.BX.UI||{},BX.Collections,BX,BX.Event,BX); //# sourceMappingURL=tabs.bundle.map.js