@topvisor/ui 1.0.4 → 1.0.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/{datepicker-BJGX0c7G.amd.js → datepicker-CRfiJCmp.amd.js} +2 -2
- package/.chunks/{datepicker-BJGX0c7G.amd.js.map → datepicker-CRfiJCmp.amd.js.map} +1 -1
- package/.chunks/{datepicker-3uPurK_5.es.js → datepicker-CugKFVIH.es.js} +2 -2
- package/.chunks/{datepicker-3uPurK_5.es.js.map → datepicker-CugKFVIH.es.js.map} +1 -1
- package/.chunks/{forms-D9r2-H5Y.es.js → forms-CHiMZ8vg.es.js} +758 -743
- package/.chunks/forms-CHiMZ8vg.es.js.map +1 -0
- package/.chunks/forms-CjYoXTEQ.amd.js +3 -0
- package/.chunks/forms-CjYoXTEQ.amd.js.map +1 -0
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-Bdv8YBAk.es.js → listItem.vue_vue_type_script_setup_true_lang-Bb7B8CTJ.es.js} +4 -4
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-Bdv8YBAk.es.js.map → listItem.vue_vue_type_script_setup_true_lang-Bb7B8CTJ.es.js.map} +1 -1
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-BxpjEUsq.amd.js → listItem.vue_vue_type_script_setup_true_lang-CEF3WDJ_.amd.js} +2 -2
- package/.chunks/{listItem.vue_vue_type_script_setup_true_lang-BxpjEUsq.amd.js.map → listItem.vue_vue_type_script_setup_true_lang-CEF3WDJ_.amd.js.map} +1 -1
- package/.chunks/{menu-B0Ul7Kbg.es.js → menu-CHeV29rC.es.js} +2 -2
- package/.chunks/{menu-B0Ul7Kbg.es.js.map → menu-CHeV29rC.es.js.map} +1 -1
- package/.chunks/{menu-CbhB9e4x.amd.js → menu-D1lnYuWU.amd.js} +2 -2
- package/.chunks/{menu-CbhB9e4x.amd.js.map → menu-D1lnYuWU.amd.js.map} +1 -1
- package/.chunks/{popup-pQCswyfj.amd.js → popup-C4Tne4qA.amd.js} +5 -5
- package/.chunks/{popup-pQCswyfj.amd.js.map → popup-C4Tne4qA.amd.js.map} +1 -1
- package/.chunks/{popup-Coq_61yv.es.js → popup-D-G2sXks.es.js} +2 -3
- package/.chunks/{popup-Coq_61yv.es.js.map → popup-D-G2sXks.es.js.map} +1 -1
- package/.chunks/utils-BOlUthaH.es.js +91 -0
- package/.chunks/utils-BOlUthaH.es.js.map +1 -0
- package/.chunks/utils-x88W55mf.amd.js +2 -0
- package/.chunks/utils-x88W55mf.amd.js.map +1 -0
- package/assets/forms.css +1 -1
- package/assets/project.css +1 -1
- package/assets/themes/dark.css +1 -1
- package/assets/themes/light.css +1 -1
- package/components/forms/avatar/avatar.vue.d.ts +3 -33
- package/components/forms/button/button.vue.d.ts +11 -31
- package/components/forms/checkbox/checkbox.vue.d.ts +12 -16
- package/components/forms/controlLabel/controlLabel.vue.d.ts +9 -13
- package/components/forms/hint/hint.vue.d.ts +2 -11
- package/components/forms/input/input.vue.d.ts +13 -31
- package/components/forms/inputDate/inputDate.vue.d.ts +6 -27
- package/components/forms/inputRange/inputRange.vue.d.ts +10 -5
- package/components/forms/loadbar/loadbar.vue.d.ts +2 -2
- package/components/forms/radio/radio.vue.d.ts +12 -16
- package/components/forms/select/select.vue.d.ts +8 -27
- package/components/forms/switcher/switcher.vue.d.ts +12 -16
- package/components/forms/textarea/textarea.vue.d.ts +6 -29
- package/components/formsExt/editArea/editArea.vue.d.ts +9 -38
- package/components/formsExt/editInput/editInput.vue.d.ts +5 -14
- package/components/formsExt/menu/menu.vue.d.ts +6 -27
- package/components/formsExt/radioGroup/radioGroup.vue.d.ts +8 -27
- package/components/formsExt/selector2/api.d.ts +2 -2
- package/components/formsExt/selector2/itemMulti.vue.d.ts +5 -14
- package/components/formsExt/selector2/selector2.vue.d.ts +107 -35
- package/components/popup/alert/alert.vue.d.ts +17 -21
- package/components/popup/confirm/confirm.vue.d.ts +19 -23
- package/components/popup/popup/listItem.vue.d.ts +10 -28
- package/components/popup/popup/opener.vue.d.ts +10 -30
- package/components/popup/popup/popup.vue.d.ts +21 -43
- package/components/popup/popup/widgetInput.vue.d.ts +11 -29
- package/components/popup/prompt/prompt.vue.d.ts +19 -23
- package/components/popup/worker.d.ts +0 -4
- package/components/project/project.d.ts +2 -0
- package/components/project/selectorCompetitors/selectorCompetitors.vue.d.ts +6 -27
- package/components/project/selectorRegion/composables/compare.d.ts +12 -0
- package/components/project/selectorRegion/composables/selectRegion.d.ts +14 -0
- package/components/project/selectorRegion/composables/selectSearcher.d.ts +13 -0
- package/components/project/selectorRegion/composables/selectorRegion.d.ts +25 -0
- package/components/project/selectorRegion/selectorRegion.d.ts +182 -0
- package/components/project/selectorRegion/selectorRegion.vue.d.ts +25 -0
- package/components/project/selectorRegion/stories/searchers.d.ts +3 -0
- package/components/project/selectorRegion/utils/consts.d.ts +20 -0
- package/components/project/selectorRegion/utils/utils.d.ts +23 -0
- package/components/project/utils.d.ts +1 -0
- package/components/tabs/tabs/content.vue.d.ts +9 -13
- package/components/tabs/tabs/tab.vue.d.ts +9 -13
- package/components/tabs/tabs/tabs.vue.d.ts +11 -15
- package/components/tabsView/tabsView/menu.vue.d.ts +17 -20
- package/components/tabsView/tabsView/menuDelimeter.vue.d.ts +2 -2
- package/components/tabsView/tabsView/menuItem.vue.d.ts +11 -29
- package/components/tabsView/tabsView/menuTitle.vue.d.ts +10 -14
- package/components/tabsView/tabsView/store.d.ts +6 -6
- package/components/tabsView/tabsView/tabsView.vue.d.ts +15 -31
- package/core/app.amd.js +1 -1
- package/core/app.amd.js.map +1 -1
- package/core/app.js +2 -2
- package/core/core/core.d.ts +0 -8
- package/core/core.amd.js +1 -1
- package/core/core.js +1 -1
- package/core/utils/date.d.ts +2 -2
- package/core/utils/scroll.d.ts +7 -1
- package/core/utils/searchers.d.ts +40 -0
- package/forms/forms.amd.js +1 -1
- package/forms/forms.js +5 -5
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.amd.js.map +1 -1
- package/formsExt/formsExt.js +64 -64
- package/icomoon/Topvisor icons.json +5846 -0
- package/icomoon/demo.html +26 -26
- package/icomoon/fonts/Topvisor-2.svg +12 -12
- package/icomoon/fonts/Topvisor-2.ttf +0 -0
- package/icomoon/fonts/Topvisor-2.woff +0 -0
- package/icomoon/selection.json +1 -1
- package/icomoon/style.css +16 -16
- package/package.json +1 -1
- package/popup/popup.amd.js +1 -1
- package/popup/popup.amd.js.map +1 -1
- package/popup/popup.js +14 -14
- package/popup/worker.amd.js +1 -1
- package/popup/worker.d.ts +0 -4
- package/popup/worker.js +3 -4
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +366 -45
- package/project/project.js.map +1 -1
- package/project/utils.amd.js +2 -0
- package/project/utils.amd.js.map +1 -0
- package/project/utils.d.ts +2 -0
- package/project/utils.js +6 -0
- package/project/utils.js.map +1 -0
- package/tabs/tabs.amd.js +1 -1
- package/tabs/tabs.js +1 -1
- package/tabsView/tabsView.amd.js +1 -1
- package/tabsView/tabsView.amd.js.map +1 -1
- package/tabsView/tabsView.js +150 -143
- package/tabsView/tabsView.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/lodash.amd.js +1 -1
- package/utils/lodash.js +4 -4
- package/utils/price.amd.js +1 -1
- package/utils/price.amd.js.map +1 -1
- package/utils/price.js +6 -7
- package/utils/price.js.map +1 -1
- package/utils/scroll.amd.js +1 -1
- package/utils/scroll.amd.js.map +1 -1
- package/utils/scroll.js +10 -8
- package/utils/scroll.js.map +1 -1
- package/utils/searchers.amd.js +2 -0
- package/utils/searchers.amd.js.map +1 -0
- package/utils/searchers.d.ts +2 -0
- package/utils/searchers.js +130 -0
- package/utils/searchers.js.map +1 -0
- package/utils/string.amd.js +1 -1
- package/utils/string.amd.js.map +1 -1
- package/utils/string.js +1 -1
- package/.chunks/forms-BImXJ_ZO.amd.js +0 -3
- package/.chunks/forms-BImXJ_ZO.amd.js.map +0 -1
- package/.chunks/forms-D9r2-H5Y.es.js.map +0 -1
- package/.chunks/i18n-C_OH9IT3.amd.js +0 -2
- package/.chunks/i18n-C_OH9IT3.amd.js.map +0 -1
- package/.chunks/i18n-DuTvft1T.es.js +0 -26
- package/.chunks/i18n-DuTvft1T.es.js.map +0 -1
package/project/project.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { C as
|
|
4
|
-
import { P as
|
|
5
|
-
import { M as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import P from "../core/core.js";
|
|
2
|
+
import { defineComponent as j, mergeModels as N, useModel as b, computed as R, openBlock as V, createElementBlock as q, unref as K, createBlock as w, withCtx as _, createVNode as J, createTextVNode as A, toDisplayString as E, Fragment as H, renderList as Q, normalizeClass as D, createElementVNode as W, ref as F, watch as B, createCommentVNode as T } from "vue";
|
|
3
|
+
import { b as L, C as X, T as z, _ as U, S as $ } from "../.chunks/forms-CHiMZ8vg.es.js";
|
|
4
|
+
import { P as Y, a as Z } from "../.chunks/listItem.vue_vue_type_script_setup_true_lang-Bb7B8CTJ.es.js";
|
|
5
|
+
import { M as ee } from "../.chunks/menu-CHeV29rC.es.js";
|
|
6
|
+
import { d as h, g as ne, s as oe, f as te } from "../.chunks/utils-BOlUthaH.es.js";
|
|
7
|
+
import { getSearcherGIcon as le, getLangLabel as ae, getDeviceGIcon as re } from "../utils/searchers.js";
|
|
8
|
+
const G = ["../assets/project.css"].map((n) => import.meta.resolve(n));
|
|
9
|
+
P.insertCSSLinkToPage(G, !0);
|
|
10
|
+
const ie = { class: "top-selectorCompetitors" }, se = { class: "top-ellipsis1" }, ue = /* @__PURE__ */ j({
|
|
10
11
|
__name: "selectorCompetitors",
|
|
11
|
-
props: /* @__PURE__ */
|
|
12
|
+
props: /* @__PURE__ */ N({
|
|
12
13
|
modelValue: {},
|
|
13
14
|
items: {},
|
|
14
15
|
showSelectAllItem: { type: Boolean, default: !0 }
|
|
@@ -17,75 +18,395 @@ const L = { class: "top-selectorCompetitors" }, P = { class: "top-ellipsis1" },
|
|
|
17
18
|
modelModifiers: {}
|
|
18
19
|
}),
|
|
19
20
|
emits: ["update:modelValue"],
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
21
|
+
setup(n) {
|
|
22
|
+
const s = n, d = b(n, "modelValue"), t = R(() => {
|
|
23
|
+
if (s.showSelectAllItem)
|
|
23
24
|
return {
|
|
24
25
|
icon: "",
|
|
25
|
-
title:
|
|
26
|
+
title: L().Common.Select_all,
|
|
26
27
|
value: "all",
|
|
27
28
|
content: ""
|
|
28
29
|
};
|
|
29
30
|
});
|
|
30
|
-
return (
|
|
31
|
-
|
|
32
|
-
opener:
|
|
33
|
-
|
|
31
|
+
return (e, r) => (V(), q("div", ie, [
|
|
32
|
+
K(X).state.isMobile ? (V(), w(Y, { key: 0 }, {
|
|
33
|
+
opener: _(() => [
|
|
34
|
+
J(z, {
|
|
34
35
|
class: "top-selectorCompetitors_opener",
|
|
35
36
|
color: "theme",
|
|
36
37
|
icon: "",
|
|
37
38
|
icon2: ""
|
|
38
39
|
}, {
|
|
39
|
-
default:
|
|
40
|
-
var
|
|
40
|
+
default: _(() => {
|
|
41
|
+
var o;
|
|
41
42
|
return [
|
|
42
|
-
|
|
43
|
-
var
|
|
44
|
-
return
|
|
45
|
-
})) == null ? void 0 :
|
|
43
|
+
A(E((o = e.items.find((a) => {
|
|
44
|
+
var u;
|
|
45
|
+
return a.value === ((u = d.value) == null ? void 0 : u[0]);
|
|
46
|
+
})) == null ? void 0 : o.content), 1)
|
|
46
47
|
];
|
|
47
48
|
}),
|
|
48
49
|
_: 1
|
|
49
50
|
})
|
|
50
51
|
]),
|
|
51
|
-
contentList:
|
|
52
|
-
(
|
|
53
|
-
var
|
|
54
|
-
return
|
|
55
|
-
class:
|
|
56
|
-
"top-active": (
|
|
52
|
+
contentList: _(() => [
|
|
53
|
+
(V(!0), q(H, null, Q(e.items, (o, a) => {
|
|
54
|
+
var u;
|
|
55
|
+
return V(), w(Z, {
|
|
56
|
+
class: D({
|
|
57
|
+
"top-active": (u = d.value) == null ? void 0 : u.includes(o.value)
|
|
57
58
|
}),
|
|
58
|
-
"data-top-icon":
|
|
59
|
-
title:
|
|
60
|
-
onClick: () =>
|
|
59
|
+
"data-top-icon": o.icon,
|
|
60
|
+
title: o.title,
|
|
61
|
+
onClick: () => d.value = [o.value]
|
|
61
62
|
}, {
|
|
62
|
-
default:
|
|
63
|
-
|
|
63
|
+
default: _(() => [
|
|
64
|
+
W("span", se, E(o.content), 1)
|
|
64
65
|
]),
|
|
65
66
|
_: 2
|
|
66
67
|
}, 1032, ["class", "data-top-icon", "title", "onClick"]);
|
|
67
68
|
}), 256))
|
|
68
69
|
]),
|
|
69
70
|
_: 1
|
|
70
|
-
})) : (
|
|
71
|
+
})) : (V(), w(ee, {
|
|
71
72
|
key: 1,
|
|
72
|
-
modelValue:
|
|
73
|
-
"onUpdate:modelValue":
|
|
74
|
-
items:
|
|
73
|
+
modelValue: d.value,
|
|
74
|
+
"onUpdate:modelValue": r[0] || (r[0] = (o) => d.value = o),
|
|
75
|
+
items: e.items,
|
|
75
76
|
isMultiple: !0,
|
|
76
77
|
styling: "bar",
|
|
77
78
|
canBeEmptyMultiple: !1,
|
|
78
|
-
selectAllItem:
|
|
79
|
+
selectAllItem: t.value
|
|
79
80
|
}, null, 8, ["modelValue", "items", "selectAllItem"]))
|
|
80
81
|
]));
|
|
81
82
|
}
|
|
82
|
-
}),
|
|
83
|
+
}), ce = {
|
|
83
84
|
"top-selectorCompetitors_opener": "top-selectorCompetitors_opener",
|
|
84
85
|
"top-button": "top-button"
|
|
85
|
-
},
|
|
86
|
-
$style:
|
|
87
|
-
},
|
|
86
|
+
}, de = {
|
|
87
|
+
$style: ce
|
|
88
|
+
}, ve = /* @__PURE__ */ U(ue, [["__cssModules", de]]), ge = (n, s) => {
|
|
89
|
+
const d = L(), t = F(s.value.keys().next().value ?? h), e = R(() => {
|
|
90
|
+
const r = /* @__PURE__ */ new Map();
|
|
91
|
+
if (s.value.forEach((o) => {
|
|
92
|
+
let a = {
|
|
93
|
+
value: o.key,
|
|
94
|
+
title: o.name
|
|
95
|
+
};
|
|
96
|
+
n.addSearcherIcon && (a.icon = le(o.key)), r.set(o.key, a);
|
|
97
|
+
}), n.addCompare && !r.has(h)) {
|
|
98
|
+
const o = {
|
|
99
|
+
value: "",
|
|
100
|
+
title: "--------------------",
|
|
101
|
+
disabled: !0
|
|
102
|
+
};
|
|
103
|
+
r.set(o.value, o);
|
|
104
|
+
const a = {
|
|
105
|
+
value: -1,
|
|
106
|
+
title: d.Common.Compare
|
|
107
|
+
};
|
|
108
|
+
r.set(a.value, a);
|
|
109
|
+
}
|
|
110
|
+
return r;
|
|
111
|
+
});
|
|
112
|
+
return {
|
|
113
|
+
searcherKey: t,
|
|
114
|
+
optionBySearcherKey: e
|
|
115
|
+
};
|
|
116
|
+
}, fe = (n, s) => {
|
|
117
|
+
var r, o, a;
|
|
118
|
+
const d = L(), t = F(h);
|
|
119
|
+
n.modelValue.length === 1 && (t.value = n.modelValue[0]), t.value === h && (n.forFrequency ? t.value = ((o = (r = s.value) == null ? void 0 : r.regionByIndex.values().next().value) == null ? void 0 : o.key) ?? h : t.value = ((a = s.value) == null ? void 0 : a.regionByIndex.keys().next().value) ?? h);
|
|
120
|
+
const e = R(() => {
|
|
121
|
+
var v;
|
|
122
|
+
const u = /* @__PURE__ */ new Map();
|
|
123
|
+
return (v = s.value.regionByIndex) == null || v.forEach((i) => {
|
|
124
|
+
let l = i.name;
|
|
125
|
+
if (n.forFrequency) {
|
|
126
|
+
const S = {
|
|
127
|
+
value: i.key,
|
|
128
|
+
title: l
|
|
129
|
+
};
|
|
130
|
+
u.has(i.key) || u.set(i.key, S);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
i.device && (l += " (" + d.Common["Device_" + i.device] + ")");
|
|
134
|
+
const y = ae(s.value.key || 0, i.lang ?? "");
|
|
135
|
+
y && (l += " / " + y);
|
|
136
|
+
const f = {
|
|
137
|
+
value: i.index,
|
|
138
|
+
title: l,
|
|
139
|
+
icon: i.device ? re(i.device) : void 0
|
|
140
|
+
};
|
|
141
|
+
u.set(i.index, f);
|
|
142
|
+
}), u;
|
|
143
|
+
});
|
|
144
|
+
return B(e, (u, v) => {
|
|
145
|
+
var f;
|
|
146
|
+
if (n.onlySearcher || t.value !== void 0 && u.get(t.value))
|
|
147
|
+
return;
|
|
148
|
+
let i = u.keys().next().value;
|
|
149
|
+
if (t.value === h || i === h) {
|
|
150
|
+
t.value = i;
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
let l = ((f = v == null ? void 0 : v.get(t.value)) == null ? void 0 : f.title) || "", y = -1;
|
|
154
|
+
for (const [S, g] of u.entries()) {
|
|
155
|
+
const m = g.title;
|
|
156
|
+
if (typeof m != "string" || typeof S == "string")
|
|
157
|
+
break;
|
|
158
|
+
if (m === l) {
|
|
159
|
+
i = S;
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
const p = new RegExp(` \\((${d.Common.Device_1}|${d.Common.Device_2})\\)`);
|
|
163
|
+
let x = l, C = 3;
|
|
164
|
+
m.indexOf(x) === -1 && (x = l.replace(/^[^a-zа-я]/i, "").replace(p, ""), C--), m.indexOf(x) === -1 && (x = l.replace(/ \/.*/, ""), C--), m.indexOf(x) === -1 && (x = l.replace(/ \/.*/, ""), x = x.replace(/^[^a-zа-я]/i, "").replace(p, ""), C--), m.indexOf(x) !== -1 && (C <= y || (y = C, i = S));
|
|
165
|
+
}
|
|
166
|
+
t.value = i;
|
|
167
|
+
}), {
|
|
168
|
+
regionIndex: t,
|
|
169
|
+
optionByRegionIndex: e
|
|
170
|
+
};
|
|
171
|
+
}, me = (n, s, d) => {
|
|
172
|
+
const t = F([]), e = () => {
|
|
173
|
+
if (n.onlySearcher && s.value) {
|
|
174
|
+
t.value = Array.from(s.value.keys());
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
let o = [];
|
|
178
|
+
if (n.modelValue.length > 1)
|
|
179
|
+
o = [...n.modelValue];
|
|
180
|
+
else
|
|
181
|
+
try {
|
|
182
|
+
o = JSON.parse(
|
|
183
|
+
localStorage.getItem("ui:project:regionSelector" + n.projectId + ":regionsIndexes")
|
|
184
|
+
) ?? [];
|
|
185
|
+
} catch {
|
|
186
|
+
}
|
|
187
|
+
o.length && (o = o.filter((a) => d.value.has(a))), o.length || (o = Array.from(d.value)), t.value = [...o];
|
|
188
|
+
}, r = () => {
|
|
189
|
+
t.value.length ? localStorage.setItem("ui:project:regionSelector:" + n.projectId + ":regionsIndexes", JSON.stringify(t.value)) : localStorage.removeItem("ui:project:regionSelector:" + n.projectId + ":regionsIndexes");
|
|
190
|
+
};
|
|
191
|
+
return B(t, () => {
|
|
192
|
+
r();
|
|
193
|
+
}), n.addCompare && e(), {
|
|
194
|
+
regionsIndexes: t
|
|
195
|
+
};
|
|
196
|
+
}, ye = (n) => {
|
|
197
|
+
const s = R(() => ne(n.forFrequency, n.autoRegion, n.searchers)), d = R(() => s.value.get(e.searcherKey.value) || oe), t = R(() => {
|
|
198
|
+
const l = /* @__PURE__ */ new Set();
|
|
199
|
+
return s.value.forEach((y) => {
|
|
200
|
+
var f;
|
|
201
|
+
(f = y.regions) == null || f.forEach((S) => {
|
|
202
|
+
S.index !== -1 && S.index !== h && l.add(S.index);
|
|
203
|
+
});
|
|
204
|
+
}), l;
|
|
205
|
+
}), e = ge(n, s), r = fe(n, d), o = me(n, s, t);
|
|
206
|
+
B(s, () => {
|
|
207
|
+
var y, f, S, g, m;
|
|
208
|
+
if (e.searcherKey.value === -1) {
|
|
209
|
+
o.regionsIndexes.value = o.regionsIndexes.value.filter((p) => t.value.has(p));
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
let l = s.value.keys().next().value;
|
|
213
|
+
s.value.forEach((p) => {
|
|
214
|
+
var x, C, c;
|
|
215
|
+
if (r.regionIndex.value && ((x = p.regionByIndex) != null && x.has(r.regionIndex.value)) && (l = p.key), !n.onlySearcher) {
|
|
216
|
+
let I;
|
|
217
|
+
l !== void 0 && (I = (C = s.value.get(l)) == null ? void 0 : C.regionByIndex);
|
|
218
|
+
const k = (c = s.value.get(p.key)) == null ? void 0 : c.regionByIndex;
|
|
219
|
+
I != null && I.has(h) && !(k != null && k.has(h)) && (l = p.key);
|
|
220
|
+
}
|
|
221
|
+
}), n.addCompare && !e.optionBySearcherKey.value.has(h) && !r.regionIndex.value && (y = o.regionsIndexes.value) != null && y.length && (l = -1), n.onlySearcher && r.regionIndex.value !== h && (l = r.regionIndex.value), l !== void 0 && (e.searcherKey.value = l), r.regionIndex.value !== void 0 && !((S = (f = d.value) == null ? void 0 : f.regionByIndex) != null && S.has(r.regionIndex.value)) && (r.regionIndex.value = (m = (g = d.value) == null ? void 0 : g.regions) == null ? void 0 : m.keys().next().value);
|
|
222
|
+
}, { immediate: !0 });
|
|
223
|
+
const a = () => {
|
|
224
|
+
if (!(e.searcherKey.value === -1 || e.searcherKey.value === h))
|
|
225
|
+
return e.searcherKey.value;
|
|
226
|
+
}, u = () => {
|
|
227
|
+
if (n.onlySearcher || r.regionIndex.value === h) return;
|
|
228
|
+
let l = r.regionIndex.value;
|
|
229
|
+
if (n.forFrequency) {
|
|
230
|
+
const y = r.regionIndex.value, f = te(n.forFrequency, { searcher_key: a(), key: y }, n.searchers);
|
|
231
|
+
l = f == null ? void 0 : f.index;
|
|
232
|
+
}
|
|
233
|
+
return l;
|
|
234
|
+
}, v = () => {
|
|
235
|
+
const l = a();
|
|
236
|
+
if (l !== void 0)
|
|
237
|
+
return s.value.get(l);
|
|
238
|
+
};
|
|
239
|
+
return {
|
|
240
|
+
selectSearcher: e,
|
|
241
|
+
selectRegion: r,
|
|
242
|
+
compare: o,
|
|
243
|
+
searcherByKey: s,
|
|
244
|
+
allRegionsIndexes: t,
|
|
245
|
+
getSearcher: v,
|
|
246
|
+
getRegion: () => {
|
|
247
|
+
var y, f;
|
|
248
|
+
const l = u();
|
|
249
|
+
if (l !== void 0)
|
|
250
|
+
return (f = (y = v()) == null ? void 0 : y.regionByIndex) == null ? void 0 : f.get(l);
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
}, he = /* @__PURE__ */ j({
|
|
254
|
+
__name: "selectorRegion",
|
|
255
|
+
props: /* @__PURE__ */ N({
|
|
256
|
+
projectId: {},
|
|
257
|
+
searchers: { default: () => [] },
|
|
258
|
+
modelValue: {},
|
|
259
|
+
modelValueSingle: {},
|
|
260
|
+
addCompare: { type: Boolean },
|
|
261
|
+
forFrequency: { type: Boolean },
|
|
262
|
+
autoRegion: { type: Boolean },
|
|
263
|
+
onlySearcher: { type: Boolean },
|
|
264
|
+
addChanger: { type: Boolean, default: !0 },
|
|
265
|
+
addSearcherIcon: { type: Boolean, default: !0 },
|
|
266
|
+
addRegionIcon: { type: Boolean, default: !0 }
|
|
267
|
+
}, {
|
|
268
|
+
modelValue: { required: !0 },
|
|
269
|
+
modelModifiers: {},
|
|
270
|
+
modelValueSingle: {},
|
|
271
|
+
modelValueSingleModifiers: {}
|
|
272
|
+
}),
|
|
273
|
+
emits: /* @__PURE__ */ N(["compareRegions"], ["update:modelValue", "update:modelValueSingle"]),
|
|
274
|
+
setup(n, { expose: s, emit: d }) {
|
|
275
|
+
const t = n, e = b(n, "modelValue"), r = b(n, "modelValueSingle"), o = d, {
|
|
276
|
+
selectSearcher: a,
|
|
277
|
+
selectRegion: u,
|
|
278
|
+
compare: v,
|
|
279
|
+
searcherByKey: i,
|
|
280
|
+
allRegionsIndexes: l,
|
|
281
|
+
getSearcher: y,
|
|
282
|
+
getRegion: f
|
|
283
|
+
} = ye(t), S = () => {
|
|
284
|
+
var g;
|
|
285
|
+
if (window.fieldTemplates && ((g = window.fieldTemplates) != null && g.openSelectorRegions)) {
|
|
286
|
+
window.fieldTemplates.openSelectorRegions(
|
|
287
|
+
i.value,
|
|
288
|
+
v.regionsIndexes.value,
|
|
289
|
+
(m) => v.regionsIndexes.value = m
|
|
290
|
+
);
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
o("compareRegions", i.value);
|
|
294
|
+
};
|
|
295
|
+
return B([u.regionIndex, a.searcherKey, v.regionsIndexes], () => {
|
|
296
|
+
if (a.searcherKey.value === -1 && v.regionsIndexes.value.length) {
|
|
297
|
+
if (JSON.stringify(e.value) === JSON.stringify(v.regionsIndexes.value))
|
|
298
|
+
return;
|
|
299
|
+
e.value = [...v.regionsIndexes.value];
|
|
300
|
+
} else
|
|
301
|
+
e.value = [t.onlySearcher ? a.searcherKey.value : u.regionIndex.value];
|
|
302
|
+
l.value.size || (a.searcherKey.value = h);
|
|
303
|
+
}), r.value && B(r, () => {
|
|
304
|
+
e.value = [r.value];
|
|
305
|
+
}, { immediate: !0 }), B(e, () => {
|
|
306
|
+
var g, m, p, x, C;
|
|
307
|
+
if (e.value[0] && (r.value = e.value[0]), t.onlySearcher) {
|
|
308
|
+
if (!e.value.length || e.value.length === 1 && !i.value.has(e.value[0])) {
|
|
309
|
+
let c = i.value.keys().next().value;
|
|
310
|
+
c !== void 0 && (e.value = [c]);
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
if (e.value.length > 1 && JSON.stringify(e.value) !== JSON.stringify(v.regionsIndexes.value)) {
|
|
314
|
+
e.value = [...v.regionsIndexes.value];
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
} else {
|
|
318
|
+
let c = [...new Set(e.value)], I = (m = (g = i.value.values().next().value) == null ? void 0 : g.regionByIndex) == null ? void 0 : m.keys().next().value;
|
|
319
|
+
if (t.forFrequency && (I = (C = (x = (p = i.value.values().next().value) == null ? void 0 : p.regionByIndex) == null ? void 0 : x.values().next().value) == null ? void 0 : C.key), !c.length)
|
|
320
|
+
I !== void 0 && c.push(I);
|
|
321
|
+
else if (c.length === 1) {
|
|
322
|
+
let k = l.value;
|
|
323
|
+
t.forFrequency && (k = /* @__PURE__ */ new Set(), i.value.forEach((O) => {
|
|
324
|
+
O.regionByIndex.forEach((M) => {
|
|
325
|
+
M.index !== -1 && M.index !== h && k.add(M.key);
|
|
326
|
+
});
|
|
327
|
+
})), !k.has(c[0]) && c[0] !== -2 && (c = [], I !== void 0 && c.push(I));
|
|
328
|
+
} else
|
|
329
|
+
c = c.filter((k) => l.value.has(k)), !c.length && I !== void 0 && c.push(I);
|
|
330
|
+
if (JSON.stringify(e.value) !== JSON.stringify(c)) {
|
|
331
|
+
e.value = c;
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
if (!(e.value.length === 1 && e.value[0] === (t.onlySearcher ? a.searcherKey.value : u.regionIndex.value)))
|
|
336
|
+
if (t.onlySearcher) {
|
|
337
|
+
if (e.value.length === 1) {
|
|
338
|
+
a.searcherKey.value = e.value[0];
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
a.searcherKey.value = -1;
|
|
342
|
+
return;
|
|
343
|
+
} else if (e.value.length === 1 && a.searcherKey.value !== -1) {
|
|
344
|
+
u.regionIndex.value = e.value[0];
|
|
345
|
+
let c;
|
|
346
|
+
for (const I of i.value.values()) {
|
|
347
|
+
for (const k of I.regionByIndex.values())
|
|
348
|
+
if ((t.forFrequency ? k.key : k.index) === u.regionIndex.value) {
|
|
349
|
+
c = I.key;
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
if (c !== void 0)
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
c !== void 0 && (a.searcherKey.value = c);
|
|
356
|
+
} else
|
|
357
|
+
a.searcherKey.value = -1, v.regionsIndexes.value = [...e.value];
|
|
358
|
+
}, { immediate: !0 }), s({
|
|
359
|
+
getSearcher: y,
|
|
360
|
+
getRegion: f
|
|
361
|
+
}), (g, m) => (V(), q("div", {
|
|
362
|
+
class: D({
|
|
363
|
+
"top-selectorRegion": !0,
|
|
364
|
+
"top-selectorRegion-onlySearcher": g.onlySearcher
|
|
365
|
+
})
|
|
366
|
+
}, [
|
|
367
|
+
J($, {
|
|
368
|
+
options: K(a).optionBySearcherKey.value,
|
|
369
|
+
modelValue: K(a).searcherKey.value,
|
|
370
|
+
"onUpdate:modelValue": m[0] || (m[0] = (p) => K(a).searcherKey.value = p),
|
|
371
|
+
name: "searcher_key",
|
|
372
|
+
addChanger: g.addChanger
|
|
373
|
+
}, null, 8, ["options", "modelValue", "addChanger"]),
|
|
374
|
+
!g.onlySearcher && K(a).searcherKey.value !== -1 ? (V(), w($, {
|
|
375
|
+
key: 0,
|
|
376
|
+
class: "top-select-region",
|
|
377
|
+
options: K(u).optionByRegionIndex.value,
|
|
378
|
+
modelValue: K(u).regionIndex.value,
|
|
379
|
+
"onUpdate:modelValue": m[1] || (m[1] = (p) => K(u).regionIndex.value = p),
|
|
380
|
+
name: g.forFrequency ? "region_key" : "region_index",
|
|
381
|
+
addChanger: g.addChanger,
|
|
382
|
+
"data-top-icon": g.addRegionIcon ? "" : void 0
|
|
383
|
+
}, null, 8, ["options", "modelValue", "name", "addChanger", "data-top-icon"])) : T("", !0),
|
|
384
|
+
g.addCompare && !g.onlySearcher && K(a).searcherKey.value === -1 ? (V(), w(z, {
|
|
385
|
+
key: 1,
|
|
386
|
+
name: "compare",
|
|
387
|
+
onClick: S,
|
|
388
|
+
"data-count-compare-regions-indexes": K(v).regionsIndexes.value.length
|
|
389
|
+
}, {
|
|
390
|
+
default: _(() => [
|
|
391
|
+
A(E(g.$i18n.Common.Selected_regions), 1)
|
|
392
|
+
]),
|
|
393
|
+
_: 1
|
|
394
|
+
}, 8, ["data-count-compare-regions-indexes"])) : T("", !0)
|
|
395
|
+
], 2));
|
|
396
|
+
}
|
|
397
|
+
}), pe = {
|
|
398
|
+
"top-select-searcher_key": "top-select-searcher_key",
|
|
399
|
+
"top-selectorRegion": "top-selectorRegion",
|
|
400
|
+
"top-select": "top-select",
|
|
401
|
+
"top-select_select": "top-select_select",
|
|
402
|
+
"top-error": "top-error",
|
|
403
|
+
"top-select-region": "top-select-region",
|
|
404
|
+
"top-selectorRegion-onlySearcher": "top-selectorRegion-onlySearcher"
|
|
405
|
+
}, xe = {
|
|
406
|
+
$style: pe
|
|
407
|
+
}, Ie = /* @__PURE__ */ U(he, [["__cssModules", xe]]), _e = ve, we = Ie;
|
|
88
408
|
export {
|
|
89
|
-
|
|
409
|
+
_e as TopSelectorCompetitors,
|
|
410
|
+
we as TopSelectorRegion
|
|
90
411
|
};
|
|
91
412
|
//# sourceMappingURL=project.js.map
|
package/project/project.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.js","sources":["../../src/components/project/selectorCompetitors/selectorCompetitors.vue","../../src/components/project/project.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { computed } from 'vue';\r\nimport type { Props } from './selectorCompetitors';\r\nimport Core from '@/core/core/core';\r\nimport Button from '@/components/forms/button/button.vue';\r\nimport Popup from '@/components/popup/popup/popup.vue';\r\nimport ListItem from '@/components/popup/popup/listItem.vue';\r\nimport Menu from '@/components/formsExt/menu/menu.vue';\r\nimport { useI18n } from '@/core/plugins/i18n';\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tshowSelectAllItem: true,\r\n});\r\nconst model = defineModel<Props['modelValue']>();\r\n\r\nconst selectAllItem = computed(() => {\r\n\tif (props.showSelectAllItem) {\r\n\t\treturn {\r\n\t\t\ticon: '',\r\n\t\t\ttitle: useI18n().Common.Select_all,\r\n\t\t\tvalue: 'all',\r\n\t\t\tcontent: '',\r\n\t\t};\r\n\t}\r\n});\r\n</script>\r\n\r\n<template>\r\n\t<div class=\"top-selectorCompetitors\">\r\n\t\t<Popup v-if=\"Core.state.isMobile\">\r\n\t\t\t<template #opener>\r\n\t\t\t\t<Button\r\n\t\t\t\t\tclass=\"top-selectorCompetitors_opener\"\r\n\t\t\t\t\tcolor=\"theme\"\r\n\t\t\t\t\ticon=\"\"\r\n\t\t\t\t\ticon2=\"\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{{ items.find((item) => item.value === model?.[0])?.content }}\r\n\t\t\t\t</Button>\r\n\t\t\t</template>\r\n\r\n\t\t\t<template #contentList>\r\n\t\t\t\t<ListItem\r\n\t\t\t\t\tv-for=\"(item, index) in items\"\r\n\t\t\t\t\t:class=\"{\r\n\t\t\t\t\t\t'top-active': model?.includes(item.value)\r\n\t\t\t\t\t}\"\r\n\t\t\t\t\t:data-top-icon=\"item.icon\"\r\n\t\t\t\t\t:title=\"item.title\"\r\n\t\t\t\t\t@click=\"() => model = [item.value]\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<span class=\"top-ellipsis1\">\r\n\t\t\t\t\t\t{{ item.content }}\r\n\t\t\t\t\t</span>\r\n\t\t\t\t</ListItem>\r\n\t\t\t</template>\r\n\t\t</Popup>\r\n\r\n\t\t<Menu\r\n\t\t\tv-else\r\n\t\t\tv-model=\"model\"\r\n\t\t\t:items=\"items\"\r\n\t\t\t:isMultiple=\"true\"\r\n\t\t\tstyling=\"bar\"\r\n\t\t\t:canBeEmptyMultiple=\"false\"\r\n\t\t\t:selectAllItem=\"selectAllItem\"\r\n\t\t/>\r\n\t</div>\r\n</template>\r\n\r\n<style module>\r\n.top-selectorCompetitors_opener.top-button {\r\n\twidth: 100%;\r\n}\r\n</style>\r\n","import type { ComponentCustomProps } from 'vue';\r\n\r\nimport SelectorCompetitors from './selectorCompetitors/selectorCompetitors.vue';\r\n\r\nexport const TopSelectorCompetitors = SelectorCompetitors as typeof SelectorCompetitors & ComponentCustomProps;\r\n"],"names":["props","__props","model","useModel","selectAllItem","computed","useI18n","TopSelectorCompetitors","SelectorCompetitors"],"mappings":";;;;;;;;;;;;;;;;;;;;AAUA,UAAAA,IAAAC,GAGAC,IAAAC,EAAAF,GAAA,YAAA,GAEAG,IAAAC,EAAA,MAAA;AACC,UAAAL,EAAA;AACC,eAAA;AAAA,UAAO,MAAA;AAAA,UACA,OAAAM,EAAA,EAAA,OAAA;AAAA,UACkB,OAAA;AAAA,UACjB,SAAA;AAAA,QACE;AAAA,IAEX,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oDCnBMC,IAAAC;"}
|
|
1
|
+
{"version":3,"file":"project.js","sources":["../../src/components/project/selectorCompetitors/selectorCompetitors.vue","../../src/components/project/selectorRegion/composables/selectSearcher.ts","../../src/components/project/selectorRegion/composables/selectRegion.ts","../../src/components/project/selectorRegion/composables/compare.ts","../../src/components/project/selectorRegion/composables/selectorRegion.ts","../../src/components/project/selectorRegion/selectorRegion.vue","../../src/components/project/project.ts"],"sourcesContent":["<script setup lang=\"ts\">\r\nimport { computed } from 'vue';\r\nimport type { Props } from './selectorCompetitors';\r\nimport Core from '@/core/core/core';\r\nimport Button from '@/components/forms/button/button.vue';\r\nimport Popup from '@/components/popup/popup/popup.vue';\r\nimport ListItem from '@/components/popup/popup/listItem.vue';\r\nimport Menu from '@/components/formsExt/menu/menu.vue';\r\nimport { useI18n } from '@/core/plugins/i18n';\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tshowSelectAllItem: true,\r\n});\r\nconst model = defineModel<Props['modelValue']>();\r\n\r\nconst selectAllItem = computed(() => {\r\n\tif (props.showSelectAllItem) {\r\n\t\treturn {\r\n\t\t\ticon: '',\r\n\t\t\ttitle: useI18n().Common.Select_all,\r\n\t\t\tvalue: 'all',\r\n\t\t\tcontent: '',\r\n\t\t};\r\n\t}\r\n});\r\n</script>\r\n\r\n<template>\r\n\t<div class=\"top-selectorCompetitors\">\r\n\t\t<Popup v-if=\"Core.state.isMobile\">\r\n\t\t\t<template #opener>\r\n\t\t\t\t<Button\r\n\t\t\t\t\tclass=\"top-selectorCompetitors_opener\"\r\n\t\t\t\t\tcolor=\"theme\"\r\n\t\t\t\t\ticon=\"\"\r\n\t\t\t\t\ticon2=\"\"\r\n\t\t\t\t>\r\n\t\t\t\t\t{{ items.find((item) => item.value === model?.[0])?.content }}\r\n\t\t\t\t</Button>\r\n\t\t\t</template>\r\n\r\n\t\t\t<template #contentList>\r\n\t\t\t\t<ListItem\r\n\t\t\t\t\tv-for=\"(item, index) in items\"\r\n\t\t\t\t\t:class=\"{\r\n\t\t\t\t\t\t'top-active': model?.includes(item.value)\r\n\t\t\t\t\t}\"\r\n\t\t\t\t\t:data-top-icon=\"item.icon\"\r\n\t\t\t\t\t:title=\"item.title\"\r\n\t\t\t\t\t@click=\"() => model = [item.value]\"\r\n\t\t\t\t>\r\n\t\t\t\t\t<span class=\"top-ellipsis1\">\r\n\t\t\t\t\t\t{{ item.content }}\r\n\t\t\t\t\t</span>\r\n\t\t\t\t</ListItem>\r\n\t\t\t</template>\r\n\t\t</Popup>\r\n\r\n\t\t<Menu\r\n\t\t\tv-else\r\n\t\t\tv-model=\"model\"\r\n\t\t\t:items=\"items\"\r\n\t\t\t:isMultiple=\"true\"\r\n\t\t\tstyling=\"bar\"\r\n\t\t\t:canBeEmptyMultiple=\"false\"\r\n\t\t\t:selectAllItem=\"selectAllItem\"\r\n\t\t/>\r\n\t</div>\r\n</template>\r\n\r\n<style module>\r\n.top-selectorCompetitors_opener.top-button {\r\n\twidth: 100%;\r\n}\r\n</style>\r\n","import { computed, type ComputedRef, ref } from 'vue';\r\nimport { useI18n } from '@/core/plugins/i18n';\r\nimport type { Props, SearcherByKey } from '../selectorRegion';\r\nimport type { Option, Options } from '@/components/forms/select/select';\r\nimport { dummyIndex } from '../utils/consts';\r\nimport { getSearcherGIcon } from '@/core/utils/searchers';\r\n\r\n/**\r\n * Создание и управление реактивными переменными для выбора ПС\r\n *\r\n * @param props - входные props компонента\r\n * @param mapSearchers - Map ПС (реактивная)\r\n */\r\nexport const useSelectSearcher = (\r\n\tprops: Props,\r\n\tmapSearchers: ComputedRef<SearcherByKey>,\r\n) => {\r\n\tconst i18n = useI18n();\r\n\r\n\t/**\r\n\t * Ключ выбранной поисковой системы\r\n\t */\r\n\tconst searcherKey = ref(mapSearchers.value.keys().next().value ?? dummyIndex);\r\n\r\n\t/**\r\n\t * Коллекция опций для выбора ПС\r\n\t */\r\n\tconst optionBySearcherKey = computed(() => {\r\n\t\tconst res: Options = new Map();\r\n\t\tmapSearchers.value.forEach((searcher) => {\r\n\t\t\tlet option: Option = {\r\n\t\t\t\tvalue: searcher.key,\r\n\t\t\t\ttitle: searcher.name,\r\n\t\t\t};\r\n\r\n\t\t\tif (props.addSearcherIcon) option.icon = getSearcherGIcon(searcher.key);\r\n\r\n\t\t\tres.set(searcher.key, option);\r\n\t\t});\r\n\r\n\t\t// добавить режим сравнения, если есть хотя бы одна ПС\r\n\t\tif (props.addCompare && !res.has(dummyIndex)) {\r\n\t\t\tconst dummyOption: Option = {\r\n\t\t\t\tvalue: '',\r\n\t\t\t\ttitle: '--------------------',\r\n\t\t\t\tdisabled: true,\r\n\t\t\t};\r\n\t\t\tres.set(dummyOption.value, dummyOption);\r\n\r\n\t\t\tconst compareOption: Option = {\r\n\t\t\t\tvalue: -1,\r\n\t\t\t\ttitle: i18n.Common.Compare!,\r\n\t\t\t};\r\n\t\t\tres.set(compareOption.value, compareOption);\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t});\r\n\r\n\treturn {\r\n\t\tsearcherKey,\r\n\t\toptionBySearcherKey,\r\n\t};\r\n};\r\n","import { computed, type ComputedRef, ref, watch } from 'vue';\r\nimport { useI18n } from '@/core/plugins/i18n';\r\nimport { getDeviceGIcon, getLangLabel } from '@/core/utils/searchers';\r\nimport type { Option } from '@/components/forms/select/select';\r\nimport { dummyIndex } from '../utils/consts';\r\nimport type { Props, Region, SearcherIndexed } from '../selectorRegion';\r\n\r\n/**\r\n * Создание и управление реактивными переменными для выбора региона\r\n *\r\n * @param props - входные props компонента\r\n * @param activeSearcherIndexed - объект активной поисковой системы (реактивная)\r\n * @param regionsIndexes - входные индексы регионов/ПС\r\n */\r\nexport const useSelectRegion = (props: Props, activeSearcherIndexed: ComputedRef<SearcherIndexed>) => {\r\n\tconst i18n = useI18n();\r\n\r\n\t/**\r\n\t * Индекс выбранного региона\r\n\t */\r\n\tconst regionIndex = ref(dummyIndex);\r\n\r\n\tif (props.modelValue.length === 1) {\r\n\t\tregionIndex.value = props.modelValue[0];\r\n\t}\r\n\r\n\tif (regionIndex.value === dummyIndex) {\r\n\t\tif (props.forFrequency) {\r\n\t\t\t// в качетсве ключа используется region.key, а не region.index\r\n\t\t\tregionIndex.value = activeSearcherIndexed.value?.regionByIndex.values().next().value?.key ?? dummyIndex;\r\n\t\t} else {\r\n\t\t\tregionIndex.value = activeSearcherIndexed.value?.regionByIndex.keys().next().value ?? dummyIndex;\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t * Коллекция опций для выбора региона\r\n\t */\r\n\tconst optionByRegionIndex = computed(() => {\r\n\t\tconst options = new Map<number, Option>();\r\n\r\n\t\tactiveSearcherIndexed.value.regionByIndex?.forEach((region) => {\r\n\t\t\tlet regionLabel = region.name;\r\n\r\n\t\t\t// на частоту в текущей версии устройство и язык не влияют\r\n\t\t\t// обратите внимание, в качетсве ключа используется region.key, а не region.index\r\n\t\t\tif (props.forFrequency) {\r\n\t\t\t\tconst option: Option = {\r\n\t\t\t\t\tvalue: region.key,\r\n\t\t\t\t\ttitle: regionLabel,\r\n\t\t\t\t};\r\n\t\t\t\tif (!options.has(region.key)) options.set(region.key, option);\r\n\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tif (region.device) {\r\n\t\t\t\tregionLabel += ' (' + i18n.Common['Device_' + region.device] + ')';\r\n\t\t\t}\r\n\r\n\t\t\tconst langLabel = getLangLabel(activeSearcherIndexed.value.key || 0, region.lang ?? '');\r\n\t\t\tif (langLabel) regionLabel += ' / ' + langLabel;\r\n\r\n\t\t\tconst option: Option = {\r\n\t\t\t\tvalue: region.index,\r\n\t\t\t\ttitle: regionLabel,\r\n\t\t\t\ticon: region.device ? getDeviceGIcon(region.device) : undefined,\r\n\t\t\t};\r\n\r\n\t\t\toptions.set(region.index, option);\r\n\t\t});\r\n\r\n\t\treturn options;\r\n\t});\r\n\r\n\t/**\r\n\t * Выбор максимально похожего региона в новой коллекции регионов\r\n\t */\r\n\twatch(optionByRegionIndex, (optionByRegionIndex, oldOptionByRegionIndex) => {\r\n\t\tif (props.onlySearcher || regionIndex.value !== undefined && optionByRegionIndex.get(regionIndex.value)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet newRegionIndex = optionByRegionIndex.keys().next().value as Region['index'];\r\n\t\tif (regionIndex.value === dummyIndex || newRegionIndex === dummyIndex) {\r\n\t\t\tregionIndex.value = newRegionIndex;\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet regionName = (oldOptionByRegionIndex?.get(regionIndex.value) as Option)?.title || '';\r\n\t\tlet regionMatchLevel = -1;\r\n\t\tfor (const [index, option] of optionByRegionIndex.entries()) {\r\n\t\t\tconst title = (option as Option).title;\r\n\r\n\t\t\tif (typeof title !== 'string' || typeof index === 'string') {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\t// полное совпадение\r\n\t\t\tif (title === regionName) {\r\n\t\t\t\tnewRegionIndex = index;\r\n\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tconst regexpDevice = new RegExp(` \\\\((${i18n.Common['Device_1']}|${i18n.Common['Device_2']})\\\\)`);\r\n\t\t\tlet regionNameCompare = regionName;\r\n\t\t\tlet regionMatchLevelI = 3;\r\n\r\n\t\t\t// без устройства\r\n\t\t\tif (title.indexOf(regionNameCompare) === -1) {\r\n\t\t\t\tregionNameCompare = regionName.replace(/^[^a-zа-я]/i, '').replace(regexpDevice, '');\r\n\r\n\t\t\t\tregionMatchLevelI--;\r\n\t\t\t}\r\n\r\n\t\t\t// без языка\r\n\t\t\tif (title.indexOf(regionNameCompare) === -1) {\r\n\t\t\t\tregionNameCompare = regionName.replace(/ \\/.*/, '');\r\n\r\n\t\t\t\tregionMatchLevelI--;\r\n\t\t\t}\r\n\r\n\t\t\t// без устройства и без языка\r\n\t\t\tif (title.indexOf(regionNameCompare) === -1) {\r\n\t\t\t\tregionNameCompare = regionName.replace(/ \\/.*/, '');\r\n\t\t\t\tregionNameCompare = regionNameCompare.replace(/^[^a-zа-я]/i, '').replace(regexpDevice, '');\r\n\r\n\t\t\t\tregionMatchLevelI--;\r\n\t\t\t}\r\n\r\n\t\t\tif (title.indexOf(regionNameCompare) === -1) continue;\r\n\t\t\tif (regionMatchLevelI <= regionMatchLevel) continue;\r\n\r\n\t\t\tregionMatchLevel = regionMatchLevelI;\r\n\t\t\tnewRegionIndex = index;\r\n\t\t}\r\n\r\n\t\tregionIndex.value = newRegionIndex;\r\n\t});\r\n\r\n\treturn {\r\n\t\tregionIndex,\r\n\t\toptionByRegionIndex,\r\n\t};\r\n};\r\n","import { type ComputedRef, ref, watch } from 'vue';\r\nimport type { Props, SearcherByKey } from '../selectorRegion';\r\n\r\n/**\r\n * Создание и управление реактивными переменными для сравнения\r\n *\r\n * @param props - входные props компонента\r\n * @param searcherByKey - Map ПС (реактивная)\r\n * @param allRegionsIndexes - Все доступные индексы регионов (реактивная)\r\n */\r\nexport const useCompare = (props: Props, searcherByKey: ComputedRef<SearcherByKey>, allRegionsIndexes: ComputedRef<Set<number>>) => {\r\n\t/**\r\n\t * Индексы регионов/ПС в сравнение\r\n\t */\r\n\tconst regionsIndexes = ref([] as number[]);\r\n\r\n\t/**\r\n\t * Загрузка индексов регионов для сравнения\r\n\t *\r\n\t * Если в modelValue передано несколько регионов, они будут установлены как выбранные для сравнения\r\n\t */\r\n\tconst compareLoad = () => {\r\n\t\tif (props.onlySearcher && searcherByKey.value) {\r\n\t\t\tregionsIndexes.value = Array.from(searcherByKey.value.keys());\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet regionsIndexesSaved: Props['modelValue'] = [];\r\n\r\n\t\tif (props.modelValue.length > 1) {\r\n\t\t\tregionsIndexesSaved = [...props.modelValue];\r\n\t\t} else {\r\n\t\t\ttry {\r\n\t\t\t\t// загрузить индексы регионов, если они были сохранены\r\n\t\t\t\tregionsIndexesSaved = JSON.parse(\r\n\t\t\t\t\tlocalStorage.getItem('ui:project:regionSelector' + props.projectId + ':regionsIndexes') as string,\r\n\t\t\t\t) ?? [];\r\n\t\t\t} catch (e) {\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// убрать из сравнения регионы, которых нет в props.searchers\r\n\t\tif (regionsIndexesSaved.length) {\r\n\t\t\tregionsIndexesSaved = regionsIndexesSaved.filter((regionIndex) => {\r\n\t\t\t\treturn allRegionsIndexes.value.has(regionIndex);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t// если не сохранено ни одного региона, выбрать все регионы проекта\r\n\t\tif (!regionsIndexesSaved.length) {\r\n\t\t\tregionsIndexesSaved = Array.from(allRegionsIndexes.value);\r\n\t\t}\r\n\r\n\t\tregionsIndexes.value = [...regionsIndexesSaved];\r\n\t};\r\n\r\n\t/**\r\n\t * Сохранение выбранных регионов\r\n\t */\r\n\tconst compareSave = () => {\r\n\t\tif (regionsIndexes.value.length) {\r\n\t\t\tlocalStorage.setItem('ui:project:regionSelector:' + props.projectId + ':regionsIndexes', JSON.stringify(regionsIndexes.value));\r\n\t\t} else {\r\n\t\t\tlocalStorage.removeItem('ui:project:regionSelector:' + props.projectId + ':regionsIndexes');\r\n\t\t}\r\n\t};\r\n\r\n\twatch(regionsIndexes, () => {\r\n\t\tcompareSave();\r\n\t});\r\n\r\n\tif (props.addCompare) {\r\n\t\t// if (props.compareRegionsIndexes?.length) {\r\n\t\t// \tcompareRegionsIndexes.value = [...props.compareRegionsIndexes];\r\n\t\t// } else {\r\n\t\t// \tcompareLoad();\r\n\t\t// }\r\n\r\n\t\tcompareLoad();\r\n\t}\r\n\r\n\treturn {\r\n\t\tregionsIndexes,\r\n\t};\r\n};\r\n","import { computed, watch } from 'vue';\r\nimport { findRegion, genSearcherByKey } from '../utils/utils';\r\nimport { dummyIndex, searcherUndefined } from '../utils/consts';\r\nimport type { Props, Region, SearcherIndexed } from '../selectorRegion';\r\nimport { useSelectSearcher } from './selectSearcher';\r\nimport { useSelectRegion } from './selectRegion';\r\nimport { useCompare } from './compare';\r\n\r\n/**\r\n * Создание и управления рективными переменными компонента\r\n *\r\n * @param props - входные props компонента\r\n */\r\nexport const useSelectorRegion = (props: Props) => {\r\n\tconst searcherByKey = computed(() => {\r\n\t\treturn genSearcherByKey(props.forFrequency, props.autoRegion, props.searchers);\r\n\t});\r\n\r\n\tconst activeSearcherIndexed = computed(() => {\r\n\t\treturn searcherByKey.value.get(selectSearcher.searcherKey.value) || searcherUndefined;\r\n\t});\r\n\r\n\t/**\r\n\t * Все индексы регионов из mapSearchers\r\n\t */\r\n\tconst allRegionsIndexes = computed(() => {\r\n\t\tconst regionsIndexes = new Set<number>();\r\n\r\n\t\tsearcherByKey.value.forEach((searcher) => {\r\n\t\t\tsearcher.regions?.forEach((region) => {\r\n\t\t\t\tif (region.index === -1) return;\r\n\t\t\t\tif (region.index === dummyIndex) return;\r\n\r\n\t\t\t\tregionsIndexes.add(region.index);\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\treturn regionsIndexes;\r\n\t});\r\n\r\n\tconst selectSearcher = useSelectSearcher(props, searcherByKey);\r\n\tconst selectRegion = useSelectRegion(props, activeSearcherIndexed);\r\n\tconst compare = useCompare(props, searcherByKey, allRegionsIndexes);\r\n\r\n\t// контроль за внешним изменением списка ПС\r\n\twatch(searcherByKey, () => {\r\n\t\t// возможные значения для сравнения регионов\r\n\t\tif (selectSearcher.searcherKey.value === -1) {\r\n\t\t\tcompare.regionsIndexes.value = compare.regionsIndexes.value.filter(regionIndex => {\r\n\t\t\t\treturn allRegionsIndexes.value.has(regionIndex);\r\n\t\t\t});\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tlet newSearcherKey = searcherByKey.value.keys().next().value;\r\n\r\n\t\tsearcherByKey.value.forEach((searcher) => {\r\n\t\t\t// определить выбранную ПС\r\n\t\t\tif (\r\n\t\t\t\tselectRegion.regionIndex.value &&\r\n\t\t\t\tsearcher.regionByIndex?.has(selectRegion.regionIndex.value)\r\n\t\t\t) {\r\n\t\t\t\tnewSearcherKey = searcher.key;\r\n\t\t\t}\r\n\r\n\t\t\t// выбрать первую ПС с выбранным регионом\r\n\t\t\tif (!props.onlySearcher) {\r\n\t\t\t\tlet regionsNewSearcher: SearcherIndexed['regionByIndex'] | undefined;\r\n\r\n\t\t\t\tif (newSearcherKey !== undefined) {\r\n\t\t\t\t\tregionsNewSearcher = searcherByKey.value.get(newSearcherKey)?.regionByIndex;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tconst regionsCurrentSearcher = searcherByKey.value.get(searcher.key)?.regionByIndex;\r\n\t\t\t\tif (\r\n\t\t\t\t\tregionsNewSearcher?.has(dummyIndex) &&\r\n\t\t\t\t\t!regionsCurrentSearcher?.has(dummyIndex)\r\n\t\t\t\t) {\r\n\t\t\t\t\tnewSearcherKey = searcher.key;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tif (props.addCompare && !selectSearcher.optionBySearcherKey.value.has(dummyIndex)) {\r\n\t\t\tif (!selectRegion.regionIndex.value && compare.regionsIndexes.value?.length) newSearcherKey = -1;\r\n\t\t}\r\n\r\n\t\tif (props.onlySearcher && selectRegion.regionIndex.value !== dummyIndex) newSearcherKey = selectRegion.regionIndex.value;\r\n\r\n\t\tif (newSearcherKey !== undefined) {\r\n\t\t\tselectSearcher.searcherKey.value = newSearcherKey;\r\n\t\t}\r\n\r\n\t\tif (\r\n\t\t\tselectRegion.regionIndex.value !== undefined &&\r\n\t\t\t!(activeSearcherIndexed.value?.regionByIndex)?.has(selectRegion.regionIndex.value)\r\n\t\t) {\r\n\t\t\tselectRegion.regionIndex.value = activeSearcherIndexed.value?.regions?.keys().next().value as number;\r\n\t\t}\r\n\t}, { immediate: true });\r\n\r\n\tconst getSearcherKey = () => {\r\n\t\tif (selectSearcher.searcherKey.value === -1 || selectSearcher.searcherKey.value === dummyIndex) return;\r\n\r\n\t\treturn selectSearcher.searcherKey.value;\r\n\t};\r\n\r\n\tconst getRegionIndex = () => {\r\n\t\tif (props.onlySearcher) return;\r\n\r\n\t\tif (selectRegion.regionIndex.value === dummyIndex) return;\r\n\r\n\t\tlet res: Region['index'] | undefined = selectRegion.regionIndex.value;\r\n\r\n\t\t// в качестве ключа используется region.key\r\n\t\tif (props.forFrequency) {\r\n\t\t\tconst regionKey = selectRegion.regionIndex.value;\r\n\t\t\tconst region = findRegion(props.forFrequency, { searcher_key: getSearcherKey(), key: regionKey } as Region, props.searchers);\r\n\r\n\t\t\tres = region?.index;\r\n\t\t}\r\n\r\n\t\treturn res;\r\n\t};\r\n\r\n\t/**\r\n\t * Получить выбранную ПС\r\n\t */\r\n\tconst getSearcher = () => {\r\n\t\tconst searcherKey = getSearcherKey();\r\n\t\tif (searcherKey === undefined) return;\r\n\r\n\t\treturn searcherByKey.value.get(searcherKey);\r\n\t};\r\n\r\n\t/**\r\n\t * Получить выбранный регион\r\n\t */\r\n\tconst getRegion = () => {\r\n\t\tconst regionIndex = getRegionIndex();\r\n\t\tif (regionIndex === undefined) return;\r\n\r\n\t\treturn getSearcher()?.regionByIndex?.get(regionIndex);\r\n\t};\r\n\r\n\treturn {\r\n\t\tselectSearcher,\r\n\t\tselectRegion,\r\n\t\tcompare,\r\n\r\n\t\tsearcherByKey,\r\n\t\tallRegionsIndexes,\r\n\r\n\t\tgetSearcher,\r\n\t\tgetRegion,\r\n\t};\r\n};\r\n","<script setup lang=\"ts\">\r\nimport { watch } from 'vue';\r\nimport type { Emits, Props, Region } from './selectorRegion';\r\nimport Select from '@/components/forms/select/select.vue';\r\nimport Button from '@/components/forms/button/button.vue';\r\nimport { useSelectorRegion } from './composables/selectorRegion';\r\nimport { dummyIndex } from './utils/consts';\r\n\r\nconst props = withDefaults(defineProps<Props>(), {\r\n\tsearchers: () => [],\r\n\t// compareRegionsIndexes: () => [],\r\n\taddSearcherIcon: true,\r\n\taddRegionIcon: true,\r\n\taddChanger: true,\r\n});\r\n\r\nconst model = defineModel<Props['modelValue']>({ required: true });\r\nconst modelSingle = defineModel<Props['modelValueSingle']>('modelValueSingle');\r\n\r\nconst emit = defineEmits<Emits>();\r\n\r\nconst {\r\n\tselectSearcher,\r\n\tselectRegion,\r\n\tcompare,\r\n\r\n\tsearcherByKey,\r\n\tallRegionsIndexes,\r\n\r\n\tgetSearcher,\r\n\tgetRegion,\r\n} = useSelectorRegion(props);\r\n\r\nconst onClickCompare = () => {\r\n\t// ### TODO: сделать выбор регионов через UI (сейчас в UI выбор региона не работает)\r\n\tif (window['fieldTemplates'] && window['fieldTemplates']?.openSelectorRegions) {\r\n\t\twindow['fieldTemplates'].openSelectorRegions(\r\n\t\t\tsearcherByKey.value,\r\n\t\t\tcompare.regionsIndexes.value,\r\n\t\t\t(regionsIndexes: Region['index'][]) => compare.regionsIndexes.value = regionsIndexes,\r\n\t\t);\r\n\t\treturn;\r\n\t}\r\n\r\n\temit('compareRegions', searcherByKey.value);\r\n};\r\n\r\nwatch([selectRegion.regionIndex, selectSearcher.searcherKey, compare.regionsIndexes], () => {\r\n\tif (selectSearcher.searcherKey.value === -1 && compare.regionsIndexes.value.length) {\r\n\t\tif (JSON.stringify(model.value) === JSON.stringify(compare.regionsIndexes.value)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tmodel.value = [...compare.regionsIndexes.value];\r\n\t} else {\r\n\t\tmodel.value = [props.onlySearcher ? selectSearcher.searcherKey.value : selectRegion.regionIndex.value];\r\n\t}\r\n\r\n\t// регионов нет\r\n\tif (!allRegionsIndexes.value.size) {\r\n\t\tselectSearcher.searcherKey.value = dummyIndex;\r\n\t}\r\n});\r\n\r\nif (modelSingle.value) {\r\n\twatch(modelSingle, () => {\r\n\t\tmodel.value = [modelSingle.value!];\r\n\t}, { immediate: true });\r\n}\r\n\r\nwatch(model, () => {\r\n\tif (model.value[0]) {\r\n\t\tmodelSingle.value = model.value[0];\r\n\t}\r\n\r\n\t// проверка входных данных v-model на корректность\r\n\tif (props.onlySearcher) {\r\n\t\tif (\r\n\t\t\t!model.value.length ||\r\n\t\t\tmodel.value.length === 1 && !searcherByKey.value.has(model.value[0])\r\n\t\t) {\r\n\t\t\tlet defaultKey: number | undefined = searcherByKey.value.keys().next().value;\r\n\r\n\t\t\tif (defaultKey !== undefined) {\r\n\t\t\t\tmodel.value = [defaultKey];\r\n\t\t\t}\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (\r\n\t\t\tmodel.value.length > 1 &&\r\n\t\t\tJSON.stringify(model.value) !== JSON.stringify(compare.regionsIndexes.value)\r\n\t\t) {\r\n\t\t\tmodel.value = [...compare.regionsIndexes.value];\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\t} else {\r\n\t\tlet newModel = [...new Set(model.value)];\r\n\r\n\t\tlet defaultIndex = searcherByKey.value.values().next().value?.regionByIndex?.keys().next().value;\r\n\t\tif (props.forFrequency) {\r\n\t\t\tdefaultIndex = searcherByKey.value.values().next().value?.regionByIndex?.values().next().value?.key;\r\n\t\t}\r\n\r\n\t\tif (!newModel.length) {\r\n\t\t\tif (defaultIndex !== undefined) {\r\n\t\t\t\tnewModel.push(defaultIndex);\r\n\t\t\t}\r\n\t\t} else if (newModel.length === 1) {\r\n\t\t\tlet all = allRegionsIndexes.value;\r\n\r\n\t\t\tif (props.forFrequency) {\r\n\t\t\t\tall = new Set();\r\n\t\t\t\tsearcherByKey.value.forEach((searcher) => {\r\n\t\t\t\t\tsearcher.regionByIndex.forEach((region) => {\r\n\t\t\t\t\t\tif (region.index === -1) return;\r\n\t\t\t\t\t\tif (region.index === dummyIndex) return;\r\n\r\n\t\t\t\t\t\tall.add(region.key);\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tif (!all.has(newModel[0]) && newModel[0] !== -2) {\r\n\t\t\t\tnewModel = [];\r\n\t\t\t\tif (defaultIndex !== undefined) {\r\n\t\t\t\t\tnewModel.push(defaultIndex);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tnewModel = newModel.filter(index => allRegionsIndexes.value.has(index));\r\n\t\t\tif (!newModel.length && defaultIndex !== undefined) {\r\n\t\t\t\tnewModel.push(defaultIndex);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (JSON.stringify(model.value) !== JSON.stringify(newModel)) {\r\n\t\t\tmodel.value = newModel;\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\t// входные данные v-model совпадают с внутренними значениями\r\n\tif (\r\n\t\tmodel.value.length === 1 &&\r\n\t\tmodel.value[0] === (props.onlySearcher ? selectSearcher.searcherKey.value : selectRegion.regionIndex.value)\r\n\t) {\r\n\t\treturn;\r\n\t}\r\n\r\n\t// if (\r\n\t// \tmodel.value.length > 1 &&\r\n\t// \tselectorSearcher.searcherKey.value === -1 &&\r\n\t// \tJSON.stringify(model.value) === JSON.stringify(selectorCompare.regionsIndexes.value)\r\n\t// ) {\r\n\t// \treturn;\r\n\t// }\r\n\r\n\t// обновление regionIndex, searcherKey, selectorCompare.regionsIndexes\r\n\tif (props.onlySearcher) {\r\n\t\t// if (!model.value.length) {\r\n\t\t// \tselectorSearcher.searcherKey.value = dummyIndex;\r\n\t\t//\r\n\t\t// \treturn;\r\n\t\t// }\r\n\r\n\t\tif (model.value.length === 1) {\r\n\t\t\tselectSearcher.searcherKey.value = model.value[0];\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tselectSearcher.searcherKey.value = -1;\r\n\r\n\t\treturn;\r\n\t} else {\r\n\t\t// if (!model.value.length) {\r\n\t\t// \tselectorSearcher.searcherKey.value = dummyIndex;\r\n\t\t// \tselectorRegion.regionIndex.value = dummyIndex;\r\n\t\t//\r\n\t\t// \treturn;\r\n\t\t// }\r\n\r\n\t\tif (model.value.length === 1 && selectSearcher.searcherKey.value !== -1) {\r\n\t\t\tselectRegion.regionIndex.value = model.value[0];\r\n\r\n\t\t\tlet newSearherKey: number | undefined;\r\n\t\t\tfor (const searcher of searcherByKey.value.values()) {\r\n\t\t\t\tfor (const region of searcher.regionByIndex.values()) {\r\n\t\t\t\t\tconst currentRegionIndex = props.forFrequency ? region.key : region.index;\r\n\t\t\t\t\tif (currentRegionIndex === selectRegion.regionIndex.value) {\r\n\t\t\t\t\t\tnewSearherKey = searcher.key;\r\n\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (newSearherKey !== undefined) {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif (newSearherKey !== undefined) {\r\n\t\t\t\tselectSearcher.searcherKey.value = newSearherKey;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tselectSearcher.searcherKey.value = -1;\r\n\t\t\tcompare.regionsIndexes.value = [...model.value];\r\n\t\t}\r\n\t}\r\n}, { immediate: true });\r\n\r\ndefineExpose({\r\n\tgetSearcher,\r\n\tgetRegion,\r\n});\r\n</script>\r\n\r\n<template>\r\n\t<div\r\n\t\t:class=\"{\r\n\t\t\t'top-selectorRegion': true,\r\n\t\t\t'top-selectorRegion-onlySearcher': onlySearcher,\r\n\t\t}\"\r\n\t>\r\n\t\t<Select\r\n\t\t\t:options=\"selectSearcher.optionBySearcherKey.value\"\r\n\t\t\tv-model=\"selectSearcher.searcherKey.value\"\r\n\t\t\tname=\"searcher_key\"\r\n\t\t\t:addChanger=\"addChanger\"\r\n\t\t/>\r\n\r\n\t\t<Select\r\n\t\t\tv-if=\"!onlySearcher && selectSearcher.searcherKey.value !== -1\"\r\n\t\t\tclass=\"top-select-region\"\r\n\t\t\t:options=\"selectRegion.optionByRegionIndex.value\"\r\n\t\t\tv-model=\"selectRegion.regionIndex.value\"\r\n\t\t\t:name=\"forFrequency ? 'region_key' : 'region_index'\"\r\n\t\t\t:addChanger=\"addChanger\"\r\n\t\t\t:data-top-icon=\"addRegionIcon ? '' : undefined\"\r\n\t\t/>\r\n\r\n\t\t<Button\r\n\t\t\tv-if=\"addCompare && !onlySearcher && selectSearcher.searcherKey.value === -1\"\r\n\t\t\tname=\"compare\"\r\n\t\t\t@click=\"onClickCompare\"\r\n\t\t\t:data-count-compare-regions-indexes=\"compare.regionsIndexes.value.length\"\r\n\t\t>\r\n\t\t\t{{ $i18n.Common.Selected_regions }}\r\n\t\t</Button>\r\n\t</div>\r\n</template>\r\n\r\n<style module>\r\n@import \"./styles/searcherColors.css\";\r\n\r\n.top-selectorRegion {\r\n\twidth: 320px;\r\n\tdisplay: inline-flex;\r\n\tvertical-align: middle;\r\n}\r\n\r\n.top-selectorRegion > .top-select {\r\n\tflex-grow: 1;\r\n}\r\n\r\n.top-selectorRegion > .top-select:focus-within {\r\n\tz-index: 4;\r\n}\r\n\r\n.top-selectorRegion > .top-select > .top-select_select:hover,\r\n.top-selectorRegion > .top-select > .top-select_select.top-error {\r\n\tz-index: 1;\r\n}\r\n\r\n.top-selectorRegion > .top-select-searcher_key {\r\n\twidth: 120px;\r\n\tmax-width: 140px;\r\n\tmargin-right: -1px;\r\n}\r\n\r\n.top-selectorRegion > .top-select-region > select {\r\n\tborder-top-left-radius: 0;\r\n\tborder-bottom-left-radius: 0;\r\n}\r\n\r\n.top-selectorRegion > .top-select-region {\r\n\t--top-icon-size: 20px;\r\n\t--top-icon-color: var(--color-text-primary-1);\r\n\r\n\t--top-icon2-size: 20px;\r\n\t--top-icon2-color: var(--color-text-primary-1);\r\n}\r\n\r\n.top-selectorRegion > .top-select-region[data-top-icon][data-top-icon2] {\r\n\t--top-icon2-size: 16px;\r\n}\r\n\r\n.top-selectorRegion > .top-select-region[data-top-icon][data-top-icon2]:after {\r\n\ttext-indent: -4px;\r\n}\r\n\r\n.top-selectorRegion > [name=\"compare\"] {\r\n\tborder-top-left-radius: 0;\r\n\tborder-bottom-left-radius: 0;\r\n\tflex-grow: 1;\r\n}\r\n\r\n.top-selectorRegion > [name=\"compare\"]:after {\r\n\tcontent: \"(\" attr(data-count-compare-regions-indexes) \")\";\r\n\tmargin: 0 0 0 6px;\r\n}\r\n\r\n.top-selectorRegion:not(.top-selectorRegion-onlySearcher) > .top-select-searcher_key > select {\r\n\tborder-top-right-radius: 0;\r\n\tborder-bottom-right-radius: 0;\r\n\tmargin-right: 0;\r\n}\r\n\r\n.top-selectorRegion:not(.top-selectorRegion-onlySearcher) > .top-select-searcher_key[data-value=\"-1\"] > select {\r\n\tborder-right: none;\r\n}\r\n\r\n.top-selectorRegion-onlySearcher {\r\n\twidth: 120px;\r\n}\r\n</style>\r\n","import type { ComponentCustomProps } from 'vue';\r\n\r\nimport SelectorCompetitors from './selectorCompetitors/selectorCompetitors.vue';\r\nimport SelectorRegion from './selectorRegion/selectorRegion.vue';\r\n\r\nexport const TopSelectorCompetitors = SelectorCompetitors as typeof SelectorCompetitors & ComponentCustomProps;\r\nexport const TopSelectorRegion = SelectorRegion as typeof SelectorRegion & ComponentCustomProps;\r\n"],"names":["props","__props","model","useModel","selectAllItem","computed","useI18n","useSelectSearcher","mapSearchers","i18n","searcherKey","ref","dummyIndex","optionBySearcherKey","res","searcher","option","getSearcherGIcon","dummyOption","compareOption","useSelectRegion","activeSearcherIndexed","regionIndex","_b","_a","_c","optionByRegionIndex","options","region","regionLabel","option2","langLabel","getLangLabel","getDeviceGIcon","watch","optionByRegionIndex2","oldOptionByRegionIndex","newRegionIndex","regionName","regionMatchLevel","index","title","regexpDevice","regionNameCompare","regionMatchLevelI","useCompare","searcherByKey","allRegionsIndexes","regionsIndexes","compareLoad","regionsIndexesSaved","compareSave","useSelectorRegion","genSearcherByKey","selectSearcher","searcherUndefined","selectRegion","compare","newSearcherKey","regionsNewSearcher","regionsCurrentSearcher","_e","_d","getSearcherKey","getRegionIndex","regionKey","findRegion","getSearcher","modelSingle","emit","__emit","getRegion","onClickCompare","defaultKey","newModel","defaultIndex","all","newSearherKey","__expose","TopSelectorCompetitors","SelectorCompetitors","TopSelectorRegion","SelectorRegion"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAUA,UAAAA,IAAAC,GAGAC,IAAAC,EAAAF,GAAA,YAAA,GAEAG,IAAAC,EAAA,MAAA;AACC,UAAAL,EAAA;AACC,eAAA;AAAA,UAAO,MAAA;AAAA,UACA,OAAAM,EAAA,EAAA,OAAA;AAAA,UACkB,OAAA;AAAA,UACjB,SAAA;AAAA,QACE;AAAA,IAEX,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDCVYC,KAAA,CAAAP,GAAAQ,MAAA;AAIZ,QAAAC,IAAAH,EAAA,GAKAI,IAAAC,EAAAH,EAAA,MAAA,KAAA,EAAA,KAAA,EAAA,SAAAI,CAAA,GAKAC,IAAAR,EAAA,MAAA;AACC,UAAAS,IAAA,oBAAA,IAAA;AAaA,QAZAN,EAAA,MAAA,QAAA,CAAAO,MAAA;AACC,UAAAC,IAAA;AAAA,QAAqB,OAAAD,EAAA;AAAA,QACJ,OAAAA,EAAA;AAAA,MACA;AAGjB,MAAAf,EAAA,oBAAAgB,EAAA,OAAAC,GAAAF,EAAA,GAAA,IAEAD,EAAA,IAAAC,EAAA,KAAAC,CAAA;AAAA,IAA4B,CAAA,GAI7BhB,EAAA,cAAA,CAAAc,EAAA,IAAAF,CAAA,GAAA;AACC,YAAAM,IAAA;AAAA,QAA4B,OAAA;AAAA,QACpB,OAAA;AAAA,QACA,UAAA;AAAA,MACG;AAEX,MAAAJ,EAAA,IAAAI,EAAA,OAAAA,CAAA;AAEA,YAAAC,IAAA;AAAA,QAA8B,OAAA;AAAA,QACtB,OAAAV,EAAA,OAAA;AAAA,MACY;AAEpB,MAAAK,EAAA,IAAAK,EAAA,OAAAA,CAAA;AAAA,IAA0C;AAG3C,WAAAL;AAAA,EAAO,CAAA;AAGR,SAAA;AAAA,I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,IACAG,EAAA,eAAA,QAAA,CAAA,GAAAvD,EAAA,KAAA;AAAA,IAEF,GAAA,EAAA,WAAA,GAAA,CAAA,GAGD4E,EAAA;AAAA,MAAa,aAAAX;AAAA,MACZ,WAAAI;AAAA,IACA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDCpNMQ,KAAAC,IACAC,KAAAC;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
define(["require","exports","../.chunks/utils-x88W55mf.amd"],function(r,e,n){"use strict";if(typeof i>"u")var i=window.Vue;e.findRegion=n.findRegion,e.genSearcherByKey=n.genSearcherByKey,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
2
|
+
//# sourceMappingURL=utils.amd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.amd.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/project/utils.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/tabs/tabs.amd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
define(["require","exports","vue","../.chunks/forms-
|
|
1
|
+
define(["require","exports","vue","../.chunks/forms-CjYoXTEQ.amd","../require/css.amd!../assets/tabs.css"],function(C,s,e,o){"use strict";if(typeof e>"u")var e=window.Vue;const l={class:e.normalizeClass({"top-tabs":!0})},c={key:0,class:"top-tabs_header"},d={class:"top-tabs_contents"},b=e.defineComponent({__name:"tabs",props:{id:{}},setup(a){return(t,n)=>(e.openBlock(),e.createElementBlock("div",l,[e.renderSlot(t.$slots,"buttons"),t.$slots.header?(e.openBlock(),e.createElementBlock("div",c,[e.renderSlot(t.$slots,"header")])):e.createCommentVNode("",!0),e.createElementVNode("div",d,[e.renderSlot(t.$slots,"contents")])]))}}),p={$style:{"top-tabs":"top-tabs","top-tabs_header":"top-tabs_header","top-tabs_contents":"top-tabs_contents","top-tabs_tabInput":"top-tabs_tabInput","top-tabs_content":"top-tabs_content"}},r=o._export_sfc(b,[["__cssModules",p]]),_=["id","name","value","checked","disabled"],u=["for"],i=e.defineComponent({__name:"tab",props:{tabsId:{},name:{},title:{},active:{type:Boolean},disabled:{type:Boolean}},setup(a){return(t,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("input",{type:"radio",class:"top-tabs_tabInput top-unvisible",id:t.tabsId+t.name,name:t.tabsId,value:t.name,checked:t.active,disabled:t.disabled},null,8,_),e.createElementVNode("label",{class:e.normalizeClass({"top-tabs_tabLabel":!0,"top-forms-focusable":!0,"top-disabled":t.disabled}),for:t.tabsId+t.name},[e.renderSlot(t.$slots,"default")],10,u)],64))}}),m={$style:{"top-tabs_tabLabel":"top-tabs_tabLabel","top-tabs_tabInput":"top-tabs_tabInput"}},f=o._export_sfc(i,[["__cssModules",m]]),$=["data-tabs-name"],T=e.defineComponent({__name:"content",props:{name:{}},setup(a){return(t,n)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass({"top-tabs_content":!0}),"data-tabs-name":t.name},[e.renderSlot(t.$slots,"default")],8,$))}}),h={$style:{"top-tabs_content":"top-tabs_content"}},y=o._export_sfc(T,[["__cssModules",h]]),v=r,k=f,B=y;s.TopTabs=v,s.TopTabsContent=B,s.TopTabsTab=k,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=tabs.amd.js.map
|
package/tabs/tabs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import d from "../core/core.js";
|
|
2
2
|
import { defineComponent as p, openBlock as o, createElementBlock as a, renderSlot as s, createCommentVNode as _, createElementVNode as n, normalizeClass as b, Fragment as i } from "vue";
|
|
3
|
-
import { _ as l } from "../.chunks/forms-
|
|
3
|
+
import { _ as l } from "../.chunks/forms-CHiMZ8vg.es.js";
|
|
4
4
|
const r = ["../assets/tabs.css"].map((e) => import.meta.resolve(e));
|
|
5
5
|
d.insertCSSLinkToPage(r, !0);
|
|
6
6
|
const u = {
|