admins-components 9.0.7 → 9.0.8
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/dist/admins-components.js +57 -57
- package/dist/admins-components100.js +26 -27
- package/dist/admins-components101.js +25 -169
- package/dist/admins-components102.js +165 -61
- package/dist/admins-components103.js +61 -60
- package/dist/admins-components104.js +65 -28
- package/dist/admins-components105.js +28 -14
- package/dist/admins-components106.js +15 -26
- package/dist/admins-components107.js +26 -8
- package/dist/admins-components108.js +9 -4
- package/dist/admins-components109.js +4 -3
- package/dist/admins-components11.js +9 -38
- package/dist/admins-components110.js +2 -2
- package/dist/admins-components111.js +3 -21
- package/dist/admins-components112.js +21 -14
- package/dist/admins-components113.js +14 -8
- package/dist/admins-components114.js +8 -13
- package/dist/admins-components115.js +11 -24
- package/dist/admins-components116.js +24 -81
- package/dist/admins-components117.js +82 -10
- package/dist/admins-components118.js +10 -4
- package/dist/admins-components119.js +5 -8
- package/dist/admins-components12.js +37 -141
- package/dist/admins-components120.js +7 -6
- package/dist/admins-components121.js +6 -5
- package/dist/admins-components122.js +4 -13
- package/dist/admins-components123.js +11 -9
- package/dist/admins-components124.js +13 -30
- package/dist/admins-components125.js +30 -4
- package/dist/admins-components126.js +4 -29
- package/dist/admins-components127.js +29 -5
- package/dist/admins-components128.js +3 -3
- package/dist/admins-components129.js +4 -7
- package/dist/admins-components13.js +145 -5
- package/dist/admins-components130.js +7 -73
- package/dist/admins-components131.js +71 -26
- package/dist/admins-components132.js +27 -57
- package/dist/admins-components133.js +57 -22
- package/dist/admins-components134.js +21 -47
- package/dist/admins-components135.js +48 -29
- package/dist/admins-components136.js +31 -3
- package/dist/admins-components137.js +3 -179
- package/dist/admins-components138.js +176 -43
- package/dist/admins-components139.js +44 -35
- package/dist/admins-components14.js +5 -46
- package/dist/admins-components140.js +34 -43
- package/dist/admins-components141.js +42 -137
- package/dist/admins-components142.js +134 -51
- package/dist/admins-components143.js +58 -7
- package/dist/admins-components144.js +6 -5
- package/dist/admins-components145.js +6 -76
- package/dist/admins-components146.js +76 -29
- package/dist/admins-components147.js +29 -1931
- package/dist/admins-components148.js +1748 -24628
- package/dist/admins-components149.js +24810 -8
- package/dist/admins-components15.js +49 -4
- package/dist/admins-components150.js +9 -7
- package/dist/admins-components151.js +7 -142
- package/dist/admins-components152.js +141 -8
- package/dist/admins-components153.js +3 -3
- package/dist/admins-components154.js +10 -0
- package/dist/admins-components156.js +161 -44
- package/dist/admins-components157.js +50 -8
- package/dist/admins-components158.js +8 -49
- package/dist/admins-components159.js +50 -6
- package/dist/admins-components16.js +4 -94
- package/dist/admins-components160.js +6 -80
- package/dist/admins-components161.js +70 -48
- package/dist/admins-components162.js +31 -32
- package/dist/admins-components163.js +58 -8
- package/dist/admins-components164.js +8 -51
- package/dist/admins-components165.js +51 -8
- package/dist/admins-components166.js +10 -0
- package/dist/{admins-components167.js → admins-components168.js} +3 -3
- package/dist/admins-components17.js +91 -225
- package/dist/admins-components18.js +245 -5
- package/dist/admins-components19.js +5 -181
- package/dist/admins-components20.js +183 -0
- package/dist/admins-components22.js +6 -72
- package/dist/admins-components23.js +78 -6
- package/dist/admins-components24.js +6 -58
- package/dist/admins-components25.js +59 -0
- package/dist/admins-components27.js +6 -60
- package/dist/admins-components28.js +61 -0
- package/dist/admins-components30.js +6 -36
- package/dist/admins-components31.js +37 -0
- package/dist/admins-components33.js +6 -36
- package/dist/admins-components34.js +36 -4
- package/dist/admins-components35.js +4 -32
- package/dist/admins-components36.js +33 -0
- package/dist/admins-components38.js +6 -147
- package/dist/admins-components39.js +148 -0
- package/dist/admins-components4.js +9 -56
- package/dist/admins-components41.js +6 -124
- package/dist/admins-components42.js +124 -4
- package/dist/admins-components43.js +4 -179
- package/dist/admins-components44.js +179 -4
- package/dist/admins-components45.js +4 -19
- package/dist/admins-components46.js +20 -0
- package/dist/admins-components48.js +6 -54
- package/dist/admins-components49.js +54 -93
- package/dist/admins-components5.js +57 -4
- package/dist/admins-components50.js +94 -0
- package/dist/admins-components52.js +6 -25
- package/dist/admins-components53.js +25 -9
- package/dist/admins-components54.js +9 -19
- package/dist/admins-components55.js +18 -72
- package/dist/admins-components56.js +73 -59
- package/dist/admins-components57.js +59 -4
- package/dist/admins-components58.js +4 -120
- package/dist/admins-components59.js +122 -0
- package/dist/admins-components6.js +4 -29
- package/dist/admins-components61.js +7 -143
- package/dist/admins-components62.js +148 -0
- package/dist/admins-components64.js +7 -7
- package/dist/admins-components65.js +7 -263
- package/dist/admins-components66.js +264 -0
- package/dist/admins-components68.js +6 -111
- package/dist/admins-components69.js +112 -0
- package/dist/admins-components7.js +29 -252
- package/dist/admins-components71.js +6 -59
- package/dist/admins-components72.js +55 -217
- package/dist/admins-components73.js +222 -0
- package/dist/admins-components75.js +6 -8
- package/dist/admins-components76.js +7 -45
- package/dist/admins-components77.js +45 -249
- package/dist/admins-components78.js +264 -0
- package/dist/admins-components8.js +253 -0
- package/dist/admins-components80.js +7 -37
- package/dist/admins-components81.js +38 -0
- package/dist/admins-components83.js +6 -198
- package/dist/admins-components84.js +199 -0
- package/dist/admins-components86.js +6 -203
- package/dist/admins-components87.js +204 -0
- package/dist/admins-components89.js +7 -3
- package/dist/admins-components90.js +3 -16
- package/dist/admins-components91.js +16 -3
- package/dist/admins-components92.js +3 -52
- package/dist/admins-components93.js +50 -80
- package/dist/admins-components94.js +78 -109
- package/dist/admins-components95.js +110 -41
- package/dist/admins-components96.js +39 -101
- package/dist/admins-components97.js +105 -6
- package/dist/admins-components98.js +5 -250
- package/dist/admins-components99.js +250 -25
- package/dist/base.css +1 -1
- package/dist/src/components/Button.vue.d.ts +1 -2
- package/dist/src/components/DatePicker.vue.d.ts +2 -0
- package/dist/src/components/DropdownMenu.vue.d.ts +2 -0
- package/package.json +1 -1
- package/dist/admins-components10.js +0 -10
- package/dist/admins-components155.js +0 -169
- package/dist/admins-components21.js +0 -7
- package/dist/admins-components26.js +0 -7
- package/dist/admins-components29.js +0 -7
- package/dist/admins-components32.js +0 -7
- package/dist/admins-components37.js +0 -7
- package/dist/admins-components40.js +0 -7
- package/dist/admins-components47.js +0 -7
- package/dist/admins-components51.js +0 -7
- package/dist/admins-components60.js +0 -8
- package/dist/admins-components63.js +0 -8
- package/dist/admins-components67.js +0 -7
- package/dist/admins-components70.js +0 -7
- package/dist/admins-components74.js +0 -7
- package/dist/admins-components79.js +0 -8
- package/dist/admins-components82.js +0 -7
- package/dist/admins-components85.js +0 -7
- package/dist/admins-components88.js +0 -8
|
@@ -1,222 +1,60 @@
|
|
|
1
1
|
import { formatDate as e } from "./admins-components3.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
], fe = { class: "filters-history__item-header-text" }, T = { class: "filters-history__item-date" }, E = {
|
|
27
|
-
key: 0,
|
|
28
|
-
class: "filters-history__item-name"
|
|
29
|
-
}, D = ["onClick"], O = ["onClick"], k = ["onClick"], A = {
|
|
30
|
-
key: 0,
|
|
31
|
-
class: "filters-history__item-content"
|
|
32
|
-
}, j = {
|
|
33
|
-
key: 0,
|
|
34
|
-
class: "filters-history__item-body"
|
|
35
|
-
}, M = {
|
|
36
|
-
key: 1,
|
|
37
|
-
class: "filters-history__item-empty"
|
|
38
|
-
}, N = { key: 3 }, P = 50, F = 7, I = /* @__PURE__ */ d({
|
|
39
|
-
__name: "FiltersHistory",
|
|
40
|
-
props: {
|
|
41
|
-
items: {},
|
|
42
|
-
values: {},
|
|
43
|
-
storageKey: {}
|
|
44
|
-
},
|
|
45
|
-
emits: ["load", "change"],
|
|
46
|
-
setup(d, { emit: I }) {
|
|
47
|
-
let L = d, R = a(() => `data-filters-${L.storageKey}`), z = I, B = g(!1), V = g([]), H = g(""), U = g(/* @__PURE__ */ new Set()), W = g(!1);
|
|
48
|
-
function G(e) {
|
|
49
|
-
return U.value.has(e);
|
|
50
|
-
}
|
|
51
|
-
function K(e) {
|
|
52
|
-
let t = new Set(U.value);
|
|
53
|
-
t.has(e) ? t.delete(e) : t.add(e), U.value = t;
|
|
54
|
-
}
|
|
55
|
-
function pe() {
|
|
56
|
-
try {
|
|
57
|
-
let e = localStorage.getItem(R.value);
|
|
58
|
-
if (!e) {
|
|
59
|
-
V.value = [];
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
let t = JSON.parse(e);
|
|
63
|
-
Array.isArray(t) ? V.value = t.filter((e) => e && typeof e == "object" && typeof e.id == "string" && e.values && typeof e.savedAt == "string") : V.value = [];
|
|
64
|
-
} catch {
|
|
65
|
-
V.value = [];
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function q() {
|
|
69
|
-
try {
|
|
70
|
-
localStorage.setItem(R.value, JSON.stringify(V.value));
|
|
71
|
-
} catch {}
|
|
72
|
-
}
|
|
73
|
-
m(pe);
|
|
74
|
-
let J = a(() => Object.values(L.values).some((e) => e !== null && e !== "" && e !== void 0));
|
|
75
|
-
function me() {
|
|
76
|
-
return `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
77
|
-
}
|
|
78
|
-
x(() => [L.values, H.value], () => {
|
|
79
|
-
Y.value &&= !1;
|
|
80
|
-
}, { deep: !0 });
|
|
81
|
-
let Y = g(!1);
|
|
82
|
-
function X() {
|
|
83
|
-
if (!J.value) return;
|
|
84
|
-
let e = H.value.trim();
|
|
85
|
-
V.value = [{
|
|
86
|
-
id: me(),
|
|
87
|
-
savedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
88
|
-
name: e || void 0,
|
|
89
|
-
values: { ...L.values }
|
|
90
|
-
}, ...V.value].slice(0, P), H.value = "", q(), f(() => {
|
|
91
|
-
Y.value = !0;
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
function he(e) {
|
|
95
|
-
z("load", { ...e.values }), z("change", { ...e.values });
|
|
96
|
-
}
|
|
97
|
-
function Z(e) {
|
|
98
|
-
if (V.value = V.value.filter((t) => t.id !== e.id), U.value.has(e.id)) {
|
|
99
|
-
let t = new Set(U.value);
|
|
100
|
-
t.delete(e.id), U.value = t;
|
|
101
|
-
}
|
|
102
|
-
q();
|
|
103
|
-
}
|
|
104
|
-
function ge() {
|
|
105
|
-
V.value = [], U.value = /* @__PURE__ */ new Set(), q(), W.value = !1;
|
|
106
|
-
}
|
|
107
|
-
function Q(e) {
|
|
108
|
-
return r(L.items, e.values);
|
|
2
|
+
//#region src/utils/filterDisplay.ts
|
|
3
|
+
function t(t, r, i) {
|
|
4
|
+
if (i == null || i === "") return "";
|
|
5
|
+
let a = t.find((e) => e.key === r);
|
|
6
|
+
if (a?.type === "dropdown" && a.options) {
|
|
7
|
+
let e = n(i);
|
|
8
|
+
if (Array.isArray(e)) return e.map((e) => {
|
|
9
|
+
let t = a.options?.find((t) => t.value === e);
|
|
10
|
+
return t ? t.label : String(e);
|
|
11
|
+
}).join(", ");
|
|
12
|
+
let t = a.options.find((t) => t.value === e);
|
|
13
|
+
if (t) return t.label;
|
|
14
|
+
}
|
|
15
|
+
if (a?.type === "checkbox") return i ? "Bekapcsolva" : "";
|
|
16
|
+
if (a?.type === "date" || a?.type === "datetime") {
|
|
17
|
+
if (typeof i == "object" && i) {
|
|
18
|
+
let t = i.local ?? i.utc ?? null;
|
|
19
|
+
if (t == null) return "";
|
|
20
|
+
let n = t instanceof Date ? t : new Date(t);
|
|
21
|
+
if (!isNaN(n.getTime())) return e(n, a.type === "datetime" ? "YYYY-MM-DD HH:mm" : "YYYY-MM-DD");
|
|
22
|
+
}
|
|
23
|
+
if (typeof i == "string" && i) {
|
|
24
|
+
let t = new Date(i);
|
|
25
|
+
if (!isNaN(t.getTime())) return e(t, a.type === "datetime" ? "YYYY-MM-DD HH:mm" : "YYYY-MM-DD");
|
|
109
26
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
27
|
+
}
|
|
28
|
+
if ((a?.type === "daterange" || a?.type === "datetimerange") && typeof i == "object") {
|
|
29
|
+
let t = a.type === "datetimerange" ? "YYYY-MM-DD HH:mm" : "YYYY-MM-DD";
|
|
30
|
+
return `${i.fromUtc ? e(new Date(i.fromUtc), t) : "…"} - ${i.toUtc ? e(new Date(i.toUtc), t) : "…"}`;
|
|
31
|
+
}
|
|
32
|
+
return typeof i == "object" ? JSON.stringify(i) : String(i);
|
|
33
|
+
}
|
|
34
|
+
function n(e) {
|
|
35
|
+
if (Array.isArray(e)) return e;
|
|
36
|
+
if (typeof e == "string") {
|
|
37
|
+
if (e.startsWith("[") && e.endsWith("]")) try {
|
|
38
|
+
let t = JSON.parse(e);
|
|
39
|
+
if (Array.isArray(t)) return t;
|
|
40
|
+
} catch {}
|
|
41
|
+
return e;
|
|
42
|
+
}
|
|
43
|
+
return e;
|
|
44
|
+
}
|
|
45
|
+
function r(e, n) {
|
|
46
|
+
let r = [];
|
|
47
|
+
for (let [i, a] of Object.entries(n)) {
|
|
48
|
+
let n = t(e, i, a);
|
|
49
|
+
if (!n) continue;
|
|
50
|
+
let o = e.find((e) => e.key === i), s = o?.label ?? i;
|
|
51
|
+
r.push({
|
|
52
|
+
key: i,
|
|
53
|
+
text: `${s}: ${n}`,
|
|
54
|
+
displayClass: o?.displayClass
|
|
114
55
|
});
|
|
115
|
-
function $(e) {
|
|
116
|
-
return _e.value.get(e.id) ?? Q(e);
|
|
117
|
-
}
|
|
118
|
-
let ve = a(() => V.value.length >= P - F);
|
|
119
|
-
function ye(t) {
|
|
120
|
-
let n = new Date(t);
|
|
121
|
-
return isNaN(n.getTime()) ? t : e(n, "YYYY-MM-DD HH:mm");
|
|
122
|
-
}
|
|
123
|
-
return (e, r) => {
|
|
124
|
-
let a = v("tooltip");
|
|
125
|
-
return h(), c("div", te, [l("div", ne, [l("button", {
|
|
126
|
-
type: "button",
|
|
127
|
-
class: p(["filters-history__toggle", { "is-open": B.value }]),
|
|
128
|
-
"aria-expanded": B.value,
|
|
129
|
-
onClick: r[0] ||= (e) => B.value = !B.value
|
|
130
|
-
}, [
|
|
131
|
-
r[6] ||= l("i", { class: "fa-solid fa-sliders filters-history__toggle-icon" }, null, -1),
|
|
132
|
-
r[7] ||= l("span", { class: "filters-history__toggle-label" }, "Mentett szűrők", -1),
|
|
133
|
-
V.value.length ? (h(), c("span", ie, y(V.value.length), 1)) : s("", !0),
|
|
134
|
-
ve.value ? S((h(), c("span", ae, [u("/ " + y(P))])), [[a, `Maximum ${P} szűrő menthető`]]) : s("", !0),
|
|
135
|
-
l("i", { class: p(["fa-solid filters-history__chevron", B.value ? "fa-chevron-up" : "fa-chevron-down"]) }, null, 2)
|
|
136
|
-
], 10, re), B.value ? (h(), c("div", oe, [
|
|
137
|
-
l("div", se, [S(l("input", {
|
|
138
|
-
"onUpdate:modelValue": r[1] ||= (e) => H.value = e,
|
|
139
|
-
type: "text",
|
|
140
|
-
class: "c-input-row c-input-row--sm",
|
|
141
|
-
placeholder: "Elnevezés",
|
|
142
|
-
onKeydown: C(X, ["enter"])
|
|
143
|
-
}, null, 544), [[b, H.value]]), ee(t, {
|
|
144
|
-
icon: "fa-solid fa-bookmark",
|
|
145
|
-
label: "Mentés",
|
|
146
|
-
size: "small",
|
|
147
|
-
type: "info",
|
|
148
|
-
disabled: !J.value || Y.value,
|
|
149
|
-
onClick: X
|
|
150
|
-
}, null, 8, ["disabled"])]),
|
|
151
|
-
!J.value && V.value.length === 0 ? (h(), c("p", ce, " Nincs aktív szűrő. Adj meg értékeket a mentéshez. ")) : V.value.length === 0 ? (h(), c("p", le, [...r[8] ||= [
|
|
152
|
-
u(" Még nincs mentett szűrő.", -1),
|
|
153
|
-
l("br", null, null, -1),
|
|
154
|
-
u(" Az aktuális beállítások a „Mentés\" gombbal menthetők.", -1),
|
|
155
|
-
l("br", null, null, -1),
|
|
156
|
-
u(" Az „Elnevezés\" mező csak a könnyebb azonosítás miatt van, megadása nem kötelező. ", -1)
|
|
157
|
-
]])) : s("", !0),
|
|
158
|
-
V.value.length > 0 ? (h(), c("ul", ue, [(h(!0), c(i, null, _(V.value, (e) => (h(), c("li", {
|
|
159
|
-
key: e.id,
|
|
160
|
-
class: p(["filters-history__item", { "is-open": G(e.id) }])
|
|
161
|
-
}, [l("div", {
|
|
162
|
-
class: p(["filters-history__item-header", { "is-open": G(e.id) }]),
|
|
163
|
-
role: "button",
|
|
164
|
-
tabindex: "0",
|
|
165
|
-
"aria-expanded": G(e.id),
|
|
166
|
-
onClick: (t) => K(e.id),
|
|
167
|
-
onKeydown: [C(w((t) => K(e.id), ["prevent"]), ["enter"]), C(w((t) => K(e.id), ["prevent"]), ["space"])]
|
|
168
|
-
}, [
|
|
169
|
-
l("i", { class: p(["fa-solid filters-history__item-chevron", G(e.id) ? "fa-chevron-down" : "fa-chevron-right"]) }, null, 2),
|
|
170
|
-
l("span", fe, [l("span", T, y(ye(e.savedAt)), 1), e.name ? (h(), c("span", E, y(e.name), 1)) : s("", !0)]),
|
|
171
|
-
l("div", {
|
|
172
|
-
class: "filters-history__item-actions",
|
|
173
|
-
onClick: r[2] ||= w(() => {}, ["stop"])
|
|
174
|
-
}, [
|
|
175
|
-
l("button", {
|
|
176
|
-
type: "button",
|
|
177
|
-
class: "c-indicator filters-history__item-btn filters-history__item-load",
|
|
178
|
-
"aria-label": "Betöltés",
|
|
179
|
-
title: "Betöltés",
|
|
180
|
-
onClick: (t) => he(e)
|
|
181
|
-
}, [...r[9] ||= [l("i", { class: "fa-solid fa-check" }, null, -1)]], 8, D),
|
|
182
|
-
$(e).length ? S((h(), c("span", {
|
|
183
|
-
key: 0,
|
|
184
|
-
class: "c-indicator",
|
|
185
|
-
onClick: w((t) => K(e.id), ["stop"])
|
|
186
|
-
}, [u(y($(e).length), 1)], 8, O)), [[a, `${$(e).length} szűrési feltétel`]]) : s("", !0),
|
|
187
|
-
l("button", {
|
|
188
|
-
type: "button",
|
|
189
|
-
class: "c-indicator filters-history__item-btn filters-history__item-remove",
|
|
190
|
-
"aria-label": "Törlés",
|
|
191
|
-
title: "Törlés",
|
|
192
|
-
onClick: (t) => Z(e)
|
|
193
|
-
}, [...r[10] ||= [l("i", { class: "fa-solid fa-xmark" }, null, -1)]], 8, k)
|
|
194
|
-
])
|
|
195
|
-
], 42, de), G(e.id) ? (h(), c("div", A, [$(e).length ? (h(), c("div", j, [(h(!0), c(i, null, _($(e), (e, t) => (h(), c("span", {
|
|
196
|
-
key: t,
|
|
197
|
-
class: p(["c-chip", e.displayClass])
|
|
198
|
-
}, y(e.text), 3))), 128))])) : (h(), c("p", M, "Nincs megjeleníthető szűrő."))])) : s("", !0)], 2))), 128))])) : s("", !0),
|
|
199
|
-
V.value.length > 3 ? (h(), c("div", N, [
|
|
200
|
-
r[11] ||= l("hr", { class: "separator my-1" }, null, -1),
|
|
201
|
-
V.value.length ? (h(), c("a", {
|
|
202
|
-
key: 0,
|
|
203
|
-
class: "filters-history__clear-all px-2",
|
|
204
|
-
onClick: r[3] ||= (e) => W.value = !0
|
|
205
|
-
}, "Összes törlése")) : s("", !0),
|
|
206
|
-
W.value ? (h(), o(n, {
|
|
207
|
-
key: 1,
|
|
208
|
-
title: "Mentett szűrők törlése",
|
|
209
|
-
message: "Biztosan törlöd az összes mentett szűrőt?",
|
|
210
|
-
"confirm-label": "Törlés",
|
|
211
|
-
"cancel-label": "Mégse",
|
|
212
|
-
type: "error",
|
|
213
|
-
onConfirm: r[4] ||= (e) => ge(),
|
|
214
|
-
onCancel: r[5] ||= (e) => W.value = !1
|
|
215
|
-
})) : s("", !0)
|
|
216
|
-
])) : s("", !0)
|
|
217
|
-
])) : s("", !0)])]);
|
|
218
|
-
};
|
|
219
56
|
}
|
|
220
|
-
|
|
57
|
+
return r;
|
|
58
|
+
}
|
|
221
59
|
//#endregion
|
|
222
|
-
export {
|
|
60
|
+
export { r as buildFilterDisplay, t as displayFilterValue, n as parseDropdownValue };
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { formatDate as e } from "./admins-components3.js";
|
|
2
|
+
import t from "./admins-components6.js";
|
|
3
|
+
import n from "./admins-components35.js";
|
|
4
|
+
import { buildFilterDisplay as r } from "./admins-components72.js";
|
|
5
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as ee, defineComponent as d, nextTick as f, normalizeClass as p, onMounted as m, openBlock as h, ref as g, renderList as _, resolveDirective as v, toDisplayString as y, vModelText as b, watch as x, withDirectives as S, withKeys as C, withModifiers as w } from "vue";
|
|
6
|
+
//#region src/components/data-table/FiltersHistory.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
+
var te = { class: "ac-component" }, ne = { class: "filters-history" }, re = ["aria-expanded"], ie = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "c-indicator"
|
|
10
|
+
}, ae = { key: 1 }, oe = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "filters-history__panel c-scroll"
|
|
13
|
+
}, se = { class: "filters-history__save-row" }, ce = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "filters-history__hint"
|
|
16
|
+
}, le = {
|
|
17
|
+
key: 1,
|
|
18
|
+
class: "filters-history__hint"
|
|
19
|
+
}, ue = {
|
|
20
|
+
key: 2,
|
|
21
|
+
class: "filters-history__list"
|
|
22
|
+
}, de = [
|
|
23
|
+
"aria-expanded",
|
|
24
|
+
"onClick",
|
|
25
|
+
"onKeydown"
|
|
26
|
+
], fe = { class: "filters-history__item-header-text" }, T = { class: "filters-history__item-date" }, E = {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "filters-history__item-name"
|
|
29
|
+
}, D = ["onClick"], O = ["onClick"], k = ["onClick"], A = {
|
|
30
|
+
key: 0,
|
|
31
|
+
class: "filters-history__item-content"
|
|
32
|
+
}, j = {
|
|
33
|
+
key: 0,
|
|
34
|
+
class: "filters-history__item-body"
|
|
35
|
+
}, M = {
|
|
36
|
+
key: 1,
|
|
37
|
+
class: "filters-history__item-empty"
|
|
38
|
+
}, N = { key: 3 }, P = 50, F = 7, I = /* @__PURE__ */ d({
|
|
39
|
+
__name: "FiltersHistory",
|
|
40
|
+
props: {
|
|
41
|
+
items: {},
|
|
42
|
+
values: {},
|
|
43
|
+
storageKey: {}
|
|
44
|
+
},
|
|
45
|
+
emits: ["load", "change"],
|
|
46
|
+
setup(d, { emit: I }) {
|
|
47
|
+
let L = d, R = a(() => `data-filters-${L.storageKey}`), z = I, B = g(!1), V = g([]), H = g(""), U = g(/* @__PURE__ */ new Set()), W = g(!1);
|
|
48
|
+
function G(e) {
|
|
49
|
+
return U.value.has(e);
|
|
50
|
+
}
|
|
51
|
+
function K(e) {
|
|
52
|
+
let t = new Set(U.value);
|
|
53
|
+
t.has(e) ? t.delete(e) : t.add(e), U.value = t;
|
|
54
|
+
}
|
|
55
|
+
function pe() {
|
|
56
|
+
try {
|
|
57
|
+
let e = localStorage.getItem(R.value);
|
|
58
|
+
if (!e) {
|
|
59
|
+
V.value = [];
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
let t = JSON.parse(e);
|
|
63
|
+
Array.isArray(t) ? V.value = t.filter((e) => e && typeof e == "object" && typeof e.id == "string" && e.values && typeof e.savedAt == "string") : V.value = [];
|
|
64
|
+
} catch {
|
|
65
|
+
V.value = [];
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function q() {
|
|
69
|
+
try {
|
|
70
|
+
localStorage.setItem(R.value, JSON.stringify(V.value));
|
|
71
|
+
} catch {}
|
|
72
|
+
}
|
|
73
|
+
m(pe);
|
|
74
|
+
let J = a(() => Object.values(L.values).some((e) => e !== null && e !== "" && e !== void 0));
|
|
75
|
+
function me() {
|
|
76
|
+
return `${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
77
|
+
}
|
|
78
|
+
x(() => [L.values, H.value], () => {
|
|
79
|
+
Y.value &&= !1;
|
|
80
|
+
}, { deep: !0 });
|
|
81
|
+
let Y = g(!1);
|
|
82
|
+
function X() {
|
|
83
|
+
if (!J.value) return;
|
|
84
|
+
let e = H.value.trim();
|
|
85
|
+
V.value = [{
|
|
86
|
+
id: me(),
|
|
87
|
+
savedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
88
|
+
name: e || void 0,
|
|
89
|
+
values: { ...L.values }
|
|
90
|
+
}, ...V.value].slice(0, P), H.value = "", q(), f(() => {
|
|
91
|
+
Y.value = !0;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function he(e) {
|
|
95
|
+
z("load", { ...e.values }), z("change", { ...e.values });
|
|
96
|
+
}
|
|
97
|
+
function Z(e) {
|
|
98
|
+
if (V.value = V.value.filter((t) => t.id !== e.id), U.value.has(e.id)) {
|
|
99
|
+
let t = new Set(U.value);
|
|
100
|
+
t.delete(e.id), U.value = t;
|
|
101
|
+
}
|
|
102
|
+
q();
|
|
103
|
+
}
|
|
104
|
+
function ge() {
|
|
105
|
+
V.value = [], U.value = /* @__PURE__ */ new Set(), q(), W.value = !1;
|
|
106
|
+
}
|
|
107
|
+
function Q(e) {
|
|
108
|
+
return r(L.items, e.values);
|
|
109
|
+
}
|
|
110
|
+
let _e = a(() => {
|
|
111
|
+
let e = /* @__PURE__ */ new Map();
|
|
112
|
+
for (let t of V.value) e.set(t.id, Q(t));
|
|
113
|
+
return e;
|
|
114
|
+
});
|
|
115
|
+
function $(e) {
|
|
116
|
+
return _e.value.get(e.id) ?? Q(e);
|
|
117
|
+
}
|
|
118
|
+
let ve = a(() => V.value.length >= P - F);
|
|
119
|
+
function ye(t) {
|
|
120
|
+
let n = new Date(t);
|
|
121
|
+
return isNaN(n.getTime()) ? t : e(n, "YYYY-MM-DD HH:mm");
|
|
122
|
+
}
|
|
123
|
+
return (e, r) => {
|
|
124
|
+
let a = v("tooltip");
|
|
125
|
+
return h(), c("div", te, [l("div", ne, [l("button", {
|
|
126
|
+
type: "button",
|
|
127
|
+
class: p(["filters-history__toggle", { "is-open": B.value }]),
|
|
128
|
+
"aria-expanded": B.value,
|
|
129
|
+
onClick: r[0] ||= (e) => B.value = !B.value
|
|
130
|
+
}, [
|
|
131
|
+
r[6] ||= l("i", { class: "fa-solid fa-sliders filters-history__toggle-icon" }, null, -1),
|
|
132
|
+
r[7] ||= l("span", { class: "filters-history__toggle-label" }, "Mentett szűrők", -1),
|
|
133
|
+
V.value.length ? (h(), c("span", ie, y(V.value.length), 1)) : s("", !0),
|
|
134
|
+
ve.value ? S((h(), c("span", ae, [u("/ " + y(P))])), [[a, `Maximum ${P} szűrő menthető`]]) : s("", !0),
|
|
135
|
+
l("i", { class: p(["fa-solid filters-history__chevron", B.value ? "fa-chevron-up" : "fa-chevron-down"]) }, null, 2)
|
|
136
|
+
], 10, re), B.value ? (h(), c("div", oe, [
|
|
137
|
+
l("div", se, [S(l("input", {
|
|
138
|
+
"onUpdate:modelValue": r[1] ||= (e) => H.value = e,
|
|
139
|
+
type: "text",
|
|
140
|
+
class: "c-input-row c-input-row--sm",
|
|
141
|
+
placeholder: "Elnevezés",
|
|
142
|
+
onKeydown: C(X, ["enter"])
|
|
143
|
+
}, null, 544), [[b, H.value]]), ee(t, {
|
|
144
|
+
icon: "fa-solid fa-bookmark",
|
|
145
|
+
label: "Mentés",
|
|
146
|
+
size: "small",
|
|
147
|
+
type: "info",
|
|
148
|
+
disabled: !J.value || Y.value,
|
|
149
|
+
onClick: X
|
|
150
|
+
}, null, 8, ["disabled"])]),
|
|
151
|
+
!J.value && V.value.length === 0 ? (h(), c("p", ce, " Nincs aktív szűrő. Adj meg értékeket a mentéshez. ")) : V.value.length === 0 ? (h(), c("p", le, [...r[8] ||= [
|
|
152
|
+
u(" Még nincs mentett szűrő.", -1),
|
|
153
|
+
l("br", null, null, -1),
|
|
154
|
+
u(" Az aktuális beállítások a „Mentés\" gombbal menthetők.", -1),
|
|
155
|
+
l("br", null, null, -1),
|
|
156
|
+
u(" Az „Elnevezés\" mező csak a könnyebb azonosítás miatt van, megadása nem kötelező. ", -1)
|
|
157
|
+
]])) : s("", !0),
|
|
158
|
+
V.value.length > 0 ? (h(), c("ul", ue, [(h(!0), c(i, null, _(V.value, (e) => (h(), c("li", {
|
|
159
|
+
key: e.id,
|
|
160
|
+
class: p(["filters-history__item", { "is-open": G(e.id) }])
|
|
161
|
+
}, [l("div", {
|
|
162
|
+
class: p(["filters-history__item-header", { "is-open": G(e.id) }]),
|
|
163
|
+
role: "button",
|
|
164
|
+
tabindex: "0",
|
|
165
|
+
"aria-expanded": G(e.id),
|
|
166
|
+
onClick: (t) => K(e.id),
|
|
167
|
+
onKeydown: [C(w((t) => K(e.id), ["prevent"]), ["enter"]), C(w((t) => K(e.id), ["prevent"]), ["space"])]
|
|
168
|
+
}, [
|
|
169
|
+
l("i", { class: p(["fa-solid filters-history__item-chevron", G(e.id) ? "fa-chevron-down" : "fa-chevron-right"]) }, null, 2),
|
|
170
|
+
l("span", fe, [l("span", T, y(ye(e.savedAt)), 1), e.name ? (h(), c("span", E, y(e.name), 1)) : s("", !0)]),
|
|
171
|
+
l("div", {
|
|
172
|
+
class: "filters-history__item-actions",
|
|
173
|
+
onClick: r[2] ||= w(() => {}, ["stop"])
|
|
174
|
+
}, [
|
|
175
|
+
l("button", {
|
|
176
|
+
type: "button",
|
|
177
|
+
class: "c-indicator filters-history__item-btn filters-history__item-load",
|
|
178
|
+
"aria-label": "Betöltés",
|
|
179
|
+
title: "Betöltés",
|
|
180
|
+
onClick: (t) => he(e)
|
|
181
|
+
}, [...r[9] ||= [l("i", { class: "fa-solid fa-check" }, null, -1)]], 8, D),
|
|
182
|
+
$(e).length ? S((h(), c("span", {
|
|
183
|
+
key: 0,
|
|
184
|
+
class: "c-indicator",
|
|
185
|
+
onClick: w((t) => K(e.id), ["stop"])
|
|
186
|
+
}, [u(y($(e).length), 1)], 8, O)), [[a, `${$(e).length} szűrési feltétel`]]) : s("", !0),
|
|
187
|
+
l("button", {
|
|
188
|
+
type: "button",
|
|
189
|
+
class: "c-indicator filters-history__item-btn filters-history__item-remove",
|
|
190
|
+
"aria-label": "Törlés",
|
|
191
|
+
title: "Törlés",
|
|
192
|
+
onClick: (t) => Z(e)
|
|
193
|
+
}, [...r[10] ||= [l("i", { class: "fa-solid fa-xmark" }, null, -1)]], 8, k)
|
|
194
|
+
])
|
|
195
|
+
], 42, de), G(e.id) ? (h(), c("div", A, [$(e).length ? (h(), c("div", j, [(h(!0), c(i, null, _($(e), (e, t) => (h(), c("span", {
|
|
196
|
+
key: t,
|
|
197
|
+
class: p(["c-chip", e.displayClass])
|
|
198
|
+
}, y(e.text), 3))), 128))])) : (h(), c("p", M, "Nincs megjeleníthető szűrő."))])) : s("", !0)], 2))), 128))])) : s("", !0),
|
|
199
|
+
V.value.length > 3 ? (h(), c("div", N, [
|
|
200
|
+
r[11] ||= l("hr", { class: "separator my-1" }, null, -1),
|
|
201
|
+
V.value.length ? (h(), c("a", {
|
|
202
|
+
key: 0,
|
|
203
|
+
class: "filters-history__clear-all px-2",
|
|
204
|
+
onClick: r[3] ||= (e) => W.value = !0
|
|
205
|
+
}, "Összes törlése")) : s("", !0),
|
|
206
|
+
W.value ? (h(), o(n, {
|
|
207
|
+
key: 1,
|
|
208
|
+
title: "Mentett szűrők törlése",
|
|
209
|
+
message: "Biztosan törlöd az összes mentett szűrőt?",
|
|
210
|
+
"confirm-label": "Törlés",
|
|
211
|
+
"cancel-label": "Mégse",
|
|
212
|
+
type: "error",
|
|
213
|
+
onConfirm: r[4] ||= (e) => ge(),
|
|
214
|
+
onCancel: r[5] ||= (e) => W.value = !1
|
|
215
|
+
})) : s("", !0)
|
|
216
|
+
])) : s("", !0)
|
|
217
|
+
])) : s("", !0)])]);
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
//#endregion
|
|
222
|
+
export { I as default };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
}
|
|
1
|
+
import './src/styles/components/data-table/filters-history.scss_vue_type_style_index_0_src_true_lang.css';
|
|
2
|
+
import e from "./admins-components73.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
//#region src/components/data-table/FiltersHistory.vue
|
|
5
|
+
var t = e;
|
|
8
6
|
//#endregion
|
|
9
|
-
export {
|
|
7
|
+
export { t as default };
|
|
@@ -1,47 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let e = t.get(i.key);
|
|
8
|
-
r[i.key] = e === null ? i.value ?? null : n(i.type, e, i.value);
|
|
9
|
-
}
|
|
10
|
-
return r;
|
|
11
|
-
}
|
|
12
|
-
function n(t, n, i) {
|
|
13
|
-
if (t === "number") {
|
|
14
|
-
let e = Number(n);
|
|
15
|
-
return isNaN(e) ? i ?? null : e;
|
|
16
|
-
}
|
|
17
|
-
return t === "date" || t === "datetime" ? { utc: n } : t === "daterange" || t === "datetimerange" ? r(n, i) : t === "dropdown" ? e(n) : t === "checkbox" ? n === "true" : n;
|
|
18
|
-
}
|
|
19
|
-
function r(e, t) {
|
|
20
|
-
try {
|
|
21
|
-
let t = JSON.parse(e);
|
|
22
|
-
return t && typeof t == "object" && "local" in t && t.local && (t.local = new Date(t.local)), t;
|
|
23
|
-
} catch {
|
|
24
|
-
return t ?? null;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
function i(e) {
|
|
28
|
-
let t = new URLSearchParams(window.location.search), r = {};
|
|
29
|
-
for (let i of e) {
|
|
30
|
-
if (i.type === "separator") continue;
|
|
31
|
-
let e = t.get(i.key);
|
|
32
|
-
e !== null && (r[i.key] = n(i.type, e, i.value));
|
|
33
|
-
}
|
|
34
|
-
return r;
|
|
35
|
-
}
|
|
36
|
-
function a(e, t) {
|
|
37
|
-
let n = new URLSearchParams(window.location.search);
|
|
38
|
-
for (let r of e) {
|
|
39
|
-
if (r.type === "separator") continue;
|
|
40
|
-
let e = t[r.key];
|
|
41
|
-
e == null || e === "" ? n.delete(r.key) : r.type === "date" || r.type === "datetime" ? n.set(r.key, e.utc) : typeof e == "object" ? n.set(r.key, JSON.stringify(e)) : n.set(r.key, String(e));
|
|
42
|
-
}
|
|
43
|
-
let r = n.toString(), i = window.location.pathname + (r ? `?${r}` : "");
|
|
44
|
-
window.history.replaceState(null, "", i);
|
|
1
|
+
//#region src/utils/debounce.ts
|
|
2
|
+
function e(e, t = 300) {
|
|
3
|
+
let n = null;
|
|
4
|
+
return (...r) => {
|
|
5
|
+
n !== null && clearTimeout(n), n = setTimeout(() => e(...r), t);
|
|
6
|
+
};
|
|
45
7
|
}
|
|
46
8
|
//#endregion
|
|
47
|
-
export {
|
|
9
|
+
export { e as debounce };
|