@topvisor/ui 1.4.3-fixDialogPage.0 → 1.4.3-fixDialogPage.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 (94) hide show
  1. package/.chunks/{core-BfkJRzIa.es.js → core-BE1XXQSp.es.js} +4 -4
  2. package/.chunks/{core-BfkJRzIa.es.js.map → core-BE1XXQSp.es.js.map} +1 -1
  3. package/.chunks/{core-KZCK3nz9.amd.js → core-Bzx1xzSh.amd.js} +2 -2
  4. package/.chunks/{core-KZCK3nz9.amd.js.map → core-Bzx1xzSh.amd.js.map} +1 -1
  5. package/.chunks/{datepicker-DMYB1RFK.es.js → datepicker-DPgavbKe.es.js} +2 -2
  6. package/.chunks/{datepicker-DMYB1RFK.es.js.map → datepicker-DPgavbKe.es.js.map} +1 -1
  7. package/.chunks/{datepicker-C5ErMHwe.amd.js → datepicker-oa8ZwRhq.amd.js} +2 -2
  8. package/.chunks/{datepicker-C5ErMHwe.amd.js.map → datepicker-oa8ZwRhq.amd.js.map} +1 -1
  9. package/.chunks/{dialog_regionSelectorRegions-CeXFum_o.amd.js → dialog_regionSelectorRegions-CZ0tMVSq.amd.js} +2 -2
  10. package/.chunks/{dialog_regionSelectorRegions-CeXFum_o.amd.js.map → dialog_regionSelectorRegions-CZ0tMVSq.amd.js.map} +1 -1
  11. package/.chunks/{dialog_regionSelectorRegions-Ch378Kqq.es.js → dialog_regionSelectorRegions-D7x41iZu.es.js} +4 -4
  12. package/.chunks/{dialog_regionSelectorRegions-Ch378Kqq.es.js.map → dialog_regionSelectorRegions-D7x41iZu.es.js.map} +1 -1
  13. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-CSTjTwQA.amd.js → dialogs.vue_vue_type_script_setup_true_lang-BBix_8WK.amd.js} +2 -2
  14. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-CSTjTwQA.amd.js.map → dialogs.vue_vue_type_script_setup_true_lang-BBix_8WK.amd.js.map} +1 -1
  15. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-BGpebQij.es.js → dialogs.vue_vue_type_script_setup_true_lang-D8WYUfXI.es.js} +2 -2
  16. package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-BGpebQij.es.js.map → dialogs.vue_vue_type_script_setup_true_lang-D8WYUfXI.es.js.map} +1 -1
  17. package/.chunks/{forms-CUaoBGD5.es.js → forms-BpbQYyEQ.es.js} +5 -5
  18. package/.chunks/{forms-CUaoBGD5.es.js.map → forms-BpbQYyEQ.es.js.map} +1 -1
  19. package/.chunks/{forms-EhKRBbpk.amd.js → forms-DDNzqU6o.amd.js} +3 -3
  20. package/.chunks/{forms-EhKRBbpk.amd.js.map → forms-DDNzqU6o.amd.js.map} +1 -1
  21. package/.chunks/{notice-DQb_Za5_.amd.js → notice-CJ3WOTCM.amd.js} +2 -2
  22. package/.chunks/{notice-DQb_Za5_.amd.js.map → notice-CJ3WOTCM.amd.js.map} +1 -1
  23. package/.chunks/{notice-Chj1PUTD.es.js → notice-Ckc8r96E.es.js} +2 -2
  24. package/.chunks/{notice-Chj1PUTD.es.js.map → notice-Ckc8r96E.es.js.map} +1 -1
  25. package/.chunks/{page.vue_vue_type_script_setup_true_lang-w4Ajsm9A.es.js → page.vue_vue_type_script_setup_true_lang-D3_o-DIM.es.js} +4 -4
  26. package/.chunks/{page.vue_vue_type_script_setup_true_lang-w4Ajsm9A.es.js.map → page.vue_vue_type_script_setup_true_lang-D3_o-DIM.es.js.map} +1 -1
  27. package/.chunks/{page.vue_vue_type_script_setup_true_lang-CUfKoByk.amd.js → page.vue_vue_type_script_setup_true_lang-fl6-Ql4d.amd.js} +2 -2
  28. package/.chunks/{page.vue_vue_type_script_setup_true_lang-CUfKoByk.amd.js.map → page.vue_vue_type_script_setup_true_lang-fl6-Ql4d.amd.js.map} +1 -1
  29. package/.chunks/{policy.vue_vue_type_style_index_0_lang-6S_OFLu6.amd.js → policy.vue_vue_type_style_index_0_lang-BDyhjT5Y.amd.js} +2 -2
  30. package/.chunks/{policy.vue_vue_type_style_index_0_lang-6S_OFLu6.amd.js.map → policy.vue_vue_type_style_index_0_lang-BDyhjT5Y.amd.js.map} +1 -1
  31. package/.chunks/{policy.vue_vue_type_style_index_0_lang-BRUOmEM8.es.js → policy.vue_vue_type_style_index_0_lang-DVl9DBpl.es.js} +4 -4
  32. package/.chunks/{policy.vue_vue_type_style_index_0_lang-BRUOmEM8.es.js.map → policy.vue_vue_type_style_index_0_lang-DVl9DBpl.es.js.map} +1 -1
  33. package/.chunks/{popup-COONSpqs.es.js → popup-DpyyE2Cs.es.js} +4 -4
  34. package/.chunks/popup-DpyyE2Cs.es.js.map +1 -0
  35. package/.chunks/{popup-CDaQNt-3.amd.js → popup-yXIpyok3.amd.js} +2 -2
  36. package/.chunks/popup-yXIpyok3.amd.js.map +1 -0
  37. package/.chunks/{popupHint.vue_vue_type_style_index_0_lang-24i49Ad3.amd.js → popupHint.vue_vue_type_style_index_0_lang-CdQostog.amd.js} +2 -2
  38. package/.chunks/{popupHint.vue_vue_type_style_index_0_lang-24i49Ad3.amd.js.map → popupHint.vue_vue_type_style_index_0_lang-CdQostog.amd.js.map} +1 -1
  39. package/.chunks/{popupHint.vue_vue_type_style_index_0_lang-DzT1BFMx.es.js → popupHint.vue_vue_type_style_index_0_lang-if4Qli-k.es.js} +2 -2
  40. package/.chunks/{popupHint.vue_vue_type_style_index_0_lang-DzT1BFMx.es.js.map → popupHint.vue_vue_type_style_index_0_lang-if4Qli-k.es.js.map} +1 -1
  41. package/.chunks/{utils-CT09IY6X.amd.js → utils-CWn_G7OO.amd.js} +2 -2
  42. package/.chunks/{utils-CT09IY6X.amd.js.map → utils-CWn_G7OO.amd.js.map} +1 -1
  43. package/.chunks/{utils-BJXd6gcx.es.js → utils-CyE38wuQ.es.js} +3 -3
  44. package/.chunks/{utils-BJXd6gcx.es.js.map → utils-CyE38wuQ.es.js.map} +1 -1
  45. package/.chunks/{utils-CH5NNXaV.amd.js → utils-DIviuVEw.amd.js} +2 -2
  46. package/.chunks/{utils-CH5NNXaV.amd.js.map → utils-DIviuVEw.amd.js.map} +1 -1
  47. package/.chunks/{utils-DTC01RKg.es.js → utils-MzIaxkRQ.es.js} +2 -2
  48. package/.chunks/{utils-DTC01RKg.es.js.map → utils-MzIaxkRQ.es.js.map} +1 -1
  49. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-Dgjj70vU.amd.js → widgetInput.vue_vue_type_script_setup_true_lang-CkOmb3VD.amd.js} +2 -2
  50. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-Dgjj70vU.amd.js.map → widgetInput.vue_vue_type_script_setup_true_lang-CkOmb3VD.amd.js.map} +1 -1
  51. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-BuoAaghB.es.js → widgetInput.vue_vue_type_script_setup_true_lang-Dy8jWadl.es.js} +2 -2
  52. package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-BuoAaghB.es.js.map → widgetInput.vue_vue_type_script_setup_true_lang-Dy8jWadl.es.js.map} +1 -1
  53. package/charts/charts.amd.js +1 -1
  54. package/charts/charts.js +1 -1
  55. package/core/app.amd.js +1 -1
  56. package/core/app.js +5 -5
  57. package/dialog/dialog.amd.js +1 -1
  58. package/dialog/dialog.js +2 -2
  59. package/forms/forms.amd.js +1 -1
  60. package/forms/forms.js +1 -1
  61. package/formsExt/formsExt.amd.js +1 -1
  62. package/formsExt/formsExt.amd.js.map +1 -1
  63. package/formsExt/formsExt.js +29 -28
  64. package/formsExt/formsExt.js.map +1 -1
  65. package/layout/layout.amd.js +1 -1
  66. package/layout/layout.js +1 -1
  67. package/package.json +1 -1
  68. package/popup/popup.amd.js +1 -1
  69. package/popup/popup.js +4 -4
  70. package/popup/worker.amd.js +1 -1
  71. package/popup/worker.js +2 -2
  72. package/project/project.amd.js +1 -1
  73. package/project/project.js +7 -7
  74. package/src/components/formsExt/editInput/types.d.ts +4 -0
  75. package/src/components/popup/lib/popup.d.ts +1 -1
  76. package/src/components/popup/popup/opener/types.d.ts +1 -1
  77. package/tabsView/tabsView.amd.js +1 -1
  78. package/tabsView/tabsView.js +2 -2
  79. package/utils/clipboard.amd.js +1 -1
  80. package/utils/clipboard.js +1 -1
  81. package/utils/date.amd.js +1 -1
  82. package/utils/date.js +1 -1
  83. package/utils/device.amd.js +1 -1
  84. package/utils/device.js +1 -1
  85. package/utils/lodash.amd.js +1 -1
  86. package/utils/lodash.js +1 -1
  87. package/utils/price.amd.js +1 -1
  88. package/utils/price.js +1 -1
  89. package/utils/searchers.amd.js +1 -1
  90. package/utils/searchers.js +3 -3
  91. package/utils/string.amd.js +1 -1
  92. package/utils/string.js +1 -1
  93. package/.chunks/popup-CDaQNt-3.amd.js.map +0 -1
  94. package/.chunks/popup-COONSpqs.es.js.map +0 -1
@@ -1,4 +1,4 @@
1
- define(["require","exports","vue","./forms-EhKRBbpk.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(`
1
+ define(["require","exports","vue","./forms-DDNzqU6o.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
2
  `);a.length&&(u=String(a.shift()),t=a.join(`
3
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-DQb_Za5_.amd.js.map
4
+ //# sourceMappingURL=notice-CJ3WOTCM.amd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notice-DQb_Za5_.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,EAAA,KAAA;AAAA,CAAA,+CAWiB,GAAAC,EAClB,MAAAF,EACA,KAAAJ,EACA,MAAAC,EACA,YAAAC,GAAA,YACsB,aAAAA,GAAA,aACC,SAAAA,GAAA,SACJ,WAAAA,GAAA,WACE,cAAAA,GAAA,kCAOtB,iBAAAL,EAAA,KAAA,EAAA,CACC,KAAA,CAAAU,EAAAC,CAAA,EAAA,CAAA,GAAAX,CAAA,EAAA,GAAA,CAAA,GAAA,CAAA,EACAW,GAAAC,EAAAD,CAAA,EAQDE,EAAA,KAAA,MAAA,UACC,EAAA,OAAA,EAAA,IAAA,QAAA,IAAAD,EAAAE,CAAA,CAAA,CAEF,EAEAC,EAAAD,GAAA,CACCA,EAAA,WAAA,sCAKDF,EAAAE,GAAA,CACCA,EAAA,YAAA,iCAKCd,EAAA,OAAAc,EAAA,EAAA,OAOKE,EAAAb,GAAA,2LASNA,4aCnGDc,EAAAhB,EAAA,IAAA,EAAA,gCAIA,MAAAiB,EAAAjB,EAAA,IAAA,EAAA,EACAkB,EAAAlB,EAAA,IAAA,OAAA,EAEAM,EAAAN,EAAA,SAAA,IAAA,CACC,IAAAmB,EAAAC,EAAA,MAAA,QAAA,QAAA,QAAA,gCAIAD,CAAO,CAAA,EAGRjB,EAAAF,EAAA,SAAA,IAAA,mFAOCmB,CAAO,CAAA,EAGRR,EAAAU,GAAA,CACCJ,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AAA,GAAAnC,EAAA,mBAAA,GAAA,EAAA,0GAKvC,QAAAgC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,IAAArB,EAAA,EACF,EAAA,KAAA,EAAAyB,CAAA,uFC1ItB,MAAAC,EAAAxB,GAAA,eAGCd,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-CJ3WOTCM.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,EAAA,KAAA;AAAA,CAAA,+CAWiB,GAAAC,EAClB,MAAAF,EACA,KAAAJ,EACA,MAAAC,EACA,YAAAC,GAAA,YACsB,aAAAA,GAAA,aACC,SAAAA,GAAA,SACJ,WAAAA,GAAA,WACE,cAAAA,GAAA,kCAOtB,iBAAAL,EAAA,KAAA,EAAA,CACC,KAAA,CAAAU,EAAAC,CAAA,EAAA,CAAA,GAAAX,CAAA,EAAA,GAAA,CAAA,GAAA,CAAA,EACAW,GAAAC,EAAAD,CAAA,EAQDE,EAAA,KAAA,MAAA,UACC,EAAA,OAAA,EAAA,IAAA,QAAA,IAAAD,EAAAE,CAAA,CAAA,CAEF,EAEAC,EAAAD,GAAA,CACCA,EAAA,WAAA,sCAKDF,EAAAE,GAAA,CACCA,EAAA,YAAA,iCAKCd,EAAA,OAAAc,EA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EAAA,EACP,CAAA,EAAA,KAAA,GAAA,CAAA,QAAA,WAAA,CAAA,GAAAX,EAAA,mBAAA,GAAA,EAAA,uEAgBRA,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,2LAKuC,EAAA,KAAA,EAAAwB,CAAA,GAAAnC,EAAA,mBAAA,GAAA,EAAA,0GAKvC,QAAAgC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAA,IAAArB,EAAA,EACF,EAAA,KAAA,EAAAyB,CAAA,uFC1ItB,MAAAC,EAAAxB,GAAA,eAGCd,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"}
@@ -4,7 +4,7 @@
4
4
  _autoloadCSSCore.insertCSSLinkToPage(fileNames, true);
5
5
 
6
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-CUaoBGD5.es.js";
7
+ import { C as h } from "./forms-BpbQYyEQ.es.js";
8
8
  import { genIntHash as A, nl2br as F } from "../utils/string.js";
9
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
10
  let d = "";
@@ -188,4 +188,4 @@ export {
188
188
  ne as default,
189
189
  oe as show
190
190
  };
191
- //# sourceMappingURL=notice-Chj1PUTD.es.js.map
191
+ //# sourceMappingURL=notice-Ckc8r96E.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notice-Chj1PUTD.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","prepareText","textNoSafety","props","__props","emit","__emit","showed","ref","closed","closedDirection","computed","res","nl2br","direction","onClick","e","tagName","vSwipe","el","_e","ui","_ui","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createBlock","_component_TopButton","_mergeProps","_hoisted_4","_Fragment","_renderList","buttonProps","$i18n","onCloseItem","_Teleport","_unref","_index","TopNoticeItem","_normalizeStyle","$event"],"mappings":";;;AAKO,MAAMA,IAAqB,KAIrBC,IAAWC,EAAS,oBAAI,KAAmB,GAElDC,IAAY,CAACC,GAAyBC,GAA2BC,MAC/D,gBAAgBC,EAAWH,IAAOC,IAAQ,KAAK,UAAUC,CAAO,CAAC,GAoB5DE,KAAO,CAACJ,GAAcC,IAAe,QAAQC,MAAsB;AAC/E,MAAIG,IAAQ;AAEZ,EAAAL,IAAO,OAAOA,CAAI;AAElB,QAAMM,IAAKP,EAAUC,GAAMC,GAAOC,CAAO;AAEzC,MAAIA,GAAS;AACZ,IAAAG,IAAQH,EAAQ;AAAA,OACV;AACN,UAAMK,IAASP,EAAK,MAAM;AAAA,CAAI;AAE9B,IAAIO,EAAO,WACVF,IAAQ,OAAOE,EAAO,OAAO,GAC7BP,IAAOO,EAAO,KAAK;AAAA,CAAI;AAAA,EAEzB;AAEA,QAAMC,IAAaX,EAAS,IAAIS,CAAE;AAClC,MAAIE,GAAY;AACf,IAAAC,EAAWD,CAAU;AAErB;AAAA,EACD;AAEA,QAAME,IAAa;AAAA,IAClB,IAAAJ;AAAA,IACA,OAAAD;AAAA,IACA,MAAAL;AAAA,IACA,OAAAC;AAAA,IACA,aAAaC,GAAS;AAAA,IACtB,cAAcA,GAAS;AAAA,IACvB,UAAUA,GAAS;AAAA,IACnB,YAAYA,GAAS;AAAA,IACrB,eAAeA,GAAS;AAAA,IACxB,SAASA,GAAS;AAAA,EAAA;AAKnB,MAFAL,EAAS,IAAIa,EAAK,IAA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AAA,UAZA,KAAK3C,EAAK;AAAA,UACV,IAAIA,EAAK;AAAA,UACT,OAAOA,EAAK;AAAA,UACZ,MAAMA,EAAK;AAAA,UACX,OAAK4C,EAAE5C,EAAK,KAAK;AAAA,UACjB,aAAaA,EAAK;AAAA,UAClB,cAAcA,EAAK;AAAA,UACnB,UAAUA,EAAK;AAAA,UACf,YAAYA,EAAK;AAAA,UACjB,aAAaA,EAAK;AAAA,UAClB,YAAYA,EAAK;AAAA,UACjB,SAAK,CAAA6C,MAAEN,EAAYvC,CAAI;AAAA,QAAA;;;;;"}
1
+ {"version":3,"file":"notice-Ckc8r96E.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","prepareText","textNoSafety","props","__props","emit","__emit","showed","ref","closed","closedDirection","computed","res","nl2br","direction","onClick","e","tagName","vSwipe","el","_e","ui","_ui","_createElementBlock","_createElementVNode","_hoisted_1","_openBlock","_createBlock","_component_TopButton","_mergeProps","_hoisted_4","_Fragment","_renderList","buttonProps","$i18n","onCloseItem","_Teleport","_unref","_index","TopNoticeItem","_normalizeStyle","$event"],"mappings":";;;AAKO,MAAMA,IAAqB,KAIrBC,IAAWC,EAAS,oBAAI,KAAmB,GAElDC,IAAY,CAACC,GAAyBC,GAA2BC,MAC/D,gBAAgBC,EAAWH,IAAOC,IAAQ,KAAK,UAAUC,CAAO,CAAC,GAoB5DE,KAAO,CAACJ,GAAcC,IAAe,QAAQC,MAAsB;AAC/E,MAAIG,IAAQ;AAEZ,EAAAL,IAAO,OAAOA,CAAI;AAElB,QAAMM,IAAKP,EAAUC,GAAMC,GAAOC,CAAO;AAEzC,MAAIA,GAAS;AACZ,IAAAG,IAAQH,EAAQ;AAAA,OACV;AACN,UAAMK,IAASP,EAAK,MAAM;AAAA,CAAI;AAE9B,IAAIO,EAAO,WACVF,IAAQ,OAAOE,EAAO,OAAO,GAC7BP,IAAOO,EAAO,KAAK;AAAA,CAAI;AAAA,EAEzB;AAEA,QAAMC,IAAaX,EAAS,IAAIS,CAAE;AAClC,MAAIE,GAAY;AACf,IAAAC,EAAWD,CAAU;AAErB;AAAA,EACD;AAEA,QAAME,IAAa;AAAA,IAClB,IAAAJ;AAAA,IACA,OAAAD;AAAA,IACA,MAAAL;AAAA,IACA,OAAAC;AAAA,IACA,aAAaC,GAAS;AAAA,IACtB,cAAcA,GAAS;AAAA,IACvB,UAAUA,GAAS;AAAA,IACnB,YAAYA,GAAS;AAAA,IACrB,eAAeA,GAAS;AAAA,IACxB,SAASA,GAAS;AAAA,EAAA;AAKnB,MAF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AI,YADrB+B,EAcEY,GAAA;AAAA,UAZA,KAAK3C,EAAK;AAAA,UACV,IAAIA,EAAK;AAAA,UACT,OAAOA,EAAK;AAAA,UACZ,MAAMA,EAAK;AAAA,UACX,OAAK4C,EAAE5C,EAAK,KAAK;AAAA,UACjB,aAAaA,EAAK;AAAA,UAClB,cAAcA,EAAK;AAAA,UACnB,UAAUA,EAAK;AAAA,UACf,YAAYA,EAAK;AAAA,UACjB,aAAaA,EAAK;AAAA,UAClB,YAAYA,EAAK;AAAA,UACjB,SAAK,CAAA6C,MAAEN,EAAYvC,CAAI;AAAA,QAAA;;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as v, provide as f, onMounted as w, getCurrentInstance as b, watch as D, createElementBlock as d, openBlock as i, unref as a, normalizeStyle as m, normalizeClass as r, createElementVNode as s, renderSlot as n, computed as C, resolveDirective as $, createCommentVNode as p, createBlock as h, Teleport as g, withDirectives as k } from "vue";
2
- import { g as T } from "./dialogs.vue_vue_type_script_setup_true_lang-BGpebQij.es.js";
3
- import { C as A } from "./forms-CUaoBGD5.es.js";
4
- import { b as B } from "./utils-DTC01RKg.es.js";
2
+ import { g as T } from "./dialogs.vue_vue_type_script_setup_true_lang-D8WYUfXI.es.js";
3
+ import { C as A } from "./forms-BpbQYyEQ.es.js";
4
+ import { b as B } from "./utils-MzIaxkRQ.es.js";
5
5
  const W = ["id", "data-view-page-active", "data-modal", "data-position"], G = /* @__PURE__ */ v({
6
6
  __name: "dialog",
7
7
  props: {
@@ -136,4 +136,4 @@ export {
136
136
  G as _,
137
137
  H as a
138
138
  };
139
- //# sourceMappingURL=page.vue_vue_type_script_setup_true_lang-w4Ajsm9A.es.js.map
139
+ //# sourceMappingURL=page.vue_vue_type_script_setup_true_lang-D3_o-DIM.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"page.vue_vue_type_script_setup_true_lang-w4Ajsm9A.es.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":["dialog","getDialogWorker","__props","provide","onMounted","topDialogBaseComponent","getCurrentInstance","topDialogComponent","watch","_createElementBlock","_unref","_normalizeClass","_normalizeStyle","_createElementVNode","_renderSlot","_ctx","props","useTopDialogSelf","classes","computed","_openBlock","_hoisted_1","_createBlock","_Teleport","_hoisted_3","_hoisted_4","_hoisted_5","Core","$i18n","_cache","$event","$slots","_withDirectives","_hoisted_9"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,UAAMA,IAASC,EAXDC,EAWuB,EAAE;AACvC,QAAI,CAACF;AACJ,YAAM,IAAI,MAAM,kFAAkF;AAMnG,WAAAG,EAAQ,gBAAgBH,CAAM,GAK9BI,EAAU,MAAM;AACf,YAAMC,IAAyBC,EAAA,GACzBC,IAAqBF,EAAuB;AAElD,UAAIE,GAAoB,QAAQ,KAAK,SAAS;AAC7C,cAAM,IAAI,MAAM,4DAA4D;AAG7E,UAAI,MAAM,QAAQA,EAAmB,QAAQ,QAAQ,KAAKA,EAAmB,QAA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L,UAAM,gBAAc;AAAA,yCACqBP,EAAA;AAAA,cAAA;;cAKzCY,EAA2BC,EAAA,QAAA,QAAA;AAAA,YAAA;;;;;;;"}
1
+ {"version":3,"file":"page.vue_vue_type_script_setup_true_lang-D3_o-DIM.es.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":["dialog","getDialogWorker","__props","provide","onMounted","topDialogBaseComponent","getCurrentInstance","topDialogComponent","watch","_createElementBlock","_unref","_normalizeClass","_normalizeStyle","_createElementVNode","_renderSlot","_ctx","props","useTopDialogSelf","classes","computed","_openBlock","_hoisted_1","_createBlock","_Teleport","_hoisted_3","_hoisted_4","_hoisted_5","Core","$i18n","_cache","$event","$slots","_withDirectives","_hoisted_9"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,UAAMA,IAASC,EAXDC,EAWuB,EAAE;AACvC,QAAI,CAACF;AACJ,YAAM,IAAI,MAAM,kFAAkF;AAMnG,WAAAG,EAAQ,gBAAgB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,8BAAiCmB,EAAAA,OAAO,SAAS,SAAS,MAAA,CAAA;AAAA,UAAA;YAEhEC,GAAAZ,EAAA,GAAAX,EAEM,OAFNwB,GAEM;AAAA,cADLnB,EAAyBC,EAAA,QAAA,MAAA;AAAA,YAAA;;;YAQnBgB,EAAAA,OAAO,eALdtB,EAQM,OAAA;AAAA;cAPL,UAAM,gBAAc;AAAA,yCACqBP,EAAA;AAAA,cAAA;;cAKzCY,EAA2BC,EAAA,QAAA,QAAA;AAAA,YAAA;;;;;;;"}
@@ -1,2 +1,2 @@
1
- define(["require","exports","vue","./dialogs.vue_vue_type_script_setup_true_lang-CSTjTwQA.amd","./forms-EhKRBbpk.amd","./utils-CT09IY6X.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-CUfKoByk.amd.js.map
1
+ define(["require","exports","vue","./dialogs.vue_vue_type_script_setup_true_lang-BBix_8WK.amd","./forms-DDNzqU6o.amd","./utils-CWn_G7OO.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-fl6-Ql4d.amd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"page.vue_vue_type_script_setup_true_lang-CUfKoByk.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,IAA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A,wJAKgB,CAAA,CAAA"}
1
+ {"version":3,"file":"page.vue_vue_type_script_setup_true_lang-fl6-Ql4d.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,EAAA,gFAdC,qBAAAG,EAAA,oCAA8D,CAAA,oEAK1B,aAAAA,EAAA,gCAE1B,EAAA,4JAIL,MAAAJ,EAAA,eAAA,CAAA,aAAAI,EAAA,OAAA,IAAA,CAAA,CAA4D,EAAA,KAAA,CAAA,kCAE3C,EAAA,GAAAC,CAAA,wXC3D9BJ,EAAAK,EAAA,iBAAA,EAEAC,EAAAP,EAAA,SAAA,KACC,uFAGA,8IAkEMA,EAAA,UAAA,EAAAA,EAAA,YAAAA,EAAA,SAAA,iDAzD6B,SAAA,CAAAA,EAAA,MAAAC,CAAA,EAAA,aAAAG,EAAA,IAAA,CAA+D,EAAA,6BA+B1F,aAAAA,EAAA,MA7BQ,iBAAAA,EAAA,KACI,MAAAJ,EAAA,eAAAO,EAAA,KAAA,CACF,EAAA,+BA0BTP,EAAA,mBAAA,MAAAQ,EAAA,CArBCR,EAAA,WAAAS,EAAA,OAAA,QAAA,CADsB,CAAA,gCAKtBT,EAAA,WAAAS,EAAA,OAAA,eAAA,CAD6B,CAAA,6MAQN,EAAA,KAAA,EAAAC,CAAA,IAAAV,EAAA,UAAA,EAAAA,EAAA,mBAAA,MAAA,oEAOd,cAAA,kBACF,EAAA,KAAA,EAAAW,CAAA,0HAMkB,SAAA,CAAAX,EAAA,MAAAC,CAAA,EAAA,aAAAG,EAAA,IAAA,CAA6D,EAAA,6BAqBxF,aAAAA,EAAA,MAnBQ,iBAAAA,EAAA,8DAGE,MAAAJ,EAAA,eAAA,CAAA,6BAAAS,EAAA,OAAA,OAAA,OAAA,KAAA,CAAA,CACiD,EAAA,+DAI1DT,EAAA,WAAAS,EAAA,OAAA,MAAA,CADoB,CAAA,GAAA,wJAKgB,CAAA,CAAA"}
@@ -1,2 +1,2 @@
1
- define(["require","exports","vue","./forms-EhKRBbpk.amd","./popupHint.vue_vue_type_style_index_0_lang-24i49Ad3.amd","./widgetInput.vue_vue_type_script_setup_true_lang-Dgjj70vU.amd","../utils/keyboard.amd","./field-Cvv0SRcJ.amd","../require/css.amd!../assets/policy.css"],(function(ae,x,e,S,P,q,K,W){"use strict";if(typeof e>"u")var e=window.Vue;const O={key:0,class:"top-menu_selectAll"},z=e.defineComponent({__name:"menu",props:e.mergeModels({modelValue:{},items:{},isMultiple:{type:Boolean},canBeEmptyMultiple:{type:Boolean},styling:{default:"default"},selectAllItem:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const a=t,n=e.useModel(t,"modelValue"),l=e.ref();!a.isMultiple&&typeof n.value!="string"&&typeof n.value!="number"&&console.warn('Type check failed for prop "modelValue". Expected String: '+typeof n.value),a.isMultiple&&!Array.isArray(n.value)&&console.warn('Type check failed for prop "modelValue". Expected Array: '+typeof n.value),a.isMultiple&&!a.canBeEmptyMultiple&&Array.isArray(n.value)&&!n.value.length&&a.items[0]&&(n.value=[a.items[0]?.href??a.items[0]?.value]);const c=o=>Array.isArray(n.value)?n.value.includes(o.value):o.value===n.value,C=(o,f=!1)=>{if(Array.isArray(n.value)){let s=n.value.slice();if(f){s.length||(s=a.items.map(h=>h.value));const g=s.indexOf(o.value);g===-1?s.push(o.value):s.splice(g,1)}else s.length===1&&s[0]===o.value?s=[]:s=[o.value];!a.canBeEmptyMultiple&&!s.length&&(s=[o.value]),n.value=s;return}n.value=o.value},p=o=>{if(l.value.scrollWidth<=l.value.offsetWidth||o.shiftKey||Math.abs(o.deltaY)<50)return;o.preventDefault();const f=o.deltaY>0?30:-30;l.value.scrollLeft=l.value.scrollLeft+f},d=(o=!0)=>{const f=l.value.querySelector(".top-active");if(!f)return;const s=24,g=f.offsetLeft-l.value.offsetLeft-s,h=f.offsetLeft-l.value.offsetLeft+f.clientWidth+s,y=l.value.scrollLeft,w=l.value.clientWidth+l.value.scrollLeft;let k;g<y&&(k=g),h>w&&(k=h-l.value.clientWidth),k!==void 0&&(S.isSafari()?S.Core.$?.(l.value).animate({scrollLeft:k},o?200:0):l.value.scrollTo({left:k,behavior:o?"smooth":"auto"}))},r=()=>{if(Array.isArray(n.value)){if(n.value.length===a.items.length){n.value=[a.items[0].href??a.items[0].value];return}n.value=a.items.map(o=>o.href??o.value)}};return e.onMounted(()=>d(!1)),e.onUpdated(()=>d(!0)),(o,f)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"el",ref:l,class:e.normalizeClass({"top-menu":!0,["top-style_"+t.styling]:!0}),onWheel:p},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,s=>(e.openBlock(),e.createBlock(S._sfc_main$1,e.mergeProps({ref_for:!0},s,{class:"top-menu_item",color:"theme",onClick:g=>C(s,g.ctrlKey||g.metaKey),isActive:c(s)}),e.createSlots({_:2},[s.content?{name:"default",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.content),1)]),key:"0"}:void 0]),1040,["onClick","isActive"]))),256)),Array.isArray(n.value)&&t.selectAllItem?(e.openBlock(),e.createElementBlock("div",O,[e.createVNode(S._sfc_main$1,e.mergeProps(t.selectAllItem,{class:"top-menu_item",color:"theme",styling:"",onClick:f[0]||(f[0]=s=>r()),isActive:n.value.length===t.items.length}),e.createSlots({_:2},[t.selectAllItem.content?{name:"default",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.selectAllItem.content),1)]),key:"0"}:void 0]),1040,["isActive"])])):e.createCommentVNode("",!0)],34))}}),U={class:"top-selector2_itemMulti top-ellipsis"},Y=e.defineComponent({__name:"itemMulti",props:{id:{},name:{}},emits:["delete"],setup(t){return(a,n)=>(e.openBlock(),e.createElementBlock("div",U,[e.createTextVNode(e.toDisplayString(t.name)+" ",1),e.createElementVNode("span",{class:"top-selector2_itemMultiDelete","data-top-icon":"",onClick:n[0]||(n[0]=l=>a.$emit("delete",{id:t.id,name:t.name})),onMousedown:n[1]||(n[1]=e.withModifiers(()=>{},["stop"]))},null,32)]))}}),b=new Map,j=t=>{b.get(t)?.clear()},H=t=>{const a=window.mo?.user?.id;return JSON.stringify(t.params)+":"+t.url+":"+a},J=(t,a)=>b.get(a)?.get(t),G=(t,a,n)=>{b.has(a)||b.set(a,new Map),b.get(a)?.set(t,n)},Q=(t,a,n,l)=>{const c=e.ref([]),C=e.ref(!1),p=e.ref(0);let d="",r;t&&!t.params.limit&&(t.params.limit=100);const o=async()=>{if(!t)return;const h=l?H(t):void 0;if(h){const k=J(h,t.path);if(k)return t.abortByFingerprint(),k}const y=await t.call();if(y.errors)return;if(!Array.isArray(y.result)){console.warn("Array expected in `res.result`");return}const w=y.result.findIndex(k=>k.id===void 0||k.name===void 0);if(w!==-1){console.warn(`В result[${w}] нет id или name`);return}return h&&G(h,t.path,y),y},f=async h=>{if(!t)return;if(h){if(!r||C.value)return;t.params.offset=r}else t.params.offset=0;a?.(t,d),C.value=!0;const y=await o();C.value=!1,p.value++,y&&(r=y.nextOffset,h?c.value=c.value.concat(y.result):c.value=y.result)},s=S.debounce(()=>f(!1),200);return{apiRequest:t,items:c,isLoading:C,countLoading:p,load:f,setSearchTextAndLoad:(h,y=!0)=>{if(t){if(h.length<n){t.abortByFingerprint(),c.value=[];return}h===d&&c.value.length||(d=h,y?s():f(!1))}}}},V=0,M=null,D=(t,a,n=!0)=>n&&a.id===M?Array.isArray(t)?t.some(l=>l.id===a.id&&l.name===a.name):a.name===t.name:Array.isArray(t)?t.some(l=>l.id===a.id):a.id===t.id,X=(t,a,n)=>{let l=t.params.filters??[];l=l.filter(c=>c.name!==n),a&&l.push(W.genFieldFilter(n,"CONTAINS",[a])),t.changeParams({filters:l})},Z=(t,a,n,l,c,C,p,d,r,o)=>{const f=e.ref(""),s={id:V,name:S.useI18n().Common.All},g=()=>{f.value=""},h=()=>!(!o.apiRequest||f.value.length>=r),y=e.computed(()=>{const i=[];return!l&&c.value&&(typeof c.value=="string"&&(s.name=c.value),i.push(s)),n.value?.forEach(u=>i.push({...u})),i}),w=e.ref([]),k=()=>{w.value=N()},N=()=>{const i=f.value.toLowerCase(),u=K.invertKeyboardLayout(i);let A=[],L;const I=[],F=()=>{I.at(-1)?.listItemProps?.type==="delimiter"&&I.pop(),I.length&&(L&&A.push(L),A.push(...I),I.length=0)};for(const B of y.value)switch(B.listItemProps?.type){case"title":F(),L=B;break;case"delimiter":if(I.length){let T=I.length;I.at(-1)?.listItemProps?.type==="delimiter"&&T--,I[T]=B}break;default:const ne=p.value.includes("id"),$=B.name.toLowerCase(),R=p.value.filter(T=>T!=="id").map(T=>typeof B[T]=="string"||typeof B[T]=="number"?B[T]:"").join("☼").toLowerCase();(ne&&B.id===Number(i)||R.includes(i)||R.includes(u))&&($===i||$===u?I.unshift(B):I.push(B))}if(F(),A.push(...o.items.value),C.value&&f.value&&!A.find(B=>B.name.toLowerCase()===i)){const B={id:M,name:f.value};A.push(B)}return l&&(A=A.filter(B=>!D(t.value,B))),A},m=i=>{i.listItemProps?.type==="title"||i.listItemProps?.type==="delimiter"||(l&&Array.isArray(t.value)?D(t.value,i)||(t.value=[...t.value,i]):t.value=i,i.id===M&&a("appendItem",i),setTimeout(()=>{g()}))};if(o.apiRequest){const i=[n,o.items];l&&i.push(t),e.watch(i,()=>{k()})}else e.watch([t,n,f],()=>{k()},{immediate:!0,deep:2});return{searchText:f,resetSearch:g,genIsShort:h,itemsForShow:w,selectItem:m,selectNextItem:()=>{if(Array.isArray(t.value))return;const i=w.value.filter(L=>!["title","delimiter"].includes(L.listItemProps?.type??"")),A=(i.findIndex(L=>L.id===t.value.id)+1)%i.length;t.value={...i[A]}},deleteItemByItem:async i=>{Array.isArray(t.value)&&(t.value=t.value.filter(u=>u.id!==i.id||u.name!==i.name))}}},_={key:0,class:"top-selector2_activeItems"},ee={key:1,class:"top-selector2_activeName top-ellipsis"},te={key:2,class:"top-selector2_placeholder top-ellipsis"},le=e.defineComponent({__name:"selector2",props:e.mergeModels({modelValue:{},items:{default:()=>[]},title:{},disabled:{type:Boolean},icon:{},modificator:{},size:{default:"s"},isError:{type:Boolean},openByFocusInput:{type:Boolean,default:void 0},searchType:{default:"popup"},searchFields:{default:()=>["id","name"]},placeholder:{},api:{},apiSetSearchParams:{},minLength:{default:0},useCache:{type:Boolean},appendSearchToResult:{type:Boolean},multiselect:{type:Boolean},useAllItem:{type:[Boolean,String]},addChanger:{type:Boolean},buttonProps:{},selectedAsPlaceholder:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:e.mergeModels(["appendItem"],["update:modelValue"]),setup(t,{expose:a,emit:n}){const l=t,c=e.useModel(t,"modelValue"),C=n;a({resetCache:(m=!1)=>{d.apiRequest&&(m&&j(d.apiRequest.path),d.items.value=[],d.countLoading.value=0,d.apiRequest.params.offset=0,requestAnimationFrame(()=>{r.itemsForShow.value=[]}),s()?.elPopup&&d.setSearchTextAndLoad(r.searchText.value))}});const p=e.computed(()=>l.searchType==="inline"&&l.multiselect||l.searchType==="inline"&&S.Core.state.isMobile?"popup":l.searchType),d=Q(l.api,l.apiSetSearchParams,l.minLength,l.useCache),r=Z(c,C,e.toRef(l,"items"),l.multiselect,e.toRef(l,"useAllItem"),e.toRef(l,"appendSearchToResult"),e.toRef(l,"searchFields"),p,l.minLength,d),o=e.computed(()=>l.buttonProps?"TopButton":p.value==="inline"?"TopInput":"div"),f=e.ref(null),s=()=>f.value?.popup;d.apiRequest&&e.watch(r.searchText,()=>{d.setSearchTextAndLoad(r.searchText.value)});const g=e.computed(()=>Array.isArray(c.value)||l.multiselect||!l.selectedAsPlaceholder&&p.value!=="inline"?l.placeholder:c.value?.name||l.placeholder),h=m=>{let v=!1;switch(m.key){case"Delete":case"Backspace":Array.isArray(c.value)&&(m.preventDefault(),m.stopPropagation(),c.value.pop());break;case"ArrowUp":case"ArrowRight":case"ArrowDown":case"ArrowLeft":case"Enter":case" ":v=!0;break;case"Escape":p.value==="inline"&&r.resetSearch();break}const E=m.key.length===1&&!m.ctrlKey&&!m.metaKey;(p.value==="popup"||p.value==="inline")&&E&&(v=!0),s()?.elPopup&&(v=!1),v&&(p.value==="popup"&&(m.preventDefault(),m.stopPropagation(),E&&(r.searchText.value||(r.searchText.value=m.key))),m.currentTarget?.click())},y=m=>{m.preventDefault(),r.selectNextItem()},w=()=>{d.apiRequest&&d.setSearchTextAndLoad(r.searchText.value,!1)},k=()=>{p.value==="popup"&&r.searchText.value&&r.resetSearch()},N=m=>{const v=m.target;v.scrollTop/(v.scrollHeight-v.offsetHeight)>.8&&d.load(!0)};return(m,v)=>{const E=e.resolveComponent("TopLoadbar"),i=e.resolveDirective("top-focus");return e.openBlock(),e.createBlock(e.unref(P._sfc_main),{ref_key:"popupRef",ref:f,onOpen:v[3]||(v[3]=u=>w()),onClose:v[4]||(v[4]=u=>k()),onScrollContentList:v[5]||(v[5]=u=>e.unref(d)?N(u):void 0),notch:!1,transitionDuration:0,openByFocusInput:p.value==="inline"&&(t.openByFocusInput??!0),disabled:p.value==="inline"&&e.unref(r).genIsShort()},e.createSlots({opener:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),e.mergeProps(t.buttonProps,{class:{"top-selector2":!0,"top-selector2-multiselect":t.multiselect,["top-selector2-"+t.modificator]:!!t.modificator,"top-as-input":!t.buttonProps&&p.value!=="inline","top-as-selector":!0,["top-size_"+t.size]:!0,"top-disabled":t.disabled,"top-forms-focusable":!t.disabled,"top-error":t.isError},icon:t.icon,tabindex:"0",onKeydown:h,onBlur:v[0]||(v[0]=u=>p.value==="inline"&&e.unref(r).resetSearch()),placeholder:g.value,title:t.title,captionType:p.value==="inline"&&t.title!==void 0?"top":void 0,modelValue:e.unref(r).searchText.value,"onUpdate:modelValue":v[1]||(v[1]=u=>e.unref(r).searchText.value=u)}),{default:e.withCtx(()=>[t.multiselect?(e.openBlock(),e.createElementBlock("div",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,u=>(e.openBlock(),e.createBlock(Y,{id:u.id,name:u.name,onDelete:e.unref(r).deleteItemByItem},null,8,["id","name","onDelete"]))),256))])):e.createCommentVNode("",!0),p.value!=="inline"&&!t.multiselect?(e.openBlock(),e.createElementBlock("span",ee,e.toDisplayString(Array.isArray(c.value)?"":c.value.name),1)):e.createCommentVNode("",!0),t.multiselect&&!c.value.length?(e.openBlock(),e.createElementBlock("span",te,e.toDisplayString(g.value),1)):e.createCommentVNode("",!0),t.addChanger&&!t.buttonProps&&!t.multiselect&&e.unref(r).itemsForShow.value.length>1&&!t.disabled?(e.openBlock(),e.createElementBlock("span",{key:3,class:"top-changer top-changer-selector","data-top-popup-disabled":"true",onClick:y})):e.createCommentVNode("",!0)]),_:1},16,["class","icon","placeholder","title","captionType","modelValue"])),[[i,t.isError,void 0,{onupdate:!0}]])]),contentList:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).itemsForShow.value,u=>(e.openBlock(),e.createBlock(e.unref(P._sfc_main$2),e.mergeProps({key:u.id??void 0,class:{"top-active":!Array.isArray(c.value)&&!t.multiselect&&c.value.id===u.id&&c.value.name===u.name,"top-selector2_item-all":u.id===e.unref(V),"top-selector2_item-new":u.id===e.unref(M)}},{ref_for:!0},u.listItemProps,{closeByClick:!t.multiselect||e.unref(S.Core).state.isMobile,onClick:A=>e.unref(r).selectItem(u)}),{default:e.withCtx(()=>[m.$slots.item?e.renderSlot(m.$slots,"item",{key:0,item:u}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(u.name),1)],64))]),_:2},1040,["class","closeByClick","onClick"]))),128)),!e.unref(r).itemsForShow.value.length&&!e.unref(r).genIsShort()?(e.openBlock(),e.createBlock(e.unref(P._sfc_main$2),{key:0,type:"regular"},{default:e.withCtx(()=>[!e.unref(d).isLoading.value||e.unref(d).countLoading.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(m.$i18n.Common.No_results),1)],64)):(e.openBlock(),e.createBlock(e.unref(S._sfc_main$12),{key:1,type:"circles"}))]),_:1})):e.createCommentVNode("",!0),e.unref(d).countLoading.value&&e.unref(d).isLoading.value&&p.value==="inline"?(e.openBlock(),e.createBlock(E,{key:1})):e.createCommentVNode("",!0)]),_:2},[p.value==="popup"?{name:"widget",fn:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref(q._sfc_main),{title:"Поиск",icon:"",modelValue:e.unref(r).searchText.value,"onUpdate:modelValue":v[2]||(v[2]=u=>e.unref(r).searchText.value=u),isLoading:!!e.unref(d).countLoading.value&&e.unref(d).isLoading.value,placeholder:g.value},null,8,["modelValue","isLoading","placeholder"]),[[i,c.value,void 0,{onupdate:!0}]])]),key:"0"}:void 0]),1032,["openByFocusInput","disabled"])}}});x.ITEM_ID_ALL=V,x.ITEM_ID_NEW=M,x._sfc_main=le,x._sfc_main$1=z,x.apiSetSearchParamsFilter=X}));
2
- //# sourceMappingURL=policy.vue_vue_type_style_index_0_lang-6S_OFLu6.amd.js.map
1
+ define(["require","exports","vue","./forms-DDNzqU6o.amd","./popupHint.vue_vue_type_style_index_0_lang-CdQostog.amd","./widgetInput.vue_vue_type_script_setup_true_lang-CkOmb3VD.amd","../utils/keyboard.amd","./field-Cvv0SRcJ.amd","../require/css.amd!../assets/policy.css"],(function(ae,x,e,S,P,q,K,W){"use strict";if(typeof e>"u")var e=window.Vue;const O={key:0,class:"top-menu_selectAll"},z=e.defineComponent({__name:"menu",props:e.mergeModels({modelValue:{},items:{},isMultiple:{type:Boolean},canBeEmptyMultiple:{type:Boolean},styling:{default:"default"},selectAllItem:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const a=t,n=e.useModel(t,"modelValue"),l=e.ref();!a.isMultiple&&typeof n.value!="string"&&typeof n.value!="number"&&console.warn('Type check failed for prop "modelValue". Expected String: '+typeof n.value),a.isMultiple&&!Array.isArray(n.value)&&console.warn('Type check failed for prop "modelValue". Expected Array: '+typeof n.value),a.isMultiple&&!a.canBeEmptyMultiple&&Array.isArray(n.value)&&!n.value.length&&a.items[0]&&(n.value=[a.items[0]?.href??a.items[0]?.value]);const c=o=>Array.isArray(n.value)?n.value.includes(o.value):o.value===n.value,C=(o,f=!1)=>{if(Array.isArray(n.value)){let s=n.value.slice();if(f){s.length||(s=a.items.map(h=>h.value));const g=s.indexOf(o.value);g===-1?s.push(o.value):s.splice(g,1)}else s.length===1&&s[0]===o.value?s=[]:s=[o.value];!a.canBeEmptyMultiple&&!s.length&&(s=[o.value]),n.value=s;return}n.value=o.value},p=o=>{if(l.value.scrollWidth<=l.value.offsetWidth||o.shiftKey||Math.abs(o.deltaY)<50)return;o.preventDefault();const f=o.deltaY>0?30:-30;l.value.scrollLeft=l.value.scrollLeft+f},d=(o=!0)=>{const f=l.value.querySelector(".top-active");if(!f)return;const s=24,g=f.offsetLeft-l.value.offsetLeft-s,h=f.offsetLeft-l.value.offsetLeft+f.clientWidth+s,y=l.value.scrollLeft,w=l.value.clientWidth+l.value.scrollLeft;let k;g<y&&(k=g),h>w&&(k=h-l.value.clientWidth),k!==void 0&&(S.isSafari()?S.Core.$?.(l.value).animate({scrollLeft:k},o?200:0):l.value.scrollTo({left:k,behavior:o?"smooth":"auto"}))},r=()=>{if(Array.isArray(n.value)){if(n.value.length===a.items.length){n.value=[a.items[0].href??a.items[0].value];return}n.value=a.items.map(o=>o.href??o.value)}};return e.onMounted(()=>d(!1)),e.onUpdated(()=>d(!0)),(o,f)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"el",ref:l,class:e.normalizeClass({"top-menu":!0,["top-style_"+t.styling]:!0}),onWheel:p},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,s=>(e.openBlock(),e.createBlock(S._sfc_main$1,e.mergeProps({ref_for:!0},s,{class:"top-menu_item",color:"theme",onClick:g=>C(s,g.ctrlKey||g.metaKey),isActive:c(s)}),e.createSlots({_:2},[s.content?{name:"default",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.content),1)]),key:"0"}:void 0]),1040,["onClick","isActive"]))),256)),Array.isArray(n.value)&&t.selectAllItem?(e.openBlock(),e.createElementBlock("div",O,[e.createVNode(S._sfc_main$1,e.mergeProps(t.selectAllItem,{class:"top-menu_item",color:"theme",styling:"",onClick:f[0]||(f[0]=s=>r()),isActive:n.value.length===t.items.length}),e.createSlots({_:2},[t.selectAllItem.content?{name:"default",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.selectAllItem.content),1)]),key:"0"}:void 0]),1040,["isActive"])])):e.createCommentVNode("",!0)],34))}}),U={class:"top-selector2_itemMulti top-ellipsis"},Y=e.defineComponent({__name:"itemMulti",props:{id:{},name:{}},emits:["delete"],setup(t){return(a,n)=>(e.openBlock(),e.createElementBlock("div",U,[e.createTextVNode(e.toDisplayString(t.name)+" ",1),e.createElementVNode("span",{class:"top-selector2_itemMultiDelete","data-top-icon":"",onClick:n[0]||(n[0]=l=>a.$emit("delete",{id:t.id,name:t.name})),onMousedown:n[1]||(n[1]=e.withModifiers(()=>{},["stop"]))},null,32)]))}}),b=new Map,j=t=>{b.get(t)?.clear()},H=t=>{const a=window.mo?.user?.id;return JSON.stringify(t.params)+":"+t.url+":"+a},J=(t,a)=>b.get(a)?.get(t),G=(t,a,n)=>{b.has(a)||b.set(a,new Map),b.get(a)?.set(t,n)},Q=(t,a,n,l)=>{const c=e.ref([]),C=e.ref(!1),p=e.ref(0);let d="",r;t&&!t.params.limit&&(t.params.limit=100);const o=async()=>{if(!t)return;const h=l?H(t):void 0;if(h){const k=J(h,t.path);if(k)return t.abortByFingerprint(),k}const y=await t.call();if(y.errors)return;if(!Array.isArray(y.result)){console.warn("Array expected in `res.result`");return}const w=y.result.findIndex(k=>k.id===void 0||k.name===void 0);if(w!==-1){console.warn(`В result[${w}] нет id или name`);return}return h&&G(h,t.path,y),y},f=async h=>{if(!t)return;if(h){if(!r||C.value)return;t.params.offset=r}else t.params.offset=0;a?.(t,d),C.value=!0;const y=await o();C.value=!1,p.value++,y&&(r=y.nextOffset,h?c.value=c.value.concat(y.result):c.value=y.result)},s=S.debounce(()=>f(!1),200);return{apiRequest:t,items:c,isLoading:C,countLoading:p,load:f,setSearchTextAndLoad:(h,y=!0)=>{if(t){if(h.length<n){t.abortByFingerprint(),c.value=[];return}h===d&&c.value.length||(d=h,y?s():f(!1))}}}},V=0,M=null,D=(t,a,n=!0)=>n&&a.id===M?Array.isArray(t)?t.some(l=>l.id===a.id&&l.name===a.name):a.name===t.name:Array.isArray(t)?t.some(l=>l.id===a.id):a.id===t.id,X=(t,a,n)=>{let l=t.params.filters??[];l=l.filter(c=>c.name!==n),a&&l.push(W.genFieldFilter(n,"CONTAINS",[a])),t.changeParams({filters:l})},Z=(t,a,n,l,c,C,p,d,r,o)=>{const f=e.ref(""),s={id:V,name:S.useI18n().Common.All},g=()=>{f.value=""},h=()=>!(!o.apiRequest||f.value.length>=r),y=e.computed(()=>{const i=[];return!l&&c.value&&(typeof c.value=="string"&&(s.name=c.value),i.push(s)),n.value?.forEach(u=>i.push({...u})),i}),w=e.ref([]),k=()=>{w.value=N()},N=()=>{const i=f.value.toLowerCase(),u=K.invertKeyboardLayout(i);let A=[],L;const I=[],F=()=>{I.at(-1)?.listItemProps?.type==="delimiter"&&I.pop(),I.length&&(L&&A.push(L),A.push(...I),I.length=0)};for(const B of y.value)switch(B.listItemProps?.type){case"title":F(),L=B;break;case"delimiter":if(I.length){let T=I.length;I.at(-1)?.listItemProps?.type==="delimiter"&&T--,I[T]=B}break;default:const ne=p.value.includes("id"),$=B.name.toLowerCase(),R=p.value.filter(T=>T!=="id").map(T=>typeof B[T]=="string"||typeof B[T]=="number"?B[T]:"").join("☼").toLowerCase();(ne&&B.id===Number(i)||R.includes(i)||R.includes(u))&&($===i||$===u?I.unshift(B):I.push(B))}if(F(),A.push(...o.items.value),C.value&&f.value&&!A.find(B=>B.name.toLowerCase()===i)){const B={id:M,name:f.value};A.push(B)}return l&&(A=A.filter(B=>!D(t.value,B))),A},m=i=>{i.listItemProps?.type==="title"||i.listItemProps?.type==="delimiter"||(l&&Array.isArray(t.value)?D(t.value,i)||(t.value=[...t.value,i]):t.value=i,i.id===M&&a("appendItem",i),setTimeout(()=>{g()}))};if(o.apiRequest){const i=[n,o.items];l&&i.push(t),e.watch(i,()=>{k()})}else e.watch([t,n,f],()=>{k()},{immediate:!0,deep:2});return{searchText:f,resetSearch:g,genIsShort:h,itemsForShow:w,selectItem:m,selectNextItem:()=>{if(Array.isArray(t.value))return;const i=w.value.filter(L=>!["title","delimiter"].includes(L.listItemProps?.type??"")),A=(i.findIndex(L=>L.id===t.value.id)+1)%i.length;t.value={...i[A]}},deleteItemByItem:async i=>{Array.isArray(t.value)&&(t.value=t.value.filter(u=>u.id!==i.id||u.name!==i.name))}}},_={key:0,class:"top-selector2_activeItems"},ee={key:1,class:"top-selector2_activeName top-ellipsis"},te={key:2,class:"top-selector2_placeholder top-ellipsis"},le=e.defineComponent({__name:"selector2",props:e.mergeModels({modelValue:{},items:{default:()=>[]},title:{},disabled:{type:Boolean},icon:{},modificator:{},size:{default:"s"},isError:{type:Boolean},openByFocusInput:{type:Boolean,default:void 0},searchType:{default:"popup"},searchFields:{default:()=>["id","name"]},placeholder:{},api:{},apiSetSearchParams:{},minLength:{default:0},useCache:{type:Boolean},appendSearchToResult:{type:Boolean},multiselect:{type:Boolean},useAllItem:{type:[Boolean,String]},addChanger:{type:Boolean},buttonProps:{},selectedAsPlaceholder:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:e.mergeModels(["appendItem"],["update:modelValue"]),setup(t,{expose:a,emit:n}){const l=t,c=e.useModel(t,"modelValue"),C=n;a({resetCache:(m=!1)=>{d.apiRequest&&(m&&j(d.apiRequest.path),d.items.value=[],d.countLoading.value=0,d.apiRequest.params.offset=0,requestAnimationFrame(()=>{r.itemsForShow.value=[]}),s()?.elPopup&&d.setSearchTextAndLoad(r.searchText.value))}});const p=e.computed(()=>l.searchType==="inline"&&l.multiselect||l.searchType==="inline"&&S.Core.state.isMobile?"popup":l.searchType),d=Q(l.api,l.apiSetSearchParams,l.minLength,l.useCache),r=Z(c,C,e.toRef(l,"items"),l.multiselect,e.toRef(l,"useAllItem"),e.toRef(l,"appendSearchToResult"),e.toRef(l,"searchFields"),p,l.minLength,d),o=e.computed(()=>l.buttonProps?"TopButton":p.value==="inline"?"TopInput":"div"),f=e.ref(null),s=()=>f.value?.popup;d.apiRequest&&e.watch(r.searchText,()=>{d.setSearchTextAndLoad(r.searchText.value)});const g=e.computed(()=>Array.isArray(c.value)||l.multiselect||!l.selectedAsPlaceholder&&p.value!=="inline"?l.placeholder:c.value?.name||l.placeholder),h=m=>{let v=!1;switch(m.key){case"Delete":case"Backspace":Array.isArray(c.value)&&(m.preventDefault(),m.stopPropagation(),c.value.pop());break;case"ArrowUp":case"ArrowRight":case"ArrowDown":case"ArrowLeft":case"Enter":case" ":v=!0;break;case"Escape":p.value==="inline"&&r.resetSearch();break}const E=m.key.length===1&&!m.ctrlKey&&!m.metaKey;(p.value==="popup"||p.value==="inline")&&E&&(v=!0),s()?.elPopup&&(v=!1),v&&(p.value==="popup"&&(m.preventDefault(),m.stopPropagation(),E&&(r.searchText.value||(r.searchText.value=m.key))),m.currentTarget?.click())},y=m=>{m.preventDefault(),r.selectNextItem()},w=()=>{d.apiRequest&&d.setSearchTextAndLoad(r.searchText.value,!1)},k=()=>{p.value==="popup"&&r.searchText.value&&r.resetSearch()},N=m=>{const v=m.target;v.scrollTop/(v.scrollHeight-v.offsetHeight)>.8&&d.load(!0)};return(m,v)=>{const E=e.resolveComponent("TopLoadbar"),i=e.resolveDirective("top-focus");return e.openBlock(),e.createBlock(e.unref(P._sfc_main),{ref_key:"popupRef",ref:f,onOpen:v[3]||(v[3]=u=>w()),onClose:v[4]||(v[4]=u=>k()),onScrollContentList:v[5]||(v[5]=u=>e.unref(d)?N(u):void 0),notch:!1,transitionDuration:0,openByFocusInput:p.value==="inline"&&(t.openByFocusInput??!0),disabled:p.value==="inline"&&e.unref(r).genIsShort()},e.createSlots({opener:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),e.mergeProps(t.buttonProps,{class:{"top-selector2":!0,"top-selector2-multiselect":t.multiselect,["top-selector2-"+t.modificator]:!!t.modificator,"top-as-input":!t.buttonProps&&p.value!=="inline","top-as-selector":!0,["top-size_"+t.size]:!0,"top-disabled":t.disabled,"top-forms-focusable":!t.disabled,"top-error":t.isError},icon:t.icon,tabindex:"0",onKeydown:h,onBlur:v[0]||(v[0]=u=>p.value==="inline"&&e.unref(r).resetSearch()),placeholder:g.value,title:t.title,captionType:p.value==="inline"&&t.title!==void 0?"top":void 0,modelValue:e.unref(r).searchText.value,"onUpdate:modelValue":v[1]||(v[1]=u=>e.unref(r).searchText.value=u)}),{default:e.withCtx(()=>[t.multiselect?(e.openBlock(),e.createElementBlock("div",_,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,u=>(e.openBlock(),e.createBlock(Y,{id:u.id,name:u.name,onDelete:e.unref(r).deleteItemByItem},null,8,["id","name","onDelete"]))),256))])):e.createCommentVNode("",!0),p.value!=="inline"&&!t.multiselect?(e.openBlock(),e.createElementBlock("span",ee,e.toDisplayString(Array.isArray(c.value)?"":c.value.name),1)):e.createCommentVNode("",!0),t.multiselect&&!c.value.length?(e.openBlock(),e.createElementBlock("span",te,e.toDisplayString(g.value),1)):e.createCommentVNode("",!0),t.addChanger&&!t.buttonProps&&!t.multiselect&&e.unref(r).itemsForShow.value.length>1&&!t.disabled?(e.openBlock(),e.createElementBlock("span",{key:3,class:"top-changer top-changer-selector","data-top-popup-disabled":"true",onClick:y})):e.createCommentVNode("",!0)]),_:1},16,["class","icon","placeholder","title","captionType","modelValue"])),[[i,t.isError,void 0,{onupdate:!0}]])]),contentList:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).itemsForShow.value,u=>(e.openBlock(),e.createBlock(e.unref(P._sfc_main$2),e.mergeProps({key:u.id??void 0,class:{"top-active":!Array.isArray(c.value)&&!t.multiselect&&c.value.id===u.id&&c.value.name===u.name,"top-selector2_item-all":u.id===e.unref(V),"top-selector2_item-new":u.id===e.unref(M)}},{ref_for:!0},u.listItemProps,{closeByClick:!t.multiselect||e.unref(S.Core).state.isMobile,onClick:A=>e.unref(r).selectItem(u)}),{default:e.withCtx(()=>[m.$slots.item?e.renderSlot(m.$slots,"item",{key:0,item:u}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(u.name),1)],64))]),_:2},1040,["class","closeByClick","onClick"]))),128)),!e.unref(r).itemsForShow.value.length&&!e.unref(r).genIsShort()?(e.openBlock(),e.createBlock(e.unref(P._sfc_main$2),{key:0,type:"regular"},{default:e.withCtx(()=>[!e.unref(d).isLoading.value||e.unref(d).countLoading.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(m.$i18n.Common.No_results),1)],64)):(e.openBlock(),e.createBlock(e.unref(S._sfc_main$12),{key:1,type:"circles"}))]),_:1})):e.createCommentVNode("",!0),e.unref(d).countLoading.value&&e.unref(d).isLoading.value&&p.value==="inline"?(e.openBlock(),e.createBlock(E,{key:1})):e.createCommentVNode("",!0)]),_:2},[p.value==="popup"?{name:"widget",fn:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref(q._sfc_main),{title:"Поиск",icon:"",modelValue:e.unref(r).searchText.value,"onUpdate:modelValue":v[2]||(v[2]=u=>e.unref(r).searchText.value=u),isLoading:!!e.unref(d).countLoading.value&&e.unref(d).isLoading.value,placeholder:g.value},null,8,["modelValue","isLoading","placeholder"]),[[i,c.value,void 0,{onupdate:!0}]])]),key:"0"}:void 0]),1032,["openByFocusInput","disabled"])}}});x.ITEM_ID_ALL=V,x.ITEM_ID_NEW=M,x._sfc_main=le,x._sfc_main$1=z,x.apiSetSearchParamsFilter=X}));
2
+ //# sourceMappingURL=policy.vue_vue_type_style_index_0_lang-BDyhjT5Y.amd.js.map