@topvisor/ui 1.1.0-addNativeDialog.19 → 1.1.0-addNativeDialog.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.chunks/{core-Ct3VWRde.amd.js → core-C6lQsOeb.amd.js} +2 -2
- package/.chunks/{core-Ct3VWRde.amd.js.map → core-C6lQsOeb.amd.js.map} +1 -1
- package/.chunks/{core-DVlMYAfi.es.js → core-CGAX5_Lv.es.js} +2 -2
- package/.chunks/{core-DVlMYAfi.es.js.map → core-CGAX5_Lv.es.js.map} +1 -1
- package/.chunks/{dialog_selectorRegions-hfsUw4lH.amd.js → dialog_selectorRegions-DagqS_0A.amd.js} +2 -2
- package/.chunks/{dialog_selectorRegions-hfsUw4lH.amd.js.map → dialog_selectorRegions-DagqS_0A.amd.js.map} +1 -1
- package/.chunks/{dialog_selectorRegions-BpE6vw7x.es.js → dialog_selectorRegions-Dl8Zy2f4.es.js} +3 -3
- package/.chunks/{dialog_selectorRegions-BpE6vw7x.es.js.map → dialog_selectorRegions-Dl8Zy2f4.es.js.map} +1 -1
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-CkfNja1v.amd.js +2 -0
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-CkfNja1v.amd.js.map +1 -0
- package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-6huAKJt_.es.js → dialogs.vue_vue_type_script_setup_true_lang-s6FF6g6r.es.js} +50 -50
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-s6FF6g6r.es.js.map +1 -0
- package/.chunks/forms-BWoAyEVH.es.js.map +1 -1
- package/.chunks/forms-BfDSGwrU.amd.js.map +1 -1
- package/.chunks/page.vue_vue_type_script_setup_true_lang-YFEcXSFT.amd.js +2 -0
- package/.chunks/page.vue_vue_type_script_setup_true_lang-YFEcXSFT.amd.js.map +1 -0
- package/.chunks/{page.vue_vue_type_script_setup_true_lang-DDBKHTXA.es.js → page.vue_vue_type_script_setup_true_lang-qW2EC-Pw.es.js} +17 -17
- package/.chunks/page.vue_vue_type_script_setup_true_lang-qW2EC-Pw.es.js.map +1 -0
- package/.chunks/{utils-B1fRcl8f.es.js → utils-CNIqYM7c.es.js} +2 -2
- package/.chunks/{utils-B1fRcl8f.es.js.map → utils-CNIqYM7c.es.js.map} +1 -1
- package/.chunks/{utils-CGvb4aCs.amd.js → utils-DKqoxjzs.amd.js} +2 -2
- package/.chunks/{utils-CGvb4aCs.amd.js.map → utils-DKqoxjzs.amd.js.map} +1 -1
- package/core/app.amd.js +1 -1
- package/core/app.js +3 -3
- package/dialog/dialog.amd.js +1 -1
- package/dialog/dialog.js +2 -2
- package/package.json +1 -1
- package/project/project.amd.js +1 -1
- package/project/project.js +2 -2
- package/src/components/dialog/lib/types.d.ts +2 -2
- package/src/components/dialog/lib/utils.d.ts +11 -11
- package/src/core/plugins/i18n.d.ts +1 -1
- package/utils/searchers.amd.js +1 -1
- package/utils/searchers.js +2 -2
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-6huAKJt_.es.js.map +0 -1
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-CM666D6Q.amd.js +0 -2
- package/.chunks/dialogs.vue_vue_type_script_setup_true_lang-CM666D6Q.amd.js.map +0 -1
- package/.chunks/page.vue_vue_type_script_setup_true_lang-DDBKHTXA.es.js.map +0 -1
- package/.chunks/page.vue_vue_type_script_setup_true_lang-mhd3MqMq.amd.js +0 -2
- package/.chunks/page.vue_vue_type_script_setup_true_lang-mhd3MqMq.amd.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(["require","exports","vue","./dialogs.vue_vue_type_script_setup_true_lang-CkfNja1v.amd","./forms-BfDSGwrU.amd","./utils-DKqoxjzs.amd"],(function($,c,e,p,r,u){"use strict";if(typeof e>"u")var e=window.Vue;const m=["id","data-view-page-active","data-modal","data-position"],v=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(s){const i=s,t=p.getDialogWorker(i.id);if(!t)throw new Error("TopDialog cannot be used in a template, use useTopDialog() / useAsyncTopDialog()");const n=p.createAndMountElDialogNative(t.idAttr,t.pageActive.value),o=e.ref(n);return e.provide("dialogWorker",t),e.onMounted(()=>{var d;const a=e.getCurrentInstance(),l=a.parent;if(((d=l==null?void 0:l.parent)==null?void 0:d.type.name)!=="DialogWrapper")throw new Error("TopDialog cannot be used in a template, use useTopDialog()");if(Array.isArray(l.subTree.children)&&l.subTree.children.length!==1)throw new Error("TopDialog can has only one root element");t.onMounted(l,a)}),e.watch(t.isOpened,()=>{t.isReady.value=!0},{flush:"post",once:!0}),e.onUnmounted(()=>{n==null||n.remove()}),(a,l)=>(e.openBlock(),e.createBlock(e.Teleport,{to:o.value},[e.createElementVNode("div",e.mergeProps({id:e.unref(t).idAttr,class:["top-dialog top-dialog-content",a.classes],style:{"--top-dialog-width":a.width,"--top-dialog-height":a.height},tabindex:"-1","data-view-page-active":e.unref(t).pageActive.value,"data-modal":a.modal,"data-position":a.position,"data-vue-dialog":"true"},a.$attrs),[l[0]||(l[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":a.height+"px"})},null,4),e.renderSlot(a.$slots,"default")],16,m)],8,["to"]))}}),g={key:0,style:{display:"none"}},h=["data-order","data-view-page"],f={class:"modal-header"},y={class:"top-title"},k={class:"buttons"},w=["data-order","data-view-page"],B={class:"modal-body"},b=e.defineComponent({__name:"page",props:{isLoading:{type:Boolean},name:{},order:{default:0},prevName:{},footerFullWith:{type:Boolean}},setup(s){const i=s,t=u.useTopDialogSelf(),n=e.computed(()=>{var o;return{active:((o=t.pageActive)==null?void 0:o.value)===i.name,"i-load-data":i.isLoading||t.isLoadingPage.value}});return(o,a)=>{const l=e.resolveDirective("top-scroll-shadow");return e.unref(t).isReady.value?(e.openBlock(),e.createElementBlock("div",g,[(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(n.value)},[e.createElementVNode("div",f,[e.createElementVNode("div",y,[e.renderSlot(o.$slots,"header")]),e.createElementVNode("div",k,[e.renderSlot(o.$slots,"headerButtons")]),e.unref(r.Core).state.isMobile&&o.prevName?(e.openBlock(),e.createBlock(r._sfc_main$1,{key:0,class:"close",title:o.$i18n.Common.Back,icon:e.unref(r.Core).state.isMobile?"":"",color:"theme",onClick:a[0]||(a[0]=d=>e.unref(t).open(o.prevName))},null,8,["title","icon"])):(e.openBlock(),e.createBlock(r._sfc_main$1,{key:1,class:"close",title:o.$i18n.Common.Close,icon:e.unref(r.Core).state.isMobile?"":"",color:"theme","data-action":"top-dialog-close"},null,8,["title","icon"]))])],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",n.value]),style:e.normalizeStyle({"--top-dialog-footer-height":o.$slots.footer?void 0:"0px"})},[e.withDirectives((e.openBlock(),e.createElementBlock("div",B,[e.renderSlot(o.$slots,"body")])),[[l]]),o.$slots.footer?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["modal-footer",{"modal-footer-fullWith":o.footerFullWith}])},[e.renderSlot(o.$slots,"footer")],2)):e.createCommentVNode("",!0)],14,w)],8,["to","disabled"]))])):e.createCommentVNode("",!0)}}});c._sfc_main=v,c._sfc_main$1=b}));
|
|
2
|
+
//# sourceMappingURL=page.vue_vue_type_script_setup_true_lang-YFEcXSFT.amd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.vue_vue_type_script_setup_true_lang-YFEcXSFT.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, ref, onUnmounted, watch } from 'vue';\nimport { getDialogWorker } from './dialogs/dialogs.vue';\nimport { createAndMountElDialogNative } from '@/components/dialog/lib/utils';\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\nconst elDialogNative = createAndMountElDialogNative(dialog.idAttr, dialog.pageActive.value);\n\nconst elDialogNativeRef = ref(elDialogNative);\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\nonUnmounted(() => {\n\telDialogNative?.remove();\n});\n</script>\n\n<template>\n\t<Teleport :to=\"elDialogNativeRef\">\n\t\t<div\n\t\t\t:id=\"dialog.idAttr\"\n\t\t\tclass=\"top-dialog top-dialog-content\"\n\t\t\t:class=\"classes\"\n\t\t\t:style=\"{\n\t\t\t\t\t'--top-dialog-width': width,\n\t\t\t\t\t'--top-dialog-height': height,\n\t\t\t\t}\"\n\t\t\ttabindex=\"-1\"\n\t\t\t:data-view-page-active=\"dialog.pageActive.value\"\n\t\t\t:data-modal=\"modal\"\n\t\t\t:data-position=\"position\"\n\t\t\tdata-vue-dialog=\"true\"\n\t\t\tv-bind=\"$attrs\"\n\t\t>\n\t\t\t<div class=\"modal-layer modal-layer-header\"></div>\n\n\t\t\t<div class=\"modal-layer modal-layer-body\" :style=\"{'min-height': height + 'px'}\"></div>\n\n\t\t\t<slot name=\"default\"></slot>\n\t\t</div>\n\t</Teleport>\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 TopButton from '@/components/forms/button/button.vue';\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<TopButton\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\t:icon=\"Core.state.isMobile ? '' : ''\"\n\t\t\t\t\t\tcolor=\"theme\"\n\t\t\t\t\t\t@click=\"dialog.open(prevName)\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<TopButton\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\t:icon=\"Core.state.isMobile ? '' : ''\"\n\t\t\t\t\t\tcolor=\"theme\"\n\t\t\t\t\t\tdata-action=\"top-dialog-close\"\n\t\t\t\t\t/>\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":["elDialogNative","dialogs_vue_vue_type_script_setup_true_lang","dialog","elDialogNativeRef","vue","topDialogBaseComponent","topDialogComponent","_ctx","modal","position","utils","classes","order","name","_hoisted_4","forms","footerFullWith"],"mappings":"siBAoBC,MAAA,IAAA,MAAA,kFAAA,EAGD,MAAAA,EAAAC,EAAA,6BAAAC,EAAA,OAAAA,EAAA,WAAA,KAAA,EAEAC,EAAAC,EAAA,IAAAJ,CAAA,EAKA,OAAAI,EAAA,QAAA,eAAAF,CAAA,yBAMC,MAAAG,EAAAD,EAAA,mBAAA,EACAE,EAAAD,EAAA,mFAGC,MAAA,IAAA,MAAA,4DAAA,sEAIA,MAAA,IAAA,MAAA,yCAAA,EAGDH,EAAA,UAAAI,EAAAD,CAAA,CAA2D,CAAA,EAG5DD,EAAA,MAAAF,EAAA,SAAA,IAAA,CACCA,EAAA,QAAA,MAAA,EAAuB,EAAA,cAEhB,KAAA,EACD,CAAA,wCAIiB,CAAA,+DAKSE,EAAA,mBAAA,MAAAA,EAAA,WAAA,CAqBzB,GAAAA,EAAA,MAAAF,CAAA,EAAA,yDAjBU,MAAA,CACT,qBAAAK,EAAA,wGAKoC,aAAAA,EAAA,MAC7BC,gBAAAA,EAAAA,SACGC,kBAAAA,MACA,EAAAF,EAAA,MAAA,EAAA,4JAKL,MAAAH,EAAA,eAAA,CAAA,aAAAG,EAAA,OAAA,IAAA,CAAA,CAA4D,EAAA,KAAA,CAAA,mZCpE1EL,EAAAQ,EAAA,iBAAA,EAEAC,EAAAP,EAAA,SAAA,IAAA,OACC,MAAA,0GAGA,CAAA,8IAoEMA,EAAA,UAAA,EAAAA,EAAA,YAAAA,EAAA,SAAA,iDA3D6B,SAAA,CAAAA,EAAA,MAAAF,CAAA,EAAA,aAAAK,EAAA,IAAA,CAA+D,EAAA,6BAiC1F,aAAAA,EAAA,MA/BQK,iBAAAA,EAAAA,KACIC,MAAAA,EAAAA,eAAAA,EAAAA,KAAAA,CACF,EAAA,+BA4BTT,EAAA,mBAAA,MAAAU,EAAA,CAvBCV,EAAA,WAAAG,EAAA,OAAA,QAAA,CADsB,CAAA,gCAKtBH,EAAA,WAAAG,EAAA,OAAA,eAAA,CAD6B,CAAA,uIAMb,KAAAH,EAAA,MAAAW,EAAA,IAAA,EAAA,MAAA,SAAA,IAAA,qEAGO,EAAA,KAAA,EAAA,CAAA,QAAA,MAAA,CAAA,IAAAX,EAAA,UAAA,EAAAA,EAAA,YAAAW,EAAA,YAAA,gDAMP,KAAAX,EAAA,MAAAW,EAAA,IAAA,EAAA,MAAA,SAAA,IAAA,kBAEf,cAAA,qKAOwB,SAAA,CAAAX,EAAA,MAAAF,CAAA,EAAA,aAAAK,EAAA,IAAA,CAA6D,EAAA,6BAqBxF,aAAAA,EAAA,MAnBQK,iBAAAA,EAAAA,8DAGE,MAAAR,EAAA,eAAA,CAAA,6BAAAG,EAAA,OAAA,OAAA,OAAA,KAAA,CAAA,CACiD,EAAA,+DAI1DH,EAAA,WAAAG,EAAA,OAAA,MAAA,CADoB,CAAA,GAAA,wJAKgBS,CAAAA,CAAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as w, ref as $, provide as A, onMounted as D, getCurrentInstance as k, watch as T, onUnmounted as C, createBlock as
|
|
2
|
-
import { g as
|
|
1
|
+
import { defineComponent as w, ref as $, provide as A, onMounted as D, getCurrentInstance as k, watch as T, onUnmounted as C, createBlock as r, openBlock as l, Teleport as v, createElementVNode as i, mergeProps as B, unref as s, renderSlot as n, normalizeStyle as b, computed as _, resolveDirective as E, createElementBlock as u, createCommentVNode as y, normalizeClass as g, withDirectives as M } from "vue";
|
|
2
|
+
import { g as N, c as W } from "./dialogs.vue_vue_type_script_setup_true_lang-s6FF6g6r.es.js";
|
|
3
3
|
import { C as h, c as f } from "./forms-BWoAyEVH.es.js";
|
|
4
|
-
import { b as S } from "./utils-
|
|
4
|
+
import { b as S } from "./utils-CNIqYM7c.es.js";
|
|
5
5
|
const P = ["id", "data-view-page-active", "data-modal", "data-position"], H = /* @__PURE__ */ w({
|
|
6
6
|
__name: "dialog",
|
|
7
7
|
props: {
|
|
@@ -16,10 +16,10 @@ const P = ["id", "data-view-page-active", "data-modal", "data-position"], H = /*
|
|
|
16
16
|
},
|
|
17
17
|
emits: ["open", "close"],
|
|
18
18
|
setup(p) {
|
|
19
|
-
const o =
|
|
19
|
+
const o = N(p.id);
|
|
20
20
|
if (!o)
|
|
21
21
|
throw new Error("TopDialog cannot be used in a template, use useTopDialog() / useAsyncTopDialog()");
|
|
22
|
-
const
|
|
22
|
+
const d = W(o.idAttr, o.pageActive.value), e = $(d);
|
|
23
23
|
return A("dialogWorker", o), D(() => {
|
|
24
24
|
var m;
|
|
25
25
|
const a = k(), t = a.parent;
|
|
@@ -34,8 +34,8 @@ const P = ["id", "data-view-page-active", "data-modal", "data-position"], H = /*
|
|
|
34
34
|
flush: "post",
|
|
35
35
|
once: !0
|
|
36
36
|
}), C(() => {
|
|
37
|
-
|
|
38
|
-
}), (a, t) => (l(),
|
|
37
|
+
d == null || d.remove();
|
|
38
|
+
}), (a, t) => (l(), r(v, { to: e.value }, [
|
|
39
39
|
i("div", B({
|
|
40
40
|
id: s(o).idAttr,
|
|
41
41
|
class: ["top-dialog top-dialog-content", a.classes],
|
|
@@ -71,7 +71,7 @@ const P = ["id", "data-view-page-active", "data-modal", "data-position"], H = /*
|
|
|
71
71
|
footerFullWith: { type: Boolean }
|
|
72
72
|
},
|
|
73
73
|
setup(p) {
|
|
74
|
-
const c = p, o = S(),
|
|
74
|
+
const c = p, o = S(), d = _(() => {
|
|
75
75
|
var e;
|
|
76
76
|
return {
|
|
77
77
|
active: ((e = o.pageActive) == null ? void 0 : e.value) === c.name,
|
|
@@ -79,16 +79,16 @@ const P = ["id", "data-view-page-active", "data-modal", "data-position"], H = /*
|
|
|
79
79
|
};
|
|
80
80
|
});
|
|
81
81
|
return (e, a) => {
|
|
82
|
-
const t =
|
|
82
|
+
const t = E("top-scroll-shadow");
|
|
83
83
|
return s(o).isReady.value ? (l(), u("div", L, [
|
|
84
|
-
(l(),
|
|
84
|
+
(l(), r(v, {
|
|
85
85
|
to: "#" + s(o).idAttr + " .modal-layer-header",
|
|
86
86
|
disabled: !s(o).needShowPage(e.name)
|
|
87
87
|
}, [
|
|
88
88
|
i("div", {
|
|
89
89
|
"data-order": e.order,
|
|
90
90
|
"data-view-page": e.name,
|
|
91
|
-
class: g(
|
|
91
|
+
class: g(d.value)
|
|
92
92
|
}, [
|
|
93
93
|
i("div", z, [
|
|
94
94
|
i("div", F, [
|
|
@@ -97,14 +97,14 @@ const P = ["id", "data-view-page-active", "data-modal", "data-position"], H = /*
|
|
|
97
97
|
i("div", V, [
|
|
98
98
|
n(e.$slots, "headerButtons")
|
|
99
99
|
]),
|
|
100
|
-
s(h).state.isMobile && e.prevName ? (l(),
|
|
100
|
+
s(h).state.isMobile && e.prevName ? (l(), r(f, {
|
|
101
101
|
key: 0,
|
|
102
102
|
class: "close",
|
|
103
103
|
title: e.$i18n.Common.Back,
|
|
104
104
|
icon: s(h).state.isMobile ? "" : "",
|
|
105
105
|
color: "theme",
|
|
106
106
|
onClick: a[0] || (a[0] = (m) => s(o).open(e.prevName))
|
|
107
|
-
}, null, 8, ["title", "icon"])) : (l(),
|
|
107
|
+
}, null, 8, ["title", "icon"])) : (l(), r(f, {
|
|
108
108
|
key: 1,
|
|
109
109
|
class: "close",
|
|
110
110
|
title: e.$i18n.Common.Close,
|
|
@@ -115,17 +115,17 @@ const P = ["id", "data-view-page-active", "data-modal", "data-position"], H = /*
|
|
|
115
115
|
])
|
|
116
116
|
], 10, R)
|
|
117
117
|
], 8, ["to", "disabled"])),
|
|
118
|
-
(l(),
|
|
118
|
+
(l(), r(v, {
|
|
119
119
|
to: "#" + s(o).idAttr + " .modal-layer-body",
|
|
120
120
|
disabled: !s(o).needShowPage(e.name)
|
|
121
121
|
}, [
|
|
122
122
|
i("div", {
|
|
123
123
|
"data-order": e.order,
|
|
124
124
|
"data-view-page": e.name,
|
|
125
|
-
class: g(["has_scroll_container",
|
|
125
|
+
class: g(["has_scroll_container", d.value]),
|
|
126
126
|
style: b({ "--top-dialog-footer-height": e.$slots.footer ? void 0 : "0px" })
|
|
127
127
|
}, [
|
|
128
|
-
|
|
128
|
+
M((l(), u("div", O, [
|
|
129
129
|
n(e.$slots, "body")
|
|
130
130
|
])), [
|
|
131
131
|
[t]
|
|
@@ -148,4 +148,4 @@ export {
|
|
|
148
148
|
H as _,
|
|
149
149
|
J as a
|
|
150
150
|
};
|
|
151
|
-
//# sourceMappingURL=page.vue_vue_type_script_setup_true_lang-
|
|
151
|
+
//# sourceMappingURL=page.vue_vue_type_script_setup_true_lang-qW2EC-Pw.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page.vue_vue_type_script_setup_true_lang-qW2EC-Pw.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, ref, onUnmounted, watch } from 'vue';\nimport { getDialogWorker } from './dialogs/dialogs.vue';\nimport { createAndMountElDialogNative } from '@/components/dialog/lib/utils';\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\nconst elDialogNative = createAndMountElDialogNative(dialog.idAttr, dialog.pageActive.value);\n\nconst elDialogNativeRef = ref(elDialogNative);\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\nonUnmounted(() => {\n\telDialogNative?.remove();\n});\n</script>\n\n<template>\n\t<Teleport :to=\"elDialogNativeRef\">\n\t\t<div\n\t\t\t:id=\"dialog.idAttr\"\n\t\t\tclass=\"top-dialog top-dialog-content\"\n\t\t\t:class=\"classes\"\n\t\t\t:style=\"{\n\t\t\t\t\t'--top-dialog-width': width,\n\t\t\t\t\t'--top-dialog-height': height,\n\t\t\t\t}\"\n\t\t\ttabindex=\"-1\"\n\t\t\t:data-view-page-active=\"dialog.pageActive.value\"\n\t\t\t:data-modal=\"modal\"\n\t\t\t:data-position=\"position\"\n\t\t\tdata-vue-dialog=\"true\"\n\t\t\tv-bind=\"$attrs\"\n\t\t>\n\t\t\t<div class=\"modal-layer modal-layer-header\"></div>\n\n\t\t\t<div class=\"modal-layer modal-layer-body\" :style=\"{'min-height': height + 'px'}\"></div>\n\n\t\t\t<slot name=\"default\"></slot>\n\t\t</div>\n\t</Teleport>\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 TopButton from '@/components/forms/button/button.vue';\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<TopButton\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\t:icon=\"Core.state.isMobile ? '' : ''\"\n\t\t\t\t\t\tcolor=\"theme\"\n\t\t\t\t\t\t@click=\"dialog.open(prevName)\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<TopButton\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\t:icon=\"Core.state.isMobile ? '' : ''\"\n\t\t\t\t\t\tcolor=\"theme\"\n\t\t\t\t\t\tdata-action=\"top-dialog-close\"\n\t\t\t\t\t/>\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","elDialogNative","createAndMountElDialogNative","elDialogNativeRef","ref","provide","onMounted","topDialogBaseComponent","getCurrentInstance","topDialogComponent","_a","watch","onUnmounted","_createBlock","_Teleport","_createElementVNode","_mergeProps","_unref","classes","width","height","modal","position","$attrs","_renderSlot","_ctx","props","useTopDialogSelf","computed","_openBlock","_createElementBlock","_hoisted_1","name","order","_hoisted_3","_hoisted_4","_hoisted_5","Core","prevName","TopButton","$i18n","_cache","$event","_normalizeClass","_normalizeStyle","$slots","_withDirectives","_hoisted_7","footerFullWith"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,UAAMA,IAASC,EAXDC,EAWuB,EAAE;AACvC,QAAI,CAACF;AACJ,YAAM,IAAI,MAAM,kFAAkF;AAGnG,UAAMG,IAAiBC,EAA6BJ,EAAO,QAAQA,EAAO,WAAW,KAAK,GAEpFK,IAAoBC,EAAIH,CAAc;AAK5C,WAAAI,EAAQ,gBAAgBP,CAAM,GAK9BQ,EAAU,MAAM;;AACf,YAAMC,IAAyBC,EAAA,GACzBC,IAAqBF,EAAuB;AAElD,YAAIG,IAAAD,KAAA,gBAAAA,EAAoB,WAApB,gBAAAC,EAA4B,KAAK,UAAS;AAC7C,cAAM,IAAI,MAAM,4DAA4D;AAG7E,UAAI,MAAM,QAAQD,EAAmB,QAAQ,QAAQ,KAAKA,EAAmB,QAAQ,SAAS,WAAW;AACxG,cAAM,IAAI,MAAM,yCAAyC;AAG1D,MAAAX,EAAO,UAAUW,GAAoBF,CAAsB;AAAA,IAC5D,CAAC,GAEDI,EAAMb,EAAO,UAAU,MAAM;AAC5B,MAAAA,EAAO,QAAQ,QAAQ;AAAA,IACxB,GAAG;AAAA,MACF,OAAO;AAAA,MACP,MAAM;AAAA,IAAA,CACN,GAEDc,EAAY,MAAM;AACjB,MAAAX,KAAA,QAAAA,EAAgB;AAAA,IACjB,CAAC,mBAIAY,EAsBWC,GAAA,EAtBA,IAAIX,EAAA,SAAiB;AAAA,MAC/BY,EAoBM,OApBNC,EAoBM;AAAA,QAnBJ,IAAIC,EAAAnB,CAAA,EAAO;AAAA,QACZ,OAAK,CAAC,iCACEoB,EAAAA,OAAO;AAAA,QACd,OAAK;AAAA,gCAA+BC,EAAAA;AAAAA,iCAAmCC,EAAAA;AAAAA,QAAAA;AAAAA,QAIxE,UAAS;AAAA,QACR,yBAAuBH,EAAAnB,CAAA,EAAO,WAAW;AAAA,QACzC,cAAYuB,EAAAA;AAAAA,QACZ,iBAAeC,EAAAA;AAAAA,QAChB,mBAAgB;AAAA,MAAA,GACRC,EAAAA,MAAM,GAAA;AAAA,wBAEdR,EAAkD,OAAA,EAA7C,OAAM,iCAAA,GAAgC,MAAA,EAAA;AAAA,QAE3CA,EAAuF,OAAA;AAAA,UAAlF,OAAM;AAAA,UAAgC,yBAAsBK,EAAAA,SAAM,MAAA;AAAA,QAAA;QAEvEI,EAA4BC,EAAA,QAAA,SAAA;AAAA,MAAA;;;;;;;;;;;;;;;;AC5E/B,UAAMC,IAAQ1B,GAMRF,IAAS6B,EAAA,GAETT,IAAUU,EAAS,MAAM;;AAC9B,aAAO;AAAA,QACN,UAAQlB,IAAAZ,EAAO,eAAP,gBAAAY,EAAmB,WAAUgB,EAAM;AAAA,QAC3C,eAAeA,EAAM,aAAa5B,EAAO,cAAc;AAAA,MAAA;AAAA,IAEzD,CAAC;;;aAMOmB,EAAAnB,CAAA,EAAO,QAAQ,SAFtB+B,KAAAC,EA+DM,OA/DNC,GA+DM;AAAA,cA3DLlB,EAkCWC,GAAA;AAAA,UAlCA,IAAE,MAAQG,EAAAnB,CAAA,EAAO,SAAM;AAAA,UAA4B,UAAQ,CAAGmB,EAAAnB,CAAA,EAAO,aAAakC,EAAAA,IAAI;AAAA,QAAA;UAChGjB,EAgCM,OAAA;AAAA,YA/BJ,cAAYkB,EAAAA;AAAAA,YACZ,kBAAgBD,EAAAA;AAAAA,YAChB,SAAOd,EAAA,KAAO;AAAA,UAAA;YAEfH,EA0BM,OA1BNmB,GA0BM;AAAA,cAzBLnB,EAEM,OAFNoB,GAEM;AAAA,gBADLX,EAA2BC,EAAA,QAAA,QAAA;AAAA,cAAA;cAG5BV,EAEM,OAFNqB,GAEM;AAAA,gBADLZ,EAAkCC,EAAA,QAAA,eAAA;AAAA,cAAA;cAI5BR,EAAAoB,CAAA,EAAK,MAAM,YAAYC,EAAAA,iBAD9BzB,EAOE0B,GAAA;AAAA;gBALD,OAAM;AAAA,gBACL,OAAOC,EAAAA,MAAM,OAAO;AAAA,gBACpB,MAAMvB,EAAAoB,CAAA,EAAK,MAAM,WAAQ,MAAA;AAAA,gBAC1B,OAAM;AAAA,gBACL,SAAKI,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEzB,EAAAnB,CAAA,EAAO,KAAKwC,EAAAA,QAAQ;AAAA,cAAA,wCAG7BzB,EAOE0B,GAAA;AAAA;gBALD,OAAM;AAAA,gBACL,OAAOC,EAAAA,MAAM,OAAO;AAAA,gBACpB,MAAMvB,EAAAoB,CAAA,EAAK,MAAM,WAAQ,MAAA;AAAA,gBAC1B,OAAM;AAAA,gBACN,eAAY;AAAA,cAAA;;;;cAMhBxB,EAsBWC,GAAA;AAAA,UAtBA,IAAE,MAAQG,EAAAnB,CAAA,EAAO,SAAM;AAAA,UAA0B,UAAQ,CAAGmB,EAAAnB,CAAA,EAAO,aAAakC,EAAAA,IAAI;AAAA,QAAA;UAC9FjB,EAoBM,OAAA;AAAA,YAnBJ,cAAYkB,EAAAA;AAAAA,YACZ,kBAAgBD,EAAAA;AAAAA,YACjB,OAAKW,EAAA,CAAC,wBACEzB,EAAA,KAAO,CAAA;AAAA,YACd,OAAK0B,EAAA,EAAA,8BAAiCC,EAAAA,OAAO,SAAS,SAAS,MAAA,CAAA;AAAA,UAAA;YAEhEC,GAAAjB,EAAA,GAAAC,EAEM,OAFNiB,GAEM;AAAA,cADLvB,EAAyBC,EAAA,QAAA,MAAA;AAAA,YAAA;;;YAQnBoB,EAAAA,OAAO,eALdf,EAQM,OAAA;AAAA;cAPL,UAAM,gBAAc;AAAA,yCACqBkB,EAAAA;AAAAA,cAAAA;;cAKzCxB,EAA2BC,EAAA,QAAA,QAAA;AAAA,YAAA;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ref as s, getCurrentInstance as a, inject as i } from "vue";
|
|
2
|
-
import { a as n, g as c } from "./dialogs.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { a as n, g as c } from "./dialogs.vue_vue_type_script_setup_true_lang-s6FF6g6r.es.js";
|
|
3
3
|
import { waitWhile as w } from "../utils/system.js";
|
|
4
4
|
class l {
|
|
5
5
|
/**
|
|
@@ -76,4 +76,4 @@ export {
|
|
|
76
76
|
d as b,
|
|
77
77
|
h as u
|
|
78
78
|
};
|
|
79
|
-
//# sourceMappingURL=utils-
|
|
79
|
+
//# sourceMappingURL=utils-CNIqYM7c.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-
|
|
1
|
+
{"version":3,"file":"utils-CNIqYM7c.es.js","sources":["../../src/components/dialog/dialog/composables/asyncDialogHandle.ts","../../src/components/dialog/dialog/composables/utils.ts"],"sourcesContent":["import type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { useTopDialog } from './utils';\nimport { waitWhile } from '@/core/utils/system';\nimport type { AsyncTopDialogComponentLoader, TopDialogComponent } from './types';\nimport { TopDialogHandle } from './dialogHandle';\n\n/**\n * Объект для работы с асинхронным диалоговым окном\n *\n * Является прослойкой для доступа к TopDialogHandle\n */\nexport class AsyncTopDialogHandle<T extends TopDialogComponent> {\n\n\t/**\n\t * Функция, определяющая компонент TopDialogComponent\n\t */\n\treadonly resolve: AsyncTopDialogComponentLoader<T>;\n\n\t/**\n\t * Реактивная Сссылка на объект worker,\n\t *\n\t * Ссылка не будет указывать на объект, если диалоговое окно еще не загружено\n\t */\n\treadonly worker: Ref<TopDialogHandle<T> | null> = ref(null);\n\n\tconstructor(resolve: AsyncTopDialogComponentLoader<T>) {\n\t\tthis.resolve = resolve;\n\t}\n\n\t/**\n\t * Получить доступ к TopDialogHandle\n\t */\n\tasync get() {\n\t\tif (this.worker.value) return this.worker.value;\n\n\t\tconst result = await this.resolve();\n\t\tconst TopDialogComponent = result.default;\n\n\t\tthis.worker.value = useTopDialog(TopDialogComponent);\n\n\t\tconst worker = this.worker.value;\n\n\t\tawait waitWhile(() => !worker.isMounted);\n\n\t\treturn worker;\n\t}\n\n\t/**\n\t * Открыть диалоговое окно\n\t */\n\tasync open(...args: Parameters<TopDialogHandle<T>['open']>) {\n\t\tconst worker = await this.get();\n\n\t\tawait worker.open(...args);\n\t}\n\n\t/**\n\t * Открыть диалоговое окно как ссылку, для хеш-навигации\n\t *\n\t * Только общедоступные диалоговые окна, расположенные в @/dialogs\n\t */\n\tasync openAsLink(...args: Parameters<TopDialogHandle<T>['open']>) {\n\t\tconst worker = await this.get();\n\n\t\tvoid worker.openAsLink(...args);\n\t}\n\n\t/**\n\t * Закрыть диалоговое окно\n\t *\n\t * Не меняет состояние компонента диалогового окна\n\t */\n\tasync close(...args: Parameters<TopDialogHandle<T>['close']>) {\n\t\tconst worker = await this.get();\n\n\t\tworker.close(...args);\n\t}\n\n\t/**\n\t * Размонтировать виджет диалогового окна\n\t */\n\tasync destroy(...args: Parameters<TopDialogHandle<T>['close']>) {\n\t\tconst worker = await this.get();\n\n\t\tworker.destroy(...args);\n\t}\n\n\t/**\n\t * Устанвоить props\n\t *\n\t * Полностью сбрасывается состояние props\n\t */\n\tasync setProps(...args: Parameters<TopDialogHandle<T>['setProps']>) {\n\t\tconst worker = await this.get();\n\n\t\tawait worker.setProps(...args);\n\t}\n}\n","import { getCurrentInstance, inject } from 'vue';\nimport { TopDialogHandle } from './dialogHandle';\nimport { AsyncTopDialogHandle } from './asyncDialogHandle';\nimport type { AsyncTopDialogComponentLoader, TopDialogComponent } from './types';\nimport { addDialogWorker, getDialogWorker } from '../dialogs/dialogs.vue';\n\n/**\n * Получить объект управленя текущим диалоговым окном\n */\nexport const useTopDialogSelf = () => {\n\t// вызов из пользовтаельского компонента диалога\n\tconst topDialogComponent = getCurrentInstance() as any;\n\tif (topDialogComponent?.type?.id) {\n\t\tconst dialogWorker = getDialogWorker(topDialogComponent.type.id);\n\t\tif (dialogWorker) return dialogWorker;\n\t}\n\n\treturn inject('dialogWorker') as TopDialogHandle<TopDialogComponent>;\n};\n\n/**\n * Получить объект управленя диалоговым окном\n *\n * При первом вызове компонент диалогового окна будет внедрен в компонент DialogWrapper\n */\nexport const useTopDialog = <T extends TopDialogComponent>(DialogComponent: T): TopDialogHandle<T> => {\n\treturn addDialogWorker(DialogComponent);\n};\n\n/**\n * Получить объект управленя асинхронным диалоговым окном\n *\n * Компонент диалогового окна будет загружен и инициирован при первом взаимодействии с объектом\n *\n * Использует useTopDialog()\n */\nexport const useAsyncTopDialog = <T extends TopDialogComponent>(resolve: AsyncTopDialogComponentLoader<T>): AsyncTopDialogHandle<T> => {\n\treturn new AsyncTopDialogHandle(resolve);\n};\n"],"names":["AsyncTopDialogHandle","ref","resolve","TopDialogComponent","useTopDialog","worker","waitWhile","args","useTopDialogSelf","topDialogComponent","getCurrentInstance","_a","dialogWorker","getDialogWorker","inject","DialogComponent","addDialogWorker","useAsyncTopDialog"],"mappings":";;;AAYO,MAAMA,EAAmD;AAAA;AAAA;AAAA;AAAA,EAKtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,SAAyCC,EAAI,IAAI;AAAA,EAE1D,YAAYC,GAA2C;AACtD,SAAK,UAAUA;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,MAAM;AACX,QAAI,KAAK,OAAO,MAAO,QAAO,KAAK,OAAO;AAG1C,UAAMC,KADS,MAAM,KAAK,QAAA,GACQ;AAElC,SAAK,OAAO,QAAQC,EAAaD,CAAkB;AAEnD,UAAME,IAAS,KAAK,OAAO;AAE3B,iBAAMC,EAAU,MAAM,CAACD,EAAO,SAAS,GAEhCA;AAAA,EACR;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,QAAQE,GAA8C;AAG3D,WAFe,MAAM,KAAK,IAAA,GAEb,KAAK,GAAGA,CAAI;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,cAAcA,GAA8C;AAGjE,KAFe,MAAM,KAAK,IAAA,GAEd,WAAW,GAAGA,CAAI;AAAA,EAC/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,SAASA,GAA+C;AAG7D,KAFe,MAAM,KAAK,IAAA,GAEnB,MAAM,GAAGA,CAAI;AAAA,EACrB;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,WAAWA,GAA+C;AAG/D,KAFe,MAAM,KAAK,IAAA,GAEnB,QAAQ,GAAGA,CAAI;AAAA,EACvB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,MAAM,YAAYA,GAAkD;AAGnE,WAFe,MAAM,KAAK,IAAA,GAEb,SAAS,GAAGA,CAAI;AAAA,EAC9B;AACD;ACzFO,MAAMC,IAAmB,MAAM;;AAErC,QAAMC,IAAqBC,EAAA;AAC3B,OAAIC,IAAAF,KAAA,gBAAAA,EAAoB,SAApB,QAAAE,EAA0B,IAAI;AACjC,UAAMC,IAAeC,EAAgBJ,EAAmB,KAAK,EAAE;AAC/D,QAAIG,EAAc,QAAOA;AAAA,EAC1B;AAEA,SAAOE,EAAO,cAAc;AAC7B,GAOaV,IAAe,CAA+BW,MACnDC,EAAgBD,CAAe,GAU1BE,IAAoB,CAA+Bf,MACxD,IAAIF,EAAqBE,CAAO;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
define(["require","exports","vue","./dialogs.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
//# sourceMappingURL=utils-
|
|
1
|
+
define(["require","exports","vue","./dialogs.vue_vue_type_script_setup_true_lang-CkfNja1v.amd","../utils/system.amd"],(function(k,s,t,i,u){"use strict";if(typeof t>"u")var t=window.Vue;class c{resolve;worker=t.ref(null);constructor(e){this.resolve=e}async get(){if(this.worker.value)return this.worker.value;const o=(await this.resolve()).default;this.worker.value=n(o);const a=this.worker.value;return await u.waitWhile(()=>!a.isMounted),a}async open(...e){await(await this.get()).open(...e)}async openAsLink(...e){(await this.get()).openAsLink(...e)}async close(...e){(await this.get()).close(...e)}async destroy(...e){(await this.get()).destroy(...e)}async setProps(...e){await(await this.get()).setProps(...e)}}const l=()=>{var e;const r=t.getCurrentInstance();if((e=r==null?void 0:r.type)!=null&&e.id){const o=i.getDialogWorker(r.type.id);if(o)return o}return t.inject("dialogWorker")},n=r=>i.addDialogWorker(r),w=r=>new c(r);s.useAsyncTopDialog=w,s.useTopDialog=n,s.useTopDialogSelf=l}));
|
|
2
|
+
//# sourceMappingURL=utils-DKqoxjzs.amd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-
|
|
1
|
+
{"version":3,"file":"utils-DKqoxjzs.amd.js","sources":["../../src/components/dialog/dialog/composables/asyncDialogHandle.ts","../../src/components/dialog/dialog/composables/utils.ts"],"sourcesContent":["import type { Ref } from 'vue';\nimport { ref } from 'vue';\nimport { useTopDialog } from './utils';\nimport { waitWhile } from '@/core/utils/system';\nimport type { AsyncTopDialogComponentLoader, TopDialogComponent } from './types';\nimport { TopDialogHandle } from './dialogHandle';\n\n/**\n * Объект для работы с асинхронным диалоговым окном\n *\n * Является прослойкой для доступа к TopDialogHandle\n */\nexport class AsyncTopDialogHandle<T extends TopDialogComponent> {\n\n\t/**\n\t * Функция, определяющая компонент TopDialogComponent\n\t */\n\treadonly resolve: AsyncTopDialogComponentLoader<T>;\n\n\t/**\n\t * Реактивная Сссылка на объект worker,\n\t *\n\t * Ссылка не будет указывать на объект, если диалоговое окно еще не загружено\n\t */\n\treadonly worker: Ref<TopDialogHandle<T> | null> = ref(null);\n\n\tconstructor(resolve: AsyncTopDialogComponentLoader<T>) {\n\t\tthis.resolve = resolve;\n\t}\n\n\t/**\n\t * Получить доступ к TopDialogHandle\n\t */\n\tasync get() {\n\t\tif (this.worker.value) return this.worker.value;\n\n\t\tconst result = await this.resolve();\n\t\tconst TopDialogComponent = result.default;\n\n\t\tthis.worker.value = useTopDialog(TopDialogComponent);\n\n\t\tconst worker = this.worker.value;\n\n\t\tawait waitWhile(() => !worker.isMounted);\n\n\t\treturn worker;\n\t}\n\n\t/**\n\t * Открыть диалоговое окно\n\t */\n\tasync open(...args: Parameters<TopDialogHandle<T>['open']>) {\n\t\tconst worker = await this.get();\n\n\t\tawait worker.open(...args);\n\t}\n\n\t/**\n\t * Открыть диалоговое окно как ссылку, для хеш-навигации\n\t *\n\t * Только общедоступные диалоговые окна, расположенные в @/dialogs\n\t */\n\tasync openAsLink(...args: Parameters<TopDialogHandle<T>['open']>) {\n\t\tconst worker = await this.get();\n\n\t\tvoid worker.openAsLink(...args);\n\t}\n\n\t/**\n\t * Закрыть диалоговое окно\n\t *\n\t * Не меняет состояние компонента диалогового окна\n\t */\n\tasync close(...args: Parameters<TopDialogHandle<T>['close']>) {\n\t\tconst worker = await this.get();\n\n\t\tworker.close(...args);\n\t}\n\n\t/**\n\t * Размонтировать виджет диалогового окна\n\t */\n\tasync destroy(...args: Parameters<TopDialogHandle<T>['close']>) {\n\t\tconst worker = await this.get();\n\n\t\tworker.destroy(...args);\n\t}\n\n\t/**\n\t * Устанвоить props\n\t *\n\t * Полностью сбрасывается состояние props\n\t */\n\tasync setProps(...args: Parameters<TopDialogHandle<T>['setProps']>) {\n\t\tconst worker = await this.get();\n\n\t\tawait worker.setProps(...args);\n\t}\n}\n","import { getCurrentInstance, inject } from 'vue';\nimport { TopDialogHandle } from './dialogHandle';\nimport { AsyncTopDialogHandle } from './asyncDialogHandle';\nimport type { AsyncTopDialogComponentLoader, TopDialogComponent } from './types';\nimport { addDialogWorker, getDialogWorker } from '../dialogs/dialogs.vue';\n\n/**\n * Получить объект управленя текущим диалоговым окном\n */\nexport const useTopDialogSelf = () => {\n\t// вызов из пользовтаельского компонента диалога\n\tconst topDialogComponent = getCurrentInstance() as any;\n\tif (topDialogComponent?.type?.id) {\n\t\tconst dialogWorker = getDialogWorker(topDialogComponent.type.id);\n\t\tif (dialogWorker) return dialogWorker;\n\t}\n\n\treturn inject('dialogWorker') as TopDialogHandle<TopDialogComponent>;\n};\n\n/**\n * Получить объект управленя диалоговым окном\n *\n * При первом вызове компонент диалогового окна будет внедрен в компонент DialogWrapper\n */\nexport const useTopDialog = <T extends TopDialogComponent>(DialogComponent: T): TopDialogHandle<T> => {\n\treturn addDialogWorker(DialogComponent);\n};\n\n/**\n * Получить объект управленя асинхронным диалоговым окном\n *\n * Компонент диалогового окна будет загружен и инициирован при первом взаимодействии с объектом\n *\n * Использует useTopDialog()\n */\nexport const useAsyncTopDialog = <T extends TopDialogComponent>(resolve: AsyncTopDialogComponentLoader<T>): AsyncTopDialogHandle<T> => {\n\treturn new AsyncTopDialogHandle(resolve);\n};\n"],"names":["AsyncTopDialogHandle","vue","resolve","TopDialogComponent","worker","args","useTopDialogSelf","topDialogComponent","_a","dialogWorker","useTopDialog","DialogComponent","dialogs_vue_vue_type_script_setup_true_lang","useAsyncTopDialog"],"mappings":"yLAYO,MAAAA,CAAA,CAAyD,QAKtD,OAAAC,EAAA,IAAA,IAAA,iBAUR,KAAA,QAAAC,cAOA,GAAA,KAAA,OAAA,MAAA,OAAA,KAAA,OAAA,MAGA,MAAAC,GADA,MAAA,KAAA,QAAA,GACA,+BAIA,MAAAC,EAAA,KAAA,OAAA,iDAIAA,EACD,MAAA,QAAAC,EAAA,CAQC,MAFA,MAAA,KAAA,IAAA,GAEA,KAAA,GAAAA,CAAA,EACD,MAAA,cAAAA,EAAA,EAQC,MAAA,KAAA,IAAA,GAEA,WAAA,GAAAA,CAAA,EACD,MAAA,SAAAA,EAAA,EAQC,MAAA,KAAA,IAAA,GAEA,MAAA,GAAAA,CAAA,EACD,MAAA,WAAAA,EAAA,EAMC,MAAA,KAAA,IAAA,GAEA,QAAA,GAAAA,CAAA,EACD,MAAA,YAAAA,EAAA,CAUC,MAFA,MAAA,KAAA,IAAA,GAEA,SAAA,GAAAA,CAAA,EAEF,CCzFO,MAAAC,EAAA,IAAA,OAEN,MAAAC,EAAAN,EAAA,mBAAA,EACA,IAAAO,EAAAD,GAAA,YAAAA,EAAA,OAAA,MAAAC,EAAA,GAAA,sCAEC,GAAAC,EAAA,OAAAA,EAGD,OAAAR,EAAA,OAAA,cAAA,CACD,EAOOS,EAAAC,GACNC,EAAA,gBAAAD,CAAA,EAUME,EAAAX,GACN,IAAAF,EAAAE,CAAA"}
|
package/core/app.amd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
define(["require","exports","../.chunks/forms-BfDSGwrU.amd","../.chunks/core-
|
|
1
|
+
define(["require","exports","../.chunks/forms-BfDSGwrU.amd","../.chunks/core-C6lQsOeb.amd","vue","../utils/clipboard.amd","../utils/string.amd","../utils/route.amd","../.chunks/utils-DKqoxjzs.amd","../.chunks/dialogs.vue_vue_type_script_setup_true_lang-CkfNja1v.amd"],(function(y,n,c,f,d,m,S,g,p,k){"use strict";if(typeof d>"u")var d=window.Vue;class E{#s;#t;#e;#i;#c;#a=[];#o=[];#n=[];#r=[];constructor(s){var t;this.#t=s.store,this.#s=this.#t.$id,this.#e=s.options.Page,this.#i=s.options.user,this.#c=s.options.Api,this.#a=s.options.tpaNamesUrlHash||[],this.#o=s.options.tpaNamesStorage||[],this.#n=s.options.tpaNamesStorageLocal||[],this.#r=s.options.tpaNamesGuestLink||[],s.store.genGuestLink=(i,a)=>this.genGuestLink(i,a),(t=this.#i.guest_data)!=null&&t.data||(this.#u(),this.#u(!0),this.#f()),this.#S(),this.#k();const e=c.debounce(()=>{this.#m(),this.#g(),this.#g(!0)});s.store.$subscribe(e)}async genGuestLink(s,e){const t=this.#p();e=Object.assign(e,Object.fromEntries(t));const i=await this.#c.gen(s).setParams(e).call();if(i!=null&&i.errors)return;const a=i.result;await m.guestLinkToClipboard(a)}#p(){const s=new Map;return this.#r.forEach(e=>{const t=S.camelToSnakeCase(e);s.set(t,this.#t[e])}),s}#h(s){s.forEach((e,t)=>{const i=this.#t[t];if(e!=null&&i!==void 0&&e!=null&&e.constructor&&e.constructor===i.constructor){if(t.indexOf("date")===0&&!Array.isArray(e)){if(typeof e=="string"&&!/\d\d\d\d-\d\d-\d\d/.test(e))return}this.#t[t]=e}})}#l(s){const e=new Map;return s.forEach((t,i)=>{t!==null&&(t=JSON.stringify(t),e.set(i,t))}),e}#d(s){const e=new Map;return s.forEach((t,i)=>{if(!(t==null||t==="false")){try{if(typeof t=="string"&&!/^\d\d\d\d-\d\d-\d\d$/.test(t)&&(t=JSON.parse(t)),t==null||t==="false")return}catch{}e.set(i,t)}}),e}#f(){let s;try{s=JSON.parse(g.getHash(this.#s))}catch{}if(!s)return;const e=new Map;this.#a.forEach(t=>{const i=s[t];i&&e.set(t,i)}),this.#h(e)}#m(){const s=new Map;this.#a.forEach(i=>{const a=this.#t[i];s.set(i,a)});const e=Object.fromEntries(s),t=JSON.stringify(e);g.setHash(this.#s,t)}#u(s=!1){const e=new Map;let t=this.#o,i="state:"+this.#s;s&&(t=this.#n,i="state:"+this.#s+":"+location.pathname),t.forEach(o=>{const r=localStorage.getItem(i+":"+o);e.set(o,r)});const a=this.#d(e);this.#h(a)}#g(s=!1){const e=new Map;let t=this.#o,i="state:"+this.#s;s&&(t=this.#n,i="state:"+this.#s+":"+location.pathname),t.forEach(o=>{const r=this.#t[o];e.set(o,r)});const a=this.#l(e);t.forEach(o=>{const r=a.get(o);localStorage.setItem(i+":"+o,r)})}#S(){var a,o,r;const s=(o=(a=this.#i)==null?void 0:a.guest_data)==null?void 0:o.data;if(!s)return;this.#i.id===-1&&(this.#i.positionsReverseDates=s.positionsReverseDates);const e=new Map;this.#r.forEach(h=>{const u=s[h];e.set(h,u)});const t=this.#d(e);this.#h(t);const i=$(".mod_guest_title");if(((r=this.#t.competitorsIds)==null?void 0:r.length)===1&&this.#e.page.data.competitors){let h=this.#e.page.data.competitors.filter(u=>u.id===s.competitorsIds[0]);h.length&&($("a",i).attr("href","http://"+h[0].url),$("a",i).text(h[0].name))}}#k(){this.#t.regionsIndexes&&d.watch(this.#t.regionsIndexes,s=>{if(!s.length)return;s.forEach((i,a)=>s[a]=i);const e=TplProjectSelectorRegion.genSearchersMap(),t=[];e.forEach(i=>{i.regions.forEach(a=>{a.index!==-1&&t.push(a.index)})}),this.#t.regionsIndexes=s.filter(i=>t.includes(i))},{immediate:!0}),this.#t.competitorsIds&&d.watch(this.#t.competitorsIds,s=>{if(!s.length)return;s.forEach((t,i)=>s[i]=t);const e=[this.#e.page.data.project.id];this.#e.page.data.project.competitors.forEach(t=>{t.on>=0&&e.push(t.id)}),this.#t.competitorsIds=s.filter(t=>e.includes(t))},{immediate:!0})}}const w=l=>{var e,t,i,a;const s=l;!((e=s.options.tpaNamesUrlHash)!=null&&e.length)&&!((t=s.options.tpaNamesStorage)!=null&&t.length)&&!((i=s.options.tpaNamesStorageLocal)!=null&&i.length)&&!((a=s.options.tpaNamesGuestLink)!=null&&a.length)||new E(s)};n.Core=c.Core,n.i18nPlugin=c.i18n,n.useI18n=c.useI18n,n.useI18nLang=c.useI18nLang,n.corePlugin=f.core,n.useAsyncTopDialog=p.useAsyncTopDialog,n.useTopDialog=p.useTopDialog,n.TopDialogWorker=k.TopDialogWorker,n.piniaTPAPlugin=w,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));
|
|
2
2
|
//# sourceMappingURL=app.amd.js.map
|
package/core/app.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { d } from "../.chunks/forms-BWoAyEVH.es.js";
|
|
2
2
|
import { C as I, i as T, u as b, a as y } from "../.chunks/forms-BWoAyEVH.es.js";
|
|
3
|
-
import { c as G } from "../.chunks/core-
|
|
3
|
+
import { c as G } from "../.chunks/core-CGAX5_Lv.es.js";
|
|
4
4
|
import { watch as p } from "vue";
|
|
5
5
|
import { guestLinkToClipboard as f } from "../utils/clipboard.js";
|
|
6
6
|
import { camelToSnakeCase as g } from "../utils/string.js";
|
|
7
7
|
import { getHash as l, setHash as m } from "../utils/route.js";
|
|
8
|
-
import { u as A, a as D } from "../.chunks/utils-
|
|
9
|
-
import { T as j } from "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-
|
|
8
|
+
import { u as A, a as D } from "../.chunks/utils-CNIqYM7c.es.js";
|
|
9
|
+
import { T as j } from "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-s6FF6g6r.es.js";
|
|
10
10
|
class u {
|
|
11
11
|
#s;
|
|
12
12
|
#t;
|
package/dialog/dialog.amd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
define(["require","exports","../.chunks/page.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
define(["require","exports","../.chunks/page.vue_vue_type_script_setup_true_lang-YFEcXSFT.amd","vue","../.chunks/utils-DKqoxjzs.amd"],(function(c,n,u,e,t){"use strict";if(typeof e>"u")var e=window.Vue;const i={name:{type:String,required:!0},order:{type:Number,required:!0},prevName:String,footerFullWith:Boolean},l=e.defineComponent({__name:"pageComponent",props:{component:{},keepAlive:{type:Boolean,default:!0},props:{},name:{},order:{},prevName:{},footerFullWith:{type:Boolean}},setup(m){const a=m,r=t.useTopDialogSelf(),s=(o,p)=>{if(!p.value){if(o.name!=="AsyncComponentWrapper"){p.value=!0;return}r.needShowPage(a.name)&&(r.isLoadingPage.value=!0,o.__asyncResolved&&(p.value=!0,r.isLoadingPage.value=!1))}};if(a.component.name==="AsyncComponentWrapper"){const o=e.ref(!1);e.onUpdated(()=>{s(a.component,o)})}return(o,p)=>(e.openBlock(),e.createBlock(e.KeepAlive,{include:o.keepAlive?"":"none"},[e.unref(r).needShowPage(o.name)?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.component),e.mergeProps({key:0},a,{name:o.name,order:o.order,prevName:o.prevName}),null,16,["name","order","prevName"])):e.createCommentVNode("",!0)],1032,["include"]))}});n.TopDialog=u._sfc_main,n.TopDialogPage=u._sfc_main$1,n.useTopDialogSelf=t.useTopDialogSelf,n.TopDialogPageComponent=l,n.propsPageCommon=i,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));
|
|
2
2
|
//# sourceMappingURL=dialog.amd.js.map
|
package/dialog/dialog.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as k, a as B } from "../.chunks/page.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _ as k, a as B } from "../.chunks/page.vue_vue_type_script_setup_true_lang-qW2EC-Pw.es.js";
|
|
2
2
|
import { defineComponent as l, ref as i, onUpdated as u, createBlock as a, openBlock as p, KeepAlive as s, createCommentVNode as d, unref as g, resolveDynamicComponent as c, mergeProps as f } from "vue";
|
|
3
|
-
import { b as v } from "../.chunks/utils-
|
|
3
|
+
import { b as v } from "../.chunks/utils-CNIqYM7c.es.js";
|
|
4
4
|
const C = {
|
|
5
5
|
name: {
|
|
6
6
|
type: String,
|
package/package.json
CHANGED
package/project/project.amd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
define(["require","exports","vue","../.chunks/forms-BfDSGwrU.amd","../.chunks/listItem.vue_vue_type_script_setup_true_lang-R7J0Cawj.amd","../.chunks/menu.vue_vue_type_style_index_0_lang-JZ-QwyLO.amd","../.chunks/utils-CGvb4aCs.amd","../utils/searchers.amd","../utils/dom.amd","../popup/worker.amd","../require/css.amd!../assets/project.css"],(function(ne,V,e,x,E,oe,le,P,_,ae){"use strict";if(typeof e>"u")var e=window.Vue;const re={class:"top-selectorCompetitors"},ie={class:"top-ellipsis1"},de=e.defineComponent({__name:"selectorCompetitors",props:e.mergeModels({modelValue:{},items:{},showSelectAllItem:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const l=n,r=e.useModel(n,"modelValue"),t=e.computed(()=>{if(l.showSelectAllItem)return{icon:"",title:x.useI18n().Common.Select_all,value:"all",content:""}});return(d,o)=>(e.openBlock(),e.createElementBlock("div",re,[e.unref(x.Core).state.isMobile?(e.openBlock(),e.createBlock(E._sfc_main,{key:0},{opener:e.withCtx(()=>[e.createVNode(x._sfc_main$1,{class:"top-selectorCompetitors_opener",color:"theme",icon:"",icon2:""},{default:e.withCtx(()=>{var a;return[e.createTextVNode(e.toDisplayString((a=d.items.find(s=>{var v;return s.value===((v=r.value)==null?void 0:v[0])}))==null?void 0:a.content),1)]}),_:1})]),contentList:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.items,a=>{var s;return e.openBlock(),e.createBlock(E._sfc_main$2,{class:e.normalizeClass({"top-active":(s=r.value)==null?void 0:s.includes(a.value)}),"data-top-icon":a.icon,title:a.title,onClick:()=>r.value=[a.value]},{default:e.withCtx(()=>[e.createElementVNode("span",ie,e.toDisplayString(a.content),1)]),_:2},1032,["class","data-top-icon","title","onClick"])}),256))]),_:1})):(e.openBlock(),e.createBlock(oe._sfc_main,{key:1,modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=a=>r.value=a),items:d.items,isMultiple:!0,styling:"bar",canBeEmptyMultiple:!1,selectAllItem:t.value},null,8,["modelValue","items","selectAllItem"]))]))}}),ue=(n,l)=>e.computed(()=>e.toValue(n).filter(d=>d.on>=0||d.id===l).map(d=>({value:d.id,title:d.url+` [${d.id}]`,icon:d.id===e.toValue(l)?"":"",content:d.name}))),w=-1,p=-2,R=-1,se={0:"Yandex",1:"Google",4:"YouTube",5:"Bing",7:"Seznam",8:"AppStore",9:"GoogleStore",20:"Yandex.com",21:"Yandex.com.tr"},J={key:p,name:"--",index:p},G={key:p,name:"--",regions:[J],regionByIndex:new Map([[p,J]])},A={key:p,name:"Autoselect",index:p},U={key:p,name:"Autoselect",regions:[A],regionByIndex:new Map([[p,A]])},Y={countryCode:"00",depth:1,device:0,key:R,index:R,lang:"ru",name:"Without region"},ce=()=>(A.name=x.useI18n().Common.Autoselect,A),ge=()=>(ce(),U.name=x.useI18n().Common.Autoselect,console.log(U),U),me=()=>(Y.name=x.useI18n().Keywords.Without_region,Y),z=(n=!1,l=!1,r=[])=>{let t;return n?t=fe(r):t=W(r),l&&t.set(p,ge()),t.size||t.set(p,G),t},W=(n,l=!0,r=[],t=!1)=>{const d=new Map;return n.forEach(o=>{if(!o.enabled||t&&typeof o.key=="number"&&o.key>1)return;const a={...o};a.regionByIndex=new Map,o.regions&&o.regions.forEach(s=>{if(l&&!s.enabled)return;const v={...s};a.regionByIndex.set(v.index,v)}),!a.regionByIndex.size&&r.length,(!o.regions||a.regionByIndex.size||r.length)&&typeof a.key=="number"&&d.set(a.key,a)}),r.forEach(o=>{if(d.has(o))return;const a={key:o,name:se[o],regions:[],regionByIndex:new Map};d.set(a.key,a)}),d},fe=n=>{const l=W(n,!1,[0,1],!0);if(l.has(2)){const r=l.get(2);r&&(r.regionByIndex=new Map)}return l.forEach(r=>{if(!r.regionByIndex)return;const t={...me()};r.regionByIndex.set(t.index,t)}),l},H=(n,l,r=[])=>{const t=z(n,!1,r);let d;return t.forEach(o=>{if(!(l.searcher_key!==void 0&&l.searcher_key!=o.key)&&o.regions&&(o.regions.forEach(a=>{if(!d&&!(l.key!==void 0&&l.key!=a.key)&&!(l.index!==void 0&&l.index!=a.index)&&!(!n&&(l.lang!==void 0&&l.lang!=a.lang||l.device!==void 0&&l.device!=a.device)))return a.searcher_key=o.key,d=a,!1}),d))return!1}),d},Q=le.useAsyncTopDialog(()=>new Promise((n,l)=>ne(["../.chunks/dialog_selectorRegions-hfsUw4lH.amd"],n,l))),ve=(n,l)=>{const r=x.useI18n(),t=e.ref(l.value.keys().next().value??p),d=e.computed(()=>{const o=new Map;if(l.value.forEach(a=>{let s={value:a.key,title:a.name};n.addSearcherIcon&&(s.icon=P.getSearcherGIcon(a.key)),o.set(a.key,s)}),n.addCompare&&!o.has(p)){const a={value:"",title:"--------------------",disabled:!0};o.set(a.value,a);const s={value:w,title:r.Common.Compare};o.set(s.value,s)}return o});return{searcherKey:t,optionBySearcherKey:d}},ye=(n,l)=>{var o,a,s;const r=x.useI18n(),t=e.ref(p);n.modelValue.length===1&&(t.value=n.modelValue[0]),t.value===p&&(n.forFrequency?t.value=((a=(o=l.value)==null?void 0:o.regionByIndex.values().next().value)==null?void 0:a.key)??p:t.value=((s=l.value)==null?void 0:s.regionByIndex.keys().next().value)??p);const d=e.computed(()=>{var h;const v=new Map;return(h=l.value.regionByIndex)==null||h.forEach(k=>{let i=k.name;if(n.forFrequency){const I={value:k.key,title:i};v.has(k.key)||v.set(k.key,I);return}k.device&&(i+=" ("+r.Common["Device_"+k.device]+")");const m=P.getLangLabel(l.value.key||0,k.lang??"");m&&(i+=" / "+m);const c={value:k.index,title:i,icon:k.device?P.getDeviceGIcon(k.device):void 0};v.set(k.index,c)}),v});return e.watch(d,(v,h)=>{var c;if(n.onlySearcher||t.value!==void 0&&v.get(t.value))return;let k=v.keys().next().value;if(t.value===p||k===p){t.value=k;return}let i=((c=h==null?void 0:h.get(t.value))==null?void 0:c.title)||"",m=-1;for(const[I,B]of v.entries()){const C=B.title;if(typeof C!="string"||typeof I=="string")break;if(C===i){k=I;break}const T=new RegExp(` \\((${r.Common.Device_1}|${r.Common.Device_2})\\)`);let f=i,u=3;C.indexOf(f)===-1&&(f=i.replace(/^[^a-zа-я]/i,"").replace(T,""),u--),C.indexOf(f)===-1&&(f=i.replace(/ \/.*/,""),u--),C.indexOf(f)===-1&&(f=i.replace(/ \/.*/,""),f=f.replace(/^[^a-zа-я]/i,"").replace(T,""),u--),C.indexOf(f)!==-1&&(u<=m||(m=u,k=I))}t.value=k}),{regionIndex:t,optionByRegionIndex:d}},pe=(n,l,r)=>{const t=e.ref([]),d=()=>{if(n.onlySearcher&&l.value){t.value=Array.from(l.value.keys());return}let a=[];if(n.modelValue.length>1)a=[...n.modelValue];else try{a=JSON.parse(localStorage.getItem("ui:project:regionSelector"+n.projectId+":regionsIndexes"))??[]}catch{}a.length&&(a=a.filter(s=>r.value.has(s))),a.length||(a=Array.from(r.value)),t.value=[...a]},o=()=>{t.value.length?localStorage.setItem("ui:project:regionSelector:"+n.projectId+":regionsIndexes",JSON.stringify(t.value)):localStorage.removeItem("ui:project:regionSelector:"+n.projectId+":regionsIndexes")};return e.watch(t,()=>{o()}),n.addCompare&&d(),{regionsIndexes:t}},he=n=>{const l=e.computed(()=>z(n.forFrequency,n.autoRegion,n.searchers)),r=e.computed(()=>l.value.get(d.searcherKey.value)||G),t=e.computed(()=>{const i=new Set;return l.value.forEach(m=>{m.regionByIndex.forEach(c=>{c.index!==R&&c.index!==p&&i.add(c.index)})}),i}),d=ve(n,l),o=ye(n,r),a=pe(n,l,t);e.watch(l,()=>{var m,c,I,B;if(n.onlySearcher?a.regionsIndexes.value=Array.from(l.value.keys()):a.regionsIndexes.value=a.regionsIndexes.value.filter(C=>t.value.has(C)),d.searcherKey.value===w)return;let i=l.value.keys().next().value;l.value.forEach(C=>{var T,f,u;if(n.onlySearcher&&C.key===d.searcherKey.value){i=d.searcherKey.value;return}if(o.regionIndex.value&&((T=C.regionByIndex)!=null&&T.has(o.regionIndex.value))&&(i=C.key),!n.onlySearcher){let g;i!==void 0&&(g=(f=l.value.get(i))==null?void 0:f.regionByIndex);const y=(u=l.value.get(C.key))==null?void 0:u.regionByIndex;g!=null&&g.has(p)&&!(y!=null&&y.has(p))&&(i=C.key)}}),i!==void 0&&(d.searcherKey.value=i),o.regionIndex.value!==void 0&&!((c=(m=r.value)==null?void 0:m.regionByIndex)!=null&&c.has(o.regionIndex.value))&&(o.regionIndex.value=(B=(I=r.value)==null?void 0:I.regions)==null?void 0:B.keys().next().value)},{immediate:!0});const s=()=>{if(!(d.searcherKey.value===w||d.searcherKey.value===p))return d.searcherKey.value},v=()=>{if(n.onlySearcher||o.regionIndex.value===p)return;let i=o.regionIndex.value;if(n.forFrequency){const m=o.regionIndex.value,c=H(n.forFrequency,{searcher_key:s(),key:m},n.searchers);i=c==null?void 0:c.index}return i},h=()=>{const i=s();if(i!==void 0)return l.value.get(i)};return{selectSearcher:d,selectRegion:o,compare:a,searcherByKey:l,allRegionsIndexes:t,getSearcher:h,getRegion:()=>{var m,c;const i=v();if(i!==void 0)return(c=(m=h())==null?void 0:m.regionByIndex)==null?void 0:c.get(i)}}},ke=e.defineComponent({__name:"selectorRegion",props:e.mergeModels({projectId:{},searchers:{default:()=>[]},modelValue:{},modelValueSingle:{},addCompare:{type:Boolean},forFrequency:{type:Boolean},autoRegion:{type:Boolean},onlySearcher:{type:Boolean},addChanger:{type:Boolean,default:!0},addSearcherIcon:{type:Boolean,default:!0},addRegionIcon:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{},modelValueSingle:{},modelValueSingleModifiers:{}}),emits:["update:modelValue","update:modelValueSingle"],setup(n,{expose:l}){const r=n,t=e.useModel(n,"modelValue"),d=e.useModel(n,"modelValueSingle"),{selectSearcher:o,selectRegion:a,compare:s,searcherByKey:v,allRegionsIndexes:h,getSearcher:k,getRegion:i}=he(r),m=()=>{const c=[];v.value.forEach(I=>{I.enabled&&I.regions.forEach(B=>{B.enabled&&c.push(B)})}),Q.open("selectorRegions",{regions:c,regionsIndexes:s.regionsIndexes.value,"@update:regionsIndexes":I=>s.regionsIndexes.value=I})};return e.watch([a.regionIndex,o.searcherKey,s.regionsIndexes],()=>{if(o.searcherKey.value===w&&s.regionsIndexes.value.length){if(JSON.stringify(t.value)===JSON.stringify(s.regionsIndexes.value))return;t.value=[...s.regionsIndexes.value]}else r.onlySearcher?(t.value=[o.searcherKey.value],o.searcherKey.value===p&&!r.autoRegion&&(t.value.length=0)):(t.value=[a.regionIndex.value],a.regionIndex.value===p&&!r.autoRegion&&(t.value.length=0));!r.onlySearcher&&!h.value.size&&(o.searcherKey.value=p)}),d.value&&e.watch(d,()=>{d.value&&(t.value=[d.value])},{immediate:!0}),e.watch(t,()=>{var c,I,B,C,T;if(t.value[0]&&(d.value=t.value[0]),r.onlySearcher){if(!t.value.length||t.value.length===1&&!v.value.has(t.value[0])||t.value.length===1&&t.value[0]===p&&!r.autoRegion){let f=v.value.keys().next().value;f===p&&!r.autoRegion&&(f=void 0,d.value=p),f!==void 0?t.value=[f]:t.value.length=0;return}if(t.value.length>1&&JSON.stringify(t.value)!==JSON.stringify(s.regionsIndexes.value)){t.value=[...s.regionsIndexes.value];return}}else{let f=[...new Set(t.value)],u=(I=(c=v.value.values().next().value)==null?void 0:c.regionByIndex)==null?void 0:I.keys().next().value;if(r.forFrequency&&(u=(T=(C=(B=v.value.values().next().value)==null?void 0:B.regionByIndex)==null?void 0:C.values().next().value)==null?void 0:T.key),u===p&&!r.autoRegion&&(u=void 0,d.value=p),!f.length)u!==void 0&&f.push(u);else if(f.length===1){let g=h.value;r.forFrequency&&(g=new Set,v.value.forEach(y=>{y.regionByIndex.forEach(S=>{S.index!==R&&S.index!==p&&g.add(S.key)})})),g.has(f[0])||(f=[],u!==void 0&&f.push(u))}else f=f.filter(g=>h.value.has(g)),!f.length&&u!==void 0&&f.push(u);if(JSON.stringify(t.value)!==JSON.stringify(f)){t.value=f;return}}if(!(t.value.length===1&&t.value[0]===(r.onlySearcher?o.searcherKey.value:a.regionIndex.value)))if(r.onlySearcher){if(t.value.length===1){o.searcherKey.value=t.value[0];return}o.searcherKey.value=w;return}else{if(!t.value.length)return;if(t.value.length===1&&o.searcherKey.value!==w){a.regionIndex.value=t.value[0];let f;for(const u of v.value.values()){for(const g of u.regionByIndex.values())if((r.forFrequency?g.key:g.index)===a.regionIndex.value){f=u.key;break}if(f!==void 0)break}f!==void 0&&(o.searcherKey.value=f)}else o.searcherKey.value=w,s.regionsIndexes.value=[...t.value]}},{immediate:!0}),l({getSearcher:k,getRegion:i}),(c,I)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({"top-selectorRegion":!0,"top-selectorRegion-onlySearcher":c.onlySearcher})},[e.createVNode(x._sfc_main$9,{options:e.unref(o).optionBySearcherKey.value,modelValue:e.unref(o).searcherKey.value,"onUpdate:modelValue":I[0]||(I[0]=B=>e.unref(o).searcherKey.value=B),name:"searcher_key",addChanger:c.addChanger},null,8,["options","modelValue","addChanger"]),!c.onlySearcher&&e.unref(o).searcherKey.value!==e.unref(w)?(e.openBlock(),e.createBlock(x._sfc_main$9,{key:0,class:"top-select-region",options:e.unref(a).optionByRegionIndex.value,modelValue:e.unref(a).regionIndex.value,"onUpdate:modelValue":I[1]||(I[1]=B=>e.unref(a).regionIndex.value=B),name:c.forFrequency?"region_key":"region_index",addChanger:c.addChanger,"data-top-icon":c.addRegionIcon?"":void 0},null,8,["options","modelValue","name","addChanger","data-top-icon"])):e.createCommentVNode("",!0),c.addCompare&&!c.onlySearcher&&e.unref(o).searcherKey.value===e.unref(w)?(e.openBlock(),e.createBlock(x._sfc_main$1,{key:1,name:"compare",onClick:m,"data-count-compare-regions-indexes":e.unref(s).regionsIndexes.value.length},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.$i18n.Common.Selected_regions),1)]),_:1},8,["data-count-compare-regions-indexes"])):e.createCommentVNode("",!0)],2))}}),X=n=>"-"+n,K=n=>n[0]==="-"?n.substring(1):n,O=(n,l)=>{n=K(n);const r=l.find(t=>t.id===n);if(r)return r},Se=(n,l,r)=>{l||(l={id:n.id}),l.id=n.id;const t=ae.TopPopupWorker.genElPopupOpener("div",l);return t.classList.add("top-tagSelector"),n.useTopButton&&t.classList.add("top-button","top-color_theme"),n.mode==="filter"&&t.classList.add("top-tagSelector-filter"),n.mode==="setter"&&!n.filters&&t.classList.add("top-tagSelector-setter_single"),n.mode==="setter"&&n.filters&&t.classList.add("top-tagSelector-setter_several"),t.onclick=d=>{d.preventDefault(),d.stopPropagation(),t.onclick=null;const o=e.ref(n.modelValue),a={model:o,mode:n.mode,targetId:n.targetId,filters:n.filters,payload:n.payload};_.storage(t,"topTagSelectorTarget",a),delete t.dataset.topPopupDisabled,e.isRef(n.modelValue)||e.watch(o,()=>{n.modelValue=o.value,D(t,n,r)}),t.click()},e.isRef(n.modelValue)?e.watch(n.modelValue,()=>D(t,n,r)):_.storage(t,"topTagSelectorRender",d=>{n.modelValue=d;const o=_.storage(t,"topTagSelectorTarget");o&&(o.model.value=d),D(t,n,r)}),D(t,n,r),t},Ie=(n,l)=>{var r;(r=_.storage(n,"topTagSelectorRender"))==null||r(l)},D=(n,l,r)=>{var d;const t=e.unref(l.modelValue);if(n.classList.toggle("top-tagSelector-selectedOne",!t.length||t.length===1),n.classList.toggle("top-tagSelector-toTwoLine",t.length>5),l.mode==="setter"&&l.filters){n.innerHTML=`<div>${r}</div>`;return}if(n.innerHTML="",!t.length&&l.mode==="filter"){const o=Z({id:"all",colorId:"",name:((d=x.useI18n().Common)==null?void 0:d.All_tags)??"",state:""});n.append(o)}t.forEach(o=>{var s,v;const a=Z({id:K(o),colorId:((s=O(o,l.tags))==null?void 0:s.color_id)??"",name:((v=O(o,l.tags))==null?void 0:v.name)??"",state:K(o)===o?"selected":"excluded"});n.append(a)})},Z=n=>{const l=document.createElement("div");return l.classList.add("top-tagSelector_tagIcon"),l.classList.toggle("top-tagSelector-active",!!n.state),l.classList.toggle("top-tagSelector-excluded",n.state==="excluded"),l.dataset.tag_id=n.id,l.dataset.tag_color_id=n.colorId,l.title=n.name,l},xe=[{id:"1",name:"Without Tag",color_id:"1"},{id:"2",name:"Red",color_id:"2"},{id:"3",name:"Orange",color_id:"3"},{id:"4",name:"Yellow",color_id:"4"},{id:"5",name:"Blue",color_id:"5"},{id:"6",name:"Purple",color_id:"6"},{id:"7",name:"Green",color_id:"7"},{id:"8",name:"Magenta",color_id:"8"},{id:"9",name:"Dark blue",color_id:"9"},{id:"10",name:"Turquoise",color_id:"10"}],Ce=["data-tag_id","data-tag_color_id","title"],F=e.defineComponent({__name:"tagIcon",props:{id:{},colorId:{},name:{},state:{}},setup(n){return(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({"top-tagSelector_tagIcon":!0,"top-tagSelector-active":!!l.state,"top-tagSelector-excluded":l.state==="excluded"}),"data-tag_id":l.id,"data-tag_color_id":l.colorId,title:l.name},null,10,Ce))}}),Be=["contenteditable","onKeydown"],ee=e.defineComponent({__name:"tagPopupListItem",props:e.mergeModels({editable:{type:Boolean},disabled:{type:Boolean},canExclude:{type:Boolean},id:{},colorId:{},name:{},state:{}},{name:{required:!0},nameModifiers:{}}),emits:e.mergeModels(["update:name","unselect","exclude","select"],["update:name"]),setup(n,{emit:l}){const r=n,t=l,d=e.useModel(n,"name"),o=e.ref(null),a=e.computed(()=>navigator.userAgent.indexOf("Firefox")!=-1?{contenteditable:s.value,onpaste:m=>m.preventDefault()}:{}),s=e.ref(!1),v=async()=>{var m;s.value=!0,await e.nextTick(),(m=o.value)==null||m.focus()},h=()=>{var c;const m=(c=o.value)==null?void 0:c.innerText;if(!m)return k();o.value&&(o.value.innerText=m),s.value=!1,t("update:name",m)},k=async()=>{o.value&&(o.value.innerText=r.name),s.value=!1},i=m=>{if(s.value||r.disabled)return;let c="selected";r.canExclude&&(m.ctrlKey||m.metaKey)&&(c="excluded"),r.state==c&&(c=""),c===""&&t("unselect"),c==="selected"&&t("select"),c==="excluded"&&t("exclude")};return(m,c)=>(e.openBlock(),e.createBlock(E._sfc_main$2,{class:e.normalizeClass({"top-tagSelector_tagListItem":!0,"top-tagSelector_tagListItem-inEdit":s.value,"top-tagSelector_tagListItem-disabled":m.disabled,"top-tagSelector_tagListItem-canExclude":m.canExclude,"top-tagSelector-active":!!m.state,"top-tagSelector-excluded":m.state==="excluded"}),onClick:e.withModifiers(i,["stop"])},{default:e.withCtx(()=>[e.createVNode(F,{id:m.id,name:d.value,colorId:m.colorId,state:m.state},null,8,["id","name","colorId","state"]),e.createElementVNode("span",e.mergeProps({ref_key:"elName",ref:o,class:"top-tagSelector_tagListItemName",contenteditable:s.value?"plaintext-only":!1},a.value,{onKeydown:[e.withKeys(e.withModifiers(h,["stop"]),["enter"]),e.withKeys(e.withModifiers(k,["stop"]),["esc"])]}),e.toDisplayString(d.value),17,Be),m.editable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("span",{key:1,"data-top-icon":"",class:"top-tagSelector_edit",onClick:e.withModifiers(h,["stop"])})):(e.openBlock(),e.createElementBlock("span",{key:0,"data-top-icon":"",class:"top-tagSelector_edit",onClick:v}))],64)):e.createCommentVNode("",!0)]),_:1},8,["class"]))}}),Ve={key:1},te=e.defineComponent({inheritAttrs:!1,__name:"popupOpener",props:e.mergeModels({modelValue:{},id:{},tags:{},mode:{},targetId:{},filters:{},useTopButton:{type:Boolean},payload:{},styling:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const l=n,r=e.useModel(n,"modelValue"),t=l.useTopButton?x._sfc_main$1:"div",d=l.useTopButton?"html":"default",o={model:r,mode:l.mode,targetId:l.targetId,filters:l.filters,payload:l.payload};return(a,s)=>{const v=e.resolveDirective("top-data");return e.openBlock(),e.createBlock(E._sfc_main$1,{id:a.id},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(t)),e.mergeProps({class:{"top-tagSelector":!0,"top-tagSelector-filter":l.mode==="filter","top-tagSelector-setter_single":l.mode==="setter"&&!a.filters,"top-tagSelector-setter_several":l.mode==="setter"&&a.filters,"top-tagSelector-selectedOne":!r.value.length||r.value.length===1,"top-tagSelector-toTwoLine":r.value.length>5},color:"theme",styling:a.styling},a.$attrs),{[e.unref(d)]:e.withCtx(()=>[!r.value.length&&a.mode==="filter"?(e.openBlock(),e.createBlock(F,{key:0,id:"all",colorId:"",name:a.$i18n.Common.All_tags??"",state:""},null,8,["name"])):e.createCommentVNode("",!0),a.mode==="setter"&&a.filters?(e.openBlock(),e.createElementBlock("div",Ve,[e.renderSlot(a.$slots,"default")])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(r.value,h=>{var k,i;return e.openBlock(),e.createBlock(F,{id:e.unref(K)(h),colorId:((k=e.unref(O)(h,a.tags))==null?void 0:k.color_id)??"",name:((i=e.unref(O)(h,a.tags))==null?void 0:i.name)??"",state:e.unref(K)(h)===h?"selected":"excluded"},null,8,["id","colorId","name","state"])}),256))]),_:2},1040,["class","styling"])),[[v,o,"topTagSelectorTarget"]])]),_:3},8,["id"])}}}),Te=e.defineComponent({__name:"tagSelector",props:e.mergeModels({modelValue:{},tags:{},tagsEditable:{type:Boolean},tagsMax:{default:10},id:{},singleMode:{type:Boolean},requiredForSetter:{type:Boolean,default:!0},maxTagsForSetter:{},emitDelay:{default:500},styling:{}},{modelValue:{required:!0},modelModifiers:{},tags:{default:e.reactive(xe)},tagsModifiers:{}}),emits:e.mergeModels(["selector","setter","tagsChanged"],["update:modelValue","update:tags"]),setup(n,{emit:l}){const r=x.useI18n(),t=n,d=e.useModel(n,"modelValue"),o=e.useModel(n,"tags"),a=l,s=x.debounce((u,g)=>{a(u,g)},t.emitDelay);t.singleMode&&!d.value.length&&(d.value=[o.value[0].id]);const v=t.id??"top-popup-id-"+Math.random(),h=e.ref("add"),k=()=>{var y;const u=" "+((y=r.Common.Tags)==null?void 0:y.toLowerCase()),g=new Map;return g.set("add",{value:"add",title:r.Common.Add+u}),g.set("replace",{value:"replace",title:r.Common.Replace+u}),g.set("delete",{value:"delete",title:r.Common.Delete+u}),g};let i=e.shallowRef({model:d,mode:"filter",targetId:void 0,filters:void 0,payload:void 0});e.watch(d,()=>{s("selector",d.value)});const m=e.computed(()=>{if(i.value.mode==="setter"&&t.maxTagsForSetter&&!i.value.filters)return i.value.model.value.length>=t.maxTagsForSetter}),c=u=>{if(u!=="all"){if(i.value.model.value.includes(u))return"selected";if(i.value.model.value.includes(X(u)))return"excluded"}return u==="all"&&!i.value.model.value.length?"selected":""},I=(u,g)=>{const y=X(u);let S=i.value.model.value.filter(M=>M!==u&&M!==y);g==="select"&&S.push(u),g==="exclude"&&S.push(y),i.value.mode==="setter"&&i.value.targetId!==void 0&&t.requiredForSetter&&(S.length||S.push("1"),S.length===2&&i.value.model.value.length===1&&i.value.model.value[0]==="1"&&(S=S.filter(M=>M!=="1"))),t.singleMode&&!i.value.filters&&(S.length||(S=i.value.model.value),S.length>1&&(S=[S[S.length-1]])),S.sort((M,N)=>{if(!t.tags)return 0;const q=t.tags.findIndex(b=>b.id===M),L=t.tags.findIndex(b=>b.id===N);return q-L}),i.value.model.value=S,i.value.mode==="setter"&&i.value.targetId!==void 0&&s("setter",{tagsIds:S,targetId:i.value.targetId,payload:i.value.payload})},B=e.computed(()=>{let u="top-tagSelector_popup";return i.value.mode==="filter"&&(u+=" top-tagSelector_popup-filter"),i.value.mode==="setter"&&(u+=" top-tagSelector_popup-setter"),u}),C=()=>{const u=prompt("","New tag");if(!u||u==="New tag")return;const g=o.value.length+1;o.value.push({id:String(g),name:u,color_id:String((g-1)%10+1)}),a("tagsChanged",o.value)},T=u=>{var g;if(i.value=_.storage(u.elPopupOpener,"topTagSelectorTarget"),!i.value)throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");if(i.value.filters&&(h.value="add",i.value.model.value=[]),!((g=x.Core.$)!=null&&g.ui.sortable)){console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");return}!x.Core.state.isMobile&&!x.Core.state.isMobileUA&&o.value&&$(u.elPopup).sortable({items:'li:has([data-tag_id]:not([data-tag_id="all"]))',cancel:'[contenteditable="plaintext-only"], [contenteditable="true"]',distance:10,stop:function(y,S){if(!o.value)return;const M=$(S.item).parent().find("[data-tag_id]"),N=[];M.each((q,L)=>{if(!o.value)return;const b=$(L).attr("data-tag_id");N.push(b)}),o.value.sort((q,L)=>{const b=N.findIndex(j=>j===q.id),we=N.findIndex(j=>j===L.id);return b-we}),s("tagsChanged",o.value)}})},f=u=>{var g;(g=x.Core.$)!=null&&g.ui.sortable&&$(u.elPopup).data("ui-sortable")&&$(u.elPopup).sortable("destroy")};return(u,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(te,{class:"top-as-selector",modelValue:d.value,"onUpdate:modelValue":g[0]||(g[0]=y=>d.value=y),id:e.unref(v),tags:o.value,styling:u.styling,mode:"filter",useTopButton:""},null,8,["modelValue","id","tags","styling"]),e.createVNode(E._sfc_main,{id:e.unref(v),class:e.normalizeClass(B.value),onOpen:g[4]||(g[4]=y=>T(y)),onClose:g[5]||(g[5]=y=>f(y)),"transition-duration":50},e.createSlots({contentList:e.withCtx(()=>[e.unref(i).mode==="filter"&&!u.singleMode?(e.openBlock(),e.createBlock(ee,{key:0,id:"all",colorId:"",name:u.$i18n.Common.All_tags??"",state:e.unref(i).model.value.length?"":"selected",onSelect:g[3]||(g[3]=y=>e.unref(i).model.value=[])},null,8,["name","state"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,y=>(e.openBlock(),e.createBlock(ee,{key:y.id,id:y.id,colorId:y.color_id,name:y.name,state:c(y.id),canExclude:e.unref(i).mode==="filter"&&!u.singleMode,editable:u.tagsEditable,disabled:m.value&&c(y.id)==="",onUnselect:S=>I(y.id,"unselect"),onSelect:S=>I(y.id,"select"),onExclude:S=>I(y.id,"exclude"),"onUpdate:name":S=>{y.name=S,e.unref(s)("tagsChanged",o.value)}},null,8,["id","colorId","name","state","canExclude","editable","disabled","onUnselect","onSelect","onExclude","onUpdate:name"]))),128)),u.tagsEditable&&o.value.length<u.tagsMax&&o.value.length<20?(e.openBlock(),e.createBlock(E._sfc_main$2,{key:1,"data-top-icon":"",onClick:e.withModifiers(C,["stop"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.$i18n.Common.Add),1)]),_:1})):e.createCommentVNode("",!0)]),_:2},[e.unref(i).mode==="setter"&&e.unref(i).filters?{name:"header",fn:e.withCtx(()=>[e.createVNode(x._sfc_main$9,{modelValue:h.value,"onUpdate:modelValue":g[1]||(g[1]=y=>h.value=y),options:k()},null,8,["modelValue","options"])]),key:"0"}:void 0,e.unref(i).mode==="setter"&&e.unref(i).filters?{name:"footer",fn:e.withCtx(()=>[e.createVNode(x._sfc_main$1,{color:"theme"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.$i18n.Common.Cancel),1)]),_:1}),e.createVNode(x._sfc_main$1,{onClick:g[2]||(g[2]=y=>e.unref(s)("setter",{tagsIds:e.unref(i).model.value,filters:e.unref(i).filters,filtersAction:h.value,payload:e.unref(i).payload}))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.value==="add"?u.$i18n.Common.Add:"")+" "+e.toDisplayString(h.value==="replace"?u.$i18n.Common.Replace:"")+" "+e.toDisplayString(h.value==="delete"?u.$i18n.Common.Remove:""),1)]),_:1})]),key:"1"}:void 0]),1032,["id","class"])],64))}});V.TopSelectorCompetitors=de,V.TopSelectorRegion=ke,V.TopTagSelector=Te,V.TopTagSelectorPopupOpener=te,V.TopTagSelectorTagIcon=F,V.dialogSelectorRegions=Q,V.findRegion=H,V.genElTopTagSelectorPopupOpener=Se,V.genSearcherByKey=z,V.renderElTopTagSelectorPopupOpener=Ie,V.useItemsFromCompetitors=ue,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
define(["require","exports","vue","../.chunks/forms-BfDSGwrU.amd","../.chunks/listItem.vue_vue_type_script_setup_true_lang-R7J0Cawj.amd","../.chunks/menu.vue_vue_type_style_index_0_lang-JZ-QwyLO.amd","../.chunks/utils-DKqoxjzs.amd","../utils/searchers.amd","../utils/dom.amd","../popup/worker.amd","../require/css.amd!../assets/project.css"],(function(ne,V,e,x,E,oe,le,P,_,ae){"use strict";if(typeof e>"u")var e=window.Vue;const re={class:"top-selectorCompetitors"},ie={class:"top-ellipsis1"},de=e.defineComponent({__name:"selectorCompetitors",props:e.mergeModels({modelValue:{},items:{},showSelectAllItem:{type:Boolean,default:!0}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const l=n,r=e.useModel(n,"modelValue"),t=e.computed(()=>{if(l.showSelectAllItem)return{icon:"",title:x.useI18n().Common.Select_all,value:"all",content:""}});return(d,o)=>(e.openBlock(),e.createElementBlock("div",re,[e.unref(x.Core).state.isMobile?(e.openBlock(),e.createBlock(E._sfc_main,{key:0},{opener:e.withCtx(()=>[e.createVNode(x._sfc_main$1,{class:"top-selectorCompetitors_opener",color:"theme",icon:"",icon2:""},{default:e.withCtx(()=>{var a;return[e.createTextVNode(e.toDisplayString((a=d.items.find(s=>{var v;return s.value===((v=r.value)==null?void 0:v[0])}))==null?void 0:a.content),1)]}),_:1})]),contentList:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.items,a=>{var s;return e.openBlock(),e.createBlock(E._sfc_main$2,{class:e.normalizeClass({"top-active":(s=r.value)==null?void 0:s.includes(a.value)}),"data-top-icon":a.icon,title:a.title,onClick:()=>r.value=[a.value]},{default:e.withCtx(()=>[e.createElementVNode("span",ie,e.toDisplayString(a.content),1)]),_:2},1032,["class","data-top-icon","title","onClick"])}),256))]),_:1})):(e.openBlock(),e.createBlock(oe._sfc_main,{key:1,modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=a=>r.value=a),items:d.items,isMultiple:!0,styling:"bar",canBeEmptyMultiple:!1,selectAllItem:t.value},null,8,["modelValue","items","selectAllItem"]))]))}}),ue=(n,l)=>e.computed(()=>e.toValue(n).filter(d=>d.on>=0||d.id===l).map(d=>({value:d.id,title:d.url+` [${d.id}]`,icon:d.id===e.toValue(l)?"":"",content:d.name}))),w=-1,p=-2,R=-1,se={0:"Yandex",1:"Google",4:"YouTube",5:"Bing",7:"Seznam",8:"AppStore",9:"GoogleStore",20:"Yandex.com",21:"Yandex.com.tr"},J={key:p,name:"--",index:p},G={key:p,name:"--",regions:[J],regionByIndex:new Map([[p,J]])},A={key:p,name:"Autoselect",index:p},U={key:p,name:"Autoselect",regions:[A],regionByIndex:new Map([[p,A]])},Y={countryCode:"00",depth:1,device:0,key:R,index:R,lang:"ru",name:"Without region"},ce=()=>(A.name=x.useI18n().Common.Autoselect,A),ge=()=>(ce(),U.name=x.useI18n().Common.Autoselect,console.log(U),U),me=()=>(Y.name=x.useI18n().Keywords.Without_region,Y),z=(n=!1,l=!1,r=[])=>{let t;return n?t=fe(r):t=W(r),l&&t.set(p,ge()),t.size||t.set(p,G),t},W=(n,l=!0,r=[],t=!1)=>{const d=new Map;return n.forEach(o=>{if(!o.enabled||t&&typeof o.key=="number"&&o.key>1)return;const a={...o};a.regionByIndex=new Map,o.regions&&o.regions.forEach(s=>{if(l&&!s.enabled)return;const v={...s};a.regionByIndex.set(v.index,v)}),!a.regionByIndex.size&&r.length,(!o.regions||a.regionByIndex.size||r.length)&&typeof a.key=="number"&&d.set(a.key,a)}),r.forEach(o=>{if(d.has(o))return;const a={key:o,name:se[o],regions:[],regionByIndex:new Map};d.set(a.key,a)}),d},fe=n=>{const l=W(n,!1,[0,1],!0);if(l.has(2)){const r=l.get(2);r&&(r.regionByIndex=new Map)}return l.forEach(r=>{if(!r.regionByIndex)return;const t={...me()};r.regionByIndex.set(t.index,t)}),l},H=(n,l,r=[])=>{const t=z(n,!1,r);let d;return t.forEach(o=>{if(!(l.searcher_key!==void 0&&l.searcher_key!=o.key)&&o.regions&&(o.regions.forEach(a=>{if(!d&&!(l.key!==void 0&&l.key!=a.key)&&!(l.index!==void 0&&l.index!=a.index)&&!(!n&&(l.lang!==void 0&&l.lang!=a.lang||l.device!==void 0&&l.device!=a.device)))return a.searcher_key=o.key,d=a,!1}),d))return!1}),d},Q=le.useAsyncTopDialog(()=>new Promise((n,l)=>ne(["../.chunks/dialog_selectorRegions-DagqS_0A.amd"],n,l))),ve=(n,l)=>{const r=x.useI18n(),t=e.ref(l.value.keys().next().value??p),d=e.computed(()=>{const o=new Map;if(l.value.forEach(a=>{let s={value:a.key,title:a.name};n.addSearcherIcon&&(s.icon=P.getSearcherGIcon(a.key)),o.set(a.key,s)}),n.addCompare&&!o.has(p)){const a={value:"",title:"--------------------",disabled:!0};o.set(a.value,a);const s={value:w,title:r.Common.Compare};o.set(s.value,s)}return o});return{searcherKey:t,optionBySearcherKey:d}},ye=(n,l)=>{var o,a,s;const r=x.useI18n(),t=e.ref(p);n.modelValue.length===1&&(t.value=n.modelValue[0]),t.value===p&&(n.forFrequency?t.value=((a=(o=l.value)==null?void 0:o.regionByIndex.values().next().value)==null?void 0:a.key)??p:t.value=((s=l.value)==null?void 0:s.regionByIndex.keys().next().value)??p);const d=e.computed(()=>{var h;const v=new Map;return(h=l.value.regionByIndex)==null||h.forEach(k=>{let i=k.name;if(n.forFrequency){const I={value:k.key,title:i};v.has(k.key)||v.set(k.key,I);return}k.device&&(i+=" ("+r.Common["Device_"+k.device]+")");const m=P.getLangLabel(l.value.key||0,k.lang??"");m&&(i+=" / "+m);const c={value:k.index,title:i,icon:k.device?P.getDeviceGIcon(k.device):void 0};v.set(k.index,c)}),v});return e.watch(d,(v,h)=>{var c;if(n.onlySearcher||t.value!==void 0&&v.get(t.value))return;let k=v.keys().next().value;if(t.value===p||k===p){t.value=k;return}let i=((c=h==null?void 0:h.get(t.value))==null?void 0:c.title)||"",m=-1;for(const[I,B]of v.entries()){const C=B.title;if(typeof C!="string"||typeof I=="string")break;if(C===i){k=I;break}const T=new RegExp(` \\((${r.Common.Device_1}|${r.Common.Device_2})\\)`);let f=i,u=3;C.indexOf(f)===-1&&(f=i.replace(/^[^a-zа-я]/i,"").replace(T,""),u--),C.indexOf(f)===-1&&(f=i.replace(/ \/.*/,""),u--),C.indexOf(f)===-1&&(f=i.replace(/ \/.*/,""),f=f.replace(/^[^a-zа-я]/i,"").replace(T,""),u--),C.indexOf(f)!==-1&&(u<=m||(m=u,k=I))}t.value=k}),{regionIndex:t,optionByRegionIndex:d}},pe=(n,l,r)=>{const t=e.ref([]),d=()=>{if(n.onlySearcher&&l.value){t.value=Array.from(l.value.keys());return}let a=[];if(n.modelValue.length>1)a=[...n.modelValue];else try{a=JSON.parse(localStorage.getItem("ui:project:regionSelector"+n.projectId+":regionsIndexes"))??[]}catch{}a.length&&(a=a.filter(s=>r.value.has(s))),a.length||(a=Array.from(r.value)),t.value=[...a]},o=()=>{t.value.length?localStorage.setItem("ui:project:regionSelector:"+n.projectId+":regionsIndexes",JSON.stringify(t.value)):localStorage.removeItem("ui:project:regionSelector:"+n.projectId+":regionsIndexes")};return e.watch(t,()=>{o()}),n.addCompare&&d(),{regionsIndexes:t}},he=n=>{const l=e.computed(()=>z(n.forFrequency,n.autoRegion,n.searchers)),r=e.computed(()=>l.value.get(d.searcherKey.value)||G),t=e.computed(()=>{const i=new Set;return l.value.forEach(m=>{m.regionByIndex.forEach(c=>{c.index!==R&&c.index!==p&&i.add(c.index)})}),i}),d=ve(n,l),o=ye(n,r),a=pe(n,l,t);e.watch(l,()=>{var m,c,I,B;if(n.onlySearcher?a.regionsIndexes.value=Array.from(l.value.keys()):a.regionsIndexes.value=a.regionsIndexes.value.filter(C=>t.value.has(C)),d.searcherKey.value===w)return;let i=l.value.keys().next().value;l.value.forEach(C=>{var T,f,u;if(n.onlySearcher&&C.key===d.searcherKey.value){i=d.searcherKey.value;return}if(o.regionIndex.value&&((T=C.regionByIndex)!=null&&T.has(o.regionIndex.value))&&(i=C.key),!n.onlySearcher){let g;i!==void 0&&(g=(f=l.value.get(i))==null?void 0:f.regionByIndex);const y=(u=l.value.get(C.key))==null?void 0:u.regionByIndex;g!=null&&g.has(p)&&!(y!=null&&y.has(p))&&(i=C.key)}}),i!==void 0&&(d.searcherKey.value=i),o.regionIndex.value!==void 0&&!((c=(m=r.value)==null?void 0:m.regionByIndex)!=null&&c.has(o.regionIndex.value))&&(o.regionIndex.value=(B=(I=r.value)==null?void 0:I.regions)==null?void 0:B.keys().next().value)},{immediate:!0});const s=()=>{if(!(d.searcherKey.value===w||d.searcherKey.value===p))return d.searcherKey.value},v=()=>{if(n.onlySearcher||o.regionIndex.value===p)return;let i=o.regionIndex.value;if(n.forFrequency){const m=o.regionIndex.value,c=H(n.forFrequency,{searcher_key:s(),key:m},n.searchers);i=c==null?void 0:c.index}return i},h=()=>{const i=s();if(i!==void 0)return l.value.get(i)};return{selectSearcher:d,selectRegion:o,compare:a,searcherByKey:l,allRegionsIndexes:t,getSearcher:h,getRegion:()=>{var m,c;const i=v();if(i!==void 0)return(c=(m=h())==null?void 0:m.regionByIndex)==null?void 0:c.get(i)}}},ke=e.defineComponent({__name:"selectorRegion",props:e.mergeModels({projectId:{},searchers:{default:()=>[]},modelValue:{},modelValueSingle:{},addCompare:{type:Boolean},forFrequency:{type:Boolean},autoRegion:{type:Boolean},onlySearcher:{type:Boolean},addChanger:{type:Boolean,default:!0},addSearcherIcon:{type:Boolean,default:!0},addRegionIcon:{type:Boolean,default:!0}},{modelValue:{required:!0},modelModifiers:{},modelValueSingle:{},modelValueSingleModifiers:{}}),emits:["update:modelValue","update:modelValueSingle"],setup(n,{expose:l}){const r=n,t=e.useModel(n,"modelValue"),d=e.useModel(n,"modelValueSingle"),{selectSearcher:o,selectRegion:a,compare:s,searcherByKey:v,allRegionsIndexes:h,getSearcher:k,getRegion:i}=he(r),m=()=>{const c=[];v.value.forEach(I=>{I.enabled&&I.regions.forEach(B=>{B.enabled&&c.push(B)})}),Q.open("selectorRegions",{regions:c,regionsIndexes:s.regionsIndexes.value,"@update:regionsIndexes":I=>s.regionsIndexes.value=I})};return e.watch([a.regionIndex,o.searcherKey,s.regionsIndexes],()=>{if(o.searcherKey.value===w&&s.regionsIndexes.value.length){if(JSON.stringify(t.value)===JSON.stringify(s.regionsIndexes.value))return;t.value=[...s.regionsIndexes.value]}else r.onlySearcher?(t.value=[o.searcherKey.value],o.searcherKey.value===p&&!r.autoRegion&&(t.value.length=0)):(t.value=[a.regionIndex.value],a.regionIndex.value===p&&!r.autoRegion&&(t.value.length=0));!r.onlySearcher&&!h.value.size&&(o.searcherKey.value=p)}),d.value&&e.watch(d,()=>{d.value&&(t.value=[d.value])},{immediate:!0}),e.watch(t,()=>{var c,I,B,C,T;if(t.value[0]&&(d.value=t.value[0]),r.onlySearcher){if(!t.value.length||t.value.length===1&&!v.value.has(t.value[0])||t.value.length===1&&t.value[0]===p&&!r.autoRegion){let f=v.value.keys().next().value;f===p&&!r.autoRegion&&(f=void 0,d.value=p),f!==void 0?t.value=[f]:t.value.length=0;return}if(t.value.length>1&&JSON.stringify(t.value)!==JSON.stringify(s.regionsIndexes.value)){t.value=[...s.regionsIndexes.value];return}}else{let f=[...new Set(t.value)],u=(I=(c=v.value.values().next().value)==null?void 0:c.regionByIndex)==null?void 0:I.keys().next().value;if(r.forFrequency&&(u=(T=(C=(B=v.value.values().next().value)==null?void 0:B.regionByIndex)==null?void 0:C.values().next().value)==null?void 0:T.key),u===p&&!r.autoRegion&&(u=void 0,d.value=p),!f.length)u!==void 0&&f.push(u);else if(f.length===1){let g=h.value;r.forFrequency&&(g=new Set,v.value.forEach(y=>{y.regionByIndex.forEach(S=>{S.index!==R&&S.index!==p&&g.add(S.key)})})),g.has(f[0])||(f=[],u!==void 0&&f.push(u))}else f=f.filter(g=>h.value.has(g)),!f.length&&u!==void 0&&f.push(u);if(JSON.stringify(t.value)!==JSON.stringify(f)){t.value=f;return}}if(!(t.value.length===1&&t.value[0]===(r.onlySearcher?o.searcherKey.value:a.regionIndex.value)))if(r.onlySearcher){if(t.value.length===1){o.searcherKey.value=t.value[0];return}o.searcherKey.value=w;return}else{if(!t.value.length)return;if(t.value.length===1&&o.searcherKey.value!==w){a.regionIndex.value=t.value[0];let f;for(const u of v.value.values()){for(const g of u.regionByIndex.values())if((r.forFrequency?g.key:g.index)===a.regionIndex.value){f=u.key;break}if(f!==void 0)break}f!==void 0&&(o.searcherKey.value=f)}else o.searcherKey.value=w,s.regionsIndexes.value=[...t.value]}},{immediate:!0}),l({getSearcher:k,getRegion:i}),(c,I)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({"top-selectorRegion":!0,"top-selectorRegion-onlySearcher":c.onlySearcher})},[e.createVNode(x._sfc_main$9,{options:e.unref(o).optionBySearcherKey.value,modelValue:e.unref(o).searcherKey.value,"onUpdate:modelValue":I[0]||(I[0]=B=>e.unref(o).searcherKey.value=B),name:"searcher_key",addChanger:c.addChanger},null,8,["options","modelValue","addChanger"]),!c.onlySearcher&&e.unref(o).searcherKey.value!==e.unref(w)?(e.openBlock(),e.createBlock(x._sfc_main$9,{key:0,class:"top-select-region",options:e.unref(a).optionByRegionIndex.value,modelValue:e.unref(a).regionIndex.value,"onUpdate:modelValue":I[1]||(I[1]=B=>e.unref(a).regionIndex.value=B),name:c.forFrequency?"region_key":"region_index",addChanger:c.addChanger,"data-top-icon":c.addRegionIcon?"":void 0},null,8,["options","modelValue","name","addChanger","data-top-icon"])):e.createCommentVNode("",!0),c.addCompare&&!c.onlySearcher&&e.unref(o).searcherKey.value===e.unref(w)?(e.openBlock(),e.createBlock(x._sfc_main$1,{key:1,name:"compare",onClick:m,"data-count-compare-regions-indexes":e.unref(s).regionsIndexes.value.length},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.$i18n.Common.Selected_regions),1)]),_:1},8,["data-count-compare-regions-indexes"])):e.createCommentVNode("",!0)],2))}}),X=n=>"-"+n,K=n=>n[0]==="-"?n.substring(1):n,O=(n,l)=>{n=K(n);const r=l.find(t=>t.id===n);if(r)return r},Se=(n,l,r)=>{l||(l={id:n.id}),l.id=n.id;const t=ae.TopPopupWorker.genElPopupOpener("div",l);return t.classList.add("top-tagSelector"),n.useTopButton&&t.classList.add("top-button","top-color_theme"),n.mode==="filter"&&t.classList.add("top-tagSelector-filter"),n.mode==="setter"&&!n.filters&&t.classList.add("top-tagSelector-setter_single"),n.mode==="setter"&&n.filters&&t.classList.add("top-tagSelector-setter_several"),t.onclick=d=>{d.preventDefault(),d.stopPropagation(),t.onclick=null;const o=e.ref(n.modelValue),a={model:o,mode:n.mode,targetId:n.targetId,filters:n.filters,payload:n.payload};_.storage(t,"topTagSelectorTarget",a),delete t.dataset.topPopupDisabled,e.isRef(n.modelValue)||e.watch(o,()=>{n.modelValue=o.value,D(t,n,r)}),t.click()},e.isRef(n.modelValue)?e.watch(n.modelValue,()=>D(t,n,r)):_.storage(t,"topTagSelectorRender",d=>{n.modelValue=d;const o=_.storage(t,"topTagSelectorTarget");o&&(o.model.value=d),D(t,n,r)}),D(t,n,r),t},Ie=(n,l)=>{var r;(r=_.storage(n,"topTagSelectorRender"))==null||r(l)},D=(n,l,r)=>{var d;const t=e.unref(l.modelValue);if(n.classList.toggle("top-tagSelector-selectedOne",!t.length||t.length===1),n.classList.toggle("top-tagSelector-toTwoLine",t.length>5),l.mode==="setter"&&l.filters){n.innerHTML=`<div>${r}</div>`;return}if(n.innerHTML="",!t.length&&l.mode==="filter"){const o=Z({id:"all",colorId:"",name:((d=x.useI18n().Common)==null?void 0:d.All_tags)??"",state:""});n.append(o)}t.forEach(o=>{var s,v;const a=Z({id:K(o),colorId:((s=O(o,l.tags))==null?void 0:s.color_id)??"",name:((v=O(o,l.tags))==null?void 0:v.name)??"",state:K(o)===o?"selected":"excluded"});n.append(a)})},Z=n=>{const l=document.createElement("div");return l.classList.add("top-tagSelector_tagIcon"),l.classList.toggle("top-tagSelector-active",!!n.state),l.classList.toggle("top-tagSelector-excluded",n.state==="excluded"),l.dataset.tag_id=n.id,l.dataset.tag_color_id=n.colorId,l.title=n.name,l},xe=[{id:"1",name:"Without Tag",color_id:"1"},{id:"2",name:"Red",color_id:"2"},{id:"3",name:"Orange",color_id:"3"},{id:"4",name:"Yellow",color_id:"4"},{id:"5",name:"Blue",color_id:"5"},{id:"6",name:"Purple",color_id:"6"},{id:"7",name:"Green",color_id:"7"},{id:"8",name:"Magenta",color_id:"8"},{id:"9",name:"Dark blue",color_id:"9"},{id:"10",name:"Turquoise",color_id:"10"}],Ce=["data-tag_id","data-tag_color_id","title"],F=e.defineComponent({__name:"tagIcon",props:{id:{},colorId:{},name:{},state:{}},setup(n){return(l,r)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({"top-tagSelector_tagIcon":!0,"top-tagSelector-active":!!l.state,"top-tagSelector-excluded":l.state==="excluded"}),"data-tag_id":l.id,"data-tag_color_id":l.colorId,title:l.name},null,10,Ce))}}),Be=["contenteditable","onKeydown"],ee=e.defineComponent({__name:"tagPopupListItem",props:e.mergeModels({editable:{type:Boolean},disabled:{type:Boolean},canExclude:{type:Boolean},id:{},colorId:{},name:{},state:{}},{name:{required:!0},nameModifiers:{}}),emits:e.mergeModels(["update:name","unselect","exclude","select"],["update:name"]),setup(n,{emit:l}){const r=n,t=l,d=e.useModel(n,"name"),o=e.ref(null),a=e.computed(()=>navigator.userAgent.indexOf("Firefox")!=-1?{contenteditable:s.value,onpaste:m=>m.preventDefault()}:{}),s=e.ref(!1),v=async()=>{var m;s.value=!0,await e.nextTick(),(m=o.value)==null||m.focus()},h=()=>{var c;const m=(c=o.value)==null?void 0:c.innerText;if(!m)return k();o.value&&(o.value.innerText=m),s.value=!1,t("update:name",m)},k=async()=>{o.value&&(o.value.innerText=r.name),s.value=!1},i=m=>{if(s.value||r.disabled)return;let c="selected";r.canExclude&&(m.ctrlKey||m.metaKey)&&(c="excluded"),r.state==c&&(c=""),c===""&&t("unselect"),c==="selected"&&t("select"),c==="excluded"&&t("exclude")};return(m,c)=>(e.openBlock(),e.createBlock(E._sfc_main$2,{class:e.normalizeClass({"top-tagSelector_tagListItem":!0,"top-tagSelector_tagListItem-inEdit":s.value,"top-tagSelector_tagListItem-disabled":m.disabled,"top-tagSelector_tagListItem-canExclude":m.canExclude,"top-tagSelector-active":!!m.state,"top-tagSelector-excluded":m.state==="excluded"}),onClick:e.withModifiers(i,["stop"])},{default:e.withCtx(()=>[e.createVNode(F,{id:m.id,name:d.value,colorId:m.colorId,state:m.state},null,8,["id","name","colorId","state"]),e.createElementVNode("span",e.mergeProps({ref_key:"elName",ref:o,class:"top-tagSelector_tagListItemName",contenteditable:s.value?"plaintext-only":!1},a.value,{onKeydown:[e.withKeys(e.withModifiers(h,["stop"]),["enter"]),e.withKeys(e.withModifiers(k,["stop"]),["esc"])]}),e.toDisplayString(d.value),17,Be),m.editable?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[s.value?(e.openBlock(),e.createElementBlock("span",{key:1,"data-top-icon":"",class:"top-tagSelector_edit",onClick:e.withModifiers(h,["stop"])})):(e.openBlock(),e.createElementBlock("span",{key:0,"data-top-icon":"",class:"top-tagSelector_edit",onClick:v}))],64)):e.createCommentVNode("",!0)]),_:1},8,["class"]))}}),Ve={key:1},te=e.defineComponent({inheritAttrs:!1,__name:"popupOpener",props:e.mergeModels({modelValue:{},id:{},tags:{},mode:{},targetId:{},filters:{},useTopButton:{type:Boolean},payload:{},styling:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const l=n,r=e.useModel(n,"modelValue"),t=l.useTopButton?x._sfc_main$1:"div",d=l.useTopButton?"html":"default",o={model:r,mode:l.mode,targetId:l.targetId,filters:l.filters,payload:l.payload};return(a,s)=>{const v=e.resolveDirective("top-data");return e.openBlock(),e.createBlock(E._sfc_main$1,{id:a.id},{default:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(t)),e.mergeProps({class:{"top-tagSelector":!0,"top-tagSelector-filter":l.mode==="filter","top-tagSelector-setter_single":l.mode==="setter"&&!a.filters,"top-tagSelector-setter_several":l.mode==="setter"&&a.filters,"top-tagSelector-selectedOne":!r.value.length||r.value.length===1,"top-tagSelector-toTwoLine":r.value.length>5},color:"theme",styling:a.styling},a.$attrs),{[e.unref(d)]:e.withCtx(()=>[!r.value.length&&a.mode==="filter"?(e.openBlock(),e.createBlock(F,{key:0,id:"all",colorId:"",name:a.$i18n.Common.All_tags??"",state:""},null,8,["name"])):e.createCommentVNode("",!0),a.mode==="setter"&&a.filters?(e.openBlock(),e.createElementBlock("div",Ve,[e.renderSlot(a.$slots,"default")])):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:2},e.renderList(r.value,h=>{var k,i;return e.openBlock(),e.createBlock(F,{id:e.unref(K)(h),colorId:((k=e.unref(O)(h,a.tags))==null?void 0:k.color_id)??"",name:((i=e.unref(O)(h,a.tags))==null?void 0:i.name)??"",state:e.unref(K)(h)===h?"selected":"excluded"},null,8,["id","colorId","name","state"])}),256))]),_:2},1040,["class","styling"])),[[v,o,"topTagSelectorTarget"]])]),_:3},8,["id"])}}}),Te=e.defineComponent({__name:"tagSelector",props:e.mergeModels({modelValue:{},tags:{},tagsEditable:{type:Boolean},tagsMax:{default:10},id:{},singleMode:{type:Boolean},requiredForSetter:{type:Boolean,default:!0},maxTagsForSetter:{},emitDelay:{default:500},styling:{}},{modelValue:{required:!0},modelModifiers:{},tags:{default:e.reactive(xe)},tagsModifiers:{}}),emits:e.mergeModels(["selector","setter","tagsChanged"],["update:modelValue","update:tags"]),setup(n,{emit:l}){const r=x.useI18n(),t=n,d=e.useModel(n,"modelValue"),o=e.useModel(n,"tags"),a=l,s=x.debounce((u,g)=>{a(u,g)},t.emitDelay);t.singleMode&&!d.value.length&&(d.value=[o.value[0].id]);const v=t.id??"top-popup-id-"+Math.random(),h=e.ref("add"),k=()=>{var y;const u=" "+((y=r.Common.Tags)==null?void 0:y.toLowerCase()),g=new Map;return g.set("add",{value:"add",title:r.Common.Add+u}),g.set("replace",{value:"replace",title:r.Common.Replace+u}),g.set("delete",{value:"delete",title:r.Common.Delete+u}),g};let i=e.shallowRef({model:d,mode:"filter",targetId:void 0,filters:void 0,payload:void 0});e.watch(d,()=>{s("selector",d.value)});const m=e.computed(()=>{if(i.value.mode==="setter"&&t.maxTagsForSetter&&!i.value.filters)return i.value.model.value.length>=t.maxTagsForSetter}),c=u=>{if(u!=="all"){if(i.value.model.value.includes(u))return"selected";if(i.value.model.value.includes(X(u)))return"excluded"}return u==="all"&&!i.value.model.value.length?"selected":""},I=(u,g)=>{const y=X(u);let S=i.value.model.value.filter(M=>M!==u&&M!==y);g==="select"&&S.push(u),g==="exclude"&&S.push(y),i.value.mode==="setter"&&i.value.targetId!==void 0&&t.requiredForSetter&&(S.length||S.push("1"),S.length===2&&i.value.model.value.length===1&&i.value.model.value[0]==="1"&&(S=S.filter(M=>M!=="1"))),t.singleMode&&!i.value.filters&&(S.length||(S=i.value.model.value),S.length>1&&(S=[S[S.length-1]])),S.sort((M,N)=>{if(!t.tags)return 0;const q=t.tags.findIndex(b=>b.id===M),L=t.tags.findIndex(b=>b.id===N);return q-L}),i.value.model.value=S,i.value.mode==="setter"&&i.value.targetId!==void 0&&s("setter",{tagsIds:S,targetId:i.value.targetId,payload:i.value.payload})},B=e.computed(()=>{let u="top-tagSelector_popup";return i.value.mode==="filter"&&(u+=" top-tagSelector_popup-filter"),i.value.mode==="setter"&&(u+=" top-tagSelector_popup-setter"),u}),C=()=>{const u=prompt("","New tag");if(!u||u==="New tag")return;const g=o.value.length+1;o.value.push({id:String(g),name:u,color_id:String((g-1)%10+1)}),a("tagsChanged",o.value)},T=u=>{var g;if(i.value=_.storage(u.elPopupOpener,"topTagSelectorTarget"),!i.value)throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");if(i.value.filters&&(h.value="add",i.value.model.value=[]),!((g=x.Core.$)!=null&&g.ui.sortable)){console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");return}!x.Core.state.isMobile&&!x.Core.state.isMobileUA&&o.value&&$(u.elPopup).sortable({items:'li:has([data-tag_id]:not([data-tag_id="all"]))',cancel:'[contenteditable="plaintext-only"], [contenteditable="true"]',distance:10,stop:function(y,S){if(!o.value)return;const M=$(S.item).parent().find("[data-tag_id]"),N=[];M.each((q,L)=>{if(!o.value)return;const b=$(L).attr("data-tag_id");N.push(b)}),o.value.sort((q,L)=>{const b=N.findIndex(j=>j===q.id),we=N.findIndex(j=>j===L.id);return b-we}),s("tagsChanged",o.value)}})},f=u=>{var g;(g=x.Core.$)!=null&&g.ui.sortable&&$(u.elPopup).data("ui-sortable")&&$(u.elPopup).sortable("destroy")};return(u,g)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(te,{class:"top-as-selector",modelValue:d.value,"onUpdate:modelValue":g[0]||(g[0]=y=>d.value=y),id:e.unref(v),tags:o.value,styling:u.styling,mode:"filter",useTopButton:""},null,8,["modelValue","id","tags","styling"]),e.createVNode(E._sfc_main,{id:e.unref(v),class:e.normalizeClass(B.value),onOpen:g[4]||(g[4]=y=>T(y)),onClose:g[5]||(g[5]=y=>f(y)),"transition-duration":50},e.createSlots({contentList:e.withCtx(()=>[e.unref(i).mode==="filter"&&!u.singleMode?(e.openBlock(),e.createBlock(ee,{key:0,id:"all",colorId:"",name:u.$i18n.Common.All_tags??"",state:e.unref(i).model.value.length?"":"selected",onSelect:g[3]||(g[3]=y=>e.unref(i).model.value=[])},null,8,["name","state"])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,y=>(e.openBlock(),e.createBlock(ee,{key:y.id,id:y.id,colorId:y.color_id,name:y.name,state:c(y.id),canExclude:e.unref(i).mode==="filter"&&!u.singleMode,editable:u.tagsEditable,disabled:m.value&&c(y.id)==="",onUnselect:S=>I(y.id,"unselect"),onSelect:S=>I(y.id,"select"),onExclude:S=>I(y.id,"exclude"),"onUpdate:name":S=>{y.name=S,e.unref(s)("tagsChanged",o.value)}},null,8,["id","colorId","name","state","canExclude","editable","disabled","onUnselect","onSelect","onExclude","onUpdate:name"]))),128)),u.tagsEditable&&o.value.length<u.tagsMax&&o.value.length<20?(e.openBlock(),e.createBlock(E._sfc_main$2,{key:1,"data-top-icon":"",onClick:e.withModifiers(C,["stop"])},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.$i18n.Common.Add),1)]),_:1})):e.createCommentVNode("",!0)]),_:2},[e.unref(i).mode==="setter"&&e.unref(i).filters?{name:"header",fn:e.withCtx(()=>[e.createVNode(x._sfc_main$9,{modelValue:h.value,"onUpdate:modelValue":g[1]||(g[1]=y=>h.value=y),options:k()},null,8,["modelValue","options"])]),key:"0"}:void 0,e.unref(i).mode==="setter"&&e.unref(i).filters?{name:"footer",fn:e.withCtx(()=>[e.createVNode(x._sfc_main$1,{color:"theme"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u.$i18n.Common.Cancel),1)]),_:1}),e.createVNode(x._sfc_main$1,{onClick:g[2]||(g[2]=y=>e.unref(s)("setter",{tagsIds:e.unref(i).model.value,filters:e.unref(i).filters,filtersAction:h.value,payload:e.unref(i).payload}))},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h.value==="add"?u.$i18n.Common.Add:"")+" "+e.toDisplayString(h.value==="replace"?u.$i18n.Common.Replace:"")+" "+e.toDisplayString(h.value==="delete"?u.$i18n.Common.Remove:""),1)]),_:1})]),key:"1"}:void 0]),1032,["id","class"])],64))}});V.TopSelectorCompetitors=de,V.TopSelectorRegion=ke,V.TopTagSelector=Te,V.TopTagSelectorPopupOpener=te,V.TopTagSelectorTagIcon=F,V.dialogSelectorRegions=Q,V.findRegion=H,V.genElTopTagSelectorPopupOpener=Se,V.genSearcherByKey=z,V.renderElTopTagSelectorPopupOpener=Ie,V.useItemsFromCompetitors=ue,Object.defineProperty(V,Symbol.toStringTag,{value:"Module"})}));
|
|
2
2
|
//# sourceMappingURL=project.amd.js.map
|
package/project/project.js
CHANGED
|
@@ -3,7 +3,7 @@ import { defineComponent as P, mergeModels as N, useModel as D, computed as E, c
|
|
|
3
3
|
import { u as R, C as J, c as H, o as re, d as Ae } from "../.chunks/forms-BWoAyEVH.es.js";
|
|
4
4
|
import { _ as Ie, b as ue, a as Re } from "../.chunks/listItem.vue_vue_type_script_setup_true_lang-Dljef_xa.es.js";
|
|
5
5
|
import { _ as Oe } from "../.chunks/menu.vue_vue_type_style_index_0_lang-HDPVVgzy.es.js";
|
|
6
|
-
import { u as Ne } from "../.chunks/utils-
|
|
6
|
+
import { u as Ne } from "../.chunks/utils-CNIqYM7c.es.js";
|
|
7
7
|
import { getSearcherGIcon as De, getLangLabel as Fe, getDeviceGIcon as qe } from "../utils/searchers.js";
|
|
8
8
|
import { storage as W } from "../utils/dom.js";
|
|
9
9
|
import { TopPopupWorker as Pe } from "../popup/worker.js";
|
|
@@ -170,7 +170,7 @@ const Ue = { class: "top-selectorCompetitors" }, je = { class: "top-ellipsis1" }
|
|
|
170
170
|
}), i))
|
|
171
171
|
return !1;
|
|
172
172
|
}), i;
|
|
173
|
-
}, Qe = Ne(() => import("../.chunks/dialog_selectorRegions-
|
|
173
|
+
}, Qe = Ne(() => import("../.chunks/dialog_selectorRegions-Dl8Zy2f4.es.js")), Xe = (t, l) => {
|
|
174
174
|
const o = R(), e = F(l.value.keys().next().value ?? p), i = E(() => {
|
|
175
175
|
const a = /* @__PURE__ */ new Map();
|
|
176
176
|
if (l.value.forEach((n) => {
|
|
@@ -25,7 +25,7 @@ export type ElTopDialogOpener<El extends HTMLElement = HTMLElement> = El & {
|
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
export type ElDialogOverlay = HTMLDivElement;
|
|
28
|
-
export type
|
|
28
|
+
export type ElTopDialogNative = HTMLDialogElement & {
|
|
29
29
|
/**
|
|
30
30
|
* Инициализирован ли dialog
|
|
31
31
|
*/
|
|
@@ -38,7 +38,7 @@ export type ElTopDialogWrapper = HTMLDialogElement & {
|
|
|
38
38
|
};
|
|
39
39
|
export type ElTopDialog = HTMLDivElement & {
|
|
40
40
|
getAttribute: (qualifiedName: 'id') => string;
|
|
41
|
-
closest: (el: '.dialog') =>
|
|
41
|
+
closest: (el: '.top-dialog-native') => ElTopDialogNative;
|
|
42
42
|
dataset: {
|
|
43
43
|
viewPageActive: string;
|
|
44
44
|
/**
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { ElTopDialog, ElTopDialogPage, MoveDirection,
|
|
1
|
+
import { ElTopDialog, ElTopDialogPage, MoveDirection, ElTopDialogNative } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Получить id внешнего элемента нативного модального окна
|
|
4
|
-
* @param
|
|
4
|
+
* @param dialogId - id элемента ElTopDialog
|
|
5
5
|
* @see ElTopDialog
|
|
6
6
|
*/
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const getDialogNativeId: (dialogId: string) => string;
|
|
8
8
|
/**
|
|
9
9
|
* Получить id внутреннего элемента нативного диалогового окна
|
|
10
|
-
* @param
|
|
11
|
-
* @see
|
|
10
|
+
* @param dialogNativeId - id элемента ElTopDialogNative
|
|
11
|
+
* @see ElTopDialogNative
|
|
12
12
|
*/
|
|
13
|
-
export declare const getDialogId: (
|
|
13
|
+
export declare const getDialogId: (dialogNativeId: string) => string;
|
|
14
14
|
/**
|
|
15
15
|
* Получить внешний элемент нативного диалогового окна
|
|
16
16
|
* @param elDialog - элемент ElTopDialog
|
|
17
17
|
* @see ElTopDialog
|
|
18
18
|
*/
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const getElDialogNative: (elDialog: ElTopDialog) => ElTopDialogNative;
|
|
20
20
|
/**
|
|
21
21
|
* Получить внутренний элемент нативного диалогового окна
|
|
22
|
-
* @param
|
|
23
|
-
* @see
|
|
22
|
+
* @param elDialogNative - элемент ElTopDialogNative
|
|
23
|
+
* @see ElTopDialogNative
|
|
24
24
|
*/
|
|
25
|
-
export declare const getElDialog: (
|
|
25
|
+
export declare const getElDialog: (elDialogNative: ElTopDialogNative) => ElTopDialog;
|
|
26
26
|
/**
|
|
27
27
|
* Создать и монтировать в body нативную оболочку окна
|
|
28
28
|
* @description Используется только для нативного диалогового окна
|
|
@@ -30,7 +30,7 @@ export declare const getElDialog: (elDialogWrapper: ElTopDialogWrapper) => ElTop
|
|
|
30
30
|
* @param pageActive - активная страница
|
|
31
31
|
* @see ElTopDialog
|
|
32
32
|
*/
|
|
33
|
-
export declare const
|
|
33
|
+
export declare const createAndMountElDialogNative: (id: string, pageActive: string) => ElTopDialogNative;
|
|
34
34
|
export declare const TopDialogUtils: {
|
|
35
35
|
getElDialogById: (id: string) => ElTopDialog | null;
|
|
36
36
|
updatePageVue: (dialogId: string, pageName?: string, pageNameNext?: string) => Promise<void>;
|
|
@@ -67,7 +67,7 @@ declare module '@vue/runtime-core' {
|
|
|
67
67
|
* В setup():
|
|
68
68
|
*
|
|
69
69
|
* ```js
|
|
70
|
-
* useI18n().Projects.Site; // выполнит inject('$i18n').Projects.Site, не
|
|
70
|
+
* useI18n().Projects.Site; // выполнит inject('$i18n').Projects.Site, не используйте inject('$i18n') напрямую, так как он не типизирован
|
|
71
71
|
* ```
|
|
72
72
|
*
|
|
73
73
|
* В template:
|
package/utils/searchers.amd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
define(["require","exports","../.chunks/forms-BfDSGwrU.amd","../.chunks/core-
|
|
1
|
+
define(["require","exports","../.chunks/forms-BfDSGwrU.amd","../.chunks/core-C6lQsOeb.amd","vue","../.chunks/dialogs.vue_vue_type_script_setup_true_lang-CkfNja1v.amd"],(function(b,c,g,f,r,d){"use strict";if(typeof r>"u")var r=window.Vue;const s={0:"Yandex",20:"Yandex.com",21:"Yandex.com.tr",1:"Google",4:"YouTube",5:"Bing",7:"Seznam",8:"AppStore",9:"GooglePlay",101:"VK",102:"Facebook",103:"Twitter"},t=a=>{let e="";switch(typeof a=="string"&&(a=Number(a)),a){case 0:e="";break;case 20:case 21:e="";break;case 1:e="";break;case 2:e="";break;case 3:e="";break;case 4:e="";break;case 5:e="";break;case 6:e="";break;case 7:e="";break;case 8:e="";break;case 9:e="";break;case null:e="";break}return e},n=a=>{let e="";switch(typeof a=="string"&&(a=Number(a)),a%10){case 0:e="";break;case 1:e="";break;case 2:e="";break}return e},i=(a,e)=>{switch(typeof a=="string"&&(a=Number(a)),a*1){case 1:case 4:case 5:case 6:case 8:case 9:return e}return""},u=(a,e,k)=>{switch(e*1){case 0:switch(k*1){case 2:a=`"${a}"`;break;case 3:a=`"!${a}"`;break;case 5:a=`"[${a}]"`;break;case 6:a=`"[!${a}]"`;break}break;case 1:a=`[${a}]`;break}return a},o=(a,e)=>{switch(e===null&&(e=6),a){case 1:e=3;break;case 2:e=2;break;case 5:e>1&&(e=1);break;default:[1,2,3,5,6].includes(e)||(e=3)}return e};c.genVolumeLabel=u,c.getDeviceGIcon=n,c.getLangLabel=i,c.getSearcherGIcon=t,c.prepareVolumeType=o,c.searchersNames=s,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})}));
|
|
2
2
|
//# sourceMappingURL=searchers.amd.js.map
|