@topvisor/ui 1.4.3-projectSelector.1 → 1.4.3-updateGroupSelector.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/policy.vue_vue_type_style_index_0_lang-6S_OFLu6.amd.js +2 -0
- package/.chunks/policy.vue_vue_type_style_index_0_lang-6S_OFLu6.amd.js.map +1 -0
- package/.chunks/policy.vue_vue_type_style_index_0_lang-BRUOmEM8.es.js +498 -0
- package/.chunks/policy.vue_vue_type_style_index_0_lang-BRUOmEM8.es.js.map +1 -0
- package/assets/policy.css +1 -1
- package/assets/project.css +1 -1
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.js +1 -1
- package/package.json +1 -1
- package/popup/popup.amd.js +1 -1
- package/popup/popup.amd.js.map +1 -1
- package/popup/popup.js +2 -2
- package/popup/popup.js.map +1 -1
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +532 -869
- package/project/project.js.map +1 -1
- package/src/components/formsExt/selector2/composables/useAPI.d.ts +0 -2
- package/src/components/formsExt/selector2/composables/useMenu.d.ts +1 -3
- package/src/components/formsExt/selector2/selector2.vue.d.ts +1 -2
- package/src/components/formsExt/selector2/types.d.ts +8 -26
- package/src/components/popup/popup/listItem.vue.d.ts +4 -24
- package/src/components/popup/popup/types.d.ts +0 -1
- package/src/components/project/groupSelector/folders/types.d.ts +1 -0
- package/src/components/project/groupSelector/folders/utils.d.ts +417 -38
- package/src/components/project/groupSelector/groupSelector.vue.d.ts +1 -0
- package/src/components/project/groupSelector/groups/groups.vue.d.ts +5 -10
- package/src/components/project/groupSelector/groups/types.d.ts +1 -0
- package/src/components/project/groupSelector/groups/utils.d.ts +791 -57
- package/src/components/project/groupSelector/types.d.ts +6 -0
- package/src/components/project/project.d.ts +0 -1
- package/.chunks/policy.vue_vue_type_style_index_0_lang-BAP-FIuQ.es.js +0 -515
- package/.chunks/policy.vue_vue_type_style_index_0_lang-BAP-FIuQ.es.js.map +0 -1
- package/.chunks/policy.vue_vue_type_style_index_0_lang-EZT5LjSx.amd.js +0 -2
- package/.chunks/policy.vue_vue_type_style_index_0_lang-EZT5LjSx.amd.js.map +0 -1
- package/src/components/project/projectSelector/cache.d.ts +0 -30
- package/src/components/project/projectSelector/projectSelector.vue.d.ts +0 -128
- package/src/components/project/projectSelector/submenu/submenu.vue.d.ts +0 -4
- package/src/components/project/projectSelector/submenu/types.d.ts +0 -17
- package/src/components/project/projectSelector/types.d.ts +0 -52
- package/src/components/project/projectSelector/utils.d.ts +0 -232
|
@@ -118,6 +118,12 @@ export interface Props {
|
|
|
118
118
|
* @const
|
|
119
119
|
*/
|
|
120
120
|
client?: Api.Client<Api.TV.Paths, true>;
|
|
121
|
+
/**
|
|
122
|
+
* Сервис API клиента для выполнения запросов
|
|
123
|
+
*
|
|
124
|
+
* Используется совместно с props.client
|
|
125
|
+
*/
|
|
126
|
+
service?: 'keywords_2' | 'keywordsAi_2';
|
|
121
127
|
}
|
|
122
128
|
export type Emits = {
|
|
123
129
|
/**
|
|
@@ -3,7 +3,6 @@ export { useItemsFromCompetitors } from './competitorSelector/composables';
|
|
|
3
3
|
export { default as TopRegionSelector } from './regionSelector/regionSelector.vue';
|
|
4
4
|
export { findRegion, genSearcherByKey, dialogRegionSelector } from './regionSelector/utils/utils';
|
|
5
5
|
export { default as TopGroupSelector } from './groupSelector/groupSelector.vue';
|
|
6
|
-
export { default as TopProjectSelector } from './projectSelector/projectSelector.vue';
|
|
7
6
|
export type { Emits as TopTagSelectorEmits, Tag, TagId, TagIdExclude } from './tagSelector/types';
|
|
8
7
|
export { genElPopupOpener as genElTopTagSelectorPopupOpener, renderElPopupOpener as renderElTopTagSelectorPopupOpener, } from './tagSelector/utils/el';
|
|
9
8
|
export { default as TopTagSelector } from './tagSelector/tagSelector.vue';
|
|
@@ -1,515 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Core as _autoloadCSSCore } from '../core/app.js';
|
|
3
|
-
const fileNames = ['../assets/policy.css'].map(fileName => import.meta.resolve(fileName));
|
|
4
|
-
_autoloadCSSCore.insertCSSLinkToPage(fileNames, true);
|
|
5
|
-
|
|
6
|
-
import { defineComponent as j, mergeModels as z, useModel as se, ref as $, onMounted as ie, onUpdated as ue, createElementBlock as T, openBlock as y, normalizeClass as ce, createCommentVNode as M, Fragment as V, renderList as U, createBlock as b, mergeProps as W, createSlots as H, withCtx as B, createTextVNode as F, toDisplayString as P, createVNode as ne, createElementVNode as oe, withModifiers as de, computed as q, watch as Y, toRef as E, resolveComponent as Z, resolveDirective as _, unref as d, renderSlot as fe, withDirectives as ee, resolveDynamicComponent as pe } from "vue";
|
|
7
|
-
import { e as te, b as ve, C as J, d as me, u as he, s as ye } from "./forms-CUaoBGD5.es.js";
|
|
8
|
-
import { _ as ge, b as le } from "./popupHint.vue_vue_type_style_index_0_lang-DzT1BFMx.es.js";
|
|
9
|
-
import { _ as Ae } from "./widgetInput.vue_vue_type_script_setup_true_lang-BuoAaghB.es.js";
|
|
10
|
-
import { invertKeyboardLayout as Ie } from "../utils/keyboard.js";
|
|
11
|
-
import { g as Ce } from "./field-CyyFzM-Y.es.js";
|
|
12
|
-
const Te = {
|
|
13
|
-
key: 0,
|
|
14
|
-
class: "top-menu_selectAll"
|
|
15
|
-
}, We = /* @__PURE__ */ j({
|
|
16
|
-
__name: "menu",
|
|
17
|
-
props: /* @__PURE__ */ z({
|
|
18
|
-
modelValue: {},
|
|
19
|
-
items: {},
|
|
20
|
-
isMultiple: { type: Boolean },
|
|
21
|
-
canBeEmptyMultiple: { type: Boolean },
|
|
22
|
-
styling: { default: "default" },
|
|
23
|
-
selectAllItem: {}
|
|
24
|
-
}, {
|
|
25
|
-
modelValue: {
|
|
26
|
-
required: !0
|
|
27
|
-
},
|
|
28
|
-
modelModifiers: {}
|
|
29
|
-
}),
|
|
30
|
-
emits: ["update:modelValue"],
|
|
31
|
-
setup(e) {
|
|
32
|
-
const a = e, l = se(e, "modelValue"), t = $();
|
|
33
|
-
!a.isMultiple && typeof l.value != "string" && typeof l.value != "number" && console.warn('Type check failed for prop "modelValue". Expected String: ' + typeof l.value), a.isMultiple && !Array.isArray(l.value) && console.warn('Type check failed for prop "modelValue". Expected Array: ' + typeof l.value), a.isMultiple && !a.canBeEmptyMultiple && Array.isArray(l.value) && !l.value.length && a.items[0] && (l.value = [a.items[0]?.href ?? a.items[0]?.value]);
|
|
34
|
-
const u = (c) => Array.isArray(l.value) ? l.value.includes(c.value) : c.value === l.value, k = (c, v = !1) => {
|
|
35
|
-
if (Array.isArray(l.value)) {
|
|
36
|
-
let s = l.value.slice();
|
|
37
|
-
if (v) {
|
|
38
|
-
s.length || (s = a.items.map((h) => h.value));
|
|
39
|
-
const I = s.indexOf(c.value);
|
|
40
|
-
I === -1 ? s.push(c.value) : s.splice(I, 1);
|
|
41
|
-
} else
|
|
42
|
-
s.length === 1 && s[0] === c.value ? s = [] : s = [c.value];
|
|
43
|
-
!a.canBeEmptyMultiple && !s.length && (s = [c.value]), l.value = s;
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
l.value = c.value;
|
|
47
|
-
}, f = (c) => {
|
|
48
|
-
if (t.value.scrollWidth <= t.value.offsetWidth || c.shiftKey || Math.abs(c.deltaY) < 50) return;
|
|
49
|
-
c.preventDefault();
|
|
50
|
-
const v = c.deltaY > 0 ? 30 : -30;
|
|
51
|
-
t.value.scrollLeft = t.value.scrollLeft + v;
|
|
52
|
-
}, i = (c = !0) => {
|
|
53
|
-
const v = t.value.querySelector(".top-active");
|
|
54
|
-
if (!v) return;
|
|
55
|
-
const s = 24, I = v.offsetLeft - t.value.offsetLeft - s, h = v.offsetLeft - t.value.offsetLeft + v.clientWidth + s, g = t.value.scrollLeft, w = t.value.clientWidth + t.value.scrollLeft;
|
|
56
|
-
let A;
|
|
57
|
-
I < g && (A = I), h > w && (A = h - t.value.clientWidth), A !== void 0 && (ve() ? J.$?.(t.value).animate({ scrollLeft: A }, c ? 200 : 0) : t.value.scrollTo({ left: A, behavior: c ? "smooth" : "auto" }));
|
|
58
|
-
}, r = () => {
|
|
59
|
-
if (Array.isArray(l.value)) {
|
|
60
|
-
if (l.value.length === a.items.length) {
|
|
61
|
-
l.value = [a.items[0].href ?? a.items[0].value];
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
l.value = a.items.map((c) => c.href ?? c.value);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
return ie(() => i(!1)), ue(() => i(!0)), (c, v) => (y(), T("div", {
|
|
68
|
-
ref_key: "el",
|
|
69
|
-
ref: t,
|
|
70
|
-
class: ce({
|
|
71
|
-
"top-menu": !0,
|
|
72
|
-
["top-style_" + e.styling]: !0
|
|
73
|
-
// ['top-unwrap-x']: styling === 'default',
|
|
74
|
-
}),
|
|
75
|
-
onWheel: f
|
|
76
|
-
}, [
|
|
77
|
-
(y(!0), T(V, null, U(e.items, (s) => (y(), b(te, W({ ref_for: !0 }, s, {
|
|
78
|
-
class: "top-menu_item",
|
|
79
|
-
color: "theme",
|
|
80
|
-
onClick: (I) => k(s, I.ctrlKey || I.metaKey),
|
|
81
|
-
isActive: u(s)
|
|
82
|
-
}), H({ _: 2 }, [
|
|
83
|
-
s.content ? {
|
|
84
|
-
name: "default",
|
|
85
|
-
fn: B(() => [
|
|
86
|
-
F(P(s.content), 1)
|
|
87
|
-
]),
|
|
88
|
-
key: "0"
|
|
89
|
-
} : void 0
|
|
90
|
-
]), 1040, ["onClick", "isActive"]))), 256)),
|
|
91
|
-
Array.isArray(l.value) && e.selectAllItem ? (y(), T("div", Te, [
|
|
92
|
-
ne(te, W(e.selectAllItem, {
|
|
93
|
-
class: "top-menu_item",
|
|
94
|
-
color: "theme",
|
|
95
|
-
styling: "",
|
|
96
|
-
onClick: v[0] || (v[0] = (s) => r()),
|
|
97
|
-
isActive: l.value.length === e.items.length
|
|
98
|
-
}), H({ _: 2 }, [
|
|
99
|
-
e.selectAllItem.content ? {
|
|
100
|
-
name: "default",
|
|
101
|
-
fn: B(() => [
|
|
102
|
-
F(P(e.selectAllItem.content), 1)
|
|
103
|
-
]),
|
|
104
|
-
key: "0"
|
|
105
|
-
} : void 0
|
|
106
|
-
]), 1040, ["isActive"])
|
|
107
|
-
])) : M("", !0)
|
|
108
|
-
], 34));
|
|
109
|
-
}
|
|
110
|
-
}), ke = { class: "top-selector2_itemMulti top-ellipsis" }, Le = /* @__PURE__ */ j({
|
|
111
|
-
__name: "itemMulti",
|
|
112
|
-
props: {
|
|
113
|
-
id: {},
|
|
114
|
-
name: {}
|
|
115
|
-
},
|
|
116
|
-
emits: ["delete"],
|
|
117
|
-
setup(e) {
|
|
118
|
-
return (a, l) => (y(), T("div", ke, [
|
|
119
|
-
F(P(e.name) + " ", 1),
|
|
120
|
-
oe("span", {
|
|
121
|
-
class: "top-selector2_itemMultiDelete",
|
|
122
|
-
"data-top-icon": "",
|
|
123
|
-
onClick: l[0] || (l[0] = (t) => a.$emit("delete", { id: e.id, name: e.name })),
|
|
124
|
-
onMousedown: l[1] || (l[1] = de(() => {
|
|
125
|
-
}, ["stop"]))
|
|
126
|
-
}, null, 32)
|
|
127
|
-
]));
|
|
128
|
-
}
|
|
129
|
-
}), N = /* @__PURE__ */ new Map(), Se = (e) => {
|
|
130
|
-
N.get(e)?.clear();
|
|
131
|
-
}, be = (e) => {
|
|
132
|
-
const a = window.mo?.user?.id;
|
|
133
|
-
return JSON.stringify(e.params) + ":" + e.url + ":" + a;
|
|
134
|
-
}, Be = (e, a) => N.get(a)?.get(e), we = (e, a, l) => {
|
|
135
|
-
N.has(a) || N.set(a, /* @__PURE__ */ new Map()), N.get(a)?.set(e, l);
|
|
136
|
-
}, xe = (e, a, l, t) => {
|
|
137
|
-
const u = $([]), k = $(!1), f = $(0);
|
|
138
|
-
let i = "", r;
|
|
139
|
-
e && !e.params.limit && (e.params.limit = 100);
|
|
140
|
-
const c = async () => {
|
|
141
|
-
if (!e) return;
|
|
142
|
-
const h = t ? be(e) : void 0;
|
|
143
|
-
if (h) {
|
|
144
|
-
const A = Be(h, e.path);
|
|
145
|
-
if (A)
|
|
146
|
-
return e.abortByFingerprint(), A;
|
|
147
|
-
}
|
|
148
|
-
const g = await e.call();
|
|
149
|
-
if (g.errors) return;
|
|
150
|
-
if (!Array.isArray(g.result)) {
|
|
151
|
-
console.warn("Array expected in `res.result`");
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
const w = g.result.findIndex((A) => A.id === void 0 || A.name === void 0);
|
|
155
|
-
if (w !== -1) {
|
|
156
|
-
console.warn(`В result[${w}] нет id или name`);
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
|
-
return h && we(h, e.path, g), g;
|
|
160
|
-
}, v = async (h) => {
|
|
161
|
-
if (!e) return;
|
|
162
|
-
if (h) {
|
|
163
|
-
if (!r || k.value) return;
|
|
164
|
-
e.params.offset = r;
|
|
165
|
-
} else
|
|
166
|
-
e.params.offset = 0;
|
|
167
|
-
a?.(e, i), k.value = !0;
|
|
168
|
-
const g = await c();
|
|
169
|
-
k.value = !1, f.value++, g && (r = g.nextOffset, h ? u.value = u.value.concat(g.result) : u.value = g.result);
|
|
170
|
-
}, s = me(() => v(!1), 200);
|
|
171
|
-
return {
|
|
172
|
-
apiRequest: e,
|
|
173
|
-
items: u,
|
|
174
|
-
isLoading: k,
|
|
175
|
-
countLoading: f,
|
|
176
|
-
load: v,
|
|
177
|
-
setSearchTextAndLoad: (h, g = !0) => {
|
|
178
|
-
if (e) {
|
|
179
|
-
if (h.length < l) {
|
|
180
|
-
e.abortByFingerprint(), u.value = [];
|
|
181
|
-
return;
|
|
182
|
-
}
|
|
183
|
-
h === i && u.value.length || (i = h, g ? s() : v(!1));
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
};
|
|
187
|
-
}, re = 0, O = null, ae = (e, a, l = !0) => l && a.id === O ? Array.isArray(e) ? e.some((t) => t.id === a.id && t.name === a.name) : a.name === e.name : Array.isArray(e) ? e.some((t) => t.id === a.id) : a.id === e.id, Oe = (e, a, l) => {
|
|
188
|
-
let t = e.params.filters ?? [];
|
|
189
|
-
t = t.filter((u) => u.name !== l), a && t.push(Ce(l, "CONTAINS", [a])), e.changeParams({ filters: t });
|
|
190
|
-
}, Me = (e, a, l, t, u, k, f, i, r, c, v) => {
|
|
191
|
-
const s = $(""), I = {
|
|
192
|
-
id: re,
|
|
193
|
-
name: he().Common.All
|
|
194
|
-
}, h = () => {
|
|
195
|
-
s.value = "";
|
|
196
|
-
}, g = () => !(!v.apiRequest || s.value.length >= c), w = q(() => {
|
|
197
|
-
const o = [];
|
|
198
|
-
return !t && u.value && (typeof u.value == "string" && (I.name = u.value), o.push(I)), l.value?.forEach((S) => o.push({ ...S })), o;
|
|
199
|
-
}), A = $([]), R = () => {
|
|
200
|
-
A.value = p();
|
|
201
|
-
}, p = () => {
|
|
202
|
-
const o = s.value.toLowerCase(), S = Ie(o);
|
|
203
|
-
let n = [], x;
|
|
204
|
-
const L = [], Q = () => {
|
|
205
|
-
L.at(-1)?.listItemProps?.type === "delimiter" && L.pop(), L.length && (x && n.push(x), n.push(...L), L.length = 0);
|
|
206
|
-
};
|
|
207
|
-
for (const C of w.value)
|
|
208
|
-
switch (C.listItemProps?.type) {
|
|
209
|
-
case "title":
|
|
210
|
-
Q(), x = C;
|
|
211
|
-
break;
|
|
212
|
-
case "delimiter":
|
|
213
|
-
if (L.length) {
|
|
214
|
-
let X = L.length;
|
|
215
|
-
L.at(-1)?.listItemProps?.type === "delimiter" && X--, L[X] = C;
|
|
216
|
-
}
|
|
217
|
-
break;
|
|
218
|
-
default:
|
|
219
|
-
const K = C.name.toLowerCase();
|
|
220
|
-
(C.id === Number(o) || K.includes(o) || K.includes(S)) && (K === o || K === S ? L.unshift(C) : L.push(C));
|
|
221
|
-
}
|
|
222
|
-
if (Q(), n.push(...v.items.value), k.value && s.value && (!f.value || f.value(o)) && // результаты могут быть найдены, но не точные, тогда предложить добавить элемент
|
|
223
|
-
!n.find((C) => C.name.toLowerCase() === o)) {
|
|
224
|
-
const C = {
|
|
225
|
-
id: O,
|
|
226
|
-
name: s.value
|
|
227
|
-
};
|
|
228
|
-
i && (C.listItemProps = { class: "top-popup-noCloser" }), n.push(C);
|
|
229
|
-
}
|
|
230
|
-
return t && (n = n.filter((C) => !ae(e.value, C))), n;
|
|
231
|
-
}, m = (o) => {
|
|
232
|
-
o.listItemProps?.type === "title" || o.listItemProps?.type === "delimiter" || o.id === O && (a("appendItem", o), i) || (t && Array.isArray(e.value) ? ae(e.value, o) || (e.value = [...e.value, o]) : e.value = o, setTimeout(() => {
|
|
233
|
-
h();
|
|
234
|
-
}));
|
|
235
|
-
};
|
|
236
|
-
if (v.apiRequest) {
|
|
237
|
-
const o = [l, v.items];
|
|
238
|
-
t && o.push(e), Y(o, () => {
|
|
239
|
-
R();
|
|
240
|
-
});
|
|
241
|
-
} else
|
|
242
|
-
Y([e, l, s], () => {
|
|
243
|
-
R();
|
|
244
|
-
}, {
|
|
245
|
-
immediate: !0,
|
|
246
|
-
// слежение за изменениями `items`
|
|
247
|
-
deep: 2
|
|
248
|
-
});
|
|
249
|
-
return {
|
|
250
|
-
searchText: s,
|
|
251
|
-
resetSearch: h,
|
|
252
|
-
genIsShort: g,
|
|
253
|
-
itemsForShow: A,
|
|
254
|
-
selectItem: m,
|
|
255
|
-
selectNextItem: () => {
|
|
256
|
-
if (Array.isArray(e.value)) return;
|
|
257
|
-
const o = A.value.filter((x) => !["title", "delimiter"].includes(x.listItemProps?.type ?? "")), n = (o.findIndex((x) => x.id === e.value.id) + 1) % o.length;
|
|
258
|
-
e.value = { ...o[n] };
|
|
259
|
-
},
|
|
260
|
-
deleteItemByItem: async (o) => {
|
|
261
|
-
Array.isArray(e.value) && (e.value = e.value.filter((S) => S.id !== o.id || S.name !== o.name));
|
|
262
|
-
}
|
|
263
|
-
};
|
|
264
|
-
}, Pe = {
|
|
265
|
-
key: 0,
|
|
266
|
-
class: "top-selector2_activeItems"
|
|
267
|
-
}, $e = {
|
|
268
|
-
key: 1,
|
|
269
|
-
class: "top-selector2_activeName top-ellipsis"
|
|
270
|
-
}, Fe = {
|
|
271
|
-
key: 2,
|
|
272
|
-
class: "top-selector2_placeholder top-ellipsis"
|
|
273
|
-
}, De = { class: "top-selector2_searchWidget" }, ze = /* @__PURE__ */ j({
|
|
274
|
-
__name: "selector2",
|
|
275
|
-
props: /* @__PURE__ */ z({
|
|
276
|
-
modelValue: {},
|
|
277
|
-
items: { default: () => [] },
|
|
278
|
-
title: {},
|
|
279
|
-
disabled: { type: Boolean },
|
|
280
|
-
icon: {},
|
|
281
|
-
modificator: {},
|
|
282
|
-
size: { default: "s" },
|
|
283
|
-
isError: { type: Boolean },
|
|
284
|
-
openByFocusInput: { type: Boolean, default: void 0 },
|
|
285
|
-
searchType: { default: "popup" },
|
|
286
|
-
placeholder: {},
|
|
287
|
-
hasCloserBtn: { type: Boolean },
|
|
288
|
-
api: {},
|
|
289
|
-
apiSetSearchParams: {},
|
|
290
|
-
minLength: { default: 0 },
|
|
291
|
-
useCache: { type: Boolean },
|
|
292
|
-
appendSearchToResult: { type: Boolean },
|
|
293
|
-
appendSearchToResultCond: {},
|
|
294
|
-
appendWithoutSelect: { type: Boolean },
|
|
295
|
-
multiselect: { type: Boolean },
|
|
296
|
-
useAllItem: { type: [Boolean, String] },
|
|
297
|
-
addChanger: { type: Boolean },
|
|
298
|
-
buttonProps: {},
|
|
299
|
-
selectedAsPlaceholder: { type: Boolean },
|
|
300
|
-
openerShortcut: {}
|
|
301
|
-
}, {
|
|
302
|
-
modelValue: { required: !0 },
|
|
303
|
-
modelModifiers: {}
|
|
304
|
-
}),
|
|
305
|
-
emits: /* @__PURE__ */ z(["appendItem", "open"], ["update:modelValue"]),
|
|
306
|
-
setup(e, { expose: a, emit: l }) {
|
|
307
|
-
const t = e, u = se(e, "modelValue"), k = l;
|
|
308
|
-
a({
|
|
309
|
-
/**
|
|
310
|
-
* Сброс локального кеша и кеша api
|
|
311
|
-
*
|
|
312
|
-
* @param resetAPICache - Сбросить API кеш, по умолчанию не сбрасывается. Для случаев, когда загруженные данные становятся неактуальными
|
|
313
|
-
*/
|
|
314
|
-
resetCache: (p = !1) => {
|
|
315
|
-
i.apiRequest && (p && Se(i.apiRequest.path), i.items.value = [], i.countLoading.value = 0, i.apiRequest.params.offset = 0, requestAnimationFrame(() => {
|
|
316
|
-
r.itemsForShow.value = [];
|
|
317
|
-
}), s()?.elPopup && i.setSearchTextAndLoad(r.searchText.value));
|
|
318
|
-
}
|
|
319
|
-
});
|
|
320
|
-
const f = q(() => t.searchType === "inline" && t.multiselect || t.searchType === "inline" && J.state.isMobile ? "popup" : t.searchType), i = xe(t.api, t.apiSetSearchParams, t.minLength, t.useCache), r = Me(
|
|
321
|
-
u,
|
|
322
|
-
k,
|
|
323
|
-
E(t, "items"),
|
|
324
|
-
t.multiselect,
|
|
325
|
-
E(t, "useAllItem"),
|
|
326
|
-
E(t, "appendSearchToResult"),
|
|
327
|
-
E(t, "appendSearchToResultCond"),
|
|
328
|
-
E(t, "appendWithoutSelect"),
|
|
329
|
-
f,
|
|
330
|
-
t.minLength,
|
|
331
|
-
i
|
|
332
|
-
), c = q(() => t.buttonProps ? "TopButton" : f.value === "inline" ? "TopInput" : "div"), v = $(null), s = () => v.value?.popup;
|
|
333
|
-
i.apiRequest && Y(r.searchText, () => {
|
|
334
|
-
i.setSearchTextAndLoad(r.searchText.value);
|
|
335
|
-
});
|
|
336
|
-
const I = q(() => Array.isArray(u.value) || t.multiselect || !t.selectedAsPlaceholder && f.value !== "inline" ? t.placeholder : u.value?.name || t.placeholder), h = (p) => {
|
|
337
|
-
let m = !1;
|
|
338
|
-
switch (p.key) {
|
|
339
|
-
case "Delete":
|
|
340
|
-
case "Backspace":
|
|
341
|
-
Array.isArray(u.value) && (p.preventDefault(), p.stopPropagation(), u.value.pop());
|
|
342
|
-
break;
|
|
343
|
-
case "ArrowUp":
|
|
344
|
-
case "ArrowRight":
|
|
345
|
-
case "ArrowDown":
|
|
346
|
-
case "ArrowLeft":
|
|
347
|
-
case "Enter":
|
|
348
|
-
case " ":
|
|
349
|
-
m = !0;
|
|
350
|
-
break;
|
|
351
|
-
case "Escape":
|
|
352
|
-
f.value === "inline" && r.resetSearch();
|
|
353
|
-
break;
|
|
354
|
-
}
|
|
355
|
-
const D = p.key.length === 1 && !p.ctrlKey && !p.metaKey;
|
|
356
|
-
(f.value === "popup" || f.value === "inline") && D && (m = !0), s()?.elPopup && (m = !1), m && (f.value === "popup" && (p.preventDefault(), p.stopPropagation(), D && (r.searchText.value || (r.searchText.value = p.key))), p.currentTarget?.click());
|
|
357
|
-
}, g = (p) => {
|
|
358
|
-
p.preventDefault(), r.selectNextItem();
|
|
359
|
-
}, w = () => {
|
|
360
|
-
i.apiRequest && i.setSearchTextAndLoad(r.searchText.value, !1), k("open");
|
|
361
|
-
}, A = () => {
|
|
362
|
-
f.value === "popup" && r.searchText.value && r.resetSearch();
|
|
363
|
-
}, R = (p) => {
|
|
364
|
-
const m = p.target;
|
|
365
|
-
m.scrollTop / (m.scrollHeight - m.offsetHeight) > 0.8 && i.load(!0);
|
|
366
|
-
};
|
|
367
|
-
return (p, m) => {
|
|
368
|
-
const D = Z("TopButton"), G = Z("TopLoadbar"), o = _("top-focus"), S = _("top-shortcut");
|
|
369
|
-
return y(), b(d(ge), {
|
|
370
|
-
ref_key: "popupRef",
|
|
371
|
-
ref: v,
|
|
372
|
-
onOpen: m[3] || (m[3] = (n) => w()),
|
|
373
|
-
onClose: m[4] || (m[4] = (n) => A()),
|
|
374
|
-
onScrollContentList: m[5] || (m[5] = (n) => d(i) ? R(n) : void 0),
|
|
375
|
-
notch: !1,
|
|
376
|
-
transitionDuration: 0,
|
|
377
|
-
openByFocusInput: f.value === "inline" && (e.openByFocusInput ?? !0),
|
|
378
|
-
disabled: f.value === "inline" && d(r).genIsShort()
|
|
379
|
-
}, H({
|
|
380
|
-
opener: B(() => [
|
|
381
|
-
ee((y(), b(pe(c.value), W(e.buttonProps, {
|
|
382
|
-
class: {
|
|
383
|
-
"top-selector2": !0,
|
|
384
|
-
"top-selector2-multiselect": e.multiselect,
|
|
385
|
-
["top-selector2-" + e.modificator]: !!e.modificator,
|
|
386
|
-
"top-as-input": !e.buttonProps && f.value !== "inline",
|
|
387
|
-
"top-as-selector": !0,
|
|
388
|
-
["top-size_" + e.size]: !0,
|
|
389
|
-
"top-disabled": e.disabled,
|
|
390
|
-
"top-forms-focusable": !e.disabled,
|
|
391
|
-
"top-error": e.isError
|
|
392
|
-
},
|
|
393
|
-
icon: e.icon,
|
|
394
|
-
tabindex: "0",
|
|
395
|
-
onKeydown: h,
|
|
396
|
-
onBlur: m[0] || (m[0] = (n) => f.value === "inline" && d(r).resetSearch()),
|
|
397
|
-
placeholder: I.value,
|
|
398
|
-
title: e.title,
|
|
399
|
-
captionType: f.value === "inline" && e.title !== void 0 ? "top" : void 0,
|
|
400
|
-
modelValue: d(r).searchText.value,
|
|
401
|
-
"onUpdate:modelValue": m[1] || (m[1] = (n) => d(r).searchText.value = n)
|
|
402
|
-
}), {
|
|
403
|
-
default: B(() => [
|
|
404
|
-
e.multiselect ? (y(), T("div", Pe, [
|
|
405
|
-
(y(!0), T(V, null, U(u.value, (n) => (y(), b(Le, {
|
|
406
|
-
id: n.id,
|
|
407
|
-
name: n.name,
|
|
408
|
-
onDelete: d(r).deleteItemByItem
|
|
409
|
-
}, null, 8, ["id", "name", "onDelete"]))), 256))
|
|
410
|
-
])) : M("", !0),
|
|
411
|
-
f.value !== "inline" && !e.multiselect ? (y(), T("span", $e, P(Array.isArray(u.value) ? "" : u.value.name), 1)) : M("", !0),
|
|
412
|
-
e.multiselect && !u.value.length ? (y(), T("span", Fe, P(I.value), 1)) : M("", !0),
|
|
413
|
-
e.addChanger && !e.buttonProps && !e.multiselect && d(r).itemsForShow.value.length > 1 && !e.disabled ? (y(), T("span", {
|
|
414
|
-
key: 3,
|
|
415
|
-
class: "top-changer top-changer-selector",
|
|
416
|
-
"data-top-popup-disabled": "true",
|
|
417
|
-
onClick: g
|
|
418
|
-
})) : M("", !0)
|
|
419
|
-
]),
|
|
420
|
-
_: 1
|
|
421
|
-
}, 16, ["class", "icon", "placeholder", "title", "captionType", "modelValue"])), [
|
|
422
|
-
[
|
|
423
|
-
o,
|
|
424
|
-
e.isError,
|
|
425
|
-
void 0,
|
|
426
|
-
{ onupdate: !0 }
|
|
427
|
-
],
|
|
428
|
-
[S, e.openerShortcut]
|
|
429
|
-
])
|
|
430
|
-
]),
|
|
431
|
-
contentList: B(() => [
|
|
432
|
-
(y(!0), T(V, null, U(d(r).itemsForShow.value, (n) => (y(), b(d(le), W({
|
|
433
|
-
key: n.id ?? void 0,
|
|
434
|
-
class: {
|
|
435
|
-
"top-active": !Array.isArray(u.value) && !e.multiselect && u.value.id === n.id && u.value.name === n.name,
|
|
436
|
-
"top-selector2_item-all": n.id === d(re),
|
|
437
|
-
"top-selector2_item-new": n.id === d(O)
|
|
438
|
-
}
|
|
439
|
-
}, { ref_for: !0 }, n.listItemProps, {
|
|
440
|
-
closeByClick: !e.multiselect || d(J).state.isMobile,
|
|
441
|
-
onClick: (x) => d(r).selectItem(n)
|
|
442
|
-
}), {
|
|
443
|
-
default: B(() => [
|
|
444
|
-
p.$slots.item ? fe(p.$slots, "item", {
|
|
445
|
-
key: 0,
|
|
446
|
-
item: n
|
|
447
|
-
}) : (y(), T(V, { key: 1 }, [
|
|
448
|
-
F(P(n.name), 1)
|
|
449
|
-
], 64))
|
|
450
|
-
]),
|
|
451
|
-
_: 2
|
|
452
|
-
}, 1040, ["class", "closeByClick", "onClick"]))), 128)),
|
|
453
|
-
!d(r).itemsForShow.value.length && !d(r).genIsShort() ? (y(), b(d(le), {
|
|
454
|
-
key: 0,
|
|
455
|
-
type: "regular"
|
|
456
|
-
}, {
|
|
457
|
-
default: B(() => [
|
|
458
|
-
!d(i).isLoading.value || d(i).countLoading.value ? (y(), T(V, { key: 0 }, [
|
|
459
|
-
F(P(p.$i18n.Common.No_results), 1)
|
|
460
|
-
], 64)) : (y(), b(d(ye), {
|
|
461
|
-
key: 1,
|
|
462
|
-
type: "circles"
|
|
463
|
-
}))
|
|
464
|
-
]),
|
|
465
|
-
_: 1
|
|
466
|
-
})) : M("", !0),
|
|
467
|
-
d(i).countLoading.value && d(i).isLoading.value && f.value === "inline" ? (y(), b(G, { key: 1 })) : M("", !0)
|
|
468
|
-
]),
|
|
469
|
-
_: 2
|
|
470
|
-
}, [
|
|
471
|
-
f.value === "popup" ? {
|
|
472
|
-
name: "widget",
|
|
473
|
-
fn: B(() => [
|
|
474
|
-
oe("div", De, [
|
|
475
|
-
ee(ne(d(Ae), {
|
|
476
|
-
title: "Поиск",
|
|
477
|
-
icon: "",
|
|
478
|
-
modelValue: d(r).searchText.value,
|
|
479
|
-
"onUpdate:modelValue": m[2] || (m[2] = (n) => d(r).searchText.value = n),
|
|
480
|
-
isLoading: !!d(i).countLoading.value && d(i).isLoading.value,
|
|
481
|
-
placeholder: I.value
|
|
482
|
-
}, null, 8, ["modelValue", "isLoading", "placeholder"]), [
|
|
483
|
-
[
|
|
484
|
-
o,
|
|
485
|
-
u.value,
|
|
486
|
-
void 0,
|
|
487
|
-
{ onupdate: !0 }
|
|
488
|
-
]
|
|
489
|
-
]),
|
|
490
|
-
e.hasCloserBtn && !p.$core.state.isMobile ? (y(), b(D, {
|
|
491
|
-
key: 0,
|
|
492
|
-
class: "closer",
|
|
493
|
-
color: "theme"
|
|
494
|
-
}, {
|
|
495
|
-
default: B(() => [
|
|
496
|
-
F(P(p.$i18n.Common.Cancel), 1)
|
|
497
|
-
]),
|
|
498
|
-
_: 1
|
|
499
|
-
})) : M("", !0)
|
|
500
|
-
])
|
|
501
|
-
]),
|
|
502
|
-
key: "0"
|
|
503
|
-
} : void 0
|
|
504
|
-
]), 1032, ["openByFocusInput", "disabled"]);
|
|
505
|
-
};
|
|
506
|
-
}
|
|
507
|
-
});
|
|
508
|
-
export {
|
|
509
|
-
O as I,
|
|
510
|
-
ze as _,
|
|
511
|
-
We as a,
|
|
512
|
-
Oe as b,
|
|
513
|
-
re as c
|
|
514
|
-
};
|
|
515
|
-
//# sourceMappingURL=policy.vue_vue_type_style_index_0_lang-BAP-FIuQ.es.js.map
|