@topvisor/ui 1.5.4-2 → 1.5.4-groupSelector.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/{api-_5LGo-V0.amd.js → api-DuS0Qura.amd.js} +2 -2
- package/.chunks/{api-_5LGo-V0.amd.js.map → api-DuS0Qura.amd.js.map} +1 -1
- package/.chunks/{api-_5LGo-V0.esm.js → api-DuS0Qura.esm.js} +2 -2
- package/.chunks/{api-_5LGo-V0.esm.js.map → api-DuS0Qura.esm.js.map} +1 -1
- package/.chunks/{app-6Z66TVYe.amd.js → app-BXCICBAa.amd.js} +2 -2
- package/.chunks/{app-6Z66TVYe.amd.js.map → app-BXCICBAa.amd.js.map} +1 -1
- package/.chunks/{app-6Z66TVYe.esm.js → app-BXCICBAa.esm.js} +6 -6
- package/.chunks/{app-6Z66TVYe.esm.js.map → app-BXCICBAa.esm.js.map} +1 -1
- package/.chunks/{datepicker-BDTqyuv7.amd.js → datepicker-BnBQNlTc.amd.js} +2 -2
- package/.chunks/{datepicker-BDTqyuv7.amd.js.map → datepicker-BnBQNlTc.amd.js.map} +1 -1
- package/.chunks/{datepicker-BDTqyuv7.esm.js → datepicker-BnBQNlTc.esm.js} +2 -2
- package/.chunks/{datepicker-BDTqyuv7.esm.js.map → datepicker-BnBQNlTc.esm.js.map} +1 -1
- package/.chunks/{dialog-ClEF_87z.amd.js → dialog-BPUICFiG.amd.js} +2 -2
- package/.chunks/{dialog-ClEF_87z.amd.js.map → dialog-BPUICFiG.amd.js.map} +1 -1
- package/.chunks/{dialog-ClEF_87z.esm.js → dialog-BPUICFiG.esm.js} +4 -4
- package/.chunks/{dialog-ClEF_87z.esm.js.map → dialog-BPUICFiG.esm.js.map} +1 -1
- package/.chunks/{dialog_regionSelectorRegions-B1vjbW-i.amd.js → dialog_regionSelectorRegions-BKvg82IO.amd.js} +2 -2
- package/.chunks/{dialog_regionSelectorRegions-B1vjbW-i.amd.js.map → dialog_regionSelectorRegions-BKvg82IO.amd.js.map} +1 -1
- package/.chunks/{dialog_regionSelectorRegions-B1vjbW-i.esm.js → dialog_regionSelectorRegions-BKvg82IO.esm.js} +5 -5
- package/.chunks/{dialog_regionSelectorRegions-B1vjbW-i.esm.js.map → dialog_regionSelectorRegions-BKvg82IO.esm.js.map} +1 -1
- package/.chunks/{dialogs-DFrx1Kl4.amd.js → dialogs-CbMNuvfF.amd.js} +2 -2
- package/.chunks/{dialogs-DFrx1Kl4.amd.js.map → dialogs-CbMNuvfF.amd.js.map} +1 -1
- package/.chunks/{dialogs-DFrx1Kl4.esm.js → dialogs-CbMNuvfF.esm.js} +3 -3
- package/.chunks/{dialogs-DFrx1Kl4.esm.js.map → dialogs-CbMNuvfF.esm.js.map} +1 -1
- package/.chunks/{forms-BboZ50-J.amd.js → forms-CdCS6WAQ.amd.js} +2 -2
- package/.chunks/forms-CdCS6WAQ.amd.js.map +1 -0
- package/.chunks/{forms-BboZ50-J.esm.js → forms-CdCS6WAQ.esm.js} +10 -8
- package/.chunks/{forms-BboZ50-J.esm.js.map → forms-CdCS6WAQ.esm.js.map} +1 -1
- package/.chunks/formsExt-Ck5q-jXI.amd.js +2 -0
- package/.chunks/formsExt-Ck5q-jXI.amd.js.map +1 -0
- package/.chunks/{formsExt-ILcRjD-o.esm.js → formsExt-Ck5q-jXI.esm.js} +20 -9
- package/.chunks/{formsExt-ILcRjD-o.esm.js.map → formsExt-Ck5q-jXI.esm.js.map} +1 -1
- package/.chunks/{notice-B84XdLbj.amd.js → notice-DA4p-RwX.amd.js} +2 -2
- package/.chunks/{notice-B84XdLbj.amd.js.map → notice-DA4p-RwX.amd.js.map} +1 -1
- package/.chunks/{notice-B84XdLbj.esm.js → notice-DA4p-RwX.esm.js} +2 -2
- package/.chunks/{notice-B84XdLbj.esm.js.map → notice-DA4p-RwX.esm.js.map} +1 -1
- package/.chunks/{popup-BEMxqg2s.amd.js → popup-CN7-bnQJ.amd.js} +2 -2
- package/.chunks/{popup-BEMxqg2s.amd.js.map → popup-CN7-bnQJ.amd.js.map} +1 -1
- package/.chunks/{popup-BEMxqg2s.esm.js → popup-CN7-bnQJ.esm.js} +3 -3
- package/.chunks/{popup-BEMxqg2s.esm.js.map → popup-CN7-bnQJ.esm.js.map} +1 -1
- package/.chunks/{popup-CgrKc5Db.amd.js → popup-DHCqvZzI.amd.js} +2 -2
- package/.chunks/popup-DHCqvZzI.amd.js.map +1 -0
- package/.chunks/{popup-CgrKc5Db.esm.js → popup-DHCqvZzI.esm.js} +8 -7
- package/.chunks/{popup-CgrKc5Db.esm.js.map → popup-DHCqvZzI.esm.js.map} +1 -1
- package/.chunks/{utils-DmmlQmsO.amd.js → utils-DrvuXyXl.amd.js} +2 -2
- package/.chunks/{utils-DmmlQmsO.amd.js.map → utils-DrvuXyXl.amd.js.map} +1 -1
- package/.chunks/{utils-DmmlQmsO.esm.js → utils-DrvuXyXl.esm.js} +3 -3
- package/.chunks/{utils-DmmlQmsO.esm.js.map → utils-DrvuXyXl.esm.js.map} +1 -1
- package/.chunks/{utils-B0qCve4y.amd.js → utils-lidKtVjF.amd.js} +2 -2
- package/.chunks/{utils-B0qCve4y.amd.js.map → utils-lidKtVjF.amd.js.map} +1 -1
- package/.chunks/{utils-B0qCve4y.esm.js → utils-lidKtVjF.esm.js} +4 -4
- package/.chunks/{utils-B0qCve4y.esm.js.map → utils-lidKtVjF.esm.js.map} +1 -1
- package/.chunks/{worker-DhqknASO.amd.js → worker-spLieexQ.amd.js} +2 -2
- package/.chunks/{worker-DhqknASO.amd.js.map → worker-spLieexQ.amd.js.map} +1 -1
- package/.chunks/{worker-DhqknASO.esm.js → worker-spLieexQ.esm.js} +3 -3
- package/.chunks/{worker-DhqknASO.esm.js.map → worker-spLieexQ.esm.js.map} +1 -1
- package/api/index.amd.js +1 -1
- package/api/index.amd.js.map +1 -1
- package/api/index.js +1 -1
- package/autoload-css-manifest.amd.json +4 -4
- package/autoload-css-manifest.json +4 -4
- package/charts/charts.amd.js +1 -1
- package/charts/charts.amd.js.map +1 -1
- package/charts/charts.js +1 -1
- package/core/app.amd.js +1 -1
- package/core/app.amd.js.map +1 -1
- package/core/app.js +4 -4
- package/dialog/dialog.amd.js +1 -1
- package/dialog/dialog.amd.js.map +1 -1
- package/dialog/dialog.js +3 -3
- package/forms/forms.amd.js +1 -1
- package/forms/forms.amd.js.map +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 +1 -1
- package/icomoon/Topvisor icons.json +152 -129
- package/icomoon/demo.html +15 -1
- package/icomoon/fonts/Topvisor-2.eot +0 -0
- package/icomoon/fonts/Topvisor-2.svg +1 -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 +8 -5
- package/layout/layout.amd.js +1 -1
- package/layout/layout.amd.js.map +1 -1
- package/layout/layout.js +1 -1
- package/package.json +1 -1
- package/popup/popup.amd.js +1 -1
- package/popup/popup.amd.js.map +1 -1
- package/popup/popup.js +1 -1
- package/popup/worker.amd.js +1 -1
- package/popup/worker.amd.js.map +1 -1
- package/popup/worker.js +1 -1
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +420 -389
- package/project/project.js.map +1 -1
- package/src/components/formsExt/selector2/selector2.vue.d.ts +8 -0
- package/src/components/popup/popupPrompt/types.d.ts +5 -0
- package/src/components/project/groupSelector/groupSelector.vue.d.ts +178 -5
- package/src/components/project/groupSelector/groups/groups.vue.d.ts +12 -2
- package/src/components/project/groupSelector/groups/types.d.ts +2 -0
- package/src/components/project/projectSelector/projectSelector.vue.d.ts +5 -1
- package/tabsView/tabsView.amd.js +1 -1
- package/tabsView/tabsView.amd.js.map +1 -1
- package/tabsView/tabsView.js +2 -2
- package/utils/clipboard.amd.js +1 -1
- package/utils/clipboard.amd.js.map +1 -1
- package/utils/clipboard.js +1 -1
- package/utils/date.amd.js +1 -1
- package/utils/date.amd.js.map +1 -1
- package/utils/date.js +1 -1
- package/utils/device.amd.js +1 -1
- package/utils/device.amd.js.map +1 -1
- package/utils/device.js +1 -1
- package/utils/lodash.amd.js +1 -1
- package/utils/lodash.amd.js.map +1 -1
- package/utils/lodash.js +1 -1
- package/utils/price.amd.js +1 -1
- package/utils/price.amd.js.map +1 -1
- package/utils/price.js +1 -1
- package/utils/searchers.amd.js +1 -1
- package/utils/searchers.amd.js.map +1 -1
- package/utils/searchers.js +1 -1
- package/utils/string.amd.js +1 -1
- package/utils/string.amd.js.map +1 -1
- package/utils/string.js +1 -1
- package/.chunks/forms-BboZ50-J.amd.js.map +0 -1
- package/.chunks/formsExt-ILcRjD-o.amd.js +0 -2
- package/.chunks/formsExt-ILcRjD-o.amd.js.map +0 -1
- package/.chunks/popup-CgrKc5Db.amd.js.map +0 -1
package/project/project.js
CHANGED
|
@@ -5,25 +5,25 @@
|
|
|
5
5
|
_autoloadCSSCore.insertCSSLinkToPage(fileNames, true);
|
|
6
6
|
/* end import css */
|
|
7
7
|
|
|
8
|
-
import "../.chunks/api-
|
|
9
|
-
import { E as e, O as t, P as n, h as r, n as i } from "../.chunks/forms-
|
|
8
|
+
import "../.chunks/api-DuS0Qura.esm.js";
|
|
9
|
+
import { E as e, O as t, P as n, h as r, n as i } from "../.chunks/forms-CdCS6WAQ.esm.js";
|
|
10
10
|
import { n as a, t as o } from "../.chunks/field-CjkpGeA7.esm.js";
|
|
11
11
|
import { storage as s } from "../utils/dom.js";
|
|
12
|
-
import { t as c } from "../.chunks/worker-
|
|
13
|
-
import "../.chunks/app-
|
|
12
|
+
import { t as c } from "../.chunks/worker-spLieexQ.esm.js";
|
|
13
|
+
import "../.chunks/app-BXCICBAa.esm.js";
|
|
14
14
|
import { validUrl as l } from "../utils/check.js";
|
|
15
15
|
import { ellipsis as u } from "../utils/string.js";
|
|
16
|
-
import { t as d } from "../.chunks/utils-
|
|
16
|
+
import { t as d } from "../.chunks/utils-DrvuXyXl.esm.js";
|
|
17
17
|
import { getDeviceGIcon as f, getLangLabel as p, getSearcherGIcon as m } from "../utils/searchers.js";
|
|
18
18
|
import { invertKeyboardLayout as h } from "../utils/keyboard.js";
|
|
19
|
-
import { c as g, n as _, o as v, r as ee, s as
|
|
20
|
-
import { d as
|
|
19
|
+
import { c as g, n as _, o as v, r as ee, s as y } from "../.chunks/popup-DHCqvZzI.esm.js";
|
|
20
|
+
import { d as b, s as x, u as te } from "../.chunks/formsExt-Ck5q-jXI.esm.js";
|
|
21
21
|
import "../popup/worker.js";
|
|
22
|
-
import { Fragment as
|
|
22
|
+
import { Fragment as S, computed as C, createBlock as w, createCommentVNode as T, createElementBlock as E, createElementVNode as D, createSlots as ne, createTextVNode as O, createVNode as k, defineComponent as A, isRef as re, mergeModels as j, mergeProps as ie, nextTick as ae, normalizeClass as M, onMounted as oe, openBlock as N, reactive as se, ref as P, renderList as F, renderSlot as ce, resolveComponent as le, resolveDirective as ue, resolveDynamicComponent as de, shallowRef as fe, toDisplayString as I, toValue as pe, unref as L, useModel as R, watch as z, withCtx as B, withDirectives as me, withKeys as he, withModifiers as V } from "vue";
|
|
23
23
|
//#region src/components/project/competitorSelector/competitorSelector.vue?vue&type=script&setup=true&lang.ts
|
|
24
|
-
var
|
|
24
|
+
var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, ve = /* @__PURE__ */ A({
|
|
25
25
|
__name: "competitorSelector",
|
|
26
|
-
props: /* @__PURE__ */
|
|
26
|
+
props: /* @__PURE__ */ j({
|
|
27
27
|
modelValue: {},
|
|
28
28
|
items: {},
|
|
29
29
|
showSelectAllItem: {
|
|
@@ -36,7 +36,7 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
36
36
|
}),
|
|
37
37
|
emits: ["update:modelValue"],
|
|
38
38
|
setup(n) {
|
|
39
|
-
let i = n, a =
|
|
39
|
+
let i = n, a = R(n, "modelValue"), o = C(() => {
|
|
40
40
|
if (i.showSelectAllItem) return {
|
|
41
41
|
icon: "",
|
|
42
42
|
title: e().Common.Select_all,
|
|
@@ -44,23 +44,23 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
44
44
|
content: ""
|
|
45
45
|
};
|
|
46
46
|
});
|
|
47
|
-
return (e, i) => (
|
|
48
|
-
opener:
|
|
47
|
+
return (e, i) => (N(), E("div", ge, [L(t).state.isMobile ? (N(), w(y, { key: 0 }, {
|
|
48
|
+
opener: B(() => [k(r, {
|
|
49
49
|
class: "top-competitorSelector_opener",
|
|
50
50
|
color: "theme",
|
|
51
51
|
icon: "",
|
|
52
52
|
icon2: ""
|
|
53
53
|
}, {
|
|
54
|
-
default:
|
|
54
|
+
default: B(() => [O(I(n.items.find((e) => e.value === a.value?.[0])?.content), 1)]),
|
|
55
55
|
_: 1
|
|
56
56
|
})]),
|
|
57
|
-
contentList:
|
|
58
|
-
class:
|
|
57
|
+
contentList: B(() => [(N(!0), E(S, null, F(n.items, (e) => (N(), w(v, {
|
|
58
|
+
class: M({ "top-active": a.value?.includes(e.value) }),
|
|
59
59
|
"data-top-icon": e.icon,
|
|
60
60
|
title: e.title,
|
|
61
61
|
onClick: () => a.value = [e.value]
|
|
62
62
|
}, {
|
|
63
|
-
default:
|
|
63
|
+
default: B(() => [D("span", _e, I(e.content), 1)]),
|
|
64
64
|
_: 2
|
|
65
65
|
}, 1032, [
|
|
66
66
|
"class",
|
|
@@ -69,7 +69,7 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
69
69
|
"onClick"
|
|
70
70
|
]))), 256))]),
|
|
71
71
|
_: 1
|
|
72
|
-
})) : (
|
|
72
|
+
})) : (N(), w(b, {
|
|
73
73
|
key: 1,
|
|
74
74
|
modelValue: a.value,
|
|
75
75
|
"onUpdate:modelValue": i[0] ||= (e) => a.value = e,
|
|
@@ -84,12 +84,12 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
84
84
|
"selectAllItem"
|
|
85
85
|
]))]));
|
|
86
86
|
}
|
|
87
|
-
}),
|
|
87
|
+
}), ye = (e, t) => C(() => pe(e).filter((e) => e.on >= 0 || e.id === t).map((e) => ({
|
|
88
88
|
value: e.id,
|
|
89
89
|
title: e.url + ` [${e.id}]`,
|
|
90
|
-
icon: e.id ===
|
|
90
|
+
icon: e.id === pe(t) ? "" : "",
|
|
91
91
|
content: e.name
|
|
92
|
-
}))),
|
|
92
|
+
}))), be = {
|
|
93
93
|
0: "Yandex",
|
|
94
94
|
1: "Google",
|
|
95
95
|
4: "YouTube",
|
|
@@ -99,25 +99,25 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
99
99
|
9: "GoogleStore",
|
|
100
100
|
20: "Yandex.com",
|
|
101
101
|
21: "Yandex.com.tr"
|
|
102
|
-
},
|
|
102
|
+
}, xe = {
|
|
103
103
|
key: -2,
|
|
104
104
|
name: "--",
|
|
105
105
|
index: -2
|
|
106
|
-
},
|
|
106
|
+
}, Se = {
|
|
107
107
|
key: -2,
|
|
108
108
|
name: "--",
|
|
109
|
-
regions: [
|
|
110
|
-
regionByIndex: new Map([[-2,
|
|
111
|
-
},
|
|
109
|
+
regions: [xe],
|
|
110
|
+
regionByIndex: new Map([[-2, xe]])
|
|
111
|
+
}, H = {
|
|
112
112
|
key: -2,
|
|
113
113
|
name: "Autoselect",
|
|
114
114
|
index: -2
|
|
115
|
-
},
|
|
115
|
+
}, Ce = {
|
|
116
116
|
key: -2,
|
|
117
117
|
name: "Autoselect",
|
|
118
|
-
regions: [
|
|
119
|
-
regionByIndex: new Map([[-2,
|
|
120
|
-
},
|
|
118
|
+
regions: [H],
|
|
119
|
+
regionByIndex: new Map([[-2, H]])
|
|
120
|
+
}, we = {
|
|
121
121
|
countryCode: "00",
|
|
122
122
|
depth: 1,
|
|
123
123
|
device: 0,
|
|
@@ -125,10 +125,10 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
125
125
|
index: -1,
|
|
126
126
|
lang: "ru",
|
|
127
127
|
name: "Without region"
|
|
128
|
-
},
|
|
128
|
+
}, Te = () => (H.name = e().Common.Autoselect, H), Ee = () => (Te(), Ce.name = e().Common.Autoselect, console.log(Ce), Ce), De = () => (we.name = e().Keywords.Without_region, we), Oe = (e = "", t = !1, n = []) => {
|
|
129
129
|
let r;
|
|
130
|
-
return r = e ?
|
|
131
|
-
},
|
|
130
|
+
return r = e ? Ae(n, e) : ke(n), t && r.set(-2, Ee()), r.size || r.set(-2, Se), r;
|
|
131
|
+
}, ke = (e, t = !0, n = [], r = "") => {
|
|
132
132
|
let i = /* @__PURE__ */ new Map();
|
|
133
133
|
return e.forEach((e) => {
|
|
134
134
|
if (!e.enabled || r && typeof e.key == "number" && e.key > 1) return;
|
|
@@ -142,35 +142,35 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
142
142
|
if (i.has(e)) return;
|
|
143
143
|
let t = {
|
|
144
144
|
key: e,
|
|
145
|
-
name:
|
|
145
|
+
name: be[e],
|
|
146
146
|
regions: [],
|
|
147
147
|
regionByIndex: /* @__PURE__ */ new Map()
|
|
148
148
|
};
|
|
149
149
|
i.set(t.key, t);
|
|
150
150
|
}), i;
|
|
151
|
-
},
|
|
152
|
-
let r =
|
|
151
|
+
}, Ae = (e, n) => {
|
|
152
|
+
let r = ke(e, !1, t.state.forceSearchersKeysForKeywordsStats, n);
|
|
153
153
|
if (r.has(2)) {
|
|
154
154
|
let e = r.get(2);
|
|
155
155
|
e && (e.regionByIndex = /* @__PURE__ */ new Map());
|
|
156
156
|
}
|
|
157
157
|
return (n === "volume" || n === "cost_forecast") && t.state.showGlobalRegionForKeywordsStats && r.forEach((e) => {
|
|
158
158
|
if (!e.regionByIndex) return;
|
|
159
|
-
let t = { ...
|
|
159
|
+
let t = { ...De() };
|
|
160
160
|
e.regionByIndex.set(t.index, t);
|
|
161
161
|
}), r;
|
|
162
|
-
},
|
|
163
|
-
let r =
|
|
162
|
+
}, je = (e, t, n = []) => {
|
|
163
|
+
let r = Oe(e, !1, n), i;
|
|
164
164
|
return r.forEach((n) => {
|
|
165
165
|
if (!(t.searcher_key !== void 0 && t.searcher_key != n.key) && n.regions && (n.regions.forEach((r) => {
|
|
166
166
|
if (!i && !(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))) return r.searcher_key = n.key, i = r, !1;
|
|
167
167
|
}), i)) return !1;
|
|
168
168
|
}), i;
|
|
169
|
-
},
|
|
169
|
+
}, Me = d(() => import("../.chunks/dialog_regionSelectorRegions-BKvg82IO.esm.js")), Ne = (t, n) => {
|
|
170
170
|
let r = e();
|
|
171
171
|
return {
|
|
172
|
-
searcherKey:
|
|
173
|
-
optionBySearcherKey:
|
|
172
|
+
searcherKey: P(n.value.keys().next().value ?? -2),
|
|
173
|
+
optionBySearcherKey: C(() => {
|
|
174
174
|
let e = /* @__PURE__ */ new Map();
|
|
175
175
|
if (n.value.forEach((n) => {
|
|
176
176
|
let r = {
|
|
@@ -194,10 +194,10 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
194
194
|
return e;
|
|
195
195
|
})
|
|
196
196
|
};
|
|
197
|
-
},
|
|
198
|
-
let r = e(), i =
|
|
197
|
+
}, Pe = (t, n) => {
|
|
198
|
+
let r = e(), i = P(-2);
|
|
199
199
|
t.modelValue.length === 1 && (i.value = t.modelValue[0]), i.value === -2 && (t.forMode ? i.value = n.value?.regionByIndex.values().next().value?.key ?? -2 : i.value = n.value?.regionByIndex.keys().next().value ?? -2);
|
|
200
|
-
let a =
|
|
200
|
+
let a = C(() => {
|
|
201
201
|
let e = /* @__PURE__ */ new Map();
|
|
202
202
|
return n.value.regionByIndex?.forEach((i) => {
|
|
203
203
|
let a = i.name;
|
|
@@ -220,7 +220,7 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
220
220
|
e.set(i.index, s);
|
|
221
221
|
}), e;
|
|
222
222
|
});
|
|
223
|
-
return
|
|
223
|
+
return z(a, (e, n) => {
|
|
224
224
|
if (t.onlySearcher || i.value !== void 0 && e.get(i.value)) return;
|
|
225
225
|
let a = e.keys().next().value;
|
|
226
226
|
if (i.value === -2 || a === -2) {
|
|
@@ -243,8 +243,8 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
243
243
|
regionIndex: i,
|
|
244
244
|
optionByRegionIndex: a
|
|
245
245
|
};
|
|
246
|
-
},
|
|
247
|
-
let r =
|
|
246
|
+
}, Fe = (e, t, n) => {
|
|
247
|
+
let r = P([]), i = () => {
|
|
248
248
|
if (e.onlySearcher && t.value) {
|
|
249
249
|
r.value = Array.from(t.value.keys());
|
|
250
250
|
return;
|
|
@@ -258,19 +258,19 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
258
258
|
}, a = () => {
|
|
259
259
|
r.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(r.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
|
|
260
260
|
};
|
|
261
|
-
return
|
|
261
|
+
return z(r, () => {
|
|
262
262
|
a();
|
|
263
263
|
}), e.addCompare && i(), { regionsIndexes: r };
|
|
264
|
-
},
|
|
265
|
-
let t =
|
|
264
|
+
}, Ie = (e) => {
|
|
265
|
+
let t = C(() => Oe(e.forMode, e.autoRegion, e.searchers)), n = C(() => t.value.get(i.searcherKey.value) || Se), r = C(() => {
|
|
266
266
|
let e = /* @__PURE__ */ new Set();
|
|
267
267
|
return t.value.forEach((t) => {
|
|
268
268
|
t.regionByIndex.forEach((t) => {
|
|
269
269
|
t.index !== -1 && t.index !== -2 && e.add(t.index);
|
|
270
270
|
});
|
|
271
271
|
}), e;
|
|
272
|
-
}), i =
|
|
273
|
-
|
|
272
|
+
}), i = Ne(e, t), a = Pe(e, n), o = Fe(e, t, r);
|
|
273
|
+
z(t, () => {
|
|
274
274
|
if (e.onlySearcher ? o.regionsIndexes.value = Array.from(t.value.keys()) : o.regionsIndexes.value = o.regionsIndexes.value.filter((e) => r.value.has(e)), i.searcherKey.value === -1) return;
|
|
275
275
|
let s = t.value.keys().next().value;
|
|
276
276
|
t.value.forEach((n) => {
|
|
@@ -293,7 +293,7 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
293
293
|
let t = a.regionIndex.value;
|
|
294
294
|
if (e.forMode) {
|
|
295
295
|
let n = a.regionIndex.value;
|
|
296
|
-
t =
|
|
296
|
+
t = je(e.forMode, {
|
|
297
297
|
searcher_key: s(),
|
|
298
298
|
key: n
|
|
299
299
|
}, e.searchers)?.index;
|
|
@@ -315,9 +315,9 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
315
315
|
if (e !== void 0) return l()?.regionByIndex?.get(e);
|
|
316
316
|
}
|
|
317
317
|
};
|
|
318
|
-
},
|
|
318
|
+
}, Le = /* @__PURE__ */ A({
|
|
319
319
|
__name: "regionSelector",
|
|
320
|
-
props: /* @__PURE__ */
|
|
320
|
+
props: /* @__PURE__ */ j({
|
|
321
321
|
projectId: {},
|
|
322
322
|
searchers: { default: () => [] },
|
|
323
323
|
modelValue: {},
|
|
@@ -346,19 +346,19 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
346
346
|
}),
|
|
347
347
|
emits: ["update:modelValue", "update:modelValueSingle"],
|
|
348
348
|
setup(e, { expose: t }) {
|
|
349
|
-
let n = e, a =
|
|
349
|
+
let n = e, a = R(e, "modelValue"), o = R(e, "modelValueSingle"), { selectSearcher: s, selectRegion: c, compare: l, searcherByKey: u, allRegionsIndexes: d, getSearcher: f, getRegion: p } = Ie(n), m = () => {
|
|
350
350
|
let e = [];
|
|
351
351
|
u.value.forEach((t) => {
|
|
352
352
|
t.enabled && t.regions.forEach((t) => {
|
|
353
353
|
t.enabled && e.push(t);
|
|
354
354
|
});
|
|
355
|
-
}),
|
|
355
|
+
}), Me.open("regions", {
|
|
356
356
|
regions: e,
|
|
357
357
|
regionsIndexes: l.regionsIndexes.value,
|
|
358
358
|
"@update:regionsIndexes": (e) => l.regionsIndexes.value = e
|
|
359
359
|
});
|
|
360
360
|
};
|
|
361
|
-
return
|
|
361
|
+
return z([
|
|
362
362
|
c.regionIndex,
|
|
363
363
|
s.searcherKey,
|
|
364
364
|
l.regionsIndexes
|
|
@@ -368,9 +368,9 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
368
368
|
a.value = [...l.regionsIndexes.value];
|
|
369
369
|
} else n.onlySearcher ? (a.value = [s.searcherKey.value], s.searcherKey.value === -2 && !n.autoRegion && (a.value.length = 0)) : (a.value = [c.regionIndex.value], c.regionIndex.value === -2 && !n.autoRegion && (a.value.length = 0));
|
|
370
370
|
!n.onlySearcher && !d.value.size && (s.searcherKey.value = -2);
|
|
371
|
-
}), o.value &&
|
|
371
|
+
}), o.value && z(o, () => {
|
|
372
372
|
o.value && (a.value = [o.value]);
|
|
373
|
-
}, { immediate: !0 }),
|
|
373
|
+
}, { immediate: !0 }), z(a, () => {
|
|
374
374
|
if (a.value[0] && (o.value = a.value[0]), n.onlySearcher) {
|
|
375
375
|
if (!a.value.length || a.value.length === 1 && !u.value.has(a.value[0]) || a.value.length === 1 && a.value[0] === -2 && !n.autoRegion) {
|
|
376
376
|
let e = u.value.keys().next().value;
|
|
@@ -422,14 +422,14 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
422
422
|
}, { immediate: !0 }), t({
|
|
423
423
|
getSearcher: f,
|
|
424
424
|
getRegion: p
|
|
425
|
-
}), (t, n) => (
|
|
425
|
+
}), (t, n) => (N(), E("div", { class: M({
|
|
426
426
|
"top-regionSelector": !0,
|
|
427
427
|
"top-regionSelector-onlySearcher": e.onlySearcher
|
|
428
428
|
}) }, [
|
|
429
|
-
|
|
430
|
-
options:
|
|
431
|
-
modelValue:
|
|
432
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
429
|
+
k(i, {
|
|
430
|
+
options: L(s).optionBySearcherKey.value,
|
|
431
|
+
modelValue: L(s).searcherKey.value,
|
|
432
|
+
"onUpdate:modelValue": n[0] ||= (e) => L(s).searcherKey.value = e,
|
|
433
433
|
name: "searcher_key",
|
|
434
434
|
addChanger: e.addChanger
|
|
435
435
|
}, null, 8, [
|
|
@@ -437,12 +437,12 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
437
437
|
"modelValue",
|
|
438
438
|
"addChanger"
|
|
439
439
|
]),
|
|
440
|
-
!e.onlySearcher &&
|
|
440
|
+
!e.onlySearcher && L(s).searcherKey.value !== L(-1) ? (N(), w(i, {
|
|
441
441
|
key: 0,
|
|
442
442
|
class: "top-select-region",
|
|
443
|
-
options:
|
|
444
|
-
modelValue:
|
|
445
|
-
"onUpdate:modelValue": n[1] ||= (e) =>
|
|
443
|
+
options: L(c).optionByRegionIndex.value,
|
|
444
|
+
modelValue: L(c).regionIndex.value,
|
|
445
|
+
"onUpdate:modelValue": n[1] ||= (e) => L(c).regionIndex.value = e,
|
|
446
446
|
name: e.forMode ? "region_key" : "region_index",
|
|
447
447
|
addChanger: e.addChanger,
|
|
448
448
|
"data-top-icon": e.addRegionIcon ? "" : void 0
|
|
@@ -452,31 +452,31 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
452
452
|
"name",
|
|
453
453
|
"addChanger",
|
|
454
454
|
"data-top-icon"
|
|
455
|
-
])) :
|
|
456
|
-
e.addCompare && !e.onlySearcher &&
|
|
455
|
+
])) : T("", !0),
|
|
456
|
+
e.addCompare && !e.onlySearcher && L(s).searcherKey.value === L(-1) ? (N(), w(r, {
|
|
457
457
|
key: 1,
|
|
458
458
|
name: "compare",
|
|
459
459
|
onClick: m,
|
|
460
|
-
"data-count-compare-regions-indexes":
|
|
460
|
+
"data-count-compare-regions-indexes": L(l).regionsIndexes.value.length
|
|
461
461
|
}, {
|
|
462
|
-
default:
|
|
462
|
+
default: B(() => [O(I(t.$i18n.Common.Selected_regions), 1)]),
|
|
463
463
|
_: 1
|
|
464
|
-
}, 8, ["data-count-compare-regions-indexes"])) :
|
|
464
|
+
}, 8, ["data-count-compare-regions-indexes"])) : T("", !0)
|
|
465
465
|
], 2));
|
|
466
466
|
}
|
|
467
|
-
}),
|
|
467
|
+
}), U = {
|
|
468
468
|
id: 0,
|
|
469
469
|
name: "/",
|
|
470
470
|
path: "/"
|
|
471
471
|
};
|
|
472
|
-
function
|
|
472
|
+
function Re(t) {
|
|
473
473
|
return t ? e()?.Common.All_folders : "/ (" + e()?.Keywords.Root_folder + ")";
|
|
474
474
|
}
|
|
475
|
-
var
|
|
476
|
-
a = { ...a }, r.childsIds.push(a.id), a.id === 0 && (a.name =
|
|
475
|
+
var ze = (e, t, n = /* @__PURE__ */ new Map(), r = { id: "root" }, i = 0) => (r.childsIds = [], r.id && (r.countAllGroupsActive = r.count_groups_active), e[r.id] && e[r.id].forEach((a) => {
|
|
476
|
+
a = { ...a }, r.childsIds.push(a.id), a.id === 0 && (a.name = Re(t));
|
|
477
477
|
let o = i > 1 ? "-".repeat(i - 1) + " " : "";
|
|
478
|
-
o && !a.name.startsWith(o) && (a.name = o + a.name), n.set(a.id, a),
|
|
479
|
-
}), n),
|
|
478
|
+
o && !a.name.startsWith(o) && (a.name = o + a.name), n.set(a.id, a), ze(e, t, n, a, i + 1), r.childsIds = r.childsIds.concat(a.childsIds), r.id && a.count_groups_active && (r.countAllGroupsActive += a.count_groups_active);
|
|
479
|
+
}), n), Be = (e, t) => e.gen(`/get/${t}/folders/`, [
|
|
480
480
|
"id",
|
|
481
481
|
"parent_id",
|
|
482
482
|
"name",
|
|
@@ -487,9 +487,9 @@ var Be = (e, t, n = /* @__PURE__ */ new Map(), r = { id: "root" }, i = 0) => (r.
|
|
|
487
487
|
});
|
|
488
488
|
//#endregion
|
|
489
489
|
//#region src/core/utils/composables/useWatch.ts
|
|
490
|
-
function
|
|
490
|
+
function Ve(e, t, n) {
|
|
491
491
|
let r = Object.keys(e);
|
|
492
|
-
return
|
|
492
|
+
return z(r.map((t) => e[t]), (e, n, i) => {
|
|
493
493
|
let a = {};
|
|
494
494
|
e.forEach((e, t) => {
|
|
495
495
|
if (!Object.is(e, n[t])) {
|
|
@@ -504,9 +504,9 @@ function He(e, t, n) {
|
|
|
504
504
|
}
|
|
505
505
|
//#endregion
|
|
506
506
|
//#region src/components/project/groupSelector/folders/folders.vue?vue&type=script&setup=true&lang.ts
|
|
507
|
-
var
|
|
507
|
+
var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
508
508
|
__name: "folders",
|
|
509
|
-
props: /* @__PURE__ */
|
|
509
|
+
props: /* @__PURE__ */ j({
|
|
510
510
|
folderId: {},
|
|
511
511
|
folder: {},
|
|
512
512
|
folders: {},
|
|
@@ -522,17 +522,17 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
522
522
|
}, {
|
|
523
523
|
folderId: { required: !0 },
|
|
524
524
|
folderIdModifiers: {},
|
|
525
|
-
folder: { default:
|
|
525
|
+
folder: { default: U },
|
|
526
526
|
folderModifiers: {}
|
|
527
527
|
}),
|
|
528
528
|
emits: ["update:folderId", "update:folder"],
|
|
529
529
|
setup(e) {
|
|
530
|
-
let t = e, n =
|
|
531
|
-
|
|
530
|
+
let t = e, n = R(e, "folderId"), r = R(e, "folder"), i = t.client && !t.folders ? Be(t.client, t.service) : void 0, a = P(null);
|
|
531
|
+
z(() => t.projectId, () => {
|
|
532
532
|
i?.changeParams({ project_id: t.projectId }), i?.setOptions({ checkFingerprint: "TopGroupSelectorFolders:" + t.projectId }), a.value?.resetCache();
|
|
533
533
|
}, { immediate: !0 });
|
|
534
|
-
let o =
|
|
535
|
-
return
|
|
534
|
+
let o = C(() => ze(t.folders ?? { root: [U] }, t.canSelectAll));
|
|
535
|
+
return Ve({
|
|
536
536
|
modelFolder: r,
|
|
537
537
|
modelFolderId: n
|
|
538
538
|
}, async (e) => {
|
|
@@ -542,20 +542,20 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
542
542
|
return;
|
|
543
543
|
}
|
|
544
544
|
let i = o.value.get(t.folderId);
|
|
545
|
-
i ||=
|
|
546
|
-
}, { immediate: !0 }), (t, n) => (
|
|
545
|
+
i ||= U, r.value = i, n.value = i.id;
|
|
546
|
+
}, { immediate: !0 }), (t, n) => (N(), w(x, {
|
|
547
547
|
class: "top-groupSelector_folder",
|
|
548
548
|
modelValue: r.value,
|
|
549
549
|
"onUpdate:modelValue": n[0] ||= (e) => r.value = e,
|
|
550
550
|
items: e.folders ? [...o.value.values()] : void 0,
|
|
551
551
|
"search-type": "inline",
|
|
552
552
|
icon: e.addIcon ? "" : void 0,
|
|
553
|
-
api: e.folders ? void 0 :
|
|
554
|
-
apiSetSearchParams: (...e) =>
|
|
553
|
+
api: e.folders ? void 0 : L(i),
|
|
554
|
+
apiSetSearchParams: (...e) => L(te)(...e, "name"),
|
|
555
555
|
addChanger: e.addChanger,
|
|
556
556
|
useCache: ""
|
|
557
557
|
}, {
|
|
558
|
-
item:
|
|
558
|
+
item: B(({ item: e }) => [D("div", { innerHTML: e.name.replaceAll(/</g, "< ") }, null, 8, He)]),
|
|
559
559
|
_: 1
|
|
560
560
|
}, 8, [
|
|
561
561
|
"modelValue",
|
|
@@ -566,17 +566,17 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
566
566
|
"addChanger"
|
|
567
567
|
]));
|
|
568
568
|
}
|
|
569
|
-
}),
|
|
569
|
+
}), W = {
|
|
570
570
|
id: -1,
|
|
571
571
|
name: "--",
|
|
572
|
-
folder_id:
|
|
573
|
-
folder_path:
|
|
574
|
-
},
|
|
572
|
+
folder_id: U.id,
|
|
573
|
+
folder_path: U.path
|
|
574
|
+
}, G = {
|
|
575
575
|
id: 0,
|
|
576
576
|
name: "All groups",
|
|
577
|
-
folder_id:
|
|
578
|
-
folder_path:
|
|
579
|
-
},
|
|
577
|
+
folder_id: U.id,
|
|
578
|
+
folder_path: U.path
|
|
579
|
+
}, K = () => (G.name = e()?.Common.All_groups, G), We = () => (G.name = e()?.Keywords.Choose_group, G), Ge = (e, t, n) => (e = [...e], t !== void 0 && (e = e.filter((e) => e.on == Number(t))), n && n.id && n.childsIds && (e = e.filter((e) => e.folder_id === n.id || n.childsIds.includes(e.folder_id))), e), Ke = (e, t) => e.gen(`/get/${t}/groups/`, [
|
|
580
580
|
"id",
|
|
581
581
|
"name",
|
|
582
582
|
"folder_id",
|
|
@@ -584,12 +584,12 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
584
584
|
]).changeParams({
|
|
585
585
|
folder_id_depth: !0,
|
|
586
586
|
limit: 100
|
|
587
|
-
}),
|
|
587
|
+
}), qe = (e, t) => e.gen(`/add/${t}/groups/`), Je = (e, t) => e.gen(`/del/${t}/groups/`), Ye = (e, t) => e.gen(`/edit/${t}/groups/rename/`), Xe = { class: "top-groupSelector_groupItem top-ellipsis1" }, Ze = {
|
|
588
588
|
key: 0,
|
|
589
589
|
class: "top-comment"
|
|
590
|
-
},
|
|
590
|
+
}, Qe = ["innerHTML"], $e = ["innerHTML"], et = ["innerHTML"], tt = /* @__PURE__ */ A({
|
|
591
591
|
__name: "groups",
|
|
592
|
-
props: /* @__PURE__ */
|
|
592
|
+
props: /* @__PURE__ */ j({
|
|
593
593
|
groupId: {},
|
|
594
594
|
group: {},
|
|
595
595
|
projectId: {},
|
|
@@ -620,139 +620,149 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
620
620
|
group: { required: !0 },
|
|
621
621
|
groupModifiers: {}
|
|
622
622
|
}),
|
|
623
|
-
emits: /* @__PURE__ */
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
623
|
+
emits: /* @__PURE__ */ j([
|
|
624
|
+
"addGroup",
|
|
625
|
+
"editGroup",
|
|
626
|
+
"delGroup"
|
|
627
|
+
], ["update:groupId", "update:group"]),
|
|
628
|
+
setup(e, { expose: t, emit: n }) {
|
|
629
|
+
let r = e, i = n, a = R(e, "groupId"), s = R(e, "group"), c = r.client && !r.groups ? Ke(r.client, r.service) : void 0, l = r.client ? qe(r.client, r.service) : void 0, u = r.client ? Je(r.client, r.service) : void 0, d = r.client ? Ye(r.client, r.service) : void 0, f = P(null), p = P(void 0), m = o("folder_id", "EQUALS", [r.folder?.id ?? 0]);
|
|
630
|
+
c?.changeParams({
|
|
631
|
+
project_id: r.projectId,
|
|
628
632
|
folder_id_depth: !0,
|
|
629
|
-
filters: [
|
|
630
|
-
}),
|
|
631
|
-
let
|
|
632
|
-
|
|
633
|
+
filters: [m]
|
|
634
|
+
}), r.on !== void 0 && c?.params.filters?.push(o("on", "EQUALS", [Number(r.on)]));
|
|
635
|
+
let h = (e) => {
|
|
636
|
+
s.value = e, a.value = e.id;
|
|
637
|
+
}, g = (e = !1) => {
|
|
638
|
+
f.value?.resetCache(e);
|
|
633
639
|
};
|
|
634
|
-
|
|
635
|
-
projectId: () =>
|
|
636
|
-
folderId: () =>
|
|
637
|
-
canSelectAll: () =>
|
|
640
|
+
Ve({
|
|
641
|
+
projectId: () => r.projectId,
|
|
642
|
+
folderId: () => r.folder?.id,
|
|
643
|
+
canSelectAll: () => r.canSelectAll
|
|
638
644
|
}, (e) => {
|
|
639
|
-
if (e.projectId && (
|
|
645
|
+
if (e.projectId && (c?.changeParams({ project_id: r.projectId }), c?.setOptions({ checkFingerprint: "TopGroupSelectorGroups:" + r.projectId })), e.folderId && (m.values = [r.folder?.id ?? 0], r.groups && (p.value = Ge(r.groups, r.on, r.folder))), g(), (e.folderId?.old !== void 0 || e.canSelectAll?.old !== void 0) && a.value !== null) {
|
|
640
646
|
let e;
|
|
641
|
-
|
|
647
|
+
r.autoselect === "first" && (e = p.value?.[0], r.canSelectAll && (e = se(K()))), (r.autoselect === "placeholder" || !e) && (e = We()), h(e);
|
|
642
648
|
}
|
|
643
|
-
}, { immediate: !0 }),
|
|
644
|
-
modelGroup:
|
|
645
|
-
modelGroupId:
|
|
649
|
+
}, { immediate: !0 }), Ve({
|
|
650
|
+
modelGroup: s,
|
|
651
|
+
modelGroupId: a
|
|
646
652
|
}, async (e) => {
|
|
647
|
-
if (
|
|
653
|
+
if (a.value !== s.value.id) {
|
|
648
654
|
if (e.modelGroup && !e.modelGroupId) {
|
|
649
|
-
|
|
655
|
+
a.value = s.value.id;
|
|
650
656
|
return;
|
|
651
657
|
}
|
|
652
|
-
if (!(
|
|
653
|
-
if (
|
|
654
|
-
let e =
|
|
655
|
-
if (!e &&
|
|
658
|
+
if (!(r.canAdd && a.value === null)) {
|
|
659
|
+
if (r.groups) {
|
|
660
|
+
let e = p.value?.find((e) => e.id === a.value);
|
|
661
|
+
if (!e && r.canSelectAll && (e = K()), e) h(e);
|
|
656
662
|
else {
|
|
657
|
-
let e =
|
|
658
|
-
e && !
|
|
663
|
+
let e = p.value?.[0];
|
|
664
|
+
e && !a.value ? h(e) : h(W);
|
|
659
665
|
}
|
|
660
666
|
}
|
|
661
|
-
if (
|
|
662
|
-
let e =
|
|
663
|
-
project_id:
|
|
664
|
-
id:
|
|
665
|
-
filters: [
|
|
667
|
+
if (r.client && !r.groups && (a.value || a.value === 0 && !r.canSelectAll)) {
|
|
668
|
+
let e = Ke(r.client, r.service).changeParams({
|
|
669
|
+
project_id: r.projectId,
|
|
670
|
+
id: a.value,
|
|
671
|
+
filters: [m]
|
|
666
672
|
});
|
|
667
|
-
e?.setOptions({ checkFingerprint: "TopGroupSelectorFindGroup:" +
|
|
673
|
+
e?.setOptions({ checkFingerprint: "TopGroupSelectorFindGroup:" + r.projectId });
|
|
668
674
|
let t = await e.call();
|
|
669
675
|
if (!t.errors?.length && !t.result) return;
|
|
670
|
-
!t.errors && t.result[0] ?
|
|
676
|
+
!t.errors && t.result[0] ? h(t.result[0]) : h(W);
|
|
671
677
|
}
|
|
672
678
|
}
|
|
673
679
|
}
|
|
674
680
|
}, { immediate: !0 });
|
|
675
|
-
let
|
|
676
|
-
if (
|
|
677
|
-
let t =
|
|
678
|
-
project_id:
|
|
681
|
+
let v = async (e) => {
|
|
682
|
+
if (r.canAdd !== "api" || !l) return;
|
|
683
|
+
let t = s.value, n = await l.changeParams({
|
|
684
|
+
project_id: r.projectId,
|
|
679
685
|
names: [e.name],
|
|
680
|
-
to_id:
|
|
686
|
+
to_id: r.folder?.id ?? U.id,
|
|
681
687
|
to_type: "in_folder_last"
|
|
682
688
|
}).call();
|
|
683
|
-
if (
|
|
684
|
-
let e =
|
|
685
|
-
|
|
686
|
-
} else
|
|
687
|
-
|
|
688
|
-
},
|
|
689
|
-
|
|
690
|
-
project_id:
|
|
689
|
+
if (n.result) {
|
|
690
|
+
let e = n.result[0];
|
|
691
|
+
h(e), i("addGroup", e);
|
|
692
|
+
} else h(t);
|
|
693
|
+
f.value?.resetCache(!0);
|
|
694
|
+
}, y = async (e, t) => {
|
|
695
|
+
d && ((await d.changeParams({
|
|
696
|
+
project_id: r.projectId,
|
|
691
697
|
id: e.id,
|
|
692
698
|
name: t
|
|
693
|
-
}).call()).errors || (
|
|
694
|
-
...
|
|
699
|
+
}).call()).errors || (s.value.id === e.id && h({
|
|
700
|
+
...s.value,
|
|
695
701
|
name: t
|
|
696
|
-
}),
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
702
|
+
}), i("editGroup", {
|
|
703
|
+
...e,
|
|
704
|
+
name: t
|
|
705
|
+
}), f.value?.updateItemById(e.id, { name: t })));
|
|
706
|
+
}, b = async (e) => {
|
|
707
|
+
u && ((await u.changeParams({
|
|
708
|
+
project_id: r.projectId,
|
|
700
709
|
id: e.id
|
|
701
|
-
}).call()).errors || (
|
|
710
|
+
}).call()).errors || (s.value.id === e.id && h(r.canSelectAll ? K() : W), i("delGroup", e), f.value?.deleteItemById(e.id)));
|
|
702
711
|
};
|
|
703
|
-
return (t, n) => (
|
|
712
|
+
return t({ resetCacheGroups: g }), (t, n) => (N(), w(x, {
|
|
704
713
|
ref_key: "refSelector",
|
|
705
|
-
ref:
|
|
714
|
+
ref: f,
|
|
706
715
|
class: "top-groupSelector_group",
|
|
707
|
-
modelValue:
|
|
708
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
709
|
-
items:
|
|
716
|
+
modelValue: s.value,
|
|
717
|
+
"onUpdate:modelValue": n[0] ||= (e) => s.value = e,
|
|
718
|
+
items: p.value ?? e.groups,
|
|
710
719
|
searchType: "inline",
|
|
711
720
|
icon: e.addIcon ? "" : void 0,
|
|
712
|
-
api: e.groups ? void 0 :
|
|
713
|
-
apiSetSearchParams: (...e) =>
|
|
721
|
+
api: e.groups ? void 0 : L(c),
|
|
722
|
+
apiSetSearchParams: (...e) => L(te)(...e, "name"),
|
|
714
723
|
appendSearchToResult: !!e.canAdd,
|
|
715
|
-
useAllItem: e.canSelectAll ?
|
|
724
|
+
useAllItem: e.canSelectAll ? L(K)().name : !1,
|
|
716
725
|
addChanger: e.addChanger,
|
|
717
726
|
useCache: "",
|
|
718
|
-
onAppendItem:
|
|
719
|
-
},
|
|
720
|
-
item:
|
|
721
|
-
n.id ===
|
|
722
|
-
|
|
727
|
+
onAppendItem: v
|
|
728
|
+
}, ne({
|
|
729
|
+
item: B(({ item: n }) => [D("div", Xe, [
|
|
730
|
+
n.id === L(null) ? (N(), E("div", Ze, I(t.$i18n.Common.Add) + ": ", 1)) : T("", !0),
|
|
731
|
+
D("span", {
|
|
723
732
|
class: "top-groupSelector_groupItemName top-ellipsis1",
|
|
724
733
|
innerHTML: n.name
|
|
725
|
-
}, null, 8,
|
|
726
|
-
n.folder_path && e.showPath ? (
|
|
734
|
+
}, null, 8, Qe),
|
|
735
|
+
n.folder_path && e.showPath ? (N(), E("span", {
|
|
727
736
|
key: 1,
|
|
728
737
|
class: "top-groupSelector_groupItemFolderPath top-ellipsis1",
|
|
729
738
|
innerHTML: n.folder_path
|
|
730
|
-
}, null, 8,
|
|
739
|
+
}, null, 8, $e)) : T("", !0)
|
|
731
740
|
])]),
|
|
732
741
|
_: 2
|
|
733
742
|
}, [e.canEditAndDel && e.client ? {
|
|
734
743
|
name: "actions",
|
|
735
|
-
fn:
|
|
744
|
+
fn: B(({ item: r }) => [r.id ? (N(), E(S, { key: 0 }, [k(_, {
|
|
736
745
|
submitText: t.$i18n.Common.Save,
|
|
737
746
|
defaultValue: r.name,
|
|
738
|
-
|
|
747
|
+
inputProps: { addCleaner: !1 },
|
|
748
|
+
onSubmit: (e) => y(r, e)
|
|
739
749
|
}, {
|
|
740
|
-
opener:
|
|
741
|
-
default:
|
|
750
|
+
opener: B(() => [...n[1] ||= [D("div", { "data-top-icon": "" }, null, -1)]]),
|
|
751
|
+
default: B(() => [...n[2] ||= []]),
|
|
742
752
|
_: 1
|
|
743
753
|
}, 8, [
|
|
744
754
|
"submitText",
|
|
745
755
|
"defaultValue",
|
|
746
756
|
"onSubmit"
|
|
747
|
-
]),
|
|
757
|
+
]), k(ee, {
|
|
748
758
|
isWarning: "",
|
|
749
759
|
submitText: t.$i18n.Common.Delete,
|
|
750
|
-
onSubmit: (e) =>
|
|
760
|
+
onSubmit: (e) => b(r)
|
|
751
761
|
}, {
|
|
752
|
-
opener:
|
|
753
|
-
default:
|
|
762
|
+
opener: B(() => [...n[3] ||= [D("div", { "data-top-icon": "" }, null, -1)]]),
|
|
763
|
+
default: B(() => [D("span", { innerHTML: e.service === "keywords_2" ? t.$i18n.Keywords.Delete_group_warning : t.$i18n["Ai.Tracker"].Delete_group_warning }, null, 8, et)]),
|
|
754
764
|
_: 1
|
|
755
|
-
}, 8, ["submitText", "onSubmit"])], 64)) :
|
|
765
|
+
}, 8, ["submitText", "onSubmit"])], 64)) : T("", !0)]),
|
|
756
766
|
key: "0"
|
|
757
767
|
} : void 0]), 1032, [
|
|
758
768
|
"modelValue",
|
|
@@ -765,9 +775,9 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
765
775
|
"addChanger"
|
|
766
776
|
]));
|
|
767
777
|
}
|
|
768
|
-
}),
|
|
778
|
+
}), nt = { class: "top-groupSelector" }, rt = /* @__PURE__ */ A({
|
|
769
779
|
__name: "groupSelector",
|
|
770
|
-
props: /* @__PURE__ */
|
|
780
|
+
props: /* @__PURE__ */ j({
|
|
771
781
|
folderId: {},
|
|
772
782
|
folder: {},
|
|
773
783
|
groupId: {},
|
|
@@ -779,7 +789,10 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
779
789
|
type: Boolean,
|
|
780
790
|
default: void 0
|
|
781
791
|
},
|
|
782
|
-
canSelectAllGroups: {
|
|
792
|
+
canSelectAllGroups: {
|
|
793
|
+
type: Boolean,
|
|
794
|
+
default: !1
|
|
795
|
+
},
|
|
783
796
|
canAddGroup: { type: [String, Boolean] },
|
|
784
797
|
canEditAndDelGroup: { type: Boolean },
|
|
785
798
|
autoselect: { default: "first" },
|
|
@@ -808,30 +821,44 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
808
821
|
folderModifiers: {},
|
|
809
822
|
groupId: { required: !0 },
|
|
810
823
|
groupIdModifiers: {},
|
|
811
|
-
group: { default:
|
|
824
|
+
group: { default: W },
|
|
812
825
|
groupModifiers: {}
|
|
813
826
|
}),
|
|
814
|
-
emits: /* @__PURE__ */
|
|
827
|
+
emits: /* @__PURE__ */ j(["update:groups"], [
|
|
815
828
|
"update:folderId",
|
|
816
829
|
"update:folder",
|
|
817
830
|
"update:groupId",
|
|
818
831
|
"update:group"
|
|
819
832
|
]),
|
|
820
|
-
setup(e, {
|
|
821
|
-
let
|
|
822
|
-
|
|
823
|
-
let
|
|
824
|
-
|
|
825
|
-
let
|
|
833
|
+
setup(e, { expose: t, emit: n }) {
|
|
834
|
+
let r = e, i = P(null), a = R(e, "folderId"), o = R(e, "folder"), s = R(e, "groupId"), c = R(e, "group"), l = n;
|
|
835
|
+
o.value = ze(r.folders ?? { root: [U] }, r.canSelectAllGroups).get(a.value);
|
|
836
|
+
let u = r.groups?.find((e) => e.id === s.value);
|
|
837
|
+
s.value || (u = r.groups?.[0]), r.canSelectAllGroups && !u && (u = K()), (r.autoselect === "placeholder" || !u) && (u = We()), u ??= W, c.value = u;
|
|
838
|
+
let d = (e) => {
|
|
826
839
|
let t;
|
|
827
|
-
|
|
840
|
+
r.groups && e && (t = [...r.groups, e]), l("update:groups", t);
|
|
841
|
+
}, f = (e) => {
|
|
842
|
+
if (!r.groups) {
|
|
843
|
+
l("update:groups");
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
846
|
+
l("update:groups", r.groups.map((t) => t.id === e.id ? e : t));
|
|
847
|
+
}, p = (e) => {
|
|
848
|
+
if (!r.groups) {
|
|
849
|
+
l("update:groups");
|
|
850
|
+
return;
|
|
851
|
+
}
|
|
852
|
+
l("update:groups", r.groups.filter((t) => t.id !== e.id));
|
|
828
853
|
};
|
|
829
|
-
return (
|
|
854
|
+
return t({ resetCacheGroups: (e = !1) => {
|
|
855
|
+
i.value?.resetCacheGroups(e);
|
|
856
|
+
} }), (t, n) => (N(), E("div", nt, [e.showFolders ? (N(), w(Ue, {
|
|
830
857
|
key: 0,
|
|
831
|
-
folderId:
|
|
832
|
-
"onUpdate:folderId": n[0] ||= (e) =>
|
|
833
|
-
folder:
|
|
834
|
-
"onUpdate:folder": n[1] ||= (e) =>
|
|
858
|
+
folderId: a.value,
|
|
859
|
+
"onUpdate:folderId": n[0] ||= (e) => a.value = e,
|
|
860
|
+
folder: o.value,
|
|
861
|
+
"onUpdate:folder": n[1] ||= (e) => o.value = e,
|
|
835
862
|
projectId: e.projectId,
|
|
836
863
|
folders: e.folders,
|
|
837
864
|
canSelectAll: e.canSelectAllGroups,
|
|
@@ -849,14 +876,16 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
849
876
|
"addIcon",
|
|
850
877
|
"client",
|
|
851
878
|
"service"
|
|
852
|
-
])) :
|
|
879
|
+
])) : T("", !0), e.showGroups ? (N(), w(tt, {
|
|
853
880
|
key: 1,
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
"onUpdate:
|
|
881
|
+
ref_key: "componentGroupsRef",
|
|
882
|
+
ref: i,
|
|
883
|
+
groupId: s.value,
|
|
884
|
+
"onUpdate:groupId": n[2] ||= (e) => s.value = e,
|
|
885
|
+
group: c.value,
|
|
886
|
+
"onUpdate:group": n[3] ||= (e) => c.value = e,
|
|
858
887
|
projectId: e.projectId,
|
|
859
|
-
folder:
|
|
888
|
+
folder: o.value,
|
|
860
889
|
groups: e.groups,
|
|
861
890
|
on: e.on,
|
|
862
891
|
canAdd: e.canAddGroup,
|
|
@@ -868,7 +897,9 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
868
897
|
addIcon: e.addIcon,
|
|
869
898
|
client: e.client,
|
|
870
899
|
service: e.service,
|
|
871
|
-
onAddGroup:
|
|
900
|
+
onAddGroup: d,
|
|
901
|
+
onEditGroup: f,
|
|
902
|
+
onDelGroup: p
|
|
872
903
|
}, null, 8, [
|
|
873
904
|
"groupId",
|
|
874
905
|
"group",
|
|
@@ -885,41 +916,41 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
885
916
|
"addIcon",
|
|
886
917
|
"client",
|
|
887
918
|
"service"
|
|
888
|
-
])) :
|
|
919
|
+
])) : T("", !0)]));
|
|
889
920
|
}
|
|
890
|
-
}),
|
|
921
|
+
}), it = (e) => ({
|
|
891
922
|
id: null,
|
|
892
923
|
name: e,
|
|
893
924
|
listItemProps: { type: "title" }
|
|
894
|
-
}),
|
|
925
|
+
}), at = {
|
|
895
926
|
scheduledUpdate: !1,
|
|
896
927
|
manualUpdate: !1,
|
|
897
928
|
guestProjects: !1
|
|
898
|
-
},
|
|
929
|
+
}, ot = (t, n) => {
|
|
899
930
|
let r = [], i = {
|
|
900
|
-
scheduledUpdate:
|
|
901
|
-
manualUpdate:
|
|
902
|
-
guestProjects:
|
|
931
|
+
scheduledUpdate: it(e().Projects.Scheduled_update),
|
|
932
|
+
manualUpdate: it(e().Projects.Manual_update),
|
|
933
|
+
guestProjects: it(e().Projects.Guest_projects)
|
|
903
934
|
}, a = n ? {
|
|
904
935
|
scheduledUpdate: !1,
|
|
905
936
|
manualUpdate: !1,
|
|
906
937
|
guestProjects: !1
|
|
907
|
-
} :
|
|
938
|
+
} : at;
|
|
908
939
|
for (let e of t) !a.scheduledUpdate && e.right?.startsWith("1") && e.on > 0 && (r.push(i.scheduledUpdate), a.scheduledUpdate = !0), !a.manualUpdate && e.right?.startsWith("1") && e.on === 0 && (r.push(i.manualUpdate), a.manualUpdate = !0), !a.guestProjects && e.right?.startsWith("0") && e.on >= 0 && (r.push(i.guestProjects), a.guestProjects = !0), r.push(e);
|
|
909
940
|
return r;
|
|
910
|
-
},
|
|
941
|
+
}, st = (e) => e.map((e) => ({
|
|
911
942
|
...e,
|
|
912
943
|
listItemProps: { attrs: { title: e.name } }
|
|
913
|
-
})),
|
|
944
|
+
})), ct = (e, t, n) => !e || e.length === 0 ? [] : (t && Object.keys(at).forEach((e) => at[e] = !1), ot(st(e), n)), lt = (e) => {
|
|
914
945
|
e = e.replace(/#.*/, "");
|
|
915
946
|
let t = location.hash;
|
|
916
947
|
return t = t.replace(/historyView=[^&]*/, ""), t = t.replace(/modelsKeys=[^&]*/, ""), 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(/%22modelsKeys%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:\{[^}]*}(,?)/, "$1")), e + t;
|
|
917
|
-
},
|
|
948
|
+
}, ut = (e, t) => {
|
|
918
949
|
t && t.target instanceof HTMLElement && c.close(t.target.closest(".top-popup-wrapper"));
|
|
919
|
-
let n =
|
|
950
|
+
let n = lt(e);
|
|
920
951
|
location.href = n;
|
|
921
|
-
},
|
|
922
|
-
let t =
|
|
952
|
+
}, dt = (e) => {
|
|
953
|
+
let t = ft(), n = location.pathname.split("/"), r = "project/dynamics/", i = "";
|
|
923
954
|
return n[1] == "project" && (r = n[1] + "/" + n[2] + "/"), n[2] == "settings" && (i = location.hash), [
|
|
924
955
|
"watcher",
|
|
925
956
|
"indexing",
|
|
@@ -928,15 +959,15 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
928
959
|
"direct",
|
|
929
960
|
"adwords"
|
|
930
961
|
].includes(n[4]) && (i = n[4] + "/"), "https://" + t + "/" + r + e + "/" + i;
|
|
931
|
-
},
|
|
962
|
+
}, ft = () => window.page?.subdomain ? window.location.host.replace(window.page?.subdomain + ".", "") : window.location.host, pt = (e) => {
|
|
932
963
|
let t = e.startsWith("http") ? e : "http://" + e;
|
|
933
964
|
return t = t.replace(/"/g, "%22"), t;
|
|
934
|
-
},
|
|
965
|
+
}, mt = (e, t) => {
|
|
935
966
|
let n = e.params.filters ?? [];
|
|
936
967
|
n = n.filter((e) => e.name !== "GEN_SEARCH_STRING()");
|
|
937
968
|
let r = h(t), i = t.replace(/([[^$.|?*+()])/g, "\\$1"), a = r.replace(/([[^$.|?*+()])/g, "\\$1");
|
|
938
969
|
t && n.push(o("GEN_SEARCH_STRING()", "REGEXP", [`(${i}|${a})`])), e.changeParams({ filters: n });
|
|
939
|
-
},
|
|
970
|
+
}, ht = (e, t, n) => {
|
|
940
971
|
let r = e.gen("/get/projects_2/projects/", [
|
|
941
972
|
"id",
|
|
942
973
|
"user_id",
|
|
@@ -956,14 +987,14 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
956
987
|
]
|
|
957
988
|
}, r.options.onApiLoaded = (e, t, n) => {
|
|
958
989
|
let r = t.data.filters.length === 1 && t.data.offset === 0 || t.data.limit === 1e3, i = t.data.limit === 100 && t.data.filters.length > 1 ? !0 : void 0;
|
|
959
|
-
e.result =
|
|
990
|
+
e.result = ct(e.result, r, i), n?.(e, t);
|
|
960
991
|
}, r;
|
|
961
|
-
},
|
|
992
|
+
}, gt = (e) => e.gen("/add/projects_2/projects/"), _t = { class: "top-projectSelectorSubmenu_item" }, vt = [
|
|
962
993
|
"href",
|
|
963
994
|
"title",
|
|
964
995
|
"data-top-icon",
|
|
965
996
|
"data-right"
|
|
966
|
-
],
|
|
997
|
+
], yt = { class: "top-projectSelectorSubmenu_item" }, bt = ["href"], xt = /* @__PURE__ */ A({
|
|
967
998
|
__name: "submenu",
|
|
968
999
|
props: {
|
|
969
1000
|
id: {},
|
|
@@ -971,7 +1002,7 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
971
1002
|
url: {}
|
|
972
1003
|
},
|
|
973
1004
|
setup(t) {
|
|
974
|
-
let n = t, r = e(), i =
|
|
1005
|
+
let n = t, r = e(), i = ft(), a = [
|
|
975
1006
|
{
|
|
976
1007
|
href: `https://${i}/project/keywords/${n.id}/`,
|
|
977
1008
|
title: r.Common.Menu_phrases,
|
|
@@ -1044,7 +1075,7 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1044
1075
|
icon: "",
|
|
1045
1076
|
right: "2"
|
|
1046
1077
|
}
|
|
1047
|
-
], o =
|
|
1078
|
+
], o = C(() => {
|
|
1048
1079
|
if (!window.page?.data?.aiTracker) {
|
|
1049
1080
|
let e = a.findIndex((e) => e.href.includes("ai-tracker"));
|
|
1050
1081
|
e !== -1 && a.splice(e, 1);
|
|
@@ -1052,53 +1083,53 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1052
1083
|
return n.right.includes("0") ? a.filter((e) => n.right[e.right] === "1") : a;
|
|
1053
1084
|
});
|
|
1054
1085
|
return (e, n) => {
|
|
1055
|
-
let r =
|
|
1056
|
-
return
|
|
1086
|
+
let r = le("TopButton");
|
|
1087
|
+
return N(), w(L(y), {
|
|
1057
1088
|
class: "top-projectSelectorSubmenu",
|
|
1058
1089
|
notch: !1,
|
|
1059
1090
|
pos: "2"
|
|
1060
1091
|
}, {
|
|
1061
|
-
opener:
|
|
1092
|
+
opener: B(() => [k(r, {
|
|
1062
1093
|
class: "top-projectSelectorSubmenu_opener",
|
|
1063
1094
|
"data-top-icon": "",
|
|
1064
1095
|
color: "theme"
|
|
1065
1096
|
})]),
|
|
1066
|
-
contentList:
|
|
1097
|
+
contentList: B(() => [(N(!0), E(S, null, F(o.value, (e) => (N(), E("li", _t, [D("a", {
|
|
1067
1098
|
href: e.href,
|
|
1068
1099
|
title: e.title,
|
|
1069
1100
|
"data-top-icon": e.icon,
|
|
1070
1101
|
"data-right": e.right
|
|
1071
|
-
}, null, 8,
|
|
1102
|
+
}, null, 8, vt)]))), 256)), D("li", yt, [D("a", {
|
|
1072
1103
|
href: t.url,
|
|
1073
1104
|
"data-top-icon": "",
|
|
1074
1105
|
target: "_blank"
|
|
1075
|
-
}, null, 8,
|
|
1106
|
+
}, null, 8, bt)])]),
|
|
1076
1107
|
_: 1
|
|
1077
1108
|
});
|
|
1078
1109
|
};
|
|
1079
1110
|
}
|
|
1080
|
-
}),
|
|
1081
|
-
localStorage.setItem(
|
|
1111
|
+
}), q = "ui_project_selector_total:", St = 1440 * 60 * 1e3, J = fe(), Ct = P(0), Y = P(null), wt = (e, t) => {
|
|
1112
|
+
localStorage.setItem(q + e, JSON.stringify({
|
|
1082
1113
|
projectsTotal: t,
|
|
1083
|
-
expiresAt: Date.now() +
|
|
1114
|
+
expiresAt: Date.now() + St
|
|
1084
1115
|
}));
|
|
1085
|
-
},
|
|
1086
|
-
let t = localStorage.getItem(
|
|
1116
|
+
}, Tt = (e) => {
|
|
1117
|
+
let t = localStorage.getItem(q + e);
|
|
1087
1118
|
if (!t) return;
|
|
1088
1119
|
let { projectsTotal: n, expiresAt: r } = JSON.parse(t);
|
|
1089
1120
|
if (Date.now() > r) {
|
|
1090
|
-
localStorage.removeItem(
|
|
1121
|
+
localStorage.removeItem(q + e);
|
|
1091
1122
|
return;
|
|
1092
1123
|
}
|
|
1093
1124
|
return n;
|
|
1094
|
-
},
|
|
1095
|
-
|
|
1096
|
-
},
|
|
1125
|
+
}, Et = (e, t = !0) => {
|
|
1126
|
+
J.value = void 0, localStorage.removeItem(q + e), t && Ct.value++;
|
|
1127
|
+
}, Dt = { class: "top-projectSelector_item" }, Ot = { class: "top-projectSelector_itemText" }, kt = { class: "top-comment" }, At = {
|
|
1097
1128
|
key: 0,
|
|
1098
1129
|
class: "top-comment"
|
|
1099
|
-
},
|
|
1130
|
+
}, jt = ["href", "onClick"], Mt = 1e3, Nt = /* @__PURE__ */ A({
|
|
1100
1131
|
__name: "projectSelector",
|
|
1101
|
-
props: /* @__PURE__ */
|
|
1132
|
+
props: /* @__PURE__ */ j({
|
|
1102
1133
|
modelValue: {},
|
|
1103
1134
|
client: {},
|
|
1104
1135
|
addLinksToProjects: {
|
|
@@ -1121,33 +1152,33 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1121
1152
|
setup(t) {
|
|
1122
1153
|
let n = e();
|
|
1123
1154
|
if (!window.mo?.user?.id) throw Error("TopProjectSelector: не удалось определить userId. Компонент требует авторизованного пользователя (см. window.mo.user.id)");
|
|
1124
|
-
let r = window.mo.user.id, i = t, a =
|
|
1125
|
-
if (!(!c.value && c.value !== 0)) return c.value <
|
|
1155
|
+
let r = window.mo.user.id, i = t, a = R(t, "modelValue"), o = ht(i.client, r), s = gt(i.client), c = P(Tt(r)), d = P(null), f = C(() => i.placeholder ?? n.Projects.Select_project), p = C(() => !J.value || !i.excludeProjectId ? J.value : J.value.filter((e) => e.id !== i.excludeProjectId)), m = C(() => {
|
|
1156
|
+
if (!(!c.value && c.value !== 0)) return c.value < Mt ? "static" : "api";
|
|
1126
1157
|
});
|
|
1127
|
-
|
|
1158
|
+
z(Ct, () => {
|
|
1128
1159
|
v();
|
|
1129
|
-
}),
|
|
1130
|
-
!a.value.id || !i.addLinksToProjects || dt(
|
|
1160
|
+
}), z(a, () => {
|
|
1161
|
+
!a.value.id || !i.addLinksToProjects || ut(dt(a.value.id));
|
|
1131
1162
|
});
|
|
1132
1163
|
let h = async () => {
|
|
1133
|
-
|
|
1134
|
-
let e = await
|
|
1164
|
+
Y.value ||= ht(i.client, r, { limit: Mt }).call();
|
|
1165
|
+
let e = await Y.value;
|
|
1135
1166
|
if (e.errors) {
|
|
1136
|
-
|
|
1167
|
+
Y.value = null;
|
|
1137
1168
|
return;
|
|
1138
1169
|
}
|
|
1139
|
-
return
|
|
1170
|
+
return Y.value = null, e;
|
|
1140
1171
|
}, g = async () => {
|
|
1141
1172
|
if (c.value) return;
|
|
1142
1173
|
let e = await h();
|
|
1143
|
-
e && (c.value = e.total, m.value === "static" && !
|
|
1174
|
+
e && (c.value = e.total, m.value === "static" && !J.value && (J.value = e.result), c.value && wt(r, c.value));
|
|
1144
1175
|
}, _ = async (e) => {
|
|
1145
1176
|
let t = await s.changeParams({
|
|
1146
1177
|
url: e.name,
|
|
1147
1178
|
name: e.name
|
|
1148
1179
|
}).call();
|
|
1149
1180
|
if (!t.errors) {
|
|
1150
|
-
if (
|
|
1181
|
+
if (J.value && m.value === "static") {
|
|
1151
1182
|
let n = {
|
|
1152
1183
|
id: Number(t.result),
|
|
1153
1184
|
user_id: r,
|
|
@@ -1156,27 +1187,27 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1156
1187
|
on: 0,
|
|
1157
1188
|
right: "11111111111111111111",
|
|
1158
1189
|
listItemProps: { attrs: { title: e.name } }
|
|
1159
|
-
}, i =
|
|
1160
|
-
|
|
1161
|
-
...
|
|
1190
|
+
}, i = J.value.findIndex((e) => e.on === 0);
|
|
1191
|
+
J.value = [
|
|
1192
|
+
...J.value.slice(0, i),
|
|
1162
1193
|
n,
|
|
1163
|
-
...
|
|
1164
|
-
], c.value && (c.value += 1,
|
|
1194
|
+
...J.value.slice(i)
|
|
1195
|
+
], c.value && (c.value += 1, wt(r, c.value));
|
|
1165
1196
|
}
|
|
1166
|
-
m.value === "api" &&
|
|
1197
|
+
m.value === "api" && Et(r);
|
|
1167
1198
|
}
|
|
1168
1199
|
}, v = () => {
|
|
1169
1200
|
m.value === "api" && d.value?.resetCache(!0);
|
|
1170
1201
|
}, ee = async () => {
|
|
1171
|
-
if (
|
|
1202
|
+
if (J.value || m.value !== "static") return;
|
|
1172
1203
|
let e = await h();
|
|
1173
|
-
e && (
|
|
1204
|
+
e && (J.value = e.result);
|
|
1174
1205
|
};
|
|
1175
|
-
return
|
|
1206
|
+
return oe(async () => {
|
|
1176
1207
|
await g();
|
|
1177
1208
|
}), (e, n) => {
|
|
1178
|
-
let r =
|
|
1179
|
-
return
|
|
1209
|
+
let r = le("TopButton");
|
|
1210
|
+
return N(), w(x, {
|
|
1180
1211
|
ref_key: "refSelector",
|
|
1181
1212
|
ref: d,
|
|
1182
1213
|
class: "top-projectSelector",
|
|
@@ -1192,44 +1223,44 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1192
1223
|
],
|
|
1193
1224
|
placeholder: f.value,
|
|
1194
1225
|
hasCloserBtn: "",
|
|
1195
|
-
api: m.value === "api" ?
|
|
1196
|
-
apiSetSearchParams: m.value === "api" ? (...e) =>
|
|
1226
|
+
api: m.value === "api" ? L(o) : void 0,
|
|
1227
|
+
apiSetSearchParams: m.value === "api" ? (...e) => L(mt)(...e) : void 0,
|
|
1197
1228
|
useCache: "",
|
|
1198
1229
|
appendSearchToResult: "",
|
|
1199
1230
|
appendSearchAllowDuplicate: "",
|
|
1200
|
-
appendSearchToResultCond:
|
|
1231
|
+
appendSearchToResultCond: L(l),
|
|
1201
1232
|
appendWithoutSelect: "",
|
|
1202
1233
|
buttonProps: t.buttonProps,
|
|
1203
1234
|
openerShortcut: t.openerShortcut,
|
|
1204
1235
|
onAppendItem: _,
|
|
1205
1236
|
onOpen: ee
|
|
1206
1237
|
}, {
|
|
1207
|
-
item:
|
|
1208
|
-
t.addLinksToProjects ? (
|
|
1238
|
+
item: B(({ item: i }) => [D("div", Dt, [D("div", Ot, [i.id ? (N(), E(S, { key: 0 }, [O(I(L(u)(i.name, 20)) + " ", 1), D("span", kt, " id " + I(i.id), 1)], 64)) : (N(), E(S, { key: 1 }, [i.listItemProps?.type ? T("", !0) : (N(), E("div", At, I(e.$i18n.Projects.Add_project) + ": ", 1)), O(" " + I(i.name), 1)], 64))]), i.id ? (N(), E(S, { key: 0 }, [
|
|
1239
|
+
t.addLinksToProjects ? (N(), E("a", {
|
|
1209
1240
|
key: 0,
|
|
1210
1241
|
class: "top-projectSelector_itemLink",
|
|
1211
|
-
href:
|
|
1212
|
-
onClick:
|
|
1213
|
-
}, null, 8,
|
|
1214
|
-
e.$core.state.isMobile ?
|
|
1242
|
+
href: L(dt)(i.id),
|
|
1243
|
+
onClick: V((e) => L(ut)(L(dt)(i.id), e), ["prevent", "stop"])
|
|
1244
|
+
}, null, 8, jt)) : T("", !0),
|
|
1245
|
+
e.$core.state.isMobile ? T("", !0) : (N(), w(r, {
|
|
1215
1246
|
key: 1,
|
|
1216
1247
|
class: "top-projectSelector_itemExtLink",
|
|
1217
|
-
href:
|
|
1248
|
+
href: L(pt)(i.url),
|
|
1218
1249
|
"data-top-icon": "",
|
|
1219
1250
|
color: "theme",
|
|
1220
1251
|
target: "_blank",
|
|
1221
|
-
onClick: n[0] ||=
|
|
1252
|
+
onClick: n[0] ||= V(() => {}, ["stop"])
|
|
1222
1253
|
}, null, 8, ["href"])),
|
|
1223
|
-
|
|
1254
|
+
k(xt, {
|
|
1224
1255
|
id: i.id,
|
|
1225
1256
|
right: i.right ?? void 0,
|
|
1226
|
-
url:
|
|
1257
|
+
url: L(pt)(i.url)
|
|
1227
1258
|
}, null, 8, [
|
|
1228
1259
|
"id",
|
|
1229
1260
|
"right",
|
|
1230
1261
|
"url"
|
|
1231
1262
|
])
|
|
1232
|
-
], 64)) :
|
|
1263
|
+
], 64)) : T("", !0)])]),
|
|
1233
1264
|
_: 1
|
|
1234
1265
|
}, 8, [
|
|
1235
1266
|
"modelValue",
|
|
@@ -1245,40 +1276,40 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1245
1276
|
]);
|
|
1246
1277
|
};
|
|
1247
1278
|
}
|
|
1248
|
-
}),
|
|
1249
|
-
e =
|
|
1279
|
+
}), Pt = (e) => "-" + e, X = (e) => e[0] === "-" ? e.substring(1) : e, Z = (e, t) => {
|
|
1280
|
+
e = X(e);
|
|
1250
1281
|
let n = t.find((t) => t.id === e);
|
|
1251
1282
|
if (n) return n;
|
|
1252
|
-
},
|
|
1283
|
+
}, Ft = (e, t, n) => {
|
|
1253
1284
|
t ||= { id: e.id }, t.id = e.id, t.pos ??= "3", t.notch ??= !0, t.posBy ??= "fixed";
|
|
1254
1285
|
let r = c.genElPopupOpener("div", t);
|
|
1255
1286
|
return r.classList.add("top-tagSelector"), e.useTopButton && r.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), e.useTopButton || r.classList.add("top-tagSelector-custom"), e.mode === "filter" && r.classList.add("top-tagSelector-filter"), e.mode === "setter" && !e.filters && r.classList.add("top-tagSelector-setter_single"), e.mode === "setter" && e.filters && r.classList.add("top-tagSelector-setter_several"), r.onclick = (t) => {
|
|
1256
1287
|
t.preventDefault(), t.stopPropagation(), r.onclick = null;
|
|
1257
|
-
let i =
|
|
1288
|
+
let i = P(e.modelValue);
|
|
1258
1289
|
s(r, "topTagSelectorTarget", {
|
|
1259
1290
|
model: i,
|
|
1260
1291
|
mode: e.mode,
|
|
1261
1292
|
targetId: e.targetId,
|
|
1262
1293
|
filters: e.filters,
|
|
1263
1294
|
payload: e.payload
|
|
1264
|
-
}), delete r.dataset.topPopupDisabled,
|
|
1265
|
-
e.modelValue = i.value,
|
|
1295
|
+
}), delete r.dataset.topPopupDisabled, re(e.modelValue) || z(i, () => {
|
|
1296
|
+
e.modelValue = i.value, Q(r, e, n);
|
|
1266
1297
|
}), r.click();
|
|
1267
|
-
},
|
|
1298
|
+
}, re(e.modelValue) ? z(e.modelValue, () => Q(r, e, n)) : s(r, "topTagSelectorRender", (t) => {
|
|
1268
1299
|
e.modelValue = t;
|
|
1269
1300
|
let i = s(r, "topTagSelectorTarget");
|
|
1270
|
-
i && (i.model.value = t),
|
|
1271
|
-
}),
|
|
1272
|
-
},
|
|
1301
|
+
i && (i.model.value = t), Q(r, e, n);
|
|
1302
|
+
}), Q(r, e, n), r;
|
|
1303
|
+
}, It = (e, t) => {
|
|
1273
1304
|
s(e, "topTagSelectorRender")?.(t);
|
|
1274
|
-
},
|
|
1275
|
-
let i =
|
|
1305
|
+
}, Q = (t, n, r) => {
|
|
1306
|
+
let i = L(n.modelValue);
|
|
1276
1307
|
if (t.classList.toggle("top-tagSelector-selectedOne", !i.length || i.length === 1), t.classList.toggle("top-tagSelector-toTwoLine", i.length > 5), n.mode === "setter" && n.filters) {
|
|
1277
1308
|
t.innerHTML = `<div>${r}</div>`;
|
|
1278
1309
|
return;
|
|
1279
1310
|
}
|
|
1280
1311
|
if (t.innerHTML = "", !i.length && n.mode === "filter") {
|
|
1281
|
-
let n =
|
|
1312
|
+
let n = Lt({
|
|
1282
1313
|
id: "all",
|
|
1283
1314
|
colorId: "",
|
|
1284
1315
|
name: e().Common?.All_tags ?? "",
|
|
@@ -1287,18 +1318,18 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1287
1318
|
t.append(n);
|
|
1288
1319
|
}
|
|
1289
1320
|
i.forEach((e) => {
|
|
1290
|
-
let r =
|
|
1291
|
-
id:
|
|
1292
|
-
colorId:
|
|
1293
|
-
name:
|
|
1294
|
-
state:
|
|
1321
|
+
let r = Lt({
|
|
1322
|
+
id: X(e),
|
|
1323
|
+
colorId: Z(e, n.tags)?.color_id ?? "",
|
|
1324
|
+
name: Z(e, n.tags)?.name ?? "",
|
|
1325
|
+
state: X(e) === e ? "selected" : "excluded"
|
|
1295
1326
|
});
|
|
1296
1327
|
t.append(r);
|
|
1297
1328
|
});
|
|
1298
|
-
},
|
|
1329
|
+
}, Lt = (e) => {
|
|
1299
1330
|
let t = document.createElement("div");
|
|
1300
1331
|
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;
|
|
1301
|
-
},
|
|
1332
|
+
}, Rt = [
|
|
1302
1333
|
{
|
|
1303
1334
|
id: "1",
|
|
1304
1335
|
name: "Without Tag",
|
|
@@ -1349,11 +1380,11 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1349
1380
|
name: "Turquoise",
|
|
1350
1381
|
color_id: "10"
|
|
1351
1382
|
}
|
|
1352
|
-
],
|
|
1383
|
+
], zt = [
|
|
1353
1384
|
"data-tag_id",
|
|
1354
1385
|
"data-tag_color_id",
|
|
1355
1386
|
"title"
|
|
1356
|
-
],
|
|
1387
|
+
], Bt = /* @__PURE__ */ A({
|
|
1357
1388
|
__name: "tagIcon",
|
|
1358
1389
|
props: {
|
|
1359
1390
|
id: {},
|
|
@@ -1362,8 +1393,8 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1362
1393
|
state: {}
|
|
1363
1394
|
},
|
|
1364
1395
|
setup(e) {
|
|
1365
|
-
return (t, n) => (
|
|
1366
|
-
class:
|
|
1396
|
+
return (t, n) => (N(), E("div", {
|
|
1397
|
+
class: M({
|
|
1367
1398
|
"top-tagSelector_tagIcon": !0,
|
|
1368
1399
|
"top-tagSelector-active": !!e.state,
|
|
1369
1400
|
"top-tagSelector-excluded": e.state === "excluded"
|
|
@@ -1371,11 +1402,11 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1371
1402
|
"data-tag_id": e.id,
|
|
1372
1403
|
"data-tag_color_id": e.colorId,
|
|
1373
1404
|
title: e.name
|
|
1374
|
-
}, null, 10,
|
|
1405
|
+
}, null, 10, zt));
|
|
1375
1406
|
}
|
|
1376
|
-
}), Vt = ["contenteditable", "onKeydown"], Ht = /* @__PURE__ */
|
|
1407
|
+
}), Vt = ["contenteditable", "onKeydown"], Ht = /* @__PURE__ */ A({
|
|
1377
1408
|
__name: "tagPopupListItem",
|
|
1378
|
-
props: /* @__PURE__ */
|
|
1409
|
+
props: /* @__PURE__ */ j({
|
|
1379
1410
|
editable: { type: Boolean },
|
|
1380
1411
|
disabled: { type: Boolean },
|
|
1381
1412
|
canExclude: { type: Boolean },
|
|
@@ -1387,18 +1418,18 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1387
1418
|
name: { required: !0 },
|
|
1388
1419
|
nameModifiers: {}
|
|
1389
1420
|
}),
|
|
1390
|
-
emits: /* @__PURE__ */
|
|
1421
|
+
emits: /* @__PURE__ */ j([
|
|
1391
1422
|
"update:name",
|
|
1392
1423
|
"unselect",
|
|
1393
1424
|
"exclude",
|
|
1394
1425
|
"select"
|
|
1395
1426
|
], ["update:name"]),
|
|
1396
1427
|
setup(e, { emit: t }) {
|
|
1397
|
-
let n = e, r = t, i =
|
|
1428
|
+
let n = e, r = t, i = R(e, "name"), a = P(null), o = C(() => navigator.userAgent.indexOf("Firefox") == -1 ? {} : {
|
|
1398
1429
|
contenteditable: s.value,
|
|
1399
1430
|
onpaste: (e) => e.preventDefault()
|
|
1400
|
-
}), s =
|
|
1401
|
-
s.value = !0, await
|
|
1431
|
+
}), s = P(!1), c = async () => {
|
|
1432
|
+
s.value = !0, await ae(), a.value?.focus();
|
|
1402
1433
|
}, l = () => {
|
|
1403
1434
|
let e = a.value?.innerText;
|
|
1404
1435
|
if (!e) return u();
|
|
@@ -1410,8 +1441,8 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1410
1441
|
let t = "selected";
|
|
1411
1442
|
n.canExclude && (e.ctrlKey || e.metaKey) && (t = "excluded"), n.state == t && (t = ""), t === "" && r("unselect"), t === "selected" && r("select"), t === "excluded" && r("exclude");
|
|
1412
1443
|
};
|
|
1413
|
-
return (t, n) => (
|
|
1414
|
-
class:
|
|
1444
|
+
return (t, n) => (N(), w(v, {
|
|
1445
|
+
class: M({
|
|
1415
1446
|
"top-tagSelector_tagListItem": !0,
|
|
1416
1447
|
"top-tagSelector_tagListItem-inEdit": s.value,
|
|
1417
1448
|
"top-tagSelector_tagListItem-disabled": e.disabled,
|
|
@@ -1419,10 +1450,10 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1419
1450
|
"top-tagSelector-active": !!e.state,
|
|
1420
1451
|
"top-tagSelector-excluded": e.state === "excluded"
|
|
1421
1452
|
}),
|
|
1422
|
-
onClick:
|
|
1453
|
+
onClick: V(d, ["stop"])
|
|
1423
1454
|
}, {
|
|
1424
|
-
default:
|
|
1425
|
-
|
|
1455
|
+
default: B(() => [
|
|
1456
|
+
k(Bt, {
|
|
1426
1457
|
id: e.id,
|
|
1427
1458
|
name: i.value,
|
|
1428
1459
|
colorId: e.colorId,
|
|
@@ -1433,31 +1464,31 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1433
1464
|
"colorId",
|
|
1434
1465
|
"state"
|
|
1435
1466
|
]),
|
|
1436
|
-
|
|
1467
|
+
D("span", ie({
|
|
1437
1468
|
ref_key: "elName",
|
|
1438
1469
|
ref: a,
|
|
1439
1470
|
class: "top-tagSelector_tagListItemName",
|
|
1440
1471
|
contenteditable: s.value ? "plaintext-only" : !1
|
|
1441
|
-
}, o.value, { onKeydown: [
|
|
1442
|
-
e.editable ? (
|
|
1472
|
+
}, o.value, { onKeydown: [he(V(l, ["stop"]), ["enter"]), he(V(u, ["stop"]), ["esc"])] }), I(i.value), 17, Vt),
|
|
1473
|
+
e.editable ? (N(), E(S, { key: 0 }, [s.value ? (N(), E("span", {
|
|
1443
1474
|
key: 1,
|
|
1444
1475
|
"data-top-icon": "",
|
|
1445
1476
|
class: "top-tagSelector_edit",
|
|
1446
|
-
onClick:
|
|
1447
|
-
})) : (
|
|
1477
|
+
onClick: V(l, ["stop"])
|
|
1478
|
+
})) : (N(), E("span", {
|
|
1448
1479
|
key: 0,
|
|
1449
1480
|
"data-top-icon": "",
|
|
1450
1481
|
class: "top-tagSelector_edit",
|
|
1451
1482
|
onClick: c
|
|
1452
|
-
}))], 64)) :
|
|
1483
|
+
}))], 64)) : T("", !0)
|
|
1453
1484
|
]),
|
|
1454
1485
|
_: 1
|
|
1455
1486
|
}, 8, ["class"]));
|
|
1456
1487
|
}
|
|
1457
|
-
}), Ut = { key: 1 }, Wt = /* @__PURE__ */
|
|
1488
|
+
}), Ut = { key: 1 }, Wt = /* @__PURE__ */ A({
|
|
1458
1489
|
inheritAttrs: !1,
|
|
1459
1490
|
__name: "popupOpener",
|
|
1460
|
-
props: /* @__PURE__ */
|
|
1491
|
+
props: /* @__PURE__ */ j({
|
|
1461
1492
|
modelValue: {},
|
|
1462
1493
|
id: {},
|
|
1463
1494
|
tags: {},
|
|
@@ -1473,7 +1504,7 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1473
1504
|
}),
|
|
1474
1505
|
emits: ["update:modelValue"],
|
|
1475
1506
|
setup(e) {
|
|
1476
|
-
let t = e, n =
|
|
1507
|
+
let t = e, n = R(e, "modelValue"), i = t.useTopButton ? r : "div", a = t.useTopButton ? "html" : "default", o = {
|
|
1477
1508
|
model: n,
|
|
1478
1509
|
mode: t.mode,
|
|
1479
1510
|
targetId: t.targetId,
|
|
@@ -1481,9 +1512,9 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1481
1512
|
payload: t.payload
|
|
1482
1513
|
};
|
|
1483
1514
|
return (r, s) => {
|
|
1484
|
-
let c =
|
|
1485
|
-
return
|
|
1486
|
-
default:
|
|
1515
|
+
let c = ue("top-data");
|
|
1516
|
+
return N(), w(g, { id: e.id }, {
|
|
1517
|
+
default: B(() => [me((N(), w(de(L(i)), ie({
|
|
1487
1518
|
class: {
|
|
1488
1519
|
"top-tagSelector": !0,
|
|
1489
1520
|
"top-tagSelector-useTopButton": t.useTopButton,
|
|
@@ -1498,17 +1529,17 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1498
1529
|
color: "theme",
|
|
1499
1530
|
styling: e.styling
|
|
1500
1531
|
}, r.$attrs), {
|
|
1501
|
-
[
|
|
1532
|
+
[L(a)]: B(() => [!n.value.length && e.mode === "filter" ? (N(), w(Bt, {
|
|
1502
1533
|
key: 0,
|
|
1503
1534
|
id: "all",
|
|
1504
1535
|
colorId: "",
|
|
1505
1536
|
name: r.$i18n.Common.All_tags ?? "",
|
|
1506
1537
|
state: ""
|
|
1507
|
-
}, null, 8, ["name"])) :
|
|
1508
|
-
id:
|
|
1509
|
-
colorId:
|
|
1510
|
-
name:
|
|
1511
|
-
state:
|
|
1538
|
+
}, null, 8, ["name"])) : T("", !0), e.mode === "setter" && e.filters ? (N(), E("div", Ut, [ce(r.$slots, "default")])) : (N(!0), E(S, { key: 2 }, F(n.value, (t) => (N(), w(Bt, {
|
|
1539
|
+
id: L(X)(t),
|
|
1540
|
+
colorId: L(Z)(t, e.tags)?.color_id ?? "",
|
|
1541
|
+
name: L(Z)(t, e.tags)?.name ?? "",
|
|
1542
|
+
state: L(X)(t) === t ? "selected" : "excluded"
|
|
1512
1543
|
}, null, 8, [
|
|
1513
1544
|
"id",
|
|
1514
1545
|
"colorId",
|
|
@@ -1525,9 +1556,9 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1525
1556
|
}, 8, ["id"]);
|
|
1526
1557
|
};
|
|
1527
1558
|
}
|
|
1528
|
-
}), Gt = /* @__PURE__ */
|
|
1559
|
+
}), Gt = /* @__PURE__ */ A({
|
|
1529
1560
|
__name: "tagSelector",
|
|
1530
|
-
props: /* @__PURE__ */
|
|
1561
|
+
props: /* @__PURE__ */ j({
|
|
1531
1562
|
modelValue: {},
|
|
1532
1563
|
tags: {},
|
|
1533
1564
|
tagsEditable: { type: Boolean },
|
|
@@ -1548,20 +1579,20 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1548
1579
|
}, {
|
|
1549
1580
|
modelValue: { required: !0 },
|
|
1550
1581
|
modelModifiers: {},
|
|
1551
|
-
tags: { default:
|
|
1582
|
+
tags: { default: se(Rt) },
|
|
1552
1583
|
tagsModifiers: {}
|
|
1553
1584
|
}),
|
|
1554
|
-
emits: /* @__PURE__ */
|
|
1585
|
+
emits: /* @__PURE__ */ j([
|
|
1555
1586
|
"selector",
|
|
1556
1587
|
"setter",
|
|
1557
1588
|
"tagsChanged"
|
|
1558
1589
|
], ["update:modelValue", "update:tags"]),
|
|
1559
1590
|
setup(a, { emit: o }) {
|
|
1560
|
-
let c = e(), l = a, u =
|
|
1591
|
+
let c = e(), l = a, u = R(a, "modelValue"), d = R(a, "tags"), f = o, p = n((e, t) => {
|
|
1561
1592
|
f(e, t);
|
|
1562
1593
|
}, l.emitDelay);
|
|
1563
1594
|
l.singleMode && !u.value.length && (u.value = [d.value[0].id]);
|
|
1564
|
-
let m = l.id ?? "top-popup-id-" + Math.random(), h =
|
|
1595
|
+
let m = l.id ?? "top-popup-id-" + Math.random(), h = P("add"), g = () => {
|
|
1565
1596
|
let e = " " + c.Common.Tags?.toLowerCase(), t = /* @__PURE__ */ new Map();
|
|
1566
1597
|
return t.set("add", {
|
|
1567
1598
|
value: "add",
|
|
@@ -1573,35 +1604,35 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1573
1604
|
value: "delete",
|
|
1574
1605
|
title: c.Common.Delete + e
|
|
1575
1606
|
}), t;
|
|
1576
|
-
}, _ =
|
|
1607
|
+
}, _ = fe({
|
|
1577
1608
|
model: u,
|
|
1578
1609
|
mode: "filter",
|
|
1579
1610
|
targetId: void 0,
|
|
1580
1611
|
filters: void 0,
|
|
1581
1612
|
payload: void 0
|
|
1582
1613
|
});
|
|
1583
|
-
|
|
1614
|
+
z(u, () => {
|
|
1584
1615
|
p("selector", u.value);
|
|
1585
1616
|
});
|
|
1586
|
-
let ee =
|
|
1617
|
+
let ee = C(() => {
|
|
1587
1618
|
if (_.value.mode === "setter" && l.maxTagsForSetter && !_.value.filters) return _.value.model.value.length >= l.maxTagsForSetter;
|
|
1588
|
-
}),
|
|
1619
|
+
}), b = (e) => {
|
|
1589
1620
|
if (e !== "all") {
|
|
1590
1621
|
if (_.value.model.value.includes(e)) return "selected";
|
|
1591
|
-
if (_.value.model.value.includes(
|
|
1622
|
+
if (_.value.model.value.includes(Pt(e))) return "excluded";
|
|
1592
1623
|
}
|
|
1593
1624
|
return e === "all" && !_.value.model.value.length ? "selected" : "";
|
|
1594
|
-
},
|
|
1595
|
-
let n =
|
|
1625
|
+
}, x = (e, t) => {
|
|
1626
|
+
let n = Pt(e), r = _.value.model.value.filter((t) => t !== e && t !== n);
|
|
1596
1627
|
t === "select" && r.push(e), t === "exclude" && r.push(n), _.value.mode === "setter" && _.value.targetId !== void 0 && l.requiredForSetter && (r.length || r.push("1"), r.length === 2 && _.value.model.value.length === 1 && _.value.model.value[0] === "1" && (r = r.filter((e) => e !== "1"))), l.singleMode && !_.value.filters && (r.length || (r = _.value.model.value), r.length > 1 && (r = [r[r.length - 1]])), r.sort((e, t) => l.tags ? l.tags.findIndex((t) => t.id === e) - l.tags.findIndex((e) => e.id === t) : 0), _.value.model.value = r, _.value.mode === "setter" && _.value.targetId !== void 0 && p("setter", {
|
|
1597
1628
|
tagsIds: r,
|
|
1598
1629
|
targetId: _.value.targetId,
|
|
1599
1630
|
payload: _.value.payload
|
|
1600
1631
|
});
|
|
1601
|
-
},
|
|
1632
|
+
}, te = C(() => {
|
|
1602
1633
|
let e = "top-tagSelector_popup";
|
|
1603
1634
|
return _.value.mode === "filter" && (e += " top-tagSelector_popup-filter"), _.value.mode === "setter" && (e += " top-tagSelector_popup-setter"), e;
|
|
1604
|
-
}),
|
|
1635
|
+
}), D = () => {
|
|
1605
1636
|
let e = prompt("", "New tag");
|
|
1606
1637
|
if (!e || e === "New tag") return;
|
|
1607
1638
|
let t = d.value.length + 1;
|
|
@@ -1610,7 +1641,7 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1610
1641
|
name: e,
|
|
1611
1642
|
color_id: String((t - 1) % 10 + 1)
|
|
1612
1643
|
}), f("tagsChanged", d.value);
|
|
1613
|
-
},
|
|
1644
|
+
}, A = (e) => {
|
|
1614
1645
|
if (_.value = s(e.elPopupOpener, "topTagSelectorTarget"), !_.value) throw Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
|
|
1615
1646
|
if (_.value.filters && (h.value = "add", _.value.model.value = []), !t.$?.ui.sortable) {
|
|
1616
1647
|
console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
|
|
@@ -1630,13 +1661,13 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1630
1661
|
}), d.value.sort((e, t) => r.findIndex((t) => t === e.id) - r.findIndex((e) => e === t.id)), p("tagsChanged", d.value);
|
|
1631
1662
|
}
|
|
1632
1663
|
});
|
|
1633
|
-
},
|
|
1664
|
+
}, re = (e) => {
|
|
1634
1665
|
t.$?.ui.sortable && $(e.elPopup).data("ui-sortable") && $(e.elPopup).sortable("destroy");
|
|
1635
1666
|
};
|
|
1636
|
-
return (e, t) => (
|
|
1667
|
+
return (e, t) => (N(), E(S, null, [k(Wt, {
|
|
1637
1668
|
modelValue: u.value,
|
|
1638
1669
|
"onUpdate:modelValue": t[0] ||= (e) => u.value = e,
|
|
1639
|
-
id:
|
|
1670
|
+
id: L(m),
|
|
1640
1671
|
tags: d.value,
|
|
1641
1672
|
styling: a.styling,
|
|
1642
1673
|
mode: "filter",
|
|
@@ -1647,36 +1678,36 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1647
1678
|
"tags",
|
|
1648
1679
|
"styling",
|
|
1649
1680
|
"useTopButton"
|
|
1650
|
-
]),
|
|
1651
|
-
id:
|
|
1652
|
-
class:
|
|
1653
|
-
onOpen: t[4] ||= (e) =>
|
|
1654
|
-
onClose: t[5] ||= (e) =>
|
|
1681
|
+
]), k(y, {
|
|
1682
|
+
id: L(m),
|
|
1683
|
+
class: M(te.value),
|
|
1684
|
+
onOpen: t[4] ||= (e) => A(e),
|
|
1685
|
+
onClose: t[5] ||= (e) => re(e),
|
|
1655
1686
|
"transition-duration": 50
|
|
1656
|
-
},
|
|
1657
|
-
contentList:
|
|
1658
|
-
|
|
1687
|
+
}, ne({
|
|
1688
|
+
contentList: B(() => [
|
|
1689
|
+
L(_).mode === "filter" && !a.singleMode ? (N(), w(Ht, {
|
|
1659
1690
|
key: 0,
|
|
1660
1691
|
id: "all",
|
|
1661
1692
|
colorId: "",
|
|
1662
1693
|
name: e.$i18n.Common.All_tags ?? "",
|
|
1663
|
-
state:
|
|
1664
|
-
onSelect: t[3] ||= (e) =>
|
|
1665
|
-
}, null, 8, ["name", "state"])) :
|
|
1666
|
-
(
|
|
1694
|
+
state: L(_).model.value.length ? "" : "selected",
|
|
1695
|
+
onSelect: t[3] ||= (e) => L(_).model.value = []
|
|
1696
|
+
}, null, 8, ["name", "state"])) : T("", !0),
|
|
1697
|
+
(N(!0), E(S, null, F(d.value, (e) => (N(), w(Ht, {
|
|
1667
1698
|
key: e.id,
|
|
1668
1699
|
id: e.id,
|
|
1669
1700
|
colorId: e.color_id,
|
|
1670
1701
|
name: e.name,
|
|
1671
|
-
state:
|
|
1672
|
-
canExclude:
|
|
1702
|
+
state: b(e.id),
|
|
1703
|
+
canExclude: L(_).mode === "filter" && !a.singleMode,
|
|
1673
1704
|
editable: a.tagsEditable,
|
|
1674
|
-
disabled: ee.value &&
|
|
1675
|
-
onUnselect: (t) =>
|
|
1676
|
-
onSelect: (t) =>
|
|
1677
|
-
onExclude: (t) =>
|
|
1705
|
+
disabled: ee.value && b(e.id) === "",
|
|
1706
|
+
onUnselect: (t) => x(e.id, "unselect"),
|
|
1707
|
+
onSelect: (t) => x(e.id, "select"),
|
|
1708
|
+
onExclude: (t) => x(e.id, "exclude"),
|
|
1678
1709
|
"onUpdate:name": (t) => {
|
|
1679
|
-
e.name = t,
|
|
1710
|
+
e.name = t, L(p)("tagsChanged", d.value);
|
|
1680
1711
|
}
|
|
1681
1712
|
}, null, 8, [
|
|
1682
1713
|
"id",
|
|
@@ -1691,36 +1722,36 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1691
1722
|
"onExclude",
|
|
1692
1723
|
"onUpdate:name"
|
|
1693
1724
|
]))), 128)),
|
|
1694
|
-
a.tagsEditable && d.value.length < a.tagsMax && d.value.length < 20 ? (
|
|
1725
|
+
a.tagsEditable && d.value.length < a.tagsMax && d.value.length < 20 ? (N(), w(v, {
|
|
1695
1726
|
key: 1,
|
|
1696
1727
|
"data-top-icon": "",
|
|
1697
|
-
onClick:
|
|
1728
|
+
onClick: V(D, ["stop"])
|
|
1698
1729
|
}, {
|
|
1699
|
-
default:
|
|
1730
|
+
default: B(() => [O(I(e.$i18n.Common.Add), 1)]),
|
|
1700
1731
|
_: 1
|
|
1701
|
-
})) :
|
|
1732
|
+
})) : T("", !0)
|
|
1702
1733
|
]),
|
|
1703
1734
|
_: 2
|
|
1704
|
-
}, [
|
|
1735
|
+
}, [L(_).mode === "setter" && L(_).filters ? {
|
|
1705
1736
|
name: "header",
|
|
1706
|
-
fn:
|
|
1737
|
+
fn: B(() => [k(i, {
|
|
1707
1738
|
modelValue: h.value,
|
|
1708
1739
|
"onUpdate:modelValue": t[1] ||= (e) => h.value = e,
|
|
1709
1740
|
options: g()
|
|
1710
1741
|
}, null, 8, ["modelValue", "options"])]),
|
|
1711
1742
|
key: "0"
|
|
1712
|
-
} : void 0,
|
|
1743
|
+
} : void 0, L(_).mode === "setter" && L(_).filters ? {
|
|
1713
1744
|
name: "footer",
|
|
1714
|
-
fn:
|
|
1715
|
-
default:
|
|
1745
|
+
fn: B(() => [k(r, { color: "theme" }, {
|
|
1746
|
+
default: B(() => [O(I(e.$i18n.Common.Cancel), 1)]),
|
|
1716
1747
|
_: 1
|
|
1717
|
-
}),
|
|
1718
|
-
tagsIds:
|
|
1719
|
-
filters:
|
|
1748
|
+
}), k(r, { onClick: t[2] ||= (e) => L(p)("setter", {
|
|
1749
|
+
tagsIds: L(_).model.value,
|
|
1750
|
+
filters: L(_).filters,
|
|
1720
1751
|
filtersAction: h.value,
|
|
1721
|
-
payload:
|
|
1752
|
+
payload: L(_).payload
|
|
1722
1753
|
}) }, {
|
|
1723
|
-
default:
|
|
1754
|
+
default: B(() => [O(I(h.value === "add" ? e.$i18n.Common.Add : "") + " " + I(h.value === "replace" ? e.$i18n.Common.Replace : "") + " " + I(h.value === "delete" ? e.$i18n.Common.Delete : ""), 1)]),
|
|
1724
1755
|
_: 1
|
|
1725
1756
|
})]),
|
|
1726
1757
|
key: "1"
|
|
@@ -1728,6 +1759,6 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ k({
|
|
|
1728
1759
|
}
|
|
1729
1760
|
});
|
|
1730
1761
|
//#endregion
|
|
1731
|
-
export {
|
|
1762
|
+
export { ve as TopCompetitorSelector, rt as TopGroupSelector, Nt as TopProjectSelector, Le as TopRegionSelector, Gt as TopTagSelector, Wt as TopTagSelectorPopupOpener, Bt as TopTagSelectorTagIcon, Et as clearCache, Me as dialogRegionSelector, je as findRegion, Ft as genElTopTagSelectorPopupOpener, Oe as genSearcherByKey, It as renderElTopTagSelectorPopupOpener, ye as useItemsFromCompetitors };
|
|
1732
1763
|
|
|
1733
1764
|
//# sourceMappingURL=project.js.map
|