Your IP : 3.141.46.108


Current Path : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/landing/node/base/dist/
Upload File :
Current File : /var/www/www-root/data/www/monolith-realty.ru/bitrix/js/landing/node/base/dist/base.bundle.js.map

{"version":3,"file":"base.bundle.js","sources":["../src/base.js"],"sourcesContent":["const isFunction = BX.Landing.Utils.isFunction;\nconst isString = BX.Landing.Utils.isString;\nconst isPlainObject = BX.Landing.Utils.isPlainObject;\nconst isArray = BX.Landing.Utils.isArray;\nconst bind = BX.Landing.Utils.bind;\nconst proxy = BX.Landing.Utils.proxy;\nconst data = BX.Landing.Utils.data;\n\nexport class Base\n{\n\tconstructor(options)\n\t{\n\t\tthis.node = options.node;\n\t\tthis.manifest = isPlainObject(options.manifest) ? options.manifest : {};\n\t\tthis.selector = isString(options.selector) ? options.selector : '';\n\t\tthis.onChangeHandler = isFunction(options.onChange) ? options.onChange : (function() {});\n\t\tthis.onDesignShow = isFunction(options.onDesignShow) ? options.onDesignShow : (function() {});\n\t\tthis.changeOptionsHandler = isFunction(options.onChangeOptions) ? options.onChangeOptions : (function() {});\n\n\t\tthis.onDocumentClick = proxy(this.onDocumentClick, this);\n\t\tthis.onDocumentKeydown = proxy(this.onDocumentKeydown, this);\n\n\t\t// Bind on document events\n\t\tbind(document, 'click', this.onDocumentClick);\n\t\tbind(document, 'keydown', this.onDocumentKeydown);\n\n\t\t// Make manifest as reed only\n\t\tObject.freeze(this.manifest);\n\n\t\t// Add selector attribute\n\t\tthis.node.dataset.selector = this.selector;\n\n\t\tif (this.isAllowInlineEdit())\n\t\t{\n\t\t\tthis.onAllowInlineEdit();\n\t\t}\n\t}\n\n\t/**\n\t * Handles document click event\n\t * @param {MouseEvent} event\n\t */\n\tonDocumentClick(event)\n\t{}\n\n\t/**\n\t * Handles document keydown event\n\t * @param {KeyboardEvent} event\n\t */\n\tonDocumentKeydown(event)\n\t{\n\t\tif (event.keyCode === 27)\n\t\t{\n\t\t\tthis.onEscapePress();\n\t\t}\n\t}\n\n\t/**\n\t * Handles escape press event\n\t */\n\tonEscapePress()\n\t{}\n\n\t/**\n\t * Gets field for editor form\n\t * @abstract\n\t * @return {?BX.Landing.UI.Field.BaseField}\n\t */\n\tgetField()\n\t{\n\t\tthrow new Error('Must be implemented by subclass');\n\t}\n\n\t/**\n\t * Shows node content editor\n\t */\n\tshowEditor()\n\t{}\n\n\t/**\n\t * Hides node content editor\n\t */\n\thideEditor()\n\t{}\n\n\t/**\n\t * Handles allow inline edit event\n\t */\n\tonAllowInlineEdit()\n\t{}\n\n\t/**\n\t * Checks that allow inline edit\n\t * @return {boolean}\n\t */\n\tisAllowInlineEdit()\n\t{\n\t\treturn this.manifest.allowInlineEdit !== false;\n\t}\n\n\t/**\n\t * Checks that this node is grouped\n\t * @return {boolean}\n\t */\n\tisGrouped()\n\t{\n\t\treturn typeof this.manifest.group === 'string' && this.manifest.group.length > 0;\n\t}\n\n\t/**\n\t * Sets node value\n\t * @abstract\n\t * @param {*} value\n\t * @param {?boolean} [preventSave = false]\n\t * @param {?boolean} [preventHistory = false]\n\t * @return void\n\t */\n\tsetValue(value, preventSave, preventHistory)\n\t{\n\t\tthrow new Error('Must be implemented by subclass');\n\t}\n\n\t/**\n\t * Gets value\n\t * @abstract\n\t * @return {string|object}\n\t */\n\tgetValue()\n\t{\n\t\tthrow new Error('Must be implemented by subclass');\n\t}\n\n\t/**\n\t * Gets additional values\n\t * @return {*}\n\t */\n\tgetAdditionalValue()\n\t{\n\t\tif (\n\t\t\tisPlainObject(this.manifest.extend)\n\t\t\t&& isArray(this.manifest.extend.attrs)\n\t\t)\n\t\t{\n\t\t\treturn this.manifest.extend.attrs.reduce((accumulator, key) => {\n\t\t\t\treturn (accumulator[key] = data(this.node, key)), accumulator;\n\t\t\t}, {});\n\t\t}\n\n\t\treturn {};\n\t}\n\n\t/**\n\t * Handles content change event and calls external onChange handler\n\t * @param {?boolean} [preventHistory = false]\n\t */\n\tonChange(preventHistory)\n\t{\n\t\tthis.onChangeHandler.apply(null, [this, preventHistory]);\n\t}\n\n\t/**\n\t * Gets node index\n\t * @return {int}\n\t */\n\tgetIndex()\n\t{\n\t\tlet index = parseInt(this.selector.split('@')[1], 10);\n\t\tindex = index === index ? index : 0;\n\n\t\treturn index;\n\t}\n\n\t/**\n\t * Prevents save\n\t * @param {boolean} value\n\t */\n\tpreventSave(value)\n\t{\n\t\tthis.isSavePreventedValue = value;\n\t}\n\n\t/**\n\t * Checks that save is prevented\n\t * @return {boolean}\n\t */\n\tisSavePrevented()\n\t{\n\t\treturn !!this.isSavePreventedValue;\n\t}\n\n\t/**\n\t * Gets current block\n\t * @return {number|*}\n\t */\n\tgetBlock()\n\t{\n\t\treturn BX.Landing.PageObject.getBlocks().getByChildNode(this.node);\n\t}\n}\n\nBX.Landing.Base = Base;\nBX.Landing.Base.storage = [];\n"],"names":["isFunction","BX","Landing","Utils","isString","isPlainObject","isArray","bind","proxy","data","Base","constructor","options","node","manifest","selector","onChangeHandler","onChange","onDesignShow","changeOptionsHandler","onChangeOptions","onDocumentClick","onDocumentKeydown","document","Object","freeze","dataset","isAllowInlineEdit","onAllowInlineEdit","event","keyCode","onEscapePress","getField","Error","showEditor","hideEditor","allowInlineEdit","isGrouped","group","length","setValue","value","preventSave","preventHistory","getValue","getAdditionalValue","extend","attrs","reduce","accumulator","key","apply","getIndex","index","parseInt","split","isSavePreventedValue","isSavePrevented","getBlock","PageObject","getBlocks","getByChildNode","storage"],"mappings":";;;;;CAAA,MAAMA,UAAU,GAAGC,EAAE,CAACC,OAAO,CAACC,KAAK,CAACH,UAAU;CAC9C,MAAMI,QAAQ,GAAGH,EAAE,CAACC,OAAO,CAACC,KAAK,CAACC,QAAQ;CAC1C,MAAMC,aAAa,GAAGJ,EAAE,CAACC,OAAO,CAACC,KAAK,CAACE,aAAa;CACpD,MAAMC,OAAO,GAAGL,EAAE,CAACC,OAAO,CAACC,KAAK,CAACG,OAAO;CACxC,MAAMC,IAAI,GAAGN,EAAE,CAACC,OAAO,CAACC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