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