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