@topvisor/ui 1.3.5-popupFromInput.0 → 1.4.0-TopGroupSelector.2

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.
Files changed (219) hide show
  1. package/.chunks/core-B9TwJi3h.amd.js +2 -0
  2. package/.chunks/core-B9TwJi3h.amd.js.map +1 -0
  3. package/.chunks/core-DVQVVUiP.es.js +196 -0
  4. package/.chunks/core-DVQVVUiP.es.js.map +1 -0
  5. package/.chunks/{datepicker-CGGp0VnN.es.js → datepicker-CrASsJeF.es.js} +14 -17
  6. package/.chunks/{datepicker-CGGp0VnN.es.js.map → datepicker-CrASsJeF.es.js.map} +1 -1
  7. package/.chunks/{datepicker-Bq_z2paN.amd.js → datepicker-bidhcksv.amd.js} +2 -2
  8. package/.chunks/{datepicker-Bq_z2paN.amd.js.map → datepicker-bidhcksv.amd.js.map} +1 -1
  9. package/.chunks/dialog_regionSelectorRegions-DJu5Y1WK.es.js +180 -0
  10. package/.chunks/dialog_regionSelectorRegions-DJu5Y1WK.es.js.map +1 -0
  11. package/.chunks/dialog_regionSelectorRegions-Dc-YGZ0l.amd.js +2 -0
  12. package/.chunks/dialog_regionSelectorRegions-Dc-YGZ0l.amd.js.map +1 -0
  13. package/.chunks/dialogs.vue_vue_type_script_setup_true_lang--Xstly2G.amd.js +2 -0
  14. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-Bf0wXalT.amd.js.map → dialogs.vue_vue_type_script_setup_true_lang--Xstly2G.amd.js.map} +1 -1
  15. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-DCVIoEeY.es.js → dialogs.vue_vue_type_script_setup_true_lang-BP6GFkkz.es.js} +111 -112
  16. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-DCVIoEeY.es.js.map → dialogs.vue_vue_type_script_setup_true_lang-BP6GFkkz.es.js.map} +1 -1
  17. package/.chunks/forms--2-YQeWM.amd.js +3 -0
  18. package/.chunks/{forms-CNcrvkYD.amd.js.map → forms--2-YQeWM.amd.js.map} +1 -1
  19. package/.chunks/forms-Cwv0JCi5.es.js +2035 -0
  20. package/.chunks/{forms-BhbgRJ5I.es.js.map → forms-Cwv0JCi5.es.js.map} +1 -1
  21. package/.chunks/index-DLUtoTUg.amd.js +2 -0
  22. package/.chunks/index-DLUtoTUg.amd.js.map +1 -0
  23. package/.chunks/index-DkQWJkMc.es.js +54 -0
  24. package/.chunks/index-DkQWJkMc.es.js.map +1 -0
  25. package/.chunks/notice-BCHrf2v6.es.js +191 -0
  26. package/.chunks/{notice-CpPhDTUb.es.js.map → notice-BCHrf2v6.es.js.map} +1 -1
  27. package/.chunks/notice-D1KO_E3H.amd.js +4 -0
  28. package/.chunks/{notice-BpLsm6Zh.amd.js.map → notice-D1KO_E3H.amd.js.map} +1 -1
  29. package/.chunks/page.vue_vue_type_script_setup_true_lang-DNs0udwC.amd.js +2 -0
  30. package/.chunks/{page.vue_vue_type_script_setup_true_lang-B-1LEQAz.amd.js.map → page.vue_vue_type_script_setup_true_lang-DNs0udwC.amd.js.map} +1 -1
  31. package/.chunks/page.vue_vue_type_script_setup_true_lang-D_ocBGzt.es.js +139 -0
  32. package/.chunks/{page.vue_vue_type_script_setup_true_lang-9abPBMpd.es.js.map → page.vue_vue_type_script_setup_true_lang-D_ocBGzt.es.js.map} +1 -1
  33. package/.chunks/policy.vue_vue_type_style_index_0_lang-B61ZEDWr.es.js +494 -0
  34. package/.chunks/policy.vue_vue_type_style_index_0_lang-B61ZEDWr.es.js.map +1 -0
  35. package/.chunks/policy.vue_vue_type_style_index_0_lang-BUIBGweg.amd.js +2 -0
  36. package/.chunks/policy.vue_vue_type_style_index_0_lang-BUIBGweg.amd.js.map +1 -0
  37. package/.chunks/popup-DJMBWRtl.es.js +468 -0
  38. package/.chunks/popup-DJMBWRtl.es.js.map +1 -0
  39. package/.chunks/popup-c8qgGOCv.amd.js +2 -0
  40. package/.chunks/popup-c8qgGOCv.amd.js.map +1 -0
  41. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Bp_-W068.es.js +209 -0
  42. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Bp_-W068.es.js.map +1 -0
  43. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-D42xEF-j.amd.js +2 -0
  44. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-D42xEF-j.amd.js.map +1 -0
  45. package/.chunks/{utils-D58EUoHa.es.js → utils-Bu-TI6uw.es.js} +192 -208
  46. package/.chunks/{utils-D58EUoHa.es.js.map → utils-Bu-TI6uw.es.js.map} +1 -1
  47. package/.chunks/utils-C6nWu0aQ.amd.js +2 -0
  48. package/.chunks/{utils-5uxIj2CI.amd.js.map → utils-C6nWu0aQ.amd.js.map} +1 -1
  49. package/.chunks/utils-DHyy_M2n.amd.js +2 -0
  50. package/.chunks/{utils-Bg_su8b-.amd.js.map → utils-DHyy_M2n.amd.js.map} +1 -1
  51. package/.chunks/{utils-UBgfsQ8v.es.js → utils-cls72V1c.es.js} +23 -24
  52. package/.chunks/{utils-UBgfsQ8v.es.js.map → utils-cls72V1c.es.js.map} +1 -1
  53. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-D6SVtg2Q.amd.js → widgetInput.vue_vue_type_script_setup_true_lang-B3soLr2U.amd.js} +2 -2
  54. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-D6SVtg2Q.amd.js.map → widgetInput.vue_vue_type_script_setup_true_lang-B3soLr2U.amd.js.map} +1 -1
  55. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-CSD2uMSW.es.js → widgetInput.vue_vue_type_script_setup_true_lang-HbtV9agA.es.js} +2 -2
  56. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-CSD2uMSW.es.js.map → widgetInput.vue_vue_type_script_setup_true_lang-HbtV9agA.es.js.map} +1 -1
  57. package/api/index.amd.js +1 -1
  58. package/api/index.amd.js.map +1 -1
  59. package/api/index.js +137 -134
  60. package/api/index.js.map +1 -1
  61. package/assets/dialog_regionSelectorRegions.css +1 -0
  62. package/assets/forms.css +1 -1
  63. package/assets/policy.css +1 -0
  64. package/assets/popupHint.css +1 -1
  65. package/assets/project.css +1 -1
  66. package/charts/charts.amd.js +1 -1
  67. package/charts/charts.amd.js.map +1 -1
  68. package/charts/charts.js +80 -80
  69. package/charts/charts.js.map +1 -1
  70. package/core/app.amd.js +1 -1
  71. package/core/app.amd.js.map +1 -1
  72. package/core/app.js +93 -96
  73. package/core/app.js.map +1 -1
  74. package/dialog/dialog.amd.js +1 -1
  75. package/dialog/dialog.amd.js.map +1 -1
  76. package/dialog/dialog.js +13 -13
  77. package/dialog/dialog.js.map +1 -1
  78. package/extra/extra.amd.js +1 -1
  79. package/extra/extra.amd.js.map +1 -1
  80. package/extra/extra.js +20 -23
  81. package/extra/extra.js.map +1 -1
  82. package/forms/forms.amd.js +1 -1
  83. package/forms/forms.js +5 -5
  84. package/formsExt/formsExt.amd.js +1 -1
  85. package/formsExt/formsExt.amd.js.map +1 -1
  86. package/formsExt/formsExt.js +185 -534
  87. package/formsExt/formsExt.js.map +1 -1
  88. package/layout/layout.amd.js +1 -1
  89. package/layout/layout.js +6 -6
  90. package/package.json +2 -2
  91. package/popup/popup.amd.js +1 -1
  92. package/popup/popup.amd.js.map +1 -1
  93. package/popup/popup.js +43 -46
  94. package/popup/popup.js.map +1 -1
  95. package/popup/worker.amd.js +1 -1
  96. package/popup/worker.amd.js.map +1 -1
  97. package/popup/worker.js +9 -9
  98. package/popup/worker.js.map +1 -1
  99. package/project/project.amd.js +1 -1
  100. package/project/project.amd.js.map +1 -1
  101. package/project/project.js +869 -607
  102. package/project/project.js.map +1 -1
  103. package/src/api/api/client/client.d.ts +5 -0
  104. package/src/api/api/mocker/index.d.ts +3 -3
  105. package/src/api/api/types/client/request.d.ts +6 -0
  106. package/src/api/api/types/ext.d.ts +2 -2
  107. package/src/api/api/types/mocker.d.ts +2 -2
  108. package/src/components/forms/button/types.d.ts +6 -0
  109. package/src/components/formsExt/formsExt.d.ts +1 -0
  110. package/src/components/formsExt/libs/optionGroup/types.d.ts +1 -1
  111. package/src/components/formsExt/selector2/cache.d.ts +12 -0
  112. package/src/components/formsExt/selector2/composables/useAPI.d.ts +2036 -2
  113. package/src/components/formsExt/selector2/composables/useMenu.d.ts +2045 -5
  114. package/src/components/formsExt/selector2/itemMulti.vue.d.ts +3 -3
  115. package/src/components/formsExt/selector2/selector2.vue.d.ts +11 -3
  116. package/src/components/formsExt/selector2/types.d.ts +39 -5
  117. package/src/components/formsExt/selector2/utils.d.ts +17 -0
  118. package/src/components/popup/lib/popup.d.ts +0 -1
  119. package/src/components/popup/popup/opener/types.d.ts +6 -2
  120. package/src/components/popup/popup/types.d.ts +3 -2
  121. package/src/components/popup/popup.d.ts +1 -1
  122. package/src/components/project/groupSelector/folders/folders.vue.d.ts +18 -0
  123. package/src/components/project/groupSelector/folders/types.d.ts +63 -0
  124. package/src/components/project/groupSelector/folders/utils.d.ts +63 -0
  125. package/src/components/project/groupSelector/groupSelector.vue.d.ts +28 -0
  126. package/src/components/project/groupSelector/groups/groups.vue.d.ts +125 -0
  127. package/src/components/project/groupSelector/groups/types.d.ts +57 -0
  128. package/src/components/project/groupSelector/groups/utils.d.ts +92 -0
  129. package/src/components/project/groupSelector/stories/mocks/folders.d.ts +4 -0
  130. package/src/components/project/groupSelector/stories/mocks/groups.d.ts +2 -0
  131. package/src/components/project/groupSelector/stories/mocks/index.d.ts +7 -0
  132. package/src/components/project/groupSelector/types.d.ts +129 -0
  133. package/src/components/project/project.d.ts +15 -4
  134. package/src/components/project/{selectorRegion → regionSelector}/utils/utils.d.ts +3 -3
  135. package/src/core/utils/composables/useWatch.d.ts +32 -0
  136. package/tabs/tabs.amd.js +1 -1
  137. package/tabs/tabs.amd.js.map +1 -1
  138. package/tabs/tabs.js +24 -24
  139. package/tabs/tabs.js.map +1 -1
  140. package/tabsView/tabsView.amd.js +1 -1
  141. package/tabsView/tabsView.amd.js.map +1 -1
  142. package/tabsView/tabsView.js +131 -133
  143. package/tabsView/tabsView.js.map +1 -1
  144. package/utils/clipboard.amd.js +1 -1
  145. package/utils/clipboard.js +1 -1
  146. package/utils/date.amd.js +1 -1
  147. package/utils/date.js +1 -1
  148. package/utils/device.amd.js +1 -1
  149. package/utils/device.js +1 -1
  150. package/utils/lodash.amd.js +1 -1
  151. package/utils/lodash.js +1 -1
  152. package/utils/price.amd.js +1 -1
  153. package/utils/price.js +1 -1
  154. package/utils/scroll.amd.js +1 -1
  155. package/utils/scroll.amd.js.map +1 -1
  156. package/utils/scroll.js +14 -14
  157. package/utils/scroll.js.map +1 -1
  158. package/utils/searchers.amd.js +1 -1
  159. package/utils/searchers.js +3 -3
  160. package/utils/string.amd.js +1 -1
  161. package/utils/string.amd.js.map +1 -1
  162. package/utils/string.js +3 -7
  163. package/utils/string.js.map +1 -1
  164. package/.chunks/core-DcLw0dEO.amd.js +0 -2
  165. package/.chunks/core-DcLw0dEO.amd.js.map +0 -1
  166. package/.chunks/core-DpTLGhiK.es.js +0 -197
  167. package/.chunks/core-DpTLGhiK.es.js.map +0 -1
  168. package/.chunks/dialog_selectorRegions-BtAADQHf.es.js +0 -190
  169. package/.chunks/dialog_selectorRegions-BtAADQHf.es.js.map +0 -1
  170. package/.chunks/dialog_selectorRegions-DCrHvHDs.amd.js +0 -2
  171. package/.chunks/dialog_selectorRegions-DCrHvHDs.amd.js.map +0 -1
  172. package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-Bf0wXalT.amd.js +0 -2
  173. package/.chunks/forms-BhbgRJ5I.es.js +0 -2045
  174. package/.chunks/forms-CNcrvkYD.amd.js +0 -3
  175. package/.chunks/index-BEI7XZmU.amd.js +0 -2
  176. package/.chunks/index-BEI7XZmU.amd.js.map +0 -1
  177. package/.chunks/index-igPkes8X.es.js +0 -48
  178. package/.chunks/index-igPkes8X.es.js.map +0 -1
  179. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-QvP1d9jN.amd.js +0 -2
  180. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-QvP1d9jN.amd.js.map +0 -1
  181. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-xvzbyqai.es.js +0 -196
  182. package/.chunks/listItem.vue_vue_type_script_setup_true_lang-xvzbyqai.es.js.map +0 -1
  183. package/.chunks/menu.vue_vue_type_style_index_0_lang-C3Rr6ZyL.amd.js +0 -2
  184. package/.chunks/menu.vue_vue_type_style_index_0_lang-C3Rr6ZyL.amd.js.map +0 -1
  185. package/.chunks/menu.vue_vue_type_style_index_0_lang-dOeZ7an1.es.js +0 -112
  186. package/.chunks/menu.vue_vue_type_style_index_0_lang-dOeZ7an1.es.js.map +0 -1
  187. package/.chunks/notice-BpLsm6Zh.amd.js +0 -4
  188. package/.chunks/notice-CpPhDTUb.es.js +0 -194
  189. package/.chunks/opener.vue_vue_type_script_setup_true_lang-DRzrTv7Q.es.js +0 -36
  190. package/.chunks/opener.vue_vue_type_script_setup_true_lang-DRzrTv7Q.es.js.map +0 -1
  191. package/.chunks/opener.vue_vue_type_script_setup_true_lang-gNZhYkDf.amd.js +0 -2
  192. package/.chunks/opener.vue_vue_type_script_setup_true_lang-gNZhYkDf.amd.js.map +0 -1
  193. package/.chunks/page.vue_vue_type_script_setup_true_lang-9abPBMpd.es.js +0 -143
  194. package/.chunks/page.vue_vue_type_script_setup_true_lang-B-1LEQAz.amd.js +0 -2
  195. package/.chunks/popup-BJj9BJP5.es.js +0 -485
  196. package/.chunks/popup-BJj9BJP5.es.js.map +0 -1
  197. package/.chunks/popup-CfXISjhC.amd.js +0 -2
  198. package/.chunks/popup-CfXISjhC.amd.js.map +0 -1
  199. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Cce9ZdtW.amd.js +0 -2
  200. package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Cce9ZdtW.amd.js.map +0 -1
  201. package/.chunks/utils-5uxIj2CI.amd.js +0 -2
  202. package/.chunks/utils-Bg_su8b-.amd.js +0 -2
  203. package/assets/dialog_selectorRegions.css +0 -1
  204. package/assets/formsExt.css +0 -1
  205. package/assets/listItem.css +0 -1
  206. package/assets/menu.css +0 -1
  207. package/src/components/popup/popup/opener.vue.d.ts +0 -16
  208. /package/src/components/project/{selectorCompetitors/selectorCompetitors.vue.d.ts → competitorSelector/competitorSelector.vue.d.ts} +0 -0
  209. /package/src/components/project/{selectorCompetitors → competitorSelector}/composables.d.ts +0 -0
  210. /package/src/components/project/{selectorCompetitors → competitorSelector}/types.d.ts +0 -0
  211. /package/src/components/project/{selectorRegion → regionSelector}/composables/compare.d.ts +0 -0
  212. /package/src/components/project/{selectorRegion → regionSelector}/composables/selectRegion.d.ts +0 -0
  213. /package/src/components/project/{selectorRegion → regionSelector}/composables/selectSearcher.d.ts +0 -0
  214. /package/src/components/project/{selectorRegion → regionSelector}/composables/selectorRegion.d.ts +0 -0
  215. /package/src/components/project/{selectorRegion/dialog_selectorRegions/dialog_selectorRegions.vue.d.ts → regionSelector/dialog_regionSelectorRegions/dialog_regionSelectorRegions.vue.d.ts} +0 -0
  216. /package/src/components/project/{selectorRegion/dialog_selectorRegions → regionSelector/dialog_regionSelectorRegions}/types.d.ts +0 -0
  217. /package/src/components/project/{selectorRegion/selectorRegion.vue.d.ts → regionSelector/regionSelector.vue.d.ts} +0 -0
  218. /package/src/components/project/{selectorRegion → regionSelector}/types.d.ts +0 -0
  219. /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","genValue","item"],"mappings":"yHAIOA,EAAA,MAAAC,EAAAC,EAAAC,EAAAC,IAAA,CAMN,GAAAH,EAAA,MAAA,CACCA,EAAA,2IASCI,EAAA,QAAA,KAAA,CAA6BA,EAC5B,IAAA,QAAA,CAAAC,EAAAC,IAAA,CAICH,EAAA,iBAAA,QAAA,IAAA,+EACoF,CAAA,CACnF,CAAA,CACD,CAAA,GAIH,MAAAC,2DAMY,MAAA,QASb,sDAAA,MAAA,QAAAG,EAAA,MAAA,GAAAP,EAAA,OAAAE,GAAAA,EAAA,MAAA,CACCF,EAAA,6DAIA,MAAAQ,EAAAN,EAAA,QAAA,EAEAK,EAAA,OAAA,OAAAL,EAAA,MAAAM,2BAECD,EAAA,MAAAP,EAAA,OAGDO,EAAA,OAAAA,EAAA,OAAA,MAAAC,EAAAA,EAAAN,EAAA,KAAA,EAGD,OAAAF,EAAA,SACC,QAAA,IAAA,mBAAAO,CAAA,EAGDA,CACD,EAEOE,EAAA,CAAAT,EAAAC,EAAAC,IAAA,CAKN,IAAAQ,EAAAV,EAAA,MAAA,EAGA,6BAAAA,EAAA,kBAAA,SACC,OAAAW,EAAA,MAAA,KAAAD,CAAA,EAEAE,EAAAZ,EAAA,OAAA,EAAAC,EAAAC,CAAA,8EAWA,QAAAW,EAAA,EAAAA,EAAAC,EAAAD,IACCE,EAAA,KAAAC,EAAAC,EAAAJ,EAAAH,EAAAT,EAAAC,CAAA,CAAA,EAGD,OAAAa,EAGD,OAAAC,EAAAhB,EAAA,OAAA,EAAAU,EAAAT,EAAAC,CAAA,CACD,EAEOc,EAAA,CAAAC,EAAAC,EAAAR,EAAAT,EAAAC,IAAA,YASN,UAAAiB,KAAAF,EAAA,CACC,MAAAG,EAAAH,EAAAE,CAAA,sBAKAR,EAAA,MAAA,KAAAD,EAAAQ,CAAA,EAEAG,EAAAF,CAAA,EAAAP,EAAAQ,EAAAF,EAAAjB,EAAAC,CAAA,GAGD,OAAAmB,CACD,EAEOT,EAAA,CAAAQ,EAAAF,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,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;AAC9B,QAAMmB,IAAO,CAAA;AAEb,aAAWC,KAAOP,GAAS;AAC1B,UAAMQ,IAAWR,EAAQO,CAAG;AAE5B,IAAIrB,KAAU,CAACA,EAAO,SAASqB,CAAG,MAGlCT,EAAM,KAAKD,IAAOQ,CAAC,GAEnBC,EAAKC,CAAG,IAAIR,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-Cwv0JCi5.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, "&nbsp;");
76
+ return t.isSafeHTML || (n = k(n)), n;
77
+ }), g = H(() => {
78
+ let n = F(t.text);
79
+ return n = n.replace(/ {2}/g, "&nbsp;"), 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-BCHrf2v6.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notice-CpPhDTUb.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, '&nbsp;');\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, '&nbsp;');\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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["../../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, '&nbsp;');\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, '&nbsp;');\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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4 @@
1
+ define(["require","exports","vue","./forms--2-YQeWM.amd","../utils/string.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,"&nbsp;");return o.isSafeHTML||(l=b(l)),l}),g=e.computed(()=>{let l=v.nl2br(o.text);return l=l.replace(/ {2}/g,"&nbsp;"),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-D1KO_E3H.amd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notice-BpLsm6Zh.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, '&nbsp;');\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, '&nbsp;');\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,EA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,mBAAA,GAAA,EAAA,mGAK/C,KAAA,GACD,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-D1KO_E3H.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, '&nbsp;');\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, '&nbsp;');\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,EAA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AA,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"}
@@ -0,0 +1,2 @@
1
+ define(["require","exports","vue","./dialogs.vue_vue_type_script_setup_true_lang--Xstly2G.amd","./forms--2-YQeWM.amd","./utils-C6nWu0aQ.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-DNs0udwC.amd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"page.vue_vue_type_script_setup_true_lang-B-1LEQAz.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","_ctx","height","position","_hoisted_1$1","utils","classes","order","name","_hoisted_4","_hoisted_6","_hoisted_7","footerFullWith"],"mappings":"siBAmBC,MAAA,IAAA,MAAA,kFAAA,EAMD,OAAAA,EAAA,QAAA,eAAAC,CAAA,yBAMC,MAAAC,EAAAF,EAAA,mBAAA,EACAG,EAAAD,EAAA,mFAGC,MAAA,IAAA,MAAA,4DAAA,sEAIA,MAAA,IAAA,MAAA,yCAAA,EAGDD,EA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AAA,wJAKgBW,CAAAA,CAAAA"}
1
+ {"version":3,"file":"page.vue_vue_type_script_setup_true_lang-DNs0udwC.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,MAAA,IAAA,MAAA,yCAAA,EAGDD,EAAA,UAAAE,EAAAD,CAAA,CAA2D,CAAA,EAG5DF,EAAA,MAAAC,EAAA,SAAA,IAAA,CACCA,EAAA,QAAA,MAAA,EAAuB,EAAA,cAEhB,KAAA,EACD,CAAA,oDAuBA,GAAAD,EAAA,MAAAC,CAAA,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