@topvisor/ui 1.5.6-topSelectorReactive.2 → 1.5.6
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/{api-DZQlrC2R.amd.js → api-DupNAJPm.amd.js} +2 -2
- package/.chunks/{api-DZQlrC2R.amd.js.map → api-DupNAJPm.amd.js.map} +1 -1
- package/.chunks/{api-DZQlrC2R.esm.js → api-DupNAJPm.esm.js} +2 -2
- package/.chunks/{api-DZQlrC2R.esm.js.map → api-DupNAJPm.esm.js.map} +1 -1
- package/.chunks/formsExt-DzXSTWaT.amd.js +2 -0
- package/.chunks/formsExt-DzXSTWaT.amd.js.map +1 -0
- package/.chunks/{formsExt-C9r4Gz9y.esm.js → formsExt-DzXSTWaT.esm.js} +126 -122
- package/.chunks/formsExt-DzXSTWaT.esm.js.map +1 -0
- package/.chunks/{mocker-Bl1SzAJY.amd.js → mocker-C9Dl3SwM.amd.js} +2 -2
- package/.chunks/mocker-C9Dl3SwM.amd.js.map +1 -0
- package/.chunks/{mocker-Bl1SzAJY.esm.js → mocker-C9Dl3SwM.esm.js} +2 -2
- package/.chunks/mocker-C9Dl3SwM.esm.js.map +1 -0
- package/api/index.amd.js +1 -1
- package/api/index.amd.js.map +1 -1
- package/api/index.js +1 -1
- package/assets/project.css +1 -1
- package/autoload-css-manifest.amd.json +1 -1
- package/autoload-css-manifest.json +1 -1
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.amd.js.map +1 -1
- package/formsExt/formsExt.js +1 -1
- package/package.json +6 -6
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +432 -416
- package/project/project.js.map +1 -1
- package/src/api/api/types/mocker.d.ts +3 -2
- package/src/components/formsExt/selector2/types.d.ts +1 -1
- package/src/components/project/projectSelector/cache.d.ts +1 -1
- package/src/components/project/projectSelector/stories/mocks/index.d.ts +2 -2
- package/src/components/project/regionSelector/utils/consts.d.ts +1 -0
- package/src/core/utils/searchers.d.ts +1 -0
- package/utils/searchers.amd.js +1 -1
- package/utils/searchers.amd.js.map +1 -1
- package/utils/searchers.js +2 -0
- package/utils/searchers.js.map +1 -1
- package/.chunks/formsExt-C9r4Gz9y.amd.js +0 -2
- package/.chunks/formsExt-C9r4Gz9y.amd.js.map +0 -1
- package/.chunks/formsExt-C9r4Gz9y.esm.js.map +0 -1
- package/.chunks/mocker-Bl1SzAJY.amd.js.map +0 -1
- package/.chunks/mocker-Bl1SzAJY.esm.js.map +0 -1
package/project/project.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
_autoloadCSSCore.insertCSSLinkToPage(fileNames, true);
|
|
6
6
|
/* end import css */
|
|
7
7
|
|
|
8
|
-
import "../.chunks/api-
|
|
8
|
+
import "../.chunks/api-DupNAJPm.esm.js";
|
|
9
9
|
import { E as e, O as t, P as n, h as r, n as i } from "../.chunks/forms-CY5MOh7a.esm.js";
|
|
10
10
|
import { n as a, t as o } from "../.chunks/field-DEusYVqS.esm.js";
|
|
11
11
|
import { storage as s } from "../utils/dom.js";
|
|
@@ -16,13 +16,13 @@ import { validUrl as u } from "../utils/check.js";
|
|
|
16
16
|
import { ellipsis as d } from "../utils/string.js";
|
|
17
17
|
import { getDeviceGIcon as f, getLangLabel as p, getSearcherGIcon as m } from "../utils/searchers.js";
|
|
18
18
|
import { invertKeyboardLayout as h } from "../utils/keyboard.js";
|
|
19
|
-
import { c as g, n as _, o as v, r as
|
|
20
|
-
import { d as
|
|
21
|
-
import { Fragment as
|
|
19
|
+
import { c as g, n as _, o as v, r as y, s as b } from "../.chunks/popup-3cwJ8Hev.esm.js";
|
|
20
|
+
import { d as x, f as S, s as C, u as ee } from "../.chunks/formsExt-DzXSTWaT.esm.js";
|
|
21
|
+
import { Fragment as w, computed as T, createBlock as E, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createSlots as te, createTextVNode as A, createVNode as j, defineComponent as M, isRef as ne, mergeModels as N, mergeProps as re, nextTick as ie, normalizeClass as P, onMounted as ae, openBlock as F, reactive as oe, ref as I, renderList as L, renderSlot as se, resolveComponent as ce, resolveDirective as le, resolveDynamicComponent as ue, shallowRef as de, toDisplayString as R, toValue as fe, unref as z, useId as pe, useModel as B, watch as V, withCtx as H, withDirectives as me, withKeys as he, withModifiers as U } from "vue";
|
|
22
22
|
//#region src/components/project/competitorSelector/competitorSelector.vue?vue&type=script&setup=true&lang.ts
|
|
23
|
-
var
|
|
23
|
+
var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, ve = /* @__PURE__ */ M({
|
|
24
24
|
__name: "competitorSelector",
|
|
25
|
-
props: /*@__PURE__*/
|
|
25
|
+
props: /*@__PURE__*/ N({
|
|
26
26
|
modelValue: {},
|
|
27
27
|
items: {},
|
|
28
28
|
showSelectAllItem: {
|
|
@@ -36,7 +36,7 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
36
36
|
}),
|
|
37
37
|
emits: ["update:modelValue"],
|
|
38
38
|
setup(n) {
|
|
39
|
-
let i = n, a =
|
|
39
|
+
let i = n, a = B(n, "modelValue"), o = T(() => {
|
|
40
40
|
if (i.showSelectAllItem) return {
|
|
41
41
|
icon: i.selectAllItemIcon,
|
|
42
42
|
title: e().Common.Select_all,
|
|
@@ -44,23 +44,23 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
44
44
|
content: ""
|
|
45
45
|
};
|
|
46
46
|
});
|
|
47
|
-
return (e, i) => (
|
|
48
|
-
opener:
|
|
47
|
+
return (e, i) => (F(), O("div", ge, [z(t).state.isMobile ? (F(), E(b, { key: 0 }, {
|
|
48
|
+
opener: H(() => [j(r, {
|
|
49
49
|
class: "top-competitorSelector_opener",
|
|
50
50
|
color: "theme",
|
|
51
51
|
icon: "",
|
|
52
52
|
icon2: ""
|
|
53
53
|
}, {
|
|
54
|
-
default:
|
|
54
|
+
default: H(() => [A(R(n.items.find((e) => e.value === a.value?.[0])?.content), 1)]),
|
|
55
55
|
_: 1
|
|
56
56
|
})]),
|
|
57
|
-
contentList:
|
|
58
|
-
class:
|
|
57
|
+
contentList: H(() => [(F(!0), O(w, null, L(n.items, (e) => (F(), E(v, {
|
|
58
|
+
class: P({ "top-active": a.value?.includes(e.value) }),
|
|
59
59
|
"data-top-icon": e.icon,
|
|
60
60
|
title: e.title,
|
|
61
61
|
onClick: () => a.value = [e.value]
|
|
62
62
|
}, {
|
|
63
|
-
default:
|
|
63
|
+
default: H(() => [k("span", _e, R(e.content), 1)]),
|
|
64
64
|
_: 2
|
|
65
65
|
}, 1032, [
|
|
66
66
|
"class",
|
|
@@ -69,7 +69,7 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
69
69
|
"onClick"
|
|
70
70
|
]))), 256))]),
|
|
71
71
|
_: 1
|
|
72
|
-
})) : (
|
|
72
|
+
})) : (F(), E(S, {
|
|
73
73
|
key: 1,
|
|
74
74
|
modelValue: a.value,
|
|
75
75
|
"onUpdate:modelValue": i[0] ||= (e) => a.value = e,
|
|
@@ -84,12 +84,12 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
84
84
|
"selectAllItem"
|
|
85
85
|
]))]));
|
|
86
86
|
}
|
|
87
|
-
}),
|
|
87
|
+
}), ye = (e, t) => T(() => fe(e).filter((e) => e.on >= 0 || e.id === t).map((e) => ({
|
|
88
88
|
value: e.id,
|
|
89
89
|
title: e.url + ` [${e.id}]`,
|
|
90
|
-
icon: e.id ===
|
|
90
|
+
icon: e.id === fe(t) ? "" : "",
|
|
91
91
|
content: e.name
|
|
92
|
-
}))),
|
|
92
|
+
}))), be = {
|
|
93
93
|
0: "Yandex",
|
|
94
94
|
1: "Google",
|
|
95
95
|
4: "YouTube",
|
|
@@ -98,26 +98,27 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
98
98
|
8: "AppStore",
|
|
99
99
|
9: "GoogleStore",
|
|
100
100
|
20: "Yandex.com",
|
|
101
|
-
21: "Yandex.com.tr"
|
|
102
|
-
|
|
101
|
+
21: "Yandex.com.tr",
|
|
102
|
+
22: "YandexLive"
|
|
103
|
+
}, xe = {
|
|
103
104
|
key: -2,
|
|
104
105
|
name: "--",
|
|
105
106
|
index: -2
|
|
106
|
-
},
|
|
107
|
+
}, Se = {
|
|
107
108
|
key: -2,
|
|
108
109
|
name: "--",
|
|
109
|
-
regions: [
|
|
110
|
-
regionByIndex: /* @__PURE__ */ new Map([[-2,
|
|
111
|
-
},
|
|
110
|
+
regions: [xe],
|
|
111
|
+
regionByIndex: /* @__PURE__ */ new Map([[-2, xe]])
|
|
112
|
+
}, W = {
|
|
112
113
|
key: -2,
|
|
113
114
|
name: "Autoselect",
|
|
114
115
|
index: -2
|
|
115
|
-
},
|
|
116
|
+
}, Ce = {
|
|
116
117
|
key: -2,
|
|
117
118
|
name: "Autoselect",
|
|
118
|
-
regions: [
|
|
119
|
-
regionByIndex: /* @__PURE__ */ new Map([[-2,
|
|
120
|
-
},
|
|
119
|
+
regions: [W],
|
|
120
|
+
regionByIndex: /* @__PURE__ */ new Map([[-2, W]])
|
|
121
|
+
}, we = {
|
|
121
122
|
countryCode: "00",
|
|
122
123
|
depth: 1,
|
|
123
124
|
device: 0,
|
|
@@ -125,13 +126,13 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
125
126
|
index: -1,
|
|
126
127
|
lang: "ru",
|
|
127
128
|
name: "Without region"
|
|
128
|
-
},
|
|
129
|
+
}, Te = () => (W.name = e().Common.Autoselect, W), Ee = () => (Te(), Ce.name = e().Common.Autoselect, console.log(Ce), Ce), De = () => (we.name = e().Keywords.Without_region, we), Oe = (e = "", t = !1, n = []) => {
|
|
129
130
|
let r;
|
|
130
|
-
return r = e ?
|
|
131
|
-
},
|
|
131
|
+
return r = e ? Ae(n, e) : ke(n), t && r.set(-2, Ee()), r.size || r.set(-2, Se), r;
|
|
132
|
+
}, ke = (e, t = !0, n = [], r = "") => {
|
|
132
133
|
let i = /* @__PURE__ */ new Map();
|
|
133
134
|
return e.forEach((e) => {
|
|
134
|
-
if (!e.enabled || r && typeof e.key == "number" && e.key > 1) return;
|
|
135
|
+
if (r !== "project_relevant_url" && !e.enabled || r && typeof e.key == "number" && e.key > 1) return;
|
|
135
136
|
let a = { ...e };
|
|
136
137
|
a.regionByIndex = /* @__PURE__ */ new Map(), e.regions && e.regions.forEach((e) => {
|
|
137
138
|
if (t && !e.enabled) return;
|
|
@@ -142,35 +143,35 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
142
143
|
if (i.has(e)) return;
|
|
143
144
|
let t = {
|
|
144
145
|
key: e,
|
|
145
|
-
name:
|
|
146
|
+
name: be[e],
|
|
146
147
|
regions: [],
|
|
147
148
|
regionByIndex: /* @__PURE__ */ new Map()
|
|
148
149
|
};
|
|
149
150
|
i.set(t.key, t);
|
|
150
151
|
}), i;
|
|
151
|
-
},
|
|
152
|
-
let r =
|
|
152
|
+
}, Ae = (e, n) => {
|
|
153
|
+
let r = ke(e, !1, t.state.forceSearchersKeysForKeywordsStats, n);
|
|
153
154
|
if (r.has(2)) {
|
|
154
155
|
let e = r.get(2);
|
|
155
156
|
e && (e.regionByIndex = /* @__PURE__ */ new Map());
|
|
156
157
|
}
|
|
157
158
|
return (n === "volume" || n === "cost_forecast") && t.state.showGlobalRegionForKeywordsStats && r.forEach((e) => {
|
|
158
159
|
if (!e.regionByIndex) return;
|
|
159
|
-
let t = { ...
|
|
160
|
+
let t = { ...De() };
|
|
160
161
|
e.regionByIndex.set(t.index, t);
|
|
161
162
|
}), r;
|
|
162
|
-
},
|
|
163
|
-
let r =
|
|
163
|
+
}, je = (e, t, n = []) => {
|
|
164
|
+
let r = Oe(e, !1, n), i;
|
|
164
165
|
return r.forEach((n) => {
|
|
165
166
|
if (!(t.searcher_key !== void 0 && t.searcher_key != n.key) && n.regions && (n.regions.forEach((r) => {
|
|
166
167
|
if (!i && !(t.key !== void 0 && t.key != r.key) && !(t.index !== void 0 && t.index != r.index) && !(!e && (t.lang !== void 0 && t.lang != r.lang || t.device !== void 0 && t.device != r.device))) return r.searcher_key = n.key, i = r, !1;
|
|
167
168
|
}), i)) return !1;
|
|
168
169
|
}), i;
|
|
169
|
-
},
|
|
170
|
+
}, Me = l(() => import("../.chunks/dialog_regionSelectorRegions-0M1fMu1a.esm.js")), Ne = (t, n) => {
|
|
170
171
|
let r = e();
|
|
171
172
|
return {
|
|
172
|
-
searcherKey:
|
|
173
|
-
optionBySearcherKey:
|
|
173
|
+
searcherKey: I(n.value.keys().next().value ?? -2),
|
|
174
|
+
optionBySearcherKey: T(() => {
|
|
174
175
|
let e = /* @__PURE__ */ new Map();
|
|
175
176
|
if (n.value.forEach((n) => {
|
|
176
177
|
let r = {
|
|
@@ -194,57 +195,57 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
194
195
|
return e;
|
|
195
196
|
})
|
|
196
197
|
};
|
|
197
|
-
},
|
|
198
|
-
let r = e(), i =
|
|
199
|
-
t.modelValue.length === 1 && (
|
|
200
|
-
let
|
|
198
|
+
}, Pe = (t, n) => {
|
|
199
|
+
let r = e(), i = T(() => t.forMode === "volume" || t.forMode === "cost_forecast"), a = I(-2);
|
|
200
|
+
t.modelValue.length === 1 && (a.value = t.modelValue[0]), a.value === -2 && (i.value ? a.value = n.value?.regionByIndex.values().next().value?.key ?? -2 : a.value = n.value?.regionByIndex.keys().next().value ?? -2);
|
|
201
|
+
let o = T(() => {
|
|
201
202
|
let e = /* @__PURE__ */ new Map();
|
|
202
|
-
return n.value.regionByIndex?.forEach((
|
|
203
|
-
let a =
|
|
204
|
-
if (
|
|
205
|
-
let
|
|
206
|
-
value:
|
|
203
|
+
return n.value.regionByIndex?.forEach((t) => {
|
|
204
|
+
let a = t.name;
|
|
205
|
+
if (i.value) {
|
|
206
|
+
let n = {
|
|
207
|
+
value: t.key,
|
|
207
208
|
title: a
|
|
208
209
|
};
|
|
209
|
-
e.has(
|
|
210
|
+
e.has(t.key) || e.set(t.key, n);
|
|
210
211
|
return;
|
|
211
212
|
}
|
|
212
|
-
|
|
213
|
-
let o = p(n.value.key || 0,
|
|
213
|
+
t.device && (a += " (" + r.Common["Device_" + t.device] + ")");
|
|
214
|
+
let o = p(n.value.key || 0, t.lang ?? "");
|
|
214
215
|
o && (a += " / " + o);
|
|
215
216
|
let s = {
|
|
216
|
-
value:
|
|
217
|
+
value: t.index,
|
|
217
218
|
title: a,
|
|
218
|
-
icon:
|
|
219
|
+
icon: t.device ? f(t.device) : void 0
|
|
219
220
|
};
|
|
220
|
-
e.set(
|
|
221
|
+
e.set(t.index, s);
|
|
221
222
|
}), e;
|
|
222
223
|
});
|
|
223
|
-
return
|
|
224
|
-
if (t.onlySearcher ||
|
|
225
|
-
let
|
|
226
|
-
if (
|
|
227
|
-
|
|
224
|
+
return V(o, (e, n) => {
|
|
225
|
+
if (t.onlySearcher || a.value !== void 0 && e.get(a.value)) return;
|
|
226
|
+
let i = e.keys().next().value;
|
|
227
|
+
if (a.value === -2 || i === -2) {
|
|
228
|
+
a.value = i;
|
|
228
229
|
return;
|
|
229
230
|
}
|
|
230
|
-
let o = n?.get(
|
|
231
|
+
let o = n?.get(a.value)?.title || "", s = -1;
|
|
231
232
|
for (let [t, n] of e.entries()) {
|
|
232
233
|
let e = n.title;
|
|
233
234
|
if (typeof e != "string" || typeof t == "string") break;
|
|
234
235
|
if (e === o) {
|
|
235
|
-
|
|
236
|
+
i = t;
|
|
236
237
|
break;
|
|
237
238
|
}
|
|
238
|
-
let
|
|
239
|
-
e.indexOf(c) === -1 && (c = o.replace(/^[^a-zа-я]/i, "").replace(
|
|
239
|
+
let a = RegExp(` \\((${r.Common.Device_1}|${r.Common.Device_2})\\)`), c = o, l = 3;
|
|
240
|
+
e.indexOf(c) === -1 && (c = o.replace(/^[^a-zа-я]/i, "").replace(a, ""), l--), e.indexOf(c) === -1 && (c = o.replace(/ \/.*/, ""), l--), e.indexOf(c) === -1 && (c = o.replace(/ \/.*/, ""), c = c.replace(/^[^a-zа-я]/i, "").replace(a, ""), l--), e.indexOf(c) !== -1 && (l <= s || (s = l, i = t));
|
|
240
241
|
}
|
|
241
|
-
|
|
242
|
+
a.value = i;
|
|
242
243
|
}), {
|
|
243
|
-
regionIndex:
|
|
244
|
-
optionByRegionIndex:
|
|
244
|
+
regionIndex: a,
|
|
245
|
+
optionByRegionIndex: o
|
|
245
246
|
};
|
|
246
|
-
},
|
|
247
|
-
let r =
|
|
247
|
+
}, Fe = (e, t, n) => {
|
|
248
|
+
let r = I([]), i = () => {
|
|
248
249
|
if (e.onlySearcher && t.value) {
|
|
249
250
|
r.value = Array.from(t.value.keys());
|
|
250
251
|
return;
|
|
@@ -258,66 +259,66 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
258
259
|
}, a = () => {
|
|
259
260
|
r.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(r.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
|
|
260
261
|
};
|
|
261
|
-
return
|
|
262
|
+
return V(r, () => {
|
|
262
263
|
a();
|
|
263
264
|
}), e.addCompare && i(), { regionsIndexes: r };
|
|
264
|
-
},
|
|
265
|
-
let t =
|
|
265
|
+
}, Ie = (e) => {
|
|
266
|
+
let t = T(() => e.forMode === "volume" || e.forMode === "cost_forecast"), n = T(() => Oe(e.forMode, e.autoRegion, e.searchers)), r = T(() => n.value.get(a.searcherKey.value) || Se), i = T(() => {
|
|
266
267
|
let e = /* @__PURE__ */ new Set();
|
|
267
|
-
return
|
|
268
|
+
return n.value.forEach((t) => {
|
|
268
269
|
t.regionByIndex.forEach((t) => {
|
|
269
270
|
t.index !== -1 && t.index !== -2 && e.add(t.index);
|
|
270
271
|
});
|
|
271
272
|
}), e;
|
|
272
|
-
}),
|
|
273
|
-
|
|
274
|
-
if (e.onlySearcher ?
|
|
275
|
-
let
|
|
276
|
-
|
|
277
|
-
if (e.onlySearcher &&
|
|
278
|
-
|
|
273
|
+
}), a = Ne(e, n), o = Pe(e, r), s = Fe(e, n, i);
|
|
274
|
+
V(n, () => {
|
|
275
|
+
if (e.onlySearcher ? s.regionsIndexes.value = Array.from(n.value.keys()) : s.regionsIndexes.value = s.regionsIndexes.value.filter((e) => i.value.has(e)), a.searcherKey.value === -1) return;
|
|
276
|
+
let t = n.value.keys().next().value;
|
|
277
|
+
n.value.forEach((r) => {
|
|
278
|
+
if (e.onlySearcher && r.key === a.searcherKey.value) {
|
|
279
|
+
t = a.searcherKey.value;
|
|
279
280
|
return;
|
|
280
281
|
}
|
|
281
|
-
if (
|
|
282
|
+
if (o.regionIndex.value && r.regionByIndex?.has(o.regionIndex.value) && (t = r.key), !e.onlySearcher) {
|
|
282
283
|
let e;
|
|
283
|
-
|
|
284
|
-
let
|
|
285
|
-
e?.has(-2) && !
|
|
284
|
+
t !== void 0 && (e = n.value.get(t)?.regionByIndex);
|
|
285
|
+
let i = n.value.get(r.key)?.regionByIndex;
|
|
286
|
+
e?.has(-2) && !i?.has(-2) && (t = r.key);
|
|
286
287
|
}
|
|
287
|
-
}),
|
|
288
|
+
}), t !== void 0 && (a.searcherKey.value = t), o.regionIndex.value !== void 0 && !(r.value?.regionByIndex)?.has(o.regionIndex.value) && (o.regionIndex.value = r.value?.regions?.keys().next().value);
|
|
288
289
|
}, { immediate: !0 });
|
|
289
|
-
let
|
|
290
|
-
if (!(
|
|
291
|
-
},
|
|
292
|
-
if (e.onlySearcher ||
|
|
293
|
-
let
|
|
294
|
-
if (e.forMode) {
|
|
295
|
-
let
|
|
296
|
-
|
|
297
|
-
searcher_key:
|
|
298
|
-
key:
|
|
290
|
+
let c = () => {
|
|
291
|
+
if (!(a.searcherKey.value === -1 || a.searcherKey.value === -2)) return a.searcherKey.value;
|
|
292
|
+
}, l = () => {
|
|
293
|
+
if (e.onlySearcher || o.regionIndex.value === -2) return;
|
|
294
|
+
let n = o.regionIndex.value;
|
|
295
|
+
if (t.value && e.forMode) {
|
|
296
|
+
let t = o.regionIndex.value;
|
|
297
|
+
n = je(e.forMode, {
|
|
298
|
+
searcher_key: c(),
|
|
299
|
+
key: t
|
|
299
300
|
}, e.searchers)?.index;
|
|
300
301
|
}
|
|
301
|
-
return
|
|
302
|
-
},
|
|
303
|
-
let e =
|
|
304
|
-
if (e !== void 0) return
|
|
302
|
+
return n;
|
|
303
|
+
}, u = () => {
|
|
304
|
+
let e = c();
|
|
305
|
+
if (e !== void 0) return n.value.get(e);
|
|
305
306
|
};
|
|
306
307
|
return {
|
|
307
|
-
selectSearcher:
|
|
308
|
-
selectRegion:
|
|
309
|
-
compare:
|
|
310
|
-
searcherByKey:
|
|
311
|
-
allRegionsIndexes:
|
|
312
|
-
getSearcher:
|
|
308
|
+
selectSearcher: a,
|
|
309
|
+
selectRegion: o,
|
|
310
|
+
compare: s,
|
|
311
|
+
searcherByKey: n,
|
|
312
|
+
allRegionsIndexes: i,
|
|
313
|
+
getSearcher: u,
|
|
313
314
|
getRegion: () => {
|
|
314
|
-
let e =
|
|
315
|
-
if (e !== void 0) return
|
|
315
|
+
let e = l();
|
|
316
|
+
if (e !== void 0) return u()?.regionByIndex?.get(e);
|
|
316
317
|
}
|
|
317
318
|
};
|
|
318
|
-
},
|
|
319
|
+
}, Le = /* @__PURE__ */ M({
|
|
319
320
|
__name: "regionSelector",
|
|
320
|
-
props: /*@__PURE__*/
|
|
321
|
+
props: /*@__PURE__*/ N({
|
|
321
322
|
projectId: {},
|
|
322
323
|
searchers: { default: () => [] },
|
|
323
324
|
modelValue: {},
|
|
@@ -346,90 +347,90 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
346
347
|
}),
|
|
347
348
|
emits: ["update:modelValue", "update:modelValueSingle"],
|
|
348
349
|
setup(e, { expose: t }) {
|
|
349
|
-
let n = e, a =
|
|
350
|
+
let n = e, a = T(() => n.forMode === "volume" || n.forMode === "cost_forecast"), o = B(e, "modelValue"), s = B(e, "modelValueSingle"), { selectSearcher: c, selectRegion: l, compare: u, searcherByKey: d, allRegionsIndexes: f, getSearcher: p, getRegion: m } = Ie(n), h = () => {
|
|
350
351
|
let e = [];
|
|
351
|
-
|
|
352
|
-
t.enabled
|
|
353
|
-
t.enabled && e.push(t);
|
|
352
|
+
d.value.forEach((t) => {
|
|
353
|
+
n.forMode !== "project_relevant_url" && !t.enabled || t.regions.forEach((t) => {
|
|
354
|
+
n.forMode !== "project_relevant_url" && !t.enabled || t.index !== -1 && e.push(t);
|
|
354
355
|
});
|
|
355
|
-
}),
|
|
356
|
+
}), Me.open("regions", {
|
|
356
357
|
regions: e,
|
|
357
|
-
regionsIndexes:
|
|
358
|
-
"@update:regionsIndexes": (e) =>
|
|
358
|
+
regionsIndexes: u.regionsIndexes.value,
|
|
359
|
+
"@update:regionsIndexes": (e) => u.regionsIndexes.value = e
|
|
359
360
|
});
|
|
360
361
|
};
|
|
361
|
-
return
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
362
|
+
return V([
|
|
363
|
+
l.regionIndex,
|
|
364
|
+
c.searcherKey,
|
|
365
|
+
u.regionsIndexes
|
|
365
366
|
], () => {
|
|
366
|
-
if (
|
|
367
|
-
if (JSON.stringify(
|
|
368
|
-
|
|
369
|
-
} else n.onlySearcher ? (
|
|
370
|
-
!n.onlySearcher && !
|
|
371
|
-
}),
|
|
372
|
-
|
|
373
|
-
}, { immediate: !0 }),
|
|
374
|
-
if (
|
|
375
|
-
if (!
|
|
376
|
-
let e =
|
|
377
|
-
e === -2 && !n.autoRegion && (e = void 0,
|
|
367
|
+
if (c.searcherKey.value === -1 && u.regionsIndexes.value.length) {
|
|
368
|
+
if (JSON.stringify(o.value) === JSON.stringify(u.regionsIndexes.value)) return;
|
|
369
|
+
o.value = [...u.regionsIndexes.value];
|
|
370
|
+
} else n.onlySearcher ? (o.value = [c.searcherKey.value], c.searcherKey.value === -2 && !n.autoRegion && (o.value.length = 0)) : (o.value = [l.regionIndex.value], l.regionIndex.value === -2 && !n.autoRegion && (o.value.length = 0));
|
|
371
|
+
!n.onlySearcher && !f.value.size && (c.searcherKey.value = -2);
|
|
372
|
+
}), s.value && V(s, () => {
|
|
373
|
+
s.value && (o.value = [s.value]);
|
|
374
|
+
}, { immediate: !0 }), V(o, () => {
|
|
375
|
+
if (o.value[0] && (s.value = o.value[0]), n.onlySearcher) {
|
|
376
|
+
if (!o.value.length || o.value.length === 1 && !d.value.has(o.value[0]) || o.value.length === 1 && o.value[0] === -2 && !n.autoRegion) {
|
|
377
|
+
let e = d.value.keys().next().value;
|
|
378
|
+
e === -2 && !n.autoRegion && (e = void 0, s.value = -2), e === void 0 ? o.value.length = 0 : o.value = [e];
|
|
378
379
|
return;
|
|
379
380
|
}
|
|
380
|
-
if (
|
|
381
|
-
|
|
381
|
+
if (o.value.length > 1 && JSON.stringify(o.value) !== JSON.stringify(u.regionsIndexes.value)) {
|
|
382
|
+
o.value = [...u.regionsIndexes.value];
|
|
382
383
|
return;
|
|
383
384
|
}
|
|
384
385
|
} else {
|
|
385
|
-
let e = [...new Set(
|
|
386
|
-
if (
|
|
386
|
+
let e = [...new Set(o.value)], t = d.value.values().next().value?.regionByIndex?.keys().next().value;
|
|
387
|
+
if (a.value && (t = d.value.values().next().value?.regionByIndex?.values().next().value?.key), t === -2 && !n.autoRegion && (t = void 0, s.value = -2), !e.length) t !== void 0 && e.push(t);
|
|
387
388
|
else if (e.length === 1) {
|
|
388
|
-
let
|
|
389
|
-
|
|
389
|
+
let n = f.value;
|
|
390
|
+
a.value && (n = /* @__PURE__ */ new Set(), d.value.forEach((e) => {
|
|
390
391
|
e.regionByIndex.forEach((e) => {
|
|
391
|
-
e.index !== -1 && e.index !== -2 &&
|
|
392
|
+
e.index !== -1 && e.index !== -2 && n.add(e.key);
|
|
392
393
|
});
|
|
393
|
-
})),
|
|
394
|
-
} else e = e.filter((e) =>
|
|
395
|
-
if (JSON.stringify(
|
|
396
|
-
|
|
394
|
+
})), n.has(e[0]) || (e = [], t !== void 0 && e.push(t));
|
|
395
|
+
} else e = e.filter((e) => f.value.has(e)), !e.length && t !== void 0 && e.push(t);
|
|
396
|
+
if (JSON.stringify(o.value) !== JSON.stringify(e)) {
|
|
397
|
+
o.value = e;
|
|
397
398
|
return;
|
|
398
399
|
}
|
|
399
400
|
}
|
|
400
|
-
if (!(
|
|
401
|
-
if (
|
|
402
|
-
|
|
401
|
+
if (!(o.value.length === 1 && o.value[0] === (n.onlySearcher ? c.searcherKey.value : l.regionIndex.value))) if (n.onlySearcher) {
|
|
402
|
+
if (o.value.length === 1) {
|
|
403
|
+
c.searcherKey.value = o.value[0];
|
|
403
404
|
return;
|
|
404
405
|
}
|
|
405
|
-
|
|
406
|
+
c.searcherKey.value = -1;
|
|
406
407
|
return;
|
|
407
408
|
} else {
|
|
408
|
-
if (!
|
|
409
|
-
if (
|
|
410
|
-
|
|
409
|
+
if (!o.value.length) return;
|
|
410
|
+
if (o.value.length === 1 && c.searcherKey.value !== -1) {
|
|
411
|
+
l.regionIndex.value = o.value[0];
|
|
411
412
|
let e;
|
|
412
|
-
for (let t of
|
|
413
|
-
for (let
|
|
413
|
+
for (let t of d.value.values()) {
|
|
414
|
+
for (let n of t.regionByIndex.values()) if ((a.value ? n.key : n.index) === l.regionIndex.value) {
|
|
414
415
|
e = t.key;
|
|
415
416
|
break;
|
|
416
417
|
}
|
|
417
418
|
if (e !== void 0) break;
|
|
418
419
|
}
|
|
419
|
-
e !== void 0 && (
|
|
420
|
-
} else
|
|
420
|
+
e !== void 0 && (c.searcherKey.value = e);
|
|
421
|
+
} else c.searcherKey.value = -1, u.regionsIndexes.value = [...o.value];
|
|
421
422
|
}
|
|
422
423
|
}, { immediate: !0 }), t({
|
|
423
|
-
getSearcher:
|
|
424
|
-
getRegion:
|
|
425
|
-
}), (t, n) => (
|
|
424
|
+
getSearcher: p,
|
|
425
|
+
getRegion: m
|
|
426
|
+
}), (t, n) => (F(), O("div", { class: P({
|
|
426
427
|
"top-regionSelector": !0,
|
|
427
428
|
"top-regionSelector-onlySearcher": e.onlySearcher
|
|
428
429
|
}) }, [
|
|
429
|
-
|
|
430
|
-
options:
|
|
431
|
-
modelValue:
|
|
432
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
430
|
+
j(i, {
|
|
431
|
+
options: z(c).optionBySearcherKey.value,
|
|
432
|
+
modelValue: z(c).searcherKey.value,
|
|
433
|
+
"onUpdate:modelValue": n[0] ||= (e) => z(c).searcherKey.value = e,
|
|
433
434
|
name: "searcher_key",
|
|
434
435
|
addChanger: e.addChanger
|
|
435
436
|
}, null, 8, [
|
|
@@ -437,13 +438,13 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
437
438
|
"modelValue",
|
|
438
439
|
"addChanger"
|
|
439
440
|
]),
|
|
440
|
-
!e.onlySearcher &&
|
|
441
|
+
!e.onlySearcher && z(c).searcherKey.value !== z(-1) ? (F(), E(i, {
|
|
441
442
|
key: 0,
|
|
442
443
|
class: "top-select-region",
|
|
443
|
-
options:
|
|
444
|
-
modelValue:
|
|
445
|
-
"onUpdate:modelValue": n[1] ||= (e) =>
|
|
446
|
-
name:
|
|
444
|
+
options: z(l).optionByRegionIndex.value,
|
|
445
|
+
modelValue: z(l).regionIndex.value,
|
|
446
|
+
"onUpdate:modelValue": n[1] ||= (e) => z(l).regionIndex.value = e,
|
|
447
|
+
name: a.value ? "region_key" : "region_index",
|
|
447
448
|
addChanger: e.addChanger,
|
|
448
449
|
"data-top-icon": e.addRegionIcon ? "" : void 0
|
|
449
450
|
}, null, 8, [
|
|
@@ -452,31 +453,31 @@ var _e = { class: "top-competitorSelector" }, ve = { class: "top-ellipsis1" }, y
|
|
|
452
453
|
"name",
|
|
453
454
|
"addChanger",
|
|
454
455
|
"data-top-icon"
|
|
455
|
-
])) :
|
|
456
|
-
e.addCompare && !e.onlySearcher &&
|
|
456
|
+
])) : D("", !0),
|
|
457
|
+
e.addCompare && !e.onlySearcher && z(c).searcherKey.value === z(-1) ? (F(), E(r, {
|
|
457
458
|
key: 1,
|
|
458
459
|
name: "compare",
|
|
459
|
-
onClick:
|
|
460
|
-
"data-count-compare-regions-indexes":
|
|
460
|
+
onClick: h,
|
|
461
|
+
"data-count-compare-regions-indexes": z(u).regionsIndexes.value.length
|
|
461
462
|
}, {
|
|
462
|
-
default:
|
|
463
|
+
default: H(() => [A(R(t.$i18n.Common.Selected_regions), 1)]),
|
|
463
464
|
_: 1
|
|
464
|
-
}, 8, ["data-count-compare-regions-indexes"])) :
|
|
465
|
+
}, 8, ["data-count-compare-regions-indexes"])) : D("", !0)
|
|
465
466
|
], 2));
|
|
466
467
|
}
|
|
467
|
-
}),
|
|
468
|
+
}), G = {
|
|
468
469
|
id: 0,
|
|
469
470
|
name: "/",
|
|
470
471
|
path: "/"
|
|
471
472
|
};
|
|
472
|
-
function
|
|
473
|
+
function Re(t) {
|
|
473
474
|
return t ? e()?.Common.All_folders : "/ (" + e()?.Keywords.Root_folder + ")";
|
|
474
475
|
}
|
|
475
|
-
var
|
|
476
|
-
a = { ...a }, r.childsIds.push(a.id), a.id === 0 && (a.name =
|
|
476
|
+
var ze = (e, t, n = /* @__PURE__ */ new Map(), r = { id: "root" }, i = 0) => (r.childsIds = [], r.id && (r.countAllGroupsActive = r.count_groups_active), e[r.id] && e[r.id].forEach((a) => {
|
|
477
|
+
a = { ...a }, r.childsIds.push(a.id), a.id === 0 && (a.name = Re(t));
|
|
477
478
|
let o = i > 1 ? "-".repeat(i - 1) + " " : "";
|
|
478
|
-
o && !a.name.startsWith(o) && (a.name = o + a.name), n.set(a.id, a),
|
|
479
|
-
}), n),
|
|
479
|
+
o && !a.name.startsWith(o) && (a.name = o + a.name), n.set(a.id, a), ze(e, t, n, a, i + 1), r.childsIds = r.childsIds.concat(a.childsIds), r.id && a.count_groups_active && (r.countAllGroupsActive += a.count_groups_active);
|
|
480
|
+
}), n), Be = (e, t) => e.gen(`/get/${t}/folders/`, [
|
|
480
481
|
"id",
|
|
481
482
|
"parent_id",
|
|
482
483
|
"name",
|
|
@@ -487,9 +488,9 @@ var Be = (e, t, n = /* @__PURE__ */ new Map(), r = { id: "root" }, i = 0) => (r.
|
|
|
487
488
|
});
|
|
488
489
|
//#endregion
|
|
489
490
|
//#region src/core/utils/composables/useWatch.ts
|
|
490
|
-
function
|
|
491
|
+
function Ve(e, t, n) {
|
|
491
492
|
let r = Object.keys(e);
|
|
492
|
-
return
|
|
493
|
+
return V(r.map((t) => e[t]), (e, n, i) => {
|
|
493
494
|
let a = {};
|
|
494
495
|
e.forEach((e, t) => {
|
|
495
496
|
if (!Object.is(e, n[t])) {
|
|
@@ -504,9 +505,9 @@ function He(e, t, n) {
|
|
|
504
505
|
}
|
|
505
506
|
//#endregion
|
|
506
507
|
//#region src/components/project/groupSelector/folders/folders.vue?vue&type=script&setup=true&lang.ts
|
|
507
|
-
var
|
|
508
|
+
var He = ["innerHTML"], Ue = /* @__PURE__ */ M({
|
|
508
509
|
__name: "folders",
|
|
509
|
-
props: /*@__PURE__*/
|
|
510
|
+
props: /*@__PURE__*/ N({
|
|
510
511
|
folderId: {},
|
|
511
512
|
folder: {},
|
|
512
513
|
folders: {},
|
|
@@ -522,20 +523,20 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
522
523
|
}, {
|
|
523
524
|
folderId: { required: !0 },
|
|
524
525
|
folderIdModifiers: {},
|
|
525
|
-
folder: { default:
|
|
526
|
+
folder: { default: G },
|
|
526
527
|
folderModifiers: {}
|
|
527
528
|
}),
|
|
528
529
|
emits: ["update:folderId", "update:folder"],
|
|
529
530
|
setup(e) {
|
|
530
|
-
let t = e, n =
|
|
531
|
-
|
|
531
|
+
let t = e, n = B(e, "folderId"), r = B(e, "folder"), i = t.client && !t.folders ? Be(t.client, t.service) : void 0, a = I(null);
|
|
532
|
+
V(() => t.projectId, () => {
|
|
532
533
|
i?.changeParams({ project_id: t.projectId }), i?.setOptions({ checkFingerprint: "TopGroupSelectorFolders:" + t.projectId }), a.value?.resetCache();
|
|
533
534
|
}, { immediate: !0 });
|
|
534
|
-
let o =
|
|
535
|
+
let o = T(() => ze(t.folders ?? { root: [G] }, t.canSelectAll)), s = (e) => (t.canSelectAll && e[0]?.id === 0 && (e[0] = {
|
|
535
536
|
...e[0],
|
|
536
|
-
name:
|
|
537
|
+
name: Re(!0)
|
|
537
538
|
}), e);
|
|
538
|
-
return
|
|
539
|
+
return Ve({
|
|
539
540
|
modelFolder: r,
|
|
540
541
|
modelFolderId: n
|
|
541
542
|
}, async (e) => {
|
|
@@ -545,21 +546,21 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
545
546
|
return;
|
|
546
547
|
}
|
|
547
548
|
let i = o.value.get(t.folderId);
|
|
548
|
-
i ||=
|
|
549
|
-
}, { immediate: !0 }), (t, n) => (
|
|
549
|
+
i ||= G, r.value = i, n.value = i.id;
|
|
550
|
+
}, { immediate: !0 }), (t, n) => (F(), E(C, {
|
|
550
551
|
class: "top-groupSelector_folder",
|
|
551
552
|
modelValue: r.value,
|
|
552
553
|
"onUpdate:modelValue": n[0] ||= (e) => r.value = e,
|
|
553
554
|
items: e.folders ? [...o.value.values()] : void 0,
|
|
554
555
|
"search-type": "inline",
|
|
555
556
|
icon: e.addIcon ? "" : void 0,
|
|
556
|
-
api: e.folders ? void 0 :
|
|
557
|
-
apiSetSearchParams: (...e) =>
|
|
557
|
+
api: e.folders ? void 0 : z(i),
|
|
558
|
+
apiSetSearchParams: (...e) => z(ee)(...e, "name"),
|
|
558
559
|
prepareItemsBeforeRender: s,
|
|
559
560
|
addChanger: e.addChanger,
|
|
560
561
|
useCache: ""
|
|
561
562
|
}, {
|
|
562
|
-
item:
|
|
563
|
+
item: H(({ item: e }) => [k("div", { innerHTML: e.name.replaceAll(/</g, "< ") }, null, 8, He)]),
|
|
563
564
|
_: 1
|
|
564
565
|
}, 8, [
|
|
565
566
|
"modelValue",
|
|
@@ -570,17 +571,17 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
570
571
|
"addChanger"
|
|
571
572
|
]));
|
|
572
573
|
}
|
|
573
|
-
}),
|
|
574
|
+
}), K = {
|
|
574
575
|
id: -1,
|
|
575
576
|
name: "--",
|
|
576
|
-
folder_id:
|
|
577
|
-
folder_path:
|
|
578
|
-
},
|
|
577
|
+
folder_id: G.id,
|
|
578
|
+
folder_path: G.path
|
|
579
|
+
}, q = {
|
|
579
580
|
id: 0,
|
|
580
581
|
name: "All groups",
|
|
581
|
-
folder_id:
|
|
582
|
-
folder_path:
|
|
583
|
-
},
|
|
582
|
+
folder_id: G.id,
|
|
583
|
+
folder_path: G.path
|
|
584
|
+
}, J = () => (q.name = e()?.Common.All_groups, q), We = () => (q.name = e()?.Keywords.Choose_group, q), Ge = (e, t, n) => (e = [...e], t !== void 0 && (e = e.filter((e) => e.on == Number(t))), n && n.id && n.childsIds && (e = e.filter((e) => e.folder_id === n.id || n.childsIds.includes(e.folder_id))), e), Ke = (e, t) => e.gen(`/get/${t}/groups/`, [
|
|
584
585
|
"id",
|
|
585
586
|
"name",
|
|
586
587
|
"folder_id",
|
|
@@ -588,12 +589,12 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
588
589
|
]).changeParams({
|
|
589
590
|
folder_id_depth: !0,
|
|
590
591
|
limit: 100
|
|
591
|
-
}),
|
|
592
|
+
}), qe = (e, t) => e.gen(`/add/${t}/groups/`), Je = (e, t) => e.gen(`/del/${t}/groups/`), Ye = (e, t) => e.gen(`/edit/${t}/groups/rename/`), Xe = { class: "top-groupSelector_groupItem top-ellipsis1" }, Ze = {
|
|
592
593
|
key: 0,
|
|
593
594
|
class: "top-comment"
|
|
594
|
-
},
|
|
595
|
+
}, Qe = ["innerHTML"], $e = ["innerHTML"], et = ["innerHTML"], tt = /* @__PURE__ */ M({
|
|
595
596
|
__name: "groups",
|
|
596
|
-
props: /*@__PURE__*/
|
|
597
|
+
props: /*@__PURE__*/ N({
|
|
597
598
|
groupId: {},
|
|
598
599
|
group: {},
|
|
599
600
|
projectId: {},
|
|
@@ -624,14 +625,14 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
624
625
|
group: { required: !0 },
|
|
625
626
|
groupModifiers: {}
|
|
626
627
|
}),
|
|
627
|
-
emits: /*@__PURE__*/
|
|
628
|
+
emits: /*@__PURE__*/ N([
|
|
628
629
|
"addGroup",
|
|
629
630
|
"editGroup",
|
|
630
631
|
"delGroup"
|
|
631
632
|
], ["update:groupId", "update:group"]),
|
|
632
633
|
setup(e, { expose: t, emit: n }) {
|
|
633
|
-
let r = e, i = n, a =
|
|
634
|
-
if (r.groups !== void 0) return
|
|
634
|
+
let r = e, i = n, a = B(e, "groupId"), s = B(e, "group"), c = r.client && !r.groups ? Ke(r.client, r.service) : void 0, l = r.client ? qe(r.client, r.service) : void 0, u = r.client ? Je(r.client, r.service) : void 0, d = r.client ? Ye(r.client, r.service) : void 0, f = I(null), p = T(() => {
|
|
635
|
+
if (r.groups !== void 0) return Ge(r.groups, r.on, r.folder);
|
|
635
636
|
}), m = o("folder_id", "EQUALS", [r.folder?.id ?? 0]);
|
|
636
637
|
c?.changeParams({
|
|
637
638
|
project_id: r.projectId,
|
|
@@ -643,16 +644,16 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
643
644
|
}, g = (e = !1) => {
|
|
644
645
|
f.value?.resetCache(e);
|
|
645
646
|
};
|
|
646
|
-
|
|
647
|
+
Ve({
|
|
647
648
|
projectId: () => r.projectId,
|
|
648
649
|
folderId: () => r.folder?.id,
|
|
649
650
|
canSelectAll: () => r.canSelectAll
|
|
650
651
|
}, (e) => {
|
|
651
652
|
if (e.projectId && (c?.changeParams({ project_id: r.projectId }), c?.setOptions({ checkFingerprint: "TopGroupSelectorGroups:" + r.projectId })), e.folderId && (m.values = [r.folder?.id ?? 0]), g(), (e.folderId?.old !== void 0 || e.canSelectAll?.old !== void 0) && a.value !== null) {
|
|
652
653
|
let e;
|
|
653
|
-
r.autoselect === "first" && (e = p.value?.[0], r.canSelectAll && (e =
|
|
654
|
+
r.autoselect === "first" && (e = p.value?.[0], r.canSelectAll && (e = oe(J()))), (r.autoselect === "placeholder" || !e) && (e = We()), h(e);
|
|
654
655
|
}
|
|
655
|
-
}, { immediate: !0 }),
|
|
656
|
+
}, { immediate: !0 }), Ve({
|
|
656
657
|
modelGroup: s,
|
|
657
658
|
modelGroupId: a
|
|
658
659
|
}, async (e) => {
|
|
@@ -664,14 +665,14 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
664
665
|
if (!(r.canAdd && a.value === null)) {
|
|
665
666
|
if (r.groups) {
|
|
666
667
|
let e = p.value?.find((e) => e.id === a.value);
|
|
667
|
-
if (!e && r.canSelectAll && (e =
|
|
668
|
+
if (!e && r.canSelectAll && (e = J()), e) h(e);
|
|
668
669
|
else {
|
|
669
670
|
let e = p.value?.[0];
|
|
670
|
-
e && !a.value ? h(e) : h(
|
|
671
|
+
e && !a.value ? h(e) : h(K);
|
|
671
672
|
}
|
|
672
673
|
}
|
|
673
674
|
if (r.client && !r.groups && (a.value || a.value === 0 && !r.canSelectAll)) {
|
|
674
|
-
let e =
|
|
675
|
+
let e = Ke(r.client, r.service).changeParams({
|
|
675
676
|
project_id: r.projectId,
|
|
676
677
|
id: a.value,
|
|
677
678
|
filters: [m]
|
|
@@ -679,7 +680,7 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
679
680
|
e?.setOptions({ checkFingerprint: "TopGroupSelectorFindGroup:" + r.projectId });
|
|
680
681
|
let t = await e.call();
|
|
681
682
|
if (!t.errors?.length && !t.result) return;
|
|
682
|
-
!t.errors && t.result[0] ? h(t.result[0]) : h(
|
|
683
|
+
!t.errors && t.result[0] ? h(t.result[0]) : h(K);
|
|
683
684
|
}
|
|
684
685
|
}
|
|
685
686
|
}
|
|
@@ -689,7 +690,7 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
689
690
|
let t = s.value, n = await l.changeParams({
|
|
690
691
|
project_id: r.projectId,
|
|
691
692
|
names: [e.name],
|
|
692
|
-
to_id: r.folder?.id ??
|
|
693
|
+
to_id: r.folder?.id ?? G.id,
|
|
693
694
|
to_type: "in_folder_last"
|
|
694
695
|
}).call();
|
|
695
696
|
if (n.result) {
|
|
@@ -697,7 +698,7 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
697
698
|
h(e), i("addGroup", e);
|
|
698
699
|
} else h(t);
|
|
699
700
|
f.value?.resetCache(!0);
|
|
700
|
-
},
|
|
701
|
+
}, b = async (e, t) => {
|
|
701
702
|
d && ((await d.changeParams({
|
|
702
703
|
project_id: r.projectId,
|
|
703
704
|
id: e.id,
|
|
@@ -706,13 +707,13 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
706
707
|
id: e.id,
|
|
707
708
|
name: t
|
|
708
709
|
}), f.value?.updateCacheItemById(e.id, { name: t })));
|
|
709
|
-
},
|
|
710
|
+
}, x = async (e) => {
|
|
710
711
|
u && ((await u.changeParams({
|
|
711
712
|
project_id: r.projectId,
|
|
712
713
|
id: e.id
|
|
713
|
-
}).call()).errors || (s.value.id === e.id && h(r.canSelectAll ?
|
|
714
|
+
}).call()).errors || (s.value.id === e.id && h(r.canSelectAll ? J() : K), i("delGroup", e.id), f.value?.deleteCacheItemById(e.id)));
|
|
714
715
|
};
|
|
715
|
-
return t({ resetCacheGroups: g }), (t, n) => (
|
|
716
|
+
return t({ resetCacheGroups: g }), (t, n) => (F(), E(C, {
|
|
716
717
|
ref_key: "refSelector",
|
|
717
718
|
ref: f,
|
|
718
719
|
class: "top-groupSelector_group",
|
|
@@ -721,51 +722,51 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
721
722
|
items: p.value ?? e.groups,
|
|
722
723
|
searchType: "inline",
|
|
723
724
|
icon: e.addIcon ? "" : void 0,
|
|
724
|
-
api: e.groups ? void 0 :
|
|
725
|
-
apiSetSearchParams: (...e) =>
|
|
725
|
+
api: e.groups ? void 0 : z(c),
|
|
726
|
+
apiSetSearchParams: (...e) => z(ee)(...e, "name"),
|
|
726
727
|
appendSearchToResult: !!e.canAdd,
|
|
727
|
-
useAllItem: e.canSelectAll ?
|
|
728
|
+
useAllItem: e.canSelectAll ? z(J)().name : !1,
|
|
728
729
|
addChanger: e.addChanger,
|
|
729
730
|
useCache: "",
|
|
730
731
|
onAppendItem: v
|
|
731
|
-
},
|
|
732
|
-
item:
|
|
733
|
-
n.id ===
|
|
734
|
-
|
|
732
|
+
}, te({
|
|
733
|
+
item: H(({ item: n }) => [k("div", Xe, [
|
|
734
|
+
n.id === z(null) ? (F(), O("div", Ze, R(t.$i18n.Common.Add) + ": ", 1)) : D("", !0),
|
|
735
|
+
k("span", {
|
|
735
736
|
class: "top-groupSelector_groupItemName top-ellipsis1",
|
|
736
737
|
innerHTML: n.name
|
|
737
|
-
}, null, 8,
|
|
738
|
-
n.folder_path && e.showPath ? (
|
|
738
|
+
}, null, 8, Qe),
|
|
739
|
+
n.folder_path && e.showPath ? (F(), O("span", {
|
|
739
740
|
key: 1,
|
|
740
741
|
class: "top-groupSelector_groupItemFolderPath top-ellipsis1",
|
|
741
742
|
innerHTML: n.folder_path
|
|
742
|
-
}, null, 8,
|
|
743
|
+
}, null, 8, $e)) : D("", !0)
|
|
743
744
|
])]),
|
|
744
745
|
_: 2
|
|
745
746
|
}, [e.canEditAndDel && e.client ? {
|
|
746
747
|
name: "actions",
|
|
747
|
-
fn:
|
|
748
|
+
fn: H(({ item: r }) => [r.id ? (F(), O(w, { key: 0 }, [j(_, {
|
|
748
749
|
submitText: t.$i18n.Common.Save,
|
|
749
750
|
defaultValue: r.name,
|
|
750
751
|
inputProps: { addCleaner: !1 },
|
|
751
|
-
onSubmit: (e) =>
|
|
752
|
+
onSubmit: (e) => b(r, e)
|
|
752
753
|
}, {
|
|
753
|
-
opener:
|
|
754
|
-
default:
|
|
754
|
+
opener: H(() => [...n[1] ||= [k("div", { "data-top-icon": "" }, null, -1)]]),
|
|
755
|
+
default: H(() => [...n[2] ||= []]),
|
|
755
756
|
_: 1
|
|
756
757
|
}, 8, [
|
|
757
758
|
"submitText",
|
|
758
759
|
"defaultValue",
|
|
759
760
|
"onSubmit"
|
|
760
|
-
]),
|
|
761
|
+
]), j(y, {
|
|
761
762
|
isWarning: "",
|
|
762
763
|
submitText: t.$i18n.Common.Delete,
|
|
763
|
-
onSubmit: (e) =>
|
|
764
|
+
onSubmit: (e) => x(r)
|
|
764
765
|
}, {
|
|
765
|
-
opener:
|
|
766
|
-
default:
|
|
766
|
+
opener: H(() => [...n[3] ||= [k("div", { "data-top-icon": "" }, null, -1)]]),
|
|
767
|
+
default: H(() => [k("span", { innerHTML: e.service === "keywords_2" ? t.$i18n.Keywords.Delete_group_warning : t.$i18n["Ai.Tracker"].Delete_group_warning }, null, 8, et)]),
|
|
767
768
|
_: 1
|
|
768
|
-
}, 8, ["submitText", "onSubmit"])], 64)) :
|
|
769
|
+
}, 8, ["submitText", "onSubmit"])], 64)) : D("", !0)]),
|
|
769
770
|
key: "0"
|
|
770
771
|
} : void 0]), 1032, [
|
|
771
772
|
"modelValue",
|
|
@@ -778,9 +779,9 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
778
779
|
"addChanger"
|
|
779
780
|
]));
|
|
780
781
|
}
|
|
781
|
-
}),
|
|
782
|
+
}), nt = { class: "top-groupSelector" }, rt = /* @__PURE__ */ M({
|
|
782
783
|
__name: "groupSelector",
|
|
783
|
-
props: /*@__PURE__*/
|
|
784
|
+
props: /*@__PURE__*/ N({
|
|
784
785
|
folderId: {},
|
|
785
786
|
folder: {},
|
|
786
787
|
groupId: {},
|
|
@@ -825,20 +826,20 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
825
826
|
folderModifiers: {},
|
|
826
827
|
groupId: { required: !0 },
|
|
827
828
|
groupIdModifiers: {},
|
|
828
|
-
group: { default:
|
|
829
|
+
group: { default: K },
|
|
829
830
|
groupModifiers: {}
|
|
830
831
|
}),
|
|
831
|
-
emits: /*@__PURE__*/
|
|
832
|
+
emits: /*@__PURE__*/ N(["update:groups"], [
|
|
832
833
|
"update:folderId",
|
|
833
834
|
"update:folder",
|
|
834
835
|
"update:groupId",
|
|
835
836
|
"update:group"
|
|
836
837
|
]),
|
|
837
838
|
setup(e, { expose: t, emit: n }) {
|
|
838
|
-
let r = e, i =
|
|
839
|
-
o.value =
|
|
839
|
+
let r = e, i = I(null), a = B(e, "folderId"), o = B(e, "folder"), s = B(e, "groupId"), c = B(e, "group"), l = n;
|
|
840
|
+
o.value = ze(r.folders ?? { root: [G] }, r.canSelectAllGroups).get(a.value);
|
|
840
841
|
let u = r.groups?.find((e) => e.id === s.value);
|
|
841
|
-
s.value || (u = r.groups?.[0]), r.canSelectAllGroups && !u && (u =
|
|
842
|
+
s.value || (u = r.groups?.[0]), r.canSelectAllGroups && !u && (u = J()), (r.autoselect === "placeholder" || !u) && (u = We()), u ??= K, c.value = u;
|
|
842
843
|
let d = (e) => {
|
|
843
844
|
let t;
|
|
844
845
|
r.groups && e && (t = [...r.groups, e]), l("update:groups", t);
|
|
@@ -864,7 +865,7 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
864
865
|
};
|
|
865
866
|
return t({ resetCacheGroups: (e = !1) => {
|
|
866
867
|
i.value?.resetCacheGroups(e);
|
|
867
|
-
} }), (t, n) => (
|
|
868
|
+
} }), (t, n) => (F(), O("div", nt, [e.showFolders ? (F(), E(Ue, {
|
|
868
869
|
key: 0,
|
|
869
870
|
folderId: a.value,
|
|
870
871
|
"onUpdate:folderId": n[0] ||= (e) => a.value = e,
|
|
@@ -887,7 +888,7 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
887
888
|
"addIcon",
|
|
888
889
|
"client",
|
|
889
890
|
"service"
|
|
890
|
-
])) :
|
|
891
|
+
])) : D("", !0), e.showGroups ? (F(), E(tt, {
|
|
891
892
|
key: 1,
|
|
892
893
|
ref_key: "componentGroupsRef",
|
|
893
894
|
ref: i,
|
|
@@ -927,46 +928,46 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
927
928
|
"addIcon",
|
|
928
929
|
"client",
|
|
929
930
|
"service"
|
|
930
|
-
])) :
|
|
931
|
+
])) : D("", !0)]));
|
|
931
932
|
}
|
|
932
|
-
}),
|
|
933
|
+
}), it = (e) => ({
|
|
933
934
|
id: null,
|
|
934
935
|
name: e,
|
|
935
936
|
listItemProps: {
|
|
936
937
|
type: "title",
|
|
937
938
|
class: "top-projectSelector_item"
|
|
938
939
|
}
|
|
939
|
-
}),
|
|
940
|
+
}), at = {
|
|
940
941
|
scheduledUpdate: !1,
|
|
941
942
|
manualUpdate: !1,
|
|
942
943
|
guestProjects: !1
|
|
943
|
-
},
|
|
944
|
+
}, ot = (t, n) => {
|
|
944
945
|
let r = [], i = {
|
|
945
|
-
scheduledUpdate:
|
|
946
|
-
manualUpdate:
|
|
947
|
-
guestProjects:
|
|
946
|
+
scheduledUpdate: it(e().Projects.Scheduled_update),
|
|
947
|
+
manualUpdate: it(e().Projects.Manual_update),
|
|
948
|
+
guestProjects: it(e().Projects.Guest_projects)
|
|
948
949
|
}, a = n ? {
|
|
949
950
|
scheduledUpdate: !1,
|
|
950
951
|
manualUpdate: !1,
|
|
951
952
|
guestProjects: !1
|
|
952
|
-
} :
|
|
953
|
+
} : at;
|
|
953
954
|
for (let e of t) !a.scheduledUpdate && e.right?.startsWith("1") && e.on > 0 && (r.push(i.scheduledUpdate), a.scheduledUpdate = !0), !a.manualUpdate && e.right?.startsWith("1") && e.on === 0 && (r.push(i.manualUpdate), a.manualUpdate = !0), !a.guestProjects && e.right?.startsWith("0") && e.on >= 0 && (r.push(i.guestProjects), a.guestProjects = !0), r.push(e);
|
|
954
955
|
return r;
|
|
955
|
-
},
|
|
956
|
+
}, st = (e) => ({
|
|
956
957
|
...e,
|
|
957
|
-
externalLink:
|
|
958
|
+
externalLink: pt(e.url ?? ""),
|
|
958
959
|
listItemProps: {
|
|
959
960
|
class: "top-projectSelector_item",
|
|
960
961
|
attrs: { title: e.name }
|
|
961
962
|
}
|
|
962
|
-
}),
|
|
963
|
+
}), ct = (e, t, n) => !e || e.length === 0 ? [] : (t && Object.keys(at).forEach((e) => at[e] = !1), ot(e.map(st), n)), lt = (e) => {
|
|
963
964
|
e = e.replace(/#.*/, "");
|
|
964
965
|
let t = location.hash;
|
|
965
966
|
return t = t.replace(/%22historyView%22:[^,]*,/, ""), t = t.replace(/%22modelsKeys%22:\[[^\]]*],/, ""), t = t.replace(/%22competitorsIds%22:\[[^\]]*],/, ""), t = t.replace(/%22searchersKeys%22:\[[^\]]*],/, ""), t = t.replace(/%22regionIndex%22:[^,]*,/, ""), t = t.replace(/%22regionsIndexes%22:\[[^\]]*],/, ""), t = t.replace(/%22folderId%22:[^,]*,/, ""), t = t.replace(/%22groupId%22:[^,]*,/, ""), t = t.replace(/%22tagsIds%22:\[[^\]]*],/, ""), /%22dataSort%22:\{[^}]*0000-00-00[^}]*}/.test(t) || (t = t.replace(/,?%22dataSort%22:\{[^}]*}(,?)/, "$1")), e + t;
|
|
967
|
+
}, ut = (e) => {
|
|
968
|
+
location.href = dt(e);
|
|
966
969
|
}, dt = (e) => {
|
|
967
|
-
|
|
968
|
-
}, ft = (e) => {
|
|
969
|
-
let t = pt(), n = location.pathname.split("/"), r = "project/dynamics/", i = "";
|
|
970
|
+
let t = ft(), n = location.pathname.split("/"), r = "project/dynamics/", i = "";
|
|
970
971
|
n[1] == "project" && (r = n[1] + "/" + n[2] + "/"), n[2] == "settings" && (i = location.hash), [
|
|
971
972
|
"watcher",
|
|
972
973
|
"indexing",
|
|
@@ -976,16 +977,16 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
976
977
|
"adwords"
|
|
977
978
|
].includes(n[4]) && (i = n[4] + "/");
|
|
978
979
|
let a = "https://" + t + "/" + r + e + "/" + i;
|
|
979
|
-
return a =
|
|
980
|
-
},
|
|
980
|
+
return a = lt(a), a;
|
|
981
|
+
}, ft = () => window.page?.subdomain ? window.location.host.replace(window.page?.subdomain + ".", "") : window.location.host, pt = (e) => {
|
|
981
982
|
let t = e.startsWith("http") ? e : "https://" + e;
|
|
982
983
|
return t = t.replace(/"/g, "%22"), t;
|
|
983
|
-
},
|
|
984
|
+
}, mt = (e, t) => {
|
|
984
985
|
let n = e.params.filters ?? [];
|
|
985
986
|
n = n.filter((e) => e.name !== "GEN_SEARCH_STRING()");
|
|
986
987
|
let r = h(t), i = t.replace(/([[^$.|?*+()])/g, "\\$1"), a = r.replace(/([[^$.|?*+()])/g, "\\$1");
|
|
987
988
|
t && n.push(o("GEN_SEARCH_STRING()", "REGEXP", [`(${i}|${a})`])), e.changeParams({ filters: n });
|
|
988
|
-
},
|
|
989
|
+
}, ht = (e) => {
|
|
989
990
|
let n = e.gen("/get/projects_2/projects/", [
|
|
990
991
|
"id",
|
|
991
992
|
"user_id",
|
|
@@ -1003,14 +1004,14 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1003
1004
|
a("id", "DESC")
|
|
1004
1005
|
]
|
|
1005
1006
|
}), n.options.loadingShowSpinner = !1, n.options.onApiLoaded = (e, t, n) => {
|
|
1006
|
-
let r = t.data.filters.length
|
|
1007
|
-
e.result =
|
|
1007
|
+
let r = t.data.filters.length > 1, i = t.data.offset === 0, a = t.data.offset === void 0 || i && !r, o = r;
|
|
1008
|
+
e.result = ct(e.result, a, o), n?.(e, t);
|
|
1008
1009
|
}, n;
|
|
1009
|
-
},
|
|
1010
|
+
}, gt = (e) => e.gen("/add/projects_2/projects/"), _t = { class: "top-ellipsis1" }, vt = /* @__PURE__ */ M({
|
|
1010
1011
|
__name: "submenu",
|
|
1011
1012
|
props: { id: {} },
|
|
1012
1013
|
setup(n) {
|
|
1013
|
-
let r = n, i = e(), a =
|
|
1014
|
+
let r = n, i = e(), a = ft(), o = (e) => {
|
|
1014
1015
|
let n = [
|
|
1015
1016
|
{
|
|
1016
1017
|
href: `https://${a}/project/keywords/${e.id}/`,
|
|
@@ -1087,44 +1088,44 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1087
1088
|
].filter((e) => !Object.entries(t.state.closedByMod).some(([t, n]) => n && e.href.includes(`/${t}/`)));
|
|
1088
1089
|
return e.right.includes("0") ? n.filter((t) => e.right[t.right] === "1") : n;
|
|
1089
1090
|
};
|
|
1090
|
-
return (e, t) => (
|
|
1091
|
+
return (e, t) => (F(), E(z(b), {
|
|
1091
1092
|
id: r.id,
|
|
1092
1093
|
class: "top-projectSelectorSubmenu",
|
|
1093
1094
|
notch: !1,
|
|
1094
1095
|
pos: "2"
|
|
1095
1096
|
}, {
|
|
1096
|
-
contentList:
|
|
1097
|
+
contentList: H(({ data: t }) => [t ? (F(), O(w, { key: 0 }, [(F(!0), O(w, null, L(o(t.projectItem), (t) => (F(), E(z(v), {
|
|
1097
1098
|
href: t.href,
|
|
1098
1099
|
title: t.title,
|
|
1099
1100
|
"data-top-icon": t.icon,
|
|
1100
1101
|
"data-right": t.right
|
|
1101
1102
|
}, {
|
|
1102
|
-
default:
|
|
1103
|
+
default: H(() => [A(R(e.$core.state.isMobile ? t.title : ""), 1)]),
|
|
1103
1104
|
_: 2
|
|
1104
1105
|
}, 1032, [
|
|
1105
1106
|
"href",
|
|
1106
1107
|
"title",
|
|
1107
1108
|
"data-top-icon",
|
|
1108
1109
|
"data-right"
|
|
1109
|
-
]))), 256)),
|
|
1110
|
+
]))), 256)), j(z(v), {
|
|
1110
1111
|
href: t.projectItem.externalLink,
|
|
1111
1112
|
title: t.projectItem.externalLink,
|
|
1112
1113
|
class: "top-ellipsis",
|
|
1113
1114
|
"data-top-icon": "",
|
|
1114
1115
|
target: "_blank"
|
|
1115
1116
|
}, {
|
|
1116
|
-
default:
|
|
1117
|
+
default: H(() => [k("span", _t, R(e.$core.state.isMobile ? t.projectItem.externalLink : ""), 1)]),
|
|
1117
1118
|
_: 2
|
|
1118
|
-
}, 1032, ["href", "title"])], 64)) :
|
|
1119
|
+
}, 1032, ["href", "title"])], 64)) : D("", !0)]),
|
|
1119
1120
|
_: 1
|
|
1120
1121
|
}, 8, ["id"]));
|
|
1121
1122
|
}
|
|
1122
|
-
}),
|
|
1123
|
+
}), yt = 1440 * 60 * 1e3, Y = I(null), X = de(), bt = (e) => {
|
|
1123
1124
|
localStorage.setItem("ui_project_selector_total:" + t.state.userId, JSON.stringify({
|
|
1124
1125
|
projectsTotal: e,
|
|
1125
|
-
expiresAt: Date.now() +
|
|
1126
|
+
expiresAt: Date.now() + yt
|
|
1126
1127
|
}));
|
|
1127
|
-
},
|
|
1128
|
+
}, xt = () => {
|
|
1128
1129
|
let e = localStorage.getItem("ui_project_selector_total:" + t.state.userId);
|
|
1129
1130
|
if (!e) return;
|
|
1130
1131
|
let { projectsTotal: n, expiresAt: r } = JSON.parse(e);
|
|
@@ -1133,14 +1134,14 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1133
1134
|
return;
|
|
1134
1135
|
}
|
|
1135
1136
|
return n;
|
|
1136
|
-
},
|
|
1137
|
-
|
|
1138
|
-
},
|
|
1137
|
+
}, St = () => {
|
|
1138
|
+
Y.value = null, X.value = void 0, localStorage.removeItem("ui_project_selector_total:" + t.state.userId), x("/get/projects_2/projects/");
|
|
1139
|
+
}, Ct = { class: "top-projectSelector_itemText" }, wt = { class: "top-comment" }, Tt = {
|
|
1139
1140
|
key: 0,
|
|
1140
1141
|
class: "top-comment"
|
|
1141
|
-
},
|
|
1142
|
+
}, Et = ["href"], Dt = 1e3, Ot = /* @__PURE__ */ M({
|
|
1142
1143
|
__name: "projectSelector",
|
|
1143
|
-
props: /*@__PURE__*/
|
|
1144
|
+
props: /*@__PURE__*/ N({
|
|
1144
1145
|
modelValue: {},
|
|
1145
1146
|
client: {},
|
|
1146
1147
|
menuMode: { type: Boolean },
|
|
@@ -1148,7 +1149,10 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1148
1149
|
openerShortcut: {},
|
|
1149
1150
|
modificator: {},
|
|
1150
1151
|
placeholder: {},
|
|
1151
|
-
buttonProps: {
|
|
1152
|
+
buttonProps: { default: () => ({
|
|
1153
|
+
color: "theme",
|
|
1154
|
+
styling: "outline"
|
|
1155
|
+
}) }
|
|
1152
1156
|
}, {
|
|
1153
1157
|
modelValue: { default: () => ({
|
|
1154
1158
|
id: null,
|
|
@@ -1158,56 +1162,64 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1158
1162
|
}),
|
|
1159
1163
|
emits: ["update:modelValue"],
|
|
1160
1164
|
setup(n) {
|
|
1161
|
-
let r = e(), i = n, a =
|
|
1162
|
-
|
|
1165
|
+
let r = e(), i = n, a = B(n, "modelValue"), o = ht(i.client);
|
|
1166
|
+
o.changeParams({ limit: Dt });
|
|
1167
|
+
let s = gt(i.client), c = I(xt()), l = I(null), f = pe(), p = T(() => i.placeholder ?? r.Projects.Select_project), m = T(() => !X.value || !i.excludeProjectId ? X.value : X.value.filter((e) => e.id !== i.excludeProjectId)), h = T(() => {
|
|
1168
|
+
if (!(!c.value && c.value !== 0)) return c.value < Dt ? "static" : "api";
|
|
1163
1169
|
}), _ = async () => {
|
|
1164
|
-
|
|
1165
|
-
let e = await
|
|
1166
|
-
return
|
|
1170
|
+
Y.value ||= o.call();
|
|
1171
|
+
let e = await Y.value;
|
|
1172
|
+
return Y.value = null, e;
|
|
1167
1173
|
}, v = async (e) => {
|
|
1168
1174
|
let n = await s.changeParams({
|
|
1169
1175
|
url: e.name,
|
|
1170
1176
|
name: e.name
|
|
1171
1177
|
}).call();
|
|
1172
1178
|
if (!n.errors) {
|
|
1173
|
-
if (
|
|
1174
|
-
let r =
|
|
1179
|
+
if (X.value && h.value === "static") {
|
|
1180
|
+
let r = st({
|
|
1175
1181
|
id: n.result,
|
|
1176
1182
|
user_id: t.state.userId,
|
|
1177
1183
|
name: e.name,
|
|
1178
1184
|
url: e.name,
|
|
1179
1185
|
on: 0,
|
|
1180
1186
|
right: "11111111111111111111"
|
|
1181
|
-
}), i =
|
|
1182
|
-
|
|
1183
|
-
...
|
|
1187
|
+
}), i = X.value.findIndex((e) => e.on === 0);
|
|
1188
|
+
X.value = [
|
|
1189
|
+
...X.value.slice(0, i),
|
|
1184
1190
|
r,
|
|
1185
|
-
...
|
|
1186
|
-
], c.value && (c.value += 1,
|
|
1191
|
+
...X.value.slice(i)
|
|
1192
|
+
], c.value && (c.value += 1, bt(c.value));
|
|
1187
1193
|
}
|
|
1188
1194
|
h.value === "api" && l.value?.resetCache(!0);
|
|
1189
1195
|
}
|
|
1190
|
-
}, ee = async () => {
|
|
1191
|
-
if (Y.value || h.value === "api") return;
|
|
1192
|
-
let e = await _();
|
|
1193
|
-
e.errors || (Y.value = e.result);
|
|
1194
1196
|
}, y = async () => {
|
|
1195
|
-
if (
|
|
1197
|
+
if (X.value || h.value === "api") return;
|
|
1196
1198
|
let e = await _();
|
|
1197
|
-
e.errors || (
|
|
1199
|
+
e.errors || (X.value = e.result);
|
|
1200
|
+
}, b = async () => {
|
|
1201
|
+
if (c.value) {
|
|
1202
|
+
let e = l.value?.popupOpenerRef?.$el;
|
|
1203
|
+
e && e.addEventListener("pointerenter", () => y(), { once: !0 });
|
|
1204
|
+
} else {
|
|
1205
|
+
let e = await _();
|
|
1206
|
+
if (e.errors) return;
|
|
1207
|
+
c.value = e.total ?? void 0, !X.value && h.value !== "api" && (X.value = e.result), c.value && bt(c.value);
|
|
1208
|
+
}
|
|
1198
1209
|
};
|
|
1199
|
-
return
|
|
1200
|
-
await
|
|
1210
|
+
return ae(async () => {
|
|
1211
|
+
await b();
|
|
1201
1212
|
}), (e, t) => {
|
|
1202
|
-
let r =
|
|
1203
|
-
return
|
|
1213
|
+
let r = ce("TopButton");
|
|
1214
|
+
return F(), O(w, null, [(F(), E(C, {
|
|
1215
|
+
key: h.value ?? "dummy",
|
|
1204
1216
|
ref_key: "refSelector",
|
|
1205
1217
|
ref: l,
|
|
1206
1218
|
class: "top-projectSelector",
|
|
1207
1219
|
modelValue: a.value,
|
|
1208
|
-
"onUpdate:modelValue": t[1] ||= (e) => n.menuMode ?
|
|
1220
|
+
"onUpdate:modelValue": t[1] ||= (e) => n.menuMode ? z(ut)(e.id) : a.value = e,
|
|
1209
1221
|
items: m.value,
|
|
1210
|
-
itemsIsLoading: h.value === "static" &&
|
|
1222
|
+
itemsIsLoading: h.value === "static" && z(X) === void 0,
|
|
1211
1223
|
title: e.$i18n.Projects.Search_projects,
|
|
1212
1224
|
modificator: n.modificator,
|
|
1213
1225
|
searchFields: [
|
|
@@ -1217,46 +1229,50 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1217
1229
|
],
|
|
1218
1230
|
placeholder: p.value,
|
|
1219
1231
|
hasCloserBtn: "",
|
|
1220
|
-
api: h.value === "api" ?
|
|
1221
|
-
apiSetSearchParams: h.value === "api" ? (...e) =>
|
|
1232
|
+
api: h.value === "api" ? z(o) : void 0,
|
|
1233
|
+
apiSetSearchParams: h.value === "api" ? (...e) => z(mt)(...e) : void 0,
|
|
1222
1234
|
useCache: "",
|
|
1223
1235
|
appendSearchToResult: "",
|
|
1224
1236
|
appendSearchAllowDuplicate: "",
|
|
1225
|
-
appendSearchToResultCond:
|
|
1237
|
+
appendSearchToResultCond: z(u),
|
|
1226
1238
|
appendWithoutSelect: "",
|
|
1227
|
-
buttonProps:
|
|
1239
|
+
buttonProps: {
|
|
1240
|
+
...n.buttonProps,
|
|
1241
|
+
isProgress: !h.value,
|
|
1242
|
+
disabled: !h.value
|
|
1243
|
+
},
|
|
1228
1244
|
openerShortcut: n.openerShortcut,
|
|
1229
1245
|
onAppendItem: v,
|
|
1230
|
-
onOpen:
|
|
1246
|
+
onOpen: y
|
|
1231
1247
|
}, {
|
|
1232
|
-
item:
|
|
1233
|
-
n.menuMode ? (
|
|
1248
|
+
item: H(({ item: i }) => [k("div", Ct, [i.id ? (F(), O(w, { key: 0 }, [A(R(z(d)(i.name, 20)) + " ", 1), k("span", wt, " id " + R(i.id), 1)], 64)) : (F(), O(w, { key: 1 }, [i.listItemProps?.type ? D("", !0) : (F(), O("div", Tt, R(e.$i18n.Projects.Add_project) + ": ", 1)), A(" " + R(i.name), 1)], 64))]), i.id ? (F(), O(w, { key: 0 }, [
|
|
1249
|
+
n.menuMode ? (F(), O("a", {
|
|
1234
1250
|
key: 0,
|
|
1235
1251
|
class: "top-projectSelector_itemLink",
|
|
1236
|
-
href:
|
|
1237
|
-
}, null, 8,
|
|
1238
|
-
e.$core.state.isMobile ?
|
|
1252
|
+
href: z(dt)(i.id)
|
|
1253
|
+
}, null, 8, Et)) : D("", !0),
|
|
1254
|
+
e.$core.state.isMobile ? D("", !0) : (F(), E(r, {
|
|
1239
1255
|
key: 1,
|
|
1240
1256
|
href: i.externalLink,
|
|
1241
1257
|
"data-top-icon": "",
|
|
1242
1258
|
color: "theme",
|
|
1243
1259
|
target: "_blank",
|
|
1244
|
-
onClick: t[0] ||=
|
|
1260
|
+
onClick: t[0] ||= U(() => {}, ["stop"])
|
|
1245
1261
|
}, null, 8, ["href"])),
|
|
1246
|
-
|
|
1247
|
-
id:
|
|
1262
|
+
j(g, {
|
|
1263
|
+
id: z(f),
|
|
1248
1264
|
pos: "2",
|
|
1249
1265
|
notch: !1,
|
|
1250
1266
|
data: { projectItem: i }
|
|
1251
1267
|
}, {
|
|
1252
|
-
default:
|
|
1268
|
+
default: H(() => [j(r, {
|
|
1253
1269
|
class: "top-popup_listMore",
|
|
1254
1270
|
"data-top-icon": "",
|
|
1255
1271
|
color: "theme"
|
|
1256
1272
|
})]),
|
|
1257
1273
|
_: 1
|
|
1258
1274
|
}, 8, ["id", "data"])
|
|
1259
|
-
], 64)) :
|
|
1275
|
+
], 64)) : D("", !0)]),
|
|
1260
1276
|
_: 1
|
|
1261
1277
|
}, 8, [
|
|
1262
1278
|
"modelValue",
|
|
@@ -1270,37 +1286,37 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1270
1286
|
"appendSearchToResultCond",
|
|
1271
1287
|
"buttonProps",
|
|
1272
1288
|
"openerShortcut"
|
|
1273
|
-
]),
|
|
1289
|
+
])), j(vt, { id: z(f) }, null, 8, ["id"])], 64);
|
|
1274
1290
|
};
|
|
1275
1291
|
}
|
|
1276
|
-
}),
|
|
1277
|
-
e =
|
|
1292
|
+
}), kt = (e) => "-" + e, Z = (e) => e[0] === "-" ? e.substring(1) : e, Q = (e, t) => {
|
|
1293
|
+
e = Z(e);
|
|
1278
1294
|
let n = t.find((t) => t.id === e);
|
|
1279
1295
|
if (n) return n;
|
|
1280
|
-
},
|
|
1296
|
+
}, At = (e, t, n) => {
|
|
1281
1297
|
t ||= { id: e.id }, t.id = e.id, t.pos ??= "3", t.notch ??= !0, t.posBy ??= "fixed";
|
|
1282
1298
|
let r = c.genElPopupOpener("div", t);
|
|
1283
1299
|
return r.classList.add("top-tagSelector"), e.useTopButton && r.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), e.useTopButton || r.classList.add("top-tagSelector-custom"), e.mode === "filter" && r.classList.add("top-tagSelector-filter"), e.mode === "setter" && !e.filters && r.classList.add("top-tagSelector-setter_single"), e.mode === "setter" && e.filters && r.classList.add("top-tagSelector-setter_several"), r.onclick = (t) => {
|
|
1284
1300
|
t.preventDefault(), t.stopPropagation(), r.onclick = null;
|
|
1285
|
-
let i =
|
|
1301
|
+
let i = I(e.modelValue), a = {
|
|
1286
1302
|
model: i,
|
|
1287
1303
|
mode: e.mode,
|
|
1288
1304
|
targetId: e.targetId,
|
|
1289
1305
|
filters: e.filters,
|
|
1290
1306
|
payload: e.payload
|
|
1291
1307
|
};
|
|
1292
|
-
s(r, "topTagSelectorTarget", a), delete r.dataset.topPopupDisabled,
|
|
1293
|
-
e.modelValue = i.value,
|
|
1308
|
+
s(r, "topTagSelectorTarget", a), delete r.dataset.topPopupDisabled, ne(e.modelValue) || V(i, () => {
|
|
1309
|
+
e.modelValue = i.value, Mt(r, e, n);
|
|
1294
1310
|
}), r.click();
|
|
1295
|
-
},
|
|
1311
|
+
}, ne(e.modelValue) ? V(e.modelValue, () => Mt(r, e, n)) : s(r, "topTagSelectorRender", (t) => {
|
|
1296
1312
|
e.modelValue = t;
|
|
1297
1313
|
let i = s(r, "topTagSelectorTarget");
|
|
1298
|
-
i && (i.model.value = t),
|
|
1299
|
-
}),
|
|
1300
|
-
},
|
|
1314
|
+
i && (i.model.value = t), Mt(r, e, n);
|
|
1315
|
+
}), Mt(r, e, n), r;
|
|
1316
|
+
}, jt = (e, t) => {
|
|
1301
1317
|
s(e, "topTagSelectorRender")?.(t);
|
|
1302
|
-
},
|
|
1303
|
-
let i =
|
|
1318
|
+
}, Mt = (t, n, r) => {
|
|
1319
|
+
let i = z(n.modelValue);
|
|
1304
1320
|
if (t.classList.toggle("top-tagSelector-selectedOne", !i.length || i.length === 1), t.classList.toggle("top-tagSelector-toTwoLine", i.length > 5), n.mode === "setter" && n.filters) {
|
|
1305
1321
|
t.innerHTML = `<div>${r}</div>`;
|
|
1306
1322
|
return;
|
|
@@ -1316,10 +1332,10 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1316
1332
|
}
|
|
1317
1333
|
i.forEach((e) => {
|
|
1318
1334
|
let r = Nt({
|
|
1319
|
-
id:
|
|
1320
|
-
colorId:
|
|
1321
|
-
name:
|
|
1322
|
-
state:
|
|
1335
|
+
id: Z(e),
|
|
1336
|
+
colorId: Q(e, n.tags)?.color_id ?? "",
|
|
1337
|
+
name: Q(e, n.tags)?.name ?? "",
|
|
1338
|
+
state: Z(e) === e ? "selected" : "excluded"
|
|
1323
1339
|
});
|
|
1324
1340
|
t.append(r);
|
|
1325
1341
|
});
|
|
@@ -1381,7 +1397,7 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1381
1397
|
"data-tag_id",
|
|
1382
1398
|
"data-tag_color_id",
|
|
1383
1399
|
"title"
|
|
1384
|
-
], It = /* @__PURE__ */
|
|
1400
|
+
], It = /* @__PURE__ */ M({
|
|
1385
1401
|
__name: "tagIcon",
|
|
1386
1402
|
props: {
|
|
1387
1403
|
id: {},
|
|
@@ -1390,8 +1406,8 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1390
1406
|
state: {}
|
|
1391
1407
|
},
|
|
1392
1408
|
setup(e) {
|
|
1393
|
-
return (t, n) => (
|
|
1394
|
-
class:
|
|
1409
|
+
return (t, n) => (F(), O("div", {
|
|
1410
|
+
class: P({
|
|
1395
1411
|
"top-tagSelector_tagIcon": !0,
|
|
1396
1412
|
"top-tagSelector-active": !!e.state,
|
|
1397
1413
|
"top-tagSelector-excluded": e.state === "excluded"
|
|
@@ -1401,9 +1417,9 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1401
1417
|
title: e.name
|
|
1402
1418
|
}, null, 10, Ft));
|
|
1403
1419
|
}
|
|
1404
|
-
}), Lt = ["contenteditable", "onKeydown"], Rt = /* @__PURE__ */
|
|
1420
|
+
}), Lt = ["contenteditable", "onKeydown"], Rt = /* @__PURE__ */ M({
|
|
1405
1421
|
__name: "tagPopupListItem",
|
|
1406
|
-
props: /*@__PURE__*/
|
|
1422
|
+
props: /*@__PURE__*/ N({
|
|
1407
1423
|
editable: { type: Boolean },
|
|
1408
1424
|
disabled: { type: Boolean },
|
|
1409
1425
|
canExclude: { type: Boolean },
|
|
@@ -1415,18 +1431,18 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1415
1431
|
name: { required: !0 },
|
|
1416
1432
|
nameModifiers: {}
|
|
1417
1433
|
}),
|
|
1418
|
-
emits: /*@__PURE__*/
|
|
1434
|
+
emits: /*@__PURE__*/ N([
|
|
1419
1435
|
"update:name",
|
|
1420
1436
|
"unselect",
|
|
1421
1437
|
"exclude",
|
|
1422
1438
|
"select"
|
|
1423
1439
|
], ["update:name"]),
|
|
1424
1440
|
setup(e, { emit: t }) {
|
|
1425
|
-
let n = e, r = t, i =
|
|
1441
|
+
let n = e, r = t, i = B(e, "name"), a = I(null), o = T(() => navigator.userAgent.indexOf("Firefox") == -1 ? {} : {
|
|
1426
1442
|
contenteditable: s.value,
|
|
1427
1443
|
onpaste: (e) => e.preventDefault()
|
|
1428
|
-
}), s =
|
|
1429
|
-
s.value = !0, await
|
|
1444
|
+
}), s = I(!1), c = async () => {
|
|
1445
|
+
s.value = !0, await ie(), a.value?.focus();
|
|
1430
1446
|
}, l = () => {
|
|
1431
1447
|
let e = a.value?.innerText;
|
|
1432
1448
|
if (!e) return u();
|
|
@@ -1438,8 +1454,8 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1438
1454
|
let t = "selected";
|
|
1439
1455
|
n.canExclude && (e.ctrlKey || e.metaKey) && (t = "excluded"), n.state == t && (t = ""), t === "" && r("unselect"), t === "selected" && r("select"), t === "excluded" && r("exclude");
|
|
1440
1456
|
};
|
|
1441
|
-
return (t, n) => (
|
|
1442
|
-
class:
|
|
1457
|
+
return (t, n) => (F(), E(v, {
|
|
1458
|
+
class: P({
|
|
1443
1459
|
"top-tagSelector_tagListItem": !0,
|
|
1444
1460
|
"top-tagSelector_tagListItem-inEdit": s.value,
|
|
1445
1461
|
"top-tagSelector_tagListItem-disabled": e.disabled,
|
|
@@ -1447,10 +1463,10 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1447
1463
|
"top-tagSelector-active": !!e.state,
|
|
1448
1464
|
"top-tagSelector-excluded": e.state === "excluded"
|
|
1449
1465
|
}),
|
|
1450
|
-
onClick:
|
|
1466
|
+
onClick: U(d, ["stop"])
|
|
1451
1467
|
}, {
|
|
1452
|
-
default:
|
|
1453
|
-
|
|
1468
|
+
default: H(() => [
|
|
1469
|
+
j(It, {
|
|
1454
1470
|
id: e.id,
|
|
1455
1471
|
name: i.value,
|
|
1456
1472
|
colorId: e.colorId,
|
|
@@ -1461,31 +1477,31 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1461
1477
|
"colorId",
|
|
1462
1478
|
"state"
|
|
1463
1479
|
]),
|
|
1464
|
-
|
|
1480
|
+
k("span", re({
|
|
1465
1481
|
ref_key: "elName",
|
|
1466
1482
|
ref: a,
|
|
1467
1483
|
class: "top-tagSelector_tagListItemName",
|
|
1468
1484
|
contenteditable: s.value ? "plaintext-only" : !1
|
|
1469
|
-
}, o.value, { onKeydown: [
|
|
1470
|
-
e.editable ? (
|
|
1485
|
+
}, o.value, { onKeydown: [he(U(l, ["stop"]), ["enter"]), he(U(u, ["stop"]), ["esc"])] }), R(i.value), 17, Lt),
|
|
1486
|
+
e.editable ? (F(), O(w, { key: 0 }, [s.value ? (F(), O("span", {
|
|
1471
1487
|
key: 1,
|
|
1472
1488
|
"data-top-icon": "",
|
|
1473
1489
|
class: "top-tagSelector_edit",
|
|
1474
|
-
onClick:
|
|
1475
|
-
})) : (
|
|
1490
|
+
onClick: U(l, ["stop"])
|
|
1491
|
+
})) : (F(), O("span", {
|
|
1476
1492
|
key: 0,
|
|
1477
1493
|
"data-top-icon": "",
|
|
1478
1494
|
class: "top-tagSelector_edit",
|
|
1479
1495
|
onClick: c
|
|
1480
|
-
}))], 64)) :
|
|
1496
|
+
}))], 64)) : D("", !0)
|
|
1481
1497
|
]),
|
|
1482
1498
|
_: 1
|
|
1483
1499
|
}, 8, ["class"]));
|
|
1484
1500
|
}
|
|
1485
|
-
}), zt = { key: 1 }, Bt = /* @__PURE__ */
|
|
1501
|
+
}), zt = { key: 1 }, Bt = /* @__PURE__ */ M({
|
|
1486
1502
|
inheritAttrs: !1,
|
|
1487
1503
|
__name: "popupOpener",
|
|
1488
|
-
props: /*@__PURE__*/
|
|
1504
|
+
props: /*@__PURE__*/ N({
|
|
1489
1505
|
modelValue: {},
|
|
1490
1506
|
id: {},
|
|
1491
1507
|
tags: {},
|
|
@@ -1501,7 +1517,7 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1501
1517
|
}),
|
|
1502
1518
|
emits: ["update:modelValue"],
|
|
1503
1519
|
setup(e) {
|
|
1504
|
-
let t = e, n =
|
|
1520
|
+
let t = e, n = B(e, "modelValue"), i = t.useTopButton ? r : "div", a = t.useTopButton ? "html" : "default", o = {
|
|
1505
1521
|
model: n,
|
|
1506
1522
|
mode: t.mode,
|
|
1507
1523
|
targetId: t.targetId,
|
|
@@ -1509,9 +1525,9 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1509
1525
|
payload: t.payload
|
|
1510
1526
|
};
|
|
1511
1527
|
return (r, s) => {
|
|
1512
|
-
let c =
|
|
1513
|
-
return
|
|
1514
|
-
default:
|
|
1528
|
+
let c = le("top-data");
|
|
1529
|
+
return F(), E(g, { id: e.id }, {
|
|
1530
|
+
default: H(() => [me((F(), E(ue(z(i)), re({
|
|
1515
1531
|
class: {
|
|
1516
1532
|
"top-tagSelector": !0,
|
|
1517
1533
|
"top-tagSelector-useTopButton": t.useTopButton,
|
|
@@ -1526,17 +1542,17 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1526
1542
|
color: "theme",
|
|
1527
1543
|
styling: e.styling
|
|
1528
1544
|
}, r.$attrs), {
|
|
1529
|
-
[
|
|
1545
|
+
[z(a)]: H(() => [!n.value.length && e.mode === "filter" ? (F(), E(It, {
|
|
1530
1546
|
key: 0,
|
|
1531
1547
|
id: "all",
|
|
1532
1548
|
colorId: "",
|
|
1533
1549
|
name: r.$i18n.Common.All_tags ?? "",
|
|
1534
1550
|
state: ""
|
|
1535
|
-
}, null, 8, ["name"])) :
|
|
1536
|
-
id:
|
|
1537
|
-
colorId:
|
|
1538
|
-
name:
|
|
1539
|
-
state:
|
|
1551
|
+
}, null, 8, ["name"])) : D("", !0), e.mode === "setter" && e.filters ? (F(), O("div", zt, [se(r.$slots, "default")])) : (F(!0), O(w, { key: 2 }, L(n.value, (t) => (F(), E(It, {
|
|
1552
|
+
id: z(Z)(t),
|
|
1553
|
+
colorId: z(Q)(t, e.tags)?.color_id ?? "",
|
|
1554
|
+
name: z(Q)(t, e.tags)?.name ?? "",
|
|
1555
|
+
state: z(Z)(t) === t ? "selected" : "excluded"
|
|
1540
1556
|
}, null, 8, [
|
|
1541
1557
|
"id",
|
|
1542
1558
|
"colorId",
|
|
@@ -1553,9 +1569,9 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1553
1569
|
}, 8, ["id"]);
|
|
1554
1570
|
};
|
|
1555
1571
|
}
|
|
1556
|
-
}), Vt = /* @__PURE__ */
|
|
1572
|
+
}), Vt = /* @__PURE__ */ M({
|
|
1557
1573
|
__name: "tagSelector",
|
|
1558
|
-
props: /*@__PURE__*/
|
|
1574
|
+
props: /*@__PURE__*/ N({
|
|
1559
1575
|
modelValue: {},
|
|
1560
1576
|
tags: {},
|
|
1561
1577
|
tagsEditable: { type: Boolean },
|
|
@@ -1576,20 +1592,20 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1576
1592
|
}, {
|
|
1577
1593
|
modelValue: { required: !0 },
|
|
1578
1594
|
modelModifiers: {},
|
|
1579
|
-
tags: { default:
|
|
1595
|
+
tags: { default: oe(Pt) },
|
|
1580
1596
|
tagsModifiers: {}
|
|
1581
1597
|
}),
|
|
1582
|
-
emits: /*@__PURE__*/
|
|
1598
|
+
emits: /*@__PURE__*/ N([
|
|
1583
1599
|
"selector",
|
|
1584
1600
|
"setter",
|
|
1585
1601
|
"tagsChanged"
|
|
1586
1602
|
], ["update:modelValue", "update:tags"]),
|
|
1587
1603
|
setup(a, { emit: o }) {
|
|
1588
|
-
let c = e(), l = a, u =
|
|
1604
|
+
let c = e(), l = a, u = B(a, "modelValue"), d = B(a, "tags"), f = o, p = n((e, t) => {
|
|
1589
1605
|
f(e, t);
|
|
1590
1606
|
}, l.emitDelay);
|
|
1591
1607
|
l.singleMode && !u.value.length && (u.value = [d.value[0].id]);
|
|
1592
|
-
let m = l.id ?? "top-popup-id-" + Math.random(), h =
|
|
1608
|
+
let m = l.id ?? "top-popup-id-" + Math.random(), h = I("add"), g = () => {
|
|
1593
1609
|
let e = " " + c.Common.Tags?.toLowerCase(), t = /* @__PURE__ */ new Map();
|
|
1594
1610
|
return t.set("add", {
|
|
1595
1611
|
value: "add",
|
|
@@ -1601,35 +1617,35 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1601
1617
|
value: "delete",
|
|
1602
1618
|
title: c.Common.Delete + e
|
|
1603
1619
|
}), t;
|
|
1604
|
-
}, _ =
|
|
1620
|
+
}, _ = de({
|
|
1605
1621
|
model: u,
|
|
1606
1622
|
mode: "filter",
|
|
1607
1623
|
targetId: void 0,
|
|
1608
1624
|
filters: void 0,
|
|
1609
1625
|
payload: void 0
|
|
1610
1626
|
});
|
|
1611
|
-
|
|
1627
|
+
V(u, () => {
|
|
1612
1628
|
p("selector", u.value);
|
|
1613
1629
|
});
|
|
1614
|
-
let
|
|
1630
|
+
let y = T(() => {
|
|
1615
1631
|
if (_.value.mode === "setter" && l.maxTagsForSetter && !_.value.filters) return _.value.model.value.length >= l.maxTagsForSetter;
|
|
1616
|
-
}),
|
|
1632
|
+
}), x = (e) => {
|
|
1617
1633
|
if (e !== "all") {
|
|
1618
1634
|
if (_.value.model.value.includes(e)) return "selected";
|
|
1619
|
-
if (_.value.model.value.includes(
|
|
1635
|
+
if (_.value.model.value.includes(kt(e))) return "excluded";
|
|
1620
1636
|
}
|
|
1621
1637
|
return e === "all" && !_.value.model.value.length ? "selected" : "";
|
|
1622
|
-
},
|
|
1623
|
-
let n =
|
|
1638
|
+
}, S = (e, t) => {
|
|
1639
|
+
let n = kt(e), r = _.value.model.value.filter((t) => t !== e && t !== n);
|
|
1624
1640
|
t === "select" && r.push(e), t === "exclude" && r.push(n), _.value.mode === "setter" && _.value.targetId !== void 0 && l.requiredForSetter && (r.length || r.push("1"), r.length === 2 && _.value.model.value.length === 1 && _.value.model.value[0] === "1" && (r = r.filter((e) => e !== "1"))), l.singleMode && !_.value.filters && (r.length || (r = _.value.model.value), r.length > 1 && (r = [r[r.length - 1]])), r.sort((e, t) => l.tags ? l.tags.findIndex((t) => t.id === e) - l.tags.findIndex((e) => e.id === t) : 0), _.value.model.value = r, _.value.mode === "setter" && _.value.targetId !== void 0 && p("setter", {
|
|
1625
1641
|
tagsIds: r,
|
|
1626
1642
|
targetId: _.value.targetId,
|
|
1627
1643
|
payload: _.value.payload
|
|
1628
1644
|
});
|
|
1629
|
-
},
|
|
1645
|
+
}, C = T(() => {
|
|
1630
1646
|
let e = "top-tagSelector_popup";
|
|
1631
1647
|
return _.value.mode === "filter" && (e += " top-tagSelector_popup-filter"), _.value.mode === "setter" && (e += " top-tagSelector_popup-setter"), e;
|
|
1632
|
-
}),
|
|
1648
|
+
}), ee = () => {
|
|
1633
1649
|
let e = prompt("", "New tag");
|
|
1634
1650
|
if (!e || e === "New tag") return;
|
|
1635
1651
|
let t = d.value.length + 1;
|
|
@@ -1638,7 +1654,7 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1638
1654
|
name: e,
|
|
1639
1655
|
color_id: String((t - 1) % 10 + 1)
|
|
1640
1656
|
}), f("tagsChanged", d.value);
|
|
1641
|
-
},
|
|
1657
|
+
}, k = (e) => {
|
|
1642
1658
|
if (_.value = s(e.elPopupOpener, "topTagSelectorTarget"), !_.value) throw Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
|
|
1643
1659
|
if (_.value.filters && (h.value = "add", _.value.model.value = []), !t.$?.ui.sortable) {
|
|
1644
1660
|
console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
|
|
@@ -1658,13 +1674,13 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1658
1674
|
}), d.value.sort((e, t) => r.findIndex((t) => t === e.id) - r.findIndex((e) => e === t.id)), p("tagsChanged", d.value);
|
|
1659
1675
|
}
|
|
1660
1676
|
});
|
|
1661
|
-
},
|
|
1677
|
+
}, M = (e) => {
|
|
1662
1678
|
t.$?.ui.sortable && $(e.elPopup).data("ui-sortable") && $(e.elPopup).sortable("destroy");
|
|
1663
1679
|
};
|
|
1664
|
-
return (e, t) => (
|
|
1680
|
+
return (e, t) => (F(), O(w, null, [j(Bt, {
|
|
1665
1681
|
modelValue: u.value,
|
|
1666
1682
|
"onUpdate:modelValue": t[0] ||= (e) => u.value = e,
|
|
1667
|
-
id:
|
|
1683
|
+
id: z(m),
|
|
1668
1684
|
tags: d.value,
|
|
1669
1685
|
styling: a.styling,
|
|
1670
1686
|
mode: "filter",
|
|
@@ -1675,36 +1691,36 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1675
1691
|
"tags",
|
|
1676
1692
|
"styling",
|
|
1677
1693
|
"useTopButton"
|
|
1678
|
-
]),
|
|
1679
|
-
id:
|
|
1680
|
-
class:
|
|
1681
|
-
onOpen: t[4] ||= (e) =>
|
|
1682
|
-
onClose: t[5] ||= (e) =>
|
|
1694
|
+
]), j(b, {
|
|
1695
|
+
id: z(m),
|
|
1696
|
+
class: P(C.value),
|
|
1697
|
+
onOpen: t[4] ||= (e) => k(e),
|
|
1698
|
+
onClose: t[5] ||= (e) => M(e),
|
|
1683
1699
|
"transition-duration": 50
|
|
1684
|
-
},
|
|
1685
|
-
contentList:
|
|
1686
|
-
_.value.mode === "filter" && !a.singleMode ? (
|
|
1700
|
+
}, te({
|
|
1701
|
+
contentList: H(() => [
|
|
1702
|
+
_.value.mode === "filter" && !a.singleMode ? (F(), E(Rt, {
|
|
1687
1703
|
key: 0,
|
|
1688
1704
|
id: "all",
|
|
1689
1705
|
colorId: "",
|
|
1690
1706
|
name: e.$i18n.Common.All_tags ?? "",
|
|
1691
1707
|
state: _.value.model.value.length ? "" : "selected",
|
|
1692
1708
|
onSelect: t[3] ||= (e) => _.value.model.value = []
|
|
1693
|
-
}, null, 8, ["name", "state"])) :
|
|
1694
|
-
(
|
|
1709
|
+
}, null, 8, ["name", "state"])) : D("", !0),
|
|
1710
|
+
(F(!0), O(w, null, L(d.value, (e) => (F(), E(Rt, {
|
|
1695
1711
|
key: e.id,
|
|
1696
1712
|
id: e.id,
|
|
1697
1713
|
colorId: e.color_id,
|
|
1698
1714
|
name: e.name,
|
|
1699
|
-
state:
|
|
1715
|
+
state: x(e.id),
|
|
1700
1716
|
canExclude: _.value.mode === "filter" && !a.singleMode,
|
|
1701
1717
|
editable: a.tagsEditable,
|
|
1702
|
-
disabled:
|
|
1703
|
-
onUnselect: (t) =>
|
|
1704
|
-
onSelect: (t) =>
|
|
1705
|
-
onExclude: (t) =>
|
|
1718
|
+
disabled: y.value && x(e.id) === "",
|
|
1719
|
+
onUnselect: (t) => S(e.id, "unselect"),
|
|
1720
|
+
onSelect: (t) => S(e.id, "select"),
|
|
1721
|
+
onExclude: (t) => S(e.id, "exclude"),
|
|
1706
1722
|
"onUpdate:name": (t) => {
|
|
1707
|
-
e.name = t,
|
|
1723
|
+
e.name = t, z(p)("tagsChanged", d.value);
|
|
1708
1724
|
}
|
|
1709
1725
|
}, null, 8, [
|
|
1710
1726
|
"id",
|
|
@@ -1719,19 +1735,19 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1719
1735
|
"onExclude",
|
|
1720
1736
|
"onUpdate:name"
|
|
1721
1737
|
]))), 128)),
|
|
1722
|
-
a.tagsEditable && d.value.length < a.tagsMax && d.value.length < 20 ? (
|
|
1738
|
+
a.tagsEditable && d.value.length < a.tagsMax && d.value.length < 20 ? (F(), E(v, {
|
|
1723
1739
|
key: 1,
|
|
1724
1740
|
"data-top-icon": "",
|
|
1725
|
-
onClick:
|
|
1741
|
+
onClick: U(ee, ["stop"])
|
|
1726
1742
|
}, {
|
|
1727
|
-
default:
|
|
1743
|
+
default: H(() => [A(R(e.$i18n.Common.Add), 1)]),
|
|
1728
1744
|
_: 1
|
|
1729
|
-
})) :
|
|
1745
|
+
})) : D("", !0)
|
|
1730
1746
|
]),
|
|
1731
1747
|
_: 2
|
|
1732
1748
|
}, [_.value.mode === "setter" && _.value.filters ? {
|
|
1733
1749
|
name: "header",
|
|
1734
|
-
fn:
|
|
1750
|
+
fn: H(() => [j(i, {
|
|
1735
1751
|
modelValue: h.value,
|
|
1736
1752
|
"onUpdate:modelValue": t[1] ||= (e) => h.value = e,
|
|
1737
1753
|
options: g()
|
|
@@ -1739,16 +1755,16 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1739
1755
|
key: "0"
|
|
1740
1756
|
} : void 0, _.value.mode === "setter" && _.value.filters ? {
|
|
1741
1757
|
name: "footer",
|
|
1742
|
-
fn:
|
|
1743
|
-
default:
|
|
1758
|
+
fn: H(() => [j(r, { color: "theme" }, {
|
|
1759
|
+
default: H(() => [A(R(e.$i18n.Common.Cancel), 1)]),
|
|
1744
1760
|
_: 1
|
|
1745
|
-
}),
|
|
1761
|
+
}), j(r, { onClick: t[2] ||= (e) => z(p)("setter", {
|
|
1746
1762
|
tagsIds: _.value.model.value,
|
|
1747
1763
|
filters: _.value.filters,
|
|
1748
1764
|
filtersAction: h.value,
|
|
1749
1765
|
payload: _.value.payload
|
|
1750
1766
|
}) }, {
|
|
1751
|
-
default:
|
|
1767
|
+
default: H(() => [A(R(h.value === "add" ? e.$i18n.Common.Add : "") + " " + R(h.value === "replace" ? e.$i18n.Common.Replace : "") + " " + R(h.value === "delete" ? e.$i18n.Common.Delete : ""), 1)]),
|
|
1752
1768
|
_: 1
|
|
1753
1769
|
})]),
|
|
1754
1770
|
key: "1"
|
|
@@ -1756,6 +1772,6 @@ var Ue = ["innerHTML"], We = /* @__PURE__ */ j({
|
|
|
1756
1772
|
}
|
|
1757
1773
|
});
|
|
1758
1774
|
//#endregion
|
|
1759
|
-
export {
|
|
1775
|
+
export { ve as TopCompetitorSelector, rt as TopGroupSelector, Ot as TopProjectSelector, Le as TopRegionSelector, Vt as TopTagSelector, Bt as TopTagSelectorPopupOpener, It as TopTagSelectorTagIcon, Me as dialogRegionSelector, je as findRegion, At as genElTopTagSelectorPopupOpener, Oe as genSearcherByKey, jt as renderElTopTagSelectorPopupOpener, St as topProjectSelectorClearCache, ye as useItemsFromCompetitors };
|
|
1760
1776
|
|
|
1761
1777
|
//# sourceMappingURL=project.js.map
|