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