@topvisor/ui 1.5.1-topRegionSelector.4 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.chunks/{api-a3D-SXH-.amd.js → api-B10YYgLm.amd.js} +2 -2
- package/.chunks/{api-a3D-SXH-.amd.js.map → api-B10YYgLm.amd.js.map} +1 -1
- package/.chunks/{api-a3D-SXH-.esm.js → api-B10YYgLm.esm.js} +2 -2
- package/.chunks/{api-a3D-SXH-.esm.js.map → api-B10YYgLm.esm.js.map} +1 -1
- package/.chunks/{app-B8VpVm8U.amd.js → app-BCUpND3O.amd.js} +2 -2
- package/.chunks/app-BCUpND3O.amd.js.map +1 -0
- package/.chunks/{app-B8VpVm8U.esm.js → app-BCUpND3O.esm.js} +7 -7
- package/.chunks/app-BCUpND3O.esm.js.map +1 -0
- package/.chunks/{datepicker-DuOSAFQy.amd.js → datepicker-LevMEoIA.amd.js} +2 -2
- package/.chunks/{datepicker-DuOSAFQy.amd.js.map → datepicker-LevMEoIA.amd.js.map} +1 -1
- package/.chunks/{datepicker-DuOSAFQy.esm.js → datepicker-LevMEoIA.esm.js} +2 -2
- package/.chunks/{datepicker-DuOSAFQy.esm.js.map → datepicker-LevMEoIA.esm.js.map} +1 -1
- package/.chunks/{dialog-ClCAM1nI.amd.js → dialog-DiALIK6w.amd.js} +2 -2
- package/.chunks/{dialog-ClCAM1nI.amd.js.map → dialog-DiALIK6w.amd.js.map} +1 -1
- package/.chunks/{dialog-ClCAM1nI.esm.js → dialog-DiALIK6w.esm.js} +4 -4
- package/.chunks/{dialog-ClCAM1nI.esm.js.map → dialog-DiALIK6w.esm.js.map} +1 -1
- package/.chunks/{dialog_regionSelectorRegions-DFZTiYi6.amd.js → dialog_regionSelectorRegions-Bs7v6bLi.amd.js} +2 -2
- package/.chunks/{dialog_regionSelectorRegions-DFZTiYi6.amd.js.map → dialog_regionSelectorRegions-Bs7v6bLi.amd.js.map} +1 -1
- package/.chunks/{dialog_regionSelectorRegions-DFZTiYi6.esm.js → dialog_regionSelectorRegions-Bs7v6bLi.esm.js} +5 -5
- package/.chunks/{dialog_regionSelectorRegions-DFZTiYi6.esm.js.map → dialog_regionSelectorRegions-Bs7v6bLi.esm.js.map} +1 -1
- package/.chunks/{dialogs-CjrddGh6.amd.js → dialogs-dXQrzbvl.amd.js} +2 -2
- package/.chunks/{dialogs-CjrddGh6.amd.js.map → dialogs-dXQrzbvl.amd.js.map} +1 -1
- package/.chunks/{dialogs-CjrddGh6.esm.js → dialogs-dXQrzbvl.esm.js} +3 -3
- package/.chunks/{dialogs-CjrddGh6.esm.js.map → dialogs-dXQrzbvl.esm.js.map} +1 -1
- package/.chunks/{forms-C2ItFa61.amd.js → forms-Dh7-1Uy3.amd.js} +2 -2
- package/.chunks/{forms-C2ItFa61.amd.js.map → forms-Dh7-1Uy3.amd.js.map} +1 -1
- package/.chunks/{forms-C2ItFa61.esm.js → forms-Dh7-1Uy3.esm.js} +7 -7
- package/.chunks/forms-Dh7-1Uy3.esm.js.map +1 -0
- package/.chunks/{formsExt-6Nz907Ry.amd.js → formsExt-Cq-kiHyl.amd.js} +2 -2
- package/.chunks/{formsExt-6Nz907Ry.amd.js.map → formsExt-Cq-kiHyl.amd.js.map} +1 -1
- package/.chunks/{formsExt-6Nz907Ry.esm.js → formsExt-Cq-kiHyl.esm.js} +4 -4
- package/.chunks/{formsExt-6Nz907Ry.esm.js.map → formsExt-Cq-kiHyl.esm.js.map} +1 -1
- package/.chunks/{notice-CBJBDgby.amd.js → notice-DM-e_WCY.amd.js} +2 -2
- package/.chunks/{notice-CBJBDgby.amd.js.map → notice-DM-e_WCY.amd.js.map} +1 -1
- package/.chunks/{notice-CBJBDgby.esm.js → notice-DM-e_WCY.esm.js} +2 -2
- package/.chunks/{notice-CBJBDgby.esm.js.map → notice-DM-e_WCY.esm.js.map} +1 -1
- package/.chunks/{popup-CFYtl5_r.amd.js → popup-CsWaer8b.amd.js} +2 -2
- package/.chunks/{popup-CFYtl5_r.amd.js.map → popup-CsWaer8b.amd.js.map} +1 -1
- package/.chunks/{popup-CFYtl5_r.esm.js → popup-CsWaer8b.esm.js} +3 -3
- package/.chunks/{popup-CFYtl5_r.esm.js.map → popup-CsWaer8b.esm.js.map} +1 -1
- package/.chunks/{popup-B06vbv6B.amd.js → popup-vNj9Xmym.amd.js} +2 -2
- package/.chunks/{popup-B06vbv6B.amd.js.map → popup-vNj9Xmym.amd.js.map} +1 -1
- package/.chunks/{popup-B06vbv6B.esm.js → popup-vNj9Xmym.esm.js} +3 -3
- package/.chunks/{popup-B06vbv6B.esm.js.map → popup-vNj9Xmym.esm.js.map} +1 -1
- package/.chunks/{utils-DJV2mWZE.amd.js → utils-C92VWjGL.amd.js} +2 -2
- package/.chunks/{utils-DJV2mWZE.amd.js.map → utils-C92VWjGL.amd.js.map} +1 -1
- package/.chunks/{utils-DJV2mWZE.esm.js → utils-C92VWjGL.esm.js} +4 -4
- package/.chunks/{utils-DJV2mWZE.esm.js.map → utils-C92VWjGL.esm.js.map} +1 -1
- package/.chunks/{utils-BTHruVpQ.amd.js → utils-p44qUhkI.amd.js} +2 -2
- package/.chunks/{utils-BTHruVpQ.amd.js.map → utils-p44qUhkI.amd.js.map} +1 -1
- package/.chunks/{utils-BTHruVpQ.esm.js → utils-p44qUhkI.esm.js} +3 -3
- package/.chunks/{utils-BTHruVpQ.esm.js.map → utils-p44qUhkI.esm.js.map} +1 -1
- package/.chunks/{worker-BIUaZFVX.amd.js → worker-BcZMXB0d.amd.js} +2 -2
- package/.chunks/{worker-BIUaZFVX.amd.js.map → worker-BcZMXB0d.amd.js.map} +1 -1
- package/.chunks/{worker-BIUaZFVX.esm.js → worker-BcZMXB0d.esm.js} +3 -3
- package/.chunks/{worker-BIUaZFVX.esm.js.map → worker-BcZMXB0d.esm.js.map} +1 -1
- package/api/index.amd.js +1 -1
- package/api/index.amd.js.map +1 -1
- package/api/index.js +1 -1
- package/autoload-css-manifest.amd.json +4 -4
- package/autoload-css-manifest.json +4 -4
- package/charts/charts.amd.js +1 -1
- package/charts/charts.amd.js.map +1 -1
- package/charts/charts.js +1 -1
- package/core/app.amd.js +1 -1
- package/core/app.amd.js.map +1 -1
- package/core/app.js +4 -4
- package/dialog/dialog.amd.js +1 -1
- package/dialog/dialog.amd.js.map +1 -1
- package/dialog/dialog.js +3 -3
- package/forms/forms.amd.js +1 -1
- package/forms/forms.amd.js.map +1 -1
- package/forms/forms.js +1 -1
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.amd.js.map +1 -1
- package/formsExt/formsExt.js +1 -1
- package/layout/layout.amd.js +1 -1
- package/layout/layout.amd.js.map +1 -1
- package/layout/layout.js +1 -1
- package/package.json +1 -1
- package/popup/popup.amd.js +1 -1
- package/popup/popup.amd.js.map +1 -1
- package/popup/popup.js +1 -1
- package/popup/worker.amd.js +1 -1
- package/popup/worker.amd.js.map +1 -1
- package/popup/worker.js +1 -1
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +11 -13
- package/project/project.js.map +1 -1
- package/tabsView/tabsView.amd.js +1 -1
- package/tabsView/tabsView.amd.js.map +1 -1
- package/tabsView/tabsView.js +2 -2
- package/utils/clipboard.amd.js +1 -1
- package/utils/clipboard.amd.js.map +1 -1
- package/utils/clipboard.js +1 -1
- package/utils/date.amd.js +1 -1
- package/utils/date.amd.js.map +1 -1
- package/utils/date.js +1 -1
- package/utils/device.amd.js +1 -1
- package/utils/device.amd.js.map +1 -1
- package/utils/device.js +1 -1
- package/utils/lodash.amd.js +1 -1
- package/utils/lodash.amd.js.map +1 -1
- package/utils/lodash.js +1 -1
- package/utils/price.amd.js +1 -1
- package/utils/price.amd.js.map +1 -1
- package/utils/price.js +1 -1
- package/utils/searchers.amd.js +1 -1
- package/utils/searchers.amd.js.map +1 -1
- package/utils/searchers.js +1 -1
- package/utils/string.amd.js +1 -1
- package/utils/string.amd.js.map +1 -1
- package/utils/string.js +1 -1
- package/.chunks/app-B8VpVm8U.amd.js.map +0 -1
- package/.chunks/app-B8VpVm8U.esm.js.map +0 -1
- package/.chunks/forms-C2ItFa61.esm.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
define([`require`,`exports`,`./forms-
|
|
1
|
+
define([`require`,`exports`,`./forms-Dh7-1Uy3.amd`,`../utils/string.amd`,`vue`,`../require/css.amd!../assets/notice.css`],function(e,t,n,r,i){"use strict";if(a===void 0)var a=window.Vue;Object.defineProperty(t,`__esModule`,{value:!0}),t.show=t.default=void 0;var o=(0,i.reactive)(new Map),s=(e,t,n)=>`top-notice_`+(0,r.genIntHash)(e+t+JSON.stringify(n)),c=(e,t=`info`,r)=>{let i=``;e=String(e);let a=s(e,t,r);if(r?.title)i=r.title;else{let t=e.split(`
|
|
2
2
|
`);t.length&&(i=String(t.shift()),e=t.join(`
|
|
3
3
|
`))}let c=o.get(a);if(c){l(c);return}let d={id:a,title:i,text:e,style:t,buttonProps:r?.buttonProps,buttonsProps:r?.buttonsProps,metaText:r?.metaText,isSafeHTML:r?.isSafeHTML,selectToClose:r?.selectToClose,onClose:r?.onClose};if(o.set(d.id,d),o.size>5){let[e,t]=[...o].at(0)||[];t&&u(t)}n.O.state.isMobile&&$(`input`).one(`click`,()=>u(d))},l=e=>{e.hightlight=!0,setTimeout(()=>e.hightlight=!1,300)},u=e=>{e.forceClosed=!0,setTimeout(()=>{e.onClose?.(),o.delete(e.id)},300)},d=e=>{let t=`hacking was detected`;return e=e.replace(/<script/g,t),e=e.replace(/<img/g,t),e=e.replace(/<iframe/g,t),e=e.replace(/javascript:/g,t),e=e.replace(/<[^>]+ (@|on)\w+=[^>]+>?/g,t),e},f={class:`top-notice_itemTextWrapper`},p=[`innerHTML`],m=[`innerHTML`],h={key:1,class:`top-notice_itemButtons`},g=[`innerHTML`],_=[`title`],v=(0,i.defineComponent)({__name:`item`,props:{id:{},title:{},text:{},style:{},metaText:{},buttonProps:{},buttonsProps:{},isSafeHTML:{type:Boolean},hightlight:{type:Boolean},selectToClose:{type:Boolean,default:!0},forceClosed:{type:Boolean}},emits:[`close`],setup(e,{emit:t}){let a=e,o=t,s=(0,i.ref)(!1);setTimeout(()=>s.value=!0,10);let c=(0,i.ref)(!1),l=(0,i.ref)(`right`),u=(0,i.computed)(()=>{let e=a.title.replace(/ {2}/g,` `);return a.isSafeHTML||(e=d(e)),e}),v=(0,i.computed)(()=>{let e=(0,r.nl2br)(a.text);return e=e.replace(/ {2}/g,` `),a.isSafeHTML||(e=d(e)),e}),y=e=>{c.value=!0,e&&(l.value=e),setTimeout(()=>o(`close`),300)},b=e=>{if(!a.selectToClose)return;let{tagName:t}=e.target;t===`A`&&y(),t===`BUTTON`&&y()},x={mounted:e=>{if(!n.O.state.isMobile||!n.O.$||!n.O.$.ui.draggable)return;let t=`right`;n.O.$(e).draggable({revert:!1,axis:`x`,drag:(e,n)=>{t=n.position.left>0?`right`:`left`},stop:(e,n)=>{y(t)}})}};return(t,n)=>{let r=(0,i.resolveComponent)(`TopButton`);return(0,i.withDirectives)(((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{class:(0,i.normalizeClass)([`top-notice_item`,{[`top-notice_item-`+e.style]:!0,"top-notice_item-hightlight":e.hightlight,"top-notice_item-showed":s.value,"top-notice_item-closed":c.value||e.forceClosed,[`top-notice_item-closed_`+l.value]:c.value}]),onClick:b},[(0,i.createElementVNode)(`div`,f,[u.value?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:0,class:`top-notice_itemTitle`,innerHTML:u.value},null,8,p)):(0,i.createCommentVNode)(``,!0),v.value?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:1,class:`top-notice_itemText`,innerHTML:v.value},null,8,m)):(0,i.createCommentVNode)(``,!0)]),e.buttonProps?((0,i.openBlock)(),(0,i.createBlock)(r,(0,i.mergeProps)({key:0,class:`top-notice_itemButton`,size:`s`},e.buttonProps,{title:e.buttonProps.title,innerHTML:e.buttonProps.default,onClick:n[0]||=e=>y()}),null,16,[`title`,`innerHTML`])):(0,i.createCommentVNode)(``,!0),e.buttonsProps?.length?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,h,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(e.buttonsProps,e=>((0,i.openBlock)(),(0,i.createBlock)(r,(0,i.mergeProps)({class:`top-notice_itemButton`,size:`s`},{ref_for:!0},e,{title:e.title,innerHTML:e.default,onClick:n[1]||=e=>y()}),null,16,[`title`,`innerHTML`]))),256))])):(0,i.createCommentVNode)(``,!0),e.metaText?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,{key:2,class:`top-notice_itemMetaText`,innerHTML:e.metaText},null,8,g)):(0,i.createCommentVNode)(``,!0),(0,i.createElementVNode)(`div`,{class:`top-notice_itemClose`,"data-top-icon":``,title:t.$i18n.Common.Close,onClick:n[2]||=()=>y()},null,8,_)],2)),[[x]])}}}),y={class:`top-notice`},b=(0,i.defineComponent)({__name:`notice`,setup(e){let t=e=>{e.onClose?.(),o.delete(e.id)};return(e,n)=>((0,i.openBlock)(),(0,i.createBlock)(i.Teleport,{to:`body`},[(0,i.createElementVNode)(`div`,y,[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)((0,i.unref)(o),([e,n])=>((0,i.openBlock)(),(0,i.createBlock)(v,{key:n.id,id:n.id,title:n.title,text:n.text,style:(0,i.normalizeStyle)(n.style),buttonProps:n.buttonProps,buttonsProps:n.buttonsProps,metaText:n.metaText,isSafeHTML:n.isSafeHTML,forceClosed:n.forceClosed,hightlight:n.hightlight,onClose:e=>t(n)},null,8,[`id`,`title`,`text`,`style`,`buttonProps`,`buttonsProps`,`metaText`,`isSafeHTML`,`forceClosed`,`hightlight`,`onClose`]))),128))])]))}});t.show=c,t.default=b});
|
|
4
|
-
//# sourceMappingURL=notice-
|
|
4
|
+
//# sourceMappingURL=notice-DM-e_WCY.amd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[".chunks/notice-CBJBDgby.esm.js","../../src/components/core/notice/utils.ts","../../src/components/core/notice/item/item.vue","../../src/components/core/notice/notice.vue"],"names":["vue","exports","x","vue_1","S","string_js_1","n","r","C","t","e","o","w","s","T","forms_C2ItFa61_esm_js_1","E","D","O","k","A","j","M","N","i","u","p","h","y","P","F"],"mappings":"AAAA,OAAO,CAAC,UAAW,UAAW,uBAA2B,sBAAsB,MAAK,0CAAA,CAAA,SAAa,EAAS,EAAS,EAAyB,EAAa,EAAO,CAC5J,aAAA,GAAAA,IAAA,OAAA,IAAAA,EAAA,OAAA,IACA,OAAO,eAAeC,EAAS,aAAc,CAAE,MAAO,GAAM,CAAC,CCOpD,EAAW,KAAA,EAAS,QAAwB,IAEnD,GAsBL,IAAIC,GAAQ,EAAAC,EAAA,UAAA,IAAA,IAAA,CAAAC,GAAA,EAAA,EAAA,IAAA,eAAA,EAAAC,EAAA,YAAA,EAAAC,EAAA,KAAA,UAAAC,EAAA,CAAA,CAAAC,GAAA,EAAA,EAAA,OAAA,IAAA,CAEL,IAAO,EAAK,GAEb,EAAe,OAAqBC,EAAA,CAE7B,IAAA,EACZL,EAAAK,EAAgBH,EAAA,EAAA,CACV,GAAA,GAAA,MACc,EAAA,EAAM,UAEf,CDjCD,IAAII,EAAID,EAAE,MAAM;EAAK,CCuCJC,EAAA,SAAO,EAAA,OAAAA,EAAA,OAAA,CAAA,CAAA,EAAAA,EAAA,KAAA;EAAA,EAEZ,IAAAC,EAAAT,EAAA,IAAA,EAAA,CAEtB,GAAAS,EAAA,CDtCUC,EAAED,EAAE,CCyCI,OAElB,IAAAE,EAAA,CACA,GAAA,EACA,MAAA,EACA,KAAsBJ,EACtB,MAAuBH,EACb,YAAS,GAAA,YACnB,aAAqB,GAAA,aACrB,SAAwB,GAAA,SACf,WAAS,GAAA,WAClB,cAAA,GAAA,cAEY,QAET,GAAS,QACL,CACQ,GAAgBJ,EAAA,IAAAW,EAAA,GAAAA,EAAA,CAAAX,EAAA,KAA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,oBAAAA,EAAA,SAAA,MAAA,EAAAA,EAAA,aAAA,EAAAA,EAAA,OAAAD,EAAA,EAAA,CAAA,EAAA,OAAA,EAAAC,EAAA,YAAA,EAAA,EAAAA,EAAA,aAAAoB,EAAA,CACM,IAAA,EAAA,GACC,GAAA,EAAA,GACC,MAAA,EAAA,MACJ,KAAA,EAAA,KACE,OAAA,EAAApB,EAAA,gBAAA,EAAA,MAAA,CACC,YAAA,EAAA,YACD,aAAA,EAAA,aACM,SAAA,EAAA,SHgIJ,WAAY,EAAE,WACd,YAAa,EAAE,YACf,WAAY,EAAE,WACd,QAAU,GAAM,EAAE,EAAC,CACtB,CAAE,KAAM,EAAG,CACR,KACA,QACA,OACA,QACA,cACA,eACA,WACA,aACA,cACA,aACA,UACH,CAAC,EAAE,CAAE,IAAI,EAAE,CAAC,CAAC,CAAC,GAE9B,CAAC,CACF,EAAQ,KAAOK,EACf,EAAQ,QAAUsB,GACpB","sourcesContent":["define([\"require\", \"exports\", \"./forms-C2ItFa61.esm.js\", \"../utils/string.js\", \"vue\"], function (require, exports, forms_C2ItFa61_esm_js_1, string_js_1, vue_1) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.show = exports.default = void 0;\n var x = (0, vue_1.reactive)(/* @__PURE__ */ new Map()), S = (e, n, r) => \"top-notice_\" + (0, string_js_1.genIntHash)(e + n + JSON.stringify(r)), C = (t, n = \"info\", r) => {\n let i = \"\";\n t = String(t);\n let a = S(t, n, r);\n if (r?.title)\n i = r.title;\n else {\n let e = t.split(\"\\n\");\n e.length && (i = String(e.shift()), t = e.join(\"\\n\"));\n }\n let o = x.get(a);\n if (o) {\n w(o);\n return;\n }\n let s = {\n id: a,\n title: i,\n text: t,\n style: n,\n buttonProps: r?.buttonProps,\n buttonsProps: r?.buttonsProps,\n metaText: r?.metaText,\n isSafeHTML: r?.isSafeHTML,\n selectToClose: r?.selectToClose,\n onClose: r?.onClose\n };\n if (x.set(s.id, s), x.size > 5) {\n let [e, t] = [...x].at(0) || [];\n t && T(t);\n }\n forms_C2ItFa61_esm_js_1.O.state.isMobile && $(\"input\").one(\"click\", () => T(s));\n }, w = (e) => {\n e.hightlight = !0, setTimeout(() => e.hightlight = !1, 300);\n }, T = (e) => {\n e.forceClosed = !0, setTimeout(() => {\n e.onClose?.(), x.delete(e.id);\n }, 300);\n }, E = (e) => {\n let t = \"hacking was detected\";\n return e = e.replace(/<script/g, t), e = e.replace(/<img/g, t), e = e.replace(/<iframe/g, t), e = e.replace(/javascript:/g, t), e = e.replace(/<[^>]+ (@|on)\\w+=[^>]+>?/g, t), e;\n }, D = { class: \"top-notice_itemTextWrapper\" }, O = [\"innerHTML\"], k = [\"innerHTML\"], A = {\n key: 1,\n class: \"top-notice_itemButtons\"\n }, j = [\"innerHTML\"], M = [\"title\"], N = /* @__PURE__ */ (0, vue_1.defineComponent)({\n __name: \"item\",\n props: {\n id: {},\n title: {},\n text: {},\n style: {},\n metaText: {},\n buttonProps: {},\n buttonsProps: {},\n isSafeHTML: { type: Boolean },\n hightlight: { type: Boolean },\n selectToClose: {\n type: Boolean,\n default: !0\n },\n forceClosed: { type: Boolean }\n },\n emits: [\"close\"],\n setup(t, { emit: i }) {\n let u = t, p = i, h = (0, vue_1.ref)(!1);\n setTimeout(() => h.value = !0, 10);\n let y = (0, vue_1.ref)(!1), x = (0, vue_1.ref)(\"right\"), S = (0, vue_1.computed)(() => {\n let e = u.title.replace(/ {2}/g, \" \");\n return u.isSafeHTML || (e = E(e)), e;\n }), C = (0, vue_1.computed)(() => {\n let e = (0, string_js_1.nl2br)(u.text);\n return e = e.replace(/ {2}/g, \" \"), u.isSafeHTML || (e = E(e)), e;\n }), w = (e) => {\n y.value = !0, e && (x.value = e), setTimeout(() => p(\"close\"), 300);\n }, T = (e) => {\n if (!u.selectToClose)\n return;\n let { tagName: t } = e.target;\n t === \"A\" && w(), t === \"BUTTON\" && w();\n }, N = { mounted: (t) => {\n if (!forms_C2ItFa61_esm_js_1.O.state.isMobile || !forms_C2ItFa61_esm_js_1.O.$ || !forms_C2ItFa61_esm_js_1.O.$.ui.draggable)\n return;\n let n = \"right\";\n forms_C2ItFa61_esm_js_1.O.$(t).draggable({\n revert: !1,\n axis: \"x\",\n drag: (e, t) => {\n n = t.position.left > 0 ? \"right\" : \"left\";\n },\n stop: (e, t) => {\n w(n);\n }\n });\n } };\n return (e, n) => {\n let i = (0, vue_1.resolveComponent)(\"TopButton\");\n return (0, vue_1.withDirectives)(((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", {\n class: (0, vue_1.normalizeClass)([\"top-notice_item\", {\n [\"top-notice_item-\" + t.style]: !0,\n \"top-notice_item-hightlight\": t.hightlight,\n \"top-notice_item-showed\": h.value,\n \"top-notice_item-closed\": y.value || t.forceClosed,\n [\"top-notice_item-closed_\" + x.value]: y.value\n }]),\n onClick: T\n }, [\n (0, vue_1.createElementVNode)(\"div\", D, [S.value ? ((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", {\n key: 0,\n class: \"top-notice_itemTitle\",\n innerHTML: S.value\n }, null, 8, O)) : (0, vue_1.createCommentVNode)(\"\", !0), C.value ? ((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", {\n key: 1,\n class: \"top-notice_itemText\",\n innerHTML: C.value\n }, null, 8, k)) : (0, vue_1.createCommentVNode)(\"\", !0)]),\n t.buttonProps ? ((0, vue_1.openBlock)(), (0, vue_1.createBlock)(i, (0, vue_1.mergeProps)({\n key: 0,\n class: \"top-notice_itemButton\",\n size: \"s\"\n }, t.buttonProps, {\n title: t.buttonProps.title,\n innerHTML: t.buttonProps.default,\n onClick: n[0] ||= (e) => w()\n }), null, 16, [\"title\", \"innerHTML\"])) : (0, vue_1.createCommentVNode)(\"\", !0),\n t.buttonsProps?.length ? ((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", A, [((0, vue_1.openBlock)(!0), (0, vue_1.createElementBlock)(vue_1.Fragment, null, (0, vue_1.renderList)(t.buttonsProps, (e) => ((0, vue_1.openBlock)(), (0, vue_1.createBlock)(i, (0, vue_1.mergeProps)({\n class: \"top-notice_itemButton\",\n size: \"s\"\n }, { ref_for: !0 }, e, {\n title: e.title,\n innerHTML: e.default,\n onClick: n[1] ||= (e) => w()\n }), null, 16, [\"title\", \"innerHTML\"]))), 256))])) : (0, vue_1.createCommentVNode)(\"\", !0),\n t.metaText ? ((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", {\n key: 2,\n class: \"top-notice_itemMetaText\",\n innerHTML: t.metaText\n }, null, 8, j)) : (0, vue_1.createCommentVNode)(\"\", !0),\n (0, vue_1.createElementVNode)(\"div\", {\n class: \"top-notice_itemClose\",\n \"data-top-icon\": \"\",\n title: e.$i18n.Common.Close,\n onClick: n[2] ||= () => w()\n }, null, 8, M)\n ], 2)), [[N]]);\n };\n }\n }), P = { class: \"top-notice\" }, F = /* @__PURE__ */ (0, vue_1.defineComponent)({\n __name: \"notice\",\n setup(e) {\n let t = (e) => {\n e.onClose?.(), x.delete(e.id);\n };\n return (e, n) => ((0, vue_1.openBlock)(), (0, vue_1.createBlock)(vue_1.Teleport, { to: \"body\" }, [(0, vue_1.createElementVNode)(\"div\", P, [((0, vue_1.openBlock)(!0), (0, vue_1.createElementBlock)(vue_1.Fragment, null, (0, vue_1.renderList)((0, vue_1.unref)(x), ([e, n]) => ((0, vue_1.openBlock)(), (0, vue_1.createBlock)(N, {\n key: n.id,\n id: n.id,\n title: n.title,\n text: n.text,\n style: (0, vue_1.normalizeStyle)(n.style),\n buttonProps: n.buttonProps,\n buttonsProps: n.buttonsProps,\n metaText: n.metaText,\n isSafeHTML: n.isSafeHTML,\n forceClosed: n.forceClosed,\n hightlight: n.hightlight,\n onClose: (e) => t(n)\n }, null, 8, [\n \"id\",\n \"title\",\n \"text\",\n \"style\",\n \"buttonProps\",\n \"buttonsProps\",\n \"metaText\",\n \"isSafeHTML\",\n \"forceClosed\",\n \"hightlight\",\n \"onClose\"\n ]))), 128))])]));\n }\n });\n exports.show = C;\n exports.default = F;\n});\n//# sourceMappingURL=notice-CBJBDgby.esm.js.map\n","import { reactive } from 'vue';\nimport type { Props as ItemProps, Props, Style } from '@/components/core/notice/item/types';\nimport Core from '@/core/core/core';\nimport { genIntHash } from '@/core/utils/string';\n\nexport const transitionDuration = 300;\n\nexport type Item = Props & { onClose?: Function };\n\nexport const itemById = reactive(new Map<string, Item>());\n\nconst genItemId = (text: ItemProps['text'], style: ItemProps['style'], options?: Options) => {\n\treturn 'top-notice_' + genIntHash(text + style + JSON.stringify(options));\n};\n\nexport type Options = {\n\ttitle?: ItemProps['title'],\n\tmetaText?: ItemProps['metaText'],\n\tbuttonProps?: ItemProps['buttonProps'],\n\tbuttonsProps?: ItemProps['buttonsProps'],\n\tisSafeHTML?: ItemProps['isSafeHTML'],\n\tselectToClose?: ItemProps['selectToClose'],\n\tonClose?: Function\n}\n\n/**\n * Показать сообщением в стиле push уведомления\n *\n * title будет получен из первой строки text\n *\n * Если в options указан title, он будет взят оттуда\n */\nexport const show = (text: string, style: Style = 'info', options?: Options) => {\n\tlet title = '';\n\n\ttext = String(text);\n\n\tconst id = genItemId(text, style, options);\n\n\tif (options?.title) {\n\t\ttitle = options.title;\n\t} else {\n\t\tconst chunks = text.split('\\n');\n\n\t\tif (chunks.length) {\n\t\t\ttitle = String(chunks.shift());\n\t\t\ttext = chunks.join('\\n');\n\t\t}\n\t}\n\n\tconst itemExists = itemById.get(id);\n\tif (itemExists) {\n\t\thightlight(itemExists);\n\n\t\treturn;\n\t}\n\n\tconst item: Item = {\n\t\tid,\n\t\ttitle,\n\t\ttext,\n\t\tstyle,\n\t\tbuttonProps: options?.buttonProps,\n\t\tbuttonsProps: options?.buttonsProps,\n\t\tmetaText: options?.metaText,\n\t\tisSafeHTML: options?.isSafeHTML,\n\t\tselectToClose: options?.selectToClose,\n\t\tonClose: options?.onClose,\n\t};\n\n\titemById.set(item.id, item);\n\n\tif (itemById.size > 5) {\n\t\tconst [_firstId, firstItem] = [...itemById].at(0) || [];\n\t\tif (firstItem) close(firstItem);\n\t}\n\n\t/**\n\t * Автозакрытие ошибок форм\n\t *\n\t * Добавляет\n\t */\n\tif (Core.state.isMobile) {\n\t\t$('input').one('click', () => close(item));\n\t}\n};\n\nconst hightlight = (item: Item) => {\n\titem.hightlight = true;\n\n\tsetTimeout(() => item.hightlight = false, transitionDuration);\n};\n\nconst close = (item: Item) => {\n\titem.forceClosed = true;\n\n\tsetTimeout(() => {\n\t\titem.onClose?.();\n\n\t\titemById.delete(item.id);\n\t}, transitionDuration);\n};\n\n/**\n * Убрать подозрительный html код\n */\nexport const prepareText = (text: string) => {\n\tconst textNoSafety = 'hacking was detected';\n\n\ttext = text.replace(/<script/g, textNoSafety);\n\ttext = text.replace(/<img/g, textNoSafety);\n\ttext = text.replace(/<iframe/g, textNoSafety);\n\ttext = text.replace(/javascript:/g, textNoSafety);\n\ttext = text.replace(/<[^>]+ (@|on)\\w+=[^>]+>?/g, textNoSafety);\n\n\treturn text;\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, withDefaults } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { nl2br } from '@/core/utils/string';\n\nimport type { Emits, Props } from './types';\nimport { prepareText, transitionDuration } from '@/components/core/notice/utils';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tselectToClose: true,\n});\n\nconst emit = defineEmits<Emits>();\n\n// анимация появления\nconst showed = ref(false);\nsetTimeout(() => showed.value = true, 10);\n\n// анимация закрытия\nconst closed = ref(false);\nconst closedDirection = ref<'top' | 'right' | 'bottom' | 'left'>('right');\n\nconst title = computed(() => {\n\tlet res = props.title.replace(/ {2}/g, ' ');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst text = computed(() => {\n\tlet res = nl2br(props.text);\n\n\tres = res.replace(/ {2}/g, ' ');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst close = (direction?: typeof closedDirection.value) => {\n\tclosed.value = true;\n\n\tif (direction) {\n\t\tclosedDirection.value = direction;\n\t}\n\n\tsetTimeout(() => emit('close'), transitionDuration);\n};\n\nconst onClick = (e: MouseEvent) => {\n\tif (!props.selectToClose) return;\n\n\tconst { tagName } = e.target as HTMLElement;\n\n\tif (tagName === 'A') close();\n\tif (tagName === 'BUTTON') close();\n};\n\nconst vSwipe = {\n\tmounted: (el: HTMLElement) => {\n\t\tif (!Core.state.isMobile) return;\n\n\t\tif (!Core.$ || !Core.$.ui['draggable']) return;\n\n\t\tlet direction: typeof closedDirection.value = 'right';\n\n\t\tlet axis = 'x';\n\t\t// if (getOS() === 'iOS') axis = 'y';\n\n\t\tCore.$(el).draggable({\n\t\t\trevert: false,\n\t\t\taxis,\n\t\t\tdrag: (_e, ui) => {\n\t\t\t\tif (axis == 'x') {\n\t\t\t\t\tdirection = ui.position.left > 0 ? 'right' : 'left';\n\t\t\t\t} else {\n\t\t\t\t\tdirection = ui.position.top > 0 ? 'bottom' : 'top';\n\t\t\t\t}\n\t\t\t},\n\t\t\tstop: (_e, _ui) => {\n\t\t\t\tclose(direction);\n\t\t\t},\n\t\t});\n\t},\n};\n\n// const vSwipe = {\n// \tmounted: (el: HTMLElement) => {\n// \t\tconst { distanceX, direction } = usePointerSwipe(el, {\n// \t\t\tdisableTextSelect: true,\n// \t\t\tonSwipe(e: PointerEvent) {\n// \t\t\t\tleft.value = -distanceX.value + 'px';\n// \t\t\t},\n// \t\t\tonSwipeEnd: (_e, direction) => {\n// \t\t\t\tclose(direction);\n// \t\t\t},\n// \t\t});\n// \t},\n// };\n</script>\n\n<template>\n\t<div\n\t\tclass=\"top-notice_item\"\n\t\t:class=\"{\n\t\t\t['top-notice_item-' + style]: true,\n\t\t\t'top-notice_item-hightlight': hightlight,\n\t\t\t'top-notice_item-showed': showed,\n\t\t\t'top-notice_item-closed': closed || forceClosed,\n\t\t\t['top-notice_item-closed_' + closedDirection]: closed,\n\t\t}\"\n\t\t@click=\"onClick\"\n\t\tv-swipe\n\t>\n\t\t<div class=\"top-notice_itemTextWrapper\">\n\t\t\t<div v-if=\"title\" class=\"top-notice_itemTitle\" v-html=\"title\"></div>\n\t\t\t<div v-if=\"text\" class=\"top-notice_itemText\" v-html=\"text\"></div>\n\t\t</div>\n\n\t\t<TopButton\n\t\t\tv-if=\"buttonProps\"\n\t\t\tclass=\"top-notice_itemButton\"\n\t\t\tsize=\"s\"\n\t\t\t:=\"buttonProps\"\n\t\t\t:title=\"buttonProps.title\"\n\t\t\tv-html=\"buttonProps.default\"\n\t\t\t@click=\"close()\"\n\t\t/>\n\n\t\t<div\n\t\t\tv-if=\"buttonsProps?.length\"\n\t\t\tclass=\"top-notice_itemButtons\"\n\t\t>\n\t\t\t<TopButton\n\t\t\t\tv-for=\"buttonProps in buttonsProps\"\n\t\t\t\tclass=\"top-notice_itemButton\"\n\t\t\t\tsize=\"s\"\n\t\t\t\t:=\"buttonProps\"\n\t\t\t\t:title=\"buttonProps.title\"\n\t\t\t\tv-html=\"buttonProps.default\"\n\t\t\t\t@click=\"close()\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<div v-if=\"metaText\" class=\"top-notice_itemMetaText\" v-html=\"metaText\"></div>\n\n\t\t<div\n\t\t\tclass=\"top-notice_itemClose\"\n\t\t\tdata-top-icon=\"\"\n\t\t\t:title=\"$i18n.Common.Close\"\n\t\t\t@click=\"() => close()\"\n\t\t></div>\n\t</div>\n</template>\n\n<style>\n@import \"style.css\";\n</style>\n","<!-- performance all in one file component, для Core.notice() -->\n<script lang=\"ts\">\nexport { show } from './utils';\n</script>\n\n<script setup lang=\"ts\">\nimport type { Item } from './utils';\nimport { itemById } from './utils';\n\nimport type { Props } from './types';\nimport TopNoticeItem from './item/item.vue';\n\ndefineProps<Props>();\n\nconst onCloseItem = (item: Item) => {\n\titem.onClose?.();\n\n\titemById.delete(item.id);\n};\n</script>\n\n<template>\n\t<teleport to=\"body\">\n\t\t<div class=\"top-notice\">\n\t\t\t<TopNoticeItem\n\t\t\t\tv-for=\"[_index, item] in itemById\"\n\t\t\t\t:key=\"item.id\"\n\t\t\t\t:id=\"item.id\"\n\t\t\t\t:title=\"item.title\"\n\t\t\t\t:text=\"item.text\"\n\t\t\t\t:style=\"item.style\"\n\t\t\t\t:buttonProps=\"item.buttonProps\"\n\t\t\t\t:buttonsProps=\"item.buttonsProps\"\n\t\t\t\t:metaText=\"item.metaText\"\n\t\t\t\t:isSafeHTML=\"item.isSafeHTML\"\n\t\t\t\t:forceClosed=\"item.forceClosed\"\n\t\t\t\t:hightlight=\"item.hightlight\"\n\t\t\t\t@close=\"onCloseItem(item)\"\n\t\t\t/>\n\t\t</div>\n\t</teleport>\n</template>\n\n<style>\n:root {\n\t--top-notice-top: var(--top-padding-4);\n\t--top-notice-right: var(--top-padding-4);\n}\n\n.top-notice {\n\twidth: 400px;\n\tfont-size: 14px;\n\tposition: fixed; top: var(--top-notice-top); right: var(--top-notice-right);\n\tz-index: 1000010;\n\tdisplay: flex; flex-direction: column-reverse; gap: var(--top-gap-2);\n}\n\n.top-notice ul {\n\tpadding: 0 0 0 var(--top-padding-5);\n}\n\n@media only screen and (max-width: 600px) {\n\t:root {\n\t\t--top-notice-top: var(--top-padding-4);\n\t\t--top-notice-right: var(--top-padding-4);\n\t}\n\n\t.top-notice { width: auto; left: var(--top-notice-right); }\n}\n</style>\n"]}
|
|
1
|
+
{"version":3,"sources":[".chunks/notice-DM-e_WCY.esm.js","../../src/components/core/notice/utils.ts","../../src/components/core/notice/item/item.vue","../../src/components/core/notice/notice.vue"],"names":["vue","exports","x","vue_1","S","string_js_1","n","r","C","t","e","o","w","s","T","forms_Dh7_1Uy3_esm_js_1","E","D","O","k","A","j","M","N","i","u","p","h","y","P","F"],"mappings":"AAAA,OAAO,CAAC,UAAW,UAAW,uBAA2B,sBAAsB,MAAK,0CAAA,CAAA,SAAa,EAAS,EAAS,EAAyB,EAAa,EAAO,CAC5J,aAAA,GAAAA,IAAA,OAAA,IAAAA,EAAA,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EAAE,WACd,QAAU,GAAM,EAAE,EAAC,CACtB,CAAE,KAAM,EAAG,CACR,KACA,QACA,OACA,QACA,cACA,eACA,WACA,aACA,cACA,aACA,UACH,CAAC,EAAE,CAAE,IAAI,EAAE,CAAC,CAAC,CAAC,GAE9B,CAAC,CACF,EAAQ,KAAOK,EACf,EAAQ,QAAUsB,GACpB","sourcesContent":["define([\"require\", \"exports\", \"./forms-Dh7-1Uy3.esm.js\", \"../utils/string.js\", \"vue\"], function (require, exports, forms_Dh7_1Uy3_esm_js_1, string_js_1, vue_1) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.show = exports.default = void 0;\n var x = (0, vue_1.reactive)(/* @__PURE__ */ new Map()), S = (e, n, r) => \"top-notice_\" + (0, string_js_1.genIntHash)(e + n + JSON.stringify(r)), C = (t, n = \"info\", r) => {\n let i = \"\";\n t = String(t);\n let a = S(t, n, r);\n if (r?.title)\n i = r.title;\n else {\n let e = t.split(\"\\n\");\n e.length && (i = String(e.shift()), t = e.join(\"\\n\"));\n }\n let o = x.get(a);\n if (o) {\n w(o);\n return;\n }\n let s = {\n id: a,\n title: i,\n text: t,\n style: n,\n buttonProps: r?.buttonProps,\n buttonsProps: r?.buttonsProps,\n metaText: r?.metaText,\n isSafeHTML: r?.isSafeHTML,\n selectToClose: r?.selectToClose,\n onClose: r?.onClose\n };\n if (x.set(s.id, s), x.size > 5) {\n let [e, t] = [...x].at(0) || [];\n t && T(t);\n }\n forms_Dh7_1Uy3_esm_js_1.O.state.isMobile && $(\"input\").one(\"click\", () => T(s));\n }, w = (e) => {\n e.hightlight = !0, setTimeout(() => e.hightlight = !1, 300);\n }, T = (e) => {\n e.forceClosed = !0, setTimeout(() => {\n e.onClose?.(), x.delete(e.id);\n }, 300);\n }, E = (e) => {\n let t = \"hacking was detected\";\n return e = e.replace(/<script/g, t), e = e.replace(/<img/g, t), e = e.replace(/<iframe/g, t), e = e.replace(/javascript:/g, t), e = e.replace(/<[^>]+ (@|on)\\w+=[^>]+>?/g, t), e;\n }, D = { class: \"top-notice_itemTextWrapper\" }, O = [\"innerHTML\"], k = [\"innerHTML\"], A = {\n key: 1,\n class: \"top-notice_itemButtons\"\n }, j = [\"innerHTML\"], M = [\"title\"], N = /* @__PURE__ */ (0, vue_1.defineComponent)({\n __name: \"item\",\n props: {\n id: {},\n title: {},\n text: {},\n style: {},\n metaText: {},\n buttonProps: {},\n buttonsProps: {},\n isSafeHTML: { type: Boolean },\n hightlight: { type: Boolean },\n selectToClose: {\n type: Boolean,\n default: !0\n },\n forceClosed: { type: Boolean }\n },\n emits: [\"close\"],\n setup(t, { emit: i }) {\n let u = t, p = i, h = (0, vue_1.ref)(!1);\n setTimeout(() => h.value = !0, 10);\n let y = (0, vue_1.ref)(!1), x = (0, vue_1.ref)(\"right\"), S = (0, vue_1.computed)(() => {\n let e = u.title.replace(/ {2}/g, \" \");\n return u.isSafeHTML || (e = E(e)), e;\n }), C = (0, vue_1.computed)(() => {\n let e = (0, string_js_1.nl2br)(u.text);\n return e = e.replace(/ {2}/g, \" \"), u.isSafeHTML || (e = E(e)), e;\n }), w = (e) => {\n y.value = !0, e && (x.value = e), setTimeout(() => p(\"close\"), 300);\n }, T = (e) => {\n if (!u.selectToClose)\n return;\n let { tagName: t } = e.target;\n t === \"A\" && w(), t === \"BUTTON\" && w();\n }, N = { mounted: (t) => {\n if (!forms_Dh7_1Uy3_esm_js_1.O.state.isMobile || !forms_Dh7_1Uy3_esm_js_1.O.$ || !forms_Dh7_1Uy3_esm_js_1.O.$.ui.draggable)\n return;\n let n = \"right\";\n forms_Dh7_1Uy3_esm_js_1.O.$(t).draggable({\n revert: !1,\n axis: \"x\",\n drag: (e, t) => {\n n = t.position.left > 0 ? \"right\" : \"left\";\n },\n stop: (e, t) => {\n w(n);\n }\n });\n } };\n return (e, n) => {\n let i = (0, vue_1.resolveComponent)(\"TopButton\");\n return (0, vue_1.withDirectives)(((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", {\n class: (0, vue_1.normalizeClass)([\"top-notice_item\", {\n [\"top-notice_item-\" + t.style]: !0,\n \"top-notice_item-hightlight\": t.hightlight,\n \"top-notice_item-showed\": h.value,\n \"top-notice_item-closed\": y.value || t.forceClosed,\n [\"top-notice_item-closed_\" + x.value]: y.value\n }]),\n onClick: T\n }, [\n (0, vue_1.createElementVNode)(\"div\", D, [S.value ? ((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", {\n key: 0,\n class: \"top-notice_itemTitle\",\n innerHTML: S.value\n }, null, 8, O)) : (0, vue_1.createCommentVNode)(\"\", !0), C.value ? ((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", {\n key: 1,\n class: \"top-notice_itemText\",\n innerHTML: C.value\n }, null, 8, k)) : (0, vue_1.createCommentVNode)(\"\", !0)]),\n t.buttonProps ? ((0, vue_1.openBlock)(), (0, vue_1.createBlock)(i, (0, vue_1.mergeProps)({\n key: 0,\n class: \"top-notice_itemButton\",\n size: \"s\"\n }, t.buttonProps, {\n title: t.buttonProps.title,\n innerHTML: t.buttonProps.default,\n onClick: n[0] ||= (e) => w()\n }), null, 16, [\"title\", \"innerHTML\"])) : (0, vue_1.createCommentVNode)(\"\", !0),\n t.buttonsProps?.length ? ((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", A, [((0, vue_1.openBlock)(!0), (0, vue_1.createElementBlock)(vue_1.Fragment, null, (0, vue_1.renderList)(t.buttonsProps, (e) => ((0, vue_1.openBlock)(), (0, vue_1.createBlock)(i, (0, vue_1.mergeProps)({\n class: \"top-notice_itemButton\",\n size: \"s\"\n }, { ref_for: !0 }, e, {\n title: e.title,\n innerHTML: e.default,\n onClick: n[1] ||= (e) => w()\n }), null, 16, [\"title\", \"innerHTML\"]))), 256))])) : (0, vue_1.createCommentVNode)(\"\", !0),\n t.metaText ? ((0, vue_1.openBlock)(), (0, vue_1.createElementBlock)(\"div\", {\n key: 2,\n class: \"top-notice_itemMetaText\",\n innerHTML: t.metaText\n }, null, 8, j)) : (0, vue_1.createCommentVNode)(\"\", !0),\n (0, vue_1.createElementVNode)(\"div\", {\n class: \"top-notice_itemClose\",\n \"data-top-icon\": \"\",\n title: e.$i18n.Common.Close,\n onClick: n[2] ||= () => w()\n }, null, 8, M)\n ], 2)), [[N]]);\n };\n }\n }), P = { class: \"top-notice\" }, F = /* @__PURE__ */ (0, vue_1.defineComponent)({\n __name: \"notice\",\n setup(e) {\n let t = (e) => {\n e.onClose?.(), x.delete(e.id);\n };\n return (e, n) => ((0, vue_1.openBlock)(), (0, vue_1.createBlock)(vue_1.Teleport, { to: \"body\" }, [(0, vue_1.createElementVNode)(\"div\", P, [((0, vue_1.openBlock)(!0), (0, vue_1.createElementBlock)(vue_1.Fragment, null, (0, vue_1.renderList)((0, vue_1.unref)(x), ([e, n]) => ((0, vue_1.openBlock)(), (0, vue_1.createBlock)(N, {\n key: n.id,\n id: n.id,\n title: n.title,\n text: n.text,\n style: (0, vue_1.normalizeStyle)(n.style),\n buttonProps: n.buttonProps,\n buttonsProps: n.buttonsProps,\n metaText: n.metaText,\n isSafeHTML: n.isSafeHTML,\n forceClosed: n.forceClosed,\n hightlight: n.hightlight,\n onClose: (e) => t(n)\n }, null, 8, [\n \"id\",\n \"title\",\n \"text\",\n \"style\",\n \"buttonProps\",\n \"buttonsProps\",\n \"metaText\",\n \"isSafeHTML\",\n \"forceClosed\",\n \"hightlight\",\n \"onClose\"\n ]))), 128))])]));\n }\n });\n exports.show = C;\n exports.default = F;\n});\n//# sourceMappingURL=notice-DM-e_WCY.esm.js.map\n","import { reactive } from 'vue';\nimport type { Props as ItemProps, Props, Style } from '@/components/core/notice/item/types';\nimport Core from '@/core/core/core';\nimport { genIntHash } from '@/core/utils/string';\n\nexport const transitionDuration = 300;\n\nexport type Item = Props & { onClose?: Function };\n\nexport const itemById = reactive(new Map<string, Item>());\n\nconst genItemId = (text: ItemProps['text'], style: ItemProps['style'], options?: Options) => {\n\treturn 'top-notice_' + genIntHash(text + style + JSON.stringify(options));\n};\n\nexport type Options = {\n\ttitle?: ItemProps['title'],\n\tmetaText?: ItemProps['metaText'],\n\tbuttonProps?: ItemProps['buttonProps'],\n\tbuttonsProps?: ItemProps['buttonsProps'],\n\tisSafeHTML?: ItemProps['isSafeHTML'],\n\tselectToClose?: ItemProps['selectToClose'],\n\tonClose?: Function\n}\n\n/**\n * Показать сообщением в стиле push уведомления\n *\n * title будет получен из первой строки text\n *\n * Если в options указан title, он будет взят оттуда\n */\nexport const show = (text: string, style: Style = 'info', options?: Options) => {\n\tlet title = '';\n\n\ttext = String(text);\n\n\tconst id = genItemId(text, style, options);\n\n\tif (options?.title) {\n\t\ttitle = options.title;\n\t} else {\n\t\tconst chunks = text.split('\\n');\n\n\t\tif (chunks.length) {\n\t\t\ttitle = String(chunks.shift());\n\t\t\ttext = chunks.join('\\n');\n\t\t}\n\t}\n\n\tconst itemExists = itemById.get(id);\n\tif (itemExists) {\n\t\thightlight(itemExists);\n\n\t\treturn;\n\t}\n\n\tconst item: Item = {\n\t\tid,\n\t\ttitle,\n\t\ttext,\n\t\tstyle,\n\t\tbuttonProps: options?.buttonProps,\n\t\tbuttonsProps: options?.buttonsProps,\n\t\tmetaText: options?.metaText,\n\t\tisSafeHTML: options?.isSafeHTML,\n\t\tselectToClose: options?.selectToClose,\n\t\tonClose: options?.onClose,\n\t};\n\n\titemById.set(item.id, item);\n\n\tif (itemById.size > 5) {\n\t\tconst [_firstId, firstItem] = [...itemById].at(0) || [];\n\t\tif (firstItem) close(firstItem);\n\t}\n\n\t/**\n\t * Автозакрытие ошибок форм\n\t *\n\t * Добавляет\n\t */\n\tif (Core.state.isMobile) {\n\t\t$('input').one('click', () => close(item));\n\t}\n};\n\nconst hightlight = (item: Item) => {\n\titem.hightlight = true;\n\n\tsetTimeout(() => item.hightlight = false, transitionDuration);\n};\n\nconst close = (item: Item) => {\n\titem.forceClosed = true;\n\n\tsetTimeout(() => {\n\t\titem.onClose?.();\n\n\t\titemById.delete(item.id);\n\t}, transitionDuration);\n};\n\n/**\n * Убрать подозрительный html код\n */\nexport const prepareText = (text: string) => {\n\tconst textNoSafety = 'hacking was detected';\n\n\ttext = text.replace(/<script/g, textNoSafety);\n\ttext = text.replace(/<img/g, textNoSafety);\n\ttext = text.replace(/<iframe/g, textNoSafety);\n\ttext = text.replace(/javascript:/g, textNoSafety);\n\ttext = text.replace(/<[^>]+ (@|on)\\w+=[^>]+>?/g, textNoSafety);\n\n\treturn text;\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, withDefaults } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { nl2br } from '@/core/utils/string';\n\nimport type { Emits, Props } from './types';\nimport { prepareText, transitionDuration } from '@/components/core/notice/utils';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tselectToClose: true,\n});\n\nconst emit = defineEmits<Emits>();\n\n// анимация появления\nconst showed = ref(false);\nsetTimeout(() => showed.value = true, 10);\n\n// анимация закрытия\nconst closed = ref(false);\nconst closedDirection = ref<'top' | 'right' | 'bottom' | 'left'>('right');\n\nconst title = computed(() => {\n\tlet res = props.title.replace(/ {2}/g, ' ');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst text = computed(() => {\n\tlet res = nl2br(props.text);\n\n\tres = res.replace(/ {2}/g, ' ');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst close = (direction?: typeof closedDirection.value) => {\n\tclosed.value = true;\n\n\tif (direction) {\n\t\tclosedDirection.value = direction;\n\t}\n\n\tsetTimeout(() => emit('close'), transitionDuration);\n};\n\nconst onClick = (e: MouseEvent) => {\n\tif (!props.selectToClose) return;\n\n\tconst { tagName } = e.target as HTMLElement;\n\n\tif (tagName === 'A') close();\n\tif (tagName === 'BUTTON') close();\n};\n\nconst vSwipe = {\n\tmounted: (el: HTMLElement) => {\n\t\tif (!Core.state.isMobile) return;\n\n\t\tif (!Core.$ || !Core.$.ui['draggable']) return;\n\n\t\tlet direction: typeof closedDirection.value = 'right';\n\n\t\tlet axis = 'x';\n\t\t// if (getOS() === 'iOS') axis = 'y';\n\n\t\tCore.$(el).draggable({\n\t\t\trevert: false,\n\t\t\taxis,\n\t\t\tdrag: (_e, ui) => {\n\t\t\t\tif (axis == 'x') {\n\t\t\t\t\tdirection = ui.position.left > 0 ? 'right' : 'left';\n\t\t\t\t} else {\n\t\t\t\t\tdirection = ui.position.top > 0 ? 'bottom' : 'top';\n\t\t\t\t}\n\t\t\t},\n\t\t\tstop: (_e, _ui) => {\n\t\t\t\tclose(direction);\n\t\t\t},\n\t\t});\n\t},\n};\n\n// const vSwipe = {\n// \tmounted: (el: HTMLElement) => {\n// \t\tconst { distanceX, direction } = usePointerSwipe(el, {\n// \t\t\tdisableTextSelect: true,\n// \t\t\tonSwipe(e: PointerEvent) {\n// \t\t\t\tleft.value = -distanceX.value + 'px';\n// \t\t\t},\n// \t\t\tonSwipeEnd: (_e, direction) => {\n// \t\t\t\tclose(direction);\n// \t\t\t},\n// \t\t});\n// \t},\n// };\n</script>\n\n<template>\n\t<div\n\t\tclass=\"top-notice_item\"\n\t\t:class=\"{\n\t\t\t['top-notice_item-' + style]: true,\n\t\t\t'top-notice_item-hightlight': hightlight,\n\t\t\t'top-notice_item-showed': showed,\n\t\t\t'top-notice_item-closed': closed || forceClosed,\n\t\t\t['top-notice_item-closed_' + closedDirection]: closed,\n\t\t}\"\n\t\t@click=\"onClick\"\n\t\tv-swipe\n\t>\n\t\t<div class=\"top-notice_itemTextWrapper\">\n\t\t\t<div v-if=\"title\" class=\"top-notice_itemTitle\" v-html=\"title\"></div>\n\t\t\t<div v-if=\"text\" class=\"top-notice_itemText\" v-html=\"text\"></div>\n\t\t</div>\n\n\t\t<TopButton\n\t\t\tv-if=\"buttonProps\"\n\t\t\tclass=\"top-notice_itemButton\"\n\t\t\tsize=\"s\"\n\t\t\t:=\"buttonProps\"\n\t\t\t:title=\"buttonProps.title\"\n\t\t\tv-html=\"buttonProps.default\"\n\t\t\t@click=\"close()\"\n\t\t/>\n\n\t\t<div\n\t\t\tv-if=\"buttonsProps?.length\"\n\t\t\tclass=\"top-notice_itemButtons\"\n\t\t>\n\t\t\t<TopButton\n\t\t\t\tv-for=\"buttonProps in buttonsProps\"\n\t\t\t\tclass=\"top-notice_itemButton\"\n\t\t\t\tsize=\"s\"\n\t\t\t\t:=\"buttonProps\"\n\t\t\t\t:title=\"buttonProps.title\"\n\t\t\t\tv-html=\"buttonProps.default\"\n\t\t\t\t@click=\"close()\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<div v-if=\"metaText\" class=\"top-notice_itemMetaText\" v-html=\"metaText\"></div>\n\n\t\t<div\n\t\t\tclass=\"top-notice_itemClose\"\n\t\t\tdata-top-icon=\"\"\n\t\t\t:title=\"$i18n.Common.Close\"\n\t\t\t@click=\"() => close()\"\n\t\t></div>\n\t</div>\n</template>\n\n<style>\n@import \"style.css\";\n</style>\n","<!-- performance all in one file component, для Core.notice() -->\n<script lang=\"ts\">\nexport { show } from './utils';\n</script>\n\n<script setup lang=\"ts\">\nimport type { Item } from './utils';\nimport { itemById } from './utils';\n\nimport type { Props } from './types';\nimport TopNoticeItem from './item/item.vue';\n\ndefineProps<Props>();\n\nconst onCloseItem = (item: Item) => {\n\titem.onClose?.();\n\n\titemById.delete(item.id);\n};\n</script>\n\n<template>\n\t<teleport to=\"body\">\n\t\t<div class=\"top-notice\">\n\t\t\t<TopNoticeItem\n\t\t\t\tv-for=\"[_index, item] in itemById\"\n\t\t\t\t:key=\"item.id\"\n\t\t\t\t:id=\"item.id\"\n\t\t\t\t:title=\"item.title\"\n\t\t\t\t:text=\"item.text\"\n\t\t\t\t:style=\"item.style\"\n\t\t\t\t:buttonProps=\"item.buttonProps\"\n\t\t\t\t:buttonsProps=\"item.buttonsProps\"\n\t\t\t\t:metaText=\"item.metaText\"\n\t\t\t\t:isSafeHTML=\"item.isSafeHTML\"\n\t\t\t\t:forceClosed=\"item.forceClosed\"\n\t\t\t\t:hightlight=\"item.hightlight\"\n\t\t\t\t@close=\"onCloseItem(item)\"\n\t\t\t/>\n\t\t</div>\n\t</teleport>\n</template>\n\n<style>\n:root {\n\t--top-notice-top: var(--top-padding-4);\n\t--top-notice-right: var(--top-padding-4);\n}\n\n.top-notice {\n\twidth: 400px;\n\tfont-size: 14px;\n\tposition: fixed; top: var(--top-notice-top); right: var(--top-notice-right);\n\tz-index: 1000010;\n\tdisplay: flex; flex-direction: column-reverse; gap: var(--top-gap-2);\n}\n\n.top-notice ul {\n\tpadding: 0 0 0 var(--top-padding-5);\n}\n\n@media only screen and (max-width: 600px) {\n\t:root {\n\t\t--top-notice-top: var(--top-padding-4);\n\t\t--top-notice-right: var(--top-padding-4);\n\t}\n\n\t.top-notice { width: auto; left: var(--top-notice-right); }\n}\n</style>\n"]}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
_autoloadCSSCore.insertCSSLinkToPage(fileNames, true);
|
|
6
6
|
/* end import css */
|
|
7
7
|
|
|
8
|
-
import { O as e } from "./forms-
|
|
8
|
+
import { O as e } from "./forms-Dh7-1Uy3.esm.js";
|
|
9
9
|
import { genIntHash as t, nl2br as n } from "../utils/string.js";
|
|
10
10
|
import { Fragment as r, Teleport as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, defineComponent as u, mergeProps as d, normalizeClass as f, normalizeStyle as p, openBlock as m, reactive as h, ref as g, renderList as _, resolveComponent as v, unref as y, withDirectives as b } from "vue";
|
|
11
11
|
var x = h(/* @__PURE__ */ new Map()), S = (e, n, r) => "top-notice_" + t(e + n + JSON.stringify(r)), C = (t, n = "info", r) => {
|
|
@@ -188,4 +188,4 @@ var x = h(/* @__PURE__ */ new Map()), S = (e, n, r) => "top-notice_" + t(e + n +
|
|
|
188
188
|
//#endregion
|
|
189
189
|
export { F as default, C as show };
|
|
190
190
|
|
|
191
|
-
//# sourceMappingURL=notice-
|
|
191
|
+
//# sourceMappingURL=notice-DM-e_WCY.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice-CBJBDgby.esm.js","names":["$i18n"],"sources":["../../src/components/core/notice/utils.ts","../../src/components/core/notice/item/item.vue","../../src/components/core/notice/item/item.vue","../../src/components/core/notice/notice.vue","../../src/components/core/notice/notice.vue"],"sourcesContent":["import { reactive } from 'vue';\nimport type { Props as ItemProps, Props, Style } from '@/components/core/notice/item/types';\nimport Core from '@/core/core/core';\nimport { genIntHash } from '@/core/utils/string';\n\nexport const transitionDuration = 300;\n\nexport type Item = Props & { onClose?: Function };\n\nexport const itemById = reactive(new Map<string, Item>());\n\nconst genItemId = (text: ItemProps['text'], style: ItemProps['style'], options?: Options) => {\n\treturn 'top-notice_' + genIntHash(text + style + JSON.stringify(options));\n};\n\nexport type Options = {\n\ttitle?: ItemProps['title'],\n\tmetaText?: ItemProps['metaText'],\n\tbuttonProps?: ItemProps['buttonProps'],\n\tbuttonsProps?: ItemProps['buttonsProps'],\n\tisSafeHTML?: ItemProps['isSafeHTML'],\n\tselectToClose?: ItemProps['selectToClose'],\n\tonClose?: Function\n}\n\n/**\n * Показать сообщением в стиле push уведомления\n *\n * title будет получен из первой строки text\n *\n * Если в options указан title, он будет взят оттуда\n */\nexport const show = (text: string, style: Style = 'info', options?: Options) => {\n\tlet title = '';\n\n\ttext = String(text);\n\n\tconst id = genItemId(text, style, options);\n\n\tif (options?.title) {\n\t\ttitle = options.title;\n\t} else {\n\t\tconst chunks = text.split('\\n');\n\n\t\tif (chunks.length) {\n\t\t\ttitle = String(chunks.shift());\n\t\t\ttext = chunks.join('\\n');\n\t\t}\n\t}\n\n\tconst itemExists = itemById.get(id);\n\tif (itemExists) {\n\t\thightlight(itemExists);\n\n\t\treturn;\n\t}\n\n\tconst item: Item = {\n\t\tid,\n\t\ttitle,\n\t\ttext,\n\t\tstyle,\n\t\tbuttonProps: options?.buttonProps,\n\t\tbuttonsProps: options?.buttonsProps,\n\t\tmetaText: options?.metaText,\n\t\tisSafeHTML: options?.isSafeHTML,\n\t\tselectToClose: options?.selectToClose,\n\t\tonClose: options?.onClose,\n\t};\n\n\titemById.set(item.id, item);\n\n\tif (itemById.size > 5) {\n\t\tconst [_firstId, firstItem] = [...itemById].at(0) || [];\n\t\tif (firstItem) close(firstItem);\n\t}\n\n\t/**\n\t * Автозакрытие ошибок форм\n\t *\n\t * Добавляет\n\t */\n\tif (Core.state.isMobile) {\n\t\t$('input').one('click', () => close(item));\n\t}\n};\n\nconst hightlight = (item: Item) => {\n\titem.hightlight = true;\n\n\tsetTimeout(() => item.hightlight = false, transitionDuration);\n};\n\nconst close = (item: Item) => {\n\titem.forceClosed = true;\n\n\tsetTimeout(() => {\n\t\titem.onClose?.();\n\n\t\titemById.delete(item.id);\n\t}, transitionDuration);\n};\n\n/**\n * Убрать подозрительный html код\n */\nexport const prepareText = (text: string) => {\n\tconst textNoSafety = 'hacking was detected';\n\n\ttext = text.replace(/<script/g, textNoSafety);\n\ttext = text.replace(/<img/g, textNoSafety);\n\ttext = text.replace(/<iframe/g, textNoSafety);\n\ttext = text.replace(/javascript:/g, textNoSafety);\n\ttext = text.replace(/<[^>]+ (@|on)\\w+=[^>]+>?/g, textNoSafety);\n\n\treturn text;\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, withDefaults } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { nl2br } from '@/core/utils/string';\n\nimport type { Emits, Props } from './types';\nimport { prepareText, transitionDuration } from '@/components/core/notice/utils';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tselectToClose: true,\n});\n\nconst emit = defineEmits<Emits>();\n\n// анимация появления\nconst showed = ref(false);\nsetTimeout(() => showed.value = true, 10);\n\n// анимация закрытия\nconst closed = ref(false);\nconst closedDirection = ref<'top' | 'right' | 'bottom' | 'left'>('right');\n\nconst title = computed(() => {\n\tlet res = props.title.replace(/ {2}/g, ' ');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst text = computed(() => {\n\tlet res = nl2br(props.text);\n\n\tres = res.replace(/ {2}/g, ' ');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst close = (direction?: typeof closedDirection.value) => {\n\tclosed.value = true;\n\n\tif (direction) {\n\t\tclosedDirection.value = direction;\n\t}\n\n\tsetTimeout(() => emit('close'), transitionDuration);\n};\n\nconst onClick = (e: MouseEvent) => {\n\tif (!props.selectToClose) return;\n\n\tconst { tagName } = e.target as HTMLElement;\n\n\tif (tagName === 'A') close();\n\tif (tagName === 'BUTTON') close();\n};\n\nconst vSwipe = {\n\tmounted: (el: HTMLElement) => {\n\t\tif (!Core.state.isMobile) return;\n\n\t\tif (!Core.$ || !Core.$.ui['draggable']) return;\n\n\t\tlet direction: typeof closedDirection.value = 'right';\n\n\t\tlet axis = 'x';\n\t\t// if (getOS() === 'iOS') axis = 'y';\n\n\t\tCore.$(el).draggable({\n\t\t\trevert: false,\n\t\t\taxis,\n\t\t\tdrag: (_e, ui) => {\n\t\t\t\tif (axis == 'x') {\n\t\t\t\t\tdirection = ui.position.left > 0 ? 'right' : 'left';\n\t\t\t\t} else {\n\t\t\t\t\tdirection = ui.position.top > 0 ? 'bottom' : 'top';\n\t\t\t\t}\n\t\t\t},\n\t\t\tstop: (_e, _ui) => {\n\t\t\t\tclose(direction);\n\t\t\t},\n\t\t});\n\t},\n};\n\n// const vSwipe = {\n// \tmounted: (el: HTMLElement) => {\n// \t\tconst { distanceX, direction } = usePointerSwipe(el, {\n// \t\t\tdisableTextSelect: true,\n// \t\t\tonSwipe(e: PointerEvent) {\n// \t\t\t\tleft.value = -distanceX.value + 'px';\n// \t\t\t},\n// \t\t\tonSwipeEnd: (_e, direction) => {\n// \t\t\t\tclose(direction);\n// \t\t\t},\n// \t\t});\n// \t},\n// };\n</script>\n\n<template>\n\t<div\n\t\tclass=\"top-notice_item\"\n\t\t:class=\"{\n\t\t\t['top-notice_item-' + style]: true,\n\t\t\t'top-notice_item-hightlight': hightlight,\n\t\t\t'top-notice_item-showed': showed,\n\t\t\t'top-notice_item-closed': closed || forceClosed,\n\t\t\t['top-notice_item-closed_' + closedDirection]: closed,\n\t\t}\"\n\t\t@click=\"onClick\"\n\t\tv-swipe\n\t>\n\t\t<div class=\"top-notice_itemTextWrapper\">\n\t\t\t<div v-if=\"title\" class=\"top-notice_itemTitle\" v-html=\"title\"></div>\n\t\t\t<div v-if=\"text\" class=\"top-notice_itemText\" v-html=\"text\"></div>\n\t\t</div>\n\n\t\t<TopButton\n\t\t\tv-if=\"buttonProps\"\n\t\t\tclass=\"top-notice_itemButton\"\n\t\t\tsize=\"s\"\n\t\t\t:=\"buttonProps\"\n\t\t\t:title=\"buttonProps.title\"\n\t\t\tv-html=\"buttonProps.default\"\n\t\t\t@click=\"close()\"\n\t\t/>\n\n\t\t<div\n\t\t\tv-if=\"buttonsProps?.length\"\n\t\t\tclass=\"top-notice_itemButtons\"\n\t\t>\n\t\t\t<TopButton\n\t\t\t\tv-for=\"buttonProps in buttonsProps\"\n\t\t\t\tclass=\"top-notice_itemButton\"\n\t\t\t\tsize=\"s\"\n\t\t\t\t:=\"buttonProps\"\n\t\t\t\t:title=\"buttonProps.title\"\n\t\t\t\tv-html=\"buttonProps.default\"\n\t\t\t\t@click=\"close()\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<div v-if=\"metaText\" class=\"top-notice_itemMetaText\" v-html=\"metaText\"></div>\n\n\t\t<div\n\t\t\tclass=\"top-notice_itemClose\"\n\t\t\tdata-top-icon=\"\"\n\t\t\t:title=\"$i18n.Common.Close\"\n\t\t\t@click=\"() => close()\"\n\t\t></div>\n\t</div>\n</template>\n\n<style>\n@import \"style.css\";\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, withDefaults } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { nl2br } from '@/core/utils/string';\n\nimport type { Emits, Props } from './types';\nimport { prepareText, transitionDuration } from '@/components/core/notice/utils';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tselectToClose: true,\n});\n\nconst emit = defineEmits<Emits>();\n\n// анимация появления\nconst showed = ref(false);\nsetTimeout(() => showed.value = true, 10);\n\n// анимация закрытия\nconst closed = ref(false);\nconst closedDirection = ref<'top' | 'right' | 'bottom' | 'left'>('right');\n\nconst title = computed(() => {\n\tlet res = props.title.replace(/ {2}/g, ' ');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst text = computed(() => {\n\tlet res = nl2br(props.text);\n\n\tres = res.replace(/ {2}/g, ' ');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst close = (direction?: typeof closedDirection.value) => {\n\tclosed.value = true;\n\n\tif (direction) {\n\t\tclosedDirection.value = direction;\n\t}\n\n\tsetTimeout(() => emit('close'), transitionDuration);\n};\n\nconst onClick = (e: MouseEvent) => {\n\tif (!props.selectToClose) return;\n\n\tconst { tagName } = e.target as HTMLElement;\n\n\tif (tagName === 'A') close();\n\tif (tagName === 'BUTTON') close();\n};\n\nconst vSwipe = {\n\tmounted: (el: HTMLElement) => {\n\t\tif (!Core.state.isMobile) return;\n\n\t\tif (!Core.$ || !Core.$.ui['draggable']) return;\n\n\t\tlet direction: typeof closedDirection.value = 'right';\n\n\t\tlet axis = 'x';\n\t\t// if (getOS() === 'iOS') axis = 'y';\n\n\t\tCore.$(el).draggable({\n\t\t\trevert: false,\n\t\t\taxis,\n\t\t\tdrag: (_e, ui) => {\n\t\t\t\tif (axis == 'x') {\n\t\t\t\t\tdirection = ui.position.left > 0 ? 'right' : 'left';\n\t\t\t\t} else {\n\t\t\t\t\tdirection = ui.position.top > 0 ? 'bottom' : 'top';\n\t\t\t\t}\n\t\t\t},\n\t\t\tstop: (_e, _ui) => {\n\t\t\t\tclose(direction);\n\t\t\t},\n\t\t});\n\t},\n};\n\n// const vSwipe = {\n// \tmounted: (el: HTMLElement) => {\n// \t\tconst { distanceX, direction } = usePointerSwipe(el, {\n// \t\t\tdisableTextSelect: true,\n// \t\t\tonSwipe(e: PointerEvent) {\n// \t\t\t\tleft.value = -distanceX.value + 'px';\n// \t\t\t},\n// \t\t\tonSwipeEnd: (_e, direction) => {\n// \t\t\t\tclose(direction);\n// \t\t\t},\n// \t\t});\n// \t},\n// };\n</script>\n\n<template>\n\t<div\n\t\tclass=\"top-notice_item\"\n\t\t:class=\"{\n\t\t\t['top-notice_item-' + style]: true,\n\t\t\t'top-notice_item-hightlight': hightlight,\n\t\t\t'top-notice_item-showed': showed,\n\t\t\t'top-notice_item-closed': closed || forceClosed,\n\t\t\t['top-notice_item-closed_' + closedDirection]: closed,\n\t\t}\"\n\t\t@click=\"onClick\"\n\t\tv-swipe\n\t>\n\t\t<div class=\"top-notice_itemTextWrapper\">\n\t\t\t<div v-if=\"title\" class=\"top-notice_itemTitle\" v-html=\"title\"></div>\n\t\t\t<div v-if=\"text\" class=\"top-notice_itemText\" v-html=\"text\"></div>\n\t\t</div>\n\n\t\t<TopButton\n\t\t\tv-if=\"buttonProps\"\n\t\t\tclass=\"top-notice_itemButton\"\n\t\t\tsize=\"s\"\n\t\t\t:=\"buttonProps\"\n\t\t\t:title=\"buttonProps.title\"\n\t\t\tv-html=\"buttonProps.default\"\n\t\t\t@click=\"close()\"\n\t\t/>\n\n\t\t<div\n\t\t\tv-if=\"buttonsProps?.length\"\n\t\t\tclass=\"top-notice_itemButtons\"\n\t\t>\n\t\t\t<TopButton\n\t\t\t\tv-for=\"buttonProps in buttonsProps\"\n\t\t\t\tclass=\"top-notice_itemButton\"\n\t\t\t\tsize=\"s\"\n\t\t\t\t:=\"buttonProps\"\n\t\t\t\t:title=\"buttonProps.title\"\n\t\t\t\tv-html=\"buttonProps.default\"\n\t\t\t\t@click=\"close()\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<div v-if=\"metaText\" class=\"top-notice_itemMetaText\" v-html=\"metaText\"></div>\n\n\t\t<div\n\t\t\tclass=\"top-notice_itemClose\"\n\t\t\tdata-top-icon=\"\"\n\t\t\t:title=\"$i18n.Common.Close\"\n\t\t\t@click=\"() => close()\"\n\t\t></div>\n\t</div>\n</template>\n\n<style>\n@import \"style.css\";\n</style>\n","<!-- performance all in one file component, для Core.notice() -->\n<script lang=\"ts\">\nexport { show } from './utils';\n</script>\n\n<script setup lang=\"ts\">\nimport type { Item } from './utils';\nimport { itemById } from './utils';\n\nimport type { Props } from './types';\nimport TopNoticeItem from './item/item.vue';\n\ndefineProps<Props>();\n\nconst onCloseItem = (item: Item) => {\n\titem.onClose?.();\n\n\titemById.delete(item.id);\n};\n</script>\n\n<template>\n\t<teleport to=\"body\">\n\t\t<div class=\"top-notice\">\n\t\t\t<TopNoticeItem\n\t\t\t\tv-for=\"[_index, item] in itemById\"\n\t\t\t\t:key=\"item.id\"\n\t\t\t\t:id=\"item.id\"\n\t\t\t\t:title=\"item.title\"\n\t\t\t\t:text=\"item.text\"\n\t\t\t\t:style=\"item.style\"\n\t\t\t\t:buttonProps=\"item.buttonProps\"\n\t\t\t\t:buttonsProps=\"item.buttonsProps\"\n\t\t\t\t:metaText=\"item.metaText\"\n\t\t\t\t:isSafeHTML=\"item.isSafeHTML\"\n\t\t\t\t:forceClosed=\"item.forceClosed\"\n\t\t\t\t:hightlight=\"item.hightlight\"\n\t\t\t\t@close=\"onCloseItem(item)\"\n\t\t\t/>\n\t\t</div>\n\t</teleport>\n</template>\n\n<style>\n:root {\n\t--top-notice-top: var(--top-padding-4);\n\t--top-notice-right: var(--top-padding-4);\n}\n\n.top-notice {\n\twidth: 400px;\n\tfont-size: 14px;\n\tposition: fixed; top: var(--top-notice-top); right: var(--top-notice-right);\n\tz-index: 1000010;\n\tdisplay: flex; flex-direction: column-reverse; gap: var(--top-gap-2);\n}\n\n.top-notice ul {\n\tpadding: 0 0 0 var(--top-padding-5);\n}\n\n@media only screen and (max-width: 600px) {\n\t:root {\n\t\t--top-notice-top: var(--top-padding-4);\n\t\t--top-notice-right: var(--top-padding-4);\n\t}\n\n\t.top-notice { width: auto; left: var(--top-notice-right); }\n}\n</style>\n","<!-- performance all in one file component, для Core.notice() -->\n<script lang=\"ts\">\nexport { show } from './utils';\n</script>\n\n<script setup lang=\"ts\">\nimport type { Item } from './utils';\nimport { itemById } from './utils';\n\nimport type { Props } from './types';\nimport TopNoticeItem from './item/item.vue';\n\ndefineProps<Props>();\n\nconst onCloseItem = (item: Item) => {\n\titem.onClose?.();\n\n\titemById.delete(item.id);\n};\n</script>\n\n<template>\n\t<teleport to=\"body\">\n\t\t<div class=\"top-notice\">\n\t\t\t<TopNoticeItem\n\t\t\t\tv-for=\"[_index, item] in itemById\"\n\t\t\t\t:key=\"item.id\"\n\t\t\t\t:id=\"item.id\"\n\t\t\t\t:title=\"item.title\"\n\t\t\t\t:text=\"item.text\"\n\t\t\t\t:style=\"item.style\"\n\t\t\t\t:buttonProps=\"item.buttonProps\"\n\t\t\t\t:buttonsProps=\"item.buttonsProps\"\n\t\t\t\t:metaText=\"item.metaText\"\n\t\t\t\t:isSafeHTML=\"item.isSafeHTML\"\n\t\t\t\t:forceClosed=\"item.forceClosed\"\n\t\t\t\t:hightlight=\"item.hightlight\"\n\t\t\t\t@close=\"onCloseItem(item)\"\n\t\t\t/>\n\t\t</div>\n\t</teleport>\n</template>\n\n<style>\n:root {\n\t--top-notice-top: var(--top-padding-4);\n\t--top-notice-right: var(--top-padding-4);\n}\n\n.top-notice {\n\twidth: 400px;\n\tfont-size: 14px;\n\tposition: fixed; top: var(--top-notice-top); right: var(--top-notice-right);\n\tz-index: 1000010;\n\tdisplay: flex; flex-direction: column-reverse; gap: var(--top-gap-2);\n}\n\n.top-notice ul {\n\tpadding: 0 0 0 var(--top-padding-5);\n}\n\n@media only screen and (max-width: 600px) {\n\t:root {\n\t\t--top-notice-top: var(--top-padding-4);\n\t\t--top-notice-right: var(--top-padding-4);\n\t}\n\n\t.top-notice { width: auto; left: var(--top-notice-right); }\n}\n</style>\n"],"mappings":";;;AASA,IAAa,IAAW,kBAAS,IAAI,KAAmB,CAAC,EAEnD,KAAa,GAAyB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AClB,cAAc,EAAK;GACnB,UAAU,EAAK;GACf,YAAY,EAAK;GACjB,aAAa,EAAK;GAClB,YAAY,EAAK;GACjB,UAAK,MAAE,EAAY,EAAI"}
|
|
1
|
+
{"version":3,"file":"notice-DM-e_WCY.esm.js","names":["$i18n"],"sources":["../../src/components/core/notice/utils.ts","../../src/components/core/notice/item/item.vue","../../src/components/core/notice/item/item.vue","../../src/components/core/notice/notice.vue","../../src/components/core/notice/notice.vue"],"sourcesContent":["import { reactive } from 'vue';\nimport type { Props as ItemProps, Props, Style } from '@/components/core/notice/item/types';\nimport Core from '@/core/core/core';\nimport { genIntHash } from '@/core/utils/string';\n\nexport const transitionDuration = 300;\n\nexport type Item = Props & { onClose?: Function };\n\nexport const itemById = reactive(new Map<string, Item>());\n\nconst genItemId = (text: ItemProps['text'], style: ItemProps['style'], options?: Options) => {\n\treturn 'top-notice_' + genIntHash(text + style + JSON.stringify(options));\n};\n\nexport type Options = {\n\ttitle?: ItemProps['title'],\n\tmetaText?: ItemProps['metaText'],\n\tbuttonProps?: ItemProps['buttonProps'],\n\tbuttonsProps?: ItemProps['buttonsProps'],\n\tisSafeHTML?: ItemProps['isSafeHTML'],\n\tselectToClose?: ItemProps['selectToClose'],\n\tonClose?: Function\n}\n\n/**\n * Показать сообщением в стиле push уведомления\n *\n * title будет получен из первой строки text\n *\n * Если в options указан title, он будет взят оттуда\n */\nexport const show = (text: string, style: Style = 'info', options?: Options) => {\n\tlet title = '';\n\n\ttext = String(text);\n\n\tconst id = genItemId(text, style, options);\n\n\tif (options?.title) {\n\t\ttitle = options.title;\n\t} else {\n\t\tconst chunks = text.split('\\n');\n\n\t\tif (chunks.length) {\n\t\t\ttitle = String(chunks.shift());\n\t\t\ttext = chunks.join('\\n');\n\t\t}\n\t}\n\n\tconst itemExists = itemById.get(id);\n\tif (itemExists) {\n\t\thightlight(itemExists);\n\n\t\treturn;\n\t}\n\n\tconst item: Item = {\n\t\tid,\n\t\ttitle,\n\t\ttext,\n\t\tstyle,\n\t\tbuttonProps: options?.buttonProps,\n\t\tbuttonsProps: options?.buttonsProps,\n\t\tmetaText: options?.metaText,\n\t\tisSafeHTML: options?.isSafeHTML,\n\t\tselectToClose: options?.selectToClose,\n\t\tonClose: options?.onClose,\n\t};\n\n\titemById.set(item.id, item);\n\n\tif (itemById.size > 5) {\n\t\tconst [_firstId, firstItem] = [...itemById].at(0) || [];\n\t\tif (firstItem) close(firstItem);\n\t}\n\n\t/**\n\t * Автозакрытие ошибок форм\n\t *\n\t * Добавляет\n\t */\n\tif (Core.state.isMobile) {\n\t\t$('input').one('click', () => close(item));\n\t}\n};\n\nconst hightlight = (item: Item) => {\n\titem.hightlight = true;\n\n\tsetTimeout(() => item.hightlight = false, transitionDuration);\n};\n\nconst close = (item: Item) => {\n\titem.forceClosed = true;\n\n\tsetTimeout(() => {\n\t\titem.onClose?.();\n\n\t\titemById.delete(item.id);\n\t}, transitionDuration);\n};\n\n/**\n * Убрать подозрительный html код\n */\nexport const prepareText = (text: string) => {\n\tconst textNoSafety = 'hacking was detected';\n\n\ttext = text.replace(/<script/g, textNoSafety);\n\ttext = text.replace(/<img/g, textNoSafety);\n\ttext = text.replace(/<iframe/g, textNoSafety);\n\ttext = text.replace(/javascript:/g, textNoSafety);\n\ttext = text.replace(/<[^>]+ (@|on)\\w+=[^>]+>?/g, textNoSafety);\n\n\treturn text;\n};\n","<script setup lang=\"ts\">\nimport { computed, ref, withDefaults } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { nl2br } from '@/core/utils/string';\n\nimport type { Emits, Props } from './types';\nimport { prepareText, transitionDuration } from '@/components/core/notice/utils';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tselectToClose: true,\n});\n\nconst emit = defineEmits<Emits>();\n\n// анимация появления\nconst showed = ref(false);\nsetTimeout(() => showed.value = true, 10);\n\n// анимация закрытия\nconst closed = ref(false);\nconst closedDirection = ref<'top' | 'right' | 'bottom' | 'left'>('right');\n\nconst title = computed(() => {\n\tlet res = props.title.replace(/ {2}/g, ' ');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst text = computed(() => {\n\tlet res = nl2br(props.text);\n\n\tres = res.replace(/ {2}/g, ' ');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst close = (direction?: typeof closedDirection.value) => {\n\tclosed.value = true;\n\n\tif (direction) {\n\t\tclosedDirection.value = direction;\n\t}\n\n\tsetTimeout(() => emit('close'), transitionDuration);\n};\n\nconst onClick = (e: MouseEvent) => {\n\tif (!props.selectToClose) return;\n\n\tconst { tagName } = e.target as HTMLElement;\n\n\tif (tagName === 'A') close();\n\tif (tagName === 'BUTTON') close();\n};\n\nconst vSwipe = {\n\tmounted: (el: HTMLElement) => {\n\t\tif (!Core.state.isMobile) return;\n\n\t\tif (!Core.$ || !Core.$.ui['draggable']) return;\n\n\t\tlet direction: typeof closedDirection.value = 'right';\n\n\t\tlet axis = 'x';\n\t\t// if (getOS() === 'iOS') axis = 'y';\n\n\t\tCore.$(el).draggable({\n\t\t\trevert: false,\n\t\t\taxis,\n\t\t\tdrag: (_e, ui) => {\n\t\t\t\tif (axis == 'x') {\n\t\t\t\t\tdirection = ui.position.left > 0 ? 'right' : 'left';\n\t\t\t\t} else {\n\t\t\t\t\tdirection = ui.position.top > 0 ? 'bottom' : 'top';\n\t\t\t\t}\n\t\t\t},\n\t\t\tstop: (_e, _ui) => {\n\t\t\t\tclose(direction);\n\t\t\t},\n\t\t});\n\t},\n};\n\n// const vSwipe = {\n// \tmounted: (el: HTMLElement) => {\n// \t\tconst { distanceX, direction } = usePointerSwipe(el, {\n// \t\t\tdisableTextSelect: true,\n// \t\t\tonSwipe(e: PointerEvent) {\n// \t\t\t\tleft.value = -distanceX.value + 'px';\n// \t\t\t},\n// \t\t\tonSwipeEnd: (_e, direction) => {\n// \t\t\t\tclose(direction);\n// \t\t\t},\n// \t\t});\n// \t},\n// };\n</script>\n\n<template>\n\t<div\n\t\tclass=\"top-notice_item\"\n\t\t:class=\"{\n\t\t\t['top-notice_item-' + style]: true,\n\t\t\t'top-notice_item-hightlight': hightlight,\n\t\t\t'top-notice_item-showed': showed,\n\t\t\t'top-notice_item-closed': closed || forceClosed,\n\t\t\t['top-notice_item-closed_' + closedDirection]: closed,\n\t\t}\"\n\t\t@click=\"onClick\"\n\t\tv-swipe\n\t>\n\t\t<div class=\"top-notice_itemTextWrapper\">\n\t\t\t<div v-if=\"title\" class=\"top-notice_itemTitle\" v-html=\"title\"></div>\n\t\t\t<div v-if=\"text\" class=\"top-notice_itemText\" v-html=\"text\"></div>\n\t\t</div>\n\n\t\t<TopButton\n\t\t\tv-if=\"buttonProps\"\n\t\t\tclass=\"top-notice_itemButton\"\n\t\t\tsize=\"s\"\n\t\t\t:=\"buttonProps\"\n\t\t\t:title=\"buttonProps.title\"\n\t\t\tv-html=\"buttonProps.default\"\n\t\t\t@click=\"close()\"\n\t\t/>\n\n\t\t<div\n\t\t\tv-if=\"buttonsProps?.length\"\n\t\t\tclass=\"top-notice_itemButtons\"\n\t\t>\n\t\t\t<TopButton\n\t\t\t\tv-for=\"buttonProps in buttonsProps\"\n\t\t\t\tclass=\"top-notice_itemButton\"\n\t\t\t\tsize=\"s\"\n\t\t\t\t:=\"buttonProps\"\n\t\t\t\t:title=\"buttonProps.title\"\n\t\t\t\tv-html=\"buttonProps.default\"\n\t\t\t\t@click=\"close()\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<div v-if=\"metaText\" class=\"top-notice_itemMetaText\" v-html=\"metaText\"></div>\n\n\t\t<div\n\t\t\tclass=\"top-notice_itemClose\"\n\t\t\tdata-top-icon=\"\"\n\t\t\t:title=\"$i18n.Common.Close\"\n\t\t\t@click=\"() => close()\"\n\t\t></div>\n\t</div>\n</template>\n\n<style>\n@import \"style.css\";\n</style>\n","<script setup lang=\"ts\">\nimport { computed, ref, withDefaults } from 'vue';\n\nimport Core from '@/core/core/core';\nimport { nl2br } from '@/core/utils/string';\n\nimport type { Emits, Props } from './types';\nimport { prepareText, transitionDuration } from '@/components/core/notice/utils';\n\nconst props = withDefaults(defineProps<Props>(), {\n\tselectToClose: true,\n});\n\nconst emit = defineEmits<Emits>();\n\n// анимация появления\nconst showed = ref(false);\nsetTimeout(() => showed.value = true, 10);\n\n// анимация закрытия\nconst closed = ref(false);\nconst closedDirection = ref<'top' | 'right' | 'bottom' | 'left'>('right');\n\nconst title = computed(() => {\n\tlet res = props.title.replace(/ {2}/g, ' ');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst text = computed(() => {\n\tlet res = nl2br(props.text);\n\n\tres = res.replace(/ {2}/g, ' ');\n\n\tif (!props.isSafeHTML) res = prepareText(res);\n\n\treturn res;\n});\n\nconst close = (direction?: typeof closedDirection.value) => {\n\tclosed.value = true;\n\n\tif (direction) {\n\t\tclosedDirection.value = direction;\n\t}\n\n\tsetTimeout(() => emit('close'), transitionDuration);\n};\n\nconst onClick = (e: MouseEvent) => {\n\tif (!props.selectToClose) return;\n\n\tconst { tagName } = e.target as HTMLElement;\n\n\tif (tagName === 'A') close();\n\tif (tagName === 'BUTTON') close();\n};\n\nconst vSwipe = {\n\tmounted: (el: HTMLElement) => {\n\t\tif (!Core.state.isMobile) return;\n\n\t\tif (!Core.$ || !Core.$.ui['draggable']) return;\n\n\t\tlet direction: typeof closedDirection.value = 'right';\n\n\t\tlet axis = 'x';\n\t\t// if (getOS() === 'iOS') axis = 'y';\n\n\t\tCore.$(el).draggable({\n\t\t\trevert: false,\n\t\t\taxis,\n\t\t\tdrag: (_e, ui) => {\n\t\t\t\tif (axis == 'x') {\n\t\t\t\t\tdirection = ui.position.left > 0 ? 'right' : 'left';\n\t\t\t\t} else {\n\t\t\t\t\tdirection = ui.position.top > 0 ? 'bottom' : 'top';\n\t\t\t\t}\n\t\t\t},\n\t\t\tstop: (_e, _ui) => {\n\t\t\t\tclose(direction);\n\t\t\t},\n\t\t});\n\t},\n};\n\n// const vSwipe = {\n// \tmounted: (el: HTMLElement) => {\n// \t\tconst { distanceX, direction } = usePointerSwipe(el, {\n// \t\t\tdisableTextSelect: true,\n// \t\t\tonSwipe(e: PointerEvent) {\n// \t\t\t\tleft.value = -distanceX.value + 'px';\n// \t\t\t},\n// \t\t\tonSwipeEnd: (_e, direction) => {\n// \t\t\t\tclose(direction);\n// \t\t\t},\n// \t\t});\n// \t},\n// };\n</script>\n\n<template>\n\t<div\n\t\tclass=\"top-notice_item\"\n\t\t:class=\"{\n\t\t\t['top-notice_item-' + style]: true,\n\t\t\t'top-notice_item-hightlight': hightlight,\n\t\t\t'top-notice_item-showed': showed,\n\t\t\t'top-notice_item-closed': closed || forceClosed,\n\t\t\t['top-notice_item-closed_' + closedDirection]: closed,\n\t\t}\"\n\t\t@click=\"onClick\"\n\t\tv-swipe\n\t>\n\t\t<div class=\"top-notice_itemTextWrapper\">\n\t\t\t<div v-if=\"title\" class=\"top-notice_itemTitle\" v-html=\"title\"></div>\n\t\t\t<div v-if=\"text\" class=\"top-notice_itemText\" v-html=\"text\"></div>\n\t\t</div>\n\n\t\t<TopButton\n\t\t\tv-if=\"buttonProps\"\n\t\t\tclass=\"top-notice_itemButton\"\n\t\t\tsize=\"s\"\n\t\t\t:=\"buttonProps\"\n\t\t\t:title=\"buttonProps.title\"\n\t\t\tv-html=\"buttonProps.default\"\n\t\t\t@click=\"close()\"\n\t\t/>\n\n\t\t<div\n\t\t\tv-if=\"buttonsProps?.length\"\n\t\t\tclass=\"top-notice_itemButtons\"\n\t\t>\n\t\t\t<TopButton\n\t\t\t\tv-for=\"buttonProps in buttonsProps\"\n\t\t\t\tclass=\"top-notice_itemButton\"\n\t\t\t\tsize=\"s\"\n\t\t\t\t:=\"buttonProps\"\n\t\t\t\t:title=\"buttonProps.title\"\n\t\t\t\tv-html=\"buttonProps.default\"\n\t\t\t\t@click=\"close()\"\n\t\t\t/>\n\t\t</div>\n\n\t\t<div v-if=\"metaText\" class=\"top-notice_itemMetaText\" v-html=\"metaText\"></div>\n\n\t\t<div\n\t\t\tclass=\"top-notice_itemClose\"\n\t\t\tdata-top-icon=\"\"\n\t\t\t:title=\"$i18n.Common.Close\"\n\t\t\t@click=\"() => close()\"\n\t\t></div>\n\t</div>\n</template>\n\n<style>\n@import \"style.css\";\n</style>\n","<!-- performance all in one file component, для Core.notice() -->\n<script lang=\"ts\">\nexport { show } from './utils';\n</script>\n\n<script setup lang=\"ts\">\nimport type { Item } from './utils';\nimport { itemById } from './utils';\n\nimport type { Props } from './types';\nimport TopNoticeItem from './item/item.vue';\n\ndefineProps<Props>();\n\nconst onCloseItem = (item: Item) => {\n\titem.onClose?.();\n\n\titemById.delete(item.id);\n};\n</script>\n\n<template>\n\t<teleport to=\"body\">\n\t\t<div class=\"top-notice\">\n\t\t\t<TopNoticeItem\n\t\t\t\tv-for=\"[_index, item] in itemById\"\n\t\t\t\t:key=\"item.id\"\n\t\t\t\t:id=\"item.id\"\n\t\t\t\t:title=\"item.title\"\n\t\t\t\t:text=\"item.text\"\n\t\t\t\t:style=\"item.style\"\n\t\t\t\t:buttonProps=\"item.buttonProps\"\n\t\t\t\t:buttonsProps=\"item.buttonsProps\"\n\t\t\t\t:metaText=\"item.metaText\"\n\t\t\t\t:isSafeHTML=\"item.isSafeHTML\"\n\t\t\t\t:forceClosed=\"item.forceClosed\"\n\t\t\t\t:hightlight=\"item.hightlight\"\n\t\t\t\t@close=\"onCloseItem(item)\"\n\t\t\t/>\n\t\t</div>\n\t</teleport>\n</template>\n\n<style>\n:root {\n\t--top-notice-top: var(--top-padding-4);\n\t--top-notice-right: var(--top-padding-4);\n}\n\n.top-notice {\n\twidth: 400px;\n\tfont-size: 14px;\n\tposition: fixed; top: var(--top-notice-top); right: var(--top-notice-right);\n\tz-index: 1000010;\n\tdisplay: flex; flex-direction: column-reverse; gap: var(--top-gap-2);\n}\n\n.top-notice ul {\n\tpadding: 0 0 0 var(--top-padding-5);\n}\n\n@media only screen and (max-width: 600px) {\n\t:root {\n\t\t--top-notice-top: var(--top-padding-4);\n\t\t--top-notice-right: var(--top-padding-4);\n\t}\n\n\t.top-notice { width: auto; left: var(--top-notice-right); }\n}\n</style>\n","<!-- performance all in one file component, для Core.notice() -->\n<script lang=\"ts\">\nexport { show } from './utils';\n</script>\n\n<script setup lang=\"ts\">\nimport type { Item } from './utils';\nimport { itemById } from './utils';\n\nimport type { Props } from './types';\nimport TopNoticeItem from './item/item.vue';\n\ndefineProps<Props>();\n\nconst onCloseItem = (item: Item) => {\n\titem.onClose?.();\n\n\titemById.delete(item.id);\n};\n</script>\n\n<template>\n\t<teleport to=\"body\">\n\t\t<div class=\"top-notice\">\n\t\t\t<TopNoticeItem\n\t\t\t\tv-for=\"[_index, item] in itemById\"\n\t\t\t\t:key=\"item.id\"\n\t\t\t\t:id=\"item.id\"\n\t\t\t\t:title=\"item.title\"\n\t\t\t\t:text=\"item.text\"\n\t\t\t\t:style=\"item.style\"\n\t\t\t\t:buttonProps=\"item.buttonProps\"\n\t\t\t\t:buttonsProps=\"item.buttonsProps\"\n\t\t\t\t:metaText=\"item.metaText\"\n\t\t\t\t:isSafeHTML=\"item.isSafeHTML\"\n\t\t\t\t:forceClosed=\"item.forceClosed\"\n\t\t\t\t:hightlight=\"item.hightlight\"\n\t\t\t\t@close=\"onCloseItem(item)\"\n\t\t\t/>\n\t\t</div>\n\t</teleport>\n</template>\n\n<style>\n:root {\n\t--top-notice-top: var(--top-padding-4);\n\t--top-notice-right: var(--top-padding-4);\n}\n\n.top-notice {\n\twidth: 400px;\n\tfont-size: 14px;\n\tposition: fixed; top: var(--top-notice-top); right: var(--top-notice-right);\n\tz-index: 1000010;\n\tdisplay: flex; flex-direction: column-reverse; gap: var(--top-gap-2);\n}\n\n.top-notice ul {\n\tpadding: 0 0 0 var(--top-padding-5);\n}\n\n@media only screen and (max-width: 600px) {\n\t:root {\n\t\t--top-notice-top: var(--top-padding-4);\n\t\t--top-notice-right: var(--top-padding-4);\n\t}\n\n\t.top-notice { width: auto; left: var(--top-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AAI,EAAK;GACT,OAAO,EAAK;GACZ,MAAM,EAAK;GACX,OAAK,EAAE,EAAK,MAAK;GACjB,aAAa,EAAK;GAClB,cAAc,EAAK;GACnB,UAAU,EAAK;GACf,YAAY,EAAK;GACjB,aAAa,EAAK;GAClB,YAAY,EAAK;GACjB,UAAK,MAAE,EAAY,EAAI"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define([`require`,`exports`,`./forms-C2ItFa61.amd`,`../utils/dom.amd`,`./worker-BIUaZFVX.amd`],function(t,n,r,i,a){"use strict";if(o===void 0)var o=window.Vue;Object.defineProperty(n,`__esModule`,{value:!0}),n.TopLibPopup=void 0,i=__importDefault(i);var s=class e{constructor(){(0,r.K)(this,`componentName`,void 0),(0,r.K)(this,`className`,void 0),(0,r.K)(this,`uid`,void 0),(0,r.K)(this,`el`,void 0),(0,r.K)(this,`options`,{}),(0,r.K)(this,`unmountEls`,[]),(0,r.K)(this,`unmountEvents`,[])}init(t,n,r){if(!n)throw t+`: el is undefined`;let i=e.getComponent(n,t);if(i)return i.reInit(r),i;this.componentName=t,this.className=`top`+t[0].toUpperCase()+t.substring(1),this.uid=this.componentName+(Math.random()+``).replace(`.`,``),this._setComponent(n),this.el=n,this.el.classList.add(this.className),this.options=Object.assign(this.options,r),this.mount()}static getComponent(e,t){return i.default.storage(e,`#`+t)}_setComponent(e){i.default.storage(e,`#`+this.componentName,this)}mount(){throw`Please, add method mount() to component: `+this.componentName}unmount(){i.default.storage(this.el,`#`+this.componentName,null),this.unmountEls.forEach(e=>{e.remove()}),this.unmountEls=[],this.unmountEvents.forEach(e=>{e.el.removeEventListener(e.type,e.listener,e.options)}),this.unmountEvents=[]}registerElForUnmount(e){this.unmountEls.push(e)}addEventListenerWithUnmount(e,t,n,r){e.addEventListener(t,n,r),this.registerEventForUnmount(e,t,n,r)}registerEventForUnmount(e,t,n,r){let i={el:e,type:t,listener:n,options:r};this.unmountEvents.push(i)}reInit(e){throw`Please, add method reInit() to component: `+this.componentName}static detach(e){if(e instanceof NodeList)e.forEach(e=>e.parentElement?.removeChild(e));else{let t=e;t.parentElement?.removeChild(t)}}};(0,r.K)(s,`componentName`,`Top`);var c=class{static init(){this.isInited||(this.isInited=!0,document.addEventListener(`click`,this.onclickCapture,{capture:!0}),document.addEventListener(`click`,this.onclick),document.addEventListener(`keydown`,this.onkeydown))}static onclickCapture(e){if(e.target instanceof HTMLElement&&e.target.closest(`.top-popup-wrapper`)){if(e.target.matches(`[data-top-popup]`)){let t=e.target.closest(`ul`),n=e.target.closest(`a, .a`);t&&t.querySelector(`a.top-active, .a.top-active`)?.classList.remove(`top-active`),n&&n.classList.add(`top-active`),e.stopPropagation();return}if(e.target.matches(`.top-popup-wrapper`)){let t=e.target;a.t.close(t,!0),e.stopPropagation();return}}}static onclick(e){if(!(e.target instanceof HTMLElement))return;let t=e.target.closest(`.closer, a, .a, .top-button`);if(t){let n=e.target.closest(`.top-popup-wrapper`);if(!n||t.matches(`.top-popup-noCloser`))return;t.getAttribute(`href`)===`.`&&e.preventDefault(),a.t.close(n,!0)}}static onkeydown(e){if(!(e.target instanceof HTMLElement))return;let t=e.target.closest(`.top-popup-wrapper`);if(t||=a.t.getPopupFromOpener(e.target)?.elPopup??null,!t)return;let n=t.querySelector(`ul.top-popup_content`);switch(e.key){case`Escape`:a.t.close(t,!0);break;case`Enter`:if(!n){if(i.default.querySelectorVisible(t,`.preloader`))break;let e=i.default.querySelectorVisible(t,`.top-popup_footer .go, .top-popup_footer [data-action]`);if(e instanceof HTMLElement){e.click();break}let n=i.default.querySelectorVisibleLast(t,`.top-popup_footer .top-button:focus`);n||=i.default.querySelectorVisibleLast(t,`.top-popup_footer .top-button`),n instanceof HTMLElement&&n.click();break}let r=i.default.querySelectorVisible(t,`li > a.top-active`);r&&r.getAttribute(`href`)&&(e.preventDefault(),location.href=r.getAttribute(`href`));let o=t.querySelector(`li > .top-active`);o instanceof HTMLElement&&o.click();break;case`ArrowUp`:case`ArrowRight`:case`ArrowDown`:case`ArrowLeft`:if(!n)break;if(e.key===`ArrowRight`||e.key===`ArrowLeft`){if(i.default.querySelectorVisible(t,`ul.top-popup_content > li:not(.top-popup_liNoSelectable) > .top-active > .top-popup_listMore`))e.preventDefault();else if(e.target.tagName===`INPUT`)break}else e.preventDefault();let s=t.querySelector(`ul.top-popup_content > li:not(.top-popup_liNoSelectable) > .top-active`)?.parentElement;if(e.key===`ArrowRight`&&s){let e=s.querySelector(`.top-active > .top-popup_listMore`);if(e instanceof HTMLElement)return e.click()}let c=i.default.querySelectorAllVisible(t,`ul.top-popup_content > li:not(.top-popup_liNoSelectable)`),l=c.length;if(!l)return;let u=-1;if(s&&(u=c.indexOf(s)),e.key===`ArrowUp`||e.key===`ArrowLeft`?u--:u++,e.key===`ArrowLeft`&&u===-1)return e.target.matches(`input`)?void 0:a.t.close(t,!0);if(e.key===`ArrowRight`&&u===l)return;u<0&&(u=l-1),u>l-1&&(u=0),t.querySelectorAll(`ul.top-popup_content > li > .top-active`).forEach(e=>e.classList.remove(`top-active`)),c[u].querySelector(`:scope > a, :scope > .a`)?.classList.add(`top-active`),a.t.scrollToActive(t);break}}};(0,r.K)(c,`isInited`,!1),r.O.insertStyleToPage(`:root{--top-popup-z-index:200000;--top-popup-transition-delay:.1s;--top-popup-offset:var(--top-padding-2);--top-popup-background-color:var(--color-layout-front-1);--top-popup-background-color-hover:var(--color-layout-front-3);--top-popup-background-color-active:var(--color-layout-front-4);--top-popup-border-color:var(--color-line-2-opacity);--top-popup-title-background-color:var(--color-layer-1);--top-popup-content-padding:calc(var(--top-popup-list-padding) + var(--top-popup-listItem-padding));--top-popup-list-padding:var(--top-padding-2);--top-popup-listItem-radius:var(--top-radius-2);--top-popup-listItem-padding:var(--top-padding-2)}.top-popup-front{position:relative}.top-popup-wrapper{--top-popup-height:0px;--top-popup-right-bounding:0px;--top-popup-bottom-bounding:0px;--top-popup-top:0px;--top-popup-right:calc(100vw - var(--top-popup-right-bounding));--top-popup-bottom:calc(var(--100vh) - var(--top-popup-bottom-bounding));--top-popup-left:0px;--top-popup-margin:-10px;text-align:initial;white-space:normal;word-break:normal;z-index:200000;outline:none;position:absolute}.top-popup-wrapper:not(.top-popup-wrapper-shown){overflow:hidden}.top-popupPanel{cursor:default;box-shadow:var(--top-shadow-b);background:var(--top-popup-background-color);border-radius:14px;flex-direction:column;display:flex;position:absolute;overflow:hidden}.top-popup-wrapper>*{opacity:0;transition:opacity var(--top-popup-transition-delay) linear, transform var(--top-popup-transition-delay) linear;pointer-events:auto}.top-popup-wrapper-shown:not(.top-popup-wrapper-closed)>*{opacity:1;transform:translate(0)!important}.top-popup_header,.top-popup_content,.top-popup_footer{font-size:14px}.top-popup_header,.top-popup_footer{justify-content:space-between;align-items:center;display:flex}.top-popup_header{color:var(--color-text-1);border-bottom:1px solid var(--top-popup-border-color);padding:var(--top-padding-3);font-weight:600}.top-popup_header>*{font-weight:400}.top-popup_header>.a{cursor:pointer}.top-popup_header>.a:hover{color:var(--color-text-primary)}.top-popup_headerButton{width:60px}.top-popup_widget{padding:var(--top-padding-2)}.top-popup_content{gap:var(--top-gap-4);-webkit-overflow-scrolling:touch;flex-direction:column;flex-grow:1;margin:0;display:flex;overflow-y:auto}div.top-popup_content{color:var(--color-text-1);padding:var(--top-popup-content-padding)}div.top-popup_content>*{flex-shrink:0}div.top-popup_content>.top-button{margin:0}div.top-popup_content .top-unwrap{--top-unwrap-x:var(--top-popup-content-padding)}ul.top-popup_content{color:var(--color-text-1);padding:var(--top-popup-list-padding);gap:2px}ul.top-popup_content .top-unwrap{--top-unwrap-x:var(--top-popup-list-padding)}.top-popup_listItem{border-radius:var(--top-popup-listItem-radius);padding:var(--top-popup-listItem-padding);line-height:1!important}ul.top-popup_content li{align-items:center;margin:0;list-style:none;display:flex;position:relative}ul.top-popup_content li>*{flex-grow:1}ul.top-popup_content li>a:not(.top-button),ul.top-popup_content li>.a{cursor:pointer;box-sizing:border-box;border-radius:var(--top-popup-listItem-radius);background:var(--top-popup-background-color);padding:var(--top-popup-listItem-padding);flex:100%;align-items:center;font-size:14px;font-style:normal;transition:background-color .1s ease-in-out;display:flex;color:var(--color-text-1)!important;font-weight:400!important;line-height:1!important;text-decoration:none!important}.top-popup-wrapper-no_animate ul.top-popup_content li>a:not(.top-button),.top-popup-wrapper-no_animate ul.top-popup_content li>.a{transition:none}ul.top-popup_content li>a:not(.top-button):hover,ul.top-popup_content li>.a:hover{background:var(--top-popup-background-color-hover)}ul.top-popup_content li>a:not(.top-button).top-active,ul.top-popup_content li>.a.top-active{background:var(--top-popup-background-color-active);--top-icon-color:var(--color-text-primary)!important}.top-popup_liastItem-withActions{width:240px;max-width:100%}.top-popup_listItemActionsLabel{flex-grow:1}.top-popup_listItemActions{flex-grow:0;min-height:20px;margin-left:auto;display:flex}.top-popup_listItemActions [data-top-icon]{--top-icon-size:20px;--top-icon-color:var(--color-text-4)}.top-popup_listItemActions [data-top-icon]:before{line-height:0}.top-popup_listItemActions [data-top-icon]:hover,.top-popup_listItemActions [data-top-icon].top-active{--top-icon-color:var(--color-text-3)}.top-popup_content+.top-popup_content{padding-top:0}.top-popup_listItem-title{background:var(--color-layer-1);color:var(--color-text-1);font-size:12px}.top-popup_listItem-formControls{flex-direction:column;padding-top:0;padding-bottom:0;display:flex}.top-popup_listItem-delimiter{background:var(--top-popup-border-color);border-radius:3px;height:1px;margin:4px;padding:0}.top-popup_listMore{margin:calc(0px - var(--top-popup-listItem-padding)) calc(0px - var(--top-popup-listItem-padding) / 2) calc(0px - var(--top-popup-listItem-padding)) 0;font-size:20px}.top-popup_listMore.top-button{margin:0}ul.top-popup_content li>.a.top-popup_listMore{text-align:center;flex-basis:10px}ul.top-popup_content li>.a.top-popup_listMore:before{color:var(--color-text-2)}ul.top-popup_content li>*>.top-popup_listMore{color:var(--color-layer-4);margin-left:auto;font-size:14px}ul.top-popup_content li>*>i.top-popup_listMore:hover,ul.top-popup_content li>*>i.top-popup_listMore.top-active{color:var(--color-text-primary)}ul.top-popup_content li>*>i.top-popup_listMore:before{display:block;transform:rotate(90deg)}ul.top-popup_content li a.close{background:0 0!important}.top-popup_content>[data-top-icon]:before{--top-icon-size:20px}ul.top-popup_content li>[data-top-icon]{--top-icon-color:var(--color-text-2);--top-icon-size:20px;--top-icon-width:20px}ul.top-popup_content li>[data-top-icon]:not(.top-button):before{height:1rem;margin-right:8px;transition:color .1s}ul.top-popup_content li:hover>[data-top-icon]:not(.top-button){--top-icon-color:var(--color-text-2)}.top-popup_footer{padding:var(--top-padding-3);border-top:1px solid var(--top-popup-border-color);gap:var(--top-gap-2);justify-content:flex-end;display:flex}.top-popup_footerSupportLink{margin-right:auto}.top-popup>[data-widget]{padding:0 var(--top-popup-list-padding)}.top-popup>[data-widget]+hr{margin:0 var(--top-popup-list-padding)}.top-popup .placeholder{z-index:1;margin:-1px 0;position:relative;background:#f9f9f9!important;border:1px solid #e0d9d9!important;border-left:none!important;border-right:none!important}.top-popup-wrapper.simple_list>.top-popup{white-space:nowrap;min-width:0}.top-popup_content .top-column{flex-direction:column;gap:4px;display:flex}.top-popup li .check_all,.top-popup li .clear_all{cursor:pointer;color:var(--color-text-primary);padding:8px;display:inline-block}.top-popup li .check_all:hover,.top-popup li .clear_all:hover{text-decoration:underline}.top-popup li .clear_all{display:none}.top-popup_content table{margin:-9px 0}.top-popup_content table td,.top-popup_content table th{padding:9px var(--top-popup-listItem-padding) 9px 0;vertical-align:top}.top-popup_content table th{white-space:nowrap;width:40%;font-weight:600}ul.top-popup_content .a>[type=checkbox],ul.top-popup_content .a>[type=radio]{margin:-8px 0 -8px auto}ul.top-popup_content a>[class*=icon],ul.top-popup_content i.a>[class*=icon]{transition:all .1s}.top-popup .buttons{white-space:nowrap;background:#ecf0f1;border-top:1px solid #bdc3c7;border-radius:0 0 4px 4px;margin:10px -15px -10px;padding:10px 15px}.top-popup_footer [class*=btn]:not(.btn-transparent){min-width:100px;margin-left:10px;padding:5px 14px}.top-popup_footer [class*=btn]:first-child{margin-left:0}.top-popup_footer .btn.full_width{flex-grow:1;margin:0}`),r.O.insertStyleToPage(`:root{--top-popup-list-padding:0px;--top-popup-listItem-radius:0px;--top-popup-listItem-padding:var(--top-padding-4)}.top-popup-wrapper{--top-popup-footer-offset:25px;transition:background .3s;position:fixed;overflow:hidden;width:auto!important;height:auto!important;top:0!important;left:0!important;right:0!important}.top-popup-wrapper-shown:not(.top-popup-wrapper-closed){-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);background:#00000080}.top-popup-wrapper-shown:not(.top-popup-wrapper-closed)>.top-popup{opacity:1!important}.top-popup{max-height:calc(100% - var(--header-height,0px) - var(--toolbar-height,0px) - 12px);border-radius:8px 8px 0 0;flex-direction:column;transition:opacity .3s,transform .3s;display:flex;transform:translateY(80%);width:auto!important;top:auto!important;right:0!important;bottom:var(--toolbar-height,0px)!important;margin:0!important;left:0!important}.top-popup-wrapper.p-from-top{--top-popup-footer-offset:0px;top:var(--header-height,0px)!important}.with_dialog .top-popup-wrapper.p-from-top{top:50px!important}.top-popup-wrapper.p-from-top>.top-popup{border-radius:0 0 8px 8px;max-height:calc(100% - 24px);transform:translateY(calc(-100% - 24px));top:0!important;bottom:auto!important}.top-popup_widget:not(.p-from-top){order:10}ul.top-popup_content{gap:0}ul.top-popup_content li:not(:last-child){border-bottom:1px solid var(--top-popup-border-color)}.top-popup-wrapper.top-style_alt>.top-popup>ul>li{border-bottom:none}.top-popup_footer{flex-direction:column-reverse}.top-popup_footer>.top-button{--top-forms-base-height:var(--top-forms-base-height_l);width:100%}ul.top-popup_content .top-popup_listItem-title{--top-popup-padding-v:12px}ul.top-popup_content .top-popup_listItem-delimiter{background:var(--color-line-1-opacity);height:4px;margin:0}ul.top-popup_content li:first-child>.top-popup_listItem-delimiter{border-top:1px solid var(--top-popup-border-color)}`,`m`),r.O.insertStyleToPage(`.top-popup-wrapper{pointer-events:none}.top-popup{min-width:250px;max-width:calc(100vw - var(--top-popup-left) - 16px);max-height:calc(var(--top-popup-bottom) + var(--top-popup-height))}.top-popup-wrapper.p0>*{transform:translateY(-8px)}.top-popup-wrapper.p1>*{transform:translateY(8px)}.top-popup-wrapper.p2>*{transform:translate(8px)}.top-popup-wrapper.p3>*{transform:translateY(8px)}.top-popup-wrapper.p4>*{transform:translate(-8px)}.top-popup-wrapper.p0>.top-popup{top:-16px;left:-8px}.top-popup-wrapper.p1>.top-popup{bottom:calc(100% + 8px)}.top-popup-wrapper.p2>.top-popup{left:calc(100% + 8px)}.top-popup-wrapper.p3>.top-popup{top:calc(100% + 8px)}.top-popup-wrapper.p4>.top-popup{right:calc(100% + 8px)}.top-popup-wrapper.p2>.top-popup,.top-popup-wrapper.p4>.top-popup{margin-top:var(--top-popup-margin)}.top-popup-wrapper.p2.invert-y>.top-popup,.top-popup-wrapper.p4.invert-y>.top-popup{margin-bottom:var(--top-popup-margin)}.top-popup-wrapper.p1.with_notch>.top-popup{margin-bottom:5px}.top-popup-wrapper.p2.with_notch>.top-popup{margin-left:5px}.top-popup-wrapper.p3.with_notch>.top-popup{margin-top:5px}.top-popup-wrapper.p4.with_notch>.top-popup{margin-right:5px}.top-popup-wrapper.invert-x>.top-popup{right:0}.top-popup-wrapper.invert-y>.top-popup{bottom:0}.top-popup-wrapper.p1>.top-popup{max-height:calc(var(--top-popup-top) - var(--header-height,0px) - 16px)}.top-popup-wrapper.p3>.top-popup{max-height:calc(var(--top-popup-bottom) - 16px)}.top-popup-wrapper.p2>.top-popup{max-width:calc(var(--top-popup-right) - 16px)}.top-popup-wrapper.p4>.top-popup{max-width:calc(var(--top-popup-left) - 16px)}.top-popup-wrapper.invert-x>.top-popup{max-width:calc(100vw - var(--top-popup-right) - 16px)}.top-popup-wrapper.invert-y>.top-popup{max-height:calc(100vh - var(--top-popup-bottom) - 16px)}.top-popup-wrapper>.notch{border:7.4px solid #0000;display:block;position:absolute}.top-popup-wrapper.p1>.notch{border-bottom:0;border-top:7.4px solid var(--color-layout-front-1);margin:0 0 7.4px -7.4px;bottom:100%;left:50%}.top-popup-wrapper.p2>.notch{border-left:0;border-right:7.4px solid var(--color-layout-front-1);margin:0 0 -7.4px 7.4px;bottom:50%;left:100%}.top-popup-wrapper.p3>.notch{border-top:0;border-bottom:7.4px solid var(--color-layout-front-1);margin:7.4px 0 0 -7.4px;top:100%;left:50%}.top-popup-wrapper.p4>.notch{border-right:0;border-left:7.4px solid var(--color-layout-front-1);margin:0 7.4px -7.4px 0;bottom:50%;right:100%}.top-popup-wrapper.p1>.notch-border{border-top-color:#0000000d;margin-bottom:6px}.top-popup-wrapper.p2>.notch-border{border-right-color:#0000000d;margin-left:6px}.top-popup-wrapper.p3>.notch-border{border-bottom-color:#0000000d;margin-top:6px}.top-popup-wrapper.p4>.notch-border{border-left-color:#0000000d;margin-right:6px}.top-popup-wrapper.p1.with_notch>.top-popup,.top-popup-wrapper.p3.with_notch>.top-popup{margin-left:-16px!important}.top-popup-wrapper.p1.with_notch>.notch,.top-popup-wrapper.p3.with_notch>.notch{margin-left:-8px!important}.top-popup-wrapper.p1.with_notch.invert-x,.top-popup-wrapper.p3.with_notch.invert-x{margin-left:3px!important}.top-popup-wrapper.p1.with_notch.invert-x>.notch,.top-popup-wrapper.p3.with_notch.invert-x>.notch{margin-left:-9px!important}ul.top-popup_content li>*>i.top-popup_listMore{visibility:hidden;transition:none}ul.top-popup_content li:hover>*>i.top-popup_listMore,ul.top-popup_content li>.top-active>i.top-popup_listMore,ul.top-popup_content li>*>i.top-popup_listMore.top-active{visibility:visible}.top-popup_listItemActions{display:none}.top-popup_listItem.top-active>.top-popup_listItemActions,.top-popup_listItem:hover>.top-popup_listItemActions{display:flex}`,`pc`);var l=class e extends s{constructor(t,n){super(),(0,r.K)(this,`elActiveByDefault`,void 0),(0,r.K)(this,`elPopup`,void 0),(0,r.K)(this,`elPopupInner`,void 0),(0,r.K)(this,`elPopupHeader`,void 0),(0,r.K)(this,`elPopupWidget`,void 0),(0,r.K)(this,`elPopupBody`,void 0),(0,r.K)(this,`elPopupFooter`,void 0),(0,r.K)(this,`elFront`,void 0),(0,r.K)(this,`openerIsInput`,!1),(0,r.K)(this,`popupParent`,void 0),(0,r.K)(this,`$`,void 0),(0,r.K)(this,`elStartPosition`,void 0),(0,r.K)(this,`shift`,{top:0,left:0}),(0,r.K)(this,`isClosed`,!1),(0,r.K)(this,`isFirstClick`,!0),(0,r.K)(this,`type`,void 0),(0,r.K)(this,`options`,{popup:``,p:0,notch:!1,class:``,posBy:`left`,frontSelector:``,invertX:!1,openByHover:!1,useOriginal:!1,transitionDuration:100,isFullScreen:!1}),(0,r.K)(this,`events`,{}),this.init(e.componentName,t,n)}async mount(){if(!(this.el instanceof HTMLElement))return;let t=this.vueGetComponent();if(this.el.closest(`.top-popup-wrapper`)&&(this.popupParent=a.t.getPopup(this.el.closest(`.top-popup-wrapper`))),await this.mountJQuery(),i.default.css(this.el,`position`)!==`absolute`&&(this.el.style.position=`relative`),this.el.dataset.topPopupOpened=`opened`,this.elActiveByDefault=this.el.classList.contains(`top-active`),this.el.classList.add(`top-active`),this.openerIsInput=this.el.classList.contains(`top-input`),this.el.classList.contains(`top-input-project_name`)&&(this.openerIsInput=!1),this.openerIsInput){let e=this.el.querySelector(`input`);e&&!e.__popupOnBlur&&(e.__popupOnBlur=!0,e.addEventListener(`blur`,e=>{let t=e.relatedTarget;t&&a.t.getPopup(t)?.elPopup!==t&&a.t.getClosestPopup(e.relatedTarget,this.el)||a.t.getPopupFromOpener(this.el)?.close()}))}if(t)this.type=`vue`,this.options.popup=``,this.elPopup=i.default.genEl(`div`,{},this.options.popup);else if(this.options.popup?.match(/^[#.]/))this.type=`selector`,this.elPopup=document.querySelector(`${this.options.popup}.template`)||void 0;else{if(this.type=`html`,this.options.useOriginal)throw`Option useOriginal not allowed for text templates`;this.elPopup=i.default.genEl(`div`,{},this.options.popup??``)}if(this.type!==`html`&&!t||t?.opened){if(!t||t?.opened){let e;if(e=t?.opened?t.popup.elPopup:document.querySelector(`${this.options.popup}.top-popup-wrapper-shown`)||void 0,e){this.elPopup=e,this.el.dataset.topPopupOpened=``,this.elActiveByDefault||this.el.classList.remove(`top-active`),a.t.close(this.elPopup),setTimeout(()=>this.mount(),this.options.transitionDuration);return}}this.elPopup||=document.querySelector(`${this.options.popup}:not(.top-popup-wrapper)`)||void 0}if(!this.elPopup)return;for(this.options.useOriginal?(this.elStartPosition=this.elPopup.closest(`.top-popup-el-start-position`),this.elStartPosition||(this.elStartPosition=i.default.wrap(this.elPopup,`i`),this.elStartPosition.classList.add(`top-popup-el-start-position`,`hidden`))):(this.elPopup=this.elPopup.cloneNode(!0),this.type===`selector`&&!this.elPopup.matches(`.template`)&&(this.elPopup.classList.remove(`hidden`),this.elPopup.querySelector(`:scope > .top-popup_content`)||this.elPopup.classList.add(`top-popup_content`),this.elPopup=i.default.wrap(this.elPopup,`div`)),this.type===`html`&&(this.elPopup.querySelector(`:scope > .top-popup_content`)||(this.elPopup.classList.add(`top-popup_content`),this.elPopup=i.default.wrap(this.elPopup,`div`))),(this.type===`selector`&&!this.elPopup.matches(`.template`)||this.type===`html`||this.type===`vue`)&&(i.default.querySelectorAllArray(this.elPopup,`[data-top-popup]`).forEach(e=>{e instanceof HTMLElement&&(e.dataset.topPopupPosBy=`fixed`)}),i.default.querySelectorAllArray(this.elPopup,`.top-popup-wrapper`).forEach(e=>e.remove()))),a.t.decoratorBeforeOpen(this),t&&(this.options.class=t.classRef.value,t.transitionDurationRef.value!==void 0&&(this.options.transitionDuration=t.transitionDurationRef.value,this.elPopup instanceof HTMLElement&&this.elPopup.style.setProperty(`--top-popup-transition-delay`,this.options.transitionDuration+`ms`))),this.elPopupInner=document.createElement(`div`),this.elPopupInner.classList.add(`top-popupPanel`,`top-popup`);this.elPopup.firstChild;)this.elPopupInner.appendChild(this.elPopup.firstChild);if(this.elPopup.append(this.elPopupInner),this.elPopup.classList.add(`top-popup-wrapper`),this.options.class){let e=this.options.class.split(` `);this.elPopup.classList.add(...e)}this.options.notch&&(this.elPopup.classList.add(`with_notch`),this.elPopup.insertAdjacentHTML(`beforeend`,`<i class="notch notch-border"></i><i class="notch"></i>`)),await this.vueOpen(),this.elPopupHeader=this.elPopupInner.querySelector(`.top-popup_header`),this.elPopupWidget=this.elPopupInner.querySelector(`.top-popup_widget`),this.elPopupBody=this.elPopupInner.querySelector(`.top-popup_content`),this.elPopupFooter=this.elPopupInner.querySelector(`.top-popup_footer`);let n=!!this.elPopup.querySelector(`[data-widget="search"]`);if(this.options.isFullScreen&&!n){let e=(0,r.E)();!this.elPopupHeader&&e.Common.Close&&(this.elPopupHeader=i.default.genEl(`i`,{class:`top-popup_header`}),this.elPopupInner.prepend(this.elPopupHeader),this.elPopupHeader.prepend(i.default.genEl(`i`,{class:`a closer`},e.Common.Close)),this.elPopupHeader.append(i.default.genEl(`i`,{class:`top-popup_headerButton`})))}i.default.storage(this.elPopup,e.componentName,this),this.options.frontSelector&&(this.elFront=document.querySelector(this.options.frontSelector)),this.elFront||=this.el.closest(`.top-popup-front`),this.elFront||=document.body,this.elPopup instanceof HTMLElement&&(this.elPopup.style.width=this.el.offsetWidth+`px`,this.elPopup.style.height=this.el.offsetHeight+`px`,this.elPopup.style.top=this.el.offsetTop+`px`,this.elPopup.style.right=parseInt(this.el.style.right||`0`)+`px`,this.elPopup.style.bottom=parseInt(this.el.style.bottom||`0`)+`px`),this.el.parentElement?.insertBefore(this.elPopup,this.el),this.elPopup.classList.remove(`template`),this.options.invertX&&this.elPopup.classList.add(`invert-x`);let o=!!this.el.closest(`.modal-header`);o||=!!this.el.closest(`#top_panel`),o||=!!this.el.closest(`#secondmenu`),o&&this.elPopup.classList.add(`p-from-top`),setTimeout(()=>this.elPopup?.classList.add(`top-popup-wrapper-shown`)),this.elFront&&!this.elFront.matches(`body`)&&(this.elFront.append(this.elPopup),this.shift.top=i.default.offset(this.el).top-this.el.offsetTop-i.default.offset(this.elFront).top,this.shift.left=i.default.offset(this.el).left-this.el.offsetLeft-i.default.offset(this.elFront).left,this.shift.top-=parseInt(this.el.style[`margin-top`]||0),this.shift.left-=parseInt(this.el.style[`margin-left`]||0),this.elPopup instanceof HTMLElement&&(this.elPopup.style.top=parseInt(this.elPopup.style.top||`0`)+this.shift.top+`px`,this.elPopup.style.left=parseInt(this.elPopup.style.left||`0`)+this.shift.left+`px`)),this.$&&r.O.$&&this.$.trigger(`aftershow.top-menu-popup`,[r.O.$(this.elPopup)]),this.recalcPosition(),this.elPopup.setAttribute(`tabindex`,`0`),this.focus(),a.t.decoratorAfterOpen(this),this.mountEvents()}async mountJQuery(){r.O.$&&(this.$=r.O.$(this.el))}focus(){let e;this.elPopup&&(e=i.default.querySelectorVisible(this.elPopup,`.top-popup-autofocus`),e||=i.default.querySelectorVisible(this.elPopup,`:read-write, select:not(:disabled)`),e||=i.default.querySelectorVisible(this.elPopup,`.top-popup_footer .top-button`),!e&&!this.openerIsInput&&(e=this.elPopup),e instanceof HTMLElement&&e.focus({preventScroll:!0}),setTimeout(()=>{e instanceof HTMLElement&&e.focus({preventScroll:!0})},this.options.transitionDuration))}mountEvents(){this.addEventListenerWithUnmount(document,`mousedown`,e=>this.onMousedown(e)),this.openerIsInput?this.onFocusCloseOthers():this.elPopup&&this.elPopupInner&&(this.addEventListenerWithUnmount(this.elPopup,`focus`,e=>this.onFocus(e)),this.options.openByHover&&(this.addEventListenerWithUnmount(this.elPopup,`mouseleave`,e=>this.onMouseleave(e)),this.addEventListenerWithUnmount(this.elPopupInner,`mouseleave`,e=>this.onMouseleave(e)))),this.options.isFullScreen&&this.elPopupBody&&this.addEventListenerWithUnmount(this.elPopupBody,`touchmove`,e=>this.onTouchmove(e))}onMousedown(e){if(!this.elPopup||!(e.target instanceof Element)||!this.isFirstClick||(this.isFirstClick=!1,setTimeout(()=>this.isFirstClick=!0),e instanceof MouseEvent&&e.button!==0))return;let t=i.default.querySelectorVisibleLast(document.body,`:scope > .top-popup-wrapper`);if(t&&t!==this.elPopup||e.target.closest(`.top-popup-front`)&&(t=i.default.querySelectorVisibleLast(e.target.closest(`.top-popup-front`),`:scope > .top-popup-wrapper`),t&&t!==this.elPopup))return;if(e.target.closest(`[data-top-popup-id="${this.options.id}"]`)){e.preventDefault();return}let n=e.target.closest(`input, select, textarea, button, [tabindex]`);n===this.elPopup&&(n=null);let r=!n;r&&this.openerIsInput&&e.preventDefault(),!this.elPopup.contains(e.target)&&(this.elPopup.closest(`.ui-dialog`)&&!e.target.closest(`.ui-dialog`)||a.t.decoratorIsIgnoreOuterClick(e)||a.t.close(this.elPopup,r))}onFocus(e){e.target instanceof Element&&e.target.matches(`input`)||this.onFocusCloseOthers()}onFocusCloseOthers(){this.isClosed||a.t.getAllVisible().forEach(e=>{this.elPopup?.contains(e)||this.popupParent?.elPopup===e||this.popupParent?.popupParent?.elPopup===e||a.t.close(e)})}onMouseleave(e){setTimeout(()=>{this.elPopupInner&&this.elPopupInner.matches(`:hover`)||!this.elPopup||a.t.close(this.elPopup)},100)}onResize(){this.elPopup&&this.elPopup.parentElement!==document.body&&document.body.append(this.elPopup),this.elPopup instanceof HTMLElement&&(this.elPopup.style.top=i.default.offset(this.el).top+`px`,this.elPopup.style.left=i.default.offset(this.el).left+`px`)}unmount(){super.unmount(),this.el instanceof HTMLElement&&(this.el.dataset.topPopupOpened=``),this.elActiveByDefault||this.el.classList.remove(`top-active`);let e=this.el.getAttribute(`style`);e&&(e=e.replace(/position:[^;]*;?/g,``),this.el.setAttribute(`style`,e))}recalcPosition(e){if(!(this.elPopup instanceof HTMLElement))return;let t=e??this.options.p,n;if(this.el instanceof HTMLElement)switch(this.elPopup.style.height=this.el.offsetHeight+`px`,this.elPopup.classList.remove(`p0`,`p1`,`p2`,`p3`,`p4`),this.elPopup.classList.add(`p`+t),this.options.posBy){case`left`:n=this.el.offsetLeft+parseInt(this.el.style[`margin-left`]||`0`),n+=this.shift.left,this.elPopup.style.left=n+`px`;break;case`right`:if(!(this.el.offsetParent instanceof HTMLElement))break;n=this.el.offsetLeft+parseInt(this.el.style[`margin-left`]||`0`),this.elPopup.style.right=this.el.offsetParent.offsetWidth-this.el.offsetWidth-n+`px`;break;case`fixed`:this.addEventListenerWithUnmount(window,`resize`,()=>this.onResize()),this.onResize();break;default:this.options.posBy?.append(this.elPopup)}let r=this.elPopup.getBoundingClientRect();this.elPopup.style.setProperty(`--top-popup-height`,this.elPopup.offsetHeight+`px`),this.elPopup.style.setProperty(`--top-popup-right-bounding`,r.right+`px`),this.elPopup.style.setProperty(`--top-popup-bottom-bounding`,r.bottom+`px`),this.elPopup.style.setProperty(`--top-popup-top`,r.top+`px`),this.elPopup.style.setProperty(`--top-popup-left`,r.left+`px`),this.elPopupInner instanceof HTMLElement&&(this.elPopupInner.style.maxWidth=`unset`,this.elPopupInner.style.maxHeight=`unset`);let o={top:!1,right:!1,bottom:!1,left:!1},s={top:!1,right:!1,bottom:!1,left:!1},c=r.left>window.innerWidth/2,l=r.top>window.innerHeight/2;t===4&&(c=!c),t===1&&(l=!l);let u=this.elPopupInner?.getBoundingClientRect(),d,f,p=i.default.cssNumber(this.elPopup,`--top-popup-offset`),m=this.el.offsetHeight,h=this.el.offsetWidth;u&&(d=window.innerWidth-u.right,f=window.innerHeight-u.bottom,u.top<p&&(o.top=!0,u.top<p*2-u.height+m&&(s.top=!0)),d<p&&(o.right=!0,d<p*2-u.width+h&&(s.right=!0)),f<p&&(o.bottom=!0,f<p*2-u.height+m&&(s.bottom=!0)),u.left<p&&(o.left=!0,u.left<p*2-u.width+m&&(s.left=!0)));let g=(e,t)=>{if(e===`x`){if(!o.right&&!o.left||(t===1||t===3)&&!s.right&&!s.left&&c)return t;o.right&&(t===0||t===2)&&c&&(t=4),o.left&&(t===0||t===4)&&c&&(t=2)}if(e===`y`){if(!o.top&&!o.bottom||(t===2||t===4)&&!s.top&&!s.bottom&&l)return t;o.top&&(t===0||t===1)&&l&&(t=3),o.bottom&&l&&(t=1)}return t},_=[`x`,`y`];(t===0||t===1||t===3)&&(_=[`y`,`x`]);let v=t??0;_.forEach(e=>{v=g(e,v)}),t=v,o.bottom&&(t===2||t===4)&&l&&this.elPopup.classList.add(`invert-y`),o.right&&(t===0||t===1||t===3)&&this.elPopup.classList.add(`invert-x`),this.elPopup.classList.remove(`p0`,`p1`,`p2`,`p3`,`p4`),this.elPopup.classList.add(`p`+t),this.elPopupInner instanceof HTMLElement&&(this.elPopupInner.style.maxWidth=``,this.elPopupInner.style.maxHeight=``),a.t.scrollToActive(this.elPopup)}onTouchmove(e){if(e.currentTarget instanceof HTMLElement&&e.target instanceof HTMLElement){if(e.currentTarget.scrollWidth>e.currentTarget.offsetWidth||e.target.parentElement?.scrollWidth&&e.target.parentElement?.offsetWidth&&e.target.parentElement.scrollWidth>e.target.parentElement?.offsetWidth)return;e.currentTarget.matches(`.has_scroll`)||e.preventDefault()}}close(){this.isClosed||(this.isClosed=!0,this.$&&r.O.$&&this.elPopup&&this.$.trigger(`afterclose.top-menu-popup`,[r.O.$(this.elPopup)]),!a.t.noClose&&(this.unmount(),this.elPopup?.classList.add(`top-popup-wrapper-closed`),setTimeout(()=>{if(this.vueClose(),!this.elPopup)return;this.options.useOriginal?(this.elPopup.removeAttribute(`style`),this.elPopup.classList.remove(`top-popup-wrapper-shown`,`top-popup-wrapper-closed`),this.elPopup.classList.add(`template`),this.elStartPosition?.append(this.elPopup),this.elPopup.querySelector(`div.top-popup_content.top-column`)?.classList.remove(`top-column`),this.elPopup.querySelector(`.notch-border`)?.remove(),this.elPopup.querySelector(`.notch`)?.remove(),this.elPopupInner?.replaceWith(...this.elPopupInner.childNodes),i.default.storageClear(this.elPopup)):(i.default.storageClear(this.elPopup),this.elPopup.remove(),delete this.elPopup);let e=a.t.getAllVisible(),t=e.length&&e[e.length-1];t?a.t.getPopup(t).focus():document.documentElement.classList.remove(`with_popup`)},this.options.transitionDuration)))}async vueOpen(){await this.vueGetComponent()?.onOpen(this)}vueClose(){this.vueGetComponent()?.onClose(this)}vueGetComponent(){if(this.el instanceof HTMLElement&&this.options.id)return a.t.vueConnectors.get(this.options.id)}};n.TopLibPopup=l,(0,r.K)(l,`componentName`,`TopPopup`),c.init()});
|
|
2
|
-
//# sourceMappingURL=popup-
|
|
1
|
+
var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define([`require`,`exports`,`./forms-Dh7-1Uy3.amd`,`../utils/dom.amd`,`./worker-BcZMXB0d.amd`],function(t,n,r,i,a){"use strict";if(o===void 0)var o=window.Vue;Object.defineProperty(n,`__esModule`,{value:!0}),n.TopLibPopup=void 0,i=__importDefault(i);var s=class e{constructor(){(0,r.K)(this,`componentName`,void 0),(0,r.K)(this,`className`,void 0),(0,r.K)(this,`uid`,void 0),(0,r.K)(this,`el`,void 0),(0,r.K)(this,`options`,{}),(0,r.K)(this,`unmountEls`,[]),(0,r.K)(this,`unmountEvents`,[])}init(t,n,r){if(!n)throw t+`: el is undefined`;let i=e.getComponent(n,t);if(i)return i.reInit(r),i;this.componentName=t,this.className=`top`+t[0].toUpperCase()+t.substring(1),this.uid=this.componentName+(Math.random()+``).replace(`.`,``),this._setComponent(n),this.el=n,this.el.classList.add(this.className),this.options=Object.assign(this.options,r),this.mount()}static getComponent(e,t){return i.default.storage(e,`#`+t)}_setComponent(e){i.default.storage(e,`#`+this.componentName,this)}mount(){throw`Please, add method mount() to component: `+this.componentName}unmount(){i.default.storage(this.el,`#`+this.componentName,null),this.unmountEls.forEach(e=>{e.remove()}),this.unmountEls=[],this.unmountEvents.forEach(e=>{e.el.removeEventListener(e.type,e.listener,e.options)}),this.unmountEvents=[]}registerElForUnmount(e){this.unmountEls.push(e)}addEventListenerWithUnmount(e,t,n,r){e.addEventListener(t,n,r),this.registerEventForUnmount(e,t,n,r)}registerEventForUnmount(e,t,n,r){let i={el:e,type:t,listener:n,options:r};this.unmountEvents.push(i)}reInit(e){throw`Please, add method reInit() to component: `+this.componentName}static detach(e){if(e instanceof NodeList)e.forEach(e=>e.parentElement?.removeChild(e));else{let t=e;t.parentElement?.removeChild(t)}}};(0,r.K)(s,`componentName`,`Top`);var c=class{static init(){this.isInited||(this.isInited=!0,document.addEventListener(`click`,this.onclickCapture,{capture:!0}),document.addEventListener(`click`,this.onclick),document.addEventListener(`keydown`,this.onkeydown))}static onclickCapture(e){if(e.target instanceof HTMLElement&&e.target.closest(`.top-popup-wrapper`)){if(e.target.matches(`[data-top-popup]`)){let t=e.target.closest(`ul`),n=e.target.closest(`a, .a`);t&&t.querySelector(`a.top-active, .a.top-active`)?.classList.remove(`top-active`),n&&n.classList.add(`top-active`),e.stopPropagation();return}if(e.target.matches(`.top-popup-wrapper`)){let t=e.target;a.t.close(t,!0),e.stopPropagation();return}}}static onclick(e){if(!(e.target instanceof HTMLElement))return;let t=e.target.closest(`.closer, a, .a, .top-button`);if(t){let n=e.target.closest(`.top-popup-wrapper`);if(!n||t.matches(`.top-popup-noCloser`))return;t.getAttribute(`href`)===`.`&&e.preventDefault(),a.t.close(n,!0)}}static onkeydown(e){if(!(e.target instanceof HTMLElement))return;let t=e.target.closest(`.top-popup-wrapper`);if(t||=a.t.getPopupFromOpener(e.target)?.elPopup??null,!t)return;let n=t.querySelector(`ul.top-popup_content`);switch(e.key){case`Escape`:a.t.close(t,!0);break;case`Enter`:if(!n){if(i.default.querySelectorVisible(t,`.preloader`))break;let e=i.default.querySelectorVisible(t,`.top-popup_footer .go, .top-popup_footer [data-action]`);if(e instanceof HTMLElement){e.click();break}let n=i.default.querySelectorVisibleLast(t,`.top-popup_footer .top-button:focus`);n||=i.default.querySelectorVisibleLast(t,`.top-popup_footer .top-button`),n instanceof HTMLElement&&n.click();break}let r=i.default.querySelectorVisible(t,`li > a.top-active`);r&&r.getAttribute(`href`)&&(e.preventDefault(),location.href=r.getAttribute(`href`));let o=t.querySelector(`li > .top-active`);o instanceof HTMLElement&&o.click();break;case`ArrowUp`:case`ArrowRight`:case`ArrowDown`:case`ArrowLeft`:if(!n)break;if(e.key===`ArrowRight`||e.key===`ArrowLeft`){if(i.default.querySelectorVisible(t,`ul.top-popup_content > li:not(.top-popup_liNoSelectable) > .top-active > .top-popup_listMore`))e.preventDefault();else if(e.target.tagName===`INPUT`)break}else e.preventDefault();let s=t.querySelector(`ul.top-popup_content > li:not(.top-popup_liNoSelectable) > .top-active`)?.parentElement;if(e.key===`ArrowRight`&&s){let e=s.querySelector(`.top-active > .top-popup_listMore`);if(e instanceof HTMLElement)return e.click()}let c=i.default.querySelectorAllVisible(t,`ul.top-popup_content > li:not(.top-popup_liNoSelectable)`),l=c.length;if(!l)return;let u=-1;if(s&&(u=c.indexOf(s)),e.key===`ArrowUp`||e.key===`ArrowLeft`?u--:u++,e.key===`ArrowLeft`&&u===-1)return e.target.matches(`input`)?void 0:a.t.close(t,!0);if(e.key===`ArrowRight`&&u===l)return;u<0&&(u=l-1),u>l-1&&(u=0),t.querySelectorAll(`ul.top-popup_content > li > .top-active`).forEach(e=>e.classList.remove(`top-active`)),c[u].querySelector(`:scope > a, :scope > .a`)?.classList.add(`top-active`),a.t.scrollToActive(t);break}}};(0,r.K)(c,`isInited`,!1),r.O.insertStyleToPage(`:root{--top-popup-z-index:200000;--top-popup-transition-delay:.1s;--top-popup-offset:var(--top-padding-2);--top-popup-background-color:var(--color-layout-front-1);--top-popup-background-color-hover:var(--color-layout-front-3);--top-popup-background-color-active:var(--color-layout-front-4);--top-popup-border-color:var(--color-line-2-opacity);--top-popup-title-background-color:var(--color-layer-1);--top-popup-content-padding:calc(var(--top-popup-list-padding) + var(--top-popup-listItem-padding));--top-popup-list-padding:var(--top-padding-2);--top-popup-listItem-radius:var(--top-radius-2);--top-popup-listItem-padding:var(--top-padding-2)}.top-popup-front{position:relative}.top-popup-wrapper{--top-popup-height:0px;--top-popup-right-bounding:0px;--top-popup-bottom-bounding:0px;--top-popup-top:0px;--top-popup-right:calc(100vw - var(--top-popup-right-bounding));--top-popup-bottom:calc(var(--100vh) - var(--top-popup-bottom-bounding));--top-popup-left:0px;--top-popup-margin:-10px;text-align:initial;white-space:normal;word-break:normal;z-index:200000;outline:none;position:absolute}.top-popup-wrapper:not(.top-popup-wrapper-shown){overflow:hidden}.top-popupPanel{cursor:default;box-shadow:var(--top-shadow-b);background:var(--top-popup-background-color);border-radius:14px;flex-direction:column;display:flex;position:absolute;overflow:hidden}.top-popup-wrapper>*{opacity:0;transition:opacity var(--top-popup-transition-delay) linear, transform var(--top-popup-transition-delay) linear;pointer-events:auto}.top-popup-wrapper-shown:not(.top-popup-wrapper-closed)>*{opacity:1;transform:translate(0)!important}.top-popup_header,.top-popup_content,.top-popup_footer{font-size:14px}.top-popup_header,.top-popup_footer{justify-content:space-between;align-items:center;display:flex}.top-popup_header{color:var(--color-text-1);border-bottom:1px solid var(--top-popup-border-color);padding:var(--top-padding-3);font-weight:600}.top-popup_header>*{font-weight:400}.top-popup_header>.a{cursor:pointer}.top-popup_header>.a:hover{color:var(--color-text-primary)}.top-popup_headerButton{width:60px}.top-popup_widget{padding:var(--top-padding-2)}.top-popup_content{gap:var(--top-gap-4);-webkit-overflow-scrolling:touch;flex-direction:column;flex-grow:1;margin:0;display:flex;overflow-y:auto}div.top-popup_content{color:var(--color-text-1);padding:var(--top-popup-content-padding)}div.top-popup_content>*{flex-shrink:0}div.top-popup_content>.top-button{margin:0}div.top-popup_content .top-unwrap{--top-unwrap-x:var(--top-popup-content-padding)}ul.top-popup_content{color:var(--color-text-1);padding:var(--top-popup-list-padding);gap:2px}ul.top-popup_content .top-unwrap{--top-unwrap-x:var(--top-popup-list-padding)}.top-popup_listItem{border-radius:var(--top-popup-listItem-radius);padding:var(--top-popup-listItem-padding);line-height:1!important}ul.top-popup_content li{align-items:center;margin:0;list-style:none;display:flex;position:relative}ul.top-popup_content li>*{flex-grow:1}ul.top-popup_content li>a:not(.top-button),ul.top-popup_content li>.a{cursor:pointer;box-sizing:border-box;border-radius:var(--top-popup-listItem-radius);background:var(--top-popup-background-color);padding:var(--top-popup-listItem-padding);flex:100%;align-items:center;font-size:14px;font-style:normal;transition:background-color .1s ease-in-out;display:flex;color:var(--color-text-1)!important;font-weight:400!important;line-height:1!important;text-decoration:none!important}.top-popup-wrapper-no_animate ul.top-popup_content li>a:not(.top-button),.top-popup-wrapper-no_animate ul.top-popup_content li>.a{transition:none}ul.top-popup_content li>a:not(.top-button):hover,ul.top-popup_content li>.a:hover{background:var(--top-popup-background-color-hover)}ul.top-popup_content li>a:not(.top-button).top-active,ul.top-popup_content li>.a.top-active{background:var(--top-popup-background-color-active);--top-icon-color:var(--color-text-primary)!important}.top-popup_liastItem-withActions{width:240px;max-width:100%}.top-popup_listItemActionsLabel{flex-grow:1}.top-popup_listItemActions{flex-grow:0;min-height:20px;margin-left:auto;display:flex}.top-popup_listItemActions [data-top-icon]{--top-icon-size:20px;--top-icon-color:var(--color-text-4)}.top-popup_listItemActions [data-top-icon]:before{line-height:0}.top-popup_listItemActions [data-top-icon]:hover,.top-popup_listItemActions [data-top-icon].top-active{--top-icon-color:var(--color-text-3)}.top-popup_content+.top-popup_content{padding-top:0}.top-popup_listItem-title{background:var(--color-layer-1);color:var(--color-text-1);font-size:12px}.top-popup_listItem-formControls{flex-direction:column;padding-top:0;padding-bottom:0;display:flex}.top-popup_listItem-delimiter{background:var(--top-popup-border-color);border-radius:3px;height:1px;margin:4px;padding:0}.top-popup_listMore{margin:calc(0px - var(--top-popup-listItem-padding)) calc(0px - var(--top-popup-listItem-padding) / 2) calc(0px - var(--top-popup-listItem-padding)) 0;font-size:20px}.top-popup_listMore.top-button{margin:0}ul.top-popup_content li>.a.top-popup_listMore{text-align:center;flex-basis:10px}ul.top-popup_content li>.a.top-popup_listMore:before{color:var(--color-text-2)}ul.top-popup_content li>*>.top-popup_listMore{color:var(--color-layer-4);margin-left:auto;font-size:14px}ul.top-popup_content li>*>i.top-popup_listMore:hover,ul.top-popup_content li>*>i.top-popup_listMore.top-active{color:var(--color-text-primary)}ul.top-popup_content li>*>i.top-popup_listMore:before{display:block;transform:rotate(90deg)}ul.top-popup_content li a.close{background:0 0!important}.top-popup_content>[data-top-icon]:before{--top-icon-size:20px}ul.top-popup_content li>[data-top-icon]{--top-icon-color:var(--color-text-2);--top-icon-size:20px;--top-icon-width:20px}ul.top-popup_content li>[data-top-icon]:not(.top-button):before{height:1rem;margin-right:8px;transition:color .1s}ul.top-popup_content li:hover>[data-top-icon]:not(.top-button){--top-icon-color:var(--color-text-2)}.top-popup_footer{padding:var(--top-padding-3);border-top:1px solid var(--top-popup-border-color);gap:var(--top-gap-2);justify-content:flex-end;display:flex}.top-popup_footerSupportLink{margin-right:auto}.top-popup>[data-widget]{padding:0 var(--top-popup-list-padding)}.top-popup>[data-widget]+hr{margin:0 var(--top-popup-list-padding)}.top-popup .placeholder{z-index:1;margin:-1px 0;position:relative;background:#f9f9f9!important;border:1px solid #e0d9d9!important;border-left:none!important;border-right:none!important}.top-popup-wrapper.simple_list>.top-popup{white-space:nowrap;min-width:0}.top-popup_content .top-column{flex-direction:column;gap:4px;display:flex}.top-popup li .check_all,.top-popup li .clear_all{cursor:pointer;color:var(--color-text-primary);padding:8px;display:inline-block}.top-popup li .check_all:hover,.top-popup li .clear_all:hover{text-decoration:underline}.top-popup li .clear_all{display:none}.top-popup_content table{margin:-9px 0}.top-popup_content table td,.top-popup_content table th{padding:9px var(--top-popup-listItem-padding) 9px 0;vertical-align:top}.top-popup_content table th{white-space:nowrap;width:40%;font-weight:600}ul.top-popup_content .a>[type=checkbox],ul.top-popup_content .a>[type=radio]{margin:-8px 0 -8px auto}ul.top-popup_content a>[class*=icon],ul.top-popup_content i.a>[class*=icon]{transition:all .1s}.top-popup .buttons{white-space:nowrap;background:#ecf0f1;border-top:1px solid #bdc3c7;border-radius:0 0 4px 4px;margin:10px -15px -10px;padding:10px 15px}.top-popup_footer [class*=btn]:not(.btn-transparent){min-width:100px;margin-left:10px;padding:5px 14px}.top-popup_footer [class*=btn]:first-child{margin-left:0}.top-popup_footer .btn.full_width{flex-grow:1;margin:0}`),r.O.insertStyleToPage(`:root{--top-popup-list-padding:0px;--top-popup-listItem-radius:0px;--top-popup-listItem-padding:var(--top-padding-4)}.top-popup-wrapper{--top-popup-footer-offset:25px;transition:background .3s;position:fixed;overflow:hidden;width:auto!important;height:auto!important;top:0!important;left:0!important;right:0!important}.top-popup-wrapper-shown:not(.top-popup-wrapper-closed){-webkit-backdrop-filter:blur(1px);backdrop-filter:blur(1px);background:#00000080}.top-popup-wrapper-shown:not(.top-popup-wrapper-closed)>.top-popup{opacity:1!important}.top-popup{max-height:calc(100% - var(--header-height,0px) - var(--toolbar-height,0px) - 12px);border-radius:8px 8px 0 0;flex-direction:column;transition:opacity .3s,transform .3s;display:flex;transform:translateY(80%);width:auto!important;top:auto!important;right:0!important;bottom:var(--toolbar-height,0px)!important;margin:0!important;left:0!important}.top-popup-wrapper.p-from-top{--top-popup-footer-offset:0px;top:var(--header-height,0px)!important}.with_dialog .top-popup-wrapper.p-from-top{top:50px!important}.top-popup-wrapper.p-from-top>.top-popup{border-radius:0 0 8px 8px;max-height:calc(100% - 24px);transform:translateY(calc(-100% - 24px));top:0!important;bottom:auto!important}.top-popup_widget:not(.p-from-top){order:10}ul.top-popup_content{gap:0}ul.top-popup_content li:not(:last-child){border-bottom:1px solid var(--top-popup-border-color)}.top-popup-wrapper.top-style_alt>.top-popup>ul>li{border-bottom:none}.top-popup_footer{flex-direction:column-reverse}.top-popup_footer>.top-button{--top-forms-base-height:var(--top-forms-base-height_l);width:100%}ul.top-popup_content .top-popup_listItem-title{--top-popup-padding-v:12px}ul.top-popup_content .top-popup_listItem-delimiter{background:var(--color-line-1-opacity);height:4px;margin:0}ul.top-popup_content li:first-child>.top-popup_listItem-delimiter{border-top:1px solid var(--top-popup-border-color)}`,`m`),r.O.insertStyleToPage(`.top-popup-wrapper{pointer-events:none}.top-popup{min-width:250px;max-width:calc(100vw - var(--top-popup-left) - 16px);max-height:calc(var(--top-popup-bottom) + var(--top-popup-height))}.top-popup-wrapper.p0>*{transform:translateY(-8px)}.top-popup-wrapper.p1>*{transform:translateY(8px)}.top-popup-wrapper.p2>*{transform:translate(8px)}.top-popup-wrapper.p3>*{transform:translateY(8px)}.top-popup-wrapper.p4>*{transform:translate(-8px)}.top-popup-wrapper.p0>.top-popup{top:-16px;left:-8px}.top-popup-wrapper.p1>.top-popup{bottom:calc(100% + 8px)}.top-popup-wrapper.p2>.top-popup{left:calc(100% + 8px)}.top-popup-wrapper.p3>.top-popup{top:calc(100% + 8px)}.top-popup-wrapper.p4>.top-popup{right:calc(100% + 8px)}.top-popup-wrapper.p2>.top-popup,.top-popup-wrapper.p4>.top-popup{margin-top:var(--top-popup-margin)}.top-popup-wrapper.p2.invert-y>.top-popup,.top-popup-wrapper.p4.invert-y>.top-popup{margin-bottom:var(--top-popup-margin)}.top-popup-wrapper.p1.with_notch>.top-popup{margin-bottom:5px}.top-popup-wrapper.p2.with_notch>.top-popup{margin-left:5px}.top-popup-wrapper.p3.with_notch>.top-popup{margin-top:5px}.top-popup-wrapper.p4.with_notch>.top-popup{margin-right:5px}.top-popup-wrapper.invert-x>.top-popup{right:0}.top-popup-wrapper.invert-y>.top-popup{bottom:0}.top-popup-wrapper.p1>.top-popup{max-height:calc(var(--top-popup-top) - var(--header-height,0px) - 16px)}.top-popup-wrapper.p3>.top-popup{max-height:calc(var(--top-popup-bottom) - 16px)}.top-popup-wrapper.p2>.top-popup{max-width:calc(var(--top-popup-right) - 16px)}.top-popup-wrapper.p4>.top-popup{max-width:calc(var(--top-popup-left) - 16px)}.top-popup-wrapper.invert-x>.top-popup{max-width:calc(100vw - var(--top-popup-right) - 16px)}.top-popup-wrapper.invert-y>.top-popup{max-height:calc(100vh - var(--top-popup-bottom) - 16px)}.top-popup-wrapper>.notch{border:7.4px solid #0000;display:block;position:absolute}.top-popup-wrapper.p1>.notch{border-bottom:0;border-top:7.4px solid var(--color-layout-front-1);margin:0 0 7.4px -7.4px;bottom:100%;left:50%}.top-popup-wrapper.p2>.notch{border-left:0;border-right:7.4px solid var(--color-layout-front-1);margin:0 0 -7.4px 7.4px;bottom:50%;left:100%}.top-popup-wrapper.p3>.notch{border-top:0;border-bottom:7.4px solid var(--color-layout-front-1);margin:7.4px 0 0 -7.4px;top:100%;left:50%}.top-popup-wrapper.p4>.notch{border-right:0;border-left:7.4px solid var(--color-layout-front-1);margin:0 7.4px -7.4px 0;bottom:50%;right:100%}.top-popup-wrapper.p1>.notch-border{border-top-color:#0000000d;margin-bottom:6px}.top-popup-wrapper.p2>.notch-border{border-right-color:#0000000d;margin-left:6px}.top-popup-wrapper.p3>.notch-border{border-bottom-color:#0000000d;margin-top:6px}.top-popup-wrapper.p4>.notch-border{border-left-color:#0000000d;margin-right:6px}.top-popup-wrapper.p1.with_notch>.top-popup,.top-popup-wrapper.p3.with_notch>.top-popup{margin-left:-16px!important}.top-popup-wrapper.p1.with_notch>.notch,.top-popup-wrapper.p3.with_notch>.notch{margin-left:-8px!important}.top-popup-wrapper.p1.with_notch.invert-x,.top-popup-wrapper.p3.with_notch.invert-x{margin-left:3px!important}.top-popup-wrapper.p1.with_notch.invert-x>.notch,.top-popup-wrapper.p3.with_notch.invert-x>.notch{margin-left:-9px!important}ul.top-popup_content li>*>i.top-popup_listMore{visibility:hidden;transition:none}ul.top-popup_content li:hover>*>i.top-popup_listMore,ul.top-popup_content li>.top-active>i.top-popup_listMore,ul.top-popup_content li>*>i.top-popup_listMore.top-active{visibility:visible}.top-popup_listItemActions{display:none}.top-popup_listItem.top-active>.top-popup_listItemActions,.top-popup_listItem:hover>.top-popup_listItemActions{display:flex}`,`pc`);var l=class e extends s{constructor(t,n){super(),(0,r.K)(this,`elActiveByDefault`,void 0),(0,r.K)(this,`elPopup`,void 0),(0,r.K)(this,`elPopupInner`,void 0),(0,r.K)(this,`elPopupHeader`,void 0),(0,r.K)(this,`elPopupWidget`,void 0),(0,r.K)(this,`elPopupBody`,void 0),(0,r.K)(this,`elPopupFooter`,void 0),(0,r.K)(this,`elFront`,void 0),(0,r.K)(this,`openerIsInput`,!1),(0,r.K)(this,`popupParent`,void 0),(0,r.K)(this,`$`,void 0),(0,r.K)(this,`elStartPosition`,void 0),(0,r.K)(this,`shift`,{top:0,left:0}),(0,r.K)(this,`isClosed`,!1),(0,r.K)(this,`isFirstClick`,!0),(0,r.K)(this,`type`,void 0),(0,r.K)(this,`options`,{popup:``,p:0,notch:!1,class:``,posBy:`left`,frontSelector:``,invertX:!1,openByHover:!1,useOriginal:!1,transitionDuration:100,isFullScreen:!1}),(0,r.K)(this,`events`,{}),this.init(e.componentName,t,n)}async mount(){if(!(this.el instanceof HTMLElement))return;let t=this.vueGetComponent();if(this.el.closest(`.top-popup-wrapper`)&&(this.popupParent=a.t.getPopup(this.el.closest(`.top-popup-wrapper`))),await this.mountJQuery(),i.default.css(this.el,`position`)!==`absolute`&&(this.el.style.position=`relative`),this.el.dataset.topPopupOpened=`opened`,this.elActiveByDefault=this.el.classList.contains(`top-active`),this.el.classList.add(`top-active`),this.openerIsInput=this.el.classList.contains(`top-input`),this.el.classList.contains(`top-input-project_name`)&&(this.openerIsInput=!1),this.openerIsInput){let e=this.el.querySelector(`input`);e&&!e.__popupOnBlur&&(e.__popupOnBlur=!0,e.addEventListener(`blur`,e=>{let t=e.relatedTarget;t&&a.t.getPopup(t)?.elPopup!==t&&a.t.getClosestPopup(e.relatedTarget,this.el)||a.t.getPopupFromOpener(this.el)?.close()}))}if(t)this.type=`vue`,this.options.popup=``,this.elPopup=i.default.genEl(`div`,{},this.options.popup);else if(this.options.popup?.match(/^[#.]/))this.type=`selector`,this.elPopup=document.querySelector(`${this.options.popup}.template`)||void 0;else{if(this.type=`html`,this.options.useOriginal)throw`Option useOriginal not allowed for text templates`;this.elPopup=i.default.genEl(`div`,{},this.options.popup??``)}if(this.type!==`html`&&!t||t?.opened){if(!t||t?.opened){let e;if(e=t?.opened?t.popup.elPopup:document.querySelector(`${this.options.popup}.top-popup-wrapper-shown`)||void 0,e){this.elPopup=e,this.el.dataset.topPopupOpened=``,this.elActiveByDefault||this.el.classList.remove(`top-active`),a.t.close(this.elPopup),setTimeout(()=>this.mount(),this.options.transitionDuration);return}}this.elPopup||=document.querySelector(`${this.options.popup}:not(.top-popup-wrapper)`)||void 0}if(!this.elPopup)return;for(this.options.useOriginal?(this.elStartPosition=this.elPopup.closest(`.top-popup-el-start-position`),this.elStartPosition||(this.elStartPosition=i.default.wrap(this.elPopup,`i`),this.elStartPosition.classList.add(`top-popup-el-start-position`,`hidden`))):(this.elPopup=this.elPopup.cloneNode(!0),this.type===`selector`&&!this.elPopup.matches(`.template`)&&(this.elPopup.classList.remove(`hidden`),this.elPopup.querySelector(`:scope > .top-popup_content`)||this.elPopup.classList.add(`top-popup_content`),this.elPopup=i.default.wrap(this.elPopup,`div`)),this.type===`html`&&(this.elPopup.querySelector(`:scope > .top-popup_content`)||(this.elPopup.classList.add(`top-popup_content`),this.elPopup=i.default.wrap(this.elPopup,`div`))),(this.type===`selector`&&!this.elPopup.matches(`.template`)||this.type===`html`||this.type===`vue`)&&(i.default.querySelectorAllArray(this.elPopup,`[data-top-popup]`).forEach(e=>{e instanceof HTMLElement&&(e.dataset.topPopupPosBy=`fixed`)}),i.default.querySelectorAllArray(this.elPopup,`.top-popup-wrapper`).forEach(e=>e.remove()))),a.t.decoratorBeforeOpen(this),t&&(this.options.class=t.classRef.value,t.transitionDurationRef.value!==void 0&&(this.options.transitionDuration=t.transitionDurationRef.value,this.elPopup instanceof HTMLElement&&this.elPopup.style.setProperty(`--top-popup-transition-delay`,this.options.transitionDuration+`ms`))),this.elPopupInner=document.createElement(`div`),this.elPopupInner.classList.add(`top-popupPanel`,`top-popup`);this.elPopup.firstChild;)this.elPopupInner.appendChild(this.elPopup.firstChild);if(this.elPopup.append(this.elPopupInner),this.elPopup.classList.add(`top-popup-wrapper`),this.options.class){let e=this.options.class.split(` `);this.elPopup.classList.add(...e)}this.options.notch&&(this.elPopup.classList.add(`with_notch`),this.elPopup.insertAdjacentHTML(`beforeend`,`<i class="notch notch-border"></i><i class="notch"></i>`)),await this.vueOpen(),this.elPopupHeader=this.elPopupInner.querySelector(`.top-popup_header`),this.elPopupWidget=this.elPopupInner.querySelector(`.top-popup_widget`),this.elPopupBody=this.elPopupInner.querySelector(`.top-popup_content`),this.elPopupFooter=this.elPopupInner.querySelector(`.top-popup_footer`);let n=!!this.elPopup.querySelector(`[data-widget="search"]`);if(this.options.isFullScreen&&!n){let e=(0,r.E)();!this.elPopupHeader&&e.Common.Close&&(this.elPopupHeader=i.default.genEl(`i`,{class:`top-popup_header`}),this.elPopupInner.prepend(this.elPopupHeader),this.elPopupHeader.prepend(i.default.genEl(`i`,{class:`a closer`},e.Common.Close)),this.elPopupHeader.append(i.default.genEl(`i`,{class:`top-popup_headerButton`})))}i.default.storage(this.elPopup,e.componentName,this),this.options.frontSelector&&(this.elFront=document.querySelector(this.options.frontSelector)),this.elFront||=this.el.closest(`.top-popup-front`),this.elFront||=document.body,this.elPopup instanceof HTMLElement&&(this.elPopup.style.width=this.el.offsetWidth+`px`,this.elPopup.style.height=this.el.offsetHeight+`px`,this.elPopup.style.top=this.el.offsetTop+`px`,this.elPopup.style.right=parseInt(this.el.style.right||`0`)+`px`,this.elPopup.style.bottom=parseInt(this.el.style.bottom||`0`)+`px`),this.el.parentElement?.insertBefore(this.elPopup,this.el),this.elPopup.classList.remove(`template`),this.options.invertX&&this.elPopup.classList.add(`invert-x`);let o=!!this.el.closest(`.modal-header`);o||=!!this.el.closest(`#top_panel`),o||=!!this.el.closest(`#secondmenu`),o&&this.elPopup.classList.add(`p-from-top`),setTimeout(()=>this.elPopup?.classList.add(`top-popup-wrapper-shown`)),this.elFront&&!this.elFront.matches(`body`)&&(this.elFront.append(this.elPopup),this.shift.top=i.default.offset(this.el).top-this.el.offsetTop-i.default.offset(this.elFront).top,this.shift.left=i.default.offset(this.el).left-this.el.offsetLeft-i.default.offset(this.elFront).left,this.shift.top-=parseInt(this.el.style[`margin-top`]||0),this.shift.left-=parseInt(this.el.style[`margin-left`]||0),this.elPopup instanceof HTMLElement&&(this.elPopup.style.top=parseInt(this.elPopup.style.top||`0`)+this.shift.top+`px`,this.elPopup.style.left=parseInt(this.elPopup.style.left||`0`)+this.shift.left+`px`)),this.$&&r.O.$&&this.$.trigger(`aftershow.top-menu-popup`,[r.O.$(this.elPopup)]),this.recalcPosition(),this.elPopup.setAttribute(`tabindex`,`0`),this.focus(),a.t.decoratorAfterOpen(this),this.mountEvents()}async mountJQuery(){r.O.$&&(this.$=r.O.$(this.el))}focus(){let e;this.elPopup&&(e=i.default.querySelectorVisible(this.elPopup,`.top-popup-autofocus`),e||=i.default.querySelectorVisible(this.elPopup,`:read-write, select:not(:disabled)`),e||=i.default.querySelectorVisible(this.elPopup,`.top-popup_footer .top-button`),!e&&!this.openerIsInput&&(e=this.elPopup),e instanceof HTMLElement&&e.focus({preventScroll:!0}),setTimeout(()=>{e instanceof HTMLElement&&e.focus({preventScroll:!0})},this.options.transitionDuration))}mountEvents(){this.addEventListenerWithUnmount(document,`mousedown`,e=>this.onMousedown(e)),this.openerIsInput?this.onFocusCloseOthers():this.elPopup&&this.elPopupInner&&(this.addEventListenerWithUnmount(this.elPopup,`focus`,e=>this.onFocus(e)),this.options.openByHover&&(this.addEventListenerWithUnmount(this.elPopup,`mouseleave`,e=>this.onMouseleave(e)),this.addEventListenerWithUnmount(this.elPopupInner,`mouseleave`,e=>this.onMouseleave(e)))),this.options.isFullScreen&&this.elPopupBody&&this.addEventListenerWithUnmount(this.elPopupBody,`touchmove`,e=>this.onTouchmove(e))}onMousedown(e){if(!this.elPopup||!(e.target instanceof Element)||!this.isFirstClick||(this.isFirstClick=!1,setTimeout(()=>this.isFirstClick=!0),e instanceof MouseEvent&&e.button!==0))return;let t=i.default.querySelectorVisibleLast(document.body,`:scope > .top-popup-wrapper`);if(t&&t!==this.elPopup||e.target.closest(`.top-popup-front`)&&(t=i.default.querySelectorVisibleLast(e.target.closest(`.top-popup-front`),`:scope > .top-popup-wrapper`),t&&t!==this.elPopup))return;if(e.target.closest(`[data-top-popup-id="${this.options.id}"]`)){e.preventDefault();return}let n=e.target.closest(`input, select, textarea, button, [tabindex]`);n===this.elPopup&&(n=null);let r=!n;r&&this.openerIsInput&&e.preventDefault(),!this.elPopup.contains(e.target)&&(this.elPopup.closest(`.ui-dialog`)&&!e.target.closest(`.ui-dialog`)||a.t.decoratorIsIgnoreOuterClick(e)||a.t.close(this.elPopup,r))}onFocus(e){e.target instanceof Element&&e.target.matches(`input`)||this.onFocusCloseOthers()}onFocusCloseOthers(){this.isClosed||a.t.getAllVisible().forEach(e=>{this.elPopup?.contains(e)||this.popupParent?.elPopup===e||this.popupParent?.popupParent?.elPopup===e||a.t.close(e)})}onMouseleave(e){setTimeout(()=>{this.elPopupInner&&this.elPopupInner.matches(`:hover`)||!this.elPopup||a.t.close(this.elPopup)},100)}onResize(){this.elPopup&&this.elPopup.parentElement!==document.body&&document.body.append(this.elPopup),this.elPopup instanceof HTMLElement&&(this.elPopup.style.top=i.default.offset(this.el).top+`px`,this.elPopup.style.left=i.default.offset(this.el).left+`px`)}unmount(){super.unmount(),this.el instanceof HTMLElement&&(this.el.dataset.topPopupOpened=``),this.elActiveByDefault||this.el.classList.remove(`top-active`);let e=this.el.getAttribute(`style`);e&&(e=e.replace(/position:[^;]*;?/g,``),this.el.setAttribute(`style`,e))}recalcPosition(e){if(!(this.elPopup instanceof HTMLElement))return;let t=e??this.options.p,n;if(this.el instanceof HTMLElement)switch(this.elPopup.style.height=this.el.offsetHeight+`px`,this.elPopup.classList.remove(`p0`,`p1`,`p2`,`p3`,`p4`),this.elPopup.classList.add(`p`+t),this.options.posBy){case`left`:n=this.el.offsetLeft+parseInt(this.el.style[`margin-left`]||`0`),n+=this.shift.left,this.elPopup.style.left=n+`px`;break;case`right`:if(!(this.el.offsetParent instanceof HTMLElement))break;n=this.el.offsetLeft+parseInt(this.el.style[`margin-left`]||`0`),this.elPopup.style.right=this.el.offsetParent.offsetWidth-this.el.offsetWidth-n+`px`;break;case`fixed`:this.addEventListenerWithUnmount(window,`resize`,()=>this.onResize()),this.onResize();break;default:this.options.posBy?.append(this.elPopup)}let r=this.elPopup.getBoundingClientRect();this.elPopup.style.setProperty(`--top-popup-height`,this.elPopup.offsetHeight+`px`),this.elPopup.style.setProperty(`--top-popup-right-bounding`,r.right+`px`),this.elPopup.style.setProperty(`--top-popup-bottom-bounding`,r.bottom+`px`),this.elPopup.style.setProperty(`--top-popup-top`,r.top+`px`),this.elPopup.style.setProperty(`--top-popup-left`,r.left+`px`),this.elPopupInner instanceof HTMLElement&&(this.elPopupInner.style.maxWidth=`unset`,this.elPopupInner.style.maxHeight=`unset`);let o={top:!1,right:!1,bottom:!1,left:!1},s={top:!1,right:!1,bottom:!1,left:!1},c=r.left>window.innerWidth/2,l=r.top>window.innerHeight/2;t===4&&(c=!c),t===1&&(l=!l);let u=this.elPopupInner?.getBoundingClientRect(),d,f,p=i.default.cssNumber(this.elPopup,`--top-popup-offset`),m=this.el.offsetHeight,h=this.el.offsetWidth;u&&(d=window.innerWidth-u.right,f=window.innerHeight-u.bottom,u.top<p&&(o.top=!0,u.top<p*2-u.height+m&&(s.top=!0)),d<p&&(o.right=!0,d<p*2-u.width+h&&(s.right=!0)),f<p&&(o.bottom=!0,f<p*2-u.height+m&&(s.bottom=!0)),u.left<p&&(o.left=!0,u.left<p*2-u.width+m&&(s.left=!0)));let g=(e,t)=>{if(e===`x`){if(!o.right&&!o.left||(t===1||t===3)&&!s.right&&!s.left&&c)return t;o.right&&(t===0||t===2)&&c&&(t=4),o.left&&(t===0||t===4)&&c&&(t=2)}if(e===`y`){if(!o.top&&!o.bottom||(t===2||t===4)&&!s.top&&!s.bottom&&l)return t;o.top&&(t===0||t===1)&&l&&(t=3),o.bottom&&l&&(t=1)}return t},_=[`x`,`y`];(t===0||t===1||t===3)&&(_=[`y`,`x`]);let v=t??0;_.forEach(e=>{v=g(e,v)}),t=v,o.bottom&&(t===2||t===4)&&l&&this.elPopup.classList.add(`invert-y`),o.right&&(t===0||t===1||t===3)&&this.elPopup.classList.add(`invert-x`),this.elPopup.classList.remove(`p0`,`p1`,`p2`,`p3`,`p4`),this.elPopup.classList.add(`p`+t),this.elPopupInner instanceof HTMLElement&&(this.elPopupInner.style.maxWidth=``,this.elPopupInner.style.maxHeight=``),a.t.scrollToActive(this.elPopup)}onTouchmove(e){if(e.currentTarget instanceof HTMLElement&&e.target instanceof HTMLElement){if(e.currentTarget.scrollWidth>e.currentTarget.offsetWidth||e.target.parentElement?.scrollWidth&&e.target.parentElement?.offsetWidth&&e.target.parentElement.scrollWidth>e.target.parentElement?.offsetWidth)return;e.currentTarget.matches(`.has_scroll`)||e.preventDefault()}}close(){this.isClosed||(this.isClosed=!0,this.$&&r.O.$&&this.elPopup&&this.$.trigger(`afterclose.top-menu-popup`,[r.O.$(this.elPopup)]),!a.t.noClose&&(this.unmount(),this.elPopup?.classList.add(`top-popup-wrapper-closed`),setTimeout(()=>{if(this.vueClose(),!this.elPopup)return;this.options.useOriginal?(this.elPopup.removeAttribute(`style`),this.elPopup.classList.remove(`top-popup-wrapper-shown`,`top-popup-wrapper-closed`),this.elPopup.classList.add(`template`),this.elStartPosition?.append(this.elPopup),this.elPopup.querySelector(`div.top-popup_content.top-column`)?.classList.remove(`top-column`),this.elPopup.querySelector(`.notch-border`)?.remove(),this.elPopup.querySelector(`.notch`)?.remove(),this.elPopupInner?.replaceWith(...this.elPopupInner.childNodes),i.default.storageClear(this.elPopup)):(i.default.storageClear(this.elPopup),this.elPopup.remove(),delete this.elPopup);let e=a.t.getAllVisible(),t=e.length&&e[e.length-1];t?a.t.getPopup(t).focus():document.documentElement.classList.remove(`with_popup`)},this.options.transitionDuration)))}async vueOpen(){await this.vueGetComponent()?.onOpen(this)}vueClose(){this.vueGetComponent()?.onClose(this)}vueGetComponent(){if(this.el instanceof HTMLElement&&this.options.id)return a.t.vueConnectors.get(this.options.id)}};n.TopLibPopup=l,(0,r.K)(l,`componentName`,`TopPopup`),c.init()});
|
|
2
|
+
//# sourceMappingURL=popup-CsWaer8b.amd.js.map
|