@topvisor/ui 1.4.0-TopGroupSelector.3 → 1.4.0-TopGroupSelector.4

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.
@@ -3,7 +3,7 @@
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 j, mergeModels as M, useModel as A, computed as E, createElementBlock as b, openBlock as h, createBlock as C, unref as v, withCtx as T, Fragment as Y, renderList as fe, normalizeClass as X, createElementVNode as oe, toDisplayString as V, createVNode as L, createTextVNode as z, toValue as ve, ref as G, watch as B, createCommentVNode as O, reactive as Be, isRef as pe, withModifiers as F, mergeProps as Ae, withKeys as ye, nextTick as Le, resolveDirective as Ne, withDirectives as Pe, resolveDynamicComponent as De, renderSlot as qe, shallowRef as Ue, createSlots as Fe } from "vue";
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 T, 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 B, createCommentVNode as O, reactive as Be, 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
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-B61ZEDWr.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__ */ j({
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: {},
@@ -38,7 +38,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
38
38
  return (r, l) => (h(), b("div", et, [
39
39
  v(_).state.isMobile ? (h(), C(be, { key: 0 }, {
40
40
  opener: T(() => [
41
- L(H, {
41
+ R(H, {
42
42
  class: "top-competitorSelector_opener",
43
43
  color: "theme",
44
44
  icon: "",
@@ -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
- }))), R = -1, y = -2, le = -1, ot = {
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: R,
186
+ value: j,
187
187
  title: o.Common.Compare
188
188
  };
189
189
  l.set(d.value, d);
@@ -281,7 +281,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
281
281
  }), i;
282
282
  }), r = ut(e, a), l = st(e, o), n = ct(e, a, t);
283
283
  B(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 === R) return;
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 === R || r.searcherKey.value === y))
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__ */ j({
328
+ }, Dt = /* @__PURE__ */ L({
329
329
  __name: "regionSelector",
330
330
  props: /* @__PURE__ */ M({
331
331
  projectId: {},
@@ -368,7 +368,7 @@ const et = { class: "top-competitorSelector" }, tt = { class: "top-ellipsis1" },
368
368
  });
369
369
  };
370
370
  return B([n.regionIndex, l.searcherKey, d.regionsIndexes], () => {
371
- if (l.searcherKey.value === R && d.regionsIndexes.value.length) {
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];
@@ -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 = R;
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 !== R) {
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,25 +431,25 @@ 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 = R, d.regionsIndexes.value = [...t.value];
434
+ l.searcherKey.value = j, d.regionsIndexes.value = [...t.value];
435
435
  }
436
436
  }, { immediate: !0 }), a({
437
437
  getSearcher: I,
438
438
  getRegion: i
439
439
  }), (u, s) => (h(), b("div", {
440
440
  class: X({
441
- "top-selectorRegion": !0,
442
- "top-selectorRegion-onlySearcher": e.onlySearcher
441
+ "top-regionSelector": !0,
442
+ "top-regionSelector-onlySearcher": e.onlySearcher
443
443
  })
444
444
  }, [
445
- L(se, {
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(R) ? (h(), C(se, {
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,7 +459,7 @@ 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(R) ? (h(), C(H, {
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,
@@ -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__ */ j({
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: {},
@@ -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), Re = () => (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 = {
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__ */ j({
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 = Be(W()))), (o.autoselect === "placeholder" || !s) && (s = Re()), i(s);
615
+ o.autoselect === "first" && (s = f.value?.[0], o.canSelectAll && (s = Be(W()))), (o.autoselect === "placeholder" || !s) && (s = je()), i(s);
616
616
  }
617
617
  }, { immediate: !0 }), Se({
618
618
  modelGroup: l,
@@ -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__ */ j({
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 = Re()), c ??= ce, l.value ??= 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);
@@ -861,7 +861,7 @@ const ce = {
861
861
  name: "Turquoise",
862
862
  color_id: "10"
863
863
  }
864
- ], Tt = ["data-tag_id", "data-tag_color_id", "title"], ge = /* @__PURE__ */ j({
864
+ ], Tt = ["data-tag_id", "data-tag_color_id", "title"], ge = /* @__PURE__ */ L({
865
865
  __name: "tagIcon",
866
866
  props: {
867
867
  id: {},
@@ -881,7 +881,7 @@ const ce = {
881
881
  title: e.name
882
882
  }, null, 10, Tt));
883
883
  }
884
- }), Bt = ["contenteditable", "onKeydown"], Te = /* @__PURE__ */ j({
884
+ }), Bt = ["contenteditable", "onKeydown"], Te = /* @__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 Le(), l.value?.focus();
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();
@@ -927,7 +927,7 @@ const ce = {
927
927
  onClick: F(i, ["stop"])
928
928
  }, {
929
929
  default: T(() => [
930
- L(ge, {
930
+ R(ge, {
931
931
  id: e.id,
932
932
  name: r.value,
933
933
  colorId: e.colorId,
@@ -961,7 +961,7 @@ const ce = {
961
961
  _: 1
962
962
  }, 8, ["class"]));
963
963
  }
964
- }), At = { key: 1 }, bt = /* @__PURE__ */ j({
964
+ }), At = { key: 1 }, bt = /* @__PURE__ */ L({
965
965
  inheritAttrs: !1,
966
966
  __name: "popupOpener",
967
967
  props: /* @__PURE__ */ M({
@@ -1034,7 +1034,7 @@ const ce = {
1034
1034
  }, 8, ["id"]);
1035
1035
  };
1036
1036
  }
1037
- }), _t = /* @__PURE__ */ j({
1037
+ }), _t = /* @__PURE__ */ L({
1038
1038
  __name: "tagSelector",
1039
1039
  props: /* @__PURE__ */ M({
1040
1040
  modelValue: {},
@@ -1137,11 +1137,11 @@ const ce = {
1137
1137
  }), d("tagsChanged", l.value);
1138
1138
  }
1139
1139
  });
1140
- }, je = (p) => {
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
- L(bt, {
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,11 +1150,11 @@ const ce = {
1150
1150
  mode: "filter",
1151
1151
  useTopButton: e.useTopButton
1152
1152
  }, null, 8, ["modelValue", "id", "tags", "styling", "useTopButton"]),
1153
- L(be, {
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) => je(x)),
1157
+ onClose: S[5] || (S[5] = (x) => Le(x)),
1158
1158
  "transition-duration": 50
1159
1159
  }, Fe({
1160
1160
  contentList: T(() => [
@@ -1198,7 +1198,7 @@ const ce = {
1198
1198
  v(i).mode === "setter" && v(i).filters ? {
1199
1199
  name: "header",
1200
1200
  fn: T(() => [
1201
- L(se, {
1201
+ R(se, {
1202
1202
  modelValue: f.value,
1203
1203
  "onUpdate:modelValue": S[1] || (S[1] = (x) => f.value = x),
1204
1204
  options: I()
@@ -1209,13 +1209,13 @@ const ce = {
1209
1209
  v(i).mode === "setter" && v(i).filters ? {
1210
1210
  name: "footer",
1211
1211
  fn: T(() => [
1212
- L(H, { color: "theme" }, {
1212
+ R(H, { color: "theme" }, {
1213
1213
  default: T(() => [
1214
1214
  z(V(p.$i18n.Common.Cancel), 1)
1215
1215
  ]),
1216
1216
  _: 1
1217
1217
  }),
1218
- L(H, {
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,