@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.
@@ -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 G, mergeModels as U, useModel as ne, ref as $, onMounted as ue, onUpdated as ce, createElementBlock as k, openBlock as y, normalizeClass as de, createCommentVNode as M, Fragment as N, renderList as H, createBlock as b, mergeProps as W, createSlots as Y, withCtx as B, createTextVNode as F, toDisplayString as P, createVNode as oe, createElementVNode as re, withModifiers as fe, computed as q, watch as J, toRef as V, resolveComponent as _, resolveDirective as ee, unref as c, renderSlot as pe, withDirectives as te, resolveDynamicComponent as ve } from "vue";
7
- import { e as le, b as me, C as j, d as he, u as ye, s as ge } from "./forms-CUaoBGD5.es.js";
8
- import { _ as Ae, b as ae } from "./popupHint.vue_vue_type_style_index_0_lang-DzT1BFMx.es.js";
9
- import { _ as Ie } from "./widgetInput.vue_vue_type_script_setup_true_lang-BuoAaghB.es.js";
10
- import { invertKeyboardLayout as Ce } from "../utils/keyboard.js";
11
- import { g as Te } from "./field-CyyFzM-Y.es.js";
12
- const ke = {
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
- }, Oe = /* @__PURE__ */ G({
15
+ }, We = /* @__PURE__ */ j({
16
16
  __name: "menu",
17
- props: /* @__PURE__ */ U({
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 = ne(e, "modelValue"), t = $();
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 i = (u) => Array.isArray(l.value) ? l.value.includes(u.value) : u.value === l.value, S = (u, v = !1) => {
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(u.value);
40
- I === -1 ? s.push(u.value) : s.splice(I, 1);
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] === u.value ? s = [] : s = [u.value];
43
- !a.canBeEmptyMultiple && !s.length && (s = [u.value]), l.value = 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 = u.value;
47
- }, f = (u) => {
48
- if (t.value.scrollWidth <= t.value.offsetWidth || u.shiftKey || Math.abs(u.deltaY) < 50) return;
49
- u.preventDefault();
50
- const v = u.deltaY > 0 ? 30 : -30;
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
- }, r = (u = !0) => {
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, x = t.value.clientWidth + 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 > x && (A = h - t.value.clientWidth), A !== void 0 && (me() ? j.$?.(t.value).animate({ scrollLeft: A }, u ? 200 : 0) : t.value.scrollTo({ left: A, behavior: u ? "smooth" : "auto" }));
58
- }, o = () => {
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((u) => u.href ?? u.value);
64
+ l.value = a.items.map((c) => c.href ?? c.value);
65
65
  }
66
66
  };
67
- return ue(() => r(!1)), ce(() => r(!0)), (u, v) => (y(), k("div", {
67
+ return ie(() => i(!1)), ue(() => i(!0)), (c, v) => (y(), T("div", {
68
68
  ref_key: "el",
69
69
  ref: t,
70
- class: de({
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), k(N, null, H(e.items, (s) => (y(), b(le, W({ ref_for: !0 }, s, {
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) => S(s, I.ctrlKey || I.metaKey),
81
- isActive: i(s)
82
- }), Y({ _: 2 }, [
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(), k("div", ke, [
92
- oe(le, W(e.selectAllItem, {
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) => o()),
96
+ onClick: v[0] || (v[0] = (s) => r()),
97
97
  isActive: l.value.length === e.items.length
98
- }), Y({ _: 2 }, [
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
- }), Se = { class: "top-selector2_itemMulti top-ellipsis" }, Le = /* @__PURE__ */ G({
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(), k("div", Se, [
118
+ return (a, l) => (y(), T("div", ke, [
119
119
  F(P(e.name) + " ", 1),
120
- re("span", {
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] = fe(() => {
124
+ onMousedown: l[1] || (l[1] = de(() => {
125
125
  }, ["stop"]))
126
126
  }, null, 32)
127
127
  ]));
128
128
  }
129
- }), R = /* @__PURE__ */ new Map(), we = (e) => {
130
- R.get(e)?.clear();
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) => R.get(a)?.get(e), xe = (e, a, l) => {
135
- R.has(a) || R.set(a, /* @__PURE__ */ new Map()), R.get(a)?.set(e, l);
136
- }, Me = (e, a, l, t) => {
137
- const i = $([]), S = $(!1), f = $(0);
138
- let r = "", o;
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 u = async () => {
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 x = g.result.findIndex((A) => A.id === void 0 || A.name === void 0);
155
- if (x !== -1) {
156
- console.warn(`В result[${x}] нет id или name`);
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 && xe(h, e.path, g), g;
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 (!o || S.value) return;
164
- e.params.offset = o;
163
+ if (!r || k.value) return;
164
+ e.params.offset = r;
165
165
  } else
166
166
  e.params.offset = 0;
167
- a?.(e, r), S.value = !0;
168
- const g = await u();
169
- S.value = !1, f.value++, g && (o = g.nextOffset, h ? i.value = i.value.concat(g.result) : i.value = g.result);
170
- }, s = he(() => v(!1), 200);
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: i,
174
- isLoading: S,
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(), i.value = [];
180
+ e.abortByFingerprint(), u.value = [];
181
181
  return;
182
182
  }
183
- h === r && i.value.length || (r = h, g ? s() : v(!1));
183
+ h === i && u.value.length || (i = h, g ? s() : v(!1));
184
184
  }
185
185
  }
186
186
  };
187
- }, ie = 0, O = null, se = (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, ze = (e, a, l) => {
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((i) => i.name !== l), a && t.push(Te(l, "CONTAINS", [a])), e.changeParams({ filters: t });
190
- }, Pe = (e, a, l, t, i, S, f, r, o, u, v) => {
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: ie,
193
- name: ye().Common.All
192
+ id: re,
193
+ name: he().Common.All
194
194
  }, h = () => {
195
195
  s.value = "";
196
- }, g = () => !(!v.apiRequest || s.value.length >= u), x = q(() => {
197
- const n = [];
198
- return !t && i.value && (typeof i.value == "string" && (I.name = i.value), n.push(I)), l.value?.forEach((w) => n.push({ ...w })), n;
199
- }), A = $([]), K = () => {
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 n = s.value.toLowerCase(), w = Ce(n), d = n.replace(/^https?:\/\/(www\.)?|\/$/g, "");
203
- let T = [], z;
204
- const L = [], X = () => {
205
- L.at(-1)?.listItemProps?.type === "delimiter" && L.pop(), L.length && (z && T.push(z), T.push(...L), L.length = 0);
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 x.value)
207
+ for (const C of w.value)
208
208
  switch (C.listItemProps?.type) {
209
209
  case "title":
210
- X(), z = C;
210
+ Q(), x = C;
211
211
  break;
212
212
  case "delimiter":
213
213
  if (L.length) {
214
- let Z = L.length;
215
- L.at(-1)?.listItemProps?.type === "delimiter" && Z--, L[Z] = C;
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 E = C.name.toLowerCase();
220
- (String(C.id).includes(n) || E.includes(n) || E.includes(w) || E.includes(d)) && (E === n || E === w ? L.unshift(C) : L.push(C));
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 (X(), T.push(...v.items.value), S.value && s.value && (!f.value || f.value(n)) && // результаты могут быть найдены, но не точные, тогда предложить добавить элемент
223
- !T.find((C) => C.name.toLowerCase() === n)) {
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
- r && (C.listItemProps = { class: "top-popup-noCloser" }), T.push(C);
228
+ i && (C.listItemProps = { class: "top-popup-noCloser" }), n.push(C);
229
229
  }
230
- return t && (T = T.filter((C) => !se(e.value, C))), T;
231
- }, m = (n) => {
232
- n.listItemProps?.type === "title" || n.listItemProps?.type === "delimiter" || n.id === O && (a("appendItem", n), r) || (t && Array.isArray(e.value) ? se(e.value, n) || (e.value = [...e.value, n]) : e.value = n, setTimeout(() => {
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 n = [l, v.items];
238
- t && n.push(e), J(n, () => {
239
- K();
237
+ const o = [l, v.items];
238
+ t && o.push(e), Y(o, () => {
239
+ R();
240
240
  });
241
241
  } else
242
- J([e, l, s], () => {
243
- K();
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 n = A.value.filter((T) => !["title", "delimiter"].includes(T.listItemProps?.type ?? "")), d = (n.findIndex((T) => T.id === e.value.id) + 1) % n.length;
258
- e.value = { ...n[d] };
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 (n) => {
261
- Array.isArray(e.value) && (e.value = e.value.filter((w) => w.id !== n.id || w.name !== n.name));
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
- }, $e = {
264
+ }, Pe = {
265
265
  key: 0,
266
266
  class: "top-selector2_activeItems"
267
- }, Fe = {
267
+ }, $e = {
268
268
  key: 1,
269
269
  class: "top-selector2_activeName top-ellipsis"
270
- }, De = {
270
+ }, Fe = {
271
271
  key: 2,
272
272
  class: "top-selector2_placeholder top-ellipsis"
273
- }, Ee = { class: "top-selector2_searchWidget" }, Ue = /* @__PURE__ */ G({
273
+ }, De = { class: "top-selector2_searchWidget" }, ze = /* @__PURE__ */ j({
274
274
  __name: "selector2",
275
- props: /* @__PURE__ */ U({
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__ */ U(["appendItem", "open"], ["update:modelValue"]),
305
+ emits: /* @__PURE__ */ z(["appendItem", "open"], ["update:modelValue"]),
306
306
  setup(e, { expose: a, emit: l }) {
307
- const t = e, i = ne(e, "modelValue"), S = l;
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
- r.apiRequest && (p && we(r.apiRequest.path), r.items.value = [], r.countLoading.value = 0, r.apiRequest.params.offset = 0, requestAnimationFrame(() => {
316
- o.itemsForShow.value = [];
317
- }), s()?.elPopup && r.setSearchTextAndLoad(o.searchText.value));
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" && j.state.isMobile ? "popup" : t.searchType), r = Me(t.api, t.apiSetSearchParams, t.minLength, t.useCache), o = Pe(
321
- i,
322
- S,
323
- V(t, "items"),
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
- V(t, "useAllItem"),
326
- V(t, "appendSearchToResult"),
327
- V(t, "appendSearchToResultCond"),
328
- V(t, "appendWithoutSelect"),
325
+ E(t, "useAllItem"),
326
+ E(t, "appendSearchToResult"),
327
+ E(t, "appendSearchToResultCond"),
328
+ E(t, "appendWithoutSelect"),
329
329
  f,
330
330
  t.minLength,
331
- r
332
- ), u = q(() => t.buttonProps ? "TopButton" : f.value === "inline" ? "TopInput" : "div"), v = $(null), s = () => v.value?.popup;
333
- r.apiRequest && J(o.searchText, () => {
334
- r.setSearchTextAndLoad(o.searchText.value);
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(i.value) || t.multiselect || !t.selectedAsPlaceholder && f.value !== "inline" ? t.placeholder : i.value?.name || t.placeholder), h = (p) => {
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(i.value) && (p.preventDefault(), p.stopPropagation(), i.value.pop());
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" && o.resetSearch();
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 && (o.searchText.value || (o.searchText.value = p.key))), p.currentTarget?.click());
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(), o.selectNextItem();
359
- }, x = () => {
360
- r.apiRequest && r.setSearchTextAndLoad(o.searchText.value, !1), S("open");
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" && o.searchText.value && o.resetSearch();
363
- }, K = (p) => {
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 && r.load(!0);
365
+ m.scrollTop / (m.scrollHeight - m.offsetHeight) > 0.8 && i.load(!0);
366
366
  };
367
367
  return (p, m) => {
368
- const D = _("TopButton"), Q = _("TopLoadbar"), n = ee("top-focus"), w = ee("top-shortcut");
369
- return y(), b(c(Ae), {
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] = (d) => x()),
373
- onClose: m[4] || (m[4] = (d) => A()),
374
- onScrollContentList: m[5] || (m[5] = (d) => c(r) ? K(d) : void 0),
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" && c(o).genIsShort()
379
- }, Y({
378
+ disabled: f.value === "inline" && d(r).genIsShort()
379
+ }, H({
380
380
  opener: B(() => [
381
- te((y(), b(ve(u.value), W(e.buttonProps, {
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] = (d) => f.value === "inline" && c(o).resetSearch()),
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: c(o).searchText.value,
401
- "onUpdate:modelValue": m[1] || (m[1] = (d) => c(o).searchText.value = d)
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(), k("div", $e, [
405
- (y(!0), k(N, null, H(i.value, (d) => (y(), b(Le, {
406
- id: d.id,
407
- name: d.name,
408
- onDelete: c(o).deleteItemByItem
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(), k("span", Fe, P(Array.isArray(i.value) ? "" : i.value.name), 1)) : M("", !0),
412
- e.multiselect && !i.value.length ? (y(), k("span", De, P(I.value), 1)) : M("", !0),
413
- e.addChanger && !e.buttonProps && !e.multiselect && c(o).itemsForShow.value.length > 1 && !e.disabled ? (y(), k("span", {
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
- n,
423
+ o,
424
424
  e.isError,
425
425
  void 0,
426
426
  { onupdate: !0 }
427
427
  ],
428
- [w, e.openerShortcut]
428
+ [S, e.openerShortcut]
429
429
  ])
430
430
  ]),
431
431
  contentList: B(() => [
432
- (y(!0), k(N, null, H(c(o).itemsForShow.value, (d) => (y(), b(c(ae), W({
433
- key: d.id ?? void 0,
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(i.value) && !e.multiselect && i.value.id === d.id && i.value.name === d.name,
436
- "top-selector2_item-all": d.id === c(ie),
437
- "top-selector2_item-new": d.id === c(O)
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 }, d.listItemProps, {
440
- closeByClick: !e.multiselect || c(j).state.isMobile,
441
- onClick: (T) => c(o).selectItem(d)
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 ? pe(p.$slots, "item", {
444
+ p.$slots.item ? fe(p.$slots, "item", {
445
445
  key: 0,
446
- item: d
447
- }) : (y(), k(N, { key: 1 }, [
448
- F(P(d.name), 1)
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
- !c(o).itemsForShow.value.length && !c(o).genIsShort() ? (y(), b(c(ae), {
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
- !c(r).isLoading.value || c(r).countLoading.value ? (y(), k(N, { key: 0 }, [
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(c(ge), {
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
- c(r).countLoading.value && c(r).isLoading.value && f.value === "inline" ? (y(), b(Q, { key: 1 })) : M("", !0)
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
- re("div", Ee, [
475
- te(oe(c(Ie), {
474
+ oe("div", De, [
475
+ ee(ne(d(Ae), {
476
476
  title: "Поиск",
477
477
  icon: "",
478
- modelValue: c(o).searchText.value,
479
- "onUpdate:modelValue": m[2] || (m[2] = (d) => c(o).searchText.value = d),
480
- isLoading: !!c(r).countLoading.value && c(r).isLoading.value,
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
- n,
485
- i.value,
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
- Ue as _,
511
- Oe as a,
512
- ze as b,
513
- ie as c
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-BiCaYVJ6.es.js.map
515
+ //# sourceMappingURL=policy.vue_vue_type_style_index_0_lang-BAP-FIuQ.es.js.map