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