@topvisor/ui 1.4.3-projectSelector.0 → 1.4.3-projectSelector.1
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-BiCaYVJ6.es.js → policy.vue_vue_type_style_index_0_lang-BAP-FIuQ.es.js} +176 -176
- package/.chunks/policy.vue_vue_type_style_index_0_lang-BAP-FIuQ.es.js.map +1 -0
- package/.chunks/policy.vue_vue_type_style_index_0_lang-EZT5LjSx.amd.js +2 -0
- package/.chunks/policy.vue_vue_type_style_index_0_lang-EZT5LjSx.amd.js.map +1 -0
- package/formsExt/formsExt.amd.js +1 -1
- package/formsExt/formsExt.js +1 -1
- package/package.json +1 -1
- package/project/project.amd.js +1 -1
- package/project/project.amd.js.map +1 -1
- package/project/project.js +248 -239
- package/project/project.js.map +1 -1
- package/src/components/project/projectSelector/cache.d.ts +1 -1
- package/src/components/project/projectSelector/projectSelector.vue.d.ts +1 -1
- package/src/components/project/projectSelector/utils.d.ts +10 -8
- package/.chunks/policy.vue_vue_type_style_index_0_lang-AfwHvWs8.amd.js +0 -2
- package/.chunks/policy.vue_vue_type_style_index_0_lang-AfwHvWs8.amd.js.map +0 -1
- package/.chunks/policy.vue_vue_type_style_index_0_lang-BiCaYVJ6.es.js.map +0 -1
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
const fileNames = ['../assets/policy.css'].map(fileName => import.meta.resolve(fileName));
|
|
4
4
|
_autoloadCSSCore.insertCSSLinkToPage(fileNames, true);
|
|
5
5
|
|
|
6
|
-
import { defineComponent as
|
|
7
|
-
import { e as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { _ as
|
|
10
|
-
import { invertKeyboardLayout as
|
|
11
|
-
import { g as
|
|
12
|
-
const
|
|
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
13
|
key: 0,
|
|
14
14
|
class: "top-menu_selectAll"
|
|
15
|
-
},
|
|
15
|
+
}, We = /* @__PURE__ */ j({
|
|
16
16
|
__name: "menu",
|
|
17
|
-
props: /* @__PURE__ */
|
|
17
|
+
props: /* @__PURE__ */ z({
|
|
18
18
|
modelValue: {},
|
|
19
19
|
items: {},
|
|
20
20
|
isMultiple: { type: Boolean },
|
|
@@ -29,57 +29,57 @@ const ke = {
|
|
|
29
29
|
}),
|
|
30
30
|
emits: ["update:modelValue"],
|
|
31
31
|
setup(e) {
|
|
32
|
-
const a = e, l =
|
|
32
|
+
const a = e, l = se(e, "modelValue"), t = $();
|
|
33
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
|
|
34
|
+
const u = (c) => Array.isArray(l.value) ? l.value.includes(c.value) : c.value === l.value, k = (c, v = !1) => {
|
|
35
35
|
if (Array.isArray(l.value)) {
|
|
36
36
|
let s = l.value.slice();
|
|
37
37
|
if (v) {
|
|
38
38
|
s.length || (s = a.items.map((h) => h.value));
|
|
39
|
-
const I = s.indexOf(
|
|
40
|
-
I === -1 ? s.push(
|
|
39
|
+
const I = s.indexOf(c.value);
|
|
40
|
+
I === -1 ? s.push(c.value) : s.splice(I, 1);
|
|
41
41
|
} else
|
|
42
|
-
s.length === 1 && s[0] ===
|
|
43
|
-
!a.canBeEmptyMultiple && !s.length && (s = [
|
|
42
|
+
s.length === 1 && s[0] === c.value ? s = [] : s = [c.value];
|
|
43
|
+
!a.canBeEmptyMultiple && !s.length && (s = [c.value]), l.value = s;
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
|
-
l.value =
|
|
47
|
-
}, f = (
|
|
48
|
-
if (t.value.scrollWidth <= t.value.offsetWidth ||
|
|
49
|
-
|
|
50
|
-
const v =
|
|
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
51
|
t.value.scrollLeft = t.value.scrollLeft + v;
|
|
52
|
-
},
|
|
52
|
+
}, i = (c = !0) => {
|
|
53
53
|
const v = t.value.querySelector(".top-active");
|
|
54
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,
|
|
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
56
|
let A;
|
|
57
|
-
I < g && (A = I), h >
|
|
58
|
-
},
|
|
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
59
|
if (Array.isArray(l.value)) {
|
|
60
60
|
if (l.value.length === a.items.length) {
|
|
61
61
|
l.value = [a.items[0].href ?? a.items[0].value];
|
|
62
62
|
return;
|
|
63
63
|
}
|
|
64
|
-
l.value = a.items.map((
|
|
64
|
+
l.value = a.items.map((c) => c.href ?? c.value);
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
return
|
|
67
|
+
return ie(() => i(!1)), ue(() => i(!0)), (c, v) => (y(), T("div", {
|
|
68
68
|
ref_key: "el",
|
|
69
69
|
ref: t,
|
|
70
|
-
class:
|
|
70
|
+
class: ce({
|
|
71
71
|
"top-menu": !0,
|
|
72
72
|
["top-style_" + e.styling]: !0
|
|
73
73
|
// ['top-unwrap-x']: styling === 'default',
|
|
74
74
|
}),
|
|
75
75
|
onWheel: f
|
|
76
76
|
}, [
|
|
77
|
-
(y(!0),
|
|
77
|
+
(y(!0), T(V, null, U(e.items, (s) => (y(), b(te, W({ ref_for: !0 }, s, {
|
|
78
78
|
class: "top-menu_item",
|
|
79
79
|
color: "theme",
|
|
80
|
-
onClick: (I) =>
|
|
81
|
-
isActive:
|
|
82
|
-
}),
|
|
80
|
+
onClick: (I) => k(s, I.ctrlKey || I.metaKey),
|
|
81
|
+
isActive: u(s)
|
|
82
|
+
}), H({ _: 2 }, [
|
|
83
83
|
s.content ? {
|
|
84
84
|
name: "default",
|
|
85
85
|
fn: B(() => [
|
|
@@ -88,14 +88,14 @@ const ke = {
|
|
|
88
88
|
key: "0"
|
|
89
89
|
} : void 0
|
|
90
90
|
]), 1040, ["onClick", "isActive"]))), 256)),
|
|
91
|
-
Array.isArray(l.value) && e.selectAllItem ? (y(),
|
|
92
|
-
|
|
91
|
+
Array.isArray(l.value) && e.selectAllItem ? (y(), T("div", Te, [
|
|
92
|
+
ne(te, W(e.selectAllItem, {
|
|
93
93
|
class: "top-menu_item",
|
|
94
94
|
color: "theme",
|
|
95
95
|
styling: "",
|
|
96
|
-
onClick: v[0] || (v[0] = (s) =>
|
|
96
|
+
onClick: v[0] || (v[0] = (s) => r()),
|
|
97
97
|
isActive: l.value.length === e.items.length
|
|
98
|
-
}),
|
|
98
|
+
}), H({ _: 2 }, [
|
|
99
99
|
e.selectAllItem.content ? {
|
|
100
100
|
name: "default",
|
|
101
101
|
fn: B(() => [
|
|
@@ -107,7 +107,7 @@ const ke = {
|
|
|
107
107
|
])) : M("", !0)
|
|
108
108
|
], 34));
|
|
109
109
|
}
|
|
110
|
-
}),
|
|
110
|
+
}), ke = { class: "top-selector2_itemMulti top-ellipsis" }, Le = /* @__PURE__ */ j({
|
|
111
111
|
__name: "itemMulti",
|
|
112
112
|
props: {
|
|
113
113
|
id: {},
|
|
@@ -115,29 +115,29 @@ const ke = {
|
|
|
115
115
|
},
|
|
116
116
|
emits: ["delete"],
|
|
117
117
|
setup(e) {
|
|
118
|
-
return (a, l) => (y(),
|
|
118
|
+
return (a, l) => (y(), T("div", ke, [
|
|
119
119
|
F(P(e.name) + " ", 1),
|
|
120
|
-
|
|
120
|
+
oe("span", {
|
|
121
121
|
class: "top-selector2_itemMultiDelete",
|
|
122
122
|
"data-top-icon": "",
|
|
123
123
|
onClick: l[0] || (l[0] = (t) => a.$emit("delete", { id: e.id, name: e.name })),
|
|
124
|
-
onMousedown: l[1] || (l[1] =
|
|
124
|
+
onMousedown: l[1] || (l[1] = de(() => {
|
|
125
125
|
}, ["stop"]))
|
|
126
126
|
}, null, 32)
|
|
127
127
|
]));
|
|
128
128
|
}
|
|
129
|
-
}),
|
|
130
|
-
|
|
129
|
+
}), N = /* @__PURE__ */ new Map(), Se = (e) => {
|
|
130
|
+
N.get(e)?.clear();
|
|
131
131
|
}, be = (e) => {
|
|
132
132
|
const a = window.mo?.user?.id;
|
|
133
133
|
return JSON.stringify(e.params) + ":" + e.url + ":" + a;
|
|
134
|
-
}, Be = (e, a) =>
|
|
135
|
-
|
|
136
|
-
},
|
|
137
|
-
const
|
|
138
|
-
let
|
|
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
139
|
e && !e.params.limit && (e.params.limit = 100);
|
|
140
|
-
const
|
|
140
|
+
const c = async () => {
|
|
141
141
|
if (!e) return;
|
|
142
142
|
const h = t ? be(e) : void 0;
|
|
143
143
|
if (h) {
|
|
@@ -151,96 +151,96 @@ const ke = {
|
|
|
151
151
|
console.warn("Array expected in `res.result`");
|
|
152
152
|
return;
|
|
153
153
|
}
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
156
|
-
console.warn(`В result[${
|
|
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
157
|
return;
|
|
158
158
|
}
|
|
159
|
-
return h &&
|
|
159
|
+
return h && we(h, e.path, g), g;
|
|
160
160
|
}, v = async (h) => {
|
|
161
161
|
if (!e) return;
|
|
162
162
|
if (h) {
|
|
163
|
-
if (!
|
|
164
|
-
e.params.offset =
|
|
163
|
+
if (!r || k.value) return;
|
|
164
|
+
e.params.offset = r;
|
|
165
165
|
} else
|
|
166
166
|
e.params.offset = 0;
|
|
167
|
-
a?.(e,
|
|
168
|
-
const g = await
|
|
169
|
-
|
|
170
|
-
}, s =
|
|
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
171
|
return {
|
|
172
172
|
apiRequest: e,
|
|
173
|
-
items:
|
|
174
|
-
isLoading:
|
|
173
|
+
items: u,
|
|
174
|
+
isLoading: k,
|
|
175
175
|
countLoading: f,
|
|
176
176
|
load: v,
|
|
177
177
|
setSearchTextAndLoad: (h, g = !0) => {
|
|
178
178
|
if (e) {
|
|
179
179
|
if (h.length < l) {
|
|
180
|
-
e.abortByFingerprint(),
|
|
180
|
+
e.abortByFingerprint(), u.value = [];
|
|
181
181
|
return;
|
|
182
182
|
}
|
|
183
|
-
h ===
|
|
183
|
+
h === i && u.value.length || (i = h, g ? s() : v(!1));
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
};
|
|
187
|
-
},
|
|
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
188
|
let t = e.params.filters ?? [];
|
|
189
|
-
t = t.filter((
|
|
190
|
-
},
|
|
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
191
|
const s = $(""), I = {
|
|
192
|
-
id:
|
|
193
|
-
name:
|
|
192
|
+
id: re,
|
|
193
|
+
name: he().Common.All
|
|
194
194
|
}, h = () => {
|
|
195
195
|
s.value = "";
|
|
196
|
-
}, g = () => !(!v.apiRequest || s.value.length >=
|
|
197
|
-
const
|
|
198
|
-
return !t &&
|
|
199
|
-
}), A = $([]),
|
|
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
200
|
A.value = p();
|
|
201
201
|
}, p = () => {
|
|
202
|
-
const
|
|
203
|
-
let
|
|
204
|
-
const L = [],
|
|
205
|
-
L.at(-1)?.listItemProps?.type === "delimiter" && L.pop(), L.length && (
|
|
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
206
|
};
|
|
207
|
-
for (const C of
|
|
207
|
+
for (const C of w.value)
|
|
208
208
|
switch (C.listItemProps?.type) {
|
|
209
209
|
case "title":
|
|
210
|
-
|
|
210
|
+
Q(), x = C;
|
|
211
211
|
break;
|
|
212
212
|
case "delimiter":
|
|
213
213
|
if (L.length) {
|
|
214
|
-
let
|
|
215
|
-
L.at(-1)?.listItemProps?.type === "delimiter" &&
|
|
214
|
+
let X = L.length;
|
|
215
|
+
L.at(-1)?.listItemProps?.type === "delimiter" && X--, L[X] = C;
|
|
216
216
|
}
|
|
217
217
|
break;
|
|
218
218
|
default:
|
|
219
|
-
const
|
|
220
|
-
(
|
|
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
221
|
}
|
|
222
|
-
if (
|
|
223
|
-
!
|
|
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
224
|
const C = {
|
|
225
225
|
id: O,
|
|
226
226
|
name: s.value
|
|
227
227
|
};
|
|
228
|
-
|
|
228
|
+
i && (C.listItemProps = { class: "top-popup-noCloser" }), n.push(C);
|
|
229
229
|
}
|
|
230
|
-
return t && (
|
|
231
|
-
}, m = (
|
|
232
|
-
|
|
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
233
|
h();
|
|
234
234
|
}));
|
|
235
235
|
};
|
|
236
236
|
if (v.apiRequest) {
|
|
237
|
-
const
|
|
238
|
-
t &&
|
|
239
|
-
|
|
237
|
+
const o = [l, v.items];
|
|
238
|
+
t && o.push(e), Y(o, () => {
|
|
239
|
+
R();
|
|
240
240
|
});
|
|
241
241
|
} else
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
Y([e, l, s], () => {
|
|
243
|
+
R();
|
|
244
244
|
}, {
|
|
245
245
|
immediate: !0,
|
|
246
246
|
// слежение за изменениями `items`
|
|
@@ -254,25 +254,25 @@ const ke = {
|
|
|
254
254
|
selectItem: m,
|
|
255
255
|
selectNextItem: () => {
|
|
256
256
|
if (Array.isArray(e.value)) return;
|
|
257
|
-
const
|
|
258
|
-
e.value = { ...n
|
|
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
259
|
},
|
|
260
|
-
deleteItemByItem: async (
|
|
261
|
-
Array.isArray(e.value) && (e.value = e.value.filter((
|
|
260
|
+
deleteItemByItem: async (o) => {
|
|
261
|
+
Array.isArray(e.value) && (e.value = e.value.filter((S) => S.id !== o.id || S.name !== o.name));
|
|
262
262
|
}
|
|
263
263
|
};
|
|
264
|
-
},
|
|
264
|
+
}, Pe = {
|
|
265
265
|
key: 0,
|
|
266
266
|
class: "top-selector2_activeItems"
|
|
267
|
-
},
|
|
267
|
+
}, $e = {
|
|
268
268
|
key: 1,
|
|
269
269
|
class: "top-selector2_activeName top-ellipsis"
|
|
270
|
-
},
|
|
270
|
+
}, Fe = {
|
|
271
271
|
key: 2,
|
|
272
272
|
class: "top-selector2_placeholder top-ellipsis"
|
|
273
|
-
},
|
|
273
|
+
}, De = { class: "top-selector2_searchWidget" }, ze = /* @__PURE__ */ j({
|
|
274
274
|
__name: "selector2",
|
|
275
|
-
props: /* @__PURE__ */
|
|
275
|
+
props: /* @__PURE__ */ z({
|
|
276
276
|
modelValue: {},
|
|
277
277
|
items: { default: () => [] },
|
|
278
278
|
title: {},
|
|
@@ -302,9 +302,9 @@ const ke = {
|
|
|
302
302
|
modelValue: { required: !0 },
|
|
303
303
|
modelModifiers: {}
|
|
304
304
|
}),
|
|
305
|
-
emits: /* @__PURE__ */
|
|
305
|
+
emits: /* @__PURE__ */ z(["appendItem", "open"], ["update:modelValue"]),
|
|
306
306
|
setup(e, { expose: a, emit: l }) {
|
|
307
|
-
const t = e,
|
|
307
|
+
const t = e, u = se(e, "modelValue"), k = l;
|
|
308
308
|
a({
|
|
309
309
|
/**
|
|
310
310
|
* Сброс локального кеша и кеша api
|
|
@@ -312,33 +312,33 @@ const ke = {
|
|
|
312
312
|
* @param resetAPICache - Сбросить API кеш, по умолчанию не сбрасывается. Для случаев, когда загруженные данные становятся неактуальными
|
|
313
313
|
*/
|
|
314
314
|
resetCache: (p = !1) => {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
}), s()?.elPopup &&
|
|
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
318
|
}
|
|
319
319
|
});
|
|
320
|
-
const f = q(() => t.searchType === "inline" && t.multiselect || t.searchType === "inline" &&
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
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
324
|
t.multiselect,
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
325
|
+
E(t, "useAllItem"),
|
|
326
|
+
E(t, "appendSearchToResult"),
|
|
327
|
+
E(t, "appendSearchToResultCond"),
|
|
328
|
+
E(t, "appendWithoutSelect"),
|
|
329
329
|
f,
|
|
330
330
|
t.minLength,
|
|
331
|
-
|
|
332
|
-
),
|
|
333
|
-
|
|
334
|
-
|
|
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
335
|
});
|
|
336
|
-
const I = q(() => Array.isArray(
|
|
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
337
|
let m = !1;
|
|
338
338
|
switch (p.key) {
|
|
339
339
|
case "Delete":
|
|
340
340
|
case "Backspace":
|
|
341
|
-
Array.isArray(
|
|
341
|
+
Array.isArray(u.value) && (p.preventDefault(), p.stopPropagation(), u.value.pop());
|
|
342
342
|
break;
|
|
343
343
|
case "ArrowUp":
|
|
344
344
|
case "ArrowRight":
|
|
@@ -349,36 +349,36 @@ const ke = {
|
|
|
349
349
|
m = !0;
|
|
350
350
|
break;
|
|
351
351
|
case "Escape":
|
|
352
|
-
f.value === "inline" &&
|
|
352
|
+
f.value === "inline" && r.resetSearch();
|
|
353
353
|
break;
|
|
354
354
|
}
|
|
355
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 && (
|
|
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
357
|
}, g = (p) => {
|
|
358
|
-
p.preventDefault(),
|
|
359
|
-
},
|
|
360
|
-
|
|
358
|
+
p.preventDefault(), r.selectNextItem();
|
|
359
|
+
}, w = () => {
|
|
360
|
+
i.apiRequest && i.setSearchTextAndLoad(r.searchText.value, !1), k("open");
|
|
361
361
|
}, A = () => {
|
|
362
|
-
f.value === "popup" &&
|
|
363
|
-
},
|
|
362
|
+
f.value === "popup" && r.searchText.value && r.resetSearch();
|
|
363
|
+
}, R = (p) => {
|
|
364
364
|
const m = p.target;
|
|
365
|
-
m.scrollTop / (m.scrollHeight - m.offsetHeight) > 0.8 &&
|
|
365
|
+
m.scrollTop / (m.scrollHeight - m.offsetHeight) > 0.8 && i.load(!0);
|
|
366
366
|
};
|
|
367
367
|
return (p, m) => {
|
|
368
|
-
const D =
|
|
369
|
-
return y(), b(
|
|
368
|
+
const D = Z("TopButton"), G = Z("TopLoadbar"), o = _("top-focus"), S = _("top-shortcut");
|
|
369
|
+
return y(), b(d(ge), {
|
|
370
370
|
ref_key: "popupRef",
|
|
371
371
|
ref: v,
|
|
372
|
-
onOpen: m[3] || (m[3] = (
|
|
373
|
-
onClose: m[4] || (m[4] = (
|
|
374
|
-
onScrollContentList: m[5] || (m[5] = (
|
|
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
375
|
notch: !1,
|
|
376
376
|
transitionDuration: 0,
|
|
377
377
|
openByFocusInput: f.value === "inline" && (e.openByFocusInput ?? !0),
|
|
378
|
-
disabled: f.value === "inline" &&
|
|
379
|
-
},
|
|
378
|
+
disabled: f.value === "inline" && d(r).genIsShort()
|
|
379
|
+
}, H({
|
|
380
380
|
opener: B(() => [
|
|
381
|
-
|
|
381
|
+
ee((y(), b(pe(c.value), W(e.buttonProps, {
|
|
382
382
|
class: {
|
|
383
383
|
"top-selector2": !0,
|
|
384
384
|
"top-selector2-multiselect": e.multiselect,
|
|
@@ -393,24 +393,24 @@ const ke = {
|
|
|
393
393
|
icon: e.icon,
|
|
394
394
|
tabindex: "0",
|
|
395
395
|
onKeydown: h,
|
|
396
|
-
onBlur: m[0] || (m[0] = (
|
|
396
|
+
onBlur: m[0] || (m[0] = (n) => f.value === "inline" && d(r).resetSearch()),
|
|
397
397
|
placeholder: I.value,
|
|
398
398
|
title: e.title,
|
|
399
399
|
captionType: f.value === "inline" && e.title !== void 0 ? "top" : void 0,
|
|
400
|
-
modelValue:
|
|
401
|
-
"onUpdate:modelValue": m[1] || (m[1] = (
|
|
400
|
+
modelValue: d(r).searchText.value,
|
|
401
|
+
"onUpdate:modelValue": m[1] || (m[1] = (n) => d(r).searchText.value = n)
|
|
402
402
|
}), {
|
|
403
403
|
default: B(() => [
|
|
404
|
-
e.multiselect ? (y(),
|
|
405
|
-
(y(!0),
|
|
406
|
-
id:
|
|
407
|
-
name:
|
|
408
|
-
onDelete:
|
|
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
409
|
}, null, 8, ["id", "name", "onDelete"]))), 256))
|
|
410
410
|
])) : M("", !0),
|
|
411
|
-
f.value !== "inline" && !e.multiselect ? (y(),
|
|
412
|
-
e.multiselect && !
|
|
413
|
-
e.addChanger && !e.buttonProps && !e.multiselect &&
|
|
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
414
|
key: 3,
|
|
415
415
|
class: "top-changer top-changer-selector",
|
|
416
416
|
"data-top-popup-disabled": "true",
|
|
@@ -420,69 +420,69 @@ const ke = {
|
|
|
420
420
|
_: 1
|
|
421
421
|
}, 16, ["class", "icon", "placeholder", "title", "captionType", "modelValue"])), [
|
|
422
422
|
[
|
|
423
|
-
|
|
423
|
+
o,
|
|
424
424
|
e.isError,
|
|
425
425
|
void 0,
|
|
426
426
|
{ onupdate: !0 }
|
|
427
427
|
],
|
|
428
|
-
[
|
|
428
|
+
[S, e.openerShortcut]
|
|
429
429
|
])
|
|
430
430
|
]),
|
|
431
431
|
contentList: B(() => [
|
|
432
|
-
(y(!0),
|
|
433
|
-
key:
|
|
432
|
+
(y(!0), T(V, null, U(d(r).itemsForShow.value, (n) => (y(), b(d(le), W({
|
|
433
|
+
key: n.id ?? void 0,
|
|
434
434
|
class: {
|
|
435
|
-
"top-active": !Array.isArray(
|
|
436
|
-
"top-selector2_item-all":
|
|
437
|
-
"top-selector2_item-new":
|
|
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
438
|
}
|
|
439
|
-
}, { ref_for: !0 },
|
|
440
|
-
closeByClick: !e.multiselect ||
|
|
441
|
-
onClick: (
|
|
439
|
+
}, { ref_for: !0 }, n.listItemProps, {
|
|
440
|
+
closeByClick: !e.multiselect || d(J).state.isMobile,
|
|
441
|
+
onClick: (x) => d(r).selectItem(n)
|
|
442
442
|
}), {
|
|
443
443
|
default: B(() => [
|
|
444
|
-
p.$slots.item ?
|
|
444
|
+
p.$slots.item ? fe(p.$slots, "item", {
|
|
445
445
|
key: 0,
|
|
446
|
-
item:
|
|
447
|
-
}) : (y(),
|
|
448
|
-
F(P(
|
|
446
|
+
item: n
|
|
447
|
+
}) : (y(), T(V, { key: 1 }, [
|
|
448
|
+
F(P(n.name), 1)
|
|
449
449
|
], 64))
|
|
450
450
|
]),
|
|
451
451
|
_: 2
|
|
452
452
|
}, 1040, ["class", "closeByClick", "onClick"]))), 128)),
|
|
453
|
-
!
|
|
453
|
+
!d(r).itemsForShow.value.length && !d(r).genIsShort() ? (y(), b(d(le), {
|
|
454
454
|
key: 0,
|
|
455
455
|
type: "regular"
|
|
456
456
|
}, {
|
|
457
457
|
default: B(() => [
|
|
458
|
-
!
|
|
458
|
+
!d(i).isLoading.value || d(i).countLoading.value ? (y(), T(V, { key: 0 }, [
|
|
459
459
|
F(P(p.$i18n.Common.No_results), 1)
|
|
460
|
-
], 64)) : (y(), b(
|
|
460
|
+
], 64)) : (y(), b(d(ye), {
|
|
461
461
|
key: 1,
|
|
462
462
|
type: "circles"
|
|
463
463
|
}))
|
|
464
464
|
]),
|
|
465
465
|
_: 1
|
|
466
466
|
})) : M("", !0),
|
|
467
|
-
|
|
467
|
+
d(i).countLoading.value && d(i).isLoading.value && f.value === "inline" ? (y(), b(G, { key: 1 })) : M("", !0)
|
|
468
468
|
]),
|
|
469
469
|
_: 2
|
|
470
470
|
}, [
|
|
471
471
|
f.value === "popup" ? {
|
|
472
472
|
name: "widget",
|
|
473
473
|
fn: B(() => [
|
|
474
|
-
|
|
475
|
-
|
|
474
|
+
oe("div", De, [
|
|
475
|
+
ee(ne(d(Ae), {
|
|
476
476
|
title: "Поиск",
|
|
477
477
|
icon: "",
|
|
478
|
-
modelValue:
|
|
479
|
-
"onUpdate:modelValue": m[2] || (m[2] = (
|
|
480
|
-
isLoading: !!
|
|
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
481
|
placeholder: I.value
|
|
482
482
|
}, null, 8, ["modelValue", "isLoading", "placeholder"]), [
|
|
483
483
|
[
|
|
484
|
-
|
|
485
|
-
|
|
484
|
+
o,
|
|
485
|
+
u.value,
|
|
486
486
|
void 0,
|
|
487
487
|
{ onupdate: !0 }
|
|
488
488
|
]
|
|
@@ -507,9 +507,9 @@ const ke = {
|
|
|
507
507
|
});
|
|
508
508
|
export {
|
|
509
509
|
O as I,
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
510
|
+
ze as _,
|
|
511
|
+
We as a,
|
|
512
|
+
Oe as b,
|
|
513
|
+
re as c
|
|
514
514
|
};
|
|
515
|
-
//# sourceMappingURL=policy.vue_vue_type_style_index_0_lang-
|
|
515
|
+
//# sourceMappingURL=policy.vue_vue_type_style_index_0_lang-BAP-FIuQ.es.js.map
|