@topvisor/ui 1.6.0 → 1.6.1-searcherKey.0
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/project/project.js
CHANGED
|
@@ -15,13 +15,13 @@ import { validUrl as u } from "../utils/check.js";
|
|
|
15
15
|
import { ellipsis as d } from "../utils/string.js";
|
|
16
16
|
import { genRegionLabelData as f, getSearcherGIcon as p } from "../utils/searchers.js";
|
|
17
17
|
import { invertKeyboardLayout as m } from "../utils/keyboard.js";
|
|
18
|
-
import { c as h, n as
|
|
19
|
-
import { c as
|
|
20
|
-
import { Fragment as
|
|
18
|
+
import { c as h, n as g, o as _, r as v, s as y } from "../.chunks/popup-cAqd6Dj3.es.js";
|
|
19
|
+
import { c as b, d as x, f as S, p as C } from "../.chunks/formsExt-D7XsRleI.es.js";
|
|
20
|
+
import { Fragment as w, computed as T, createBlock as E, createCommentVNode as D, createElementBlock as O, createElementVNode as k, createSlots as ee, createTextVNode as A, createVNode as j, defineComponent as M, isRef as te, mergeModels as N, mergeProps as ne, nextTick as re, normalizeClass as P, onMounted as ie, openBlock as F, reactive as ae, ref as I, renderList as oe, renderSlot as se, resolveComponent as ce, resolveDirective as le, resolveDynamicComponent as ue, shallowRef as de, toDisplayString as L, toValue as fe, unref as R, useId as pe, useModel as z, watch as B, withCtx as V, withDirectives as me, withKeys as he, withModifiers as H } from "vue";
|
|
21
21
|
//#region src/components/project/competitorSelector/competitorSelector.vue?vue&type=script&setup=true&lang.ts
|
|
22
|
-
var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, ve = /* @__PURE__ */
|
|
22
|
+
var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, ve = /* @__PURE__ */ M({
|
|
23
23
|
__name: "competitorSelector",
|
|
24
|
-
props: /*@__PURE__*/
|
|
24
|
+
props: /*@__PURE__*/ N({
|
|
25
25
|
modelValue: {},
|
|
26
26
|
items: {},
|
|
27
27
|
showSelectAllItem: {
|
|
@@ -35,7 +35,7 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
35
35
|
}),
|
|
36
36
|
emits: ["update:modelValue"],
|
|
37
37
|
setup(e) {
|
|
38
|
-
let t = e, i = z(e, "modelValue"), o =
|
|
38
|
+
let t = e, i = z(e, "modelValue"), o = T(() => {
|
|
39
39
|
if (t.showSelectAllItem) return {
|
|
40
40
|
icon: t.selectAllItemIcon,
|
|
41
41
|
title: n().Common.Select_all,
|
|
@@ -43,23 +43,23 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
43
43
|
content: ""
|
|
44
44
|
};
|
|
45
45
|
});
|
|
46
|
-
return (t, n) => (
|
|
47
|
-
opener: V(() => [
|
|
46
|
+
return (t, n) => (F(), O("div", ge, [R(r).state.isMobile ? (F(), E(y, { key: 0 }, {
|
|
47
|
+
opener: V(() => [j(a, {
|
|
48
48
|
class: "top-competitorSelector_opener",
|
|
49
49
|
color: "theme",
|
|
50
50
|
icon: "",
|
|
51
51
|
icon2: ""
|
|
52
52
|
}, {
|
|
53
|
-
default: V(() => [
|
|
53
|
+
default: V(() => [A(L(e.items.find((e) => e.value === i.value?.[0])?.content), 1)]),
|
|
54
54
|
_: 1
|
|
55
55
|
})]),
|
|
56
|
-
contentList: V(() => [(
|
|
57
|
-
class:
|
|
56
|
+
contentList: V(() => [(F(!0), O(w, null, oe(e.items, (e) => (F(), E(_, {
|
|
57
|
+
class: P({ "top-active": i.value?.includes(e.value) }),
|
|
58
58
|
"data-top-icon": e.icon,
|
|
59
59
|
title: e.title,
|
|
60
60
|
onClick: () => i.value = [e.value]
|
|
61
61
|
}, {
|
|
62
|
-
default: V(() => [
|
|
62
|
+
default: V(() => [k("span", _e, L(e.content), 1)]),
|
|
63
63
|
_: 2
|
|
64
64
|
}, 1032, [
|
|
65
65
|
"class",
|
|
@@ -68,7 +68,7 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
68
68
|
"onClick"
|
|
69
69
|
]))), 256))]),
|
|
70
70
|
_: 1
|
|
71
|
-
})) : (
|
|
71
|
+
})) : (F(), E(C, {
|
|
72
72
|
key: 1,
|
|
73
73
|
modelValue: i.value,
|
|
74
74
|
"onUpdate:modelValue": n[0] ||= (e) => i.value = e,
|
|
@@ -83,7 +83,7 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
83
83
|
"selectAllItem"
|
|
84
84
|
]))]));
|
|
85
85
|
}
|
|
86
|
-
}), ye = (e, t) =>
|
|
86
|
+
}), ye = (e, t) => T(() => fe(e).filter((e) => e.on >= 0 || e.id === t).map((e) => ({
|
|
87
87
|
value: e.id,
|
|
88
88
|
title: e.url + ` [${e.id}]`,
|
|
89
89
|
icon: e.id === fe(t) ? "" : "",
|
|
@@ -173,8 +173,8 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
173
173
|
}, Fe = (e, t) => {
|
|
174
174
|
let r = n();
|
|
175
175
|
return {
|
|
176
|
-
searcherKey:
|
|
177
|
-
optionBySearcherKey:
|
|
176
|
+
searcherKey: I(e.modelValueSearcherKey ?? t.value.keys().next().value ?? -2),
|
|
177
|
+
optionBySearcherKey: T(() => {
|
|
178
178
|
let n = /* @__PURE__ */ new Map();
|
|
179
179
|
if (t.value.forEach((t) => {
|
|
180
180
|
let r = {
|
|
@@ -199,9 +199,9 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
199
199
|
})
|
|
200
200
|
};
|
|
201
201
|
}, Ie = (e, t) => {
|
|
202
|
-
let r = n(), i =
|
|
202
|
+
let r = n(), i = T(() => e.forMode === "volume" || e.forMode === "cost_forecast"), a = I(-2);
|
|
203
203
|
e.modelValue.length === 1 && (a.value = e.modelValue[0]), a.value === -2 && (a.value = i.value ? t.value?.regionByIndex.values().next().value?.key ?? -2 : t.value?.regionByIndex.keys().next().value ?? -2);
|
|
204
|
-
let o =
|
|
204
|
+
let o = T(() => {
|
|
205
205
|
let e = /* @__PURE__ */ new Map();
|
|
206
206
|
return t.value.regionByIndex?.forEach((t) => {
|
|
207
207
|
if (i.value) {
|
|
@@ -248,7 +248,7 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
248
248
|
optionByRegionIndex: o
|
|
249
249
|
};
|
|
250
250
|
}, Le = (e, t, n) => {
|
|
251
|
-
let r =
|
|
251
|
+
let r = I([]), i = () => {
|
|
252
252
|
if (e.onlySearcher && t.value) {
|
|
253
253
|
r.value = Array.from(t.value.keys());
|
|
254
254
|
return;
|
|
@@ -266,7 +266,7 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
266
266
|
a();
|
|
267
267
|
}), e.addCompare && i(), { regionsIndexes: r };
|
|
268
268
|
}, Re = (e) => {
|
|
269
|
-
let t =
|
|
269
|
+
let t = T(() => e.forMode === "volume" || e.forMode === "cost_forecast"), n = T(() => je(e.forMode, e.autoRegion, e.searchers)), r = T(() => n.value.get(a.searcherKey.value) || Se), i = T(() => {
|
|
270
270
|
let e = /* @__PURE__ */ new Set();
|
|
271
271
|
return n.value.forEach((t) => {
|
|
272
272
|
t.regionByIndex.forEach((t) => {
|
|
@@ -277,7 +277,7 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
277
277
|
B(n, () => {
|
|
278
278
|
if (e.onlySearcher ? s.regionsIndexes.value = Array.from(n.value.keys()) : s.regionsIndexes.value = s.regionsIndexes.value.filter((e) => i.value.has(e)), a.searcherKey.value === -1) return;
|
|
279
279
|
let t = n.value.keys().next().value;
|
|
280
|
-
n.value.forEach((r) => {
|
|
280
|
+
e.modelValueSearcherKey === void 0 ? n.value.forEach((r) => {
|
|
281
281
|
if (e.onlySearcher && r.key === a.searcherKey.value) {
|
|
282
282
|
t = a.searcherKey.value;
|
|
283
283
|
return;
|
|
@@ -288,7 +288,7 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
288
288
|
let i = n.value.get(r.key)?.regionByIndex;
|
|
289
289
|
e?.has(-2) && !i?.has(-2) && (t = r.key);
|
|
290
290
|
}
|
|
291
|
-
}), t !== void 0 && (a.searcherKey.value = t), o.regionIndex.value !== void 0 && !(r.value?.regionByIndex)?.has(o.regionIndex.value) && (o.regionIndex.value = r.value?.regions?.keys().next().value);
|
|
291
|
+
}) : t = e.modelValueSearcherKey, t !== void 0 && (a.searcherKey.value = t), o.regionIndex.value !== void 0 && !(r.value?.regionByIndex)?.has(o.regionIndex.value) && (o.regionIndex.value = r.value?.regions?.keys().next().value);
|
|
292
292
|
}, { immediate: !0 });
|
|
293
293
|
let c = () => {
|
|
294
294
|
if (a.searcherKey.value !== -1 && a.searcherKey.value !== -2) return a.searcherKey.value;
|
|
@@ -319,13 +319,14 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
319
319
|
if (e !== void 0) return u()?.regionByIndex?.get(e);
|
|
320
320
|
}
|
|
321
321
|
};
|
|
322
|
-
}, ze = /* @__PURE__ */
|
|
322
|
+
}, ze = /* @__PURE__ */ M({
|
|
323
323
|
__name: "regionSelector",
|
|
324
|
-
props: /*@__PURE__*/
|
|
324
|
+
props: /*@__PURE__*/ N({
|
|
325
325
|
projectId: {},
|
|
326
326
|
searchers: { default: () => [] },
|
|
327
327
|
modelValue: {},
|
|
328
328
|
modelValueSingle: {},
|
|
329
|
+
modelValueSearcherKey: {},
|
|
329
330
|
addCompare: { type: Boolean },
|
|
330
331
|
forMode: {},
|
|
331
332
|
autoRegion: { type: Boolean },
|
|
@@ -346,95 +347,107 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
346
347
|
modelValue: { required: !0 },
|
|
347
348
|
modelModifiers: {},
|
|
348
349
|
modelValueSingle: {},
|
|
349
|
-
modelValueSingleModifiers: {}
|
|
350
|
+
modelValueSingleModifiers: {},
|
|
351
|
+
modelValueSearcherKey: {},
|
|
352
|
+
modelValueSearcherKeyModifiers: {}
|
|
350
353
|
}),
|
|
351
|
-
emits: [
|
|
354
|
+
emits: [
|
|
355
|
+
"update:modelValue",
|
|
356
|
+
"update:modelValueSingle",
|
|
357
|
+
"update:modelValueSearcherKey"
|
|
358
|
+
],
|
|
352
359
|
setup(e, { expose: t }) {
|
|
353
|
-
let n = e, r =
|
|
360
|
+
let n = e, r = T(() => n.forMode === "volume" || n.forMode === "cost_forecast"), i = z(e, "modelValue"), s = z(e, "modelValueSingle"), c = z(e, "modelValueSearcherKey"), l = i.value.some((e) => e !== -2);
|
|
361
|
+
if (r.value && !n.onlySearcher && c.value === void 0 && l) throw Error("При использовании `region.key` в `modelValue` необходимо передавать `modelValueSearcherKey`");
|
|
362
|
+
let { selectSearcher: u, selectRegion: d, compare: f, searcherByKey: p, allRegionsIndexes: m, getSearcher: h, getRegion: g } = Re(n), _ = () => {
|
|
354
363
|
let e = [];
|
|
355
|
-
|
|
364
|
+
p.value.forEach((t) => {
|
|
356
365
|
(n.forMode === "project_relevant_url" || t.enabled) && t.regions.forEach((t) => {
|
|
357
366
|
(n.forMode === "project_relevant_url" || t.enabled) && t.index !== -1 && e.push(t);
|
|
358
367
|
});
|
|
359
368
|
}), Ae.open("regions", {
|
|
360
369
|
regions: e,
|
|
361
|
-
regionsIndexes:
|
|
362
|
-
"@update:regionsIndexes": (e) =>
|
|
370
|
+
regionsIndexes: f.regionsIndexes.value,
|
|
371
|
+
"@update:regionsIndexes": (e) => f.regionsIndexes.value = e
|
|
363
372
|
});
|
|
364
373
|
};
|
|
365
374
|
return B([
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
375
|
+
d.regionIndex,
|
|
376
|
+
u.searcherKey,
|
|
377
|
+
f.regionsIndexes
|
|
369
378
|
], () => {
|
|
370
|
-
if (
|
|
371
|
-
if (JSON.stringify(i.value) === JSON.stringify(
|
|
372
|
-
i.value = [...
|
|
373
|
-
} else n.onlySearcher ? (i.value = [
|
|
374
|
-
!n.onlySearcher && !
|
|
379
|
+
if (u.searcherKey.value === -1 && f.regionsIndexes.value.length) {
|
|
380
|
+
if (JSON.stringify(i.value) === JSON.stringify(f.regionsIndexes.value)) return;
|
|
381
|
+
i.value = [...f.regionsIndexes.value];
|
|
382
|
+
} else n.onlySearcher ? (i.value = [u.searcherKey.value], u.searcherKey.value === -2 && !n.autoRegion && (i.value.length = 0)) : (i.value = [d.regionIndex.value], d.regionIndex.value === -2 && !n.autoRegion && (i.value.length = 0));
|
|
383
|
+
!n.onlySearcher && !m.value.size && (u.searcherKey.value = -2);
|
|
384
|
+
}), B(c, () => {
|
|
385
|
+
c.value !== void 0 && (u.searcherKey.value = c.value);
|
|
386
|
+
}), B(u.searcherKey, () => {
|
|
387
|
+
c.value !== void 0 && (c.value = u.searcherKey.value);
|
|
375
388
|
}), s.value && B(s, () => {
|
|
376
389
|
s.value && (i.value = [s.value]);
|
|
377
390
|
}, { immediate: !0 }), B(i, () => {
|
|
378
391
|
if (i.value[0] && (s.value = i.value[0]), n.onlySearcher) {
|
|
379
|
-
if (!i.value.length || i.value.length === 1 && !
|
|
380
|
-
let e =
|
|
392
|
+
if (!i.value.length || i.value.length === 1 && !p.value.has(i.value[0]) || i.value.length === 1 && i.value[0] === -2 && !n.autoRegion) {
|
|
393
|
+
let e = p.value.keys().next().value;
|
|
381
394
|
e === -2 && !n.autoRegion && (e = void 0, s.value = -2), e === void 0 ? i.value.length = 0 : i.value = [e];
|
|
382
395
|
return;
|
|
383
396
|
}
|
|
384
|
-
if (i.value.length > 1 && JSON.stringify(i.value) !== JSON.stringify(
|
|
385
|
-
i.value = [...
|
|
397
|
+
if (i.value.length > 1 && JSON.stringify(i.value) !== JSON.stringify(f.regionsIndexes.value)) {
|
|
398
|
+
i.value = [...f.regionsIndexes.value];
|
|
386
399
|
return;
|
|
387
400
|
}
|
|
388
401
|
} else {
|
|
389
|
-
let e = [...new Set(i.value)], t =
|
|
390
|
-
if (r.value && (t =
|
|
402
|
+
let e = [...new Set(i.value)], t = p.value.values().next().value?.regionByIndex?.keys().next().value;
|
|
403
|
+
if (r.value && (t = p.value.values().next().value?.regionByIndex?.values().next().value?.key), t === -2 && !n.autoRegion && (t = void 0, s.value = -2), !e.length) t !== void 0 && e.push(t);
|
|
391
404
|
else if (e.length === 1) {
|
|
392
|
-
let n =
|
|
393
|
-
r.value && (n = /* @__PURE__ */ new Set(),
|
|
405
|
+
let n = m.value;
|
|
406
|
+
r.value && (n = /* @__PURE__ */ new Set(), p.value.forEach((e) => {
|
|
394
407
|
e.regionByIndex.forEach((e) => {
|
|
395
408
|
e.index !== -2 && n.add(e.key);
|
|
396
409
|
});
|
|
397
410
|
})), n.has(e[0]) || (e = [], t !== void 0 && e.push(t));
|
|
398
|
-
} else e = e.filter((e) =>
|
|
411
|
+
} else e = e.filter((e) => m.value.has(e)), !e.length && t !== void 0 && e.push(t);
|
|
399
412
|
if (JSON.stringify(i.value) !== JSON.stringify(e)) {
|
|
400
413
|
i.value = e;
|
|
401
414
|
return;
|
|
402
415
|
}
|
|
403
416
|
}
|
|
404
|
-
if (i.value.length !== 1 || i.value[0] !== (n.onlySearcher ?
|
|
417
|
+
if (i.value.length !== 1 || i.value[0] !== (n.onlySearcher ? u.searcherKey.value : d.regionIndex.value)) {
|
|
405
418
|
if (n.onlySearcher) {
|
|
406
419
|
if (i.value.length === 1) {
|
|
407
|
-
|
|
420
|
+
u.searcherKey.value = i.value[0];
|
|
408
421
|
return;
|
|
409
422
|
}
|
|
410
|
-
|
|
423
|
+
u.searcherKey.value = -1;
|
|
411
424
|
return;
|
|
412
425
|
}
|
|
413
426
|
if (!i.value.length) return;
|
|
414
|
-
if (i.value.length === 1 &&
|
|
415
|
-
|
|
416
|
-
let e;
|
|
417
|
-
for (let t of
|
|
418
|
-
for (let n of t.regionByIndex.values()) if ((r.value ? n.key : n.index) ===
|
|
427
|
+
if (i.value.length === 1 && u.searcherKey.value !== -1) {
|
|
428
|
+
d.regionIndex.value = i.value[0];
|
|
429
|
+
let e = c.value;
|
|
430
|
+
if (e === void 0) for (let t of p.value.values()) {
|
|
431
|
+
for (let n of t.regionByIndex.values()) if ((r.value ? n.key : n.index) === d.regionIndex.value) {
|
|
419
432
|
e = t.key;
|
|
420
433
|
break;
|
|
421
434
|
}
|
|
422
435
|
if (e !== void 0) break;
|
|
423
436
|
}
|
|
424
|
-
e !== void 0 && (
|
|
425
|
-
} else
|
|
437
|
+
e !== void 0 && (u.searcherKey.value = e);
|
|
438
|
+
} else u.searcherKey.value = -1, f.regionsIndexes.value = [...i.value];
|
|
426
439
|
}
|
|
427
440
|
}, { immediate: !0 }), t({
|
|
428
|
-
getSearcher:
|
|
429
|
-
getRegion:
|
|
430
|
-
}), (t, n) => (
|
|
441
|
+
getSearcher: h,
|
|
442
|
+
getRegion: g
|
|
443
|
+
}), (t, n) => (F(), O("div", { class: P({
|
|
431
444
|
"top-regionSelector": !0,
|
|
432
445
|
"top-regionSelector-onlySearcher": e.onlySearcher
|
|
433
446
|
}) }, [
|
|
434
|
-
|
|
435
|
-
options: R(
|
|
436
|
-
modelValue: R(
|
|
437
|
-
"onUpdate:modelValue": n[0] ||= (e) => R(
|
|
447
|
+
j(o, {
|
|
448
|
+
options: R(u).optionBySearcherKey.value,
|
|
449
|
+
modelValue: R(u).searcherKey.value,
|
|
450
|
+
"onUpdate:modelValue": n[0] ||= (e) => R(u).searcherKey.value = e,
|
|
438
451
|
name: "searcher_key",
|
|
439
452
|
addChanger: e.addChanger
|
|
440
453
|
}, null, 8, [
|
|
@@ -442,12 +455,12 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
442
455
|
"modelValue",
|
|
443
456
|
"addChanger"
|
|
444
457
|
]),
|
|
445
|
-
!e.onlySearcher && R(
|
|
458
|
+
!e.onlySearcher && R(u).searcherKey.value !== R(-1) ? (F(), E(o, {
|
|
446
459
|
key: 0,
|
|
447
460
|
class: "top-select-region",
|
|
448
|
-
options: R(
|
|
449
|
-
modelValue: R(
|
|
450
|
-
"onUpdate:modelValue": n[1] ||= (e) => R(
|
|
461
|
+
options: R(d).optionByRegionIndex.value,
|
|
462
|
+
modelValue: R(d).regionIndex.value,
|
|
463
|
+
"onUpdate:modelValue": n[1] ||= (e) => R(d).regionIndex.value = e,
|
|
451
464
|
name: r.value ? "region_key" : "region_index",
|
|
452
465
|
addChanger: e.addChanger,
|
|
453
466
|
"data-top-icon": e.addRegionIcon ? "" : void 0
|
|
@@ -457,16 +470,16 @@ var ge = { class: "top-competitorSelector" }, _e = { class: "top-ellipsis1" }, v
|
|
|
457
470
|
"name",
|
|
458
471
|
"addChanger",
|
|
459
472
|
"data-top-icon"
|
|
460
|
-
])) :
|
|
461
|
-
e.addCompare && !e.onlySearcher && R(
|
|
473
|
+
])) : D("", !0),
|
|
474
|
+
e.addCompare && !e.onlySearcher && R(u).searcherKey.value === R(-1) ? (F(), E(a, {
|
|
462
475
|
key: 1,
|
|
463
476
|
name: "compare",
|
|
464
|
-
onClick:
|
|
465
|
-
"data-count-compare-regions-indexes": R(
|
|
477
|
+
onClick: _,
|
|
478
|
+
"data-count-compare-regions-indexes": R(f).regionsIndexes.value.length
|
|
466
479
|
}, {
|
|
467
|
-
default: V(() => [
|
|
480
|
+
default: V(() => [A(L(t.$i18n.Common.Selected_regions), 1)]),
|
|
468
481
|
_: 1
|
|
469
|
-
}, 8, ["data-count-compare-regions-indexes"])) :
|
|
482
|
+
}, 8, ["data-count-compare-regions-indexes"])) : D("", !0)
|
|
470
483
|
], 2));
|
|
471
484
|
}
|
|
472
485
|
}), W = {
|
|
@@ -509,9 +522,9 @@ function Ue(e, t, n) {
|
|
|
509
522
|
}
|
|
510
523
|
//#endregion
|
|
511
524
|
//#region src/components/project/groupSelector/folders/folders.vue?vue&type=script&setup=true&lang.ts
|
|
512
|
-
var We = ["innerHTML"], Ge = /* @__PURE__ */
|
|
525
|
+
var We = ["innerHTML"], Ge = /* @__PURE__ */ M({
|
|
513
526
|
__name: "folders",
|
|
514
|
-
props: /*@__PURE__*/
|
|
527
|
+
props: /*@__PURE__*/ N({
|
|
515
528
|
folderId: {},
|
|
516
529
|
folder: {},
|
|
517
530
|
folders: {},
|
|
@@ -532,11 +545,11 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
532
545
|
}),
|
|
533
546
|
emits: ["update:folderId", "update:folder"],
|
|
534
547
|
setup(e) {
|
|
535
|
-
let t = e, n = z(e, "folderId"), r = z(e, "folder"), i = t.client && !t.folders ? He(t.client, t.service) : void 0, a =
|
|
548
|
+
let t = e, n = z(e, "folderId"), r = z(e, "folder"), i = t.client && !t.folders ? He(t.client, t.service) : void 0, a = I(null);
|
|
536
549
|
B(() => t.projectId, () => {
|
|
537
550
|
i?.changeParams({ project_id: t.projectId }), i?.setOptions({ checkFingerprint: "TopGroupSelectorFolders:" + t.projectId }), a.value?.resetCache();
|
|
538
551
|
}, { immediate: !0 });
|
|
539
|
-
let o =
|
|
552
|
+
let o = T(() => Ve(t.folders ?? { root: [W] }, t.canSelectAll)), s = (e) => (t.canSelectAll && e[0]?.id === 0 && (e[0] = {
|
|
540
553
|
...e[0],
|
|
541
554
|
name: Be(!0)
|
|
542
555
|
}), e);
|
|
@@ -551,7 +564,7 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
551
564
|
}
|
|
552
565
|
let i = o.value.get(t.folderId);
|
|
553
566
|
i ||= W, r.value = i, n.value = i.id;
|
|
554
|
-
}, { immediate: !0 }), (t, n) => (
|
|
567
|
+
}, { immediate: !0 }), (t, n) => (F(), E(b, {
|
|
555
568
|
class: "top-groupSelector_folder",
|
|
556
569
|
modelValue: r.value,
|
|
557
570
|
"onUpdate:modelValue": n[0] ||= (e) => r.value = e,
|
|
@@ -559,12 +572,12 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
559
572
|
"search-type": "inline",
|
|
560
573
|
icon: e.addIcon ? "" : void 0,
|
|
561
574
|
api: e.folders ? void 0 : R(i),
|
|
562
|
-
apiSetSearchParams: (...e) => R(
|
|
575
|
+
apiSetSearchParams: (...e) => R(x)(...e, "name"),
|
|
563
576
|
prepareItemsBeforeRender: s,
|
|
564
577
|
addChanger: e.addChanger,
|
|
565
578
|
useCache: ""
|
|
566
579
|
}, {
|
|
567
|
-
item: V(({ item: e }) => [
|
|
580
|
+
item: V(({ item: e }) => [k("div", { innerHTML: e.name.replaceAll(/</g, "< ") }, null, 8, We)]),
|
|
568
581
|
_: 1
|
|
569
582
|
}, 8, [
|
|
570
583
|
"modelValue",
|
|
@@ -596,9 +609,9 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
596
609
|
}), Ye = (e, t) => e.gen(`/add/${t}/groups/`), Xe = (e, t) => e.gen(`/del/${t}/groups/`), Ze = (e, t) => e.gen(`/edit/${t}/groups/rename/`), Qe = { class: "top-groupSelector_groupItem top-ellipsis1" }, $e = {
|
|
597
610
|
key: 0,
|
|
598
611
|
class: "top-comment"
|
|
599
|
-
}, et = ["innerHTML"], tt = ["innerHTML"], nt = ["innerHTML"], rt = /* @__PURE__ */
|
|
612
|
+
}, et = ["innerHTML"], tt = ["innerHTML"], nt = ["innerHTML"], rt = /* @__PURE__ */ M({
|
|
600
613
|
__name: "groups",
|
|
601
|
-
props: /*@__PURE__*/
|
|
614
|
+
props: /*@__PURE__*/ N({
|
|
602
615
|
groupId: {},
|
|
603
616
|
group: {},
|
|
604
617
|
projectId: {},
|
|
@@ -629,13 +642,13 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
629
642
|
group: { required: !0 },
|
|
630
643
|
groupModifiers: {}
|
|
631
644
|
}),
|
|
632
|
-
emits: /*@__PURE__*/
|
|
645
|
+
emits: /*@__PURE__*/ N([
|
|
633
646
|
"addGroup",
|
|
634
647
|
"editGroup",
|
|
635
648
|
"delGroup"
|
|
636
649
|
], ["update:groupId", "update:group"]),
|
|
637
650
|
setup(e, { expose: n, emit: r }) {
|
|
638
|
-
let i = e, a = r, o = z(e, "groupId"), s = z(e, "group"), c = i.client && !i.groups ? Je(i.client, i.service) : void 0, l = i.client ? Ye(i.client, i.service) : void 0, u = i.client ? Xe(i.client, i.service) : void 0, d = i.client ? Ze(i.client, i.service) : void 0, f =
|
|
651
|
+
let i = e, a = r, o = z(e, "groupId"), s = z(e, "group"), c = i.client && !i.groups ? Je(i.client, i.service) : void 0, l = i.client ? Ye(i.client, i.service) : void 0, u = i.client ? Xe(i.client, i.service) : void 0, d = i.client ? Ze(i.client, i.service) : void 0, f = I(null), p = T(() => {
|
|
639
652
|
if (i.groups !== void 0) return qe(i.groups, i.on, i.folder);
|
|
640
653
|
}), m = t("folder_id", "EQUALS", [i.folder?.id ?? 0]);
|
|
641
654
|
c?.changeParams({
|
|
@@ -645,7 +658,7 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
645
658
|
}), i.on !== void 0 && c?.params.filters?.push(t("on", "EQUALS", [Number(i.on)]));
|
|
646
659
|
let h = (e) => {
|
|
647
660
|
s.value = e, o.value = e.id;
|
|
648
|
-
},
|
|
661
|
+
}, _ = (e = !1) => {
|
|
649
662
|
f.value?.resetCache(e);
|
|
650
663
|
};
|
|
651
664
|
Ue({
|
|
@@ -653,9 +666,9 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
653
666
|
folderId: () => i.folder?.id,
|
|
654
667
|
canSelectAll: () => i.canSelectAll
|
|
655
668
|
}, (e) => {
|
|
656
|
-
if (e.projectId && (c?.changeParams({ project_id: i.projectId }), c?.setOptions({ checkFingerprint: "TopGroupSelectorGroups:" + i.projectId })), e.folderId && (m.values = [i.folder?.id ?? 0]),
|
|
669
|
+
if (e.projectId && (c?.changeParams({ project_id: i.projectId }), c?.setOptions({ checkFingerprint: "TopGroupSelectorGroups:" + i.projectId })), e.folderId && (m.values = [i.folder?.id ?? 0]), _(), (e.folderId?.old !== void 0 || e.canSelectAll?.old !== void 0) && o.value !== null) {
|
|
657
670
|
let e;
|
|
658
|
-
i.autoselect === "first" && (e = p.value?.[0], i.canSelectAll && (e =
|
|
671
|
+
i.autoselect === "first" && (e = p.value?.[0], i.canSelectAll && (e = ae(q()))), (i.autoselect === "placeholder" || !e) && (e = Ke()), h(e);
|
|
659
672
|
}
|
|
660
673
|
}, { immediate: !0 }), Ue({
|
|
661
674
|
modelGroup: s,
|
|
@@ -689,7 +702,7 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
689
702
|
}
|
|
690
703
|
}
|
|
691
704
|
}, { immediate: !0 });
|
|
692
|
-
let
|
|
705
|
+
let y = async (e) => {
|
|
693
706
|
if (i.canAdd !== "api" || !l) return;
|
|
694
707
|
let t = s.value, n = await l.changeParams({
|
|
695
708
|
project_id: i.projectId,
|
|
@@ -702,7 +715,7 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
702
715
|
h(e), a("addGroup", e);
|
|
703
716
|
} else h(t);
|
|
704
717
|
f.value?.resetCache(!0);
|
|
705
|
-
},
|
|
718
|
+
}, S = async (e, t) => {
|
|
706
719
|
d && ((await d.changeParams({
|
|
707
720
|
project_id: i.projectId,
|
|
708
721
|
id: e.id,
|
|
@@ -711,13 +724,13 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
711
724
|
id: e.id,
|
|
712
725
|
name: t
|
|
713
726
|
}), f.value?.updateCacheItemById(e.id, { name: t })));
|
|
714
|
-
},
|
|
727
|
+
}, C = async (e) => {
|
|
715
728
|
u && ((await u.changeParams({
|
|
716
729
|
project_id: i.projectId,
|
|
717
730
|
id: e.id
|
|
718
731
|
}).call()).errors || (s.value.id === e.id && h(i.canSelectAll ? q() : G), a("delGroup", e.id), f.value?.deleteCacheItemById(e.id)));
|
|
719
732
|
};
|
|
720
|
-
return n({ resetCacheGroups:
|
|
733
|
+
return n({ resetCacheGroups: _ }), (t, n) => (F(), E(b, {
|
|
721
734
|
ref_key: "refSelector",
|
|
722
735
|
ref: f,
|
|
723
736
|
class: "top-groupSelector_group",
|
|
@@ -727,50 +740,50 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
727
740
|
searchType: "inline",
|
|
728
741
|
icon: e.addIcon ? "" : void 0,
|
|
729
742
|
api: e.groups ? void 0 : R(c),
|
|
730
|
-
apiSetSearchParams: (...e) => R(
|
|
743
|
+
apiSetSearchParams: (...e) => R(x)(...e, "name"),
|
|
731
744
|
appendSearchToResult: !!e.canAdd,
|
|
732
745
|
useAllItem: e.canSelectAll ? R(q)().name : !1,
|
|
733
746
|
addChanger: e.addChanger,
|
|
734
747
|
useCache: "",
|
|
735
|
-
onAppendItem:
|
|
736
|
-
},
|
|
737
|
-
item: V(({ item: n }) => [
|
|
738
|
-
n.id === R(null) ? (
|
|
739
|
-
|
|
748
|
+
onAppendItem: y
|
|
749
|
+
}, ee({
|
|
750
|
+
item: V(({ item: n }) => [k("div", Qe, [
|
|
751
|
+
n.id === R(null) ? (F(), O("div", $e, L(t.$i18n.Common.Add) + ": ", 1)) : D("", !0),
|
|
752
|
+
k("span", {
|
|
740
753
|
class: "top-groupSelector_groupItemName top-ellipsis1",
|
|
741
754
|
innerHTML: n.name
|
|
742
755
|
}, null, 8, et),
|
|
743
|
-
n.folder_path && e.showPath ? (
|
|
756
|
+
n.folder_path && e.showPath ? (F(), O("span", {
|
|
744
757
|
key: 1,
|
|
745
758
|
class: "top-groupSelector_groupItemFolderPath top-ellipsis1",
|
|
746
759
|
innerHTML: n.folder_path
|
|
747
|
-
}, null, 8, tt)) :
|
|
760
|
+
}, null, 8, tt)) : D("", !0)
|
|
748
761
|
])]),
|
|
749
762
|
_: 2
|
|
750
763
|
}, [e.canEditAndDel && e.client ? {
|
|
751
764
|
name: "actions",
|
|
752
|
-
fn: V(({ item: r }) => [r.id ? (
|
|
765
|
+
fn: V(({ item: r }) => [r.id ? (F(), O(w, { key: 0 }, [j(g, {
|
|
753
766
|
submitText: t.$i18n.Common.Save,
|
|
754
767
|
defaultValue: r.name,
|
|
755
768
|
inputProps: { addCleaner: !1 },
|
|
756
|
-
onSubmit: (e) =>
|
|
769
|
+
onSubmit: (e) => S(r, e)
|
|
757
770
|
}, {
|
|
758
|
-
opener: V(() => [...n[1] ||= [
|
|
771
|
+
opener: V(() => [...n[1] ||= [k("div", { "data-top-icon": "" }, null, -1)]]),
|
|
759
772
|
default: V(() => [...n[2] ||= []]),
|
|
760
773
|
_: 1
|
|
761
774
|
}, 8, [
|
|
762
775
|
"submitText",
|
|
763
776
|
"defaultValue",
|
|
764
777
|
"onSubmit"
|
|
765
|
-
]),
|
|
778
|
+
]), j(v, {
|
|
766
779
|
isWarning: "",
|
|
767
780
|
submitText: t.$i18n.Common.Delete,
|
|
768
|
-
onSubmit: (e) =>
|
|
781
|
+
onSubmit: (e) => C(r)
|
|
769
782
|
}, {
|
|
770
|
-
opener: V(() => [...n[3] ||= [
|
|
771
|
-
default: V(() => [
|
|
783
|
+
opener: V(() => [...n[3] ||= [k("div", { "data-top-icon": "" }, null, -1)]]),
|
|
784
|
+
default: V(() => [k("span", { innerHTML: e.service === "keywords_2" ? t.$i18n.Keywords.Delete_group_warning : t.$i18n.Aitracker.Delete_group_warning }, null, 8, nt)]),
|
|
772
785
|
_: 1
|
|
773
|
-
}, 8, ["submitText", "onSubmit"])], 64)) :
|
|
786
|
+
}, 8, ["submitText", "onSubmit"])], 64)) : D("", !0)]),
|
|
774
787
|
key: "0"
|
|
775
788
|
} : void 0]), 1032, [
|
|
776
789
|
"modelValue",
|
|
@@ -783,9 +796,9 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
783
796
|
"addChanger"
|
|
784
797
|
]));
|
|
785
798
|
}
|
|
786
|
-
}), it = { class: "top-groupSelector" }, at = /* @__PURE__ */
|
|
799
|
+
}), it = { class: "top-groupSelector" }, at = /* @__PURE__ */ M({
|
|
787
800
|
__name: "groupSelector",
|
|
788
|
-
props: /*@__PURE__*/
|
|
801
|
+
props: /*@__PURE__*/ N({
|
|
789
802
|
folderId: {},
|
|
790
803
|
folder: {},
|
|
791
804
|
groupId: {},
|
|
@@ -833,14 +846,14 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
833
846
|
group: { default: G },
|
|
834
847
|
groupModifiers: {}
|
|
835
848
|
}),
|
|
836
|
-
emits: /*@__PURE__*/
|
|
849
|
+
emits: /*@__PURE__*/ N(["update:groups"], [
|
|
837
850
|
"update:folderId",
|
|
838
851
|
"update:folder",
|
|
839
852
|
"update:groupId",
|
|
840
853
|
"update:group"
|
|
841
854
|
]),
|
|
842
855
|
setup(e, { expose: t, emit: n }) {
|
|
843
|
-
let r = e, i =
|
|
856
|
+
let r = e, i = I(null), a = z(e, "folderId"), o = z(e, "folder"), s = z(e, "groupId"), c = z(e, "group"), l = n;
|
|
844
857
|
o.value = Ve(r.folders ?? { root: [W] }, r.canSelectAllGroups).get(a.value);
|
|
845
858
|
let u = r.groups?.find((e) => e.id === s.value);
|
|
846
859
|
s.value || (u = r.groups?.[0]), r.canSelectAllGroups && !u && (u = q()), (r.autoselect === "placeholder" || !u) && (u = Ke()), u ??= G, c.value = u;
|
|
@@ -869,7 +882,7 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
869
882
|
};
|
|
870
883
|
return t({ resetCacheGroups: (e = !1) => {
|
|
871
884
|
i.value?.resetCacheGroups(e);
|
|
872
|
-
} }), (t, n) => (
|
|
885
|
+
} }), (t, n) => (F(), O("div", it, [e.showFolders ? (F(), E(Ge, {
|
|
873
886
|
key: 0,
|
|
874
887
|
folderId: a.value,
|
|
875
888
|
"onUpdate:folderId": n[0] ||= (e) => a.value = e,
|
|
@@ -892,7 +905,7 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
892
905
|
"addIcon",
|
|
893
906
|
"client",
|
|
894
907
|
"service"
|
|
895
|
-
])) :
|
|
908
|
+
])) : D("", !0), e.showGroups ? (F(), E(rt, {
|
|
896
909
|
key: 1,
|
|
897
910
|
ref_key: "componentGroupsRef",
|
|
898
911
|
ref: i,
|
|
@@ -932,7 +945,7 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
932
945
|
"addIcon",
|
|
933
946
|
"client",
|
|
934
947
|
"service"
|
|
935
|
-
])) :
|
|
948
|
+
])) : D("", !0)]));
|
|
936
949
|
}
|
|
937
950
|
}), ot = (e) => ({
|
|
938
951
|
id: null,
|
|
@@ -1043,7 +1056,7 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1043
1056
|
}
|
|
1044
1057
|
return n.isLoading = !1, c;
|
|
1045
1058
|
} };
|
|
1046
|
-
}, yt = (e) => e.gen("/add/projects_2/projects/"), bt = { class: "top-ellipsis1" }, xt = /* @__PURE__ */
|
|
1059
|
+
}, yt = (e) => e.gen("/add/projects_2/projects/"), bt = { class: "top-ellipsis1" }, xt = /* @__PURE__ */ M({
|
|
1047
1060
|
__name: "submenu",
|
|
1048
1061
|
props: { id: {} },
|
|
1049
1062
|
setup(e) {
|
|
@@ -1124,39 +1137,39 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1124
1137
|
].filter((e) => !Object.entries(r.state.closedByMod).some(([t, n]) => n && e.href.includes(`/${t}/`)));
|
|
1125
1138
|
return e.right.includes("0") ? t.filter((t) => e.right[t.right] === "1") : t;
|
|
1126
1139
|
};
|
|
1127
|
-
return (e, n) => (
|
|
1140
|
+
return (e, n) => (F(), E(R(y), {
|
|
1128
1141
|
id: t.id,
|
|
1129
1142
|
class: "top-projectSelectorSubmenu",
|
|
1130
1143
|
notch: !1,
|
|
1131
1144
|
pos: "2"
|
|
1132
1145
|
}, {
|
|
1133
|
-
contentList: V(({ data: t }) => [t ? (
|
|
1146
|
+
contentList: V(({ data: t }) => [t ? (F(), O(w, { key: 0 }, [(F(!0), O(w, null, oe(o(t.projectItem), (t) => (F(), E(R(_), {
|
|
1134
1147
|
href: t.href,
|
|
1135
1148
|
title: t.title,
|
|
1136
1149
|
"data-top-icon": t.icon,
|
|
1137
1150
|
"data-right": t.right
|
|
1138
1151
|
}, {
|
|
1139
|
-
default: V(() => [
|
|
1152
|
+
default: V(() => [A(L(e.$core.state.isMobile ? t.title : ""), 1)]),
|
|
1140
1153
|
_: 2
|
|
1141
1154
|
}, 1032, [
|
|
1142
1155
|
"href",
|
|
1143
1156
|
"title",
|
|
1144
1157
|
"data-top-icon",
|
|
1145
1158
|
"data-right"
|
|
1146
|
-
]))), 256)),
|
|
1159
|
+
]))), 256)), j(R(_), {
|
|
1147
1160
|
href: t.projectItem.externalLink,
|
|
1148
1161
|
title: t.projectItem.externalLink,
|
|
1149
1162
|
class: "top-ellipsis",
|
|
1150
1163
|
"data-top-icon": "",
|
|
1151
1164
|
target: "_blank"
|
|
1152
1165
|
}, {
|
|
1153
|
-
default: V(() => [
|
|
1166
|
+
default: V(() => [k("span", bt, L(e.$core.state.isMobile ? t.projectItem.externalLink : ""), 1)]),
|
|
1154
1167
|
_: 2
|
|
1155
|
-
}, 1032, ["href", "title"])], 64)) :
|
|
1168
|
+
}, 1032, ["href", "title"])], 64)) : D("", !0)]),
|
|
1156
1169
|
_: 1
|
|
1157
1170
|
}, 8, ["id"]));
|
|
1158
1171
|
}
|
|
1159
|
-
}), J = "ui_project_selector_total", St = 864e5, Y =
|
|
1172
|
+
}), J = "ui_project_selector_total", St = 864e5, Y = I(null), X = de(), Ct = (e) => {
|
|
1160
1173
|
localStorage.setItem(J + ":" + r.state.userId, JSON.stringify({
|
|
1161
1174
|
projectsTotal: e,
|
|
1162
1175
|
expiresAt: Date.now() + St
|
|
@@ -1171,13 +1184,13 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1171
1184
|
}
|
|
1172
1185
|
return t;
|
|
1173
1186
|
}, Tt = () => {
|
|
1174
|
-
Y.value = null, X.value = void 0, localStorage.removeItem(J + ":" + r.state.userId),
|
|
1187
|
+
Y.value = null, X.value = void 0, localStorage.removeItem(J + ":" + r.state.userId), S("/get/projects_2/projects/");
|
|
1175
1188
|
}, Et = { class: "top-projectSelector_itemText" }, Dt = { class: "top-comment" }, Ot = {
|
|
1176
1189
|
key: 0,
|
|
1177
1190
|
class: "top-comment"
|
|
1178
|
-
}, kt = ["href"], At = 1e3, jt = /* @__PURE__ */
|
|
1191
|
+
}, kt = ["href"], At = 1e3, jt = /* @__PURE__ */ M({
|
|
1179
1192
|
__name: "projectSelector",
|
|
1180
|
-
props: /*@__PURE__*/
|
|
1193
|
+
props: /*@__PURE__*/ N({
|
|
1181
1194
|
modelValue: {},
|
|
1182
1195
|
client: {},
|
|
1183
1196
|
menuMode: { type: Boolean },
|
|
@@ -1198,24 +1211,24 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1198
1211
|
}),
|
|
1199
1212
|
emits: ["update:modelValue"],
|
|
1200
1213
|
setup(e, { expose: t }) {
|
|
1201
|
-
let i = n(), a = e, o = z(e, "modelValue"), s = _t(a.client), c = yt(a.client), l =
|
|
1214
|
+
let i = n(), a = e, o = z(e, "modelValue"), s = _t(a.client), c = yt(a.client), l = I(wt()), f = I(null), p = pe(), m = T(() => a.placeholder ?? i.Projects.Select_project), g = T(() => !X.value || !a.excludeProjectId ? X.value : X.value.filter((e) => e.id !== a.excludeProjectId)), { getNextProjectId: _ } = vt(a.client), v = async (e = !1) => {
|
|
1202
1215
|
let t = o.value.id;
|
|
1203
1216
|
if (!t) return;
|
|
1204
|
-
let n = await
|
|
1217
|
+
let n = await _(t, e);
|
|
1205
1218
|
n && ft(n);
|
|
1206
|
-
},
|
|
1219
|
+
}, y = T(() => {
|
|
1207
1220
|
if (l.value || l.value === 0) return l.value < At ? "static" : "api";
|
|
1208
|
-
}),
|
|
1221
|
+
}), x = async () => {
|
|
1209
1222
|
Y.value ||= s.call();
|
|
1210
1223
|
let e = await Y.value;
|
|
1211
1224
|
return Y.value = null, e;
|
|
1212
|
-
},
|
|
1225
|
+
}, S = async (e) => {
|
|
1213
1226
|
let t = await c.changeParams({
|
|
1214
1227
|
url: e.name,
|
|
1215
1228
|
name: e.name
|
|
1216
1229
|
}).call();
|
|
1217
1230
|
if (!t.errors) {
|
|
1218
|
-
if (X.value &&
|
|
1231
|
+
if (X.value && y.value === "static") {
|
|
1219
1232
|
let n = lt({
|
|
1220
1233
|
id: t.result,
|
|
1221
1234
|
user_id: r.state.userId,
|
|
@@ -1230,37 +1243,37 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1230
1243
|
...X.value.slice(i)
|
|
1231
1244
|
], l.value && (l.value += 1, Ct(l.value));
|
|
1232
1245
|
}
|
|
1233
|
-
|
|
1246
|
+
y.value === "api" && f.value?.resetCache(!0);
|
|
1234
1247
|
}
|
|
1235
|
-
},
|
|
1236
|
-
if (X.value ||
|
|
1237
|
-
let e = await
|
|
1248
|
+
}, C = async () => {
|
|
1249
|
+
if (X.value || y.value === "api") return;
|
|
1250
|
+
let e = await x();
|
|
1238
1251
|
e.errors || (X.value = e.result);
|
|
1239
|
-
},
|
|
1252
|
+
}, ee = async () => {
|
|
1240
1253
|
if (l.value) {
|
|
1241
1254
|
let e = f.value?.popupOpenerRef?.$el;
|
|
1242
|
-
e && e.addEventListener("pointerenter", () =>
|
|
1255
|
+
e && e.addEventListener("pointerenter", () => C(), { once: !0 });
|
|
1243
1256
|
} else {
|
|
1244
1257
|
s.changeParams({ limit: At });
|
|
1245
|
-
let e = await
|
|
1258
|
+
let e = await x();
|
|
1246
1259
|
if (e.errors) return;
|
|
1247
|
-
delete s.params.limit, l.value = e.total ?? void 0, !X.value &&
|
|
1260
|
+
delete s.params.limit, l.value = e.total ?? void 0, !X.value && y.value !== "api" && (X.value = e.result), l.value && Ct(l.value);
|
|
1248
1261
|
}
|
|
1249
1262
|
};
|
|
1250
|
-
return t({ goToNextProject:
|
|
1251
|
-
await
|
|
1263
|
+
return t({ goToNextProject: v }), ie(async () => {
|
|
1264
|
+
await ee();
|
|
1252
1265
|
}), (t, n) => {
|
|
1253
1266
|
let r = ce("TopButton");
|
|
1254
|
-
return
|
|
1255
|
-
key:
|
|
1267
|
+
return F(), O(w, null, [(F(), E(b, {
|
|
1268
|
+
key: y.value ?? "dummy",
|
|
1256
1269
|
ref_key: "refSelector",
|
|
1257
1270
|
ref: f,
|
|
1258
1271
|
class: "top-projectSelector",
|
|
1259
1272
|
modelValue: o.value,
|
|
1260
1273
|
"onUpdate:modelValue": n[1] ||= (t) => e.menuMode ? R(ft)(t.id) : o.value = t,
|
|
1261
|
-
items:
|
|
1274
|
+
items: g.value,
|
|
1262
1275
|
itemsChunkSize: 100,
|
|
1263
|
-
itemsIsLoading:
|
|
1276
|
+
itemsIsLoading: y.value === "static" && R(X) === void 0,
|
|
1264
1277
|
title: t.$i18n.Projects.Search_projects,
|
|
1265
1278
|
modificator: e.modificator,
|
|
1266
1279
|
searchFields: [
|
|
@@ -1270,8 +1283,8 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1270
1283
|
],
|
|
1271
1284
|
placeholder: m.value,
|
|
1272
1285
|
hasCloserBtn: "",
|
|
1273
|
-
api:
|
|
1274
|
-
apiSetSearchParams:
|
|
1286
|
+
api: y.value === "api" ? R(s) : void 0,
|
|
1287
|
+
apiSetSearchParams: y.value === "api" ? (...e) => R(gt)(...e) : void 0,
|
|
1275
1288
|
useCache: "",
|
|
1276
1289
|
appendSearchToResult: "",
|
|
1277
1290
|
appendSearchAllowDuplicate: "",
|
|
@@ -1279,20 +1292,20 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1279
1292
|
appendWithoutSelect: "",
|
|
1280
1293
|
buttonProps: {
|
|
1281
1294
|
...e.buttonProps,
|
|
1282
|
-
isProgress: !
|
|
1283
|
-
disabled: !
|
|
1295
|
+
isProgress: !y.value,
|
|
1296
|
+
disabled: !y.value
|
|
1284
1297
|
},
|
|
1285
1298
|
openerShortcut: e.openerShortcut,
|
|
1286
|
-
onAppendItem:
|
|
1287
|
-
onOpen:
|
|
1299
|
+
onAppendItem: S,
|
|
1300
|
+
onOpen: C
|
|
1288
1301
|
}, {
|
|
1289
|
-
item: V(({ item: i }) => [
|
|
1290
|
-
e.menuMode ? (
|
|
1302
|
+
item: V(({ item: i }) => [k("div", Et, [i.id ? (F(), O(w, { key: 0 }, [A(L(R(d)(i.name, 20)) + " ", 1), k("span", Dt, " id " + L(i.id), 1)], 64)) : (F(), O(w, { key: 1 }, [i.listItemProps?.type ? D("", !0) : (F(), O("div", Ot, L(t.$i18n.Projects.Add_project) + ": ", 1)), A(" " + L(i.name), 1)], 64))]), i.id ? (F(), O(w, { key: 0 }, [
|
|
1303
|
+
e.menuMode ? (F(), O("a", {
|
|
1291
1304
|
key: 0,
|
|
1292
1305
|
class: "top-projectSelector_itemLink",
|
|
1293
1306
|
href: R(pt)(i.id)
|
|
1294
|
-
}, null, 8, kt)) :
|
|
1295
|
-
t.$core.state.isMobile ?
|
|
1307
|
+
}, null, 8, kt)) : D("", !0),
|
|
1308
|
+
t.$core.state.isMobile ? D("", !0) : (F(), E(r, {
|
|
1296
1309
|
key: 1,
|
|
1297
1310
|
href: i.externalLink,
|
|
1298
1311
|
"data-top-icon": "",
|
|
@@ -1300,20 +1313,20 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1300
1313
|
target: "_blank",
|
|
1301
1314
|
onClick: n[0] ||= H(() => {}, ["stop"])
|
|
1302
1315
|
}, null, 8, ["href"])),
|
|
1303
|
-
|
|
1316
|
+
j(h, {
|
|
1304
1317
|
id: R(p),
|
|
1305
1318
|
pos: "2",
|
|
1306
1319
|
notch: !1,
|
|
1307
1320
|
data: { projectItem: i }
|
|
1308
1321
|
}, {
|
|
1309
|
-
default: V(() => [
|
|
1322
|
+
default: V(() => [j(r, {
|
|
1310
1323
|
class: "top-popup_listMore",
|
|
1311
1324
|
"data-top-icon": "",
|
|
1312
1325
|
color: "theme"
|
|
1313
1326
|
})]),
|
|
1314
1327
|
_: 1
|
|
1315
1328
|
}, 8, ["id", "data"])
|
|
1316
|
-
], 64)) :
|
|
1329
|
+
], 64)) : D("", !0)]),
|
|
1317
1330
|
_: 1
|
|
1318
1331
|
}, 8, [
|
|
1319
1332
|
"modelValue",
|
|
@@ -1327,7 +1340,7 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1327
1340
|
"appendSearchToResultCond",
|
|
1328
1341
|
"buttonProps",
|
|
1329
1342
|
"openerShortcut"
|
|
1330
|
-
])),
|
|
1343
|
+
])), j(xt, { id: R(p) }, null, 8, ["id"])], 64);
|
|
1331
1344
|
};
|
|
1332
1345
|
}
|
|
1333
1346
|
}), Mt = (e) => "-" + e, Z = (e) => e[0] === "-" ? e.substring(1) : e, Nt = (e, t) => {
|
|
@@ -1339,17 +1352,17 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1339
1352
|
let r = c.genElPopupOpener("div", t);
|
|
1340
1353
|
return r.classList.add("top-tagSelector"), e.useTopButton && r.classList.add("top-tagSelector-useTopButton", "top-button", "top-color_theme", "top-as-selector"), e.useTopButton || r.classList.add("top-tagSelector-custom"), e.mode === "filter" && r.classList.add("top-tagSelector-filter"), e.mode === "setter" && !e.filters && r.classList.add("top-tagSelector-setter_single"), e.mode === "setter" && e.filters && r.classList.add("top-tagSelector-setter_several"), r.onclick = (t) => {
|
|
1341
1354
|
t.preventDefault(), t.stopPropagation(), r.onclick = null;
|
|
1342
|
-
let i =
|
|
1355
|
+
let i = I(e.modelValue), a = {
|
|
1343
1356
|
model: i,
|
|
1344
1357
|
mode: e.mode,
|
|
1345
1358
|
targetId: e.targetId,
|
|
1346
1359
|
filters: e.filters,
|
|
1347
1360
|
payload: e.payload
|
|
1348
1361
|
};
|
|
1349
|
-
s(r, "topTagSelectorTarget", a), delete r.dataset.topPopupDisabled,
|
|
1362
|
+
s(r, "topTagSelectorTarget", a), delete r.dataset.topPopupDisabled, te(e.modelValue) || B(i, () => {
|
|
1350
1363
|
e.modelValue = i.value, It(r, e, n);
|
|
1351
1364
|
}), r.click();
|
|
1352
|
-
},
|
|
1365
|
+
}, te(e.modelValue) ? B(e.modelValue, () => It(r, e, n)) : s(r, "topTagSelectorRender", (t) => {
|
|
1353
1366
|
e.modelValue = t;
|
|
1354
1367
|
let i = s(r, "topTagSelectorTarget");
|
|
1355
1368
|
i && (i.model.value = t), It(r, e, n);
|
|
@@ -1438,7 +1451,7 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1438
1451
|
"data-tag_id",
|
|
1439
1452
|
"data-tag_color_id",
|
|
1440
1453
|
"title"
|
|
1441
|
-
], Q = /* @__PURE__ */
|
|
1454
|
+
], Q = /* @__PURE__ */ M({
|
|
1442
1455
|
__name: "tagIcon",
|
|
1443
1456
|
props: {
|
|
1444
1457
|
id: {},
|
|
@@ -1447,8 +1460,8 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1447
1460
|
state: {}
|
|
1448
1461
|
},
|
|
1449
1462
|
setup(e) {
|
|
1450
|
-
return (t, n) => (
|
|
1451
|
-
class:
|
|
1463
|
+
return (t, n) => (F(), O("div", {
|
|
1464
|
+
class: P({
|
|
1452
1465
|
"top-tagSelector_tagIcon": !0,
|
|
1453
1466
|
"top-tagSelector-active": !!e.state,
|
|
1454
1467
|
"top-tagSelector-excluded": e.state === "excluded"
|
|
@@ -1458,9 +1471,9 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1458
1471
|
title: e.name
|
|
1459
1472
|
}, null, 10, zt));
|
|
1460
1473
|
}
|
|
1461
|
-
}), Bt = ["contenteditable", "onKeydown"], Vt = /* @__PURE__ */
|
|
1474
|
+
}), Bt = ["contenteditable", "onKeydown"], Vt = /* @__PURE__ */ M({
|
|
1462
1475
|
__name: "tagPopupListItem",
|
|
1463
|
-
props: /*@__PURE__*/
|
|
1476
|
+
props: /*@__PURE__*/ N({
|
|
1464
1477
|
editable: { type: Boolean },
|
|
1465
1478
|
disabled: { type: Boolean },
|
|
1466
1479
|
canExclude: { type: Boolean },
|
|
@@ -1472,18 +1485,18 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1472
1485
|
name: { required: !0 },
|
|
1473
1486
|
nameModifiers: {}
|
|
1474
1487
|
}),
|
|
1475
|
-
emits: /*@__PURE__*/
|
|
1488
|
+
emits: /*@__PURE__*/ N([
|
|
1476
1489
|
"update:name",
|
|
1477
1490
|
"unselect",
|
|
1478
1491
|
"exclude",
|
|
1479
1492
|
"select"
|
|
1480
1493
|
], ["update:name"]),
|
|
1481
1494
|
setup(e, { emit: t }) {
|
|
1482
|
-
let n = e, r = t, i = z(e, "name"), a =
|
|
1495
|
+
let n = e, r = t, i = z(e, "name"), a = I(null), o = T(() => navigator.userAgent.indexOf("Firefox") == -1 ? {} : {
|
|
1483
1496
|
contenteditable: s.value,
|
|
1484
1497
|
onpaste: (e) => e.preventDefault()
|
|
1485
|
-
}), s =
|
|
1486
|
-
s.value = !0, await
|
|
1498
|
+
}), s = I(!1), c = async () => {
|
|
1499
|
+
s.value = !0, await re(), a.value?.focus();
|
|
1487
1500
|
}, l = () => {
|
|
1488
1501
|
let e = a.value?.innerText;
|
|
1489
1502
|
if (!e) return u();
|
|
@@ -1495,8 +1508,8 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1495
1508
|
let t = "selected";
|
|
1496
1509
|
n.canExclude && (e.ctrlKey || e.metaKey) && (t = "excluded"), n.state == t && (t = ""), t === "" && r("unselect"), t === "selected" && r("select"), t === "excluded" && r("exclude");
|
|
1497
1510
|
};
|
|
1498
|
-
return (t, n) => (
|
|
1499
|
-
class:
|
|
1511
|
+
return (t, n) => (F(), E(_, {
|
|
1512
|
+
class: P({
|
|
1500
1513
|
"top-tagSelector_tagListItem": !0,
|
|
1501
1514
|
"top-tagSelector_tagListItem-inEdit": s.value,
|
|
1502
1515
|
"top-tagSelector_tagListItem-disabled": e.disabled,
|
|
@@ -1507,7 +1520,7 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1507
1520
|
onClick: H(d, ["stop"])
|
|
1508
1521
|
}, {
|
|
1509
1522
|
default: V(() => [
|
|
1510
|
-
|
|
1523
|
+
j(Q, {
|
|
1511
1524
|
id: e.id,
|
|
1512
1525
|
name: i.value,
|
|
1513
1526
|
colorId: e.colorId,
|
|
@@ -1518,31 +1531,31 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1518
1531
|
"colorId",
|
|
1519
1532
|
"state"
|
|
1520
1533
|
]),
|
|
1521
|
-
|
|
1534
|
+
k("span", ne({
|
|
1522
1535
|
ref_key: "elName",
|
|
1523
1536
|
ref: a,
|
|
1524
1537
|
class: "top-tagSelector_tagListItemName",
|
|
1525
1538
|
contenteditable: s.value ? "plaintext-only" : !1
|
|
1526
1539
|
}, o.value, { onKeydown: [he(H(l, ["stop"]), ["enter"]), he(H(u, ["stop"]), ["esc"])] }), L(i.value), 17, Bt),
|
|
1527
|
-
e.editable ? (
|
|
1540
|
+
e.editable ? (F(), O(w, { key: 0 }, [s.value ? (F(), O("span", {
|
|
1528
1541
|
key: 1,
|
|
1529
1542
|
"data-top-icon": "",
|
|
1530
1543
|
class: "top-tagSelector_edit",
|
|
1531
1544
|
onClick: H(l, ["stop"])
|
|
1532
|
-
})) : (
|
|
1545
|
+
})) : (F(), O("span", {
|
|
1533
1546
|
key: 0,
|
|
1534
1547
|
"data-top-icon": "",
|
|
1535
1548
|
class: "top-tagSelector_edit",
|
|
1536
1549
|
onClick: c
|
|
1537
|
-
}))], 64)) :
|
|
1550
|
+
}))], 64)) : D("", !0)
|
|
1538
1551
|
]),
|
|
1539
1552
|
_: 1
|
|
1540
1553
|
}, 8, ["class"]));
|
|
1541
1554
|
}
|
|
1542
|
-
}), Ht = { key: 1 }, Ut = /* @__PURE__ */
|
|
1555
|
+
}), Ht = { key: 1 }, Ut = /* @__PURE__ */ M({
|
|
1543
1556
|
inheritAttrs: !1,
|
|
1544
1557
|
__name: "popupOpener",
|
|
1545
|
-
props: /*@__PURE__*/
|
|
1558
|
+
props: /*@__PURE__*/ N({
|
|
1546
1559
|
modelValue: {},
|
|
1547
1560
|
id: {},
|
|
1548
1561
|
tags: {},
|
|
@@ -1567,8 +1580,8 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1567
1580
|
};
|
|
1568
1581
|
return (a, c) => {
|
|
1569
1582
|
let l = le("top-data");
|
|
1570
|
-
return
|
|
1571
|
-
default: V(() => [me((
|
|
1583
|
+
return F(), E(h, { id: e.id }, {
|
|
1584
|
+
default: V(() => [me((F(), E(ue(R(i)), ne({
|
|
1572
1585
|
class: {
|
|
1573
1586
|
"top-tagSelector": !0,
|
|
1574
1587
|
"top-tagSelector-useTopButton": n.useTopButton,
|
|
@@ -1583,13 +1596,13 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1583
1596
|
color: "theme",
|
|
1584
1597
|
styling: e.styling
|
|
1585
1598
|
}, t), {
|
|
1586
|
-
[R(o)]: V(() => [!r.value.length && e.mode === "filter" ? (
|
|
1599
|
+
[R(o)]: V(() => [!r.value.length && e.mode === "filter" ? (F(), E(Q, {
|
|
1587
1600
|
key: 0,
|
|
1588
1601
|
id: "all",
|
|
1589
1602
|
colorId: "",
|
|
1590
1603
|
name: a.$i18n.Common.All_tags ?? "",
|
|
1591
1604
|
state: ""
|
|
1592
|
-
}, null, 8, ["name"])) :
|
|
1605
|
+
}, null, 8, ["name"])) : D("", !0), e.mode === "setter" && e.filters ? (F(), O("div", Ht, [se(a.$slots, "default")])) : (F(!0), O(w, { key: 2 }, oe(r.value, (t) => (F(), E(Q, {
|
|
1593
1606
|
id: R(Z)(t),
|
|
1594
1607
|
colorId: R(Nt)(t, e.tags)?.color_id ?? "",
|
|
1595
1608
|
name: R(Nt)(t, e.tags)?.name ?? "",
|
|
@@ -1610,9 +1623,9 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1610
1623
|
}, 8, ["id"]);
|
|
1611
1624
|
};
|
|
1612
1625
|
}
|
|
1613
|
-
}), Wt = /* @__PURE__ */
|
|
1626
|
+
}), Wt = /* @__PURE__ */ M({
|
|
1614
1627
|
__name: "tagSelector",
|
|
1615
|
-
props: /*@__PURE__*/
|
|
1628
|
+
props: /*@__PURE__*/ N({
|
|
1616
1629
|
modelValue: {},
|
|
1617
1630
|
tags: {},
|
|
1618
1631
|
tagsEditable: { type: Boolean },
|
|
@@ -1633,10 +1646,10 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1633
1646
|
}, {
|
|
1634
1647
|
modelValue: { required: !0 },
|
|
1635
1648
|
modelModifiers: {},
|
|
1636
|
-
tags: { default:
|
|
1649
|
+
tags: { default: ae(Rt) },
|
|
1637
1650
|
tagsModifiers: {}
|
|
1638
1651
|
}),
|
|
1639
|
-
emits: /*@__PURE__*/
|
|
1652
|
+
emits: /*@__PURE__*/ N([
|
|
1640
1653
|
"selector",
|
|
1641
1654
|
"setter",
|
|
1642
1655
|
"tagsChanged"
|
|
@@ -1646,7 +1659,7 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1646
1659
|
f(e, t);
|
|
1647
1660
|
}, l.emitDelay);
|
|
1648
1661
|
l.singleMode && !u.value.length && (u.value = [d.value[0].id]);
|
|
1649
|
-
let m = l.id ?? "top-popup-id-" + Math.random(), h =
|
|
1662
|
+
let m = l.id ?? "top-popup-id-" + Math.random(), h = I("add"), g = () => {
|
|
1650
1663
|
let e = " " + c.Common.Tags?.toLowerCase(), t = /* @__PURE__ */ new Map();
|
|
1651
1664
|
return t.set("add", {
|
|
1652
1665
|
value: "add",
|
|
@@ -1658,7 +1671,7 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1658
1671
|
value: "delete",
|
|
1659
1672
|
title: c.Common.Delete + e
|
|
1660
1673
|
}), t;
|
|
1661
|
-
},
|
|
1674
|
+
}, v = de({
|
|
1662
1675
|
model: u,
|
|
1663
1676
|
mode: "filter",
|
|
1664
1677
|
targetId: void 0,
|
|
@@ -1668,25 +1681,25 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1668
1681
|
B(u, () => {
|
|
1669
1682
|
p("selector", u.value);
|
|
1670
1683
|
});
|
|
1671
|
-
let
|
|
1672
|
-
if (
|
|
1673
|
-
}),
|
|
1684
|
+
let b = T(() => {
|
|
1685
|
+
if (v.value.mode === "setter" && l.maxTagsForSetter && !v.value.filters) return v.value.model.value.length >= l.maxTagsForSetter;
|
|
1686
|
+
}), x = (e) => {
|
|
1674
1687
|
if (e !== "all") {
|
|
1675
|
-
if (
|
|
1676
|
-
if (
|
|
1688
|
+
if (v.value.model.value.includes(e)) return "selected";
|
|
1689
|
+
if (v.value.model.value.includes(Mt(e))) return "excluded";
|
|
1677
1690
|
}
|
|
1678
|
-
return e === "all" && !
|
|
1679
|
-
},
|
|
1680
|
-
let n = Mt(e), r =
|
|
1681
|
-
t === "select" && r.push(e), t === "exclude" && r.push(n),
|
|
1691
|
+
return e === "all" && !v.value.model.value.length ? "selected" : "";
|
|
1692
|
+
}, S = (e, t) => {
|
|
1693
|
+
let n = Mt(e), r = v.value.model.value.filter((t) => t !== e && t !== n);
|
|
1694
|
+
t === "select" && r.push(e), t === "exclude" && r.push(n), v.value.mode === "setter" && v.value.targetId !== void 0 && l.requiredForSetter && (r.length || r.push("1"), r.length === 2 && v.value.model.value.length === 1 && v.value.model.value[0] === "1" && (r = r.filter((e) => e !== "1"))), l.singleMode && !v.value.filters && (r.length || (r = v.value.model.value), r.length > 1 && (r = [r[r.length - 1]])), r.sort((e, t) => l.tags ? l.tags.findIndex((t) => t.id === e) - l.tags.findIndex((e) => e.id === t) : 0), v.value.model.value = r, v.value.mode === "setter" && v.value.targetId !== void 0 && p("setter", {
|
|
1682
1695
|
tagsIds: r,
|
|
1683
|
-
targetId:
|
|
1684
|
-
payload:
|
|
1696
|
+
targetId: v.value.targetId,
|
|
1697
|
+
payload: v.value.payload
|
|
1685
1698
|
});
|
|
1686
|
-
},
|
|
1699
|
+
}, C = T(() => {
|
|
1687
1700
|
let e = "top-tagSelector_popup";
|
|
1688
|
-
return
|
|
1689
|
-
}),
|
|
1701
|
+
return v.value.mode === "filter" && (e += " top-tagSelector_popup-filter"), v.value.mode === "setter" && (e += " top-tagSelector_popup-setter"), e;
|
|
1702
|
+
}), k = () => {
|
|
1690
1703
|
let e = prompt("", "New tag");
|
|
1691
1704
|
if (!e || e === "New tag") return;
|
|
1692
1705
|
let t = d.value.length + 1;
|
|
@@ -1695,9 +1708,9 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1695
1708
|
name: e,
|
|
1696
1709
|
color_id: String((t - 1) % 10 + 1)
|
|
1697
1710
|
}), f("tagsChanged", d.value);
|
|
1698
|
-
},
|
|
1699
|
-
if (
|
|
1700
|
-
if (
|
|
1711
|
+
}, M = (e) => {
|
|
1712
|
+
if (v.value = s(e.elPopupOpener, "topTagSelectorTarget"), !v.value) throw Error("Open popup TopTagSelector required v-data:topTagSelectorTarget");
|
|
1713
|
+
if (v.value.filters && (h.value = "add", v.value.model.value = []), !r.$?.ui.sortable) {
|
|
1701
1714
|
console.info("Для работы сортировки требуется глобальная загрузка jQuery UI Sortable");
|
|
1702
1715
|
return;
|
|
1703
1716
|
}
|
|
@@ -1715,10 +1728,10 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1715
1728
|
}), d.value.sort((e, t) => r.findIndex((t) => t === e.id) - r.findIndex((e) => e === t.id)), p("tagsChanged", d.value);
|
|
1716
1729
|
}
|
|
1717
1730
|
});
|
|
1718
|
-
},
|
|
1731
|
+
}, te = (e) => {
|
|
1719
1732
|
r.$?.ui.sortable && $(e.elPopup).data("ui-sortable") && $(e.elPopup).sortable("destroy");
|
|
1720
1733
|
};
|
|
1721
|
-
return (t, n) => (
|
|
1734
|
+
return (t, n) => (F(), O(w, null, [j(Ut, {
|
|
1722
1735
|
modelValue: u.value,
|
|
1723
1736
|
"onUpdate:modelValue": n[0] ||= (e) => u.value = e,
|
|
1724
1737
|
id: R(m),
|
|
@@ -1732,34 +1745,34 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1732
1745
|
"tags",
|
|
1733
1746
|
"styling",
|
|
1734
1747
|
"useTopButton"
|
|
1735
|
-
]),
|
|
1748
|
+
]), j(y, {
|
|
1736
1749
|
id: R(m),
|
|
1737
|
-
class:
|
|
1738
|
-
onOpen: n[4] ||= (e) =>
|
|
1739
|
-
onClose: n[5] ||= (e) =>
|
|
1750
|
+
class: P(C.value),
|
|
1751
|
+
onOpen: n[4] ||= (e) => M(e),
|
|
1752
|
+
onClose: n[5] ||= (e) => te(e),
|
|
1740
1753
|
"transition-duration": 50
|
|
1741
|
-
},
|
|
1754
|
+
}, ee({
|
|
1742
1755
|
contentList: V(() => [
|
|
1743
|
-
|
|
1756
|
+
v.value.mode === "filter" && !e.singleMode ? (F(), E(Vt, {
|
|
1744
1757
|
key: 0,
|
|
1745
1758
|
id: "all",
|
|
1746
1759
|
colorId: "",
|
|
1747
1760
|
name: t.$i18n.Common.All_tags ?? "",
|
|
1748
|
-
state:
|
|
1749
|
-
onSelect: n[3] ||= (e) =>
|
|
1750
|
-
}, null, 8, ["name", "state"])) :
|
|
1751
|
-
(
|
|
1761
|
+
state: v.value.model.value.length ? "" : "selected",
|
|
1762
|
+
onSelect: n[3] ||= (e) => v.value.model.value = []
|
|
1763
|
+
}, null, 8, ["name", "state"])) : D("", !0),
|
|
1764
|
+
(F(!0), O(w, null, oe(d.value, (t) => (F(), E(Vt, {
|
|
1752
1765
|
key: t.id,
|
|
1753
1766
|
id: t.id,
|
|
1754
1767
|
colorId: t.color_id,
|
|
1755
1768
|
name: t.name,
|
|
1756
|
-
state:
|
|
1757
|
-
canExclude:
|
|
1769
|
+
state: x(t.id),
|
|
1770
|
+
canExclude: v.value.mode === "filter" && !e.singleMode,
|
|
1758
1771
|
editable: e.tagsEditable,
|
|
1759
|
-
disabled:
|
|
1760
|
-
onUnselect: (e) =>
|
|
1761
|
-
onSelect: (e) =>
|
|
1762
|
-
onExclude: (e) =>
|
|
1772
|
+
disabled: b.value && x(t.id) === "",
|
|
1773
|
+
onUnselect: (e) => S(t.id, "unselect"),
|
|
1774
|
+
onSelect: (e) => S(t.id, "select"),
|
|
1775
|
+
onExclude: (e) => S(t.id, "exclude"),
|
|
1763
1776
|
"onUpdate:name": (e) => {
|
|
1764
1777
|
t.name = e, R(p)("tagsChanged", d.value);
|
|
1765
1778
|
}
|
|
@@ -1776,36 +1789,36 @@ var We = ["innerHTML"], Ge = /* @__PURE__ */ j({
|
|
|
1776
1789
|
"onExclude",
|
|
1777
1790
|
"onUpdate:name"
|
|
1778
1791
|
]))), 128)),
|
|
1779
|
-
e.tagsEditable && d.value.length < e.tagsMax && d.value.length < 20 ? (
|
|
1792
|
+
e.tagsEditable && d.value.length < e.tagsMax && d.value.length < 20 ? (F(), E(_, {
|
|
1780
1793
|
key: 1,
|
|
1781
1794
|
"data-top-icon": "",
|
|
1782
|
-
onClick: H(
|
|
1795
|
+
onClick: H(k, ["stop"])
|
|
1783
1796
|
}, {
|
|
1784
|
-
default: V(() => [
|
|
1797
|
+
default: V(() => [A(L(t.$i18n.Common.Add), 1)]),
|
|
1785
1798
|
_: 1
|
|
1786
|
-
})) :
|
|
1799
|
+
})) : D("", !0)
|
|
1787
1800
|
]),
|
|
1788
1801
|
_: 2
|
|
1789
|
-
}, [
|
|
1802
|
+
}, [v.value.mode === "setter" && v.value.filters ? {
|
|
1790
1803
|
name: "header",
|
|
1791
|
-
fn: V(() => [
|
|
1804
|
+
fn: V(() => [j(o, {
|
|
1792
1805
|
modelValue: h.value,
|
|
1793
1806
|
"onUpdate:modelValue": n[1] ||= (e) => h.value = e,
|
|
1794
|
-
options:
|
|
1807
|
+
options: g()
|
|
1795
1808
|
}, null, 8, ["modelValue", "options"])]),
|
|
1796
1809
|
key: "0"
|
|
1797
|
-
} : void 0,
|
|
1810
|
+
} : void 0, v.value.mode === "setter" && v.value.filters ? {
|
|
1798
1811
|
name: "footer",
|
|
1799
|
-
fn: V(() => [
|
|
1800
|
-
default: V(() => [
|
|
1812
|
+
fn: V(() => [j(a, { color: "theme" }, {
|
|
1813
|
+
default: V(() => [A(L(t.$i18n.Common.Cancel), 1)]),
|
|
1801
1814
|
_: 1
|
|
1802
|
-
}),
|
|
1803
|
-
tagsIds:
|
|
1804
|
-
filters:
|
|
1815
|
+
}), j(a, { onClick: n[2] ||= (e) => R(p)("setter", {
|
|
1816
|
+
tagsIds: v.value.model.value,
|
|
1817
|
+
filters: v.value.filters,
|
|
1805
1818
|
filtersAction: h.value,
|
|
1806
|
-
payload:
|
|
1819
|
+
payload: v.value.payload
|
|
1807
1820
|
}) }, {
|
|
1808
|
-
default: V(() => [
|
|
1821
|
+
default: V(() => [A(L(h.value === "add" ? t.$i18n.Common.Add : "") + " " + L(h.value === "replace" ? t.$i18n.Common.Replace : "") + " " + L(h.value === "delete" ? t.$i18n.Common.Delete : ""), 1)]),
|
|
1809
1822
|
_: 1
|
|
1810
1823
|
})]),
|
|
1811
1824
|
key: "1"
|