Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/cvetdv.ru/bitrix/js/im/v2/component/elements/popup/dist/ |
Upload File : |
{"version":3,"file":"popup.bundle.js","sources":["../src/popup.js"],"sourcesContent":["import { Popup, PopupManager, PopupOptions } from 'main.popup';\nimport { Type } from 'main.core';\n\nimport { Logger } from 'im.v2.lib.logger';\n\nconst POPUP_CONTAINER_PREFIX = '#popup-window-content-';\nconst POPUP_BORDER_RADIUS = '10px';\n\n// @vue/component\nexport const MessengerPopup = {\n\tname: 'MessengerPopup',\n\tprops:\n\t{\n\t\tid: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tconfig: {\n\t\t\ttype: Object,\n\t\t\trequired: false,\n\t\t\tdefault(): {} {\n\t\t\t\treturn {};\n\t\t\t},\n\t\t},\n\t},\n\temits: ['close'],\n\tcomputed:\n\t{\n\t\tpopupContainer(): string\n\t\t{\n\t\t\treturn `${POPUP_CONTAINER_PREFIX}${this.id}`;\n\t\t},\n\t},\n\tcreated()\n\t{\n\t\tLogger.warn(`Popup: ${this.id} created`);\n\t\tthis.instance = this.getPopupInstance();\n\t\tthis.instance.show();\n\t},\n\tmounted()\n\t{\n\t\tthis.instance.adjustPosition({\n\t\t\tforceBindPosition: true,\n\t\t\tposition: this.getPopupConfig().bindOptions.position,\n\t\t});\n\t},\n\tbeforeUnmount()\n\t{\n\t\tif (!this.instance)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tthis.closePopup();\n\t},\n\tmethods:\n\t{\n\t\tgetPopupInstance(): Popup\n\t\t{\n\t\t\tif (!this.instance)\n\t\t\t{\n\t\t\t\tPopupManager.getPopupById(this.id)?.destroy();\n\n\t\t\t\tthis.instance = new Popup(this.getPopupConfig());\n\t\t\t}\n\n\t\t\treturn this.instance;\n\t\t},\n\t\tgetDefaultConfig(): PopupOptions\n\t\t{\n\t\t\treturn {\n\t\t\t\tid: this.id,\n\t\t\t\tbindOptions: {\n\t\t\t\t\tposition: 'bottom',\n\t\t\t\t},\n\t\t\t\toffsetTop: 0,\n\t\t\t\toffsetLeft: 0,\n\t\t\t\tclassName: 'bx-im-messenger__scope',\n\t\t\t\tcacheable: false,\n\t\t\t\tcloseIcon: false,\n\t\t\t\tautoHide: true,\n\t\t\t\tcloseByEsc: true,\n\t\t\t\tanimation: 'fading',\n\t\t\t\tevents: {\n\t\t\t\t\tonPopupClose: this.closePopup.bind(this),\n\t\t\t\t\tonPopupDestroy: this.closePopup.bind(this),\n\t\t\t\t},\n\t\t\t\tcontentBorderRadius: POPUP_BORDER_RADIUS,\n\t\t\t};\n\t\t},\n\t\tgetPopupConfig(): Object\n\t\t{\n\t\t\tconst defaultConfig = this.getDefaultConfig();\n\t\t\tconst modifiedOptions = {};\n\n\t\t\tconst defaultClassName = defaultConfig.className;\n\t\t\tif (this.config.className)\n\t\t\t{\n\t\t\t\tmodifiedOptions.className = `${defaultClassName} ${this.config.className}`;\n\t\t\t}\n\n\t\t\tconst offsetTop = this.config.offsetTop ?? defaultConfig.offsetTop;\n\t\t\t// adjust for default popup margin for shadow\n\t\t\tif (this.config.bindOptions?.position === 'top' && Type.isNumber(this.config.offsetTop))\n\t\t\t{\n\t\t\t\tmodifiedOptions.offsetTop = offsetTop - 10;\n\t\t\t}\n\n\t\t\treturn { ...defaultConfig, ...this.config, ...modifiedOptions };\n\t\t},\n\t\tclosePopup()\n\t\t{\n\t\t\tLogger.warn(`Popup: ${this.id} closing`);\n\t\t\tthis.$emit('close');\n\t\t\tthis.instance.destroy();\n\t\t\tthis.instance = null;\n\t\t},\n\t\tenableAutoHide()\n\t\t{\n\t\t\tthis.getPopupInstance().setAutoHide(true);\n\t\t},\n\t\tdisableAutoHide()\n\t\t{\n\t\t\tthis.getPopupInstance().setAutoHide(false);\n\t\t},\n\t\tadjustPosition()\n\t\t{\n\t\t\tthis.getPopupInstance().adjustPosition({\n\t\t\t\tforceBindPosition: true,\n\t\t\t\tposition: this.getPopupConfig().bindOptions.position,\n\t\t\t});\n\t\t},\n\t},\n\ttemplate: `\n\t\t<Teleport :to=\"popupContainer\">\n\t\t\t<slot\n\t\t\t\t:adjustPosition=\"adjustPosition\"\n\t\t\t\t:enableAutoHide=\"enableAutoHide\"\n\t\t\t\t:disableAutoHide=\"disableAutoHide\"\n\t\t\t></slot>\n\t\t</Teleport>\n\t`,\n};\n"],"names":["POPUP_CONTAINER_PREFIX","POPUP_BORDER_RADIUS","MessengerPopup","name","props","id","type","String","required","config","Object","default","emits","computed","popupContainer","created","Logger","warn","instance","getPopupInstance","show","mounted","adjustPosition","forceBindPosition","position","getPopupConfig","bindOptions","beforeUnmount","closePopup","methods","PopupManager","getPopupById","destroy","Popup","getDefaultConfig","offsetTop","offsetLeft","className","cacheable","closeIcon","autoHide","closeByEsc","animation","events","onPopupClose","bind","onPopupDestroy","contentBorderRadius","defaultConfig","modifiedOptions","defaultClassName","Type","isNumber","$emit","enableAutoHide","setAutoHide","disableAutoHide","template"],"mappings":";;;;;;;;CAKA,MAAMA,sBAAsB,GAAG,wBAAwB;CACvD,MAAMC,mBAAmB,GAAG,MAAM;;CAElC;AACA,OAAaC,cAAc,GAAG;GAC7BC,IAAI,EAAE,gBAAgB;GACtBC,KAAK,EACL;KACCC,EAAE,EAAE;OACHC,IAAI,EAAEC,MAAM;OACZC,QAAQ,EAAE;MACV;KACDC,MAAM,EAAE;OACPH,IAAI,EAAEI,MAAM;OACZF,QAAQ,EAAE,KAAK;OACfG,OAAO,GAAO;SACb,OAAO,EAAE;;;IAGX;GACDC,KAAK,EAAE,CAAC,OAAO,CAAC;GAChBC,QAAQ,EACR;KACCC,cAAc,GACd;OACC,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