| Current Path : /var/www/homesaver/www/bitrix/js/ui/vue3/components/popup/dist/ |
| Current File : /var/www/homesaver/www/bitrix/js/ui/vue3/components/popup/dist/popup.bundle.js.map |
{"version":3,"file":"popup.bundle.js","sources":["../src/popup.js"],"sourcesContent":["import { Tag, Text, Type } from 'main.core';\nimport { Popup as MainPopup, type PopupOptions } from 'main.popup';\n\nexport const Popup = {\n\tname: 'Popup',\n\temits: ['close'],\n\tprops: {\n\t\toptions: {\n\t\t\t/** @type PopupOptions */\n\t\t\ttype: Object,\n\t\t\tdefault: {},\n\t\t},\n\t},\n\tdata(): Object {\n\t\treturn {\n\t\t\tisPopupShown: false,\n\t\t\tpopupContentId: `ui-vue3-popup-${Text.getRandom()}`,\n\t\t};\n\t},\n\tpopup: null,\n\tmounted()\n\t{\n\t\tconst eventsFromOptions: PopupOptions['events'] = this.options.events ?? {};\n\n\t\tthis.popup = new MainPopup({\n\t\t\t...this.options,\n\t\t\tcacheable: false,\n\t\t\tcontent: Tag.render`<div id=\"${this.popupContentId}\"></div>`,\n\t\t\tevents: {\n\t\t\t\t...eventsFromOptions,\n\t\t\t\tonPopupShow: (...args) => {\n\t\t\t\t\t// WARNING! Teleport should always be mounted AFTER the target node is rendered in DOM\n\t\t\t\t\tthis.isPopupShown = true;\n\n\t\t\t\t\t// adjust position on page after vue has rendered popup content\n\t\t\t\t\tvoid this.$nextTick(() => {\n\t\t\t\t\t\tthis.popup.adjustPosition();\n\t\t\t\t\t});\n\n\t\t\t\t\tif (Type.isFunction(eventsFromOptions.onPopupShow))\n\t\t\t\t\t{\n\t\t\t\t\t\teventsFromOptions.onPopupShow(...args);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonPopupAfterClose: (...args) => {\n\t\t\t\t\tthis.isPopupShown = false;\n\t\t\t\t\tthis.$emit('close');\n\n\t\t\t\t\tif (Type.isFunction(eventsFromOptions.onPopupAfterClose))\n\t\t\t\t\t{\n\t\t\t\t\t\teventsFromOptions.onPopupAfterClose(...args);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t});\n\n\t\tthis.popup.show();\n\t},\n\tbeforeUnmount()\n\t{\n\t\tthis.popup?.close();\n\t},\n\ttemplate: `\n\t\t<Teleport v-if=\"isPopupShown\" :to=\"'#' + popupContentId\">\n\t\t\t<slot/>\n\t\t</Teleport>\n\t`,\n};\n"],"names":["Popup","name","emits","props","options","type","Object","default","data","isPopupShown","popupContentId","Text","getRandom","popup","mounted","eventsFromOptions","events","MainPopup","cacheable","content","Tag","render","onPopupShow","args","$nextTick","adjustPosition","Type","isFunction","onPopupAfterClose","$emit","show","beforeUnmount","close","template"],"mappings":";;;;;;;;;AAAA,OAGaA,KAAK,GAAG;GACpBC,IAAI,EAAE,OAAO;GACbC,KAAK,EAAE,CAAC,OAAO,CAAC;GAChBC,KAAK,EAAE;KACNC,OAAO,EAAE;;OAERC,IAAI,EAAEC,MAAM;OACZC,OAAO,EAAE;;IAEV;GACDC,IAAI,GAAW;KACd,OAAO;OACNC,YAAY,EAAE,KAAK;OACnBC,cAAc,EAAG,iBAAgBC,cAAI,CAACC,SAAS,EAAG;MAClD;IACD;GACDC,KAAK,EAAE,IAAI;GACXC,OAAO,GACP;KAAA;KACC,MAAMC,iBAAyC,2BAAG,IAAI,CAACX,OAAO,CAACY,MAAM,mCAAI,EAAE;KAE3E,IAAI,CAACH,KAAK,GAAG,IAAII,gBAAS,CAAC;OAC1B,GAAG,IAAI,CAACb,OAAO;OACfc,SAAS,EAAE,KAAK;OAChBC,OAAO,EAAEC,aAAG,CAACC,MAAM,cAAC,YAAS,CAAsB,UAAQ,GAA5B,IAAI,CAACX,cAAc,CAAU;OAC5DM,MAAM,EAAE;SACP,GAAGD,iBAAiB;SACpBO,WAAW,EAAE,CAAC,GAAGC,IAAI,KAAK;;WAEzB,IAAI,CAACd,YAAY,GAAG,IAAI;;;WAGxB,KAAK,IAAI,CAACe,SAAS,CAAC,MAAM;aACzB,IAAI,CAACX,KAAK,CAACY,cAAc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