@topvisor/ui 1.4.3-fixTabsView.1 → 1.4.3-fixTabsView.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +279 -280
- package/project/project.js.map +1 -1
- package/src/components/project/projectSelector/projectSelector.vue.d.ts +3 -3
- package/src/components/project/projectSelector/types.d.ts +4 -4
- package/src/components/project/projectSelector/utils.d.ts +4 -0
package/project/project.js
CHANGED
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
const fileNames = ['../assets/project.css'].map(fileName => import.meta.resolve(fileName));
|
|
4
4
|
_autoloadCSSCore.insertCSSLinkToPage(fileNames, true);
|
|
5
5
|
|
|
6
|
-
import { defineComponent as K, useModel as P, computed as E, openBlock as h, createElementBlock as
|
|
7
|
-
import { u as w, C as X, e as ee, q as xe, d as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { _ as
|
|
10
|
-
import { u as
|
|
11
|
-
import { getSearcherGIcon as
|
|
6
|
+
import { defineComponent as K, useModel as P, computed as E, openBlock as h, createElementBlock as A, unref as m, createBlock as j, withCtx as B, Fragment as F, renderList as pe, normalizeClass as oe, createElementVNode as N, toDisplayString as b, createVNode as U, createTextVNode as H, mergeModels as G, toValue as be, ref as _, watch as L, createCommentVNode as M, reactive as Fe, resolveComponent as qe, shallowRef as We, onMounted as tt, withModifiers as W, isRef as Pe, mergeProps as He, withKeys as Ee, nextTick as ot, resolveDirective as at, withDirectives as lt, resolveDynamicComponent as nt, renderSlot as rt, createSlots as it } from "vue";
|
|
7
|
+
import { u as w, C as X, e as ee, q as xe, d as dt } from "../.chunks/forms-DtC-EKJL.es.js";
|
|
8
|
+
import { _ as Ae, a as je, b as st } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-DAQIAxvu.es.js";
|
|
9
|
+
import { _ as ut, b as Be, c as Je, I as ze, a as ye } from "../.chunks/policy.vue_vue_type_style_index_0_lang-Bv3LwNDC.es.js";
|
|
10
|
+
import { u as ct } from "../.chunks/utils-BNzP9anP.es.js";
|
|
11
|
+
import { getSearcherGIcon as ft, getLangLabel as gt, getDeviceGIcon as mt } from "../utils/searchers.js";
|
|
12
12
|
import "../.chunks/core-Dgj_YGWh.es.js";
|
|
13
13
|
import "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-CJ97l1ST.es.js";
|
|
14
14
|
import { g as ie, a as le } from "../.chunks/field-CyyFzM-Y.es.js";
|
|
15
|
-
import { validUrl as
|
|
16
|
-
import { ellipsis as
|
|
17
|
-
import { invertKeyboardLayout as
|
|
15
|
+
import { validUrl as vt } from "../utils/check.js";
|
|
16
|
+
import { ellipsis as pt } from "../utils/string.js";
|
|
17
|
+
import { invertKeyboardLayout as ht } from "../utils/keyboard.js";
|
|
18
18
|
import { storage as Z } from "../utils/dom.js";
|
|
19
|
-
import { TopPopupWorker as
|
|
20
|
-
const
|
|
19
|
+
import { TopPopupWorker as yt } from "../popup/worker.js";
|
|
20
|
+
const St = { class: "top-competitorSelector" }, It = { class: "top-ellipsis1" }, Bo = /* @__PURE__ */ K({
|
|
21
21
|
__name: "competitorSelector",
|
|
22
22
|
props: /* @__PURE__ */ G({
|
|
23
23
|
modelValue: {},
|
|
@@ -38,8 +38,8 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
38
38
|
content: ""
|
|
39
39
|
};
|
|
40
40
|
});
|
|
41
|
-
return (n, l) => (h(),
|
|
42
|
-
|
|
41
|
+
return (n, l) => (h(), A("div", St, [
|
|
42
|
+
m(X).state.isMobile ? (h(), j(Ae, { key: 0 }, {
|
|
43
43
|
opener: B(() => [
|
|
44
44
|
U(ee, {
|
|
45
45
|
class: "top-competitorSelector_opener",
|
|
@@ -48,13 +48,13 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
48
48
|
icon2: ""
|
|
49
49
|
}, {
|
|
50
50
|
default: B(() => [
|
|
51
|
-
|
|
51
|
+
H(b(e.items.find((r) => r.value === o.value?.[0])?.content), 1)
|
|
52
52
|
]),
|
|
53
53
|
_: 1
|
|
54
54
|
})
|
|
55
55
|
]),
|
|
56
56
|
contentList: B(() => [
|
|
57
|
-
(h(!0),
|
|
57
|
+
(h(!0), A(F, null, pe(e.items, (r) => (h(), j(je, {
|
|
58
58
|
class: oe({
|
|
59
59
|
"top-active": o.value?.includes(r.value)
|
|
60
60
|
}),
|
|
@@ -63,13 +63,13 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
63
63
|
onClick: () => o.value = [r.value]
|
|
64
64
|
}, {
|
|
65
65
|
default: B(() => [
|
|
66
|
-
N("span",
|
|
66
|
+
N("span", It, b(r.content), 1)
|
|
67
67
|
]),
|
|
68
68
|
_: 2
|
|
69
69
|
}, 1032, ["class", "data-top-icon", "title", "onClick"]))), 256))
|
|
70
70
|
]),
|
|
71
71
|
_: 1
|
|
72
|
-
})) : (h(),
|
|
72
|
+
})) : (h(), j(ut, {
|
|
73
73
|
key: 1,
|
|
74
74
|
modelValue: o.value,
|
|
75
75
|
"onUpdate:modelValue": l[0] || (l[0] = (r) => o.value = r),
|
|
@@ -86,7 +86,7 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
86
86
|
title: n.url + ` [${n.id}]`,
|
|
87
87
|
icon: n.id === be(t) ? "" : "",
|
|
88
88
|
content: n.name
|
|
89
|
-
}))), D = -1, S = -2, de = -1,
|
|
89
|
+
}))), D = -1, S = -2, de = -1, xt = {
|
|
90
90
|
0: "Yandex",
|
|
91
91
|
1: "Google",
|
|
92
92
|
4: "YouTube",
|
|
@@ -100,7 +100,7 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
100
100
|
key: S,
|
|
101
101
|
name: "--",
|
|
102
102
|
index: S
|
|
103
|
-
},
|
|
103
|
+
}, Ye = {
|
|
104
104
|
key: S,
|
|
105
105
|
name: "--",
|
|
106
106
|
regions: [Me],
|
|
@@ -122,10 +122,10 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
122
122
|
index: de,
|
|
123
123
|
lang: "ru",
|
|
124
124
|
name: "Without region"
|
|
125
|
-
},
|
|
125
|
+
}, Ct = () => (se.name = w().Common.Autoselect, se), kt = () => (Ct(), Se.name = w().Common.Autoselect, console.log(Se), Se), Tt = () => (_e.name = w().Keywords.Without_region, _e), Qe = (e = !1, t = !1, o = []) => {
|
|
126
126
|
let a;
|
|
127
|
-
return e ? a =
|
|
128
|
-
},
|
|
127
|
+
return e ? a = At(o) : a = Xe(o), t && a.set(S, kt()), a.size || a.set(S, Ye), a;
|
|
128
|
+
}, Xe = (e, t = !0, o = [], a = !1) => {
|
|
129
129
|
const n = /* @__PURE__ */ new Map();
|
|
130
130
|
return e.forEach((l) => {
|
|
131
131
|
if (!l.enabled || a && typeof l.key == "number" && l.key > 1) return;
|
|
@@ -142,25 +142,25 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
142
142
|
if (n.has(l)) return;
|
|
143
143
|
const r = {
|
|
144
144
|
key: l,
|
|
145
|
-
name:
|
|
145
|
+
name: xt[l],
|
|
146
146
|
regions: [],
|
|
147
147
|
regionByIndex: /* @__PURE__ */ new Map()
|
|
148
148
|
};
|
|
149
149
|
n.set(r.key, r);
|
|
150
150
|
}), n;
|
|
151
|
-
},
|
|
152
|
-
const t =
|
|
151
|
+
}, At = (e) => {
|
|
152
|
+
const t = Xe(e, !1, [0, 1], !0);
|
|
153
153
|
if (t.has(2)) {
|
|
154
154
|
const o = t.get(2);
|
|
155
155
|
o && (o.regionByIndex = /* @__PURE__ */ new Map());
|
|
156
156
|
}
|
|
157
157
|
return t.forEach((o) => {
|
|
158
158
|
if (!o.regionByIndex) return;
|
|
159
|
-
const a = { ...
|
|
159
|
+
const a = { ...Tt() };
|
|
160
160
|
o.regionByIndex.set(a.index, a);
|
|
161
161
|
}), t;
|
|
162
162
|
}, jt = (e, t, o = []) => {
|
|
163
|
-
const a =
|
|
163
|
+
const a = Qe(e, !1, o);
|
|
164
164
|
let n;
|
|
165
165
|
return a.forEach((l) => {
|
|
166
166
|
if (!(t.searcher_key !== void 0 && t.searcher_key != l.key) && l.regions && (l.regions.forEach((r) => {
|
|
@@ -169,7 +169,7 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
169
169
|
}), n))
|
|
170
170
|
return !1;
|
|
171
171
|
}), n;
|
|
172
|
-
},
|
|
172
|
+
}, Bt = ct(() => import("../.chunks/dialog_regionSelectorRegions-qDW2Ejsv.es.js")), wt = (e, t) => {
|
|
173
173
|
const o = w(), a = _(t.value.keys().next().value ?? S), n = E(() => {
|
|
174
174
|
const l = /* @__PURE__ */ new Map();
|
|
175
175
|
if (t.value.forEach((r) => {
|
|
@@ -177,7 +177,7 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
177
177
|
value: r.key,
|
|
178
178
|
title: r.name
|
|
179
179
|
};
|
|
180
|
-
e.addSearcherIcon && (i.icon =
|
|
180
|
+
e.addSearcherIcon && (i.icon = ft(r.key)), l.set(r.key, i);
|
|
181
181
|
}), e.addCompare && !l.has(S)) {
|
|
182
182
|
const r = {
|
|
183
183
|
value: "",
|
|
@@ -197,7 +197,7 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
197
197
|
searcherKey: a,
|
|
198
198
|
optionBySearcherKey: n
|
|
199
199
|
};
|
|
200
|
-
},
|
|
200
|
+
}, $t = (e, t) => {
|
|
201
201
|
const o = w(), a = _(S);
|
|
202
202
|
e.modelValue.length === 1 && (a.value = e.modelValue[0]), a.value === S && (e.forFrequency ? a.value = t.value?.regionByIndex.values().next().value?.key ?? S : a.value = t.value?.regionByIndex.keys().next().value ?? S);
|
|
203
203
|
const n = E(() => {
|
|
@@ -205,20 +205,20 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
205
205
|
return t.value.regionByIndex?.forEach((r) => {
|
|
206
206
|
let i = r.name;
|
|
207
207
|
if (e.forFrequency) {
|
|
208
|
-
const
|
|
208
|
+
const C = {
|
|
209
209
|
value: r.key,
|
|
210
210
|
title: i
|
|
211
211
|
};
|
|
212
|
-
l.has(r.key) || l.set(r.key,
|
|
212
|
+
l.has(r.key) || l.set(r.key, C);
|
|
213
213
|
return;
|
|
214
214
|
}
|
|
215
215
|
r.device && (i += " (" + o.Common["Device_" + r.device] + ")");
|
|
216
|
-
const u =
|
|
216
|
+
const u = gt(t.value.key || 0, r.lang ?? "");
|
|
217
217
|
u && (i += " / " + u);
|
|
218
218
|
const g = {
|
|
219
219
|
value: r.index,
|
|
220
220
|
title: i,
|
|
221
|
-
icon: r.device ?
|
|
221
|
+
icon: r.device ? mt(r.device) : void 0
|
|
222
222
|
};
|
|
223
223
|
l.set(r.index, g);
|
|
224
224
|
}), l;
|
|
@@ -232,24 +232,24 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
232
232
|
return;
|
|
233
233
|
}
|
|
234
234
|
let u = r?.get(a.value)?.title || "", g = -1;
|
|
235
|
-
for (const [
|
|
235
|
+
for (const [C, d] of l.entries()) {
|
|
236
236
|
const f = d.title;
|
|
237
|
-
if (typeof f != "string" || typeof
|
|
237
|
+
if (typeof f != "string" || typeof C == "string")
|
|
238
238
|
break;
|
|
239
239
|
if (f === u) {
|
|
240
|
-
i =
|
|
240
|
+
i = C;
|
|
241
241
|
break;
|
|
242
242
|
}
|
|
243
243
|
const s = new RegExp(` \\((${o.Common.Device_1}|${o.Common.Device_2})\\)`);
|
|
244
|
-
let c = u,
|
|
245
|
-
f.indexOf(c) === -1 && (c = u.replace(/^[^a-zа-я]/i, "").replace(s, ""),
|
|
244
|
+
let c = u, v = 3;
|
|
245
|
+
f.indexOf(c) === -1 && (c = u.replace(/^[^a-zа-я]/i, "").replace(s, ""), v--), f.indexOf(c) === -1 && (c = u.replace(/ \/.*/, ""), v--), f.indexOf(c) === -1 && (c = u.replace(/ \/.*/, ""), c = c.replace(/^[^a-zа-я]/i, "").replace(s, ""), v--), f.indexOf(c) !== -1 && (v <= g || (g = v, i = C));
|
|
246
246
|
}
|
|
247
247
|
a.value = i;
|
|
248
248
|
}), {
|
|
249
249
|
regionIndex: a,
|
|
250
250
|
optionByRegionIndex: n
|
|
251
251
|
};
|
|
252
|
-
},
|
|
252
|
+
}, bt = (e, t, o) => {
|
|
253
253
|
const a = _([]), n = () => {
|
|
254
254
|
if (e.onlySearcher && t.value) {
|
|
255
255
|
a.value = Array.from(t.value.keys());
|
|
@@ -274,15 +274,15 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
274
274
|
}), e.addCompare && n(), {
|
|
275
275
|
regionsIndexes: a
|
|
276
276
|
};
|
|
277
|
-
},
|
|
278
|
-
const t = E(() =>
|
|
277
|
+
}, Pt = (e) => {
|
|
278
|
+
const t = E(() => Qe(e.forFrequency, e.autoRegion, e.searchers)), o = E(() => t.value.get(n.searcherKey.value) || Ye), a = E(() => {
|
|
279
279
|
const d = /* @__PURE__ */ new Set();
|
|
280
280
|
return t.value.forEach((f) => {
|
|
281
281
|
f.regionByIndex.forEach((s) => {
|
|
282
282
|
s.index !== de && s.index !== S && d.add(s.index);
|
|
283
283
|
});
|
|
284
284
|
}), d;
|
|
285
|
-
}), n =
|
|
285
|
+
}), n = wt(e, t), l = $t(e, o), r = bt(e, t, a);
|
|
286
286
|
L(t, () => {
|
|
287
287
|
if (e.onlySearcher ? r.regionsIndexes.value = Array.from(t.value.keys()) : r.regionsIndexes.value = r.regionsIndexes.value.filter((f) => a.value.has(f)), n.searcherKey.value === D) return;
|
|
288
288
|
let d = t.value.keys().next().value;
|
|
@@ -356,15 +356,15 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
356
356
|
compare: i,
|
|
357
357
|
searcherByKey: u,
|
|
358
358
|
allRegionsIndexes: g,
|
|
359
|
-
getSearcher:
|
|
359
|
+
getSearcher: C,
|
|
360
360
|
getRegion: d
|
|
361
|
-
} =
|
|
361
|
+
} = Pt(o), f = () => {
|
|
362
362
|
const s = [];
|
|
363
363
|
u.value.forEach((c) => {
|
|
364
|
-
c.enabled && c.regions.forEach((
|
|
365
|
-
|
|
364
|
+
c.enabled && c.regions.forEach((v) => {
|
|
365
|
+
v.enabled && s.push(v);
|
|
366
366
|
});
|
|
367
|
-
}),
|
|
367
|
+
}), Bt.open("regions", {
|
|
368
368
|
regions: s,
|
|
369
369
|
regionsIndexes: i.regionsIndexes.value,
|
|
370
370
|
"@update:regionsIndexes": (c) => i.regionsIndexes.value = c
|
|
@@ -396,14 +396,14 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
396
396
|
if (o.forFrequency && (c = u.value.values().next().value?.regionByIndex?.values().next().value?.key), c === S && !o.autoRegion && (c = void 0, n.value = S), !s.length)
|
|
397
397
|
c !== void 0 && s.push(c);
|
|
398
398
|
else if (s.length === 1) {
|
|
399
|
-
let
|
|
400
|
-
o.forFrequency && (
|
|
401
|
-
I.regionByIndex.forEach((
|
|
402
|
-
|
|
399
|
+
let v = g.value;
|
|
400
|
+
o.forFrequency && (v = /* @__PURE__ */ new Set(), u.value.forEach((I) => {
|
|
401
|
+
I.regionByIndex.forEach((k) => {
|
|
402
|
+
k.index !== de && k.index !== S && v.add(k.key);
|
|
403
403
|
});
|
|
404
|
-
})),
|
|
404
|
+
})), v.has(s[0]) || (s = [], c !== void 0 && s.push(c));
|
|
405
405
|
} else
|
|
406
|
-
s = s.filter((
|
|
406
|
+
s = s.filter((v) => g.value.has(v)), !s.length && c !== void 0 && s.push(c);
|
|
407
407
|
if (JSON.stringify(a.value) !== JSON.stringify(s)) {
|
|
408
408
|
a.value = s;
|
|
409
409
|
return;
|
|
@@ -424,8 +424,8 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
424
424
|
r.regionIndex.value = a.value[0];
|
|
425
425
|
let s;
|
|
426
426
|
for (const c of u.value.values()) {
|
|
427
|
-
for (const
|
|
428
|
-
if ((o.forFrequency ?
|
|
427
|
+
for (const v of c.regionByIndex.values())
|
|
428
|
+
if ((o.forFrequency ? v.key : v.index) === r.regionIndex.value) {
|
|
429
429
|
s = c.key;
|
|
430
430
|
break;
|
|
431
431
|
}
|
|
@@ -437,39 +437,39 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
437
437
|
l.searcherKey.value = D, i.regionsIndexes.value = [...a.value];
|
|
438
438
|
}
|
|
439
439
|
}, { immediate: !0 }), t({
|
|
440
|
-
getSearcher:
|
|
440
|
+
getSearcher: C,
|
|
441
441
|
getRegion: d
|
|
442
|
-
}), (s, c) => (h(),
|
|
442
|
+
}), (s, c) => (h(), A("div", {
|
|
443
443
|
class: oe({
|
|
444
444
|
"top-selectorRegion": !0,
|
|
445
445
|
"top-selectorRegion-onlySearcher": e.onlySearcher
|
|
446
446
|
})
|
|
447
447
|
}, [
|
|
448
448
|
U(xe, {
|
|
449
|
-
options:
|
|
450
|
-
modelValue:
|
|
451
|
-
"onUpdate:modelValue": c[0] || (c[0] = (
|
|
449
|
+
options: m(l).optionBySearcherKey.value,
|
|
450
|
+
modelValue: m(l).searcherKey.value,
|
|
451
|
+
"onUpdate:modelValue": c[0] || (c[0] = (v) => m(l).searcherKey.value = v),
|
|
452
452
|
name: "searcher_key",
|
|
453
453
|
addChanger: e.addChanger
|
|
454
454
|
}, null, 8, ["options", "modelValue", "addChanger"]),
|
|
455
|
-
!e.onlySearcher &&
|
|
455
|
+
!e.onlySearcher && m(l).searcherKey.value !== m(D) ? (h(), j(xe, {
|
|
456
456
|
key: 0,
|
|
457
457
|
class: "top-select-region",
|
|
458
|
-
options:
|
|
459
|
-
modelValue:
|
|
460
|
-
"onUpdate:modelValue": c[1] || (c[1] = (
|
|
458
|
+
options: m(r).optionByRegionIndex.value,
|
|
459
|
+
modelValue: m(r).regionIndex.value,
|
|
460
|
+
"onUpdate:modelValue": c[1] || (c[1] = (v) => m(r).regionIndex.value = v),
|
|
461
461
|
name: e.forFrequency ? "region_key" : "region_index",
|
|
462
462
|
addChanger: e.addChanger,
|
|
463
463
|
"data-top-icon": e.addRegionIcon ? "" : void 0
|
|
464
464
|
}, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : M("", !0),
|
|
465
|
-
e.addCompare && !e.onlySearcher &&
|
|
465
|
+
e.addCompare && !e.onlySearcher && m(l).searcherKey.value === m(D) ? (h(), j(ee, {
|
|
466
466
|
key: 1,
|
|
467
467
|
name: "compare",
|
|
468
468
|
onClick: f,
|
|
469
|
-
"data-count-compare-regions-indexes":
|
|
469
|
+
"data-count-compare-regions-indexes": m(i).regionsIndexes.value.length
|
|
470
470
|
}, {
|
|
471
471
|
default: B(() => [
|
|
472
|
-
|
|
472
|
+
H(b(s.$i18n.Common.Selected_regions), 1)
|
|
473
473
|
]),
|
|
474
474
|
_: 1
|
|
475
475
|
}, 8, ["data-count-compare-regions-indexes"])) : M("", !0)
|
|
@@ -490,14 +490,14 @@ const yt = { class: "top-competitorSelector" }, St = { class: "top-ellipsis1" },
|
|
|
490
490
|
name: "/",
|
|
491
491
|
path: "/"
|
|
492
492
|
};
|
|
493
|
-
function
|
|
493
|
+
function Et(e) {
|
|
494
494
|
return e ? w()?.Common.All_folders : "/ (" + w()?.Keywords.Root_folder + ")";
|
|
495
495
|
}
|
|
496
496
|
const $e = (e, t, o = /* @__PURE__ */ new Map(), a = { id: "root" }, n = 0) => (a.childsIds = [], a.id && (a.countAllGroupsActive = a.count_groups_active), e[a.id] && e[a.id].forEach((l) => {
|
|
497
|
-
l = { ...l }, a.childsIds.push(l.id), l.id === 0 && (l.name =
|
|
497
|
+
l = { ...l }, a.childsIds.push(l.id), l.id === 0 && (l.name = Et(t));
|
|
498
498
|
const r = n > 1 ? "-".repeat(n - 1) + " " : "";
|
|
499
499
|
r && !l.name.startsWith(r) && (l.name = r + l.name), o.set(l.id, l), $e(e, t, o, l, n + 1), a.childsIds = a.childsIds.concat(l.childsIds), a.id && l.count_groups_active && (a.countAllGroupsActive += l.count_groups_active);
|
|
500
|
-
}), o),
|
|
500
|
+
}), o), Mt = (e, t) => {
|
|
501
501
|
const o = e.gen(`/get/${t}/folders/`, ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 });
|
|
502
502
|
return o.options.onApiLoaded = (a, n, l) => {
|
|
503
503
|
a.result && (a.result = a.result.map((r) => we(r))), l?.(a, n);
|
|
@@ -507,18 +507,18 @@ function Ce(e, t, o) {
|
|
|
507
507
|
const a = Object.keys(e), n = a.map((l) => e[l]);
|
|
508
508
|
return L(n, (l, r, i) => {
|
|
509
509
|
const u = {};
|
|
510
|
-
l.forEach((g,
|
|
511
|
-
if (!Object.is(g, r[
|
|
512
|
-
const d = a[
|
|
510
|
+
l.forEach((g, C) => {
|
|
511
|
+
if (!Object.is(g, r[C])) {
|
|
512
|
+
const d = a[C];
|
|
513
513
|
u[d] = {
|
|
514
|
-
old: r[
|
|
514
|
+
old: r[C],
|
|
515
515
|
new: g
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
518
|
}), Object.keys(u).length && t(u, i);
|
|
519
519
|
}, o);
|
|
520
520
|
}
|
|
521
|
-
const
|
|
521
|
+
const _t = /* @__PURE__ */ K({
|
|
522
522
|
__name: "folders",
|
|
523
523
|
props: /* @__PURE__ */ G({
|
|
524
524
|
folderId: {},
|
|
@@ -538,10 +538,10 @@ const Mt = /* @__PURE__ */ K({
|
|
|
538
538
|
}),
|
|
539
539
|
emits: ["update:folderId", "update:folder"],
|
|
540
540
|
setup(e) {
|
|
541
|
-
const t = e, o = P(e, "folderId"), a = P(e, "folder"), n = t.client && !t.folders && t.service ?
|
|
541
|
+
const t = e, o = P(e, "folderId"), a = P(e, "folder"), n = t.client && !t.folders && t.service ? Mt(t.client, t.service) : void 0, l = _(null), r = E(() => {
|
|
542
542
|
const i = $e(t.folders ?? { root: [q] }, t.canSelectAll), u = /* @__PURE__ */ new Map();
|
|
543
|
-
return i.forEach((g,
|
|
544
|
-
u.set(
|
|
543
|
+
return i.forEach((g, C) => {
|
|
544
|
+
u.set(C, we(g));
|
|
545
545
|
}), u;
|
|
546
546
|
});
|
|
547
547
|
return L(() => t.projectId, () => {
|
|
@@ -562,15 +562,15 @@ const Mt = /* @__PURE__ */ K({
|
|
|
562
562
|
}
|
|
563
563
|
let u = r.value.get(t.folderId);
|
|
564
564
|
u || (u = q), a.value = u, o.value = u.id;
|
|
565
|
-
}, { immediate: !0 }), (i, u) => (h(),
|
|
565
|
+
}, { immediate: !0 }), (i, u) => (h(), j(Be, {
|
|
566
566
|
class: "top-groupSelector_folder",
|
|
567
567
|
modelValue: a.value,
|
|
568
568
|
"onUpdate:modelValue": u[0] || (u[0] = (g) => a.value = g),
|
|
569
569
|
items: e.folders ? [...r.value.values()] : void 0,
|
|
570
570
|
"search-type": "inline",
|
|
571
571
|
icon: e.addIcon ? "" : void 0,
|
|
572
|
-
api: e.folders ? void 0 :
|
|
573
|
-
apiSetSearchParams: (...g) =>
|
|
572
|
+
api: e.folders ? void 0 : m(n),
|
|
573
|
+
apiSetSearchParams: (...g) => m(Je)(...g, "name"),
|
|
574
574
|
addChanger: e.addChanger,
|
|
575
575
|
useCache: ""
|
|
576
576
|
}, null, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "addChanger"]));
|
|
@@ -581,22 +581,22 @@ const Mt = /* @__PURE__ */ K({
|
|
|
581
581
|
folder_id: q.id,
|
|
582
582
|
folder_path: q.path
|
|
583
583
|
}, ge = {
|
|
584
|
-
id:
|
|
584
|
+
id: ze,
|
|
585
585
|
name: "All groups",
|
|
586
586
|
folder_id: q.id,
|
|
587
587
|
folder_path: q.path
|
|
588
|
-
}, re = () => (ge.name = w()?.Common.All_groups, ge),
|
|
588
|
+
}, re = () => (ge.name = w()?.Common.All_groups, ge), Ze = () => (ge.name = w()?.Keywords.Choose_group, ge), Vt = (e, t, o) => (e = [...e], t !== void 0 && (e = e.filter((a) => a.on == Number(t))), o && o.id && o.childsIds && (e = e.filter((a) => a.folder_id === o.id || o.childsIds.includes(a.folder_id))), e), Ve = (e, t) => {
|
|
589
589
|
const o = e.gen(`/get/${t}/groups/`, ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 });
|
|
590
590
|
return o.options.onApiLoaded = (a, n, l) => {
|
|
591
591
|
a.result && (a.result = a.result.map((r) => ce(r))), l?.(a, n);
|
|
592
592
|
}, o;
|
|
593
|
-
},
|
|
593
|
+
}, Gt = (e, t) => e.gen(`/add/${t}/groups/`), Lt = { class: "top-groupSelector_groupItem" }, Rt = {
|
|
594
594
|
key: 0,
|
|
595
595
|
class: "top-comment"
|
|
596
|
-
},
|
|
596
|
+
}, Kt = {
|
|
597
597
|
key: 1,
|
|
598
598
|
class: "top-groupSelector_groupItemFolderPath"
|
|
599
|
-
},
|
|
599
|
+
}, Ot = /* @__PURE__ */ K({
|
|
600
600
|
__name: "groups",
|
|
601
601
|
props: /* @__PURE__ */ G({
|
|
602
602
|
groupId: {},
|
|
@@ -621,21 +621,21 @@ const Mt = /* @__PURE__ */ K({
|
|
|
621
621
|
}),
|
|
622
622
|
emits: /* @__PURE__ */ G(["addGroup"], ["update:groupId", "update:group"]),
|
|
623
623
|
setup(e, { emit: t }) {
|
|
624
|
-
const o = e, a = t, n = P(e, "groupId"), l = P(e, "group"), r = o.client && !o.groups && o.service ? Ve(o.client, o.service) : void 0, i = o.client && o.service ?
|
|
624
|
+
const o = e, a = t, n = P(e, "groupId"), l = P(e, "group"), r = o.client && !o.groups && o.service ? Ve(o.client, o.service) : void 0, i = o.client && o.service ? Gt(o.client, o.service) : void 0, u = _(null), g = _(void 0), C = ie("folder_id", "EQUALS", [o.folder?.id ?? 0]);
|
|
625
625
|
r?.changeParams({
|
|
626
626
|
project_id: o.projectId,
|
|
627
627
|
folder_id_depth: !0,
|
|
628
628
|
filters: [
|
|
629
|
-
|
|
629
|
+
C
|
|
630
630
|
]
|
|
631
631
|
}), o.on !== void 0 && r?.params.filters?.push(ie("on", "EQUALS", [Number(o.on)]));
|
|
632
632
|
const d = E(() => {
|
|
633
633
|
const c = g.value ?? o.groups;
|
|
634
634
|
if (c)
|
|
635
|
-
return c.map((
|
|
635
|
+
return c.map((v) => ce(v));
|
|
636
636
|
}), f = (c) => {
|
|
637
|
-
const
|
|
638
|
-
l.value =
|
|
637
|
+
const v = ce(c);
|
|
638
|
+
l.value = v, n.value = v.id;
|
|
639
639
|
};
|
|
640
640
|
Ce({
|
|
641
641
|
projectId: () => o.projectId,
|
|
@@ -646,11 +646,11 @@ const Mt = /* @__PURE__ */ K({
|
|
|
646
646
|
project_id: o.projectId
|
|
647
647
|
}), r?.setOptions({
|
|
648
648
|
checkFingerprint: "TopGroupSelectorGroups:" + o.projectId
|
|
649
|
-
})), c.folderId && (
|
|
649
|
+
})), c.folderId && (C.values = [
|
|
650
650
|
o.folder?.id ?? 0
|
|
651
|
-
], o.groups && (g.value =
|
|
652
|
-
let
|
|
653
|
-
o.autoselect === "first" && (
|
|
651
|
+
], o.groups && (g.value = Vt(o.groups, o.on, o.folder))), u.value?.resetCache(), (c.folderId?.old !== void 0 || c.canSelectAll?.old !== void 0) && n.value !== ye) {
|
|
652
|
+
let v;
|
|
653
|
+
o.autoselect === "first" && (v = g.value?.[0], o.canSelectAll && (v = Fe(re()))), (o.autoselect === "placeholder" || !v) && (v = Ze()), f(v);
|
|
654
654
|
}
|
|
655
655
|
}, { immediate: !0 }), Ce({
|
|
656
656
|
modelGroup: l,
|
|
@@ -663,26 +663,26 @@ const Mt = /* @__PURE__ */ K({
|
|
|
663
663
|
}
|
|
664
664
|
if (!(o.canAdd && n.value === ye)) {
|
|
665
665
|
if (o.groups) {
|
|
666
|
-
let
|
|
667
|
-
if (!
|
|
668
|
-
f(
|
|
666
|
+
let v = g.value?.find((I) => I.id === n.value);
|
|
667
|
+
if (!v && o.canSelectAll && (v = re()), v)
|
|
668
|
+
f(v);
|
|
669
669
|
else {
|
|
670
670
|
const I = g.value?.[0];
|
|
671
671
|
I && !n.value ? f(I) : f(fe);
|
|
672
672
|
}
|
|
673
673
|
}
|
|
674
|
-
if (o.client && !o.groups && o.service && (n.value || n.value ===
|
|
675
|
-
const
|
|
674
|
+
if (o.client && !o.groups && o.service && (n.value || n.value === ze && !o.canSelectAll)) {
|
|
675
|
+
const v = Ve(o.client, o.service).changeParams({
|
|
676
676
|
project_id: o.projectId,
|
|
677
677
|
id: n.value,
|
|
678
678
|
filters: [
|
|
679
|
-
|
|
679
|
+
C
|
|
680
680
|
]
|
|
681
681
|
});
|
|
682
|
-
|
|
682
|
+
v?.setOptions({
|
|
683
683
|
checkFingerprint: "TopGroupSelectorFindGroup:" + o.projectId
|
|
684
684
|
});
|
|
685
|
-
const I = await
|
|
685
|
+
const I = await v.call();
|
|
686
686
|
if (!I.errors?.length && !I.result) return;
|
|
687
687
|
!I.errors && I.result[0] ? f(I.result[0]) : f(fe);
|
|
688
688
|
}
|
|
@@ -691,42 +691,42 @@ const Mt = /* @__PURE__ */ K({
|
|
|
691
691
|
}, { immediate: !0 });
|
|
692
692
|
const s = async (c) => {
|
|
693
693
|
if (o.canAdd !== "api" || !i) return;
|
|
694
|
-
const
|
|
694
|
+
const v = l.value, I = await i.changeParams({
|
|
695
695
|
project_id: o.projectId,
|
|
696
696
|
names: [c.name],
|
|
697
697
|
to_id: o.folder?.id ?? q.id,
|
|
698
698
|
to_type: "in_folder_last"
|
|
699
699
|
}).call();
|
|
700
|
-
I.result ? (f(I.result), a("addGroup", I.result)) : f(
|
|
700
|
+
I.result ? (f(I.result), a("addGroup", I.result)) : f(v), u.value?.resetCache(!0);
|
|
701
701
|
};
|
|
702
|
-
return (c,
|
|
702
|
+
return (c, v) => (h(), j(Be, {
|
|
703
703
|
ref_key: "refSelector",
|
|
704
704
|
ref: u,
|
|
705
705
|
class: "top-groupSelector_group",
|
|
706
706
|
modelValue: l.value,
|
|
707
|
-
"onUpdate:modelValue":
|
|
707
|
+
"onUpdate:modelValue": v[0] || (v[0] = (I) => l.value = I),
|
|
708
708
|
items: d.value,
|
|
709
709
|
searchType: "inline",
|
|
710
710
|
icon: e.addIcon ? "" : void 0,
|
|
711
|
-
api: e.groups ? void 0 :
|
|
712
|
-
apiSetSearchParams: (...I) =>
|
|
711
|
+
api: e.groups ? void 0 : m(r),
|
|
712
|
+
apiSetSearchParams: (...I) => m(Je)(...I, "name"),
|
|
713
713
|
appendSearchToResult: !!e.canAdd,
|
|
714
|
-
useAllItem: e.canSelectAll ?
|
|
714
|
+
useAllItem: e.canSelectAll ? m(re)().name : !1,
|
|
715
715
|
addChanger: e.addChanger,
|
|
716
716
|
useCache: "",
|
|
717
717
|
onAppendItem: s
|
|
718
718
|
}, {
|
|
719
719
|
item: B(({ item: I }) => [
|
|
720
|
-
N("div",
|
|
721
|
-
I.id ===
|
|
720
|
+
N("div", Lt, [
|
|
721
|
+
I.id === m(ye) ? (h(), A("div", Rt, b(c.$i18n.Common.Add) + ": ", 1)) : M("", !0),
|
|
722
722
|
N("span", null, b(I.name), 1),
|
|
723
|
-
I.folder_path && e.showPath ? (h(),
|
|
723
|
+
I.folder_path && e.showPath ? (h(), A("span", Kt, b(I.folder_path), 1)) : M("", !0)
|
|
724
724
|
])
|
|
725
725
|
]),
|
|
726
726
|
_: 1
|
|
727
727
|
}, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "appendSearchToResult", "useAllItem", "addChanger"]));
|
|
728
728
|
}
|
|
729
|
-
}),
|
|
729
|
+
}), Ut = { class: "top-groupSelector" }, bo = /* @__PURE__ */ K({
|
|
730
730
|
__name: "groupSelector",
|
|
731
731
|
props: /* @__PURE__ */ G({
|
|
732
732
|
folderId: {},
|
|
@@ -761,13 +761,13 @@ const Mt = /* @__PURE__ */ K({
|
|
|
761
761
|
const o = e, a = P(e, "folderId"), n = P(e, "folder"), l = P(e, "groupId"), r = P(e, "group"), i = t, u = $e(o.folders ?? { root: [q] }, o.canSelectAllGroups);
|
|
762
762
|
n.value = u.get(a.value), n.value && (n.value = we(n.value));
|
|
763
763
|
let g = o.groups?.find((d) => d.id === l.value);
|
|
764
|
-
l.value || (g = o.groups?.[0]), o.canSelectAllGroups && !g && (g = re()), (o.autoselect === "placeholder" || !g) && (g =
|
|
765
|
-
const
|
|
764
|
+
l.value || (g = o.groups?.[0]), o.canSelectAllGroups && !g && (g = re()), (o.autoselect === "placeholder" || !g) && (g = Ze()), g ??= fe, r.value = g, r.value = ce(r.value);
|
|
765
|
+
const C = (d) => {
|
|
766
766
|
let f;
|
|
767
767
|
o.groups && d && (f = [...o.groups, d]), i("update:groups", f);
|
|
768
768
|
};
|
|
769
|
-
return (d, f) => (h(),
|
|
770
|
-
e.showFolders ? (h(),
|
|
769
|
+
return (d, f) => (h(), A("div", Ut, [
|
|
770
|
+
e.showFolders ? (h(), j(_t, {
|
|
771
771
|
key: 0,
|
|
772
772
|
folderId: a.value,
|
|
773
773
|
"onUpdate:folderId": f[0] || (f[0] = (s) => a.value = s),
|
|
@@ -781,7 +781,7 @@ const Mt = /* @__PURE__ */ K({
|
|
|
781
781
|
client: e.client,
|
|
782
782
|
service: e.service
|
|
783
783
|
}, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client", "service"])) : M("", !0),
|
|
784
|
-
e.showGroups ? (h(),
|
|
784
|
+
e.showGroups ? (h(), j(Ot, {
|
|
785
785
|
key: 1,
|
|
786
786
|
groupId: l.value,
|
|
787
787
|
"onUpdate:groupId": f[2] || (f[2] = (s) => l.value = s),
|
|
@@ -799,11 +799,11 @@ const Mt = /* @__PURE__ */ K({
|
|
|
799
799
|
addIcon: e.addIcon,
|
|
800
800
|
client: e.client,
|
|
801
801
|
service: e.service,
|
|
802
|
-
onAddGroup:
|
|
802
|
+
onAddGroup: C
|
|
803
803
|
}, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "showPath", "addIcon", "client", "service"])) : M("", !0)
|
|
804
804
|
]));
|
|
805
805
|
}
|
|
806
|
-
}),
|
|
806
|
+
}), Nt = { class: "top-projectSelectorSubmenu_item" }, Dt = ["href", "title", "data-top-icon", "data-right"], Ft = { class: "top-projectSelectorSubmenu_item" }, qt = ["href"], Wt = /* @__PURE__ */ K({
|
|
807
807
|
__name: "submenu",
|
|
808
808
|
props: {
|
|
809
809
|
id: {},
|
|
@@ -880,8 +880,8 @@ const Mt = /* @__PURE__ */ K({
|
|
|
880
880
|
}
|
|
881
881
|
], n = E(() => t.right.includes("0") ? a.filter((l) => t.right[l.right] === "1") : a);
|
|
882
882
|
return (l, r) => {
|
|
883
|
-
const i =
|
|
884
|
-
return h(),
|
|
883
|
+
const i = qe("TopButton");
|
|
884
|
+
return h(), j(m(Ae), {
|
|
885
885
|
class: "top-projectSelectorSubmenu",
|
|
886
886
|
notch: !1,
|
|
887
887
|
pos: "2"
|
|
@@ -894,20 +894,20 @@ const Mt = /* @__PURE__ */ K({
|
|
|
894
894
|
})
|
|
895
895
|
]),
|
|
896
896
|
contentList: B(() => [
|
|
897
|
-
(h(!0),
|
|
897
|
+
(h(!0), A(F, null, pe(n.value, (u) => (h(), A("li", Nt, [
|
|
898
898
|
N("a", {
|
|
899
899
|
href: u.href,
|
|
900
900
|
title: u.title,
|
|
901
901
|
"data-top-icon": u.icon,
|
|
902
902
|
"data-right": u.right
|
|
903
|
-
}, null, 8,
|
|
903
|
+
}, null, 8, Dt)
|
|
904
904
|
]))), 256)),
|
|
905
|
-
N("li",
|
|
905
|
+
N("li", Ft, [
|
|
906
906
|
N("a", {
|
|
907
907
|
href: e.url,
|
|
908
908
|
"data-top-icon": "",
|
|
909
909
|
target: "_blank"
|
|
910
|
-
}, null, 8,
|
|
910
|
+
}, null, 8, qt)
|
|
911
911
|
])
|
|
912
912
|
]),
|
|
913
913
|
_: 1
|
|
@@ -924,7 +924,7 @@ const Mt = /* @__PURE__ */ K({
|
|
|
924
924
|
scheduledUpdate: !1,
|
|
925
925
|
manualUpdate: !1,
|
|
926
926
|
guestProjects: !1
|
|
927
|
-
},
|
|
927
|
+
}, Ht = (e, t) => {
|
|
928
928
|
const o = [], a = {
|
|
929
929
|
scheduledUpdate: Ie(w().Projects.Scheduled_update),
|
|
930
930
|
manualUpdate: Ie(w().Projects.Manual_update),
|
|
@@ -937,36 +937,34 @@ const Mt = /* @__PURE__ */ K({
|
|
|
937
937
|
for (const l of e)
|
|
938
938
|
!n.scheduledUpdate && l.right?.startsWith("1") && l.on > 0 && (o.push(a.scheduledUpdate), n.scheduledUpdate = !0), !n.manualUpdate && l.right?.startsWith("1") && l.on === 0 && (o.push(a.manualUpdate), n.manualUpdate = !0), !n.guestProjects && l.right?.startsWith("0") && l.on >= 0 && (o.push(a.guestProjects), n.guestProjects = !0), o.push(l);
|
|
939
939
|
return o;
|
|
940
|
-
},
|
|
940
|
+
}, Jt = (e) => e.map((t) => ({
|
|
941
941
|
...t,
|
|
942
942
|
listItemProps: {
|
|
943
943
|
attrs: { title: t.name }
|
|
944
944
|
}
|
|
945
|
-
})),
|
|
945
|
+
})), zt = (e, t, o) => {
|
|
946
946
|
if (!e || e.length === 0) return [];
|
|
947
947
|
t && Object.keys(ke).forEach((n) => ke[n] = !1);
|
|
948
|
-
const a =
|
|
949
|
-
return
|
|
950
|
-
}, zt = (e) => {
|
|
951
|
-
if (!e) return "";
|
|
952
|
-
let t = e;
|
|
953
|
-
return t = t.replace(/historyView=[^&]*/, ""), t = t.replace(/competitorsIds=[^&]*/, ""), t = t.replace(/searchersKeys=[^&]*/, ""), t = t.replace(/regionIndex=[^&]*/, ""), t = t.replace(/regionsIndexes=[^&]*/, ""), t = t.replace(/folderId=[^&]*/, ""), t = t.replace(/groupId=[^&]*/, ""), t = t.replace(/tags=[^&]*/, ""), window.mo?.getHash && !window.mo.getHash("dataSort").toString().includes("0000-00-00") && (t = t.replace(/dataSort=[^&]*/, "")), t = t.replace(/%22historyView%22:[^,]*,/, ""), t = t.replace(/%22competitorsIds%22:\[[^\]]*],/, ""), t = t.replace(/%22searchersKeys%22:\[[^\]]*],/, ""), t = t.replace(/%22regionIndex%22:[^,]*,/, ""), t = t.replace(/%22regionsIndexes%22:\[[^\]]*],/, ""), t = t.replace(/%22folderId%22:[^,]*,/, ""), t = t.replace(/%22groupId%22:[^,]*,/, ""), t = t.replace(/%22tagsIds%22:\[[^\]]*],/, ""), /%22dataSort%22:\{[^}]*0000-00-00[^}]*}/.test(t) || (t = t.replace(/%22dataSort%22:\{[^}]*},/, "")), t;
|
|
948
|
+
const a = Jt(e);
|
|
949
|
+
return Ht(a, o);
|
|
954
950
|
}, Yt = (e) => {
|
|
951
|
+
if (!e) return;
|
|
952
|
+
e = e.replace(/#.*/, "");
|
|
953
|
+
let t = location.hash;
|
|
954
|
+
t = t.replace(/historyView=[^&]*/, ""), t = t.replace(/competitorsIds=[^&]*/, ""), t = t.replace(/searchersKeys=[^&]*/, ""), t = t.replace(/regionIndex=[^&]*/, ""), t = t.replace(/regionsIndexes=[^&]*/, ""), t = t.replace(/folderId=[^&]*/, ""), t = t.replace(/groupId=[^&]*/, ""), t = t.replace(/tags=[^&]*/, ""), window.mo?.getHash && !window.mo.getHash("dataSort").toString().includes("0000-00-00") && (t = t.replace(/dataSort=[^&]*/, "")), t = t.replace(/%22historyView%22:[^,]*,/, ""), t = t.replace(/%22competitorsIds%22:\[[^\]]*],/, ""), t = t.replace(/%22searchersKeys%22:\[[^\]]*],/, ""), t = t.replace(/%22regionIndex%22:[^,]*,/, ""), t = t.replace(/%22regionsIndexes%22:\[[^\]]*],/, ""), t = t.replace(/%22folderId%22:[^,]*,/, ""), t = t.replace(/%22groupId%22:[^,]*,/, ""), t = t.replace(/%22tagsIds%22:\[[^\]]*],/, ""), /%22dataSort%22:\{[^}]*0000-00-00[^}]*}/.test(t) || (t = t.replace(/%22dataSort%22:\{[^}]*},/, "")), e += t, location.href = e;
|
|
955
|
+
}, Ge = (e) => {
|
|
955
956
|
const t = location.pathname.split("/");
|
|
956
957
|
let o = "project/dynamics/", a = "";
|
|
957
|
-
t[1] == "project" && (o = t[1] + "/" + t[2] + "/"), ["watcher", "indexing", "sitemap", "audit", "direct", "adwords"].includes(t[4]) && (a = t[4] + "/");
|
|
958
|
-
|
|
959
|
-
const l = zt(location.hash);
|
|
960
|
-
return n += l, n;
|
|
961
|
-
}, Ge = (e) => {
|
|
958
|
+
return t[1] == "project" && (o = t[1] + "/" + t[2] + "/"), t[2] == "settings" && (a = location.hash), ["watcher", "indexing", "sitemap", "audit", "direct", "adwords"].includes(t[4]) && (a = t[4] + "/"), "/" + o + e + "/" + a;
|
|
959
|
+
}, Le = (e) => {
|
|
962
960
|
let t = e.startsWith("http") ? e : "http://" + e;
|
|
963
961
|
return t = t.replace(/"/g, "%22"), t;
|
|
964
962
|
}, Qt = (e, t) => {
|
|
965
963
|
let o = e.params.filters ?? [];
|
|
966
964
|
o = o.filter((r) => r.name !== "GEN_SEARCH_STRING()");
|
|
967
|
-
const a =
|
|
965
|
+
const a = ht(t), n = t.replace(/([[^$.|?*+()])/g, "\\$1"), l = a.replace(/([[^$.|?*+()])/g, "\\$1");
|
|
968
966
|
t && o.push(ie("GEN_SEARCH_STRING()", "REGEXP", [`(${n}|${l})`])), e.changeParams({ filters: o });
|
|
969
|
-
},
|
|
967
|
+
}, Re = (e, t, o) => {
|
|
970
968
|
const a = e.gen("/get/projects_2/projects/", ["id", "user_id", "name", "url", "on", "right"]);
|
|
971
969
|
return a.params = {
|
|
972
970
|
...o,
|
|
@@ -981,9 +979,9 @@ const Mt = /* @__PURE__ */ K({
|
|
|
981
979
|
]
|
|
982
980
|
}, a.options.onApiLoaded = (n, l, r) => {
|
|
983
981
|
const i = l.data.filters.length === 1 && l.data.offset === 0 || l.data.limit === 1e3, u = l.data.limit === 100 && l.data.filters.length > 1 ? !0 : void 0;
|
|
984
|
-
n.result =
|
|
982
|
+
n.result = zt(n.result, i, u), r?.(n, l);
|
|
985
983
|
}, a;
|
|
986
|
-
}, Xt = (e) => e.gen("/add/projects_2/projects/"), me = "ui_project_selector_total:", Zt = 1440 * 60 * 1e3, V =
|
|
984
|
+
}, Xt = (e) => e.gen("/add/projects_2/projects/"), me = "ui_project_selector_total:", Zt = 1440 * 60 * 1e3, V = We(), et = _(0), Q = _(null), Ke = (e, t) => {
|
|
987
985
|
localStorage.setItem(
|
|
988
986
|
me + e,
|
|
989
987
|
JSON.stringify({ projectsTotal: t, expiresAt: Date.now() + Zt })
|
|
@@ -998,15 +996,15 @@ const Mt = /* @__PURE__ */ K({
|
|
|
998
996
|
}
|
|
999
997
|
return o;
|
|
1000
998
|
}, to = (e, t = !0) => {
|
|
1001
|
-
V.value = void 0, localStorage.removeItem(me + e), t &&
|
|
999
|
+
V.value = void 0, localStorage.removeItem(me + e), t && et.value++;
|
|
1002
1000
|
}, oo = { class: "top-projectSelector_item" }, ao = { class: "top-projectSelector_itemText" }, lo = { class: "top-comment" }, no = {
|
|
1003
1001
|
key: 0,
|
|
1004
1002
|
class: "top-comment"
|
|
1005
|
-
}, ro = ["href"],
|
|
1003
|
+
}, ro = ["href", "onClick"], Oe = 1e3, Po = /* @__PURE__ */ K({
|
|
1006
1004
|
__name: "projectSelector",
|
|
1007
1005
|
props: /* @__PURE__ */ G({
|
|
1006
|
+
modelValue: {},
|
|
1008
1007
|
client: {},
|
|
1009
|
-
project: {},
|
|
1010
1008
|
addLinksToProjects: { type: Boolean, default: !0 },
|
|
1011
1009
|
excludeProjectId: {},
|
|
1012
1010
|
modificator: {},
|
|
@@ -1014,98 +1012,98 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1014
1012
|
buttonProps: {},
|
|
1015
1013
|
openerShortcut: {}
|
|
1016
1014
|
}, {
|
|
1017
|
-
|
|
1018
|
-
|
|
1015
|
+
modelValue: { default: { id: null, name: "" } },
|
|
1016
|
+
modelModifiers: {}
|
|
1019
1017
|
}),
|
|
1020
|
-
emits: ["update:
|
|
1018
|
+
emits: ["update:modelValue"],
|
|
1021
1019
|
setup(e) {
|
|
1022
1020
|
const t = w();
|
|
1023
1021
|
if (!window.mo?.user?.id)
|
|
1024
1022
|
throw new Error("TopProjectSelector: не удалось определить userId. Компонент требует авторизованного пользователя (см. window.mo.user.id)");
|
|
1025
|
-
const o = window.mo.user.id, a = e, n = P(e, "
|
|
1023
|
+
const o = window.mo.user.id, a = e, n = P(e, "modelValue"), l = Re(
|
|
1026
1024
|
a.client,
|
|
1027
1025
|
o
|
|
1028
|
-
), r = Xt(a.client), i = _(eo(o)), u = _(null), g = E(() => a.placeholder ?? t.Projects.Select_project),
|
|
1026
|
+
), r = Xt(a.client), i = _(eo(o)), u = _(null), g = E(() => a.placeholder ?? t.Projects.Select_project), C = E(() => !V.value || !a.excludeProjectId ? V.value : V.value.filter((k) => k.id !== a.excludeProjectId)), d = E(() => {
|
|
1029
1027
|
if (!(!i.value && i.value !== 0))
|
|
1030
|
-
return i.value <
|
|
1028
|
+
return i.value < Oe ? "static" : "api";
|
|
1031
1029
|
});
|
|
1032
|
-
L(
|
|
1033
|
-
|
|
1030
|
+
L(et, () => {
|
|
1031
|
+
v();
|
|
1034
1032
|
});
|
|
1035
1033
|
const f = async () => {
|
|
1036
1034
|
if (!Q.value) {
|
|
1037
|
-
const R =
|
|
1035
|
+
const R = Re(
|
|
1038
1036
|
a.client,
|
|
1039
1037
|
o,
|
|
1040
|
-
{ limit:
|
|
1038
|
+
{ limit: Oe }
|
|
1041
1039
|
);
|
|
1042
1040
|
Q.value = R.call();
|
|
1043
1041
|
}
|
|
1044
|
-
const
|
|
1045
|
-
if (
|
|
1042
|
+
const k = await Q.value;
|
|
1043
|
+
if (k.errors) {
|
|
1046
1044
|
Q.value = null;
|
|
1047
1045
|
return;
|
|
1048
1046
|
}
|
|
1049
|
-
return Q.value = null,
|
|
1047
|
+
return Q.value = null, k;
|
|
1050
1048
|
}, s = async () => {
|
|
1051
1049
|
if (i.value) return;
|
|
1052
|
-
const
|
|
1053
|
-
|
|
1054
|
-
}, c = async (
|
|
1050
|
+
const k = await f();
|
|
1051
|
+
k && (i.value = k.total, d.value === "static" && !V.value && (V.value = k.result), i.value && Ke(o, i.value));
|
|
1052
|
+
}, c = async (k) => {
|
|
1055
1053
|
const R = await r.changeParams({
|
|
1056
|
-
url:
|
|
1057
|
-
name:
|
|
1054
|
+
url: k.name,
|
|
1055
|
+
name: k.name
|
|
1058
1056
|
}).call();
|
|
1059
1057
|
if (!R.errors) {
|
|
1060
1058
|
if (V.value && d.value === "static") {
|
|
1061
1059
|
const y = {
|
|
1062
1060
|
id: Number(R.result),
|
|
1063
1061
|
user_id: o,
|
|
1064
|
-
name:
|
|
1065
|
-
url:
|
|
1062
|
+
name: k.name,
|
|
1063
|
+
url: k.name,
|
|
1066
1064
|
on: 0,
|
|
1067
1065
|
right: "11111111111111111111",
|
|
1068
1066
|
listItemProps: {
|
|
1069
|
-
attrs: { title:
|
|
1067
|
+
attrs: { title: k.name }
|
|
1070
1068
|
}
|
|
1071
|
-
}, p = V.value.findIndex((
|
|
1069
|
+
}, p = V.value.findIndex((x) => x.on === 0);
|
|
1072
1070
|
V.value = [
|
|
1073
1071
|
...V.value.slice(0, p),
|
|
1074
1072
|
y,
|
|
1075
1073
|
...V.value.slice(p)
|
|
1076
|
-
], i.value && (i.value += 1,
|
|
1074
|
+
], i.value && (i.value += 1, Ke(o, i.value));
|
|
1077
1075
|
}
|
|
1078
1076
|
d.value === "api" && to(o);
|
|
1079
1077
|
}
|
|
1080
|
-
},
|
|
1078
|
+
}, v = () => {
|
|
1081
1079
|
d.value === "api" && u.value?.resetCache(!0);
|
|
1082
1080
|
}, I = async () => {
|
|
1083
1081
|
if (V.value || d.value !== "static") return;
|
|
1084
|
-
const
|
|
1085
|
-
|
|
1082
|
+
const k = await f();
|
|
1083
|
+
k && (V.value = k.result);
|
|
1086
1084
|
};
|
|
1087
|
-
return
|
|
1085
|
+
return tt(async () => {
|
|
1088
1086
|
await s();
|
|
1089
|
-
}), (
|
|
1090
|
-
const y =
|
|
1091
|
-
return h(),
|
|
1087
|
+
}), (k, R) => {
|
|
1088
|
+
const y = qe("TopButton");
|
|
1089
|
+
return h(), j(Be, {
|
|
1092
1090
|
ref_key: "refSelector",
|
|
1093
1091
|
ref: u,
|
|
1094
1092
|
class: "top-projectSelector",
|
|
1095
1093
|
modelValue: n.value,
|
|
1096
1094
|
"onUpdate:modelValue": R[1] || (R[1] = (p) => n.value = p),
|
|
1097
|
-
items:
|
|
1098
|
-
title:
|
|
1095
|
+
items: C.value,
|
|
1096
|
+
title: k.$i18n.Projects.Search_projects,
|
|
1099
1097
|
modificator: e.modificator,
|
|
1100
1098
|
searchFields: ["id", "name", "url"],
|
|
1101
1099
|
placeholder: g.value,
|
|
1102
1100
|
hasCloserBtn: "",
|
|
1103
|
-
api: d.value === "api" ?
|
|
1104
|
-
apiSetSearchParams: d.value === "api" ? (...p) =>
|
|
1101
|
+
api: d.value === "api" ? m(l) : void 0,
|
|
1102
|
+
apiSetSearchParams: d.value === "api" ? (...p) => m(Qt)(...p) : void 0,
|
|
1105
1103
|
useCache: "",
|
|
1106
1104
|
appendSearchToResult: "",
|
|
1107
1105
|
appendSearchAllowDuplicate: "",
|
|
1108
|
-
appendSearchToResultCond:
|
|
1106
|
+
appendSearchToResultCond: m(vt),
|
|
1109
1107
|
appendWithoutSelect: "",
|
|
1110
1108
|
buttonProps: e.buttonProps,
|
|
1111
1109
|
openerShortcut: e.openerShortcut,
|
|
@@ -1115,34 +1113,35 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1115
1113
|
item: B(({ item: p }) => [
|
|
1116
1114
|
N("div", oo, [
|
|
1117
1115
|
N("div", ao, [
|
|
1118
|
-
p.id ? (h(),
|
|
1119
|
-
|
|
1116
|
+
p.id ? (h(), A(F, { key: 0 }, [
|
|
1117
|
+
H(b(m(pt)(p.name, 20)) + " ", 1),
|
|
1120
1118
|
N("span", lo, " id " + b(p.id), 1)
|
|
1121
|
-
], 64)) : (h(),
|
|
1122
|
-
p.listItemProps?.type ? M("", !0) : (h(),
|
|
1123
|
-
|
|
1119
|
+
], 64)) : (h(), A(F, { key: 1 }, [
|
|
1120
|
+
p.listItemProps?.type ? M("", !0) : (h(), A("div", no, b(k.$i18n.Projects.Add_project) + ": ", 1)),
|
|
1121
|
+
H(" " + b(p.name), 1)
|
|
1124
1122
|
], 64))
|
|
1125
1123
|
]),
|
|
1126
|
-
p.id ? (h(),
|
|
1127
|
-
e.addLinksToProjects ? (h(),
|
|
1124
|
+
p.id ? (h(), A(F, { key: 0 }, [
|
|
1125
|
+
e.addLinksToProjects ? (h(), A("a", {
|
|
1128
1126
|
key: 0,
|
|
1129
1127
|
class: "top-projectSelector_itemLink",
|
|
1130
|
-
href:
|
|
1128
|
+
href: m(Ge)(p.id),
|
|
1129
|
+
onClick: W((x) => m(Yt)(m(Ge)(p.id)), ["prevent"])
|
|
1131
1130
|
}, null, 8, ro)) : M("", !0),
|
|
1132
|
-
|
|
1131
|
+
k.$core.state.isMobile ? M("", !0) : (h(), j(y, {
|
|
1133
1132
|
key: 1,
|
|
1134
1133
|
class: "top-projectSelector_itemExtLink",
|
|
1135
|
-
href:
|
|
1134
|
+
href: m(Le)(p.url),
|
|
1136
1135
|
"data-top-icon": "",
|
|
1137
1136
|
color: "theme",
|
|
1138
1137
|
target: "_blank",
|
|
1139
|
-
onClick: R[0] || (R[0] =
|
|
1138
|
+
onClick: R[0] || (R[0] = W(() => {
|
|
1140
1139
|
}, ["stop"]))
|
|
1141
1140
|
}, null, 8, ["href"])),
|
|
1142
|
-
U(
|
|
1141
|
+
U(Wt, {
|
|
1143
1142
|
id: p.id,
|
|
1144
1143
|
right: p.right ?? void 0,
|
|
1145
|
-
url:
|
|
1144
|
+
url: m(Le)(p.url)
|
|
1146
1145
|
}, null, 8, ["id", "right", "url"])
|
|
1147
1146
|
], 64)) : M("", !0)
|
|
1148
1147
|
])
|
|
@@ -1151,14 +1150,14 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1151
1150
|
}, 8, ["modelValue", "items", "title", "modificator", "placeholder", "api", "apiSetSearchParams", "appendSearchToResultCond", "buttonProps", "openerShortcut"]);
|
|
1152
1151
|
};
|
|
1153
1152
|
}
|
|
1154
|
-
}),
|
|
1153
|
+
}), Ue = (e) => "-" + e, te = (e) => e[0] === "-" ? e.substring(1) : e, ve = (e, t) => {
|
|
1155
1154
|
e = te(e);
|
|
1156
1155
|
const o = t.find((a) => a.id === e);
|
|
1157
1156
|
if (o)
|
|
1158
1157
|
return o;
|
|
1159
1158
|
}, Eo = (e, t, o) => {
|
|
1160
1159
|
t || (t = { id: e.id }), t.id = e.id, t.pos ??= "3", t.notch ??= !0, t.posBy ??= "fixed";
|
|
1161
|
-
const a =
|
|
1160
|
+
const a = yt.genElPopupOpener("div", t);
|
|
1162
1161
|
return a.classList.add("top-tagSelector"), e.useTopButton && a.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), e.useTopButton || a.classList.add("top-tagSelector-custom"), e.mode === "filter" && a.classList.add("top-tagSelector-filter"), e.mode === "setter" && !e.filters && a.classList.add("top-tagSelector-setter_single"), e.mode === "setter" && e.filters && a.classList.add("top-tagSelector-setter_several"), a.onclick = (n) => {
|
|
1163
1162
|
n.preventDefault(), n.stopPropagation(), a.onclick = null;
|
|
1164
1163
|
const l = _(e.modelValue), r = {
|
|
@@ -1179,13 +1178,13 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1179
1178
|
}, Mo = (e, t) => {
|
|
1180
1179
|
Z(e, "topTagSelectorRender")?.(t);
|
|
1181
1180
|
}, ne = (e, t, o) => {
|
|
1182
|
-
const a =
|
|
1181
|
+
const a = m(t.modelValue);
|
|
1183
1182
|
if (e.classList.toggle("top-tagSelector-selectedOne", !a.length || a.length === 1), e.classList.toggle("top-tagSelector-toTwoLine", a.length > 5), t.mode === "setter" && t.filters) {
|
|
1184
1183
|
e.innerHTML = `<div>${o}</div>`;
|
|
1185
1184
|
return;
|
|
1186
1185
|
}
|
|
1187
1186
|
if (e.innerHTML = "", !a.length && t.mode === "filter") {
|
|
1188
|
-
const n =
|
|
1187
|
+
const n = Ne({
|
|
1189
1188
|
id: "all",
|
|
1190
1189
|
colorId: "",
|
|
1191
1190
|
name: w().Common?.All_tags ?? "",
|
|
@@ -1194,7 +1193,7 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1194
1193
|
e.append(n);
|
|
1195
1194
|
}
|
|
1196
1195
|
a.forEach((n) => {
|
|
1197
|
-
const l =
|
|
1196
|
+
const l = Ne({
|
|
1198
1197
|
id: te(n),
|
|
1199
1198
|
colorId: ve(n, t.tags)?.color_id ?? "",
|
|
1200
1199
|
name: ve(n, t.tags)?.name ?? "",
|
|
@@ -1202,7 +1201,7 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1202
1201
|
});
|
|
1203
1202
|
e.append(l);
|
|
1204
1203
|
});
|
|
1205
|
-
},
|
|
1204
|
+
}, Ne = (e) => {
|
|
1206
1205
|
const t = document.createElement("div");
|
|
1207
1206
|
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;
|
|
1208
1207
|
}, io = [
|
|
@@ -1265,7 +1264,7 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1265
1264
|
state: {}
|
|
1266
1265
|
},
|
|
1267
1266
|
setup(e) {
|
|
1268
|
-
return (t, o) => (h(),
|
|
1267
|
+
return (t, o) => (h(), A("div", {
|
|
1269
1268
|
class: oe({
|
|
1270
1269
|
"top-tagSelector_tagIcon": !0,
|
|
1271
1270
|
"top-tagSelector-active": !!e.state,
|
|
@@ -1276,7 +1275,7 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1276
1275
|
title: e.name
|
|
1277
1276
|
}, null, 10, so));
|
|
1278
1277
|
}
|
|
1279
|
-
}), uo = ["contenteditable", "onKeydown"],
|
|
1278
|
+
}), uo = ["contenteditable", "onKeydown"], De = /* @__PURE__ */ K({
|
|
1280
1279
|
__name: "tagPopupListItem",
|
|
1281
1280
|
props: /* @__PURE__ */ G({
|
|
1282
1281
|
editable: { type: Boolean },
|
|
@@ -1298,19 +1297,19 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1298
1297
|
contenteditable: i.value,
|
|
1299
1298
|
onpaste: (f) => f.preventDefault()
|
|
1300
1299
|
} : {}), i = _(!1), u = async () => {
|
|
1301
|
-
i.value = !0, await
|
|
1300
|
+
i.value = !0, await ot(), l.value?.focus();
|
|
1302
1301
|
}, g = () => {
|
|
1303
1302
|
const f = l.value?.innerText;
|
|
1304
|
-
if (!f) return
|
|
1303
|
+
if (!f) return C();
|
|
1305
1304
|
l.value && (l.value.innerText = f), i.value = !1, a("update:name", f);
|
|
1306
|
-
},
|
|
1305
|
+
}, C = async () => {
|
|
1307
1306
|
l.value && (l.value.innerText = o.name), i.value = !1;
|
|
1308
1307
|
}, d = (f) => {
|
|
1309
1308
|
if (i.value || o.disabled) return;
|
|
1310
1309
|
let s = "selected";
|
|
1311
1310
|
o.canExclude && (f.ctrlKey || f.metaKey) && (s = "excluded"), o.state == s && (s = ""), s === "" && a("unselect"), s === "selected" && a("select"), s === "excluded" && a("exclude");
|
|
1312
1311
|
};
|
|
1313
|
-
return (f, s) => (h(),
|
|
1312
|
+
return (f, s) => (h(), j(je, {
|
|
1314
1313
|
class: oe({
|
|
1315
1314
|
"top-tagSelector_tagListItem": !0,
|
|
1316
1315
|
"top-tagSelector_tagListItem-inEdit": i.value,
|
|
@@ -1319,7 +1318,7 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1319
1318
|
"top-tagSelector-active": !!e.state,
|
|
1320
1319
|
"top-tagSelector-excluded": e.state === "excluded"
|
|
1321
1320
|
}),
|
|
1322
|
-
onClick:
|
|
1321
|
+
onClick: W(d, ["stop"])
|
|
1323
1322
|
}, {
|
|
1324
1323
|
default: B(() => [
|
|
1325
1324
|
U(Te, {
|
|
@@ -1328,24 +1327,24 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1328
1327
|
colorId: e.colorId,
|
|
1329
1328
|
state: e.state
|
|
1330
1329
|
}, null, 8, ["id", "name", "colorId", "state"]),
|
|
1331
|
-
N("span",
|
|
1330
|
+
N("span", He({
|
|
1332
1331
|
ref_key: "elName",
|
|
1333
1332
|
ref: l,
|
|
1334
1333
|
class: "top-tagSelector_tagListItemName",
|
|
1335
1334
|
contenteditable: i.value ? "plaintext-only" : !1
|
|
1336
1335
|
}, r.value, {
|
|
1337
1336
|
onKeydown: [
|
|
1338
|
-
Ee(
|
|
1339
|
-
Ee(
|
|
1337
|
+
Ee(W(g, ["stop"]), ["enter"]),
|
|
1338
|
+
Ee(W(C, ["stop"]), ["esc"])
|
|
1340
1339
|
]
|
|
1341
1340
|
}), b(n.value), 17, uo),
|
|
1342
|
-
e.editable ? (h(),
|
|
1343
|
-
i.value ? (h(),
|
|
1341
|
+
e.editable ? (h(), A(F, { key: 0 }, [
|
|
1342
|
+
i.value ? (h(), A("span", {
|
|
1344
1343
|
key: 1,
|
|
1345
1344
|
"data-top-icon": "",
|
|
1346
1345
|
class: "top-tagSelector_edit",
|
|
1347
|
-
onClick:
|
|
1348
|
-
})) : (h(),
|
|
1346
|
+
onClick: W(g, ["stop"])
|
|
1347
|
+
})) : (h(), A("span", {
|
|
1349
1348
|
key: 0,
|
|
1350
1349
|
"data-top-icon": "",
|
|
1351
1350
|
class: "top-tagSelector_edit",
|
|
@@ -1385,10 +1384,10 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1385
1384
|
payload: t.payload
|
|
1386
1385
|
};
|
|
1387
1386
|
return (r, i) => {
|
|
1388
|
-
const u =
|
|
1389
|
-
return h(),
|
|
1387
|
+
const u = at("top-data");
|
|
1388
|
+
return h(), j(st, { id: e.id }, {
|
|
1390
1389
|
default: B(() => [
|
|
1391
|
-
|
|
1390
|
+
lt((h(), j(nt(m(a)), He({
|
|
1392
1391
|
class: {
|
|
1393
1392
|
"top-tagSelector": !0,
|
|
1394
1393
|
"top-tagSelector-useTopButton": t.useTopButton,
|
|
@@ -1403,21 +1402,21 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1403
1402
|
color: "theme",
|
|
1404
1403
|
styling: e.styling
|
|
1405
1404
|
}, r.$attrs), {
|
|
1406
|
-
[
|
|
1407
|
-
!o.value.length && e.mode === "filter" ? (h(),
|
|
1405
|
+
[m(n)]: B(() => [
|
|
1406
|
+
!o.value.length && e.mode === "filter" ? (h(), j(Te, {
|
|
1408
1407
|
key: 0,
|
|
1409
1408
|
id: "all",
|
|
1410
1409
|
colorId: "",
|
|
1411
1410
|
name: r.$i18n.Common.All_tags ?? "",
|
|
1412
1411
|
state: ""
|
|
1413
1412
|
}, null, 8, ["name"])) : M("", !0),
|
|
1414
|
-
e.mode === "setter" && e.filters ? (h(),
|
|
1415
|
-
|
|
1416
|
-
])) : (h(!0),
|
|
1417
|
-
id:
|
|
1418
|
-
colorId:
|
|
1419
|
-
name:
|
|
1420
|
-
state:
|
|
1413
|
+
e.mode === "setter" && e.filters ? (h(), A("div", co, [
|
|
1414
|
+
rt(r.$slots, "default")
|
|
1415
|
+
])) : (h(!0), A(F, { key: 2 }, pe(o.value, (g) => (h(), j(Te, {
|
|
1416
|
+
id: m(te)(g),
|
|
1417
|
+
colorId: m(ve)(g, e.tags)?.color_id ?? "",
|
|
1418
|
+
name: m(ve)(g, e.tags)?.name ?? "",
|
|
1419
|
+
state: m(te)(g) === g ? "selected" : "excluded"
|
|
1421
1420
|
}, null, 8, ["id", "colorId", "name", "state"]))), 256))
|
|
1422
1421
|
]),
|
|
1423
1422
|
_: 2
|
|
@@ -1449,21 +1448,21 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1449
1448
|
},
|
|
1450
1449
|
modelModifiers: {},
|
|
1451
1450
|
tags: {
|
|
1452
|
-
default:
|
|
1451
|
+
default: Fe(io)
|
|
1453
1452
|
},
|
|
1454
1453
|
tagsModifiers: {}
|
|
1455
1454
|
}),
|
|
1456
1455
|
emits: /* @__PURE__ */ G(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
|
|
1457
1456
|
setup(e, { emit: t }) {
|
|
1458
|
-
const o = w(), a = e, n = P(e, "modelValue"), l = P(e, "tags"), r = t, i =
|
|
1457
|
+
const o = w(), a = e, n = P(e, "modelValue"), l = P(e, "tags"), r = t, i = dt((y, p) => {
|
|
1459
1458
|
r(y, p);
|
|
1460
1459
|
}, a.emitDelay);
|
|
1461
1460
|
a.singleMode && !n.value.length && (n.value = [l.value[0].id]);
|
|
1462
|
-
const u = a.id ?? "top-popup-id-" + Math.random(), g = _("add"),
|
|
1461
|
+
const u = a.id ?? "top-popup-id-" + Math.random(), g = _("add"), C = () => {
|
|
1463
1462
|
const y = " " + o.Common.Tags?.toLowerCase(), p = /* @__PURE__ */ new Map();
|
|
1464
1463
|
return p.set("add", { value: "add", title: o.Common.Add + y }), p.set("replace", { value: "replace", title: o.Common.Replace + y }), p.set("delete", { value: "delete", title: o.Common.Delete + y }), p;
|
|
1465
1464
|
};
|
|
1466
|
-
let d =
|
|
1465
|
+
let d = We({
|
|
1467
1466
|
model: n,
|
|
1468
1467
|
mode: "filter",
|
|
1469
1468
|
targetId: void 0,
|
|
@@ -1479,13 +1478,13 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1479
1478
|
}), s = (y) => {
|
|
1480
1479
|
if (y !== "all") {
|
|
1481
1480
|
if (d.value.model.value.includes(y)) return "selected";
|
|
1482
|
-
if (d.value.model.value.includes(
|
|
1481
|
+
if (d.value.model.value.includes(Ue(y))) return "excluded";
|
|
1483
1482
|
}
|
|
1484
1483
|
return y === "all" && !d.value.model.value.length ? "selected" : "";
|
|
1485
1484
|
}, c = (y, p) => {
|
|
1486
|
-
const
|
|
1487
|
-
let T = d.value.model.value.filter((O) => O !== y && O !==
|
|
1488
|
-
p === "select" && T.push(y), p === "exclude" && T.push(
|
|
1485
|
+
const x = Ue(y);
|
|
1486
|
+
let T = d.value.model.value.filter((O) => O !== y && O !== x);
|
|
1487
|
+
p === "select" && T.push(y), p === "exclude" && T.push(x), d.value.mode === "setter" && d.value.targetId !== void 0 && a.requiredForSetter && (T.length || T.push("1"), T.length === 2 && d.value.model.value.length === 1 && d.value.model.value[0] === "1" && (T = T.filter((O) => O !== "1"))), a.singleMode && !d.value.filters && (T.length || (T = d.value.model.value), T.length > 1 && (T = [T[T.length - 1]])), T.sort((O, ae) => {
|
|
1489
1488
|
if (!a.tags) return 0;
|
|
1490
1489
|
const J = a.tags.findIndex((Y) => Y.id === O), z = a.tags.findIndex((Y) => Y.id === ae);
|
|
1491
1490
|
return J - z;
|
|
@@ -1494,7 +1493,7 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1494
1493
|
targetId: d.value.targetId,
|
|
1495
1494
|
payload: d.value.payload
|
|
1496
1495
|
});
|
|
1497
|
-
},
|
|
1496
|
+
}, v = E(() => {
|
|
1498
1497
|
let y = "top-tagSelector_popup";
|
|
1499
1498
|
return d.value.mode === "filter" && (y += " top-tagSelector_popup-filter"), d.value.mode === "setter" && (y += " top-tagSelector_popup-setter"), y;
|
|
1500
1499
|
}), I = () => {
|
|
@@ -1506,7 +1505,7 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1506
1505
|
name: y,
|
|
1507
1506
|
color_id: String((p - 1) % 10 + 1)
|
|
1508
1507
|
}), r("tagsChanged", l.value);
|
|
1509
|
-
},
|
|
1508
|
+
}, k = (y) => {
|
|
1510
1509
|
if (d.value = Z(y.elPopupOpener, "topTagSelectorTarget"), !d.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
|
|
1511
1510
|
if (d.value.filters && (g.value = "add", d.value.model.value = []), !X.$?.ui.sortable) {
|
|
1512
1511
|
console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
|
|
@@ -1519,9 +1518,9 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1519
1518
|
*/
|
|
1520
1519
|
cancel: '[contenteditable="plaintext-only"], [contenteditable="true"]',
|
|
1521
1520
|
distance: 10,
|
|
1522
|
-
stop: function(p,
|
|
1521
|
+
stop: function(p, x) {
|
|
1523
1522
|
if (!l.value) return;
|
|
1524
|
-
const T = $(
|
|
1523
|
+
const T = $(x.item).parent().find("[data-tag_id]"), O = [];
|
|
1525
1524
|
T.each((ae, J) => {
|
|
1526
1525
|
if (!l.value) return;
|
|
1527
1526
|
const z = $(J).attr("data-tag_id");
|
|
@@ -1535,91 +1534,91 @@ const Mt = /* @__PURE__ */ K({
|
|
|
1535
1534
|
}, R = (y) => {
|
|
1536
1535
|
X.$?.ui.sortable && $(y.elPopup).data("ui-sortable") && $(y.elPopup).sortable("destroy");
|
|
1537
1536
|
};
|
|
1538
|
-
return (y, p) => (h(),
|
|
1537
|
+
return (y, p) => (h(), A(F, null, [
|
|
1539
1538
|
U(fo, {
|
|
1540
1539
|
modelValue: n.value,
|
|
1541
|
-
"onUpdate:modelValue": p[0] || (p[0] = (
|
|
1542
|
-
id:
|
|
1540
|
+
"onUpdate:modelValue": p[0] || (p[0] = (x) => n.value = x),
|
|
1541
|
+
id: m(u),
|
|
1543
1542
|
tags: l.value,
|
|
1544
1543
|
styling: e.styling,
|
|
1545
1544
|
mode: "filter",
|
|
1546
1545
|
useTopButton: e.useTopButton
|
|
1547
1546
|
}, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
|
|
1548
|
-
U(
|
|
1549
|
-
id:
|
|
1550
|
-
class: oe(
|
|
1551
|
-
onOpen: p[4] || (p[4] = (
|
|
1552
|
-
onClose: p[5] || (p[5] = (
|
|
1547
|
+
U(Ae, {
|
|
1548
|
+
id: m(u),
|
|
1549
|
+
class: oe(v.value),
|
|
1550
|
+
onOpen: p[4] || (p[4] = (x) => k(x)),
|
|
1551
|
+
onClose: p[5] || (p[5] = (x) => R(x)),
|
|
1553
1552
|
"transition-duration": 50
|
|
1554
|
-
},
|
|
1553
|
+
}, it({
|
|
1555
1554
|
contentList: B(() => [
|
|
1556
|
-
|
|
1555
|
+
m(d).mode === "filter" && !e.singleMode ? (h(), j(De, {
|
|
1557
1556
|
key: 0,
|
|
1558
1557
|
id: "all",
|
|
1559
1558
|
colorId: "",
|
|
1560
1559
|
name: y.$i18n.Common.All_tags ?? "",
|
|
1561
|
-
state:
|
|
1562
|
-
onSelect: p[3] || (p[3] = (
|
|
1560
|
+
state: m(d).model.value.length ? "" : "selected",
|
|
1561
|
+
onSelect: p[3] || (p[3] = (x) => m(d).model.value = [])
|
|
1563
1562
|
}, null, 8, ["name", "state"])) : M("", !0),
|
|
1564
|
-
(h(!0),
|
|
1565
|
-
key:
|
|
1566
|
-
id:
|
|
1567
|
-
colorId:
|
|
1568
|
-
name:
|
|
1569
|
-
state: s(
|
|
1570
|
-
canExclude:
|
|
1563
|
+
(h(!0), A(F, null, pe(l.value, (x) => (h(), j(De, {
|
|
1564
|
+
key: x.id,
|
|
1565
|
+
id: x.id,
|
|
1566
|
+
colorId: x.color_id,
|
|
1567
|
+
name: x.name,
|
|
1568
|
+
state: s(x.id),
|
|
1569
|
+
canExclude: m(d).mode === "filter" && !e.singleMode,
|
|
1571
1570
|
editable: e.tagsEditable,
|
|
1572
|
-
disabled: f.value && s(
|
|
1573
|
-
onUnselect: (T) => c(
|
|
1574
|
-
onSelect: (T) => c(
|
|
1575
|
-
onExclude: (T) => c(
|
|
1571
|
+
disabled: f.value && s(x.id) === "",
|
|
1572
|
+
onUnselect: (T) => c(x.id, "unselect"),
|
|
1573
|
+
onSelect: (T) => c(x.id, "select"),
|
|
1574
|
+
onExclude: (T) => c(x.id, "exclude"),
|
|
1576
1575
|
"onUpdate:name": (T) => {
|
|
1577
|
-
|
|
1576
|
+
x.name = T, m(i)("tagsChanged", l.value);
|
|
1578
1577
|
}
|
|
1579
1578
|
}, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
|
|
1580
|
-
e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(),
|
|
1579
|
+
e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), j(je, {
|
|
1581
1580
|
key: 1,
|
|
1582
1581
|
"data-top-icon": "",
|
|
1583
|
-
onClick:
|
|
1582
|
+
onClick: W(I, ["stop"])
|
|
1584
1583
|
}, {
|
|
1585
1584
|
default: B(() => [
|
|
1586
|
-
|
|
1585
|
+
H(b(y.$i18n.Common.Add), 1)
|
|
1587
1586
|
]),
|
|
1588
1587
|
_: 1
|
|
1589
1588
|
})) : M("", !0)
|
|
1590
1589
|
]),
|
|
1591
1590
|
_: 2
|
|
1592
1591
|
}, [
|
|
1593
|
-
|
|
1592
|
+
m(d).mode === "setter" && m(d).filters ? {
|
|
1594
1593
|
name: "header",
|
|
1595
1594
|
fn: B(() => [
|
|
1596
1595
|
U(xe, {
|
|
1597
1596
|
modelValue: g.value,
|
|
1598
|
-
"onUpdate:modelValue": p[1] || (p[1] = (
|
|
1599
|
-
options:
|
|
1597
|
+
"onUpdate:modelValue": p[1] || (p[1] = (x) => g.value = x),
|
|
1598
|
+
options: C()
|
|
1600
1599
|
}, null, 8, ["modelValue", "options"])
|
|
1601
1600
|
]),
|
|
1602
1601
|
key: "0"
|
|
1603
1602
|
} : void 0,
|
|
1604
|
-
|
|
1603
|
+
m(d).mode === "setter" && m(d).filters ? {
|
|
1605
1604
|
name: "footer",
|
|
1606
1605
|
fn: B(() => [
|
|
1607
1606
|
U(ee, { color: "theme" }, {
|
|
1608
1607
|
default: B(() => [
|
|
1609
|
-
|
|
1608
|
+
H(b(y.$i18n.Common.Cancel), 1)
|
|
1610
1609
|
]),
|
|
1611
1610
|
_: 1
|
|
1612
1611
|
}),
|
|
1613
1612
|
U(ee, {
|
|
1614
|
-
onClick: p[2] || (p[2] = (
|
|
1615
|
-
tagsIds:
|
|
1616
|
-
filters:
|
|
1613
|
+
onClick: p[2] || (p[2] = (x) => m(i)("setter", {
|
|
1614
|
+
tagsIds: m(d).model.value,
|
|
1615
|
+
filters: m(d).filters,
|
|
1617
1616
|
filtersAction: g.value,
|
|
1618
|
-
payload:
|
|
1617
|
+
payload: m(d).payload
|
|
1619
1618
|
}))
|
|
1620
1619
|
}, {
|
|
1621
1620
|
default: B(() => [
|
|
1622
|
-
|
|
1621
|
+
H(b(g.value === "add" ? y.$i18n.Common.Add : "") + " " + b(g.value === "replace" ? y.$i18n.Common.Replace : "") + " " + b(g.value === "delete" ? y.$i18n.Common.Delete : ""), 1)
|
|
1623
1622
|
]),
|
|
1624
1623
|
_: 1
|
|
1625
1624
|
})
|
|
@@ -1639,10 +1638,10 @@ export {
|
|
|
1639
1638
|
fo as TopTagSelectorPopupOpener,
|
|
1640
1639
|
Te as TopTagSelectorTagIcon,
|
|
1641
1640
|
to as clearCache,
|
|
1642
|
-
|
|
1641
|
+
Bt as dialogRegionSelector,
|
|
1643
1642
|
jt as findRegion,
|
|
1644
1643
|
Eo as genElTopTagSelectorPopupOpener,
|
|
1645
|
-
|
|
1644
|
+
Qe as genSearcherByKey,
|
|
1646
1645
|
Mo as renderElTopTagSelectorPopupOpener,
|
|
1647
1646
|
wo as useItemsFromCompetitors
|
|
1648
1647
|
};
|