File manager - Edit - /home/web/vm-3fadc827.na4u.ru/www/bitrix/modules/ui/install/js/ui/counterpanel/dist/counterpanel.bundle.min.js
Back
this.BX=this.BX||{};(function(t,e,i,n){"use strict";var s,a,l,r;function o(t,e){c(t,e);e.add(t)}function c(t,e){if(e.has(t)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function u(t,e,i){if(!e.has(t)){throw new TypeError("attempted to get private field on non-instance")}return i}var h=new WeakSet;var v=new WeakSet;var d=new WeakSet;var f=new WeakSet;var p=new WeakSet;var m=new WeakSet;var y=new WeakSet;var g=function(){function t(i){babelHelpers.classCallCheck(this,t);o(this,y);o(this,m);o(this,p);o(this,f);o(this,d);o(this,v);o(this,h);this.id=i.id;this.title=e.Type.isString(i.title)?i.title:null;this.value=e.Type.isNumber(i.value)?i.value:null;this.color=e.Type.isString(i.color)?i.color:null;this.eventsForActive=e.Type.isObject(i.eventsForActive)?i.eventsForActive:null;this.eventsForUnActive=e.Type.isObject(i.eventsForUnActive)?i.eventsForUnActive:null;this.panel=i.panel?i.panel:null;this.layout={container:null,value:null,title:null,cross:null};this.counter=null;this.isActive=false;if(!u(this,v,b).call(this).isMultiselect()){u(this,h,C).call(this)}}babelHelpers.createClass(t,[{key:"updateValue",value:function t(i){if(e.Type.isNumber(i)){this.value=i;u(this,d,T).call(this).update(i);u(this,d,T).call(this).show();if(i===0){this.updateColor("THEME")}}}},{key:"updateColor",value:function t(n){if(e.Type.isString(n)){this.color=n;u(this,d,T).call(this).setColor(i.Counter.Color[n])}}},{key:"activate",value:function t(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;this.isActive=true;this.getContainer().classList.add("--active");if(e){n.EventEmitter.emit("BX.UI.CounterPanel.Item:activate",this)}}},{key:"deactivate",value:function t(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:true;this.isActive=false;this.getContainer().classList.remove("--active");this.getContainer().classList.remove("--hover");if(e){n.EventEmitter.emit("BX.UI.CounterPanel.Item:deactivate",this)}}},{key:"getContainer",value:function t(){var i=this;if(!this.layout.container){this.layout.container=e.Tag.render(s||(s=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-counter-panel__item">\n\t\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t\t","\n\t\t\t\t</div>\n\t\t\t"])),u(this,f,k).call(this),this.title?u(this,p,A).call(this):"",u(this,m,w).call(this));u(this,y,E).call(this);this.layout.container.addEventListener("mouseenter",(function(){if(!i.isActive){i.layout.container.classList.add("--hover")}}));this.layout.container.addEventListener("mouseleave",(function(){if(!i.isActive){i.layout.container.classList.remove("--hover")}}));this.layout.container.addEventListener("click",(function(){i.isActive?i.deactivate():i.activate()}))}return this.layout.container}}]);return t}();function C(){var t=this;n.EventEmitter.subscribe("BX.UI.CounterPanel.Item:activate",(function(e){if(e.data!==t){t.deactivate()}}))}function b(){return this.panel}function T(){if(!this.counter){this.counter=new i.Counter({value:this.value?this.value:0,color:this.color?i.Counter.Color[this.color]:i.Counter.Color.THEME,animation:true})}return this.counter}function k(){if(!this.layout.value){this.layout.value=e.Tag.render(a||(a=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-counter-panel__item-value">\n\t\t\t\t\t',"\n\t\t\t\t</div>\n\t\t\t"])),u(this,d,T).call(this).getContainer())}return this.layout.value}function A(){if(!this.layout.title){this.layout.title=e.Tag.render(l||(l=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-counter-panel__item-title">',"</div>\n\t\t\t"])),this.title)}return this.layout.title}function w(){if(!this.layout.cross){this.layout.cross=e.Tag.render(r||(r=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-counter-panel__item-cross">\n\t\t\t\t\t<div class="ui-counter-panel__item-cross--icon"></div>\n\t\t\t\t</div>\n\t\t\t'])))}return this.layout.cross}function E(){var t=this;if(this.eventsForActive){var e=Object.keys(this.eventsForActive);var i=function i(n){var s=e[n];t.getContainer().addEventListener(s,(function(){if(t.isActive){t.eventsForActive[s]()}}))};for(var n=0;n<e.length;n++){i(n)}}if(this.eventsForUnActive){var s=Object.keys(this.eventsForUnActive);var a=function e(i){var n=s[i];t.getContainer().addEventListener(n,(function(){if(!t.isActive){t.eventsForUnActive[n]()}}))};for(var l=0;l<s.length;l++){a(l)}}}var F,I;function L(t,e){U(t,e);e.add(t)}function U(t,e){if(e.has(t)){throw new TypeError("Cannot initialize the same private elements twice on an object")}}function _(t,e,i){if(!e.has(t)){throw new TypeError("attempted to get private field on non-instance")}return i}var B=new WeakSet;var S=new WeakSet;var H=new WeakSet;var W=function(){function t(i){babelHelpers.classCallCheck(this,t);L(this,H);L(this,S);L(this,B);this.target=e.Type.isDomNode(i.target)?i.target:null;this.items=e.Type.isArray(i.items)?i.items:[];this.multiselect=e.Type.isBoolean(i.multiselect)?i.multiselect:null;this.container=null;this.keys=[]}babelHelpers.createClass(t,[{key:"isMultiselect",value:function t(){return this.multiselect}},{key:"getItems",value:function t(){return this.items}},{key:"getItemById",value:function t(e){if(e){var i=this.keys.indexOf(e);return this.items[i]}}},{key:"init",value:function t(){_(this,B,X).call(this);_(this,H,O).call(this)}}]);return t}();function X(){var t=this;this.items=this.items.map((function(e){t.keys.push(e.id);return new g({id:e.id?e.id:null,title:e.title?e.title:null,value:e.value?parseInt(e.value,10):null,cross:e.cross?e.cross:null,color:e.color?e.color:null,eventsForActive:e.eventsForActive?e.eventsForActive:null,eventsForUnActive:e.eventsForUnActive?e.eventsForUnActive:null,panel:t})}));this.getItemById()}function j(){if(!this.container){this.container=e.Tag.render(F||(F=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-counter-panel ui-counter-panel__scope"></div>\n\t\t\t'])))}return this.container}function O(){var t=this;if(this.target&&this.items.length>0){this.items.map((function(i,n){if(i instanceof g){_(t,S,j).call(t).appendChild(i.getContainer());if(t.items.length!==n+1&&t.items.length>1){_(t,S,j).call(t).appendChild(e.Tag.render(I||(I=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t\t\t\t<div class="ui-counter-panel__item-separator"></div>\n\t\t\t\t\t\t']))))}}}));e.Dom.clean(this.target);this.target.appendChild(_(this,S,j).call(this))}}t.CounterPanel=W;t.CounterItem=g})(this.BX.UI=this.BX.UI||{},BX,BX.UI,BX.Event); //# sourceMappingURL=counterpanel.bundle.map.js
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.26 |
proxy
|
phpinfo
|
Settings