@anzusystems/common-admin 1.47.0-beta.98 → 1.47.0-beta.dev-1771794052
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-DWMjveFQ.mjs +7280 -0
- package/dist/AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-DWMjveFQ.mjs.map +1 -0
- package/dist/common-admin.css +1 -0
- package/dist/common-admin.d.ts +21083 -0
- package/dist/common-admin.js +23085 -0
- package/dist/common-admin.js.map +1 -0
- package/dist/index-CS8NJO8z.mjs +20879 -0
- package/dist/index-CS8NJO8z.mjs.map +1 -0
- package/dist/labs.d.ts +1054 -0
- package/dist/labs.js +709 -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 -8776
- package/dist/common-admin.es.js +0 -343
- package/dist/common-admin.es.js.map +0 -1
- package/dist/lib-CDpngw0k.js +0 -24741
- package/dist/lib-CDpngw0k.js.map +0 -1
- package/dist/style.css +0 -13
- package/dist/webfontloader-DYZrD9l8.js +0 -452
- package/dist/webfontloader-DYZrD9l8.js.map +0 -1
package/dist/labs.js
ADDED
|
@@ -0,0 +1,709 @@
|
|
|
1
|
+
import { bS as ve, d as D, j as U, k as Me, h as X, i as le, ai as be, aj as ye, ak as he, al as Ce, af as re, a$ as Ae, a9 as we, aa as _e, ab as xe, ac as ke, am as Fe, an as Pe, ad as Se, ae as Be, bT as Te, bU as Ee, bV as Ie, bW as qe, ar as De, bX as ce, ao as Je, ap as Ke, aT as Oe, F as He, a7 as Qe, b3 as We, aq as Ye, a1 as Ge, bY as Xe, q as Ze, p as et, x as tt, a6 as ot, aH as at, m as st, l as nt } from "./AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-DWMjveFQ.mjs";
|
|
2
|
+
import { aD as ho, bZ as Co, b_ as Ao, az as wo, aA as _o, aC as xo, aE as ko, aB as Fo, aQ as Po, aI as So, bc as Bo, aF as To, aG as Eo, ax as Io, ay as Do, b$ as No, c4 as Vo, c5 as jo, c2 as Lo, c3 as Ro, ah as Uo, ag as zo, c0 as $o, c1 as Mo, c6 as qo } from "./AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-DWMjveFQ.mjs";
|
|
3
|
+
import { defineComponent as ue, mergeModels as fe, useModel as lt, inject as Ne, computed as x, watch as ee, createElementBlock as z, openBlock as S, createElementVNode as F, createVNode as _, toDisplayString as k, unref as w, withCtx as P, createTextVNode as K, Fragment as de, renderList as Ve, createBlock as Z, normalizeClass as je, createCommentVNode as Le, withModifiers as W, ref as Q, onMounted as Re, toRaw as pe, resolveComponent as ge, renderSlot as R, mergeProps as rt, withDirectives as it, vShow as ct } from "vue";
|
|
4
|
+
import { useI18n as me } from "vue-i18n";
|
|
5
|
+
import { VBtn as H } from "vuetify/components/VBtn";
|
|
6
|
+
import { VList as ut, VListItem as dt, VListItemTitle as mt } from "vuetify/components/VList";
|
|
7
|
+
import { VMenu as ft } from "vuetify/components/VMenu";
|
|
8
|
+
import { useThrottleFn as ae, useDebounceFn as pt } from "@vueuse/core";
|
|
9
|
+
import { VBtnToggle as gt } from "vuetify/components/VBtnToggle";
|
|
10
|
+
import Ue from "axios";
|
|
11
|
+
import { VCard as vt } from "vuetify/components/VCard";
|
|
12
|
+
import { VDialog as bt } from "vuetify/components/VDialog";
|
|
13
|
+
import { VSpacer as yt } from "vuetify/components/VGrid";
|
|
14
|
+
import { VIcon as ht } from "vuetify/components/VIcon";
|
|
15
|
+
import { VToolbar as Ct } from "vuetify/components/VToolbar";
|
|
16
|
+
import { VTooltip as At } from "vuetify/components/VTooltip";
|
|
17
|
+
import { Intersect as wt } from "vuetify/directives";
|
|
18
|
+
const _t = { class: "d-flex align-center justify-center" }, xt = { class: "text-caption mr-1" }, uo = /* @__PURE__ */ ue({
|
|
19
|
+
__name: "ADatatableOrdering",
|
|
20
|
+
props: /* @__PURE__ */ fe({
|
|
21
|
+
variant: { default: "id" },
|
|
22
|
+
customOptions: { default: void 0 },
|
|
23
|
+
paginationUpdateCustomCb: { type: Function, default: void 0 }
|
|
24
|
+
}, {
|
|
25
|
+
modelValue: {
|
|
26
|
+
default: 1,
|
|
27
|
+
required: !1
|
|
28
|
+
},
|
|
29
|
+
modelModifiers: {}
|
|
30
|
+
}),
|
|
31
|
+
emits: /* @__PURE__ */ fe(["sortByChange"], ["update:modelValue"]),
|
|
32
|
+
setup(t, { emit: b }) {
|
|
33
|
+
const p = t, e = b, d = lt(t, "modelValue"), l = Ne(ve);
|
|
34
|
+
if (D(l))
|
|
35
|
+
throw new Error("Incorrect provide/inject config.");
|
|
36
|
+
const { t: n } = me(), r = [
|
|
37
|
+
{ id: 1, titleT: "common.system.datatable.ordering.mostRecent", sortBy: { key: "createdAt", order: U.Desc } },
|
|
38
|
+
{ id: 2, titleT: "common.system.datatable.ordering.oldest", sortBy: { key: "createdAt", order: U.Asc } }
|
|
39
|
+
], i = [
|
|
40
|
+
{ id: 1, titleT: "common.system.datatable.ordering.mostRecent", sortBy: { key: "id", order: U.Desc } },
|
|
41
|
+
{ id: 2, titleT: "common.system.datatable.ordering.oldest", sortBy: { key: "id", order: U.Asc } }
|
|
42
|
+
], c = [
|
|
43
|
+
{
|
|
44
|
+
id: 3,
|
|
45
|
+
titleT: "common.system.datatable.ordering.mostRelevant",
|
|
46
|
+
sortBy: { key: Me, order: U.Desc }
|
|
47
|
+
},
|
|
48
|
+
{ id: 1, titleT: "common.system.datatable.ordering.mostRecent", sortBy: { key: "createdAt", order: U.Desc } },
|
|
49
|
+
{ id: 2, titleT: "common.system.datatable.ordering.oldest", sortBy: { key: "createdAt", order: U.Asc } }
|
|
50
|
+
], C = x(() => {
|
|
51
|
+
const o = y.value.find((v) => v.id === d.value);
|
|
52
|
+
return o ? n(o.titleT) : "";
|
|
53
|
+
}), y = x(() => p.customOptions ? p.customOptions : p.variant === "most-relevant" ? c : p.variant === "id" ? i : r), h = (o) => {
|
|
54
|
+
d.value = o.id;
|
|
55
|
+
}, u = (o) => {
|
|
56
|
+
o.sortBy || (l.value = { ...l.value, sortBy: null, descending: !0 }, e("sortByChange", o)), l.value.sortBy = o.sortBy, e("sortByChange", o);
|
|
57
|
+
};
|
|
58
|
+
return ee(d, (o, v) => {
|
|
59
|
+
if (o === v) return;
|
|
60
|
+
const a = y.value.find((m) => m.id === o);
|
|
61
|
+
if (!D(a)) {
|
|
62
|
+
if (D(p.paginationUpdateCustomCb)) {
|
|
63
|
+
u(a);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
p.paginationUpdateCustomCb(a, l);
|
|
67
|
+
}
|
|
68
|
+
}), ee(
|
|
69
|
+
l,
|
|
70
|
+
(o, v) => {
|
|
71
|
+
if (o.sortBy?.key === v?.sortBy?.key && o.sortBy?.order === v?.sortBy?.order)
|
|
72
|
+
return;
|
|
73
|
+
const a = y.value.find((m) => o.sortBy?.key === m.sortBy?.key && o.sortBy?.order === m.sortBy?.order);
|
|
74
|
+
D(a) || (d.value = a.id);
|
|
75
|
+
},
|
|
76
|
+
{ immediate: !0 }
|
|
77
|
+
), (o, v) => (S(), z("div", _t, [
|
|
78
|
+
F("div", xt, k(w(n)("common.system.datatable.ordering.title")) + ": ", 1),
|
|
79
|
+
_(H, {
|
|
80
|
+
variant: "text",
|
|
81
|
+
rounded: "xl",
|
|
82
|
+
size: "small",
|
|
83
|
+
"append-icon": "mdi-chevron-down"
|
|
84
|
+
}, {
|
|
85
|
+
default: P(() => [
|
|
86
|
+
K(k(C.value) + " ", 1),
|
|
87
|
+
_(ft, {
|
|
88
|
+
activator: "parent",
|
|
89
|
+
location: "bottom",
|
|
90
|
+
"close-on-content-click": ""
|
|
91
|
+
}, {
|
|
92
|
+
default: P(() => [
|
|
93
|
+
_(ut, {
|
|
94
|
+
density: "compact",
|
|
95
|
+
class: "pa-0"
|
|
96
|
+
}, {
|
|
97
|
+
default: P(() => [
|
|
98
|
+
(S(!0), z(de, null, Ve(y.value, (a) => (S(), Z(dt, {
|
|
99
|
+
key: a.id,
|
|
100
|
+
onClick: (m) => h(a)
|
|
101
|
+
}, {
|
|
102
|
+
default: P(() => [
|
|
103
|
+
_(mt, {
|
|
104
|
+
class: je({ "font-weight-bold": a.id === d.value })
|
|
105
|
+
}, {
|
|
106
|
+
default: P(() => [
|
|
107
|
+
K(k(w(n)(a.titleT)), 1)
|
|
108
|
+
]),
|
|
109
|
+
_: 2
|
|
110
|
+
}, 1032, ["class"])
|
|
111
|
+
]),
|
|
112
|
+
_: 2
|
|
113
|
+
}, 1032, ["onClick"]))), 128))
|
|
114
|
+
]),
|
|
115
|
+
_: 1
|
|
116
|
+
})
|
|
117
|
+
]),
|
|
118
|
+
_: 1
|
|
119
|
+
})
|
|
120
|
+
]),
|
|
121
|
+
_: 1
|
|
122
|
+
})
|
|
123
|
+
]));
|
|
124
|
+
}
|
|
125
|
+
}), kt = { class: "anzu-data-footer" }, Ft = {
|
|
126
|
+
key: 0,
|
|
127
|
+
class: "anzu-data-footer__page-limit"
|
|
128
|
+
}, Pt = { class: "anzu-data-footer__pagination" }, St = { class: "anzu-data-footer__icons-before" }, Bt = { class: "current-page" }, Tt = { class: "anzu-data-footer__icons-after" }, Et = /* @__PURE__ */ ue({
|
|
129
|
+
__name: "ADatatablePagination",
|
|
130
|
+
props: {
|
|
131
|
+
itemsPerPageOptions: { default: () => [10, 25, 50] },
|
|
132
|
+
hideRecordsPerPage: { type: Boolean, default: !1 }
|
|
133
|
+
},
|
|
134
|
+
emits: ["change"],
|
|
135
|
+
setup(t, { emit: b }) {
|
|
136
|
+
const p = b, e = Ne(ve);
|
|
137
|
+
if (D(e))
|
|
138
|
+
throw new Error("Incorrect provide/inject config.");
|
|
139
|
+
const { t: d } = me(), l = x(() => Math.ceil(e.value.totalCount / e.value.rowsPerPage)), n = x(() => e.value.page * e.value.rowsPerPage - e.value.rowsPerPage + 1), r = x(() => e.value.page * e.value.rowsPerPage - e.value.rowsPerPage + e.value.currentViewCount), i = x(() => e.value.page === 1), c = x(() => !X(e.value.hasNextPage) || e.value.page === l.value), C = x(() => X(e.value.hasNextPage) && e.value.page === l.value || e.value.hasNextPage === !1), y = x(() => X(e.value.hasNextPage) ? e.value.totalCount : e.value.hasNextPage ? r.value + 1 + "+" : r.value);
|
|
140
|
+
ee(
|
|
141
|
+
() => e.value.rowsPerPage,
|
|
142
|
+
(a, m) => {
|
|
143
|
+
a !== m && (e.value.page = 1, p("change"));
|
|
144
|
+
}
|
|
145
|
+
), ee(
|
|
146
|
+
() => e.value.page,
|
|
147
|
+
(a, m) => {
|
|
148
|
+
a !== m && p("change");
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
const h = ae(() => {
|
|
152
|
+
e.value.page = 1;
|
|
153
|
+
}, 300), u = ae(() => {
|
|
154
|
+
e.value.page = l.value;
|
|
155
|
+
}, 300), o = ae(() => {
|
|
156
|
+
e.value.page = e.value.page - 1;
|
|
157
|
+
}, 300), v = ae(() => {
|
|
158
|
+
e.value.page = e.value.page + 1;
|
|
159
|
+
}, 300);
|
|
160
|
+
return (a, m) => (S(), z("div", kt, [
|
|
161
|
+
t.hideRecordsPerPage ? Le("", !0) : (S(), z("div", Ft, [
|
|
162
|
+
K(k(w(d)("common.system.datatable.itemsPerPage")) + ": ", 1),
|
|
163
|
+
_(gt, {
|
|
164
|
+
modelValue: w(e).rowsPerPage,
|
|
165
|
+
"onUpdate:modelValue": m[0] || (m[0] = (B) => w(e).rowsPerPage = B),
|
|
166
|
+
class: "ml-2",
|
|
167
|
+
density: "compact",
|
|
168
|
+
mandatory: "",
|
|
169
|
+
"data-cy": "table-size"
|
|
170
|
+
}, {
|
|
171
|
+
default: P(() => [
|
|
172
|
+
(S(!0), z(de, null, Ve(t.itemsPerPageOptions, (B) => (S(), Z(H, {
|
|
173
|
+
key: B,
|
|
174
|
+
color: B === w(e).rowsPerPage ? "secondary" : "",
|
|
175
|
+
value: B,
|
|
176
|
+
density: "compact",
|
|
177
|
+
size: "small",
|
|
178
|
+
variant: "text"
|
|
179
|
+
}, {
|
|
180
|
+
default: P(() => [
|
|
181
|
+
K(k(B), 1)
|
|
182
|
+
]),
|
|
183
|
+
_: 2
|
|
184
|
+
}, 1032, ["color", "value"]))), 128))
|
|
185
|
+
]),
|
|
186
|
+
_: 1
|
|
187
|
+
}, 8, ["modelValue"])
|
|
188
|
+
])),
|
|
189
|
+
F("div", Pt, k(n.value) + " - " + k(r.value) + " " + k(w(d)("common.system.datatable.from")) + " " + k(y.value), 1),
|
|
190
|
+
F("div", St, [
|
|
191
|
+
_(H, {
|
|
192
|
+
disabled: i.value,
|
|
193
|
+
icon: "mdi-page-first",
|
|
194
|
+
size: "small",
|
|
195
|
+
variant: "text",
|
|
196
|
+
onClick: W(w(h), ["stop"])
|
|
197
|
+
}, null, 8, ["disabled", "onClick"]),
|
|
198
|
+
_(H, {
|
|
199
|
+
disabled: i.value,
|
|
200
|
+
icon: "mdi-chevron-left",
|
|
201
|
+
size: "small",
|
|
202
|
+
variant: "text",
|
|
203
|
+
onClick: W(w(o), ["stop"])
|
|
204
|
+
}, null, 8, ["disabled", "onClick"])
|
|
205
|
+
]),
|
|
206
|
+
F("div", Bt, [
|
|
207
|
+
F("span", null, k(w(e).page), 1)
|
|
208
|
+
]),
|
|
209
|
+
F("div", Tt, [
|
|
210
|
+
_(H, {
|
|
211
|
+
disabled: C.value,
|
|
212
|
+
icon: "mdi-chevron-right",
|
|
213
|
+
size: "small",
|
|
214
|
+
variant: "text",
|
|
215
|
+
onClick: W(w(v), ["stop"])
|
|
216
|
+
}, null, 8, ["disabled", "onClick"]),
|
|
217
|
+
_(H, {
|
|
218
|
+
disabled: c.value,
|
|
219
|
+
icon: "mdi-page-last",
|
|
220
|
+
size: "small",
|
|
221
|
+
variant: "text",
|
|
222
|
+
onClick: W(w(u), ["stop"])
|
|
223
|
+
}, null, 8, ["disabled", "onClick"])
|
|
224
|
+
])
|
|
225
|
+
]));
|
|
226
|
+
}
|
|
227
|
+
}), It = (t, b, p = "id") => {
|
|
228
|
+
const { querySetLimit: e, querySetOffset: d, querySetOrder: l, queryBuild: n, queryAddFilter: r, queryAdd: i } = qe(), c = t.length;
|
|
229
|
+
return e(c), d(1, c), l(p, !1), b ? i(p, t.join(",")) : r("in", p, t.join(",")), n();
|
|
230
|
+
};
|
|
231
|
+
function mo(t, b, p, e, d, l, n, r) {
|
|
232
|
+
let i, c, C, y, h, u, o, v;
|
|
233
|
+
typeof t == "function" ? (i = t, c = b, C = p, y = e, h = d, u = l ?? {}, o = n ?? !1, v = r ?? "id") : (i = t.client, c = t.system, C = t.entity, y = t.urlTemplate, h = t.urlParams, u = t.options ?? {}, o = t.isSearchApi ?? !1, v = t.field ?? "id");
|
|
234
|
+
let a = null;
|
|
235
|
+
return {
|
|
236
|
+
executeFetch: async ($, N = void 0, g = void 0) => {
|
|
237
|
+
a = new AbortController();
|
|
238
|
+
let T, E;
|
|
239
|
+
typeof N == "object" && N !== null ? (T = N.urlTemplateOverride, E = N.urlParamsOverride) : (T = N, E = g);
|
|
240
|
+
try {
|
|
241
|
+
const s = le(E) ? E : h, I = le(T) ? T : y;
|
|
242
|
+
if (D(I)) throw new Error("Url template is undefined");
|
|
243
|
+
const O = (D(s) ? I : be(I, s)) + It($, o, v), V = await i().get(O, {
|
|
244
|
+
...u,
|
|
245
|
+
signal: a.signal
|
|
246
|
+
});
|
|
247
|
+
if (!ye(V.status))
|
|
248
|
+
throw new he(V.status);
|
|
249
|
+
if (V.data?.data)
|
|
250
|
+
return V.data.data;
|
|
251
|
+
if (V.status === Ce)
|
|
252
|
+
return [];
|
|
253
|
+
throw new re();
|
|
254
|
+
} catch (s) {
|
|
255
|
+
if (s instanceof DOMException && s.name === "AbortError")
|
|
256
|
+
return [];
|
|
257
|
+
throw Ae(s) ? s : we(s) ? new _e(s, s.config?.url) : xe(s) ? new ke(s, c, C, s) : Fe(s) ? new Pe(s, c, C, s) : Se(s) ? new Be(s, s) : Te(s) ? new Ee(s) : Ue.isAxiosError(s) ? (console.error("Axios error: " + y, s.cause), new Ie(s)) : (console.error("AnzuFatalError: ", s), new re(s));
|
|
258
|
+
} finally {
|
|
259
|
+
a = null;
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
abortFetch: () => {
|
|
263
|
+
a && a.abort();
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
function fo(t, b, p, e, d, l) {
|
|
268
|
+
let n, r, i, c, C, y;
|
|
269
|
+
typeof t == "function" ? (n = t, r = b, i = p, c = e, C = d, y = l ?? {}) : (n = t.client, r = t.system, i = t.entity, c = t.urlTemplate, C = t.urlParams, y = t.options ?? {});
|
|
270
|
+
let h = null;
|
|
271
|
+
return {
|
|
272
|
+
executeFetch: async (v, a, m = void 0, B = void 0, $ = "id", N = !0, g = 100, T = !1) => {
|
|
273
|
+
h = new AbortController();
|
|
274
|
+
let E, s, I, O, V, Y;
|
|
275
|
+
typeof m == "object" && m !== null ? (E = m.urlTemplateOverride, s = m.urlParamsOverride, I = m.sortBy ?? "id", O = m.sortDesc ?? !0, V = m.batchSize ?? 100, Y = m.forceElastic ?? !1) : (E = m, s = B, I = $, O = N, V = g, Y = T);
|
|
276
|
+
try {
|
|
277
|
+
const f = a.general.elastic || Y ? "/search" : "", M = le(s) ? s : C, te = le(E) ? E : c;
|
|
278
|
+
if (D(te)) throw new Error("Url template is undefined");
|
|
279
|
+
const { pagination: A } = De(I, O ? U.Desc : U.Asc, {
|
|
280
|
+
rowsPerPage: V
|
|
281
|
+
}), q = (D(M) ? te : be(te, M)) + f, j = [], L = await n().get(q + ce(A, v, a), {
|
|
282
|
+
...y,
|
|
283
|
+
signal: h.signal
|
|
284
|
+
});
|
|
285
|
+
if (!ye(L.status))
|
|
286
|
+
throw new he(L.status);
|
|
287
|
+
if (L.data) {
|
|
288
|
+
const J = L.data;
|
|
289
|
+
if (j.push(...J.data), Je(J))
|
|
290
|
+
for (A.value.hasNextPage = J.hasNextPage; A.value.hasNextPage; ) {
|
|
291
|
+
A.value.page++;
|
|
292
|
+
const oe = (await n().get(
|
|
293
|
+
q + ce(A, v, a),
|
|
294
|
+
{
|
|
295
|
+
...y,
|
|
296
|
+
signal: h.signal
|
|
297
|
+
}
|
|
298
|
+
)).data;
|
|
299
|
+
j.push(...oe.data), A.value.hasNextPage = oe.hasNextPage;
|
|
300
|
+
}
|
|
301
|
+
else if (Ke(J)) {
|
|
302
|
+
if (A.value.totalCount = J.totalCount, A.value.totalCount <= A.value.rowsPerPage)
|
|
303
|
+
return j;
|
|
304
|
+
const ie = [], oe = Math.ceil(A.value.totalCount / A.value.rowsPerPage);
|
|
305
|
+
for (let G = 1; G < oe; G++) {
|
|
306
|
+
const ze = { ...A.value, page: G + 1 }, $e = Q(ze);
|
|
307
|
+
ie.push(
|
|
308
|
+
n().get(q + ce($e, v, a), {
|
|
309
|
+
...y,
|
|
310
|
+
signal: h.signal
|
|
311
|
+
})
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
(await Promise.all(ie)).forEach((G) => {
|
|
315
|
+
j.push(...G.data.data);
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
return j;
|
|
319
|
+
}
|
|
320
|
+
if (L.status === Ce)
|
|
321
|
+
return [];
|
|
322
|
+
throw new re();
|
|
323
|
+
} catch (f) {
|
|
324
|
+
if (f instanceof DOMException && f.name === "AbortError")
|
|
325
|
+
return [];
|
|
326
|
+
throw Ae(f) ? f : we(f) ? new _e(f, f.config?.url) : xe(f) ? new ke(f, r, i, f) : Fe(f) ? new Pe(f, r, i, f) : Se(f) ? new Be(f, f) : Te(f) ? new Ee(f) : Ue.isAxiosError(f) ? (console.error("Axios error: " + c, f.cause), new Ie(f)) : (console.error("AnzuFatalError: ", f), new re(f));
|
|
327
|
+
} finally {
|
|
328
|
+
h = null;
|
|
329
|
+
}
|
|
330
|
+
},
|
|
331
|
+
abortFetch: () => {
|
|
332
|
+
h && h.abort();
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
}
|
|
336
|
+
const se = "/adm/v1/job", ne = "job";
|
|
337
|
+
function po(t, b) {
|
|
338
|
+
return {
|
|
339
|
+
useFetchJobList: () => Qe(t, b, ne, se),
|
|
340
|
+
fetchJob: (n) => He(t, se + "/:id", { id: n }, b, ne),
|
|
341
|
+
createJob: (n) => {
|
|
342
|
+
const r = We(n._resourceName).slice(4).replace("-kind-", "-kind/");
|
|
343
|
+
return Ye(t, n, se + "/:type", { type: r }, b, ne);
|
|
344
|
+
},
|
|
345
|
+
deleteJob: (n) => Oe(t, se + "/:id", { id: n }, b, ne)
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
const Dt = {
|
|
349
|
+
key: "",
|
|
350
|
+
title: void 0,
|
|
351
|
+
sortable: !1,
|
|
352
|
+
fixed: !1
|
|
353
|
+
}, Nt = {
|
|
354
|
+
storeColumnsLocalStorage: !0,
|
|
355
|
+
disableActions: !1,
|
|
356
|
+
customI18n: void 0,
|
|
357
|
+
showExpand: !1
|
|
358
|
+
};
|
|
359
|
+
function Vt(t, b, p, e, d = {}) {
|
|
360
|
+
const l = { ...Nt, ...d }, n = l.customI18n ?? Ge, { t: r } = n.global || n;
|
|
361
|
+
let i;
|
|
362
|
+
tt(l.storeColumnsLocalStorage) ? i = l.storeColumnsLocalStorage : ot(l.storeColumnsLocalStorage) && l.storeColumnsLocalStorage === !0 && (i = "table_" + p + "_" + e);
|
|
363
|
+
const c = t.map((u) => {
|
|
364
|
+
const o = { ...Dt, ...u };
|
|
365
|
+
return D(o.title) && (D(o.title) && Xe.includes(o.key) ? o.title = r("common.model.tracking." + o.key) : D(o.title) && p && e ? o.title = r(p + "." + e + ".model." + o.key) : o.title = ""), o;
|
|
366
|
+
}), C = x(() => {
|
|
367
|
+
const u = [];
|
|
368
|
+
return l.showExpand && u.push({ key: "data-table-expand", sortable: !1 }), c.forEach((o) => {
|
|
369
|
+
b.value.includes(o.key) || u.push(o);
|
|
370
|
+
}), l.disableActions || u.push({ key: "actions", sortable: !1, fixed: "end" }), u;
|
|
371
|
+
}), y = () => {
|
|
372
|
+
if (!i || !localStorage) return;
|
|
373
|
+
const u = localStorage.getItem(i);
|
|
374
|
+
if (!u) return;
|
|
375
|
+
const o = JSON.parse(u);
|
|
376
|
+
Ze(o) && et(o.hidden) && (b.value = o.hidden);
|
|
377
|
+
}, h = (u) => {
|
|
378
|
+
!i || !localStorage || localStorage.setItem(i, JSON.stringify({ hidden: u }));
|
|
379
|
+
};
|
|
380
|
+
return Re(() => {
|
|
381
|
+
y();
|
|
382
|
+
}), ee(b, (u) => {
|
|
383
|
+
h(u);
|
|
384
|
+
}), {
|
|
385
|
+
columnsAll: c,
|
|
386
|
+
columnsVisible: C,
|
|
387
|
+
columnsHidden: b
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
function go(t, b, p, e, d, l, n, r = null, i = void 0, c = void 0, C = !1, y = !1) {
|
|
391
|
+
const h = Q(!1), u = Q([]), o = Q([]), v = Q(!1), { pagination: a, setSortBy: m, incrementPage: B } = De(
|
|
392
|
+
X(r) ? null : r.key,
|
|
393
|
+
r?.order
|
|
394
|
+
), { resetFilter: $, submitFilter: N } = at(l, n, {
|
|
395
|
+
storeFiltersLocalStorage: !1,
|
|
396
|
+
populateUrlParams: !1
|
|
397
|
+
}), { showErrorsDefault: g } = st(), { columnsVisible: T, columnsAll: E, columnsHidden: s } = Vt(
|
|
398
|
+
t,
|
|
399
|
+
b,
|
|
400
|
+
p,
|
|
401
|
+
e,
|
|
402
|
+
{ storeColumnsLocalStorage: !1, disableActions: !y }
|
|
403
|
+
), I = () => {
|
|
404
|
+
Y(), M();
|
|
405
|
+
}, O = (A) => {
|
|
406
|
+
m(A.sortBy), M();
|
|
407
|
+
}, V = async () => {
|
|
408
|
+
v.value = !0, B();
|
|
409
|
+
try {
|
|
410
|
+
const A = await d(
|
|
411
|
+
a,
|
|
412
|
+
l,
|
|
413
|
+
n,
|
|
414
|
+
i,
|
|
415
|
+
c,
|
|
416
|
+
C
|
|
417
|
+
);
|
|
418
|
+
u.value.push(...A);
|
|
419
|
+
} catch (A) {
|
|
420
|
+
g(A);
|
|
421
|
+
} finally {
|
|
422
|
+
v.value = !1;
|
|
423
|
+
}
|
|
424
|
+
}, Y = () => {
|
|
425
|
+
u.value = [], o.value = [];
|
|
426
|
+
}, f = async () => {
|
|
427
|
+
v.value = !0;
|
|
428
|
+
try {
|
|
429
|
+
u.value = await d(
|
|
430
|
+
a,
|
|
431
|
+
l,
|
|
432
|
+
n,
|
|
433
|
+
i,
|
|
434
|
+
c,
|
|
435
|
+
C
|
|
436
|
+
);
|
|
437
|
+
} catch (A) {
|
|
438
|
+
g(A);
|
|
439
|
+
} finally {
|
|
440
|
+
v.value = !1;
|
|
441
|
+
}
|
|
442
|
+
}, M = pt(async () => {
|
|
443
|
+
await f();
|
|
444
|
+
});
|
|
445
|
+
return {
|
|
446
|
+
items: u,
|
|
447
|
+
selected: o,
|
|
448
|
+
pagination: a,
|
|
449
|
+
columnsVisible: T,
|
|
450
|
+
columnsHidden: s,
|
|
451
|
+
columnsAll: E,
|
|
452
|
+
filterTouched: h,
|
|
453
|
+
loading: v,
|
|
454
|
+
onRowClick: (A) => {
|
|
455
|
+
const q = A.target;
|
|
456
|
+
if (!q || q.tagName === "INPUT" && q.type === "checkbox")
|
|
457
|
+
return;
|
|
458
|
+
const j = q.closest(".v-data-table__tr");
|
|
459
|
+
if (!j || !j.classList.contains("v-data-table__tr")) return;
|
|
460
|
+
const L = j.firstElementChild;
|
|
461
|
+
if (!L || !L.classList.contains("v-data-table__td")) return;
|
|
462
|
+
const J = L.querySelector("input");
|
|
463
|
+
J && J.click();
|
|
464
|
+
},
|
|
465
|
+
onFetchNextPage: V,
|
|
466
|
+
onOpen: I,
|
|
467
|
+
sortByChange: O,
|
|
468
|
+
getList: M,
|
|
469
|
+
resetFilter: () => $(a, M),
|
|
470
|
+
submitFilter: () => N(a, M)
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
const jt = { class: "d-flex flex-column w-100 px-1 align-center" }, Lt = { class: "d-flex justify-space-between w-100 align-center" }, Rt = { class: "d-flex align-center" }, Ut = { class: "d-flex align-center" }, zt = { class: "subject-select__sidebar system-border-r" }, $t = { class: "subject-select-filter" }, Mt = { class: "subject-select__content" }, qt = {
|
|
474
|
+
key: 0,
|
|
475
|
+
class: "d-flex w-100 align-center justify-center pa-4"
|
|
476
|
+
}, Jt = { class: "subject-select__actions system-border-t" }, Kt = { key: 0 }, Ot = { key: 1 }, vo = /* @__PURE__ */ ue({
|
|
477
|
+
__name: "ASubjectSelect",
|
|
478
|
+
props: {
|
|
479
|
+
selectedItems: {},
|
|
480
|
+
pagination: {},
|
|
481
|
+
loading: { type: Boolean, default: !1 },
|
|
482
|
+
minCount: { default: 1 },
|
|
483
|
+
maxCount: { default: 1 },
|
|
484
|
+
modelValue: { type: Boolean, default: void 0 },
|
|
485
|
+
dialogTitleT: { default: "common.subjectSelect.texts.title" },
|
|
486
|
+
paginationMode: { default: "standard" },
|
|
487
|
+
autoOpen: { type: Boolean, default: !1 }
|
|
488
|
+
},
|
|
489
|
+
emits: ["update:modelValue", "update:pagination", "onOpen", "onPageChange", "onConfirm", "onFetchNextPage"],
|
|
490
|
+
setup(t, { expose: b, emit: p }) {
|
|
491
|
+
const e = t, d = p, l = Q(!1), n = x({
|
|
492
|
+
get() {
|
|
493
|
+
return D(e.modelValue) ? l.value : e.modelValue;
|
|
494
|
+
},
|
|
495
|
+
set(g) {
|
|
496
|
+
l.value = g, d("update:modelValue", g);
|
|
497
|
+
}
|
|
498
|
+
}), r = x({
|
|
499
|
+
get: () => e.pagination,
|
|
500
|
+
set: (g) => {
|
|
501
|
+
d("update:pagination", { ...pe(g) });
|
|
502
|
+
}
|
|
503
|
+
}), i = Q(!0), { t: c } = me(), C = x(() => e.selectedItems.length), y = x(() => C.value < e.minCount || C.value > e.maxCount), h = () => {
|
|
504
|
+
d("onOpen"), i.value = !0, n.value = !0;
|
|
505
|
+
}, u = () => {
|
|
506
|
+
i.value = !i.value;
|
|
507
|
+
}, o = () => {
|
|
508
|
+
n.value = !1;
|
|
509
|
+
}, v = () => {
|
|
510
|
+
d(
|
|
511
|
+
"onConfirm",
|
|
512
|
+
e.selectedItems.map((g) => pe(g))
|
|
513
|
+
), o();
|
|
514
|
+
}, a = () => {
|
|
515
|
+
d("onFetchNextPage");
|
|
516
|
+
}, m = () => {
|
|
517
|
+
d("onPageChange");
|
|
518
|
+
}, B = x(() => Math.ceil(r.value.totalCount / r.value.rowsPerPage)), $ = x(() => !(X(r.value.hasNextPage) && r.value.page === B.value || r.value.hasNextPage === !1)), N = (g) => {
|
|
519
|
+
g && $.value && !e.loading && a();
|
|
520
|
+
};
|
|
521
|
+
return Re(() => {
|
|
522
|
+
e.autoOpen && h();
|
|
523
|
+
}), b({
|
|
524
|
+
open: h
|
|
525
|
+
}), (g, T) => {
|
|
526
|
+
const E = ge("ABtnSecondary"), s = ge("ABtnPrimary");
|
|
527
|
+
return S(), z(de, null, [
|
|
528
|
+
R(g.$slots, "activator", {
|
|
529
|
+
props: { onClick: W(() => h(), ["stop"]) }
|
|
530
|
+
}),
|
|
531
|
+
_(bt, rt(g.$attrs, {
|
|
532
|
+
"model-value": n.value,
|
|
533
|
+
fullscreen: "",
|
|
534
|
+
class: "subject-select",
|
|
535
|
+
"onUpdate:modelValue": T[1] || (T[1] = (I) => d("update:modelValue", I))
|
|
536
|
+
}), {
|
|
537
|
+
default: P(() => [
|
|
538
|
+
n.value ? (S(), Z(vt, {
|
|
539
|
+
key: 0,
|
|
540
|
+
class: "subject-select__card"
|
|
541
|
+
}, {
|
|
542
|
+
default: P(() => [
|
|
543
|
+
_(nt, {
|
|
544
|
+
class: "subject-select__toolbar system-border-b",
|
|
545
|
+
onOnCancel: o
|
|
546
|
+
}, {
|
|
547
|
+
default: P(() => [
|
|
548
|
+
R(g.$slots, "title", {}, () => [
|
|
549
|
+
K(k(w(c)(t.dialogTitleT)), 1)
|
|
550
|
+
])
|
|
551
|
+
]),
|
|
552
|
+
_: 3
|
|
553
|
+
}),
|
|
554
|
+
_(Ct, {
|
|
555
|
+
density: "compact",
|
|
556
|
+
color: "transparent",
|
|
557
|
+
height: 46,
|
|
558
|
+
elevation: "0",
|
|
559
|
+
class: "system-border-b subject-select__second-bar"
|
|
560
|
+
}, {
|
|
561
|
+
default: P(() => [
|
|
562
|
+
R(g.$slots, "second-bar", {}, () => [
|
|
563
|
+
F("div", jt, [
|
|
564
|
+
F("div", Lt, [
|
|
565
|
+
F("div", Rt, [
|
|
566
|
+
_(H, {
|
|
567
|
+
icon: "",
|
|
568
|
+
width: 30,
|
|
569
|
+
height: 30,
|
|
570
|
+
onClick: u
|
|
571
|
+
}, {
|
|
572
|
+
default: P(() => [
|
|
573
|
+
_(ht, {
|
|
574
|
+
icon: "mdi-tune",
|
|
575
|
+
size: 16
|
|
576
|
+
}),
|
|
577
|
+
_(At, {
|
|
578
|
+
activator: "parent",
|
|
579
|
+
location: "bottom"
|
|
580
|
+
}, {
|
|
581
|
+
default: P(() => [
|
|
582
|
+
K(k(w(c)("common.subjectSelect.filter.toggle")), 1)
|
|
583
|
+
]),
|
|
584
|
+
_: 1
|
|
585
|
+
})
|
|
586
|
+
]),
|
|
587
|
+
_: 1
|
|
588
|
+
}),
|
|
589
|
+
R(g.$slots, "second-bar-left")
|
|
590
|
+
]),
|
|
591
|
+
F("div", Ut, [
|
|
592
|
+
R(g.$slots, "second-bar-right")
|
|
593
|
+
])
|
|
594
|
+
])
|
|
595
|
+
])
|
|
596
|
+
])
|
|
597
|
+
]),
|
|
598
|
+
_: 3
|
|
599
|
+
}),
|
|
600
|
+
F("div", {
|
|
601
|
+
class: je(["subject-select__main", { "subject-select__main--sidebar-active": i.value }])
|
|
602
|
+
}, [
|
|
603
|
+
F("div", zt, [
|
|
604
|
+
F("div", $t, [
|
|
605
|
+
R(g.$slots, "filter")
|
|
606
|
+
])
|
|
607
|
+
]),
|
|
608
|
+
F("div", Mt, [
|
|
609
|
+
R(g.$slots, "content"),
|
|
610
|
+
t.paginationMode === "more" ? (S(), z("div", qt, [
|
|
611
|
+
it((S(), Z(E, {
|
|
612
|
+
loading: t.loading,
|
|
613
|
+
size: "small",
|
|
614
|
+
onClick: a
|
|
615
|
+
}, {
|
|
616
|
+
default: P(() => [
|
|
617
|
+
R(g.$slots, "button-confirm-title", {}, () => [
|
|
618
|
+
K(k(w(c)("common.button.loadMore")), 1)
|
|
619
|
+
])
|
|
620
|
+
]),
|
|
621
|
+
_: 3
|
|
622
|
+
}, 8, ["loading"])), [
|
|
623
|
+
[ct, $.value || t.loading],
|
|
624
|
+
[
|
|
625
|
+
wt,
|
|
626
|
+
N,
|
|
627
|
+
void 0,
|
|
628
|
+
{ quiet: !0 }
|
|
629
|
+
]
|
|
630
|
+
])
|
|
631
|
+
])) : (S(), Z(Et, {
|
|
632
|
+
key: 1,
|
|
633
|
+
modelValue: r.value,
|
|
634
|
+
"onUpdate:modelValue": T[0] || (T[0] = (I) => r.value = I),
|
|
635
|
+
onChange: m
|
|
636
|
+
}, null, 8, ["modelValue"]))
|
|
637
|
+
])
|
|
638
|
+
], 2),
|
|
639
|
+
F("div", Jt, [
|
|
640
|
+
t.minCount === t.maxCount ? (S(), z("div", Kt, k(w(c)("common.subjectSelect.texts.pickExactCount", { count: t.minCount, selected: C.value })), 1)) : (S(), z("div", Ot, k(w(c)("common.subjectSelect.texts.pickRangeCount", {
|
|
641
|
+
minCount: t.minCount,
|
|
642
|
+
maxCount: t.maxCount,
|
|
643
|
+
selected: C.value
|
|
644
|
+
})), 1)),
|
|
645
|
+
_(yt),
|
|
646
|
+
_(s, {
|
|
647
|
+
disabled: y.value,
|
|
648
|
+
onClick: W(v, ["stop"])
|
|
649
|
+
}, {
|
|
650
|
+
default: P(() => [
|
|
651
|
+
R(g.$slots, "button-confirm-title", {}, () => [
|
|
652
|
+
K(k(w(c)("common.button.confirm")), 1)
|
|
653
|
+
])
|
|
654
|
+
]),
|
|
655
|
+
_: 3
|
|
656
|
+
}, 8, ["disabled"])
|
|
657
|
+
])
|
|
658
|
+
]),
|
|
659
|
+
_: 3
|
|
660
|
+
})) : Le("", !0)
|
|
661
|
+
]),
|
|
662
|
+
_: 3
|
|
663
|
+
}, 16, ["model-value"])
|
|
664
|
+
], 64);
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
});
|
|
668
|
+
export {
|
|
669
|
+
uo as ADatatableOrdering,
|
|
670
|
+
Et as ADatatablePagination,
|
|
671
|
+
ho as AFilterBooleanSelect,
|
|
672
|
+
Co as AFilterDatetimePicker,
|
|
673
|
+
Ao as AFilterInteger,
|
|
674
|
+
wo as AFilterRemoteAutocomplete,
|
|
675
|
+
_o as AFilterRemoteAutocompleteWithMinimal,
|
|
676
|
+
xo as AFilterString,
|
|
677
|
+
ko as AFilterTimeInterval,
|
|
678
|
+
Fo as AFilterValueObjectOptionsSelect,
|
|
679
|
+
Po as AFilterWrapper,
|
|
680
|
+
So as AFilterWrapperSubjectSelect,
|
|
681
|
+
Bo as AFormRemoteAutocomplete,
|
|
682
|
+
vo as ASubjectSelect,
|
|
683
|
+
ve as DatatablePaginationKey,
|
|
684
|
+
To as FilterConfigKey,
|
|
685
|
+
Eo as FilterDataKey,
|
|
686
|
+
Io as FilterInnerConfigKey,
|
|
687
|
+
Do as FilterInnerDataKey,
|
|
688
|
+
No as TimeIntervalSpecialOptions,
|
|
689
|
+
Vo as UserAdminConfigLayoutType,
|
|
690
|
+
jo as UserAdminConfigLayoutTypeDefault,
|
|
691
|
+
Lo as UserAdminConfigType,
|
|
692
|
+
Ro as UserAdminConfigTypeDefault,
|
|
693
|
+
Vt as createDatatableColumnsConfig,
|
|
694
|
+
Uo as createFilter,
|
|
695
|
+
zo as createFilterStore,
|
|
696
|
+
ce as generateListQuery,
|
|
697
|
+
mo as useApiFetchByIds,
|
|
698
|
+
Qe as useApiFetchList,
|
|
699
|
+
fo as useApiFetchListBatch,
|
|
700
|
+
qe as useApiQueryBuilder,
|
|
701
|
+
$o as useApiRequest,
|
|
702
|
+
at as useFilterHelpers,
|
|
703
|
+
po as useJobApi,
|
|
704
|
+
De as usePagination,
|
|
705
|
+
go as useSubjectSelect,
|
|
706
|
+
Mo as useUserAdminConfigApi,
|
|
707
|
+
qo as useUserAdminConfigFactory
|
|
708
|
+
};
|
|
709
|
+
//# sourceMappingURL=labs.js.map
|