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