@topvisor/ui 1.5.1-2 → 1.5.1-topProjectSelector.0
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-CBMWBeCS.amd.js → api-a3D-SXH-.amd.js} +2 -2
- package/.chunks/{api-CBMWBeCS.amd.js.map → api-a3D-SXH-.amd.js.map} +1 -1
- package/.chunks/{api-CBMWBeCS.esm.js → api-a3D-SXH-.esm.js} +2 -2
- package/.chunks/{api-CBMWBeCS.esm.js.map → api-a3D-SXH-.esm.js.map} +1 -1
- package/.chunks/{app-DyAn8Ury.amd.js → app-BDGZ1d0R.amd.js} +2 -2
- package/.chunks/{app-DyAn8Ury.amd.js.map → app-BDGZ1d0R.amd.js.map} +1 -1
- package/.chunks/{app-DyAn8Ury.esm.js → app-BDGZ1d0R.esm.js} +6 -6
- package/.chunks/app-BDGZ1d0R.esm.js.map +1 -0
- package/.chunks/{datepicker-BmHkZfBO.amd.js → datepicker-DuOSAFQy.amd.js} +2 -2
- package/.chunks/{datepicker-BmHkZfBO.amd.js.map → datepicker-DuOSAFQy.amd.js.map} +1 -1
- package/.chunks/{datepicker-BmHkZfBO.esm.js → datepicker-DuOSAFQy.esm.js} +2 -2
- package/.chunks/{datepicker-BmHkZfBO.esm.js.map → datepicker-DuOSAFQy.esm.js.map} +1 -1
- package/.chunks/{dialog-bIV6Y2PF.amd.js → dialog-ClCAM1nI.amd.js} +2 -2
- package/.chunks/{dialog-bIV6Y2PF.amd.js.map → dialog-ClCAM1nI.amd.js.map} +1 -1
- package/.chunks/{dialog-bIV6Y2PF.esm.js → dialog-ClCAM1nI.esm.js} +4 -4
- package/.chunks/{dialog-bIV6Y2PF.esm.js.map → dialog-ClCAM1nI.esm.js.map} +1 -1
- package/.chunks/{dialog_regionSelectorRegions-gPKA93af.amd.js → dialog_regionSelectorRegions-DFZTiYi6.amd.js} +2 -2
- package/.chunks/{dialog_regionSelectorRegions-gPKA93af.amd.js.map → dialog_regionSelectorRegions-DFZTiYi6.amd.js.map} +1 -1
- package/.chunks/{dialog_regionSelectorRegions-gPKA93af.esm.js → dialog_regionSelectorRegions-DFZTiYi6.esm.js} +5 -5
- package/.chunks/{dialog_regionSelectorRegions-gPKA93af.esm.js.map → dialog_regionSelectorRegions-DFZTiYi6.esm.js.map} +1 -1
- package/.chunks/{dialogs-CE8F7A0M.amd.js → dialogs-CjrddGh6.amd.js} +2 -2
- package/.chunks/{dialogs-CE8F7A0M.amd.js.map → dialogs-CjrddGh6.amd.js.map} +1 -1
- package/.chunks/{dialogs-CE8F7A0M.esm.js → dialogs-CjrddGh6.esm.js} +3 -3
- package/.chunks/{dialogs-CE8F7A0M.esm.js.map → dialogs-CjrddGh6.esm.js.map} +1 -1
- package/.chunks/forms-C2ItFa61.amd.js +2 -0
- package/.chunks/forms-C2ItFa61.amd.js.map +1 -0
- package/.chunks/{forms-DByj6MWE.esm.js → forms-C2ItFa61.esm.js} +10 -6
- package/.chunks/forms-C2ItFa61.esm.js.map +1 -0
- package/.chunks/{formsExt-BGISafFX.amd.js → formsExt-6Nz907Ry.amd.js} +2 -2
- package/.chunks/{formsExt-BGISafFX.amd.js.map → formsExt-6Nz907Ry.amd.js.map} +1 -1
- package/.chunks/{formsExt-BGISafFX.esm.js → formsExt-6Nz907Ry.esm.js} +4 -4
- package/.chunks/{formsExt-BGISafFX.esm.js.map → formsExt-6Nz907Ry.esm.js.map} +1 -1
- package/.chunks/{notice-Ds5K-ei_.amd.js → notice-CBJBDgby.amd.js} +2 -2
- package/.chunks/{notice-Ds5K-ei_.amd.js.map → notice-CBJBDgby.amd.js.map} +1 -1
- package/.chunks/{notice-Ds5K-ei_.esm.js → notice-CBJBDgby.esm.js} +2 -2
- package/.chunks/{notice-Ds5K-ei_.esm.js.map → notice-CBJBDgby.esm.js.map} +1 -1
- package/.chunks/{popup-Cvyqovn6.amd.js → popup-B06vbv6B.amd.js} +2 -2
- package/.chunks/{popup-Cvyqovn6.amd.js.map → popup-B06vbv6B.amd.js.map} +1 -1
- package/.chunks/{popup-Cvyqovn6.esm.js → popup-B06vbv6B.esm.js} +3 -3
- package/.chunks/{popup-Cvyqovn6.esm.js.map → popup-B06vbv6B.esm.js.map} +1 -1
- package/.chunks/{popup-BxGYabRi.amd.js → popup-CFYtl5_r.amd.js} +2 -2
- package/.chunks/{popup-BxGYabRi.amd.js.map → popup-CFYtl5_r.amd.js.map} +1 -1
- package/.chunks/{popup-BxGYabRi.esm.js → popup-CFYtl5_r.esm.js} +3 -3
- package/.chunks/{popup-BxGYabRi.esm.js.map → popup-CFYtl5_r.esm.js.map} +1 -1
- package/.chunks/{utils-sPSU5tXH.amd.js → utils-BTHruVpQ.amd.js} +2 -2
- package/.chunks/{utils-sPSU5tXH.amd.js.map → utils-BTHruVpQ.amd.js.map} +1 -1
- package/.chunks/{utils-sPSU5tXH.esm.js → utils-BTHruVpQ.esm.js} +3 -3
- package/.chunks/{utils-sPSU5tXH.esm.js.map → utils-BTHruVpQ.esm.js.map} +1 -1
- package/.chunks/{utils-mRLC32Uo.amd.js → utils-DJV2mWZE.amd.js} +2 -2
- package/.chunks/{utils-mRLC32Uo.amd.js.map → utils-DJV2mWZE.amd.js.map} +1 -1
- package/.chunks/{utils-mRLC32Uo.esm.js → utils-DJV2mWZE.esm.js} +4 -4
- package/.chunks/{utils-mRLC32Uo.esm.js.map → utils-DJV2mWZE.esm.js.map} +1 -1
- package/.chunks/{worker-Cx7e_9o9.amd.js → worker-BIUaZFVX.amd.js} +2 -2
- package/.chunks/{worker-Cx7e_9o9.amd.js.map → worker-BIUaZFVX.amd.js.map} +1 -1
- package/.chunks/{worker-Cx7e_9o9.esm.js → worker-BIUaZFVX.esm.js} +3 -3
- package/.chunks/{worker-Cx7e_9o9.esm.js.map → worker-BIUaZFVX.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/assets/project.css +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 +57 -63
- package/project/project.js.map +1 -1
- package/src/api/api/types/api.d.ts +5 -1
- package/src/core/core/core.d.ts +2 -0
- package/src/core/core/options.d.ts +8 -0
- package/src/core/core/state.d.ts +2 -0
- package/src/core/plugins/core.d.ts +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-DyAn8Ury.esm.js.map +0 -1
- package/.chunks/forms-DByj6MWE.amd.js +0 -2
- package/.chunks/forms-DByj6MWE.amd.js.map +0 -1
- package/.chunks/forms-DByj6MWE.esm.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
define([`require`,`exports`,`./forms-
|
|
1
|
+
define([`require`,`exports`,`./forms-C2ItFa61.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-CBJBDgby.amd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[".chunks/notice-Ds5K-ei_.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_DByj6MWE_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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,YAAA,EAAA,EAAAA,EAAA,aAAAA,EAAA,SAAA,CAAA,GAAA,OAAA,CAAA,EAAA,EAAAA,EAAA,oBAAA,MAAA0B,EAAA,GAAA,EAAA1B,EAAA,WAAA,CAAA,EAAA,EAAA,EAAAA,EAAA,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-DByj6MWE.esm.js\", \"../utils/string.js\", \"vue\"], function (require, exports, forms_DByj6MWE_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_DByj6MWE_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_DByj6MWE_esm_js_1.O.state.isMobile || !forms_DByj6MWE_esm_js_1.O.$ || !forms_DByj6MWE_esm_js_1.O.$.ui.draggable)\n return;\n let n = \"right\";\n forms_DByj6MWE_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-Ds5K-ei_.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-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","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AAA,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"]}
|
|
@@ -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-C2ItFa61.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-CBJBDgby.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice-Ds5K-ei_.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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aADjB,EAcE,GAAA;GAZA,KAAK,EAAK;GACV,IAAI,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
|
+
{"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,GAA2B,MAC/D,gBAAgB,EAAW,IAAO,IAAQ,KAAK,UAAU,EAAQ,CAAC,EAoB7D,KAAQ,GAAc,IAAe,QAAQ,MAAsB;CAC/E,IAAI,IAAQ;AAEZ,KAAO,OAAO,EAAK;CAEnB,IAAM,IAAK,EAAU,GAAM,GAAO,EAAQ;AAE1C,KAAI,GAAS,MACZ,KAAQ,EAAQ;MACV;EACN,IAAM,IAAS,EAAK,MAAM,KAAK;AAE/B,EAAI,EAAO,WACV,IAAQ,OAAO,EAAO,OAAO,CAAC,EAC9B,IAAO,EAAO,KAAK,KAAK;;CAI1B,IAAM,IAAa,EAAS,IAAI,EAAG;AACnC,KAAI,GAAY;AACf,IAAW,EAAW;AAEtB;;CAGD,IAAM,IAAa;EAClB;EACA;EACA;EACA;EACA,aAAa,GAAS;EACtB,cAAc,GAAS;EACvB,UAAU,GAAS;EACnB,YAAY,GAAS;EACrB,eAAe,GAAS;EACxB,SAAS,GAAS;EAClB;AAID,KAFA,EAAS,IAAI,EAAK,IAAI,EAAK,EAEvB,EAAS,OAAO,GAAG;EACtB,IAAM,CAAC,GAAU,KAAa,CAAC,GAAG,EAAS,CAAC,GAAG,EAAE,IAAI,EAAE;AACvD,EAAI,KAAW,EAAM,EAAU;;AAQhC,CAAI,EAAK,MAAM,YACd,EAAE,QAAQ,CAAC,IAAI,eAAe,EAAM,EAAK,CAAC;GAItC,KAAc,MAAe;AAGlC,CAFA,EAAK,aAAa,IAElB,iBAAiB,EAAK,aAAa,IAAA,IAA0B;GAGxD,KAAS,MAAe;AAG7B,CAFA,EAAK,cAAc,IAEnB,iBAAiB;AAGh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N,GAgBM,EAAA,EAAA,GAAA,EAfL,EAcE,GAAA,MAAA,EAbwB,EAAA,EAAQ,GAAA,CAAzB,GAAQ,aADjB,EAcE,GAAA;GAZA,KAAK,EAAK;GACV,IAAI,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
|
-
define([`require`,`exports`,`./forms-DByj6MWE.amd`,`./worker-Cx7e_9o9.amd`,`vue`,`../require/css.amd!../assets/popup.css`],function(e,t,n,r,i){"use strict";if(a===void 0)var a=window.Vue;Object.defineProperty(t,`__esModule`,{value:!0}),t.t=t.s=t.r=t.o=t.n=t.i=t.c=t.a=void 0;var o=(0,i.defineComponent)({__name:`opener`,props:{id:{},pos:{default:`3`},notch:{type:Boolean,default:!0},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{default:`fixed`},data:{}},setup(e){let t=e,n=t.id||Math.random()+``,a;function o(e){setTimeout(()=>{a=e.nextElementSibling,a&&s(a)})}(0,i.onUpdated)(()=>{a&&s(a)});function s(e){e.dataset.topPopup=`#`+n;let i=!!e.dataset.topPopupDisabled;if(e.dataset.topPopupId=n,e.dataset.topPopupPos=t.pos,e.dataset.topPopupPosBy=t.posBy,e.dataset.topPopupNotch=t.notch?`true`:``,e.dataset.topPopupOpenByHover=t.openByHover?`true`:``,e.dataset.topPopupDisabled=t.disabled?`true`:``,e.__TopPopupOpenerProps=t,t.openByFocusInput&&e.classList.contains(`top-input`)){let n=e.querySelector(`input`);if(n.onfocus=()=>{e.dataset.topPopupDisabled||r.t.getPopupFromOpener(e)?.vueGetComponent()?.opened||r.t.openByOpener(e)},t.disabled!==i&&n===document.activeElement){let n=r.t.getPopupFromOpener(e);!t.disabled&&!n&&r.t.openByOpener(e),t.disabled&&n&&n.close()}}}return(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,null,[(0,i.createElementVNode)(`template`,{ref:o}),(0,i.renderSlot)(e.$slots,`default`)],64))}}),s={key:0,class:`top-popup_header`},c={key:0,class:`top-as-a closer`},l={key:1,class:`top-popup_widget`},u={key:2,class:`top-popup_content`},d={key:4,class:`top-popup_footer`},f=[`href`],p=(0,i.defineComponent)({__name:`popup`,props:{id:{default:``},class:{},transitionDuration:{},footerSupportLink:{},pos:{default:`3`},notch:{type:Boolean,default:!0},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{default:`fixed`},data:{}},emits:[`open`,`close`,`scrollContentList`],setup(e,{expose:t,emit:a}){let p=e,m=a,h=p.id||`top-popup-id-`+Math.random(),g={id:h,popup:void 0};t(g);let _=(0,i.ref)(null),v=(0,i.ref)(null),y=(0,i.ref)(),b={onOpen:async e=>{e.elPopup&&(_.value=e.elPopup),e.elPopupInner&&(e.elPopupInner.innerText=``,v.value=e.elPopupInner),b.opened=!0,b.popup=e,g.popup=e,y.value=e.el.__TopPopupOpenerProps.data,m(`open`,{elPopup:e.elPopup,elPopupOpener:e.el,data:y.value})},onClose:e=>{v.value=null,b.opened=!1,b.popup=void 0,y.value=void 0,m(`close`,{elPopup:e.elPopup,elPopupOpener:e.el,data:e.el.__TopPopupOpenerProps.data})},classRef:(0,i.toRef)(p,`class`),opened:!1,popup:void 0,transitionDurationRef:(0,i.toRef)(p,`transitionDuration`)};return(0,i.watch)(()=>p.class,(e,t)=>{if(!_.value)return;let n=e?.split(` `)??[],r=(t?.split(` `)??[]).filter(e=>!n.includes(e));_.value.classList.remove(...r),_.value.classList.add(...n)}),r.t.regVueComponent(h,b),(0,i.onUnmounted)(()=>{r.t.unregVueComponent(h)}),(t,r)=>{let a=(0,i.resolveDirective)(`top-scroll-shadow`);return(0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,null,[t.$slots.opener?((0,i.openBlock)(),(0,i.createBlock)(o,{key:0,id:(0,i.unref)(h),pos:e.pos,posBy:e.posBy,notch:e.notch,openByFocusInput:e.openByFocusInput,openByHover:t.$core.state.isMobile||t.$core.state.isMobileUA?!1:e.openByHover,disabled:e.disabled},{default:(0,i.withCtx)(()=>[(0,i.renderSlot)(t.$slots,`opener`)]),_:3},8,[`id`,`pos`,`posBy`,`notch`,`openByFocusInput`,`openByHover`,`disabled`])):(0,i.createCommentVNode)(``,!0),v.value?((0,i.openBlock)(),(0,i.createBlock)(i.Teleport,{key:1,to:v.value},[t.$slots.header||t.$core.state.isMobile?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,s,[t.$core.state.isMobile?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,c,(0,i.toDisplayString)(t.$i18n.Common.Close),1)):(0,i.createCommentVNode)(``,!0),(0,i.renderSlot)(t.$slots,`header`,{data:y.value})])):(0,i.createCommentVNode)(``,!0),t.$slots.widget?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,l,[(0,i.renderSlot)(t.$slots,`widget`)])):(0,i.createCommentVNode)(``,!0),t.$slots.content?(0,i.withDirectives)(((0,i.openBlock)(),(0,i.createElementBlock)(`div`,u,[(0,i.renderSlot)(t.$slots,`content`,{data:y.value})])),[[a]]):(0,i.createCommentVNode)(``,!0),t.$slots.contentList?(0,i.withDirectives)(((0,i.openBlock)(),(0,i.createElementBlock)(`ul`,{key:3,class:`top-popup_content`,onScroll:r[0]||=e=>t.$emit(`scrollContentList`,e)},[(0,i.renderSlot)(t.$slots,`contentList`,{data:y.value})],32)),[[a]]):(0,i.createCommentVNode)(``,!0),t.$slots.footer||e.footerSupportLink?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,d,[e.footerSupportLink?((0,i.openBlock)(),(0,i.createElementBlock)(`a`,{key:0,class:`top-popup_footerSupportLink`,href:e.footerSupportLink,target:`_blank`},[(0,i.createVNode)(n.d,{hint:``})],8,f)):(0,i.createCommentVNode)(``,!0),(0,i.renderSlot)(t.$slots,`footer`,{data:y.value})])):(0,i.createCommentVNode)(``,!0)],8,[`to`])):(0,i.createCommentVNode)(``,!0)],64)}}}),m={class:`top-popup_listItemActionsLabel top-ellipsis1`},h={class:`top-popup_listItemActions`},g=(0,i.defineComponent)({inheritAttrs:!1,__name:`listItem`,props:{type:{default:`button`},closeByClick:{type:Boolean,default:!0},attrs:{}},setup(e){let t=e;return(n,r)=>((0,i.openBlock)(),(0,i.createElementBlock)(`li`,{class:(0,i.normalizeClass)({"top-popup_liNoSelectable":t.type!==`button`})},[((0,i.openBlock)(),(0,i.createBlock)((0,i.resolveDynamicComponent)(n.$attrs.href?`a`:`div`),(0,i.mergeProps)({class:{"top-popup_listItem":!0,[`top-popup_listItem-`+t.type]:!!t.type,"top-popup_liastItem-withActions":n.$slots.actions,"top-popup-noCloser":!e.closeByClick,a:t.type===`button`}},{...n.$attrs,...e.attrs}),{default:(0,i.withCtx)(()=>[n.$slots.actions?((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:0},[(0,i.createElementVNode)(`div`,m,[(0,i.renderSlot)(n.$slots,`default`)]),(0,i.createElementVNode)(`div`,h,[(0,i.renderSlot)(n.$slots,`actions`)])],64)):(0,i.renderSlot)(n.$slots,`default`,{key:1})]),_:3},16,[`class`])),(0,i.renderSlot)(n.$slots,`buttons`)],2))}}),_=(0,i.defineComponent)({__name:`widgetInput`,props:(0,i.mergeModels)({modelValue:{},name:{},disabled:{type:Boolean},readonly:{type:Boolean},modificator:{},size:{},styling:{},isError:{type:Boolean},isLoading:{type:Boolean},icon:{},icon2:{},addCleaner:{type:Boolean,default:!0},title:{},captionType:{}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=(0,i.useModel)(e,`modelValue`);return(e,r)=>((0,i.openBlock)(),(0,i.createBlock)(n.c,(0,i.mergeProps)(e.$props,{modificator:`popupWidgetInput`,modelValue:t.value,"onUpdate:modelValue":r[0]||=e=>t.value=e}),null,16,[`modelValue`]))}}),v=(0,i.defineComponent)({__name:`popupAlert`,props:{submitText:{},id:{},class:{},transitionDuration:{},footerSupportLink:{},pos:{},notch:{type:Boolean},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{},data:{}},emits:[`open`,`close`,`scrollContentList`],setup(e){let{submitText:t,...r}=e;return(e,a)=>((0,i.openBlock)(),(0,i.createBlock)(p,(0,i.mergeProps)({class:`top-popupAlert`},r,{onOpen:a[0]||=t=>e.$emit(`open`,t),onClose:a[1]||=t=>e.$emit(`close`,t),onScrollContentList:a[2]||=(...t)=>e.$emit(`scrollContentList`,...t)}),(0,i.createSlots)({opener:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`opener`)]),footer:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`footer`),(0,i.createVNode)(n.h,null,{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(t)||e.$i18n.Common.Close),1)]),_:1})]),_:2},[e.$slots.header?{name:`header`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`header`)]),key:`0`}:void 0,e.$slots.default?{name:`content`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`)]),key:`1`}:void 0]),1040))}}),y=(0,i.defineComponent)({__name:`popupConfirm`,props:{cancelText:{},submitText:{},isWarning:{type:Boolean},id:{},class:{},transitionDuration:{},footerSupportLink:{},pos:{},notch:{type:Boolean},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{},data:{}},emits:[`open`,`close`,`scrollContentList`,`submit`],setup(e,{emit:t}){let r=e,a=t,o=(0,i.ref)(!1),s=()=>{o.value=!0,a(`submit`)},c=e=>{if(o.value){o.value=!1;return}a(`close`,e)},{submitText:l,cancelText:u,isWarning:d,...f}=r;return(e,t)=>((0,i.openBlock)(),(0,i.createBlock)(p,(0,i.mergeProps)({class:`top-popupConfirm`},f,{onOpen:t[0]||=t=>e.$emit(`open`,t),onClose:t[1]||=e=>c(e),onScrollContentList:t[2]||=(...t)=>e.$emit(`scrollContentList`,...t)}),(0,i.createSlots)({opener:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`opener`)]),footer:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`footer`),(0,i.createVNode)(n.h,{color:`theme`},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(u)||e.$i18n.Common.Cancel),1)]),_:1}),(0,i.createVNode)(n.h,{onClick:s,color:(0,i.unref)(d)?`red`:`blue`},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(l)||e.$i18n.Common.Continue),1)]),_:1},8,[`color`])]),_:2},[e.$slots.header?{name:`header`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`header`)]),key:`0`}:void 0,e.$slots.default?{name:`content`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`)]),key:`1`}:void 0]),1040))}}),b=(0,i.defineComponent)({__name:`popupPrompt`,props:{submitText:{},cancelText:{},defaultValue:{},id:{},class:{},transitionDuration:{},footerSupportLink:{},pos:{},notch:{type:Boolean},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{},data:{}},emits:[`open`,`close`,`scrollContentList`,`submit`],setup(e,{emit:t}){let r=e,a=t,o=()=>c.value=r.defaultValue??``,s=(0,i.ref)(!1),c=(0,i.ref)();(0,i.watch)(()=>r.defaultValue,()=>o(),{immediate:!0});let l=()=>{s.value=!0},u=e=>{if(s.value){s.value=!1,a(`submit`,c.value),o();return}o(),a(`close`,e)},{submitText:d,cancelText:f,defaultValue:m,...h}=r;return(e,t)=>((0,i.openBlock)(),(0,i.createBlock)(p,(0,i.mergeProps)({class:`top-popupPrompt`},h,{onOpen:t[1]||=t=>e.$emit(`open`,t),onClose:t[2]||=e=>u(e),onScrollContentList:t[3]||=(...t)=>e.$emit(`scrollContentList`,...t)}),(0,i.createSlots)({opener:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`opener`)]),footer:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`footer`),(0,i.createVNode)(n.h,{color:`theme`},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(f)||e.$i18n.Common.Cancel),1)]),_:1}),(0,i.createVNode)(n.h,{onClick:l},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(d)||e.$i18n.Common.OK),1)]),_:1})]),_:2},[e.$slots.header?{name:`header`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`header`)]),key:`0`}:void 0,e.$slots.default?{name:`content`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`),(0,i.createVNode)(_,{modelValue:c.value,"onUpdate:modelValue":t[0]||=e=>c.value=e,modelModifiers:{trim:!0}},null,8,[`modelValue`])]),key:`1`}:void 0]),1040))}}),x=(0,i.defineComponent)({__name:`popupHint`,props:{hint:{},id:{},class:{},transitionDuration:{},footerSupportLink:{},pos:{},notch:{type:Boolean},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{},data:{}},setup(e){let{hint:t,...r}=e;return(e,a)=>{let o=(0,i.resolveDirective)(`top-tooltip`);return(0,i.openBlock)(),(0,i.createBlock)(p,(0,i.mergeProps)({class:`top-popupHint`},r,{onOpen:a[0]||=t=>e.$emit(`open`,t),onClose:a[1]||=t=>e.$emit(`close`,t),onScrollContentList:a[2]||=(...t)=>e.$emit(`scrollContentList`,...t)}),(0,i.createSlots)({opener:(0,i.withCtx)(()=>[(0,i.withDirectives)((0,i.createVNode)(n.d,{hint:(0,i.unref)(t),class:`top-popupHint_opener`},null,8,[`hint`]),[[o]])]),_:2},[e.$slots.default?{name:`content`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`)]),key:`0`}:void 0]),1040)}}});t.c=o,t.s=p,t.o=g,t.a=_,t.i=v,t.r=y,t.n=b,t.t=x});
|
|
2
|
-
//# sourceMappingURL=popup-
|
|
1
|
+
define([`require`,`exports`,`./forms-C2ItFa61.amd`,`./worker-BIUaZFVX.amd`,`vue`,`../require/css.amd!../assets/popup.css`],function(e,t,n,r,i){"use strict";if(a===void 0)var a=window.Vue;Object.defineProperty(t,`__esModule`,{value:!0}),t.t=t.s=t.r=t.o=t.n=t.i=t.c=t.a=void 0;var o=(0,i.defineComponent)({__name:`opener`,props:{id:{},pos:{default:`3`},notch:{type:Boolean,default:!0},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{default:`fixed`},data:{}},setup(e){let t=e,n=t.id||Math.random()+``,a;function o(e){setTimeout(()=>{a=e.nextElementSibling,a&&s(a)})}(0,i.onUpdated)(()=>{a&&s(a)});function s(e){e.dataset.topPopup=`#`+n;let i=!!e.dataset.topPopupDisabled;if(e.dataset.topPopupId=n,e.dataset.topPopupPos=t.pos,e.dataset.topPopupPosBy=t.posBy,e.dataset.topPopupNotch=t.notch?`true`:``,e.dataset.topPopupOpenByHover=t.openByHover?`true`:``,e.dataset.topPopupDisabled=t.disabled?`true`:``,e.__TopPopupOpenerProps=t,t.openByFocusInput&&e.classList.contains(`top-input`)){let n=e.querySelector(`input`);if(n.onfocus=()=>{e.dataset.topPopupDisabled||r.t.getPopupFromOpener(e)?.vueGetComponent()?.opened||r.t.openByOpener(e)},t.disabled!==i&&n===document.activeElement){let n=r.t.getPopupFromOpener(e);!t.disabled&&!n&&r.t.openByOpener(e),t.disabled&&n&&n.close()}}}return(e,t)=>((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,null,[(0,i.createElementVNode)(`template`,{ref:o}),(0,i.renderSlot)(e.$slots,`default`)],64))}}),s={key:0,class:`top-popup_header`},c={key:0,class:`top-as-a closer`},l={key:1,class:`top-popup_widget`},u={key:2,class:`top-popup_content`},d={key:4,class:`top-popup_footer`},f=[`href`],p=(0,i.defineComponent)({__name:`popup`,props:{id:{default:``},class:{},transitionDuration:{},footerSupportLink:{},pos:{default:`3`},notch:{type:Boolean,default:!0},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{default:`fixed`},data:{}},emits:[`open`,`close`,`scrollContentList`],setup(e,{expose:t,emit:a}){let p=e,m=a,h=p.id||`top-popup-id-`+Math.random(),g={id:h,popup:void 0};t(g);let _=(0,i.ref)(null),v=(0,i.ref)(null),y=(0,i.ref)(),b={onOpen:async e=>{e.elPopup&&(_.value=e.elPopup),e.elPopupInner&&(e.elPopupInner.innerText=``,v.value=e.elPopupInner),b.opened=!0,b.popup=e,g.popup=e,y.value=e.el.__TopPopupOpenerProps.data,m(`open`,{elPopup:e.elPopup,elPopupOpener:e.el,data:y.value})},onClose:e=>{v.value=null,b.opened=!1,b.popup=void 0,y.value=void 0,m(`close`,{elPopup:e.elPopup,elPopupOpener:e.el,data:e.el.__TopPopupOpenerProps.data})},classRef:(0,i.toRef)(p,`class`),opened:!1,popup:void 0,transitionDurationRef:(0,i.toRef)(p,`transitionDuration`)};return(0,i.watch)(()=>p.class,(e,t)=>{if(!_.value)return;let n=e?.split(` `)??[],r=(t?.split(` `)??[]).filter(e=>!n.includes(e));_.value.classList.remove(...r),_.value.classList.add(...n)}),r.t.regVueComponent(h,b),(0,i.onUnmounted)(()=>{r.t.unregVueComponent(h)}),(t,r)=>{let a=(0,i.resolveDirective)(`top-scroll-shadow`);return(0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,null,[t.$slots.opener?((0,i.openBlock)(),(0,i.createBlock)(o,{key:0,id:(0,i.unref)(h),pos:e.pos,posBy:e.posBy,notch:e.notch,openByFocusInput:e.openByFocusInput,openByHover:t.$core.state.isMobile||t.$core.state.isMobileUA?!1:e.openByHover,disabled:e.disabled},{default:(0,i.withCtx)(()=>[(0,i.renderSlot)(t.$slots,`opener`)]),_:3},8,[`id`,`pos`,`posBy`,`notch`,`openByFocusInput`,`openByHover`,`disabled`])):(0,i.createCommentVNode)(``,!0),v.value?((0,i.openBlock)(),(0,i.createBlock)(i.Teleport,{key:1,to:v.value},[t.$slots.header||t.$core.state.isMobile?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,s,[t.$core.state.isMobile?((0,i.openBlock)(),(0,i.createElementBlock)(`span`,c,(0,i.toDisplayString)(t.$i18n.Common.Close),1)):(0,i.createCommentVNode)(``,!0),(0,i.renderSlot)(t.$slots,`header`,{data:y.value})])):(0,i.createCommentVNode)(``,!0),t.$slots.widget?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,l,[(0,i.renderSlot)(t.$slots,`widget`)])):(0,i.createCommentVNode)(``,!0),t.$slots.content?(0,i.withDirectives)(((0,i.openBlock)(),(0,i.createElementBlock)(`div`,u,[(0,i.renderSlot)(t.$slots,`content`,{data:y.value})])),[[a]]):(0,i.createCommentVNode)(``,!0),t.$slots.contentList?(0,i.withDirectives)(((0,i.openBlock)(),(0,i.createElementBlock)(`ul`,{key:3,class:`top-popup_content`,onScroll:r[0]||=e=>t.$emit(`scrollContentList`,e)},[(0,i.renderSlot)(t.$slots,`contentList`,{data:y.value})],32)),[[a]]):(0,i.createCommentVNode)(``,!0),t.$slots.footer||e.footerSupportLink?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,d,[e.footerSupportLink?((0,i.openBlock)(),(0,i.createElementBlock)(`a`,{key:0,class:`top-popup_footerSupportLink`,href:e.footerSupportLink,target:`_blank`},[(0,i.createVNode)(n.d,{hint:``})],8,f)):(0,i.createCommentVNode)(``,!0),(0,i.renderSlot)(t.$slots,`footer`,{data:y.value})])):(0,i.createCommentVNode)(``,!0)],8,[`to`])):(0,i.createCommentVNode)(``,!0)],64)}}}),m={class:`top-popup_listItemActionsLabel top-ellipsis1`},h={class:`top-popup_listItemActions`},g=(0,i.defineComponent)({inheritAttrs:!1,__name:`listItem`,props:{type:{default:`button`},closeByClick:{type:Boolean,default:!0},attrs:{}},setup(e){let t=e;return(n,r)=>((0,i.openBlock)(),(0,i.createElementBlock)(`li`,{class:(0,i.normalizeClass)({"top-popup_liNoSelectable":t.type!==`button`})},[((0,i.openBlock)(),(0,i.createBlock)((0,i.resolveDynamicComponent)(n.$attrs.href?`a`:`div`),(0,i.mergeProps)({class:{"top-popup_listItem":!0,[`top-popup_listItem-`+t.type]:!!t.type,"top-popup_liastItem-withActions":n.$slots.actions,"top-popup-noCloser":!e.closeByClick,a:t.type===`button`}},{...n.$attrs,...e.attrs}),{default:(0,i.withCtx)(()=>[n.$slots.actions?((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:0},[(0,i.createElementVNode)(`div`,m,[(0,i.renderSlot)(n.$slots,`default`)]),(0,i.createElementVNode)(`div`,h,[(0,i.renderSlot)(n.$slots,`actions`)])],64)):(0,i.renderSlot)(n.$slots,`default`,{key:1})]),_:3},16,[`class`])),(0,i.renderSlot)(n.$slots,`buttons`)],2))}}),_=(0,i.defineComponent)({__name:`widgetInput`,props:(0,i.mergeModels)({modelValue:{},name:{},disabled:{type:Boolean},readonly:{type:Boolean},modificator:{},size:{},styling:{},isError:{type:Boolean},isLoading:{type:Boolean},icon:{},icon2:{},addCleaner:{type:Boolean,default:!0},title:{},captionType:{}},{modelValue:{default:``},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=(0,i.useModel)(e,`modelValue`);return(e,r)=>((0,i.openBlock)(),(0,i.createBlock)(n.c,(0,i.mergeProps)(e.$props,{modificator:`popupWidgetInput`,modelValue:t.value,"onUpdate:modelValue":r[0]||=e=>t.value=e}),null,16,[`modelValue`]))}}),v=(0,i.defineComponent)({__name:`popupAlert`,props:{submitText:{},id:{},class:{},transitionDuration:{},footerSupportLink:{},pos:{},notch:{type:Boolean},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{},data:{}},emits:[`open`,`close`,`scrollContentList`],setup(e){let{submitText:t,...r}=e;return(e,a)=>((0,i.openBlock)(),(0,i.createBlock)(p,(0,i.mergeProps)({class:`top-popupAlert`},r,{onOpen:a[0]||=t=>e.$emit(`open`,t),onClose:a[1]||=t=>e.$emit(`close`,t),onScrollContentList:a[2]||=(...t)=>e.$emit(`scrollContentList`,...t)}),(0,i.createSlots)({opener:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`opener`)]),footer:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`footer`),(0,i.createVNode)(n.h,null,{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(t)||e.$i18n.Common.Close),1)]),_:1})]),_:2},[e.$slots.header?{name:`header`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`header`)]),key:`0`}:void 0,e.$slots.default?{name:`content`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`)]),key:`1`}:void 0]),1040))}}),y=(0,i.defineComponent)({__name:`popupConfirm`,props:{cancelText:{},submitText:{},isWarning:{type:Boolean},id:{},class:{},transitionDuration:{},footerSupportLink:{},pos:{},notch:{type:Boolean},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{},data:{}},emits:[`open`,`close`,`scrollContentList`,`submit`],setup(e,{emit:t}){let r=e,a=t,o=(0,i.ref)(!1),s=()=>{o.value=!0,a(`submit`)},c=e=>{if(o.value){o.value=!1;return}a(`close`,e)},{submitText:l,cancelText:u,isWarning:d,...f}=r;return(e,t)=>((0,i.openBlock)(),(0,i.createBlock)(p,(0,i.mergeProps)({class:`top-popupConfirm`},f,{onOpen:t[0]||=t=>e.$emit(`open`,t),onClose:t[1]||=e=>c(e),onScrollContentList:t[2]||=(...t)=>e.$emit(`scrollContentList`,...t)}),(0,i.createSlots)({opener:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`opener`)]),footer:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`footer`),(0,i.createVNode)(n.h,{color:`theme`},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(u)||e.$i18n.Common.Cancel),1)]),_:1}),(0,i.createVNode)(n.h,{onClick:s,color:(0,i.unref)(d)?`red`:`blue`},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(l)||e.$i18n.Common.Continue),1)]),_:1},8,[`color`])]),_:2},[e.$slots.header?{name:`header`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`header`)]),key:`0`}:void 0,e.$slots.default?{name:`content`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`)]),key:`1`}:void 0]),1040))}}),b=(0,i.defineComponent)({__name:`popupPrompt`,props:{submitText:{},cancelText:{},defaultValue:{},id:{},class:{},transitionDuration:{},footerSupportLink:{},pos:{},notch:{type:Boolean},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{},data:{}},emits:[`open`,`close`,`scrollContentList`,`submit`],setup(e,{emit:t}){let r=e,a=t,o=()=>c.value=r.defaultValue??``,s=(0,i.ref)(!1),c=(0,i.ref)();(0,i.watch)(()=>r.defaultValue,()=>o(),{immediate:!0});let l=()=>{s.value=!0},u=e=>{if(s.value){s.value=!1,a(`submit`,c.value),o();return}o(),a(`close`,e)},{submitText:d,cancelText:f,defaultValue:m,...h}=r;return(e,t)=>((0,i.openBlock)(),(0,i.createBlock)(p,(0,i.mergeProps)({class:`top-popupPrompt`},h,{onOpen:t[1]||=t=>e.$emit(`open`,t),onClose:t[2]||=e=>u(e),onScrollContentList:t[3]||=(...t)=>e.$emit(`scrollContentList`,...t)}),(0,i.createSlots)({opener:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`opener`)]),footer:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`footer`),(0,i.createVNode)(n.h,{color:`theme`},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(f)||e.$i18n.Common.Cancel),1)]),_:1}),(0,i.createVNode)(n.h,{onClick:l},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)((0,i.unref)(d)||e.$i18n.Common.OK),1)]),_:1})]),_:2},[e.$slots.header?{name:`header`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`header`)]),key:`0`}:void 0,e.$slots.default?{name:`content`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`),(0,i.createVNode)(_,{modelValue:c.value,"onUpdate:modelValue":t[0]||=e=>c.value=e,modelModifiers:{trim:!0}},null,8,[`modelValue`])]),key:`1`}:void 0]),1040))}}),x=(0,i.defineComponent)({__name:`popupHint`,props:{hint:{},id:{},class:{},transitionDuration:{},footerSupportLink:{},pos:{},notch:{type:Boolean},openByFocusInput:{type:Boolean},openByHover:{type:Boolean},disabled:{type:Boolean},posBy:{},data:{}},setup(e){let{hint:t,...r}=e;return(e,a)=>{let o=(0,i.resolveDirective)(`top-tooltip`);return(0,i.openBlock)(),(0,i.createBlock)(p,(0,i.mergeProps)({class:`top-popupHint`},r,{onOpen:a[0]||=t=>e.$emit(`open`,t),onClose:a[1]||=t=>e.$emit(`close`,t),onScrollContentList:a[2]||=(...t)=>e.$emit(`scrollContentList`,...t)}),(0,i.createSlots)({opener:(0,i.withCtx)(()=>[(0,i.withDirectives)((0,i.createVNode)(n.d,{hint:(0,i.unref)(t),class:`top-popupHint_opener`},null,8,[`hint`]),[[o]])]),_:2},[e.$slots.default?{name:`content`,fn:(0,i.withCtx)(()=>[(0,i.renderSlot)(e.$slots,`default`)]),key:`0`}:void 0]),1040)}}});t.c=o,t.s=p,t.o=g,t.a=_,t.i=v,t.r=y,t.n=b,t.t=x});
|
|
2
|
+
//# sourceMappingURL=popup-B06vbv6B.amd.js.map
|