Current Path : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/landing/node/icon/dist/ |
Current File : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/landing/node/icon/dist/icon.bundle.min.js |
this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};(function(t,e,n){"use strict";const i=BX.Landing.Utils.encodeDataValue;const s=BX.Landing.Utils.decodeDataValue;const a=BX.Landing.Utils.data;const o=BX.Landing.Utils.attr;class l extends n.Img{constructor(t){super(t);this.type="icon";this.node.addEventListener("click",this.onClick.bind(this))}getField(){if(this.field){this.field.content=this.getValue()}else{const t=this.getValue();if(t.url){t.url=s(t.url)}const e=!!this.node.closest("a");this.field=new BX.Landing.UI.Field.Icon({selector:this.selector,title:this.manifest.name,disableLink:e,content:t,dimensions:this.manifest.dimensions||{}})}return this.field}setValue(t,e=false,n=false){this.lastValue=this.lastValue||this.getValue();this.preventSave(e);return r(this.node,t).then((()=>{if(t.url){const e=this.preparePseudoUrl(t.url);if(e!==null){o(this.node,"data-pseudo-url",e)}}this.onChange(n);if(!n){BX.Landing.History.getInstance().push()}this.lastValue=this.getValue()}))}getValue(){return{type:"icon",src:"",id:-1,alt:"",classList:c(this.node.className),url:i(d(this))}}onClick(t){BX.Event.EventEmitter.emit("BX.Landing.Node.Icon:onClick")}}BX.Landing.Node.Icon=l;function d(t){const e=a(t.node,"data-pseudo-url");return e||""}function c(t){return t.split(" ")}function r(t,n){return BX.Landing.UI.Panel.IconPanel.getLibraries().then((i=>{i.forEach((n=>{n.categories.forEach((n=>{n.items.forEach((n=>{const i=BX.Type.isObject(n)?n.options.join(" "):n;const s=i.split(" ");s.forEach((n=>{if(n){e.Dom.removeClass(t,n)}}))}))}))}));n.classList.forEach((n=>{e.Dom.addClass(t,n)}))}))}t.Icon=l})(this.BX.Landing.Node=this.BX.Landing.Node||{},BX,BX.Landing.Node); //# sourceMappingURL=icon.bundle.map.js