@topvisor/ui 1.4.0-TopGroupSelector.6 → 1.4.0-TopGroupSelector.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.chunks/policy.vue_vue_type_style_index_0_lang-BfL6Mj6K.amd.js +2 -0
- package/.chunks/{policy.vue_vue_type_style_index_0_lang-BUIBGweg.amd.js.map → policy.vue_vue_type_style_index_0_lang-BfL6Mj6K.amd.js.map} +1 -1
- package/.chunks/{policy.vue_vue_type_style_index_0_lang-B61ZEDWr.es.js → policy.vue_vue_type_style_index_0_lang-b4Vb3SlQ.es.js} +107 -105
- package/.chunks/{policy.vue_vue_type_style_index_0_lang-B61ZEDWr.es.js.map → policy.vue_vue_type_style_index_0_lang-b4Vb3SlQ.es.js.map} +1 -1
- package/.chunks/popupHint.vue_vue_type_style_index_0_lang-Bp_-W068.es.js.map +1 -1
- package/.chunks/popupHint.vue_vue_type_style_index_0_lang-D42xEF-j.amd.js.map +1 -1
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.js +1 -1
- package/package.json +1 -1
- package/popup/worker.amd.js +1 -1
- package/popup/worker.amd.js.map +1 -1
- package/popup/worker.js +9 -7
- package/popup/worker.js.map +1 -1
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +69 -71
- package/src/components/project/project.d.ts +0 -10
- package/.chunks/policy.vue_vue_type_style_index_0_lang-BUIBGweg.amd.js +0 -2
package/project/project.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
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
|
|
6
|
+
import { defineComponent as L, mergeModels as M, useModel as A, computed as E, createElementBlock as b, openBlock as h, createBlock as C, unref as v, withCtx as B, Fragment as Y, renderList as fe, normalizeClass as X, createElementVNode as oe, toDisplayString as V, createVNode as R, createTextVNode as z, toValue as ve, ref as G, watch as T, createCommentVNode as O, reactive as Te, isRef as pe, withModifiers as F, mergeProps as Ae, withKeys as ye, nextTick as Re, resolveDirective as Ne, withDirectives as Pe, resolveDynamicComponent as De, renderSlot as qe, shallowRef as Ue, createSlots as Fe } from "vue";
|
|
7
7
|
import { u as w, C as _, e as H, p as se, d as _e } from "../.chunks/forms-Cwv0JCi5.es.js";
|
|
8
8
|
import { _ as be, b as me, a as ze } from "../.chunks/popupHint.vue_vue_type_style_index_0_lang-Bp_-W068.es.js";
|
|
9
|
-
import { a as Je, _ as Ve, b as Me, c as we, I as de } from "../.chunks/policy.vue_vue_type_style_index_0_lang-
|
|
9
|
+
import { a as Je, _ as Ve, b as Me, c as we, I as de } from "../.chunks/policy.vue_vue_type_style_index_0_lang-b4Vb3SlQ.es.js";
|
|
10
10
|
import { u as We } from "../.chunks/utils-cls72V1c.es.js";
|
|
11
11
|
import { getSearcherGIcon as Ye, getLangLabel as He, getDeviceGIcon as Qe } from "../utils/searchers.js";
|
|
12
12
|
import "../.chunks/core-DVQVVUiP.es.js";
|
|
@@ -14,7 +14,7 @@ import "../.chunks/dialogs.vue_vue_type_script_setup_true_lang-BP6GFkkz.es.js";
|
|
|
14
14
|
import { g as Xe } 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__ */ L({
|
|
18
18
|
__name: "competitorSelector",
|
|
19
19
|
props: /* @__PURE__ */ M({
|
|
20
20
|
modelValue: {},
|
|
@@ -37,20 +37,20 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
37
37
|
});
|
|
38
38
|
return (r, l) => (h(), b("div", et, [
|
|
39
39
|
v(_).state.isMobile ? (h(), C(be, { key: 0 }, {
|
|
40
|
-
opener:
|
|
41
|
-
|
|
40
|
+
opener: B(() => [
|
|
41
|
+
R(H, {
|
|
42
42
|
class: "top-competitorSelector_opener",
|
|
43
43
|
color: "theme",
|
|
44
44
|
icon: "",
|
|
45
45
|
icon2: ""
|
|
46
46
|
}, {
|
|
47
|
-
default:
|
|
47
|
+
default: B(() => [
|
|
48
48
|
z(V(e.items.find((n) => n.value === o.value?.[0])?.content), 1)
|
|
49
49
|
]),
|
|
50
50
|
_: 1
|
|
51
51
|
})
|
|
52
52
|
]),
|
|
53
|
-
contentList:
|
|
53
|
+
contentList: B(() => [
|
|
54
54
|
(h(!0), b(Y, null, fe(e.items, (n) => (h(), C(me, {
|
|
55
55
|
class: X({
|
|
56
56
|
"top-active": o.value?.includes(n.value)
|
|
@@ -59,7 +59,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
59
59
|
title: n.title,
|
|
60
60
|
onClick: () => o.value = [n.value]
|
|
61
61
|
}, {
|
|
62
|
-
default:
|
|
62
|
+
default: B(() => [
|
|
63
63
|
oe("span", tt, V(n.content), 1)
|
|
64
64
|
]),
|
|
65
65
|
_: 2
|
|
@@ -83,7 +83,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
83
83
|
title: r.url + ` [${r.id}]`,
|
|
84
84
|
icon: r.id === ve(a) ? "" : "",
|
|
85
85
|
content: r.name
|
|
86
|
-
}))),
|
|
86
|
+
}))), j = -1, y = -2, le = -1, ot = {
|
|
87
87
|
0: "Yandex",
|
|
88
88
|
1: "Google",
|
|
89
89
|
4: "YouTube",
|
|
@@ -183,7 +183,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
183
183
|
};
|
|
184
184
|
l.set(n.value, n);
|
|
185
185
|
const d = {
|
|
186
|
-
value:
|
|
186
|
+
value: j,
|
|
187
187
|
title: o.Common.Compare
|
|
188
188
|
};
|
|
189
189
|
l.set(d.value, d);
|
|
@@ -220,7 +220,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
220
220
|
l.set(n.index, f);
|
|
221
221
|
}), l;
|
|
222
222
|
});
|
|
223
|
-
return
|
|
223
|
+
return T(r, (l, n) => {
|
|
224
224
|
if (e.onlySearcher || t.value !== void 0 && l.get(t.value))
|
|
225
225
|
return;
|
|
226
226
|
let d = l.keys().next().value;
|
|
@@ -266,7 +266,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
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 T(t, () => {
|
|
270
270
|
l();
|
|
271
271
|
}), e.addCompare && r(), {
|
|
272
272
|
regionsIndexes: t
|
|
@@ -280,8 +280,8 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
280
280
|
});
|
|
281
281
|
}), i;
|
|
282
282
|
}), r = ut(e, a), l = st(e, o), n = ct(e, a, t);
|
|
283
|
-
|
|
284
|
-
if (e.onlySearcher ? n.regionsIndexes.value = Array.from(a.value.keys()) : n.regionsIndexes.value = n.regionsIndexes.value.filter((m) => t.value.has(m)), r.searcherKey.value ===
|
|
283
|
+
T(a, () => {
|
|
284
|
+
if (e.onlySearcher ? n.regionsIndexes.value = Array.from(a.value.keys()) : n.regionsIndexes.value = n.regionsIndexes.value.filter((m) => t.value.has(m)), r.searcherKey.value === j) return;
|
|
285
285
|
let i = a.value.keys().next().value;
|
|
286
286
|
a.value.forEach((m) => {
|
|
287
287
|
if (e.onlySearcher && m.key === r.searcherKey.value) {
|
|
@@ -297,7 +297,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
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
299
|
const d = () => {
|
|
300
|
-
if (!(r.searcherKey.value ===
|
|
300
|
+
if (!(r.searcherKey.value === j || r.searcherKey.value === y))
|
|
301
301
|
return r.searcherKey.value;
|
|
302
302
|
}, c = () => {
|
|
303
303
|
if (e.onlySearcher || l.regionIndex.value === y) return;
|
|
@@ -325,7 +325,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
325
325
|
return f()?.regionByIndex?.get(i);
|
|
326
326
|
}
|
|
327
327
|
};
|
|
328
|
-
}, Dt = /* @__PURE__ */
|
|
328
|
+
}, Dt = /* @__PURE__ */ L({
|
|
329
329
|
__name: "regionSelector",
|
|
330
330
|
props: /* @__PURE__ */ M({
|
|
331
331
|
projectId: {},
|
|
@@ -367,17 +367,17 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
367
367
|
"@update:regionsIndexes": (s) => d.regionsIndexes.value = s
|
|
368
368
|
});
|
|
369
369
|
};
|
|
370
|
-
return
|
|
371
|
-
if (l.searcherKey.value ===
|
|
370
|
+
return T([n.regionIndex, l.searcherKey, d.regionsIndexes], () => {
|
|
371
|
+
if (l.searcherKey.value === j && d.regionsIndexes.value.length) {
|
|
372
372
|
if (JSON.stringify(t.value) === JSON.stringify(d.regionsIndexes.value))
|
|
373
373
|
return;
|
|
374
374
|
t.value = [...d.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
377
|
!o.onlySearcher && !f.value.size && (l.searcherKey.value = y);
|
|
378
|
-
}), r.value &&
|
|
378
|
+
}), r.value && T(r, () => {
|
|
379
379
|
r.value && (t.value = [r.value]);
|
|
380
|
-
}, { immediate: !0 }),
|
|
380
|
+
}, { immediate: !0 }), T(t, () => {
|
|
381
381
|
if (t.value[0] && (r.value = t.value[0]), o.onlySearcher) {
|
|
382
382
|
if (!t.value.length || t.value.length === 1 && !c.value.has(t.value[0]) || t.value.length === 1 && t.value[0] === y && !o.autoRegion) {
|
|
383
383
|
let u = c.value.keys().next().value;
|
|
@@ -412,12 +412,12 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
412
412
|
l.searcherKey.value = t.value[0];
|
|
413
413
|
return;
|
|
414
414
|
}
|
|
415
|
-
l.searcherKey.value =
|
|
415
|
+
l.searcherKey.value = j;
|
|
416
416
|
return;
|
|
417
417
|
} else {
|
|
418
418
|
if (!t.value.length)
|
|
419
419
|
return;
|
|
420
|
-
if (t.value.length === 1 && l.searcherKey.value !==
|
|
420
|
+
if (t.value.length === 1 && l.searcherKey.value !== j) {
|
|
421
421
|
n.regionIndex.value = t.value[0];
|
|
422
422
|
let u;
|
|
423
423
|
for (const s of c.value.values()) {
|
|
@@ -431,7 +431,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
431
431
|
}
|
|
432
432
|
u !== void 0 && (l.searcherKey.value = u);
|
|
433
433
|
} else
|
|
434
|
-
l.searcherKey.value =
|
|
434
|
+
l.searcherKey.value = j, d.regionsIndexes.value = [...t.value];
|
|
435
435
|
}
|
|
436
436
|
}, { immediate: !0 }), a({
|
|
437
437
|
getSearcher: I,
|
|
@@ -442,14 +442,14 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
442
442
|
"top-selectorRegion-onlySearcher": e.onlySearcher
|
|
443
443
|
})
|
|
444
444
|
}, [
|
|
445
|
-
|
|
445
|
+
R(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),
|
|
449
449
|
name: "searcher_key",
|
|
450
450
|
addChanger: e.addChanger
|
|
451
451
|
}, null, 8, ["options", "modelValue", "addChanger"]),
|
|
452
|
-
!e.onlySearcher && v(l).searcherKey.value !== v(
|
|
452
|
+
!e.onlySearcher && v(l).searcherKey.value !== v(j) ? (h(), C(se, {
|
|
453
453
|
key: 0,
|
|
454
454
|
class: "top-select-region",
|
|
455
455
|
options: v(n).optionByRegionIndex.value,
|
|
@@ -459,13 +459,13 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
|
|
|
459
459
|
addChanger: e.addChanger,
|
|
460
460
|
"data-top-icon": e.addRegionIcon ? "" : void 0
|
|
461
461
|
}, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : O("", !0),
|
|
462
|
-
e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(
|
|
462
|
+
e.addCompare && !e.onlySearcher && v(l).searcherKey.value === v(j) ? (h(), C(H, {
|
|
463
463
|
key: 1,
|
|
464
464
|
name: "compare",
|
|
465
465
|
onClick: m,
|
|
466
466
|
"data-count-compare-regions-indexes": v(d).regionsIndexes.value.length
|
|
467
467
|
}, {
|
|
468
|
-
default:
|
|
468
|
+
default: B(() => [
|
|
469
469
|
z(V(u.$i18n.Common.Selected_regions), 1)
|
|
470
470
|
]),
|
|
471
471
|
_: 1
|
|
@@ -487,7 +487,7 @@ const Oe = (e, a, o = /* @__PURE__ */ new Map(), t = { id: "root" }, r = 0) => (
|
|
|
487
487
|
l = { ...l }, t.childsIds.push(l.id), l.id === 0 && (l.name = Ke(a));
|
|
488
488
|
const n = r > 1 ? "-".repeat(r - 1) + " " : "";
|
|
489
489
|
n && !l.name.startsWith(n) && (l.name = n + l.name), o.set(l.id, l), Oe(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 }), vt = /* @__PURE__ */
|
|
490
|
+
}), o), mt = (e) => e.gen("/get/keywords_2/folders/", ["id", "parent_id", "name", "path"]).changeParams({ orders: ["ord_path"], limit: 100 }), vt = /* @__PURE__ */ L({
|
|
491
491
|
__name: "folders",
|
|
492
492
|
props: /* @__PURE__ */ M({
|
|
493
493
|
folderId: {},
|
|
@@ -507,7 +507,7 @@ const Oe = (e, a, o = /* @__PURE__ */ new Map(), t = { id: "root" }, r = 0) => (
|
|
|
507
507
|
emits: ["update:folderId", "update:folder"],
|
|
508
508
|
setup(e) {
|
|
509
509
|
const a = e, o = A(e, "folderId"), t = A(e, "folder"), r = a.client && !a.folders ? mt(a.client) : void 0, l = G(null);
|
|
510
|
-
|
|
510
|
+
T(() => a.projectId, () => {
|
|
511
511
|
r?.changeParams({
|
|
512
512
|
project_id: a.projectId
|
|
513
513
|
}), r?.setOptions({
|
|
@@ -515,12 +515,12 @@ const Oe = (e, a, o = /* @__PURE__ */ new Map(), t = { id: "root" }, r = 0) => (
|
|
|
515
515
|
}), l.value?.resetCache();
|
|
516
516
|
}, { immediate: !0 });
|
|
517
517
|
const n = E(() => Oe(a.folders ?? { root: [N] }, a.canSelectAll));
|
|
518
|
-
return
|
|
518
|
+
return T(o, () => {
|
|
519
519
|
a.folders && (n.value.get(a.folderId) || (o.value = 0));
|
|
520
|
-
}, { immediate: !0 }),
|
|
520
|
+
}, { immediate: !0 }), T(o, () => {
|
|
521
521
|
const d = n.value.get(a.folderId);
|
|
522
522
|
d && (t.value = d);
|
|
523
|
-
}),
|
|
523
|
+
}), T(t, () => {
|
|
524
524
|
o.value = t.value.id;
|
|
525
525
|
}), (d, c) => (h(), C(Ve, {
|
|
526
526
|
class: "top-groupSelector_folder",
|
|
@@ -538,7 +538,7 @@ const Oe = (e, a, o = /* @__PURE__ */ new Map(), t = { id: "root" }, r = 0) => (
|
|
|
538
538
|
});
|
|
539
539
|
function Se(e, a, o) {
|
|
540
540
|
const t = Object.keys(e), r = t.map((l) => e[l]);
|
|
541
|
-
return
|
|
541
|
+
return T(r, (l, n, d) => {
|
|
542
542
|
const c = {};
|
|
543
543
|
l.forEach((f, I) => {
|
|
544
544
|
if (!Object.is(f, n[I])) {
|
|
@@ -561,13 +561,13 @@ const ce = {
|
|
|
561
561
|
name: "All groups",
|
|
562
562
|
folder_id: N.id,
|
|
563
563
|
folder_path: N.path
|
|
564
|
-
}, W = () => (ne.name = w()?.Common.All_groups, ne),
|
|
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 && a.childsIds && (e = e.filter((o) => o.folder_id === a.id || a.childsIds.includes(o.folder_id))), e), xe = (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
565
|
key: 0,
|
|
566
566
|
class: "top-comment"
|
|
567
567
|
}, St = {
|
|
568
568
|
key: 1,
|
|
569
569
|
class: "top-groupSelector_groupItemFolderPath"
|
|
570
|
-
}, xt = /* @__PURE__ */
|
|
570
|
+
}, xt = /* @__PURE__ */ L({
|
|
571
571
|
__name: "groups",
|
|
572
572
|
props: /* @__PURE__ */ M({
|
|
573
573
|
groupId: {},
|
|
@@ -612,7 +612,7 @@ const ce = {
|
|
|
612
612
|
o.folder?.id ?? 0
|
|
613
613
|
], o.groups && (f.value = pt(o.groups, o.folder))), c.value?.resetCache(), (u.folderId?.old !== void 0 || u.canSelectAll?.old !== void 0) && r.value !== de) {
|
|
614
614
|
let s;
|
|
615
|
-
o.autoselect === "first" && (s = f.value?.[0], o.canSelectAll && (s =
|
|
615
|
+
o.autoselect === "first" && (s = f.value?.[0], o.canSelectAll && (s = Te(W()))), (o.autoselect === "placeholder" || !s) && (s = je()), i(s);
|
|
616
616
|
}
|
|
617
617
|
}, { immediate: !0 }), Se({
|
|
618
618
|
modelGroup: l,
|
|
@@ -678,7 +678,7 @@ const ce = {
|
|
|
678
678
|
useCache: "",
|
|
679
679
|
onAppendItem: m
|
|
680
680
|
}, {
|
|
681
|
-
item:
|
|
681
|
+
item: B(({ item: g }) => [
|
|
682
682
|
oe("div", ht, [
|
|
683
683
|
g.id === v(de) ? (h(), b("div", It, V(u.$i18n.Common.Add) + ": ", 1)) : O("", !0),
|
|
684
684
|
oe("span", null, V(g.name), 1),
|
|
@@ -688,7 +688,7 @@ const ce = {
|
|
|
688
688
|
_: 1
|
|
689
689
|
}, 8, ["modelValue", "items", "icon", "api", "apiSetSearchParams", "appendSearchToResult", "useAllItem", "addChanger"]));
|
|
690
690
|
}
|
|
691
|
-
}), kt = { class: "top-groupSelector" }, qt = /* @__PURE__ */
|
|
691
|
+
}), kt = { class: "top-groupSelector" }, qt = /* @__PURE__ */ L({
|
|
692
692
|
__name: "groupSelector",
|
|
693
693
|
props: /* @__PURE__ */ M({
|
|
694
694
|
folderId: {},
|
|
@@ -718,7 +718,7 @@ const ce = {
|
|
|
718
718
|
setup(e, { emit: a }) {
|
|
719
719
|
const o = e, t = A(e, "folderId"), r = A(e, "groupId"), l = A(e, "group"), n = a, d = G(ft(o.folders, o.canSelectAllGroups));
|
|
720
720
|
let c = o.groups?.find((I) => I.id === r.value);
|
|
721
|
-
r.value || (c = o.groups?.[0]), o.canSelectAllGroups && !c && (c = W()), o.canSelectAllGroups && !c && (c = W()), (o.autoselect === "placeholder" || !c) && (c =
|
|
721
|
+
r.value || (c = o.groups?.[0]), o.canSelectAllGroups && !c && (c = W()), o.canSelectAllGroups && !c && (c = W()), (o.autoselect === "placeholder" || !c) && (c = je()), c ??= ce, l.value ??= c;
|
|
722
722
|
const f = (I) => {
|
|
723
723
|
let i;
|
|
724
724
|
o.groups && I && (i = [...o.groups, I]), n("update:groups", i);
|
|
@@ -773,10 +773,10 @@ const ce = {
|
|
|
773
773
|
filters: e.filters,
|
|
774
774
|
payload: e.payload
|
|
775
775
|
};
|
|
776
|
-
J(t, "topTagSelectorTarget", n), delete t.dataset.topPopupDisabled, pe(e.modelValue) ||
|
|
776
|
+
J(t, "topTagSelectorTarget", n), delete t.dataset.topPopupDisabled, pe(e.modelValue) || T(l, () => {
|
|
777
777
|
e.modelValue = l.value, te(t, e, o);
|
|
778
778
|
}), t.click();
|
|
779
|
-
}, pe(e.modelValue) ?
|
|
779
|
+
}, pe(e.modelValue) ? T(e.modelValue, () => te(t, e, o)) : J(t, "topTagSelectorRender", (r) => {
|
|
780
780
|
e.modelValue = r;
|
|
781
781
|
const l = J(t, "topTagSelectorTarget");
|
|
782
782
|
l && (l.model.value = r), te(t, e, o);
|
|
@@ -861,7 +861,7 @@ const ce = {
|
|
|
861
861
|
name: "Turquoise",
|
|
862
862
|
color_id: "10"
|
|
863
863
|
}
|
|
864
|
-
],
|
|
864
|
+
], Bt = ["data-tag_id", "data-tag_color_id", "title"], ge = /* @__PURE__ */ L({
|
|
865
865
|
__name: "tagIcon",
|
|
866
866
|
props: {
|
|
867
867
|
id: {},
|
|
@@ -879,9 +879,9 @@ const ce = {
|
|
|
879
879
|
"data-tag_id": e.id,
|
|
880
880
|
"data-tag_color_id": e.colorId,
|
|
881
881
|
title: e.name
|
|
882
|
-
}, null, 10,
|
|
882
|
+
}, null, 10, Bt));
|
|
883
883
|
}
|
|
884
|
-
}),
|
|
884
|
+
}), Tt = ["contenteditable", "onKeydown"], Be = /* @__PURE__ */ L({
|
|
885
885
|
__name: "tagPopupListItem",
|
|
886
886
|
props: /* @__PURE__ */ M({
|
|
887
887
|
editable: { type: Boolean },
|
|
@@ -903,7 +903,7 @@ const ce = {
|
|
|
903
903
|
contenteditable: d.value,
|
|
904
904
|
onpaste: (m) => m.preventDefault()
|
|
905
905
|
} : {}), d = G(!1), c = async () => {
|
|
906
|
-
d.value = !0, await
|
|
906
|
+
d.value = !0, await Re(), l.value?.focus();
|
|
907
907
|
}, f = () => {
|
|
908
908
|
const m = l.value?.innerText;
|
|
909
909
|
if (!m) return I();
|
|
@@ -926,8 +926,8 @@ const ce = {
|
|
|
926
926
|
}),
|
|
927
927
|
onClick: F(i, ["stop"])
|
|
928
928
|
}, {
|
|
929
|
-
default:
|
|
930
|
-
|
|
929
|
+
default: B(() => [
|
|
930
|
+
R(ge, {
|
|
931
931
|
id: e.id,
|
|
932
932
|
name: r.value,
|
|
933
933
|
colorId: e.colorId,
|
|
@@ -943,7 +943,7 @@ const ce = {
|
|
|
943
943
|
ye(F(f, ["stop"]), ["enter"]),
|
|
944
944
|
ye(F(I, ["stop"]), ["esc"])
|
|
945
945
|
]
|
|
946
|
-
}), V(r.value), 17,
|
|
946
|
+
}), V(r.value), 17, Tt),
|
|
947
947
|
e.editable ? (h(), b(Y, { key: 0 }, [
|
|
948
948
|
d.value ? (h(), b("span", {
|
|
949
949
|
key: 1,
|
|
@@ -961,7 +961,7 @@ const ce = {
|
|
|
961
961
|
_: 1
|
|
962
962
|
}, 8, ["class"]));
|
|
963
963
|
}
|
|
964
|
-
}), At = { key: 1 }, bt = /* @__PURE__ */
|
|
964
|
+
}), At = { key: 1 }, bt = /* @__PURE__ */ L({
|
|
965
965
|
inheritAttrs: !1,
|
|
966
966
|
__name: "popupOpener",
|
|
967
967
|
props: /* @__PURE__ */ M({
|
|
@@ -992,7 +992,7 @@ const ce = {
|
|
|
992
992
|
return (n, d) => {
|
|
993
993
|
const c = Ne("top-data");
|
|
994
994
|
return h(), C(ze, { id: e.id }, {
|
|
995
|
-
default:
|
|
995
|
+
default: B(() => [
|
|
996
996
|
Pe((h(), C(De(v(t)), Ae({
|
|
997
997
|
class: {
|
|
998
998
|
"top-tagSelector": !0,
|
|
@@ -1008,7 +1008,7 @@ const ce = {
|
|
|
1008
1008
|
color: "theme",
|
|
1009
1009
|
styling: e.styling
|
|
1010
1010
|
}, n.$attrs), {
|
|
1011
|
-
[v(r)]:
|
|
1011
|
+
[v(r)]: B(() => [
|
|
1012
1012
|
!o.value.length && e.mode === "filter" ? (h(), C(ge, {
|
|
1013
1013
|
key: 0,
|
|
1014
1014
|
id: "all",
|
|
@@ -1034,7 +1034,7 @@ const ce = {
|
|
|
1034
1034
|
}, 8, ["id"]);
|
|
1035
1035
|
};
|
|
1036
1036
|
}
|
|
1037
|
-
}), _t = /* @__PURE__ */
|
|
1037
|
+
}), _t = /* @__PURE__ */ L({
|
|
1038
1038
|
__name: "tagSelector",
|
|
1039
1039
|
props: /* @__PURE__ */ M({
|
|
1040
1040
|
modelValue: {},
|
|
@@ -1054,7 +1054,7 @@ const ce = {
|
|
|
1054
1054
|
},
|
|
1055
1055
|
modelModifiers: {},
|
|
1056
1056
|
tags: {
|
|
1057
|
-
default:
|
|
1057
|
+
default: Te(Ct)
|
|
1058
1058
|
},
|
|
1059
1059
|
tagsModifiers: {}
|
|
1060
1060
|
}),
|
|
@@ -1075,7 +1075,7 @@ const ce = {
|
|
|
1075
1075
|
filters: void 0,
|
|
1076
1076
|
payload: void 0
|
|
1077
1077
|
});
|
|
1078
|
-
|
|
1078
|
+
T(r, () => {
|
|
1079
1079
|
d("selector", r.value);
|
|
1080
1080
|
});
|
|
1081
1081
|
const m = E(() => {
|
|
@@ -1137,11 +1137,11 @@ const ce = {
|
|
|
1137
1137
|
}), d("tagsChanged", l.value);
|
|
1138
1138
|
}
|
|
1139
1139
|
});
|
|
1140
|
-
},
|
|
1140
|
+
}, Le = (p) => {
|
|
1141
1141
|
_.$?.ui.sortable && $(p.elPopup).data("ui-sortable") && $(p.elPopup).sortable("destroy");
|
|
1142
1142
|
};
|
|
1143
1143
|
return (p, S) => (h(), b(Y, null, [
|
|
1144
|
-
|
|
1144
|
+
R(bt, {
|
|
1145
1145
|
modelValue: r.value,
|
|
1146
1146
|
"onUpdate:modelValue": S[0] || (S[0] = (x) => r.value = x),
|
|
1147
1147
|
id: v(c),
|
|
@@ -1150,15 +1150,15 @@ const ce = {
|
|
|
1150
1150
|
mode: "filter",
|
|
1151
1151
|
useTopButton: e.useTopButton
|
|
1152
1152
|
}, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
|
|
1153
|
-
|
|
1153
|
+
R(be, {
|
|
1154
1154
|
id: v(c),
|
|
1155
1155
|
class: X(g.value),
|
|
1156
1156
|
onOpen: S[4] || (S[4] = (x) => P(x)),
|
|
1157
|
-
onClose: S[5] || (S[5] = (x) =>
|
|
1157
|
+
onClose: S[5] || (S[5] = (x) => Le(x)),
|
|
1158
1158
|
"transition-duration": 50
|
|
1159
1159
|
}, Fe({
|
|
1160
|
-
contentList:
|
|
1161
|
-
v(i).mode === "filter" && !e.singleMode ? (h(), C(
|
|
1160
|
+
contentList: B(() => [
|
|
1161
|
+
v(i).mode === "filter" && !e.singleMode ? (h(), C(Be, {
|
|
1162
1162
|
key: 0,
|
|
1163
1163
|
id: "all",
|
|
1164
1164
|
colorId: "",
|
|
@@ -1166,7 +1166,7 @@ const ce = {
|
|
|
1166
1166
|
state: v(i).model.value.length ? "" : "selected",
|
|
1167
1167
|
onSelect: S[3] || (S[3] = (x) => v(i).model.value = [])
|
|
1168
1168
|
}, null, 8, ["name", "state"])) : O("", !0),
|
|
1169
|
-
(h(!0), b(Y, null, fe(l.value, (x) => (h(), C(
|
|
1169
|
+
(h(!0), b(Y, null, fe(l.value, (x) => (h(), C(Be, {
|
|
1170
1170
|
key: x.id,
|
|
1171
1171
|
id: x.id,
|
|
1172
1172
|
colorId: x.color_id,
|
|
@@ -1187,7 +1187,7 @@ const ce = {
|
|
|
1187
1187
|
"data-top-icon": "",
|
|
1188
1188
|
onClick: F(Z, ["stop"])
|
|
1189
1189
|
}, {
|
|
1190
|
-
default:
|
|
1190
|
+
default: B(() => [
|
|
1191
1191
|
z(V(p.$i18n.Common.Add), 1)
|
|
1192
1192
|
]),
|
|
1193
1193
|
_: 1
|
|
@@ -1197,8 +1197,8 @@ const ce = {
|
|
|
1197
1197
|
}, [
|
|
1198
1198
|
v(i).mode === "setter" && v(i).filters ? {
|
|
1199
1199
|
name: "header",
|
|
1200
|
-
fn:
|
|
1201
|
-
|
|
1200
|
+
fn: B(() => [
|
|
1201
|
+
R(se, {
|
|
1202
1202
|
modelValue: f.value,
|
|
1203
1203
|
"onUpdate:modelValue": S[1] || (S[1] = (x) => f.value = x),
|
|
1204
1204
|
options: I()
|
|
@@ -1208,14 +1208,14 @@ const ce = {
|
|
|
1208
1208
|
} : void 0,
|
|
1209
1209
|
v(i).mode === "setter" && v(i).filters ? {
|
|
1210
1210
|
name: "footer",
|
|
1211
|
-
fn:
|
|
1212
|
-
|
|
1213
|
-
default:
|
|
1211
|
+
fn: B(() => [
|
|
1212
|
+
R(H, { color: "theme" }, {
|
|
1213
|
+
default: B(() => [
|
|
1214
1214
|
z(V(p.$i18n.Common.Cancel), 1)
|
|
1215
1215
|
]),
|
|
1216
1216
|
_: 1
|
|
1217
1217
|
}),
|
|
1218
|
-
|
|
1218
|
+
R(H, {
|
|
1219
1219
|
onClick: S[2] || (S[2] = (x) => v(d)("setter", {
|
|
1220
1220
|
tagsIds: v(i).model.value,
|
|
1221
1221
|
filters: v(i).filters,
|
|
@@ -1223,7 +1223,7 @@ const ce = {
|
|
|
1223
1223
|
payload: v(i).payload
|
|
1224
1224
|
}))
|
|
1225
1225
|
}, {
|
|
1226
|
-
default:
|
|
1226
|
+
default: B(() => [
|
|
1227
1227
|
z(V(f.value === "add" ? p.$i18n.Common.Add : "") + " " + V(f.value === "replace" ? p.$i18n.Common.Replace : "") + " " + V(f.value === "delete" ? p.$i18n.Common.Delete : ""), 1)
|
|
1228
1228
|
]),
|
|
1229
1229
|
_: 1
|
|
@@ -1239,8 +1239,6 @@ export {
|
|
|
1239
1239
|
Nt as TopCompetitorSelector,
|
|
1240
1240
|
qt as TopGroupSelector,
|
|
1241
1241
|
Dt as TopRegionSelector,
|
|
1242
|
-
Nt as TopSelectorCompetitors,
|
|
1243
|
-
Dt as TopSelectorRegion,
|
|
1244
1242
|
_t as TopTagSelector,
|
|
1245
1243
|
bt as TopTagSelectorPopupOpener,
|
|
1246
1244
|
ge as TopTagSelectorTagIcon,
|
|
@@ -8,13 +8,3 @@ export { genElPopupOpener as genElTopTagSelectorPopupOpener, renderElPopupOpener
|
|
|
8
8
|
export { default as TopTagSelector } from './tagSelector/tagSelector.vue';
|
|
9
9
|
export { default as TopTagSelectorPopupOpener } from './tagSelector/popupOpener/popupOpener.vue';
|
|
10
10
|
export { default as TopTagSelectorTagIcon } from './tagSelector/tagIcon/tagIcon.vue';
|
|
11
|
-
export {
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated
|
|
14
|
-
*/
|
|
15
|
-
default as TopSelectorCompetitors, } from './competitorSelector/competitorSelector.vue';
|
|
16
|
-
export {
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated
|
|
19
|
-
*/
|
|
20
|
-
default as TopSelectorRegion, } from './regionSelector/regionSelector.vue';
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
define(["require","exports","vue","./forms--2-YQeWM.amd","./popupHint.vue_vue_type_style_index_0_lang-D42xEF-j.amd","./widgetInput.vue_vue_type_script_setup_true_lang-B3soLr2U.amd","../utils/keyboard.amd","./field-Cvv0SRcJ.amd","../require/css.amd!../assets/policy.css"],(function(te,L,e,w,E,$,R,q){"use strict";if(typeof e>"u")var e=window.Vue;const K={key:0,class:"top-menu_selectAll"},W=e.defineComponent({__name:"menu",props:e.mergeModels({modelValue:{},items:{},isMultiple:{type:Boolean},canBeEmptyMultiple:{type:Boolean},styling:{default:"default"},selectAllItem:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(t){const a=t,n=e.useModel(t,"modelValue"),l=e.ref();!a.isMultiple&&typeof n.value!="string"&&typeof n.value!="number"&&console.warn('Type check failed for prop "modelValue". Expected String: '+typeof n.value),a.isMultiple&&!Array.isArray(n.value)&&console.warn('Type check failed for prop "modelValue". Expected Array: '+typeof n.value),a.isMultiple&&!a.canBeEmptyMultiple&&Array.isArray(n.value)&&!n.value.length&&a.items[0]&&(n.value=[a.items[0]?.href??a.items[0]?.value]);const c=o=>Array.isArray(n.value)?n.value.includes(o.value):o.value===n.value,C=(o,m=!1)=>{if(Array.isArray(n.value)){let i=n.value.slice();if(m){i.length||(i=a.items.map(h=>h.value));const g=i.indexOf(o.value);g===-1?i.push(o.value):i.splice(g,1)}else i.length===1&&i[0]===o.value?i=[]:i=[o.value];!a.canBeEmptyMultiple&&!i.length&&(i=[o.value]),n.value=i;return}n.value=o.value},d=o=>{if(l.value.scrollWidth<=l.value.offsetWidth||o.shiftKey||Math.abs(o.deltaY)<50)return;o.preventDefault();const m=o.deltaY>0?30:-30;l.value.scrollLeft=l.value.scrollLeft+m},f=(o=!0)=>{const m=l.value.querySelector(".top-active");if(!m)return;const i=24,g=m.offsetLeft-l.value.offsetLeft-i,h=m.offsetLeft-l.value.offsetLeft+m.clientWidth+i,y=l.value.scrollLeft,S=l.value.clientWidth+l.value.scrollLeft;let k;g<y&&(k=g),h>S&&(k=h-l.value.clientWidth),k!==void 0&&(w.isSafari()?w.Core.$?.(l.value).animate({scrollLeft:k},o?200:0):l.value.scrollTo({left:k,behavior:o?"smooth":"auto"}))},r=()=>{if(Array.isArray(n.value)){if(n.value.length===a.items.length){n.value=[a.items[0].href??a.items[0].value];return}n.value=a.items.map(o=>o.href??o.value)}};return e.onMounted(()=>f(!1)),e.onUpdated(()=>f(!0)),(o,m)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"el",ref:l,class:e.normalizeClass({"top-menu":!0,["top-style_"+t.styling]:!0}),onWheel:d},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.items,i=>(e.openBlock(),e.createBlock(w._sfc_main$1,e.mergeProps({ref_for:!0},i,{class:"top-menu_item",color:"theme",onClick:g=>C(i,g.ctrlKey||g.metaKey),isActive:c(i)}),e.createSlots({_:2},[i.content?{name:"default",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(i.content),1)]),key:"0"}:void 0]),1040,["onClick","isActive"]))),256)),Array.isArray(n.value)&&t.selectAllItem?(e.openBlock(),e.createElementBlock("div",K,[e.createVNode(w._sfc_main$1,e.mergeProps(t.selectAllItem,{class:"top-menu_item",color:"theme",styling:"",onClick:m[0]||(m[0]=i=>r()),isActive:n.value.length===t.items.length}),e.createSlots({_:2},[t.selectAllItem.content?{name:"default",fn:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.selectAllItem.content),1)]),key:"0"}:void 0]),1040,["isActive"])])):e.createCommentVNode("",!0)],34))}}),O={class:"top-selector2_itemMulti top-ellipsis"},z=e.defineComponent({__name:"itemMulti",props:{id:{},name:{}},emits:["delete"],setup(t){return(a,n)=>(e.openBlock(),e.createElementBlock("div",O,[e.createTextVNode(e.toDisplayString(t.name)+" ",1),e.createElementVNode("span",{class:"top-selector2_itemMultiDelete","data-top-icon":"",onClick:n[0]||(n[0]=l=>a.$emit("delete",{id:t.id,name:t.name})),onMousedown:n[1]||(n[1]=e.withModifiers(()=>{},["stop"]))},null,32)]))}}),x=new Map,U=t=>{x.get(t)?.clear()},Y=t=>{const a=window.mo?.user?.id;return JSON.stringify(t.params)+":"+t.url+":"+a},H=(t,a)=>x.get(a)?.get(t),J=(t,a,n)=>{x.has(a)||x.set(a,new Map),x.get(a)?.set(t,n)},j=(t,a,n,l)=>{const c=e.ref([]),C=e.ref(!1),d=e.ref(0);let f="",r;t&&!t.params.limit&&(t.params.limit=100);const o=async()=>{if(!t)return;const h=l?Y(t):void 0;if(h){const k=H(h,t.path);if(k)return t.abortByFingerprint(),k}const y=await t.call();if(y.errors)return;if(!Array.isArray(y.result)){console.warn("Array expected in `res.result`");return}const S=y.result.findIndex(k=>k.id===void 0||k.name===void 0);if(S!==-1){console.warn(`В result[${S}] нет id или name`);return}return h&&J(h,t.path,y),y},m=async h=>{if(!t)return;if(h){if(!r||C.value)return;t.params.offset=r}else t.params.offset=0;a?.(t,f),C.value=!0;const y=await o();C.value=!1,d.value++,y&&(r=y.nextOffset,h?c.value=c.value.concat(y.result):c.value=y.result)},i=w.debounce(()=>m(!1),200);return{apiRequest:t,items:c,isLoading:C,countLoading:d,load:m,setSearchTextAndLoad:(h,y=!0)=>{if(t){if(h.length<n){t.abortByFingerprint(),c.value=[];return}h===f&&c.value.length||(f=h,y?i():m(!1))}}}},V=0,b=null,N=(t,a,n=!0)=>n&&a.id===b?Array.isArray(t)?t.some(l=>l.id===a.id&&l.name===a.name):a.name===t.name:Array.isArray(t)?t.some(l=>l.id===a.id):a.id===t.id,G=(t,a,n)=>{let l=t.params.filters??[];l=l.filter(c=>c.name!==n),a&&l.push(q.genFieldFilter(n,"CONTAINS",[a])),t.changeParams({filters:l})},Q=(t,a,n,l,c,C,d,f,r)=>{const o=e.ref(""),m={id:V,name:w.useI18n().Common.All},i=()=>{o.value=""},g=()=>!(!r.apiRequest||o.value.length>=f),h=e.computed(()=>{const s=[];return!l&&c.value&&(typeof c.value=="string"&&(m.name=c.value),s.push(m)),n.value?.forEach(A=>s.push({...A})),s}),y=e.ref([]),S=()=>{y.value=k()},k=()=>{const s=o.value.toLowerCase(),A=R.invertKeyboardLayout(s);let u=[],T;const I=[],D=()=>{I.at(-1)?.listItemProps?.type==="delimiter"&&I.pop(),I.length&&(T&&u.push(T),u.push(...I),I.length=0)};for(const B of h.value)switch(B.listItemProps?.type){case"title":D(),T=B;break;case"delimiter":if(I.length){let F=I.length;I.at(-1)?.listItemProps?.type==="delimiter"&&F--,I[F]=B}break;default:const M=B.name.toLowerCase();(B.id===Number(s)||M.includes(s)||M.includes(A))&&(M===s||M===A?I.unshift(B):I.push(B))}if(D(),u.push(...r.items.value),C.value&&o.value&&!u.find(B=>B.name.toLowerCase()===s)){const B={id:b,name:o.value};u.push(B)}return l&&(u=u.filter(B=>!N(t.value,B))),u},P=s=>{s.listItemProps?.type==="title"||s.listItemProps?.type==="delimiter"||(l&&Array.isArray(t.value)?N(t.value,s)||(t.value=[...t.value,s]):t.value=s,s.id===b&&a("appendItem",s),setTimeout(()=>{i()}))};if(r.apiRequest){const s=[n,r.items];l&&s.push(t),e.watch(s,()=>{S()})}else e.watch([t,n,o],()=>{S()},{immediate:!0,deep:2});return{searchText:o,resetSearch:i,genIsShort:g,itemsForShow:y,selectItem:P,selectNextItem:()=>{if(Array.isArray(t.value))return;const s=y.value.filter(T=>!["title","delimiter"].includes(T.listItemProps?.type??"")),u=(s.findIndex(T=>T.id===t.value.id)+1)%s.length;t.value={...s[u]}},deleteItemByItem:async s=>{Array.isArray(t.value)&&(t.value=t.value.filter(A=>A.id!==s.id||A.name!==s.name))}}},X={key:0,class:"top-selector2_activeItems"},Z={key:1,class:"top-selector2_activeName top-ellipsis"},_={key:2,class:"top-selector2_placeholder top-ellipsis"},ee=e.defineComponent({__name:"selector2",props:e.mergeModels({modelValue:{},items:{default:()=>[]},title:{},disabled:{type:Boolean},icon:{},modificator:{},size:{default:"s"},isError:{type:Boolean},openByFocusInput:{type:Boolean,default:void 0},searchType:{default:"popup"},placeholder:{},api:{},apiSetSearchParams:{},minLength:{default:0},useCache:{type:Boolean},appendSearchToResult:{type:Boolean},multiselect:{type:Boolean},useAllItem:{type:[Boolean,String]},addChanger:{type:Boolean},buttonProps:{},selectedAsPlaceholder:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:e.mergeModels(["appendItem"],["update:modelValue"]),setup(t,{expose:a,emit:n}){const l=t,c=e.useModel(t,"modelValue"),C=n;a({resetCache:(v=!1)=>{f.apiRequest&&(v&&U(f.apiRequest.path),f.items.value=[],f.countLoading.value=0,f.apiRequest.params.offset=0,requestAnimationFrame(()=>{r.itemsForShow.value=[]}),i()?.elPopup&&f.setSearchTextAndLoad(r.searchText.value))}});const d=e.computed(()=>l.searchType==="inline"&&l.multiselect||l.searchType==="inline"&&w.Core.state.isMobile?"popup":l.searchType),f=j(l.api,l.apiSetSearchParams,l.minLength,l.useCache),r=Q(c,C,e.toRef(l,"items"),l.multiselect,e.toRef(l,"useAllItem"),e.toRef(l,"appendSearchToResult"),d,l.minLength,f),o=e.computed(()=>l.buttonProps?"TopButton":d.value==="inline"?"TopInput":"div"),m=e.ref(null),i=()=>m.value?.popup;f.apiRequest&&e.watch(r.searchText,()=>{f.setSearchTextAndLoad(r.searchText.value)});const g=e.computed(()=>Array.isArray(c.value)||l.multiselect||!l.selectedAsPlaceholder&&d.value!=="inline"?l.placeholder:c.value?.name||l.placeholder),h=v=>{let p=!1;switch(v.key){case"Delete":case"Backspace":Array.isArray(c.value)&&(v.preventDefault(),v.stopPropagation(),c.value.pop());break;case"ArrowUp":case"ArrowRight":case"ArrowDown":case"ArrowLeft":case"Enter":case" ":p=!0;break;case"Escape":d.value==="inline"&&r.resetSearch();break}const s=v.key.length===1&&!v.ctrlKey&&!v.metaKey;(d.value==="popup"||d.value==="inline")&&s&&(p=!0),i()?.elPopup&&(p=!1),p&&(d.value==="popup"&&(v.preventDefault(),v.stopPropagation(),s&&(r.searchText.value||(r.searchText.value=v.key))),v.currentTarget?.click())},y=v=>{v.preventDefault(),r.selectNextItem()},S=()=>{f.apiRequest&&f.setSearchTextAndLoad(r.searchText.value,!1)},k=()=>{d.value==="popup"&&r.searchText.value&&r.resetSearch()},P=v=>{const p=v.target;p.scrollTop/(p.scrollHeight-p.offsetHeight)>.8&&f.load(!0)};return(v,p)=>{const s=e.resolveComponent("TopLoadbar"),A=e.resolveDirective("top-focus");return e.openBlock(),e.createBlock(e.unref(E._sfc_main),{ref_key:"popupRef",ref:m,onOpen:p[3]||(p[3]=u=>S()),onClose:p[4]||(p[4]=u=>k()),onScrollContentList:p[5]||(p[5]=u=>e.unref(f)?P(u):void 0),notch:!1,transitionDuration:0,openByFocusInput:d.value==="inline"&&(t.openByFocusInput??!0),disabled:d.value==="inline"&&e.unref(r).genIsShort()},e.createSlots({opener:e.withCtx(()=>[e.withDirectives((e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),e.mergeProps(t.buttonProps,{class:{"top-selector2":!0,"top-selector2-multiselect":t.multiselect,["top-selector2-"+t.modificator]:!!t.modificator,"top-as-input":!t.buttonProps&&d.value!=="inline","top-as-selector":!0,["top-size_"+t.size]:!0,"top-disabled":t.disabled,"top-forms-focusable":!t.disabled,"top-error":t.isError},icon:t.icon,tabindex:"0",onKeydown:h,onBlur:p[0]||(p[0]=u=>d.value==="inline"&&e.unref(r).resetSearch()),placeholder:g.value,title:t.title,captionType:d.value==="inline"&&t.title!==void 0?"top":void 0,modelValue:e.unref(r).searchText.value,"onUpdate:modelValue":p[1]||(p[1]=u=>e.unref(r).searchText.value=u)}),{default:e.withCtx(()=>[t.multiselect?(e.openBlock(),e.createElementBlock("div",X,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,u=>(e.openBlock(),e.createBlock(z,{id:u.id,name:u.name,onDelete:e.unref(r).deleteItemByItem},null,8,["id","name","onDelete"]))),256))])):e.createCommentVNode("",!0),d.value!=="inline"&&!t.multiselect?(e.openBlock(),e.createElementBlock("span",Z,e.toDisplayString(Array.isArray(c.value)?"":c.value.name),1)):e.createCommentVNode("",!0),t.multiselect&&!c.value.length?(e.openBlock(),e.createElementBlock("span",_,e.toDisplayString(g.value),1)):e.createCommentVNode("",!0),t.addChanger&&!t.buttonProps&&!t.multiselect&&e.unref(r).itemsForShow.value.length>1&&!t.disabled?(e.openBlock(),e.createElementBlock("span",{key:3,class:"top-changer top-changer-selector","data-top-popup-disabled":"true",onClick:y})):e.createCommentVNode("",!0)]),_:1},16,["class","icon","placeholder","title","captionType","modelValue"])),[[A,t.isError,void 0,{onupdate:!0}]])]),contentList:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(r).itemsForShow.value,u=>(e.openBlock(),e.createBlock(e.unref(E._sfc_main$2),e.mergeProps({key:u.id??void 0,class:{"top-active":!Array.isArray(c.value)&&!t.multiselect&&c.value.id===u.id&&c.value.name===u.name}},{ref_for:!0},u.listItemProps,{closeByClick:!t.multiselect||e.unref(w.Core).state.isMobile,onClick:T=>e.unref(r).selectItem(u)}),{default:e.withCtx(()=>[v.$slots.item?e.renderSlot(v.$slots,"item",{key:0,item:u}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(u.name),1)],64))]),_:2},1040,["class","closeByClick","onClick"]))),128)),!e.unref(r).itemsForShow.value.length&&!e.unref(r).genIsShort()?(e.openBlock(),e.createBlock(e.unref(E._sfc_main$2),{key:0,type:"regular"},{default:e.withCtx(()=>[!e.unref(f).isLoading.value||e.unref(f).countLoading.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(v.$i18n.Common.No_results),1)],64)):(e.openBlock(),e.createBlock(e.unref(w._sfc_main$12),{key:1,type:"circles"}))]),_:1})):e.createCommentVNode("",!0),e.unref(f).countLoading.value&&e.unref(f).isLoading.value&&d.value==="inline"?(e.openBlock(),e.createBlock(s,{key:1})):e.createCommentVNode("",!0)]),_:2},[d.value==="popup"?{name:"widget",fn:e.withCtx(()=>[e.withDirectives(e.createVNode(e.unref($._sfc_main),{title:"Поиск",icon:"",modelValue:e.unref(r).searchText.value,"onUpdate:modelValue":p[2]||(p[2]=u=>e.unref(r).searchText.value=u),isLoading:!!e.unref(f).countLoading.value&&e.unref(f).isLoading.value,placeholder:g.value},null,8,["modelValue","isLoading","placeholder"]),[[A,c.value,void 0,{onupdate:!0}]])]),key:"0"}:void 0]),1032,["openByFocusInput","disabled"])}}});L.ITEM_ID_ALL=V,L.ITEM_ID_NEW=b,L._sfc_main=ee,L._sfc_main$1=W,L.apiSetSearchParamsFilter=G}));
|
|
2
|
-
//# sourceMappingURL=policy.vue_vue_type_style_index_0_lang-BUIBGweg.amd.js.map
|