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