@topvisor/ui 1.4.1-projectSelector.1 → 1.4.1-projectSelector.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 +559 -558
- package/project/project.js.map +1 -1
- package/src/components/project/projectSelector/projectSelector.vue.d.ts +1 -0
- package/src/components/project/projectSelector/types.d.ts +2 -2
- package/src/components/project/projectSelector/utils.d.ts +1 -8
- package/src/components/project/projectSelector/stories/mocks/projects.d.ts +0 -10
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
|
|
7
|
-
import { u as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { a as et, _ as
|
|
6
|
+
import { defineComponent as L, mergeModels as _, useModel as b, computed as P, createElementBlock as j, openBlock as p, createBlock as T, unref as v, withCtx as C, Fragment as D, renderList as se, normalizeClass as ee, createElementVNode as O, toDisplayString as B, createVNode as E, createTextVNode as q, toValue as xe, ref as M, watch as G, createCommentVNode as V, reactive as _e, resolveComponent as Ee, onMounted as Ue, withModifiers as U, isRef as ke, mergeProps as Ge, withKeys as Ce, nextTick as Fe, resolveDirective as We, withDirectives as ze, resolveDynamicComponent as Je, renderSlot as Ye, shallowRef as He, createSlots as Qe } from "vue";
|
|
7
|
+
import { u as w, C as Y, e as X, q as fe, d as Xe } from "../.chunks/forms-BAUgA7Ct.es.js";
|
|
8
|
+
import { _ as pe, b as he, a as Ze } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-BIWw5zUX.es.js";
|
|
9
|
+
import { a as et, _ as ye, b as Ie, c as Le, I as ne } from "../.chunks/policy.vue_vue_type_style_index_0_lang-ClaW4X74.es.js";
|
|
10
10
|
import { u as tt } from "../.chunks/utils-BYaZxGC1.es.js";
|
|
11
|
-
import { getSearcherGIcon as ot, getLangLabel as
|
|
11
|
+
import { getSearcherGIcon as ot, getLangLabel as nt, getDeviceGIcon as lt } from "../utils/searchers.js";
|
|
12
12
|
import "../.chunks/core-BE_-rKvW.es.js";
|
|
13
13
|
import "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-DMhcuiHP.es.js";
|
|
14
14
|
import { g as Te } from "../.chunks/field-CyyFzM-Y.es.js";
|
|
15
|
-
import { validUrl as
|
|
16
|
-
import { storage as
|
|
15
|
+
import { validUrl as je } from "../utils/check.js";
|
|
16
|
+
import { storage as H } from "../utils/dom.js";
|
|
17
17
|
import { TopPopupWorker as at } from "../popup/worker.js";
|
|
18
|
-
const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" }, io = /* @__PURE__ */
|
|
18
|
+
const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" }, io = /* @__PURE__ */ L({
|
|
19
19
|
__name: "competitorSelector",
|
|
20
|
-
props: /* @__PURE__ */
|
|
20
|
+
props: /* @__PURE__ */ _({
|
|
21
21
|
modelValue: {},
|
|
22
22
|
items: {},
|
|
23
23
|
showSelectAllItem: { type: Boolean, default: !0 }
|
|
@@ -27,33 +27,33 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
|
|
|
27
27
|
}),
|
|
28
28
|
emits: ["update:modelValue"],
|
|
29
29
|
setup(e) {
|
|
30
|
-
const t = e, o =
|
|
30
|
+
const t = e, o = b(e, "modelValue"), n = P(() => {
|
|
31
31
|
if (t.showSelectAllItem)
|
|
32
32
|
return {
|
|
33
33
|
icon: "",
|
|
34
|
-
title:
|
|
34
|
+
title: w().Common.Select_all,
|
|
35
35
|
value: "all",
|
|
36
36
|
content: ""
|
|
37
37
|
};
|
|
38
38
|
});
|
|
39
|
-
return (a,
|
|
40
|
-
|
|
39
|
+
return (a, l) => (p(), j("div", rt, [
|
|
40
|
+
v(Y).state.isMobile ? (p(), T(pe, { key: 0 }, {
|
|
41
41
|
opener: C(() => [
|
|
42
|
-
E(
|
|
42
|
+
E(X, {
|
|
43
43
|
class: "top-competitorSelector_opener",
|
|
44
44
|
color: "theme",
|
|
45
45
|
icon: "",
|
|
46
46
|
icon2: ""
|
|
47
47
|
}, {
|
|
48
48
|
default: C(() => [
|
|
49
|
-
|
|
49
|
+
q(B(e.items.find((r) => r.value === o.value?.[0])?.content), 1)
|
|
50
50
|
]),
|
|
51
51
|
_: 1
|
|
52
52
|
})
|
|
53
53
|
]),
|
|
54
54
|
contentList: C(() => [
|
|
55
|
-
(
|
|
56
|
-
class:
|
|
55
|
+
(p(!0), j(D, null, se(e.items, (r) => (p(), T(he, {
|
|
56
|
+
class: ee({
|
|
57
57
|
"top-active": o.value?.includes(r.value)
|
|
58
58
|
}),
|
|
59
59
|
"data-top-icon": r.icon,
|
|
@@ -61,30 +61,30 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
|
|
|
61
61
|
onClick: () => o.value = [r.value]
|
|
62
62
|
}, {
|
|
63
63
|
default: C(() => [
|
|
64
|
-
|
|
64
|
+
O("span", it, B(r.content), 1)
|
|
65
65
|
]),
|
|
66
66
|
_: 2
|
|
67
67
|
}, 1032, ["class", "data-top-icon", "title", "onClick"]))), 256))
|
|
68
68
|
]),
|
|
69
69
|
_: 1
|
|
70
|
-
})) : (
|
|
70
|
+
})) : (p(), T(et, {
|
|
71
71
|
key: 1,
|
|
72
72
|
modelValue: o.value,
|
|
73
|
-
"onUpdate:modelValue":
|
|
73
|
+
"onUpdate:modelValue": l[0] || (l[0] = (r) => o.value = r),
|
|
74
74
|
items: e.items,
|
|
75
75
|
isMultiple: !0,
|
|
76
76
|
styling: "bar",
|
|
77
77
|
canBeEmptyMultiple: !1,
|
|
78
|
-
selectAllItem:
|
|
78
|
+
selectAllItem: n.value
|
|
79
79
|
}, null, 8, ["modelValue", "items", "selectAllItem"]))
|
|
80
80
|
]));
|
|
81
81
|
}
|
|
82
|
-
}), so = (e, t) =>
|
|
82
|
+
}), so = (e, t) => P(() => xe(e).filter((a) => a.on >= 0 || a.id === t).map((a) => ({
|
|
83
83
|
value: a.id,
|
|
84
84
|
title: a.url + ` [${a.id}]`,
|
|
85
|
-
icon: a.id ===
|
|
85
|
+
icon: a.id === xe(t) ? "" : "",
|
|
86
86
|
content: a.name
|
|
87
|
-
}))),
|
|
87
|
+
}))), R = -1, y = -2, le = -1, dt = {
|
|
88
88
|
0: "Yandex",
|
|
89
89
|
1: "Google",
|
|
90
90
|
4: "YouTube",
|
|
@@ -94,15 +94,15 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
|
|
|
94
94
|
9: "GoogleStore",
|
|
95
95
|
20: "Yandex.com",
|
|
96
96
|
21: "Yandex.com.tr"
|
|
97
|
-
},
|
|
97
|
+
}, Ae = {
|
|
98
98
|
key: y,
|
|
99
99
|
name: "--",
|
|
100
100
|
index: y
|
|
101
|
-
},
|
|
101
|
+
}, Ke = {
|
|
102
102
|
key: y,
|
|
103
103
|
name: "--",
|
|
104
|
-
regions: [
|
|
105
|
-
regionByIndex: /* @__PURE__ */ new Map([[y,
|
|
104
|
+
regions: [Ae],
|
|
105
|
+
regionByIndex: /* @__PURE__ */ new Map([[y, Ae]])
|
|
106
106
|
}, ae = {
|
|
107
107
|
key: y,
|
|
108
108
|
name: "Autoselect",
|
|
@@ -112,35 +112,35 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
|
|
|
112
112
|
name: "Autoselect",
|
|
113
113
|
regions: [ae],
|
|
114
114
|
regionByIndex: /* @__PURE__ */ new Map([[y, ae]])
|
|
115
|
-
},
|
|
115
|
+
}, Be = {
|
|
116
116
|
countryCode: "00",
|
|
117
117
|
depth: 1,
|
|
118
118
|
device: 0,
|
|
119
|
-
key:
|
|
120
|
-
index:
|
|
119
|
+
key: le,
|
|
120
|
+
index: le,
|
|
121
121
|
lang: "ru",
|
|
122
122
|
name: "Without region"
|
|
123
|
-
}, st = () => (ae.name =
|
|
124
|
-
let
|
|
125
|
-
return e ?
|
|
126
|
-
}, Re = (e, t = !0, o = [],
|
|
123
|
+
}, st = () => (ae.name = w().Common.Autoselect, ae), ut = () => (st(), ce.name = w().Common.Autoselect, console.log(ce), ce), ct = () => (Be.name = w().Keywords.Without_region, Be), Oe = (e = !1, t = !1, o = []) => {
|
|
124
|
+
let n;
|
|
125
|
+
return e ? n = gt(o) : n = Re(o), t && n.set(y, ut()), n.size || n.set(y, Ke), n;
|
|
126
|
+
}, Re = (e, t = !0, o = [], n = !1) => {
|
|
127
127
|
const a = /* @__PURE__ */ new Map();
|
|
128
|
-
return e.forEach((
|
|
129
|
-
if (!
|
|
130
|
-
const r = { ...
|
|
131
|
-
r.regionByIndex = /* @__PURE__ */ new Map(),
|
|
128
|
+
return e.forEach((l) => {
|
|
129
|
+
if (!l.enabled || n && typeof l.key == "number" && l.key > 1) return;
|
|
130
|
+
const r = { ...l };
|
|
131
|
+
r.regionByIndex = /* @__PURE__ */ new Map(), l.regions && l.regions.forEach((u) => {
|
|
132
132
|
if (t && !u.enabled) return;
|
|
133
133
|
const c = { ...u };
|
|
134
134
|
r.regionByIndex.set(c.index, c);
|
|
135
135
|
}), !r.regionByIndex.size && o.length, // режим вывода ПС без регионов
|
|
136
|
-
(!
|
|
136
|
+
(!l.regions || // есть включенные регионы
|
|
137
137
|
r.regionByIndex.size || // запрошен вывод конкретных ПС
|
|
138
138
|
o.length) && typeof r.key == "number" && a.set(r.key, r);
|
|
139
|
-
}), o.forEach((
|
|
140
|
-
if (a.has(
|
|
139
|
+
}), o.forEach((l) => {
|
|
140
|
+
if (a.has(l)) return;
|
|
141
141
|
const r = {
|
|
142
|
-
key:
|
|
143
|
-
name: dt[
|
|
142
|
+
key: l,
|
|
143
|
+
name: dt[l],
|
|
144
144
|
regions: [],
|
|
145
145
|
regionByIndex: /* @__PURE__ */ new Map()
|
|
146
146
|
};
|
|
@@ -154,103 +154,103 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
|
|
|
154
154
|
}
|
|
155
155
|
return t.forEach((o) => {
|
|
156
156
|
if (!o.regionByIndex) return;
|
|
157
|
-
const
|
|
158
|
-
o.regionByIndex.set(
|
|
157
|
+
const n = { ...ct() };
|
|
158
|
+
o.regionByIndex.set(n.index, n);
|
|
159
159
|
}), t;
|
|
160
160
|
}, ft = (e, t, o = []) => {
|
|
161
|
-
const
|
|
161
|
+
const n = Oe(e, !1, o);
|
|
162
162
|
let a;
|
|
163
|
-
return
|
|
164
|
-
if (!(t.searcher_key !== void 0 && t.searcher_key !=
|
|
163
|
+
return n.forEach((l) => {
|
|
164
|
+
if (!(t.searcher_key !== void 0 && t.searcher_key != l.key) && l.regions && (l.regions.forEach((r) => {
|
|
165
165
|
if (!a && !(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)))
|
|
166
|
-
return r.searcher_key =
|
|
166
|
+
return r.searcher_key = l.key, a = r, !1;
|
|
167
167
|
}), a))
|
|
168
168
|
return !1;
|
|
169
169
|
}), a;
|
|
170
|
-
}, mt = tt(() => import("../.chunks/dialog_regionSelectorRegions-Btp9cfmF.es.js")),
|
|
171
|
-
const o =
|
|
172
|
-
const
|
|
170
|
+
}, mt = tt(() => import("../.chunks/dialog_regionSelectorRegions-Btp9cfmF.es.js")), vt = (e, t) => {
|
|
171
|
+
const o = w(), n = M(t.value.keys().next().value ?? y), a = P(() => {
|
|
172
|
+
const l = /* @__PURE__ */ new Map();
|
|
173
173
|
if (t.value.forEach((r) => {
|
|
174
174
|
let u = {
|
|
175
175
|
value: r.key,
|
|
176
176
|
title: r.name
|
|
177
177
|
};
|
|
178
|
-
e.addSearcherIcon && (u.icon = ot(r.key)),
|
|
179
|
-
}), e.addCompare && !
|
|
178
|
+
e.addSearcherIcon && (u.icon = ot(r.key)), l.set(r.key, u);
|
|
179
|
+
}), e.addCompare && !l.has(y)) {
|
|
180
180
|
const r = {
|
|
181
181
|
value: "",
|
|
182
182
|
title: "--------------------",
|
|
183
183
|
disabled: !0
|
|
184
184
|
};
|
|
185
|
-
|
|
185
|
+
l.set(r.value, r);
|
|
186
186
|
const u = {
|
|
187
|
-
value:
|
|
187
|
+
value: R,
|
|
188
188
|
title: o.Common.Compare
|
|
189
189
|
};
|
|
190
|
-
|
|
190
|
+
l.set(u.value, u);
|
|
191
191
|
}
|
|
192
|
-
return
|
|
192
|
+
return l;
|
|
193
193
|
});
|
|
194
194
|
return {
|
|
195
|
-
searcherKey:
|
|
195
|
+
searcherKey: n,
|
|
196
196
|
optionBySearcherKey: a
|
|
197
197
|
};
|
|
198
|
-
},
|
|
199
|
-
const o =
|
|
200
|
-
e.modelValue.length === 1 && (
|
|
201
|
-
const a =
|
|
202
|
-
const
|
|
198
|
+
}, pt = (e, t) => {
|
|
199
|
+
const o = w(), n = M(y);
|
|
200
|
+
e.modelValue.length === 1 && (n.value = e.modelValue[0]), n.value === y && (e.forFrequency ? n.value = t.value?.regionByIndex.values().next().value?.key ?? y : n.value = t.value?.regionByIndex.keys().next().value ?? y);
|
|
201
|
+
const a = P(() => {
|
|
202
|
+
const l = /* @__PURE__ */ new Map();
|
|
203
203
|
return t.value.regionByIndex?.forEach((r) => {
|
|
204
204
|
let u = r.name;
|
|
205
205
|
if (e.forFrequency) {
|
|
206
|
-
const
|
|
206
|
+
const I = {
|
|
207
207
|
value: r.key,
|
|
208
208
|
title: u
|
|
209
209
|
};
|
|
210
|
-
|
|
210
|
+
l.has(r.key) || l.set(r.key, I);
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
213
|
r.device && (u += " (" + o.Common["Device_" + r.device] + ")");
|
|
214
|
-
const c =
|
|
214
|
+
const c = nt(t.value.key || 0, r.lang ?? "");
|
|
215
215
|
c && (u += " / " + c);
|
|
216
|
-
const
|
|
216
|
+
const g = {
|
|
217
217
|
value: r.index,
|
|
218
218
|
title: u,
|
|
219
|
-
icon: r.device ?
|
|
219
|
+
icon: r.device ? lt(r.device) : void 0
|
|
220
220
|
};
|
|
221
|
-
|
|
222
|
-
}),
|
|
221
|
+
l.set(r.index, g);
|
|
222
|
+
}), l;
|
|
223
223
|
});
|
|
224
|
-
return
|
|
225
|
-
if (e.onlySearcher ||
|
|
224
|
+
return G(a, (l, r) => {
|
|
225
|
+
if (e.onlySearcher || n.value !== void 0 && l.get(n.value))
|
|
226
226
|
return;
|
|
227
|
-
let u =
|
|
228
|
-
if (
|
|
229
|
-
|
|
227
|
+
let u = l.keys().next().value;
|
|
228
|
+
if (n.value === y || u === y) {
|
|
229
|
+
n.value = u;
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
|
-
let c = r?.get(
|
|
233
|
-
for (const [
|
|
234
|
-
const
|
|
235
|
-
if (typeof
|
|
232
|
+
let c = r?.get(n.value)?.title || "", g = -1;
|
|
233
|
+
for (const [I, d] of l.entries()) {
|
|
234
|
+
const m = d.title;
|
|
235
|
+
if (typeof m != "string" || typeof I == "string")
|
|
236
236
|
break;
|
|
237
|
-
if (
|
|
238
|
-
u =
|
|
237
|
+
if (m === c) {
|
|
238
|
+
u = I;
|
|
239
239
|
break;
|
|
240
240
|
}
|
|
241
|
-
const
|
|
242
|
-
let s = c,
|
|
243
|
-
|
|
241
|
+
const i = new RegExp(` \\((${o.Common.Device_1}|${o.Common.Device_2})\\)`);
|
|
242
|
+
let s = c, f = 3;
|
|
243
|
+
m.indexOf(s) === -1 && (s = c.replace(/^[^a-zа-я]/i, "").replace(i, ""), f--), m.indexOf(s) === -1 && (s = c.replace(/ \/.*/, ""), f--), m.indexOf(s) === -1 && (s = c.replace(/ \/.*/, ""), s = s.replace(/^[^a-zа-я]/i, "").replace(i, ""), f--), m.indexOf(s) !== -1 && (f <= g || (g = f, u = I));
|
|
244
244
|
}
|
|
245
|
-
|
|
245
|
+
n.value = u;
|
|
246
246
|
}), {
|
|
247
|
-
regionIndex:
|
|
247
|
+
regionIndex: n,
|
|
248
248
|
optionByRegionIndex: a
|
|
249
249
|
};
|
|
250
250
|
}, ht = (e, t, o) => {
|
|
251
|
-
const
|
|
251
|
+
const n = M([]), a = () => {
|
|
252
252
|
if (e.onlySearcher && t.value) {
|
|
253
|
-
|
|
253
|
+
n.value = Array.from(t.value.keys());
|
|
254
254
|
return;
|
|
255
255
|
}
|
|
256
256
|
let r = [];
|
|
@@ -263,72 +263,72 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
|
|
|
263
263
|
) ?? [];
|
|
264
264
|
} catch {
|
|
265
265
|
}
|
|
266
|
-
r.length && (r = r.filter((u) => o.value.has(u))), r.length || (r = Array.from(o.value)),
|
|
267
|
-
},
|
|
268
|
-
|
|
266
|
+
r.length && (r = r.filter((u) => o.value.has(u))), r.length || (r = Array.from(o.value)), n.value = [...r];
|
|
267
|
+
}, l = () => {
|
|
268
|
+
n.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(n.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
|
|
269
269
|
};
|
|
270
|
-
return
|
|
271
|
-
|
|
270
|
+
return G(n, () => {
|
|
271
|
+
l();
|
|
272
272
|
}), e.addCompare && a(), {
|
|
273
|
-
regionsIndexes:
|
|
273
|
+
regionsIndexes: n
|
|
274
274
|
};
|
|
275
275
|
}, yt = (e) => {
|
|
276
|
-
const t =
|
|
277
|
-
const
|
|
278
|
-
return t.value.forEach((
|
|
279
|
-
|
|
280
|
-
|
|
276
|
+
const t = P(() => Oe(e.forFrequency, e.autoRegion, e.searchers)), o = P(() => t.value.get(a.searcherKey.value) || Ke), n = P(() => {
|
|
277
|
+
const d = /* @__PURE__ */ new Set();
|
|
278
|
+
return t.value.forEach((m) => {
|
|
279
|
+
m.regionByIndex.forEach((i) => {
|
|
280
|
+
i.index !== le && i.index !== y && d.add(i.index);
|
|
281
281
|
});
|
|
282
|
-
}),
|
|
283
|
-
}), a =
|
|
284
|
-
|
|
285
|
-
if (e.onlySearcher ? r.regionsIndexes.value = Array.from(t.value.keys()) : r.regionsIndexes.value = r.regionsIndexes.value.filter((
|
|
286
|
-
let
|
|
287
|
-
t.value.forEach((
|
|
288
|
-
if (e.onlySearcher &&
|
|
289
|
-
|
|
282
|
+
}), d;
|
|
283
|
+
}), a = vt(e, t), l = pt(e, o), r = ht(e, t, n);
|
|
284
|
+
G(t, () => {
|
|
285
|
+
if (e.onlySearcher ? r.regionsIndexes.value = Array.from(t.value.keys()) : r.regionsIndexes.value = r.regionsIndexes.value.filter((m) => n.value.has(m)), a.searcherKey.value === R) return;
|
|
286
|
+
let d = t.value.keys().next().value;
|
|
287
|
+
t.value.forEach((m) => {
|
|
288
|
+
if (e.onlySearcher && m.key === a.searcherKey.value) {
|
|
289
|
+
d = a.searcherKey.value;
|
|
290
290
|
return;
|
|
291
291
|
}
|
|
292
|
-
if (
|
|
293
|
-
let
|
|
294
|
-
|
|
295
|
-
const s = t.value.get(
|
|
296
|
-
|
|
292
|
+
if (l.regionIndex.value && m.regionByIndex?.has(l.regionIndex.value) && (d = m.key), !e.onlySearcher) {
|
|
293
|
+
let i;
|
|
294
|
+
d !== void 0 && (i = t.value.get(d)?.regionByIndex);
|
|
295
|
+
const s = t.value.get(m.key)?.regionByIndex;
|
|
296
|
+
i?.has(y) && !s?.has(y) && (d = m.key);
|
|
297
297
|
}
|
|
298
|
-
}),
|
|
298
|
+
}), d !== void 0 && (a.searcherKey.value = d), l.regionIndex.value !== void 0 && !o.value?.regionByIndex?.has(l.regionIndex.value) && (l.regionIndex.value = o.value?.regions?.keys().next().value);
|
|
299
299
|
}, { immediate: !0 });
|
|
300
300
|
const u = () => {
|
|
301
|
-
if (!(a.searcherKey.value ===
|
|
301
|
+
if (!(a.searcherKey.value === R || a.searcherKey.value === y))
|
|
302
302
|
return a.searcherKey.value;
|
|
303
303
|
}, c = () => {
|
|
304
|
-
if (e.onlySearcher ||
|
|
305
|
-
let
|
|
304
|
+
if (e.onlySearcher || l.regionIndex.value === y) return;
|
|
305
|
+
let d = l.regionIndex.value;
|
|
306
306
|
if (e.forFrequency) {
|
|
307
|
-
const
|
|
308
|
-
|
|
307
|
+
const m = l.regionIndex.value;
|
|
308
|
+
d = ft(e.forFrequency, { searcher_key: u(), key: m }, e.searchers)?.index;
|
|
309
309
|
}
|
|
310
|
-
return
|
|
311
|
-
},
|
|
312
|
-
const
|
|
313
|
-
if (
|
|
314
|
-
return t.value.get(
|
|
310
|
+
return d;
|
|
311
|
+
}, g = () => {
|
|
312
|
+
const d = u();
|
|
313
|
+
if (d !== void 0)
|
|
314
|
+
return t.value.get(d);
|
|
315
315
|
};
|
|
316
316
|
return {
|
|
317
317
|
selectSearcher: a,
|
|
318
|
-
selectRegion:
|
|
318
|
+
selectRegion: l,
|
|
319
319
|
compare: r,
|
|
320
320
|
searcherByKey: t,
|
|
321
|
-
allRegionsIndexes:
|
|
322
|
-
getSearcher:
|
|
321
|
+
allRegionsIndexes: n,
|
|
322
|
+
getSearcher: g,
|
|
323
323
|
getRegion: () => {
|
|
324
|
-
const
|
|
325
|
-
if (
|
|
326
|
-
return
|
|
324
|
+
const d = c();
|
|
325
|
+
if (d !== void 0)
|
|
326
|
+
return g()?.regionByIndex?.get(d);
|
|
327
327
|
}
|
|
328
328
|
};
|
|
329
|
-
}, uo = /* @__PURE__ */
|
|
329
|
+
}, uo = /* @__PURE__ */ L({
|
|
330
330
|
__name: "regionSelector",
|
|
331
|
-
props: /* @__PURE__ */
|
|
331
|
+
props: /* @__PURE__ */ _({
|
|
332
332
|
projectId: {},
|
|
333
333
|
searchers: { default: () => [] },
|
|
334
334
|
modelValue: {},
|
|
@@ -348,162 +348,162 @@ const rt = { class: "top-competitorSelector" }, it = { class: "top-ellipsis1" },
|
|
|
348
348
|
}),
|
|
349
349
|
emits: ["update:modelValue", "update:modelValueSingle"],
|
|
350
350
|
setup(e, { expose: t }) {
|
|
351
|
-
const o = e,
|
|
352
|
-
selectSearcher:
|
|
351
|
+
const o = e, n = b(e, "modelValue"), a = b(e, "modelValueSingle"), {
|
|
352
|
+
selectSearcher: l,
|
|
353
353
|
selectRegion: r,
|
|
354
354
|
compare: u,
|
|
355
355
|
searcherByKey: c,
|
|
356
|
-
allRegionsIndexes:
|
|
357
|
-
getSearcher:
|
|
358
|
-
getRegion:
|
|
359
|
-
} = yt(o),
|
|
360
|
-
const
|
|
356
|
+
allRegionsIndexes: g,
|
|
357
|
+
getSearcher: I,
|
|
358
|
+
getRegion: d
|
|
359
|
+
} = yt(o), m = () => {
|
|
360
|
+
const i = [];
|
|
361
361
|
c.value.forEach((s) => {
|
|
362
|
-
s.enabled && s.regions.forEach((
|
|
363
|
-
|
|
362
|
+
s.enabled && s.regions.forEach((f) => {
|
|
363
|
+
f.enabled && i.push(f);
|
|
364
364
|
});
|
|
365
365
|
}), mt.open("regions", {
|
|
366
|
-
regions:
|
|
366
|
+
regions: i,
|
|
367
367
|
regionsIndexes: u.regionsIndexes.value,
|
|
368
368
|
"@update:regionsIndexes": (s) => u.regionsIndexes.value = s
|
|
369
369
|
});
|
|
370
370
|
};
|
|
371
|
-
return
|
|
372
|
-
if (
|
|
373
|
-
if (JSON.stringify(
|
|
371
|
+
return G([r.regionIndex, l.searcherKey, u.regionsIndexes], () => {
|
|
372
|
+
if (l.searcherKey.value === R && u.regionsIndexes.value.length) {
|
|
373
|
+
if (JSON.stringify(n.value) === JSON.stringify(u.regionsIndexes.value))
|
|
374
374
|
return;
|
|
375
|
-
|
|
375
|
+
n.value = [...u.regionsIndexes.value];
|
|
376
376
|
} else
|
|
377
|
-
o.onlySearcher ? (
|
|
378
|
-
!o.onlySearcher && !
|
|
379
|
-
}), a.value &&
|
|
380
|
-
a.value && (
|
|
381
|
-
}, { immediate: !0 }),
|
|
382
|
-
if (
|
|
383
|
-
if (!
|
|
384
|
-
let
|
|
385
|
-
|
|
377
|
+
o.onlySearcher ? (n.value = [l.searcherKey.value], l.searcherKey.value === y && !o.autoRegion && (n.value.length = 0)) : (n.value = [r.regionIndex.value], r.regionIndex.value === y && !o.autoRegion && (n.value.length = 0));
|
|
378
|
+
!o.onlySearcher && !g.value.size && (l.searcherKey.value = y);
|
|
379
|
+
}), a.value && G(a, () => {
|
|
380
|
+
a.value && (n.value = [a.value]);
|
|
381
|
+
}, { immediate: !0 }), G(n, () => {
|
|
382
|
+
if (n.value[0] && (a.value = n.value[0]), o.onlySearcher) {
|
|
383
|
+
if (!n.value.length || n.value.length === 1 && !c.value.has(n.value[0]) || n.value.length === 1 && n.value[0] === y && !o.autoRegion) {
|
|
384
|
+
let i = c.value.keys().next().value;
|
|
385
|
+
i === y && !o.autoRegion && (i = void 0, a.value = y), i !== void 0 ? n.value = [i] : n.value.length = 0;
|
|
386
386
|
return;
|
|
387
387
|
}
|
|
388
|
-
if (
|
|
389
|
-
|
|
388
|
+
if (n.value.length > 1 && JSON.stringify(n.value) !== JSON.stringify(u.regionsIndexes.value)) {
|
|
389
|
+
n.value = [...u.regionsIndexes.value];
|
|
390
390
|
return;
|
|
391
391
|
}
|
|
392
392
|
} else {
|
|
393
|
-
let
|
|
394
|
-
if (o.forFrequency && (s = c.value.values().next().value?.regionByIndex?.values().next().value?.key), s === y && !o.autoRegion && (s = void 0, a.value = y), !
|
|
395
|
-
s !== void 0 &&
|
|
396
|
-
else if (
|
|
397
|
-
let
|
|
398
|
-
o.forFrequency && (
|
|
399
|
-
|
|
400
|
-
|
|
393
|
+
let i = [...new Set(n.value)], s = c.value.values().next().value?.regionByIndex?.keys().next().value;
|
|
394
|
+
if (o.forFrequency && (s = c.value.values().next().value?.regionByIndex?.values().next().value?.key), s === y && !o.autoRegion && (s = void 0, a.value = y), !i.length)
|
|
395
|
+
s !== void 0 && i.push(s);
|
|
396
|
+
else if (i.length === 1) {
|
|
397
|
+
let f = g.value;
|
|
398
|
+
o.forFrequency && (f = /* @__PURE__ */ new Set(), c.value.forEach((A) => {
|
|
399
|
+
A.regionByIndex.forEach((F) => {
|
|
400
|
+
F.index !== le && F.index !== y && f.add(F.key);
|
|
401
401
|
});
|
|
402
|
-
})),
|
|
402
|
+
})), f.has(i[0]) || (i = [], s !== void 0 && i.push(s));
|
|
403
403
|
} else
|
|
404
|
-
|
|
405
|
-
if (JSON.stringify(
|
|
406
|
-
|
|
404
|
+
i = i.filter((f) => g.value.has(f)), !i.length && s !== void 0 && i.push(s);
|
|
405
|
+
if (JSON.stringify(n.value) !== JSON.stringify(i)) {
|
|
406
|
+
n.value = i;
|
|
407
407
|
return;
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
|
-
if (!(
|
|
410
|
+
if (!(n.value.length === 1 && n.value[0] === (o.onlySearcher ? l.searcherKey.value : r.regionIndex.value)))
|
|
411
411
|
if (o.onlySearcher) {
|
|
412
|
-
if (
|
|
413
|
-
|
|
412
|
+
if (n.value.length === 1) {
|
|
413
|
+
l.searcherKey.value = n.value[0];
|
|
414
414
|
return;
|
|
415
415
|
}
|
|
416
|
-
|
|
416
|
+
l.searcherKey.value = R;
|
|
417
417
|
return;
|
|
418
418
|
} else {
|
|
419
|
-
if (!
|
|
419
|
+
if (!n.value.length)
|
|
420
420
|
return;
|
|
421
|
-
if (
|
|
422
|
-
r.regionIndex.value =
|
|
423
|
-
let
|
|
421
|
+
if (n.value.length === 1 && l.searcherKey.value !== R) {
|
|
422
|
+
r.regionIndex.value = n.value[0];
|
|
423
|
+
let i;
|
|
424
424
|
for (const s of c.value.values()) {
|
|
425
|
-
for (const
|
|
426
|
-
if ((o.forFrequency ?
|
|
427
|
-
|
|
425
|
+
for (const f of s.regionByIndex.values())
|
|
426
|
+
if ((o.forFrequency ? f.key : f.index) === r.regionIndex.value) {
|
|
427
|
+
i = s.key;
|
|
428
428
|
break;
|
|
429
429
|
}
|
|
430
|
-
if (
|
|
430
|
+
if (i !== void 0)
|
|
431
431
|
break;
|
|
432
432
|
}
|
|
433
|
-
|
|
433
|
+
i !== void 0 && (l.searcherKey.value = i);
|
|
434
434
|
} else
|
|
435
|
-
|
|
435
|
+
l.searcherKey.value = R, u.regionsIndexes.value = [...n.value];
|
|
436
436
|
}
|
|
437
437
|
}, { immediate: !0 }), t({
|
|
438
|
-
getSearcher:
|
|
439
|
-
getRegion:
|
|
440
|
-
}), (
|
|
441
|
-
class:
|
|
438
|
+
getSearcher: I,
|
|
439
|
+
getRegion: d
|
|
440
|
+
}), (i, s) => (p(), j("div", {
|
|
441
|
+
class: ee({
|
|
442
442
|
"top-selectorRegion": !0,
|
|
443
443
|
"top-selectorRegion-onlySearcher": e.onlySearcher
|
|
444
444
|
})
|
|
445
445
|
}, [
|
|
446
446
|
E(fe, {
|
|
447
|
-
options:
|
|
448
|
-
modelValue:
|
|
449
|
-
"onUpdate:modelValue": s[0] || (s[0] = (
|
|
447
|
+
options: v(l).optionBySearcherKey.value,
|
|
448
|
+
modelValue: v(l).searcherKey.value,
|
|
449
|
+
"onUpdate:modelValue": s[0] || (s[0] = (f) => v(l).searcherKey.value = f),
|
|
450
450
|
name: "searcher_key",
|
|
451
451
|
addChanger: e.addChanger
|
|
452
452
|
}, null, 8, ["options", "modelValue", "addChanger"]),
|
|
453
|
-
!e.onlySearcher &&
|
|
453
|
+
!e.onlySearcher && v(l).searcherKey.value !== v(R) ? (p(), T(fe, {
|
|
454
454
|
key: 0,
|
|
455
455
|
class: "top-select-region",
|
|
456
|
-
options:
|
|
457
|
-
modelValue:
|
|
458
|
-
"onUpdate:modelValue": s[1] || (s[1] = (
|
|
456
|
+
options: v(r).optionByRegionIndex.value,
|
|
457
|
+
modelValue: v(r).regionIndex.value,
|
|
458
|
+
"onUpdate:modelValue": s[1] || (s[1] = (f) => v(r).regionIndex.value = f),
|
|
459
459
|
name: e.forFrequency ? "region_key" : "region_index",
|
|
460
460
|
addChanger: e.addChanger,
|
|
461
461
|
"data-top-icon": e.addRegionIcon ? "" : void 0
|
|
462
|
-
}, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) :
|
|
463
|
-
e.addCompare && !e.onlySearcher &&
|
|
462
|
+
}, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : V("", !0),
|
|
463
|
+
e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(R) ? (p(), T(X, {
|
|
464
464
|
key: 1,
|
|
465
465
|
name: "compare",
|
|
466
|
-
onClick:
|
|
467
|
-
"data-count-compare-regions-indexes":
|
|
466
|
+
onClick: m,
|
|
467
|
+
"data-count-compare-regions-indexes": v(u).regionsIndexes.value.length
|
|
468
468
|
}, {
|
|
469
469
|
default: C(() => [
|
|
470
|
-
|
|
470
|
+
q(B(i.$i18n.Common.Selected_regions), 1)
|
|
471
471
|
]),
|
|
472
472
|
_: 1
|
|
473
|
-
}, 8, ["data-count-compare-regions-indexes"])) :
|
|
473
|
+
}, 8, ["data-count-compare-regions-indexes"])) : V("", !0)
|
|
474
474
|
], 2));
|
|
475
475
|
}
|
|
476
|
-
}),
|
|
476
|
+
}), N = {
|
|
477
477
|
id: 0,
|
|
478
478
|
name: "/",
|
|
479
479
|
path: "/"
|
|
480
480
|
};
|
|
481
481
|
function It(e) {
|
|
482
|
-
return e ?
|
|
482
|
+
return e ? w()?.Common.All_folders : "/ (" + w()?.Keywords.Root_folder + ")";
|
|
483
483
|
}
|
|
484
|
-
const
|
|
485
|
-
|
|
484
|
+
const Se = (e, t, o = /* @__PURE__ */ new Map(), n = { id: "root" }, a = 0) => (n.childsIds = [], n.id && (n.countAllGroupsActive = n.count_groups_active), e[n.id] && e[n.id].forEach((l) => {
|
|
485
|
+
l = { ...l }, n.childsIds.push(l.id), l.id === 0 && (l.name = It(t));
|
|
486
486
|
const r = a > 1 ? "-".repeat(a - 1) + " " : "";
|
|
487
|
-
r && !
|
|
487
|
+
r && !l.name.startsWith(r) && (l.name = r + l.name), o.set(l.id, l), Se(e, t, o, l, a + 1), n.childsIds = n.childsIds.concat(l.childsIds), n.id && l.count_groups_active && (n.countAllGroupsActive += l.count_groups_active);
|
|
488
488
|
}), o), St = (e) => e.gen("/get/keywords_2/folders/", ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 });
|
|
489
489
|
function me(e, t, o) {
|
|
490
|
-
const
|
|
491
|
-
return
|
|
490
|
+
const n = Object.keys(e), a = n.map((l) => e[l]);
|
|
491
|
+
return G(a, (l, r, u) => {
|
|
492
492
|
const c = {};
|
|
493
|
-
|
|
494
|
-
if (!Object.is(
|
|
495
|
-
const
|
|
496
|
-
c[
|
|
497
|
-
old: r[
|
|
498
|
-
new:
|
|
493
|
+
l.forEach((g, I) => {
|
|
494
|
+
if (!Object.is(g, r[I])) {
|
|
495
|
+
const d = n[I];
|
|
496
|
+
c[d] = {
|
|
497
|
+
old: r[I],
|
|
498
|
+
new: g
|
|
499
499
|
};
|
|
500
500
|
}
|
|
501
501
|
}), Object.keys(c).length && t(c, u);
|
|
502
502
|
}, o);
|
|
503
503
|
}
|
|
504
|
-
const xt = /* @__PURE__ */
|
|
504
|
+
const xt = /* @__PURE__ */ L({
|
|
505
505
|
__name: "folders",
|
|
506
|
-
props: /* @__PURE__ */
|
|
506
|
+
props: /* @__PURE__ */ _({
|
|
507
507
|
folderId: {},
|
|
508
508
|
folder: {},
|
|
509
509
|
folders: {},
|
|
@@ -515,41 +515,41 @@ const xt = /* @__PURE__ */ G({
|
|
|
515
515
|
}, {
|
|
516
516
|
folderId: { required: !0 },
|
|
517
517
|
folderIdModifiers: {},
|
|
518
|
-
folder: { default:
|
|
518
|
+
folder: { default: N },
|
|
519
519
|
folderModifiers: {}
|
|
520
520
|
}),
|
|
521
521
|
emits: ["update:folderId", "update:folder"],
|
|
522
522
|
setup(e) {
|
|
523
|
-
const t = e, o =
|
|
524
|
-
|
|
523
|
+
const t = e, o = b(e, "folderId"), n = b(e, "folder"), a = t.client && !t.folders ? St(t.client) : void 0, l = M(null);
|
|
524
|
+
G(() => t.projectId, () => {
|
|
525
525
|
a?.changeParams({
|
|
526
526
|
project_id: t.projectId
|
|
527
527
|
}), a?.setOptions({
|
|
528
528
|
checkFingerprint: "TopGroupSelectorFolders:" + t.projectId
|
|
529
|
-
}),
|
|
529
|
+
}), l.value?.resetCache();
|
|
530
530
|
}, { immediate: !0 });
|
|
531
|
-
const r =
|
|
531
|
+
const r = P(() => Se(t.folders ?? { root: [N] }, t.canSelectAll));
|
|
532
532
|
return me({
|
|
533
|
-
modelFolder:
|
|
533
|
+
modelFolder: n,
|
|
534
534
|
modelFolderId: o
|
|
535
535
|
}, async (u) => {
|
|
536
|
-
if (o.value ===
|
|
536
|
+
if (o.value === n.value.id)
|
|
537
537
|
return;
|
|
538
538
|
if (u.modelFolder && !u.modelFolderId) {
|
|
539
|
-
o.value =
|
|
539
|
+
o.value = n.value.id;
|
|
540
540
|
return;
|
|
541
541
|
}
|
|
542
542
|
let c = r.value.get(t.folderId);
|
|
543
|
-
c || (c =
|
|
544
|
-
}, { immediate: !0 }), (u, c) => (
|
|
543
|
+
c || (c = N), n.value = c, o.value = c.id;
|
|
544
|
+
}, { immediate: !0 }), (u, c) => (p(), T(ye, {
|
|
545
545
|
class: "top-groupSelector_folder",
|
|
546
|
-
modelValue:
|
|
547
|
-
"onUpdate:modelValue": c[0] || (c[0] = (
|
|
546
|
+
modelValue: n.value,
|
|
547
|
+
"onUpdate:modelValue": c[0] || (c[0] = (g) => n.value = g),
|
|
548
548
|
items: e.folders ? [...r.value.values()] : void 0,
|
|
549
549
|
"search-type": "inline",
|
|
550
550
|
icon: e.addIcon ? "" : void 0,
|
|
551
|
-
api: e.folders ? void 0 :
|
|
552
|
-
apiSetSearchParams: (...
|
|
551
|
+
api: e.folders ? void 0 : v(a),
|
|
552
|
+
apiSetSearchParams: (...g) => v(Ie)(...g, "name"),
|
|
553
553
|
addChanger: e.addChanger,
|
|
554
554
|
useCache: ""
|
|
555
555
|
}, null, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "addChanger"]));
|
|
@@ -557,22 +557,22 @@ const xt = /* @__PURE__ */ G({
|
|
|
557
557
|
}), re = {
|
|
558
558
|
id: -1,
|
|
559
559
|
name: "--",
|
|
560
|
-
folder_id:
|
|
561
|
-
folder_path:
|
|
560
|
+
folder_id: N.id,
|
|
561
|
+
folder_path: N.path
|
|
562
562
|
}, ie = {
|
|
563
|
-
id:
|
|
563
|
+
id: Le,
|
|
564
564
|
name: "All groups",
|
|
565
|
-
folder_id:
|
|
566
|
-
folder_path:
|
|
567
|
-
},
|
|
565
|
+
folder_id: N.id,
|
|
566
|
+
folder_path: N.path
|
|
567
|
+
}, Q = () => (ie.name = w()?.Common.All_groups, ie), Ne = () => (ie.name = w()?.Keywords.Choose_group, ie), kt = (e, t, o) => (e = [...e], t !== void 0 && (e = e.filter((n) => n.on == Number(t))), o && o.id && o.childsIds && (e = e.filter((n) => n.folder_id === o.id || o.childsIds.includes(n.folder_id))), e), be = (e) => e.gen("/get/keywords_2/groups/", ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 }), Ct = (e) => e.gen("/add/keywords_2/groups/"), Tt = { class: "top-groupSelector_groupItem" }, jt = {
|
|
568
568
|
key: 0,
|
|
569
569
|
class: "top-comment"
|
|
570
570
|
}, At = {
|
|
571
571
|
key: 1,
|
|
572
572
|
class: "top-groupSelector_groupItemFolderPath"
|
|
573
|
-
}, Bt = /* @__PURE__ */
|
|
573
|
+
}, Bt = /* @__PURE__ */ L({
|
|
574
574
|
__name: "groups",
|
|
575
|
-
props: /* @__PURE__ */
|
|
575
|
+
props: /* @__PURE__ */ _({
|
|
576
576
|
groupId: {},
|
|
577
577
|
group: {},
|
|
578
578
|
projectId: {},
|
|
@@ -592,111 +592,111 @@ const xt = /* @__PURE__ */ G({
|
|
|
592
592
|
group: { required: !0 },
|
|
593
593
|
groupModifiers: {}
|
|
594
594
|
}),
|
|
595
|
-
emits: /* @__PURE__ */
|
|
595
|
+
emits: /* @__PURE__ */ _(["addGroup"], ["update:groupId", "update:group"]),
|
|
596
596
|
setup(e, { emit: t }) {
|
|
597
|
-
const o = e,
|
|
597
|
+
const o = e, n = t, a = b(e, "groupId"), l = b(e, "group"), r = o.client && !o.groups ? be(o.client) : void 0, u = o.client ? Ct(o.client) : void 0, c = M(null), g = M(void 0), I = Te("folder_id", "EQUALS", [o.folder?.id ?? 0]);
|
|
598
598
|
r?.changeParams({
|
|
599
599
|
project_id: o.projectId,
|
|
600
600
|
folder_id_depth: !0,
|
|
601
601
|
filters: [
|
|
602
|
-
|
|
602
|
+
I
|
|
603
603
|
]
|
|
604
604
|
}), o.on !== void 0 && r?.params.filters?.push(Te("on", "EQUALS", [Number(o.on)]));
|
|
605
|
-
const
|
|
606
|
-
|
|
605
|
+
const d = (i) => {
|
|
606
|
+
l.value = i, a.value = i.id;
|
|
607
607
|
};
|
|
608
608
|
me({
|
|
609
609
|
projectId: () => o.projectId,
|
|
610
610
|
folderId: () => o.folder?.id,
|
|
611
611
|
canSelectAll: () => o.canSelectAll
|
|
612
|
-
}, (
|
|
613
|
-
if (
|
|
612
|
+
}, (i) => {
|
|
613
|
+
if (i.projectId && (r?.changeParams({
|
|
614
614
|
project_id: o.projectId
|
|
615
615
|
}), r?.setOptions({
|
|
616
616
|
checkFingerprint: "TopGroupSelectorGroups:" + o.projectId
|
|
617
|
-
})),
|
|
617
|
+
})), i.folderId && (I.values = [
|
|
618
618
|
o.folder?.id ?? 0
|
|
619
|
-
], o.groups && (
|
|
619
|
+
], o.groups && (g.value = kt(o.groups, o.on, o.folder))), c.value?.resetCache(), (i.folderId?.old !== void 0 || i.canSelectAll?.old !== void 0) && a.value !== ne) {
|
|
620
620
|
let s;
|
|
621
|
-
o.autoselect === "first" && (s =
|
|
621
|
+
o.autoselect === "first" && (s = g.value?.[0], o.canSelectAll && (s = _e(Q()))), (o.autoselect === "placeholder" || !s) && (s = Ne()), d(s);
|
|
622
622
|
}
|
|
623
623
|
}, { immediate: !0 }), me({
|
|
624
|
-
modelGroup:
|
|
624
|
+
modelGroup: l,
|
|
625
625
|
modelGroupId: a
|
|
626
|
-
}, async (
|
|
627
|
-
if (a.value !==
|
|
628
|
-
if (
|
|
629
|
-
a.value =
|
|
626
|
+
}, async (i) => {
|
|
627
|
+
if (a.value !== l.value.id) {
|
|
628
|
+
if (i.modelGroup && !i.modelGroupId) {
|
|
629
|
+
a.value = l.value.id;
|
|
630
630
|
return;
|
|
631
631
|
}
|
|
632
|
-
if (!(o.canAdd && a.value ===
|
|
632
|
+
if (!(o.canAdd && a.value === ne)) {
|
|
633
633
|
if (o.groups) {
|
|
634
|
-
let s =
|
|
635
|
-
if (!s && o.canSelectAll && (s =
|
|
636
|
-
|
|
634
|
+
let s = g.value?.find((f) => f.id === a.value);
|
|
635
|
+
if (!s && o.canSelectAll && (s = Q()), s)
|
|
636
|
+
d(s);
|
|
637
637
|
else {
|
|
638
|
-
const
|
|
639
|
-
|
|
638
|
+
const f = g.value?.[0];
|
|
639
|
+
f && !a.value ? d(f) : d(re);
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
|
-
if (o.client && !o.groups && (a.value || a.value ===
|
|
643
|
-
const s =
|
|
642
|
+
if (o.client && !o.groups && (a.value || a.value === Le && !o.canSelectAll)) {
|
|
643
|
+
const s = be(o.client).changeParams({
|
|
644
644
|
project_id: o.projectId,
|
|
645
645
|
id: a.value,
|
|
646
646
|
filters: [
|
|
647
|
-
|
|
647
|
+
I
|
|
648
648
|
]
|
|
649
649
|
});
|
|
650
650
|
s?.setOptions({
|
|
651
651
|
checkFingerprint: "TopGroupSelectorFindGroup:" + o.projectId
|
|
652
652
|
});
|
|
653
|
-
const
|
|
654
|
-
if (!
|
|
655
|
-
!
|
|
653
|
+
const f = await s.call();
|
|
654
|
+
if (!f.errors?.length && !f.result) return;
|
|
655
|
+
!f.errors && f.result[0] ? d(f.result[0]) : d(re);
|
|
656
656
|
}
|
|
657
657
|
}
|
|
658
658
|
}
|
|
659
659
|
}, { immediate: !0 });
|
|
660
|
-
const
|
|
660
|
+
const m = async (i) => {
|
|
661
661
|
if (o.canAdd !== "api" || !u) return;
|
|
662
|
-
const s =
|
|
662
|
+
const s = l.value, f = await u.changeParams({
|
|
663
663
|
project_id: o.projectId,
|
|
664
|
-
names: [
|
|
665
|
-
to_id: o.folder?.id ??
|
|
664
|
+
names: [i.name],
|
|
665
|
+
to_id: o.folder?.id ?? N.id,
|
|
666
666
|
to_type: "in_folder_last"
|
|
667
667
|
}).call();
|
|
668
|
-
|
|
668
|
+
f.result ? (d(f.result), n("addGroup", f.result)) : d(s), c.value?.resetCache(!0);
|
|
669
669
|
};
|
|
670
|
-
return (
|
|
670
|
+
return (i, s) => (p(), T(ye, {
|
|
671
671
|
ref_key: "refSelector",
|
|
672
672
|
ref: c,
|
|
673
673
|
class: "top-groupSelector_group",
|
|
674
|
-
modelValue:
|
|
675
|
-
"onUpdate:modelValue": s[0] || (s[0] = (
|
|
676
|
-
items:
|
|
674
|
+
modelValue: l.value,
|
|
675
|
+
"onUpdate:modelValue": s[0] || (s[0] = (f) => l.value = f),
|
|
676
|
+
items: g.value ?? e.groups,
|
|
677
677
|
searchType: "inline",
|
|
678
678
|
icon: e.addIcon ? "" : void 0,
|
|
679
|
-
api: e.groups ? void 0 :
|
|
680
|
-
apiSetSearchParams: (...
|
|
679
|
+
api: e.groups ? void 0 : v(r),
|
|
680
|
+
apiSetSearchParams: (...f) => v(Ie)(...f, "name"),
|
|
681
681
|
appendSearchToResult: !!e.canAdd,
|
|
682
|
-
useAllItem: e.canSelectAll ?
|
|
682
|
+
useAllItem: e.canSelectAll ? v(Q)().name : !1,
|
|
683
683
|
addChanger: e.addChanger,
|
|
684
684
|
useCache: "",
|
|
685
|
-
onAppendItem:
|
|
685
|
+
onAppendItem: m
|
|
686
686
|
}, {
|
|
687
|
-
item: C(({ item:
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
687
|
+
item: C(({ item: f }) => [
|
|
688
|
+
O("div", Tt, [
|
|
689
|
+
f.id === v(ne) ? (p(), j("div", jt, B(i.$i18n.Common.Add) + ": ", 1)) : V("", !0),
|
|
690
|
+
O("span", null, B(f.name), 1),
|
|
691
|
+
f.folder_path && e.showPath ? (p(), j("span", At, B(f.folder_path), 1)) : V("", !0)
|
|
692
692
|
])
|
|
693
693
|
]),
|
|
694
694
|
_: 1
|
|
695
695
|
}, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "appendSearchToResult", "useAllItem", "addChanger"]));
|
|
696
696
|
}
|
|
697
|
-
}), bt = { class: "top-groupSelector" }, co = /* @__PURE__ */
|
|
697
|
+
}), bt = { class: "top-groupSelector" }, co = /* @__PURE__ */ L({
|
|
698
698
|
__name: "groupSelector",
|
|
699
|
-
props: /* @__PURE__ */
|
|
699
|
+
props: /* @__PURE__ */ _({
|
|
700
700
|
folderId: {},
|
|
701
701
|
folder: {},
|
|
702
702
|
groupId: {},
|
|
@@ -723,36 +723,36 @@ const xt = /* @__PURE__ */ G({
|
|
|
723
723
|
group: { default: re },
|
|
724
724
|
groupModifiers: {}
|
|
725
725
|
}),
|
|
726
|
-
emits: /* @__PURE__ */
|
|
726
|
+
emits: /* @__PURE__ */ _(["update:groups"], ["update:folderId", "update:folder", "update:groupId", "update:group"]),
|
|
727
727
|
setup(e, { emit: t }) {
|
|
728
|
-
const o = e,
|
|
729
|
-
a.value = c.get(
|
|
730
|
-
let
|
|
731
|
-
|
|
732
|
-
const
|
|
733
|
-
let
|
|
734
|
-
o.groups &&
|
|
728
|
+
const o = e, n = b(e, "folderId"), a = b(e, "folder"), l = b(e, "groupId"), r = b(e, "group"), u = t, c = Se(o.folders ?? { root: [N] }, o.canSelectAllGroups);
|
|
729
|
+
a.value = c.get(n.value);
|
|
730
|
+
let g = o.groups?.find((d) => d.id === l.value);
|
|
731
|
+
l.value || (g = o.groups?.[0]), o.canSelectAllGroups && !g && (g = Q()), o.canSelectAllGroups && !g && (g = Q()), (o.autoselect === "placeholder" || !g) && (g = Ne()), g ??= re, r.value = g;
|
|
732
|
+
const I = (d) => {
|
|
733
|
+
let m;
|
|
734
|
+
o.groups && d && (m = [...o.groups, d]), u("update:groups", m);
|
|
735
735
|
};
|
|
736
|
-
return (
|
|
737
|
-
e.showFolders ? (
|
|
736
|
+
return (d, m) => (p(), j("div", bt, [
|
|
737
|
+
e.showFolders ? (p(), T(xt, {
|
|
738
738
|
key: 0,
|
|
739
|
-
folderId:
|
|
740
|
-
"onUpdate:folderId":
|
|
739
|
+
folderId: n.value,
|
|
740
|
+
"onUpdate:folderId": m[0] || (m[0] = (i) => n.value = i),
|
|
741
741
|
folder: a.value,
|
|
742
|
-
"onUpdate:folder":
|
|
742
|
+
"onUpdate:folder": m[1] || (m[1] = (i) => a.value = i),
|
|
743
743
|
projectId: e.projectId,
|
|
744
744
|
folders: e.folders,
|
|
745
745
|
canSelectAll: e.canSelectAllGroups,
|
|
746
746
|
addChanger: e.addChanger,
|
|
747
747
|
addIcon: e.addIcon,
|
|
748
748
|
client: e.client
|
|
749
|
-
}, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client"])) :
|
|
750
|
-
e.showGroups ? (
|
|
749
|
+
}, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client"])) : V("", !0),
|
|
750
|
+
e.showGroups ? (p(), T(Bt, {
|
|
751
751
|
key: 1,
|
|
752
|
-
groupId:
|
|
753
|
-
"onUpdate:groupId":
|
|
752
|
+
groupId: l.value,
|
|
753
|
+
"onUpdate:groupId": m[2] || (m[2] = (i) => l.value = i),
|
|
754
754
|
group: r.value,
|
|
755
|
-
"onUpdate:group":
|
|
755
|
+
"onUpdate:group": m[3] || (m[3] = (i) => r.value = i),
|
|
756
756
|
projectId: e.projectId,
|
|
757
757
|
folder: a.value,
|
|
758
758
|
groups: e.groups,
|
|
@@ -764,11 +764,11 @@ const xt = /* @__PURE__ */ G({
|
|
|
764
764
|
showPath: e.showFolders && !!e.folders?.[0],
|
|
765
765
|
addIcon: e.addIcon,
|
|
766
766
|
client: e.client,
|
|
767
|
-
onAddGroup:
|
|
768
|
-
}, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "showPath", "addIcon", "client"])) :
|
|
767
|
+
onAddGroup: I
|
|
768
|
+
}, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "showPath", "addIcon", "client"])) : V("", !0)
|
|
769
769
|
]));
|
|
770
770
|
}
|
|
771
|
-
}),
|
|
771
|
+
}), wt = { class: "top-projectSelectorSubmenu_item" }, $t = ["href", "title", "data-top-icon", "data-right"], Pt = { class: "top-projectSelectorSubmenu_item" }, Mt = ["href"], Vt = /* @__PURE__ */ L({
|
|
772
772
|
__name: "submenu",
|
|
773
773
|
props: {
|
|
774
774
|
id: {},
|
|
@@ -776,8 +776,8 @@ const xt = /* @__PURE__ */ G({
|
|
|
776
776
|
url: {}
|
|
777
777
|
},
|
|
778
778
|
setup(e) {
|
|
779
|
-
const t = e, o =
|
|
780
|
-
let
|
|
779
|
+
const t = e, o = w();
|
|
780
|
+
let n = [
|
|
781
781
|
{
|
|
782
782
|
href: `/project/keywords/${t.id}/`,
|
|
783
783
|
title: o.Common.Menu_phrases,
|
|
@@ -845,10 +845,10 @@ const xt = /* @__PURE__ */ G({
|
|
|
845
845
|
right: "2"
|
|
846
846
|
}
|
|
847
847
|
];
|
|
848
|
-
const a =
|
|
849
|
-
return (
|
|
848
|
+
const a = P(() => t.right.includes("0") ? n.filter((l) => t.right[l.right] === "1") : n);
|
|
849
|
+
return (l, r) => {
|
|
850
850
|
const u = Ee("TopButton");
|
|
851
|
-
return
|
|
851
|
+
return p(), T(v(pe), {
|
|
852
852
|
class: "top-projectSelectorSubmenu",
|
|
853
853
|
notch: !1,
|
|
854
854
|
pos: "2"
|
|
@@ -861,20 +861,20 @@ const xt = /* @__PURE__ */ G({
|
|
|
861
861
|
})
|
|
862
862
|
]),
|
|
863
863
|
contentList: C(() => [
|
|
864
|
-
(
|
|
865
|
-
|
|
864
|
+
(p(!0), j(D, null, se(a.value, (c) => (p(), j("li", wt, [
|
|
865
|
+
O("a", {
|
|
866
866
|
href: c.href,
|
|
867
867
|
title: c.title,
|
|
868
868
|
"data-top-icon": c.icon,
|
|
869
869
|
"data-right": c.right
|
|
870
|
-
}, null, 8,
|
|
870
|
+
}, null, 8, $t)
|
|
871
871
|
]))), 256)),
|
|
872
|
-
|
|
873
|
-
|
|
872
|
+
O("li", Pt, [
|
|
873
|
+
O("a", {
|
|
874
874
|
href: e.url,
|
|
875
875
|
"data-top-icon": "",
|
|
876
876
|
target: "_blank"
|
|
877
|
-
}, null, 8,
|
|
877
|
+
}, null, 8, Mt)
|
|
878
878
|
])
|
|
879
879
|
]),
|
|
880
880
|
_: 1
|
|
@@ -888,54 +888,54 @@ const xt = /* @__PURE__ */ G({
|
|
|
888
888
|
type: "title"
|
|
889
889
|
}
|
|
890
890
|
}), _t = (e) => {
|
|
891
|
-
const t =
|
|
891
|
+
const t = w();
|
|
892
892
|
return [
|
|
893
|
-
{ filter: (
|
|
894
|
-
{ filter: (
|
|
895
|
-
{ filter: (
|
|
896
|
-
].flatMap(({ filter:
|
|
897
|
-
const
|
|
898
|
-
return
|
|
893
|
+
{ filter: (n) => n.right.startsWith("1") && n.on > 0, title: ge(t.Projects.Scheduled_update) },
|
|
894
|
+
{ filter: (n) => n.right.startsWith("1") && n.on === 0, title: ge(t.Projects.Manual_update) },
|
|
895
|
+
{ filter: (n) => n.right.startsWith("0") && n.on >= 0, title: ge(t.Projects.Guest_projects) }
|
|
896
|
+
].flatMap(({ filter: n, title: a }) => {
|
|
897
|
+
const l = e.filter(n);
|
|
898
|
+
return l.length ? [a, ...l] : [];
|
|
899
899
|
});
|
|
900
|
-
}, Et = (e) => e.map((
|
|
901
|
-
...
|
|
900
|
+
}, Et = (e, t) => e.map((o) => ({
|
|
901
|
+
...o,
|
|
902
902
|
listItemProps: {
|
|
903
903
|
class: "top-projectSelector_item",
|
|
904
|
-
href: qe(Number(
|
|
905
|
-
title:
|
|
904
|
+
href: t ? qe(Number(o.id)) : void 0,
|
|
905
|
+
title: o.name
|
|
906
906
|
}
|
|
907
|
-
})),
|
|
908
|
-
if (!e) return;
|
|
909
|
-
t && (e = e.filter((
|
|
910
|
-
const
|
|
911
|
-
return _t(
|
|
912
|
-
},
|
|
907
|
+
})), Gt = (e, t, o) => {
|
|
908
|
+
if (!e || e.length === 0) return;
|
|
909
|
+
t && (e = e.filter((a) => a.id !== t));
|
|
910
|
+
const n = Et(e, o);
|
|
911
|
+
return _t(n);
|
|
912
|
+
}, Lt = (e) => {
|
|
913
913
|
if (!e) return "";
|
|
914
914
|
let t = e;
|
|
915
915
|
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;
|
|
916
916
|
}, qe = (e) => {
|
|
917
917
|
const t = location.pathname.split("/");
|
|
918
|
-
let o = "project/dynamics/",
|
|
919
|
-
t[1] == "project" && (o = t[1] + "/" + t[2] + "/"), ["watcher", "indexing", "sitemap", "audit", "direct", "adwords"].includes(t[4]) && (
|
|
920
|
-
let a = "/" + o + e + "/" +
|
|
921
|
-
const
|
|
922
|
-
return a +=
|
|
918
|
+
let o = "project/dynamics/", n = "";
|
|
919
|
+
t[1] == "project" && (o = t[1] + "/" + t[2] + "/"), ["watcher", "indexing", "sitemap", "audit", "direct", "adwords"].includes(t[4]) && (n = t[4] + "/");
|
|
920
|
+
let a = "/" + o + e + "/" + n;
|
|
921
|
+
const l = Lt(location.hash);
|
|
922
|
+
return a += l, a;
|
|
923
923
|
}, we = (e) => {
|
|
924
924
|
let t = e.startsWith("http") ? e : "http://" + e;
|
|
925
925
|
return t = t.replace(/"/g, "%22"), t;
|
|
926
|
-
},
|
|
927
|
-
const
|
|
928
|
-
return
|
|
929
|
-
l.result =
|
|
930
|
-
},
|
|
931
|
-
},
|
|
926
|
+
}, $e = (e, t, o, n) => {
|
|
927
|
+
const a = e.gen("/get/projects_2/projects/", ["id", "user_id", "name", "url", "on", "right"]);
|
|
928
|
+
return a.options.onApiLoaded = (l, r, u) => {
|
|
929
|
+
l.result = Gt(l.result, o, n), u?.(l, r);
|
|
930
|
+
}, t && (a.params.limit = t), a;
|
|
931
|
+
}, Kt = (e) => e.gen("/add/projects_2/projects/"), Ot = { class: "top-projectSelector_itemText" }, Rt = { class: "top-projectSelector_itemName" }, Nt = { class: "top-projectSelector_itemId" }, qt = { key: 1 }, Dt = {
|
|
932
932
|
key: 0,
|
|
933
933
|
class: "top-comment"
|
|
934
|
-
}, go = /* @__PURE__ */
|
|
934
|
+
}, go = /* @__PURE__ */ L({
|
|
935
935
|
__name: "projectSelector",
|
|
936
|
-
props: /* @__PURE__ */
|
|
936
|
+
props: /* @__PURE__ */ _({
|
|
937
937
|
project: {},
|
|
938
|
-
|
|
938
|
+
addLinksToProjects: { type: Boolean, default: !0 },
|
|
939
939
|
userId: { default: window.mo?.user?.id },
|
|
940
940
|
icon: {},
|
|
941
941
|
excludeProjectId: {},
|
|
@@ -946,159 +946,160 @@ const xt = /* @__PURE__ */ G({
|
|
|
946
946
|
client: {}
|
|
947
947
|
}, {
|
|
948
948
|
project: {
|
|
949
|
-
default: { id:
|
|
949
|
+
default: { id: ne, name: "" }
|
|
950
950
|
},
|
|
951
951
|
projectModifiers: {}
|
|
952
952
|
}),
|
|
953
953
|
emits: ["update:project"],
|
|
954
954
|
setup(e) {
|
|
955
|
-
const t =
|
|
956
|
-
|
|
957
|
-
const r = o.client ?
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
955
|
+
const t = w(), o = e, n = P(() => o.placeholder ?? t.Projects.Select_project), a = P(() => o.openerText ?? t.Common.Projects), l = b(e, "project");
|
|
956
|
+
l.value.name || (l.value.name = a.value);
|
|
957
|
+
const r = o.client ? $e(o.client, 100, o.excludeProjectId, o.addLinksToProjects) : void 0, u = o.client ? Kt(o.client) : void 0, c = M([]), g = M(null), I = M(!1), d = async () => {
|
|
958
|
+
if (!o.client) return;
|
|
959
|
+
const s = await $e(o.client, 1e3, o.excludeProjectId, o.addLinksToProjects).call();
|
|
960
|
+
s.errors || s.total && s.total < 1e3 && (c.value = s.result);
|
|
961
|
+
}, m = async (i) => {
|
|
962
962
|
if (!u) return;
|
|
963
|
-
const
|
|
963
|
+
const s = await u.changeParams({
|
|
964
964
|
url: i.name,
|
|
965
965
|
name: i.name
|
|
966
966
|
}).call();
|
|
967
|
-
if (!
|
|
968
|
-
if (
|
|
969
|
-
const
|
|
970
|
-
id: Number(
|
|
967
|
+
if (!s.errors)
|
|
968
|
+
if (c) {
|
|
969
|
+
const f = {
|
|
970
|
+
id: Number(s.result),
|
|
971
971
|
url: i.name,
|
|
972
972
|
name: i.name,
|
|
973
973
|
user_id: o.userId,
|
|
974
974
|
on: 0,
|
|
975
975
|
right: "11111111111111111111",
|
|
976
976
|
listItemProps: {
|
|
977
|
-
class: "top-projectSelector_item",
|
|
978
|
-
href: qe(Number(
|
|
977
|
+
class: "top-projectSelector_item top-active",
|
|
978
|
+
href: o.addLinksToProjects ? qe(Number(s.result)) : void 0
|
|
979
979
|
}
|
|
980
980
|
};
|
|
981
|
-
c.value?.unshift(
|
|
981
|
+
c.value?.unshift(f);
|
|
982
982
|
} else
|
|
983
|
-
|
|
983
|
+
g.value?.resetCache(!0);
|
|
984
984
|
};
|
|
985
|
-
return Ue(() => {
|
|
986
|
-
|
|
987
|
-
}), (i,
|
|
988
|
-
const
|
|
989
|
-
return
|
|
985
|
+
return Ue(async () => {
|
|
986
|
+
await d(), I.value = !0, l.value.name || (l.value.name = a.value);
|
|
987
|
+
}), (i, s) => {
|
|
988
|
+
const f = Ee("TopButton");
|
|
989
|
+
return I.value ? (p(), T(ye, {
|
|
990
|
+
key: 0,
|
|
990
991
|
ref_key: "refSelector",
|
|
991
|
-
ref:
|
|
992
|
+
ref: g,
|
|
992
993
|
class: "top-projectSelector",
|
|
993
|
-
modelValue:
|
|
994
|
-
"onUpdate:modelValue":
|
|
994
|
+
modelValue: l.value,
|
|
995
|
+
"onUpdate:modelValue": s[1] || (s[1] = (A) => l.value = A),
|
|
995
996
|
items: c.value,
|
|
996
997
|
title: i.$i18n.Projects.Search_projects,
|
|
997
998
|
icon: e.icon,
|
|
998
999
|
modificator: "projectSelector",
|
|
999
|
-
placeholder:
|
|
1000
|
-
api:
|
|
1001
|
-
apiSetSearchParams:
|
|
1000
|
+
placeholder: n.value,
|
|
1001
|
+
api: c.value.length !== 0 ? void 0 : v(r),
|
|
1002
|
+
apiSetSearchParams: c.value.length !== 0 ? void 0 : (...A) => v(Ie)(...A, "name"),
|
|
1002
1003
|
useCache: "",
|
|
1003
1004
|
appendSearchToResult: "",
|
|
1004
|
-
appendSearchToResultCond:
|
|
1005
|
+
appendSearchToResultCond: v(je),
|
|
1005
1006
|
buttonProps: e.buttonProps,
|
|
1006
1007
|
openerShortcut: e.openerShortcut,
|
|
1007
|
-
onAppendItem:
|
|
1008
|
+
onAppendItem: m
|
|
1008
1009
|
}, {
|
|
1009
1010
|
widgetAction: C(() => [
|
|
1010
|
-
i.$core.state.isMobile ?
|
|
1011
|
+
i.$core.state.isMobile ? V("", !0) : (p(), T(f, {
|
|
1011
1012
|
key: 0,
|
|
1012
1013
|
class: "top-projectSelector_cancel closer",
|
|
1013
1014
|
color: "theme"
|
|
1014
1015
|
}, {
|
|
1015
1016
|
default: C(() => [
|
|
1016
|
-
|
|
1017
|
+
q(B(i.$i18n.Common.Cancel), 1)
|
|
1017
1018
|
]),
|
|
1018
1019
|
_: 1
|
|
1019
1020
|
}))
|
|
1020
1021
|
]),
|
|
1021
|
-
item: C(({ item:
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1022
|
+
item: C(({ item: A }) => [
|
|
1023
|
+
A.id ? (p(), j(D, { key: 0 }, [
|
|
1024
|
+
O("div", Ot, [
|
|
1025
|
+
O("span", Rt, B(A.name), 1),
|
|
1026
|
+
O("span", Nt, " id " + B(A.id), 1)
|
|
1026
1027
|
]),
|
|
1027
|
-
E(
|
|
1028
|
+
E(f, {
|
|
1028
1029
|
class: "top-projectSelector_itemLink",
|
|
1029
|
-
href:
|
|
1030
|
+
href: v(we)(A.url),
|
|
1030
1031
|
"data-top-icon": "",
|
|
1031
1032
|
color: "theme",
|
|
1032
1033
|
target: "_blank",
|
|
1033
|
-
onClick:
|
|
1034
|
+
onClick: s[0] || (s[0] = U(() => {
|
|
1034
1035
|
}, ["stop"]))
|
|
1035
1036
|
}, null, 8, ["href"]),
|
|
1036
1037
|
E(Vt, {
|
|
1037
|
-
id:
|
|
1038
|
-
right:
|
|
1039
|
-
url:
|
|
1038
|
+
id: A.id,
|
|
1039
|
+
right: A.right ?? void 0,
|
|
1040
|
+
url: v(we)(A.url)
|
|
1040
1041
|
}, null, 8, ["id", "right", "url"])
|
|
1041
|
-
], 64)) : (
|
|
1042
|
-
|
|
1043
|
-
|
|
1042
|
+
], 64)) : (p(), j("div", qt, [
|
|
1043
|
+
v(je)(A.name) ? (p(), j("div", Dt, B(i.$i18n.Projects.Add_project) + ": ", 1)) : V("", !0),
|
|
1044
|
+
q(" " + B(A.name), 1)
|
|
1044
1045
|
]))
|
|
1045
1046
|
]),
|
|
1046
1047
|
_: 1
|
|
1047
|
-
}, 8, ["modelValue", "items", "title", "icon", "placeholder", "api", "apiSetSearchParams", "appendSearchToResultCond", "buttonProps", "openerShortcut"]);
|
|
1048
|
+
}, 8, ["modelValue", "items", "title", "icon", "placeholder", "api", "apiSetSearchParams", "appendSearchToResultCond", "buttonProps", "openerShortcut"])) : V("", !0);
|
|
1048
1049
|
};
|
|
1049
1050
|
}
|
|
1050
|
-
}),
|
|
1051
|
-
e =
|
|
1052
|
-
const o = t.find((
|
|
1051
|
+
}), Pe = (e) => "-" + e, Z = (e) => e[0] === "-" ? e.substring(1) : e, de = (e, t) => {
|
|
1052
|
+
e = Z(e);
|
|
1053
|
+
const o = t.find((n) => n.id === e);
|
|
1053
1054
|
if (o)
|
|
1054
1055
|
return o;
|
|
1055
1056
|
}, fo = (e, t, o) => {
|
|
1056
1057
|
t || (t = { id: e.id }), t.id = e.id, t.pos ??= "3", t.notch ??= !0, t.posBy ??= "fixed";
|
|
1057
|
-
const
|
|
1058
|
-
return
|
|
1059
|
-
a.preventDefault(), a.stopPropagation(),
|
|
1060
|
-
const
|
|
1061
|
-
model:
|
|
1058
|
+
const n = at.genElPopupOpener("div", t);
|
|
1059
|
+
return n.classList.add("top-tagSelector"), e.useTopButton && n.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), e.useTopButton || n.classList.add("top-tagSelector-custom"), e.mode === "filter" && n.classList.add("top-tagSelector-filter"), e.mode === "setter" && !e.filters && n.classList.add("top-tagSelector-setter_single"), e.mode === "setter" && e.filters && n.classList.add("top-tagSelector-setter_several"), n.onclick = (a) => {
|
|
1060
|
+
a.preventDefault(), a.stopPropagation(), n.onclick = null;
|
|
1061
|
+
const l = M(e.modelValue), r = {
|
|
1062
|
+
model: l,
|
|
1062
1063
|
mode: e.mode,
|
|
1063
1064
|
targetId: e.targetId,
|
|
1064
1065
|
filters: e.filters,
|
|
1065
1066
|
payload: e.payload
|
|
1066
1067
|
};
|
|
1067
|
-
|
|
1068
|
-
e.modelValue =
|
|
1069
|
-
}),
|
|
1070
|
-
},
|
|
1068
|
+
H(n, "topTagSelectorTarget", r), delete n.dataset.topPopupDisabled, ke(e.modelValue) || G(l, () => {
|
|
1069
|
+
e.modelValue = l.value, oe(n, e, o);
|
|
1070
|
+
}), n.click();
|
|
1071
|
+
}, ke(e.modelValue) ? G(e.modelValue, () => oe(n, e, o)) : H(n, "topTagSelectorRender", (a) => {
|
|
1071
1072
|
e.modelValue = a;
|
|
1072
|
-
const
|
|
1073
|
-
|
|
1074
|
-
}), oe(
|
|
1073
|
+
const l = H(n, "topTagSelectorTarget");
|
|
1074
|
+
l && (l.model.value = a), oe(n, e, o);
|
|
1075
|
+
}), oe(n, e, o), n;
|
|
1075
1076
|
}, mo = (e, t) => {
|
|
1076
|
-
|
|
1077
|
+
H(e, "topTagSelectorRender")?.(t);
|
|
1077
1078
|
}, oe = (e, t, o) => {
|
|
1078
|
-
const
|
|
1079
|
-
if (e.classList.toggle("top-tagSelector-selectedOne", !
|
|
1079
|
+
const n = v(t.modelValue);
|
|
1080
|
+
if (e.classList.toggle("top-tagSelector-selectedOne", !n.length || n.length === 1), e.classList.toggle("top-tagSelector-toTwoLine", n.length > 5), t.mode === "setter" && t.filters) {
|
|
1080
1081
|
e.innerHTML = `<div>${o}</div>`;
|
|
1081
1082
|
return;
|
|
1082
1083
|
}
|
|
1083
|
-
if (e.innerHTML = "", !
|
|
1084
|
-
const a =
|
|
1084
|
+
if (e.innerHTML = "", !n.length && t.mode === "filter") {
|
|
1085
|
+
const a = Me({
|
|
1085
1086
|
id: "all",
|
|
1086
1087
|
colorId: "",
|
|
1087
|
-
name:
|
|
1088
|
+
name: w().Common?.All_tags ?? "",
|
|
1088
1089
|
state: ""
|
|
1089
1090
|
});
|
|
1090
1091
|
e.append(a);
|
|
1091
1092
|
}
|
|
1092
|
-
|
|
1093
|
-
const
|
|
1094
|
-
id:
|
|
1093
|
+
n.forEach((a) => {
|
|
1094
|
+
const l = Me({
|
|
1095
|
+
id: Z(a),
|
|
1095
1096
|
colorId: de(a, t.tags)?.color_id ?? "",
|
|
1096
1097
|
name: de(a, t.tags)?.name ?? "",
|
|
1097
|
-
state:
|
|
1098
|
+
state: Z(a) === a ? "selected" : "excluded"
|
|
1098
1099
|
});
|
|
1099
|
-
e.append(
|
|
1100
|
+
e.append(l);
|
|
1100
1101
|
});
|
|
1101
|
-
},
|
|
1102
|
+
}, Me = (e) => {
|
|
1102
1103
|
const t = document.createElement("div");
|
|
1103
1104
|
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;
|
|
1104
1105
|
}, Ut = [
|
|
@@ -1152,7 +1153,7 @@ const xt = /* @__PURE__ */ G({
|
|
|
1152
1153
|
name: "Turquoise",
|
|
1153
1154
|
color_id: "10"
|
|
1154
1155
|
}
|
|
1155
|
-
], Ft = ["data-tag_id", "data-tag_color_id", "title"], ve = /* @__PURE__ */
|
|
1156
|
+
], Ft = ["data-tag_id", "data-tag_color_id", "title"], ve = /* @__PURE__ */ L({
|
|
1156
1157
|
__name: "tagIcon",
|
|
1157
1158
|
props: {
|
|
1158
1159
|
id: {},
|
|
@@ -1161,8 +1162,8 @@ const xt = /* @__PURE__ */ G({
|
|
|
1161
1162
|
state: {}
|
|
1162
1163
|
},
|
|
1163
1164
|
setup(e) {
|
|
1164
|
-
return (t, o) => (
|
|
1165
|
-
class:
|
|
1165
|
+
return (t, o) => (p(), j("div", {
|
|
1166
|
+
class: ee({
|
|
1166
1167
|
"top-tagSelector_tagIcon": !0,
|
|
1167
1168
|
"top-tagSelector-active": !!e.state,
|
|
1168
1169
|
"top-tagSelector-excluded": e.state === "excluded"
|
|
@@ -1172,9 +1173,9 @@ const xt = /* @__PURE__ */ G({
|
|
|
1172
1173
|
title: e.name
|
|
1173
1174
|
}, null, 10, Ft));
|
|
1174
1175
|
}
|
|
1175
|
-
}), Wt = ["contenteditable", "onKeydown"], Ve = /* @__PURE__ */
|
|
1176
|
+
}), Wt = ["contenteditable", "onKeydown"], Ve = /* @__PURE__ */ L({
|
|
1176
1177
|
__name: "tagPopupListItem",
|
|
1177
|
-
props: /* @__PURE__ */
|
|
1178
|
+
props: /* @__PURE__ */ _({
|
|
1178
1179
|
editable: { type: Boolean },
|
|
1179
1180
|
disabled: { type: Boolean },
|
|
1180
1181
|
canExclude: { type: Boolean },
|
|
@@ -1188,26 +1189,26 @@ const xt = /* @__PURE__ */ G({
|
|
|
1188
1189
|
},
|
|
1189
1190
|
nameModifiers: {}
|
|
1190
1191
|
}),
|
|
1191
|
-
emits: /* @__PURE__ */
|
|
1192
|
+
emits: /* @__PURE__ */ _(["update:name", "unselect", "exclude", "select"], ["update:name"]),
|
|
1192
1193
|
setup(e, { emit: t }) {
|
|
1193
|
-
const o = e,
|
|
1194
|
+
const o = e, n = t, a = b(e, "name"), l = M(null), r = P(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
|
|
1194
1195
|
contenteditable: u.value,
|
|
1195
|
-
onpaste: (
|
|
1196
|
-
} : {}), u =
|
|
1197
|
-
u.value = !0, await Fe(),
|
|
1198
|
-
},
|
|
1199
|
-
const
|
|
1200
|
-
if (!
|
|
1201
|
-
|
|
1202
|
-
},
|
|
1203
|
-
|
|
1204
|
-
},
|
|
1196
|
+
onpaste: (m) => m.preventDefault()
|
|
1197
|
+
} : {}), u = M(!1), c = async () => {
|
|
1198
|
+
u.value = !0, await Fe(), l.value?.focus();
|
|
1199
|
+
}, g = () => {
|
|
1200
|
+
const m = l.value?.innerText;
|
|
1201
|
+
if (!m) return I();
|
|
1202
|
+
l.value && (l.value.innerText = m), u.value = !1, n("update:name", m);
|
|
1203
|
+
}, I = async () => {
|
|
1204
|
+
l.value && (l.value.innerText = o.name), u.value = !1;
|
|
1205
|
+
}, d = (m) => {
|
|
1205
1206
|
if (u.value || o.disabled) return;
|
|
1206
|
-
let
|
|
1207
|
-
o.canExclude && (
|
|
1207
|
+
let i = "selected";
|
|
1208
|
+
o.canExclude && (m.ctrlKey || m.metaKey) && (i = "excluded"), o.state == i && (i = ""), i === "" && n("unselect"), i === "selected" && n("select"), i === "excluded" && n("exclude");
|
|
1208
1209
|
};
|
|
1209
|
-
return (
|
|
1210
|
-
class:
|
|
1210
|
+
return (m, i) => (p(), T(he, {
|
|
1211
|
+
class: ee({
|
|
1211
1212
|
"top-tagSelector_tagListItem": !0,
|
|
1212
1213
|
"top-tagSelector_tagListItem-inEdit": u.value,
|
|
1213
1214
|
"top-tagSelector_tagListItem-disabled": e.disabled,
|
|
@@ -1215,7 +1216,7 @@ const xt = /* @__PURE__ */ G({
|
|
|
1215
1216
|
"top-tagSelector-active": !!e.state,
|
|
1216
1217
|
"top-tagSelector-excluded": e.state === "excluded"
|
|
1217
1218
|
}),
|
|
1218
|
-
onClick:
|
|
1219
|
+
onClick: U(d, ["stop"])
|
|
1219
1220
|
}, {
|
|
1220
1221
|
default: C(() => [
|
|
1221
1222
|
E(ve, {
|
|
@@ -1224,38 +1225,38 @@ const xt = /* @__PURE__ */ G({
|
|
|
1224
1225
|
colorId: e.colorId,
|
|
1225
1226
|
state: e.state
|
|
1226
1227
|
}, null, 8, ["id", "name", "colorId", "state"]),
|
|
1227
|
-
|
|
1228
|
+
O("span", Ge({
|
|
1228
1229
|
ref_key: "elName",
|
|
1229
|
-
ref:
|
|
1230
|
+
ref: l,
|
|
1230
1231
|
class: "top-tagSelector_tagListItemName",
|
|
1231
1232
|
contenteditable: u.value ? "plaintext-only" : !1
|
|
1232
1233
|
}, r.value, {
|
|
1233
1234
|
onKeydown: [
|
|
1234
|
-
|
|
1235
|
-
|
|
1235
|
+
Ce(U(g, ["stop"]), ["enter"]),
|
|
1236
|
+
Ce(U(I, ["stop"]), ["esc"])
|
|
1236
1237
|
]
|
|
1237
|
-
}),
|
|
1238
|
-
e.editable ? (
|
|
1239
|
-
u.value ? (
|
|
1238
|
+
}), B(a.value), 17, Wt),
|
|
1239
|
+
e.editable ? (p(), j(D, { key: 0 }, [
|
|
1240
|
+
u.value ? (p(), j("span", {
|
|
1240
1241
|
key: 1,
|
|
1241
1242
|
"data-top-icon": "",
|
|
1242
1243
|
class: "top-tagSelector_edit",
|
|
1243
|
-
onClick:
|
|
1244
|
-
})) : (
|
|
1244
|
+
onClick: U(g, ["stop"])
|
|
1245
|
+
})) : (p(), j("span", {
|
|
1245
1246
|
key: 0,
|
|
1246
1247
|
"data-top-icon": "",
|
|
1247
1248
|
class: "top-tagSelector_edit",
|
|
1248
1249
|
onClick: c
|
|
1249
1250
|
}))
|
|
1250
|
-
], 64)) :
|
|
1251
|
+
], 64)) : V("", !0)
|
|
1251
1252
|
]),
|
|
1252
1253
|
_: 1
|
|
1253
1254
|
}, 8, ["class"]));
|
|
1254
1255
|
}
|
|
1255
|
-
}), zt = { key: 1 }, Jt = /* @__PURE__ */
|
|
1256
|
+
}), zt = { key: 1 }, Jt = /* @__PURE__ */ L({
|
|
1256
1257
|
inheritAttrs: !1,
|
|
1257
1258
|
__name: "popupOpener",
|
|
1258
|
-
props: /* @__PURE__ */
|
|
1259
|
+
props: /* @__PURE__ */ _({
|
|
1259
1260
|
modelValue: {},
|
|
1260
1261
|
id: {},
|
|
1261
1262
|
tags: {},
|
|
@@ -1273,7 +1274,7 @@ const xt = /* @__PURE__ */ G({
|
|
|
1273
1274
|
}),
|
|
1274
1275
|
emits: ["update:modelValue"],
|
|
1275
1276
|
setup(e) {
|
|
1276
|
-
const t = e, o =
|
|
1277
|
+
const t = e, o = b(e, "modelValue"), n = t.useTopButton ? X : "div", a = t.useTopButton ? "html" : "default", l = {
|
|
1277
1278
|
model: o,
|
|
1278
1279
|
mode: t.mode,
|
|
1279
1280
|
targetId: t.targetId,
|
|
@@ -1282,9 +1283,9 @@ const xt = /* @__PURE__ */ G({
|
|
|
1282
1283
|
};
|
|
1283
1284
|
return (r, u) => {
|
|
1284
1285
|
const c = We("top-data");
|
|
1285
|
-
return
|
|
1286
|
+
return p(), T(Ze, { id: e.id }, {
|
|
1286
1287
|
default: C(() => [
|
|
1287
|
-
ze((
|
|
1288
|
+
ze((p(), T(Je(v(n)), Ge({
|
|
1288
1289
|
class: {
|
|
1289
1290
|
"top-tagSelector": !0,
|
|
1290
1291
|
"top-tagSelector-useTopButton": t.useTopButton,
|
|
@@ -1299,35 +1300,35 @@ const xt = /* @__PURE__ */ G({
|
|
|
1299
1300
|
color: "theme",
|
|
1300
1301
|
styling: e.styling
|
|
1301
1302
|
}, r.$attrs), {
|
|
1302
|
-
[
|
|
1303
|
-
!o.value.length && e.mode === "filter" ? (
|
|
1303
|
+
[v(a)]: C(() => [
|
|
1304
|
+
!o.value.length && e.mode === "filter" ? (p(), T(ve, {
|
|
1304
1305
|
key: 0,
|
|
1305
1306
|
id: "all",
|
|
1306
1307
|
colorId: "",
|
|
1307
1308
|
name: r.$i18n.Common.All_tags ?? "",
|
|
1308
1309
|
state: ""
|
|
1309
|
-
}, null, 8, ["name"])) :
|
|
1310
|
-
e.mode === "setter" && e.filters ? (
|
|
1310
|
+
}, null, 8, ["name"])) : V("", !0),
|
|
1311
|
+
e.mode === "setter" && e.filters ? (p(), j("div", zt, [
|
|
1311
1312
|
Ye(r.$slots, "default")
|
|
1312
|
-
])) : (
|
|
1313
|
-
id:
|
|
1314
|
-
colorId:
|
|
1315
|
-
name:
|
|
1316
|
-
state:
|
|
1313
|
+
])) : (p(!0), j(D, { key: 2 }, se(o.value, (g) => (p(), T(ve, {
|
|
1314
|
+
id: v(Z)(g),
|
|
1315
|
+
colorId: v(de)(g, e.tags)?.color_id ?? "",
|
|
1316
|
+
name: v(de)(g, e.tags)?.name ?? "",
|
|
1317
|
+
state: v(Z)(g) === g ? "selected" : "excluded"
|
|
1317
1318
|
}, null, 8, ["id", "colorId", "name", "state"]))), 256))
|
|
1318
1319
|
]),
|
|
1319
1320
|
_: 2
|
|
1320
1321
|
}, 1040, ["class", "styling"])), [
|
|
1321
|
-
[c,
|
|
1322
|
+
[c, l, "topTagSelectorTarget"]
|
|
1322
1323
|
])
|
|
1323
1324
|
]),
|
|
1324
1325
|
_: 3
|
|
1325
1326
|
}, 8, ["id"]);
|
|
1326
1327
|
};
|
|
1327
1328
|
}
|
|
1328
|
-
}),
|
|
1329
|
+
}), vo = /* @__PURE__ */ L({
|
|
1329
1330
|
__name: "tagSelector",
|
|
1330
|
-
props: /* @__PURE__ */
|
|
1331
|
+
props: /* @__PURE__ */ _({
|
|
1331
1332
|
modelValue: {},
|
|
1332
1333
|
tags: {},
|
|
1333
1334
|
tagsEditable: { type: Boolean },
|
|
@@ -1349,173 +1350,173 @@ const xt = /* @__PURE__ */ G({
|
|
|
1349
1350
|
},
|
|
1350
1351
|
tagsModifiers: {}
|
|
1351
1352
|
}),
|
|
1352
|
-
emits: /* @__PURE__ */
|
|
1353
|
+
emits: /* @__PURE__ */ _(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
|
|
1353
1354
|
setup(e, { emit: t }) {
|
|
1354
|
-
const o =
|
|
1355
|
-
r(h,
|
|
1356
|
-
},
|
|
1357
|
-
|
|
1358
|
-
const c =
|
|
1359
|
-
const h = " " + o.Common.Tags?.toLowerCase(),
|
|
1360
|
-
return
|
|
1355
|
+
const o = w(), n = e, a = b(e, "modelValue"), l = b(e, "tags"), r = t, u = Xe((h, S) => {
|
|
1356
|
+
r(h, S);
|
|
1357
|
+
}, n.emitDelay);
|
|
1358
|
+
n.singleMode && !a.value.length && (a.value = [l.value[0].id]);
|
|
1359
|
+
const c = n.id ?? "top-popup-id-" + Math.random(), g = M("add"), I = () => {
|
|
1360
|
+
const h = " " + o.Common.Tags?.toLowerCase(), S = /* @__PURE__ */ new Map();
|
|
1361
|
+
return S.set("add", { value: "add", title: o.Common.Add + h }), S.set("replace", { value: "replace", title: o.Common.Replace + h }), S.set("delete", { value: "delete", title: o.Common.Delete + h }), S;
|
|
1361
1362
|
};
|
|
1362
|
-
let
|
|
1363
|
+
let d = He({
|
|
1363
1364
|
model: a,
|
|
1364
1365
|
mode: "filter",
|
|
1365
1366
|
targetId: void 0,
|
|
1366
1367
|
filters: void 0,
|
|
1367
1368
|
payload: void 0
|
|
1368
1369
|
});
|
|
1369
|
-
|
|
1370
|
+
G(a, () => {
|
|
1370
1371
|
u("selector", a.value);
|
|
1371
1372
|
});
|
|
1372
|
-
const
|
|
1373
|
-
if (
|
|
1374
|
-
return
|
|
1375
|
-
}),
|
|
1373
|
+
const m = P(() => {
|
|
1374
|
+
if (d.value.mode === "setter" && n.maxTagsForSetter && !d.value.filters)
|
|
1375
|
+
return d.value.model.value.length >= n.maxTagsForSetter;
|
|
1376
|
+
}), i = (h) => {
|
|
1376
1377
|
if (h !== "all") {
|
|
1377
|
-
if (
|
|
1378
|
-
if (
|
|
1378
|
+
if (d.value.model.value.includes(h)) return "selected";
|
|
1379
|
+
if (d.value.model.value.includes(Pe(h))) return "excluded";
|
|
1379
1380
|
}
|
|
1380
|
-
return h === "all" && !
|
|
1381
|
-
}, s = (h,
|
|
1382
|
-
const x =
|
|
1383
|
-
let k =
|
|
1384
|
-
|
|
1385
|
-
if (!
|
|
1386
|
-
const
|
|
1387
|
-
return
|
|
1388
|
-
}),
|
|
1381
|
+
return h === "all" && !d.value.model.value.length ? "selected" : "";
|
|
1382
|
+
}, s = (h, S) => {
|
|
1383
|
+
const x = Pe(h);
|
|
1384
|
+
let k = d.value.model.value.filter((K) => K !== h && K !== x);
|
|
1385
|
+
S === "select" && k.push(h), S === "exclude" && k.push(x), d.value.mode === "setter" && d.value.targetId !== void 0 && n.requiredForSetter && (k.length || k.push("1"), k.length === 2 && d.value.model.value.length === 1 && d.value.model.value[0] === "1" && (k = k.filter((K) => K !== "1"))), n.singleMode && !d.value.filters && (k.length || (k = d.value.model.value), k.length > 1 && (k = [k[k.length - 1]])), k.sort((K, te) => {
|
|
1386
|
+
if (!n.tags) return 0;
|
|
1387
|
+
const W = n.tags.findIndex((J) => J.id === K), z = n.tags.findIndex((J) => J.id === te);
|
|
1388
|
+
return W - z;
|
|
1389
|
+
}), d.value.model.value = k, d.value.mode === "setter" && d.value.targetId !== void 0 && u("setter", {
|
|
1389
1390
|
tagsIds: k,
|
|
1390
|
-
targetId:
|
|
1391
|
-
payload:
|
|
1391
|
+
targetId: d.value.targetId,
|
|
1392
|
+
payload: d.value.payload
|
|
1392
1393
|
});
|
|
1393
|
-
},
|
|
1394
|
+
}, f = P(() => {
|
|
1394
1395
|
let h = "top-tagSelector_popup";
|
|
1395
|
-
return
|
|
1396
|
-
}),
|
|
1396
|
+
return d.value.mode === "filter" && (h += " top-tagSelector_popup-filter"), d.value.mode === "setter" && (h += " top-tagSelector_popup-setter"), h;
|
|
1397
|
+
}), A = () => {
|
|
1397
1398
|
const h = prompt("", "New tag");
|
|
1398
1399
|
if (!h || h === "New tag") return;
|
|
1399
|
-
const
|
|
1400
|
-
|
|
1401
|
-
id: String(
|
|
1400
|
+
const S = l.value.length + 1;
|
|
1401
|
+
l.value.push({
|
|
1402
|
+
id: String(S),
|
|
1402
1403
|
name: h,
|
|
1403
|
-
color_id: String((
|
|
1404
|
-
}), r("tagsChanged",
|
|
1405
|
-
},
|
|
1406
|
-
if (
|
|
1407
|
-
if (
|
|
1404
|
+
color_id: String((S - 1) % 10 + 1)
|
|
1405
|
+
}), r("tagsChanged", l.value);
|
|
1406
|
+
}, F = (h) => {
|
|
1407
|
+
if (d.value = H(h.elPopupOpener, "topTagSelectorTarget"), !d.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
|
|
1408
|
+
if (d.value.filters && (g.value = "add", d.value.model.value = []), !Y.$?.ui.sortable) {
|
|
1408
1409
|
console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
|
|
1409
1410
|
return;
|
|
1410
1411
|
}
|
|
1411
|
-
!
|
|
1412
|
+
!Y.state.isMobile && !Y.state.isMobileUA && l.value && $(h.elPopup).sortable({
|
|
1412
1413
|
items: 'li:has([data-tag_id]:not([data-tag_id="all"]))',
|
|
1413
1414
|
/**
|
|
1414
1415
|
* @todo Удалить `[contenteditable="true"]` через пол года после выхода версии firefox с поддержкой contenteditable plaintext-only, включая бета версии
|
|
1415
1416
|
*/
|
|
1416
1417
|
cancel: '[contenteditable="plaintext-only"], [contenteditable="true"]',
|
|
1417
1418
|
distance: 10,
|
|
1418
|
-
stop: function(
|
|
1419
|
-
if (!
|
|
1419
|
+
stop: function(S, x) {
|
|
1420
|
+
if (!l.value) return;
|
|
1420
1421
|
const k = $(x.item).parent().find("[data-tag_id]"), K = [];
|
|
1421
|
-
k.each((te,
|
|
1422
|
-
if (!
|
|
1423
|
-
const
|
|
1424
|
-
K.push(
|
|
1425
|
-
}),
|
|
1426
|
-
const
|
|
1427
|
-
return
|
|
1428
|
-
}), u("tagsChanged",
|
|
1422
|
+
k.each((te, W) => {
|
|
1423
|
+
if (!l.value) return;
|
|
1424
|
+
const z = $(W).attr("data-tag_id");
|
|
1425
|
+
K.push(z);
|
|
1426
|
+
}), l.value.sort((te, W) => {
|
|
1427
|
+
const z = K.findIndex((ue) => ue === te.id), J = K.findIndex((ue) => ue === W.id);
|
|
1428
|
+
return z - J;
|
|
1429
|
+
}), u("tagsChanged", l.value);
|
|
1429
1430
|
}
|
|
1430
1431
|
});
|
|
1431
1432
|
}, De = (h) => {
|
|
1432
|
-
|
|
1433
|
+
Y.$?.ui.sortable && $(h.elPopup).data("ui-sortable") && $(h.elPopup).sortable("destroy");
|
|
1433
1434
|
};
|
|
1434
|
-
return (h,
|
|
1435
|
+
return (h, S) => (p(), j(D, null, [
|
|
1435
1436
|
E(Jt, {
|
|
1436
1437
|
modelValue: a.value,
|
|
1437
|
-
"onUpdate:modelValue":
|
|
1438
|
-
id:
|
|
1439
|
-
tags:
|
|
1438
|
+
"onUpdate:modelValue": S[0] || (S[0] = (x) => a.value = x),
|
|
1439
|
+
id: v(c),
|
|
1440
|
+
tags: l.value,
|
|
1440
1441
|
styling: e.styling,
|
|
1441
1442
|
mode: "filter",
|
|
1442
1443
|
useTopButton: e.useTopButton
|
|
1443
1444
|
}, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
|
|
1444
|
-
E(
|
|
1445
|
-
id:
|
|
1446
|
-
class:
|
|
1447
|
-
onOpen:
|
|
1448
|
-
onClose:
|
|
1445
|
+
E(pe, {
|
|
1446
|
+
id: v(c),
|
|
1447
|
+
class: ee(f.value),
|
|
1448
|
+
onOpen: S[4] || (S[4] = (x) => F(x)),
|
|
1449
|
+
onClose: S[5] || (S[5] = (x) => De(x)),
|
|
1449
1450
|
"transition-duration": 50
|
|
1450
1451
|
}, Qe({
|
|
1451
1452
|
contentList: C(() => [
|
|
1452
|
-
|
|
1453
|
+
v(d).mode === "filter" && !e.singleMode ? (p(), T(Ve, {
|
|
1453
1454
|
key: 0,
|
|
1454
1455
|
id: "all",
|
|
1455
1456
|
colorId: "",
|
|
1456
1457
|
name: h.$i18n.Common.All_tags ?? "",
|
|
1457
|
-
state:
|
|
1458
|
-
onSelect:
|
|
1459
|
-
}, null, 8, ["name", "state"])) :
|
|
1460
|
-
(
|
|
1458
|
+
state: v(d).model.value.length ? "" : "selected",
|
|
1459
|
+
onSelect: S[3] || (S[3] = (x) => v(d).model.value = [])
|
|
1460
|
+
}, null, 8, ["name", "state"])) : V("", !0),
|
|
1461
|
+
(p(!0), j(D, null, se(l.value, (x) => (p(), T(Ve, {
|
|
1461
1462
|
key: x.id,
|
|
1462
1463
|
id: x.id,
|
|
1463
1464
|
colorId: x.color_id,
|
|
1464
1465
|
name: x.name,
|
|
1465
|
-
state:
|
|
1466
|
-
canExclude:
|
|
1466
|
+
state: i(x.id),
|
|
1467
|
+
canExclude: v(d).mode === "filter" && !e.singleMode,
|
|
1467
1468
|
editable: e.tagsEditable,
|
|
1468
|
-
disabled:
|
|
1469
|
+
disabled: m.value && i(x.id) === "",
|
|
1469
1470
|
onUnselect: (k) => s(x.id, "unselect"),
|
|
1470
1471
|
onSelect: (k) => s(x.id, "select"),
|
|
1471
1472
|
onExclude: (k) => s(x.id, "exclude"),
|
|
1472
1473
|
"onUpdate:name": (k) => {
|
|
1473
|
-
x.name = k,
|
|
1474
|
+
x.name = k, v(u)("tagsChanged", l.value);
|
|
1474
1475
|
}
|
|
1475
1476
|
}, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
|
|
1476
|
-
e.tagsEditable &&
|
|
1477
|
+
e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (p(), T(he, {
|
|
1477
1478
|
key: 1,
|
|
1478
1479
|
"data-top-icon": "",
|
|
1479
|
-
onClick:
|
|
1480
|
+
onClick: U(A, ["stop"])
|
|
1480
1481
|
}, {
|
|
1481
1482
|
default: C(() => [
|
|
1482
|
-
|
|
1483
|
+
q(B(h.$i18n.Common.Add), 1)
|
|
1483
1484
|
]),
|
|
1484
1485
|
_: 1
|
|
1485
|
-
})) :
|
|
1486
|
+
})) : V("", !0)
|
|
1486
1487
|
]),
|
|
1487
1488
|
_: 2
|
|
1488
1489
|
}, [
|
|
1489
|
-
|
|
1490
|
+
v(d).mode === "setter" && v(d).filters ? {
|
|
1490
1491
|
name: "header",
|
|
1491
1492
|
fn: C(() => [
|
|
1492
1493
|
E(fe, {
|
|
1493
|
-
modelValue:
|
|
1494
|
-
"onUpdate:modelValue":
|
|
1495
|
-
options:
|
|
1494
|
+
modelValue: g.value,
|
|
1495
|
+
"onUpdate:modelValue": S[1] || (S[1] = (x) => g.value = x),
|
|
1496
|
+
options: I()
|
|
1496
1497
|
}, null, 8, ["modelValue", "options"])
|
|
1497
1498
|
]),
|
|
1498
1499
|
key: "0"
|
|
1499
1500
|
} : void 0,
|
|
1500
|
-
|
|
1501
|
+
v(d).mode === "setter" && v(d).filters ? {
|
|
1501
1502
|
name: "footer",
|
|
1502
1503
|
fn: C(() => [
|
|
1503
|
-
E(
|
|
1504
|
+
E(X, { color: "theme" }, {
|
|
1504
1505
|
default: C(() => [
|
|
1505
|
-
|
|
1506
|
+
q(B(h.$i18n.Common.Cancel2), 1)
|
|
1506
1507
|
]),
|
|
1507
1508
|
_: 1
|
|
1508
1509
|
}),
|
|
1509
|
-
E(
|
|
1510
|
-
onClick:
|
|
1511
|
-
tagsIds:
|
|
1512
|
-
filters:
|
|
1513
|
-
filtersAction:
|
|
1514
|
-
payload:
|
|
1510
|
+
E(X, {
|
|
1511
|
+
onClick: S[2] || (S[2] = (x) => v(u)("setter", {
|
|
1512
|
+
tagsIds: v(d).model.value,
|
|
1513
|
+
filters: v(d).filters,
|
|
1514
|
+
filtersAction: g.value,
|
|
1515
|
+
payload: v(d).payload
|
|
1515
1516
|
}))
|
|
1516
1517
|
}, {
|
|
1517
1518
|
default: C(() => [
|
|
1518
|
-
|
|
1519
|
+
q(B(g.value === "add" ? h.$i18n.Common.Add : "") + " " + B(g.value === "replace" ? h.$i18n.Common.Replace : "") + " " + B(g.value === "delete" ? h.$i18n.Common.Delete : ""), 1)
|
|
1519
1520
|
]),
|
|
1520
1521
|
_: 1
|
|
1521
1522
|
})
|
|
@@ -1531,7 +1532,7 @@ export {
|
|
|
1531
1532
|
co as TopGroupSelector,
|
|
1532
1533
|
go as TopProjectSelector,
|
|
1533
1534
|
uo as TopRegionSelector,
|
|
1534
|
-
|
|
1535
|
+
vo as TopTagSelector,
|
|
1535
1536
|
Jt as TopTagSelectorPopupOpener,
|
|
1536
1537
|
ve as TopTagSelectorTagIcon,
|
|
1537
1538
|
mt as dialogRegionSelector,
|