@topvisor/ui 1.3.5-5.0 → 1.4.0-TopGroupSelector.10
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/core-BL-38XF7.es.js +196 -0
- package/.chunks/core-BL-38XF7.es.js.map +1 -0
- package/.chunks/core-BsPx05H9.amd.js +2 -0
- package/.chunks/core-BsPx05H9.amd.js.map +1 -0
- package/.chunks/{datepicker-CPrHVH4x.amd.js → datepicker-3coUsFW2.amd.js} +2 -2
- package/.chunks/{datepicker-CPrHVH4x.amd.js.map → datepicker-3coUsFW2.amd.js.map} +1 -1
- package/.chunks/{datepicker-J8Zg9mKt.es.js → datepicker-D1Hw3a3o.es.js} +14 -17
- package/.chunks/{datepicker-J8Zg9mKt.es.js.map → datepicker-D1Hw3a3o.es.js.map} +1 -1
- package/.chunks/dialog_regionSelectorRegions-1UVhgK2f.es.js +180 -0
- package/.chunks/dialog_regionSelectorRegions-1UVhgK2f.es.js.map +1 -0
- package/.chunks/dialog_regionSelectorRegions-CZ8IX7la.amd.js +2 -0
- package/.chunks/dialog_regionSelectorRegions-CZ8IX7la.amd.js.map +1 -0
- package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-DvkvzHEY.es.js → dialogs.vue_vue_type_script_setup_true_lang-DRbTG0vh.es.js} +111 -112
- package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-DvkvzHEY.es.js.map → dialogs.vue_vue_type_script_setup_true_lang-DRbTG0vh.es.js.map} +1 -1
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-Dq9kWWMg.amd.js +2 -0
- package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-8KsNy0Bd.amd.js.map → dialogs.vue_vue_type_script_setup_true_lang-Dq9kWWMg.amd.js.map} +1 -1
- package/.chunks/forms-BseC3Ftz.es.js +2035 -0
- package/.chunks/{forms-COXAfg9G.es.js.map → forms-BseC3Ftz.es.js.map} +1 -1
- package/.chunks/forms-CUSCBQu3.amd.js +3 -0
- package/.chunks/{forms-DXX5M4DO.amd.js.map → forms-CUSCBQu3.amd.js.map} +1 -1
- package/.chunks/index-DLUtoTUg.amd.js +2 -0
- package/.chunks/index-DLUtoTUg.amd.js.map +1 -0
- package/.chunks/index-DkQWJkMc.es.js +54 -0
- package/.chunks/index-DkQWJkMc.es.js.map +1 -0
- package/.chunks/notice-Cl3ZgiHm.es.js +191 -0
- package/.chunks/{notice-P7CXfEuX.es.js.map → notice-Cl3ZgiHm.es.js.map} +1 -1
- package/.chunks/notice-DwjipV21.amd.js +4 -0
- package/.chunks/{notice-CSGn_jTM.amd.js.map → notice-DwjipV21.amd.js.map} +1 -1
- package/.chunks/page.vue_vue_type_script_setup_true_lang-CjIiZU-D.amd.js +2 -0
- package/.chunks/{page.vue_vue_type_script_setup_true_lang-DHPOnLj5.amd.js.map → page.vue_vue_type_script_setup_true_lang-CjIiZU-D.amd.js.map} +1 -1
- package/.chunks/page.vue_vue_type_script_setup_true_lang-CpRJQFD1.es.js +139 -0
- package/.chunks/{page.vue_vue_type_script_setup_true_lang-D9m45rLs.es.js.map → page.vue_vue_type_script_setup_true_lang-CpRJQFD1.es.js.map} +1 -1
- package/.chunks/policy.vue_vue_type_style_index_0_lang-BBDJEs5Q.es.js +496 -0
- package/.chunks/policy.vue_vue_type_style_index_0_lang-BBDJEs5Q.es.js.map +1 -0
- package/.chunks/policy.vue_vue_type_style_index_0_lang-DJOaMdBm.amd.js +2 -0
- package/.chunks/policy.vue_vue_type_style_index_0_lang-DJOaMdBm.amd.js.map +1 -0
- package/.chunks/popup-DRuyYFGB.amd.js +2 -0
- package/.chunks/popup-DRuyYFGB.amd.js.map +1 -0
- package/.chunks/popup-Jw_Yyg3U.es.js +470 -0
- package/.chunks/popup-Jw_Yyg3U.es.js.map +1 -0
- package/.chunks/popupHint.vue_vue_type_style_index_0_lang-DD59yF6H.es.js +209 -0
- package/.chunks/popupHint.vue_vue_type_style_index_0_lang-DD59yF6H.es.js.map +1 -0
- package/.chunks/popupHint.vue_vue_type_style_index_0_lang-DtiT6NE4.amd.js +2 -0
- package/.chunks/popupHint.vue_vue_type_style_index_0_lang-DtiT6NE4.amd.js.map +1 -0
- package/.chunks/utils-CzHUG_xz.amd.js +2 -0
- package/.chunks/{utils-D505nRsu.amd.js.map → utils-CzHUG_xz.amd.js.map} +1 -1
- package/.chunks/utils-D9nYQabE.amd.js +2 -0
- package/.chunks/{utils-DmxcQpWA.amd.js.map → utils-D9nYQabE.amd.js.map} +1 -1
- package/.chunks/{utils-CWm0zAtM.es.js → utils-Q69SXlnV.es.js} +192 -208
- package/.chunks/{utils-CWm0zAtM.es.js.map → utils-Q69SXlnV.es.js.map} +1 -1
- package/.chunks/{utils-Rbz9mxy6.es.js → utils-YrUExsH7.es.js} +23 -24
- package/.chunks/{utils-Rbz9mxy6.es.js.map → utils-YrUExsH7.es.js.map} +1 -1
- package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-TVpBXc9F.es.js → widgetInput.vue_vue_type_script_setup_true_lang-CDkeKVqY.es.js} +2 -2
- package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-TVpBXc9F.es.js.map → widgetInput.vue_vue_type_script_setup_true_lang-CDkeKVqY.es.js.map} +1 -1
- package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-BU-FdL6d.amd.js → widgetInput.vue_vue_type_script_setup_true_lang-CkE912ll.amd.js} +2 -2
- package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-BU-FdL6d.amd.js.map → widgetInput.vue_vue_type_script_setup_true_lang-CkE912ll.amd.js.map} +1 -1
- package/api/index.amd.js +1 -1
- package/api/index.amd.js.map +1 -1
- package/api/index.js +138 -133
- package/api/index.js.map +1 -1
- package/assets/dialog_regionSelectorRegions.css +1 -0
- package/assets/forms.css +1 -1
- package/assets/policy.css +1 -0
- package/assets/popupHint.css +1 -1
- package/assets/project.css +1 -1
- package/charts/charts.amd.js +1 -1
- package/charts/charts.amd.js.map +1 -1
- package/charts/charts.js +80 -80
- package/charts/charts.js.map +1 -1
- package/core/app.amd.js +1 -1
- package/core/app.amd.js.map +1 -1
- package/core/app.js +93 -96
- package/core/app.js.map +1 -1
- package/dialog/dialog.amd.js +1 -1
- package/dialog/dialog.amd.js.map +1 -1
- package/dialog/dialog.js +13 -13
- package/dialog/dialog.js.map +1 -1
- package/extra/extra.amd.js +1 -1
- package/extra/extra.amd.js.map +1 -1
- package/extra/extra.js +20 -23
- package/extra/extra.js.map +1 -1
- package/forms/forms.amd.js +1 -1
- package/forms/forms.js +5 -5
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.amd.js.map +1 -1
- package/formsExt/formsExt.js +180 -541
- package/formsExt/formsExt.js.map +1 -1
- package/layout/layout.amd.js +1 -1
- package/layout/layout.js +6 -6
- package/package.json +1 -1
- package/popup/popup.amd.js +1 -1
- package/popup/popup.amd.js.map +1 -1
- package/popup/popup.js +43 -46
- package/popup/popup.js.map +1 -1
- package/popup/worker.amd.js +1 -1
- package/popup/worker.amd.js.map +1 -1
- package/popup/worker.js +11 -9
- package/popup/worker.js.map +1 -1
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +847 -579
- package/project/project.js.map +1 -1
- package/src/api/api/client/client.d.ts +5 -0
- package/src/api/api/mocker/index.d.ts +3 -3
- package/src/api/api/types/client/request.d.ts +6 -0
- package/src/api/api/types/mocker.d.ts +2 -2
- package/src/components/formsExt/formsExt.d.ts +1 -0
- package/src/components/formsExt/selector2/cache.d.ts +12 -0
- package/src/components/formsExt/selector2/composables/useAPI.d.ts +2033 -0
- package/src/components/formsExt/selector2/composables/useMenu.d.ts +2045 -5
- package/src/components/formsExt/selector2/itemMulti.vue.d.ts +3 -3
- package/src/components/formsExt/selector2/selector2.vue.d.ts +9 -3
- package/src/components/formsExt/selector2/types.d.ts +25 -8
- package/src/components/formsExt/selector2/utils.d.ts +16 -0
- package/src/components/popup/lib/popup.d.ts +1 -2
- package/src/components/popup/popup/opener/types.d.ts +6 -2
- package/src/components/popup/popup/types.d.ts +3 -2
- package/src/components/popup/popup.d.ts +1 -1
- package/src/components/project/groupSelector/folders/folders.vue.d.ts +18 -0
- package/src/components/project/groupSelector/folders/types.d.ts +63 -0
- package/src/components/project/groupSelector/folders/utils.d.ts +63 -0
- package/src/components/project/groupSelector/groupSelector.vue.d.ts +33 -0
- package/src/components/project/groupSelector/groups/groups.vue.d.ts +126 -0
- package/src/components/project/groupSelector/groups/types.d.ts +58 -0
- package/src/components/project/groupSelector/groups/utils.d.ts +92 -0
- package/src/components/project/groupSelector/stories/mocks/folders.d.ts +4 -0
- package/src/components/project/groupSelector/stories/mocks/groups.d.ts +2 -0
- package/src/components/project/groupSelector/stories/mocks/index.d.ts +7 -0
- package/src/components/project/groupSelector/types.d.ts +133 -0
- package/src/components/project/project.d.ts +5 -4
- package/src/components/project/{selectorRegion → regionSelector}/utils/utils.d.ts +3 -3
- package/src/core/utils/composables/useWatch.d.ts +32 -0
- package/tabs/tabs.amd.js +1 -1
- package/tabs/tabs.amd.js.map +1 -1
- package/tabs/tabs.js +24 -24
- package/tabs/tabs.js.map +1 -1
- package/tabsView/tabsView.amd.js +1 -1
- package/tabsView/tabsView.amd.js.map +1 -1
- package/tabsView/tabsView.js +131 -133
- package/tabsView/tabsView.js.map +1 -1
- package/utils/clipboard.amd.js +1 -1
- package/utils/clipboard.js +1 -1
- package/utils/date.amd.js +1 -1
- package/utils/date.js +1 -1
- package/utils/device.amd.js +1 -1
- package/utils/device.js +1 -1
- package/utils/lodash.amd.js +1 -1
- package/utils/lodash.js +1 -1
- package/utils/price.amd.js +1 -1
- package/utils/price.js +1 -1
- package/utils/scroll.amd.js +1 -1
- package/utils/scroll.amd.js.map +1 -1
- package/utils/scroll.js +14 -14
- package/utils/scroll.js.map +1 -1
- package/utils/searchers.amd.js +1 -1
- package/utils/searchers.js +3 -3
- package/utils/string.amd.js +1 -1
- package/utils/string.amd.js.map +1 -1
- package/utils/string.js +3 -7
- package/utils/string.js.map +1 -1
- package/.chunks/core-CaWxDXrZ.es.js +0 -197
- package/.chunks/core-CaWxDXrZ.es.js.map +0 -1
- package/.chunks/core-DmO1i1Ua.amd.js +0 -2
- package/.chunks/core-DmO1i1Ua.amd.js.map +0 -1
- package/.chunks/dialog_selectorRegions-DoEjgXtb.es.js +0 -190
- package/.chunks/dialog_selectorRegions-DoEjgXtb.es.js.map +0 -1
- package/.chunks/dialog_selectorRegions-DzufTzj9.amd.js +0 -2
- package/.chunks/dialog_selectorRegions-DzufTzj9.amd.js.map +0 -1
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-8KsNy0Bd.amd.js +0 -2
- package/.chunks/forms-COXAfg9G.es.js +0 -2047
- package/.chunks/forms-DXX5M4DO.amd.js +0 -3
- package/.chunks/index-BEI7XZmU.amd.js +0 -2
- package/.chunks/index-BEI7XZmU.amd.js.map +0 -1
- package/.chunks/index-igPkes8X.es.js +0 -48
- package/.chunks/index-igPkes8X.es.js.map +0 -1
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang--W1RouXP.es.js +0 -199
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang--W1RouXP.es.js.map +0 -1
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-DzV225TL.amd.js +0 -2
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-DzV225TL.amd.js.map +0 -1
- package/.chunks/menu.vue_vue_type_style_index_0_lang-BiyxTfdE.es.js +0 -112
- package/.chunks/menu.vue_vue_type_style_index_0_lang-BiyxTfdE.es.js.map +0 -1
- package/.chunks/menu.vue_vue_type_style_index_0_lang-D3OAqOqX.amd.js +0 -2
- package/.chunks/menu.vue_vue_type_style_index_0_lang-D3OAqOqX.amd.js.map +0 -1
- package/.chunks/notice-CSGn_jTM.amd.js +0 -4
- package/.chunks/notice-P7CXfEuX.es.js +0 -194
- package/.chunks/opener.vue_vue_type_script_setup_true_lang-DRzrTv7Q.es.js +0 -36
- package/.chunks/opener.vue_vue_type_script_setup_true_lang-DRzrTv7Q.es.js.map +0 -1
- package/.chunks/opener.vue_vue_type_script_setup_true_lang-gNZhYkDf.amd.js +0 -2
- package/.chunks/opener.vue_vue_type_script_setup_true_lang-gNZhYkDf.amd.js.map +0 -1
- package/.chunks/page.vue_vue_type_script_setup_true_lang-D9m45rLs.es.js +0 -143
- package/.chunks/page.vue_vue_type_script_setup_true_lang-DHPOnLj5.amd.js +0 -2
- package/.chunks/popup-CF4k7j3U.amd.js +0 -2
- package/.chunks/popup-CF4k7j3U.amd.js.map +0 -1
- package/.chunks/popup-G7FYKscC.es.js +0 -485
- package/.chunks/popup-G7FYKscC.es.js.map +0 -1
- package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Cce9ZdtW.amd.js +0 -2
- package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Cce9ZdtW.amd.js.map +0 -1
- package/.chunks/utils-D505nRsu.amd.js +0 -2
- package/.chunks/utils-DmxcQpWA.amd.js +0 -2
- package/assets/dialog_selectorRegions.css +0 -1
- package/assets/formsExt.css +0 -1
- package/assets/listItem.css +0 -1
- package/assets/menu.css +0 -1
- package/src/components/popup/popup/opener.vue.d.ts +0 -17
- /package/src/components/project/{selectorCompetitors/selectorCompetitors.vue.d.ts → competitorSelector/competitorSelector.vue.d.ts} +0 -0
- /package/src/components/project/{selectorCompetitors → competitorSelector}/composables.d.ts +0 -0
- /package/src/components/project/{selectorCompetitors → competitorSelector}/types.d.ts +0 -0
- /package/src/components/project/{selectorRegion → regionSelector}/composables/compare.d.ts +0 -0
- /package/src/components/project/{selectorRegion → regionSelector}/composables/selectRegion.d.ts +0 -0
- /package/src/components/project/{selectorRegion → regionSelector}/composables/selectSearcher.d.ts +0 -0
- /package/src/components/project/{selectorRegion → regionSelector}/composables/selectorRegion.d.ts +0 -0
- /package/src/components/project/{selectorRegion/dialog_selectorRegions/dialog_selectorRegions.vue.d.ts → regionSelector/dialog_regionSelectorRegions/dialog_regionSelectorRegions.vue.d.ts} +0 -0
- /package/src/components/project/{selectorRegion/dialog_selectorRegions → regionSelector/dialog_regionSelectorRegions}/types.d.ts +0 -0
- /package/src/components/project/{selectorRegion/selectorRegion.vue.d.ts → regionSelector/regionSelector.vue.d.ts} +0 -0
- /package/src/components/project/{selectorRegion → regionSelector}/types.d.ts +0 -0
- /package/src/components/project/{selectorRegion → regionSelector}/utils/consts.d.ts +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(["require","exports","@faker-js/faker"],(function(k,u,a){"use strict";if(typeof M>"u")var M=window.Vue;const y=20,w=async(e,s,t,l)=>{if(e.delay){e.showLog&&console.log("genMock pause",e.delay);const{sleep:n}=await new Promise((c,d)=>k(["../utils/system.amd"],c,d));let o=n(e.delay);l&&(o=Promise.race([o,new Promise((c,d)=>{l.addEventListener("abort",()=>{d(new DOMException("The operation was aborted from API mocker.","AbortError"))})})])),await o}const r={result:g(e,s,t),errors:void 0,nextOffset:void 0,total:void 0};if(delete r.errors,delete r.nextOffset,delete r.total,Array.isArray(r.result)&&e.total&&t&&t.limit){e.useFilter&&(r.result=r.result.filter(o=>e.useFilter?.(o,t)));const n=t.offset??0;r.result.length>t.limit+n&&(r.nextOffset=t.limit+n,r.total=e.total),r.result=r.result.slice(n,n+t.limit)}return e.showLog&&console.log("genMock complete",r),r},g=(e,s,t)=>{let l=e.seed??0;if(l===-1&&(l=Math.random()),e.result instanceof Function)return a.faker.seed(l),f(e.result,0,s,t);if(Array.isArray(e.result)){const r=e.result[0],n=[],o=e.total??t?.limit??y;for(let c=0;c<o;c++)n.push(i(r,c,l,s,t));return n}return i(e.result,0,l,s,t)},i=(e,s,t,l,r)=>{const n={};for(const o in e){const c=e[o];l&&!l.includes(o)||(a.faker.seed(t+s),n[o]=f(c,s,l,r))}return n},f=(e,s=0,t,l)=>e(s,t,l);u.genMockItem=i,u.genMockResponse=w,u.genMockResult=g,u.genMockValue=f,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})}));
|
|
2
|
+
//# sourceMappingURL=index-DLUtoTUg.amd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DLUtoTUg.amd.js","sources":["../../src/api/api/mocker/index.ts"],"sourcesContent":["import { faker } from '@faker-js/faker';\n\nconst DEFAULT_LIMIT = 20;\n\nexport const genMockResponse = async (\n\toptions: Api.Mocker.Options<any, any>,\n\tfields?: readonly string[],\n\tparams?: Api.Mocker.Params,\n\trequestInitSignal?: ReturnType<Api.ClientRequest<any>['abortByFingerprint']>,\n) => {\n\tif (options.delay) {\n\t\tif (options.showLog) {\n\t\t\tconsole.log('genMock pause', options.delay);\n\t\t}\n\n\t\tconst { sleep } = await import('@/core/utils/system');\n\n\t\tlet promise = sleep(options.delay);\n\n\t\tif (requestInitSignal) {\n\t\t\tpromise = Promise.race<void>([\n\t\t\t\tpromise,\n\n\t\t\t\t// обработчик отмены\n\t\t\t\tnew Promise((_resolve, reject) => {\n\t\t\t\t\trequestInitSignal.addEventListener('abort', () => {\n\t\t\t\t\t\treject(new DOMException('The operation was aborted from API mocker.', 'AbortError'));\n\t\t\t\t\t});\n\t\t\t\t}),\n\t\t\t]);\n\t\t}\n\n\t\tawait promise;\n\t}\n\n\tconst res = {\n\t\tresult: genMockResult(options, fields, params),\n\t\terrors: undefined,\n\t\tnextOffset: undefined as number | undefined,\n\t\ttotal: undefined as number | undefined,\n\t};\n\n\tdelete res.errors;\n\tdelete res.nextOffset;\n\tdelete res.total;\n\n\t// реализация `limit` и `offset`\n\tif (Array.isArray(res.result) && options.total && params && params.limit) {\n\t\tif (options.useFilter) {\n\t\t\tres.result = res.result.filter((resultItem) => options.useFilter?.(resultItem, params));\n\t\t}\n\n\t\tconst offset = params.offset ?? 0;\n\n\t\tif (res.result.length > params.limit + offset) {\n\t\t\tres.nextOffset = params.limit + offset;\n\t\t\tres.total = options.total;\n\t\t}\n\n\t\tres.result = res.result.slice(offset, offset + params.limit);\n\t}\n\n\tif (options.showLog) {\n\t\tconsole.log('genMock complete', res);\n\t}\n\n\treturn res;\n};\n\nexport const genMockResult = <Options extends Api.Mocker.Options<any, any>>(\n\toptions: Options,\n\tfields?: readonly string[],\n\tparams?: Api.Mocker.Params,\n): Api.Mocker.ToMockResult<Options['result']> => {\n\tlet seed: number | undefined = options.seed ?? 0;\n\tif (seed === -1) seed = Math.random();\n\n\tif (options.result instanceof Function) {\n\t\tfaker.seed(seed);\n\n\t\treturn genMockValue(options.result, 0, fields, params);\n\t}\n\n\tif (Array.isArray(options.result)) {\n\t\tconst genItem = options.result[0];\n\n\t\tconst result = [] as Api.Mocker.ToMockResult<Options['result']>;\n\n\t\t// для работы `useFilter()` применять `params.limit` можно только после применения фильтра\n\t\tconst total = options.total ?? params?.limit ?? DEFAULT_LIMIT;\n\n\t\tfor (let i = 0; i < total; i++) {\n\t\t\tresult.push(genMockItem(genItem, i, seed, fields, params));\n\t\t}\n\n\t\treturn result;\n\t}\n\n\treturn genMockItem(options.result, 0, seed, fields, params) as Api.Mocker.ToMockResult<Options['result']>;\n};\n\nexport const genMockItem = <T extends Api.Mocker.Item>(\n\tgenItem: T,\n\tn: number,\n\tseed: number,\n\tfields?: readonly string[],\n\tparams?: Api.Mocker.Params,\n): Api.Mocker.ToMockItem<T> => {\n\tconst item = {} as Api.Mocker.ToMockItem<T>;\n\n\tfor (const key in genItem) {\n\t\tconst genValue = genItem[key];\n\n\t\tif (fields && !fields.includes(key)) continue;\n\n\t\t// seed для генерации одного объекта всегда одинаковый\n\t\tfaker.seed(seed + n);\n\n\t\titem[key] = genMockValue(genValue, n, fields, params);\n\t}\n\n\treturn item;\n};\n\nexport const genMockValue = <T extends Api.Mocker.Value>(\n\tgenValue: T,\n\tn: number = 0,\n\tfields?: readonly string[],\n\tparams?: Api.Mocker.Params,\n): Api.Mocker.ToMockValue<T> => {\n\treturn genValue(n, fields, params);\n};\n"],"names":["genMockResponse","options","fields","params","requestInitSignal","promise","_resolve","reject","res","offset","genMockResult","seed","faker","genMockValue","i","total","result","genMockItem","genItem","n","key","gen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F,EAAA,EAAAjB,EAAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { faker as i } from "@faker-js/faker";
|
|
2
|
+
const a = 20, y = async (e, c, t, l) => {
|
|
3
|
+
if (e.delay) {
|
|
4
|
+
e.showLog && console.log("genMock pause", e.delay);
|
|
5
|
+
const { sleep: o } = await import("../utils/system.js");
|
|
6
|
+
let s = o(e.delay);
|
|
7
|
+
l && (s = Promise.race([
|
|
8
|
+
s,
|
|
9
|
+
// обработчик отмены
|
|
10
|
+
new Promise((n, d) => {
|
|
11
|
+
l.addEventListener("abort", () => {
|
|
12
|
+
d(new DOMException("The operation was aborted from API mocker.", "AbortError"));
|
|
13
|
+
});
|
|
14
|
+
})
|
|
15
|
+
])), await s;
|
|
16
|
+
}
|
|
17
|
+
const r = {
|
|
18
|
+
result: g(e, c, t),
|
|
19
|
+
errors: void 0,
|
|
20
|
+
nextOffset: void 0,
|
|
21
|
+
total: void 0
|
|
22
|
+
};
|
|
23
|
+
if (delete r.errors, delete r.nextOffset, delete r.total, Array.isArray(r.result) && e.total && t && t.limit) {
|
|
24
|
+
e.useFilter && (r.result = r.result.filter((s) => e.useFilter?.(s, t)));
|
|
25
|
+
const o = t.offset ?? 0;
|
|
26
|
+
r.result.length > t.limit + o && (r.nextOffset = t.limit + o, r.total = e.total), r.result = r.result.slice(o, o + t.limit);
|
|
27
|
+
}
|
|
28
|
+
return e.showLog && console.log("genMock complete", r), r;
|
|
29
|
+
}, g = (e, c, t) => {
|
|
30
|
+
let l = e.seed ?? 0;
|
|
31
|
+
if (l === -1 && (l = Math.random()), e.result instanceof Function)
|
|
32
|
+
return i.seed(l), f(e.result, 0, c, t);
|
|
33
|
+
if (Array.isArray(e.result)) {
|
|
34
|
+
const r = e.result[0], o = [], s = e.total ?? t?.limit ?? a;
|
|
35
|
+
for (let n = 0; n < s; n++)
|
|
36
|
+
o.push(u(r, n, l, c, t));
|
|
37
|
+
return o;
|
|
38
|
+
}
|
|
39
|
+
return u(e.result, 0, l, c, t);
|
|
40
|
+
}, u = (e, c, t, l, r) => {
|
|
41
|
+
const o = {};
|
|
42
|
+
for (const s in e) {
|
|
43
|
+
const n = e[s];
|
|
44
|
+
l && !l.includes(s) || (i.seed(t + c), o[s] = f(n, c, l, r));
|
|
45
|
+
}
|
|
46
|
+
return o;
|
|
47
|
+
}, f = (e, c = 0, t, l) => e(c, t, l);
|
|
48
|
+
export {
|
|
49
|
+
u as genMockItem,
|
|
50
|
+
y as genMockResponse,
|
|
51
|
+
g as genMockResult,
|
|
52
|
+
f as genMockValue
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=index-DkQWJkMc.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DkQWJkMc.es.js","sources":["../../src/api/api/mocker/index.ts"],"sourcesContent":["import { faker } from '@faker-js/faker';\n\nconst DEFAULT_LIMIT = 20;\n\nexport const genMockResponse = async (\n\toptions: Api.Mocker.Options<any, any>,\n\tfields?: readonly string[],\n\tparams?: Api.Mocker.Params,\n\trequestInitSignal?: ReturnType<Api.ClientRequest<any>['abortByFingerprint']>,\n) => {\n\tif (options.delay) {\n\t\tif (options.showLog) {\n\t\t\tconsole.log('genMock pause', options.delay);\n\t\t}\n\n\t\tconst { sleep } = await import('@/core/utils/system');\n\n\t\tlet promise = sleep(options.delay);\n\n\t\tif (requestInitSignal) {\n\t\t\tpromise = Promise.race<void>([\n\t\t\t\tpromise,\n\n\t\t\t\t// обработчик отмены\n\t\t\t\tnew Promise((_resolve, reject) => {\n\t\t\t\t\trequestInitSignal.addEventListener('abort', () => {\n\t\t\t\t\t\treject(new DOMException('The operation was aborted from API mocker.', 'AbortError'));\n\t\t\t\t\t});\n\t\t\t\t}),\n\t\t\t]);\n\t\t}\n\n\t\tawait promise;\n\t}\n\n\tconst res = {\n\t\tresult: genMockResult(options, fields, params),\n\t\terrors: undefined,\n\t\tnextOffset: undefined as number | undefined,\n\t\ttotal: undefined as number | undefined,\n\t};\n\n\tdelete res.errors;\n\tdelete res.nextOffset;\n\tdelete res.total;\n\n\t// реализация `limit` и `offset`\n\tif (Array.isArray(res.result) && options.total && params && params.limit) {\n\t\tif (options.useFilter) {\n\t\t\tres.result = res.result.filter((resultItem) => options.useFilter?.(resultItem, params));\n\t\t}\n\n\t\tconst offset = params.offset ?? 0;\n\n\t\tif (res.result.length > params.limit + offset) {\n\t\t\tres.nextOffset = params.limit + offset;\n\t\t\tres.total = options.total;\n\t\t}\n\n\t\tres.result = res.result.slice(offset, offset + params.limit);\n\t}\n\n\tif (options.showLog) {\n\t\tconsole.log('genMock complete', res);\n\t}\n\n\treturn res;\n};\n\nexport const genMockResult = <Options extends Api.Mocker.Options<any, any>>(\n\toptions: Options,\n\tfields?: readonly string[],\n\tparams?: Api.Mocker.Params,\n): Api.Mocker.ToMockResult<Options['result']> => {\n\tlet seed: number | undefined = options.seed ?? 0;\n\tif (seed === -1) seed = Math.random();\n\n\tif (options.result instanceof Function) {\n\t\tfaker.seed(seed);\n\n\t\treturn genMockValue(options.result, 0, fields, params);\n\t}\n\n\tif (Array.isArray(options.result)) {\n\t\tconst genItem = options.result[0];\n\n\t\tconst result = [] as Api.Mocker.ToMockResult<Options['result']>;\n\n\t\t// для работы `useFilter()` применять `params.limit` можно только после применения фильтра\n\t\tconst total = options.total ?? params?.limit ?? DEFAULT_LIMIT;\n\n\t\tfor (let i = 0; i < total; i++) {\n\t\t\tresult.push(genMockItem(genItem, i, seed, fields, params));\n\t\t}\n\n\t\treturn result;\n\t}\n\n\treturn genMockItem(options.result, 0, seed, fields, params) as Api.Mocker.ToMockResult<Options['result']>;\n};\n\nexport const genMockItem = <T extends Api.Mocker.Item>(\n\tgenItem: T,\n\tn: number,\n\tseed: number,\n\tfields?: readonly string[],\n\tparams?: Api.Mocker.Params,\n): Api.Mocker.ToMockItem<T> => {\n\tconst item = {} as Api.Mocker.ToMockItem<T>;\n\n\tfor (const key in genItem) {\n\t\tconst genValue = genItem[key];\n\n\t\tif (fields && !fields.includes(key)) continue;\n\n\t\t// seed для генерации одного объекта всегда одинаковый\n\t\tfaker.seed(seed + n);\n\n\t\titem[key] = genMockValue(genValue, n, fields, params);\n\t}\n\n\treturn item;\n};\n\nexport const genMockValue = <T extends Api.Mocker.Value>(\n\tgenValue: T,\n\tn: number = 0,\n\tfields?: readonly string[],\n\tparams?: Api.Mocker.Params,\n): Api.Mocker.ToMockValue<T> => {\n\treturn genValue(n, fields, params);\n};\n"],"names":["DEFAULT_LIMIT","genMockResponse","options","fields","params","requestInitSignal","sleep","promise","_resolve","reject","res","genMockResult","resultItem","offset","seed","faker","genMockValue","genItem","result","total","i","genMockItem","n","item","key","genValue"],"mappings":";AAEA,MAAMA,IAAgB,IAETC,IAAkB,OAC9BC,GACAC,GACAC,GACAC,MACI;AACJ,MAAIH,EAAQ,OAAO;AAClB,IAAIA,EAAQ,WACX,QAAQ,IAAI,iBAAiBA,EAAQ,KAAK;AAG3C,UAAM,EAAE,OAAAI,EAAA,IAAU,MAAM,OAAO,oBAAqB;AAEpD,QAAIC,IAAUD,EAAMJ,EAAQ,KAAK;AAEjC,IAAIG,MACHE,IAAU,QAAQ,KAAW;AAAA,MAC5BA;AAAA;AAAA,MAGA,IAAI,QAAQ,CAACC,GAAUC,MAAW;AACjC,QAAAJ,EAAkB,iBAAiB,SAAS,MAAM;AACjD,UAAAI,EAAO,IAAI,aAAa,8CAA8C,YAAY,CAAC;AAAA,QACpF,CAAC;AAAA,MACF,CAAC;AAAA,IAAA,CACD,IAGF,MAAMF;AAAA,EACP;AAEA,QAAMG,IAAM;AAAA,IACX,QAAQC,EAAcT,GAASC,GAAQC,CAAM;AAAA,IAC7C,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,OAAO;AAAA,EAAA;AAQR,MALA,OAAOM,EAAI,QACX,OAAOA,EAAI,YACX,OAAOA,EAAI,OAGP,MAAM,QAAQA,EAAI,MAAM,KAAKR,EAAQ,SAASE,KAAUA,EAAO,OAAO;AACzE,IAA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,EAAaS,GAAUH,GAAGnB,GAAQC,CAAM;AAAA,EACrD;AAEA,SAAOmB;AACR,GAEaP,IAAe,CAC3BS,GACAH,IAAY,GACZnB,GACAC,MAEOqB,EAASH,GAAGnB,GAAQC,CAAM;"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
import { Core as _autoloadCSSCore } from '../core/app.js';
|
|
3
|
+
const fileNames = ['../assets/notice.css'].map(fileName => import.meta.resolve(fileName));
|
|
4
|
+
_autoloadCSSCore.insertCSSLinkToPage(fileNames, true);
|
|
5
|
+
|
|
6
|
+
import { reactive as N, defineComponent as B, ref as _, computed as H, resolveComponent as z, withDirectives as D, createElementBlock as a, openBlock as l, normalizeClass as E, createElementVNode as M, createBlock as C, createCommentVNode as T, mergeProps as L, Fragment as S, renderList as x, Teleport as j, unref as O, normalizeStyle as V } from "vue";
|
|
7
|
+
import { C as h } from "./forms-BseC3Ftz.es.js";
|
|
8
|
+
import { genIntHash as A, nl2br as F } from "../utils/string.js";
|
|
9
|
+
const y = 300, u = N(/* @__PURE__ */ new Map()), J = (e, i, t) => "top-notice_" + A(e + i + JSON.stringify(t)), oe = (e, i = "info", t) => {
|
|
10
|
+
let d = "";
|
|
11
|
+
e = String(e);
|
|
12
|
+
const f = J(e, i, t);
|
|
13
|
+
if (t?.title)
|
|
14
|
+
d = t.title;
|
|
15
|
+
else {
|
|
16
|
+
const c = e.split(`
|
|
17
|
+
`);
|
|
18
|
+
c.length && (d = String(c.shift()), e = c.join(`
|
|
19
|
+
`));
|
|
20
|
+
}
|
|
21
|
+
const o = u.get(f);
|
|
22
|
+
if (o) {
|
|
23
|
+
U(o);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const r = {
|
|
27
|
+
id: f,
|
|
28
|
+
title: d,
|
|
29
|
+
text: e,
|
|
30
|
+
style: i,
|
|
31
|
+
buttonProps: t?.buttonProps,
|
|
32
|
+
buttonsProps: t?.buttonsProps,
|
|
33
|
+
metaText: t?.metaText,
|
|
34
|
+
isSafeHTML: t?.isSafeHTML,
|
|
35
|
+
selectToClose: t?.selectToClose,
|
|
36
|
+
onClose: t?.onClose
|
|
37
|
+
};
|
|
38
|
+
if (u.set(r.id, r), u.size > 5) {
|
|
39
|
+
const [c, g] = [...u].at(0) || [];
|
|
40
|
+
g && P(g);
|
|
41
|
+
}
|
|
42
|
+
h.state.isMobile && $("input").one("click", () => P(r));
|
|
43
|
+
}, U = (e) => {
|
|
44
|
+
e.hightlight = !0, setTimeout(() => e.hightlight = !1, y);
|
|
45
|
+
}, P = (e) => {
|
|
46
|
+
e.forceClosed = !0, setTimeout(() => {
|
|
47
|
+
e.onClose?.(), u.delete(e.id);
|
|
48
|
+
}, y);
|
|
49
|
+
}, k = (e) => {
|
|
50
|
+
const i = "hacking was detected";
|
|
51
|
+
return e = e.replace(/<script/g, i), e = e.replace(/<img/g, i), e = e.replace(/<iframe/g, i), e = e.replace(/javascript:/g, i), e = e.replace(/<[^>]+ (@|on)\w+=[^>]+>?/g, i), e;
|
|
52
|
+
}, W = { class: "top-notice_itemTextWrapper" }, q = ["innerHTML"], G = ["innerHTML"], K = {
|
|
53
|
+
key: 1,
|
|
54
|
+
class: "top-notice_itemButtons"
|
|
55
|
+
}, Q = ["innerHTML"], R = ["title"], X = /* @__PURE__ */ B({
|
|
56
|
+
__name: "item",
|
|
57
|
+
props: {
|
|
58
|
+
id: {},
|
|
59
|
+
title: {},
|
|
60
|
+
text: {},
|
|
61
|
+
style: {},
|
|
62
|
+
metaText: {},
|
|
63
|
+
buttonProps: {},
|
|
64
|
+
buttonsProps: {},
|
|
65
|
+
isSafeHTML: { type: Boolean },
|
|
66
|
+
hightlight: { type: Boolean },
|
|
67
|
+
selectToClose: { type: Boolean, default: !0 },
|
|
68
|
+
forceClosed: { type: Boolean }
|
|
69
|
+
},
|
|
70
|
+
emits: ["close"],
|
|
71
|
+
setup(e, { emit: i }) {
|
|
72
|
+
const t = e, d = i, f = _(!1);
|
|
73
|
+
setTimeout(() => f.value = !0, 10);
|
|
74
|
+
const o = _(!1), r = _("right"), c = H(() => {
|
|
75
|
+
let n = t.title.replace(/ {2}/g, " ");
|
|
76
|
+
return t.isSafeHTML || (n = k(n)), n;
|
|
77
|
+
}), g = H(() => {
|
|
78
|
+
let n = F(t.text);
|
|
79
|
+
return n = n.replace(/ {2}/g, " "), t.isSafeHTML || (n = k(n)), n;
|
|
80
|
+
}), m = (n) => {
|
|
81
|
+
o.value = !0, n && (r.value = n), setTimeout(() => d("close"), y);
|
|
82
|
+
}, w = (n) => {
|
|
83
|
+
if (!t.selectToClose) return;
|
|
84
|
+
const { tagName: s } = n.target;
|
|
85
|
+
s === "A" && m(), s === "BUTTON" && m();
|
|
86
|
+
}, I = {
|
|
87
|
+
mounted: (n) => {
|
|
88
|
+
if (!h.state.isMobile || !h.$ || !h.$.ui.draggable) return;
|
|
89
|
+
let s = "right";
|
|
90
|
+
h.$(n).draggable({
|
|
91
|
+
revert: !1,
|
|
92
|
+
axis: "x",
|
|
93
|
+
drag: (p, b) => {
|
|
94
|
+
s = b.position.left > 0 ? "right" : "left";
|
|
95
|
+
},
|
|
96
|
+
stop: (p, b) => {
|
|
97
|
+
m(s);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
return (n, s) => {
|
|
103
|
+
const v = z("TopButton");
|
|
104
|
+
return D((l(), a("div", {
|
|
105
|
+
class: E(["top-notice_item", {
|
|
106
|
+
["top-notice_item-" + e.style]: !0,
|
|
107
|
+
"top-notice_item-hightlight": e.hightlight,
|
|
108
|
+
"top-notice_item-showed": f.value,
|
|
109
|
+
"top-notice_item-closed": o.value || e.forceClosed,
|
|
110
|
+
["top-notice_item-closed_" + r.value]: o.value
|
|
111
|
+
}]),
|
|
112
|
+
onClick: w
|
|
113
|
+
}, [
|
|
114
|
+
M("div", W, [
|
|
115
|
+
c.value ? (l(), a("div", {
|
|
116
|
+
key: 0,
|
|
117
|
+
class: "top-notice_itemTitle",
|
|
118
|
+
innerHTML: c.value
|
|
119
|
+
}, null, 8, q)) : T("", !0),
|
|
120
|
+
g.value ? (l(), a("div", {
|
|
121
|
+
key: 1,
|
|
122
|
+
class: "top-notice_itemText",
|
|
123
|
+
innerHTML: g.value
|
|
124
|
+
}, null, 8, G)) : T("", !0)
|
|
125
|
+
]),
|
|
126
|
+
e.buttonProps ? (l(), C(v, L({
|
|
127
|
+
key: 0,
|
|
128
|
+
class: "top-notice_itemButton",
|
|
129
|
+
size: "s"
|
|
130
|
+
}, e.buttonProps, {
|
|
131
|
+
title: e.buttonProps.title,
|
|
132
|
+
innerHTML: e.buttonProps.default,
|
|
133
|
+
onClick: s[0] || (s[0] = (p) => m())
|
|
134
|
+
}), null, 16, ["title", "innerHTML"])) : T("", !0),
|
|
135
|
+
e.buttonsProps?.length ? (l(), a("div", K, [
|
|
136
|
+
(l(!0), a(S, null, x(e.buttonsProps, (p) => (l(), C(v, L({
|
|
137
|
+
class: "top-notice_itemButton",
|
|
138
|
+
size: "s"
|
|
139
|
+
}, { ref_for: !0 }, p, {
|
|
140
|
+
title: p.title,
|
|
141
|
+
innerHTML: p.default,
|
|
142
|
+
onClick: s[1] || (s[1] = (b) => m())
|
|
143
|
+
}), null, 16, ["title", "innerHTML"]))), 256))
|
|
144
|
+
])) : T("", !0),
|
|
145
|
+
e.metaText ? (l(), a("div", {
|
|
146
|
+
key: 2,
|
|
147
|
+
class: "top-notice_itemMetaText",
|
|
148
|
+
innerHTML: e.metaText
|
|
149
|
+
}, null, 8, Q)) : T("", !0),
|
|
150
|
+
M("div", {
|
|
151
|
+
class: "top-notice_itemClose",
|
|
152
|
+
"data-top-icon": "",
|
|
153
|
+
title: n.$i18n.Common.Close,
|
|
154
|
+
onClick: s[2] || (s[2] = () => m())
|
|
155
|
+
}, null, 8, R)
|
|
156
|
+
], 2)), [
|
|
157
|
+
[I]
|
|
158
|
+
]);
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
}), Y = { class: "top-notice" }, ne = /* @__PURE__ */ B({
|
|
162
|
+
__name: "notice",
|
|
163
|
+
setup(e) {
|
|
164
|
+
const i = (t) => {
|
|
165
|
+
t.onClose?.(), u.delete(t.id);
|
|
166
|
+
};
|
|
167
|
+
return (t, d) => (l(), C(j, { to: "body" }, [
|
|
168
|
+
M("div", Y, [
|
|
169
|
+
(l(!0), a(S, null, x(O(u), ([f, o]) => (l(), C(X, {
|
|
170
|
+
key: o.id,
|
|
171
|
+
id: o.id,
|
|
172
|
+
title: o.title,
|
|
173
|
+
text: o.text,
|
|
174
|
+
style: V(o.style),
|
|
175
|
+
buttonProps: o.buttonProps,
|
|
176
|
+
buttonsProps: o.buttonsProps,
|
|
177
|
+
metaText: o.metaText,
|
|
178
|
+
isSafeHTML: o.isSafeHTML,
|
|
179
|
+
forceClosed: o.forceClosed,
|
|
180
|
+
hightlight: o.hightlight,
|
|
181
|
+
onClose: (r) => i(o)
|
|
182
|
+
}, null, 8, ["id", "title", "text", "style", "buttonProps", "buttonsProps", "metaText", "isSafeHTML", "forceClosed", "hightlight", "onClose"]))), 128))
|
|
183
|
+
])
|
|
184
|
+
]));
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
export {
|
|
188
|
+
ne as default,
|
|
189
|
+
oe as show
|
|
190
|
+
};
|
|
191
|
+
//# sourceMappingURL=notice-Cl3ZgiHm.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice-P7CXfEuX.es.js","sources":["../../src/components/core/notice/utils.ts","../../src/components/core/notice/item/item.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","<!-- 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"],"names":["transitionDuration","itemById","reactive","genItemId","text","style","options","genIntHash","show","title","id","chunks","itemExists","hightlight","item","_firstId","firstItem","Core","close","_a","prepareText","textNoSafety","props","__props","emit","__emit","showed","ref","closed","closedDirection","computed","res","nl2br","direction","onClick","e","tagName","vSwipe","el","_e","ui","_ui","_createElementBlock","forceClosed","_createElementVNode","_hoisted_1","buttonProps","_openBlock","_createBlock","_component_TopButton","_mergeProps","buttonsProps","_hoisted_4","_Fragment","_renderList","metaText","$i18n","onCloseItem","_Teleport","_unref","_index","TopNoticeItem","_normalizeStyle","$event"],"mappings":";;;AAKO,MAAMA,IAAqB,KAIrBC,IAAWC,EAAS,oBAAI,KAAmB,GAElDC,IAAY,CAACC,GAAyBC,GAA2BC,MAC/D,gBAAgBC,EAAWH,IAAOC,IAAQ,KAAK,UAAUC,CAAO,CAAC,GAoB5DE,KAAO,CAACJ,GAAcC,IAAe,QAAQC,MAAsB;AAC/E,MAAIG,IAAQ;AAEZ,EAAAL,IAAO,OAAOA,CAAI;AAElB,QAAMM,IAAKP,EAAUC,GAAMC,GAAOC,CAAO;AAEzC,MAAIA,KAAA,QAAAA,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A,GAAAC,EAQEC,GARFC,EAQE;AAAA,YAND,OAAM;AAAA,YACN,MAAK;AAAA,UAAA,oBACFJ,GAAW;AAAA,YACb,OAAOA,EAAY;AAAA,YACpB,WAAQA,EAAY;AAAA,YACnB,gCAAO5B,EAAA;AAAA,UAAK;;QAIJqC,EAAAA,iBAAXb,EAA6E,OAAA;AAAA;UAAxD,OAAM;AAAA,UAA0B,WAAQa,EAAAA;AAAAA,QAAAA;QAE7DX,EAKO,OAAA;AAAA,UAJN,OAAM;AAAA,UACN,iBAAc;AAAA,UACb,OAAOY,EAAAA,MAAM,OAAO;AAAA,UACpB,+BAAatC,EAAA;AAAA,QAAK;;;;;;;;;AC1ItB,UAAMuC,IAAc,CAAC3C,MAAe;;AACnC,OAAAK,IAAAL,EAAK,YAAL,QAAAK,EAAA,KAAAL,IAEAb,EAAS,OAAOa,EAAK,EAAE;AAAA,IACxB;2BAICkC,EAkBWU,GAAA,EAlBD,IAAG,UAAM;AAAA,MAClBd,EAgBM,OAhBNC,GAgBM;AAAA,SAfLE,EAAA,EAAA,GAAAL,EAcEW,GAAA,MAAAC,EAbwBK,EAAA1D,CAAA,GAAQ,CAAA,CAAzB2D,GAAQ9C,CAAI,YADrBkC,EAcEa,GAAA;AAAA,UAZA,KAAK/C,EAAK;AAAA,UACV,IAAIA,EAAK;AAAA,UACT,OAAOA,EAAK;AAAA,UACZ,MAAMA,EAAK;AAAA,UACX,OAAKgD,EAAEhD,EAAK,KAAK;AAAA,UACjB,aAAaA,EAAK;AAAA,UAClB,cAAcA,EAAK;AAAA,UACnB,UAAUA,EAAK;AAAA,UACf,YAAYA,EAAK;AAAA,UACjB,aAAaA,EAAK;AAAA,UAClB,YAAYA,EAAK;AAAA,UACjB,SAAK,CAAAiD,MAAEN,EAAY3C,CAAI;AAAA,QAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"notice-Cl3ZgiHm.es.js","sources":["../../src/components/core/notice/utils.ts","../../src/components/core/notice/item/item.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","<!-- 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"],"names":["transitionDuration","itemById","reactive","genItemId","text","style","options","genIntHash","show","title","id","chunks","itemExists","hightlight","item","_firstId","firstItem","Core","close","prepareText","textNoSafety","props","__props","emit","__emit","showed","ref","closed","closedDirection","computed","res","nl2br","direction","onClick","e","tagName","vSwipe","el","_e","ui","_ui","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createBlock","_component_TopButton","_mergeProps","_hoisted_4","_Fragment","_renderList","buttonProps","$i18n","onCloseItem","_Teleport","_unref","_index","TopNoticeItem","_normalizeStyle","$event"],"mappings":";;;AAKO,MAAMA,IAAqB,KAIrBC,IAAWC,EAAS,oBAAI,KAAmB,GAElDC,IAAY,CAACC,GAAyBC,GAA2BC,MAC/D,gBAAgBC,EA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.amd","../require/css.amd!../assets/notice.css"],(function(j,T,e,f,v){"use strict";if(typeof e>"u")var e=window.Vue;const h=300,r=e.reactive(new Map),M=(t,i,o)=>"top-notice_"+v.genIntHash(t+i+JSON.stringify(o)),y=(t,i="info",o)=>{let u="";t=String(t);const d=M(t,i,o);if(o?.title)u=o.title;else{const a=t.split(`
|
|
2
|
+
`);a.length&&(u=String(a.shift()),t=a.join(`
|
|
3
|
+
`))}const n=r.get(d);if(n){_(n);return}const c={id:d,title:u,text:t,style:i,buttonProps:o?.buttonProps,buttonsProps:o?.buttonsProps,metaText:o?.metaText,isSafeHTML:o?.isSafeHTML,selectToClose:o?.selectToClose,onClose:o?.onClose};if(r.set(c.id,c),r.size>5){const[a,g]=[...r].at(0)||[];g&&B(g)}f.Core.state.isMobile&&$("input").one("click",()=>B(c))},_=t=>{t.hightlight=!0,setTimeout(()=>t.hightlight=!1,h)},B=t=>{t.forceClosed=!0,setTimeout(()=>{t.onClose?.(),r.delete(t.id)},h)},b=t=>{const i="hacking was detected";return t=t.replace(/<script/g,i),t=t.replace(/<img/g,i),t=t.replace(/<iframe/g,i),t=t.replace(/javascript:/g,i),t=t.replace(/<[^>]+ (@|on)\w+=[^>]+>?/g,i),t},L={class:"top-notice_itemTextWrapper"},H=["innerHTML"],P=["innerHTML"],S={key:1,class:"top-notice_itemButtons"},N=["innerHTML"],w=["title"],E=e.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(t,{emit:i}){const o=t,u=i,d=e.ref(!1);setTimeout(()=>d.value=!0,10);const n=e.ref(!1),c=e.ref("right"),a=e.computed(()=>{let l=o.title.replace(/ {2}/g," ");return o.isSafeHTML||(l=b(l)),l}),g=e.computed(()=>{let l=v.nl2br(o.text);return l=l.replace(/ {2}/g," "),o.isSafeHTML||(l=b(l)),l}),m=l=>{n.value=!0,l&&(c.value=l),setTimeout(()=>u("close"),h)},I=l=>{if(!o.selectToClose)return;const{tagName:s}=l.target;s==="A"&&m(),s==="BUTTON"&&m()},z={mounted:l=>{if(!f.Core.state.isMobile||!f.Core.$||!f.Core.$.ui.draggable)return;let s="right";f.Core.$(l).draggable({revert:!1,axis:"x",drag:(p,k)=>{s=k.position.left>0?"right":"left"},stop:(p,k)=>{m(s)}})}};return(l,s)=>{const C=e.resolveComponent("TopButton");return e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["top-notice_item",{["top-notice_item-"+t.style]:!0,"top-notice_item-hightlight":t.hightlight,"top-notice_item-showed":d.value,"top-notice_item-closed":n.value||t.forceClosed,["top-notice_item-closed_"+c.value]:n.value}]),onClick:I},[e.createElementVNode("div",L,[a.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"top-notice_itemTitle",innerHTML:a.value},null,8,H)):e.createCommentVNode("",!0),g.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"top-notice_itemText",innerHTML:g.value},null,8,P)):e.createCommentVNode("",!0)]),t.buttonProps?(e.openBlock(),e.createBlock(C,e.mergeProps({key:0,class:"top-notice_itemButton",size:"s"},t.buttonProps,{title:t.buttonProps.title,innerHTML:t.buttonProps.default,onClick:s[0]||(s[0]=p=>m())}),null,16,["title","innerHTML"])):e.createCommentVNode("",!0),t.buttonsProps?.length?(e.openBlock(),e.createElementBlock("div",S,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.buttonsProps,p=>(e.openBlock(),e.createBlock(C,e.mergeProps({class:"top-notice_itemButton",size:"s"},{ref_for:!0},p,{title:p.title,innerHTML:p.default,onClick:s[1]||(s[1]=k=>m())}),null,16,["title","innerHTML"]))),256))])):e.createCommentVNode("",!0),t.metaText?(e.openBlock(),e.createElementBlock("div",{key:2,class:"top-notice_itemMetaText",innerHTML:t.metaText},null,8,N)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"top-notice_itemClose","data-top-icon":"",title:l.$i18n.Common.Close,onClick:s[2]||(s[2]=()=>m())},null,8,w)],2)),[[z]])}}}),x={class:"top-notice"},V=e.defineComponent({__name:"notice",setup(t){const i=o=>{o.onClose?.(),r.delete(o.id)};return(o,u)=>(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createElementVNode("div",x,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r),([d,n])=>(e.openBlock(),e.createBlock(E,{key:n.id,id:n.id,title:n.title,text:n.text,style:e.normalizeStyle(n.style),buttonProps:n.buttonProps,buttonsProps:n.buttonsProps,metaText:n.metaText,isSafeHTML:n.isSafeHTML,forceClosed:n.forceClosed,hightlight:n.hightlight,onClose:c=>i(n)},null,8,["id","title","text","style","buttonProps","buttonsProps","metaText","isSafeHTML","forceClosed","hightlight","onClose"]))),128))])]))}});T.default=V,T.show=y,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
|
|
4
|
+
//# sourceMappingURL=notice-DwjipV21.amd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notice-CSGn_jTM.amd.js","sources":["../../src/components/core/notice/utils.ts","../../src/components/core/notice/item/item.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","<!-- 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"],"names":["itemById","vue","utils_string","text","style","options","show","title","chunks","id","_firstId","firstItem","close","forms","item","hightlight","prepareText","showed","closed","closedDirection","res","props","direction","onClick","e","tagName","el","_e","ui","_ui","_ctx","_hoisted_2","_hoisted_3","_cache","$event","buttonProps","metaText","_hoisted_6","onCloseItem","_hoisted_1"],"mappings":"yMASOA,EAAAC,EAAA,SAAA,IAAA,GAAA,aAGN,cAAAC,EAAA,WAAAC,EAAAC,EAAA,KAAA,UAAAC,CAAA,CAAA,EAoBMC,EAAA,CAAAH,EAAAC,EAAA,OAAAC,IAAA,UAGNF,EAAA,OAAAA,CAAA,mBAIA,GAAAE,GAAA,MAAAA,EAAA,MACCE,EAAAF,EAAA,UAAgB;GAIhBG,EAAA,6BAECL,EAAAK,EAAA,KAAA;AAAA,CAAA,+CAWiB,GAAAC,EAClB,MAAAF,EACA,KAAAJ,EACA,MAAAC,EACA,YAAAC,GAAA,YAAAA,EAAA,YACsB,aAAAA,GAAA,YAAAA,EAAA,aACC,SAAAA,GAAA,YAAAA,EAAA,SACJ,WAAAA,GAAA,YAAAA,EAAA,WACE,cAAAA,GAAA,YAAAA,EAAA,gDAOtB,iBAAAL,EAAA,KAAA,EAAA,CACC,KAAA,CAAAU,EAAAC,CAAA,EAAA,CAAA,GAAAX,CAAA,EAAA,GAAA,CAAA,GAAA,CAAA,EACAW,GAAAC,EAAAD,CAAA,EAQDE,EAAA,KAAA,MAAA,UACC,EAAA,OAAA,EAAA,IAAA,QAAA,IAAAD,EAAA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EAAA6B,EAAA,YAAA,CACS,MAAAA,EAAA,YAAA,MACM,UAAAA,EAAA,YAAA,QACA,QAAAG,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAAtB,EAAA,EACP,CAAA,EAAA,KAAA,GAAA,CAAA,QAAA,WAAA,CAAA,GAAAX,EAAA,mBAAA,GAAA,EAAA,mFAgBRA,EAAA,UAAA,EAAA,EAAAA,EAAA,mBAAAA,EAAA,SAAA,KAAAA,EAAA,WAAA6B,EAAA,aAAAK,8EAPE,KAAA,qBAEQ,MAAAA,EAAA,MACM,UAAAA,EAAA,QACA,QAAAF,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAAtB,EAAA,2LAKuCwB,EAAAA,KAAAA,EAAAA,CAAAA,GAAAA,EAAAA,mBAAAA,GAAAA,EAAAA,0GAKvC,QAAAH,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,IAAArB,EAAA,EACF,EAAA,KAAA,EAAAyB,CAAA,uFC1ItB,MAAAC,EAAAxB,GAAA,sCAGCd,EAAA,OAAAc,EAAA,EAAA,CAAuB,oEAKJb,EAAA,mBAAA,MAAAsC,EAAA,wHAgBf,IAAAzB,EAAA,GAZU,GAAAA,EAAA,GACD,MAAAA,EAAA,MACG,KAAAA,EAAA,KACD,MAAAb,EAAA,eAAAa,EAAA,KAAA,EACM,YAAAA,EAAA,YACC,aAAAA,EAAA,aACC,SAAAA,EAAA,SACJ,WAAAA,EAAA,WACE,YAAAA,EAAA,YACC,WAAAA,EAAA,WACD,QAAAoB,GAAAI,EAAAxB,CAAA,CACM,EAAA,KAAA,EAAA,CAAA,KAAA,QAAA,OAAA,QAAA,cAAA,eAAA,WAAA,aAAA,cAAA,aAAA,SAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"notice-DwjipV21.amd.js","sources":["../../src/components/core/notice/utils.ts","../../src/components/core/notice/item/item.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","<!-- 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"],"names":["itemById","vue","utils_string","text","style","options","show","title","chunks","id","_firstId","firstItem","close","forms","item","hightlight","prepareText","showed","closed","closedDirection","res","props","direction","onClick","e","tagName","el","_e","ui","_ui","__props","_hoisted_2","_hoisted_3","_cache","$event","buttonProps","_hoisted_5","_hoisted_6","onCloseItem","_hoisted_1"],"mappings":"yMASOA,EAAAC,EAAA,SAAA,IAAA,GAAA,aAGN,cAAAC,EAAA,WAAAC,EAAAC,EAAA,KAAA,UAAAC,CAAA,CAAA,EAoBMC,EAAA,CAAAH,EAAAC,EAAA,OAAAC,IAAA,UAGNF,EAAA,OAAAA,CAAA,mBAIA,GAAAE,GAAA,MACCE,EAAAF,EAAA,UAAgB;GAIhBG,EAAA,6BAECL,EAAAK,EAAA,KAAA;AAAA,CAAA,+CAWiB,GAAAC,EAClB,MA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A,WACE,YAAAA,EAAA,YACC,WAAAA,EAAA,WACD,QAAAoB,GAAAI,EAAAxB,CAAA,CACM,EAAA,KAAA,EAAA,CAAA,KAAA,QAAA,OAAA,QAAA,cAAA,eAAA,WAAA,aAAA,cAAA,aAAA,SAAA,CAAA"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(["require","exports","vue","./dialogs.vue_vue_type_script_setup_true_lang-Dq9kWWMg.amd","./forms-CUSCBQu3.amd","./utils-CzHUG_xz.amd"],(function(b,i,e,s,r,c){"use strict";if(typeof e>"u")var e=window.Vue;const u=["id","data-view-page-active","data-modal","data-position"],m=e.defineComponent({__name:"dialog",props:{id:{},pageActive:{},width:{default:"600px"},height:{default:"auto"},modal:{type:Boolean,default:!0},position:{},historyType:{default:"push"},classes:{}},emits:["open","close"],setup(o){const n=o,t=s.getDialogWorker(n.id);if(!t)throw new Error("TopDialog cannot be used in a template, use useTopDialog() / useAsyncTopDialog()");return e.provide("dialogWorker",t),e.onMounted(()=>{const l=e.getCurrentInstance(),a=l.parent;if(a?.parent?.type.name!=="DialogWrapper")throw new Error("TopDialog cannot be used in a template, use useTopDialog()");if(Array.isArray(a.subTree.children)&&a.subTree.children.length!==1)throw new Error("TopDialog can has only one root element");t.onMounted(a,l)}),e.watch(t.isOpened,()=>{t.isReady.value=!0},{flush:"post",once:!0}),(l,a)=>(e.openBlock(),e.createElementBlock("div",{id:e.unref(t).idAttr,class:e.normalizeClass(["top-dialog",o.classes]),style:e.normalizeStyle({"--top-dialog-width":o.width,"--top-dialog-height":o.height}),tabindex:"-1","data-view-page-active":e.unref(t).pageActive.value,"data-modal":o.modal,"data-position":o.position},[a[0]||(a[0]=e.createElementVNode("div",{class:"modal-layer modal-layer-header"},null,-1)),e.createElementVNode("div",{class:"modal-layer modal-layer-body",style:e.normalizeStyle({"min-height":o.height+"px"})},null,4),e.renderSlot(l.$slots,"default")],14,u))}}),p={key:0,style:{display:"none"}},h=["data-order","data-view-page"],v={class:"modal-header"},g={class:"top-title"},f={class:"buttons"},y=["title"],k=["title"],w=["data-order","data-view-page"],B={class:"modal-body"},C=e.defineComponent({__name:"page",props:{isLoading:{type:Boolean},name:{},order:{default:0},prevName:{},footerFullWith:{type:Boolean}},setup(o){const n=o,t=c.useTopDialogSelf(),l=e.computed(()=>({active:t.pageActive?.value===n.name,"i-load-data":n.isLoading||t.isLoadingPage.value}));return(a,d)=>{const E=e.resolveDirective("top-scroll-shadow");return e.unref(t).isReady.value?(e.openBlock(),e.createElementBlock("div",p,[(e.openBlock(),e.createBlock(e.Teleport,{to:"#"+e.unref(t).idAttr+" .modal-layer-header",disabled:!e.unref(t).needShowPage(o.name)},[e.createElementVNode("div",{"data-order":o.order,"data-view-page":o.name,class:e.normalizeClass(l.value)},[e.createElementVNode("div",v,[e.createElementVNode("div",g,[e.renderSlot(a.$slots,"header")]),e.createElementVNode("div",f,[e.renderSlot(a.$slots,"headerButtons")]),e.unref(r.Core).state.isMobile&&o.prevName?(e.openBlock(),e.createElementBlock("div",{key:0,class:"close",title:a.$i18n.Common.Back,"data-top-icon":"",onClick:d[0]||(d[0]=D=>e.unref(t).open(o.prevName))},null,8,y)):(e.openBlock(),e.createElementBlock("div",{key:1,class:"close",title:a.$i18n.Common.Close,"data-top-icon":"","data-action":"top-dialog-close"},null,8,k))])],10,h)],8,["to","disabled"])),(e.openBlock(),e.createBlock(e.Teleport,{to:"#"+e.unref(t).idAttr+" .modal-layer-body",disabled:!e.unref(t).needShowPage(o.name)},[e.createElementVNode("div",{"data-order":o.order,"data-view-page":o.name,class:e.normalizeClass(["has_scroll_container",l.value]),style:e.normalizeStyle({"--top-dialog-footer-height":a.$slots.footer?void 0:"0px"})},[e.withDirectives((e.openBlock(),e.createElementBlock("div",B,[e.renderSlot(a.$slots,"body")])),[[E]]),a.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["modal-footer",{"modal-footer-fullWith":o.footerFullWith}])},[e.renderSlot(a.$slots,"footer")],2)):e.createCommentVNode("",!0)],14,w)],8,["to","disabled"]))])):e.createCommentVNode("",!0)}}});i._sfc_main=m,i._sfc_main$1=C}));
|
|
2
|
+
//# sourceMappingURL=page.vue_vue_type_script_setup_true_lang-CjIiZU-D.amd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
{"version":3,"file":"page.vue_vue_type_script_setup_true_lang-CjIiZU-D.amd.js","sources":["../../src/components/dialog/dialog/dialog.vue","../../src/components/dialog/dialog/page/page.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { ComponentInternalInstance } from 'vue';\nimport { getCurrentInstance, onMounted, provide, watch } from 'vue';\nimport { getDialogWorker } from './dialogs/dialogs.vue';\nimport type { Emits, Props, Slots } from './types';\n\nconst props = withDefaults(defineProps<Props>(), {\n\twidth: '600px',\n\theight: 'auto',\n\tmodal: true,\n\thistoryType: 'push',\n});\n\ndefineEmits<Emits>();\n\ndefineSlots<Slots>();\n\nconst dialog = getDialogWorker(props.id);\nif (!dialog) {\n\tthrow new Error('TopDialog cannot be used in a template, use useTopDialog() / useAsyncTopDialog()');\n}\n\n/**\n * Для useTopDialogSelf()\n */\nprovide('dialogWorker', dialog);\n\n/**\n * Инициализация начального состояния TopDialogHandle\n */\nonMounted(() => {\n\tconst topDialogBaseComponent = getCurrentInstance() as ComponentInternalInstance;\n\tconst topDialogComponent = topDialogBaseComponent.parent;\n\n\tif (topDialogComponent?.parent?.type.name !== 'DialogWrapper') {\n\t\tthrow new Error('TopDialog cannot be used in a template, use useTopDialog()');\n\t}\n\n\tif (Array.isArray(topDialogComponent.subTree.children) && topDialogComponent.subTree.children.length !== 1) {\n\t\tthrow new Error('TopDialog can has only one root element');\n\t}\n\n\tdialog.onMounted(topDialogComponent, topDialogBaseComponent);\n});\n\nwatch(dialog.isOpened, () => {\n\tdialog.isReady.value = true;\n}, {\n\tflush: 'post',\n\tonce: true,\n});\n</script>\n\n<template>\n\t<div\n\t\t:id=\"dialog.idAttr\"\n\t\tclass=\"top-dialog\"\n\t\t:class=\"classes\"\n\t\t:style=\"{\n\t\t\t'--top-dialog-width': width,\n\t\t\t'--top-dialog-height': height,\n\t\t}\"\n\t\ttabindex=\"-1\"\n\t\t:data-view-page-active=\"dialog.pageActive.value\"\n\t\t:data-modal=\"modal\"\n\t\t:data-position=\"position\"\n\t>\n\t\t<div class=\"modal-layer modal-layer-header\"></div>\n\n\t\t<div class=\"modal-layer modal-layer-body\" :style=\"{'min-height': height + 'px'}\"></div>\n\n\t\t<slot name=\"default\"></slot>\n\t</div>\n</template>\n","<script setup lang=\"ts\">\nimport { computed } from 'vue';\nimport Core from '@/core/core/core';\nimport { useTopDialogSelf } from '@/components/dialog/dialog/composables/utils';\nimport type { Props, Slots } from './types';\n\nconst props = withDefaults(defineProps<Props>(), {\n\torder: 0,\n});\n\ndefineSlots<Slots>();\n\nconst dialog = useTopDialogSelf();\n\nconst classes = computed(() => {\n\treturn {\n\t\tactive: dialog.pageActive?.value === props.name,\n\t\t'i-load-data': props.isLoading || dialog.isLoadingPage.value,\n\t};\n});\n</script>\n\n<template>\n\t<div\n\t\tstyle=\"display: none\"\n\t\tv-if=\"dialog.isReady.value\"\n\t>\n\t\t<Teleport :to=\"'#' + dialog.idAttr + ' .modal-layer-header'\" :disabled=\"!dialog.needShowPage(name)\">\n\t\t\t<div\n\t\t\t\t:data-order=\"order\"\n\t\t\t\t:data-view-page=\"name\"\n\t\t\t\t:class=\"classes\"\n\t\t\t>\n\t\t\t\t<div class=\"modal-header\">\n\t\t\t\t\t<div class=\"top-title\">\n\t\t\t\t\t\t<slot name=\"header\"></slot>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div class=\"buttons\">\n\t\t\t\t\t\t<slot name=\"headerButtons\"></slot>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-if=\"Core.state.isMobile && prevName\"\n\t\t\t\t\t\tclass=\"close\"\n\t\t\t\t\t\t:title=\"$i18n.Common.Back\"\n\t\t\t\t\t\tdata-top-icon=\"\"\n\t\t\t\t\t\t@click=\"dialog.open(prevName)\"\n\t\t\t\t\t></div>\n\n\t\t\t\t\t<div\n\t\t\t\t\t\tv-else\n\t\t\t\t\t\tclass=\"close\"\n\t\t\t\t\t\t:title=\"$i18n.Common.Close\"\n\t\t\t\t\t\tdata-top-icon=\"\"\n\t\t\t\t\t\tdata-action=\"top-dialog-close\"\n\t\t\t\t\t></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Teleport>\n\n\t\t<Teleport :to=\"'#' + dialog.idAttr + ' .modal-layer-body'\" :disabled=\"!dialog.needShowPage(name)\">\n\t\t\t<div\n\t\t\t\t:data-order=\"order\"\n\t\t\t\t:data-view-page=\"name\"\n\t\t\t\tclass=\"has_scroll_container\"\n\t\t\t\t:class=\"classes\"\n\t\t\t\t:style=\"{'--top-dialog-footer-height': $slots.footer ? undefined : '0px'}\"\n\t\t\t>\n\t\t\t\t<div class=\"modal-body\" v-top-scroll-shadow>\n\t\t\t\t\t<slot name=\"body\"></slot>\n\t\t\t\t</div>\n\n\t\t\t\t<div\n\t\t\t\t\tclass=\"modal-footer\"\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t'modal-footer-fullWith': footerFullWith\n\t\t\t\t\t}\"\n\t\t\t\t\tv-if=\"$slots.footer\"\n\t\t\t\t>\n\t\t\t\t\t<slot name=\"footer\"></slot>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</Teleport>\n\t</div>\n</template>\n"],"names":["vue","dialog","topDialogBaseComponent","topDialogComponent","__props","_hoisted_1$1","utils","classes","_hoisted_4","_ctx","_hoisted_6","_hoisted_7"],"mappings":"siBAmBC,MAAA,IAAA,MAAA,kFAAA,EAMD,OAAAA,EAAA,QAAA,eAAAC,CAAA,mBAMC,MAAAC,EAAAF,EAAA,mBAAA,EACAG,EAAAD,EAAA,iDAGC,MAAA,IAAA,MAAA,4DAAA,sEAIA,MA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