@topvisor/ui 1.4.3-updateGroupSelector.3 → 1.4.3-updateRegionSelector.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.chunks/core-Dgj_YGWh.es.js +268 -0
- package/.chunks/core-Dgj_YGWh.es.js.map +1 -0
- package/.chunks/core-DzDFXOdI.amd.js +2 -0
- package/.chunks/core-DzDFXOdI.amd.js.map +1 -0
- package/.chunks/{datepicker-C5ErMHwe.amd.js → datepicker-oa8ZwRhq.amd.js} +2 -2
- package/.chunks/{datepicker-C5ErMHwe.amd.js.map → datepicker-oa8ZwRhq.amd.js.map} +1 -1
- package/.chunks/{datepicker-DMYB1RFK.es.js → datepicker-qToxk2nN.es.js} +2 -2
- package/.chunks/{datepicker-DMYB1RFK.es.js.map → datepicker-qToxk2nN.es.js.map} +1 -1
- package/.chunks/{dialog_regionSelectorRegions-CHC-Blbu.amd.js → dialog_regionSelectorRegions-CZ0tMVSq.amd.js} +2 -2
- package/.chunks/{dialog_regionSelectorRegions-CHC-Blbu.amd.js.map → dialog_regionSelectorRegions-CZ0tMVSq.amd.js.map} +1 -1
- package/.chunks/{dialog_regionSelectorRegions-BMWyYCfD.es.js → dialog_regionSelectorRegions-qDW2Ejsv.es.js} +5 -5
- package/.chunks/{dialog_regionSelectorRegions-BMWyYCfD.es.js.map → dialog_regionSelectorRegions-qDW2Ejsv.es.js.map} +1 -1
- package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-C3qaTBlO.amd.js → dialogs.vue_vue_type_script_setup_true_lang-BBix_8WK.amd.js} +2 -2
- package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-C3qaTBlO.amd.js.map → dialogs.vue_vue_type_script_setup_true_lang-BBix_8WK.amd.js.map} +1 -1
- package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-BZM_iKPW.es.js → dialogs.vue_vue_type_script_setup_true_lang-CJ97l1ST.es.js} +3 -3
- package/.chunks/{dialogs.vue_vue_type_script_setup_true_lang-BZM_iKPW.es.js.map → dialogs.vue_vue_type_script_setup_true_lang-CJ97l1ST.es.js.map} +1 -1
- package/.chunks/{forms-EhKRBbpk.amd.js → forms-DDNzqU6o.amd.js} +3 -3
- package/.chunks/{forms-EhKRBbpk.amd.js.map → forms-DDNzqU6o.amd.js.map} +1 -1
- package/.chunks/{forms-CUaoBGD5.es.js → forms-DtC-EKJL.es.js} +24 -24
- package/.chunks/{forms-CUaoBGD5.es.js.map → forms-DtC-EKJL.es.js.map} +1 -1
- package/.chunks/lazy-DDNqYkXn.amd.js +2 -0
- package/.chunks/lazy-DDNqYkXn.amd.js.map +1 -0
- package/.chunks/{lazy-40pjr8cZ.es.js → lazy-HKSyLh72.es.js} +23 -19
- package/.chunks/lazy-HKSyLh72.es.js.map +1 -0
- package/.chunks/{notice-Chj1PUTD.es.js → notice-BvQl911b.es.js} +3 -3
- package/.chunks/{notice-Chj1PUTD.es.js.map → notice-BvQl911b.es.js.map} +1 -1
- package/.chunks/{notice-DQb_Za5_.amd.js → notice-CJ3WOTCM.amd.js} +2 -2
- package/.chunks/{notice-DQb_Za5_.amd.js.map → notice-CJ3WOTCM.amd.js.map} +1 -1
- package/.chunks/{page.vue_vue_type_script_setup_true_lang-C-xQ-eC7.es.js → page.vue_vue_type_script_setup_true_lang-Dd5-B4Ss.es.js} +9 -9
- package/.chunks/{page.vue_vue_type_script_setup_true_lang-C-xQ-eC7.es.js.map → page.vue_vue_type_script_setup_true_lang-Dd5-B4Ss.es.js.map} +1 -1
- package/.chunks/{page.vue_vue_type_script_setup_true_lang-bUK5c5qn.amd.js → page.vue_vue_type_script_setup_true_lang-fl6-Ql4d.amd.js} +2 -2
- package/.chunks/{page.vue_vue_type_script_setup_true_lang-bUK5c5qn.amd.js.map → page.vue_vue_type_script_setup_true_lang-fl6-Ql4d.amd.js.map} +1 -1
- package/.chunks/policy.vue_vue_type_style_index_0_lang-Bv3LwNDC.es.js +519 -0
- package/.chunks/policy.vue_vue_type_style_index_0_lang-Bv3LwNDC.es.js.map +1 -0
- package/.chunks/policy.vue_vue_type_style_index_0_lang-Da7rztT5.amd.js +2 -0
- package/.chunks/policy.vue_vue_type_style_index_0_lang-Da7rztT5.amd.js.map +1 -0
- package/.chunks/{popup-COONSpqs.es.js → popup-OuDglAOF.es.js} +4 -4
- package/.chunks/popup-OuDglAOF.es.js.map +1 -0
- package/.chunks/{popup-CDaQNt-3.amd.js → popup-yXIpyok3.amd.js} +2 -2
- package/.chunks/popup-yXIpyok3.amd.js.map +1 -0
- package/.chunks/{popupHint.vue_vue_type_style_index_0_lang-24i49Ad3.amd.js → popupHint.vue_vue_type_style_index_0_lang-Bu_HvFoW.amd.js} +2 -2
- package/.chunks/{popupHint.vue_vue_type_style_index_0_lang-24i49Ad3.amd.js.map → popupHint.vue_vue_type_style_index_0_lang-Bu_HvFoW.amd.js.map} +1 -1
- package/.chunks/{popupHint.vue_vue_type_style_index_0_lang-DzT1BFMx.es.js → popupHint.vue_vue_type_style_index_0_lang-DAQIAxvu.es.js} +5 -5
- package/.chunks/{popupHint.vue_vue_type_style_index_0_lang-DzT1BFMx.es.js.map → popupHint.vue_vue_type_style_index_0_lang-DAQIAxvu.es.js.map} +1 -1
- package/.chunks/{utils-Kzz2mc2t.es.js → utils-BNzP9anP.es.js} +2 -2
- package/.chunks/{utils-Kzz2mc2t.es.js.map → utils-BNzP9anP.es.js.map} +1 -1
- package/.chunks/{utils-DsGgpnXD.amd.js → utils-CWn_G7OO.amd.js} +2 -2
- package/.chunks/{utils-DsGgpnXD.amd.js.map → utils-CWn_G7OO.amd.js.map} +1 -1
- package/.chunks/{utils-C2_4b48S.amd.js → utils-DIviuVEw.amd.js} +2 -2
- package/.chunks/utils-DIviuVEw.amd.js.map +1 -0
- package/.chunks/{utils-DQ-xahGh.es.js → utils-Dma85ehT.es.js} +67 -67
- package/.chunks/utils-Dma85ehT.es.js.map +1 -0
- package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-BuoAaghB.es.js → widgetInput.vue_vue_type_script_setup_true_lang-CX_BOcVY.es.js} +6 -6
- package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-BuoAaghB.es.js.map → widgetInput.vue_vue_type_script_setup_true_lang-CX_BOcVY.es.js.map} +1 -1
- package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-Dgjj70vU.amd.js → widgetInput.vue_vue_type_script_setup_true_lang-CkOmb3VD.amd.js} +2 -2
- package/.chunks/{widgetInput.vue_vue_type_script_setup_true_lang-Dgjj70vU.amd.js.map → widgetInput.vue_vue_type_script_setup_true_lang-CkOmb3VD.amd.js.map} +1 -1
- package/api/index.amd.js +1 -1
- package/api/index.js +6 -6
- package/assets/policy.css +1 -1
- package/assets/project.css +1 -1
- package/assets/tabsView.css +1 -1
- package/assets/themes/dark.css +1 -1
- package/assets/themes/light.css +1 -1
- package/charts/charts.amd.js +1 -1
- package/charts/charts.js +14 -14
- package/core/app.amd.js +1 -1
- package/core/app.js +15 -15
- package/dialog/dialog.amd.js +1 -1
- package/dialog/dialog.js +6 -6
- package/extra/extra.js +2 -2
- package/forms/forms.amd.js +1 -1
- package/forms/forms.js +1 -1
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.amd.js.map +1 -1
- package/formsExt/formsExt.js +46 -45
- package/formsExt/formsExt.js.map +1 -1
- package/icomoon/Topvisor icons.json +349 -247
- package/icomoon/demo.html +57 -1
- package/icomoon/fonts/Topvisor-2.eot +0 -0
- package/icomoon/fonts/Topvisor-2.svg +4 -0
- package/icomoon/fonts/Topvisor-2.ttf +0 -0
- package/icomoon/fonts/Topvisor-2.woff +0 -0
- package/icomoon/selection.json +1 -1
- package/icomoon/style.css +17 -5
- package/layout/layout.amd.js +1 -1
- package/layout/layout.js +7 -7
- package/package.json +2 -2
- package/popup/popup.amd.js +1 -1
- package/popup/popup.js +9 -9
- package/popup/worker.amd.js +1 -1
- package/popup/worker.js +2 -2
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +1043 -658
- package/project/project.js.map +1 -1
- package/src/components/formsExt/editInput/types.d.ts +4 -0
- package/src/components/formsExt/selector2/composables/useMenu.d.ts +1 -1
- package/src/components/formsExt/selector2/selector2.vue.d.ts +2 -0
- package/src/components/formsExt/selector2/types.d.ts +35 -1
- package/src/components/formsExt/selector2/utils.d.ts +2 -0
- package/src/components/popup/lib/popup.d.ts +1 -1
- package/src/components/popup/popup/opener/types.d.ts +1 -1
- package/src/components/project/groupSelector/folders/utils.d.ts +6 -26
- package/src/components/project/groupSelector/groupSelector.vue.d.ts +1 -1
- package/src/components/project/groupSelector/groups/groups.vue.d.ts +13 -6
- package/src/components/project/groupSelector/groups/utils.d.ts +18 -53
- package/src/components/project/groupSelector/utils.d.ts +37 -0
- package/src/components/project/project.d.ts +2 -0
- package/src/components/project/projectSelector/cache.d.ts +29 -0
- package/src/components/project/projectSelector/projectSelector.vue.d.ts +128 -0
- package/src/components/project/projectSelector/submenu/submenu.vue.d.ts +4 -0
- package/src/components/project/projectSelector/submenu/types.d.ts +17 -0
- package/src/components/project/projectSelector/types.d.ts +48 -0
- package/src/components/project/projectSelector/utils.d.ts +248 -0
- package/src/components/project/regionSelector/types.d.ts +9 -4
- package/src/components/project/regionSelector/utils/utils.d.ts +5 -5
- package/src/components/tabsView/tabsView/menu.vue.d.ts +2 -6
- package/src/core/directives/shortcut.d.ts +2 -1
- package/src/core/directives/tooltip.d.ts +2 -6
- package/tabs/tabs.js +5 -5
- package/tabsView/tabsView.amd.js +1 -1
- package/tabsView/tabsView.amd.js.map +1 -1
- package/tabsView/tabsView.js +93 -104
- package/tabsView/tabsView.js.map +1 -1
- package/utils/clipboard.amd.js +1 -1
- package/utils/clipboard.js +1 -1
- package/utils/date.amd.js +1 -1
- package/utils/date.js +1 -1
- package/utils/device.amd.js +1 -1
- package/utils/device.js +1 -1
- package/utils/lodash.amd.js +1 -1
- package/utils/lodash.js +1 -1
- package/utils/price.amd.js +1 -1
- package/utils/price.js +1 -1
- package/utils/searchers.amd.js +1 -1
- package/utils/searchers.js +3 -3
- package/utils/string.amd.js +1 -1
- package/utils/string.js +1 -1
- package/.chunks/core-BEpKBNHt.amd.js +0 -2
- package/.chunks/core-BEpKBNHt.amd.js.map +0 -1
- package/.chunks/core-DBWAn2Eg.es.js +0 -242
- package/.chunks/core-DBWAn2Eg.es.js.map +0 -1
- package/.chunks/lazy-40pjr8cZ.es.js.map +0 -1
- package/.chunks/lazy-DSFLxvj4.amd.js +0 -2
- package/.chunks/lazy-DSFLxvj4.amd.js.map +0 -1
- package/.chunks/policy.vue_vue_type_style_index_0_lang-6S_OFLu6.amd.js +0 -2
- package/.chunks/policy.vue_vue_type_style_index_0_lang-6S_OFLu6.amd.js.map +0 -1
- package/.chunks/policy.vue_vue_type_style_index_0_lang-BRUOmEM8.es.js +0 -498
- package/.chunks/policy.vue_vue_type_style_index_0_lang-BRUOmEM8.es.js.map +0 -1
- package/.chunks/popup-CDaQNt-3.amd.js.map +0 -1
- package/.chunks/popup-COONSpqs.es.js.map +0 -1
- package/.chunks/utils-C2_4b48S.amd.js.map +0 -1
- package/.chunks/utils-DQ-xahGh.es.js.map +0 -1
package/project/project.js
CHANGED
|
@@ -3,20 +3,23 @@
|
|
|
3
3
|
const fileNames = ['../assets/project.css'].map(fileName => import.meta.resolve(fileName));
|
|
4
4
|
_autoloadCSSCore.insertCSSLinkToPage(fileNames, true);
|
|
5
5
|
|
|
6
|
-
import { defineComponent as
|
|
7
|
-
import { u as
|
|
8
|
-
import { _ as
|
|
9
|
-
import {
|
|
10
|
-
import { u as
|
|
11
|
-
import { getSearcherGIcon as
|
|
12
|
-
import "../.chunks/core-
|
|
13
|
-
import "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-
|
|
14
|
-
import { g as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
6
|
+
import { defineComponent as K, useModel as P, computed as M, openBlock as h, createElementBlock as A, unref as m, createBlock as j, withCtx as w, Fragment as F, renderList as ve, normalizeClass as oe, createElementVNode as N, toDisplayString as b, createVNode as U, createTextVNode as H, mergeModels as L, toValue as Pe, ref as _, watch as G, createCommentVNode as E, reactive as qe, resolveComponent as We, shallowRef as He, onMounted as lt, withModifiers as W, isRef as Me, mergeProps as Je, withKeys as Ee, nextTick as nt, resolveDirective as rt, withDirectives as it, resolveDynamicComponent as st, renderSlot as dt, createSlots as ut } from "vue";
|
|
7
|
+
import { u as B, C as X, e as ee, q as Ce, d as ct } from "../.chunks/forms-DtC-EKJL.es.js";
|
|
8
|
+
import { _ as je, a as $e, b as ft } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-DAQIAxvu.es.js";
|
|
9
|
+
import { _ as gt, b as we, c as ze, I as Ye, a as ye } from "../.chunks/policy.vue_vue_type_style_index_0_lang-Bv3LwNDC.es.js";
|
|
10
|
+
import { u as mt } from "../.chunks/utils-BNzP9anP.es.js";
|
|
11
|
+
import { getSearcherGIcon as pt, getLangLabel as vt, getDeviceGIcon as ht } from "../utils/searchers.js";
|
|
12
|
+
import "../.chunks/core-Dgj_YGWh.es.js";
|
|
13
|
+
import "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-CJ97l1ST.es.js";
|
|
14
|
+
import { g as ie, a as le } from "../.chunks/field-CyyFzM-Y.es.js";
|
|
15
|
+
import { validUrl as yt } from "../utils/check.js";
|
|
16
|
+
import { ellipsis as St } from "../utils/string.js";
|
|
17
|
+
import { TopPopupWorker as Qe } from "../popup/worker.js";
|
|
18
|
+
import { invertKeyboardLayout as It } from "../utils/keyboard.js";
|
|
19
|
+
import { storage as Z } from "../utils/dom.js";
|
|
20
|
+
const xt = { class: "top-competitorSelector" }, Ct = { class: "top-ellipsis1" }, Bo = /* @__PURE__ */ K({
|
|
18
21
|
__name: "competitorSelector",
|
|
19
|
-
props: /* @__PURE__ */
|
|
22
|
+
props: /* @__PURE__ */ L({
|
|
20
23
|
modelValue: {},
|
|
21
24
|
items: {},
|
|
22
25
|
showSelectAllItem: { type: Boolean, default: !0 }
|
|
@@ -26,64 +29,64 @@ const _e = { class: "top-competitorSelector" }, et = { class: "top-ellipsis1" },
|
|
|
26
29
|
}),
|
|
27
30
|
emits: ["update:modelValue"],
|
|
28
31
|
setup(e) {
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
32
|
+
const t = e, a = P(e, "modelValue"), o = M(() => {
|
|
33
|
+
if (t.showSelectAllItem)
|
|
31
34
|
return {
|
|
32
35
|
icon: "",
|
|
33
|
-
title:
|
|
36
|
+
title: B().Common.Select_all,
|
|
34
37
|
value: "all",
|
|
35
38
|
content: ""
|
|
36
39
|
};
|
|
37
40
|
});
|
|
38
|
-
return (
|
|
39
|
-
|
|
40
|
-
opener:
|
|
41
|
-
|
|
41
|
+
return (n, l) => (h(), A("div", xt, [
|
|
42
|
+
m(X).state.isMobile ? (h(), j(je, { key: 0 }, {
|
|
43
|
+
opener: w(() => [
|
|
44
|
+
U(ee, {
|
|
42
45
|
class: "top-competitorSelector_opener",
|
|
43
46
|
color: "theme",
|
|
44
47
|
icon: "",
|
|
45
48
|
icon2: ""
|
|
46
49
|
}, {
|
|
47
|
-
default:
|
|
48
|
-
|
|
50
|
+
default: w(() => [
|
|
51
|
+
H(b(e.items.find((r) => r.value === a.value?.[0])?.content), 1)
|
|
49
52
|
]),
|
|
50
53
|
_: 1
|
|
51
54
|
})
|
|
52
55
|
]),
|
|
53
|
-
contentList:
|
|
54
|
-
(h(!0), A(
|
|
55
|
-
class:
|
|
56
|
-
"top-active":
|
|
56
|
+
contentList: w(() => [
|
|
57
|
+
(h(!0), A(F, null, ve(e.items, (r) => (h(), j($e, {
|
|
58
|
+
class: oe({
|
|
59
|
+
"top-active": a.value?.includes(r.value)
|
|
57
60
|
}),
|
|
58
|
-
"data-top-icon":
|
|
59
|
-
title:
|
|
60
|
-
onClick: () =>
|
|
61
|
+
"data-top-icon": r.icon,
|
|
62
|
+
title: r.title,
|
|
63
|
+
onClick: () => a.value = [r.value]
|
|
61
64
|
}, {
|
|
62
|
-
default:
|
|
63
|
-
|
|
65
|
+
default: w(() => [
|
|
66
|
+
N("span", Ct, b(r.content), 1)
|
|
64
67
|
]),
|
|
65
68
|
_: 2
|
|
66
69
|
}, 1032, ["class", "data-top-icon", "title", "onClick"]))), 256))
|
|
67
70
|
]),
|
|
68
71
|
_: 1
|
|
69
|
-
})) : (h(),
|
|
72
|
+
})) : (h(), j(gt, {
|
|
70
73
|
key: 1,
|
|
71
|
-
modelValue:
|
|
72
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
74
|
+
modelValue: a.value,
|
|
75
|
+
"onUpdate:modelValue": l[0] || (l[0] = (r) => a.value = r),
|
|
73
76
|
items: e.items,
|
|
74
77
|
isMultiple: !0,
|
|
75
78
|
styling: "bar",
|
|
76
79
|
canBeEmptyMultiple: !1,
|
|
77
|
-
selectAllItem:
|
|
80
|
+
selectAllItem: o.value
|
|
78
81
|
}, null, 8, ["modelValue", "items", "selectAllItem"]))
|
|
79
82
|
]));
|
|
80
83
|
}
|
|
81
|
-
}),
|
|
82
|
-
value:
|
|
83
|
-
title:
|
|
84
|
-
icon:
|
|
85
|
-
content:
|
|
86
|
-
}))),
|
|
84
|
+
}), bo = (e, t) => M(() => Pe(e).filter((n) => n.on >= 0 || n.id === t).map((n) => ({
|
|
85
|
+
value: n.id,
|
|
86
|
+
title: n.url + ` [${n.id}]`,
|
|
87
|
+
icon: n.id === Pe(t) ? "" : "",
|
|
88
|
+
content: n.name
|
|
89
|
+
}))), D = -1, S = -2, se = -1, kt = {
|
|
87
90
|
0: "Yandex",
|
|
88
91
|
1: "Google",
|
|
89
92
|
4: "YouTube",
|
|
@@ -93,247 +96,247 @@ const _e = { class: "top-competitorSelector" }, et = { class: "top-ellipsis1" },
|
|
|
93
96
|
9: "GoogleStore",
|
|
94
97
|
20: "Yandex.com",
|
|
95
98
|
21: "Yandex.com.tr"
|
|
96
|
-
},
|
|
97
|
-
key:
|
|
99
|
+
}, _e = {
|
|
100
|
+
key: S,
|
|
98
101
|
name: "--",
|
|
99
|
-
index:
|
|
100
|
-
},
|
|
101
|
-
key:
|
|
102
|
+
index: S
|
|
103
|
+
}, Xe = {
|
|
104
|
+
key: S,
|
|
102
105
|
name: "--",
|
|
103
|
-
regions: [
|
|
104
|
-
regionByIndex: /* @__PURE__ */ new Map([[
|
|
105
|
-
},
|
|
106
|
-
key:
|
|
106
|
+
regions: [_e],
|
|
107
|
+
regionByIndex: /* @__PURE__ */ new Map([[S, _e]])
|
|
108
|
+
}, de = {
|
|
109
|
+
key: S,
|
|
107
110
|
name: "Autoselect",
|
|
108
|
-
index:
|
|
109
|
-
},
|
|
110
|
-
key:
|
|
111
|
+
index: S
|
|
112
|
+
}, Se = {
|
|
113
|
+
key: S,
|
|
111
114
|
name: "Autoselect",
|
|
112
|
-
regions: [
|
|
113
|
-
regionByIndex: /* @__PURE__ */ new Map([[
|
|
114
|
-
},
|
|
115
|
+
regions: [de],
|
|
116
|
+
regionByIndex: /* @__PURE__ */ new Map([[S, de]])
|
|
117
|
+
}, Ve = {
|
|
115
118
|
countryCode: "00",
|
|
116
119
|
depth: 1,
|
|
117
120
|
device: 0,
|
|
118
|
-
key:
|
|
119
|
-
index:
|
|
121
|
+
key: se,
|
|
122
|
+
index: se,
|
|
120
123
|
lang: "ru",
|
|
121
124
|
name: "Without region"
|
|
122
|
-
},
|
|
123
|
-
let
|
|
124
|
-
return e ?
|
|
125
|
-
},
|
|
126
|
-
const
|
|
125
|
+
}, Tt = () => (de.name = B().Common.Autoselect, de), At = () => (Tt(), Se.name = B().Common.Autoselect, console.log(Se), Se), jt = () => (Ve.name = B().Keywords.Without_region, Ve), Ze = (e = "", t = !1, a = []) => {
|
|
126
|
+
let o;
|
|
127
|
+
return e ? o = $t(a, e) : o = et(a), t && o.set(S, At()), o.size || o.set(S, Xe), o;
|
|
128
|
+
}, et = (e, t = !0, a = [], o = "") => {
|
|
129
|
+
const n = /* @__PURE__ */ new Map();
|
|
127
130
|
return e.forEach((l) => {
|
|
128
|
-
if (!l.enabled ||
|
|
129
|
-
const
|
|
130
|
-
|
|
131
|
-
if (
|
|
132
|
-
const f = { ...
|
|
133
|
-
|
|
134
|
-
}), !
|
|
131
|
+
if (!l.enabled || o && typeof l.key == "number" && l.key > 1) return;
|
|
132
|
+
const r = { ...l };
|
|
133
|
+
r.regionByIndex = /* @__PURE__ */ new Map(), l.regions && l.regions.forEach((i) => {
|
|
134
|
+
if (t && !i.enabled) return;
|
|
135
|
+
const f = { ...i };
|
|
136
|
+
r.regionByIndex.set(f.index, f);
|
|
137
|
+
}), !r.regionByIndex.size && a.length, // режим вывода ПС без регионов
|
|
135
138
|
(!l.regions || // есть включенные регионы
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}),
|
|
139
|
-
if (
|
|
140
|
-
const
|
|
139
|
+
r.regionByIndex.size || // запрошен вывод конкретных ПС
|
|
140
|
+
a.length) && n.set(r.key, r);
|
|
141
|
+
}), a.forEach((l) => {
|
|
142
|
+
if (n.has(l)) return;
|
|
143
|
+
const r = {
|
|
141
144
|
key: l,
|
|
142
|
-
name:
|
|
145
|
+
name: kt[l],
|
|
143
146
|
regions: [],
|
|
144
147
|
regionByIndex: /* @__PURE__ */ new Map()
|
|
145
148
|
};
|
|
146
|
-
|
|
147
|
-
}),
|
|
148
|
-
},
|
|
149
|
-
const a =
|
|
149
|
+
n.set(r.key, r);
|
|
150
|
+
}), n;
|
|
151
|
+
}, $t = (e, t) => {
|
|
152
|
+
const a = et(e, !1, [0, 1], t);
|
|
150
153
|
if (a.has(2)) {
|
|
151
154
|
const o = a.get(2);
|
|
152
155
|
o && (o.regionByIndex = /* @__PURE__ */ new Map());
|
|
153
156
|
}
|
|
154
|
-
return a.forEach((o) => {
|
|
157
|
+
return (t === "volume" || t === "cost_forecast") && a.forEach((o) => {
|
|
155
158
|
if (!o.regionByIndex) return;
|
|
156
|
-
const
|
|
157
|
-
o.regionByIndex.set(
|
|
159
|
+
const n = { ...jt() };
|
|
160
|
+
o.regionByIndex.set(n.index, n);
|
|
158
161
|
}), a;
|
|
159
|
-
},
|
|
160
|
-
const
|
|
161
|
-
let
|
|
162
|
-
return
|
|
163
|
-
if (!(
|
|
164
|
-
if (!
|
|
165
|
-
return
|
|
166
|
-
}),
|
|
162
|
+
}, wt = (e, t, a = []) => {
|
|
163
|
+
const o = Ze(e, !1, a);
|
|
164
|
+
let n;
|
|
165
|
+
return o.forEach((l) => {
|
|
166
|
+
if (!(t.searcher_key !== void 0 && t.searcher_key != l.key) && l.regions && (l.regions.forEach((r) => {
|
|
167
|
+
if (!n && !(t.key !== void 0 && t.key != r.key) && !(t.index !== void 0 && t.index != r.index) && !(!e && (t.lang !== void 0 && t.lang != r.lang || t.device !== void 0 && t.device != r.device)))
|
|
168
|
+
return r.searcher_key = l.key, n = r, !1;
|
|
169
|
+
}), n))
|
|
167
170
|
return !1;
|
|
168
|
-
}),
|
|
169
|
-
},
|
|
170
|
-
const
|
|
171
|
+
}), n;
|
|
172
|
+
}, Bt = mt(() => import("../.chunks/dialog_regionSelectorRegions-qDW2Ejsv.es.js")), bt = (e, t) => {
|
|
173
|
+
const a = B(), o = _(t.value.keys().next().value ?? S), n = M(() => {
|
|
171
174
|
const l = /* @__PURE__ */ new Map();
|
|
172
|
-
if (
|
|
173
|
-
let
|
|
174
|
-
value:
|
|
175
|
-
title:
|
|
175
|
+
if (t.value.forEach((r) => {
|
|
176
|
+
let i = {
|
|
177
|
+
value: r.key,
|
|
178
|
+
title: r.name
|
|
176
179
|
};
|
|
177
|
-
e.addSearcherIcon && (
|
|
178
|
-
}), e.addCompare && !l.has(
|
|
179
|
-
const
|
|
180
|
+
e.addSearcherIcon && (i.icon = pt(r.key)), l.set(r.key, i);
|
|
181
|
+
}), e.addCompare && !l.has(S)) {
|
|
182
|
+
const r = {
|
|
180
183
|
value: "",
|
|
181
184
|
title: "--------------------",
|
|
182
185
|
disabled: !0
|
|
183
186
|
};
|
|
184
|
-
l.set(
|
|
185
|
-
const
|
|
186
|
-
value:
|
|
187
|
-
title:
|
|
187
|
+
l.set(r.value, r);
|
|
188
|
+
const i = {
|
|
189
|
+
value: D,
|
|
190
|
+
title: a.Common.Compare
|
|
188
191
|
};
|
|
189
|
-
l.set(
|
|
192
|
+
l.set(i.value, i);
|
|
190
193
|
}
|
|
191
194
|
return l;
|
|
192
195
|
});
|
|
193
196
|
return {
|
|
194
|
-
searcherKey:
|
|
195
|
-
optionBySearcherKey:
|
|
197
|
+
searcherKey: o,
|
|
198
|
+
optionBySearcherKey: n
|
|
196
199
|
};
|
|
197
|
-
},
|
|
198
|
-
const
|
|
199
|
-
e.modelValue.length === 1 && (
|
|
200
|
-
const
|
|
200
|
+
}, Pt = (e, t) => {
|
|
201
|
+
const a = B(), o = _(S);
|
|
202
|
+
e.modelValue.length === 1 && (o.value = e.modelValue[0]), o.value === S && (e.forMode ? o.value = t.value?.regionByIndex.values().next().value?.key ?? S : o.value = t.value?.regionByIndex.keys().next().value ?? S);
|
|
203
|
+
const n = M(() => {
|
|
201
204
|
const l = /* @__PURE__ */ new Map();
|
|
202
|
-
return
|
|
203
|
-
let
|
|
204
|
-
if (e.
|
|
205
|
-
const
|
|
206
|
-
value:
|
|
207
|
-
title:
|
|
205
|
+
return t.value.regionByIndex?.forEach((r) => {
|
|
206
|
+
let i = r.name;
|
|
207
|
+
if (e.forMode) {
|
|
208
|
+
const C = {
|
|
209
|
+
value: r.key,
|
|
210
|
+
title: i
|
|
208
211
|
};
|
|
209
|
-
l.has(
|
|
212
|
+
l.has(r.key) || l.set(r.key, C);
|
|
210
213
|
return;
|
|
211
214
|
}
|
|
212
|
-
|
|
213
|
-
const f =
|
|
214
|
-
f && (
|
|
215
|
-
const
|
|
216
|
-
value:
|
|
217
|
-
title:
|
|
218
|
-
icon:
|
|
215
|
+
r.device && (i += " (" + a.Common["Device_" + r.device] + ")");
|
|
216
|
+
const f = vt(t.value.key || 0, r.lang ?? "");
|
|
217
|
+
f && (i += " / " + f);
|
|
218
|
+
const u = {
|
|
219
|
+
value: r.index,
|
|
220
|
+
title: i,
|
|
221
|
+
icon: r.device ? ht(r.device) : void 0
|
|
219
222
|
};
|
|
220
|
-
l.set(
|
|
223
|
+
l.set(r.index, u);
|
|
221
224
|
}), l;
|
|
222
225
|
});
|
|
223
|
-
return
|
|
224
|
-
if (e.onlySearcher ||
|
|
226
|
+
return G(n, (l, r) => {
|
|
227
|
+
if (e.onlySearcher || o.value !== void 0 && l.get(o.value))
|
|
225
228
|
return;
|
|
226
|
-
let
|
|
227
|
-
if (
|
|
228
|
-
|
|
229
|
+
let i = l.keys().next().value;
|
|
230
|
+
if (o.value === S || i === S) {
|
|
231
|
+
o.value = i;
|
|
229
232
|
return;
|
|
230
233
|
}
|
|
231
|
-
let f =
|
|
232
|
-
for (const [
|
|
233
|
-
const
|
|
234
|
-
if (typeof
|
|
234
|
+
let f = r?.get(o.value)?.title || "", u = -1;
|
|
235
|
+
for (const [C, s] of l.entries()) {
|
|
236
|
+
const g = s.title;
|
|
237
|
+
if (typeof g != "string" || typeof C == "string")
|
|
235
238
|
break;
|
|
236
|
-
if (
|
|
237
|
-
|
|
239
|
+
if (g === f) {
|
|
240
|
+
i = C;
|
|
238
241
|
break;
|
|
239
242
|
}
|
|
240
|
-
const d = new RegExp(` \\((${
|
|
241
|
-
let
|
|
242
|
-
|
|
243
|
+
const d = new RegExp(` \\((${a.Common.Device_1}|${a.Common.Device_2})\\)`);
|
|
244
|
+
let c = f, p = 3;
|
|
245
|
+
g.indexOf(c) === -1 && (c = f.replace(/^[^a-zа-я]/i, "").replace(d, ""), p--), g.indexOf(c) === -1 && (c = f.replace(/ \/.*/, ""), p--), g.indexOf(c) === -1 && (c = f.replace(/ \/.*/, ""), c = c.replace(/^[^a-zа-я]/i, "").replace(d, ""), p--), g.indexOf(c) !== -1 && (p <= u || (u = p, i = C));
|
|
243
246
|
}
|
|
244
|
-
|
|
247
|
+
o.value = i;
|
|
245
248
|
}), {
|
|
246
|
-
regionIndex:
|
|
247
|
-
optionByRegionIndex:
|
|
249
|
+
regionIndex: o,
|
|
250
|
+
optionByRegionIndex: n
|
|
248
251
|
};
|
|
249
|
-
},
|
|
250
|
-
const
|
|
251
|
-
if (e.onlySearcher &&
|
|
252
|
-
|
|
252
|
+
}, Mt = (e, t, a) => {
|
|
253
|
+
const o = _([]), n = () => {
|
|
254
|
+
if (e.onlySearcher && t.value) {
|
|
255
|
+
o.value = Array.from(t.value.keys());
|
|
253
256
|
return;
|
|
254
257
|
}
|
|
255
|
-
let
|
|
258
|
+
let r = [];
|
|
256
259
|
if (e.modelValue.length > 1)
|
|
257
|
-
|
|
260
|
+
r = [...e.modelValue];
|
|
258
261
|
else
|
|
259
262
|
try {
|
|
260
|
-
|
|
263
|
+
r = JSON.parse(
|
|
261
264
|
localStorage.getItem("ui:project:regionSelector" + e.projectId + ":regionsIndexes")
|
|
262
265
|
) ?? [];
|
|
263
266
|
} catch {
|
|
264
267
|
}
|
|
265
|
-
|
|
268
|
+
r.length && (r = r.filter((i) => a.value.has(i))), r.length || (r = Array.from(a.value)), o.value = [...r];
|
|
266
269
|
}, l = () => {
|
|
267
|
-
|
|
270
|
+
o.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(o.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
|
|
268
271
|
};
|
|
269
|
-
return
|
|
272
|
+
return G(o, () => {
|
|
270
273
|
l();
|
|
271
|
-
}), e.addCompare &&
|
|
272
|
-
regionsIndexes:
|
|
274
|
+
}), e.addCompare && n(), {
|
|
275
|
+
regionsIndexes: o
|
|
273
276
|
};
|
|
274
|
-
},
|
|
275
|
-
const
|
|
276
|
-
const
|
|
277
|
-
return
|
|
278
|
-
|
|
279
|
-
d.index !==
|
|
277
|
+
}, Et = (e) => {
|
|
278
|
+
const t = M(() => Ze(e.forMode, e.autoRegion, e.searchers)), a = M(() => t.value.get(n.searcherKey.value) || Xe), o = M(() => {
|
|
279
|
+
const s = /* @__PURE__ */ new Set();
|
|
280
|
+
return t.value.forEach((g) => {
|
|
281
|
+
g.regionByIndex.forEach((d) => {
|
|
282
|
+
d.index !== se && d.index !== S && s.add(d.index);
|
|
280
283
|
});
|
|
281
|
-
}),
|
|
282
|
-
}),
|
|
283
|
-
|
|
284
|
-
if (e.onlySearcher ?
|
|
285
|
-
let
|
|
286
|
-
|
|
287
|
-
if (e.onlySearcher &&
|
|
288
|
-
|
|
284
|
+
}), s;
|
|
285
|
+
}), n = bt(e, t), l = Pt(e, a), r = Mt(e, t, o);
|
|
286
|
+
G(t, () => {
|
|
287
|
+
if (e.onlySearcher ? r.regionsIndexes.value = Array.from(t.value.keys()) : r.regionsIndexes.value = r.regionsIndexes.value.filter((g) => o.value.has(g)), n.searcherKey.value === D) return;
|
|
288
|
+
let s = t.value.keys().next().value;
|
|
289
|
+
t.value.forEach((g) => {
|
|
290
|
+
if (e.onlySearcher && g.key === n.searcherKey.value) {
|
|
291
|
+
s = n.searcherKey.value;
|
|
289
292
|
return;
|
|
290
293
|
}
|
|
291
|
-
if (l.regionIndex.value &&
|
|
294
|
+
if (l.regionIndex.value && g.regionByIndex?.has(l.regionIndex.value) && (s = g.key), !e.onlySearcher) {
|
|
292
295
|
let d;
|
|
293
|
-
|
|
294
|
-
const
|
|
295
|
-
d?.has(
|
|
296
|
+
s !== void 0 && (d = t.value.get(s)?.regionByIndex);
|
|
297
|
+
const c = t.value.get(g.key)?.regionByIndex;
|
|
298
|
+
d?.has(S) && !c?.has(S) && (s = g.key);
|
|
296
299
|
}
|
|
297
|
-
}),
|
|
300
|
+
}), s !== void 0 && (n.searcherKey.value = s), l.regionIndex.value !== void 0 && !a.value?.regionByIndex?.has(l.regionIndex.value) && (l.regionIndex.value = a.value?.regions?.keys().next().value);
|
|
298
301
|
}, { immediate: !0 });
|
|
299
|
-
const
|
|
300
|
-
if (!(
|
|
301
|
-
return
|
|
302
|
+
const i = () => {
|
|
303
|
+
if (!(n.searcherKey.value === D || n.searcherKey.value === S))
|
|
304
|
+
return n.searcherKey.value;
|
|
302
305
|
}, f = () => {
|
|
303
|
-
if (e.onlySearcher || l.regionIndex.value ===
|
|
304
|
-
let
|
|
305
|
-
if (e.
|
|
306
|
-
const
|
|
307
|
-
|
|
306
|
+
if (e.onlySearcher || l.regionIndex.value === S) return;
|
|
307
|
+
let s = l.regionIndex.value;
|
|
308
|
+
if (e.forMode) {
|
|
309
|
+
const g = l.regionIndex.value;
|
|
310
|
+
s = wt(e.forMode, { searcher_key: i(), key: g }, e.searchers)?.index;
|
|
308
311
|
}
|
|
309
|
-
return
|
|
310
|
-
},
|
|
311
|
-
const
|
|
312
|
-
if (
|
|
313
|
-
return
|
|
312
|
+
return s;
|
|
313
|
+
}, u = () => {
|
|
314
|
+
const s = i();
|
|
315
|
+
if (s !== void 0)
|
|
316
|
+
return t.value.get(s);
|
|
314
317
|
};
|
|
315
318
|
return {
|
|
316
|
-
selectSearcher:
|
|
319
|
+
selectSearcher: n,
|
|
317
320
|
selectRegion: l,
|
|
318
|
-
compare:
|
|
319
|
-
searcherByKey:
|
|
320
|
-
allRegionsIndexes:
|
|
321
|
-
getSearcher:
|
|
321
|
+
compare: r,
|
|
322
|
+
searcherByKey: t,
|
|
323
|
+
allRegionsIndexes: o,
|
|
324
|
+
getSearcher: u,
|
|
322
325
|
getRegion: () => {
|
|
323
|
-
const
|
|
324
|
-
if (
|
|
325
|
-
return
|
|
326
|
+
const s = f();
|
|
327
|
+
if (s !== void 0)
|
|
328
|
+
return u()?.regionByIndex?.get(s);
|
|
326
329
|
}
|
|
327
330
|
};
|
|
328
|
-
},
|
|
331
|
+
}, Po = /* @__PURE__ */ K({
|
|
329
332
|
__name: "regionSelector",
|
|
330
|
-
props: /* @__PURE__ */
|
|
333
|
+
props: /* @__PURE__ */ L({
|
|
331
334
|
projectId: {},
|
|
332
335
|
searchers: { default: () => [] },
|
|
333
336
|
modelValue: {},
|
|
334
337
|
modelValueSingle: {},
|
|
335
338
|
addCompare: { type: Boolean },
|
|
336
|
-
|
|
339
|
+
forMode: {},
|
|
337
340
|
autoRegion: { type: Boolean },
|
|
338
341
|
onlySearcher: { type: Boolean },
|
|
339
342
|
addChanger: { type: Boolean, default: !0 },
|
|
@@ -346,84 +349,84 @@ const _e = { class: "top-competitorSelector" }, et = { class: "top-ellipsis1" },
|
|
|
346
349
|
modelValueSingleModifiers: {}
|
|
347
350
|
}),
|
|
348
351
|
emits: ["update:modelValue", "update:modelValueSingle"],
|
|
349
|
-
setup(e, { expose:
|
|
350
|
-
const
|
|
352
|
+
setup(e, { expose: t }) {
|
|
353
|
+
const a = e, o = P(e, "modelValue"), n = P(e, "modelValueSingle"), {
|
|
351
354
|
selectSearcher: l,
|
|
352
|
-
selectRegion:
|
|
353
|
-
compare:
|
|
355
|
+
selectRegion: r,
|
|
356
|
+
compare: i,
|
|
354
357
|
searcherByKey: f,
|
|
355
|
-
allRegionsIndexes:
|
|
356
|
-
getSearcher:
|
|
357
|
-
getRegion:
|
|
358
|
-
} =
|
|
358
|
+
allRegionsIndexes: u,
|
|
359
|
+
getSearcher: C,
|
|
360
|
+
getRegion: s
|
|
361
|
+
} = Et(a), g = () => {
|
|
359
362
|
const d = [];
|
|
360
|
-
f.value.forEach((
|
|
361
|
-
|
|
362
|
-
|
|
363
|
+
f.value.forEach((c) => {
|
|
364
|
+
c.enabled && c.regions.forEach((p) => {
|
|
365
|
+
p.enabled && d.push(p);
|
|
363
366
|
});
|
|
364
|
-
}),
|
|
367
|
+
}), Bt.open("regions", {
|
|
365
368
|
regions: d,
|
|
366
|
-
regionsIndexes:
|
|
367
|
-
"@update:regionsIndexes": (
|
|
369
|
+
regionsIndexes: i.regionsIndexes.value,
|
|
370
|
+
"@update:regionsIndexes": (c) => i.regionsIndexes.value = c
|
|
368
371
|
});
|
|
369
372
|
};
|
|
370
|
-
return
|
|
371
|
-
if (l.searcherKey.value ===
|
|
372
|
-
if (JSON.stringify(
|
|
373
|
+
return G([r.regionIndex, l.searcherKey, i.regionsIndexes], () => {
|
|
374
|
+
if (l.searcherKey.value === D && i.regionsIndexes.value.length) {
|
|
375
|
+
if (JSON.stringify(o.value) === JSON.stringify(i.regionsIndexes.value))
|
|
373
376
|
return;
|
|
374
|
-
|
|
377
|
+
o.value = [...i.regionsIndexes.value];
|
|
375
378
|
} else
|
|
376
|
-
|
|
377
|
-
!
|
|
378
|
-
}),
|
|
379
|
-
|
|
380
|
-
}, { immediate: !0 }),
|
|
381
|
-
if (
|
|
382
|
-
if (!
|
|
379
|
+
a.onlySearcher ? (o.value = [l.searcherKey.value], l.searcherKey.value === S && !a.autoRegion && (o.value.length = 0)) : (o.value = [r.regionIndex.value], r.regionIndex.value === S && !a.autoRegion && (o.value.length = 0));
|
|
380
|
+
!a.onlySearcher && !u.value.size && (l.searcherKey.value = S);
|
|
381
|
+
}), n.value && G(n, () => {
|
|
382
|
+
n.value && (o.value = [n.value]);
|
|
383
|
+
}, { immediate: !0 }), G(o, () => {
|
|
384
|
+
if (o.value[0] && (n.value = o.value[0]), a.onlySearcher) {
|
|
385
|
+
if (!o.value.length || o.value.length === 1 && !f.value.has(o.value[0]) || o.value.length === 1 && o.value[0] === S && !a.autoRegion) {
|
|
383
386
|
let d = f.value.keys().next().value;
|
|
384
|
-
d ===
|
|
387
|
+
d === S && !a.autoRegion && (d = void 0, n.value = S), d !== void 0 ? o.value = [d] : o.value.length = 0;
|
|
385
388
|
return;
|
|
386
389
|
}
|
|
387
|
-
if (
|
|
388
|
-
|
|
390
|
+
if (o.value.length > 1 && JSON.stringify(o.value) !== JSON.stringify(i.regionsIndexes.value)) {
|
|
391
|
+
o.value = [...i.regionsIndexes.value];
|
|
389
392
|
return;
|
|
390
393
|
}
|
|
391
394
|
} else {
|
|
392
|
-
let d = [...new Set(
|
|
393
|
-
if (
|
|
394
|
-
|
|
395
|
+
let d = [...new Set(o.value)], c = f.value.values().next().value?.regionByIndex?.keys().next().value;
|
|
396
|
+
if (a.forMode && (c = f.value.values().next().value?.regionByIndex?.values().next().value?.key), c === S && !a.autoRegion && (c = void 0, n.value = S), !d.length)
|
|
397
|
+
c !== void 0 && d.push(c);
|
|
395
398
|
else if (d.length === 1) {
|
|
396
|
-
let
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
399
|
+
let p = u.value;
|
|
400
|
+
a.forMode && (p = /* @__PURE__ */ new Set(), f.value.forEach((I) => {
|
|
401
|
+
I.regionByIndex.forEach((k) => {
|
|
402
|
+
k.index !== se && k.index !== S && p.add(k.key);
|
|
400
403
|
});
|
|
401
|
-
})),
|
|
404
|
+
})), p.has(d[0]) || (d = [], c !== void 0 && d.push(c));
|
|
402
405
|
} else
|
|
403
|
-
d = d.filter((
|
|
404
|
-
if (JSON.stringify(
|
|
405
|
-
|
|
406
|
+
d = d.filter((p) => u.value.has(p)), !d.length && c !== void 0 && d.push(c);
|
|
407
|
+
if (JSON.stringify(o.value) !== JSON.stringify(d)) {
|
|
408
|
+
o.value = d;
|
|
406
409
|
return;
|
|
407
410
|
}
|
|
408
411
|
}
|
|
409
|
-
if (!(
|
|
410
|
-
if (
|
|
411
|
-
if (
|
|
412
|
-
l.searcherKey.value =
|
|
412
|
+
if (!(o.value.length === 1 && o.value[0] === (a.onlySearcher ? l.searcherKey.value : r.regionIndex.value)))
|
|
413
|
+
if (a.onlySearcher) {
|
|
414
|
+
if (o.value.length === 1) {
|
|
415
|
+
l.searcherKey.value = o.value[0];
|
|
413
416
|
return;
|
|
414
417
|
}
|
|
415
|
-
l.searcherKey.value =
|
|
418
|
+
l.searcherKey.value = D;
|
|
416
419
|
return;
|
|
417
420
|
} else {
|
|
418
|
-
if (!
|
|
421
|
+
if (!o.value.length)
|
|
419
422
|
return;
|
|
420
|
-
if (
|
|
421
|
-
|
|
423
|
+
if (o.value.length === 1 && l.searcherKey.value !== D) {
|
|
424
|
+
r.regionIndex.value = o.value[0];
|
|
422
425
|
let d;
|
|
423
|
-
for (const
|
|
424
|
-
for (const
|
|
425
|
-
if ((
|
|
426
|
-
d =
|
|
426
|
+
for (const c of f.value.values()) {
|
|
427
|
+
for (const p of c.regionByIndex.values())
|
|
428
|
+
if ((a.forMode ? p.key : p.index) === r.regionIndex.value) {
|
|
429
|
+
d = c.key;
|
|
427
430
|
break;
|
|
428
431
|
}
|
|
429
432
|
if (d !== void 0)
|
|
@@ -431,78 +434,93 @@ const _e = { class: "top-competitorSelector" }, et = { class: "top-ellipsis1" },
|
|
|
431
434
|
}
|
|
432
435
|
d !== void 0 && (l.searcherKey.value = d);
|
|
433
436
|
} else
|
|
434
|
-
l.searcherKey.value =
|
|
437
|
+
l.searcherKey.value = D, i.regionsIndexes.value = [...o.value];
|
|
435
438
|
}
|
|
436
|
-
}, { immediate: !0 }),
|
|
437
|
-
getSearcher:
|
|
438
|
-
getRegion:
|
|
439
|
-
}), (d,
|
|
440
|
-
class:
|
|
439
|
+
}, { immediate: !0 }), t({
|
|
440
|
+
getSearcher: C,
|
|
441
|
+
getRegion: s
|
|
442
|
+
}), (d, c) => (h(), A("div", {
|
|
443
|
+
class: oe({
|
|
441
444
|
"top-selectorRegion": !0,
|
|
442
445
|
"top-selectorRegion-onlySearcher": e.onlySearcher
|
|
443
446
|
})
|
|
444
447
|
}, [
|
|
445
|
-
|
|
446
|
-
options:
|
|
447
|
-
modelValue:
|
|
448
|
-
"onUpdate:modelValue":
|
|
448
|
+
U(Ce, {
|
|
449
|
+
options: m(l).optionBySearcherKey.value,
|
|
450
|
+
modelValue: m(l).searcherKey.value,
|
|
451
|
+
"onUpdate:modelValue": c[0] || (c[0] = (p) => m(l).searcherKey.value = p),
|
|
449
452
|
name: "searcher_key",
|
|
450
453
|
addChanger: e.addChanger
|
|
451
454
|
}, null, 8, ["options", "modelValue", "addChanger"]),
|
|
452
|
-
!e.onlySearcher &&
|
|
455
|
+
!e.onlySearcher && m(l).searcherKey.value !== m(D) ? (h(), j(Ce, {
|
|
453
456
|
key: 0,
|
|
454
457
|
class: "top-select-region",
|
|
455
|
-
options:
|
|
456
|
-
modelValue:
|
|
457
|
-
"onUpdate:modelValue":
|
|
458
|
-
name: e.
|
|
458
|
+
options: m(r).optionByRegionIndex.value,
|
|
459
|
+
modelValue: m(r).regionIndex.value,
|
|
460
|
+
"onUpdate:modelValue": c[1] || (c[1] = (p) => m(r).regionIndex.value = p),
|
|
461
|
+
name: e.forMode ? "region_key" : "region_index",
|
|
459
462
|
addChanger: e.addChanger,
|
|
460
463
|
"data-top-icon": e.addRegionIcon ? "" : void 0
|
|
461
|
-
}, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) :
|
|
462
|
-
e.addCompare && !e.onlySearcher &&
|
|
464
|
+
}, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : E("", !0),
|
|
465
|
+
e.addCompare && !e.onlySearcher && m(l).searcherKey.value === m(D) ? (h(), j(ee, {
|
|
463
466
|
key: 1,
|
|
464
467
|
name: "compare",
|
|
465
|
-
onClick:
|
|
466
|
-
"data-count-compare-regions-indexes":
|
|
468
|
+
onClick: g,
|
|
469
|
+
"data-count-compare-regions-indexes": m(i).regionsIndexes.value.length
|
|
467
470
|
}, {
|
|
468
|
-
default:
|
|
469
|
-
|
|
471
|
+
default: w(() => [
|
|
472
|
+
H(b(d.$i18n.Common.Selected_regions), 1)
|
|
470
473
|
]),
|
|
471
474
|
_: 1
|
|
472
|
-
}, 8, ["data-count-compare-regions-indexes"])) :
|
|
475
|
+
}, 8, ["data-count-compare-regions-indexes"])) : E("", !0)
|
|
473
476
|
], 2));
|
|
474
477
|
}
|
|
475
|
-
}),
|
|
478
|
+
}), ue = (e) => (e = e.replace(/"/g, '"'), e.replace(/'/g, "'")), Be = (e) => ({
|
|
479
|
+
...e,
|
|
480
|
+
name: ue(e.name),
|
|
481
|
+
path: ue(e.path)
|
|
482
|
+
}), ce = (e) => {
|
|
483
|
+
const t = {
|
|
484
|
+
...e,
|
|
485
|
+
name: ue(e.name)
|
|
486
|
+
};
|
|
487
|
+
return "folder_path" in t && typeof t.folder_path == "string" && (t.folder_path = ue(t.folder_path)), t;
|
|
488
|
+
}, q = {
|
|
476
489
|
id: 0,
|
|
477
490
|
name: "/",
|
|
478
491
|
path: "/"
|
|
479
492
|
};
|
|
480
|
-
function
|
|
481
|
-
return e ?
|
|
493
|
+
function _t(e) {
|
|
494
|
+
return e ? B()?.Common.All_folders : "/ (" + B()?.Keywords.Root_folder + ")";
|
|
482
495
|
}
|
|
483
|
-
const
|
|
484
|
-
l = { ...l },
|
|
485
|
-
const
|
|
486
|
-
|
|
487
|
-
}),
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
496
|
+
const be = (e, t, a = /* @__PURE__ */ new Map(), o = { id: "root" }, n = 0) => (o.childsIds = [], o.id && (o.countAllGroupsActive = o.count_groups_active), e[o.id] && e[o.id].forEach((l) => {
|
|
497
|
+
l = { ...l }, o.childsIds.push(l.id), l.id === 0 && (l.name = _t(t));
|
|
498
|
+
const r = n > 1 ? "-".repeat(n - 1) + " " : "";
|
|
499
|
+
r && !l.name.startsWith(r) && (l.name = r + l.name), a.set(l.id, l), be(e, t, a, l, n + 1), o.childsIds = o.childsIds.concat(l.childsIds), o.id && l.count_groups_active && (o.countAllGroupsActive += l.count_groups_active);
|
|
500
|
+
}), a), Vt = (e, t) => {
|
|
501
|
+
const a = e.gen(`/get/${t}/folders/`, ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 });
|
|
502
|
+
return a.options.onApiLoaded = (o, n, l) => {
|
|
503
|
+
o.result && (o.result = o.result.map((r) => Be(r))), l?.(o, n);
|
|
504
|
+
}, a;
|
|
505
|
+
};
|
|
506
|
+
function ke(e, t, a) {
|
|
507
|
+
const o = Object.keys(e), n = o.map((l) => e[l]);
|
|
508
|
+
return G(n, (l, r, i) => {
|
|
491
509
|
const f = {};
|
|
492
|
-
l.forEach((
|
|
493
|
-
if (!Object.is(
|
|
494
|
-
const
|
|
495
|
-
f[
|
|
496
|
-
old:
|
|
497
|
-
new:
|
|
510
|
+
l.forEach((u, C) => {
|
|
511
|
+
if (!Object.is(u, r[C])) {
|
|
512
|
+
const s = o[C];
|
|
513
|
+
f[s] = {
|
|
514
|
+
old: r[C],
|
|
515
|
+
new: u
|
|
498
516
|
};
|
|
499
517
|
}
|
|
500
|
-
}), Object.keys(f).length &&
|
|
501
|
-
},
|
|
518
|
+
}), Object.keys(f).length && t(f, i);
|
|
519
|
+
}, a);
|
|
502
520
|
}
|
|
503
|
-
const
|
|
521
|
+
const Gt = /* @__PURE__ */ K({
|
|
504
522
|
__name: "folders",
|
|
505
|
-
props: /* @__PURE__ */
|
|
523
|
+
props: /* @__PURE__ */ L({
|
|
506
524
|
folderId: {},
|
|
507
525
|
folder: {},
|
|
508
526
|
folders: {},
|
|
@@ -515,64 +533,72 @@ const mt = /* @__PURE__ */ R({
|
|
|
515
533
|
}, {
|
|
516
534
|
folderId: { required: !0 },
|
|
517
535
|
folderIdModifiers: {},
|
|
518
|
-
folder: { default:
|
|
536
|
+
folder: { default: q },
|
|
519
537
|
folderModifiers: {}
|
|
520
538
|
}),
|
|
521
539
|
emits: ["update:folderId", "update:folder"],
|
|
522
540
|
setup(e) {
|
|
523
|
-
const
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
}),
|
|
528
|
-
|
|
541
|
+
const t = e, a = P(e, "folderId"), o = P(e, "folder"), n = t.client && !t.folders && t.service ? Vt(t.client, t.service) : void 0, l = _(null), r = M(() => {
|
|
542
|
+
const i = be(t.folders ?? { root: [q] }, t.canSelectAll), f = /* @__PURE__ */ new Map();
|
|
543
|
+
return i.forEach((u, C) => {
|
|
544
|
+
f.set(C, Be(u));
|
|
545
|
+
}), f;
|
|
546
|
+
});
|
|
547
|
+
return G(() => t.projectId, () => {
|
|
548
|
+
n?.changeParams({
|
|
549
|
+
project_id: t.projectId
|
|
550
|
+
}), n?.setOptions({
|
|
551
|
+
checkFingerprint: "TopGroupSelectorFolders:" + t.projectId
|
|
529
552
|
}), l.value?.resetCache();
|
|
530
|
-
}, { immediate: !0 })
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
}, async (u) => {
|
|
536
|
-
if (o.value === t.value.id)
|
|
553
|
+
}, { immediate: !0 }), ke({
|
|
554
|
+
modelFolder: o,
|
|
555
|
+
modelFolderId: a
|
|
556
|
+
}, async (i) => {
|
|
557
|
+
if (a.value === o.value.id)
|
|
537
558
|
return;
|
|
538
|
-
if (
|
|
539
|
-
|
|
559
|
+
if (i.modelFolder && !i.modelFolderId) {
|
|
560
|
+
a.value = o.value.id;
|
|
540
561
|
return;
|
|
541
562
|
}
|
|
542
|
-
let f =
|
|
543
|
-
f || (f =
|
|
544
|
-
}, { immediate: !0 }), (
|
|
563
|
+
let f = r.value.get(t.folderId);
|
|
564
|
+
f || (f = q), o.value = f, a.value = f.id;
|
|
565
|
+
}, { immediate: !0 }), (i, f) => (h(), j(we, {
|
|
545
566
|
class: "top-groupSelector_folder",
|
|
546
|
-
modelValue:
|
|
547
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
|
548
|
-
items: e.folders ? [...
|
|
567
|
+
modelValue: o.value,
|
|
568
|
+
"onUpdate:modelValue": f[0] || (f[0] = (u) => o.value = u),
|
|
569
|
+
items: e.folders ? [...r.value.values()] : void 0,
|
|
549
570
|
"search-type": "inline",
|
|
550
571
|
icon: e.addIcon ? "" : void 0,
|
|
551
|
-
api: e.folders ? void 0 :
|
|
552
|
-
apiSetSearchParams: (...
|
|
572
|
+
api: e.folders ? void 0 : m(n),
|
|
573
|
+
apiSetSearchParams: (...u) => m(ze)(...u, "name"),
|
|
553
574
|
addChanger: e.addChanger,
|
|
554
575
|
useCache: ""
|
|
555
576
|
}, null, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "addChanger"]));
|
|
556
577
|
}
|
|
557
|
-
}),
|
|
578
|
+
}), fe = {
|
|
558
579
|
id: -1,
|
|
559
580
|
name: "--",
|
|
560
|
-
folder_id:
|
|
561
|
-
folder_path:
|
|
562
|
-
},
|
|
563
|
-
id:
|
|
581
|
+
folder_id: q.id,
|
|
582
|
+
folder_path: q.path
|
|
583
|
+
}, ge = {
|
|
584
|
+
id: Ye,
|
|
564
585
|
name: "All groups",
|
|
565
|
-
folder_id:
|
|
566
|
-
folder_path:
|
|
567
|
-
},
|
|
586
|
+
folder_id: q.id,
|
|
587
|
+
folder_path: q.path
|
|
588
|
+
}, re = () => (ge.name = B()?.Common.All_groups, ge), tt = () => (ge.name = B()?.Keywords.Choose_group, ge), Lt = (e, t, a) => (e = [...e], t !== void 0 && (e = e.filter((o) => o.on == Number(t))), a && a.id && a.childsIds && (e = e.filter((o) => o.folder_id === a.id || a.childsIds.includes(o.folder_id))), e), Ge = (e, t) => {
|
|
589
|
+
const a = e.gen(`/get/${t}/groups/`, ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 });
|
|
590
|
+
return a.options.onApiLoaded = (o, n, l) => {
|
|
591
|
+
o.result && (o.result = o.result.map((r) => ce(r))), l?.(o, n);
|
|
592
|
+
}, a;
|
|
593
|
+
}, Rt = (e, t) => e.gen(`/add/${t}/groups/`), Kt = { class: "top-groupSelector_groupItem" }, Ot = {
|
|
568
594
|
key: 0,
|
|
569
595
|
class: "top-comment"
|
|
570
|
-
},
|
|
596
|
+
}, Ut = {
|
|
571
597
|
key: 1,
|
|
572
598
|
class: "top-groupSelector_groupItemFolderPath"
|
|
573
|
-
},
|
|
599
|
+
}, Nt = /* @__PURE__ */ K({
|
|
574
600
|
__name: "groups",
|
|
575
|
-
props: /* @__PURE__ */
|
|
601
|
+
props: /* @__PURE__ */ L({
|
|
576
602
|
groupId: {},
|
|
577
603
|
group: {},
|
|
578
604
|
projectId: {},
|
|
@@ -593,111 +619,116 @@ const mt = /* @__PURE__ */ R({
|
|
|
593
619
|
group: { required: !0 },
|
|
594
620
|
groupModifiers: {}
|
|
595
621
|
}),
|
|
596
|
-
emits: /* @__PURE__ */
|
|
597
|
-
setup(e, { emit:
|
|
598
|
-
const
|
|
599
|
-
|
|
600
|
-
project_id:
|
|
622
|
+
emits: /* @__PURE__ */ L(["addGroup"], ["update:groupId", "update:group"]),
|
|
623
|
+
setup(e, { emit: t }) {
|
|
624
|
+
const a = e, o = t, n = P(e, "groupId"), l = P(e, "group"), r = a.client && !a.groups && a.service ? Ge(a.client, a.service) : void 0, i = a.client && a.service ? Rt(a.client, a.service) : void 0, f = _(null), u = _(void 0), C = ie("folder_id", "EQUALS", [a.folder?.id ?? 0]);
|
|
625
|
+
r?.changeParams({
|
|
626
|
+
project_id: a.projectId,
|
|
601
627
|
folder_id_depth: !0,
|
|
602
628
|
filters: [
|
|
603
|
-
|
|
629
|
+
C
|
|
604
630
|
]
|
|
605
|
-
}),
|
|
606
|
-
const
|
|
607
|
-
|
|
631
|
+
}), a.on !== void 0 && r?.params.filters?.push(ie("on", "EQUALS", [Number(a.on)]));
|
|
632
|
+
const s = M(() => {
|
|
633
|
+
const c = u.value ?? a.groups;
|
|
634
|
+
if (c)
|
|
635
|
+
return c.map((p) => ce(p));
|
|
636
|
+
}), g = (c) => {
|
|
637
|
+
const p = ce(c);
|
|
638
|
+
l.value = p, n.value = p.id;
|
|
608
639
|
};
|
|
609
|
-
|
|
610
|
-
projectId: () =>
|
|
611
|
-
folderId: () =>
|
|
612
|
-
canSelectAll: () =>
|
|
613
|
-
}, (
|
|
614
|
-
if (
|
|
615
|
-
project_id:
|
|
616
|
-
}),
|
|
617
|
-
checkFingerprint: "TopGroupSelectorGroups:" +
|
|
618
|
-
})),
|
|
619
|
-
|
|
620
|
-
],
|
|
621
|
-
let
|
|
622
|
-
|
|
640
|
+
ke({
|
|
641
|
+
projectId: () => a.projectId,
|
|
642
|
+
folderId: () => a.folder?.id,
|
|
643
|
+
canSelectAll: () => a.canSelectAll
|
|
644
|
+
}, (c) => {
|
|
645
|
+
if (c.projectId && (r?.changeParams({
|
|
646
|
+
project_id: a.projectId
|
|
647
|
+
}), r?.setOptions({
|
|
648
|
+
checkFingerprint: "TopGroupSelectorGroups:" + a.projectId
|
|
649
|
+
})), c.folderId && (C.values = [
|
|
650
|
+
a.folder?.id ?? 0
|
|
651
|
+
], a.groups && (u.value = Lt(a.groups, a.on, a.folder))), f.value?.resetCache(), (c.folderId?.old !== void 0 || c.canSelectAll?.old !== void 0) && n.value !== ye) {
|
|
652
|
+
let p;
|
|
653
|
+
a.autoselect === "first" && (p = u.value?.[0], a.canSelectAll && (p = qe(re()))), (a.autoselect === "placeholder" || !p) && (p = tt()), g(p);
|
|
623
654
|
}
|
|
624
|
-
}, { immediate: !0 }),
|
|
655
|
+
}, { immediate: !0 }), ke({
|
|
625
656
|
modelGroup: l,
|
|
626
|
-
modelGroupId:
|
|
627
|
-
}, async (
|
|
628
|
-
if (
|
|
629
|
-
if (
|
|
630
|
-
|
|
657
|
+
modelGroupId: n
|
|
658
|
+
}, async (c) => {
|
|
659
|
+
if (n.value !== l.value.id) {
|
|
660
|
+
if (c.modelGroup && !c.modelGroupId) {
|
|
661
|
+
n.value = l.value.id;
|
|
631
662
|
return;
|
|
632
663
|
}
|
|
633
|
-
if (!(
|
|
634
|
-
if (
|
|
635
|
-
let
|
|
636
|
-
if (!
|
|
637
|
-
|
|
664
|
+
if (!(a.canAdd && n.value === ye)) {
|
|
665
|
+
if (a.groups) {
|
|
666
|
+
let p = u.value?.find((I) => I.id === n.value);
|
|
667
|
+
if (!p && a.canSelectAll && (p = re()), p)
|
|
668
|
+
g(p);
|
|
638
669
|
else {
|
|
639
|
-
const
|
|
640
|
-
|
|
670
|
+
const I = u.value?.[0];
|
|
671
|
+
I && !n.value ? g(I) : g(fe);
|
|
641
672
|
}
|
|
642
673
|
}
|
|
643
|
-
if (
|
|
644
|
-
const
|
|
645
|
-
project_id:
|
|
646
|
-
id:
|
|
674
|
+
if (a.client && !a.groups && a.service && (n.value || n.value === Ye && !a.canSelectAll)) {
|
|
675
|
+
const p = Ge(a.client, a.service).changeParams({
|
|
676
|
+
project_id: a.projectId,
|
|
677
|
+
id: n.value,
|
|
647
678
|
filters: [
|
|
648
|
-
|
|
679
|
+
C
|
|
649
680
|
]
|
|
650
681
|
});
|
|
651
|
-
|
|
652
|
-
checkFingerprint: "TopGroupSelectorFindGroup:" +
|
|
682
|
+
p?.setOptions({
|
|
683
|
+
checkFingerprint: "TopGroupSelectorFindGroup:" + a.projectId
|
|
653
684
|
});
|
|
654
|
-
const
|
|
655
|
-
if (!
|
|
656
|
-
!
|
|
685
|
+
const I = await p.call();
|
|
686
|
+
if (!I.errors?.length && !I.result) return;
|
|
687
|
+
!I.errors && I.result[0] ? g(I.result[0]) : g(fe);
|
|
657
688
|
}
|
|
658
689
|
}
|
|
659
690
|
}
|
|
660
691
|
}, { immediate: !0 });
|
|
661
|
-
const
|
|
662
|
-
if (
|
|
663
|
-
const
|
|
664
|
-
project_id:
|
|
665
|
-
names: [
|
|
666
|
-
to_id:
|
|
692
|
+
const d = async (c) => {
|
|
693
|
+
if (a.canAdd !== "api" || !i) return;
|
|
694
|
+
const p = l.value, I = await i.changeParams({
|
|
695
|
+
project_id: a.projectId,
|
|
696
|
+
names: [c.name],
|
|
697
|
+
to_id: a.folder?.id ?? q.id,
|
|
667
698
|
to_type: "in_folder_last"
|
|
668
699
|
}).call();
|
|
669
|
-
|
|
700
|
+
I.result ? (g(I.result), o("addGroup", I.result)) : g(p), f.value?.resetCache(!0);
|
|
670
701
|
};
|
|
671
|
-
return (
|
|
702
|
+
return (c, p) => (h(), j(we, {
|
|
672
703
|
ref_key: "refSelector",
|
|
673
704
|
ref: f,
|
|
674
705
|
class: "top-groupSelector_group",
|
|
675
706
|
modelValue: l.value,
|
|
676
|
-
"onUpdate:modelValue":
|
|
677
|
-
items:
|
|
707
|
+
"onUpdate:modelValue": p[0] || (p[0] = (I) => l.value = I),
|
|
708
|
+
items: s.value,
|
|
678
709
|
searchType: "inline",
|
|
679
710
|
icon: e.addIcon ? "" : void 0,
|
|
680
|
-
api: e.groups ? void 0 :
|
|
681
|
-
apiSetSearchParams: (...
|
|
711
|
+
api: e.groups ? void 0 : m(r),
|
|
712
|
+
apiSetSearchParams: (...I) => m(ze)(...I, "name"),
|
|
682
713
|
appendSearchToResult: !!e.canAdd,
|
|
683
|
-
useAllItem: e.canSelectAll ?
|
|
714
|
+
useAllItem: e.canSelectAll ? m(re)().name : !1,
|
|
684
715
|
addChanger: e.addChanger,
|
|
685
716
|
useCache: "",
|
|
686
|
-
onAppendItem:
|
|
717
|
+
onAppendItem: d
|
|
687
718
|
}, {
|
|
688
|
-
item:
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
719
|
+
item: w(({ item: I }) => [
|
|
720
|
+
N("div", Kt, [
|
|
721
|
+
I.id === m(ye) ? (h(), A("div", Ot, b(c.$i18n.Common.Add) + ": ", 1)) : E("", !0),
|
|
722
|
+
N("span", null, b(I.name), 1),
|
|
723
|
+
I.folder_path && e.showPath ? (h(), A("span", Ut, b(I.folder_path), 1)) : E("", !0)
|
|
693
724
|
])
|
|
694
725
|
]),
|
|
695
726
|
_: 1
|
|
696
727
|
}, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "appendSearchToResult", "useAllItem", "addChanger"]));
|
|
697
728
|
}
|
|
698
|
-
}),
|
|
729
|
+
}), Dt = { class: "top-groupSelector" }, Mo = /* @__PURE__ */ K({
|
|
699
730
|
__name: "groupSelector",
|
|
700
|
-
props: /* @__PURE__ */
|
|
731
|
+
props: /* @__PURE__ */ L({
|
|
701
732
|
folderId: {},
|
|
702
733
|
folder: {},
|
|
703
734
|
groupId: {},
|
|
@@ -707,7 +738,7 @@ const mt = /* @__PURE__ */ R({
|
|
|
707
738
|
groups: {},
|
|
708
739
|
on: { type: Boolean, default: void 0 },
|
|
709
740
|
canSelectAllGroups: { type: Boolean },
|
|
710
|
-
canAddGroup: {},
|
|
741
|
+
canAddGroup: { type: [String, Boolean] },
|
|
711
742
|
autoselect: { default: "first" },
|
|
712
743
|
addChanger: { type: Boolean, default: !0 },
|
|
713
744
|
showFolders: { type: Boolean, default: !0 },
|
|
@@ -722,26 +753,26 @@ const mt = /* @__PURE__ */ R({
|
|
|
722
753
|
folderModifiers: {},
|
|
723
754
|
groupId: { required: !0 },
|
|
724
755
|
groupIdModifiers: {},
|
|
725
|
-
group: { default:
|
|
756
|
+
group: { default: fe },
|
|
726
757
|
groupModifiers: {}
|
|
727
758
|
}),
|
|
728
|
-
emits: /* @__PURE__ */
|
|
729
|
-
setup(e, { emit:
|
|
730
|
-
const
|
|
731
|
-
|
|
732
|
-
let
|
|
733
|
-
l.value || (
|
|
734
|
-
const
|
|
735
|
-
let
|
|
736
|
-
|
|
759
|
+
emits: /* @__PURE__ */ L(["update:groups"], ["update:folderId", "update:folder", "update:groupId", "update:group"]),
|
|
760
|
+
setup(e, { emit: t }) {
|
|
761
|
+
const a = e, o = P(e, "folderId"), n = P(e, "folder"), l = P(e, "groupId"), r = P(e, "group"), i = t, f = be(a.folders ?? { root: [q] }, a.canSelectAllGroups);
|
|
762
|
+
n.value = f.get(o.value), n.value && (n.value = Be(n.value));
|
|
763
|
+
let u = a.groups?.find((s) => s.id === l.value);
|
|
764
|
+
l.value || (u = a.groups?.[0]), a.canSelectAllGroups && !u && (u = re()), (a.autoselect === "placeholder" || !u) && (u = tt()), u ??= fe, r.value = u, r.value = ce(r.value);
|
|
765
|
+
const C = (s) => {
|
|
766
|
+
let g;
|
|
767
|
+
a.groups && s && (g = [...a.groups, s]), i("update:groups", g);
|
|
737
768
|
};
|
|
738
|
-
return (
|
|
739
|
-
e.showFolders ? (h(),
|
|
769
|
+
return (s, g) => (h(), A("div", Dt, [
|
|
770
|
+
e.showFolders ? (h(), j(Gt, {
|
|
740
771
|
key: 0,
|
|
741
|
-
folderId:
|
|
742
|
-
"onUpdate:folderId":
|
|
743
|
-
folder:
|
|
744
|
-
"onUpdate:folder":
|
|
772
|
+
folderId: o.value,
|
|
773
|
+
"onUpdate:folderId": g[0] || (g[0] = (d) => o.value = d),
|
|
774
|
+
folder: n.value,
|
|
775
|
+
"onUpdate:folder": g[1] || (g[1] = (d) => n.value = d),
|
|
745
776
|
projectId: e.projectId,
|
|
746
777
|
folders: e.folders,
|
|
747
778
|
canSelectAll: e.canSelectAllGroups,
|
|
@@ -749,15 +780,15 @@ const mt = /* @__PURE__ */ R({
|
|
|
749
780
|
addIcon: e.addIcon,
|
|
750
781
|
client: e.client,
|
|
751
782
|
service: e.service
|
|
752
|
-
}, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client", "service"])) :
|
|
753
|
-
e.showGroups ? (h(),
|
|
783
|
+
}, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client", "service"])) : E("", !0),
|
|
784
|
+
e.showGroups ? (h(), j(Nt, {
|
|
754
785
|
key: 1,
|
|
755
786
|
groupId: l.value,
|
|
756
|
-
"onUpdate:groupId":
|
|
757
|
-
group:
|
|
758
|
-
"onUpdate:group":
|
|
787
|
+
"onUpdate:groupId": g[2] || (g[2] = (d) => l.value = d),
|
|
788
|
+
group: r.value,
|
|
789
|
+
"onUpdate:group": g[3] || (g[3] = (d) => r.value = d),
|
|
759
790
|
projectId: e.projectId,
|
|
760
|
-
folder:
|
|
791
|
+
folder: n.value,
|
|
761
792
|
groups: e.groups,
|
|
762
793
|
on: e.on,
|
|
763
794
|
canAdd: e.canAddGroup,
|
|
@@ -768,65 +799,417 @@ const mt = /* @__PURE__ */ R({
|
|
|
768
799
|
addIcon: e.addIcon,
|
|
769
800
|
client: e.client,
|
|
770
801
|
service: e.service,
|
|
771
|
-
onAddGroup:
|
|
772
|
-
}, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "showPath", "addIcon", "client", "service"])) :
|
|
802
|
+
onAddGroup: C
|
|
803
|
+
}, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "showPath", "addIcon", "client", "service"])) : E("", !0)
|
|
773
804
|
]));
|
|
774
805
|
}
|
|
775
|
-
}),
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
806
|
+
}), Ie = (e) => ({
|
|
807
|
+
id: null,
|
|
808
|
+
name: e,
|
|
809
|
+
listItemProps: {
|
|
810
|
+
type: "title"
|
|
811
|
+
}
|
|
812
|
+
}), Te = {
|
|
813
|
+
scheduledUpdate: !1,
|
|
814
|
+
manualUpdate: !1,
|
|
815
|
+
guestProjects: !1
|
|
816
|
+
}, Ft = (e, t) => {
|
|
817
|
+
const a = [], o = {
|
|
818
|
+
scheduledUpdate: Ie(B().Projects.Scheduled_update),
|
|
819
|
+
manualUpdate: Ie(B().Projects.Manual_update),
|
|
820
|
+
guestProjects: Ie(B().Projects.Guest_projects)
|
|
821
|
+
}, n = t ? {
|
|
822
|
+
scheduledUpdate: !1,
|
|
823
|
+
manualUpdate: !1,
|
|
824
|
+
guestProjects: !1
|
|
825
|
+
} : Te;
|
|
826
|
+
for (const l of e)
|
|
827
|
+
!n.scheduledUpdate && l.right?.startsWith("1") && l.on > 0 && (a.push(o.scheduledUpdate), n.scheduledUpdate = !0), !n.manualUpdate && l.right?.startsWith("1") && l.on === 0 && (a.push(o.manualUpdate), n.manualUpdate = !0), !n.guestProjects && l.right?.startsWith("0") && l.on >= 0 && (a.push(o.guestProjects), n.guestProjects = !0), a.push(l);
|
|
828
|
+
return a;
|
|
829
|
+
}, qt = (e) => e.map((t) => ({
|
|
830
|
+
...t,
|
|
831
|
+
listItemProps: {
|
|
832
|
+
attrs: { title: t.name }
|
|
833
|
+
}
|
|
834
|
+
})), Wt = (e, t, a) => {
|
|
835
|
+
if (!e || e.length === 0) return [];
|
|
836
|
+
t && Object.keys(Te).forEach((n) => Te[n] = !1);
|
|
837
|
+
const o = qt(e);
|
|
838
|
+
return Ft(o, a);
|
|
839
|
+
}, Ht = (e) => {
|
|
840
|
+
e = e.replace(/#.*/, "");
|
|
841
|
+
let t = location.hash;
|
|
842
|
+
return t = t.replace(/historyView=[^&]*/, ""), t = t.replace(/competitorsIds=[^&]*/, ""), t = t.replace(/searchersKeys=[^&]*/, ""), t = t.replace(/regionIndex=[^&]*/, ""), t = t.replace(/regionsIndexes=[^&]*/, ""), t = t.replace(/folderId=[^&]*/, ""), t = t.replace(/groupId=[^&]*/, ""), t = t.replace(/tags=[^&]*/, ""), window.mo?.getHash && !window.mo.getHash("dataSort").toString().includes("0000-00-00") && (t = t.replace(/dataSort=[^&]*/, "")), t = t.replace(/%22historyView%22:[^,]*,/, ""), t = t.replace(/%22competitorsIds%22:\[[^\]]*],/, ""), t = t.replace(/%22searchersKeys%22:\[[^\]]*],/, ""), t = t.replace(/%22regionIndex%22:[^,]*,/, ""), t = t.replace(/%22regionsIndexes%22:\[[^\]]*],/, ""), t = t.replace(/%22folderId%22:[^,]*,/, ""), t = t.replace(/%22groupId%22:[^,]*,/, ""), t = t.replace(/%22tagsIds%22:\[[^\]]*],/, ""), /%22dataSort%22:\{[^}]*0000-00-00[^}]*}/.test(t) || (t = t.replace(/%22dataSort%22:\{[^}]*},/, "")), e + t;
|
|
843
|
+
}, Le = (e, t) => {
|
|
844
|
+
t && t.target instanceof HTMLElement && Qe.close(t.target.closest(".top-popup-wrapper"));
|
|
845
|
+
const a = Ht(e);
|
|
846
|
+
location.href = a;
|
|
847
|
+
}, xe = (e) => {
|
|
848
|
+
const t = ot(), a = location.pathname.split("/");
|
|
849
|
+
let o = "project/dynamics/", n = "";
|
|
850
|
+
return a[1] == "project" && (o = a[1] + "/" + a[2] + "/"), a[2] == "settings" && (n = location.hash), ["watcher", "indexing", "sitemap", "audit", "direct", "adwords"].includes(a[4]) && (n = a[4] + "/"), "https://" + t + "/" + o + e + "/" + n;
|
|
851
|
+
}, ot = () => window.page?.subdomain ? window.location.host.replace(window.page?.subdomain + ".", "") : window.location.host, Re = (e) => {
|
|
852
|
+
let t = e.startsWith("http") ? e : "http://" + e;
|
|
853
|
+
return t = t.replace(/"/g, "%22"), t;
|
|
854
|
+
}, Jt = (e, t) => {
|
|
855
|
+
let a = e.params.filters ?? [];
|
|
856
|
+
a = a.filter((r) => r.name !== "GEN_SEARCH_STRING()");
|
|
857
|
+
const o = It(t), n = t.replace(/([[^$.|?*+()])/g, "\\$1"), l = o.replace(/([[^$.|?*+()])/g, "\\$1");
|
|
858
|
+
t && a.push(ie("GEN_SEARCH_STRING()", "REGEXP", [`(${n}|${l})`])), e.changeParams({ filters: a });
|
|
859
|
+
}, Ke = (e, t, a) => {
|
|
860
|
+
const o = e.gen("/get/projects_2/projects/", ["id", "user_id", "name", "url", "on", "right"]);
|
|
861
|
+
return o.params = {
|
|
862
|
+
...a,
|
|
863
|
+
filters: [
|
|
864
|
+
ie("on", "GREATER_THAN_EQUALS", [0])
|
|
865
|
+
],
|
|
866
|
+
orders: [
|
|
867
|
+
le("user_id", "DESC", [t]),
|
|
868
|
+
le("on", "DESC"),
|
|
869
|
+
le("favorite", "DESC"),
|
|
870
|
+
le("id", "DESC")
|
|
871
|
+
]
|
|
872
|
+
}, o.options.onApiLoaded = (n, l, r) => {
|
|
873
|
+
const i = l.data.filters.length === 1 && l.data.offset === 0 || l.data.limit === 1e3, f = l.data.limit === 100 && l.data.filters.length > 1 ? !0 : void 0;
|
|
874
|
+
n.result = Wt(n.result, i, f), r?.(n, l);
|
|
875
|
+
}, o;
|
|
876
|
+
}, zt = (e) => e.gen("/add/projects_2/projects/"), Yt = { class: "top-projectSelectorSubmenu_item" }, Qt = ["href", "title", "data-top-icon", "data-right"], Xt = { class: "top-projectSelectorSubmenu_item" }, Zt = ["href"], eo = /* @__PURE__ */ K({
|
|
877
|
+
__name: "submenu",
|
|
878
|
+
props: {
|
|
879
|
+
id: {},
|
|
880
|
+
right: {},
|
|
881
|
+
url: {}
|
|
882
|
+
},
|
|
883
|
+
setup(e) {
|
|
884
|
+
const t = e, a = B(), o = ot(), n = [
|
|
885
|
+
{
|
|
886
|
+
href: `https://${o}/project/keywords/${t.id}/`,
|
|
887
|
+
title: a.Common.Menu_phrases,
|
|
888
|
+
icon: "",
|
|
889
|
+
right: "2"
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
href: `https://${o}/project/dynamics/${t.id}/`,
|
|
893
|
+
title: a.Common.Menu_dynamics,
|
|
894
|
+
icon: "",
|
|
895
|
+
right: "1"
|
|
896
|
+
},
|
|
897
|
+
{
|
|
898
|
+
href: `https://${o}/project/snapshots/${t.id}/`,
|
|
899
|
+
title: a.Common.Menu_snapshots,
|
|
900
|
+
icon: "",
|
|
901
|
+
right: "1"
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
href: `https://${o}/project/competitors/${t.id}/`,
|
|
905
|
+
title: a.Common.Menu_competitors,
|
|
906
|
+
icon: "",
|
|
907
|
+
right: "1"
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
href: `https://${o}/project/analytics/${t.id}/`,
|
|
911
|
+
title: a.Common.Menu_analytics,
|
|
912
|
+
icon: "",
|
|
913
|
+
right: "5"
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
href: `https://${o}/project/broker/${t.id}/`,
|
|
917
|
+
title: a.Common.Menu_broker,
|
|
918
|
+
icon: "",
|
|
919
|
+
right: "6"
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
href: `https://${o}/project/audit/${t.id}/sitemap/`,
|
|
923
|
+
title: a.Audit.Sitemap_gen,
|
|
924
|
+
icon: "",
|
|
925
|
+
right: "8"
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
href: `https://${o}/project/audit/${t.id}/audit/`,
|
|
929
|
+
title: a.Common.Menu_audit,
|
|
930
|
+
icon: "",
|
|
931
|
+
right: "8"
|
|
932
|
+
},
|
|
933
|
+
{
|
|
934
|
+
href: `https://${o}/project/audit/${t.id}/indexing/`,
|
|
935
|
+
title: a.Audit.Indexing,
|
|
936
|
+
icon: "",
|
|
937
|
+
right: "8"
|
|
938
|
+
},
|
|
939
|
+
{
|
|
940
|
+
href: `https://${o}/project/audit/${t.id}/watcher/`,
|
|
941
|
+
title: a.Audit.Watcher,
|
|
942
|
+
icon: "",
|
|
943
|
+
right: "9"
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
href: `https://${o}/project/settings/${t.id}/`,
|
|
947
|
+
title: a.Common.Menu_settings,
|
|
948
|
+
icon: "",
|
|
949
|
+
right: "2"
|
|
950
|
+
}
|
|
951
|
+
], l = M(() => t.right.includes("0") ? n.filter((r) => t.right[r.right] === "1") : n);
|
|
952
|
+
return (r, i) => {
|
|
953
|
+
const f = We("TopButton");
|
|
954
|
+
return h(), j(m(je), {
|
|
955
|
+
class: "top-projectSelectorSubmenu",
|
|
956
|
+
notch: !1,
|
|
957
|
+
pos: "2"
|
|
958
|
+
}, {
|
|
959
|
+
opener: w(() => [
|
|
960
|
+
U(f, {
|
|
961
|
+
class: "top-projectSelectorSubmenu_opener",
|
|
962
|
+
"data-top-icon": "",
|
|
963
|
+
color: "theme"
|
|
964
|
+
})
|
|
965
|
+
]),
|
|
966
|
+
contentList: w(() => [
|
|
967
|
+
(h(!0), A(F, null, ve(l.value, (u) => (h(), A("li", Yt, [
|
|
968
|
+
N("a", {
|
|
969
|
+
href: u.href,
|
|
970
|
+
title: u.title,
|
|
971
|
+
"data-top-icon": u.icon,
|
|
972
|
+
"data-right": u.right
|
|
973
|
+
}, null, 8, Qt)
|
|
974
|
+
]))), 256)),
|
|
975
|
+
N("li", Xt, [
|
|
976
|
+
N("a", {
|
|
977
|
+
href: e.url,
|
|
978
|
+
"data-top-icon": "",
|
|
979
|
+
target: "_blank"
|
|
980
|
+
}, null, 8, Zt)
|
|
981
|
+
])
|
|
982
|
+
]),
|
|
983
|
+
_: 1
|
|
984
|
+
});
|
|
985
|
+
};
|
|
986
|
+
}
|
|
987
|
+
}), me = "ui_project_selector_total:", to = 1440 * 60 * 1e3, V = He(), at = _(0), Q = _(null), Oe = (e, t) => {
|
|
988
|
+
localStorage.setItem(
|
|
989
|
+
me + e,
|
|
990
|
+
JSON.stringify({ projectsTotal: t, expiresAt: Date.now() + to })
|
|
991
|
+
);
|
|
992
|
+
}, oo = (e) => {
|
|
993
|
+
const t = localStorage.getItem(me + e);
|
|
994
|
+
if (!t) return;
|
|
995
|
+
const { projectsTotal: a, expiresAt: o } = JSON.parse(t);
|
|
996
|
+
if (Date.now() > o) {
|
|
997
|
+
localStorage.removeItem(me + e);
|
|
998
|
+
return;
|
|
999
|
+
}
|
|
1000
|
+
return a;
|
|
1001
|
+
}, ao = (e, t = !0) => {
|
|
1002
|
+
V.value = void 0, localStorage.removeItem(me + e), t && at.value++;
|
|
1003
|
+
}, lo = { class: "top-projectSelector_item" }, no = { class: "top-projectSelector_itemText" }, ro = { class: "top-comment" }, io = {
|
|
1004
|
+
key: 0,
|
|
1005
|
+
class: "top-comment"
|
|
1006
|
+
}, so = ["href", "onClick"], Ue = 1e3, Eo = /* @__PURE__ */ K({
|
|
1007
|
+
__name: "projectSelector",
|
|
1008
|
+
props: /* @__PURE__ */ L({
|
|
1009
|
+
modelValue: {},
|
|
1010
|
+
client: {},
|
|
1011
|
+
addLinksToProjects: { type: Boolean, default: !0 },
|
|
1012
|
+
excludeProjectId: {},
|
|
1013
|
+
modificator: {},
|
|
1014
|
+
placeholder: {},
|
|
1015
|
+
buttonProps: {},
|
|
1016
|
+
openerShortcut: {}
|
|
1017
|
+
}, {
|
|
1018
|
+
modelValue: { default: { id: null, name: "" } },
|
|
1019
|
+
modelModifiers: {}
|
|
1020
|
+
}),
|
|
1021
|
+
emits: ["update:modelValue"],
|
|
1022
|
+
setup(e) {
|
|
1023
|
+
const t = B();
|
|
1024
|
+
if (!window.mo?.user?.id)
|
|
1025
|
+
throw new Error("TopProjectSelector: не удалось определить userId. Компонент требует авторизованного пользователя (см. window.mo.user.id)");
|
|
1026
|
+
const a = window.mo.user.id, o = e, n = P(e, "modelValue"), l = Ke(
|
|
1027
|
+
o.client,
|
|
1028
|
+
a
|
|
1029
|
+
), r = zt(o.client), i = _(oo(a)), f = _(null), u = M(() => o.placeholder ?? t.Projects.Select_project), C = M(() => !V.value || !o.excludeProjectId ? V.value : V.value.filter((k) => k.id !== o.excludeProjectId)), s = M(() => {
|
|
1030
|
+
if (!(!i.value && i.value !== 0))
|
|
1031
|
+
return i.value < Ue ? "static" : "api";
|
|
1032
|
+
});
|
|
1033
|
+
G(at, () => {
|
|
1034
|
+
p();
|
|
1035
|
+
}), G(n, () => {
|
|
1036
|
+
!n.value.id || !o.addLinksToProjects || Le(xe(n.value.id));
|
|
1037
|
+
});
|
|
1038
|
+
const g = async () => {
|
|
1039
|
+
if (!Q.value) {
|
|
1040
|
+
const R = Ke(
|
|
1041
|
+
o.client,
|
|
1042
|
+
a,
|
|
1043
|
+
{ limit: Ue }
|
|
1044
|
+
);
|
|
1045
|
+
Q.value = R.call();
|
|
1046
|
+
}
|
|
1047
|
+
const k = await Q.value;
|
|
1048
|
+
if (k.errors) {
|
|
1049
|
+
Q.value = null;
|
|
1050
|
+
return;
|
|
1051
|
+
}
|
|
1052
|
+
return Q.value = null, k;
|
|
1053
|
+
}, d = async () => {
|
|
1054
|
+
if (i.value) return;
|
|
1055
|
+
const k = await g();
|
|
1056
|
+
k && (i.value = k.total, s.value === "static" && !V.value && (V.value = k.result), i.value && Oe(a, i.value));
|
|
1057
|
+
}, c = async (k) => {
|
|
1058
|
+
const R = await r.changeParams({
|
|
1059
|
+
url: k.name,
|
|
1060
|
+
name: k.name
|
|
1061
|
+
}).call();
|
|
1062
|
+
if (!R.errors) {
|
|
1063
|
+
if (V.value && s.value === "static") {
|
|
1064
|
+
const y = {
|
|
1065
|
+
id: Number(R.result),
|
|
1066
|
+
user_id: a,
|
|
1067
|
+
name: k.name,
|
|
1068
|
+
url: k.name,
|
|
1069
|
+
on: 0,
|
|
1070
|
+
right: "11111111111111111111",
|
|
1071
|
+
listItemProps: {
|
|
1072
|
+
attrs: { title: k.name }
|
|
1073
|
+
}
|
|
1074
|
+
}, v = V.value.findIndex((x) => x.on === 0);
|
|
1075
|
+
V.value = [
|
|
1076
|
+
...V.value.slice(0, v),
|
|
1077
|
+
y,
|
|
1078
|
+
...V.value.slice(v)
|
|
1079
|
+
], i.value && (i.value += 1, Oe(a, i.value));
|
|
1080
|
+
}
|
|
1081
|
+
s.value === "api" && ao(a);
|
|
1082
|
+
}
|
|
1083
|
+
}, p = () => {
|
|
1084
|
+
s.value === "api" && f.value?.resetCache(!0);
|
|
1085
|
+
}, I = async () => {
|
|
1086
|
+
if (V.value || s.value !== "static") return;
|
|
1087
|
+
const k = await g();
|
|
1088
|
+
k && (V.value = k.result);
|
|
1089
|
+
};
|
|
1090
|
+
return lt(async () => {
|
|
1091
|
+
await d();
|
|
1092
|
+
}), (k, R) => {
|
|
1093
|
+
const y = We("TopButton");
|
|
1094
|
+
return h(), j(we, {
|
|
1095
|
+
ref_key: "refSelector",
|
|
1096
|
+
ref: f,
|
|
1097
|
+
class: "top-projectSelector",
|
|
1098
|
+
modelValue: n.value,
|
|
1099
|
+
"onUpdate:modelValue": R[1] || (R[1] = (v) => n.value = v),
|
|
1100
|
+
items: C.value,
|
|
1101
|
+
title: k.$i18n.Projects.Search_projects,
|
|
1102
|
+
modificator: e.modificator,
|
|
1103
|
+
searchFields: ["id", "name", "url"],
|
|
1104
|
+
placeholder: u.value,
|
|
1105
|
+
hasCloserBtn: "",
|
|
1106
|
+
api: s.value === "api" ? m(l) : void 0,
|
|
1107
|
+
apiSetSearchParams: s.value === "api" ? (...v) => m(Jt)(...v) : void 0,
|
|
1108
|
+
useCache: "",
|
|
1109
|
+
appendSearchToResult: "",
|
|
1110
|
+
appendSearchAllowDuplicate: "",
|
|
1111
|
+
appendSearchToResultCond: m(yt),
|
|
1112
|
+
appendWithoutSelect: "",
|
|
1113
|
+
buttonProps: e.buttonProps,
|
|
1114
|
+
openerShortcut: e.openerShortcut,
|
|
1115
|
+
onAppendItem: c,
|
|
1116
|
+
onOpen: I
|
|
1117
|
+
}, {
|
|
1118
|
+
item: w(({ item: v }) => [
|
|
1119
|
+
N("div", lo, [
|
|
1120
|
+
N("div", no, [
|
|
1121
|
+
v.id ? (h(), A(F, { key: 0 }, [
|
|
1122
|
+
H(b(m(St)(v.name, 20)) + " ", 1),
|
|
1123
|
+
N("span", ro, " id " + b(v.id), 1)
|
|
1124
|
+
], 64)) : (h(), A(F, { key: 1 }, [
|
|
1125
|
+
v.listItemProps?.type ? E("", !0) : (h(), A("div", io, b(k.$i18n.Projects.Add_project) + ": ", 1)),
|
|
1126
|
+
H(" " + b(v.name), 1)
|
|
1127
|
+
], 64))
|
|
1128
|
+
]),
|
|
1129
|
+
v.id ? (h(), A(F, { key: 0 }, [
|
|
1130
|
+
e.addLinksToProjects ? (h(), A("a", {
|
|
1131
|
+
key: 0,
|
|
1132
|
+
class: "top-projectSelector_itemLink",
|
|
1133
|
+
href: m(xe)(v.id),
|
|
1134
|
+
onClick: W((x) => m(Le)(m(xe)(v.id), x), ["prevent", "stop"])
|
|
1135
|
+
}, null, 8, so)) : E("", !0),
|
|
1136
|
+
k.$core.state.isMobile ? E("", !0) : (h(), j(y, {
|
|
1137
|
+
key: 1,
|
|
1138
|
+
class: "top-projectSelector_itemExtLink",
|
|
1139
|
+
href: m(Re)(v.url),
|
|
1140
|
+
"data-top-icon": "",
|
|
1141
|
+
color: "theme",
|
|
1142
|
+
target: "_blank",
|
|
1143
|
+
onClick: R[0] || (R[0] = W(() => {
|
|
1144
|
+
}, ["stop"]))
|
|
1145
|
+
}, null, 8, ["href"])),
|
|
1146
|
+
U(eo, {
|
|
1147
|
+
id: v.id,
|
|
1148
|
+
right: v.right ?? void 0,
|
|
1149
|
+
url: m(Re)(v.url)
|
|
1150
|
+
}, null, 8, ["id", "right", "url"])
|
|
1151
|
+
], 64)) : E("", !0)
|
|
1152
|
+
])
|
|
1153
|
+
]),
|
|
1154
|
+
_: 1
|
|
1155
|
+
}, 8, ["modelValue", "items", "title", "modificator", "placeholder", "api", "apiSetSearchParams", "appendSearchToResultCond", "buttonProps", "openerShortcut"]);
|
|
1156
|
+
};
|
|
1157
|
+
}
|
|
1158
|
+
}), Ne = (e) => "-" + e, te = (e) => e[0] === "-" ? e.substring(1) : e, pe = (e, t) => {
|
|
1159
|
+
e = te(e);
|
|
1160
|
+
const a = t.find((o) => o.id === e);
|
|
1161
|
+
if (a)
|
|
1162
|
+
return a;
|
|
1163
|
+
}, _o = (e, t, a) => {
|
|
1164
|
+
t || (t = { id: e.id }), t.id = e.id, t.pos ??= "3", t.notch ??= !0, t.posBy ??= "fixed";
|
|
1165
|
+
const o = Qe.genElPopupOpener("div", t);
|
|
1166
|
+
return o.classList.add("top-tagSelector"), e.useTopButton && o.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), e.useTopButton || o.classList.add("top-tagSelector-custom"), e.mode === "filter" && o.classList.add("top-tagSelector-filter"), e.mode === "setter" && !e.filters && o.classList.add("top-tagSelector-setter_single"), e.mode === "setter" && e.filters && o.classList.add("top-tagSelector-setter_several"), o.onclick = (n) => {
|
|
1167
|
+
n.preventDefault(), n.stopPropagation(), o.onclick = null;
|
|
1168
|
+
const l = _(e.modelValue), r = {
|
|
786
1169
|
model: l,
|
|
787
1170
|
mode: e.mode,
|
|
788
1171
|
targetId: e.targetId,
|
|
789
1172
|
filters: e.filters,
|
|
790
1173
|
payload: e.payload
|
|
791
1174
|
};
|
|
792
|
-
|
|
793
|
-
e.modelValue = l.value,
|
|
794
|
-
}),
|
|
795
|
-
},
|
|
796
|
-
e.modelValue =
|
|
797
|
-
const l =
|
|
798
|
-
l && (l.model.value =
|
|
799
|
-
}),
|
|
800
|
-
},
|
|
801
|
-
|
|
802
|
-
},
|
|
803
|
-
const
|
|
804
|
-
if (e.classList.toggle("top-tagSelector-selectedOne", !
|
|
805
|
-
e.innerHTML = `<div>${
|
|
1175
|
+
Z(o, "topTagSelectorTarget", r), delete o.dataset.topPopupDisabled, Me(e.modelValue) || G(l, () => {
|
|
1176
|
+
e.modelValue = l.value, ne(o, e, a);
|
|
1177
|
+
}), o.click();
|
|
1178
|
+
}, Me(e.modelValue) ? G(e.modelValue, () => ne(o, e, a)) : Z(o, "topTagSelectorRender", (n) => {
|
|
1179
|
+
e.modelValue = n;
|
|
1180
|
+
const l = Z(o, "topTagSelectorTarget");
|
|
1181
|
+
l && (l.model.value = n), ne(o, e, a);
|
|
1182
|
+
}), ne(o, e, a), o;
|
|
1183
|
+
}, Vo = (e, t) => {
|
|
1184
|
+
Z(e, "topTagSelectorRender")?.(t);
|
|
1185
|
+
}, ne = (e, t, a) => {
|
|
1186
|
+
const o = m(t.modelValue);
|
|
1187
|
+
if (e.classList.toggle("top-tagSelector-selectedOne", !o.length || o.length === 1), e.classList.toggle("top-tagSelector-toTwoLine", o.length > 5), t.mode === "setter" && t.filters) {
|
|
1188
|
+
e.innerHTML = `<div>${a}</div>`;
|
|
806
1189
|
return;
|
|
807
1190
|
}
|
|
808
|
-
if (e.innerHTML = "", !
|
|
809
|
-
const
|
|
1191
|
+
if (e.innerHTML = "", !o.length && t.mode === "filter") {
|
|
1192
|
+
const n = De({
|
|
810
1193
|
id: "all",
|
|
811
1194
|
colorId: "",
|
|
812
|
-
name:
|
|
1195
|
+
name: B().Common?.All_tags ?? "",
|
|
813
1196
|
state: ""
|
|
814
1197
|
});
|
|
815
|
-
e.append(
|
|
1198
|
+
e.append(n);
|
|
816
1199
|
}
|
|
817
|
-
|
|
818
|
-
const l =
|
|
819
|
-
id:
|
|
820
|
-
colorId:
|
|
821
|
-
name:
|
|
822
|
-
state:
|
|
1200
|
+
o.forEach((n) => {
|
|
1201
|
+
const l = De({
|
|
1202
|
+
id: te(n),
|
|
1203
|
+
colorId: pe(n, t.tags)?.color_id ?? "",
|
|
1204
|
+
name: pe(n, t.tags)?.name ?? "",
|
|
1205
|
+
state: te(n) === n ? "selected" : "excluded"
|
|
823
1206
|
});
|
|
824
1207
|
e.append(l);
|
|
825
1208
|
});
|
|
826
|
-
},
|
|
827
|
-
const
|
|
828
|
-
return
|
|
829
|
-
},
|
|
1209
|
+
}, De = (e) => {
|
|
1210
|
+
const t = document.createElement("div");
|
|
1211
|
+
return t.classList.add("top-tagSelector_tagIcon"), t.classList.toggle("top-tagSelector-active", !!e.state), t.classList.toggle("top-tagSelector-excluded", e.state === "excluded"), t.dataset.tag_id = e.id, t.dataset.tag_color_id = e.colorId, t.title = e.name, t;
|
|
1212
|
+
}, uo = [
|
|
830
1213
|
{
|
|
831
1214
|
id: "1",
|
|
832
1215
|
name: "Without Tag",
|
|
@@ -877,7 +1260,7 @@ const mt = /* @__PURE__ */ R({
|
|
|
877
1260
|
name: "Turquoise",
|
|
878
1261
|
color_id: "10"
|
|
879
1262
|
}
|
|
880
|
-
],
|
|
1263
|
+
], co = ["data-tag_id", "data-tag_color_id", "title"], Ae = /* @__PURE__ */ K({
|
|
881
1264
|
__name: "tagIcon",
|
|
882
1265
|
props: {
|
|
883
1266
|
id: {},
|
|
@@ -886,8 +1269,8 @@ const mt = /* @__PURE__ */ R({
|
|
|
886
1269
|
state: {}
|
|
887
1270
|
},
|
|
888
1271
|
setup(e) {
|
|
889
|
-
return (
|
|
890
|
-
class:
|
|
1272
|
+
return (t, a) => (h(), A("div", {
|
|
1273
|
+
class: oe({
|
|
891
1274
|
"top-tagSelector_tagIcon": !0,
|
|
892
1275
|
"top-tagSelector-active": !!e.state,
|
|
893
1276
|
"top-tagSelector-excluded": e.state === "excluded"
|
|
@@ -895,11 +1278,11 @@ const mt = /* @__PURE__ */ R({
|
|
|
895
1278
|
"data-tag_id": e.id,
|
|
896
1279
|
"data-tag_color_id": e.colorId,
|
|
897
1280
|
title: e.name
|
|
898
|
-
}, null, 10,
|
|
1281
|
+
}, null, 10, co));
|
|
899
1282
|
}
|
|
900
|
-
}),
|
|
1283
|
+
}), fo = ["contenteditable", "onKeydown"], Fe = /* @__PURE__ */ K({
|
|
901
1284
|
__name: "tagPopupListItem",
|
|
902
|
-
props: /* @__PURE__ */
|
|
1285
|
+
props: /* @__PURE__ */ L({
|
|
903
1286
|
editable: { type: Boolean },
|
|
904
1287
|
disabled: { type: Boolean },
|
|
905
1288
|
canExclude: { type: Boolean },
|
|
@@ -913,74 +1296,74 @@ const mt = /* @__PURE__ */ R({
|
|
|
913
1296
|
},
|
|
914
1297
|
nameModifiers: {}
|
|
915
1298
|
}),
|
|
916
|
-
emits: /* @__PURE__ */
|
|
917
|
-
setup(e, { emit:
|
|
918
|
-
const
|
|
919
|
-
contenteditable:
|
|
920
|
-
onpaste: (
|
|
921
|
-
} : {}),
|
|
922
|
-
|
|
923
|
-
},
|
|
924
|
-
const
|
|
925
|
-
if (!
|
|
926
|
-
l.value && (l.value.innerText =
|
|
927
|
-
},
|
|
928
|
-
l.value && (l.value.innerText =
|
|
929
|
-
},
|
|
930
|
-
if (
|
|
1299
|
+
emits: /* @__PURE__ */ L(["update:name", "unselect", "exclude", "select"], ["update:name"]),
|
|
1300
|
+
setup(e, { emit: t }) {
|
|
1301
|
+
const a = e, o = t, n = P(e, "name"), l = _(null), r = M(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
|
|
1302
|
+
contenteditable: i.value,
|
|
1303
|
+
onpaste: (g) => g.preventDefault()
|
|
1304
|
+
} : {}), i = _(!1), f = async () => {
|
|
1305
|
+
i.value = !0, await nt(), l.value?.focus();
|
|
1306
|
+
}, u = () => {
|
|
1307
|
+
const g = l.value?.innerText;
|
|
1308
|
+
if (!g) return C();
|
|
1309
|
+
l.value && (l.value.innerText = g), i.value = !1, o("update:name", g);
|
|
1310
|
+
}, C = async () => {
|
|
1311
|
+
l.value && (l.value.innerText = a.name), i.value = !1;
|
|
1312
|
+
}, s = (g) => {
|
|
1313
|
+
if (i.value || a.disabled) return;
|
|
931
1314
|
let d = "selected";
|
|
932
|
-
|
|
1315
|
+
a.canExclude && (g.ctrlKey || g.metaKey) && (d = "excluded"), a.state == d && (d = ""), d === "" && o("unselect"), d === "selected" && o("select"), d === "excluded" && o("exclude");
|
|
933
1316
|
};
|
|
934
|
-
return (
|
|
935
|
-
class:
|
|
1317
|
+
return (g, d) => (h(), j($e, {
|
|
1318
|
+
class: oe({
|
|
936
1319
|
"top-tagSelector_tagListItem": !0,
|
|
937
|
-
"top-tagSelector_tagListItem-inEdit":
|
|
1320
|
+
"top-tagSelector_tagListItem-inEdit": i.value,
|
|
938
1321
|
"top-tagSelector_tagListItem-disabled": e.disabled,
|
|
939
1322
|
"top-tagSelector_tagListItem-canExclude": e.canExclude,
|
|
940
1323
|
"top-tagSelector-active": !!e.state,
|
|
941
1324
|
"top-tagSelector-excluded": e.state === "excluded"
|
|
942
1325
|
}),
|
|
943
|
-
onClick:
|
|
1326
|
+
onClick: W(s, ["stop"])
|
|
944
1327
|
}, {
|
|
945
|
-
default:
|
|
946
|
-
|
|
1328
|
+
default: w(() => [
|
|
1329
|
+
U(Ae, {
|
|
947
1330
|
id: e.id,
|
|
948
|
-
name:
|
|
1331
|
+
name: n.value,
|
|
949
1332
|
colorId: e.colorId,
|
|
950
1333
|
state: e.state
|
|
951
1334
|
}, null, 8, ["id", "name", "colorId", "state"]),
|
|
952
|
-
|
|
1335
|
+
N("span", Je({
|
|
953
1336
|
ref_key: "elName",
|
|
954
1337
|
ref: l,
|
|
955
1338
|
class: "top-tagSelector_tagListItemName",
|
|
956
|
-
contenteditable:
|
|
957
|
-
},
|
|
1339
|
+
contenteditable: i.value ? "plaintext-only" : !1
|
|
1340
|
+
}, r.value, {
|
|
958
1341
|
onKeydown: [
|
|
959
|
-
|
|
960
|
-
|
|
1342
|
+
Ee(W(u, ["stop"]), ["enter"]),
|
|
1343
|
+
Ee(W(C, ["stop"]), ["esc"])
|
|
961
1344
|
]
|
|
962
|
-
}), b(
|
|
963
|
-
e.editable ? (h(), A(
|
|
964
|
-
|
|
1345
|
+
}), b(n.value), 17, fo),
|
|
1346
|
+
e.editable ? (h(), A(F, { key: 0 }, [
|
|
1347
|
+
i.value ? (h(), A("span", {
|
|
965
1348
|
key: 1,
|
|
966
1349
|
"data-top-icon": "",
|
|
967
1350
|
class: "top-tagSelector_edit",
|
|
968
|
-
onClick:
|
|
1351
|
+
onClick: W(u, ["stop"])
|
|
969
1352
|
})) : (h(), A("span", {
|
|
970
1353
|
key: 0,
|
|
971
1354
|
"data-top-icon": "",
|
|
972
1355
|
class: "top-tagSelector_edit",
|
|
973
1356
|
onClick: f
|
|
974
1357
|
}))
|
|
975
|
-
], 64)) :
|
|
1358
|
+
], 64)) : E("", !0)
|
|
976
1359
|
]),
|
|
977
1360
|
_: 1
|
|
978
1361
|
}, 8, ["class"]));
|
|
979
1362
|
}
|
|
980
|
-
}),
|
|
1363
|
+
}), go = { key: 1 }, mo = /* @__PURE__ */ K({
|
|
981
1364
|
inheritAttrs: !1,
|
|
982
1365
|
__name: "popupOpener",
|
|
983
|
-
props: /* @__PURE__ */
|
|
1366
|
+
props: /* @__PURE__ */ L({
|
|
984
1367
|
modelValue: {},
|
|
985
1368
|
id: {},
|
|
986
1369
|
tags: {},
|
|
@@ -998,47 +1381,47 @@ const mt = /* @__PURE__ */ R({
|
|
|
998
1381
|
}),
|
|
999
1382
|
emits: ["update:modelValue"],
|
|
1000
1383
|
setup(e) {
|
|
1001
|
-
const
|
|
1002
|
-
model:
|
|
1003
|
-
mode:
|
|
1004
|
-
targetId:
|
|
1005
|
-
filters:
|
|
1006
|
-
payload:
|
|
1384
|
+
const t = e, a = P(e, "modelValue"), o = t.useTopButton ? ee : "div", n = t.useTopButton ? "html" : "default", l = {
|
|
1385
|
+
model: a,
|
|
1386
|
+
mode: t.mode,
|
|
1387
|
+
targetId: t.targetId,
|
|
1388
|
+
filters: t.filters,
|
|
1389
|
+
payload: t.payload
|
|
1007
1390
|
};
|
|
1008
|
-
return (
|
|
1009
|
-
const f =
|
|
1010
|
-
return h(),
|
|
1011
|
-
default:
|
|
1012
|
-
|
|
1391
|
+
return (r, i) => {
|
|
1392
|
+
const f = rt("top-data");
|
|
1393
|
+
return h(), j(ft, { id: e.id }, {
|
|
1394
|
+
default: w(() => [
|
|
1395
|
+
it((h(), j(st(m(o)), Je({
|
|
1013
1396
|
class: {
|
|
1014
1397
|
"top-tagSelector": !0,
|
|
1015
|
-
"top-tagSelector-useTopButton":
|
|
1016
|
-
"top-tagSelector-custom": !
|
|
1017
|
-
"top-as-selector":
|
|
1018
|
-
"top-tagSelector-filter":
|
|
1019
|
-
"top-tagSelector-setter_single":
|
|
1020
|
-
"top-tagSelector-setter_several":
|
|
1021
|
-
"top-tagSelector-selectedOne": !
|
|
1022
|
-
"top-tagSelector-toTwoLine":
|
|
1398
|
+
"top-tagSelector-useTopButton": t.useTopButton,
|
|
1399
|
+
"top-tagSelector-custom": !t.useTopButton,
|
|
1400
|
+
"top-as-selector": t.useTopButton,
|
|
1401
|
+
"top-tagSelector-filter": t.mode === "filter",
|
|
1402
|
+
"top-tagSelector-setter_single": t.mode === "setter" && !e.filters,
|
|
1403
|
+
"top-tagSelector-setter_several": t.mode === "setter" && e.filters,
|
|
1404
|
+
"top-tagSelector-selectedOne": !a.value.length || a.value.length === 1,
|
|
1405
|
+
"top-tagSelector-toTwoLine": a.value.length > 5
|
|
1023
1406
|
},
|
|
1024
1407
|
color: "theme",
|
|
1025
1408
|
styling: e.styling
|
|
1026
|
-
},
|
|
1027
|
-
[
|
|
1028
|
-
!
|
|
1409
|
+
}, r.$attrs), {
|
|
1410
|
+
[m(n)]: w(() => [
|
|
1411
|
+
!a.value.length && e.mode === "filter" ? (h(), j(Ae, {
|
|
1029
1412
|
key: 0,
|
|
1030
1413
|
id: "all",
|
|
1031
1414
|
colorId: "",
|
|
1032
|
-
name:
|
|
1415
|
+
name: r.$i18n.Common.All_tags ?? "",
|
|
1033
1416
|
state: ""
|
|
1034
|
-
}, null, 8, ["name"])) :
|
|
1035
|
-
e.mode === "setter" && e.filters ? (h(), A("div",
|
|
1036
|
-
|
|
1037
|
-
])) : (h(!0), A(
|
|
1038
|
-
id:
|
|
1039
|
-
colorId:
|
|
1040
|
-
name:
|
|
1041
|
-
state:
|
|
1417
|
+
}, null, 8, ["name"])) : E("", !0),
|
|
1418
|
+
e.mode === "setter" && e.filters ? (h(), A("div", go, [
|
|
1419
|
+
dt(r.$slots, "default")
|
|
1420
|
+
])) : (h(!0), A(F, { key: 2 }, ve(a.value, (u) => (h(), j(Ae, {
|
|
1421
|
+
id: m(te)(u),
|
|
1422
|
+
colorId: m(pe)(u, e.tags)?.color_id ?? "",
|
|
1423
|
+
name: m(pe)(u, e.tags)?.name ?? "",
|
|
1424
|
+
state: m(te)(u) === u ? "selected" : "excluded"
|
|
1042
1425
|
}, null, 8, ["id", "colorId", "name", "state"]))), 256))
|
|
1043
1426
|
]),
|
|
1044
1427
|
_: 2
|
|
@@ -1050,9 +1433,9 @@ const mt = /* @__PURE__ */ R({
|
|
|
1050
1433
|
}, 8, ["id"]);
|
|
1051
1434
|
};
|
|
1052
1435
|
}
|
|
1053
|
-
}),
|
|
1436
|
+
}), Go = /* @__PURE__ */ K({
|
|
1054
1437
|
__name: "tagSelector",
|
|
1055
|
-
props: /* @__PURE__ */
|
|
1438
|
+
props: /* @__PURE__ */ L({
|
|
1056
1439
|
modelValue: {},
|
|
1057
1440
|
tags: {},
|
|
1058
1441
|
tagsEditable: { type: Boolean },
|
|
@@ -1070,177 +1453,177 @@ const mt = /* @__PURE__ */ R({
|
|
|
1070
1453
|
},
|
|
1071
1454
|
modelModifiers: {},
|
|
1072
1455
|
tags: {
|
|
1073
|
-
default:
|
|
1456
|
+
default: qe(uo)
|
|
1074
1457
|
},
|
|
1075
1458
|
tagsModifiers: {}
|
|
1076
1459
|
}),
|
|
1077
|
-
emits: /* @__PURE__ */
|
|
1078
|
-
setup(e, { emit:
|
|
1079
|
-
const
|
|
1080
|
-
|
|
1081
|
-
},
|
|
1082
|
-
|
|
1083
|
-
const f =
|
|
1084
|
-
const
|
|
1085
|
-
return
|
|
1460
|
+
emits: /* @__PURE__ */ L(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
|
|
1461
|
+
setup(e, { emit: t }) {
|
|
1462
|
+
const a = B(), o = e, n = P(e, "modelValue"), l = P(e, "tags"), r = t, i = ct((y, v) => {
|
|
1463
|
+
r(y, v);
|
|
1464
|
+
}, o.emitDelay);
|
|
1465
|
+
o.singleMode && !n.value.length && (n.value = [l.value[0].id]);
|
|
1466
|
+
const f = o.id ?? "top-popup-id-" + Math.random(), u = _("add"), C = () => {
|
|
1467
|
+
const y = " " + a.Common.Tags?.toLowerCase(), v = /* @__PURE__ */ new Map();
|
|
1468
|
+
return v.set("add", { value: "add", title: a.Common.Add + y }), v.set("replace", { value: "replace", title: a.Common.Replace + y }), v.set("delete", { value: "delete", title: a.Common.Delete + y }), v;
|
|
1086
1469
|
};
|
|
1087
|
-
let
|
|
1088
|
-
model:
|
|
1470
|
+
let s = He({
|
|
1471
|
+
model: n,
|
|
1089
1472
|
mode: "filter",
|
|
1090
1473
|
targetId: void 0,
|
|
1091
1474
|
filters: void 0,
|
|
1092
1475
|
payload: void 0
|
|
1093
1476
|
});
|
|
1094
|
-
|
|
1095
|
-
|
|
1477
|
+
G(n, () => {
|
|
1478
|
+
i("selector", n.value);
|
|
1096
1479
|
});
|
|
1097
|
-
const
|
|
1098
|
-
if (
|
|
1099
|
-
return
|
|
1100
|
-
}), d = (
|
|
1101
|
-
if (
|
|
1102
|
-
if (
|
|
1103
|
-
if (
|
|
1480
|
+
const g = M(() => {
|
|
1481
|
+
if (s.value.mode === "setter" && o.maxTagsForSetter && !s.value.filters)
|
|
1482
|
+
return s.value.model.value.length >= o.maxTagsForSetter;
|
|
1483
|
+
}), d = (y) => {
|
|
1484
|
+
if (y !== "all") {
|
|
1485
|
+
if (s.value.model.value.includes(y)) return "selected";
|
|
1486
|
+
if (s.value.model.value.includes(Ne(y))) return "excluded";
|
|
1104
1487
|
}
|
|
1105
|
-
return
|
|
1106
|
-
},
|
|
1107
|
-
const
|
|
1108
|
-
let
|
|
1109
|
-
|
|
1110
|
-
if (!
|
|
1111
|
-
const
|
|
1112
|
-
return
|
|
1113
|
-
}),
|
|
1114
|
-
tagsIds:
|
|
1115
|
-
targetId:
|
|
1116
|
-
payload:
|
|
1488
|
+
return y === "all" && !s.value.model.value.length ? "selected" : "";
|
|
1489
|
+
}, c = (y, v) => {
|
|
1490
|
+
const x = Ne(y);
|
|
1491
|
+
let T = s.value.model.value.filter((O) => O !== y && O !== x);
|
|
1492
|
+
v === "select" && T.push(y), v === "exclude" && T.push(x), s.value.mode === "setter" && s.value.targetId !== void 0 && o.requiredForSetter && (T.length || T.push("1"), T.length === 2 && s.value.model.value.length === 1 && s.value.model.value[0] === "1" && (T = T.filter((O) => O !== "1"))), o.singleMode && !s.value.filters && (T.length || (T = s.value.model.value), T.length > 1 && (T = [T[T.length - 1]])), T.sort((O, ae) => {
|
|
1493
|
+
if (!o.tags) return 0;
|
|
1494
|
+
const J = o.tags.findIndex((Y) => Y.id === O), z = o.tags.findIndex((Y) => Y.id === ae);
|
|
1495
|
+
return J - z;
|
|
1496
|
+
}), s.value.model.value = T, s.value.mode === "setter" && s.value.targetId !== void 0 && i("setter", {
|
|
1497
|
+
tagsIds: T,
|
|
1498
|
+
targetId: s.value.targetId,
|
|
1499
|
+
payload: s.value.payload
|
|
1117
1500
|
});
|
|
1118
|
-
},
|
|
1119
|
-
let
|
|
1120
|
-
return
|
|
1121
|
-
}),
|
|
1122
|
-
const
|
|
1123
|
-
if (!
|
|
1124
|
-
const
|
|
1501
|
+
}, p = M(() => {
|
|
1502
|
+
let y = "top-tagSelector_popup";
|
|
1503
|
+
return s.value.mode === "filter" && (y += " top-tagSelector_popup-filter"), s.value.mode === "setter" && (y += " top-tagSelector_popup-setter"), y;
|
|
1504
|
+
}), I = () => {
|
|
1505
|
+
const y = prompt("", "New tag");
|
|
1506
|
+
if (!y || y === "New tag") return;
|
|
1507
|
+
const v = l.value.length + 1;
|
|
1125
1508
|
l.value.push({
|
|
1126
|
-
id: String(
|
|
1127
|
-
name:
|
|
1128
|
-
color_id: String((
|
|
1129
|
-
}),
|
|
1130
|
-
},
|
|
1131
|
-
if (
|
|
1132
|
-
if (
|
|
1509
|
+
id: String(v),
|
|
1510
|
+
name: y,
|
|
1511
|
+
color_id: String((v - 1) % 10 + 1)
|
|
1512
|
+
}), r("tagsChanged", l.value);
|
|
1513
|
+
}, k = (y) => {
|
|
1514
|
+
if (s.value = Z(y.elPopupOpener, "topTagSelectorTarget"), !s.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
|
|
1515
|
+
if (s.value.filters && (u.value = "add", s.value.model.value = []), !X.$?.ui.sortable) {
|
|
1133
1516
|
console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
|
|
1134
1517
|
return;
|
|
1135
1518
|
}
|
|
1136
|
-
!
|
|
1519
|
+
!X.state.isMobile && !X.state.isMobileUA && l.value && $(y.elPopup).sortable({
|
|
1137
1520
|
items: 'li:has([data-tag_id]:not([data-tag_id="all"]))',
|
|
1138
1521
|
/**
|
|
1139
1522
|
* @todo Удалить `[contenteditable="true"]` через пол года после выхода версии firefox с поддержкой contenteditable plaintext-only, включая бета версии
|
|
1140
1523
|
*/
|
|
1141
1524
|
cancel: '[contenteditable="plaintext-only"], [contenteditable="true"]',
|
|
1142
1525
|
distance: 10,
|
|
1143
|
-
stop: function(
|
|
1526
|
+
stop: function(v, x) {
|
|
1144
1527
|
if (!l.value) return;
|
|
1145
|
-
const
|
|
1146
|
-
|
|
1528
|
+
const T = $(x.item).parent().find("[data-tag_id]"), O = [];
|
|
1529
|
+
T.each((ae, J) => {
|
|
1147
1530
|
if (!l.value) return;
|
|
1148
|
-
const
|
|
1149
|
-
|
|
1150
|
-
}), l.value.sort((
|
|
1151
|
-
const
|
|
1152
|
-
return
|
|
1153
|
-
}),
|
|
1531
|
+
const z = $(J).attr("data-tag_id");
|
|
1532
|
+
O.push(z);
|
|
1533
|
+
}), l.value.sort((ae, J) => {
|
|
1534
|
+
const z = O.findIndex((he) => he === ae.id), Y = O.findIndex((he) => he === J.id);
|
|
1535
|
+
return z - Y;
|
|
1536
|
+
}), i("tagsChanged", l.value);
|
|
1154
1537
|
}
|
|
1155
1538
|
});
|
|
1156
|
-
},
|
|
1157
|
-
|
|
1539
|
+
}, R = (y) => {
|
|
1540
|
+
X.$?.ui.sortable && $(y.elPopup).data("ui-sortable") && $(y.elPopup).sortable("destroy");
|
|
1158
1541
|
};
|
|
1159
|
-
return (
|
|
1160
|
-
|
|
1161
|
-
modelValue:
|
|
1162
|
-
"onUpdate:modelValue":
|
|
1163
|
-
id:
|
|
1542
|
+
return (y, v) => (h(), A(F, null, [
|
|
1543
|
+
U(mo, {
|
|
1544
|
+
modelValue: n.value,
|
|
1545
|
+
"onUpdate:modelValue": v[0] || (v[0] = (x) => n.value = x),
|
|
1546
|
+
id: m(f),
|
|
1164
1547
|
tags: l.value,
|
|
1165
1548
|
styling: e.styling,
|
|
1166
1549
|
mode: "filter",
|
|
1167
1550
|
useTopButton: e.useTopButton
|
|
1168
1551
|
}, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
|
|
1169
|
-
|
|
1170
|
-
id:
|
|
1171
|
-
class:
|
|
1172
|
-
onOpen:
|
|
1173
|
-
onClose:
|
|
1552
|
+
U(je, {
|
|
1553
|
+
id: m(f),
|
|
1554
|
+
class: oe(p.value),
|
|
1555
|
+
onOpen: v[4] || (v[4] = (x) => k(x)),
|
|
1556
|
+
onClose: v[5] || (v[5] = (x) => R(x)),
|
|
1174
1557
|
"transition-duration": 50
|
|
1175
|
-
},
|
|
1176
|
-
contentList:
|
|
1177
|
-
|
|
1558
|
+
}, ut({
|
|
1559
|
+
contentList: w(() => [
|
|
1560
|
+
m(s).mode === "filter" && !e.singleMode ? (h(), j(Fe, {
|
|
1178
1561
|
key: 0,
|
|
1179
1562
|
id: "all",
|
|
1180
1563
|
colorId: "",
|
|
1181
|
-
name:
|
|
1182
|
-
state:
|
|
1183
|
-
onSelect:
|
|
1184
|
-
}, null, 8, ["name", "state"])) :
|
|
1185
|
-
(h(!0), A(
|
|
1186
|
-
key:
|
|
1187
|
-
id:
|
|
1188
|
-
colorId:
|
|
1189
|
-
name:
|
|
1190
|
-
state: d(
|
|
1191
|
-
canExclude:
|
|
1564
|
+
name: y.$i18n.Common.All_tags ?? "",
|
|
1565
|
+
state: m(s).model.value.length ? "" : "selected",
|
|
1566
|
+
onSelect: v[3] || (v[3] = (x) => m(s).model.value = [])
|
|
1567
|
+
}, null, 8, ["name", "state"])) : E("", !0),
|
|
1568
|
+
(h(!0), A(F, null, ve(l.value, (x) => (h(), j(Fe, {
|
|
1569
|
+
key: x.id,
|
|
1570
|
+
id: x.id,
|
|
1571
|
+
colorId: x.color_id,
|
|
1572
|
+
name: x.name,
|
|
1573
|
+
state: d(x.id),
|
|
1574
|
+
canExclude: m(s).mode === "filter" && !e.singleMode,
|
|
1192
1575
|
editable: e.tagsEditable,
|
|
1193
|
-
disabled:
|
|
1194
|
-
onUnselect: (
|
|
1195
|
-
onSelect: (
|
|
1196
|
-
onExclude: (
|
|
1197
|
-
"onUpdate:name": (
|
|
1198
|
-
|
|
1576
|
+
disabled: g.value && d(x.id) === "",
|
|
1577
|
+
onUnselect: (T) => c(x.id, "unselect"),
|
|
1578
|
+
onSelect: (T) => c(x.id, "select"),
|
|
1579
|
+
onExclude: (T) => c(x.id, "exclude"),
|
|
1580
|
+
"onUpdate:name": (T) => {
|
|
1581
|
+
x.name = T, m(i)("tagsChanged", l.value);
|
|
1199
1582
|
}
|
|
1200
1583
|
}, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
|
|
1201
|
-
e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(),
|
|
1584
|
+
e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), j($e, {
|
|
1202
1585
|
key: 1,
|
|
1203
1586
|
"data-top-icon": "",
|
|
1204
|
-
onClick:
|
|
1587
|
+
onClick: W(I, ["stop"])
|
|
1205
1588
|
}, {
|
|
1206
|
-
default:
|
|
1207
|
-
|
|
1589
|
+
default: w(() => [
|
|
1590
|
+
H(b(y.$i18n.Common.Add), 1)
|
|
1208
1591
|
]),
|
|
1209
1592
|
_: 1
|
|
1210
|
-
})) :
|
|
1593
|
+
})) : E("", !0)
|
|
1211
1594
|
]),
|
|
1212
1595
|
_: 2
|
|
1213
1596
|
}, [
|
|
1214
|
-
|
|
1597
|
+
m(s).mode === "setter" && m(s).filters ? {
|
|
1215
1598
|
name: "header",
|
|
1216
|
-
fn:
|
|
1217
|
-
|
|
1218
|
-
modelValue:
|
|
1219
|
-
"onUpdate:modelValue":
|
|
1220
|
-
options:
|
|
1599
|
+
fn: w(() => [
|
|
1600
|
+
U(Ce, {
|
|
1601
|
+
modelValue: u.value,
|
|
1602
|
+
"onUpdate:modelValue": v[1] || (v[1] = (x) => u.value = x),
|
|
1603
|
+
options: C()
|
|
1221
1604
|
}, null, 8, ["modelValue", "options"])
|
|
1222
1605
|
]),
|
|
1223
1606
|
key: "0"
|
|
1224
1607
|
} : void 0,
|
|
1225
|
-
|
|
1608
|
+
m(s).mode === "setter" && m(s).filters ? {
|
|
1226
1609
|
name: "footer",
|
|
1227
|
-
fn:
|
|
1228
|
-
|
|
1229
|
-
default:
|
|
1230
|
-
|
|
1610
|
+
fn: w(() => [
|
|
1611
|
+
U(ee, { color: "theme" }, {
|
|
1612
|
+
default: w(() => [
|
|
1613
|
+
H(b(y.$i18n.Common.Cancel), 1)
|
|
1231
1614
|
]),
|
|
1232
1615
|
_: 1
|
|
1233
1616
|
}),
|
|
1234
|
-
|
|
1235
|
-
onClick:
|
|
1236
|
-
tagsIds:
|
|
1237
|
-
filters:
|
|
1238
|
-
filtersAction:
|
|
1239
|
-
payload:
|
|
1617
|
+
U(ee, {
|
|
1618
|
+
onClick: v[2] || (v[2] = (x) => m(i)("setter", {
|
|
1619
|
+
tagsIds: m(s).model.value,
|
|
1620
|
+
filters: m(s).filters,
|
|
1621
|
+
filtersAction: u.value,
|
|
1622
|
+
payload: m(s).payload
|
|
1240
1623
|
}))
|
|
1241
1624
|
}, {
|
|
1242
|
-
default:
|
|
1243
|
-
|
|
1625
|
+
default: w(() => [
|
|
1626
|
+
H(b(u.value === "add" ? y.$i18n.Common.Add : "") + " " + b(u.value === "replace" ? y.$i18n.Common.Replace : "") + " " + b(u.value === "delete" ? y.$i18n.Common.Delete : ""), 1)
|
|
1244
1627
|
]),
|
|
1245
1628
|
_: 1
|
|
1246
1629
|
})
|
|
@@ -1252,17 +1635,19 @@ const mt = /* @__PURE__ */ R({
|
|
|
1252
1635
|
}
|
|
1253
1636
|
});
|
|
1254
1637
|
export {
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1638
|
+
Bo as TopCompetitorSelector,
|
|
1639
|
+
Mo as TopGroupSelector,
|
|
1640
|
+
Eo as TopProjectSelector,
|
|
1641
|
+
Po as TopRegionSelector,
|
|
1642
|
+
Go as TopTagSelector,
|
|
1643
|
+
mo as TopTagSelectorPopupOpener,
|
|
1644
|
+
Ae as TopTagSelectorTagIcon,
|
|
1645
|
+
ao as clearCache,
|
|
1646
|
+
Bt as dialogRegionSelector,
|
|
1647
|
+
wt as findRegion,
|
|
1648
|
+
_o as genElTopTagSelectorPopupOpener,
|
|
1649
|
+
Ze as genSearcherByKey,
|
|
1650
|
+
Vo as renderElTopTagSelectorPopupOpener,
|
|
1651
|
+
bo as useItemsFromCompetitors
|
|
1267
1652
|
};
|
|
1268
1653
|
//# sourceMappingURL=project.js.map
|