Current Path : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/landing/node/base/dist/ |
Current File : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/landing/node/base/dist/base.bundle.min.js |
this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};(function(n){"use strict";const e=BX.Landing.Utils.isFunction;const t=BX.Landing.Utils.isString;const i=BX.Landing.Utils.isPlainObject;const s=BX.Landing.Utils.isArray;const o=BX.Landing.Utils.bind;const a=BX.Landing.Utils.proxy;const l=BX.Landing.Utils.data;class d{constructor(n){this.node=n.node;this.manifest=i(n.manifest)?n.manifest:{};this.selector=t(n.selector)?n.selector:"";this.onChangeHandler=e(n.onChange)?n.onChange:function(){};this.onDesignShow=e(n.onDesignShow)?n.onDesignShow:function(){};this.changeOptionsHandler=e(n.onChangeOptions)?n.onChangeOptions:function(){};this.onDocumentClick=a(this.onDocumentClick,this);this.onDocumentKeydown=a(this.onDocumentKeydown,this);o(document,"click",this.onDocumentClick);o(document,"keydown",this.onDocumentKeydown);Object.freeze(this.manifest);this.node.dataset.selector=this.selector;if(this.isAllowInlineEdit()){this.onAllowInlineEdit()}}onDocumentClick(n){}onDocumentKeydown(n){if(n.keyCode===27){this.onEscapePress()}}onEscapePress(){}getField(){throw new Error("Must be implemented by subclass")}showEditor(){}hideEditor(){}onAllowInlineEdit(){}isAllowInlineEdit(){return this.manifest.allowInlineEdit!==false}isGrouped(){return typeof this.manifest.group==="string"&&this.manifest.group.length>0}setValue(n,e,t){throw new Error("Must be implemented by subclass")}getValue(){throw new Error("Must be implemented by subclass")}getAdditionalValue(){if(i(this.manifest.extend)&&s(this.manifest.extend.attrs)){return this.manifest.extend.attrs.reduce(((n,e)=>(n[e]=l(this.node,e),n)),{})}return{}}onChange(n){this.onChangeHandler.apply(null,[this,n])}getIndex(){let n=parseInt(this.selector.split("@")[1],10);n=n===n?n:0;return n}preventSave(n){this.isSavePreventedValue=n}isSavePrevented(){return!!this.isSavePreventedValue}getBlock(){return BX.Landing.PageObject.getBlocks().getByChildNode(this.node)}}BX.Landing.Base=d;BX.Landing.Base.storage=[];n.Base=d})(this.BX.Landing.Node=this.BX.Landing.Node||{}); //# sourceMappingURL=base.bundle.map.js