@anzusystems/common-admin 1.47.0-beta.34 → 1.47.0-beta.340
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/AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-Cc4fwgQq.mjs +6756 -0
- package/dist/AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-Cc4fwgQq.mjs.map +1 -0
- package/dist/common-admin.css +1 -0
- package/dist/common-admin.d.ts +19582 -0
- package/dist/common-admin.js +22424 -0
- package/dist/common-admin.js.map +1 -0
- package/dist/index-Bk8A-WJh.mjs +20614 -0
- package/dist/index-Bk8A-WJh.mjs.map +1 -0
- package/dist/labs.d.ts +929 -0
- package/dist/labs.js +1186 -0
- package/dist/labs.js.map +1 -0
- package/dist/webfontloader-DeB77L0f.mjs +452 -0
- package/dist/webfontloader-DeB77L0f.mjs.map +1 -0
- package/package.json +86 -61
- package/dist/common-admin.es.d.ts +0 -11186
- package/dist/common-admin.es.js +0 -326
- package/dist/common-admin.es.js.map +0 -1
- package/dist/lib-hAtZsU89.js +0 -24214
- package/dist/lib-hAtZsU89.js.map +0 -1
- package/dist/style.css +0 -13
- package/dist/webfontloader-DmiWvmlF.js +0 -452
- package/dist/webfontloader-DmiWvmlF.js.map +0 -1
package/dist/labs.js
ADDED
|
@@ -0,0 +1,1186 @@
|
|
|
1
|
+
import { bP as Ve, bQ as ke, aE as Fe, aF as xe, d as F, bR as mt, H as Be, bS as ft, l as Oe, p as Ae, ah as fe, g as Q, bT as he, bU as Ce, n as re, k as Re, o as Ie, a5 as De, at as Pe, m as vt, A as pt, i as Y, bV as gt, B as bt, D as yt, bW as ht, aX as Ct, bX as _t, bY as Ue, h as K, j as At, ai as Le, aj as Ne, ak as ze, al as Me, ae as ve, aZ as qe, a8 as He, a9 as Je, aa as Ke, ab as We, am as Qe, an as Ye, ac as Ge, ad as Xe, bZ as Ze, b_ as et, b$ as tt, c0 as wt, ar as at, c1 as _e, ao as kt, ap as Ft, aP as xt, F as Pt, a6 as Tt, b1 as St, aq as Bt, a1 as It, c2 as Dt, q as $t, x as jt, aG as Et } from "./AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-Cc4fwgQq.mjs";
|
|
2
|
+
import { aD as so, c3 as lo, c4 as no, az as ro, aA as io, aC as uo, aB as co, aH as mo, ba as fo, ax as vo, ay as po, c9 as go, ca as bo, c7 as yo, c8 as ho, ag as Co, af as _o, c5 as Ao, c6 as wo, cb as ko } from "./AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-Cc4fwgQq.mjs";
|
|
3
|
+
import { defineComponent as Z, inject as H, computed as S, nextTick as me, ref as O, watch as G, resolveComponent as pe, createElementBlock as V, openBlock as y, Fragment as X, createBlock as B, createCommentVNode as q, withModifiers as R, unref as f, withCtx as u, createVNode as m, mergeProps as ot, renderSlot as E, createTextVNode as U, toDisplayString as P, normalizeClass as be, renderList as oe, createElementVNode as I, mergeModels as ge, useModel as we, provide as $e, resolveDynamicComponent as Vt, withDirectives as st, vShow as lt, onMounted as Ot, toRaw as je } from "vue";
|
|
4
|
+
import { useI18n as ae } from "vue-i18n";
|
|
5
|
+
import { VCard as nt, VCardText as Rt, VCardActions as Ut } from "vuetify/components/VCard";
|
|
6
|
+
import { VDialog as rt } from "vuetify/components/VDialog";
|
|
7
|
+
import { VSpacer as it, VRow as ie, VCol as te } from "vuetify/components/VGrid";
|
|
8
|
+
import { VListItem as ut, VList as Lt, VListItemTitle as Nt } from "vuetify/components/VList";
|
|
9
|
+
import { VSelect as zt } from "vuetify/components/VSelect";
|
|
10
|
+
import { VTextarea as Mt } from "vuetify/components/VTextarea";
|
|
11
|
+
import { VBtn as W } from "vuetify/components/VBtn";
|
|
12
|
+
import { VIcon as Te } from "vuetify/components/VIcon";
|
|
13
|
+
import { VTooltip as ct } from "vuetify/components/VTooltip";
|
|
14
|
+
import { VChip as Ee } from "vuetify/components/VChip";
|
|
15
|
+
import dt from "axios";
|
|
16
|
+
import { VForm as qt } from "vuetify/components/VForm";
|
|
17
|
+
import { VMenu as Ht } from "vuetify/components/VMenu";
|
|
18
|
+
import { useThrottleFn as ue, useDebounceFn as Jt } from "@vueuse/core";
|
|
19
|
+
import { VBtnToggle as Kt } from "vuetify/components/VBtnToggle";
|
|
20
|
+
import { VToolbar as Wt } from "vuetify/components/VToolbar";
|
|
21
|
+
import { Intersect as Qt } from "vuetify/directives";
|
|
22
|
+
const Yt = /* @__PURE__ */ Z({
|
|
23
|
+
__name: "AFilterTimeInterval",
|
|
24
|
+
props: {
|
|
25
|
+
nameFrom: {},
|
|
26
|
+
nameUntil: {},
|
|
27
|
+
allowed: { default: void 0 },
|
|
28
|
+
placeholder: { default: void 0 },
|
|
29
|
+
dataCy: { default: "filter-time-interval" }
|
|
30
|
+
},
|
|
31
|
+
emits: ["change"],
|
|
32
|
+
setup(a, { emit: p }) {
|
|
33
|
+
const l = a, t = p, g = H(Ve), i = H(ke), n = H(Fe), o = H(xe);
|
|
34
|
+
if (F(g) || F(i) || F(n) || // eslint-disable-next-line vue/no-setup-props-reactivity-loss
|
|
35
|
+
F(n.fields[l.nameFrom]) || // eslint-disable-next-line vue/no-setup-props-reactivity-loss
|
|
36
|
+
F(n.fields[l.nameUntil]) || F(o) || // eslint-disable-next-line vue/no-setup-props-reactivity-loss
|
|
37
|
+
F(o[l.nameFrom]) || // eslint-disable-next-line vue/no-setup-props-reactivity-loss
|
|
38
|
+
F(o[l.nameUntil]))
|
|
39
|
+
throw new Error("Incorrect provide/inject config.");
|
|
40
|
+
const c = S({
|
|
41
|
+
get() {
|
|
42
|
+
return o[l.nameFrom];
|
|
43
|
+
},
|
|
44
|
+
set(_) {
|
|
45
|
+
o[l.nameFrom] = _, z(_), n.touched = !0, me(() => {
|
|
46
|
+
t("change");
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}), { timeIntervalOptions: d, getTimeIntervalOption: b } = mt(l.allowed), v = O(null), C = O(!1), r = O({
|
|
50
|
+
from: null,
|
|
51
|
+
until: Be()
|
|
52
|
+
}), e = O(!1), { v$: w } = ft(r), h = S(() => n.fields[l.nameFrom]), { t: s } = ae(), D = S(() => h.value.titleT ? s(h.value.titleT) : void 0), { clearOne: L } = Pe(), { showValidationError: k } = Oe(), A = () => {
|
|
53
|
+
e.value = !1, v.value = null, M();
|
|
54
|
+
}, x = () => {
|
|
55
|
+
if (w.value.$touch(), w.value.$invalid) {
|
|
56
|
+
k();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
e.value = !0, C.value = !1, o[l.nameUntil] = r.value.until, c.value = r.value.from;
|
|
60
|
+
}, N = () => {
|
|
61
|
+
C.value = !1, v.value = null;
|
|
62
|
+
}, M = () => {
|
|
63
|
+
L(l.nameFrom, o, n), L(l.nameUntil, o, n), i.value.delete(l.nameFrom);
|
|
64
|
+
}, z = (_) => {
|
|
65
|
+
if (Ae(_) || fe(_)) return;
|
|
66
|
+
if (Q(_) || F(_)) {
|
|
67
|
+
i.value.delete(l.nameFrom);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
const T = b(_);
|
|
71
|
+
if (!T && he(_)) {
|
|
72
|
+
const j = b(Ce.Custom);
|
|
73
|
+
i.value.set(l.nameFrom, [
|
|
74
|
+
{
|
|
75
|
+
title: j.title + ": " + re(r.value.from) + " - " + re(r.value.until),
|
|
76
|
+
value: _
|
|
77
|
+
}
|
|
78
|
+
]);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
T && i.value.set(l.nameFrom, [{ title: T.title, value: _ }]);
|
|
82
|
+
}, J = (_ = !1) => {
|
|
83
|
+
w.value.$reset(), _ && (r.value.from = null, r.value.until = Be()), C.value = !0;
|
|
84
|
+
};
|
|
85
|
+
G(
|
|
86
|
+
c,
|
|
87
|
+
(_) => {
|
|
88
|
+
if (Ae(_) || fe(_)) return;
|
|
89
|
+
if (e.value = !1, F(_) || Q(_)) {
|
|
90
|
+
v.value = null;
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const T = b(c.value), j = o[l.nameUntil];
|
|
94
|
+
!T && he(c.value) && he(j) && (v.value = Ce.Custom, r.value.from = c.value, r.value.until = j, e.value = !0), T && (v.value = T.value);
|
|
95
|
+
},
|
|
96
|
+
{ immediate: !0 }
|
|
97
|
+
), G(
|
|
98
|
+
[() => o[l.nameFrom], () => o[l.nameUntil]],
|
|
99
|
+
([_, T], [j, le]) => {
|
|
100
|
+
_ === j && T === le || z(_);
|
|
101
|
+
},
|
|
102
|
+
{ immediate: !0 }
|
|
103
|
+
);
|
|
104
|
+
const se = (_) => {
|
|
105
|
+
if (_.value === Ce.Custom) {
|
|
106
|
+
J(!0);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
o[l.nameUntil] = null, c.value = _.value;
|
|
110
|
+
};
|
|
111
|
+
return (_, T) => {
|
|
112
|
+
const j = pe("ABtnTertiary"), le = pe("ABtnPrimary");
|
|
113
|
+
return y(), V(X, null, [
|
|
114
|
+
e.value ? (y(), B(Mt, {
|
|
115
|
+
key: 0,
|
|
116
|
+
label: D.value,
|
|
117
|
+
"model-value": f(re)(r.value.from) + " - " + f(re)(r.value.until),
|
|
118
|
+
readonly: "",
|
|
119
|
+
rows: "1",
|
|
120
|
+
"auto-grow": "",
|
|
121
|
+
"hide-details": "",
|
|
122
|
+
"append-inner-icon": "mdi-menu-down",
|
|
123
|
+
clearable: "",
|
|
124
|
+
class: "cursor-pointer",
|
|
125
|
+
"onClick:clear": R(A, ["stop"]),
|
|
126
|
+
onClick: T[0] || (T[0] = R(($) => J(), ["stop"]))
|
|
127
|
+
}, null, 8, ["label", "model-value"])) : (y(), B(zt, {
|
|
128
|
+
key: 1,
|
|
129
|
+
modelValue: v.value,
|
|
130
|
+
"onUpdate:modelValue": T[1] || (T[1] = ($) => v.value = $),
|
|
131
|
+
"item-title": "title",
|
|
132
|
+
"item-value": "value",
|
|
133
|
+
label: D.value,
|
|
134
|
+
clearable: !f(Q)(v.value),
|
|
135
|
+
"no-filter": "",
|
|
136
|
+
"data-cy": a.dataCy,
|
|
137
|
+
items: f(d),
|
|
138
|
+
"hide-details": "",
|
|
139
|
+
autocomplete: "off",
|
|
140
|
+
"onClick:clear": R(A, ["stop"])
|
|
141
|
+
}, {
|
|
142
|
+
item: u(({ props: $, item: ee }) => [
|
|
143
|
+
m(ut, ot($, {
|
|
144
|
+
onClick: (ne) => se(ee)
|
|
145
|
+
}), null, 16, ["onClick"])
|
|
146
|
+
]),
|
|
147
|
+
_: 1
|
|
148
|
+
}, 8, ["modelValue", "label", "clearable", "data-cy", "items"])),
|
|
149
|
+
C.value ? (y(), B(rt, {
|
|
150
|
+
key: 2,
|
|
151
|
+
"model-value": !0,
|
|
152
|
+
width: "auto",
|
|
153
|
+
"min-width": 360
|
|
154
|
+
}, {
|
|
155
|
+
default: u(() => [
|
|
156
|
+
m(nt, null, {
|
|
157
|
+
default: u(() => [
|
|
158
|
+
m(Re, { onOnCancel: N }, {
|
|
159
|
+
default: u(() => [
|
|
160
|
+
E(_.$slots, "title", {}, () => [
|
|
161
|
+
U(P(D.value), 1)
|
|
162
|
+
], !0)
|
|
163
|
+
]),
|
|
164
|
+
_: 3
|
|
165
|
+
}),
|
|
166
|
+
m(Rt, null, {
|
|
167
|
+
default: u(() => [
|
|
168
|
+
m(Ie, null, {
|
|
169
|
+
default: u(() => [
|
|
170
|
+
m(De, {
|
|
171
|
+
modelValue: r.value.from,
|
|
172
|
+
"onUpdate:modelValue": T[2] || (T[2] = ($) => r.value.from = $),
|
|
173
|
+
v: f(w).dialogData.from,
|
|
174
|
+
label: f(s)("common.filter.timeInterval.from"),
|
|
175
|
+
required: ""
|
|
176
|
+
}, null, 8, ["modelValue", "v", "label"])
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
}),
|
|
180
|
+
m(Ie, null, {
|
|
181
|
+
default: u(() => [
|
|
182
|
+
m(De, {
|
|
183
|
+
modelValue: r.value.until,
|
|
184
|
+
"onUpdate:modelValue": T[3] || (T[3] = ($) => r.value.until = $),
|
|
185
|
+
v: f(w).dialogData.until,
|
|
186
|
+
label: f(s)("common.filter.timeInterval.until"),
|
|
187
|
+
required: ""
|
|
188
|
+
}, null, 8, ["modelValue", "v", "label"])
|
|
189
|
+
]),
|
|
190
|
+
_: 1
|
|
191
|
+
})
|
|
192
|
+
]),
|
|
193
|
+
_: 1
|
|
194
|
+
}),
|
|
195
|
+
m(Ut, null, {
|
|
196
|
+
default: u(() => [
|
|
197
|
+
m(it),
|
|
198
|
+
m(j, {
|
|
199
|
+
"data-cy": "button-cancel",
|
|
200
|
+
onClick: R(N, ["stop"])
|
|
201
|
+
}, {
|
|
202
|
+
default: u(() => [
|
|
203
|
+
U(P(f(s)("common.button.cancel")), 1)
|
|
204
|
+
]),
|
|
205
|
+
_: 1
|
|
206
|
+
}),
|
|
207
|
+
m(le, {
|
|
208
|
+
"data-cy": "button-confirm",
|
|
209
|
+
onClick: R(x, ["stop"])
|
|
210
|
+
}, {
|
|
211
|
+
default: u(() => [
|
|
212
|
+
U(P(f(s)("common.button.confirm")), 1)
|
|
213
|
+
]),
|
|
214
|
+
_: 1
|
|
215
|
+
})
|
|
216
|
+
]),
|
|
217
|
+
_: 1
|
|
218
|
+
})
|
|
219
|
+
]),
|
|
220
|
+
_: 3
|
|
221
|
+
})
|
|
222
|
+
]),
|
|
223
|
+
_: 3
|
|
224
|
+
})) : q("", !0)
|
|
225
|
+
], 64);
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
}), Wa = /* @__PURE__ */ vt(Yt, [["__scopeId", "data-v-622f5681"]]), Gt = /* @__PURE__ */ Z({
|
|
229
|
+
__name: "AFilterAdvancedButton",
|
|
230
|
+
props: {
|
|
231
|
+
tooltipT: { default: "common.button.advancedFilters" },
|
|
232
|
+
buttonClass: { default: "mt-1" },
|
|
233
|
+
dataCy: { default: "filter-advanced" }
|
|
234
|
+
},
|
|
235
|
+
emits: ["advancedFilter"],
|
|
236
|
+
setup(a, { emit: p }) {
|
|
237
|
+
const l = p, t = O(!1), g = (n) => {
|
|
238
|
+
pt(n), t.value = !t.value, l("advancedFilter");
|
|
239
|
+
}, { t: i } = ae();
|
|
240
|
+
return (n, o) => (y(), B(W, {
|
|
241
|
+
class: be(a.buttonClass),
|
|
242
|
+
"data-cy": a.dataCy,
|
|
243
|
+
icon: "",
|
|
244
|
+
size: "x-small",
|
|
245
|
+
variant: "text",
|
|
246
|
+
onClick: R(g, ["stop"])
|
|
247
|
+
}, {
|
|
248
|
+
default: u(() => [
|
|
249
|
+
m(Te, { icon: "mdi-filter-variant" }),
|
|
250
|
+
m(ct, {
|
|
251
|
+
activator: "parent",
|
|
252
|
+
location: "bottom"
|
|
253
|
+
}, {
|
|
254
|
+
default: u(() => [
|
|
255
|
+
U(P(f(i)(a.tooltipT)), 1)
|
|
256
|
+
]),
|
|
257
|
+
_: 1
|
|
258
|
+
})
|
|
259
|
+
]),
|
|
260
|
+
_: 1
|
|
261
|
+
}, 8, ["class", "data-cy"]));
|
|
262
|
+
}
|
|
263
|
+
}), Xt = { class: "a-selected-filters__label text-caption" }, Zt = /* @__PURE__ */ Z({
|
|
264
|
+
__name: "FiltersSelected",
|
|
265
|
+
setup(a) {
|
|
266
|
+
const p = H(Fe), l = H(xe), t = H(ke);
|
|
267
|
+
if (F(p) || F(l) || F(t))
|
|
268
|
+
throw new Error("Incorrect provide/inject config.");
|
|
269
|
+
const { t: g } = ae(), i = (b) => {
|
|
270
|
+
const v = p.fields?.[b]?.titleT;
|
|
271
|
+
return v ? g(v) : b;
|
|
272
|
+
}, n = S(() => {
|
|
273
|
+
const b = Object.keys(p.fields);
|
|
274
|
+
return Array.from(t.value).map(([v, C]) => ({
|
|
275
|
+
name: v,
|
|
276
|
+
title: i(v),
|
|
277
|
+
options: C
|
|
278
|
+
})).sort((v, C) => b.indexOf(v.name) - b.indexOf(C.name));
|
|
279
|
+
}), { clearOneFilterSelected: o, isClearable: c } = Pe(), d = (b, v) => {
|
|
280
|
+
o(b, v, l, p, t), p.touched = !0;
|
|
281
|
+
};
|
|
282
|
+
return (b, v) => (y(!0), V(X, null, oe(n.value, (C) => (y(), V("div", {
|
|
283
|
+
key: C.name,
|
|
284
|
+
class: "a-selected-filters"
|
|
285
|
+
}, [
|
|
286
|
+
I("div", Xt, P(C.title) + ": ", 1),
|
|
287
|
+
(y(!0), V(X, null, oe(C.options, (r) => (y(), V("div", {
|
|
288
|
+
key: r.value,
|
|
289
|
+
class: "a-selected-filters__chips"
|
|
290
|
+
}, [
|
|
291
|
+
f(c)(C.name, f(p)) ? (y(), B(Ee, {
|
|
292
|
+
key: 0,
|
|
293
|
+
closable: "",
|
|
294
|
+
size: "small",
|
|
295
|
+
class: "a-selected-filters__chip",
|
|
296
|
+
"onClick:close": R((e) => d(C.name, r.value), ["stop"])
|
|
297
|
+
}, {
|
|
298
|
+
close: u(() => [
|
|
299
|
+
m(Te, {
|
|
300
|
+
size: "16",
|
|
301
|
+
icon: "mdi-close-circle"
|
|
302
|
+
})
|
|
303
|
+
]),
|
|
304
|
+
default: u(() => [
|
|
305
|
+
U(" " + P(r.title), 1)
|
|
306
|
+
]),
|
|
307
|
+
_: 2
|
|
308
|
+
}, 1032, ["onClick:close"])) : (y(), B(Ee, {
|
|
309
|
+
key: 1,
|
|
310
|
+
size: "small",
|
|
311
|
+
class: "a-selected-filters__chip"
|
|
312
|
+
}, {
|
|
313
|
+
default: u(() => [
|
|
314
|
+
U(P(r.title), 1)
|
|
315
|
+
]),
|
|
316
|
+
_: 2
|
|
317
|
+
}, 1024))
|
|
318
|
+
]))), 128))
|
|
319
|
+
]))), 128));
|
|
320
|
+
}
|
|
321
|
+
}), ea = { class: "d-flex flex-wrap align-center" }, ta = { class: "a-filter__container" }, aa = { class: "a-filter__search" }, oa = { key: 2 }, Qa = /* @__PURE__ */ Z({
|
|
322
|
+
__name: "AFilterWrapper",
|
|
323
|
+
props: /* @__PURE__ */ ge({
|
|
324
|
+
enableTop: { type: Boolean, default: !1 },
|
|
325
|
+
hideButtons: { type: Boolean, default: !1 },
|
|
326
|
+
formName: { default: "search" },
|
|
327
|
+
userId: { default: void 0 },
|
|
328
|
+
client: { type: Function, default: void 0 },
|
|
329
|
+
store: { type: [Object, Boolean], default: !0 },
|
|
330
|
+
alwaysVisible: { type: Boolean, default: !1 },
|
|
331
|
+
hideMore: { type: Boolean, default: !1 }
|
|
332
|
+
}, {
|
|
333
|
+
datatableHiddenColumns: {
|
|
334
|
+
default: void 0,
|
|
335
|
+
required: !1
|
|
336
|
+
},
|
|
337
|
+
datatableHiddenColumnsModifiers: {},
|
|
338
|
+
showDetail: { type: Boolean, default: !1, required: !1 },
|
|
339
|
+
showDetailModifiers: {}
|
|
340
|
+
}),
|
|
341
|
+
emits: /* @__PURE__ */ ge(["submit", "reset", "bookmarkLoadAfter"], ["update:datatableHiddenColumns", "update:showDetail"]),
|
|
342
|
+
setup(a, { expose: p, emit: l }) {
|
|
343
|
+
const t = a, g = l, i = we(a, "datatableHiddenColumns"), n = we(a, "showDetail"), o = H(Fe), c = H(xe);
|
|
344
|
+
if (F(o) || F(c))
|
|
345
|
+
throw new Error("Incorrect provide/inject config.");
|
|
346
|
+
const d = O({
|
|
347
|
+
system: o.general.system,
|
|
348
|
+
subject: o.general.subject
|
|
349
|
+
});
|
|
350
|
+
fe(t.store) ? t.store === !1 && (d.value.system = void 0, d.value.subject = void 0) : (d.value.system = t.store.system, d.value.subject = t.store.subject);
|
|
351
|
+
const b = O(0);
|
|
352
|
+
$e(Ve, b);
|
|
353
|
+
const v = O(/* @__PURE__ */ new Map());
|
|
354
|
+
$e(ke, v);
|
|
355
|
+
const C = () => {
|
|
356
|
+
b.value++, me(() => {
|
|
357
|
+
g("submit");
|
|
358
|
+
});
|
|
359
|
+
}, { clearAll: r, clearAllFilterSelected: e } = Pe(), w = () => {
|
|
360
|
+
me(() => {
|
|
361
|
+
b.value++, g("bookmarkLoadAfter");
|
|
362
|
+
});
|
|
363
|
+
}, h = () => {
|
|
364
|
+
r(c, o), e(c, o, v), me(() => {
|
|
365
|
+
b.value++, g("reset");
|
|
366
|
+
});
|
|
367
|
+
}, s = () => {
|
|
368
|
+
n.value = !n.value;
|
|
369
|
+
}, D = S(() => o.touched), L = S(() => Object.entries(o.fields).filter(([, k]) => !k.render.skip).map(([k]) => k));
|
|
370
|
+
return t.alwaysVisible && (n.value = !0), p({
|
|
371
|
+
submit: C,
|
|
372
|
+
reset: h
|
|
373
|
+
}), (k, A) => (y(), B(qt, {
|
|
374
|
+
name: a.formName,
|
|
375
|
+
onSubmit: R(C, ["prevent"])
|
|
376
|
+
}, {
|
|
377
|
+
default: u(() => [
|
|
378
|
+
a.enableTop ? (y(), B(ie, {
|
|
379
|
+
key: 0,
|
|
380
|
+
dense: ""
|
|
381
|
+
}, {
|
|
382
|
+
default: u(() => [
|
|
383
|
+
m(te, null, {
|
|
384
|
+
default: u(() => [
|
|
385
|
+
E(k.$slots, "top")
|
|
386
|
+
]),
|
|
387
|
+
_: 3
|
|
388
|
+
})
|
|
389
|
+
]),
|
|
390
|
+
_: 3
|
|
391
|
+
})) : q("", !0),
|
|
392
|
+
m(ie, { dense: "" }, {
|
|
393
|
+
default: u(() => [
|
|
394
|
+
a.store && a.userId && f(Y)(a.client) ? (y(), B(te, { key: 0 }, {
|
|
395
|
+
default: u(() => [
|
|
396
|
+
E(k.$slots, "bookmarks", {}, () => [
|
|
397
|
+
I("div", ea, [
|
|
398
|
+
d.value.system && d.value.subject && a.userId && f(Y)(a.client) ? (y(), B(gt, {
|
|
399
|
+
key: 0,
|
|
400
|
+
"datatable-hidden-columns": i.value,
|
|
401
|
+
"onUpdate:datatableHiddenColumns": A[0] || (A[0] = (x) => i.value = x),
|
|
402
|
+
client: a.client,
|
|
403
|
+
system: d.value.system,
|
|
404
|
+
subject: d.value.subject,
|
|
405
|
+
"user-id": a.userId,
|
|
406
|
+
onSubmit: w
|
|
407
|
+
}, null, 8, ["datatable-hidden-columns", "client", "system", "subject", "user-id"])) : q("", !0)
|
|
408
|
+
])
|
|
409
|
+
])
|
|
410
|
+
]),
|
|
411
|
+
_: 3
|
|
412
|
+
})) : q("", !0)
|
|
413
|
+
]),
|
|
414
|
+
_: 3
|
|
415
|
+
}),
|
|
416
|
+
a.alwaysVisible ? q("", !0) : (y(), B(ie, {
|
|
417
|
+
key: 1,
|
|
418
|
+
dense: ""
|
|
419
|
+
}, {
|
|
420
|
+
default: u(() => [
|
|
421
|
+
a.hideMore ? q("", !0) : (y(), B(te, {
|
|
422
|
+
key: 0,
|
|
423
|
+
cols: "auto"
|
|
424
|
+
}, {
|
|
425
|
+
default: u(() => [
|
|
426
|
+
m(Gt, {
|
|
427
|
+
"button-active": n.value,
|
|
428
|
+
onAdvancedFilter: s
|
|
429
|
+
}, null, 8, ["button-active"])
|
|
430
|
+
]),
|
|
431
|
+
_: 1
|
|
432
|
+
})),
|
|
433
|
+
m(te, null, {
|
|
434
|
+
default: u(() => [
|
|
435
|
+
I("div", ta, [
|
|
436
|
+
I("div", aa, [
|
|
437
|
+
E(k.$slots, "search")
|
|
438
|
+
]),
|
|
439
|
+
m(Zt)
|
|
440
|
+
])
|
|
441
|
+
]),
|
|
442
|
+
_: 3
|
|
443
|
+
}),
|
|
444
|
+
a.hideButtons ? q("", !0) : (y(), B(te, {
|
|
445
|
+
key: 1,
|
|
446
|
+
class: "text-right",
|
|
447
|
+
cols: "auto"
|
|
448
|
+
}, {
|
|
449
|
+
default: u(() => [
|
|
450
|
+
E(k.$slots, "buttons", {}, () => [
|
|
451
|
+
m(bt, { touched: D.value }, null, 8, ["touched"]),
|
|
452
|
+
m(yt, { onReset: h }),
|
|
453
|
+
d.value.system && d.value.subject && a.userId && f(Y)(a.client) ? (y(), B(ht, {
|
|
454
|
+
key: 0,
|
|
455
|
+
client: a.client,
|
|
456
|
+
user: a.userId,
|
|
457
|
+
system: d.value.system,
|
|
458
|
+
subject: d.value.subject,
|
|
459
|
+
"datatable-hidden-columns": i.value
|
|
460
|
+
}, null, 8, ["client", "user", "system", "subject", "datatable-hidden-columns"])) : q("", !0)
|
|
461
|
+
])
|
|
462
|
+
]),
|
|
463
|
+
_: 3
|
|
464
|
+
}))
|
|
465
|
+
]),
|
|
466
|
+
_: 3
|
|
467
|
+
})),
|
|
468
|
+
a.hideMore ? q("", !0) : (y(), V("div", oa, [
|
|
469
|
+
(y(), B(Vt(a.alwaysVisible ? "div" : "VSlideYTransition"), null, {
|
|
470
|
+
default: u(() => [
|
|
471
|
+
st(I("div", {
|
|
472
|
+
class: be({ "mt-6 pa-4 system-border-a": !a.alwaysVisible })
|
|
473
|
+
}, [
|
|
474
|
+
E(k.$slots, "detail", {}, () => [
|
|
475
|
+
m(ie, null, {
|
|
476
|
+
default: u(() => [
|
|
477
|
+
(y(!0), V(X, null, oe(L.value, (x) => (y(), B(te, {
|
|
478
|
+
key: x,
|
|
479
|
+
cols: f(o).fields[x].render.xs || 12,
|
|
480
|
+
sm: f(o).fields[x].render.sm || 6,
|
|
481
|
+
md: f(o).fields[x].render.md || 4,
|
|
482
|
+
lg: f(o).fields[x].render.lg || 3,
|
|
483
|
+
xl: f(o).fields[x].render.xl || 2
|
|
484
|
+
}, {
|
|
485
|
+
default: u(() => [
|
|
486
|
+
E(k.$slots, f(Ct)(x), {
|
|
487
|
+
itemConfig: f(o).fields[x]
|
|
488
|
+
}, () => [
|
|
489
|
+
m(_t, { name: x }, null, 8, ["name"])
|
|
490
|
+
])
|
|
491
|
+
]),
|
|
492
|
+
_: 2
|
|
493
|
+
}, 1032, ["cols", "sm", "md", "lg", "xl"]))), 128))
|
|
494
|
+
]),
|
|
495
|
+
_: 3
|
|
496
|
+
})
|
|
497
|
+
])
|
|
498
|
+
], 2), [
|
|
499
|
+
[lt, n.value]
|
|
500
|
+
])
|
|
501
|
+
]),
|
|
502
|
+
_: 3
|
|
503
|
+
}))
|
|
504
|
+
]))
|
|
505
|
+
]),
|
|
506
|
+
_: 3
|
|
507
|
+
}, 8, ["name"]));
|
|
508
|
+
}
|
|
509
|
+
}), sa = { class: "d-flex align-center justify-center" }, la = { class: "text-caption mr-1" }, Ya = /* @__PURE__ */ Z({
|
|
510
|
+
__name: "ADatatableOrdering",
|
|
511
|
+
props: /* @__PURE__ */ ge({
|
|
512
|
+
variant: { default: "id" },
|
|
513
|
+
customOptions: { default: void 0 },
|
|
514
|
+
paginationUpdateCustomCb: { type: Function, default: void 0 }
|
|
515
|
+
}, {
|
|
516
|
+
modelValue: {
|
|
517
|
+
default: 1,
|
|
518
|
+
required: !1
|
|
519
|
+
},
|
|
520
|
+
modelModifiers: {}
|
|
521
|
+
}),
|
|
522
|
+
emits: /* @__PURE__ */ ge(["sortByChange"], ["update:modelValue"]),
|
|
523
|
+
setup(a, { emit: p }) {
|
|
524
|
+
const l = a, t = p, g = we(a, "modelValue"), i = H(Ue);
|
|
525
|
+
if (F(i))
|
|
526
|
+
throw new Error("Incorrect provide/inject config.");
|
|
527
|
+
const { t: n } = ae(), o = [
|
|
528
|
+
{ id: 1, titleT: "common.system.datatable.ordering.mostRecent", sortBy: { key: "createdAt", order: K.Desc } },
|
|
529
|
+
{ id: 2, titleT: "common.system.datatable.ordering.oldest", sortBy: { key: "createdAt", order: K.Asc } }
|
|
530
|
+
], c = [
|
|
531
|
+
{ id: 1, titleT: "common.system.datatable.ordering.mostRecent", sortBy: { key: "id", order: K.Desc } },
|
|
532
|
+
{ id: 2, titleT: "common.system.datatable.ordering.oldest", sortBy: { key: "id", order: K.Asc } }
|
|
533
|
+
], d = [
|
|
534
|
+
{
|
|
535
|
+
id: 3,
|
|
536
|
+
titleT: "common.system.datatable.ordering.mostRelevant",
|
|
537
|
+
sortBy: { key: At, order: K.Desc }
|
|
538
|
+
},
|
|
539
|
+
{ id: 1, titleT: "common.system.datatable.ordering.mostRecent", sortBy: { key: "createdAt", order: K.Desc } },
|
|
540
|
+
{ id: 2, titleT: "common.system.datatable.ordering.oldest", sortBy: { key: "createdAt", order: K.Asc } }
|
|
541
|
+
], b = S(() => {
|
|
542
|
+
const e = v.value.find((w) => w.id === g.value);
|
|
543
|
+
return e ? n(e.titleT) : "";
|
|
544
|
+
}), v = S(() => l.customOptions ? l.customOptions : l.variant === "most-relevant" ? d : l.variant === "id" ? c : o), C = (e) => {
|
|
545
|
+
g.value = e.id;
|
|
546
|
+
}, r = (e) => {
|
|
547
|
+
e.sortBy || (i.value = { ...i.value, sortBy: null, descending: !0 }, t("sortByChange", e)), i.value.sortBy = e.sortBy, t("sortByChange", e);
|
|
548
|
+
};
|
|
549
|
+
return G(
|
|
550
|
+
g,
|
|
551
|
+
(e, w) => {
|
|
552
|
+
if (e === w) return;
|
|
553
|
+
const h = v.value.find((s) => s.id === e);
|
|
554
|
+
if (!F(h)) {
|
|
555
|
+
if (F(l.paginationUpdateCustomCb)) {
|
|
556
|
+
r(h);
|
|
557
|
+
return;
|
|
558
|
+
}
|
|
559
|
+
l.paginationUpdateCustomCb(h, i);
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
), G(
|
|
563
|
+
i,
|
|
564
|
+
(e, w) => {
|
|
565
|
+
if (e.sortBy?.key === w?.sortBy?.key && e.sortBy?.order === w?.sortBy?.order)
|
|
566
|
+
return;
|
|
567
|
+
const h = v.value.find((s) => e.sortBy?.key === s.sortBy?.key && e.sortBy?.order === s.sortBy?.order);
|
|
568
|
+
F(h) || (g.value = h.id);
|
|
569
|
+
},
|
|
570
|
+
{ immediate: !0 }
|
|
571
|
+
), (e, w) => (y(), V("div", sa, [
|
|
572
|
+
I("div", la, P(f(n)("common.system.datatable.ordering.title")) + ": ", 1),
|
|
573
|
+
m(W, {
|
|
574
|
+
variant: "text",
|
|
575
|
+
rounded: "xl",
|
|
576
|
+
size: "small",
|
|
577
|
+
"append-icon": "mdi-chevron-down"
|
|
578
|
+
}, {
|
|
579
|
+
default: u(() => [
|
|
580
|
+
U(P(b.value) + " ", 1),
|
|
581
|
+
m(Ht, {
|
|
582
|
+
activator: "parent",
|
|
583
|
+
location: "bottom",
|
|
584
|
+
"close-on-content-click": ""
|
|
585
|
+
}, {
|
|
586
|
+
default: u(() => [
|
|
587
|
+
m(Lt, {
|
|
588
|
+
density: "compact",
|
|
589
|
+
class: "pa-0"
|
|
590
|
+
}, {
|
|
591
|
+
default: u(() => [
|
|
592
|
+
(y(!0), V(X, null, oe(v.value, (h) => (y(), B(ut, {
|
|
593
|
+
key: h.id,
|
|
594
|
+
onClick: (s) => C(h)
|
|
595
|
+
}, {
|
|
596
|
+
default: u(() => [
|
|
597
|
+
m(Nt, {
|
|
598
|
+
class: be({ "font-weight-bold": h.id === g.value })
|
|
599
|
+
}, {
|
|
600
|
+
default: u(() => [
|
|
601
|
+
U(P(f(n)(h.titleT)), 1)
|
|
602
|
+
]),
|
|
603
|
+
_: 2
|
|
604
|
+
}, 1032, ["class"])
|
|
605
|
+
]),
|
|
606
|
+
_: 2
|
|
607
|
+
}, 1032, ["onClick"]))), 128))
|
|
608
|
+
]),
|
|
609
|
+
_: 1
|
|
610
|
+
})
|
|
611
|
+
]),
|
|
612
|
+
_: 1
|
|
613
|
+
})
|
|
614
|
+
]),
|
|
615
|
+
_: 1
|
|
616
|
+
})
|
|
617
|
+
]));
|
|
618
|
+
}
|
|
619
|
+
}), na = { class: "anzu-data-footer" }, ra = {
|
|
620
|
+
key: 0,
|
|
621
|
+
class: "anzu-data-footer__page-limit"
|
|
622
|
+
}, ia = { class: "anzu-data-footer__pagination" }, ua = { class: "anzu-data-footer__icons-before" }, ca = { class: "current-page" }, da = { class: "anzu-data-footer__icons-after" }, ma = /* @__PURE__ */ Z({
|
|
623
|
+
__name: "ADatatablePagination",
|
|
624
|
+
props: {
|
|
625
|
+
itemsPerPageOptions: { default: () => [10, 25, 50] },
|
|
626
|
+
hideRecordsPerPage: { type: Boolean, default: !1 }
|
|
627
|
+
},
|
|
628
|
+
emits: ["change"],
|
|
629
|
+
setup(a, { emit: p }) {
|
|
630
|
+
const l = p, t = H(Ue);
|
|
631
|
+
if (F(t))
|
|
632
|
+
throw new Error("Incorrect provide/inject config.");
|
|
633
|
+
const { t: g } = ae(), i = S(() => Math.ceil(t.value.totalCount / t.value.rowsPerPage)), n = S(() => t.value.page * t.value.rowsPerPage - t.value.rowsPerPage + 1), o = S(() => t.value.page * t.value.rowsPerPage - t.value.rowsPerPage + t.value.currentViewCount), c = S(() => t.value.page === 1), d = S(() => !Q(t.value.hasNextPage) || t.value.page === i.value), b = S(() => Q(t.value.hasNextPage) && t.value.page === i.value || t.value.hasNextPage === !1), v = S(() => Q(t.value.hasNextPage) ? t.value.totalCount : t.value.hasNextPage ? o.value + 1 + "+" : o.value);
|
|
634
|
+
G(
|
|
635
|
+
() => t.value.rowsPerPage,
|
|
636
|
+
(h, s) => {
|
|
637
|
+
h !== s && (t.value.page = 1, l("change"));
|
|
638
|
+
}
|
|
639
|
+
), G(
|
|
640
|
+
() => t.value.page,
|
|
641
|
+
(h, s) => {
|
|
642
|
+
h !== s && l("change");
|
|
643
|
+
}
|
|
644
|
+
);
|
|
645
|
+
const C = ue(() => {
|
|
646
|
+
t.value.page = 1;
|
|
647
|
+
}, 300), r = ue(() => {
|
|
648
|
+
t.value.page = i.value;
|
|
649
|
+
}, 300), e = ue(() => {
|
|
650
|
+
t.value.page = t.value.page - 1;
|
|
651
|
+
}, 300), w = ue(() => {
|
|
652
|
+
t.value.page = t.value.page + 1;
|
|
653
|
+
}, 300);
|
|
654
|
+
return (h, s) => (y(), V("div", na, [
|
|
655
|
+
a.hideRecordsPerPage ? q("", !0) : (y(), V("div", ra, [
|
|
656
|
+
U(P(f(g)("common.system.datatable.itemsPerPage")) + ": ", 1),
|
|
657
|
+
m(Kt, {
|
|
658
|
+
modelValue: f(t).rowsPerPage,
|
|
659
|
+
"onUpdate:modelValue": s[0] || (s[0] = (D) => f(t).rowsPerPage = D),
|
|
660
|
+
class: "ml-2",
|
|
661
|
+
density: "compact",
|
|
662
|
+
mandatory: "",
|
|
663
|
+
"data-cy": "table-size"
|
|
664
|
+
}, {
|
|
665
|
+
default: u(() => [
|
|
666
|
+
(y(!0), V(X, null, oe(a.itemsPerPageOptions, (D) => (y(), B(W, {
|
|
667
|
+
key: D,
|
|
668
|
+
color: D === f(t).rowsPerPage ? "secondary" : "",
|
|
669
|
+
value: D,
|
|
670
|
+
density: "compact",
|
|
671
|
+
size: "small",
|
|
672
|
+
variant: "text"
|
|
673
|
+
}, {
|
|
674
|
+
default: u(() => [
|
|
675
|
+
U(P(D), 1)
|
|
676
|
+
]),
|
|
677
|
+
_: 2
|
|
678
|
+
}, 1032, ["color", "value"]))), 128))
|
|
679
|
+
]),
|
|
680
|
+
_: 1
|
|
681
|
+
}, 8, ["modelValue"])
|
|
682
|
+
])),
|
|
683
|
+
I("div", ia, P(n.value) + " - " + P(o.value) + " " + P(f(g)("common.system.datatable.from")) + " " + P(v.value), 1),
|
|
684
|
+
I("div", ua, [
|
|
685
|
+
m(W, {
|
|
686
|
+
disabled: c.value,
|
|
687
|
+
icon: "mdi-page-first",
|
|
688
|
+
size: "small",
|
|
689
|
+
variant: "text",
|
|
690
|
+
onClick: R(f(C), ["stop"])
|
|
691
|
+
}, null, 8, ["disabled", "onClick"]),
|
|
692
|
+
m(W, {
|
|
693
|
+
disabled: c.value,
|
|
694
|
+
icon: "mdi-chevron-left",
|
|
695
|
+
size: "small",
|
|
696
|
+
variant: "text",
|
|
697
|
+
onClick: R(f(e), ["stop"])
|
|
698
|
+
}, null, 8, ["disabled", "onClick"])
|
|
699
|
+
]),
|
|
700
|
+
I("div", ca, [
|
|
701
|
+
I("span", null, P(f(t).page), 1)
|
|
702
|
+
]),
|
|
703
|
+
I("div", da, [
|
|
704
|
+
m(W, {
|
|
705
|
+
disabled: b.value,
|
|
706
|
+
icon: "mdi-chevron-right",
|
|
707
|
+
size: "small",
|
|
708
|
+
variant: "text",
|
|
709
|
+
onClick: R(f(w), ["stop"])
|
|
710
|
+
}, null, 8, ["disabled", "onClick"]),
|
|
711
|
+
m(W, {
|
|
712
|
+
disabled: d.value,
|
|
713
|
+
icon: "mdi-page-last",
|
|
714
|
+
size: "small",
|
|
715
|
+
variant: "text",
|
|
716
|
+
onClick: R(f(r), ["stop"])
|
|
717
|
+
}, null, 8, ["disabled", "onClick"])
|
|
718
|
+
])
|
|
719
|
+
]));
|
|
720
|
+
}
|
|
721
|
+
}), fa = (a, p, l = "id") => {
|
|
722
|
+
const { querySetLimit: t, querySetOffset: g, querySetOrder: i, queryBuild: n, queryAddFilter: o, queryAdd: c } = wt(), d = a.length;
|
|
723
|
+
return t(d), g(1, d), i(l, !1), p ? c(l, a.join(",")) : o("in", l, a.join(",")), n();
|
|
724
|
+
}, Ga = (a, p, l, t = void 0, g = void 0, i = {}, n = !1, o = "id") => {
|
|
725
|
+
let c = null;
|
|
726
|
+
return {
|
|
727
|
+
executeFetch: async (v, C = void 0, r = void 0) => {
|
|
728
|
+
c = new AbortController();
|
|
729
|
+
try {
|
|
730
|
+
const e = Y(r) ? r : g, w = Y(C) ? C : t;
|
|
731
|
+
if (F(w)) throw new Error("Url template is undefined");
|
|
732
|
+
const h = (F(e) ? w : Le(w, e)) + fa(v, n, o), s = await a().get(h, {
|
|
733
|
+
...i,
|
|
734
|
+
signal: c.signal
|
|
735
|
+
});
|
|
736
|
+
if (!Ne(s.status))
|
|
737
|
+
throw new ze(s.status);
|
|
738
|
+
if (s.data?.data)
|
|
739
|
+
return s.data.data;
|
|
740
|
+
if (s.status === Me)
|
|
741
|
+
return [];
|
|
742
|
+
throw new ve();
|
|
743
|
+
} catch (e) {
|
|
744
|
+
if (e instanceof DOMException && e.name === "AbortError")
|
|
745
|
+
return [];
|
|
746
|
+
throw qe(e) ? e : He(e) ? new Je(e, e.config?.url) : Ke(e) ? new We(e, p, l, e) : Qe(e) ? new Ye(e, p, l, e) : Ge(e) ? new Xe(e, e) : Ze(e) ? new et(e) : dt.isAxiosError(e) ? (console.error("Axios error: " + t, e.cause), new tt(e)) : (console.error("AnzuFatalError: ", e), new ve(e));
|
|
747
|
+
} finally {
|
|
748
|
+
c = null;
|
|
749
|
+
}
|
|
750
|
+
},
|
|
751
|
+
abortFetch: () => {
|
|
752
|
+
c && c.abort();
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
}, Xa = (a, p, l, t = void 0, g = void 0, i = {}) => {
|
|
756
|
+
let n = null;
|
|
757
|
+
return {
|
|
758
|
+
executeFetch: async (d, b, v = void 0, C = void 0, r = "id", e = !0, w = 100, h = !1) => {
|
|
759
|
+
n = new AbortController();
|
|
760
|
+
try {
|
|
761
|
+
const s = b.general.elastic || h ? "/search" : "", D = Y(C) ? C : g, L = Y(v) ? v : t;
|
|
762
|
+
if (F(L)) throw new Error("Url template is undefined");
|
|
763
|
+
const { pagination: k } = at(r, e ? K.Desc : K.Asc, {
|
|
764
|
+
rowsPerPage: w
|
|
765
|
+
}), A = (F(D) ? L : Le(L, D)) + s, x = [], N = await a().get(A + _e(k, d, b), {
|
|
766
|
+
...i,
|
|
767
|
+
signal: n.signal
|
|
768
|
+
});
|
|
769
|
+
if (!Ne(N.status))
|
|
770
|
+
throw new ze(N.status);
|
|
771
|
+
if (N.data) {
|
|
772
|
+
const M = N.data;
|
|
773
|
+
if (x.push(...M.data), kt(M))
|
|
774
|
+
for (k.value.hasNextPage = M.hasNextPage; k.value.hasNextPage; ) {
|
|
775
|
+
k.value.page++;
|
|
776
|
+
const J = (await a().get(A + _e(k, d, b), {
|
|
777
|
+
...i,
|
|
778
|
+
signal: n.signal
|
|
779
|
+
})).data;
|
|
780
|
+
x.push(...J.data), k.value.hasNextPage = J.hasNextPage;
|
|
781
|
+
}
|
|
782
|
+
else if (Ft(M)) {
|
|
783
|
+
if (k.value.totalCount = M.totalCount, k.value.totalCount <= k.value.rowsPerPage)
|
|
784
|
+
return x;
|
|
785
|
+
const z = [], J = Math.ceil(k.value.totalCount / k.value.rowsPerPage);
|
|
786
|
+
for (let _ = 1; _ < J; _++) {
|
|
787
|
+
const T = { ...k.value, page: _ + 1 }, j = O(T);
|
|
788
|
+
z.push(
|
|
789
|
+
a().get(A + _e(j, d, b), {
|
|
790
|
+
...i,
|
|
791
|
+
signal: n.signal
|
|
792
|
+
})
|
|
793
|
+
);
|
|
794
|
+
}
|
|
795
|
+
(await Promise.all(z)).forEach((_) => {
|
|
796
|
+
x.push(..._.data.data);
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
return x;
|
|
800
|
+
}
|
|
801
|
+
if (N.status === Me)
|
|
802
|
+
return [];
|
|
803
|
+
throw new ve();
|
|
804
|
+
} catch (s) {
|
|
805
|
+
if (s instanceof DOMException && s.name === "AbortError")
|
|
806
|
+
return [];
|
|
807
|
+
throw qe(s) ? s : He(s) ? new Je(s, s.config?.url) : Ke(s) ? new We(s, p, l, s) : Qe(s) ? new Ye(s, p, l, s) : Ge(s) ? new Xe(s, s) : Ze(s) ? new et(s) : dt.isAxiosError(s) ? (console.error("Axios error: " + t, s.cause), new tt(s)) : (console.error("AnzuFatalError: ", s), new ve(s));
|
|
808
|
+
} finally {
|
|
809
|
+
n = null;
|
|
810
|
+
}
|
|
811
|
+
},
|
|
812
|
+
abortFetch: () => {
|
|
813
|
+
n && n.abort();
|
|
814
|
+
}
|
|
815
|
+
};
|
|
816
|
+
}, ce = "/adm/v1/job", de = "job";
|
|
817
|
+
function Za(a, p) {
|
|
818
|
+
return {
|
|
819
|
+
useFetchJobList: () => Tt(a, p, de, ce),
|
|
820
|
+
fetchJob: (n) => Pt(a, ce + "/:id", { id: n }, p, de),
|
|
821
|
+
createJob: (n) => {
|
|
822
|
+
const o = St(n._resourceName).slice(4).replace("-kind-", "-kind/");
|
|
823
|
+
return Bt(a, n, ce + "/:type", { type: o }, p, de);
|
|
824
|
+
},
|
|
825
|
+
deleteJob: (n) => xt(a, ce + "/:id", { id: n }, p, de)
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
const va = {
|
|
829
|
+
key: "",
|
|
830
|
+
title: void 0,
|
|
831
|
+
sortable: !1,
|
|
832
|
+
fixed: !1
|
|
833
|
+
}, pa = {
|
|
834
|
+
storeColumnsLocalStorage: !0,
|
|
835
|
+
disableActions: !1,
|
|
836
|
+
customI18n: void 0,
|
|
837
|
+
showExpand: !1
|
|
838
|
+
};
|
|
839
|
+
function ga(a, p, l, t, g = {}) {
|
|
840
|
+
const i = { ...pa, ...g }, n = i.customI18n ?? It, { t: o } = n.global || n;
|
|
841
|
+
let c;
|
|
842
|
+
jt(i.storeColumnsLocalStorage) ? c = i.storeColumnsLocalStorage : fe(i.storeColumnsLocalStorage) && i.storeColumnsLocalStorage === !0 && (c = "table_" + l + "_" + t);
|
|
843
|
+
const d = a.map((r) => {
|
|
844
|
+
const e = { ...va, ...r };
|
|
845
|
+
return F(e.title) && (F(e.title) && Dt.includes(e.key) ? e.title = o("common.model.tracking." + e.key) : F(e.title) && l && t ? e.title = o(l + "." + t + ".model." + e.key) : e.title = ""), e;
|
|
846
|
+
}), b = S(() => {
|
|
847
|
+
const r = [];
|
|
848
|
+
return i.showExpand && r.push({ key: "data-table-expand", sortable: !1 }), d.forEach((e) => {
|
|
849
|
+
p.value.includes(e.key) || r.push(e);
|
|
850
|
+
}), i.disableActions || r.push({ key: "actions", sortable: !1, fixed: "end" }), r;
|
|
851
|
+
}), v = () => {
|
|
852
|
+
if (!c || !localStorage) return;
|
|
853
|
+
const r = localStorage.getItem(c);
|
|
854
|
+
if (!r) return;
|
|
855
|
+
const e = JSON.parse(r);
|
|
856
|
+
$t(e) && Ae(e.hidden) && (p.value = e.hidden);
|
|
857
|
+
}, C = (r) => {
|
|
858
|
+
!c || !localStorage || localStorage.setItem(c, JSON.stringify({ hidden: r }));
|
|
859
|
+
};
|
|
860
|
+
return Ot(() => {
|
|
861
|
+
v();
|
|
862
|
+
}), G(p, (r) => {
|
|
863
|
+
C(r);
|
|
864
|
+
}), {
|
|
865
|
+
columnsAll: d,
|
|
866
|
+
columnsVisible: b,
|
|
867
|
+
columnsHidden: p
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
function eo(a, p, l, t, g, i, n, o = null, c = void 0, d = void 0, b = !1, v = !1) {
|
|
871
|
+
const C = O(!1), r = O([]), e = O([]), w = O(!1), { pagination: h, setSortBy: s, incrementPage: D } = at(
|
|
872
|
+
Q(o) ? null : o.key,
|
|
873
|
+
o?.order
|
|
874
|
+
), { resetFilter: L, submitFilter: k } = Et(i, n, {
|
|
875
|
+
storeFiltersLocalStorage: !1,
|
|
876
|
+
populateUrlParams: !1
|
|
877
|
+
}), { showErrorsDefault: A } = Oe(), { columnsVisible: x, columnsAll: N, columnsHidden: M } = ga(
|
|
878
|
+
a,
|
|
879
|
+
p,
|
|
880
|
+
l,
|
|
881
|
+
t,
|
|
882
|
+
{ storeColumnsLocalStorage: !1, disableActions: !v }
|
|
883
|
+
), z = () => {
|
|
884
|
+
_(), j();
|
|
885
|
+
}, J = ($) => {
|
|
886
|
+
s($.sortBy), j();
|
|
887
|
+
}, se = async () => {
|
|
888
|
+
w.value = !0, D();
|
|
889
|
+
try {
|
|
890
|
+
const $ = await g(
|
|
891
|
+
h,
|
|
892
|
+
i,
|
|
893
|
+
n,
|
|
894
|
+
c,
|
|
895
|
+
d,
|
|
896
|
+
b
|
|
897
|
+
);
|
|
898
|
+
r.value.push(...$);
|
|
899
|
+
} catch ($) {
|
|
900
|
+
A($);
|
|
901
|
+
} finally {
|
|
902
|
+
w.value = !1;
|
|
903
|
+
}
|
|
904
|
+
}, _ = () => {
|
|
905
|
+
r.value = [], e.value = [];
|
|
906
|
+
}, T = async () => {
|
|
907
|
+
w.value = !0;
|
|
908
|
+
try {
|
|
909
|
+
r.value = await g(
|
|
910
|
+
h,
|
|
911
|
+
i,
|
|
912
|
+
n,
|
|
913
|
+
c,
|
|
914
|
+
d,
|
|
915
|
+
b
|
|
916
|
+
);
|
|
917
|
+
} catch ($) {
|
|
918
|
+
A($);
|
|
919
|
+
} finally {
|
|
920
|
+
w.value = !1;
|
|
921
|
+
}
|
|
922
|
+
}, j = Jt(async () => {
|
|
923
|
+
await T();
|
|
924
|
+
});
|
|
925
|
+
return {
|
|
926
|
+
items: r,
|
|
927
|
+
selected: e,
|
|
928
|
+
pagination: h,
|
|
929
|
+
columnsVisible: x,
|
|
930
|
+
columnsHidden: M,
|
|
931
|
+
columnsAll: N,
|
|
932
|
+
filterTouched: C,
|
|
933
|
+
loading: w,
|
|
934
|
+
onRowClick: ($) => {
|
|
935
|
+
const ee = $.target;
|
|
936
|
+
if (!ee || ee.tagName === "INPUT" && ee.type === "checkbox")
|
|
937
|
+
return;
|
|
938
|
+
const ne = ee.closest(".v-data-table__tr");
|
|
939
|
+
if (!ne || !ne.classList.contains("v-data-table__tr")) return;
|
|
940
|
+
const ye = ne.firstElementChild;
|
|
941
|
+
if (!ye || !ye.classList.contains("v-data-table__td")) return;
|
|
942
|
+
const Se = ye.querySelector("input");
|
|
943
|
+
Se && Se.click();
|
|
944
|
+
},
|
|
945
|
+
onFetchNextPage: se,
|
|
946
|
+
onOpen: z,
|
|
947
|
+
sortByChange: J,
|
|
948
|
+
getList: j,
|
|
949
|
+
resetFilter: () => L(h, j),
|
|
950
|
+
submitFilter: () => k(h, j)
|
|
951
|
+
};
|
|
952
|
+
}
|
|
953
|
+
const ba = { class: "d-flex flex-column w-100 px-1 align-center" }, ya = { class: "d-flex justify-space-between w-100 align-center" }, ha = { class: "d-flex align-center" }, Ca = { class: "d-flex align-center" }, _a = { class: "subject-select__sidebar system-border-r" }, Aa = { class: "subject-select-filter" }, wa = { class: "subject-select__content" }, ka = {
|
|
954
|
+
key: 0,
|
|
955
|
+
class: "d-flex w-100 align-center justify-center pa-4"
|
|
956
|
+
}, Fa = { class: "subject-select__actions system-border-t" }, xa = { key: 0 }, Pa = { key: 1 }, to = /* @__PURE__ */ Z({
|
|
957
|
+
__name: "ASubjectSelect",
|
|
958
|
+
props: {
|
|
959
|
+
selectedItems: {},
|
|
960
|
+
pagination: {},
|
|
961
|
+
loading: { type: Boolean, default: !1 },
|
|
962
|
+
minCount: { default: 1 },
|
|
963
|
+
maxCount: { default: 1 },
|
|
964
|
+
modelValue: { type: Boolean, default: void 0 },
|
|
965
|
+
dialogTitleT: { default: "common.subjectSelect.texts.title" },
|
|
966
|
+
paginationMode: { default: "standard" }
|
|
967
|
+
},
|
|
968
|
+
emits: ["update:modelValue", "update:pagination", "onOpen", "onPageChange", "onConfirm", "onFetchNextPage"],
|
|
969
|
+
setup(a, { expose: p, emit: l }) {
|
|
970
|
+
const t = a, g = l, i = O(!1), n = S({
|
|
971
|
+
get() {
|
|
972
|
+
return F(t.modelValue) ? i.value : t.modelValue;
|
|
973
|
+
},
|
|
974
|
+
set(A) {
|
|
975
|
+
i.value = A, g("update:modelValue", A);
|
|
976
|
+
}
|
|
977
|
+
}), o = S({
|
|
978
|
+
get: () => t.pagination,
|
|
979
|
+
set: (A) => {
|
|
980
|
+
g("update:pagination", { ...je(A) });
|
|
981
|
+
}
|
|
982
|
+
}), c = O(!0), { t: d } = ae(), b = S(() => t.selectedItems.length), v = S(() => b.value < t.minCount || b.value > t.maxCount), C = () => {
|
|
983
|
+
g("onOpen"), c.value = !0, n.value = !0;
|
|
984
|
+
}, r = () => {
|
|
985
|
+
c.value = !c.value;
|
|
986
|
+
}, e = () => {
|
|
987
|
+
n.value = !1;
|
|
988
|
+
}, w = () => {
|
|
989
|
+
g(
|
|
990
|
+
"onConfirm",
|
|
991
|
+
t.selectedItems.map((A) => je(A))
|
|
992
|
+
), e();
|
|
993
|
+
}, h = () => {
|
|
994
|
+
g("onFetchNextPage");
|
|
995
|
+
}, s = () => {
|
|
996
|
+
g("onPageChange");
|
|
997
|
+
}, D = S(() => Math.ceil(o.value.totalCount / o.value.rowsPerPage)), L = S(() => !(Q(o.value.hasNextPage) && o.value.page === D.value || o.value.hasNextPage === !1)), k = (A) => {
|
|
998
|
+
A && L.value && !t.loading && h();
|
|
999
|
+
};
|
|
1000
|
+
return p({
|
|
1001
|
+
open: C
|
|
1002
|
+
}), (A, x) => {
|
|
1003
|
+
const N = pe("ABtnSecondary"), M = pe("ABtnPrimary");
|
|
1004
|
+
return y(), V(X, null, [
|
|
1005
|
+
E(A.$slots, "activator", {
|
|
1006
|
+
props: { onClick: R(() => C(), ["stop"]) }
|
|
1007
|
+
}),
|
|
1008
|
+
m(rt, ot(A.$attrs, {
|
|
1009
|
+
"model-value": n.value,
|
|
1010
|
+
fullscreen: "",
|
|
1011
|
+
class: "subject-select",
|
|
1012
|
+
"onUpdate:modelValue": x[1] || (x[1] = (z) => g("update:modelValue", z))
|
|
1013
|
+
}), {
|
|
1014
|
+
default: u(() => [
|
|
1015
|
+
n.value ? (y(), B(nt, {
|
|
1016
|
+
key: 0,
|
|
1017
|
+
class: "subject-select__card"
|
|
1018
|
+
}, {
|
|
1019
|
+
default: u(() => [
|
|
1020
|
+
m(Re, {
|
|
1021
|
+
class: "subject-select__toolbar system-border-b",
|
|
1022
|
+
onOnCancel: e
|
|
1023
|
+
}, {
|
|
1024
|
+
default: u(() => [
|
|
1025
|
+
E(A.$slots, "title", {}, () => [
|
|
1026
|
+
U(P(f(d)(a.dialogTitleT)), 1)
|
|
1027
|
+
])
|
|
1028
|
+
]),
|
|
1029
|
+
_: 3
|
|
1030
|
+
}),
|
|
1031
|
+
m(Wt, {
|
|
1032
|
+
density: "compact",
|
|
1033
|
+
color: "transparent",
|
|
1034
|
+
height: 46,
|
|
1035
|
+
elevation: "0",
|
|
1036
|
+
class: "system-border-b subject-select__second-bar"
|
|
1037
|
+
}, {
|
|
1038
|
+
default: u(() => [
|
|
1039
|
+
E(A.$slots, "second-bar", {}, () => [
|
|
1040
|
+
I("div", ba, [
|
|
1041
|
+
I("div", ya, [
|
|
1042
|
+
I("div", ha, [
|
|
1043
|
+
m(W, {
|
|
1044
|
+
icon: "",
|
|
1045
|
+
width: 30,
|
|
1046
|
+
height: 30,
|
|
1047
|
+
onClick: r
|
|
1048
|
+
}, {
|
|
1049
|
+
default: u(() => [
|
|
1050
|
+
m(Te, {
|
|
1051
|
+
icon: "mdi-tune",
|
|
1052
|
+
size: 16
|
|
1053
|
+
}),
|
|
1054
|
+
m(ct, {
|
|
1055
|
+
activator: "parent",
|
|
1056
|
+
location: "bottom"
|
|
1057
|
+
}, {
|
|
1058
|
+
default: u(() => [
|
|
1059
|
+
U(P(f(d)("common.subjectSelect.filter.toggle")), 1)
|
|
1060
|
+
]),
|
|
1061
|
+
_: 1
|
|
1062
|
+
})
|
|
1063
|
+
]),
|
|
1064
|
+
_: 1
|
|
1065
|
+
}),
|
|
1066
|
+
E(A.$slots, "second-bar-left")
|
|
1067
|
+
]),
|
|
1068
|
+
I("div", Ca, [
|
|
1069
|
+
E(A.$slots, "second-bar-right")
|
|
1070
|
+
])
|
|
1071
|
+
])
|
|
1072
|
+
])
|
|
1073
|
+
])
|
|
1074
|
+
]),
|
|
1075
|
+
_: 3
|
|
1076
|
+
}),
|
|
1077
|
+
I("div", {
|
|
1078
|
+
class: be(["subject-select__main", { "subject-select__main--sidebar-active": c.value }])
|
|
1079
|
+
}, [
|
|
1080
|
+
I("div", _a, [
|
|
1081
|
+
I("div", Aa, [
|
|
1082
|
+
E(A.$slots, "filter")
|
|
1083
|
+
])
|
|
1084
|
+
]),
|
|
1085
|
+
I("div", wa, [
|
|
1086
|
+
E(A.$slots, "content"),
|
|
1087
|
+
a.paginationMode === "more" ? (y(), V("div", ka, [
|
|
1088
|
+
st((y(), B(N, {
|
|
1089
|
+
loading: a.loading,
|
|
1090
|
+
size: "small",
|
|
1091
|
+
onClick: h
|
|
1092
|
+
}, {
|
|
1093
|
+
default: u(() => [
|
|
1094
|
+
E(A.$slots, "button-confirm-title", {}, () => [
|
|
1095
|
+
U(P(f(d)("common.button.loadMore")), 1)
|
|
1096
|
+
])
|
|
1097
|
+
]),
|
|
1098
|
+
_: 3
|
|
1099
|
+
}, 8, ["loading"])), [
|
|
1100
|
+
[lt, L.value || a.loading],
|
|
1101
|
+
[
|
|
1102
|
+
Qt,
|
|
1103
|
+
k,
|
|
1104
|
+
void 0,
|
|
1105
|
+
{ quiet: !0 }
|
|
1106
|
+
]
|
|
1107
|
+
])
|
|
1108
|
+
])) : (y(), B(ma, {
|
|
1109
|
+
key: 1,
|
|
1110
|
+
modelValue: o.value,
|
|
1111
|
+
"onUpdate:modelValue": x[0] || (x[0] = (z) => o.value = z),
|
|
1112
|
+
onChange: s
|
|
1113
|
+
}, null, 8, ["modelValue"]))
|
|
1114
|
+
])
|
|
1115
|
+
], 2),
|
|
1116
|
+
I("div", Fa, [
|
|
1117
|
+
a.minCount === a.maxCount ? (y(), V("div", xa, P(f(d)("common.subjectSelect.texts.pickExactCount", { count: a.minCount, selected: b.value })), 1)) : (y(), V("div", Pa, P(f(d)("common.subjectSelect.texts.pickRangeCount", {
|
|
1118
|
+
minCount: a.minCount,
|
|
1119
|
+
maxCount: a.maxCount,
|
|
1120
|
+
selected: b.value
|
|
1121
|
+
})), 1)),
|
|
1122
|
+
m(it),
|
|
1123
|
+
m(M, {
|
|
1124
|
+
disabled: v.value,
|
|
1125
|
+
onClick: R(w, ["stop"])
|
|
1126
|
+
}, {
|
|
1127
|
+
default: u(() => [
|
|
1128
|
+
E(A.$slots, "button-confirm-title", {}, () => [
|
|
1129
|
+
U(P(f(d)("common.button.confirm")), 1)
|
|
1130
|
+
])
|
|
1131
|
+
]),
|
|
1132
|
+
_: 3
|
|
1133
|
+
}, 8, ["disabled"])
|
|
1134
|
+
])
|
|
1135
|
+
]),
|
|
1136
|
+
_: 3
|
|
1137
|
+
})) : q("", !0)
|
|
1138
|
+
]),
|
|
1139
|
+
_: 3
|
|
1140
|
+
}, 16, ["model-value"])
|
|
1141
|
+
], 64);
|
|
1142
|
+
};
|
|
1143
|
+
}
|
|
1144
|
+
});
|
|
1145
|
+
export {
|
|
1146
|
+
Ya as ADatatableOrdering,
|
|
1147
|
+
ma as ADatatablePagination,
|
|
1148
|
+
so as AFilterBooleanSelect,
|
|
1149
|
+
lo as AFilterDatetimePicker,
|
|
1150
|
+
no as AFilterInteger,
|
|
1151
|
+
ro as AFilterRemoteAutocomplete,
|
|
1152
|
+
io as AFilterRemoteAutocompleteWithMinimal,
|
|
1153
|
+
uo as AFilterString,
|
|
1154
|
+
Wa as AFilterTimeInterval,
|
|
1155
|
+
co as AFilterValueObjectOptionsSelect,
|
|
1156
|
+
Qa as AFilterWrapper,
|
|
1157
|
+
mo as AFilterWrapperSubjectSelect,
|
|
1158
|
+
fo as AFormRemoteAutocomplete,
|
|
1159
|
+
to as ASubjectSelect,
|
|
1160
|
+
Ue as DatatablePaginationKey,
|
|
1161
|
+
Fe as FilterConfigKey,
|
|
1162
|
+
xe as FilterDataKey,
|
|
1163
|
+
vo as FilterInnerConfigKey,
|
|
1164
|
+
po as FilterInnerDataKey,
|
|
1165
|
+
Ce as TimeIntervalSpecialOptions,
|
|
1166
|
+
go as UserAdminConfigLayoutType,
|
|
1167
|
+
bo as UserAdminConfigLayoutTypeDefault,
|
|
1168
|
+
yo as UserAdminConfigType,
|
|
1169
|
+
ho as UserAdminConfigTypeDefault,
|
|
1170
|
+
ga as createDatatableColumnsConfig,
|
|
1171
|
+
Co as createFilter,
|
|
1172
|
+
_o as createFilterStore,
|
|
1173
|
+
_e as generateListQuery,
|
|
1174
|
+
Ga as useApiFetchByIds,
|
|
1175
|
+
Tt as useApiFetchList,
|
|
1176
|
+
Xa as useApiFetchListBatch,
|
|
1177
|
+
wt as useApiQueryBuilder,
|
|
1178
|
+
Ao as useApiRequest,
|
|
1179
|
+
Et as useFilterHelpers,
|
|
1180
|
+
Za as useJobApi,
|
|
1181
|
+
at as usePagination,
|
|
1182
|
+
eo as useSubjectSelect,
|
|
1183
|
+
wo as useUserAdminConfigApi,
|
|
1184
|
+
ko as useUserAdminConfigFactory
|
|
1185
|
+
};
|
|
1186
|
+
//# sourceMappingURL=labs.js.map
|