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