@topvisor/ui 1.4.0-TopGroupSelector.8 → 1.4.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 +423 -412
- package/project/project.js.map +1 -1
- package/src/components/project/groupSelector/groupSelector.vue.d.ts +5 -0
- package/src/components/project/groupSelector/groups/groups.vue.d.ts +1 -0
- package/src/components/project/groupSelector/groups/types.d.ts +5 -0
- package/src/components/project/groupSelector/groups/utils.d.ts +1 -1
- package/src/components/project/groupSelector/types.d.ts +6 -2
- package/utils/string.amd.js +1 -1
- package/utils/string.amd.js.map +1 -1
- package/utils/string.js +49 -49
- package/utils/string.js.map +1 -1
package/project/project.js
CHANGED
|
@@ -3,20 +3,20 @@
|
|
|
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 w, C as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { a as
|
|
10
|
-
import { u as
|
|
11
|
-
import { getSearcherGIcon as Ye, getLangLabel 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 Y, renderList as me, normalizeClass as X, 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 De, renderSlot as qe, shallowRef as Fe, createSlots as Ue } from "vue";
|
|
7
|
+
import { u as w, C as z, e as Q, p as ce, d as ze } from "../.chunks/forms-BseC3Ftz.es.js";
|
|
8
|
+
import { _ as we, b as ve, a as Je } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-DD59yF6H.es.js";
|
|
9
|
+
import { a as We, _ as Me, b as Ee, c as $e, I as ue } from "../.chunks/policy.vue_vue_type_style_index_0_lang-BBDJEs5Q.es.js";
|
|
10
|
+
import { u as _e } from "../.chunks/utils-YrUExsH7.es.js";
|
|
11
|
+
import { getSearcherGIcon as Ye, getLangLabel as Qe, getDeviceGIcon as He } from "../utils/searchers.js";
|
|
12
12
|
import "../.chunks/core-BL-38XF7.es.js";
|
|
13
13
|
import "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-DRbTG0vh.es.js";
|
|
14
|
-
import { g as
|
|
15
|
-
import { storage as
|
|
16
|
-
import { TopPopupWorker as
|
|
17
|
-
const
|
|
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 Xe } from "../popup/worker.js";
|
|
17
|
+
const Ze = { class: "top-competitorSelector" }, et = { class: "top-ellipsis1" }, Rt = /* @__PURE__ */ R({
|
|
18
18
|
__name: "competitorSelector",
|
|
19
|
-
props: /* @__PURE__ */
|
|
19
|
+
props: /* @__PURE__ */ V({
|
|
20
20
|
modelValue: {},
|
|
21
21
|
items: {},
|
|
22
22
|
showSelectAllItem: { type: Boolean, default: !0 }
|
|
@@ -26,7 +26,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
26
26
|
}),
|
|
27
27
|
emits: ["update:modelValue"],
|
|
28
28
|
setup(e) {
|
|
29
|
-
const a = e, o =
|
|
29
|
+
const a = e, o = T(e, "modelValue"), t = M(() => {
|
|
30
30
|
if (a.showSelectAllItem)
|
|
31
31
|
return {
|
|
32
32
|
icon: "",
|
|
@@ -35,23 +35,23 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
35
35
|
content: ""
|
|
36
36
|
};
|
|
37
37
|
});
|
|
38
|
-
return (r, l) => (h(),
|
|
39
|
-
v(
|
|
38
|
+
return (r, l) => (h(), A("div", Ze, [
|
|
39
|
+
v(z).state.isMobile ? (h(), C(we, { key: 0 }, {
|
|
40
40
|
opener: B(() => [
|
|
41
|
-
|
|
41
|
+
P(Q, {
|
|
42
42
|
class: "top-competitorSelector_opener",
|
|
43
43
|
color: "theme",
|
|
44
44
|
icon: "",
|
|
45
45
|
icon2: ""
|
|
46
46
|
}, {
|
|
47
47
|
default: B(() => [
|
|
48
|
-
|
|
48
|
+
J(b(e.items.find((n) => n.value === o.value?.[0])?.content), 1)
|
|
49
49
|
]),
|
|
50
50
|
_: 1
|
|
51
51
|
})
|
|
52
52
|
]),
|
|
53
53
|
contentList: B(() => [
|
|
54
|
-
(h(!0),
|
|
54
|
+
(h(!0), A(Y, null, me(e.items, (n) => (h(), C(ve, {
|
|
55
55
|
class: X({
|
|
56
56
|
"top-active": o.value?.includes(n.value)
|
|
57
57
|
}),
|
|
@@ -60,13 +60,13 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
60
60
|
onClick: () => o.value = [n.value]
|
|
61
61
|
}, {
|
|
62
62
|
default: B(() => [
|
|
63
|
-
oe("span",
|
|
63
|
+
oe("span", et, b(n.content), 1)
|
|
64
64
|
]),
|
|
65
65
|
_: 2
|
|
66
66
|
}, 1032, ["class", "data-top-icon", "title", "onClick"]))), 256))
|
|
67
67
|
]),
|
|
68
68
|
_: 1
|
|
69
|
-
})) : (h(), C(
|
|
69
|
+
})) : (h(), C(We, {
|
|
70
70
|
key: 1,
|
|
71
71
|
modelValue: o.value,
|
|
72
72
|
"onUpdate:modelValue": l[0] || (l[0] = (n) => o.value = n),
|
|
@@ -78,12 +78,12 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
78
78
|
}, null, 8, ["modelValue", "items", "selectAllItem"]))
|
|
79
79
|
]));
|
|
80
80
|
}
|
|
81
|
-
}), Pt = (e, a) =>
|
|
81
|
+
}), Pt = (e, a) => M(() => ye(e).filter((r) => r.on >= 0 || r.id === a).map((r) => ({
|
|
82
82
|
value: r.id,
|
|
83
83
|
title: r.url + ` [${r.id}]`,
|
|
84
|
-
icon: r.id ===
|
|
84
|
+
icon: r.id === ye(a) ? "" : "",
|
|
85
85
|
content: r.name
|
|
86
|
-
}))),
|
|
86
|
+
}))), L = -1, y = -2, le = -1, tt = {
|
|
87
87
|
0: "Yandex",
|
|
88
88
|
1: "Google",
|
|
89
89
|
4: "YouTube",
|
|
@@ -93,25 +93,25 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
93
93
|
9: "GoogleStore",
|
|
94
94
|
20: "Yandex.com",
|
|
95
95
|
21: "Yandex.com.tr"
|
|
96
|
-
},
|
|
96
|
+
}, xe = {
|
|
97
97
|
key: y,
|
|
98
98
|
name: "--",
|
|
99
99
|
index: y
|
|
100
|
-
},
|
|
100
|
+
}, Ge = {
|
|
101
101
|
key: y,
|
|
102
102
|
name: "--",
|
|
103
|
-
regions: [
|
|
104
|
-
regionByIndex: /* @__PURE__ */ new Map([[y,
|
|
103
|
+
regions: [xe],
|
|
104
|
+
regionByIndex: /* @__PURE__ */ new Map([[y, xe]])
|
|
105
105
|
}, ae = {
|
|
106
106
|
key: y,
|
|
107
107
|
name: "Autoselect",
|
|
108
108
|
index: y
|
|
109
|
-
},
|
|
109
|
+
}, se = {
|
|
110
110
|
key: y,
|
|
111
111
|
name: "Autoselect",
|
|
112
112
|
regions: [ae],
|
|
113
113
|
regionByIndex: /* @__PURE__ */ new Map([[y, ae]])
|
|
114
|
-
},
|
|
114
|
+
}, ke = {
|
|
115
115
|
countryCode: "00",
|
|
116
116
|
depth: 1,
|
|
117
117
|
device: 0,
|
|
@@ -119,18 +119,18 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
119
119
|
index: le,
|
|
120
120
|
lang: "ru",
|
|
121
121
|
name: "Without region"
|
|
122
|
-
},
|
|
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
123
|
let t;
|
|
124
|
-
return e ? t =
|
|
125
|
-
},
|
|
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) => {
|
|
126
126
|
const r = /* @__PURE__ */ new Map();
|
|
127
127
|
return e.forEach((l) => {
|
|
128
128
|
if (!l.enabled || t && typeof l.key == "number" && l.key > 1) return;
|
|
129
129
|
const n = { ...l };
|
|
130
|
-
n.regionByIndex = /* @__PURE__ */ new Map(), l.regions && l.regions.forEach((
|
|
131
|
-
if (a && !
|
|
132
|
-
const
|
|
133
|
-
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);
|
|
134
134
|
}), !n.regionByIndex.size && o.length, // режим вывода ПС без регионов
|
|
135
135
|
(!l.regions || // есть включенные регионы
|
|
136
136
|
n.regionByIndex.size || // запрошен вывод конкретных ПС
|
|
@@ -139,25 +139,25 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
139
139
|
if (r.has(l)) return;
|
|
140
140
|
const n = {
|
|
141
141
|
key: l,
|
|
142
|
-
name:
|
|
142
|
+
name: tt[l],
|
|
143
143
|
regions: [],
|
|
144
144
|
regionByIndex: /* @__PURE__ */ new Map()
|
|
145
145
|
};
|
|
146
146
|
r.set(n.key, n);
|
|
147
147
|
}), r;
|
|
148
|
-
},
|
|
149
|
-
const a =
|
|
148
|
+
}, nt = (e) => {
|
|
149
|
+
const a = Oe(e, !1, [0, 1], !0);
|
|
150
150
|
if (a.has(2)) {
|
|
151
151
|
const o = a.get(2);
|
|
152
152
|
o && (o.regionByIndex = /* @__PURE__ */ new Map());
|
|
153
153
|
}
|
|
154
154
|
return a.forEach((o) => {
|
|
155
155
|
if (!o.regionByIndex) return;
|
|
156
|
-
const t = { ...
|
|
156
|
+
const t = { ...at() };
|
|
157
157
|
o.regionByIndex.set(t.index, t);
|
|
158
158
|
}), a;
|
|
159
|
-
},
|
|
160
|
-
const t =
|
|
159
|
+
}, rt = (e, a, o = []) => {
|
|
160
|
+
const t = Ke(e, !1, o);
|
|
161
161
|
let r;
|
|
162
162
|
return t.forEach((l) => {
|
|
163
163
|
if (!(a.searcher_key !== void 0 && a.searcher_key != l.key) && l.regions && (l.regions.forEach((n) => {
|
|
@@ -166,15 +166,15 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
166
166
|
}), r))
|
|
167
167
|
return !1;
|
|
168
168
|
}), r;
|
|
169
|
-
},
|
|
170
|
-
const o = w(), t =
|
|
169
|
+
}, it = _e(() => import("../.chunks/dialog_regionSelectorRegions-1UVhgK2f.es.js")), dt = (e, a) => {
|
|
170
|
+
const o = w(), t = K(a.value.keys().next().value ?? y), r = M(() => {
|
|
171
171
|
const l = /* @__PURE__ */ new Map();
|
|
172
172
|
if (a.value.forEach((n) => {
|
|
173
|
-
let
|
|
173
|
+
let u = {
|
|
174
174
|
value: n.key,
|
|
175
175
|
title: n.name
|
|
176
176
|
};
|
|
177
|
-
e.addSearcherIcon && (
|
|
177
|
+
e.addSearcherIcon && (u.icon = Ye(n.key)), l.set(n.key, u);
|
|
178
178
|
}), e.addCompare && !l.has(y)) {
|
|
179
179
|
const n = {
|
|
180
180
|
value: "",
|
|
@@ -182,11 +182,11 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
182
182
|
disabled: !0
|
|
183
183
|
};
|
|
184
184
|
l.set(n.value, n);
|
|
185
|
-
const
|
|
186
|
-
value:
|
|
185
|
+
const u = {
|
|
186
|
+
value: L,
|
|
187
187
|
title: o.Common.Compare
|
|
188
188
|
};
|
|
189
|
-
l.set(
|
|
189
|
+
l.set(u.value, u);
|
|
190
190
|
}
|
|
191
191
|
return l;
|
|
192
192
|
});
|
|
@@ -194,60 +194,60 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
194
194
|
searcherKey: t,
|
|
195
195
|
optionBySearcherKey: r
|
|
196
196
|
};
|
|
197
|
-
},
|
|
198
|
-
const o = w(), t =
|
|
197
|
+
}, ut = (e, a) => {
|
|
198
|
+
const o = w(), t = K(y);
|
|
199
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 =
|
|
200
|
+
const r = M(() => {
|
|
201
201
|
const l = /* @__PURE__ */ new Map();
|
|
202
202
|
return a.value.regionByIndex?.forEach((n) => {
|
|
203
|
-
let
|
|
203
|
+
let u = n.name;
|
|
204
204
|
if (e.forFrequency) {
|
|
205
|
-
const
|
|
205
|
+
const x = {
|
|
206
206
|
value: n.key,
|
|
207
|
-
title:
|
|
207
|
+
title: u
|
|
208
208
|
};
|
|
209
|
-
l.has(n.key) || l.set(n.key,
|
|
209
|
+
l.has(n.key) || l.set(n.key, x);
|
|
210
210
|
return;
|
|
211
211
|
}
|
|
212
|
-
n.device && (
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
const
|
|
212
|
+
n.device && (u += " (" + o.Common["Device_" + n.device] + ")");
|
|
213
|
+
const f = Qe(a.value.key || 0, n.lang ?? "");
|
|
214
|
+
f && (u += " / " + f);
|
|
215
|
+
const c = {
|
|
216
216
|
value: n.index,
|
|
217
|
-
title:
|
|
218
|
-
icon: n.device ?
|
|
217
|
+
title: u,
|
|
218
|
+
icon: n.device ? He(n.device) : void 0
|
|
219
219
|
};
|
|
220
|
-
l.set(n.index,
|
|
220
|
+
l.set(n.index, c);
|
|
221
221
|
}), l;
|
|
222
222
|
});
|
|
223
|
-
return
|
|
223
|
+
return E(r, (l, n) => {
|
|
224
224
|
if (e.onlySearcher || t.value !== void 0 && l.get(t.value))
|
|
225
225
|
return;
|
|
226
|
-
let
|
|
227
|
-
if (t.value === y ||
|
|
228
|
-
t.value =
|
|
226
|
+
let u = l.keys().next().value;
|
|
227
|
+
if (t.value === y || u === y) {
|
|
228
|
+
t.value = u;
|
|
229
229
|
return;
|
|
230
230
|
}
|
|
231
|
-
let
|
|
232
|
-
for (const [
|
|
231
|
+
let f = n?.get(t.value)?.title || "", c = -1;
|
|
232
|
+
for (const [x, i] of l.entries()) {
|
|
233
233
|
const m = i.title;
|
|
234
|
-
if (typeof m != "string" || typeof
|
|
234
|
+
if (typeof m != "string" || typeof x == "string")
|
|
235
235
|
break;
|
|
236
|
-
if (m ===
|
|
237
|
-
|
|
236
|
+
if (m === f) {
|
|
237
|
+
u = x;
|
|
238
238
|
break;
|
|
239
239
|
}
|
|
240
|
-
const
|
|
241
|
-
let s =
|
|
242
|
-
m.indexOf(s) === -1 && (s =
|
|
240
|
+
const d = new RegExp(` \\((${o.Common.Device_1}|${o.Common.Device_2})\\)`);
|
|
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));
|
|
243
243
|
}
|
|
244
|
-
t.value =
|
|
244
|
+
t.value = u;
|
|
245
245
|
}), {
|
|
246
246
|
regionIndex: t,
|
|
247
247
|
optionByRegionIndex: r
|
|
248
248
|
};
|
|
249
|
-
},
|
|
250
|
-
const t =
|
|
249
|
+
}, st = (e, a, o) => {
|
|
250
|
+
const t = K([]), r = () => {
|
|
251
251
|
if (e.onlySearcher && a.value) {
|
|
252
252
|
t.value = Array.from(a.value.keys());
|
|
253
253
|
return;
|
|
@@ -262,26 +262,26 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
262
262
|
) ?? [];
|
|
263
263
|
} catch {
|
|
264
264
|
}
|
|
265
|
-
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];
|
|
266
266
|
}, l = () => {
|
|
267
267
|
t.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(t.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
|
|
268
268
|
};
|
|
269
|
-
return
|
|
269
|
+
return E(t, () => {
|
|
270
270
|
l();
|
|
271
271
|
}), e.addCompare && r(), {
|
|
272
272
|
regionsIndexes: t
|
|
273
273
|
};
|
|
274
|
-
},
|
|
275
|
-
const a =
|
|
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(() => {
|
|
276
276
|
const i = /* @__PURE__ */ new Set();
|
|
277
277
|
return a.value.forEach((m) => {
|
|
278
|
-
m.regionByIndex.forEach((
|
|
279
|
-
|
|
278
|
+
m.regionByIndex.forEach((d) => {
|
|
279
|
+
d.index !== le && d.index !== y && i.add(d.index);
|
|
280
280
|
});
|
|
281
281
|
}), i;
|
|
282
|
-
}), r =
|
|
283
|
-
|
|
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 ===
|
|
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
285
|
let i = a.value.keys().next().value;
|
|
286
286
|
a.value.forEach((m) => {
|
|
287
287
|
if (e.onlySearcher && m.key === r.searcherKey.value) {
|
|
@@ -289,26 +289,26 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
291
|
if (l.regionIndex.value && m.regionByIndex?.has(l.regionIndex.value) && (i = m.key), !e.onlySearcher) {
|
|
292
|
-
let
|
|
293
|
-
i !== void 0 && (
|
|
292
|
+
let d;
|
|
293
|
+
i !== void 0 && (d = a.value.get(i)?.regionByIndex);
|
|
294
294
|
const s = a.value.get(m.key)?.regionByIndex;
|
|
295
|
-
|
|
295
|
+
d?.has(y) && !s?.has(y) && (i = m.key);
|
|
296
296
|
}
|
|
297
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);
|
|
298
298
|
}, { immediate: !0 });
|
|
299
|
-
const
|
|
300
|
-
if (!(r.searcherKey.value ===
|
|
299
|
+
const u = () => {
|
|
300
|
+
if (!(r.searcherKey.value === L || r.searcherKey.value === y))
|
|
301
301
|
return r.searcherKey.value;
|
|
302
|
-
},
|
|
302
|
+
}, f = () => {
|
|
303
303
|
if (e.onlySearcher || l.regionIndex.value === y) return;
|
|
304
304
|
let i = l.regionIndex.value;
|
|
305
305
|
if (e.forFrequency) {
|
|
306
306
|
const m = l.regionIndex.value;
|
|
307
|
-
i =
|
|
307
|
+
i = rt(e.forFrequency, { searcher_key: u(), key: m }, e.searchers)?.index;
|
|
308
308
|
}
|
|
309
309
|
return i;
|
|
310
|
-
},
|
|
311
|
-
const i =
|
|
310
|
+
}, c = () => {
|
|
311
|
+
const i = u();
|
|
312
312
|
if (i !== void 0)
|
|
313
313
|
return a.value.get(i);
|
|
314
314
|
};
|
|
@@ -318,16 +318,16 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
318
318
|
compare: n,
|
|
319
319
|
searcherByKey: a,
|
|
320
320
|
allRegionsIndexes: t,
|
|
321
|
-
getSearcher:
|
|
321
|
+
getSearcher: c,
|
|
322
322
|
getRegion: () => {
|
|
323
|
-
const i =
|
|
323
|
+
const i = f();
|
|
324
324
|
if (i !== void 0)
|
|
325
|
-
return
|
|
325
|
+
return c()?.regionByIndex?.get(i);
|
|
326
326
|
}
|
|
327
327
|
};
|
|
328
|
-
},
|
|
328
|
+
}, Nt = /* @__PURE__ */ R({
|
|
329
329
|
__name: "regionSelector",
|
|
330
|
-
props: /* @__PURE__ */
|
|
330
|
+
props: /* @__PURE__ */ V({
|
|
331
331
|
projectId: {},
|
|
332
332
|
searchers: { default: () => [] },
|
|
333
333
|
modelValue: {},
|
|
@@ -347,62 +347,62 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
347
347
|
}),
|
|
348
348
|
emits: ["update:modelValue", "update:modelValueSingle"],
|
|
349
349
|
setup(e, { expose: a }) {
|
|
350
|
-
const o = e, t =
|
|
350
|
+
const o = e, t = T(e, "modelValue"), r = T(e, "modelValueSingle"), {
|
|
351
351
|
selectSearcher: l,
|
|
352
352
|
selectRegion: n,
|
|
353
|
-
compare:
|
|
354
|
-
searcherByKey:
|
|
355
|
-
allRegionsIndexes:
|
|
356
|
-
getSearcher:
|
|
353
|
+
compare: u,
|
|
354
|
+
searcherByKey: f,
|
|
355
|
+
allRegionsIndexes: c,
|
|
356
|
+
getSearcher: x,
|
|
357
357
|
getRegion: i
|
|
358
|
-
} =
|
|
359
|
-
const
|
|
360
|
-
|
|
358
|
+
} = ct(o), m = () => {
|
|
359
|
+
const d = [];
|
|
360
|
+
f.value.forEach((s) => {
|
|
361
361
|
s.enabled && s.regions.forEach((g) => {
|
|
362
|
-
g.enabled &&
|
|
362
|
+
g.enabled && d.push(g);
|
|
363
363
|
});
|
|
364
|
-
}),
|
|
365
|
-
regions:
|
|
366
|
-
regionsIndexes:
|
|
367
|
-
"@update:regionsIndexes": (s) =>
|
|
364
|
+
}), it.open("regions", {
|
|
365
|
+
regions: d,
|
|
366
|
+
regionsIndexes: u.regionsIndexes.value,
|
|
367
|
+
"@update:regionsIndexes": (s) => u.regionsIndexes.value = s
|
|
368
368
|
});
|
|
369
369
|
};
|
|
370
|
-
return
|
|
371
|
-
if (l.searcherKey.value ===
|
|
372
|
-
if (JSON.stringify(t.value) === 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))
|
|
373
373
|
return;
|
|
374
|
-
t.value = [...
|
|
374
|
+
t.value = [...u.regionsIndexes.value];
|
|
375
375
|
} else
|
|
376
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));
|
|
377
|
-
!o.onlySearcher && !
|
|
378
|
-
}), r.value &&
|
|
377
|
+
!o.onlySearcher && !c.value.size && (l.searcherKey.value = y);
|
|
378
|
+
}), r.value && E(r, () => {
|
|
379
379
|
r.value && (t.value = [r.value]);
|
|
380
|
-
}, { immediate: !0 }),
|
|
380
|
+
}, { immediate: !0 }), E(t, () => {
|
|
381
381
|
if (t.value[0] && (r.value = t.value[0]), o.onlySearcher) {
|
|
382
|
-
if (!t.value.length || t.value.length === 1 && !
|
|
383
|
-
let
|
|
384
|
-
|
|
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;
|
|
385
385
|
return;
|
|
386
386
|
}
|
|
387
|
-
if (t.value.length > 1 && JSON.stringify(t.value) !== JSON.stringify(
|
|
388
|
-
t.value = [...
|
|
387
|
+
if (t.value.length > 1 && JSON.stringify(t.value) !== JSON.stringify(u.regionsIndexes.value)) {
|
|
388
|
+
t.value = [...u.regionsIndexes.value];
|
|
389
389
|
return;
|
|
390
390
|
}
|
|
391
391
|
} else {
|
|
392
|
-
let
|
|
393
|
-
if (o.forFrequency && (s =
|
|
394
|
-
s !== void 0 &&
|
|
395
|
-
else if (
|
|
396
|
-
let g =
|
|
397
|
-
o.forFrequency && (g = /* @__PURE__ */ new Set(),
|
|
398
|
-
Z.regionByIndex.forEach((
|
|
399
|
-
|
|
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);
|
|
395
|
+
else if (d.length === 1) {
|
|
396
|
+
let g = c.value;
|
|
397
|
+
o.forFrequency && (g = /* @__PURE__ */ new Set(), f.value.forEach((Z) => {
|
|
398
|
+
Z.regionByIndex.forEach((N) => {
|
|
399
|
+
N.index !== le && N.index !== y && g.add(N.key);
|
|
400
400
|
});
|
|
401
|
-
})), g.has(
|
|
401
|
+
})), g.has(d[0]) || (d = [], s !== void 0 && d.push(s));
|
|
402
402
|
} else
|
|
403
|
-
|
|
404
|
-
if (JSON.stringify(t.value) !== JSON.stringify(
|
|
405
|
-
t.value =
|
|
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;
|
|
406
406
|
return;
|
|
407
407
|
}
|
|
408
408
|
}
|
|
@@ -412,44 +412,44 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
412
412
|
l.searcherKey.value = t.value[0];
|
|
413
413
|
return;
|
|
414
414
|
}
|
|
415
|
-
l.searcherKey.value =
|
|
415
|
+
l.searcherKey.value = L;
|
|
416
416
|
return;
|
|
417
417
|
} else {
|
|
418
418
|
if (!t.value.length)
|
|
419
419
|
return;
|
|
420
|
-
if (t.value.length === 1 && l.searcherKey.value !==
|
|
420
|
+
if (t.value.length === 1 && l.searcherKey.value !== L) {
|
|
421
421
|
n.regionIndex.value = t.value[0];
|
|
422
|
-
let
|
|
423
|
-
for (const s of
|
|
422
|
+
let d;
|
|
423
|
+
for (const s of f.value.values()) {
|
|
424
424
|
for (const g of s.regionByIndex.values())
|
|
425
425
|
if ((o.forFrequency ? g.key : g.index) === n.regionIndex.value) {
|
|
426
|
-
|
|
426
|
+
d = s.key;
|
|
427
427
|
break;
|
|
428
428
|
}
|
|
429
|
-
if (
|
|
429
|
+
if (d !== void 0)
|
|
430
430
|
break;
|
|
431
431
|
}
|
|
432
|
-
|
|
432
|
+
d !== void 0 && (l.searcherKey.value = d);
|
|
433
433
|
} else
|
|
434
|
-
l.searcherKey.value =
|
|
434
|
+
l.searcherKey.value = L, u.regionsIndexes.value = [...t.value];
|
|
435
435
|
}
|
|
436
436
|
}, { immediate: !0 }), a({
|
|
437
|
-
getSearcher:
|
|
437
|
+
getSearcher: x,
|
|
438
438
|
getRegion: i
|
|
439
|
-
}), (
|
|
439
|
+
}), (d, s) => (h(), A("div", {
|
|
440
440
|
class: X({
|
|
441
441
|
"top-selectorRegion": !0,
|
|
442
442
|
"top-selectorRegion-onlySearcher": e.onlySearcher
|
|
443
443
|
})
|
|
444
444
|
}, [
|
|
445
|
-
|
|
445
|
+
P(ce, {
|
|
446
446
|
options: v(l).optionBySearcherKey.value,
|
|
447
447
|
modelValue: v(l).searcherKey.value,
|
|
448
448
|
"onUpdate:modelValue": s[0] || (s[0] = (g) => v(l).searcherKey.value = g),
|
|
449
449
|
name: "searcher_key",
|
|
450
450
|
addChanger: e.addChanger
|
|
451
451
|
}, null, 8, ["options", "modelValue", "addChanger"]),
|
|
452
|
-
!e.onlySearcher && v(l).searcherKey.value !== v(
|
|
452
|
+
!e.onlySearcher && v(l).searcherKey.value !== v(L) ? (h(), C(ce, {
|
|
453
453
|
key: 0,
|
|
454
454
|
class: "top-select-region",
|
|
455
455
|
options: v(n).optionByRegionIndex.value,
|
|
@@ -459,37 +459,50 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
459
459
|
addChanger: e.addChanger,
|
|
460
460
|
"data-top-icon": e.addRegionIcon ? "" : void 0
|
|
461
461
|
}, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : O("", !0),
|
|
462
|
-
e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(
|
|
462
|
+
e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(L) ? (h(), C(Q, {
|
|
463
463
|
key: 1,
|
|
464
464
|
name: "compare",
|
|
465
465
|
onClick: m,
|
|
466
|
-
"data-count-compare-regions-indexes": v(
|
|
466
|
+
"data-count-compare-regions-indexes": v(u).regionsIndexes.value.length
|
|
467
467
|
}, {
|
|
468
468
|
default: B(() => [
|
|
469
|
-
|
|
469
|
+
J(b(d.$i18n.Common.Selected_regions), 1)
|
|
470
470
|
]),
|
|
471
471
|
_: 1
|
|
472
472
|
}, 8, ["data-count-compare-regions-indexes"])) : O("", !0)
|
|
473
473
|
], 2));
|
|
474
474
|
}
|
|
475
|
-
}),
|
|
475
|
+
}), j = {
|
|
476
476
|
id: 0,
|
|
477
477
|
name: "/",
|
|
478
478
|
path: "/"
|
|
479
|
-
}, ft = (e, a) => {
|
|
480
|
-
let o = e?.root[0] ?? N;
|
|
481
|
-
return o = { ...o }, o.name = Ke(a), o;
|
|
482
479
|
};
|
|
483
|
-
function
|
|
480
|
+
function gt(e) {
|
|
484
481
|
return e ? w()?.Common.All_folders : "/ (" + w()?.Keywords.Root_folder + ")";
|
|
485
482
|
}
|
|
486
|
-
const
|
|
487
|
-
l = { ...l }, t.childsIds.push(l.id), l.id === 0 && (l.name =
|
|
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),
|
|
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) => e.gen("/get/keywords_2/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],
|
|
497
|
+
new: c
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
}), Object.keys(f).length && a(f, u);
|
|
501
|
+
}, o);
|
|
502
|
+
}
|
|
503
|
+
const mt = /* @__PURE__ */ R({
|
|
491
504
|
__name: "folders",
|
|
492
|
-
props: /* @__PURE__ */
|
|
505
|
+
props: /* @__PURE__ */ V({
|
|
493
506
|
folderId: {},
|
|
494
507
|
folder: {},
|
|
495
508
|
folders: {},
|
|
@@ -501,84 +514,75 @@ const Oe = (e, a, o = /* @__PURE__ */ new Map(), t = { id: "root" }, r = 0) => (
|
|
|
501
514
|
}, {
|
|
502
515
|
folderId: { required: !0 },
|
|
503
516
|
folderIdModifiers: {},
|
|
504
|
-
folder: { default:
|
|
517
|
+
folder: { default: j },
|
|
505
518
|
folderModifiers: {}
|
|
506
519
|
}),
|
|
507
520
|
emits: ["update:folderId", "update:folder"],
|
|
508
521
|
setup(e) {
|
|
509
|
-
const a = e, o =
|
|
510
|
-
|
|
522
|
+
const a = e, o = T(e, "folderId"), t = T(e, "folder"), r = a.client && !a.folders ? ft(a.client) : void 0, l = K(null);
|
|
523
|
+
E(() => a.projectId, () => {
|
|
511
524
|
r?.changeParams({
|
|
512
525
|
project_id: a.projectId
|
|
513
526
|
}), r?.setOptions({
|
|
514
527
|
checkFingerprint: "TopGroupSelectorFolders:" + a.projectId
|
|
515
528
|
}), l.value?.resetCache();
|
|
516
529
|
}, { immediate: !0 });
|
|
517
|
-
const n =
|
|
518
|
-
return
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
530
|
+
const n = M(() => pe(a.folders ?? { root: [j] }, a.canSelectAll));
|
|
531
|
+
return ge({
|
|
532
|
+
modelFolder: t,
|
|
533
|
+
modelFolderId: o
|
|
534
|
+
}, async (u) => {
|
|
535
|
+
if (o.value === t.value.id)
|
|
536
|
+
return;
|
|
537
|
+
if (u.modelFolder && !u.modelFolderId) {
|
|
538
|
+
o.value = t.value.id;
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
let f = n.value.get(a.folderId);
|
|
542
|
+
f || (f = j), t.value = f, o.value = f.id;
|
|
543
|
+
}, { immediate: !0 }), (u, f) => (h(), C(Me, {
|
|
526
544
|
class: "top-groupSelector_folder",
|
|
527
545
|
modelValue: t.value,
|
|
528
|
-
"onUpdate:modelValue":
|
|
546
|
+
"onUpdate:modelValue": f[0] || (f[0] = (c) => t.value = c),
|
|
529
547
|
items: e.folders ? [...n.value.values()] : void 0,
|
|
530
548
|
"search-type": "inline",
|
|
531
549
|
icon: e.addIcon ? "" : void 0,
|
|
532
550
|
api: e.folders ? void 0 : v(r),
|
|
533
|
-
apiSetSearchParams: (...
|
|
551
|
+
apiSetSearchParams: (...c) => v(Ee)(...c, "name"),
|
|
534
552
|
addChanger: e.addChanger,
|
|
535
553
|
useCache: ""
|
|
536
554
|
}, null, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "addChanger"]));
|
|
537
555
|
}
|
|
538
|
-
})
|
|
539
|
-
function Se(e, a, o) {
|
|
540
|
-
const t = Object.keys(e), r = t.map((l) => e[l]);
|
|
541
|
-
return T(r, (l, n, d) => {
|
|
542
|
-
const c = {};
|
|
543
|
-
l.forEach((f, I) => {
|
|
544
|
-
if (!Object.is(f, n[I])) {
|
|
545
|
-
const i = t[I];
|
|
546
|
-
c[i] = {
|
|
547
|
-
old: n[I],
|
|
548
|
-
new: f
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
}), Object.keys(c).length && a(c, d);
|
|
552
|
-
}, o);
|
|
553
|
-
}
|
|
554
|
-
const ce = {
|
|
556
|
+
}), ne = {
|
|
555
557
|
id: -1,
|
|
556
558
|
name: "--",
|
|
557
|
-
folder_id:
|
|
558
|
-
folder_path:
|
|
559
|
-
},
|
|
560
|
-
id:
|
|
559
|
+
folder_id: j.id,
|
|
560
|
+
folder_path: j.path
|
|
561
|
+
}, re = {
|
|
562
|
+
id: $e,
|
|
561
563
|
name: "All groups",
|
|
562
|
-
folder_id:
|
|
563
|
-
folder_path:
|
|
564
|
-
},
|
|
564
|
+
folder_id: j.id,
|
|
565
|
+
folder_path: j.path
|
|
566
|
+
}, _ = () => (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) => e.gen("/get/keywords_2/groups/", ["id", "name", "folder_id", "folder_path"]).changeParams({ folder_id_depth: !0, limit: 100 }), pt = (e) => e.gen("/add/keywords_2/groups/"), yt = { class: "top-groupSelector_groupItem" }, ht = {
|
|
565
567
|
key: 0,
|
|
566
568
|
class: "top-comment"
|
|
567
|
-
},
|
|
569
|
+
}, It = {
|
|
568
570
|
key: 1,
|
|
569
571
|
class: "top-groupSelector_groupItemFolderPath"
|
|
570
|
-
},
|
|
572
|
+
}, St = /* @__PURE__ */ R({
|
|
571
573
|
__name: "groups",
|
|
572
|
-
props: /* @__PURE__ */
|
|
574
|
+
props: /* @__PURE__ */ V({
|
|
573
575
|
groupId: {},
|
|
574
576
|
group: {},
|
|
575
577
|
projectId: {},
|
|
576
578
|
folder: {},
|
|
577
579
|
groups: {},
|
|
580
|
+
on: { type: Boolean, default: void 0 },
|
|
578
581
|
canAdd: { type: [String, Boolean] },
|
|
579
582
|
canSelectAll: { type: [Boolean, String] },
|
|
580
583
|
autoselect: { default: "first" },
|
|
581
584
|
addChanger: { type: Boolean, default: !0 },
|
|
585
|
+
showPath: { type: Boolean },
|
|
582
586
|
addIcon: { type: Boolean, default: !0 },
|
|
583
587
|
client: {}
|
|
584
588
|
}, {
|
|
@@ -587,58 +591,59 @@ const ce = {
|
|
|
587
591
|
group: { required: !0 },
|
|
588
592
|
groupModifiers: {}
|
|
589
593
|
}),
|
|
590
|
-
emits: /* @__PURE__ */
|
|
594
|
+
emits: /* @__PURE__ */ V(["addGroup"], ["update:groupId", "update:group"]),
|
|
591
595
|
setup(e, { emit: a }) {
|
|
592
|
-
const o = e, t = a, r =
|
|
596
|
+
const o = e, t = a, r = T(e, "groupId"), l = T(e, "group"), n = o.client && !o.groups ? Ce(o.client) : void 0, u = o.client ? pt(o.client) : void 0, f = K(null), c = K(void 0), x = Se("folder_id", "EQUALS", [o.folder?.id ?? 0]);
|
|
593
597
|
n?.changeParams({
|
|
594
598
|
project_id: o.projectId,
|
|
599
|
+
folder_id_depth: !0,
|
|
595
600
|
filters: [
|
|
596
|
-
|
|
601
|
+
x
|
|
597
602
|
]
|
|
598
|
-
});
|
|
599
|
-
const i = (
|
|
600
|
-
l.value =
|
|
603
|
+
}), o.on !== void 0 && n?.params.filters?.push(Se("on", "EQUALS", [Number(o.on)]));
|
|
604
|
+
const i = (d) => {
|
|
605
|
+
l.value = d, r.value = d.id;
|
|
601
606
|
};
|
|
602
|
-
|
|
607
|
+
ge({
|
|
603
608
|
projectId: () => o.projectId,
|
|
604
609
|
folderId: () => o.folder?.id,
|
|
605
610
|
canSelectAll: () => o.canSelectAll
|
|
606
|
-
}, (
|
|
607
|
-
if (
|
|
611
|
+
}, (d) => {
|
|
612
|
+
if (d.projectId && (n?.changeParams({
|
|
608
613
|
project_id: o.projectId
|
|
609
614
|
}), n?.setOptions({
|
|
610
615
|
checkFingerprint: "TopGroupSelectorGroups:" + o.projectId
|
|
611
|
-
})),
|
|
616
|
+
})), d.folderId && (x.values = [
|
|
612
617
|
o.folder?.id ?? 0
|
|
613
|
-
], o.groups && (
|
|
618
|
+
], 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) {
|
|
614
619
|
let s;
|
|
615
|
-
o.autoselect === "first" && (s =
|
|
620
|
+
o.autoselect === "first" && (s = c.value?.[0], o.canSelectAll && (s = be(_()))), (o.autoselect === "placeholder" || !s) && (s = Le()), i(s);
|
|
616
621
|
}
|
|
617
|
-
}, { immediate: !0 }),
|
|
622
|
+
}, { immediate: !0 }), ge({
|
|
618
623
|
modelGroup: l,
|
|
619
624
|
modelGroupId: r
|
|
620
|
-
}, async (
|
|
625
|
+
}, async (d) => {
|
|
621
626
|
if (r.value !== l.value.id) {
|
|
622
|
-
if (
|
|
627
|
+
if (d.modelGroup && !d.modelGroupId) {
|
|
623
628
|
r.value = l.value.id;
|
|
624
629
|
return;
|
|
625
630
|
}
|
|
626
|
-
if (!(o.canAdd && r.value ===
|
|
631
|
+
if (!(o.canAdd && r.value === ue)) {
|
|
627
632
|
if (o.groups) {
|
|
628
|
-
let s =
|
|
629
|
-
if (!s && o.canSelectAll && (s =
|
|
633
|
+
let s = c.value?.find((g) => g.id === r.value);
|
|
634
|
+
if (!s && o.canSelectAll && (s = _()), s)
|
|
630
635
|
i(s);
|
|
631
636
|
else {
|
|
632
|
-
const g =
|
|
633
|
-
g && !r.value ? i(g) : i(
|
|
637
|
+
const g = c.value?.[0];
|
|
638
|
+
g && !r.value ? i(g) : i(ne);
|
|
634
639
|
}
|
|
635
640
|
}
|
|
636
|
-
if (o.client && !o.groups && (r.value || r.value ===
|
|
637
|
-
const s =
|
|
641
|
+
if (o.client && !o.groups && (r.value || r.value === $e && !o.canSelectAll)) {
|
|
642
|
+
const s = Ce(o.client).changeParams({
|
|
638
643
|
project_id: o.projectId,
|
|
639
644
|
id: r.value,
|
|
640
645
|
filters: [
|
|
641
|
-
|
|
646
|
+
x
|
|
642
647
|
]
|
|
643
648
|
});
|
|
644
649
|
s?.setOptions({
|
|
@@ -646,58 +651,59 @@ const ce = {
|
|
|
646
651
|
});
|
|
647
652
|
const g = await s.call();
|
|
648
653
|
if (!g.errors?.length && !g.result) return;
|
|
649
|
-
!g.errors && g.result[0] ? i(g.result[0]) : i(
|
|
654
|
+
!g.errors && g.result[0] ? i(g.result[0]) : i(ne);
|
|
650
655
|
}
|
|
651
656
|
}
|
|
652
657
|
}
|
|
653
658
|
}, { immediate: !0 });
|
|
654
|
-
const m = async (
|
|
655
|
-
if (o.canAdd !== "api" || !
|
|
656
|
-
const s = l.value, g = await
|
|
659
|
+
const m = async (d) => {
|
|
660
|
+
if (o.canAdd !== "api" || !u) return;
|
|
661
|
+
const s = l.value, g = await u.changeParams({
|
|
657
662
|
project_id: o.projectId,
|
|
658
|
-
names: [
|
|
659
|
-
to_id: o.folder?.id ??
|
|
663
|
+
names: [d.name],
|
|
664
|
+
to_id: o.folder?.id ?? j.id,
|
|
660
665
|
to_type: "in_folder_last"
|
|
661
666
|
}).call();
|
|
662
|
-
g.result ? (i(g.result), t("addGroup", g.result)) : i(s),
|
|
667
|
+
g.result ? (i(g.result), t("addGroup", g.result)) : i(s), f.value?.resetCache(!0);
|
|
663
668
|
};
|
|
664
|
-
return (
|
|
669
|
+
return (d, s) => (h(), C(Me, {
|
|
665
670
|
ref_key: "refSelector",
|
|
666
|
-
ref:
|
|
671
|
+
ref: f,
|
|
667
672
|
class: "top-groupSelector_group",
|
|
668
673
|
modelValue: l.value,
|
|
669
674
|
"onUpdate:modelValue": s[0] || (s[0] = (g) => l.value = g),
|
|
670
|
-
items:
|
|
675
|
+
items: c.value ?? e.groups,
|
|
671
676
|
searchType: "inline",
|
|
672
677
|
icon: e.addIcon ? "" : void 0,
|
|
673
678
|
api: e.groups ? void 0 : v(n),
|
|
674
|
-
apiSetSearchParams: (...g) => v(
|
|
679
|
+
apiSetSearchParams: (...g) => v(Ee)(...g, "name"),
|
|
675
680
|
appendSearchToResult: !!e.canAdd,
|
|
676
|
-
useAllItem: e.canSelectAll ? v(
|
|
681
|
+
useAllItem: e.canSelectAll ? v(_)().name : !1,
|
|
677
682
|
addChanger: e.addChanger,
|
|
678
683
|
useCache: "",
|
|
679
684
|
onAppendItem: m
|
|
680
685
|
}, {
|
|
681
686
|
item: B(({ item: g }) => [
|
|
682
|
-
oe("div",
|
|
683
|
-
g.id === v(
|
|
684
|
-
oe("span", null,
|
|
685
|
-
g.folder_path ? (h(),
|
|
687
|
+
oe("div", yt, [
|
|
688
|
+
g.id === v(ue) ? (h(), A("div", ht, b(d.$i18n.Common.Add) + ": ", 1)) : O("", !0),
|
|
689
|
+
oe("span", null, b(g.name), 1),
|
|
690
|
+
g.folder_path && e.showPath ? (h(), A("span", It, b(g.folder_path), 1)) : O("", !0)
|
|
686
691
|
])
|
|
687
692
|
]),
|
|
688
693
|
_: 1
|
|
689
694
|
}, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "appendSearchToResult", "useAllItem", "addChanger"]));
|
|
690
695
|
}
|
|
691
|
-
}),
|
|
696
|
+
}), xt = { class: "top-groupSelector" }, Dt = /* @__PURE__ */ R({
|
|
692
697
|
__name: "groupSelector",
|
|
693
|
-
props: /* @__PURE__ */
|
|
698
|
+
props: /* @__PURE__ */ V({
|
|
694
699
|
folderId: {},
|
|
700
|
+
folder: {},
|
|
695
701
|
groupId: {},
|
|
696
702
|
group: {},
|
|
697
703
|
projectId: {},
|
|
698
704
|
folders: {},
|
|
699
705
|
groups: {},
|
|
700
|
-
|
|
706
|
+
on: { type: Boolean, default: void 0 },
|
|
701
707
|
canSelectAllGroups: { type: Boolean },
|
|
702
708
|
canAddGroup: {},
|
|
703
709
|
autoselect: { default: "first" },
|
|
@@ -709,27 +715,30 @@ const ce = {
|
|
|
709
715
|
}, {
|
|
710
716
|
folderId: { required: !0 },
|
|
711
717
|
folderIdModifiers: {},
|
|
718
|
+
folder: {},
|
|
719
|
+
folderModifiers: {},
|
|
712
720
|
groupId: { required: !0 },
|
|
713
721
|
groupIdModifiers: {},
|
|
714
|
-
group: {},
|
|
722
|
+
group: { default: ne },
|
|
715
723
|
groupModifiers: {}
|
|
716
724
|
}),
|
|
717
|
-
emits: /* @__PURE__ */
|
|
725
|
+
emits: /* @__PURE__ */ V(["update:groups"], ["update:folderId", "update:folder", "update:groupId", "update:group"]),
|
|
718
726
|
setup(e, { emit: a }) {
|
|
719
|
-
const o = e, t =
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
727
|
+
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);
|
|
728
|
+
r.value = f.get(t.value);
|
|
729
|
+
let c = o.groups?.find((i) => i.id === l.value);
|
|
730
|
+
l.value || (c = o.groups?.[0]), o.canSelectAllGroups && !c && (c = _()), o.canSelectAllGroups && !c && (c = _()), (o.autoselect === "placeholder" || !c) && (c = Le()), c ??= ne, n.value = c;
|
|
731
|
+
const x = (i) => {
|
|
732
|
+
let m;
|
|
733
|
+
o.groups && i && (m = [...o.groups, i]), u("update:groups", m);
|
|
725
734
|
};
|
|
726
|
-
return (
|
|
727
|
-
e.showFolders ? (h(), C(
|
|
735
|
+
return (i, m) => (h(), A("div", xt, [
|
|
736
|
+
e.showFolders ? (h(), C(mt, {
|
|
728
737
|
key: 0,
|
|
729
738
|
folderId: t.value,
|
|
730
|
-
"onUpdate:folderId":
|
|
731
|
-
folder:
|
|
732
|
-
"onUpdate:folder":
|
|
739
|
+
"onUpdate:folderId": m[0] || (m[0] = (d) => t.value = d),
|
|
740
|
+
folder: r.value,
|
|
741
|
+
"onUpdate:folder": m[1] || (m[1] = (d) => r.value = d),
|
|
733
742
|
projectId: e.projectId,
|
|
734
743
|
folders: e.folders,
|
|
735
744
|
canSelectAll: e.canSelectAllGroups,
|
|
@@ -737,52 +746,54 @@ const ce = {
|
|
|
737
746
|
addIcon: e.addIcon,
|
|
738
747
|
client: e.client
|
|
739
748
|
}, null, 8, ["folderId", "folder", "projectId", "folders", "canSelectAll", "addChanger", "addIcon", "client"])) : O("", !0),
|
|
740
|
-
e.showGroups ? (h(), C(
|
|
749
|
+
e.showGroups ? (h(), C(St, {
|
|
741
750
|
key: 1,
|
|
742
|
-
groupId:
|
|
743
|
-
"onUpdate:groupId":
|
|
744
|
-
group:
|
|
745
|
-
"onUpdate:group":
|
|
751
|
+
groupId: l.value,
|
|
752
|
+
"onUpdate:groupId": m[2] || (m[2] = (d) => l.value = d),
|
|
753
|
+
group: n.value,
|
|
754
|
+
"onUpdate:group": m[3] || (m[3] = (d) => n.value = d),
|
|
746
755
|
projectId: e.projectId,
|
|
747
|
-
folder:
|
|
756
|
+
folder: r.value,
|
|
748
757
|
groups: e.groups,
|
|
758
|
+
on: e.on,
|
|
749
759
|
canAdd: e.canAddGroup,
|
|
750
760
|
canSelectAll: e.canSelectAllGroups,
|
|
751
761
|
autoselect: e.autoselect,
|
|
752
762
|
addChanger: e.addChanger,
|
|
763
|
+
showPath: e.showFolders && !!e.folders?.[0],
|
|
753
764
|
addIcon: e.addIcon,
|
|
754
765
|
client: e.client,
|
|
755
|
-
onAddGroup:
|
|
756
|
-
}, null, 8, ["groupId", "group", "projectId", "folder", "groups", "canAdd", "canSelectAll", "autoselect", "addChanger", "addIcon", "client"])) : O("", !0)
|
|
766
|
+
onAddGroup: x
|
|
767
|
+
}, null, 8, ["groupId", "group", "projectId", "folder", "groups", "on", "canAdd", "canSelectAll", "autoselect", "addChanger", "showPath", "addIcon", "client"])) : O("", !0)
|
|
757
768
|
]));
|
|
758
769
|
}
|
|
759
|
-
}),
|
|
760
|
-
e =
|
|
770
|
+
}), Be = (e) => "-" + e, H = (e) => e[0] === "-" ? e.substring(1) : e, ie = (e, a) => {
|
|
771
|
+
e = H(e);
|
|
761
772
|
const o = a.find((t) => t.id === e);
|
|
762
773
|
if (o)
|
|
763
774
|
return o;
|
|
764
|
-
},
|
|
775
|
+
}, qt = (e, a, o) => {
|
|
765
776
|
a || (a = { id: e.id }), a.id = e.id, a.pos ??= "3", a.notch ??= !0, a.posBy ??= "fixed";
|
|
766
|
-
const t =
|
|
777
|
+
const t = Xe.genElPopupOpener("div", a);
|
|
767
778
|
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) => {
|
|
768
779
|
r.preventDefault(), r.stopPropagation(), t.onclick = null;
|
|
769
|
-
const l =
|
|
780
|
+
const l = K(e.modelValue), n = {
|
|
770
781
|
model: l,
|
|
771
782
|
mode: e.mode,
|
|
772
783
|
targetId: e.targetId,
|
|
773
784
|
filters: e.filters,
|
|
774
785
|
payload: e.payload
|
|
775
786
|
};
|
|
776
|
-
|
|
787
|
+
W(t, "topTagSelectorTarget", n), delete t.dataset.topPopupDisabled, he(e.modelValue) || E(l, () => {
|
|
777
788
|
e.modelValue = l.value, te(t, e, o);
|
|
778
789
|
}), t.click();
|
|
779
|
-
},
|
|
790
|
+
}, he(e.modelValue) ? E(e.modelValue, () => te(t, e, o)) : W(t, "topTagSelectorRender", (r) => {
|
|
780
791
|
e.modelValue = r;
|
|
781
|
-
const l =
|
|
792
|
+
const l = W(t, "topTagSelectorTarget");
|
|
782
793
|
l && (l.model.value = r), te(t, e, o);
|
|
783
794
|
}), te(t, e, o), t;
|
|
784
795
|
}, Ft = (e, a) => {
|
|
785
|
-
|
|
796
|
+
W(e, "topTagSelectorRender")?.(a);
|
|
786
797
|
}, te = (e, a, o) => {
|
|
787
798
|
const t = v(a.modelValue);
|
|
788
799
|
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) {
|
|
@@ -790,7 +801,7 @@ const ce = {
|
|
|
790
801
|
return;
|
|
791
802
|
}
|
|
792
803
|
if (e.innerHTML = "", !t.length && a.mode === "filter") {
|
|
793
|
-
const r =
|
|
804
|
+
const r = Te({
|
|
794
805
|
id: "all",
|
|
795
806
|
colorId: "",
|
|
796
807
|
name: w().Common?.All_tags ?? "",
|
|
@@ -799,18 +810,18 @@ const ce = {
|
|
|
799
810
|
e.append(r);
|
|
800
811
|
}
|
|
801
812
|
t.forEach((r) => {
|
|
802
|
-
const l =
|
|
803
|
-
id:
|
|
804
|
-
colorId:
|
|
805
|
-
name:
|
|
806
|
-
state:
|
|
813
|
+
const l = Te({
|
|
814
|
+
id: H(r),
|
|
815
|
+
colorId: ie(r, a.tags)?.color_id ?? "",
|
|
816
|
+
name: ie(r, a.tags)?.name ?? "",
|
|
817
|
+
state: H(r) === r ? "selected" : "excluded"
|
|
807
818
|
});
|
|
808
819
|
e.append(l);
|
|
809
820
|
});
|
|
810
|
-
},
|
|
821
|
+
}, Te = (e) => {
|
|
811
822
|
const a = document.createElement("div");
|
|
812
823
|
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;
|
|
813
|
-
},
|
|
824
|
+
}, kt = [
|
|
814
825
|
{
|
|
815
826
|
id: "1",
|
|
816
827
|
name: "Without Tag",
|
|
@@ -861,7 +872,7 @@ const ce = {
|
|
|
861
872
|
name: "Turquoise",
|
|
862
873
|
color_id: "10"
|
|
863
874
|
}
|
|
864
|
-
],
|
|
875
|
+
], Ct = ["data-tag_id", "data-tag_color_id", "title"], fe = /* @__PURE__ */ R({
|
|
865
876
|
__name: "tagIcon",
|
|
866
877
|
props: {
|
|
867
878
|
id: {},
|
|
@@ -870,7 +881,7 @@ const ce = {
|
|
|
870
881
|
state: {}
|
|
871
882
|
},
|
|
872
883
|
setup(e) {
|
|
873
|
-
return (a, o) => (h(),
|
|
884
|
+
return (a, o) => (h(), A("div", {
|
|
874
885
|
class: X({
|
|
875
886
|
"top-tagSelector_tagIcon": !0,
|
|
876
887
|
"top-tagSelector-active": !!e.state,
|
|
@@ -879,11 +890,11 @@ const ce = {
|
|
|
879
890
|
"data-tag_id": e.id,
|
|
880
891
|
"data-tag_color_id": e.colorId,
|
|
881
892
|
title: e.name
|
|
882
|
-
}, null, 10,
|
|
893
|
+
}, null, 10, Ct));
|
|
883
894
|
}
|
|
884
|
-
}),
|
|
895
|
+
}), Bt = ["contenteditable", "onKeydown"], Ae = /* @__PURE__ */ R({
|
|
885
896
|
__name: "tagPopupListItem",
|
|
886
|
-
props: /* @__PURE__ */
|
|
897
|
+
props: /* @__PURE__ */ V({
|
|
887
898
|
editable: { type: Boolean },
|
|
888
899
|
disabled: { type: Boolean },
|
|
889
900
|
canExclude: { type: Boolean },
|
|
@@ -897,74 +908,74 @@ const ce = {
|
|
|
897
908
|
},
|
|
898
909
|
nameModifiers: {}
|
|
899
910
|
}),
|
|
900
|
-
emits: /* @__PURE__ */
|
|
911
|
+
emits: /* @__PURE__ */ V(["update:name", "unselect", "exclude", "select"], ["update:name"]),
|
|
901
912
|
setup(e, { emit: a }) {
|
|
902
|
-
const o = e, t = a, r =
|
|
903
|
-
contenteditable:
|
|
913
|
+
const o = e, t = a, r = T(e, "name"), l = K(null), n = M(() => navigator.userAgent.indexOf("Firefox") != -1 ? {
|
|
914
|
+
contenteditable: u.value,
|
|
904
915
|
onpaste: (m) => m.preventDefault()
|
|
905
|
-
} : {}),
|
|
906
|
-
|
|
907
|
-
},
|
|
916
|
+
} : {}), u = K(!1), f = async () => {
|
|
917
|
+
u.value = !0, await Re(), l.value?.focus();
|
|
918
|
+
}, c = () => {
|
|
908
919
|
const m = l.value?.innerText;
|
|
909
|
-
if (!m) return
|
|
910
|
-
l.value && (l.value.innerText = m),
|
|
911
|
-
},
|
|
912
|
-
l.value && (l.value.innerText = o.name),
|
|
920
|
+
if (!m) return x();
|
|
921
|
+
l.value && (l.value.innerText = m), u.value = !1, t("update:name", m);
|
|
922
|
+
}, x = async () => {
|
|
923
|
+
l.value && (l.value.innerText = o.name), u.value = !1;
|
|
913
924
|
}, i = (m) => {
|
|
914
|
-
if (
|
|
915
|
-
let
|
|
916
|
-
o.canExclude && (m.ctrlKey || m.metaKey) && (
|
|
925
|
+
if (u.value || o.disabled) return;
|
|
926
|
+
let d = "selected";
|
|
927
|
+
o.canExclude && (m.ctrlKey || m.metaKey) && (d = "excluded"), o.state == d && (d = ""), d === "" && t("unselect"), d === "selected" && t("select"), d === "excluded" && t("exclude");
|
|
917
928
|
};
|
|
918
|
-
return (m,
|
|
929
|
+
return (m, d) => (h(), C(ve, {
|
|
919
930
|
class: X({
|
|
920
931
|
"top-tagSelector_tagListItem": !0,
|
|
921
|
-
"top-tagSelector_tagListItem-inEdit":
|
|
932
|
+
"top-tagSelector_tagListItem-inEdit": u.value,
|
|
922
933
|
"top-tagSelector_tagListItem-disabled": e.disabled,
|
|
923
934
|
"top-tagSelector_tagListItem-canExclude": e.canExclude,
|
|
924
935
|
"top-tagSelector-active": !!e.state,
|
|
925
936
|
"top-tagSelector-excluded": e.state === "excluded"
|
|
926
937
|
}),
|
|
927
|
-
onClick:
|
|
938
|
+
onClick: U(i, ["stop"])
|
|
928
939
|
}, {
|
|
929
940
|
default: B(() => [
|
|
930
|
-
|
|
941
|
+
P(fe, {
|
|
931
942
|
id: e.id,
|
|
932
943
|
name: r.value,
|
|
933
944
|
colorId: e.colorId,
|
|
934
945
|
state: e.state
|
|
935
946
|
}, null, 8, ["id", "name", "colorId", "state"]),
|
|
936
|
-
oe("span",
|
|
947
|
+
oe("span", Ve({
|
|
937
948
|
ref_key: "elName",
|
|
938
949
|
ref: l,
|
|
939
950
|
class: "top-tagSelector_tagListItemName",
|
|
940
|
-
contenteditable:
|
|
951
|
+
contenteditable: u.value ? "plaintext-only" : !1
|
|
941
952
|
}, n.value, {
|
|
942
953
|
onKeydown: [
|
|
943
|
-
|
|
944
|
-
|
|
954
|
+
Ie(U(c, ["stop"]), ["enter"]),
|
|
955
|
+
Ie(U(x, ["stop"]), ["esc"])
|
|
945
956
|
]
|
|
946
|
-
}),
|
|
947
|
-
e.editable ? (h(),
|
|
948
|
-
|
|
957
|
+
}), b(r.value), 17, Bt),
|
|
958
|
+
e.editable ? (h(), A(Y, { key: 0 }, [
|
|
959
|
+
u.value ? (h(), A("span", {
|
|
949
960
|
key: 1,
|
|
950
961
|
"data-top-icon": "",
|
|
951
962
|
class: "top-tagSelector_edit",
|
|
952
|
-
onClick:
|
|
953
|
-
})) : (h(),
|
|
963
|
+
onClick: U(c, ["stop"])
|
|
964
|
+
})) : (h(), A("span", {
|
|
954
965
|
key: 0,
|
|
955
966
|
"data-top-icon": "",
|
|
956
967
|
class: "top-tagSelector_edit",
|
|
957
|
-
onClick:
|
|
968
|
+
onClick: f
|
|
958
969
|
}))
|
|
959
970
|
], 64)) : O("", !0)
|
|
960
971
|
]),
|
|
961
972
|
_: 1
|
|
962
973
|
}, 8, ["class"]));
|
|
963
974
|
}
|
|
964
|
-
}),
|
|
975
|
+
}), Tt = { key: 1 }, At = /* @__PURE__ */ R({
|
|
965
976
|
inheritAttrs: !1,
|
|
966
977
|
__name: "popupOpener",
|
|
967
|
-
props: /* @__PURE__ */
|
|
978
|
+
props: /* @__PURE__ */ V({
|
|
968
979
|
modelValue: {},
|
|
969
980
|
id: {},
|
|
970
981
|
tags: {},
|
|
@@ -982,18 +993,18 @@ const ce = {
|
|
|
982
993
|
}),
|
|
983
994
|
emits: ["update:modelValue"],
|
|
984
995
|
setup(e) {
|
|
985
|
-
const a = e, o =
|
|
996
|
+
const a = e, o = T(e, "modelValue"), t = a.useTopButton ? Q : "div", r = a.useTopButton ? "html" : "default", l = {
|
|
986
997
|
model: o,
|
|
987
998
|
mode: a.mode,
|
|
988
999
|
targetId: a.targetId,
|
|
989
1000
|
filters: a.filters,
|
|
990
1001
|
payload: a.payload
|
|
991
1002
|
};
|
|
992
|
-
return (n,
|
|
993
|
-
const
|
|
994
|
-
return h(), C(
|
|
1003
|
+
return (n, u) => {
|
|
1004
|
+
const f = Pe("top-data");
|
|
1005
|
+
return h(), C(Je, { id: e.id }, {
|
|
995
1006
|
default: B(() => [
|
|
996
|
-
|
|
1007
|
+
Ne((h(), C(De(v(t)), Ve({
|
|
997
1008
|
class: {
|
|
998
1009
|
"top-tagSelector": !0,
|
|
999
1010
|
"top-tagSelector-useTopButton": a.useTopButton,
|
|
@@ -1009,34 +1020,34 @@ const ce = {
|
|
|
1009
1020
|
styling: e.styling
|
|
1010
1021
|
}, n.$attrs), {
|
|
1011
1022
|
[v(r)]: B(() => [
|
|
1012
|
-
!o.value.length && e.mode === "filter" ? (h(), C(
|
|
1023
|
+
!o.value.length && e.mode === "filter" ? (h(), C(fe, {
|
|
1013
1024
|
key: 0,
|
|
1014
1025
|
id: "all",
|
|
1015
1026
|
colorId: "",
|
|
1016
1027
|
name: n.$i18n.Common.All_tags ?? "",
|
|
1017
1028
|
state: ""
|
|
1018
1029
|
}, null, 8, ["name"])) : O("", !0),
|
|
1019
|
-
e.mode === "setter" && e.filters ? (h(),
|
|
1030
|
+
e.mode === "setter" && e.filters ? (h(), A("div", Tt, [
|
|
1020
1031
|
qe(n.$slots, "default")
|
|
1021
|
-
])) : (h(!0),
|
|
1022
|
-
id: v(
|
|
1023
|
-
colorId: v(
|
|
1024
|
-
name: v(
|
|
1025
|
-
state: v(
|
|
1032
|
+
])) : (h(!0), A(Y, { key: 2 }, me(o.value, (c) => (h(), C(fe, {
|
|
1033
|
+
id: v(H)(c),
|
|
1034
|
+
colorId: v(ie)(c, e.tags)?.color_id ?? "",
|
|
1035
|
+
name: v(ie)(c, e.tags)?.name ?? "",
|
|
1036
|
+
state: v(H)(c) === c ? "selected" : "excluded"
|
|
1026
1037
|
}, null, 8, ["id", "colorId", "name", "state"]))), 256))
|
|
1027
1038
|
]),
|
|
1028
1039
|
_: 2
|
|
1029
1040
|
}, 1040, ["class", "styling"])), [
|
|
1030
|
-
[
|
|
1041
|
+
[f, l, "topTagSelectorTarget"]
|
|
1031
1042
|
])
|
|
1032
1043
|
]),
|
|
1033
1044
|
_: 3
|
|
1034
1045
|
}, 8, ["id"]);
|
|
1035
1046
|
};
|
|
1036
1047
|
}
|
|
1037
|
-
}),
|
|
1048
|
+
}), Ut = /* @__PURE__ */ R({
|
|
1038
1049
|
__name: "tagSelector",
|
|
1039
|
-
props: /* @__PURE__ */
|
|
1050
|
+
props: /* @__PURE__ */ V({
|
|
1040
1051
|
modelValue: {},
|
|
1041
1052
|
tags: {},
|
|
1042
1053
|
tagsEditable: { type: Boolean },
|
|
@@ -1054,141 +1065,141 @@ const ce = {
|
|
|
1054
1065
|
},
|
|
1055
1066
|
modelModifiers: {},
|
|
1056
1067
|
tags: {
|
|
1057
|
-
default:
|
|
1068
|
+
default: be(kt)
|
|
1058
1069
|
},
|
|
1059
1070
|
tagsModifiers: {}
|
|
1060
1071
|
}),
|
|
1061
|
-
emits: /* @__PURE__ */
|
|
1072
|
+
emits: /* @__PURE__ */ V(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
|
|
1062
1073
|
setup(e, { emit: a }) {
|
|
1063
|
-
const o = w(), t = e, r =
|
|
1064
|
-
n(p,
|
|
1074
|
+
const o = w(), t = e, r = T(e, "modelValue"), l = T(e, "tags"), n = a, u = ze((p, I) => {
|
|
1075
|
+
n(p, I);
|
|
1065
1076
|
}, t.emitDelay);
|
|
1066
1077
|
t.singleMode && !r.value.length && (r.value = [l.value[0].id]);
|
|
1067
|
-
const
|
|
1068
|
-
const p = " " + o.Common.Tags?.toLowerCase(),
|
|
1069
|
-
return
|
|
1078
|
+
const f = t.id ?? "top-popup-id-" + Math.random(), c = K("add"), x = () => {
|
|
1079
|
+
const p = " " + o.Common.Tags?.toLowerCase(), I = /* @__PURE__ */ new Map();
|
|
1080
|
+
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;
|
|
1070
1081
|
};
|
|
1071
|
-
let i =
|
|
1082
|
+
let i = Fe({
|
|
1072
1083
|
model: r,
|
|
1073
1084
|
mode: "filter",
|
|
1074
1085
|
targetId: void 0,
|
|
1075
1086
|
filters: void 0,
|
|
1076
1087
|
payload: void 0
|
|
1077
1088
|
});
|
|
1078
|
-
|
|
1079
|
-
|
|
1089
|
+
E(r, () => {
|
|
1090
|
+
u("selector", r.value);
|
|
1080
1091
|
});
|
|
1081
|
-
const m =
|
|
1092
|
+
const m = M(() => {
|
|
1082
1093
|
if (i.value.mode === "setter" && t.maxTagsForSetter && !i.value.filters)
|
|
1083
1094
|
return i.value.model.value.length >= t.maxTagsForSetter;
|
|
1084
|
-
}),
|
|
1095
|
+
}), d = (p) => {
|
|
1085
1096
|
if (p !== "all") {
|
|
1086
1097
|
if (i.value.model.value.includes(p)) return "selected";
|
|
1087
|
-
if (i.value.model.value.includes(
|
|
1098
|
+
if (i.value.model.value.includes(Be(p))) return "excluded";
|
|
1088
1099
|
}
|
|
1089
1100
|
return p === "all" && !i.value.model.value.length ? "selected" : "";
|
|
1090
|
-
}, s = (p,
|
|
1091
|
-
const
|
|
1092
|
-
let k = i.value.model.value.filter((
|
|
1093
|
-
|
|
1101
|
+
}, s = (p, I) => {
|
|
1102
|
+
const S = Be(p);
|
|
1103
|
+
let k = i.value.model.value.filter((G) => G !== p && G !== S);
|
|
1104
|
+
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) => {
|
|
1094
1105
|
if (!t.tags) return 0;
|
|
1095
|
-
const D = t.tags.findIndex((
|
|
1106
|
+
const D = t.tags.findIndex((F) => F.id === G), q = t.tags.findIndex((F) => F.id === ee);
|
|
1096
1107
|
return D - q;
|
|
1097
|
-
}), i.value.model.value = k, i.value.mode === "setter" && i.value.targetId !== void 0 &&
|
|
1108
|
+
}), i.value.model.value = k, i.value.mode === "setter" && i.value.targetId !== void 0 && u("setter", {
|
|
1098
1109
|
tagsIds: k,
|
|
1099
1110
|
targetId: i.value.targetId,
|
|
1100
1111
|
payload: i.value.payload
|
|
1101
1112
|
});
|
|
1102
|
-
}, g =
|
|
1113
|
+
}, g = M(() => {
|
|
1103
1114
|
let p = "top-tagSelector_popup";
|
|
1104
1115
|
return i.value.mode === "filter" && (p += " top-tagSelector_popup-filter"), i.value.mode === "setter" && (p += " top-tagSelector_popup-setter"), p;
|
|
1105
1116
|
}), Z = () => {
|
|
1106
1117
|
const p = prompt("", "New tag");
|
|
1107
1118
|
if (!p || p === "New tag") return;
|
|
1108
|
-
const
|
|
1119
|
+
const I = l.value.length + 1;
|
|
1109
1120
|
l.value.push({
|
|
1110
|
-
id: String(
|
|
1121
|
+
id: String(I),
|
|
1111
1122
|
name: p,
|
|
1112
|
-
color_id: String((
|
|
1123
|
+
color_id: String((I - 1) % 10 + 1)
|
|
1113
1124
|
}), n("tagsChanged", l.value);
|
|
1114
|
-
},
|
|
1115
|
-
if (i.value =
|
|
1116
|
-
if (i.value.filters && (
|
|
1125
|
+
}, N = (p) => {
|
|
1126
|
+
if (i.value = W(p.elPopupOpener, "topTagSelectorTarget"), !i.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
|
|
1127
|
+
if (i.value.filters && (c.value = "add", i.value.model.value = []), !z.$?.ui.sortable) {
|
|
1117
1128
|
console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
|
|
1118
1129
|
return;
|
|
1119
1130
|
}
|
|
1120
|
-
!
|
|
1131
|
+
!z.state.isMobile && !z.state.isMobileUA && l.value && $(p.elPopup).sortable({
|
|
1121
1132
|
items: 'li:has([data-tag_id]:not([data-tag_id="all"]))',
|
|
1122
1133
|
/**
|
|
1123
1134
|
* @todo Удалить `[contenteditable="true"]` через пол года после выхода версии firefox с поддержкой contenteditable plaintext-only, включая бета версии
|
|
1124
1135
|
*/
|
|
1125
1136
|
cancel: '[contenteditable="plaintext-only"], [contenteditable="true"]',
|
|
1126
1137
|
distance: 10,
|
|
1127
|
-
stop: function(
|
|
1138
|
+
stop: function(I, S) {
|
|
1128
1139
|
if (!l.value) return;
|
|
1129
|
-
const k = $(
|
|
1140
|
+
const k = $(S.item).parent().find("[data-tag_id]"), G = [];
|
|
1130
1141
|
k.each((ee, D) => {
|
|
1131
1142
|
if (!l.value) return;
|
|
1132
1143
|
const q = $(D).attr("data-tag_id");
|
|
1133
|
-
|
|
1144
|
+
G.push(q);
|
|
1134
1145
|
}), l.value.sort((ee, D) => {
|
|
1135
|
-
const q =
|
|
1136
|
-
return q -
|
|
1137
|
-
}),
|
|
1146
|
+
const q = G.findIndex((de) => de === ee.id), F = G.findIndex((de) => de === D.id);
|
|
1147
|
+
return q - F;
|
|
1148
|
+
}), u("tagsChanged", l.value);
|
|
1138
1149
|
}
|
|
1139
1150
|
});
|
|
1140
|
-
},
|
|
1141
|
-
|
|
1151
|
+
}, je = (p) => {
|
|
1152
|
+
z.$?.ui.sortable && $(p.elPopup).data("ui-sortable") && $(p.elPopup).sortable("destroy");
|
|
1142
1153
|
};
|
|
1143
|
-
return (p,
|
|
1144
|
-
|
|
1154
|
+
return (p, I) => (h(), A(Y, null, [
|
|
1155
|
+
P(At, {
|
|
1145
1156
|
modelValue: r.value,
|
|
1146
|
-
"onUpdate:modelValue":
|
|
1147
|
-
id: v(
|
|
1157
|
+
"onUpdate:modelValue": I[0] || (I[0] = (S) => r.value = S),
|
|
1158
|
+
id: v(f),
|
|
1148
1159
|
tags: l.value,
|
|
1149
1160
|
styling: e.styling,
|
|
1150
1161
|
mode: "filter",
|
|
1151
1162
|
useTopButton: e.useTopButton
|
|
1152
1163
|
}, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
|
|
1153
|
-
|
|
1154
|
-
id: v(
|
|
1164
|
+
P(we, {
|
|
1165
|
+
id: v(f),
|
|
1155
1166
|
class: X(g.value),
|
|
1156
|
-
onOpen:
|
|
1157
|
-
onClose:
|
|
1167
|
+
onOpen: I[4] || (I[4] = (S) => N(S)),
|
|
1168
|
+
onClose: I[5] || (I[5] = (S) => je(S)),
|
|
1158
1169
|
"transition-duration": 50
|
|
1159
|
-
},
|
|
1170
|
+
}, Ue({
|
|
1160
1171
|
contentList: B(() => [
|
|
1161
|
-
v(i).mode === "filter" && !e.singleMode ? (h(), C(
|
|
1172
|
+
v(i).mode === "filter" && !e.singleMode ? (h(), C(Ae, {
|
|
1162
1173
|
key: 0,
|
|
1163
1174
|
id: "all",
|
|
1164
1175
|
colorId: "",
|
|
1165
1176
|
name: p.$i18n.Common.All_tags ?? "",
|
|
1166
1177
|
state: v(i).model.value.length ? "" : "selected",
|
|
1167
|
-
onSelect:
|
|
1178
|
+
onSelect: I[3] || (I[3] = (S) => v(i).model.value = [])
|
|
1168
1179
|
}, null, 8, ["name", "state"])) : O("", !0),
|
|
1169
|
-
(h(!0),
|
|
1170
|
-
key:
|
|
1171
|
-
id:
|
|
1172
|
-
colorId:
|
|
1173
|
-
name:
|
|
1174
|
-
state:
|
|
1180
|
+
(h(!0), A(Y, null, me(l.value, (S) => (h(), C(Ae, {
|
|
1181
|
+
key: S.id,
|
|
1182
|
+
id: S.id,
|
|
1183
|
+
colorId: S.color_id,
|
|
1184
|
+
name: S.name,
|
|
1185
|
+
state: d(S.id),
|
|
1175
1186
|
canExclude: v(i).mode === "filter" && !e.singleMode,
|
|
1176
1187
|
editable: e.tagsEditable,
|
|
1177
|
-
disabled: m.value &&
|
|
1178
|
-
onUnselect: (k) => s(
|
|
1179
|
-
onSelect: (k) => s(
|
|
1180
|
-
onExclude: (k) => s(
|
|
1188
|
+
disabled: m.value && d(S.id) === "",
|
|
1189
|
+
onUnselect: (k) => s(S.id, "unselect"),
|
|
1190
|
+
onSelect: (k) => s(S.id, "select"),
|
|
1191
|
+
onExclude: (k) => s(S.id, "exclude"),
|
|
1181
1192
|
"onUpdate:name": (k) => {
|
|
1182
|
-
|
|
1193
|
+
S.name = k, v(u)("tagsChanged", l.value);
|
|
1183
1194
|
}
|
|
1184
1195
|
}, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
|
|
1185
|
-
e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), C(
|
|
1196
|
+
e.tagsEditable && l.value.length < e.tagsMax && l.value.length < 20 ? (h(), C(ve, {
|
|
1186
1197
|
key: 1,
|
|
1187
1198
|
"data-top-icon": "",
|
|
1188
|
-
onClick:
|
|
1199
|
+
onClick: U(Z, ["stop"])
|
|
1189
1200
|
}, {
|
|
1190
1201
|
default: B(() => [
|
|
1191
|
-
|
|
1202
|
+
J(b(p.$i18n.Common.Add), 1)
|
|
1192
1203
|
]),
|
|
1193
1204
|
_: 1
|
|
1194
1205
|
})) : O("", !0)
|
|
@@ -1198,10 +1209,10 @@ const ce = {
|
|
|
1198
1209
|
v(i).mode === "setter" && v(i).filters ? {
|
|
1199
1210
|
name: "header",
|
|
1200
1211
|
fn: B(() => [
|
|
1201
|
-
|
|
1202
|
-
modelValue:
|
|
1203
|
-
"onUpdate:modelValue":
|
|
1204
|
-
options:
|
|
1212
|
+
P(ce, {
|
|
1213
|
+
modelValue: c.value,
|
|
1214
|
+
"onUpdate:modelValue": I[1] || (I[1] = (S) => c.value = S),
|
|
1215
|
+
options: x()
|
|
1205
1216
|
}, null, 8, ["modelValue", "options"])
|
|
1206
1217
|
]),
|
|
1207
1218
|
key: "0"
|
|
@@ -1209,22 +1220,22 @@ const ce = {
|
|
|
1209
1220
|
v(i).mode === "setter" && v(i).filters ? {
|
|
1210
1221
|
name: "footer",
|
|
1211
1222
|
fn: B(() => [
|
|
1212
|
-
|
|
1223
|
+
P(Q, { color: "theme" }, {
|
|
1213
1224
|
default: B(() => [
|
|
1214
|
-
|
|
1225
|
+
J(b(p.$i18n.Common.Cancel), 1)
|
|
1215
1226
|
]),
|
|
1216
1227
|
_: 1
|
|
1217
1228
|
}),
|
|
1218
|
-
|
|
1219
|
-
onClick:
|
|
1229
|
+
P(Q, {
|
|
1230
|
+
onClick: I[2] || (I[2] = (S) => v(u)("setter", {
|
|
1220
1231
|
tagsIds: v(i).model.value,
|
|
1221
1232
|
filters: v(i).filters,
|
|
1222
|
-
filtersAction:
|
|
1233
|
+
filtersAction: c.value,
|
|
1223
1234
|
payload: v(i).payload
|
|
1224
1235
|
}))
|
|
1225
1236
|
}, {
|
|
1226
1237
|
default: B(() => [
|
|
1227
|
-
|
|
1238
|
+
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)
|
|
1228
1239
|
]),
|
|
1229
1240
|
_: 1
|
|
1230
1241
|
})
|
|
@@ -1236,16 +1247,16 @@ const ce = {
|
|
|
1236
1247
|
}
|
|
1237
1248
|
});
|
|
1238
1249
|
export {
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1250
|
+
Rt as TopCompetitorSelector,
|
|
1251
|
+
Dt as TopGroupSelector,
|
|
1252
|
+
Nt as TopRegionSelector,
|
|
1253
|
+
Ut as TopTagSelector,
|
|
1254
|
+
At as TopTagSelectorPopupOpener,
|
|
1255
|
+
fe as TopTagSelectorTagIcon,
|
|
1256
|
+
it as dialogRegionSelector,
|
|
1257
|
+
rt as findRegion,
|
|
1258
|
+
qt as genElTopTagSelectorPopupOpener,
|
|
1259
|
+
Ke as genSearcherByKey,
|
|
1249
1260
|
Ft as renderElTopTagSelectorPopupOpener,
|
|
1250
1261
|
Pt as useItemsFromCompetitors
|
|
1251
1262
|
};
|