@topvisor/ui 1.0.8 → 1.0.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/datepicker-Cs3C14z5.amd.js +248 -0
- package/.chunks/datepicker-Cs3C14z5.amd.js.map +1 -0
- package/.chunks/datepicker-LNkS97nF.es.js +290 -0
- package/.chunks/datepicker-LNkS97nF.es.js.map +1 -0
- package/.chunks/forms-BydHEF-k.es.js +1928 -0
- package/.chunks/forms-BydHEF-k.es.js.map +1 -0
- package/.chunks/forms-Cq5zFLsO.amd.js +3 -0
- package/.chunks/forms-Cq5zFLsO.amd.js.map +1 -0
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-B0xTxYZR.amd.js +2 -0
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-B0xTxYZR.amd.js.map +1 -0
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-DinMn3Ud.es.js +174 -0
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-DinMn3Ud.es.js.map +1 -0
- package/.chunks/menu.vue_vue_type_style_index_0_lang-BT-PgdJ5.amd.js +2 -0
- package/.chunks/menu.vue_vue_type_style_index_0_lang-BT-PgdJ5.amd.js.map +1 -0
- package/.chunks/menu.vue_vue_type_style_index_0_lang-C585WUlJ.es.js +109 -0
- package/.chunks/menu.vue_vue_type_style_index_0_lang-C585WUlJ.es.js.map +1 -0
- package/.chunks/{popup-D-G2sXks.es.js → popup-B7AaTfNZ.es.js} +494 -493
- package/.chunks/popup-B7AaTfNZ.es.js.map +1 -0
- package/.chunks/popup-D22VHVHf.amd.js +448 -0
- package/.chunks/popup-D22VHVHf.amd.js.map +1 -0
- package/.chunks/store-CX_6ZXhO.es.js.map +1 -1
- package/.chunks/store-esTid5oI.amd.js.map +1 -1
- package/README.md +86 -86
- package/assets/charts.css +1 -0
- package/assets/core.css +1 -1
- package/assets/forms.css +1 -1
- package/assets/project.css +1 -1
- package/assets/tabsView.css +1 -1
- package/assets/themes/dark.css +1 -1
- package/assets/themes/light.css +1 -1
- package/charts/charts.amd.js +2 -0
- package/charts/charts.amd.js.map +1 -0
- package/charts/charts.d.ts +2 -0
- package/charts/charts.js +120 -0
- package/charts/charts.js.map +1 -0
- package/components/charts/charts.d.ts +3 -0
- package/components/charts/miniChart/miniChart.d.ts +80 -0
- package/components/charts/miniChart/miniChart.vue.d.ts +15 -0
- package/components/charts/miniChart/stories/dummy.d.ts +13 -0
- package/components/charts/miniChart/utils/consts.d.ts +8 -0
- package/components/formsExt/selector2/selector2.vue.d.ts +16 -20
- package/components/popup/alert/alert.vue.d.ts +8 -7
- package/components/popup/confirm/confirm.d.ts +1 -1
- package/components/popup/confirm/confirm.vue.d.ts +8 -7
- package/components/popup/lib/popup.d.ts +1 -1
- package/components/popup/popup/popup.d.ts +8 -4
- package/components/popup/popup/popup.vue.d.ts +8 -8
- package/components/popup/prompt/prompt.d.ts +1 -1
- package/components/popup/prompt/prompt.vue.d.ts +8 -7
- package/components/project/project.d.ts +9 -0
- package/components/project/tagSelector/popupListItem/tagPopupListItem.vue.d.ts +18 -0
- package/components/project/tagSelector/popupListItem/types.d.ts +33 -0
- package/components/project/tagSelector/popupOpener/popupOpener.vue.d.ts +26 -0
- package/components/project/tagSelector/popupOpener/types.d.ts +62 -0
- package/components/project/tagSelector/tagIcon/tagIcon.vue.d.ts +4 -0
- package/components/project/tagSelector/tagIcon/types.d.ts +21 -0
- package/components/project/tagSelector/tagSelector.vue.d.ts +37 -0
- package/components/project/tagSelector/tagsDefaults.d.ts +3 -0
- package/components/project/tagSelector/types.d.ts +138 -0
- package/components/project/tagSelector/utils/el.d.ts +19 -0
- package/components/project/tagSelector/utils/utils.d.ts +14 -0
- package/core/app.amd.js +1 -1
- package/core/app.amd.js.map +1 -1
- package/core/app.js +52 -45
- package/core/app.js.map +1 -1
- package/core/core/core.d.ts +4 -0
- package/core/directives/data.d.ts +10 -0
- package/core/utils/route.d.ts +1 -1
- package/forms/forms.amd.js +1 -1
- package/forms/forms.js +5 -5
- package/forms/helpers.amd.js.map +1 -1
- package/forms/helpers.js.map +1 -1
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.amd.js.map +1 -1
- package/formsExt/formsExt.js +121 -166
- package/formsExt/formsExt.js.map +1 -1
- package/icomoon/Read Me.txt +7 -7
- package/icomoon/Topvisor icons.json +5845 -5845
- package/icomoon/demo-files/demo.css +161 -161
- package/icomoon/demo-files/demo.js +30 -30
- package/icomoon/demo.html +3379 -3379
- package/icomoon/fonts/Topvisor-2.svg +263 -263
- package/icomoon/style.css +740 -740
- package/package.json +37 -37
- package/popup/popup.amd.js +1 -1
- package/popup/popup.amd.js.map +1 -1
- package/popup/popup.js +103 -108
- package/popup/popup.js.map +1 -1
- package/popup/worker.amd.js +1 -1
- package/popup/worker.amd.js.map +1 -1
- package/popup/worker.js +2 -2
- 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 +814 -262
- package/project/project.js.map +1 -1
- package/require/css.amd.js +12 -12
- package/tabs/tabs.amd.js +1 -1
- package/tabs/tabs.amd.js.map +1 -1
- package/tabs/tabs.js +41 -59
- package/tabs/tabs.js.map +1 -1
- package/tabsView/tabsView.amd.js +1 -1
- package/tabsView/tabsView.amd.js.map +1 -1
- package/tabsView/tabsView.js +144 -183
- package/tabsView/tabsView.js.map +1 -1
- package/utils/check.amd.js +1 -1
- package/utils/check.amd.js.map +1 -1
- package/utils/check.js +1 -1
- package/utils/check.js.map +1 -1
- package/utils/clipboard.amd.js.map +1 -1
- package/utils/clipboard.js.map +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/dom.amd.js.map +1 -1
- package/utils/dom.js.map +1 -1
- package/utils/image.amd.js.map +1 -1
- package/utils/image.js.map +1 -1
- package/utils/keyboard.amd.js.map +1 -1
- package/utils/keyboard.js.map +1 -1
- package/utils/lodash.amd.js +1 -1
- package/utils/lodash.js +5 -5
- package/utils/number.amd.js.map +1 -1
- package/utils/number.js.map +1 -1
- package/utils/price.amd.js +1 -1
- package/utils/price.amd.js.map +1 -1
- package/utils/price.js +1 -1
- package/utils/price.js.map +1 -1
- package/utils/route.amd.js +1 -1
- package/utils/route.amd.js.map +1 -1
- package/utils/route.js +15 -15
- package/utils/route.js.map +1 -1
- package/utils/scroll.amd.js.map +1 -1
- package/utils/scroll.js.map +1 -1
- package/utils/searchers.amd.js.map +1 -1
- package/utils/searchers.js.map +1 -1
- package/utils/string.amd.js +1 -1
- package/utils/string.amd.js.map +1 -1
- package/utils/string.js +1 -1
- package/utils/string.js.map +1 -1
- package/utils/system.amd.js.map +1 -1
- package/utils/system.js.map +1 -1
- package/utils/url.amd.js.map +1 -1
- package/utils/url.js.map +1 -1
- package/web-types.json +89 -72
- package/.chunks/datepicker-CRfiJCmp.amd.js +0 -248
- package/.chunks/datepicker-CRfiJCmp.amd.js.map +0 -1
- package/.chunks/datepicker-CugKFVIH.es.js +0 -290
- package/.chunks/datepicker-CugKFVIH.es.js.map +0 -1
- package/.chunks/forms-CHiMZ8vg.es.js +0 -2015
- package/.chunks/forms-CHiMZ8vg.es.js.map +0 -1
- package/.chunks/forms-CjYoXTEQ.amd.js +0 -3
- package/.chunks/forms-CjYoXTEQ.amd.js.map +0 -1
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-Bb7B8CTJ.es.js +0 -174
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-Bb7B8CTJ.es.js.map +0 -1
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-CEF3WDJ_.amd.js +0 -2
- package/.chunks/listItem.vue_vue_type_script_setup_true_lang-CEF3WDJ_.amd.js.map +0 -1
- package/.chunks/menu-CHeV29rC.es.js +0 -118
- package/.chunks/menu-CHeV29rC.es.js.map +0 -1
- package/.chunks/menu-D1lnYuWU.amd.js +0 -2
- package/.chunks/menu-D1lnYuWU.amd.js.map +0 -1
- package/.chunks/popup-C4Tne4qA.amd.js +0 -447
- package/.chunks/popup-C4Tne4qA.amd.js.map +0 -1
- package/.chunks/popup-D-G2sXks.es.js.map +0 -1
- package/.chunks/utils-BOlUthaH.es.js +0 -91
- package/.chunks/utils-BOlUthaH.es.js.map +0 -1
- package/.chunks/utils-x88W55mf.amd.js +0 -2
- package/.chunks/utils-x88W55mf.amd.js.map +0 -1
- package/components/project/utils.d.ts +0 -1
- package/core/core.amd.js +0 -2
- package/core/core.amd.js.map +0 -1
- package/core/core.d.ts +0 -4
- package/core/core.js +0 -6
- package/core/core.js.map +0 -1
- package/project/utils.amd.js +0 -2
- package/project/utils.amd.js.map +0 -1
- package/project/utils.d.ts +0 -2
- package/project/utils.js +0 -6
- package/project/utils.js.map +0 -1
- package/test/themes/themes/dark-positions.amd.js +0 -2
- package/test/themes/themes/dark-positions.amd.js.map +0 -1
- package/test/themes/themes/dark-positions.d.ts +0 -1
- package/test/themes/themes/dark-positions.js +0 -2
- package/test/themes/themes/dark-positions.js.map +0 -1
- package/test/themes/themes/dark.amd.js +0 -2
- package/test/themes/themes/dark.amd.js.map +0 -1
- package/test/themes/themes/dark.d.ts +0 -1
- package/test/themes/themes/dark.js +0 -4
- package/test/themes/themes/dark.js.map +0 -1
- package/test/themes/themes/light-positions.amd.js +0 -2
- package/test/themes/themes/light-positions.amd.js.map +0 -1
- package/test/themes/themes/light-positions.d.ts +0 -1
- package/test/themes/themes/light-positions.js +0 -2
- package/test/themes/themes/light-positions.js.map +0 -1
- package/test/themes/themes/light.amd.js +0 -2
- package/test/themes/themes/light.amd.js.map +0 -1
- package/test/themes/themes/light.d.ts +0 -1
- package/test/themes/themes/light.js +0 -4
- package/test/themes/themes/light.js.map +0 -1
package/project/project.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { Core as ke } from "../core/app.js";
|
|
2
|
+
import { defineComponent as P, mergeModels as O, useModel as q, computed as A, openBlock as I, createElementBlock as w, unref as y, createBlock as b, withCtx as B, createVNode as L, createTextVNode as z, toDisplayString as E, Fragment as Y, renderList as ie, normalizeClass as Q, createElementVNode as ve, ref as D, watch as K, createCommentVNode as F, withModifiers as j, withKeys as de, nextTick as Te, resolveDirective as _e, withDirectives as Be, resolveDynamicComponent as be, mergeProps as Ve, renderSlot as we, reactive as Me, shallowRef as Ee, createSlots as Ke, isRef as ue } from "vue";
|
|
3
|
+
import { e as R, C as J, _ as W, y as re, s as $e } from "../.chunks/forms-BydHEF-k.es.js";
|
|
4
|
+
import { _ as ye, b as se, a as Le } from "../.chunks/listItem.vue_vue_type_script_setup_true_lang-DinMn3Ud.es.js";
|
|
5
|
+
import { _ as Ae } from "../.chunks/menu.vue_vue_type_style_index_0_lang-C585WUlJ.es.js";
|
|
6
|
+
import { getSearcherGIcon as Oe, getLangLabel as Re, getDeviceGIcon as Ne } from "../utils/searchers.js";
|
|
7
|
+
import { storage as G } from "../utils/dom.js";
|
|
8
|
+
import { TopPopupWorker as qe } from "../popup/worker.js";
|
|
9
|
+
const Ce = ["../assets/project.css"].map((e) => import.meta.resolve(e));
|
|
10
|
+
ke.insertCSSLinkToPage(Ce, !0);
|
|
11
|
+
const De = { class: "top-selectorCompetitors" }, Fe = { class: "top-ellipsis1" }, Pe = /* @__PURE__ */ P({
|
|
11
12
|
__name: "selectorCompetitors",
|
|
12
|
-
props: /* @__PURE__ */
|
|
13
|
+
props: /* @__PURE__ */ O({
|
|
13
14
|
modelValue: {},
|
|
14
15
|
items: {},
|
|
15
16
|
showSelectAllItem: { type: Boolean, default: !0 }
|
|
@@ -18,61 +19,61 @@ const ie = { class: "top-selectorCompetitors" }, se = { class: "top-ellipsis1" }
|
|
|
18
19
|
modelModifiers: {}
|
|
19
20
|
}),
|
|
20
21
|
emits: ["update:modelValue"],
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
22
|
+
setup(e) {
|
|
23
|
+
const l = e, i = q(e, "modelValue"), t = A(() => {
|
|
24
|
+
if (l.showSelectAllItem)
|
|
24
25
|
return {
|
|
25
26
|
icon: "",
|
|
26
|
-
title:
|
|
27
|
+
title: R().Common.Select_all,
|
|
27
28
|
value: "all",
|
|
28
29
|
content: ""
|
|
29
30
|
};
|
|
30
31
|
});
|
|
31
|
-
return (
|
|
32
|
-
|
|
33
|
-
opener:
|
|
34
|
-
|
|
32
|
+
return (r, o) => (I(), w("div", De, [
|
|
33
|
+
y(J).state.isMobile ? (I(), b(ye, { key: 0 }, {
|
|
34
|
+
opener: B(() => [
|
|
35
|
+
L(W, {
|
|
35
36
|
class: "top-selectorCompetitors_opener",
|
|
36
37
|
color: "theme",
|
|
37
38
|
icon: "",
|
|
38
39
|
icon2: ""
|
|
39
40
|
}, {
|
|
40
|
-
default:
|
|
41
|
-
var
|
|
41
|
+
default: B(() => {
|
|
42
|
+
var n;
|
|
42
43
|
return [
|
|
43
|
-
|
|
44
|
-
var
|
|
45
|
-
return
|
|
46
|
-
})) == null ? void 0 :
|
|
44
|
+
z(E((n = r.items.find((u) => {
|
|
45
|
+
var m;
|
|
46
|
+
return u.value === ((m = i.value) == null ? void 0 : m[0]);
|
|
47
|
+
})) == null ? void 0 : n.content), 1)
|
|
47
48
|
];
|
|
48
49
|
}),
|
|
49
50
|
_: 1
|
|
50
51
|
})
|
|
51
52
|
]),
|
|
52
|
-
contentList:
|
|
53
|
-
(
|
|
54
|
-
var
|
|
55
|
-
return
|
|
56
|
-
class:
|
|
57
|
-
"top-active": (
|
|
53
|
+
contentList: B(() => [
|
|
54
|
+
(I(!0), w(Y, null, ie(r.items, (n, u) => {
|
|
55
|
+
var m;
|
|
56
|
+
return I(), b(se, {
|
|
57
|
+
class: Q({
|
|
58
|
+
"top-active": (m = i.value) == null ? void 0 : m.includes(n.value)
|
|
58
59
|
}),
|
|
59
|
-
"data-top-icon":
|
|
60
|
-
title:
|
|
61
|
-
onClick: () =>
|
|
60
|
+
"data-top-icon": n.icon,
|
|
61
|
+
title: n.title,
|
|
62
|
+
onClick: () => i.value = [n.value]
|
|
62
63
|
}, {
|
|
63
|
-
default:
|
|
64
|
-
|
|
64
|
+
default: B(() => [
|
|
65
|
+
ve("span", Fe, E(n.content), 1)
|
|
65
66
|
]),
|
|
66
67
|
_: 2
|
|
67
68
|
}, 1032, ["class", "data-top-icon", "title", "onClick"]);
|
|
68
69
|
}), 256))
|
|
69
70
|
]),
|
|
70
71
|
_: 1
|
|
71
|
-
})) : (
|
|
72
|
+
})) : (I(), b(Ae, {
|
|
72
73
|
key: 1,
|
|
73
|
-
modelValue:
|
|
74
|
-
"onUpdate:modelValue":
|
|
75
|
-
items:
|
|
74
|
+
modelValue: i.value,
|
|
75
|
+
"onUpdate:modelValue": o[0] || (o[0] = (n) => i.value = n),
|
|
76
|
+
items: r.items,
|
|
76
77
|
isMultiple: !0,
|
|
77
78
|
styling: "bar",
|
|
78
79
|
canBeEmptyMultiple: !1,
|
|
@@ -80,179 +81,257 @@ const ie = { class: "top-selectorCompetitors" }, se = { class: "top-ellipsis1" }
|
|
|
80
81
|
}, null, 8, ["modelValue", "items", "selectAllItem"]))
|
|
81
82
|
]));
|
|
82
83
|
}
|
|
83
|
-
}),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
84
|
+
}), S = -2, Ue = {
|
|
85
|
+
0: "Yandex",
|
|
86
|
+
1: "Google",
|
|
87
|
+
2: "go.Mail",
|
|
88
|
+
4: "YouTube",
|
|
89
|
+
5: "Bing",
|
|
90
|
+
6: "Yahoo",
|
|
91
|
+
7: "Seznam",
|
|
92
|
+
8: "AppStore",
|
|
93
|
+
9: "GoogleStore",
|
|
94
|
+
20: "Yandex.com",
|
|
95
|
+
21: "Yandex.com.tr"
|
|
96
|
+
}, ee = {
|
|
97
|
+
key: S,
|
|
98
|
+
name: "--",
|
|
99
|
+
index: S
|
|
100
|
+
}, pe = {
|
|
101
|
+
key: S,
|
|
102
|
+
name: "--",
|
|
103
|
+
regions: [ee],
|
|
104
|
+
regionByIndex: /* @__PURE__ */ new Map([[S, ee]])
|
|
105
|
+
}, te = {
|
|
106
|
+
key: S,
|
|
107
|
+
name: "Autoselect",
|
|
108
|
+
index: S
|
|
109
|
+
}, ne = {
|
|
110
|
+
key: S,
|
|
111
|
+
name: "Autoselect",
|
|
112
|
+
regions: [te],
|
|
113
|
+
regionByIndex: /* @__PURE__ */ new Map([[S, te]])
|
|
114
|
+
}, ce = {
|
|
115
|
+
countryCode: "00",
|
|
116
|
+
depth: 1,
|
|
117
|
+
device: 0,
|
|
118
|
+
key: -1,
|
|
119
|
+
index: -1,
|
|
120
|
+
lang: "ru",
|
|
121
|
+
name: "Without region"
|
|
122
|
+
}, je = () => (te.name = R().Common.Autoselect, te), Je = () => (je(), ne.name = R().Common.Autoselect, console.log(ne), ne), ze = () => (ce.name = R().Keywords.Without_region, ce), he = (e = !1, l = !1, i = []) => {
|
|
123
|
+
let t;
|
|
124
|
+
return e ? t = Ge(i) : t = Se(i), l && t.set(S, Je()), t.size || t.set(S, pe), t;
|
|
125
|
+
}, Se = (e, l = !0, i = [], t = !1) => {
|
|
126
|
+
const r = /* @__PURE__ */ new Map();
|
|
127
|
+
return e.forEach((o) => {
|
|
128
|
+
if (!o.enabled || t && typeof o.key == "number" && o.key > 1) return;
|
|
129
|
+
const n = { ...o };
|
|
130
|
+
n.regionByIndex = /* @__PURE__ */ new Map(), o.regions && o.regions.forEach((u) => {
|
|
131
|
+
if (l && !u.enabled) return;
|
|
132
|
+
const m = { ...u };
|
|
133
|
+
n.regionByIndex && n.regionByIndex.set(m.index, m);
|
|
134
|
+
}), !n.regionByIndex.size && !i.length && n.regionByIndex.set(ee.index, ee), typeof n.key == "number" && r.set(n.key, n);
|
|
135
|
+
}), i.forEach((o) => {
|
|
136
|
+
if (r.has(o)) return;
|
|
137
|
+
const n = {
|
|
138
|
+
key: o,
|
|
139
|
+
name: Ue[o],
|
|
140
|
+
regions: [],
|
|
141
|
+
regionByIndex: /* @__PURE__ */ new Map()
|
|
142
|
+
};
|
|
143
|
+
r.set(n.key, n);
|
|
144
|
+
}), r;
|
|
145
|
+
}, Ge = (e) => {
|
|
146
|
+
const l = Se(e, !1, [0, 1], !0);
|
|
147
|
+
if (l.has(2)) {
|
|
148
|
+
const i = l.get(2);
|
|
149
|
+
i && (i.regionByIndex = /* @__PURE__ */ new Map());
|
|
150
|
+
}
|
|
151
|
+
return l.forEach((i) => {
|
|
152
|
+
if (!i.regionByIndex) return;
|
|
153
|
+
const t = { ...ze() };
|
|
154
|
+
i.regionByIndex.set(t.index, t);
|
|
155
|
+
}), l;
|
|
156
|
+
}, Ye = (e, l, i = []) => {
|
|
157
|
+
const t = he(e, !1, i);
|
|
158
|
+
let r;
|
|
159
|
+
return t.forEach((o) => {
|
|
160
|
+
if (!(l.searcher_key !== void 0 && l.searcher_key != o.key) && o.regions && (o.regions.forEach((n) => {
|
|
161
|
+
if (!r && !(l.key !== void 0 && l.key != n.key) && !(l.index !== void 0 && l.index != n.index) && !(!e && (l.lang !== void 0 && l.lang != n.lang || l.device !== void 0 && l.device != n.device)))
|
|
162
|
+
return n.searcher_key = o.key, r = n, !1;
|
|
163
|
+
}), r))
|
|
164
|
+
return !1;
|
|
165
|
+
}), r;
|
|
166
|
+
}, We = (e, l) => {
|
|
167
|
+
const i = R(), t = D(l.value.keys().next().value ?? S), r = A(() => {
|
|
168
|
+
const o = /* @__PURE__ */ new Map();
|
|
169
|
+
if (l.value.forEach((n) => {
|
|
170
|
+
let u = {
|
|
171
|
+
value: n.key,
|
|
172
|
+
title: n.name
|
|
95
173
|
};
|
|
96
|
-
|
|
97
|
-
}),
|
|
98
|
-
const
|
|
174
|
+
e.addSearcherIcon && (u.icon = Oe(n.key)), o.set(n.key, u);
|
|
175
|
+
}), e.addCompare && !o.has(S)) {
|
|
176
|
+
const n = {
|
|
99
177
|
value: "",
|
|
100
178
|
title: "--------------------",
|
|
101
179
|
disabled: !0
|
|
102
180
|
};
|
|
103
|
-
|
|
104
|
-
const
|
|
181
|
+
o.set(n.value, n);
|
|
182
|
+
const u = {
|
|
105
183
|
value: -1,
|
|
106
|
-
title:
|
|
184
|
+
title: i.Common.Compare
|
|
107
185
|
};
|
|
108
|
-
|
|
186
|
+
o.set(u.value, u);
|
|
109
187
|
}
|
|
110
|
-
return
|
|
188
|
+
return o;
|
|
111
189
|
});
|
|
112
190
|
return {
|
|
113
191
|
searcherKey: t,
|
|
114
|
-
optionBySearcherKey:
|
|
192
|
+
optionBySearcherKey: r
|
|
115
193
|
};
|
|
116
|
-
},
|
|
117
|
-
var
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
var
|
|
122
|
-
const
|
|
123
|
-
return (
|
|
124
|
-
let
|
|
125
|
-
if (
|
|
126
|
-
const
|
|
127
|
-
value:
|
|
128
|
-
title:
|
|
194
|
+
}, He = (e, l) => {
|
|
195
|
+
var o, n, u;
|
|
196
|
+
const i = R(), t = D(S);
|
|
197
|
+
e.modelValue.length === 1 && (t.value = e.modelValue[0]), t.value === S && (e.forFrequency ? t.value = ((n = (o = l.value) == null ? void 0 : o.regionByIndex.values().next().value) == null ? void 0 : n.key) ?? S : t.value = ((u = l.value) == null ? void 0 : u.regionByIndex.keys().next().value) ?? S);
|
|
198
|
+
const r = A(() => {
|
|
199
|
+
var g;
|
|
200
|
+
const m = /* @__PURE__ */ new Map();
|
|
201
|
+
return (g = l.value.regionByIndex) == null || g.forEach((f) => {
|
|
202
|
+
let a = f.name;
|
|
203
|
+
if (e.forFrequency) {
|
|
204
|
+
const C = {
|
|
205
|
+
value: f.key,
|
|
206
|
+
title: a
|
|
129
207
|
};
|
|
130
|
-
|
|
208
|
+
m.has(f.key) || m.set(f.key, C);
|
|
131
209
|
return;
|
|
132
210
|
}
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
const
|
|
137
|
-
value:
|
|
138
|
-
title:
|
|
139
|
-
icon:
|
|
211
|
+
f.device && (a += " (" + i.Common["Device_" + f.device] + ")");
|
|
212
|
+
const p = Re(l.value.key || 0, f.lang ?? "");
|
|
213
|
+
p && (a += " / " + p);
|
|
214
|
+
const x = {
|
|
215
|
+
value: f.index,
|
|
216
|
+
title: a,
|
|
217
|
+
icon: f.device ? Ne(f.device) : void 0
|
|
140
218
|
};
|
|
141
|
-
|
|
142
|
-
}),
|
|
219
|
+
m.set(f.index, x);
|
|
220
|
+
}), m;
|
|
143
221
|
});
|
|
144
|
-
return
|
|
145
|
-
var
|
|
146
|
-
if (
|
|
222
|
+
return K(r, (m, g) => {
|
|
223
|
+
var x;
|
|
224
|
+
if (e.onlySearcher || t.value !== void 0 && m.get(t.value))
|
|
147
225
|
return;
|
|
148
|
-
let
|
|
149
|
-
if (t.value ===
|
|
150
|
-
t.value =
|
|
226
|
+
let f = m.keys().next().value;
|
|
227
|
+
if (t.value === S || f === S) {
|
|
228
|
+
t.value = f;
|
|
151
229
|
return;
|
|
152
230
|
}
|
|
153
|
-
let
|
|
154
|
-
for (const [
|
|
155
|
-
const
|
|
156
|
-
if (typeof
|
|
231
|
+
let a = ((x = g == null ? void 0 : g.get(t.value)) == null ? void 0 : x.title) || "", p = -1;
|
|
232
|
+
for (const [C, k] of m.entries()) {
|
|
233
|
+
const h = k.title;
|
|
234
|
+
if (typeof h != "string" || typeof C == "string")
|
|
157
235
|
break;
|
|
158
|
-
if (
|
|
159
|
-
|
|
236
|
+
if (h === a) {
|
|
237
|
+
f = C;
|
|
160
238
|
break;
|
|
161
239
|
}
|
|
162
|
-
const
|
|
163
|
-
let
|
|
164
|
-
|
|
240
|
+
const _ = new RegExp(` \\((${i.Common.Device_1}|${i.Common.Device_2})\\)`);
|
|
241
|
+
let T = a, d = 3;
|
|
242
|
+
h.indexOf(T) === -1 && (T = a.replace(/^[^a-zа-я]/i, "").replace(_, ""), d--), h.indexOf(T) === -1 && (T = a.replace(/ \/.*/, ""), d--), h.indexOf(T) === -1 && (T = a.replace(/ \/.*/, ""), T = T.replace(/^[^a-zа-я]/i, "").replace(_, ""), d--), h.indexOf(T) !== -1 && (d <= p || (p = d, f = C));
|
|
165
243
|
}
|
|
166
|
-
t.value =
|
|
244
|
+
t.value = f;
|
|
167
245
|
}), {
|
|
168
246
|
regionIndex: t,
|
|
169
|
-
optionByRegionIndex:
|
|
247
|
+
optionByRegionIndex: r
|
|
170
248
|
};
|
|
171
|
-
},
|
|
172
|
-
const t =
|
|
173
|
-
if (
|
|
174
|
-
t.value = Array.from(
|
|
249
|
+
}, Qe = (e, l, i) => {
|
|
250
|
+
const t = D([]), r = () => {
|
|
251
|
+
if (e.onlySearcher && l.value) {
|
|
252
|
+
t.value = Array.from(l.value.keys());
|
|
175
253
|
return;
|
|
176
254
|
}
|
|
177
|
-
let
|
|
178
|
-
if (
|
|
179
|
-
|
|
255
|
+
let n = [];
|
|
256
|
+
if (e.modelValue.length > 1)
|
|
257
|
+
n = [...e.modelValue];
|
|
180
258
|
else
|
|
181
259
|
try {
|
|
182
|
-
|
|
183
|
-
localStorage.getItem("ui:project:regionSelector" +
|
|
260
|
+
n = JSON.parse(
|
|
261
|
+
localStorage.getItem("ui:project:regionSelector" + e.projectId + ":regionsIndexes")
|
|
184
262
|
) ?? [];
|
|
185
263
|
} catch {
|
|
186
264
|
}
|
|
187
|
-
|
|
188
|
-
},
|
|
189
|
-
t.value.length ? localStorage.setItem("ui:project:regionSelector:" +
|
|
265
|
+
n.length && (n = n.filter((u) => i.value.has(u))), n.length || (n = Array.from(i.value)), t.value = [...n];
|
|
266
|
+
}, o = () => {
|
|
267
|
+
t.value.length ? localStorage.setItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes", JSON.stringify(t.value)) : localStorage.removeItem("ui:project:regionSelector:" + e.projectId + ":regionsIndexes");
|
|
190
268
|
};
|
|
191
|
-
return
|
|
192
|
-
|
|
193
|
-
}),
|
|
269
|
+
return K(t, () => {
|
|
270
|
+
o();
|
|
271
|
+
}), e.addCompare && r(), {
|
|
194
272
|
regionsIndexes: t
|
|
195
273
|
};
|
|
196
|
-
},
|
|
197
|
-
const
|
|
198
|
-
const
|
|
199
|
-
return
|
|
200
|
-
var
|
|
201
|
-
(
|
|
202
|
-
|
|
274
|
+
}, Xe = (e) => {
|
|
275
|
+
const l = A(() => he(e.forFrequency, e.autoRegion, e.searchers)), i = A(() => l.value.get(r.searcherKey.value) || pe), t = A(() => {
|
|
276
|
+
const a = /* @__PURE__ */ new Set();
|
|
277
|
+
return l.value.forEach((p) => {
|
|
278
|
+
var x;
|
|
279
|
+
(x = p.regions) == null || x.forEach((C) => {
|
|
280
|
+
C.index !== -1 && C.index !== S && a.add(C.index);
|
|
203
281
|
});
|
|
204
|
-
}),
|
|
205
|
-
}),
|
|
206
|
-
|
|
207
|
-
var
|
|
208
|
-
if (e.searcherKey.value === -1)
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
282
|
+
}), a;
|
|
283
|
+
}), r = We(e, l), o = He(e, i), n = Qe(e, l, t);
|
|
284
|
+
K(l, () => {
|
|
285
|
+
var p, x, C, k;
|
|
286
|
+
if (e.onlySearcher ? n.regionsIndexes.value = Array.from(l.value.keys()) : n.regionsIndexes.value = n.regionsIndexes.value.filter((h) => t.value.has(h)), r.searcherKey.value === -1) return;
|
|
287
|
+
let a = l.value.keys().next().value;
|
|
288
|
+
l.value.forEach((h) => {
|
|
289
|
+
var _, T, d;
|
|
290
|
+
if (e.onlySearcher && h.key === r.searcherKey.value) {
|
|
291
|
+
a = r.searcherKey.value;
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
if (o.regionIndex.value && ((_ = h.regionByIndex) != null && _.has(o.regionIndex.value)) && (a = h.key), !e.onlySearcher) {
|
|
295
|
+
let s;
|
|
296
|
+
a !== void 0 && (s = (T = l.value.get(a)) == null ? void 0 : T.regionByIndex);
|
|
297
|
+
const c = (d = l.value.get(h.key)) == null ? void 0 : d.regionByIndex;
|
|
298
|
+
s != null && s.has(S) && !(c != null && c.has(S)) && (a = h.key);
|
|
220
299
|
}
|
|
221
|
-
}),
|
|
300
|
+
}), a !== void 0 && (r.searcherKey.value = a), o.regionIndex.value !== void 0 && !((x = (p = i.value) == null ? void 0 : p.regionByIndex) != null && x.has(o.regionIndex.value)) && (o.regionIndex.value = (k = (C = i.value) == null ? void 0 : C.regions) == null ? void 0 : k.keys().next().value);
|
|
222
301
|
}, { immediate: !0 });
|
|
223
|
-
const
|
|
224
|
-
if (!(
|
|
225
|
-
return
|
|
226
|
-
},
|
|
227
|
-
if (
|
|
228
|
-
let
|
|
229
|
-
if (
|
|
230
|
-
const
|
|
231
|
-
|
|
302
|
+
const u = () => {
|
|
303
|
+
if (!(r.searcherKey.value === -1 || r.searcherKey.value === S))
|
|
304
|
+
return r.searcherKey.value;
|
|
305
|
+
}, m = () => {
|
|
306
|
+
if (e.onlySearcher || o.regionIndex.value === S) return;
|
|
307
|
+
let a = o.regionIndex.value;
|
|
308
|
+
if (e.forFrequency) {
|
|
309
|
+
const p = o.regionIndex.value, x = Ye(e.forFrequency, { searcher_key: u(), key: p }, e.searchers);
|
|
310
|
+
a = x == null ? void 0 : x.index;
|
|
232
311
|
}
|
|
233
|
-
return
|
|
234
|
-
},
|
|
235
|
-
const
|
|
236
|
-
if (
|
|
237
|
-
return
|
|
312
|
+
return a;
|
|
313
|
+
}, g = () => {
|
|
314
|
+
const a = u();
|
|
315
|
+
if (a !== void 0)
|
|
316
|
+
return l.value.get(a);
|
|
238
317
|
};
|
|
239
318
|
return {
|
|
240
|
-
selectSearcher:
|
|
241
|
-
selectRegion:
|
|
242
|
-
compare:
|
|
243
|
-
searcherByKey:
|
|
319
|
+
selectSearcher: r,
|
|
320
|
+
selectRegion: o,
|
|
321
|
+
compare: n,
|
|
322
|
+
searcherByKey: l,
|
|
244
323
|
allRegionsIndexes: t,
|
|
245
|
-
getSearcher:
|
|
324
|
+
getSearcher: g,
|
|
246
325
|
getRegion: () => {
|
|
247
|
-
var
|
|
248
|
-
const
|
|
249
|
-
if (
|
|
250
|
-
return (
|
|
326
|
+
var p, x;
|
|
327
|
+
const a = m();
|
|
328
|
+
if (a !== void 0)
|
|
329
|
+
return (x = (p = g()) == null ? void 0 : p.regionByIndex) == null ? void 0 : x.get(a);
|
|
251
330
|
}
|
|
252
331
|
};
|
|
253
|
-
},
|
|
332
|
+
}, Ze = /* @__PURE__ */ P({
|
|
254
333
|
__name: "selectorRegion",
|
|
255
|
-
props: /* @__PURE__ */
|
|
334
|
+
props: /* @__PURE__ */ O({
|
|
256
335
|
projectId: {},
|
|
257
336
|
searchers: { default: () => [] },
|
|
258
337
|
modelValue: {},
|
|
@@ -270,143 +349,616 @@ const ie = { class: "top-selectorCompetitors" }, se = { class: "top-ellipsis1" }
|
|
|
270
349
|
modelValueSingle: {},
|
|
271
350
|
modelValueSingleModifiers: {}
|
|
272
351
|
}),
|
|
273
|
-
emits: /* @__PURE__ */
|
|
274
|
-
setup(
|
|
275
|
-
const t =
|
|
276
|
-
selectSearcher:
|
|
277
|
-
selectRegion:
|
|
278
|
-
compare:
|
|
279
|
-
searcherByKey:
|
|
280
|
-
allRegionsIndexes:
|
|
281
|
-
getSearcher:
|
|
282
|
-
getRegion:
|
|
283
|
-
} =
|
|
284
|
-
var
|
|
285
|
-
if (window.fieldTemplates && ((
|
|
352
|
+
emits: /* @__PURE__ */ O(["compareRegions"], ["update:modelValue", "update:modelValueSingle"]),
|
|
353
|
+
setup(e, { expose: l, emit: i }) {
|
|
354
|
+
const t = e, r = q(e, "modelValue"), o = q(e, "modelValueSingle"), n = i, {
|
|
355
|
+
selectSearcher: u,
|
|
356
|
+
selectRegion: m,
|
|
357
|
+
compare: g,
|
|
358
|
+
searcherByKey: f,
|
|
359
|
+
allRegionsIndexes: a,
|
|
360
|
+
getSearcher: p,
|
|
361
|
+
getRegion: x
|
|
362
|
+
} = Xe(t), C = () => {
|
|
363
|
+
var k;
|
|
364
|
+
if (window.fieldTemplates && ((k = window.fieldTemplates) != null && k.openSelectorRegions)) {
|
|
286
365
|
window.fieldTemplates.openSelectorRegions(
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
(
|
|
366
|
+
f.value,
|
|
367
|
+
g.regionsIndexes.value,
|
|
368
|
+
(h) => g.regionsIndexes.value = h
|
|
290
369
|
);
|
|
291
370
|
return;
|
|
292
371
|
}
|
|
293
|
-
|
|
372
|
+
n("compareRegions", f.value);
|
|
294
373
|
};
|
|
295
|
-
return
|
|
296
|
-
if (
|
|
297
|
-
if (JSON.stringify(
|
|
374
|
+
return K([m.regionIndex, u.searcherKey, g.regionsIndexes], () => {
|
|
375
|
+
if (u.searcherKey.value === -1 && g.regionsIndexes.value.length) {
|
|
376
|
+
if (JSON.stringify(r.value) === JSON.stringify(g.regionsIndexes.value))
|
|
298
377
|
return;
|
|
299
|
-
|
|
378
|
+
r.value = [...g.regionsIndexes.value];
|
|
300
379
|
} else
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
}),
|
|
304
|
-
|
|
305
|
-
}, { immediate: !0 }),
|
|
306
|
-
var
|
|
307
|
-
if (
|
|
308
|
-
if (!
|
|
309
|
-
let
|
|
310
|
-
|
|
380
|
+
r.value = [t.onlySearcher ? u.searcherKey.value : m.regionIndex.value];
|
|
381
|
+
!t.onlySearcher && !a.value.size && (u.searcherKey.value = S);
|
|
382
|
+
}), o.value && K(o, () => {
|
|
383
|
+
r.value = [o.value];
|
|
384
|
+
}, { immediate: !0 }), K(r, () => {
|
|
385
|
+
var k, h, _, T, d;
|
|
386
|
+
if (r.value[0] && (o.value = r.value[0]), t.onlySearcher) {
|
|
387
|
+
if (!r.value.length || r.value.length === 1 && !f.value.has(r.value[0])) {
|
|
388
|
+
let s = f.value.keys().next().value;
|
|
389
|
+
s !== void 0 && (r.value = [s]);
|
|
311
390
|
return;
|
|
312
391
|
}
|
|
313
|
-
if (
|
|
314
|
-
|
|
392
|
+
if (r.value.length > 1 && JSON.stringify(r.value) !== JSON.stringify(g.regionsIndexes.value)) {
|
|
393
|
+
r.value = [...g.regionsIndexes.value];
|
|
315
394
|
return;
|
|
316
395
|
}
|
|
317
396
|
} else {
|
|
318
|
-
let
|
|
319
|
-
if (t.forFrequency && (
|
|
320
|
-
|
|
321
|
-
else if (
|
|
322
|
-
let
|
|
323
|
-
t.forFrequency && (
|
|
324
|
-
|
|
325
|
-
M.index !== -1 && M.index !==
|
|
397
|
+
let s = [...new Set(r.value)], c = (h = (k = f.value.values().next().value) == null ? void 0 : k.regionByIndex) == null ? void 0 : h.keys().next().value;
|
|
398
|
+
if (t.forFrequency && (c = (d = (T = (_ = f.value.values().next().value) == null ? void 0 : _.regionByIndex) == null ? void 0 : T.values().next().value) == null ? void 0 : d.key), !s.length)
|
|
399
|
+
c !== void 0 && s.push(c);
|
|
400
|
+
else if (s.length === 1) {
|
|
401
|
+
let v = a.value;
|
|
402
|
+
t.forFrequency && (v = /* @__PURE__ */ new Set(), f.value.forEach((V) => {
|
|
403
|
+
V.regionByIndex.forEach((M) => {
|
|
404
|
+
M.index !== -1 && M.index !== S && v.add(M.key);
|
|
326
405
|
});
|
|
327
|
-
})), !
|
|
406
|
+
})), !v.has(s[0]) && s[0] !== -2 && (s = [], c !== void 0 && s.push(c));
|
|
328
407
|
} else
|
|
329
|
-
|
|
330
|
-
if (JSON.stringify(
|
|
331
|
-
|
|
408
|
+
s = s.filter((v) => a.value.has(v)), !s.length && c !== void 0 && s.push(c);
|
|
409
|
+
if (JSON.stringify(r.value) !== JSON.stringify(s)) {
|
|
410
|
+
r.value = s;
|
|
332
411
|
return;
|
|
333
412
|
}
|
|
334
413
|
}
|
|
335
|
-
if (!(
|
|
414
|
+
if (!(r.value.length === 1 && r.value[0] === (t.onlySearcher ? u.searcherKey.value : m.regionIndex.value)))
|
|
336
415
|
if (t.onlySearcher) {
|
|
337
|
-
if (
|
|
338
|
-
|
|
416
|
+
if (r.value.length === 1) {
|
|
417
|
+
u.searcherKey.value = r.value[0];
|
|
339
418
|
return;
|
|
340
419
|
}
|
|
341
|
-
|
|
420
|
+
u.searcherKey.value = -1;
|
|
342
421
|
return;
|
|
343
|
-
} else if (
|
|
344
|
-
|
|
345
|
-
let
|
|
346
|
-
for (const
|
|
347
|
-
for (const
|
|
348
|
-
if ((t.forFrequency ?
|
|
349
|
-
|
|
422
|
+
} else if (r.value.length === 1 && u.searcherKey.value !== -1) {
|
|
423
|
+
m.regionIndex.value = r.value[0];
|
|
424
|
+
let s;
|
|
425
|
+
for (const c of f.value.values()) {
|
|
426
|
+
for (const v of c.regionByIndex.values())
|
|
427
|
+
if ((t.forFrequency ? v.key : v.index) === m.regionIndex.value) {
|
|
428
|
+
s = c.key;
|
|
350
429
|
break;
|
|
351
430
|
}
|
|
352
|
-
if (
|
|
431
|
+
if (s !== void 0)
|
|
353
432
|
break;
|
|
354
433
|
}
|
|
355
|
-
|
|
434
|
+
s !== void 0 && (u.searcherKey.value = s);
|
|
356
435
|
} else
|
|
357
|
-
|
|
358
|
-
}, { immediate: !0 }),
|
|
359
|
-
getSearcher:
|
|
360
|
-
getRegion:
|
|
361
|
-
}), (
|
|
362
|
-
class:
|
|
436
|
+
u.searcherKey.value = -1, g.regionsIndexes.value = [...r.value];
|
|
437
|
+
}, { immediate: !0 }), l({
|
|
438
|
+
getSearcher: p,
|
|
439
|
+
getRegion: x
|
|
440
|
+
}), (k, h) => (I(), w("div", {
|
|
441
|
+
class: Q({
|
|
363
442
|
"top-selectorRegion": !0,
|
|
364
|
-
"top-selectorRegion-onlySearcher":
|
|
443
|
+
"top-selectorRegion-onlySearcher": k.onlySearcher
|
|
365
444
|
})
|
|
366
445
|
}, [
|
|
367
|
-
|
|
368
|
-
options:
|
|
369
|
-
modelValue:
|
|
370
|
-
"onUpdate:modelValue":
|
|
446
|
+
L(re, {
|
|
447
|
+
options: y(u).optionBySearcherKey.value,
|
|
448
|
+
modelValue: y(u).searcherKey.value,
|
|
449
|
+
"onUpdate:modelValue": h[0] || (h[0] = (_) => y(u).searcherKey.value = _),
|
|
371
450
|
name: "searcher_key",
|
|
372
|
-
addChanger:
|
|
451
|
+
addChanger: k.addChanger
|
|
373
452
|
}, null, 8, ["options", "modelValue", "addChanger"]),
|
|
374
|
-
!
|
|
453
|
+
!k.onlySearcher && y(u).searcherKey.value !== -1 ? (I(), b(re, {
|
|
375
454
|
key: 0,
|
|
376
455
|
class: "top-select-region",
|
|
377
|
-
options:
|
|
378
|
-
modelValue:
|
|
379
|
-
"onUpdate:modelValue":
|
|
380
|
-
name:
|
|
381
|
-
addChanger:
|
|
382
|
-
"data-top-icon":
|
|
383
|
-
}, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) :
|
|
384
|
-
|
|
456
|
+
options: y(m).optionByRegionIndex.value,
|
|
457
|
+
modelValue: y(m).regionIndex.value,
|
|
458
|
+
"onUpdate:modelValue": h[1] || (h[1] = (_) => y(m).regionIndex.value = _),
|
|
459
|
+
name: k.forFrequency ? "region_key" : "region_index",
|
|
460
|
+
addChanger: k.addChanger,
|
|
461
|
+
"data-top-icon": k.addRegionIcon ? "" : void 0
|
|
462
|
+
}, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : F("", !0),
|
|
463
|
+
k.addCompare && !k.onlySearcher && y(u).searcherKey.value === -1 ? (I(), b(W, {
|
|
385
464
|
key: 1,
|
|
386
465
|
name: "compare",
|
|
387
|
-
onClick:
|
|
388
|
-
"data-count-compare-regions-indexes":
|
|
466
|
+
onClick: C,
|
|
467
|
+
"data-count-compare-regions-indexes": y(g).regionsIndexes.value.length
|
|
389
468
|
}, {
|
|
390
|
-
default:
|
|
391
|
-
|
|
469
|
+
default: B(() => [
|
|
470
|
+
z(E(k.$i18n.Common.Selected_regions), 1)
|
|
392
471
|
]),
|
|
393
472
|
_: 1
|
|
394
|
-
}, 8, ["data-count-compare-regions-indexes"])) :
|
|
473
|
+
}, 8, ["data-count-compare-regions-indexes"])) : F("", !0)
|
|
395
474
|
], 2));
|
|
396
475
|
}
|
|
397
|
-
}),
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
},
|
|
476
|
+
}), et = [
|
|
477
|
+
{
|
|
478
|
+
id: "1",
|
|
479
|
+
name: "Without Tag",
|
|
480
|
+
color_id: "1"
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
id: "2",
|
|
484
|
+
name: "Red",
|
|
485
|
+
color_id: "2"
|
|
486
|
+
},
|
|
487
|
+
{
|
|
488
|
+
id: "3",
|
|
489
|
+
name: "Orange",
|
|
490
|
+
color_id: "3"
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
id: "4",
|
|
494
|
+
name: "Yellow",
|
|
495
|
+
color_id: "4"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
id: "5",
|
|
499
|
+
name: "Blue",
|
|
500
|
+
color_id: "5"
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
id: "6",
|
|
504
|
+
name: "Purple",
|
|
505
|
+
color_id: "6"
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
id: "7",
|
|
509
|
+
name: "Green",
|
|
510
|
+
color_id: "7"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
id: "8",
|
|
514
|
+
name: "Magenta",
|
|
515
|
+
color_id: "8"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
id: "9",
|
|
519
|
+
name: "Dark blue",
|
|
520
|
+
color_id: "9"
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
id: "10",
|
|
524
|
+
name: "Turquoise",
|
|
525
|
+
color_id: "10"
|
|
526
|
+
}
|
|
527
|
+
], me = (e) => "-" + e, H = (e) => e[0] === "-" ? e.substring(1) : e, ae = (e, l) => {
|
|
528
|
+
e = H(e);
|
|
529
|
+
const i = l.find((t) => t.id === e);
|
|
530
|
+
if (i)
|
|
531
|
+
return i;
|
|
532
|
+
}, tt = ["data-tag_id", "data-tag_color_id", "title"], le = /* @__PURE__ */ P({
|
|
533
|
+
__name: "tagIcon",
|
|
534
|
+
props: {
|
|
535
|
+
id: {},
|
|
536
|
+
colorId: {},
|
|
537
|
+
name: {},
|
|
538
|
+
state: {}
|
|
539
|
+
},
|
|
540
|
+
setup(e) {
|
|
541
|
+
return (l, i) => (I(), w("div", {
|
|
542
|
+
class: Q({
|
|
543
|
+
"top-tagSelector_tagIcon": !0,
|
|
544
|
+
"top-tagSelector-active": !!l.state,
|
|
545
|
+
"top-tagSelector-excluded": l.state === "excluded"
|
|
546
|
+
}),
|
|
547
|
+
"data-tag_id": l.id,
|
|
548
|
+
"data-tag_color_id": l.colorId,
|
|
549
|
+
title: l.name
|
|
550
|
+
}, null, 10, tt));
|
|
551
|
+
}
|
|
552
|
+
}), at = ["contenteditable", "onKeydown"], ge = /* @__PURE__ */ P({
|
|
553
|
+
__name: "tagPopupListItem",
|
|
554
|
+
props: /* @__PURE__ */ O({
|
|
555
|
+
editable: { type: Boolean },
|
|
556
|
+
disabled: { type: Boolean },
|
|
557
|
+
canExclude: { type: Boolean },
|
|
558
|
+
id: {},
|
|
559
|
+
colorId: {},
|
|
560
|
+
name: {},
|
|
561
|
+
state: {}
|
|
562
|
+
}, {
|
|
563
|
+
name: {
|
|
564
|
+
required: !0
|
|
565
|
+
},
|
|
566
|
+
nameModifiers: {}
|
|
567
|
+
}),
|
|
568
|
+
emits: /* @__PURE__ */ O(["update:name", "unselect", "exclude", "select"], ["update:name"]),
|
|
569
|
+
setup(e, { emit: l }) {
|
|
570
|
+
const i = e, t = l, r = q(e, "name"), o = D(null), n = D(!1), u = async () => {
|
|
571
|
+
var a;
|
|
572
|
+
n.value = !0, await Te(), (a = o.value) == null || a.focus();
|
|
573
|
+
}, m = () => {
|
|
574
|
+
var p;
|
|
575
|
+
const a = (p = o.value) == null ? void 0 : p.innerText;
|
|
576
|
+
if (!a) return g();
|
|
577
|
+
o.value && (o.value.innerText = a), n.value = !1, t("update:name", a);
|
|
578
|
+
}, g = async () => {
|
|
579
|
+
o.value && (o.value.innerText = i.name), n.value = !1;
|
|
580
|
+
}, f = (a) => {
|
|
581
|
+
if (n.value || i.disabled) return;
|
|
582
|
+
let p = "selected";
|
|
583
|
+
i.canExclude && (a.ctrlKey || a.metaKey) && (p = "excluded"), i.state == p && (p = ""), p === "" && t("unselect"), p === "selected" && t("select"), p === "excluded" && t("exclude");
|
|
584
|
+
};
|
|
585
|
+
return (a, p) => (I(), b(se, {
|
|
586
|
+
class: Q({
|
|
587
|
+
"top-tagSelector_tagListItem": !0,
|
|
588
|
+
"top-tagSelector_tagListItem-inEdit": n.value,
|
|
589
|
+
"top-tagSelector_tagListItem-disabled": a.disabled,
|
|
590
|
+
"top-tagSelector_tagListItem-canExclude": a.canExclude,
|
|
591
|
+
"top-tagSelector-active": !!a.state,
|
|
592
|
+
"top-tagSelector-excluded": a.state === "excluded"
|
|
593
|
+
}),
|
|
594
|
+
onClick: j(f, ["stop"])
|
|
595
|
+
}, {
|
|
596
|
+
default: B(() => [
|
|
597
|
+
L(le, {
|
|
598
|
+
id: a.id,
|
|
599
|
+
name: r.value,
|
|
600
|
+
colorId: a.colorId,
|
|
601
|
+
state: a.state
|
|
602
|
+
}, null, 8, ["id", "name", "colorId", "state"]),
|
|
603
|
+
ve("span", {
|
|
604
|
+
ref_key: "elName",
|
|
605
|
+
ref: o,
|
|
606
|
+
class: "top-tagSelector_tagListItemName",
|
|
607
|
+
contenteditable: n.value ? "plaintext-only" : !1,
|
|
608
|
+
onKeydown: [
|
|
609
|
+
de(j(m, ["stop"]), ["enter"]),
|
|
610
|
+
de(j(g, ["stop"]), ["esc"])
|
|
611
|
+
]
|
|
612
|
+
}, E(r.value), 41, at),
|
|
613
|
+
a.editable ? (I(), w(Y, { key: 0 }, [
|
|
614
|
+
n.value ? (I(), w("span", {
|
|
615
|
+
key: 1,
|
|
616
|
+
"data-top-icon": "",
|
|
617
|
+
class: "top-tagSelector_edit",
|
|
618
|
+
onClick: j(m, ["stop"])
|
|
619
|
+
})) : (I(), w("span", {
|
|
620
|
+
key: 0,
|
|
621
|
+
"data-top-icon": "",
|
|
622
|
+
class: "top-tagSelector_edit",
|
|
623
|
+
onClick: u
|
|
624
|
+
}))
|
|
625
|
+
], 64)) : F("", !0)
|
|
626
|
+
]),
|
|
627
|
+
_: 1
|
|
628
|
+
}, 8, ["class"]));
|
|
629
|
+
}
|
|
630
|
+
}), lt = { key: 1 }, Ie = /* @__PURE__ */ P({
|
|
631
|
+
inheritAttrs: !1,
|
|
632
|
+
__name: "popupOpener",
|
|
633
|
+
props: /* @__PURE__ */ O({
|
|
634
|
+
modelValue: {},
|
|
635
|
+
id: {},
|
|
636
|
+
tags: {},
|
|
637
|
+
mode: {},
|
|
638
|
+
targetId: {},
|
|
639
|
+
filters: {},
|
|
640
|
+
useTopButton: { type: Boolean },
|
|
641
|
+
payload: {}
|
|
642
|
+
}, {
|
|
643
|
+
modelValue: {
|
|
644
|
+
required: !0
|
|
645
|
+
},
|
|
646
|
+
modelModifiers: {}
|
|
647
|
+
}),
|
|
648
|
+
emits: ["update:modelValue"],
|
|
649
|
+
setup(e) {
|
|
650
|
+
const l = e, i = q(e, "modelValue"), t = l.useTopButton ? W : "div", r = l.useTopButton ? "html" : "default", o = {
|
|
651
|
+
model: i,
|
|
652
|
+
mode: l.mode,
|
|
653
|
+
targetId: l.targetId,
|
|
654
|
+
filters: l.filters,
|
|
655
|
+
payload: l.payload
|
|
656
|
+
};
|
|
657
|
+
return (n, u) => {
|
|
658
|
+
const m = _e("top-data");
|
|
659
|
+
return I(), b(Le, { id: n.id }, {
|
|
660
|
+
default: B(() => [
|
|
661
|
+
Be((I(), b(be(y(t)), Ve({
|
|
662
|
+
class: {
|
|
663
|
+
"top-tagSelector": !0,
|
|
664
|
+
"top-tagSelector-filter": l.mode === "filter",
|
|
665
|
+
"top-tagSelector-setter_single": l.mode === "setter" && !n.filters,
|
|
666
|
+
"top-tagSelector-setter_several": l.mode === "setter" && n.filters,
|
|
667
|
+
"top-tagSelector-selectedOne": !i.value.length || i.value.length === 1,
|
|
668
|
+
"top-tagSelector-toTwoLine": i.value.length > 5
|
|
669
|
+
},
|
|
670
|
+
color: "theme",
|
|
671
|
+
styling: ""
|
|
672
|
+
}, n.$attrs), {
|
|
673
|
+
[y(r)]: B(() => [
|
|
674
|
+
!i.value.length && n.mode === "filter" ? (I(), b(le, {
|
|
675
|
+
key: 0,
|
|
676
|
+
id: "all",
|
|
677
|
+
colorId: "",
|
|
678
|
+
name: n.$i18n.Common.All_tags ?? "",
|
|
679
|
+
state: ""
|
|
680
|
+
}, null, 8, ["name"])) : F("", !0),
|
|
681
|
+
n.mode === "setter" && n.filters ? (I(), w("div", lt, [
|
|
682
|
+
we(n.$slots, "default")
|
|
683
|
+
])) : (I(!0), w(Y, { key: 2 }, ie(i.value, (g) => {
|
|
684
|
+
var f, a;
|
|
685
|
+
return I(), b(le, {
|
|
686
|
+
id: y(H)(g),
|
|
687
|
+
colorId: ((f = y(ae)(g, n.tags)) == null ? void 0 : f.color_id) ?? "",
|
|
688
|
+
name: ((a = y(ae)(g, n.tags)) == null ? void 0 : a.name) ?? "",
|
|
689
|
+
state: y(H)(g) === g ? "selected" : "excluded"
|
|
690
|
+
}, null, 8, ["id", "colorId", "name", "state"]);
|
|
691
|
+
}), 256))
|
|
692
|
+
]),
|
|
693
|
+
_: 2
|
|
694
|
+
}, 1040, ["class"])), [
|
|
695
|
+
[m, o, "topTagSelectorTarget"]
|
|
696
|
+
])
|
|
697
|
+
]),
|
|
698
|
+
_: 3
|
|
699
|
+
}, 8, ["id"]);
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
}), ot = /* @__PURE__ */ P({
|
|
703
|
+
__name: "tagSelector",
|
|
704
|
+
props: /* @__PURE__ */ O({
|
|
705
|
+
modelValue: {},
|
|
706
|
+
tags: {},
|
|
707
|
+
tagsEditable: { type: Boolean },
|
|
708
|
+
tagsMax: { default: 10 },
|
|
709
|
+
id: {},
|
|
710
|
+
singleMode: { type: Boolean },
|
|
711
|
+
requiredForSetter: { type: Boolean, default: !0 },
|
|
712
|
+
maxTagsForSetter: {},
|
|
713
|
+
emitDelay: { default: 500 }
|
|
714
|
+
}, {
|
|
715
|
+
modelValue: {
|
|
716
|
+
required: !0
|
|
717
|
+
},
|
|
718
|
+
modelModifiers: {},
|
|
719
|
+
tags: {
|
|
720
|
+
default: Me(et)
|
|
721
|
+
},
|
|
722
|
+
tagsModifiers: {}
|
|
723
|
+
}),
|
|
724
|
+
emits: /* @__PURE__ */ O(["selector", "setter", "tagsChanged"], ["update:modelValue", "update:tags"]),
|
|
725
|
+
setup(e, { emit: l }) {
|
|
726
|
+
const i = R(), t = e, r = q(e, "modelValue"), o = q(e, "tags"), n = l, u = $e((d, s) => {
|
|
727
|
+
n(d, s);
|
|
728
|
+
}, t.emitDelay);
|
|
729
|
+
t.singleMode && !r.value.length && (r.value = [o.value[0].id]);
|
|
730
|
+
const m = t.id ?? "top-popup-id-" + Math.random(), g = D("add"), f = () => {
|
|
731
|
+
var c;
|
|
732
|
+
const d = " " + ((c = i.Common.Tags) == null ? void 0 : c.toLowerCase()), s = /* @__PURE__ */ new Map();
|
|
733
|
+
return s.set("add", { value: "add", title: i.Common.Add + d }), s.set("replace", { value: "replace", title: i.Common.Replace + d }), s.set("delete", { value: "delete", title: i.Common.Delete + d }), s;
|
|
734
|
+
};
|
|
735
|
+
let a = Ee({
|
|
736
|
+
model: r,
|
|
737
|
+
mode: "filter",
|
|
738
|
+
targetId: void 0,
|
|
739
|
+
filters: void 0,
|
|
740
|
+
payload: void 0
|
|
741
|
+
});
|
|
742
|
+
K(r, () => {
|
|
743
|
+
u("selector", r.value);
|
|
744
|
+
});
|
|
745
|
+
const p = A(() => {
|
|
746
|
+
if (a.value.mode === "setter" && t.maxTagsForSetter && !a.value.filters)
|
|
747
|
+
return a.value.model.value.length >= t.maxTagsForSetter;
|
|
748
|
+
}), x = (d) => {
|
|
749
|
+
if (d !== "all") {
|
|
750
|
+
if (a.value.model.value.includes(d)) return "selected";
|
|
751
|
+
if (a.value.model.value.includes(me(d))) return "excluded";
|
|
752
|
+
}
|
|
753
|
+
return d === "all" && !a.value.model.value.length ? "selected" : "";
|
|
754
|
+
}, C = (d, s) => {
|
|
755
|
+
const c = me(d);
|
|
756
|
+
let v = a.value.model.value.filter((V) => V !== d && V !== c);
|
|
757
|
+
s === "select" && v.push(d), s === "exclude" && v.push(c), a.value.mode === "setter" && a.value.targetId !== void 0 && t.requiredForSetter && (v.length || v.push("1"), v.length === 2 && a.value.model.value.length === 1 && a.value.model.value[0] === "1" && (v = v.filter((V) => V !== "1"))), t.singleMode && !a.value.filters && (v.length || (v = a.value.model.value), v.length > 1 && (v = [v[v.length - 1]])), v.sort((V, M) => {
|
|
758
|
+
if (!t.tags) return 0;
|
|
759
|
+
const X = t.tags.findIndex((N) => N.id === V), U = t.tags.findIndex((N) => N.id === M);
|
|
760
|
+
return X - U;
|
|
761
|
+
}), a.value.model.value = v, a.value.mode === "setter" && a.value.targetId !== void 0 && u("setter", {
|
|
762
|
+
tagsIds: v,
|
|
763
|
+
targetId: a.value.targetId,
|
|
764
|
+
payload: a.value.payload
|
|
765
|
+
});
|
|
766
|
+
}, k = A(() => {
|
|
767
|
+
let d = "top-tagSelector_popup";
|
|
768
|
+
return a.value.mode === "filter" && (d += " top-tagSelector_popup-filter"), a.value.mode === "setter" && (d += " top-tagSelector_popup-setter"), d;
|
|
769
|
+
}), h = () => {
|
|
770
|
+
const d = prompt("", "New tag");
|
|
771
|
+
if (!d || d === "New tag") return;
|
|
772
|
+
const s = o.value.length + 1;
|
|
773
|
+
o.value.push({
|
|
774
|
+
id: String(s),
|
|
775
|
+
name: d,
|
|
776
|
+
color_id: String((s - 1) % 10 + 1)
|
|
777
|
+
}), n("tagsChanged", o.value);
|
|
778
|
+
}, _ = (d) => {
|
|
779
|
+
var s;
|
|
780
|
+
if (a.value = G(d.elPopupOpener, "topTagSelectorTarget"), !a.value) throw new Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
|
|
781
|
+
if (a.value.filters && (g.value = "add", a.value.model.value = []), !((s = J.$) != null && s.ui.sortable)) {
|
|
782
|
+
console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
!J.state.isMobile && !J.state.isMobileUA && o.value && $(d.elPopup).sortable({
|
|
786
|
+
items: 'li:has([data-tag_id]:not([data-tag_id="all"]))',
|
|
787
|
+
cancel: '[contenteditable="plaintext-only"]',
|
|
788
|
+
distance: 10,
|
|
789
|
+
stop: function(c, v) {
|
|
790
|
+
if (!o.value) return;
|
|
791
|
+
const V = $(v.item).parent().find("[data-tag_id]"), M = [];
|
|
792
|
+
V.each((X, U) => {
|
|
793
|
+
if (!o.value) return;
|
|
794
|
+
const N = $(U).attr("data-tag_id");
|
|
795
|
+
M.push(N);
|
|
796
|
+
}), o.value.sort((X, U) => {
|
|
797
|
+
const N = M.findIndex((oe) => oe === X.id), xe = M.findIndex((oe) => oe === U.id);
|
|
798
|
+
return N - xe;
|
|
799
|
+
}), u("tagsChanged", o.value);
|
|
800
|
+
}
|
|
801
|
+
});
|
|
802
|
+
}, T = (d) => {
|
|
803
|
+
var s;
|
|
804
|
+
(s = J.$) != null && s.ui.sortable && $(d.elPopup).data("ui-sortable") && $(d.elPopup).sortable("destroy");
|
|
805
|
+
};
|
|
806
|
+
return (d, s) => (I(), w(Y, null, [
|
|
807
|
+
L(Ie, {
|
|
808
|
+
class: "top-select_arrow",
|
|
809
|
+
modelValue: r.value,
|
|
810
|
+
"onUpdate:modelValue": s[0] || (s[0] = (c) => r.value = c),
|
|
811
|
+
id: y(m),
|
|
812
|
+
tags: o.value,
|
|
813
|
+
mode: "filter",
|
|
814
|
+
useTopButton: ""
|
|
815
|
+
}, null, 8, ["modelValue", "id", "tags"]),
|
|
816
|
+
L(ye, {
|
|
817
|
+
id: y(m),
|
|
818
|
+
class: Q(k.value),
|
|
819
|
+
onOpen: s[4] || (s[4] = (c) => _(c)),
|
|
820
|
+
onClose: s[5] || (s[5] = (c) => T(c)),
|
|
821
|
+
"transition-duration": 50
|
|
822
|
+
}, Ke({
|
|
823
|
+
contentList: B(() => [
|
|
824
|
+
y(a).mode === "filter" && !d.singleMode ? (I(), b(ge, {
|
|
825
|
+
key: 0,
|
|
826
|
+
id: "all",
|
|
827
|
+
colorId: "",
|
|
828
|
+
name: d.$i18n.Common.All_tags ?? "",
|
|
829
|
+
state: y(a).model.value.length ? "" : "selected",
|
|
830
|
+
onSelect: s[3] || (s[3] = (c) => y(a).model.value = [])
|
|
831
|
+
}, null, 8, ["name", "state"])) : F("", !0),
|
|
832
|
+
(I(!0), w(Y, null, ie(o.value, (c) => (I(), b(ge, {
|
|
833
|
+
key: c.id,
|
|
834
|
+
id: c.id,
|
|
835
|
+
colorId: c.color_id,
|
|
836
|
+
name: c.name,
|
|
837
|
+
state: x(c.id),
|
|
838
|
+
canExclude: y(a).mode === "filter" && !d.singleMode,
|
|
839
|
+
editable: d.tagsEditable,
|
|
840
|
+
disabled: p.value && x(c.id) === "",
|
|
841
|
+
onUnselect: (v) => C(c.id, "unselect"),
|
|
842
|
+
onSelect: (v) => C(c.id, "select"),
|
|
843
|
+
onExclude: (v) => C(c.id, "exclude"),
|
|
844
|
+
"onUpdate:name": (v) => {
|
|
845
|
+
c.name = v, y(u)("tagsChanged", o.value);
|
|
846
|
+
}
|
|
847
|
+
}, null, 8, ["id", "colorId", "name", "state", "canExclude", "editable", "disabled", "onUnselect", "onSelect", "onExclude", "onUpdate:name"]))), 128)),
|
|
848
|
+
d.tagsEditable && o.value.length < d.tagsMax && o.value.length < 20 ? (I(), b(se, {
|
|
849
|
+
key: 1,
|
|
850
|
+
"data-top-icon": "",
|
|
851
|
+
onClick: j(h, ["stop"])
|
|
852
|
+
}, {
|
|
853
|
+
default: B(() => [
|
|
854
|
+
z(E(d.$i18n.Common.Add), 1)
|
|
855
|
+
]),
|
|
856
|
+
_: 1
|
|
857
|
+
})) : F("", !0)
|
|
858
|
+
]),
|
|
859
|
+
_: 2
|
|
860
|
+
}, [
|
|
861
|
+
y(a).mode === "setter" && y(a).filters ? {
|
|
862
|
+
name: "header",
|
|
863
|
+
fn: B(() => [
|
|
864
|
+
L(re, {
|
|
865
|
+
modelValue: g.value,
|
|
866
|
+
"onUpdate:modelValue": s[1] || (s[1] = (c) => g.value = c),
|
|
867
|
+
options: f()
|
|
868
|
+
}, null, 8, ["modelValue", "options"])
|
|
869
|
+
]),
|
|
870
|
+
key: "0"
|
|
871
|
+
} : void 0,
|
|
872
|
+
y(a).mode === "setter" && y(a).filters ? {
|
|
873
|
+
name: "footer",
|
|
874
|
+
fn: B(() => [
|
|
875
|
+
L(W, { color: "theme" }, {
|
|
876
|
+
default: B(() => [
|
|
877
|
+
z(E(d.$i18n.Common.Cancel), 1)
|
|
878
|
+
]),
|
|
879
|
+
_: 1
|
|
880
|
+
}),
|
|
881
|
+
L(W, {
|
|
882
|
+
onClick: s[2] || (s[2] = (c) => y(u)("setter", {
|
|
883
|
+
tagsIds: y(a).model.value,
|
|
884
|
+
filters: y(a).filters,
|
|
885
|
+
filtersAction: g.value,
|
|
886
|
+
payload: y(a).payload
|
|
887
|
+
}))
|
|
888
|
+
}, {
|
|
889
|
+
default: B(() => [
|
|
890
|
+
z(E(g.value === "add" ? d.$i18n.Common.Add : "") + " " + E(g.value === "replace" ? d.$i18n.Common.Replace : "") + " " + E(g.value === "delete" ? d.$i18n.Common.Remove : ""), 1)
|
|
891
|
+
]),
|
|
892
|
+
_: 1
|
|
893
|
+
})
|
|
894
|
+
]),
|
|
895
|
+
key: "1"
|
|
896
|
+
} : void 0
|
|
897
|
+
]), 1032, ["id", "class"])
|
|
898
|
+
], 64));
|
|
899
|
+
}
|
|
900
|
+
}), gt = (e, l, i) => {
|
|
901
|
+
l || (l = { id: e.id }), l.id = e.id;
|
|
902
|
+
const t = qe.genElPopupOpener("div", l);
|
|
903
|
+
return t.classList.add("top-tagSelector"), e.useTopButton && t.classList.add("top-button", "top-color_theme"), 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) => {
|
|
904
|
+
r.preventDefault(), r.stopPropagation(), t.onclick = null;
|
|
905
|
+
const o = D(e.modelValue), n = {
|
|
906
|
+
model: o,
|
|
907
|
+
mode: e.mode,
|
|
908
|
+
targetId: e.targetId,
|
|
909
|
+
filters: e.filters,
|
|
910
|
+
payload: e.payload
|
|
911
|
+
};
|
|
912
|
+
G(t, "topTagSelectorTarget", n), delete t.dataset.topPopupDisabled, ue(e.modelValue) || K(o, () => {
|
|
913
|
+
e.modelValue = o.value, Z(t, e, i);
|
|
914
|
+
}), t.click();
|
|
915
|
+
}, ue(e.modelValue) ? K(e.modelValue, () => Z(t, e, i)) : G(t, "topTagSelectorRender", (r) => {
|
|
916
|
+
e.modelValue = r;
|
|
917
|
+
const o = G(t, "topTagSelectorTarget");
|
|
918
|
+
o && (o.model.value = r), Z(t, e, i);
|
|
919
|
+
}), Z(t, e, i), t;
|
|
920
|
+
}, ft = (e, l) => {
|
|
921
|
+
var i;
|
|
922
|
+
(i = G(e, "topTagSelectorRender")) == null || i(l);
|
|
923
|
+
}, Z = (e, l, i) => {
|
|
924
|
+
var r;
|
|
925
|
+
const t = y(l.modelValue);
|
|
926
|
+
if (e.classList.toggle("top-tagSelector-selectedOne", !t.length || t.length === 1), e.classList.toggle("top-tagSelector-toTwoLine", t.length > 5), l.mode === "setter" && l.filters) {
|
|
927
|
+
e.innerHTML = `<div>${i}</div>`;
|
|
928
|
+
return;
|
|
929
|
+
}
|
|
930
|
+
if (e.innerHTML = "", !t.length && l.mode === "filter") {
|
|
931
|
+
const o = fe({
|
|
932
|
+
id: "all",
|
|
933
|
+
colorId: "",
|
|
934
|
+
name: ((r = R().Common) == null ? void 0 : r.All_tags) ?? "",
|
|
935
|
+
state: ""
|
|
936
|
+
});
|
|
937
|
+
e.append(o);
|
|
938
|
+
}
|
|
939
|
+
t.forEach((o) => {
|
|
940
|
+
var u, m;
|
|
941
|
+
const n = fe({
|
|
942
|
+
id: H(o),
|
|
943
|
+
colorId: ((u = ae(o, l.tags)) == null ? void 0 : u.color_id) ?? "",
|
|
944
|
+
name: ((m = ae(o, l.tags)) == null ? void 0 : m.name) ?? "",
|
|
945
|
+
state: H(o) === o ? "selected" : "excluded"
|
|
946
|
+
});
|
|
947
|
+
e.append(n);
|
|
948
|
+
});
|
|
949
|
+
}, fe = (e) => {
|
|
950
|
+
const l = document.createElement("div");
|
|
951
|
+
return l.classList.add("top-tagSelector_tagIcon"), l.classList.toggle("top-tagSelector-active", !!e.state), l.classList.toggle("top-tagSelector-excluded", e.state === "excluded"), l.dataset.tag_id = e.id, l.dataset.tag_color_id = e.colorId, l.title = e.name, l;
|
|
952
|
+
}, vt = Pe, yt = Ze, pt = ot, ht = Ie, St = le;
|
|
408
953
|
export {
|
|
409
|
-
|
|
410
|
-
|
|
954
|
+
vt as TopSelectorCompetitors,
|
|
955
|
+
yt as TopSelectorRegion,
|
|
956
|
+
pt as TopTagSelector,
|
|
957
|
+
ht as TopTagSelectorPopupOpener,
|
|
958
|
+
St as TopTagSelectorTagIcon,
|
|
959
|
+
Ye as findRegion,
|
|
960
|
+
gt as genElTopTagSelectorPopupOpener,
|
|
961
|
+
he as genSearcherByKey,
|
|
962
|
+
ft as renderElTopTagSelectorPopupOpener
|
|
411
963
|
};
|
|
412
964
|
//# sourceMappingURL=project.js.map
|