@topvisor/ui 1.5.4-groupSelector.0 → 1.5.4-groupSelector.1
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 +310 -304
- package/project/project.js.map +1 -1
- package/src/components/project/groupSelector/groupSelector.vue.d.ts +4 -6
- package/src/components/project/groupSelector/groups/groups.vue.d.ts +1 -1
package/project/project.js
CHANGED
|
@@ -19,11 +19,11 @@ import { invertKeyboardLayout as h } from "../utils/keyboard.js";
|
|
|
19
19
|
import { c as g, n as _, o as v, r as ee, s as y } from "../.chunks/popup-DHCqvZzI.esm.js";
|
|
20
20
|
import { d as b, s as x, u as te } from "../.chunks/formsExt-Ck5q-jXI.esm.js";
|
|
21
21
|
import "../popup/worker.js";
|
|
22
|
-
import { Fragment as S, computed as C, createBlock as w, createCommentVNode as T, createElementBlock as E, createElementVNode as D, createSlots as ne, createTextVNode as O, createVNode as k, defineComponent as A, isRef as
|
|
22
|
+
import { Fragment as S, computed as C, createBlock as w, createCommentVNode as T, createElementBlock as E, createElementVNode as D, createSlots as ne, createTextVNode as O, createVNode as k, defineComponent as A, isRef as j, mergeModels as M, mergeProps as re, nextTick as ie, normalizeClass as N, onMounted as ae, openBlock as P, reactive as oe, ref as F, renderList as I, renderSlot as se, resolveComponent as ce, resolveDirective as le, resolveDynamicComponent as ue, shallowRef as de, toDisplayString as L, toValue as fe, unref as R, useModel as z, watch as B, withCtx as V, withDirectives as pe, withKeys as me, withModifiers as H } from "vue";
|
|
23
23
|
//#region src/components/project/competitorSelector/competitorSelector.vue?vue&type=script&setup=true&lang.ts
|
|
24
|
-
var
|
|
24
|
+
var he = { class: "top-competitorSelector" }, ge = { class: "top-ellipsis1" }, _e = /* @__PURE__ */ A({
|
|
25
25
|
__name: "competitorSelector",
|
|
26
|
-
props: /* @__PURE__ */
|
|
26
|
+
props: /* @__PURE__ */ M({
|
|
27
27
|
modelValue: {},
|
|
28
28
|
items: {},
|
|
29
29
|
showSelectAllItem: {
|
|
@@ -36,7 +36,7 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
36
36
|
}),
|
|
37
37
|
emits: ["update:modelValue"],
|
|
38
38
|
setup(n) {
|
|
39
|
-
let i = n, a =
|
|
39
|
+
let i = n, a = z(n, "modelValue"), o = C(() => {
|
|
40
40
|
if (i.showSelectAllItem) return {
|
|
41
41
|
icon: "",
|
|
42
42
|
title: e().Common.Select_all,
|
|
@@ -44,23 +44,23 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
44
44
|
content: ""
|
|
45
45
|
};
|
|
46
46
|
});
|
|
47
|
-
return (e, i) => (
|
|
48
|
-
opener:
|
|
47
|
+
return (e, i) => (P(), E("div", he, [R(t).state.isMobile ? (P(), w(y, { key: 0 }, {
|
|
48
|
+
opener: V(() => [k(r, {
|
|
49
49
|
class: "top-competitorSelector_opener",
|
|
50
50
|
color: "theme",
|
|
51
51
|
icon: "",
|
|
52
52
|
icon2: ""
|
|
53
53
|
}, {
|
|
54
|
-
default:
|
|
54
|
+
default: V(() => [O(L(n.items.find((e) => e.value === a.value?.[0])?.content), 1)]),
|
|
55
55
|
_: 1
|
|
56
56
|
})]),
|
|
57
|
-
contentList:
|
|
58
|
-
class:
|
|
57
|
+
contentList: V(() => [(P(!0), E(S, null, I(n.items, (e) => (P(), w(v, {
|
|
58
|
+
class: N({ "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: V(() => [D("span", ge, L(e.content), 1)]),
|
|
64
64
|
_: 2
|
|
65
65
|
}, 1032, [
|
|
66
66
|
"class",
|
|
@@ -69,7 +69,7 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
69
69
|
"onClick"
|
|
70
70
|
]))), 256))]),
|
|
71
71
|
_: 1
|
|
72
|
-
})) : (
|
|
72
|
+
})) : (P(), w(b, {
|
|
73
73
|
key: 1,
|
|
74
74
|
modelValue: a.value,
|
|
75
75
|
"onUpdate:modelValue": i[0] ||= (e) => a.value = e,
|
|
@@ -84,12 +84,12 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
84
84
|
"selectAllItem"
|
|
85
85
|
]))]));
|
|
86
86
|
}
|
|
87
|
-
}),
|
|
87
|
+
}), ve = (e, t) => C(() => fe(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 === fe(t) ? "" : "",
|
|
91
91
|
content: e.name
|
|
92
|
-
}))),
|
|
92
|
+
}))), ye = {
|
|
93
93
|
0: "Yandex",
|
|
94
94
|
1: "Google",
|
|
95
95
|
4: "YouTube",
|
|
@@ -99,25 +99,25 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
99
99
|
9: "GoogleStore",
|
|
100
100
|
20: "Yandex.com",
|
|
101
101
|
21: "Yandex.com.tr"
|
|
102
|
-
},
|
|
102
|
+
}, be = {
|
|
103
103
|
key: -2,
|
|
104
104
|
name: "--",
|
|
105
105
|
index: -2
|
|
106
|
-
},
|
|
106
|
+
}, xe = {
|
|
107
107
|
key: -2,
|
|
108
108
|
name: "--",
|
|
109
|
-
regions: [
|
|
110
|
-
regionByIndex: new Map([[-2,
|
|
111
|
-
},
|
|
109
|
+
regions: [be],
|
|
110
|
+
regionByIndex: new Map([[-2, be]])
|
|
111
|
+
}, U = {
|
|
112
112
|
key: -2,
|
|
113
113
|
name: "Autoselect",
|
|
114
114
|
index: -2
|
|
115
|
-
},
|
|
115
|
+
}, Se = {
|
|
116
116
|
key: -2,
|
|
117
117
|
name: "Autoselect",
|
|
118
|
-
regions: [
|
|
119
|
-
regionByIndex: new Map([[-2,
|
|
120
|
-
},
|
|
118
|
+
regions: [U],
|
|
119
|
+
regionByIndex: new Map([[-2, U]])
|
|
120
|
+
}, Ce = {
|
|
121
121
|
countryCode: "00",
|
|
122
122
|
depth: 1,
|
|
123
123
|
device: 0,
|
|
@@ -125,10 +125,10 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
125
125
|
index: -1,
|
|
126
126
|
lang: "ru",
|
|
127
127
|
name: "Without region"
|
|
128
|
-
},
|
|
128
|
+
}, we = () => (U.name = e().Common.Autoselect, U), Te = () => (we(), Se.name = e().Common.Autoselect, console.log(Se), Se), Ee = () => (Ce.name = e().Keywords.Without_region, Ce), De = (e = "", t = !1, n = []) => {
|
|
129
129
|
let r;
|
|
130
|
-
return r = e ?
|
|
131
|
-
},
|
|
130
|
+
return r = e ? ke(n, e) : Oe(n), t && r.set(-2, Te()), r.size || r.set(-2, xe), r;
|
|
131
|
+
}, Oe = (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,34 +142,34 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
142
142
|
if (i.has(e)) return;
|
|
143
143
|
let t = {
|
|
144
144
|
key: e,
|
|
145
|
-
name:
|
|
145
|
+
name: ye[e],
|
|
146
146
|
regions: [],
|
|
147
147
|
regionByIndex: /* @__PURE__ */ new Map()
|
|
148
148
|
};
|
|
149
149
|
i.set(t.key, t);
|
|
150
150
|
}), i;
|
|
151
|
-
},
|
|
152
|
-
let r =
|
|
151
|
+
}, ke = (e, n) => {
|
|
152
|
+
let r = Oe(e, !1, t.state.forceSearchersKeysForKeywordsStats, n);
|
|
153
153
|
if (r.has(2)) {
|
|
154
154
|
let e = r.get(2);
|
|
155
155
|
e && (e.regionByIndex = /* @__PURE__ */ new Map());
|
|
156
156
|
}
|
|
157
157
|
return (n === "volume" || n === "cost_forecast") && t.state.showGlobalRegionForKeywordsStats && r.forEach((e) => {
|
|
158
158
|
if (!e.regionByIndex) return;
|
|
159
|
-
let t = { ...
|
|
159
|
+
let t = { ...Ee() };
|
|
160
160
|
e.regionByIndex.set(t.index, t);
|
|
161
161
|
}), r;
|
|
162
|
-
},
|
|
163
|
-
let r =
|
|
162
|
+
}, Ae = (e, t, n = []) => {
|
|
163
|
+
let r = De(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
|
+
}, je = d(() => import("../.chunks/dialog_regionSelectorRegions-BKvg82IO.esm.js")), Me = (t, n) => {
|
|
170
170
|
let r = e();
|
|
171
171
|
return {
|
|
172
|
-
searcherKey:
|
|
172
|
+
searcherKey: F(n.value.keys().next().value ?? -2),
|
|
173
173
|
optionBySearcherKey: C(() => {
|
|
174
174
|
let e = /* @__PURE__ */ new Map();
|
|
175
175
|
if (n.value.forEach((n) => {
|
|
@@ -194,8 +194,8 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
194
194
|
return e;
|
|
195
195
|
})
|
|
196
196
|
};
|
|
197
|
-
},
|
|
198
|
-
let r = e(), i =
|
|
197
|
+
}, Ne = (t, n) => {
|
|
198
|
+
let r = e(), i = F(-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
200
|
let a = C(() => {
|
|
201
201
|
let e = /* @__PURE__ */ new Map();
|
|
@@ -220,7 +220,7 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
220
220
|
e.set(i.index, s);
|
|
221
221
|
}), e;
|
|
222
222
|
});
|
|
223
|
-
return
|
|
223
|
+
return B(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 ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
243
243
|
regionIndex: i,
|
|
244
244
|
optionByRegionIndex: a
|
|
245
245
|
};
|
|
246
|
-
},
|
|
247
|
-
let r =
|
|
246
|
+
}, Pe = (e, t, n) => {
|
|
247
|
+
let r = F([]), 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 ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
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 B(r, () => {
|
|
262
262
|
a();
|
|
263
263
|
}), e.addCompare && i(), { regionsIndexes: r };
|
|
264
|
-
},
|
|
265
|
-
let t = C(() =>
|
|
264
|
+
}, Fe = (e) => {
|
|
265
|
+
let t = C(() => De(e.forMode, e.autoRegion, e.searchers)), n = C(() => t.value.get(i.searcherKey.value) || xe), r = C(() => {
|
|
266
266
|
let e = /* @__PURE__ */ new Set();
|
|
267
267
|
return t.value.forEach((t) => {
|
|
268
268
|
t.regionByIndex.forEach((t) => {
|
|
269
269
|
t.index !== -1 && t.index !== -2 && e.add(t.index);
|
|
270
270
|
});
|
|
271
271
|
}), e;
|
|
272
|
-
}), i =
|
|
273
|
-
|
|
272
|
+
}), i = Me(e, t), a = Ne(e, n), o = Pe(e, t, r);
|
|
273
|
+
B(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 ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
293
293
|
let t = a.regionIndex.value;
|
|
294
294
|
if (e.forMode) {
|
|
295
295
|
let n = a.regionIndex.value;
|
|
296
|
-
t =
|
|
296
|
+
t = Ae(e.forMode, {
|
|
297
297
|
searcher_key: s(),
|
|
298
298
|
key: n
|
|
299
299
|
}, e.searchers)?.index;
|
|
@@ -315,9 +315,9 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
315
315
|
if (e !== void 0) return l()?.regionByIndex?.get(e);
|
|
316
316
|
}
|
|
317
317
|
};
|
|
318
|
-
},
|
|
318
|
+
}, Ie = /* @__PURE__ */ A({
|
|
319
319
|
__name: "regionSelector",
|
|
320
|
-
props: /* @__PURE__ */
|
|
320
|
+
props: /* @__PURE__ */ M({
|
|
321
321
|
projectId: {},
|
|
322
322
|
searchers: { default: () => [] },
|
|
323
323
|
modelValue: {},
|
|
@@ -346,19 +346,19 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
346
346
|
}),
|
|
347
347
|
emits: ["update:modelValue", "update:modelValueSingle"],
|
|
348
348
|
setup(e, { expose: t }) {
|
|
349
|
-
let n = e, a =
|
|
349
|
+
let n = e, a = z(e, "modelValue"), o = z(e, "modelValueSingle"), { selectSearcher: s, selectRegion: c, compare: l, searcherByKey: u, allRegionsIndexes: d, getSearcher: f, getRegion: p } = Fe(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
|
+
}), je.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 B([
|
|
362
362
|
c.regionIndex,
|
|
363
363
|
s.searcherKey,
|
|
364
364
|
l.regionsIndexes
|
|
@@ -368,9 +368,9 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
368
368
|
a.value = [...l.regionsIndexes.value];
|
|
369
369
|
} else n.onlySearcher ? (a.value = [s.searcherKey.value], s.searcherKey.value === -2 && !n.autoRegion && (a.value.length = 0)) : (a.value = [c.regionIndex.value], c.regionIndex.value === -2 && !n.autoRegion && (a.value.length = 0));
|
|
370
370
|
!n.onlySearcher && !d.value.size && (s.searcherKey.value = -2);
|
|
371
|
-
}), o.value &&
|
|
371
|
+
}), o.value && B(o, () => {
|
|
372
372
|
o.value && (a.value = [o.value]);
|
|
373
|
-
}, { immediate: !0 }),
|
|
373
|
+
}, { immediate: !0 }), B(a, () => {
|
|
374
374
|
if (a.value[0] && (o.value = a.value[0]), n.onlySearcher) {
|
|
375
375
|
if (!a.value.length || a.value.length === 1 && !u.value.has(a.value[0]) || a.value.length === 1 && a.value[0] === -2 && !n.autoRegion) {
|
|
376
376
|
let e = u.value.keys().next().value;
|
|
@@ -422,14 +422,14 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
422
422
|
}, { immediate: !0 }), t({
|
|
423
423
|
getSearcher: f,
|
|
424
424
|
getRegion: p
|
|
425
|
-
}), (t, n) => (
|
|
425
|
+
}), (t, n) => (P(), E("div", { class: N({
|
|
426
426
|
"top-regionSelector": !0,
|
|
427
427
|
"top-regionSelector-onlySearcher": e.onlySearcher
|
|
428
428
|
}) }, [
|
|
429
429
|
k(i, {
|
|
430
|
-
options:
|
|
431
|
-
modelValue:
|
|
432
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
430
|
+
options: R(s).optionBySearcherKey.value,
|
|
431
|
+
modelValue: R(s).searcherKey.value,
|
|
432
|
+
"onUpdate:modelValue": n[0] ||= (e) => R(s).searcherKey.value = e,
|
|
433
433
|
name: "searcher_key",
|
|
434
434
|
addChanger: e.addChanger
|
|
435
435
|
}, null, 8, [
|
|
@@ -437,12 +437,12 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
437
437
|
"modelValue",
|
|
438
438
|
"addChanger"
|
|
439
439
|
]),
|
|
440
|
-
!e.onlySearcher &&
|
|
440
|
+
!e.onlySearcher && R(s).searcherKey.value !== R(-1) ? (P(), w(i, {
|
|
441
441
|
key: 0,
|
|
442
442
|
class: "top-select-region",
|
|
443
|
-
options:
|
|
444
|
-
modelValue:
|
|
445
|
-
"onUpdate:modelValue": n[1] ||= (e) =>
|
|
443
|
+
options: R(c).optionByRegionIndex.value,
|
|
444
|
+
modelValue: R(c).regionIndex.value,
|
|
445
|
+
"onUpdate:modelValue": n[1] ||= (e) => R(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
|
|
@@ -453,30 +453,30 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
453
453
|
"addChanger",
|
|
454
454
|
"data-top-icon"
|
|
455
455
|
])) : T("", !0),
|
|
456
|
-
e.addCompare && !e.onlySearcher &&
|
|
456
|
+
e.addCompare && !e.onlySearcher && R(s).searcherKey.value === R(-1) ? (P(), w(r, {
|
|
457
457
|
key: 1,
|
|
458
458
|
name: "compare",
|
|
459
459
|
onClick: m,
|
|
460
|
-
"data-count-compare-regions-indexes":
|
|
460
|
+
"data-count-compare-regions-indexes": R(l).regionsIndexes.value.length
|
|
461
461
|
}, {
|
|
462
|
-
default:
|
|
462
|
+
default: V(() => [O(L(t.$i18n.Common.Selected_regions), 1)]),
|
|
463
463
|
_: 1
|
|
464
464
|
}, 8, ["data-count-compare-regions-indexes"])) : T("", !0)
|
|
465
465
|
], 2));
|
|
466
466
|
}
|
|
467
|
-
}),
|
|
467
|
+
}), W = {
|
|
468
468
|
id: 0,
|
|
469
469
|
name: "/",
|
|
470
470
|
path: "/"
|
|
471
471
|
};
|
|
472
|
-
function
|
|
472
|
+
function Le(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 Re = (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 = Le(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), Re(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), ze = (e, t) => e.gen(`/get/${t}/folders/`, [
|
|
480
480
|
"id",
|
|
481
481
|
"parent_id",
|
|
482
482
|
"name",
|
|
@@ -487,9 +487,9 @@ var ze = (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 Be(e, t, n) {
|
|
491
491
|
let r = Object.keys(e);
|
|
492
|
-
return
|
|
492
|
+
return B(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 Ve(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 Ve = ["innerHTML"], He = /* @__PURE__ */ A({
|
|
508
508
|
__name: "folders",
|
|
509
|
-
props: /* @__PURE__ */
|
|
509
|
+
props: /* @__PURE__ */ M({
|
|
510
510
|
folderId: {},
|
|
511
511
|
folder: {},
|
|
512
512
|
folders: {},
|
|
@@ -522,17 +522,17 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
522
522
|
}, {
|
|
523
523
|
folderId: { required: !0 },
|
|
524
524
|
folderIdModifiers: {},
|
|
525
|
-
folder: { default:
|
|
525
|
+
folder: { default: W },
|
|
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 = z(e, "folderId"), r = z(e, "folder"), i = t.client && !t.folders ? ze(t.client, t.service) : void 0, a = F(null);
|
|
531
|
+
B(() => 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 = C(() =>
|
|
535
|
-
return
|
|
534
|
+
let o = C(() => Re(t.folders ?? { root: [W] }, t.canSelectAll));
|
|
535
|
+
return Be({
|
|
536
536
|
modelFolder: r,
|
|
537
537
|
modelFolderId: n
|
|
538
538
|
}, async (e) => {
|
|
@@ -542,20 +542,20 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
542
542
|
return;
|
|
543
543
|
}
|
|
544
544
|
let i = o.value.get(t.folderId);
|
|
545
|
-
i ||=
|
|
546
|
-
}, { immediate: !0 }), (t, n) => (
|
|
545
|
+
i ||= W, r.value = i, n.value = i.id;
|
|
546
|
+
}, { immediate: !0 }), (t, n) => (P(), w(x, {
|
|
547
547
|
class: "top-groupSelector_folder",
|
|
548
548
|
modelValue: r.value,
|
|
549
549
|
"onUpdate:modelValue": n[0] ||= (e) => r.value = e,
|
|
550
550
|
items: e.folders ? [...o.value.values()] : void 0,
|
|
551
551
|
"search-type": "inline",
|
|
552
552
|
icon: e.addIcon ? "" : void 0,
|
|
553
|
-
api: e.folders ? void 0 :
|
|
554
|
-
apiSetSearchParams: (...e) =>
|
|
553
|
+
api: e.folders ? void 0 : R(i),
|
|
554
|
+
apiSetSearchParams: (...e) => R(te)(...e, "name"),
|
|
555
555
|
addChanger: e.addChanger,
|
|
556
556
|
useCache: ""
|
|
557
557
|
}, {
|
|
558
|
-
item:
|
|
558
|
+
item: V(({ item: e }) => [D("div", { innerHTML: e.name.replaceAll(/</g, "< ") }, null, 8, Ve)]),
|
|
559
559
|
_: 1
|
|
560
560
|
}, 8, [
|
|
561
561
|
"modelValue",
|
|
@@ -566,17 +566,17 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
566
566
|
"addChanger"
|
|
567
567
|
]));
|
|
568
568
|
}
|
|
569
|
-
}),
|
|
569
|
+
}), G = {
|
|
570
570
|
id: -1,
|
|
571
571
|
name: "--",
|
|
572
|
-
folder_id:
|
|
573
|
-
folder_path:
|
|
574
|
-
},
|
|
572
|
+
folder_id: W.id,
|
|
573
|
+
folder_path: W.path
|
|
574
|
+
}, K = {
|
|
575
575
|
id: 0,
|
|
576
576
|
name: "All groups",
|
|
577
|
-
folder_id:
|
|
578
|
-
folder_path:
|
|
579
|
-
},
|
|
577
|
+
folder_id: W.id,
|
|
578
|
+
folder_path: W.path
|
|
579
|
+
}, q = () => (K.name = e()?.Common.All_groups, K), Ue = () => (K.name = e()?.Keywords.Choose_group, K), We = (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), Ge = (e, t) => e.gen(`/get/${t}/groups/`, [
|
|
580
580
|
"id",
|
|
581
581
|
"name",
|
|
582
582
|
"folder_id",
|
|
@@ -584,12 +584,12 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
584
584
|
]).changeParams({
|
|
585
585
|
folder_id_depth: !0,
|
|
586
586
|
limit: 100
|
|
587
|
-
}),
|
|
587
|
+
}), Ke = (e, t) => e.gen(`/add/${t}/groups/`), qe = (e, t) => e.gen(`/del/${t}/groups/`), Je = (e, t) => e.gen(`/edit/${t}/groups/rename/`), Ye = { class: "top-groupSelector_groupItem top-ellipsis1" }, Xe = {
|
|
588
588
|
key: 0,
|
|
589
589
|
class: "top-comment"
|
|
590
|
-
},
|
|
590
|
+
}, Ze = ["innerHTML"], Qe = ["innerHTML"], $e = ["innerHTML"], et = /* @__PURE__ */ A({
|
|
591
591
|
__name: "groups",
|
|
592
|
-
props: /* @__PURE__ */
|
|
592
|
+
props: /* @__PURE__ */ M({
|
|
593
593
|
groupId: {},
|
|
594
594
|
group: {},
|
|
595
595
|
projectId: {},
|
|
@@ -620,13 +620,13 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
620
620
|
group: { required: !0 },
|
|
621
621
|
groupModifiers: {}
|
|
622
622
|
}),
|
|
623
|
-
emits: /* @__PURE__ */
|
|
623
|
+
emits: /* @__PURE__ */ M([
|
|
624
624
|
"addGroup",
|
|
625
625
|
"editGroup",
|
|
626
626
|
"delGroup"
|
|
627
627
|
], ["update:groupId", "update:group"]),
|
|
628
628
|
setup(e, { expose: t, emit: n }) {
|
|
629
|
-
let r = e, i = n, a =
|
|
629
|
+
let r = e, i = n, a = z(e, "groupId"), s = z(e, "group"), c = r.client && !r.groups ? Ge(r.client, r.service) : void 0, l = r.client ? Ke(r.client, r.service) : void 0, u = r.client ? qe(r.client, r.service) : void 0, d = r.client ? Je(r.client, r.service) : void 0, f = F(null), p = F(void 0), m = o("folder_id", "EQUALS", [r.folder?.id ?? 0]);
|
|
630
630
|
c?.changeParams({
|
|
631
631
|
project_id: r.projectId,
|
|
632
632
|
folder_id_depth: !0,
|
|
@@ -636,17 +636,43 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
636
636
|
s.value = e, a.value = e.id;
|
|
637
637
|
}, g = (e = !1) => {
|
|
638
638
|
f.value?.resetCache(e);
|
|
639
|
+
}, v = () => {
|
|
640
|
+
r.groups && (p.value = We(r.groups, r.on, r.folder));
|
|
641
|
+
}, y = () => {
|
|
642
|
+
h(r.canSelectAll ? q() : G);
|
|
643
|
+
}, b = async () => {
|
|
644
|
+
if (r.groups) {
|
|
645
|
+
let e = p.value?.find((e) => e.id === a.value);
|
|
646
|
+
if (!e && r.canSelectAll && (e = q()), e) h(e);
|
|
647
|
+
else {
|
|
648
|
+
let e = p.value?.[0];
|
|
649
|
+
e && !a.value ? h(e) : h(G);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
if (r.client && !r.groups && (a.value || a.value === 0 && !r.canSelectAll)) {
|
|
653
|
+
let e = Ge(r.client, r.service).changeParams({
|
|
654
|
+
project_id: r.projectId,
|
|
655
|
+
id: a.value,
|
|
656
|
+
filters: [m]
|
|
657
|
+
});
|
|
658
|
+
e?.setOptions({ checkFingerprint: "TopGroupSelectorFindGroup:" + r.projectId });
|
|
659
|
+
let t = await e.call();
|
|
660
|
+
if (!t.errors?.length && !t.result) return;
|
|
661
|
+
!t.errors && t.result[0] ? h(t.result[0]) : y();
|
|
662
|
+
}
|
|
663
|
+
}, C = async () => {
|
|
664
|
+
g(!0), v(), await b();
|
|
639
665
|
};
|
|
640
|
-
|
|
666
|
+
Be({
|
|
641
667
|
projectId: () => r.projectId,
|
|
642
668
|
folderId: () => r.folder?.id,
|
|
643
669
|
canSelectAll: () => r.canSelectAll
|
|
644
670
|
}, (e) => {
|
|
645
|
-
if (e.projectId && (c?.changeParams({ project_id: r.projectId }), c?.setOptions({ checkFingerprint: "TopGroupSelectorGroups:" + r.projectId })), e.folderId && (m.values = [r.folder?.id ?? 0],
|
|
671
|
+
if (e.projectId && (c?.changeParams({ project_id: r.projectId }), c?.setOptions({ checkFingerprint: "TopGroupSelectorGroups:" + r.projectId })), e.folderId && (m.values = [r.folder?.id ?? 0], v()), g(), (e.folderId?.old !== void 0 || e.canSelectAll?.old !== void 0) && a.value !== null) {
|
|
646
672
|
let e;
|
|
647
|
-
r.autoselect === "first" && (e = p.value?.[0], r.canSelectAll && (e =
|
|
673
|
+
r.autoselect === "first" && (e = p.value?.[0], r.canSelectAll && (e = oe(q()))), (r.autoselect === "placeholder" || !e) && (e = Ue()), h(e);
|
|
648
674
|
}
|
|
649
|
-
}, { immediate: !0 }),
|
|
675
|
+
}, { immediate: !0 }), Be({
|
|
650
676
|
modelGroup: s,
|
|
651
677
|
modelGroupId: a
|
|
652
678
|
}, async (e) => {
|
|
@@ -655,35 +681,15 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
655
681
|
a.value = s.value.id;
|
|
656
682
|
return;
|
|
657
683
|
}
|
|
658
|
-
|
|
659
|
-
if (r.groups) {
|
|
660
|
-
let e = p.value?.find((e) => e.id === a.value);
|
|
661
|
-
if (!e && r.canSelectAll && (e = K()), e) h(e);
|
|
662
|
-
else {
|
|
663
|
-
let e = p.value?.[0];
|
|
664
|
-
e && !a.value ? h(e) : h(W);
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
if (r.client && !r.groups && (a.value || a.value === 0 && !r.canSelectAll)) {
|
|
668
|
-
let e = Ke(r.client, r.service).changeParams({
|
|
669
|
-
project_id: r.projectId,
|
|
670
|
-
id: a.value,
|
|
671
|
-
filters: [m]
|
|
672
|
-
});
|
|
673
|
-
e?.setOptions({ checkFingerprint: "TopGroupSelectorFindGroup:" + r.projectId });
|
|
674
|
-
let t = await e.call();
|
|
675
|
-
if (!t.errors?.length && !t.result) return;
|
|
676
|
-
!t.errors && t.result[0] ? h(t.result[0]) : h(W);
|
|
677
|
-
}
|
|
678
|
-
}
|
|
684
|
+
r.canAdd && a.value === null || await b();
|
|
679
685
|
}
|
|
680
686
|
}, { immediate: !0 });
|
|
681
|
-
let
|
|
687
|
+
let O = async (e) => {
|
|
682
688
|
if (r.canAdd !== "api" || !l) return;
|
|
683
689
|
let t = s.value, n = await l.changeParams({
|
|
684
690
|
project_id: r.projectId,
|
|
685
691
|
names: [e.name],
|
|
686
|
-
to_id: r.folder?.id ??
|
|
692
|
+
to_id: r.folder?.id ?? W.id,
|
|
687
693
|
to_type: "in_folder_last"
|
|
688
694
|
}).call();
|
|
689
695
|
if (n.result) {
|
|
@@ -691,7 +697,7 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
691
697
|
h(e), i("addGroup", e);
|
|
692
698
|
} else h(t);
|
|
693
699
|
f.value?.resetCache(!0);
|
|
694
|
-
},
|
|
700
|
+
}, A = async (e, t) => {
|
|
695
701
|
d && ((await d.changeParams({
|
|
696
702
|
project_id: r.projectId,
|
|
697
703
|
id: e.id,
|
|
@@ -703,13 +709,13 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
703
709
|
...e,
|
|
704
710
|
name: t
|
|
705
711
|
}), f.value?.updateItemById(e.id, { name: t })));
|
|
706
|
-
},
|
|
712
|
+
}, j = async (e) => {
|
|
707
713
|
u && ((await u.changeParams({
|
|
708
714
|
project_id: r.projectId,
|
|
709
715
|
id: e.id
|
|
710
|
-
}).call()).errors || (s.value.id === e.id &&
|
|
716
|
+
}).call()).errors || (s.value.id === e.id && y(), i("delGroup", e), f.value?.deleteItemById(e.id)));
|
|
711
717
|
};
|
|
712
|
-
return t({
|
|
718
|
+
return t({ reload: C }), (t, n) => (P(), w(x, {
|
|
713
719
|
ref_key: "refSelector",
|
|
714
720
|
ref: f,
|
|
715
721
|
class: "top-groupSelector_group",
|
|
@@ -718,37 +724,37 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
718
724
|
items: p.value ?? e.groups,
|
|
719
725
|
searchType: "inline",
|
|
720
726
|
icon: e.addIcon ? "" : void 0,
|
|
721
|
-
api: e.groups ? void 0 :
|
|
722
|
-
apiSetSearchParams: (...e) =>
|
|
727
|
+
api: e.groups ? void 0 : R(c),
|
|
728
|
+
apiSetSearchParams: (...e) => R(te)(...e, "name"),
|
|
723
729
|
appendSearchToResult: !!e.canAdd,
|
|
724
|
-
useAllItem: e.canSelectAll ?
|
|
730
|
+
useAllItem: e.canSelectAll ? R(q)().name : !1,
|
|
725
731
|
addChanger: e.addChanger,
|
|
726
732
|
useCache: "",
|
|
727
|
-
onAppendItem:
|
|
733
|
+
onAppendItem: O
|
|
728
734
|
}, ne({
|
|
729
|
-
item:
|
|
730
|
-
n.id ===
|
|
735
|
+
item: V(({ item: n }) => [D("div", Ye, [
|
|
736
|
+
n.id === R(null) ? (P(), E("div", Xe, L(t.$i18n.Common.Add) + ": ", 1)) : T("", !0),
|
|
731
737
|
D("span", {
|
|
732
738
|
class: "top-groupSelector_groupItemName top-ellipsis1",
|
|
733
739
|
innerHTML: n.name
|
|
734
|
-
}, null, 8,
|
|
735
|
-
n.folder_path && e.showPath ? (
|
|
740
|
+
}, null, 8, Ze),
|
|
741
|
+
n.folder_path && e.showPath ? (P(), E("span", {
|
|
736
742
|
key: 1,
|
|
737
743
|
class: "top-groupSelector_groupItemFolderPath top-ellipsis1",
|
|
738
744
|
innerHTML: n.folder_path
|
|
739
|
-
}, null, 8,
|
|
745
|
+
}, null, 8, Qe)) : T("", !0)
|
|
740
746
|
])]),
|
|
741
747
|
_: 2
|
|
742
748
|
}, [e.canEditAndDel && e.client ? {
|
|
743
749
|
name: "actions",
|
|
744
|
-
fn:
|
|
750
|
+
fn: V(({ item: r }) => [r.id ? (P(), E(S, { key: 0 }, [k(_, {
|
|
745
751
|
submitText: t.$i18n.Common.Save,
|
|
746
752
|
defaultValue: r.name,
|
|
747
753
|
inputProps: { addCleaner: !1 },
|
|
748
|
-
onSubmit: (e) =>
|
|
754
|
+
onSubmit: (e) => A(r, e)
|
|
749
755
|
}, {
|
|
750
|
-
opener:
|
|
751
|
-
default:
|
|
756
|
+
opener: V(() => [...n[1] ||= [D("div", { "data-top-icon": "" }, null, -1)]]),
|
|
757
|
+
default: V(() => [...n[2] ||= []]),
|
|
752
758
|
_: 1
|
|
753
759
|
}, 8, [
|
|
754
760
|
"submitText",
|
|
@@ -757,10 +763,10 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
757
763
|
]), k(ee, {
|
|
758
764
|
isWarning: "",
|
|
759
765
|
submitText: t.$i18n.Common.Delete,
|
|
760
|
-
onSubmit: (e) =>
|
|
766
|
+
onSubmit: (e) => j(r)
|
|
761
767
|
}, {
|
|
762
|
-
opener:
|
|
763
|
-
default:
|
|
768
|
+
opener: V(() => [...n[3] ||= [D("div", { "data-top-icon": "" }, null, -1)]]),
|
|
769
|
+
default: V(() => [D("span", { innerHTML: e.service === "keywords_2" ? t.$i18n.Keywords.Delete_group_warning : t.$i18n["Ai.Tracker"].Delete_group_warning }, null, 8, $e)]),
|
|
764
770
|
_: 1
|
|
765
771
|
}, 8, ["submitText", "onSubmit"])], 64)) : T("", !0)]),
|
|
766
772
|
key: "0"
|
|
@@ -775,9 +781,9 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
775
781
|
"addChanger"
|
|
776
782
|
]));
|
|
777
783
|
}
|
|
778
|
-
}),
|
|
784
|
+
}), tt = { class: "top-groupSelector" }, nt = /* @__PURE__ */ A({
|
|
779
785
|
__name: "groupSelector",
|
|
780
|
-
props: /* @__PURE__ */
|
|
786
|
+
props: /* @__PURE__ */ M({
|
|
781
787
|
folderId: {},
|
|
782
788
|
folder: {},
|
|
783
789
|
groupId: {},
|
|
@@ -821,20 +827,20 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
821
827
|
folderModifiers: {},
|
|
822
828
|
groupId: { required: !0 },
|
|
823
829
|
groupIdModifiers: {},
|
|
824
|
-
group: { default:
|
|
830
|
+
group: { default: G },
|
|
825
831
|
groupModifiers: {}
|
|
826
832
|
}),
|
|
827
|
-
emits: /* @__PURE__ */
|
|
833
|
+
emits: /* @__PURE__ */ M(["update:groups"], [
|
|
828
834
|
"update:folderId",
|
|
829
835
|
"update:folder",
|
|
830
836
|
"update:groupId",
|
|
831
837
|
"update:group"
|
|
832
838
|
]),
|
|
833
839
|
setup(e, { expose: t, emit: n }) {
|
|
834
|
-
let r = e, i =
|
|
835
|
-
o.value =
|
|
840
|
+
let r = e, i = F(null), a = z(e, "folderId"), o = z(e, "folder"), s = z(e, "groupId"), c = z(e, "group"), l = n;
|
|
841
|
+
o.value = Re(r.folders ?? { root: [W] }, r.canSelectAllGroups).get(a.value);
|
|
836
842
|
let u = r.groups?.find((e) => e.id === s.value);
|
|
837
|
-
s.value || (u = r.groups?.[0]), r.canSelectAllGroups && !u && (u =
|
|
843
|
+
s.value || (u = r.groups?.[0]), r.canSelectAllGroups && !u && (u = q()), (r.autoselect === "placeholder" || !u) && (u = Ue()), u ??= G, c.value = u;
|
|
838
844
|
let d = (e) => {
|
|
839
845
|
let t;
|
|
840
846
|
r.groups && e && (t = [...r.groups, e]), l("update:groups", t);
|
|
@@ -851,9 +857,9 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
851
857
|
}
|
|
852
858
|
l("update:groups", r.groups.filter((t) => t.id !== e.id));
|
|
853
859
|
};
|
|
854
|
-
return t({
|
|
855
|
-
i.value?.
|
|
856
|
-
} }), (t, n) => (
|
|
860
|
+
return t({ reloadGroups: async () => {
|
|
861
|
+
await i.value?.reload();
|
|
862
|
+
} }), (t, n) => (P(), E("div", tt, [e.showFolders ? (P(), w(He, {
|
|
857
863
|
key: 0,
|
|
858
864
|
folderId: a.value,
|
|
859
865
|
"onUpdate:folderId": n[0] ||= (e) => a.value = e,
|
|
@@ -876,7 +882,7 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
876
882
|
"addIcon",
|
|
877
883
|
"client",
|
|
878
884
|
"service"
|
|
879
|
-
])) : T("", !0), e.showGroups ? (
|
|
885
|
+
])) : T("", !0), e.showGroups ? (P(), w(et, {
|
|
880
886
|
key: 1,
|
|
881
887
|
ref_key: "componentGroupsRef",
|
|
882
888
|
ref: i,
|
|
@@ -918,39 +924,39 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
918
924
|
"service"
|
|
919
925
|
])) : T("", !0)]));
|
|
920
926
|
}
|
|
921
|
-
}),
|
|
927
|
+
}), rt = (e) => ({
|
|
922
928
|
id: null,
|
|
923
929
|
name: e,
|
|
924
930
|
listItemProps: { type: "title" }
|
|
925
|
-
}),
|
|
931
|
+
}), it = {
|
|
926
932
|
scheduledUpdate: !1,
|
|
927
933
|
manualUpdate: !1,
|
|
928
934
|
guestProjects: !1
|
|
929
|
-
},
|
|
935
|
+
}, at = (t, n) => {
|
|
930
936
|
let r = [], i = {
|
|
931
|
-
scheduledUpdate:
|
|
932
|
-
manualUpdate:
|
|
933
|
-
guestProjects:
|
|
937
|
+
scheduledUpdate: rt(e().Projects.Scheduled_update),
|
|
938
|
+
manualUpdate: rt(e().Projects.Manual_update),
|
|
939
|
+
guestProjects: rt(e().Projects.Guest_projects)
|
|
934
940
|
}, a = n ? {
|
|
935
941
|
scheduledUpdate: !1,
|
|
936
942
|
manualUpdate: !1,
|
|
937
943
|
guestProjects: !1
|
|
938
|
-
} :
|
|
944
|
+
} : it;
|
|
939
945
|
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);
|
|
940
946
|
return r;
|
|
941
|
-
},
|
|
947
|
+
}, ot = (e) => e.map((e) => ({
|
|
942
948
|
...e,
|
|
943
949
|
listItemProps: { attrs: { title: e.name } }
|
|
944
|
-
})),
|
|
950
|
+
})), st = (e, t, n) => !e || e.length === 0 ? [] : (t && Object.keys(it).forEach((e) => it[e] = !1), at(ot(e), n)), ct = (e) => {
|
|
945
951
|
e = e.replace(/#.*/, "");
|
|
946
952
|
let t = location.hash;
|
|
947
953
|
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;
|
|
948
|
-
},
|
|
954
|
+
}, lt = (e, t) => {
|
|
949
955
|
t && t.target instanceof HTMLElement && c.close(t.target.closest(".top-popup-wrapper"));
|
|
950
|
-
let n =
|
|
956
|
+
let n = ct(e);
|
|
951
957
|
location.href = n;
|
|
952
|
-
},
|
|
953
|
-
let t =
|
|
958
|
+
}, ut = (e) => {
|
|
959
|
+
let t = dt(), n = location.pathname.split("/"), r = "project/dynamics/", i = "";
|
|
954
960
|
return n[1] == "project" && (r = n[1] + "/" + n[2] + "/"), n[2] == "settings" && (i = location.hash), [
|
|
955
961
|
"watcher",
|
|
956
962
|
"indexing",
|
|
@@ -959,15 +965,15 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
959
965
|
"direct",
|
|
960
966
|
"adwords"
|
|
961
967
|
].includes(n[4]) && (i = n[4] + "/"), "https://" + t + "/" + r + e + "/" + i;
|
|
962
|
-
},
|
|
968
|
+
}, dt = () => window.page?.subdomain ? window.location.host.replace(window.page?.subdomain + ".", "") : window.location.host, ft = (e) => {
|
|
963
969
|
let t = e.startsWith("http") ? e : "http://" + e;
|
|
964
970
|
return t = t.replace(/"/g, "%22"), t;
|
|
965
|
-
},
|
|
971
|
+
}, pt = (e, t) => {
|
|
966
972
|
let n = e.params.filters ?? [];
|
|
967
973
|
n = n.filter((e) => e.name !== "GEN_SEARCH_STRING()");
|
|
968
974
|
let r = h(t), i = t.replace(/([[^$.|?*+()])/g, "\\$1"), a = r.replace(/([[^$.|?*+()])/g, "\\$1");
|
|
969
975
|
t && n.push(o("GEN_SEARCH_STRING()", "REGEXP", [`(${i}|${a})`])), e.changeParams({ filters: n });
|
|
970
|
-
},
|
|
976
|
+
}, mt = (e, t, n) => {
|
|
971
977
|
let r = e.gen("/get/projects_2/projects/", [
|
|
972
978
|
"id",
|
|
973
979
|
"user_id",
|
|
@@ -987,14 +993,14 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
987
993
|
]
|
|
988
994
|
}, r.options.onApiLoaded = (e, t, n) => {
|
|
989
995
|
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;
|
|
990
|
-
e.result =
|
|
996
|
+
e.result = st(e.result, r, i), n?.(e, t);
|
|
991
997
|
}, r;
|
|
992
|
-
},
|
|
998
|
+
}, ht = (e) => e.gen("/add/projects_2/projects/"), gt = { class: "top-projectSelectorSubmenu_item" }, _t = [
|
|
993
999
|
"href",
|
|
994
1000
|
"title",
|
|
995
1001
|
"data-top-icon",
|
|
996
1002
|
"data-right"
|
|
997
|
-
],
|
|
1003
|
+
], vt = { class: "top-projectSelectorSubmenu_item" }, yt = ["href"], bt = /* @__PURE__ */ A({
|
|
998
1004
|
__name: "submenu",
|
|
999
1005
|
props: {
|
|
1000
1006
|
id: {},
|
|
@@ -1002,7 +1008,7 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1002
1008
|
url: {}
|
|
1003
1009
|
},
|
|
1004
1010
|
setup(t) {
|
|
1005
|
-
let n = t, r = e(), i =
|
|
1011
|
+
let n = t, r = e(), i = dt(), a = [
|
|
1006
1012
|
{
|
|
1007
1013
|
href: `https://${i}/project/keywords/${n.id}/`,
|
|
1008
1014
|
title: r.Common.Menu_phrases,
|
|
@@ -1083,53 +1089,53 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1083
1089
|
return n.right.includes("0") ? a.filter((e) => n.right[e.right] === "1") : a;
|
|
1084
1090
|
});
|
|
1085
1091
|
return (e, n) => {
|
|
1086
|
-
let r =
|
|
1087
|
-
return
|
|
1092
|
+
let r = ce("TopButton");
|
|
1093
|
+
return P(), w(R(y), {
|
|
1088
1094
|
class: "top-projectSelectorSubmenu",
|
|
1089
1095
|
notch: !1,
|
|
1090
1096
|
pos: "2"
|
|
1091
1097
|
}, {
|
|
1092
|
-
opener:
|
|
1098
|
+
opener: V(() => [k(r, {
|
|
1093
1099
|
class: "top-projectSelectorSubmenu_opener",
|
|
1094
1100
|
"data-top-icon": "",
|
|
1095
1101
|
color: "theme"
|
|
1096
1102
|
})]),
|
|
1097
|
-
contentList:
|
|
1103
|
+
contentList: V(() => [(P(!0), E(S, null, I(o.value, (e) => (P(), E("li", gt, [D("a", {
|
|
1098
1104
|
href: e.href,
|
|
1099
1105
|
title: e.title,
|
|
1100
1106
|
"data-top-icon": e.icon,
|
|
1101
1107
|
"data-right": e.right
|
|
1102
|
-
}, null, 8,
|
|
1108
|
+
}, null, 8, _t)]))), 256)), D("li", vt, [D("a", {
|
|
1103
1109
|
href: t.url,
|
|
1104
1110
|
"data-top-icon": "",
|
|
1105
1111
|
target: "_blank"
|
|
1106
|
-
}, null, 8,
|
|
1112
|
+
}, null, 8, yt)])]),
|
|
1107
1113
|
_: 1
|
|
1108
1114
|
});
|
|
1109
1115
|
};
|
|
1110
1116
|
}
|
|
1111
|
-
}),
|
|
1112
|
-
localStorage.setItem(
|
|
1117
|
+
}), J = "ui_project_selector_total:", xt = 1440 * 60 * 1e3, Y = de(), St = F(0), X = F(null), Ct = (e, t) => {
|
|
1118
|
+
localStorage.setItem(J + e, JSON.stringify({
|
|
1113
1119
|
projectsTotal: t,
|
|
1114
|
-
expiresAt: Date.now() +
|
|
1120
|
+
expiresAt: Date.now() + xt
|
|
1115
1121
|
}));
|
|
1116
|
-
},
|
|
1117
|
-
let t = localStorage.getItem(
|
|
1122
|
+
}, wt = (e) => {
|
|
1123
|
+
let t = localStorage.getItem(J + e);
|
|
1118
1124
|
if (!t) return;
|
|
1119
1125
|
let { projectsTotal: n, expiresAt: r } = JSON.parse(t);
|
|
1120
1126
|
if (Date.now() > r) {
|
|
1121
|
-
localStorage.removeItem(
|
|
1127
|
+
localStorage.removeItem(J + e);
|
|
1122
1128
|
return;
|
|
1123
1129
|
}
|
|
1124
1130
|
return n;
|
|
1125
|
-
},
|
|
1126
|
-
|
|
1127
|
-
},
|
|
1131
|
+
}, Tt = (e, t = !0) => {
|
|
1132
|
+
Y.value = void 0, localStorage.removeItem(J + e), t && St.value++;
|
|
1133
|
+
}, Et = { class: "top-projectSelector_item" }, Dt = { class: "top-projectSelector_itemText" }, Ot = { class: "top-comment" }, kt = {
|
|
1128
1134
|
key: 0,
|
|
1129
1135
|
class: "top-comment"
|
|
1130
|
-
},
|
|
1136
|
+
}, At = ["href", "onClick"], jt = 1e3, Mt = /* @__PURE__ */ A({
|
|
1131
1137
|
__name: "projectSelector",
|
|
1132
|
-
props: /* @__PURE__ */
|
|
1138
|
+
props: /* @__PURE__ */ M({
|
|
1133
1139
|
modelValue: {},
|
|
1134
1140
|
client: {},
|
|
1135
1141
|
addLinksToProjects: {
|
|
@@ -1152,33 +1158,33 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1152
1158
|
setup(t) {
|
|
1153
1159
|
let n = e();
|
|
1154
1160
|
if (!window.mo?.user?.id) throw Error("TopProjectSelector: не удалось определить userId. Компонент требует авторизованного пользователя (см. window.mo.user.id)");
|
|
1155
|
-
let r = window.mo.user.id, i = t, a =
|
|
1156
|
-
if (!(!c.value && c.value !== 0)) return c.value <
|
|
1161
|
+
let r = window.mo.user.id, i = t, a = z(t, "modelValue"), o = mt(i.client, r), s = ht(i.client), c = F(wt(r)), d = F(null), f = C(() => i.placeholder ?? n.Projects.Select_project), p = C(() => !Y.value || !i.excludeProjectId ? Y.value : Y.value.filter((e) => e.id !== i.excludeProjectId)), m = C(() => {
|
|
1162
|
+
if (!(!c.value && c.value !== 0)) return c.value < jt ? "static" : "api";
|
|
1157
1163
|
});
|
|
1158
|
-
|
|
1164
|
+
B(St, () => {
|
|
1159
1165
|
v();
|
|
1160
|
-
}),
|
|
1161
|
-
!a.value.id || !i.addLinksToProjects || ut(
|
|
1166
|
+
}), B(a, () => {
|
|
1167
|
+
!a.value.id || !i.addLinksToProjects || lt(ut(a.value.id));
|
|
1162
1168
|
});
|
|
1163
1169
|
let h = async () => {
|
|
1164
|
-
|
|
1165
|
-
let e = await
|
|
1170
|
+
X.value ||= mt(i.client, r, { limit: jt }).call();
|
|
1171
|
+
let e = await X.value;
|
|
1166
1172
|
if (e.errors) {
|
|
1167
|
-
|
|
1173
|
+
X.value = null;
|
|
1168
1174
|
return;
|
|
1169
1175
|
}
|
|
1170
|
-
return
|
|
1176
|
+
return X.value = null, e;
|
|
1171
1177
|
}, g = async () => {
|
|
1172
1178
|
if (c.value) return;
|
|
1173
1179
|
let e = await h();
|
|
1174
|
-
e && (c.value = e.total, m.value === "static" && !
|
|
1180
|
+
e && (c.value = e.total, m.value === "static" && !Y.value && (Y.value = e.result), c.value && Ct(r, c.value));
|
|
1175
1181
|
}, _ = async (e) => {
|
|
1176
1182
|
let t = await s.changeParams({
|
|
1177
1183
|
url: e.name,
|
|
1178
1184
|
name: e.name
|
|
1179
1185
|
}).call();
|
|
1180
1186
|
if (!t.errors) {
|
|
1181
|
-
if (
|
|
1187
|
+
if (Y.value && m.value === "static") {
|
|
1182
1188
|
let n = {
|
|
1183
1189
|
id: Number(t.result),
|
|
1184
1190
|
user_id: r,
|
|
@@ -1187,27 +1193,27 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1187
1193
|
on: 0,
|
|
1188
1194
|
right: "11111111111111111111",
|
|
1189
1195
|
listItemProps: { attrs: { title: e.name } }
|
|
1190
|
-
}, i =
|
|
1191
|
-
|
|
1192
|
-
...
|
|
1196
|
+
}, i = Y.value.findIndex((e) => e.on === 0);
|
|
1197
|
+
Y.value = [
|
|
1198
|
+
...Y.value.slice(0, i),
|
|
1193
1199
|
n,
|
|
1194
|
-
...
|
|
1195
|
-
], c.value && (c.value += 1,
|
|
1200
|
+
...Y.value.slice(i)
|
|
1201
|
+
], c.value && (c.value += 1, Ct(r, c.value));
|
|
1196
1202
|
}
|
|
1197
|
-
m.value === "api" &&
|
|
1203
|
+
m.value === "api" && Tt(r);
|
|
1198
1204
|
}
|
|
1199
1205
|
}, v = () => {
|
|
1200
1206
|
m.value === "api" && d.value?.resetCache(!0);
|
|
1201
1207
|
}, ee = async () => {
|
|
1202
|
-
if (
|
|
1208
|
+
if (Y.value || m.value !== "static") return;
|
|
1203
1209
|
let e = await h();
|
|
1204
|
-
e && (
|
|
1210
|
+
e && (Y.value = e.result);
|
|
1205
1211
|
};
|
|
1206
|
-
return
|
|
1212
|
+
return ae(async () => {
|
|
1207
1213
|
await g();
|
|
1208
1214
|
}), (e, n) => {
|
|
1209
|
-
let r =
|
|
1210
|
-
return
|
|
1215
|
+
let r = ce("TopButton");
|
|
1216
|
+
return P(), w(x, {
|
|
1211
1217
|
ref_key: "refSelector",
|
|
1212
1218
|
ref: d,
|
|
1213
1219
|
class: "top-projectSelector",
|
|
@@ -1223,38 +1229,38 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1223
1229
|
],
|
|
1224
1230
|
placeholder: f.value,
|
|
1225
1231
|
hasCloserBtn: "",
|
|
1226
|
-
api: m.value === "api" ?
|
|
1227
|
-
apiSetSearchParams: m.value === "api" ? (...e) =>
|
|
1232
|
+
api: m.value === "api" ? R(o) : void 0,
|
|
1233
|
+
apiSetSearchParams: m.value === "api" ? (...e) => R(pt)(...e) : void 0,
|
|
1228
1234
|
useCache: "",
|
|
1229
1235
|
appendSearchToResult: "",
|
|
1230
1236
|
appendSearchAllowDuplicate: "",
|
|
1231
|
-
appendSearchToResultCond:
|
|
1237
|
+
appendSearchToResultCond: R(l),
|
|
1232
1238
|
appendWithoutSelect: "",
|
|
1233
1239
|
buttonProps: t.buttonProps,
|
|
1234
1240
|
openerShortcut: t.openerShortcut,
|
|
1235
1241
|
onAppendItem: _,
|
|
1236
1242
|
onOpen: ee
|
|
1237
1243
|
}, {
|
|
1238
|
-
item:
|
|
1239
|
-
t.addLinksToProjects ? (
|
|
1244
|
+
item: V(({ item: i }) => [D("div", Et, [D("div", Dt, [i.id ? (P(), E(S, { key: 0 }, [O(L(R(u)(i.name, 20)) + " ", 1), D("span", Ot, " id " + L(i.id), 1)], 64)) : (P(), E(S, { key: 1 }, [i.listItemProps?.type ? T("", !0) : (P(), E("div", kt, L(e.$i18n.Projects.Add_project) + ": ", 1)), O(" " + L(i.name), 1)], 64))]), i.id ? (P(), E(S, { key: 0 }, [
|
|
1245
|
+
t.addLinksToProjects ? (P(), E("a", {
|
|
1240
1246
|
key: 0,
|
|
1241
1247
|
class: "top-projectSelector_itemLink",
|
|
1242
|
-
href:
|
|
1243
|
-
onClick:
|
|
1244
|
-
}, null, 8,
|
|
1245
|
-
e.$core.state.isMobile ? T("", !0) : (
|
|
1248
|
+
href: R(ut)(i.id),
|
|
1249
|
+
onClick: H((e) => R(lt)(R(ut)(i.id), e), ["prevent", "stop"])
|
|
1250
|
+
}, null, 8, At)) : T("", !0),
|
|
1251
|
+
e.$core.state.isMobile ? T("", !0) : (P(), w(r, {
|
|
1246
1252
|
key: 1,
|
|
1247
1253
|
class: "top-projectSelector_itemExtLink",
|
|
1248
|
-
href:
|
|
1254
|
+
href: R(ft)(i.url),
|
|
1249
1255
|
"data-top-icon": "",
|
|
1250
1256
|
color: "theme",
|
|
1251
1257
|
target: "_blank",
|
|
1252
|
-
onClick: n[0] ||=
|
|
1258
|
+
onClick: n[0] ||= H(() => {}, ["stop"])
|
|
1253
1259
|
}, null, 8, ["href"])),
|
|
1254
|
-
k(
|
|
1260
|
+
k(bt, {
|
|
1255
1261
|
id: i.id,
|
|
1256
1262
|
right: i.right ?? void 0,
|
|
1257
|
-
url:
|
|
1263
|
+
url: R(ft)(i.url)
|
|
1258
1264
|
}, null, 8, [
|
|
1259
1265
|
"id",
|
|
1260
1266
|
"right",
|
|
@@ -1276,34 +1282,34 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1276
1282
|
]);
|
|
1277
1283
|
};
|
|
1278
1284
|
}
|
|
1279
|
-
}),
|
|
1280
|
-
e =
|
|
1285
|
+
}), Nt = (e) => "-" + e, Z = (e) => e[0] === "-" ? e.substring(1) : e, Q = (e, t) => {
|
|
1286
|
+
e = Z(e);
|
|
1281
1287
|
let n = t.find((t) => t.id === e);
|
|
1282
1288
|
if (n) return n;
|
|
1283
|
-
},
|
|
1289
|
+
}, Pt = (e, t, n) => {
|
|
1284
1290
|
t ||= { id: e.id }, t.id = e.id, t.pos ??= "3", t.notch ??= !0, t.posBy ??= "fixed";
|
|
1285
1291
|
let r = c.genElPopupOpener("div", t);
|
|
1286
1292
|
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) => {
|
|
1287
1293
|
t.preventDefault(), t.stopPropagation(), r.onclick = null;
|
|
1288
|
-
let i =
|
|
1294
|
+
let i = F(e.modelValue);
|
|
1289
1295
|
s(r, "topTagSelectorTarget", {
|
|
1290
1296
|
model: i,
|
|
1291
1297
|
mode: e.mode,
|
|
1292
1298
|
targetId: e.targetId,
|
|
1293
1299
|
filters: e.filters,
|
|
1294
1300
|
payload: e.payload
|
|
1295
|
-
}), delete r.dataset.topPopupDisabled,
|
|
1296
|
-
e.modelValue = i.value,
|
|
1301
|
+
}), delete r.dataset.topPopupDisabled, j(e.modelValue) || B(i, () => {
|
|
1302
|
+
e.modelValue = i.value, It(r, e, n);
|
|
1297
1303
|
}), r.click();
|
|
1298
|
-
},
|
|
1304
|
+
}, j(e.modelValue) ? B(e.modelValue, () => It(r, e, n)) : s(r, "topTagSelectorRender", (t) => {
|
|
1299
1305
|
e.modelValue = t;
|
|
1300
1306
|
let i = s(r, "topTagSelectorTarget");
|
|
1301
|
-
i && (i.model.value = t),
|
|
1302
|
-
}),
|
|
1303
|
-
},
|
|
1307
|
+
i && (i.model.value = t), It(r, e, n);
|
|
1308
|
+
}), It(r, e, n), r;
|
|
1309
|
+
}, Ft = (e, t) => {
|
|
1304
1310
|
s(e, "topTagSelectorRender")?.(t);
|
|
1305
|
-
},
|
|
1306
|
-
let i =
|
|
1311
|
+
}, It = (t, n, r) => {
|
|
1312
|
+
let i = R(n.modelValue);
|
|
1307
1313
|
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) {
|
|
1308
1314
|
t.innerHTML = `<div>${r}</div>`;
|
|
1309
1315
|
return;
|
|
@@ -1319,10 +1325,10 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1319
1325
|
}
|
|
1320
1326
|
i.forEach((e) => {
|
|
1321
1327
|
let r = Lt({
|
|
1322
|
-
id:
|
|
1323
|
-
colorId:
|
|
1324
|
-
name:
|
|
1325
|
-
state:
|
|
1328
|
+
id: Z(e),
|
|
1329
|
+
colorId: Q(e, n.tags)?.color_id ?? "",
|
|
1330
|
+
name: Q(e, n.tags)?.name ?? "",
|
|
1331
|
+
state: Z(e) === e ? "selected" : "excluded"
|
|
1326
1332
|
});
|
|
1327
1333
|
t.append(r);
|
|
1328
1334
|
});
|
|
@@ -1393,8 +1399,8 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1393
1399
|
state: {}
|
|
1394
1400
|
},
|
|
1395
1401
|
setup(e) {
|
|
1396
|
-
return (t, n) => (
|
|
1397
|
-
class:
|
|
1402
|
+
return (t, n) => (P(), E("div", {
|
|
1403
|
+
class: N({
|
|
1398
1404
|
"top-tagSelector_tagIcon": !0,
|
|
1399
1405
|
"top-tagSelector-active": !!e.state,
|
|
1400
1406
|
"top-tagSelector-excluded": e.state === "excluded"
|
|
@@ -1406,7 +1412,7 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1406
1412
|
}
|
|
1407
1413
|
}), Vt = ["contenteditable", "onKeydown"], Ht = /* @__PURE__ */ A({
|
|
1408
1414
|
__name: "tagPopupListItem",
|
|
1409
|
-
props: /* @__PURE__ */
|
|
1415
|
+
props: /* @__PURE__ */ M({
|
|
1410
1416
|
editable: { type: Boolean },
|
|
1411
1417
|
disabled: { type: Boolean },
|
|
1412
1418
|
canExclude: { type: Boolean },
|
|
@@ -1418,18 +1424,18 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1418
1424
|
name: { required: !0 },
|
|
1419
1425
|
nameModifiers: {}
|
|
1420
1426
|
}),
|
|
1421
|
-
emits: /* @__PURE__ */
|
|
1427
|
+
emits: /* @__PURE__ */ M([
|
|
1422
1428
|
"update:name",
|
|
1423
1429
|
"unselect",
|
|
1424
1430
|
"exclude",
|
|
1425
1431
|
"select"
|
|
1426
1432
|
], ["update:name"]),
|
|
1427
1433
|
setup(e, { emit: t }) {
|
|
1428
|
-
let n = e, r = t, i =
|
|
1434
|
+
let n = e, r = t, i = z(e, "name"), a = F(null), o = C(() => navigator.userAgent.indexOf("Firefox") == -1 ? {} : {
|
|
1429
1435
|
contenteditable: s.value,
|
|
1430
1436
|
onpaste: (e) => e.preventDefault()
|
|
1431
|
-
}), s =
|
|
1432
|
-
s.value = !0, await
|
|
1437
|
+
}), s = F(!1), c = async () => {
|
|
1438
|
+
s.value = !0, await ie(), a.value?.focus();
|
|
1433
1439
|
}, l = () => {
|
|
1434
1440
|
let e = a.value?.innerText;
|
|
1435
1441
|
if (!e) return u();
|
|
@@ -1441,8 +1447,8 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1441
1447
|
let t = "selected";
|
|
1442
1448
|
n.canExclude && (e.ctrlKey || e.metaKey) && (t = "excluded"), n.state == t && (t = ""), t === "" && r("unselect"), t === "selected" && r("select"), t === "excluded" && r("exclude");
|
|
1443
1449
|
};
|
|
1444
|
-
return (t, n) => (
|
|
1445
|
-
class:
|
|
1450
|
+
return (t, n) => (P(), w(v, {
|
|
1451
|
+
class: N({
|
|
1446
1452
|
"top-tagSelector_tagListItem": !0,
|
|
1447
1453
|
"top-tagSelector_tagListItem-inEdit": s.value,
|
|
1448
1454
|
"top-tagSelector_tagListItem-disabled": e.disabled,
|
|
@@ -1450,9 +1456,9 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1450
1456
|
"top-tagSelector-active": !!e.state,
|
|
1451
1457
|
"top-tagSelector-excluded": e.state === "excluded"
|
|
1452
1458
|
}),
|
|
1453
|
-
onClick:
|
|
1459
|
+
onClick: H(d, ["stop"])
|
|
1454
1460
|
}, {
|
|
1455
|
-
default:
|
|
1461
|
+
default: V(() => [
|
|
1456
1462
|
k(Bt, {
|
|
1457
1463
|
id: e.id,
|
|
1458
1464
|
name: i.value,
|
|
@@ -1464,18 +1470,18 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1464
1470
|
"colorId",
|
|
1465
1471
|
"state"
|
|
1466
1472
|
]),
|
|
1467
|
-
D("span",
|
|
1473
|
+
D("span", re({
|
|
1468
1474
|
ref_key: "elName",
|
|
1469
1475
|
ref: a,
|
|
1470
1476
|
class: "top-tagSelector_tagListItemName",
|
|
1471
1477
|
contenteditable: s.value ? "plaintext-only" : !1
|
|
1472
|
-
}, o.value, { onKeydown: [
|
|
1473
|
-
e.editable ? (
|
|
1478
|
+
}, o.value, { onKeydown: [me(H(l, ["stop"]), ["enter"]), me(H(u, ["stop"]), ["esc"])] }), L(i.value), 17, Vt),
|
|
1479
|
+
e.editable ? (P(), E(S, { key: 0 }, [s.value ? (P(), E("span", {
|
|
1474
1480
|
key: 1,
|
|
1475
1481
|
"data-top-icon": "",
|
|
1476
1482
|
class: "top-tagSelector_edit",
|
|
1477
|
-
onClick:
|
|
1478
|
-
})) : (
|
|
1483
|
+
onClick: H(l, ["stop"])
|
|
1484
|
+
})) : (P(), E("span", {
|
|
1479
1485
|
key: 0,
|
|
1480
1486
|
"data-top-icon": "",
|
|
1481
1487
|
class: "top-tagSelector_edit",
|
|
@@ -1488,7 +1494,7 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1488
1494
|
}), Ut = { key: 1 }, Wt = /* @__PURE__ */ A({
|
|
1489
1495
|
inheritAttrs: !1,
|
|
1490
1496
|
__name: "popupOpener",
|
|
1491
|
-
props: /* @__PURE__ */
|
|
1497
|
+
props: /* @__PURE__ */ M({
|
|
1492
1498
|
modelValue: {},
|
|
1493
1499
|
id: {},
|
|
1494
1500
|
tags: {},
|
|
@@ -1504,7 +1510,7 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1504
1510
|
}),
|
|
1505
1511
|
emits: ["update:modelValue"],
|
|
1506
1512
|
setup(e) {
|
|
1507
|
-
let t = e, n =
|
|
1513
|
+
let t = e, n = z(e, "modelValue"), i = t.useTopButton ? r : "div", a = t.useTopButton ? "html" : "default", o = {
|
|
1508
1514
|
model: n,
|
|
1509
1515
|
mode: t.mode,
|
|
1510
1516
|
targetId: t.targetId,
|
|
@@ -1512,9 +1518,9 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1512
1518
|
payload: t.payload
|
|
1513
1519
|
};
|
|
1514
1520
|
return (r, s) => {
|
|
1515
|
-
let c =
|
|
1516
|
-
return
|
|
1517
|
-
default:
|
|
1521
|
+
let c = le("top-data");
|
|
1522
|
+
return P(), w(g, { id: e.id }, {
|
|
1523
|
+
default: V(() => [pe((P(), w(ue(R(i)), re({
|
|
1518
1524
|
class: {
|
|
1519
1525
|
"top-tagSelector": !0,
|
|
1520
1526
|
"top-tagSelector-useTopButton": t.useTopButton,
|
|
@@ -1529,17 +1535,17 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1529
1535
|
color: "theme",
|
|
1530
1536
|
styling: e.styling
|
|
1531
1537
|
}, r.$attrs), {
|
|
1532
|
-
[
|
|
1538
|
+
[R(a)]: V(() => [!n.value.length && e.mode === "filter" ? (P(), w(Bt, {
|
|
1533
1539
|
key: 0,
|
|
1534
1540
|
id: "all",
|
|
1535
1541
|
colorId: "",
|
|
1536
1542
|
name: r.$i18n.Common.All_tags ?? "",
|
|
1537
1543
|
state: ""
|
|
1538
|
-
}, null, 8, ["name"])) : T("", !0), e.mode === "setter" && e.filters ? (
|
|
1539
|
-
id:
|
|
1540
|
-
colorId:
|
|
1541
|
-
name:
|
|
1542
|
-
state:
|
|
1544
|
+
}, null, 8, ["name"])) : T("", !0), e.mode === "setter" && e.filters ? (P(), E("div", Ut, [se(r.$slots, "default")])) : (P(!0), E(S, { key: 2 }, I(n.value, (t) => (P(), w(Bt, {
|
|
1545
|
+
id: R(Z)(t),
|
|
1546
|
+
colorId: R(Q)(t, e.tags)?.color_id ?? "",
|
|
1547
|
+
name: R(Q)(t, e.tags)?.name ?? "",
|
|
1548
|
+
state: R(Z)(t) === t ? "selected" : "excluded"
|
|
1543
1549
|
}, null, 8, [
|
|
1544
1550
|
"id",
|
|
1545
1551
|
"colorId",
|
|
@@ -1558,7 +1564,7 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1558
1564
|
}
|
|
1559
1565
|
}), Gt = /* @__PURE__ */ A({
|
|
1560
1566
|
__name: "tagSelector",
|
|
1561
|
-
props: /* @__PURE__ */
|
|
1567
|
+
props: /* @__PURE__ */ M({
|
|
1562
1568
|
modelValue: {},
|
|
1563
1569
|
tags: {},
|
|
1564
1570
|
tagsEditable: { type: Boolean },
|
|
@@ -1579,20 +1585,20 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1579
1585
|
}, {
|
|
1580
1586
|
modelValue: { required: !0 },
|
|
1581
1587
|
modelModifiers: {},
|
|
1582
|
-
tags: { default:
|
|
1588
|
+
tags: { default: oe(Rt) },
|
|
1583
1589
|
tagsModifiers: {}
|
|
1584
1590
|
}),
|
|
1585
|
-
emits: /* @__PURE__ */
|
|
1591
|
+
emits: /* @__PURE__ */ M([
|
|
1586
1592
|
"selector",
|
|
1587
1593
|
"setter",
|
|
1588
1594
|
"tagsChanged"
|
|
1589
1595
|
], ["update:modelValue", "update:tags"]),
|
|
1590
1596
|
setup(a, { emit: o }) {
|
|
1591
|
-
let c = e(), l = a, u =
|
|
1597
|
+
let c = e(), l = a, u = z(a, "modelValue"), d = z(a, "tags"), f = o, p = n((e, t) => {
|
|
1592
1598
|
f(e, t);
|
|
1593
1599
|
}, l.emitDelay);
|
|
1594
1600
|
l.singleMode && !u.value.length && (u.value = [d.value[0].id]);
|
|
1595
|
-
let m = l.id ?? "top-popup-id-" + Math.random(), h =
|
|
1601
|
+
let m = l.id ?? "top-popup-id-" + Math.random(), h = F("add"), g = () => {
|
|
1596
1602
|
let e = " " + c.Common.Tags?.toLowerCase(), t = /* @__PURE__ */ new Map();
|
|
1597
1603
|
return t.set("add", {
|
|
1598
1604
|
value: "add",
|
|
@@ -1604,14 +1610,14 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1604
1610
|
value: "delete",
|
|
1605
1611
|
title: c.Common.Delete + e
|
|
1606
1612
|
}), t;
|
|
1607
|
-
}, _ =
|
|
1613
|
+
}, _ = de({
|
|
1608
1614
|
model: u,
|
|
1609
1615
|
mode: "filter",
|
|
1610
1616
|
targetId: void 0,
|
|
1611
1617
|
filters: void 0,
|
|
1612
1618
|
payload: void 0
|
|
1613
1619
|
});
|
|
1614
|
-
|
|
1620
|
+
B(u, () => {
|
|
1615
1621
|
p("selector", u.value);
|
|
1616
1622
|
});
|
|
1617
1623
|
let ee = C(() => {
|
|
@@ -1619,11 +1625,11 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1619
1625
|
}), b = (e) => {
|
|
1620
1626
|
if (e !== "all") {
|
|
1621
1627
|
if (_.value.model.value.includes(e)) return "selected";
|
|
1622
|
-
if (_.value.model.value.includes(
|
|
1628
|
+
if (_.value.model.value.includes(Nt(e))) return "excluded";
|
|
1623
1629
|
}
|
|
1624
1630
|
return e === "all" && !_.value.model.value.length ? "selected" : "";
|
|
1625
1631
|
}, x = (e, t) => {
|
|
1626
|
-
let n =
|
|
1632
|
+
let n = Nt(e), r = _.value.model.value.filter((t) => t !== e && t !== n);
|
|
1627
1633
|
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", {
|
|
1628
1634
|
tagsIds: r,
|
|
1629
1635
|
targetId: _.value.targetId,
|
|
@@ -1661,13 +1667,13 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1661
1667
|
}), d.value.sort((e, t) => r.findIndex((t) => t === e.id) - r.findIndex((e) => e === t.id)), p("tagsChanged", d.value);
|
|
1662
1668
|
}
|
|
1663
1669
|
});
|
|
1664
|
-
},
|
|
1670
|
+
}, j = (e) => {
|
|
1665
1671
|
t.$?.ui.sortable && $(e.elPopup).data("ui-sortable") && $(e.elPopup).sortable("destroy");
|
|
1666
1672
|
};
|
|
1667
|
-
return (e, t) => (
|
|
1673
|
+
return (e, t) => (P(), E(S, null, [k(Wt, {
|
|
1668
1674
|
modelValue: u.value,
|
|
1669
1675
|
"onUpdate:modelValue": t[0] ||= (e) => u.value = e,
|
|
1670
|
-
id:
|
|
1676
|
+
id: R(m),
|
|
1671
1677
|
tags: d.value,
|
|
1672
1678
|
styling: a.styling,
|
|
1673
1679
|
mode: "filter",
|
|
@@ -1679,35 +1685,35 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1679
1685
|
"styling",
|
|
1680
1686
|
"useTopButton"
|
|
1681
1687
|
]), k(y, {
|
|
1682
|
-
id:
|
|
1683
|
-
class:
|
|
1688
|
+
id: R(m),
|
|
1689
|
+
class: N(te.value),
|
|
1684
1690
|
onOpen: t[4] ||= (e) => A(e),
|
|
1685
|
-
onClose: t[5] ||= (e) =>
|
|
1691
|
+
onClose: t[5] ||= (e) => j(e),
|
|
1686
1692
|
"transition-duration": 50
|
|
1687
1693
|
}, ne({
|
|
1688
|
-
contentList:
|
|
1689
|
-
|
|
1694
|
+
contentList: V(() => [
|
|
1695
|
+
R(_).mode === "filter" && !a.singleMode ? (P(), w(Ht, {
|
|
1690
1696
|
key: 0,
|
|
1691
1697
|
id: "all",
|
|
1692
1698
|
colorId: "",
|
|
1693
1699
|
name: e.$i18n.Common.All_tags ?? "",
|
|
1694
|
-
state:
|
|
1695
|
-
onSelect: t[3] ||= (e) =>
|
|
1700
|
+
state: R(_).model.value.length ? "" : "selected",
|
|
1701
|
+
onSelect: t[3] ||= (e) => R(_).model.value = []
|
|
1696
1702
|
}, null, 8, ["name", "state"])) : T("", !0),
|
|
1697
|
-
(
|
|
1703
|
+
(P(!0), E(S, null, I(d.value, (e) => (P(), w(Ht, {
|
|
1698
1704
|
key: e.id,
|
|
1699
1705
|
id: e.id,
|
|
1700
1706
|
colorId: e.color_id,
|
|
1701
1707
|
name: e.name,
|
|
1702
1708
|
state: b(e.id),
|
|
1703
|
-
canExclude:
|
|
1709
|
+
canExclude: R(_).mode === "filter" && !a.singleMode,
|
|
1704
1710
|
editable: a.tagsEditable,
|
|
1705
1711
|
disabled: ee.value && b(e.id) === "",
|
|
1706
1712
|
onUnselect: (t) => x(e.id, "unselect"),
|
|
1707
1713
|
onSelect: (t) => x(e.id, "select"),
|
|
1708
1714
|
onExclude: (t) => x(e.id, "exclude"),
|
|
1709
1715
|
"onUpdate:name": (t) => {
|
|
1710
|
-
e.name = t,
|
|
1716
|
+
e.name = t, R(p)("tagsChanged", d.value);
|
|
1711
1717
|
}
|
|
1712
1718
|
}, null, 8, [
|
|
1713
1719
|
"id",
|
|
@@ -1722,36 +1728,36 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1722
1728
|
"onExclude",
|
|
1723
1729
|
"onUpdate:name"
|
|
1724
1730
|
]))), 128)),
|
|
1725
|
-
a.tagsEditable && d.value.length < a.tagsMax && d.value.length < 20 ? (
|
|
1731
|
+
a.tagsEditable && d.value.length < a.tagsMax && d.value.length < 20 ? (P(), w(v, {
|
|
1726
1732
|
key: 1,
|
|
1727
1733
|
"data-top-icon": "",
|
|
1728
|
-
onClick:
|
|
1734
|
+
onClick: H(D, ["stop"])
|
|
1729
1735
|
}, {
|
|
1730
|
-
default:
|
|
1736
|
+
default: V(() => [O(L(e.$i18n.Common.Add), 1)]),
|
|
1731
1737
|
_: 1
|
|
1732
1738
|
})) : T("", !0)
|
|
1733
1739
|
]),
|
|
1734
1740
|
_: 2
|
|
1735
|
-
}, [
|
|
1741
|
+
}, [R(_).mode === "setter" && R(_).filters ? {
|
|
1736
1742
|
name: "header",
|
|
1737
|
-
fn:
|
|
1743
|
+
fn: V(() => [k(i, {
|
|
1738
1744
|
modelValue: h.value,
|
|
1739
1745
|
"onUpdate:modelValue": t[1] ||= (e) => h.value = e,
|
|
1740
1746
|
options: g()
|
|
1741
1747
|
}, null, 8, ["modelValue", "options"])]),
|
|
1742
1748
|
key: "0"
|
|
1743
|
-
} : void 0,
|
|
1749
|
+
} : void 0, R(_).mode === "setter" && R(_).filters ? {
|
|
1744
1750
|
name: "footer",
|
|
1745
|
-
fn:
|
|
1746
|
-
default:
|
|
1751
|
+
fn: V(() => [k(r, { color: "theme" }, {
|
|
1752
|
+
default: V(() => [O(L(e.$i18n.Common.Cancel), 1)]),
|
|
1747
1753
|
_: 1
|
|
1748
|
-
}), k(r, { onClick: t[2] ||= (e) =>
|
|
1749
|
-
tagsIds:
|
|
1750
|
-
filters:
|
|
1754
|
+
}), k(r, { onClick: t[2] ||= (e) => R(p)("setter", {
|
|
1755
|
+
tagsIds: R(_).model.value,
|
|
1756
|
+
filters: R(_).filters,
|
|
1751
1757
|
filtersAction: h.value,
|
|
1752
|
-
payload:
|
|
1758
|
+
payload: R(_).payload
|
|
1753
1759
|
}) }, {
|
|
1754
|
-
default:
|
|
1760
|
+
default: V(() => [O(L(h.value === "add" ? e.$i18n.Common.Add : "") + " " + L(h.value === "replace" ? e.$i18n.Common.Replace : "") + " " + L(h.value === "delete" ? e.$i18n.Common.Delete : ""), 1)]),
|
|
1755
1761
|
_: 1
|
|
1756
1762
|
})]),
|
|
1757
1763
|
key: "1"
|
|
@@ -1759,6 +1765,6 @@ var He = ["innerHTML"], Ue = /* @__PURE__ */ A({
|
|
|
1759
1765
|
}
|
|
1760
1766
|
});
|
|
1761
1767
|
//#endregion
|
|
1762
|
-
export {
|
|
1768
|
+
export { _e as TopCompetitorSelector, nt as TopGroupSelector, Mt as TopProjectSelector, Ie as TopRegionSelector, Gt as TopTagSelector, Wt as TopTagSelectorPopupOpener, Bt as TopTagSelectorTagIcon, Tt as clearCache, je as dialogRegionSelector, Ae as findRegion, Pt as genElTopTagSelectorPopupOpener, De as genSearcherByKey, Ft as renderElTopTagSelectorPopupOpener, ve as useItemsFromCompetitors };
|
|
1763
1769
|
|
|
1764
1770
|
//# sourceMappingURL=project.js.map
|