Your IP : 172.71.120.3


Current Path : /var/www/element/data/www/revenuestory.ru/bitrix/js/landing/node/dist/
Upload File :
Current File : /var/www/element/data/www/revenuestory.ru/bitrix/js/landing/node/dist/node.bundle.js.map

{"version":3,"file":"node.bundle.js","sources":["../src/node.js"],"sourcesContent":["import {Type} from 'main.core';\n\nexport class Node\n{\n\tconstructor()\n\t{\n\t\tvar isFunction = BX.Landing.Utils.isFunction;\n\t\tvar isString = BX.Landing.Utils.isString;\n\t\tvar isPlainObject = BX.Landing.Utils.isPlainObject;\n\t\tvar isArray = BX.Landing.Utils.isArray;\n\t\tvar bind = BX.Landing.Utils.bind;\n\t\tvar proxy = BX.Landing.Utils.proxy;\n\t\tvar data = BX.Landing.Utils.data;\n\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\tonDocumentClick(event)\n\t{\n\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\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\n\t/**\n\t * Hides node content editor\n\t */\n\thideEditor()\n\t{\n\n\t}\n\n\t/**\n\t * Handles allow inline edit event\n\t */\n\tonAllowInlineEdit()\n\t{\n\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 */\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 (isPlainObject(this.manifest.extend) &&\n\t\t\tisArray(this.manifest.extend.attrs))\n\t\t{\n\t\t\treturn this.manifest.extend.attrs.reduce(function(accumulator, key) {\n\t\t\t\treturn (accumulator[key] = data(this.node, key)), accumulator;\n\t\t\t}.bind(this), {});\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 */\n\tonChange()\n\t{\n\t\tthis.onChangeHandler.apply(null, [this]);\n\t}\n\n\t/**\n\t * Gets node index\n\t * @return {int}\n\t */\n\tgetIndex()\n\t{\n\t\tvar index = parseInt(this.selector.split(\"@\")[1]);\n\t\tindex = index === index ? index : 0;\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}"],"names":["Node","constructor","isFunction","BX","Landing","Utils","isString","isPlainObject","isArray","bind","proxy","data","node","options","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"],"mappings":";;;;CAEO,MAAMA,IAAN,CACP;CACCC,EAAAA,WAAW,GACX;CACC,QAAIC,UAAU,GAAGC,EAAE,CAACC,OAAH,CAAWC,KAAX,CAAiBH,UAAlC;CACA,QAAII,QAAQ,GAAGH,EAAE,CAACC,OAAH,CAAWC,KAAX,CAAiBC,QAAhC;CACA,QAAIC,aAAa,GAAGJ,EAAE,CAACC,OAAH,CAAWC,KAAX,CAAiBE,aAArC;CACA,QAAIC,OAAO,GAAGL,EAAE,CAACC,OAAH,CAAWC,KAAX,CAAiBG,OAA/B;CACA,QAAIC,IAAI,GAAGN,EAAE,CAACC,OAAH,CAAWC,KAAX,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