@anzusystems/common-admin 1.47.0-beta.dev-1782074999 → 1.47.0-beta.dev-1782075999
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-o6c_O9hq.mjs → AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-Du5IKIA6.mjs} +2802 -2799
- package/dist/{AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-o6c_O9hq.mjs.map → AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-Du5IKIA6.mjs.map} +1 -1
- package/dist/common-admin.d.ts +6 -0
- package/dist/common-admin.js +6 -5
- package/dist/common-admin.js.map +1 -1
- package/dist/labs.d.ts +17 -3
- package/dist/labs.js +931 -927
- package/dist/labs.js.map +1 -1
- package/dist/{webfontloader-BZnUc4FL.mjs → webfontloader-C21jfvFG.mjs} +2 -2
- package/dist/{webfontloader-BZnUc4FL.mjs.map → webfontloader-C21jfvFG.mjs.map} +1 -1
- package/package.json +1 -1
package/dist/labs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { aG as za, aH as Na, d as Ie, bT as Oa, bU as Ua, bV as En, j as _e, k as ja, a1 as qa, h as St, i as Lt, aj as Tn, ak as $n, al as Fn, am as Bn, ag as Mt, a_ as Kn, aa as Rn, ab as Vn, ac as Ln, ad as Mn, an as zn, ao as Nn, ae as On, af as Un, bW as jn, bX as qn, be as Hn, bY as Ha, as as Gn, bZ as en, ap as Ga, aq as Ja, aV as Wa, b2 as Xa, ar as Ya, E as Qa, a8 as Za, a2 as _a, b_ as eo, q as to, p as no, x as ao, a7 as oo, aI as lo, m as Jn, b$ as io, l as so, c0 as ro, c1 as Wn, c2 as Xn, c3 as Yn, c4 as Qn, c5 as Zn, c6 as _n, c7 as ea, c8 as ta, c9 as na, ca as aa, g as Re, cb as co, cc as uo, _ as oa, cd as fo, ce as vo, cf as mo, cg as yo, ch as ho, aU as go, ci as po, cj as bo, ck as ko, z as wo, cl as Co, cm as xo } from "./AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-
|
|
2
|
-
import { aE as
|
|
3
|
-
import { defineComponent as et, inject as ht, provide as nn, ref as ie, openBlock as S, createBlock as ne, withModifiers as ue, withCtx as f, renderSlot as U, useModel as gt, computed as x, watch as Ee, createElementBlock as N, createElementVNode as O, toDisplayString as L, unref as m, createVNode as c, createTextVNode as te, Fragment as xe, renderList as rt, normalizeClass as Ne, mergeModels as Xe, createCommentVNode as ee, onMounted as an, toRaw as Cn, resolveComponent as xn, mergeProps as fe, withDirectives as So, vShow as Ao, useSlots as la, useTemplateRef as zt, isRef as ia, toValue as Io, reactive as
|
|
4
|
-
import { VForm as
|
|
1
|
+
import { aG as za, aH as Na, d as Ie, bT as Oa, bU as Ua, bV as En, j as _e, k as ja, a1 as qa, h as St, i as Lt, aj as Tn, ak as $n, al as Fn, am as Bn, ag as Mt, a_ as Kn, aa as Rn, ab as Vn, ac as Ln, ad as Mn, an as zn, ao as Nn, ae as On, af as Un, bW as jn, bX as qn, be as Hn, bY as Ha, as as Gn, bZ as en, ap as Ga, aq as Ja, aV as Wa, b2 as Xa, ar as Ya, E as Qa, a8 as Za, a2 as _a, b_ as eo, q as to, p as no, x as ao, a7 as oo, aI as lo, m as Jn, b$ as io, l as so, c0 as ro, c1 as Wn, c2 as Xn, c3 as Yn, c4 as Qn, c5 as Zn, c6 as _n, c7 as ea, c8 as ta, c9 as na, ca as aa, g as Re, cb as co, cc as uo, _ as oa, cd as fo, ce as vo, cf as mo, cg as yo, ch as ho, aU as go, ci as po, cj as bo, ck as ko, z as wo, cl as Co, cm as xo } from "./AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-Du5IKIA6.mjs";
|
|
2
|
+
import { aE as es, cn as ts, co as ns, aA as as, aB as os, aD as ls, aF as is, aC as ss, aS as rs, aJ as ds, bb as cs, aO as us, aX as fs, ay as vs, az as ms, cp as ys, cq as hs, cr as gs, cs as ps, ct as bs, cu as ks, ai as ws, ah as Cs, cv as xs, cw as Ss, cx as As, cy as Is, cz as Ds } from "./AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-Du5IKIA6.mjs";
|
|
3
|
+
import { defineComponent as et, inject as ht, provide as nn, ref as ie, openBlock as S, createBlock as ne, withModifiers as ue, withCtx as f, renderSlot as U, useModel as gt, computed as x, watch as Ee, createElementBlock as N, createElementVNode as O, toDisplayString as L, unref as m, createVNode as c, createTextVNode as te, Fragment as xe, renderList as rt, normalizeClass as Ne, mergeModels as Xe, createCommentVNode as ee, onMounted as an, toRaw as Cn, resolveComponent as xn, mergeProps as fe, withDirectives as So, vShow as Ao, useSlots as la, useTemplateRef as zt, isRef as ia, toValue as Io, reactive as Do, normalizeProps as We, guardReactiveProps as at, normalizeStyle as At, shallowRef as tn, nextTick as Ze, onBeforeUnmount as on, getCurrentInstance as sa } from "vue";
|
|
4
|
+
import { VForm as Po } from "vuetify/components/VForm";
|
|
5
5
|
import { useI18n as ot } from "vue-i18n";
|
|
6
6
|
import { VBtn as re } from "vuetify/components/VBtn";
|
|
7
7
|
import { VList as It, VListItem as je, VListItemTitle as Ge } from "vuetify/components/VList";
|
|
@@ -28,20 +28,20 @@ const Li = /* @__PURE__ */ et({
|
|
|
28
28
|
formName: { default: "search" }
|
|
29
29
|
},
|
|
30
30
|
emits: ["submit"],
|
|
31
|
-
setup(e, { emit:
|
|
32
|
-
const
|
|
31
|
+
setup(e, { emit: p }) {
|
|
32
|
+
const o = p, n = ht(za), i = ht(Na);
|
|
33
33
|
if (Ie(n) || Ie(i))
|
|
34
34
|
throw new Error("Incorrect provide/inject config.");
|
|
35
35
|
nn(Oa, ie(0)), nn(Ua, ie(/* @__PURE__ */ new Map()));
|
|
36
36
|
const v = () => {
|
|
37
|
-
|
|
37
|
+
o("submit");
|
|
38
38
|
};
|
|
39
|
-
return (
|
|
39
|
+
return (b, $) => (S(), ne(Po, {
|
|
40
40
|
name: e.formName,
|
|
41
41
|
onSubmit: ue(v, ["prevent"])
|
|
42
42
|
}, {
|
|
43
43
|
default: f(() => [
|
|
44
|
-
U(
|
|
44
|
+
U(b.$slots, "default")
|
|
45
45
|
]),
|
|
46
46
|
_: 3
|
|
47
47
|
}, 8, ["name"]));
|
|
@@ -60,11 +60,11 @@ const Li = /* @__PURE__ */ et({
|
|
|
60
60
|
modelModifiers: {}
|
|
61
61
|
}),
|
|
62
62
|
emits: /* @__PURE__ */ Xe(["sortByChange"], ["update:modelValue"]),
|
|
63
|
-
setup(e, { emit:
|
|
64
|
-
const
|
|
63
|
+
setup(e, { emit: p }) {
|
|
64
|
+
const o = e, n = p, i = gt(e, "modelValue"), v = ht(En);
|
|
65
65
|
if (Ie(v))
|
|
66
66
|
throw new Error("Incorrect provide/inject config.");
|
|
67
|
-
const { t:
|
|
67
|
+
const { t: b } = ot(), $ = [
|
|
68
68
|
{
|
|
69
69
|
id: 1,
|
|
70
70
|
titleT: "common.system.datatable.ordering.mostRecent",
|
|
@@ -75,7 +75,7 @@ const Li = /* @__PURE__ */ et({
|
|
|
75
75
|
titleT: "common.system.datatable.ordering.oldest",
|
|
76
76
|
sortBy: { key: "createdAt", order: _e.Asc }
|
|
77
77
|
}
|
|
78
|
-
],
|
|
78
|
+
], k = [
|
|
79
79
|
{
|
|
80
80
|
id: 1,
|
|
81
81
|
titleT: "common.system.datatable.ordering.mostRecent",
|
|
@@ -104,8 +104,8 @@ const Li = /* @__PURE__ */ et({
|
|
|
104
104
|
}
|
|
105
105
|
], h = x(() => {
|
|
106
106
|
const g = A.value.find((M) => M.id === i.value);
|
|
107
|
-
return g ?
|
|
108
|
-
}), A = x(() =>
|
|
107
|
+
return g ? b(g.titleT) : "";
|
|
108
|
+
}), A = x(() => o.customOptions ? o.customOptions : o.variant === "most-relevant" ? u : o.variant === "id" ? k : $), q = (g) => {
|
|
109
109
|
i.value = g.id;
|
|
110
110
|
}, z = (g) => {
|
|
111
111
|
g.sortBy || (v.value = {
|
|
@@ -115,25 +115,25 @@ const Li = /* @__PURE__ */ et({
|
|
|
115
115
|
};
|
|
116
116
|
return Ee(i, (g, M) => {
|
|
117
117
|
if (g === M) return;
|
|
118
|
-
const
|
|
119
|
-
if (!Ie(
|
|
120
|
-
if (Ie(
|
|
121
|
-
z(
|
|
118
|
+
const G = A.value.find((V) => V.id === g);
|
|
119
|
+
if (!Ie(G)) {
|
|
120
|
+
if (Ie(o.paginationUpdateCustomCb)) {
|
|
121
|
+
z(G);
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
|
|
124
|
+
o.paginationUpdateCustomCb(G, v);
|
|
125
125
|
}
|
|
126
126
|
}), Ee(
|
|
127
127
|
v,
|
|
128
128
|
(g, M) => {
|
|
129
129
|
if (g.sortBy?.key === M?.sortBy?.key && g.sortBy?.order === M?.sortBy?.order)
|
|
130
130
|
return;
|
|
131
|
-
const
|
|
132
|
-
Ie(
|
|
131
|
+
const G = A.value.find((V) => g.sortBy?.key === V.sortBy?.key && g.sortBy?.order === V.sortBy?.order);
|
|
132
|
+
Ie(G) || (i.value = G.id);
|
|
133
133
|
},
|
|
134
134
|
{ immediate: !0 }
|
|
135
135
|
), (g, M) => (S(), N("div", Ro, [
|
|
136
|
-
O("div", Vo, L(m(
|
|
136
|
+
O("div", Vo, L(m(b)("common.system.datatable.ordering.title")) + ": ", 1),
|
|
137
137
|
c(re, {
|
|
138
138
|
variant: "text",
|
|
139
139
|
rounded: "xl",
|
|
@@ -154,16 +154,16 @@ const Li = /* @__PURE__ */ et({
|
|
|
154
154
|
class: "pa-0"
|
|
155
155
|
}, {
|
|
156
156
|
default: f(() => [
|
|
157
|
-
(S(!0), N(xe, null, rt(A.value, (
|
|
158
|
-
key:
|
|
159
|
-
onClick: (V) => q(
|
|
157
|
+
(S(!0), N(xe, null, rt(A.value, (G) => (S(), ne(je, {
|
|
158
|
+
key: G.id,
|
|
159
|
+
onClick: (V) => q(G)
|
|
160
160
|
}, {
|
|
161
161
|
default: f(() => [
|
|
162
162
|
c(Ge, {
|
|
163
|
-
class: Ne({ "font-weight-bold":
|
|
163
|
+
class: Ne({ "font-weight-bold": G.id === i.value })
|
|
164
164
|
}, {
|
|
165
165
|
default: f(() => [
|
|
166
|
-
te(L(m(
|
|
166
|
+
te(L(m(b)(G.titleT)), 1)
|
|
167
167
|
]),
|
|
168
168
|
_: 2
|
|
169
169
|
}, 1032, ["class"])
|
|
@@ -191,29 +191,29 @@ const Li = /* @__PURE__ */ et({
|
|
|
191
191
|
hideRecordsPerPage: { type: Boolean, default: !1 }
|
|
192
192
|
},
|
|
193
193
|
emits: ["change"],
|
|
194
|
-
setup(e, { emit:
|
|
195
|
-
const
|
|
194
|
+
setup(e, { emit: p }) {
|
|
195
|
+
const o = p, n = ht(En);
|
|
196
196
|
if (Ie(n))
|
|
197
197
|
throw new Error("Incorrect provide/inject config.");
|
|
198
|
-
const { t: i } = ot(), { setStoredPage: v } = qa(),
|
|
198
|
+
const { t: i } = ot(), { setStoredPage: v } = qa(), b = x(() => Math.ceil(n.value.totalCount / n.value.rowsPerPage)), $ = x(() => n.value.page * n.value.rowsPerPage - n.value.rowsPerPage + 1), k = x(() => n.value.page * n.value.rowsPerPage - n.value.rowsPerPage + n.value.currentViewCount), u = x(() => n.value.page === 1), h = x(() => !St(n.value.hasNextPage) || n.value.page === b.value), A = x(() => St(n.value.hasNextPage) && n.value.page === b.value || n.value.hasNextPage === !1), q = x(() => St(n.value.hasNextPage) ? n.value.totalCount : n.value.hasNextPage ? k.value + 1 + "+" : k.value);
|
|
199
199
|
Ee(
|
|
200
200
|
() => n.value.rowsPerPage,
|
|
201
201
|
(V, Y) => {
|
|
202
|
-
V !== Y && (n.value.page = 1,
|
|
202
|
+
V !== Y && (n.value.page = 1, o("change"));
|
|
203
203
|
}
|
|
204
204
|
), Ee(
|
|
205
205
|
() => n.value.page,
|
|
206
206
|
(V, Y) => {
|
|
207
|
-
V !== Y && (v(V),
|
|
207
|
+
V !== Y && (v(V), o("change"));
|
|
208
208
|
}
|
|
209
209
|
);
|
|
210
210
|
const z = Ft(() => {
|
|
211
211
|
n.value.page = 1;
|
|
212
212
|
}, 300), g = Ft(() => {
|
|
213
|
-
n.value.page =
|
|
213
|
+
n.value.page = b.value;
|
|
214
214
|
}, 300), M = Ft(() => {
|
|
215
215
|
n.value.page = n.value.page - 1;
|
|
216
|
-
}, 300),
|
|
216
|
+
}, 300), G = Ft(() => {
|
|
217
217
|
n.value.page = n.value.page + 1;
|
|
218
218
|
}, 300);
|
|
219
219
|
return (V, Y) => (S(), N("div", Lo, [
|
|
@@ -245,7 +245,7 @@ const Li = /* @__PURE__ */ et({
|
|
|
245
245
|
_: 1
|
|
246
246
|
}, 8, ["modelValue"])
|
|
247
247
|
])),
|
|
248
|
-
O("div", zo, L($.value) + " - " + L(
|
|
248
|
+
O("div", zo, L($.value) + " - " + L(k.value) + " " + L(m(i)("common.system.datatable.from")) + " " + L(q.value), 1),
|
|
249
249
|
O("div", No, [
|
|
250
250
|
c(re, {
|
|
251
251
|
disabled: u.value,
|
|
@@ -271,7 +271,7 @@ const Li = /* @__PURE__ */ et({
|
|
|
271
271
|
icon: "mdi-chevron-right",
|
|
272
272
|
size: "small",
|
|
273
273
|
variant: "text",
|
|
274
|
-
onClick: ue(m(
|
|
274
|
+
onClick: ue(m(G), ["stop"])
|
|
275
275
|
}, null, 8, ["disabled", "onClick"]),
|
|
276
276
|
c(re, {
|
|
277
277
|
disabled: h.value,
|
|
@@ -283,44 +283,44 @@ const Li = /* @__PURE__ */ et({
|
|
|
283
283
|
])
|
|
284
284
|
]));
|
|
285
285
|
}
|
|
286
|
-
}), qo = (e,
|
|
287
|
-
const { querySetLimit: n, querySetOffset: i, querySetOrder: v, queryBuild:
|
|
288
|
-
return n(u), i(1, u), v(
|
|
286
|
+
}), qo = (e, p, o = "id") => {
|
|
287
|
+
const { querySetLimit: n, querySetOffset: i, querySetOrder: v, queryBuild: b, queryAddFilter: $, queryAdd: k } = Ha(), u = e.length;
|
|
288
|
+
return n(u), i(1, u), v(o, !1), p ? k(o, e.join(",")) : $("in", o, e.join(",")), b();
|
|
289
289
|
}, zi = (e) => {
|
|
290
290
|
const {
|
|
291
|
-
client:
|
|
292
|
-
system:
|
|
291
|
+
client: p,
|
|
292
|
+
system: o,
|
|
293
293
|
entity: n,
|
|
294
294
|
urlTemplate: i,
|
|
295
295
|
urlParams: v,
|
|
296
|
-
options:
|
|
296
|
+
options: b = {},
|
|
297
297
|
isSearchApi: $ = !1,
|
|
298
|
-
field:
|
|
298
|
+
field: k = "id",
|
|
299
299
|
silentConsoleError: u = !1
|
|
300
300
|
} = e;
|
|
301
301
|
let h = null;
|
|
302
302
|
return {
|
|
303
303
|
executeFetch: async (z, g = {}) => {
|
|
304
304
|
h = new AbortController();
|
|
305
|
-
const { urlTemplate: M, urlParams:
|
|
305
|
+
const { urlTemplate: M, urlParams: G } = g;
|
|
306
306
|
try {
|
|
307
|
-
const V = Lt(
|
|
307
|
+
const V = Lt(G) ? G : v, Y = Lt(M) ? M : i;
|
|
308
308
|
if (Ie(Y)) throw new Error("Url template is undefined");
|
|
309
|
-
const F = (Ie(V) ? Y : Tn(Y, V)) + qo(z, $,
|
|
310
|
-
...
|
|
309
|
+
const F = (Ie(V) ? Y : Tn(Y, V)) + qo(z, $, k), r = await p().get(F, {
|
|
310
|
+
...b,
|
|
311
311
|
signal: h.signal
|
|
312
312
|
});
|
|
313
|
-
if (!$n(
|
|
314
|
-
throw new Fn(
|
|
315
|
-
if (
|
|
316
|
-
return
|
|
317
|
-
if (
|
|
313
|
+
if (!$n(r.status))
|
|
314
|
+
throw new Fn(r.status);
|
|
315
|
+
if (r.data?.data)
|
|
316
|
+
return r.data.data;
|
|
317
|
+
if (r.status === Bn)
|
|
318
318
|
return [];
|
|
319
319
|
throw new Mt();
|
|
320
320
|
} catch (V) {
|
|
321
321
|
if (V instanceof DOMException && V.name === "AbortError")
|
|
322
322
|
return [];
|
|
323
|
-
throw Kn(V) ? V : Rn(V) ? new Vn(V, V.config?.url) : Ln(V) ? new Mn(V,
|
|
323
|
+
throw Kn(V) ? V : Rn(V) ? new Vn(V, V.config?.url) : Ln(V) ? new Mn(V, o, n, V) : zn(V) ? new Nn(V, o, n, V) : On(V) ? new Un(V, V) : jn(V) ? new qn(V) : ra.isAxiosError(V) ? (u || console.error("Axios error: " + i, ...V.cause ? [V.cause] : []), new Hn(V)) : (u || console.error("AnzuFatalError: ", V), new Mt(V));
|
|
324
324
|
} finally {
|
|
325
325
|
h = null;
|
|
326
326
|
}
|
|
@@ -331,36 +331,36 @@ const Li = /* @__PURE__ */ et({
|
|
|
331
331
|
};
|
|
332
332
|
}, Ni = (e) => {
|
|
333
333
|
const {
|
|
334
|
-
client:
|
|
335
|
-
system:
|
|
334
|
+
client: p,
|
|
335
|
+
system: o,
|
|
336
336
|
entity: n,
|
|
337
337
|
urlTemplate: i,
|
|
338
338
|
urlParams: v,
|
|
339
|
-
options:
|
|
339
|
+
options: b = {},
|
|
340
340
|
silentConsoleError: $ = !1
|
|
341
341
|
} = e;
|
|
342
|
-
let
|
|
342
|
+
let k = null;
|
|
343
343
|
return {
|
|
344
344
|
executeFetch: async (A, q, z = {}) => {
|
|
345
|
-
|
|
345
|
+
k = new AbortController();
|
|
346
346
|
const {
|
|
347
347
|
urlTemplate: g,
|
|
348
348
|
urlParams: M,
|
|
349
|
-
sortBy:
|
|
349
|
+
sortBy: G = "id",
|
|
350
350
|
sortDesc: V = !0,
|
|
351
351
|
batchSize: Y = 100,
|
|
352
352
|
forceElastic: F = !1
|
|
353
353
|
} = z;
|
|
354
354
|
try {
|
|
355
|
-
const
|
|
355
|
+
const r = q.general.elastic || F ? "/search" : "", d = Lt(M) ? M : v, K = Lt(g) ? g : i;
|
|
356
356
|
if (Ie(K)) throw new Error("Url template is undefined");
|
|
357
|
-
const { pagination:
|
|
357
|
+
const { pagination: D } = Gn(G, V ? _e.Desc : _e.Asc, {
|
|
358
358
|
rowsPerPage: Y
|
|
359
|
-
}), Q = (Ie(
|
|
360
|
-
Q + en(
|
|
359
|
+
}), Q = (Ie(d) ? K : Tn(K, d)) + r, X = [], de = await p().get(
|
|
360
|
+
Q + en(D, A, q),
|
|
361
361
|
{
|
|
362
|
-
...
|
|
363
|
-
signal:
|
|
362
|
+
...b,
|
|
363
|
+
signal: k.signal
|
|
364
364
|
}
|
|
365
365
|
);
|
|
366
366
|
if (!$n(de.status))
|
|
@@ -368,32 +368,32 @@ const Li = /* @__PURE__ */ et({
|
|
|
368
368
|
if (de.data) {
|
|
369
369
|
const se = de.data;
|
|
370
370
|
if (X.push(...se.data), Ga(se))
|
|
371
|
-
for (
|
|
372
|
-
|
|
373
|
-
const Se = (await
|
|
374
|
-
Q + en(
|
|
371
|
+
for (D.value.hasNextPage = se.hasNextPage; D.value.hasNextPage; ) {
|
|
372
|
+
D.value.page++;
|
|
373
|
+
const Se = (await p().get(
|
|
374
|
+
Q + en(D, A, q),
|
|
375
375
|
{
|
|
376
|
-
...
|
|
377
|
-
signal:
|
|
376
|
+
...b,
|
|
377
|
+
signal: k.signal
|
|
378
378
|
}
|
|
379
379
|
)).data;
|
|
380
|
-
X.push(...Se.data),
|
|
380
|
+
X.push(...Se.data), D.value.hasNextPage = Se.hasNextPage;
|
|
381
381
|
}
|
|
382
382
|
else if (Ja(se)) {
|
|
383
|
-
if (
|
|
383
|
+
if (D.value.totalCount = se.totalCount, D.value.totalCount <= D.value.rowsPerPage)
|
|
384
384
|
return X;
|
|
385
|
-
const le = [], Se = Math.ceil(
|
|
386
|
-
for (let
|
|
387
|
-
const I = { ...
|
|
385
|
+
const le = [], Se = Math.ceil(D.value.totalCount / D.value.rowsPerPage);
|
|
386
|
+
for (let w = 1; w < Se; w++) {
|
|
387
|
+
const I = { ...D.value, page: w + 1 }, E = ie(I);
|
|
388
388
|
le.push(
|
|
389
|
-
|
|
390
|
-
...
|
|
391
|
-
signal:
|
|
389
|
+
p().get(Q + en(E, A, q), {
|
|
390
|
+
...b,
|
|
391
|
+
signal: k.signal
|
|
392
392
|
})
|
|
393
393
|
);
|
|
394
394
|
}
|
|
395
|
-
(await Promise.all(le)).forEach((
|
|
396
|
-
X.push(...
|
|
395
|
+
(await Promise.all(le)).forEach((w) => {
|
|
396
|
+
X.push(...w.data.data);
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
399
|
return X;
|
|
@@ -401,28 +401,28 @@ const Li = /* @__PURE__ */ et({
|
|
|
401
401
|
if (de.status === Bn)
|
|
402
402
|
return [];
|
|
403
403
|
throw new Mt();
|
|
404
|
-
} catch (
|
|
405
|
-
if (
|
|
404
|
+
} catch (r) {
|
|
405
|
+
if (r instanceof DOMException && r.name === "AbortError")
|
|
406
406
|
return [];
|
|
407
|
-
throw Kn(
|
|
407
|
+
throw Kn(r) ? r : Rn(r) ? new Vn(r, r.config?.url) : Ln(r) ? new Mn(r, o, n, r) : zn(r) ? new Nn(r, o, n, r) : On(r) ? new Un(r, r) : jn(r) ? new qn(r) : ra.isAxiosError(r) ? ($ || console.error("Axios error: " + i, ...r.cause ? [r.cause] : []), new Hn(r)) : ($ || console.error("AnzuFatalError: ", r), new Mt(r));
|
|
408
408
|
} finally {
|
|
409
|
-
|
|
409
|
+
k = null;
|
|
410
410
|
}
|
|
411
411
|
},
|
|
412
412
|
abortFetch: () => {
|
|
413
|
-
|
|
413
|
+
k && k.abort();
|
|
414
414
|
}
|
|
415
415
|
};
|
|
416
416
|
}, Bt = "/adm/v1/job", Kt = "job";
|
|
417
|
-
function Oi(e,
|
|
417
|
+
function Oi(e, p) {
|
|
418
418
|
return {
|
|
419
|
-
useFetchJobList: () => Za({ client: e, system:
|
|
420
|
-
fetchJob: (
|
|
421
|
-
createJob: (
|
|
422
|
-
const $ = Xa(
|
|
423
|
-
return Ya(e,
|
|
419
|
+
useFetchJobList: () => Za({ client: e, system: p, entity: Kt, urlTemplate: Bt }),
|
|
420
|
+
fetchJob: (b) => Qa(e, Bt + "/:id", { id: b }, p, Kt),
|
|
421
|
+
createJob: (b) => {
|
|
422
|
+
const $ = Xa(b._resourceName).slice(4).replace("-kind-", "-kind/");
|
|
423
|
+
return Ya(e, b, Bt + "/:type", { type: $ }, p, Kt);
|
|
424
424
|
},
|
|
425
|
-
deleteJob: (
|
|
425
|
+
deleteJob: (b) => Wa(e, Bt + "/:id", { id: b }, p, Kt)
|
|
426
426
|
};
|
|
427
427
|
}
|
|
428
428
|
const Ho = {
|
|
@@ -436,61 +436,61 @@ const Ho = {
|
|
|
436
436
|
customI18n: void 0,
|
|
437
437
|
showExpand: !1
|
|
438
438
|
};
|
|
439
|
-
function Jo(e,
|
|
440
|
-
const v = { ...Go, ...i },
|
|
441
|
-
let
|
|
442
|
-
ao(v.storeColumnsLocalStorage) ?
|
|
439
|
+
function Jo(e, p, o, n, i = {}) {
|
|
440
|
+
const v = { ...Go, ...i }, b = v.customI18n ?? _a, { t: $ } = b.global || b;
|
|
441
|
+
let k;
|
|
442
|
+
ao(v.storeColumnsLocalStorage) ? k = v.storeColumnsLocalStorage : oo(v.storeColumnsLocalStorage) && v.storeColumnsLocalStorage === !0 && (k = "table_" + o + "_" + n);
|
|
443
443
|
const u = e.map((z) => {
|
|
444
444
|
const g = { ...Ho, ...z };
|
|
445
|
-
return Ie(g.title) && (Ie(g.title) && eo.includes(g.key) ? g.title = $("common.model.tracking." + g.key) : Ie(g.title) &&
|
|
445
|
+
return Ie(g.title) && (Ie(g.title) && eo.includes(g.key) ? g.title = $("common.model.tracking." + g.key) : Ie(g.title) && o && n ? g.title = $(o + "." + n + ".model." + g.key) : g.title = ""), g;
|
|
446
446
|
}), h = x(() => {
|
|
447
447
|
const z = [];
|
|
448
448
|
return v.showExpand && z.push({ key: "data-table-expand", sortable: !1 }), u.forEach((g) => {
|
|
449
|
-
|
|
449
|
+
p.value.includes(g.key) || z.push(g);
|
|
450
450
|
}), v.disableActions || z.push({ key: "actions", sortable: !1, fixed: "end" }), z;
|
|
451
451
|
}), A = () => {
|
|
452
|
-
if (!
|
|
453
|
-
const z = localStorage.getItem(
|
|
452
|
+
if (!k || !localStorage) return;
|
|
453
|
+
const z = localStorage.getItem(k);
|
|
454
454
|
if (!z) return;
|
|
455
455
|
const g = JSON.parse(z);
|
|
456
|
-
to(g) && no(g.hidden) && (
|
|
456
|
+
to(g) && no(g.hidden) && (p.value = g.hidden);
|
|
457
457
|
}, q = (z) => {
|
|
458
|
-
!
|
|
458
|
+
!k || !localStorage || localStorage.setItem(k, JSON.stringify({ hidden: z }));
|
|
459
459
|
};
|
|
460
460
|
return an(() => {
|
|
461
461
|
A();
|
|
462
|
-
}), Ee(
|
|
462
|
+
}), Ee(p, (z) => {
|
|
463
463
|
q(z);
|
|
464
464
|
}), {
|
|
465
465
|
columnsAll: u,
|
|
466
466
|
columnsVisible: h,
|
|
467
|
-
columnsHidden:
|
|
467
|
+
columnsHidden: p
|
|
468
468
|
};
|
|
469
469
|
}
|
|
470
|
-
function Ui(e,
|
|
471
|
-
const h = ie(!1), A = ie([]), q = ie([]), z = ie(!1), { pagination: g, setSortBy: M, incrementPage:
|
|
470
|
+
function Ui(e, p, o, n, i, v, b, $ = null, k = void 0, u = !1) {
|
|
471
|
+
const h = ie(!1), A = ie([]), q = ie([]), z = ie(!1), { pagination: g, setSortBy: M, incrementPage: G } = Gn(
|
|
472
472
|
St($) ? null : $.key,
|
|
473
473
|
$?.order
|
|
474
|
-
), { resetFilter: V, submitFilter: Y } = lo(v,
|
|
474
|
+
), { resetFilter: V, submitFilter: Y } = lo(v, b, {
|
|
475
475
|
storeFiltersLocalStorage: !1,
|
|
476
476
|
populateUrlParams: !1
|
|
477
|
-
}), { showErrorsDefault: F } = Jn(), { columnsVisible:
|
|
477
|
+
}), { showErrorsDefault: F } = Jn(), { columnsVisible: r, columnsAll: d, columnsHidden: K } = Jo(
|
|
478
478
|
e,
|
|
479
|
-
|
|
480
|
-
|
|
479
|
+
p,
|
|
480
|
+
o,
|
|
481
481
|
n,
|
|
482
482
|
{ storeColumnsLocalStorage: !1, disableActions: !u }
|
|
483
|
-
),
|
|
483
|
+
), D = () => {
|
|
484
484
|
de(), le();
|
|
485
|
-
}, Q = (
|
|
486
|
-
M(
|
|
485
|
+
}, Q = (P) => {
|
|
486
|
+
M(P.sortBy), le();
|
|
487
487
|
}, X = async () => {
|
|
488
|
-
z.value = !0,
|
|
488
|
+
z.value = !0, G();
|
|
489
489
|
try {
|
|
490
|
-
const
|
|
491
|
-
A.value.push(...
|
|
492
|
-
} catch (
|
|
493
|
-
F(
|
|
490
|
+
const P = await i(g, v, b, k);
|
|
491
|
+
A.value.push(...P);
|
|
492
|
+
} catch (P) {
|
|
493
|
+
F(P);
|
|
494
494
|
} finally {
|
|
495
495
|
z.value = !1;
|
|
496
496
|
}
|
|
@@ -502,11 +502,11 @@ function Ui(e, C, l, n, i, v, p, $ = null, b = void 0, u = !1) {
|
|
|
502
502
|
A.value = await i(
|
|
503
503
|
g,
|
|
504
504
|
v,
|
|
505
|
-
|
|
506
|
-
|
|
505
|
+
b,
|
|
506
|
+
k
|
|
507
507
|
);
|
|
508
|
-
} catch (
|
|
509
|
-
F(
|
|
508
|
+
} catch (P) {
|
|
509
|
+
F(P);
|
|
510
510
|
} finally {
|
|
511
511
|
z.value = !1;
|
|
512
512
|
}
|
|
@@ -517,24 +517,24 @@ function Ui(e, C, l, n, i, v, p, $ = null, b = void 0, u = !1) {
|
|
|
517
517
|
items: A,
|
|
518
518
|
selected: q,
|
|
519
519
|
pagination: g,
|
|
520
|
-
columnsVisible:
|
|
520
|
+
columnsVisible: r,
|
|
521
521
|
columnsHidden: K,
|
|
522
|
-
columnsAll:
|
|
522
|
+
columnsAll: d,
|
|
523
523
|
filterTouched: h,
|
|
524
524
|
loading: z,
|
|
525
|
-
onRowClick: (
|
|
526
|
-
const
|
|
527
|
-
if (!
|
|
525
|
+
onRowClick: (P) => {
|
|
526
|
+
const w = P.target;
|
|
527
|
+
if (!w || w.tagName === "INPUT" && w.type === "checkbox")
|
|
528
528
|
return;
|
|
529
|
-
const I =
|
|
529
|
+
const I = w.closest(".v-data-table__tr");
|
|
530
530
|
if (!I || !I.classList.contains("v-data-table__tr")) return;
|
|
531
|
-
const
|
|
532
|
-
if (!
|
|
533
|
-
const T =
|
|
531
|
+
const E = I.firstElementChild;
|
|
532
|
+
if (!E || !E.classList.contains("v-data-table__td")) return;
|
|
533
|
+
const T = E.querySelector("input");
|
|
534
534
|
T && T.click();
|
|
535
535
|
},
|
|
536
536
|
onFetchNextPage: X,
|
|
537
|
-
onOpen:
|
|
537
|
+
onOpen: D,
|
|
538
538
|
sortByChange: Q,
|
|
539
539
|
getList: le,
|
|
540
540
|
resetFilter: () => V(g, le),
|
|
@@ -558,70 +558,70 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
558
558
|
autoOpen: { type: Boolean, default: !1 }
|
|
559
559
|
},
|
|
560
560
|
emits: ["update:modelValue", "update:pagination", "onOpen", "onPageChange", "onConfirm", "onFetchNextPage"],
|
|
561
|
-
setup(e, { expose:
|
|
562
|
-
const n = e, i =
|
|
561
|
+
setup(e, { expose: p, emit: o }) {
|
|
562
|
+
const n = e, i = o, v = ie(!1), b = x({
|
|
563
563
|
get() {
|
|
564
564
|
return Ie(n.modelValue) ? v.value : n.modelValue;
|
|
565
565
|
},
|
|
566
|
-
set(
|
|
567
|
-
v.value =
|
|
566
|
+
set(D) {
|
|
567
|
+
v.value = D, i("update:modelValue", D);
|
|
568
568
|
}
|
|
569
569
|
}), $ = x({
|
|
570
570
|
get: () => n.pagination,
|
|
571
|
-
set: (
|
|
572
|
-
i("update:pagination", { ...Cn(
|
|
571
|
+
set: (D) => {
|
|
572
|
+
i("update:pagination", { ...Cn(D) });
|
|
573
573
|
}
|
|
574
|
-
}), { mdAndDown:
|
|
575
|
-
|
|
574
|
+
}), { mdAndDown: k } = da(), u = ie(!k.value), h = () => {
|
|
575
|
+
k.value && (u.value = !1);
|
|
576
576
|
};
|
|
577
577
|
nn(io, h);
|
|
578
578
|
const { t: A } = ot(), q = x(() => n.selectedItems.length), z = x(() => q.value < n.minCount || q.value > n.maxCount), g = () => {
|
|
579
|
-
i("onOpen"), u.value = !
|
|
579
|
+
i("onOpen"), u.value = !k.value, b.value = !0;
|
|
580
580
|
}, M = () => {
|
|
581
581
|
u.value = !u.value;
|
|
582
|
-
},
|
|
583
|
-
|
|
582
|
+
}, G = () => {
|
|
583
|
+
b.value = !1;
|
|
584
584
|
}, V = () => {
|
|
585
585
|
i(
|
|
586
586
|
"onConfirm",
|
|
587
|
-
n.selectedItems.map((
|
|
588
|
-
),
|
|
587
|
+
n.selectedItems.map((D) => Cn(D))
|
|
588
|
+
), G();
|
|
589
589
|
}, Y = () => {
|
|
590
590
|
i("onFetchNextPage");
|
|
591
591
|
}, F = () => {
|
|
592
592
|
i("onPageChange");
|
|
593
|
-
},
|
|
594
|
-
|
|
593
|
+
}, r = x(() => Math.ceil($.value.totalCount / $.value.rowsPerPage)), d = x(() => !(St($.value.hasNextPage) && $.value.page === r.value || $.value.hasNextPage === !1)), K = (D) => {
|
|
594
|
+
D && d.value && !n.loading && Y();
|
|
595
595
|
};
|
|
596
596
|
return an(() => {
|
|
597
597
|
n.autoOpen && g();
|
|
598
|
-
}),
|
|
598
|
+
}), p({
|
|
599
599
|
open: g,
|
|
600
600
|
closeSidebarOnMobile: h
|
|
601
|
-
}), (
|
|
601
|
+
}), (D, Q) => {
|
|
602
602
|
const X = xn("ABtnSecondary"), de = xn("ABtnPrimary");
|
|
603
603
|
return S(), N(xe, null, [
|
|
604
|
-
U(
|
|
604
|
+
U(D.$slots, "activator", {
|
|
605
605
|
props: { onClick: ue(() => g(), ["stop"]) }
|
|
606
606
|
}),
|
|
607
|
-
c(sn, fe(
|
|
608
|
-
"model-value":
|
|
607
|
+
c(sn, fe(D.$attrs, {
|
|
608
|
+
"model-value": b.value,
|
|
609
609
|
fullscreen: "",
|
|
610
610
|
class: "subject-select",
|
|
611
611
|
"onUpdate:modelValue": Q[1] || (Q[1] = (se) => i("update:modelValue", se))
|
|
612
612
|
}), {
|
|
613
613
|
default: f(() => [
|
|
614
|
-
|
|
614
|
+
b.value ? (S(), ne(ln, {
|
|
615
615
|
key: 0,
|
|
616
616
|
class: "subject-select__card"
|
|
617
617
|
}, {
|
|
618
618
|
default: f(() => [
|
|
619
619
|
c(so, {
|
|
620
620
|
class: "subject-select__toolbar system-border-b",
|
|
621
|
-
onOnCancel:
|
|
621
|
+
onOnCancel: G
|
|
622
622
|
}, {
|
|
623
623
|
default: f(() => [
|
|
624
|
-
U(
|
|
624
|
+
U(D.$slots, "title", {}, () => [
|
|
625
625
|
te(L(m(A)(e.dialogTitleT)), 1)
|
|
626
626
|
])
|
|
627
627
|
]),
|
|
@@ -635,7 +635,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
635
635
|
class: "system-border-b subject-select__second-bar"
|
|
636
636
|
}, {
|
|
637
637
|
default: f(() => [
|
|
638
|
-
U(
|
|
638
|
+
U(D.$slots, "second-bar", {}, () => [
|
|
639
639
|
O("div", Wo, [
|
|
640
640
|
O("div", Xo, [
|
|
641
641
|
O("div", Yo, [
|
|
@@ -662,10 +662,10 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
662
662
|
]),
|
|
663
663
|
_: 1
|
|
664
664
|
}),
|
|
665
|
-
U(
|
|
665
|
+
U(D.$slots, "second-bar-left")
|
|
666
666
|
]),
|
|
667
667
|
O("div", Qo, [
|
|
668
|
-
U(
|
|
668
|
+
U(D.$slots, "second-bar-right")
|
|
669
669
|
])
|
|
670
670
|
])
|
|
671
671
|
])
|
|
@@ -678,11 +678,11 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
678
678
|
}, [
|
|
679
679
|
O("div", Zo, [
|
|
680
680
|
O("div", _o, [
|
|
681
|
-
U(
|
|
681
|
+
U(D.$slots, "filter")
|
|
682
682
|
])
|
|
683
683
|
]),
|
|
684
684
|
O("div", el, [
|
|
685
|
-
U(
|
|
685
|
+
U(D.$slots, "content"),
|
|
686
686
|
e.paginationMode === "more" ? (S(), N("div", tl, [
|
|
687
687
|
So((S(), ne(X, {
|
|
688
688
|
loading: e.loading,
|
|
@@ -690,13 +690,13 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
690
690
|
onClick: Y
|
|
691
691
|
}, {
|
|
692
692
|
default: f(() => [
|
|
693
|
-
U(
|
|
693
|
+
U(D.$slots, "button-confirm-title", {}, () => [
|
|
694
694
|
te(L(m(A)("common.button.loadMore")), 1)
|
|
695
695
|
])
|
|
696
696
|
]),
|
|
697
697
|
_: 3
|
|
698
698
|
}, 8, ["loading"])), [
|
|
699
|
-
[Ao,
|
|
699
|
+
[Ao, d.value || e.loading],
|
|
700
700
|
[
|
|
701
701
|
Fo,
|
|
702
702
|
K,
|
|
@@ -727,7 +727,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
727
727
|
onClick: ue(V, ["stop"])
|
|
728
728
|
}, {
|
|
729
729
|
default: f(() => [
|
|
730
|
-
U(
|
|
730
|
+
U(D.$slots, "button-confirm-title", {}, () => [
|
|
731
731
|
te(L(m(A)("common.button.confirm")), 1)
|
|
732
732
|
])
|
|
733
733
|
]),
|
|
@@ -817,8 +817,8 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
817
817
|
modelModifiers: {}
|
|
818
818
|
}),
|
|
819
819
|
emits: /* @__PURE__ */ Xe(["edit", "deleted", "close", "item-saved", "item-expand"], ["update:modelValue"]),
|
|
820
|
-
setup(e, { expose:
|
|
821
|
-
const n = e, i =
|
|
820
|
+
setup(e, { expose: p, emit: o }) {
|
|
821
|
+
const n = e, i = o, v = gt(e, "modelValue"), { t: b } = ot(), $ = la(), k = da(), u = zt("rootEl"), h = x(() => k.platform.value.touch), A = n.editor ?? ro({
|
|
822
822
|
get: () => v.value,
|
|
823
823
|
set: (a) => v.value = a,
|
|
824
824
|
factory: n.factory,
|
|
@@ -831,7 +831,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
831
831
|
), M = x(() => {
|
|
832
832
|
const a = n.position;
|
|
833
833
|
return a === void 0 || a === !1 ? "position" : typeof a == "object" ? a.field : a;
|
|
834
|
-
}),
|
|
834
|
+
}), G = x(
|
|
835
835
|
() => v.value.map((a, j) => ({
|
|
836
836
|
key: z(a),
|
|
837
837
|
index: j,
|
|
@@ -840,25 +840,25 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
840
840
|
}))
|
|
841
841
|
), V = /* @__PURE__ */ new Set(), Y = (a) => {
|
|
842
842
|
const j = /* @__PURE__ */ new Set(), y = /* @__PURE__ */ new Set();
|
|
843
|
-
let
|
|
843
|
+
let be = 0;
|
|
844
844
|
for (const Ue of a) {
|
|
845
845
|
if (Ue.key === void 0 || Ue.key === null) {
|
|
846
|
-
|
|
846
|
+
be++;
|
|
847
847
|
continue;
|
|
848
848
|
}
|
|
849
849
|
j.has(Ue.key) && y.add(String(Ue.key)), j.add(Ue.key);
|
|
850
850
|
}
|
|
851
|
-
if (
|
|
852
|
-
const He = `${
|
|
853
|
-
V.has(He) || (V.add(He),
|
|
854
|
-
`[list-editor] ${
|
|
851
|
+
if (be === 0 && y.size === 0) return;
|
|
852
|
+
const He = `${be}|${[...y].sort().join(",")}`;
|
|
853
|
+
V.has(He) || (V.add(He), be > 0 && console.warn(
|
|
854
|
+
`[list-editor] ${be} row(s) resolve to an undefined key (key-field "${g.value}"). Point get-key at a field every item has, or give new items unique temp ids (see nextListEditorTempId).`
|
|
855
855
|
), y.size > 0 && console.warn(
|
|
856
856
|
`[list-editor] duplicate row keys (key-field "${g.value}"): ${[...y].join(", ")}. Row keys must be unique — dirty tracking and validation rails target rows by key.`
|
|
857
857
|
));
|
|
858
858
|
};
|
|
859
|
-
Ee(
|
|
860
|
-
const F = ie(/* @__PURE__ */ new Set()),
|
|
861
|
-
editingKeys:
|
|
859
|
+
Ee(G, (a) => Y(a), { immediate: !0 });
|
|
860
|
+
const F = ie(/* @__PURE__ */ new Set()), r = zt("rowsContainer"), d = x(() => !n.chips && !!$.item), K = x(() => !n.chips && !!$["item-readonly"]), {
|
|
861
|
+
editingKeys: D,
|
|
862
862
|
editingSnapshots: Q,
|
|
863
863
|
beginEdit: X,
|
|
864
864
|
cancelEdit: de,
|
|
@@ -866,9 +866,9 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
866
866
|
closeEdit: le,
|
|
867
867
|
requestAutoOpen: Se
|
|
868
868
|
} = Wn({
|
|
869
|
-
rowsContainer:
|
|
869
|
+
rowsContainer: r,
|
|
870
870
|
rowSelector: ".a-le-row",
|
|
871
|
-
isInlineEdit:
|
|
871
|
+
isInlineEdit: d,
|
|
872
872
|
restoreSnapshot: (a, j) => A.updateItem(a, j),
|
|
873
873
|
watchKeys: () => v.value.map((a) => z(a)),
|
|
874
874
|
findEntry: (a) => {
|
|
@@ -878,31 +878,31 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
878
878
|
afterAutoOpen: (a) => {
|
|
879
879
|
F.value.delete(a);
|
|
880
880
|
}
|
|
881
|
-
}),
|
|
882
|
-
() => n.addLabel ?
|
|
883
|
-
),
|
|
884
|
-
() => n.deleteConfirmTitle ??
|
|
885
|
-
),
|
|
886
|
-
() => n.deleteConfirmText ?? (n.deleteMode === "immediate" ?
|
|
881
|
+
}), P = x(
|
|
882
|
+
() => n.addLabel ? b(n.addLabel) : b("common.sortable.add")
|
|
883
|
+
), w = x(() => n.emptyTitle ?? b("common.sortable.emptyTitle")), I = x(
|
|
884
|
+
() => n.deleteConfirmTitle ?? b("common.sortable.deleteConfirmTitle")
|
|
885
|
+
), E = x(
|
|
886
|
+
() => n.deleteConfirmText ?? (n.deleteMode === "immediate" ? b("common.sortable.deleteConfirmText") : b("common.sortable.deleteConfirmTextDeferred"))
|
|
887
887
|
), T = x(() => !n.readonly && !n.disabled && !n.loading), W = x(() => T.value && n.showAddButton), Z = A.unsavedCount, me = x(
|
|
888
888
|
() => !n.readonly && !n.disableUnsaved && Z.value > 0
|
|
889
|
-
), oe = x(() => !!(n.title || $.header) || me.value),
|
|
889
|
+
), oe = x(() => !!(n.title || $.header) || me.value), ye = x(() => !!n.onItemSave), Ce = /* @__PURE__ */ new Map(), we = x(() => {
|
|
890
890
|
const a = [], j = /* @__PURE__ */ new Set();
|
|
891
|
-
for (const y of
|
|
891
|
+
for (const y of G.value) {
|
|
892
892
|
j.add(y.key);
|
|
893
|
-
const
|
|
894
|
-
if (Be && Be.raw === y.raw && Be.index === y.index && Be.position === y.position && Be.editing ===
|
|
893
|
+
const be = D.value.has(y.key), He = F.value.has(y.key), Ue = n.loadingKeys?.has(y.key) ?? !1, Qe = n.disableUnsaved || n.readonly ? !1 : A.isUnsaved(y.key), Le = Qe, Dt = A.rowState(y.raw, y.key, be), Be = Ce.get(y.key);
|
|
894
|
+
if (Be && Be.raw === y.raw && Be.index === y.index && Be.position === y.position && Be.editing === be && Be.expanded === He && Be.loading === Ue && Be.dirty === Le && Be.unsaved === Qe && Be.validationState === Dt) {
|
|
895
895
|
a.push(Be);
|
|
896
896
|
continue;
|
|
897
897
|
}
|
|
898
898
|
const ft = {
|
|
899
899
|
...y,
|
|
900
|
-
editing:
|
|
900
|
+
editing: be,
|
|
901
901
|
expanded: He,
|
|
902
902
|
loading: Ue,
|
|
903
903
|
dirty: Le,
|
|
904
904
|
unsaved: Qe,
|
|
905
|
-
validationState:
|
|
905
|
+
validationState: Dt
|
|
906
906
|
};
|
|
907
907
|
Ce.set(y.key, ft), a.push(ft);
|
|
908
908
|
}
|
|
@@ -914,7 +914,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
914
914
|
variant: "flat",
|
|
915
915
|
isReorderMode: ie(!1),
|
|
916
916
|
disabled: x(() => !T.value),
|
|
917
|
-
isEditing: (a) =>
|
|
917
|
+
isEditing: (a) => D.value.has(a),
|
|
918
918
|
onToggleEdit: (a) => {
|
|
919
919
|
const j = Ae(a);
|
|
920
920
|
j && Je(j);
|
|
@@ -929,11 +929,11 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
929
929
|
T.value && (Se(), A.addItem(void 0, { afterId: a.key }));
|
|
930
930
|
}, Je = (a) => {
|
|
931
931
|
if (T.value) {
|
|
932
|
-
if (
|
|
932
|
+
if (D.value.has(a.key)) {
|
|
933
933
|
_(a);
|
|
934
934
|
return;
|
|
935
935
|
}
|
|
936
|
-
|
|
936
|
+
d.value && (X(a), F.value.delete(a.key)), i("edit", a);
|
|
937
937
|
}
|
|
938
938
|
}, dt = (a) => {
|
|
939
939
|
if (n.disabled || n.loading) return;
|
|
@@ -941,7 +941,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
941
941
|
if (y)
|
|
942
942
|
F.value.delete(j);
|
|
943
943
|
else {
|
|
944
|
-
for (const
|
|
944
|
+
for (const be of F.value) F.value.delete(be);
|
|
945
945
|
F.value.add(j);
|
|
946
946
|
}
|
|
947
947
|
i("item-expand", a, !y);
|
|
@@ -964,19 +964,19 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
964
964
|
onDeleteConfirm: (a) => n.onDeleteConfirm ? n.onDeleteConfirm(a) : !0,
|
|
965
965
|
onDelete: (a) => n.onDelete?.(a),
|
|
966
966
|
onDeleted: (a) => {
|
|
967
|
-
|
|
967
|
+
D.value.delete(a.key), Q.value.delete(a.key), F.value.delete(a.key), A.deleteItem(a.key, { trackDeleted: n.deleteMode === "deferred" }), i("deleted", a);
|
|
968
968
|
},
|
|
969
969
|
disableDeleteConfirm: () => n.disableDeleteConfirm || n.chips
|
|
970
|
-
}),
|
|
970
|
+
}), C = async (a) => {
|
|
971
971
|
T.value && await bt(a);
|
|
972
972
|
}, B = async (a) => {
|
|
973
973
|
n.onItemSave && await n.onItemSave(a.raw), se(a), i("item-saved", a);
|
|
974
|
-
},
|
|
974
|
+
}, J = (a) => {
|
|
975
975
|
de(a);
|
|
976
976
|
}, _ = (a) => {
|
|
977
977
|
le(a), F.value.delete(a.key), i("close", a);
|
|
978
|
-
},
|
|
979
|
-
let j =
|
|
978
|
+
}, H = /* @__PURE__ */ new Map(), ve = (a) => {
|
|
979
|
+
let j = H.get(a);
|
|
980
980
|
return j || (j = {
|
|
981
981
|
edit: () => {
|
|
982
982
|
const y = Ae(a);
|
|
@@ -988,7 +988,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
988
988
|
},
|
|
989
989
|
cancel: () => {
|
|
990
990
|
const y = Ae(a);
|
|
991
|
-
y &&
|
|
991
|
+
y && J(y);
|
|
992
992
|
},
|
|
993
993
|
close: () => {
|
|
994
994
|
const y = Ae(a);
|
|
@@ -996,7 +996,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
996
996
|
},
|
|
997
997
|
delete: async () => {
|
|
998
998
|
const y = Ae(a);
|
|
999
|
-
y && await
|
|
999
|
+
y && await C(y);
|
|
1000
1000
|
},
|
|
1001
1001
|
addAfter: () => {
|
|
1002
1002
|
const y = Ae(a);
|
|
@@ -1007,18 +1007,18 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1007
1007
|
y && dt(y);
|
|
1008
1008
|
},
|
|
1009
1009
|
update: (y) => A.updateItem(a, y)
|
|
1010
|
-
},
|
|
1010
|
+
}, H.set(a, j)), j;
|
|
1011
1011
|
};
|
|
1012
1012
|
Ee(
|
|
1013
1013
|
() => we.value,
|
|
1014
1014
|
(a) => {
|
|
1015
|
-
if (
|
|
1015
|
+
if (H.size === 0) return;
|
|
1016
1016
|
const j = new Set(a.map((y) => y.key));
|
|
1017
|
-
for (const y of
|
|
1018
|
-
j.has(y) ||
|
|
1017
|
+
for (const y of H.keys())
|
|
1018
|
+
j.has(y) || H.delete(y);
|
|
1019
1019
|
}
|
|
1020
1020
|
);
|
|
1021
|
-
const
|
|
1021
|
+
const he = (a) => ({
|
|
1022
1022
|
item: a,
|
|
1023
1023
|
raw: a.raw,
|
|
1024
1024
|
index: a.index,
|
|
@@ -1036,14 +1036,14 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1036
1036
|
() => n.unsavedSectionLabel && !n.disableUnsaved ? { label: n.unsavedSectionLabel, dirty: A.hasUnsaved.value } : []
|
|
1037
1037
|
);
|
|
1038
1038
|
const ge = () => aa(A, (a) => {
|
|
1039
|
-
const j =
|
|
1039
|
+
const j = G.value.find((y) => y.key === a);
|
|
1040
1040
|
j && X(j);
|
|
1041
1041
|
});
|
|
1042
1042
|
return Zn({
|
|
1043
1043
|
hasErrors: A.hasErrors,
|
|
1044
1044
|
validationScope: n.validationScope,
|
|
1045
1045
|
reveal: ge
|
|
1046
|
-
}),
|
|
1046
|
+
}), p({
|
|
1047
1047
|
...A,
|
|
1048
1048
|
validateAll: ge
|
|
1049
1049
|
}), (a, j) => (S(), N("div", {
|
|
@@ -1061,7 +1061,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1061
1061
|
}, [
|
|
1062
1062
|
O("div", {
|
|
1063
1063
|
ref_key: "rowsContainer",
|
|
1064
|
-
ref:
|
|
1064
|
+
ref: r,
|
|
1065
1065
|
class: "a-le-card"
|
|
1066
1066
|
}, [
|
|
1067
1067
|
oe.value ? (S(), N("div", ll, [
|
|
@@ -1072,7 +1072,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1072
1072
|
key: 0,
|
|
1073
1073
|
class: "a-le-unsaved-count",
|
|
1074
1074
|
"data-unsaved-count": m(Z)
|
|
1075
|
-
}, L(m(
|
|
1075
|
+
}, L(m(b)("common.sortable.pendingChanges", { count: m(Z) })), 9, sl)) : ee("", !0)
|
|
1076
1076
|
])) : ee("", !0),
|
|
1077
1077
|
e.loading ? (S(), N("div", rl, [
|
|
1078
1078
|
c(fa, {
|
|
@@ -1099,8 +1099,8 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1099
1099
|
actions: { add: $e }
|
|
1100
1100
|
}, () => [
|
|
1101
1101
|
c(_n, {
|
|
1102
|
-
title:
|
|
1103
|
-
"add-label":
|
|
1102
|
+
title: w.value,
|
|
1103
|
+
"add-label": P.value,
|
|
1104
1104
|
"can-add": W.value,
|
|
1105
1105
|
onAdd: $e
|
|
1106
1106
|
}, null, 8, ["title", "add-label", "can-add"])
|
|
@@ -1109,7 +1109,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1109
1109
|
key: String(y.key),
|
|
1110
1110
|
class: "a-le-row-wrapper"
|
|
1111
1111
|
}, [
|
|
1112
|
-
U(a.$slots, "before-item", fe({ ref_for: !0 },
|
|
1112
|
+
U(a.$slots, "before-item", fe({ ref_for: !0 }, he(y))),
|
|
1113
1113
|
O("div", {
|
|
1114
1114
|
"data-id": String(y.key),
|
|
1115
1115
|
role: "listitem",
|
|
@@ -1122,14 +1122,14 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1122
1122
|
"a-le-row--clickable": pt(y),
|
|
1123
1123
|
[`a-le-row--validation-${y.validationState}`]: y.validationState !== null
|
|
1124
1124
|
}]),
|
|
1125
|
-
onKeydown: (
|
|
1125
|
+
onKeydown: (be) => m(Te).handleKeydown(y.key, be)
|
|
1126
1126
|
}, [
|
|
1127
1127
|
O("div", {
|
|
1128
1128
|
class: "a-le-row-header",
|
|
1129
|
-
onClick: (
|
|
1129
|
+
onClick: (be) => Fe(y)
|
|
1130
1130
|
}, [
|
|
1131
1131
|
O("div", vl, [
|
|
1132
|
-
U(a.$slots, "item-compact", fe({ ref_for: !0 },
|
|
1132
|
+
U(a.$slots, "item-compact", fe({ ref_for: !0 }, he(y)), () => [
|
|
1133
1133
|
O("span", ml, L(Ve(y.raw)), 1)
|
|
1134
1134
|
]),
|
|
1135
1135
|
y.unsaved ? (S(), ne(ea, {
|
|
@@ -1138,12 +1138,12 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1138
1138
|
}, null, 8, ["dot-only"])) : ee("", !0)
|
|
1139
1139
|
]),
|
|
1140
1140
|
e.chips ? ee("", !0) : (S(), N("div", yl, [
|
|
1141
|
-
U(a.$slots, "item-status", fe({ ref_for: !0 },
|
|
1141
|
+
U(a.$slots, "item-status", fe({ ref_for: !0 }, he(y)), () => [
|
|
1142
1142
|
e.statusField && y.raw[e.statusField] != null && y.raw[e.statusField] !== "" ? (S(), N("span", hl, L(y.raw[e.statusField]), 1)) : ee("", !0)
|
|
1143
1143
|
])
|
|
1144
1144
|
])),
|
|
1145
1145
|
O("div", gl, [
|
|
1146
|
-
U(a.$slots, "item-actions", fe({ ref_for: !0 },
|
|
1146
|
+
U(a.$slots, "item-actions", fe({ ref_for: !0 }, he(y)), () => [
|
|
1147
1147
|
e.chips && e.showDeleteButton && T.value ? (S(), ne(re, {
|
|
1148
1148
|
key: 0,
|
|
1149
1149
|
icon: "",
|
|
@@ -1152,7 +1152,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1152
1152
|
density: "compact",
|
|
1153
1153
|
active: !1,
|
|
1154
1154
|
class: "a-le-action a-le-action--chip-close",
|
|
1155
|
-
onClick: ue((
|
|
1155
|
+
onClick: ue((be) => C(y), ["stop"])
|
|
1156
1156
|
}, {
|
|
1157
1157
|
default: f(() => [
|
|
1158
1158
|
c(ce, {
|
|
@@ -1170,7 +1170,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1170
1170
|
color: "primary",
|
|
1171
1171
|
density: "comfortable",
|
|
1172
1172
|
class: "mx-1 a-le-action a-le-action--edit",
|
|
1173
|
-
onClick: ue((
|
|
1173
|
+
onClick: ue((be) => Je(y), ["stop"])
|
|
1174
1174
|
}, {
|
|
1175
1175
|
default: f(() => [
|
|
1176
1176
|
c(ce, {
|
|
@@ -1180,7 +1180,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1180
1180
|
c(qe, {
|
|
1181
1181
|
activator: "parent",
|
|
1182
1182
|
location: "bottom",
|
|
1183
|
-
text: m(
|
|
1183
|
+
text: m(b)("common.sortable.edit")
|
|
1184
1184
|
}, null, 8, ["text"])
|
|
1185
1185
|
]),
|
|
1186
1186
|
_: 1
|
|
@@ -1192,7 +1192,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1192
1192
|
variant: "text",
|
|
1193
1193
|
density: "comfortable",
|
|
1194
1194
|
class: "mx-1 a-le-action a-le-action--delete",
|
|
1195
|
-
onClick: ue((
|
|
1195
|
+
onClick: ue((be) => C(y), ["stop"])
|
|
1196
1196
|
}, {
|
|
1197
1197
|
default: f(() => [
|
|
1198
1198
|
c(ce, {
|
|
@@ -1202,7 +1202,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1202
1202
|
c(qe, {
|
|
1203
1203
|
activator: "parent",
|
|
1204
1204
|
location: "bottom",
|
|
1205
|
-
text: m(
|
|
1205
|
+
text: m(b)("common.sortable.delete")
|
|
1206
1206
|
}, null, 8, ["text"])
|
|
1207
1207
|
]),
|
|
1208
1208
|
_: 1
|
|
@@ -1224,14 +1224,14 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1224
1224
|
c(qe, {
|
|
1225
1225
|
activator: "parent",
|
|
1226
1226
|
location: "bottom",
|
|
1227
|
-
text: m(
|
|
1227
|
+
text: m(b)("common.sortable.more")
|
|
1228
1228
|
}, null, 8, ["text"]),
|
|
1229
1229
|
c(Nt, { activator: "parent" }, {
|
|
1230
1230
|
default: f(() => [
|
|
1231
1231
|
c(It, { density: "compact" }, {
|
|
1232
1232
|
default: f(() => [
|
|
1233
1233
|
c(je, {
|
|
1234
|
-
onClick: (
|
|
1234
|
+
onClick: (be) => ze(y)
|
|
1235
1235
|
}, {
|
|
1236
1236
|
prepend: f(() => [
|
|
1237
1237
|
c(ce, { icon: "mdi-plus" })
|
|
@@ -1239,7 +1239,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1239
1239
|
default: f(() => [
|
|
1240
1240
|
c(Ge, null, {
|
|
1241
1241
|
default: f(() => [
|
|
1242
|
-
te(L(m(
|
|
1242
|
+
te(L(m(b)("common.sortable.addAfter")), 1)
|
|
1243
1243
|
]),
|
|
1244
1244
|
_: 1
|
|
1245
1245
|
})
|
|
@@ -1262,19 +1262,19 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1262
1262
|
(y.editing || e.defaultExpanded) && a.$slots.item ? (S(), N(xe, { key: 0 }, [
|
|
1263
1263
|
O("div", pl, [
|
|
1264
1264
|
O("div", bl, [
|
|
1265
|
-
U(a.$slots, "item", fe({ ref_for: !0 },
|
|
1265
|
+
U(a.$slots, "item", fe({ ref_for: !0 }, he(y)))
|
|
1266
1266
|
])
|
|
1267
1267
|
]),
|
|
1268
|
-
U(a.$slots, "item-footer", fe({ ref_for: !0 },
|
|
1269
|
-
|
|
1268
|
+
U(a.$slots, "item-footer", fe({ ref_for: !0 }, he(y)), () => [
|
|
1269
|
+
ye.value && !e.defaultExpanded ? (S(), N("div", kl, [
|
|
1270
1270
|
j[1] || (j[1] = O("div", { class: "a-le-row-footer-spacer" }, null, -1)),
|
|
1271
1271
|
c(re, {
|
|
1272
1272
|
variant: "text",
|
|
1273
1273
|
disabled: y.loading,
|
|
1274
|
-
onClick: ue((
|
|
1274
|
+
onClick: ue((be) => J(y), ["stop"])
|
|
1275
1275
|
}, {
|
|
1276
1276
|
default: f(() => [
|
|
1277
|
-
te(L(m(
|
|
1277
|
+
te(L(m(b)("common.button.cancel")), 1)
|
|
1278
1278
|
]),
|
|
1279
1279
|
_: 1
|
|
1280
1280
|
}, 8, ["disabled", "onClick"]),
|
|
@@ -1283,10 +1283,10 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1283
1283
|
variant: "flat",
|
|
1284
1284
|
"prepend-icon": "mdi-check",
|
|
1285
1285
|
disabled: y.loading,
|
|
1286
|
-
onClick: ue((
|
|
1286
|
+
onClick: ue((be) => B(y), ["stop"])
|
|
1287
1287
|
}, {
|
|
1288
1288
|
default: f(() => [
|
|
1289
|
-
te(L(m(
|
|
1289
|
+
te(L(m(b)("common.button.save")), 1)
|
|
1290
1290
|
]),
|
|
1291
1291
|
_: 1
|
|
1292
1292
|
}, 8, ["disabled", "onClick"])
|
|
@@ -1294,11 +1294,11 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1294
1294
|
])
|
|
1295
1295
|
], 64)) : a.$slots["item-readonly"] && (e.readonly || y.expanded) ? (S(), N("div", wl, [
|
|
1296
1296
|
O("div", Cl, [
|
|
1297
|
-
U(a.$slots, "item-readonly", fe({ ref_for: !0 },
|
|
1297
|
+
U(a.$slots, "item-readonly", fe({ ref_for: !0 }, he(y)))
|
|
1298
1298
|
])
|
|
1299
1299
|
])) : ee("", !0)
|
|
1300
1300
|
], 42, ul),
|
|
1301
|
-
U(a.$slots, "after-item", fe({ ref_for: !0 },
|
|
1301
|
+
U(a.$slots, "after-item", fe({ ref_for: !0 }, he(y)))
|
|
1302
1302
|
]))), 128)),
|
|
1303
1303
|
W.value && !e.loading && !e.error && !Oe.value ? U(a.$slots, "add-button", {
|
|
1304
1304
|
key: 5,
|
|
@@ -1316,7 +1316,7 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1316
1316
|
icon: "mdi-plus",
|
|
1317
1317
|
size: "18"
|
|
1318
1318
|
}),
|
|
1319
|
-
O("span", null, L(
|
|
1319
|
+
O("span", null, L(P.value), 1)
|
|
1320
1320
|
])
|
|
1321
1321
|
]) : ee("", !0)
|
|
1322
1322
|
], 512),
|
|
@@ -1324,67 +1324,67 @@ const Wo = { class: "d-flex flex-column w-100 px-1 align-center" }, Xo = { class
|
|
|
1324
1324
|
modelValue: m(Ye),
|
|
1325
1325
|
"onUpdate:modelValue": j[0] || (j[0] = (y) => ia(Ye) ? Ye.value = y : null),
|
|
1326
1326
|
title: I.value,
|
|
1327
|
-
text:
|
|
1328
|
-
"confirm-label": m(
|
|
1329
|
-
"cancel-label": m(
|
|
1327
|
+
text: E.value,
|
|
1328
|
+
"confirm-label": m(b)("common.sortable.delete"),
|
|
1329
|
+
"cancel-label": m(b)("common.button.cancel"),
|
|
1330
1330
|
error: m(ct),
|
|
1331
1331
|
"in-flight": m(tt),
|
|
1332
1332
|
onConfirm: m(lt),
|
|
1333
1333
|
onCancel: m(ut)
|
|
1334
1334
|
}, null, 8, ["modelValue", "title", "text", "confirm-label", "cancel-label", "error", "in-flight", "onConfirm", "onCancel"]),
|
|
1335
|
-
O("div", xl, L(m(Te).grabbedKey.value !== null ? m(
|
|
1335
|
+
O("div", xl, L(m(Te).grabbedKey.value !== null ? m(b)("common.sortable.keyboardGrab.status", {
|
|
1336
1336
|
n: m(Te).grabbedIndex.value + 1,
|
|
1337
1337
|
total: m(Te).totalCount.value
|
|
1338
1338
|
}) : ""), 1)
|
|
1339
1339
|
], 2));
|
|
1340
1340
|
}
|
|
1341
1341
|
}), Sl = "id", Al = "position", Il = "parent";
|
|
1342
|
-
function
|
|
1343
|
-
const
|
|
1344
|
-
if (!
|
|
1345
|
-
let
|
|
1346
|
-
for (const I of
|
|
1347
|
-
const
|
|
1348
|
-
|
|
1342
|
+
function Dl(e, p) {
|
|
1343
|
+
const o = p.keyField ?? Sl, n = p.getKey, i = p.positionField ?? Al, v = p.parentField ?? Il, b = p.positionMultiplier ?? 1, $ = p.maxDepth, k = (P) => n ? n(P) : P[o], u = (P) => {
|
|
1344
|
+
if (!P.children || P.children.length === 0) return 1;
|
|
1345
|
+
let w = 0;
|
|
1346
|
+
for (const I of P.children) {
|
|
1347
|
+
const E = u(I);
|
|
1348
|
+
E > w && (w = E);
|
|
1349
1349
|
}
|
|
1350
|
-
return
|
|
1351
|
-
}, h = (
|
|
1352
|
-
for (const
|
|
1353
|
-
if (
|
|
1354
|
-
if (
|
|
1355
|
-
const T = h(
|
|
1350
|
+
return w + 1;
|
|
1351
|
+
}, h = (P, w = e.value.children, I = null) => {
|
|
1352
|
+
for (const E of w) {
|
|
1353
|
+
if (k(E.data) === P) return { node: E, parent: I };
|
|
1354
|
+
if (E.children && E.children.length > 0) {
|
|
1355
|
+
const T = h(P, E.children, E);
|
|
1356
1356
|
if (T.node) return T;
|
|
1357
1357
|
}
|
|
1358
1358
|
}
|
|
1359
1359
|
return { node: null, parent: null };
|
|
1360
|
-
}, A = (
|
|
1361
|
-
let
|
|
1362
|
-
for (const I of
|
|
1363
|
-
I.data[i] !==
|
|
1364
|
-
}, q = (
|
|
1365
|
-
const
|
|
1360
|
+
}, A = (P) => {
|
|
1361
|
+
let w = 1 * b;
|
|
1362
|
+
for (const I of P)
|
|
1363
|
+
I.data[i] !== w && (I.data[i] = w, I.meta.dirty = !0), w += b;
|
|
1364
|
+
}, q = (P) => {
|
|
1365
|
+
const w = (I) => {
|
|
1366
1366
|
A(I);
|
|
1367
|
-
for (const
|
|
1367
|
+
for (const E of I) E.children && E.children.length && w(E.children);
|
|
1368
1368
|
};
|
|
1369
|
-
|
|
1370
|
-
}, z = (
|
|
1371
|
-
const
|
|
1372
|
-
return q(
|
|
1373
|
-
}, g = (
|
|
1374
|
-
const
|
|
1375
|
-
let
|
|
1369
|
+
w(P.children);
|
|
1370
|
+
}, z = (P) => {
|
|
1371
|
+
const w = Re(P);
|
|
1372
|
+
return q(w), w;
|
|
1373
|
+
}, g = (P) => {
|
|
1374
|
+
const w = [], I = p.expandedKeys?.value;
|
|
1375
|
+
let E = 0;
|
|
1376
1376
|
const T = (W, Z, me) => {
|
|
1377
1377
|
for (let oe = 0; oe < W.length; oe++) {
|
|
1378
|
-
const
|
|
1379
|
-
|
|
1378
|
+
const ye = W[oe], Ce = k(ye.data), we = !Ie(ye.children), Oe = we && (ye.children?.length ?? 0) > 0, Ae = ye.children?.length ?? 0, Te = I ? I.has(Ce) : !0, Ve = $ - (Z + 1), $e = we && Ve > 0, ze = Z > 0, Je = oe > 0;
|
|
1379
|
+
w.push({
|
|
1380
1380
|
key: Ce,
|
|
1381
|
-
index:
|
|
1382
|
-
raw:
|
|
1383
|
-
position:
|
|
1384
|
-
node:
|
|
1381
|
+
index: E++,
|
|
1382
|
+
raw: ye.data,
|
|
1383
|
+
position: ye.data[i],
|
|
1384
|
+
node: ye,
|
|
1385
1385
|
depth: Z,
|
|
1386
1386
|
parent: me?.data ?? null,
|
|
1387
|
-
parentKey: me ?
|
|
1387
|
+
parentKey: me ? k(me.data) : null,
|
|
1388
1388
|
childrenCount: Ae,
|
|
1389
1389
|
hasChildren: Oe,
|
|
1390
1390
|
childrenAllowed: we,
|
|
@@ -1395,89 +1395,89 @@ function Pl(e, C) {
|
|
|
1395
1395
|
canAddChild: $e,
|
|
1396
1396
|
canIndent: Je,
|
|
1397
1397
|
canOutdent: ze
|
|
1398
|
-
}), Oe && Te && T(
|
|
1398
|
+
}), Oe && Te && T(ye.children, Z + 1, ye);
|
|
1399
1399
|
}
|
|
1400
1400
|
};
|
|
1401
|
-
return T(
|
|
1402
|
-
}, M = x(() => g(e.value)),
|
|
1403
|
-
|
|
1404
|
-
}, V = (
|
|
1405
|
-
if (!
|
|
1406
|
-
if (
|
|
1407
|
-
const I =
|
|
1408
|
-
return I === -1 ?
|
|
1401
|
+
return T(P.children, 0, null), w;
|
|
1402
|
+
}, M = x(() => g(e.value)), G = (P, w, I) => {
|
|
1403
|
+
P.splice(w + 1, 0, I);
|
|
1404
|
+
}, V = (P, w) => {
|
|
1405
|
+
if (!w) return P.length;
|
|
1406
|
+
if (w.afterId !== void 0) {
|
|
1407
|
+
const I = P.findIndex((E) => k(E.data) === w.afterId);
|
|
1408
|
+
return I === -1 ? P.length : I + 1;
|
|
1409
1409
|
}
|
|
1410
|
-
return
|
|
1411
|
-
}, Y = (
|
|
1412
|
-
const I = Re(e.value),
|
|
1413
|
-
data: Re(
|
|
1414
|
-
children:
|
|
1410
|
+
return w.afterIndex !== void 0 ? w.afterIndex < 0 ? P.length : Math.min(w.afterIndex + 1, P.length) : w.index !== void 0 ? Math.max(0, Math.min(w.index, P.length)) : P.length;
|
|
1411
|
+
}, Y = (P, w) => {
|
|
1412
|
+
const I = Re(e.value), E = w?.childrenAllowed ?? !0, T = {
|
|
1413
|
+
data: Re(P),
|
|
1414
|
+
children: E ? [] : void 0,
|
|
1415
1415
|
meta: { dirty: !1 }
|
|
1416
1416
|
};
|
|
1417
1417
|
let W = I.children, Z = null;
|
|
1418
|
-
if (
|
|
1419
|
-
const { node: oe } = h(
|
|
1418
|
+
if (w?.parentId !== void 0 && w.parentId !== null) {
|
|
1419
|
+
const { node: oe } = h(w.parentId, I.children);
|
|
1420
1420
|
oe && oe.children && (W = oe.children, Z = oe);
|
|
1421
1421
|
}
|
|
1422
|
-
if (
|
|
1423
|
-
const { node: oe, parent:
|
|
1422
|
+
if (w?.afterId !== void 0) {
|
|
1423
|
+
const { node: oe, parent: ye } = h(w.afterId, I.children);
|
|
1424
1424
|
if (oe) {
|
|
1425
|
-
const Ce =
|
|
1425
|
+
const Ce = ye ? ye.children : I.children, we = Ce.indexOf(oe);
|
|
1426
1426
|
if (we !== -1)
|
|
1427
|
-
return
|
|
1427
|
+
return G(Ce, we, T), T.data[v] = ye ? k(ye.data) : null, A(Ce), e.value = I, I;
|
|
1428
1428
|
}
|
|
1429
1429
|
}
|
|
1430
|
-
const me =
|
|
1431
|
-
return W.splice(me, 0, T), T.data[v] = Z ?
|
|
1432
|
-
}, F = (
|
|
1433
|
-
const
|
|
1434
|
-
if (!I) return
|
|
1435
|
-
const T =
|
|
1436
|
-
return W === -1 || (T.splice(W, 1), A(T), e.value =
|
|
1437
|
-
},
|
|
1438
|
-
const
|
|
1439
|
-
return T && (T.data = Re(
|
|
1440
|
-
},
|
|
1441
|
-
const { node:
|
|
1442
|
-
if (!
|
|
1443
|
-
const W = T ? T.children :
|
|
1430
|
+
const me = w?.asFirstChild ? 0 : V(W, w);
|
|
1431
|
+
return W.splice(me, 0, T), T.data[v] = Z ? k(Z.data) : null, A(W), e.value = I, I;
|
|
1432
|
+
}, F = (P) => {
|
|
1433
|
+
const w = Re(e.value), { node: I, parent: E } = h(P, w.children);
|
|
1434
|
+
if (!I) return w;
|
|
1435
|
+
const T = E ? E.children : w.children, W = T.indexOf(I);
|
|
1436
|
+
return W === -1 || (T.splice(W, 1), A(T), e.value = w), w;
|
|
1437
|
+
}, r = (P, w, I = !0) => {
|
|
1438
|
+
const E = Re(e.value), { node: T } = h(P, E.children);
|
|
1439
|
+
return T && (T.data = Re(w), I && (T.meta.dirty = !0), e.value = E), E;
|
|
1440
|
+
}, d = (P, w, I) => {
|
|
1441
|
+
const { node: E, parent: T } = h(w, P.children);
|
|
1442
|
+
if (!E) return null;
|
|
1443
|
+
const W = T ? T.children : P.children, Z = W.indexOf(E);
|
|
1444
1444
|
if (Z === -1) return null;
|
|
1445
1445
|
const me = I(W, Z);
|
|
1446
1446
|
if (me === null || me === Z) return null;
|
|
1447
1447
|
const [oe] = W.splice(Z, 1);
|
|
1448
|
-
return W.splice(me, 0, oe), A(W),
|
|
1449
|
-
}, K = (
|
|
1450
|
-
const
|
|
1448
|
+
return W.splice(me, 0, oe), A(W), P;
|
|
1449
|
+
}, K = (P) => {
|
|
1450
|
+
const w = Re(e.value), I = d(w, P, (E, T) => T > 0 ? T - 1 : null);
|
|
1451
1451
|
return I && (e.value = I), I;
|
|
1452
|
-
},
|
|
1453
|
-
const
|
|
1452
|
+
}, D = (P) => {
|
|
1453
|
+
const w = Re(e.value), I = d(w, P, (E, T) => T < E.length - 1 ? T + 1 : null);
|
|
1454
1454
|
return I && (e.value = I), I;
|
|
1455
|
-
}, Q = (
|
|
1456
|
-
const
|
|
1455
|
+
}, Q = (P) => {
|
|
1456
|
+
const w = Re(e.value), I = d(w, P, (E, T) => T > 0 ? 0 : null);
|
|
1457
1457
|
return I && (e.value = I), I;
|
|
1458
|
-
}, X = (
|
|
1459
|
-
const
|
|
1458
|
+
}, X = (P) => {
|
|
1459
|
+
const w = Re(e.value), I = d(w, P, (E, T) => T < E.length - 1 ? E.length - 1 : null);
|
|
1460
1460
|
return I && (e.value = I), I;
|
|
1461
|
-
}, de = (
|
|
1462
|
-
const
|
|
1461
|
+
}, de = (P) => {
|
|
1462
|
+
const w = Re(e.value), { node: I, parent: E } = h(P, w.children);
|
|
1463
1463
|
if (!I) return null;
|
|
1464
|
-
const T =
|
|
1464
|
+
const T = E ? E.children : w.children, W = T.indexOf(I);
|
|
1465
1465
|
if (W <= 0) return null;
|
|
1466
1466
|
const Z = T[W - 1];
|
|
1467
1467
|
if (Ie(Z.children)) return null;
|
|
1468
1468
|
const me = u(I);
|
|
1469
|
-
return le(
|
|
1470
|
-
}, se = (
|
|
1471
|
-
const
|
|
1472
|
-
if (!I || !
|
|
1473
|
-
const { parent: T } = h(
|
|
1469
|
+
return le(w, k(Z.data)) + 1 + me > $ ? null : (T.splice(W, 1), Z.children.push(I), I.data[v] = k(Z.data), I.meta.dirty = !0, A(T), A(Z.children), e.value = w, w);
|
|
1470
|
+
}, se = (P) => {
|
|
1471
|
+
const w = Re(e.value), { node: I, parent: E } = h(P, w.children);
|
|
1472
|
+
if (!I || !E) return null;
|
|
1473
|
+
const { parent: T } = h(k(E.data), w.children), W = T ? T.children : w.children, Z = W.indexOf(E);
|
|
1474
1474
|
if (Z === -1) return null;
|
|
1475
|
-
const me =
|
|
1476
|
-
return oe === -1 ? null : (me.splice(oe, 1), W.splice(Z + 1, 0, I), I.data[v] = T ?
|
|
1477
|
-
}, le = (
|
|
1478
|
-
const I = (
|
|
1479
|
-
for (const W of
|
|
1480
|
-
if (
|
|
1475
|
+
const me = E.children, oe = me.indexOf(I);
|
|
1476
|
+
return oe === -1 ? null : (me.splice(oe, 1), W.splice(Z + 1, 0, I), I.data[v] = T ? k(T.data) : null, I.meta.dirty = !0, A(me), A(W), e.value = w, w);
|
|
1477
|
+
}, le = (P, w) => {
|
|
1478
|
+
const I = (E, T) => {
|
|
1479
|
+
for (const W of E) {
|
|
1480
|
+
if (k(W.data) === w) return T;
|
|
1481
1481
|
if (W.children && W.children.length) {
|
|
1482
1482
|
const Z = I(W.children, T + 1);
|
|
1483
1483
|
if (Z !== null) return Z;
|
|
@@ -1485,292 +1485,292 @@ function Pl(e, C) {
|
|
|
1485
1485
|
}
|
|
1486
1486
|
return null;
|
|
1487
1487
|
};
|
|
1488
|
-
return I(
|
|
1488
|
+
return I(P.children, 0) ?? 0;
|
|
1489
1489
|
};
|
|
1490
1490
|
return {
|
|
1491
1491
|
viewItems: M,
|
|
1492
1492
|
findNode: h,
|
|
1493
1493
|
addItem: Y,
|
|
1494
1494
|
deleteItem: F,
|
|
1495
|
-
updateItem:
|
|
1495
|
+
updateItem: r,
|
|
1496
1496
|
moveUp: K,
|
|
1497
|
-
moveDown:
|
|
1497
|
+
moveDown: D,
|
|
1498
1498
|
moveTop: Q,
|
|
1499
1499
|
moveBottom: X,
|
|
1500
1500
|
indent: de,
|
|
1501
1501
|
outdent: se,
|
|
1502
|
-
moveTo: (
|
|
1503
|
-
const
|
|
1502
|
+
moveTo: (P, w, I) => {
|
|
1503
|
+
const E = Re(e.value), { node: T, parent: W } = h(P, E.children);
|
|
1504
1504
|
if (!T) return null;
|
|
1505
|
-
if (
|
|
1505
|
+
if (w !== null) {
|
|
1506
1506
|
const Ve = ($e) => {
|
|
1507
1507
|
if (!$e.children) return !1;
|
|
1508
1508
|
for (const ze of $e.children)
|
|
1509
|
-
if (
|
|
1509
|
+
if (k(ze.data) === w || Ve(ze)) return !0;
|
|
1510
1510
|
return !1;
|
|
1511
1511
|
};
|
|
1512
|
-
if (
|
|
1512
|
+
if (k(T.data) === w || Ve(T)) return null;
|
|
1513
1513
|
}
|
|
1514
1514
|
let Z, me = null, oe = 0;
|
|
1515
|
-
if (
|
|
1516
|
-
Z =
|
|
1515
|
+
if (w === null)
|
|
1516
|
+
Z = E.children, oe = 0;
|
|
1517
1517
|
else {
|
|
1518
|
-
const { node: Ve } = h(
|
|
1518
|
+
const { node: Ve } = h(w, E.children);
|
|
1519
1519
|
if (!Ve || Ie(Ve.children)) return null;
|
|
1520
|
-
Z = Ve.children, me = Ve, oe = le(
|
|
1520
|
+
Z = Ve.children, me = Ve, oe = le(E, w) + 1;
|
|
1521
1521
|
}
|
|
1522
|
-
const
|
|
1523
|
-
if (oe +
|
|
1524
|
-
const Ce = W ? W.children :
|
|
1522
|
+
const ye = u(T);
|
|
1523
|
+
if (oe + ye > $) return null;
|
|
1524
|
+
const Ce = W ? W.children : E.children, we = Ce.indexOf(T);
|
|
1525
1525
|
if (we === -1) return null;
|
|
1526
1526
|
const Oe = Ce === Z, [Ae] = Ce.splice(we, 1);
|
|
1527
1527
|
let Te = I;
|
|
1528
|
-
return Oe && we < I && (Te = I - 1), Te = Math.max(0, Math.min(Te, Z.length)), Z.splice(Te, 0, Ae), Ae.data[v] = me ?
|
|
1528
|
+
return Oe && we < I && (Te = I - 1), Te = Math.max(0, Math.min(Te, Z.length)), Z.splice(Te, 0, Ae), Ae.data[v] = me ? k(me.data) : null, Ae.meta.dirty = !0, Oe || A(Ce), A(Z), e.value = E, E;
|
|
1529
1529
|
},
|
|
1530
1530
|
recalculatePositions: z,
|
|
1531
1531
|
calculateSubtreeDepth: u
|
|
1532
1532
|
};
|
|
1533
1533
|
}
|
|
1534
|
-
const
|
|
1535
|
-
const
|
|
1534
|
+
const Pl = (e) => {
|
|
1535
|
+
const p = [], o = (n) => {
|
|
1536
1536
|
for (const i of n)
|
|
1537
|
-
|
|
1537
|
+
p.push(i.data), i.children && i.children.length && o(i.children);
|
|
1538
1538
|
};
|
|
1539
|
-
return
|
|
1540
|
-
}, st = (e,
|
|
1541
|
-
const
|
|
1539
|
+
return o(e.children), p;
|
|
1540
|
+
}, st = (e, p) => {
|
|
1541
|
+
const o = (n) => {
|
|
1542
1542
|
for (const i of n)
|
|
1543
|
-
|
|
1543
|
+
p(i), i.children && i.children.length && o(i.children);
|
|
1544
1544
|
};
|
|
1545
|
-
|
|
1545
|
+
o(e.children);
|
|
1546
1546
|
};
|
|
1547
1547
|
function El(e) {
|
|
1548
|
-
const
|
|
1548
|
+
const p = typeof e.getKey == "function" ? null : e.getKey ?? "id", o = (C) => typeof e.getKey == "function" ? e.getKey(C) : C[p], n = p ?? "id", i = e.position ?? "position", v = i !== !1, b = typeof i == "object" ? i.field : i === !1 ? "position" : i, $ = typeof i == "object" && i.multiplier ? i.multiplier : 1, k = e.parentField ?? "parent", u = x({
|
|
1549
1549
|
get: () => e.get(),
|
|
1550
|
-
set: (
|
|
1551
|
-
}), h =
|
|
1550
|
+
set: (C) => e.set(C)
|
|
1551
|
+
}), h = Dl(u, {
|
|
1552
1552
|
keyField: n,
|
|
1553
1553
|
// Pass the controller's keyOf so tree ops resolve keys identically to
|
|
1554
1554
|
// invalidKeys/dirty tracking — supports a function get-key, not just a field.
|
|
1555
|
-
getKey:
|
|
1556
|
-
positionField:
|
|
1557
|
-
parentField:
|
|
1555
|
+
getKey: o,
|
|
1556
|
+
positionField: b,
|
|
1557
|
+
parentField: k,
|
|
1558
1558
|
positionMultiplier: $,
|
|
1559
1559
|
maxDepth: e.maxDepth
|
|
1560
|
-
}), A = x(() =>
|
|
1561
|
-
const B = { ...
|
|
1562
|
-
v && delete B[
|
|
1563
|
-
for (const
|
|
1560
|
+
}), A = x(() => Pl(e.get())), q = h.viewItems, z = x(() => Io(e.dirtyExclude) ?? []), g = (C) => {
|
|
1561
|
+
const B = { ...C };
|
|
1562
|
+
v && delete B[b], delete B[k];
|
|
1563
|
+
for (const J of z.value) delete B[J];
|
|
1564
1564
|
return JSON.stringify(B);
|
|
1565
|
-
}, M = ie(/* @__PURE__ */ new Map()),
|
|
1566
|
-
const B = /* @__PURE__ */ new Map(),
|
|
1567
|
-
for (const
|
|
1568
|
-
const ge =
|
|
1569
|
-
B.set(ge, g(
|
|
1565
|
+
}, M = ie(/* @__PURE__ */ new Map()), G = ie(/* @__PURE__ */ new Map()), V = ie(null), Y = (C) => Re(C), F = (C) => {
|
|
1566
|
+
const B = /* @__PURE__ */ new Map(), J = /* @__PURE__ */ new Map(), _ = (H, ve) => {
|
|
1567
|
+
for (const he of H) {
|
|
1568
|
+
const ge = o(he.data);
|
|
1569
|
+
B.set(ge, g(he.data)), J.set(ge, ve), he.children && he.children.length && _(he.children, ge);
|
|
1570
1570
|
}
|
|
1571
1571
|
};
|
|
1572
|
-
_(
|
|
1572
|
+
_(C.children, null), M.value = B, G.value = J, V.value = Y(C);
|
|
1573
1573
|
};
|
|
1574
1574
|
F(e.get()), Ee(
|
|
1575
1575
|
z,
|
|
1576
1576
|
() => {
|
|
1577
1577
|
if (!V.value) return;
|
|
1578
|
-
const
|
|
1579
|
-
st(V.value, (B) =>
|
|
1578
|
+
const C = /* @__PURE__ */ new Map();
|
|
1579
|
+
st(V.value, (B) => C.set(o(B.data), g(B.data))), M.value = C;
|
|
1580
1580
|
},
|
|
1581
1581
|
{ flush: "sync" }
|
|
1582
1582
|
);
|
|
1583
|
-
const
|
|
1583
|
+
const r = ie(!1), d = Do(/* @__PURE__ */ new Map()), K = (C, B, J) => {
|
|
1584
1584
|
if (e.isDirty) {
|
|
1585
|
-
const
|
|
1586
|
-
return e.isDirty(
|
|
1585
|
+
const H = se(B);
|
|
1586
|
+
return e.isDirty(C.data, H);
|
|
1587
1587
|
}
|
|
1588
1588
|
const _ = M.value.get(B);
|
|
1589
|
-
return !!(_ === void 0 || _ !== g(
|
|
1590
|
-
},
|
|
1589
|
+
return !!(_ === void 0 || _ !== g(C.data) || G.value.has(B) && (G.value.get(B) ?? null ?? null) !== (J ?? null));
|
|
1590
|
+
}, D = ie(/* @__PURE__ */ new Map()), Q = ie(/* @__PURE__ */ new Set()), X = ie(/* @__PURE__ */ new Set());
|
|
1591
1591
|
Ee(
|
|
1592
1592
|
() => e.get(),
|
|
1593
|
-
(
|
|
1593
|
+
(C) => {
|
|
1594
1594
|
const B = /* @__PURE__ */ new Set();
|
|
1595
|
-
st(
|
|
1596
|
-
const ve =
|
|
1597
|
-
if (B.add(ve), !M.value.has(ve) && !
|
|
1598
|
-
const
|
|
1599
|
-
|
|
1595
|
+
st(C, (H) => {
|
|
1596
|
+
const ve = o(H.data);
|
|
1597
|
+
if (B.add(ve), !M.value.has(ve) && !D.value.has(ve) && D.value.set(ve, g(H.data)), !Q.value.has(ve)) {
|
|
1598
|
+
const he = M.value.get(ve) ?? D.value.get(ve);
|
|
1599
|
+
he !== void 0 && he !== g(H.data) && Q.value.add(ve);
|
|
1600
1600
|
}
|
|
1601
1601
|
});
|
|
1602
|
-
const
|
|
1603
|
-
for (const
|
|
1604
|
-
for (const
|
|
1602
|
+
const J = [];
|
|
1603
|
+
for (const H of D.value.keys()) B.has(H) || J.push(H);
|
|
1604
|
+
for (const H of J) D.value.delete(H);
|
|
1605
1605
|
const _ = [];
|
|
1606
|
-
for (const
|
|
1607
|
-
for (const
|
|
1606
|
+
for (const H of X.value) B.has(H) && _.push(H);
|
|
1607
|
+
for (const H of _) X.value.delete(H);
|
|
1608
1608
|
},
|
|
1609
1609
|
{ immediate: !0, deep: !0 }
|
|
1610
1610
|
);
|
|
1611
|
-
const de = (
|
|
1611
|
+
const de = (C) => Q.value.has(C), se = (C) => {
|
|
1612
1612
|
if (!V.value) return;
|
|
1613
1613
|
let B;
|
|
1614
|
-
return st(V.value, (
|
|
1615
|
-
B === void 0 &&
|
|
1614
|
+
return st(V.value, (J) => {
|
|
1615
|
+
B === void 0 && o(J.data) === C && (B = J.data);
|
|
1616
1616
|
}), B;
|
|
1617
|
-
}, le = (
|
|
1617
|
+
}, le = (C) => {
|
|
1618
1618
|
let B = !1;
|
|
1619
|
-
return st(e.get(), (
|
|
1620
|
-
!B &&
|
|
1619
|
+
return st(e.get(), (J) => {
|
|
1620
|
+
!B && o(J.data) === C && (B = !0);
|
|
1621
1621
|
}), B;
|
|
1622
1622
|
}, Se = x(() => {
|
|
1623
|
-
const
|
|
1624
|
-
for (const
|
|
1625
|
-
const ve =
|
|
1626
|
-
K(
|
|
1623
|
+
const C = /* @__PURE__ */ new Set(), B = (J, _) => {
|
|
1624
|
+
for (const H of J) {
|
|
1625
|
+
const ve = o(H.data);
|
|
1626
|
+
K(H, ve, _) && C.add(ve), H.children && H.children.length && B(H.children, ve);
|
|
1627
1627
|
}
|
|
1628
1628
|
};
|
|
1629
|
-
return B(e.get().children, null),
|
|
1630
|
-
}),
|
|
1629
|
+
return B(e.get().children, null), C;
|
|
1630
|
+
}), P = (C) => Se.value.has(C), w = x(
|
|
1631
1631
|
() => Se.value.size > 0 || X.value.size > 0
|
|
1632
1632
|
), I = x(() => {
|
|
1633
|
-
const
|
|
1634
|
-
for (const B of X.value)
|
|
1635
|
-
return
|
|
1636
|
-
}),
|
|
1637
|
-
const
|
|
1638
|
-
if (
|
|
1633
|
+
const C = new Set(Se.value);
|
|
1634
|
+
for (const B of X.value) C.add(B);
|
|
1635
|
+
return C.size;
|
|
1636
|
+
}), E = (C, B) => {
|
|
1637
|
+
const J = d.get(B);
|
|
1638
|
+
if (J) return { invalid: !J(), warning: !1 };
|
|
1639
1639
|
if (!e.validate) return { invalid: !1, warning: !1 };
|
|
1640
|
-
const _ = e.validate(
|
|
1640
|
+
const _ = e.validate(C);
|
|
1641
1641
|
return typeof _ == "boolean" ? { invalid: !_, warning: !1 } : { invalid: !_.valid, warning: _.valid && _.state === "warning" };
|
|
1642
1642
|
}, T = x(() => {
|
|
1643
|
-
const
|
|
1643
|
+
const C = /* @__PURE__ */ new Set();
|
|
1644
1644
|
return st(e.get(), (B) => {
|
|
1645
|
-
const
|
|
1646
|
-
|
|
1647
|
-
}),
|
|
1648
|
-
}), W = x(() => T.value.size > 0), Z = (
|
|
1649
|
-
const { invalid:
|
|
1650
|
-
return
|
|
1651
|
-
}, me = () => (
|
|
1652
|
-
const
|
|
1653
|
-
for (const
|
|
1654
|
-
const ve = { ...
|
|
1655
|
-
ve[
|
|
1645
|
+
const J = o(B.data);
|
|
1646
|
+
E(B.data, J).invalid && C.add(J);
|
|
1647
|
+
}), C;
|
|
1648
|
+
}), W = x(() => T.value.size > 0), Z = (C, B, J = !1) => {
|
|
1649
|
+
const { invalid: _, warning: H } = E(C, B);
|
|
1650
|
+
return _ ? r.value ? "invalid" : J ? null : de(B) || P(B) ? "invalid" : null : H ? "warning" : null;
|
|
1651
|
+
}, me = () => (r.value = !0, T.value.size === 0), oe = () => {
|
|
1652
|
+
const C = [], B = (J, _) => {
|
|
1653
|
+
for (const H of J) {
|
|
1654
|
+
const ve = { ...H.data };
|
|
1655
|
+
ve[k] = _, C.push(ve), H.children && H.children.length && B(H.children, o(H.data));
|
|
1656
1656
|
}
|
|
1657
1657
|
};
|
|
1658
|
-
return B(e.get().children, null),
|
|
1658
|
+
return B(e.get().children, null), C;
|
|
1659
1659
|
};
|
|
1660
1660
|
return {
|
|
1661
1661
|
items: A,
|
|
1662
1662
|
viewItems: q,
|
|
1663
|
-
hasUnsaved:
|
|
1663
|
+
hasUnsaved: w,
|
|
1664
1664
|
unsavedCount: I,
|
|
1665
1665
|
hasErrors: W,
|
|
1666
1666
|
invalidKeys: T,
|
|
1667
|
-
isUnsaved:
|
|
1667
|
+
isUnsaved: P,
|
|
1668
1668
|
rowState: Z,
|
|
1669
1669
|
validateAll: me,
|
|
1670
1670
|
getPayload: () => e.payload ? e.payload(oe()) : oe(),
|
|
1671
1671
|
getChanges: () => {
|
|
1672
|
-
const
|
|
1673
|
-
for (const ge of
|
|
1672
|
+
const C = [], B = [], J = [], _ = [], H = oe(), ve = /* @__PURE__ */ new Map();
|
|
1673
|
+
for (const ge of H) ve.set(o(ge), ge);
|
|
1674
1674
|
st(e.get(), (ge) => {
|
|
1675
|
-
const a =
|
|
1676
|
-
if (y === void 0 ?
|
|
1677
|
-
const
|
|
1678
|
-
(
|
|
1675
|
+
const a = o(ge.data), j = ve.get(a) ?? ge.data, y = M.value.get(a);
|
|
1676
|
+
if (y === void 0 ? C.push(j) : y !== g(ge.data) && B.push(j), y !== void 0 && ge.meta.dirty && y === g(ge.data) && J.push(j), G.value.has(a)) {
|
|
1677
|
+
const be = G.value.get(a) ?? null, He = j[k];
|
|
1678
|
+
(be ?? null) !== (He ?? null) && _.push(j);
|
|
1679
1679
|
}
|
|
1680
1680
|
});
|
|
1681
|
-
const
|
|
1681
|
+
const he = [];
|
|
1682
1682
|
for (const ge of X.value) {
|
|
1683
1683
|
const a = se(ge);
|
|
1684
|
-
a !== void 0 &&
|
|
1684
|
+
a !== void 0 && he.push(a);
|
|
1685
1685
|
}
|
|
1686
|
-
return { added:
|
|
1686
|
+
return { added: C, updated: B, moved: J, deleted: he, reparented: _ };
|
|
1687
1687
|
},
|
|
1688
|
-
commit: (
|
|
1689
|
-
const B =
|
|
1690
|
-
st(_, (
|
|
1691
|
-
const ve = se(
|
|
1692
|
-
|
|
1693
|
-
}), e.set(_), F(_),
|
|
1688
|
+
commit: (C) => {
|
|
1689
|
+
const B = C ?? e.get(), J = e.normalizeSaved ? e.normalizeSaved(B) : B, _ = Y(J);
|
|
1690
|
+
st(_, (H) => {
|
|
1691
|
+
const ve = se(o(H.data)), he = e.commitKey ? e.commitKey(H.data, ve) : o(H.data);
|
|
1692
|
+
he == null && p && (H.data[n] = co()), H.meta.dirty = !1;
|
|
1693
|
+
}), e.set(_), F(_), D.value = /* @__PURE__ */ new Map(), Q.value = /* @__PURE__ */ new Set(), X.value = /* @__PURE__ */ new Set(), r.value = !1;
|
|
1694
1694
|
},
|
|
1695
|
-
reset: (
|
|
1696
|
-
const B =
|
|
1697
|
-
e.set(B),
|
|
1695
|
+
reset: (C) => {
|
|
1696
|
+
const B = C ?? (V.value ? Y(V.value) : e.get());
|
|
1697
|
+
e.set(B), D.value = /* @__PURE__ */ new Map(), Q.value = /* @__PURE__ */ new Set(), X.value = /* @__PURE__ */ new Set(), r.value = !1;
|
|
1698
1698
|
},
|
|
1699
|
-
addItem: (
|
|
1700
|
-
const
|
|
1701
|
-
|
|
1699
|
+
addItem: (C, B) => {
|
|
1700
|
+
const J = C ?? e.factory?.();
|
|
1701
|
+
J !== void 0 && h.addItem(J, B);
|
|
1702
1702
|
},
|
|
1703
|
-
addAfter: (
|
|
1703
|
+
addAfter: (C, B, J = !0) => {
|
|
1704
1704
|
const _ = B ?? e.factory?.();
|
|
1705
|
-
_ !== void 0 && h.addItem(_, { afterId:
|
|
1705
|
+
_ !== void 0 && h.addItem(_, { afterId: C, childrenAllowed: J });
|
|
1706
1706
|
},
|
|
1707
|
-
addChild: (
|
|
1707
|
+
addChild: (C, B, J = !0) => {
|
|
1708
1708
|
const _ = B ?? e.factory?.();
|
|
1709
|
-
_ !== void 0 && h.addItem(_, { parentId:
|
|
1709
|
+
_ !== void 0 && h.addItem(_, { parentId: C, childrenAllowed: J });
|
|
1710
1710
|
},
|
|
1711
|
-
updateItem: (
|
|
1712
|
-
h.updateItem(
|
|
1711
|
+
updateItem: (C, B, J = !0) => {
|
|
1712
|
+
h.updateItem(C, B, J);
|
|
1713
1713
|
},
|
|
1714
|
-
deleteItem: (
|
|
1715
|
-
M.value.has(
|
|
1714
|
+
deleteItem: (C, B) => {
|
|
1715
|
+
M.value.has(C) && B?.trackDeleted !== !1 && le(C) && X.value.add(C), h.deleteItem(C);
|
|
1716
1716
|
},
|
|
1717
|
-
restoreDeleted: (
|
|
1718
|
-
X.value.delete(
|
|
1717
|
+
restoreDeleted: (C) => {
|
|
1718
|
+
X.value.delete(C);
|
|
1719
1719
|
},
|
|
1720
|
-
moveUp: (
|
|
1721
|
-
moveDown: (
|
|
1722
|
-
moveTop: (
|
|
1723
|
-
moveBottom: (
|
|
1724
|
-
indent: (
|
|
1725
|
-
outdent: (
|
|
1726
|
-
moveTo: (
|
|
1720
|
+
moveUp: (C) => h.moveUp(C) !== null,
|
|
1721
|
+
moveDown: (C) => h.moveDown(C) !== null,
|
|
1722
|
+
moveTop: (C) => h.moveTop(C) !== null,
|
|
1723
|
+
moveBottom: (C) => h.moveBottom(C) !== null,
|
|
1724
|
+
indent: (C) => h.indent(C) !== null,
|
|
1725
|
+
outdent: (C) => h.outdent(C) !== null,
|
|
1726
|
+
moveTo: (C, B, J) => h.moveTo(C, B, J) !== null,
|
|
1727
1727
|
recalculatePositions: () => {
|
|
1728
1728
|
e.set(h.recalculatePositions(e.get()));
|
|
1729
1729
|
},
|
|
1730
|
-
registerValidity: (
|
|
1730
|
+
registerValidity: (C, B) => (d.set(C, B), () => d.delete(C)),
|
|
1731
1731
|
findNode: h.findNode,
|
|
1732
1732
|
calculateSubtreeDepth: h.calculateSubtreeDepth
|
|
1733
1733
|
};
|
|
1734
1734
|
}
|
|
1735
|
-
const Ot = (e,
|
|
1736
|
-
let n = Ot(e,
|
|
1735
|
+
const Ot = (e, p) => e.find((o) => o.key === p) ?? null, va = (e, p, o) => {
|
|
1736
|
+
let n = Ot(e, o);
|
|
1737
1737
|
for (; n && n.parentKey !== null; ) {
|
|
1738
|
-
if (n.parentKey ===
|
|
1738
|
+
if (n.parentKey === p) return !0;
|
|
1739
1739
|
n = Ot(e, n.parentKey);
|
|
1740
1740
|
}
|
|
1741
1741
|
return !1;
|
|
1742
|
-
}, Tl = (e,
|
|
1743
|
-
let n = Ot(e,
|
|
1744
|
-
for (; n && n.depth >
|
|
1742
|
+
}, Tl = (e, p, o) => {
|
|
1743
|
+
let n = Ot(e, p);
|
|
1744
|
+
for (; n && n.depth > o; ) {
|
|
1745
1745
|
if (n.parentKey === null) return null;
|
|
1746
1746
|
n = Ot(e, n.parentKey);
|
|
1747
1747
|
}
|
|
1748
|
-
return n && n.depth ===
|
|
1749
|
-
}, $l = (e,
|
|
1750
|
-
for (let i =
|
|
1748
|
+
return n && n.depth === o ? n : null;
|
|
1749
|
+
}, $l = (e, p, o) => o === p || va(e, p, o), Rt = (e, p, o, n) => {
|
|
1750
|
+
for (let i = p; i >= 0 && i < e.length; i += o) {
|
|
1751
1751
|
const v = e[i];
|
|
1752
1752
|
if (!$l(e, n, v.key)) return v;
|
|
1753
1753
|
}
|
|
1754
1754
|
return null;
|
|
1755
1755
|
}, Fl = (e) => {
|
|
1756
1756
|
const {
|
|
1757
|
-
pointer:
|
|
1758
|
-
hoveredRow:
|
|
1757
|
+
pointer: p,
|
|
1758
|
+
hoveredRow: o,
|
|
1759
1759
|
sourceKey: n,
|
|
1760
1760
|
sourceSubtreeDepth: i,
|
|
1761
1761
|
viewItems: v,
|
|
1762
|
-
maxDepth:
|
|
1762
|
+
maxDepth: b,
|
|
1763
1763
|
indentPx: $,
|
|
1764
|
-
containerLeft:
|
|
1764
|
+
containerLeft: k,
|
|
1765
1765
|
containerPaddingLeft: u
|
|
1766
1766
|
} = e;
|
|
1767
|
-
if (
|
|
1768
|
-
const h =
|
|
1767
|
+
if (o.key === n || va(v, n, o.key)) return null;
|
|
1768
|
+
const h = p.y - o.rect.top, A = o.rect.height, q = h < A / 2, z = q ? "top" : "bottom", g = v.findIndex((D) => D.key === o.key), M = q ? Rt(v, g - 1, -1, n) : Rt(v, g, -1, n), G = q ? Rt(v, g, 1, n) : Rt(v, g + 1, 1, n), V = p.x - k - u, Y = Math.round(V / $), F = M ? M.depth + 1 : 0, r = G ? G.depth : 0, d = Math.max(r, Math.min(Y, F));
|
|
1769
1769
|
let K;
|
|
1770
1770
|
if (!M)
|
|
1771
1771
|
K = {
|
|
1772
1772
|
type: "insert",
|
|
1773
|
-
refKey:
|
|
1773
|
+
refKey: o.key,
|
|
1774
1774
|
refEdge: "top",
|
|
1775
1775
|
parentKey: null,
|
|
1776
1776
|
index: 0,
|
|
@@ -1778,42 +1778,42 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
1778
1778
|
makeChild: !1,
|
|
1779
1779
|
levelRowKey: null
|
|
1780
1780
|
};
|
|
1781
|
-
else if (
|
|
1781
|
+
else if (d === M.depth + 1)
|
|
1782
1782
|
K = {
|
|
1783
1783
|
type: "insert",
|
|
1784
|
-
refKey:
|
|
1784
|
+
refKey: o.key,
|
|
1785
1785
|
refEdge: z,
|
|
1786
1786
|
parentKey: M.key,
|
|
1787
1787
|
index: 0,
|
|
1788
|
-
depth:
|
|
1788
|
+
depth: d,
|
|
1789
1789
|
makeChild: !0,
|
|
1790
1790
|
levelRowKey: null
|
|
1791
1791
|
};
|
|
1792
|
-
else if (
|
|
1792
|
+
else if (d === M.depth)
|
|
1793
1793
|
K = {
|
|
1794
1794
|
type: "insert",
|
|
1795
|
-
refKey:
|
|
1795
|
+
refKey: o.key,
|
|
1796
1796
|
refEdge: z,
|
|
1797
1797
|
parentKey: M.parentKey,
|
|
1798
1798
|
index: M.siblingIndex + 1,
|
|
1799
|
-
depth:
|
|
1799
|
+
depth: d,
|
|
1800
1800
|
makeChild: !1,
|
|
1801
1801
|
levelRowKey: M.key
|
|
1802
1802
|
};
|
|
1803
1803
|
else {
|
|
1804
|
-
const
|
|
1805
|
-
|
|
1804
|
+
const D = Tl(v, M.key, d);
|
|
1805
|
+
D ? K = {
|
|
1806
1806
|
type: "insert",
|
|
1807
|
-
refKey:
|
|
1807
|
+
refKey: o.key,
|
|
1808
1808
|
refEdge: z,
|
|
1809
|
-
parentKey:
|
|
1810
|
-
index:
|
|
1811
|
-
depth:
|
|
1809
|
+
parentKey: D.parentKey,
|
|
1810
|
+
index: D.siblingIndex + 1,
|
|
1811
|
+
depth: d,
|
|
1812
1812
|
makeChild: !1,
|
|
1813
|
-
levelRowKey:
|
|
1813
|
+
levelRowKey: D.key
|
|
1814
1814
|
} : K = {
|
|
1815
1815
|
type: "insert",
|
|
1816
|
-
refKey:
|
|
1816
|
+
refKey: o.key,
|
|
1817
1817
|
refEdge: z,
|
|
1818
1818
|
parentKey: M.parentKey,
|
|
1819
1819
|
index: M.siblingIndex + 1,
|
|
@@ -1822,7 +1822,7 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
1822
1822
|
levelRowKey: M.key
|
|
1823
1823
|
};
|
|
1824
1824
|
}
|
|
1825
|
-
return K.depth + i - 1 >=
|
|
1825
|
+
return K.depth + i - 1 >= b ? { type: "blocked", desired: K, reason: "maxDepth" } : K;
|
|
1826
1826
|
}, Bl = ["data-id", "aria-level", "tabindex"], Kl = ["aria-label"], Rl = {
|
|
1827
1827
|
key: 2,
|
|
1828
1828
|
class: "a-nested-list-editor__tree-toggle a-nested-list-editor__tree-toggle--spacer",
|
|
@@ -1853,13 +1853,13 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
1853
1853
|
callbacks: {}
|
|
1854
1854
|
},
|
|
1855
1855
|
setup(e) {
|
|
1856
|
-
const
|
|
1857
|
-
if (typeof
|
|
1858
|
-
return
|
|
1859
|
-
const u =
|
|
1856
|
+
const p = e, o = ma, { t: n } = ot(), i = (k) => `--row-${String(k).replace(/\W/g, "_")}`, v = (k) => {
|
|
1857
|
+
if (typeof p.context.resolveValidation == "function")
|
|
1858
|
+
return p.context.resolveValidation(k, p.vi.key, p.vi.index);
|
|
1859
|
+
const u = k.validationState;
|
|
1860
1860
|
return u === "valid" || u === "invalid" || u === "warning" ? u : null;
|
|
1861
|
-
},
|
|
1862
|
-
return (
|
|
1861
|
+
}, b = () => p.context.buildSlotProps(p.vi), $ = () => p.viewItems.filter((k) => k.parentKey === p.vi.key);
|
|
1862
|
+
return (k, u) => (S(), N("div", {
|
|
1863
1863
|
class: Ne([
|
|
1864
1864
|
"a-le-row-wrapper",
|
|
1865
1865
|
{
|
|
@@ -1872,7 +1872,7 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
1872
1872
|
tabindex: e.context.keyboardNav ? e.context.keyboardNav.rowTabindex(e.vi.key) : void 0,
|
|
1873
1873
|
onKeydown: u[17] || (u[17] = (h) => e.context.keyboardNav ? e.context.keyboardNav.handleKeydown(e.vi.key, h) : void 0)
|
|
1874
1874
|
}, [
|
|
1875
|
-
U(
|
|
1875
|
+
U(k.$slots, "before-item", We(at(b()))),
|
|
1876
1876
|
O("div", {
|
|
1877
1877
|
class: Ne([
|
|
1878
1878
|
"a-le-row",
|
|
@@ -1918,7 +1918,7 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
1918
1918
|
O("span", { class: "a-nested-list-editor__tree-toggle-caret" }, null, -1)
|
|
1919
1919
|
])], 10, Kl)) : e.context.showExpandToggle ? (S(), N("span", Rl)) : ee("", !0),
|
|
1920
1920
|
O("div", Vl, [
|
|
1921
|
-
U(
|
|
1921
|
+
U(k.$slots, "item-compact", We(at(b())), () => [
|
|
1922
1922
|
O("span", Ll, L(e.context.resolveCompactText(e.vi.raw, e.vi.key)), 1)
|
|
1923
1923
|
]),
|
|
1924
1924
|
e.vi.hasChildren ? (S(), N("span", Ml, [
|
|
@@ -1931,12 +1931,12 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
1931
1931
|
e.vi.unsaved ? (S(), ne(ea, { key: 1 })) : ee("", !0)
|
|
1932
1932
|
]),
|
|
1933
1933
|
e.context.reorderMode ? ee("", !0) : (S(), N("div", zl, [
|
|
1934
|
-
U(
|
|
1934
|
+
U(k.$slots, "item-status", We(at(b())), () => [
|
|
1935
1935
|
e.context.statusField && e.vi.raw[e.context.statusField] != null && e.vi.raw[e.context.statusField] !== "" ? (S(), N("span", Nl, L(e.vi.raw[e.context.statusField]), 1)) : ee("", !0)
|
|
1936
1936
|
])
|
|
1937
1937
|
])),
|
|
1938
1938
|
O("div", Ol, [
|
|
1939
|
-
U(
|
|
1939
|
+
U(k.$slots, "item-actions", We(at(b())), () => [
|
|
1940
1940
|
e.context.reorderMode ? (S(), N(xe, { key: 0 }, [
|
|
1941
1941
|
c(re, {
|
|
1942
1942
|
icon: "",
|
|
@@ -2251,13 +2251,13 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2251
2251
|
])
|
|
2252
2252
|
])
|
|
2253
2253
|
]),
|
|
2254
|
-
e.vi.editing && !e.context.reorderMode &&
|
|
2254
|
+
e.vi.editing && !e.context.reorderMode && k.$slots.item ? (S(), N(xe, { key: 0 }, [
|
|
2255
2255
|
O("div", Ul, [
|
|
2256
2256
|
O("div", jl, [
|
|
2257
|
-
U(
|
|
2257
|
+
U(k.$slots, "item", We(at(b())))
|
|
2258
2258
|
])
|
|
2259
2259
|
]),
|
|
2260
|
-
U(
|
|
2260
|
+
U(k.$slots, "item-footer", We(at(b())), () => [
|
|
2261
2261
|
e.context.showInlineSaveFooter ? (S(), N("div", ql, [
|
|
2262
2262
|
u[19] || (u[19] = O("div", { class: "a-le-row-footer-spacer" }, null, -1)),
|
|
2263
2263
|
c(re, {
|
|
@@ -2284,13 +2284,13 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2284
2284
|
}, 8, ["disabled"])
|
|
2285
2285
|
])) : ee("", !0)
|
|
2286
2286
|
])
|
|
2287
|
-
], 64)) :
|
|
2287
|
+
], 64)) : k.$slots["item-readonly"] && (e.context.readonly || e.vi.expanded) && !e.context.reorderMode ? (S(), N("div", Hl, [
|
|
2288
2288
|
O("div", Gl, [
|
|
2289
|
-
U(
|
|
2289
|
+
U(k.$slots, "item-readonly", We(at(b())))
|
|
2290
2290
|
])
|
|
2291
2291
|
])) : ee("", !0)
|
|
2292
2292
|
], 6),
|
|
2293
|
-
U(
|
|
2293
|
+
U(k.$slots, "after-item", We(at(b()))),
|
|
2294
2294
|
e.vi.hasChildren && e.vi.childrenExpanded ? (S(), N("div", {
|
|
2295
2295
|
key: 0,
|
|
2296
2296
|
class: "a-nested-list-editor__children",
|
|
@@ -2300,7 +2300,7 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2300
2300
|
class: Ne([Wl]),
|
|
2301
2301
|
"data-parent-id": String(e.vi.key)
|
|
2302
2302
|
}, [
|
|
2303
|
-
(S(!0), N(xe, null, rt($(), (h) => (S(), ne(m(
|
|
2303
|
+
(S(!0), N(xe, null, rt($(), (h) => (S(), ne(m(o), {
|
|
2304
2304
|
key: String(h.key),
|
|
2305
2305
|
vi: h,
|
|
2306
2306
|
"view-items": e.viewItems,
|
|
@@ -2309,28 +2309,28 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2309
2309
|
callbacks: e.callbacks
|
|
2310
2310
|
}, {
|
|
2311
2311
|
item: f((A) => [
|
|
2312
|
-
U(
|
|
2312
|
+
U(k.$slots, "item", fe({ ref_for: !0 }, A))
|
|
2313
2313
|
]),
|
|
2314
2314
|
"item-compact": f((A) => [
|
|
2315
|
-
U(
|
|
2315
|
+
U(k.$slots, "item-compact", fe({ ref_for: !0 }, A))
|
|
2316
2316
|
]),
|
|
2317
2317
|
"item-readonly": f((A) => [
|
|
2318
|
-
U(
|
|
2318
|
+
U(k.$slots, "item-readonly", fe({ ref_for: !0 }, A))
|
|
2319
2319
|
]),
|
|
2320
2320
|
"item-status": f((A) => [
|
|
2321
|
-
U(
|
|
2321
|
+
U(k.$slots, "item-status", fe({ ref_for: !0 }, A))
|
|
2322
2322
|
]),
|
|
2323
2323
|
"item-footer": f((A) => [
|
|
2324
|
-
U(
|
|
2324
|
+
U(k.$slots, "item-footer", fe({ ref_for: !0 }, A))
|
|
2325
2325
|
]),
|
|
2326
2326
|
"item-actions": f((A) => [
|
|
2327
|
-
U(
|
|
2327
|
+
U(k.$slots, "item-actions", fe({ ref_for: !0 }, A))
|
|
2328
2328
|
]),
|
|
2329
2329
|
"before-item": f((A) => [
|
|
2330
|
-
U(
|
|
2330
|
+
U(k.$slots, "before-item", fe({ ref_for: !0 }, A))
|
|
2331
2331
|
]),
|
|
2332
2332
|
"after-item": f((A) => [
|
|
2333
|
-
U(
|
|
2333
|
+
U(k.$slots, "after-item", fe({ ref_for: !0 }, A))
|
|
2334
2334
|
]),
|
|
2335
2335
|
_: 3
|
|
2336
2336
|
}, 8, ["vi", "view-items", "drag-state", "context", "callbacks"]))), 128))
|
|
@@ -2352,92 +2352,92 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2352
2352
|
modelModifiers: {}
|
|
2353
2353
|
}),
|
|
2354
2354
|
emits: /* @__PURE__ */ Xe(["confirm"], ["update:modelValue"]),
|
|
2355
|
-
setup(e, { emit:
|
|
2356
|
-
const
|
|
2357
|
-
Ee(i, (
|
|
2358
|
-
|
|
2355
|
+
setup(e, { emit: p }) {
|
|
2356
|
+
const o = e, n = p, i = gt(e, "modelValue"), { t: v } = ot(), b = ie(void 0), $ = ie("last");
|
|
2357
|
+
Ee(i, (r) => {
|
|
2358
|
+
r && (b.value = void 0, $.value = "last");
|
|
2359
2359
|
});
|
|
2360
|
-
const
|
|
2361
|
-
const
|
|
2362
|
-
if (
|
|
2363
|
-
const
|
|
2364
|
-
for (const
|
|
2365
|
-
if (
|
|
2360
|
+
const k = x(() => {
|
|
2361
|
+
const r = /* @__PURE__ */ new Set();
|
|
2362
|
+
if (o.sourceKey === null) return r;
|
|
2363
|
+
const d = (K) => {
|
|
2364
|
+
for (const D of K) {
|
|
2365
|
+
if (D.data[o.keyField] === o.sourceKey) {
|
|
2366
2366
|
const X = (de) => {
|
|
2367
2367
|
for (const se of de)
|
|
2368
|
-
|
|
2368
|
+
r.add(se.data[o.keyField]), se.children?.length && X(se.children);
|
|
2369
2369
|
};
|
|
2370
|
-
return
|
|
2370
|
+
return D.children?.length && X(D.children), !0;
|
|
2371
2371
|
}
|
|
2372
|
-
if (
|
|
2372
|
+
if (D.children?.length && d(D.children)) return !0;
|
|
2373
2373
|
}
|
|
2374
2374
|
return !1;
|
|
2375
2375
|
};
|
|
2376
|
-
return
|
|
2376
|
+
return d(o.tree.children), r;
|
|
2377
2377
|
}), u = x(() => {
|
|
2378
|
-
if (
|
|
2379
|
-
const
|
|
2380
|
-
for (const K of
|
|
2381
|
-
if (K.data[
|
|
2378
|
+
if (o.sourceKey === null) return null;
|
|
2379
|
+
const r = (d) => {
|
|
2380
|
+
for (const K of d) {
|
|
2381
|
+
if (K.data[o.keyField] === o.sourceKey) return K;
|
|
2382
2382
|
if (K.children?.length) {
|
|
2383
|
-
const
|
|
2384
|
-
if (
|
|
2383
|
+
const D = r(K.children);
|
|
2384
|
+
if (D) return D;
|
|
2385
2385
|
}
|
|
2386
2386
|
}
|
|
2387
2387
|
return null;
|
|
2388
2388
|
};
|
|
2389
|
-
return
|
|
2389
|
+
return r(o.tree.children);
|
|
2390
2390
|
}), h = x(() => {
|
|
2391
|
-
if (
|
|
2392
|
-
const
|
|
2393
|
-
for (const
|
|
2394
|
-
if (
|
|
2395
|
-
if (
|
|
2396
|
-
const Q =
|
|
2391
|
+
if (o.sourceKey === null) return;
|
|
2392
|
+
const r = (d, K) => {
|
|
2393
|
+
for (const D of d) {
|
|
2394
|
+
if (D.data[o.keyField] === o.sourceKey) return K;
|
|
2395
|
+
if (D.children?.length) {
|
|
2396
|
+
const Q = r(D.children, D.data[o.keyField]);
|
|
2397
2397
|
if (Q !== void 0) return Q;
|
|
2398
2398
|
}
|
|
2399
2399
|
}
|
|
2400
2400
|
};
|
|
2401
|
-
return
|
|
2401
|
+
return r(o.tree.children, null);
|
|
2402
2402
|
}), A = x(() => {
|
|
2403
|
-
const
|
|
2404
|
-
|
|
2403
|
+
const r = [], d = u.value ? o.calculateSubtreeDepth(u.value) : 1;
|
|
2404
|
+
r.push({
|
|
2405
2405
|
key: null,
|
|
2406
2406
|
depth: 0,
|
|
2407
2407
|
label: v("common.sortable.changeParent.rootLabel"),
|
|
2408
|
-
hasChildren:
|
|
2408
|
+
hasChildren: o.tree.children.length > 0,
|
|
2409
2409
|
disallowed: h.value === null,
|
|
2410
2410
|
reason: h.value === null ? "currentParent" : null
|
|
2411
2411
|
});
|
|
2412
|
-
const K = (
|
|
2413
|
-
for (const X of
|
|
2414
|
-
const de = X.data[
|
|
2412
|
+
const K = (D, Q) => {
|
|
2413
|
+
for (const X of D) {
|
|
2414
|
+
const de = X.data[o.keyField];
|
|
2415
2415
|
let se = !1, le = null;
|
|
2416
|
-
de ===
|
|
2416
|
+
de === o.sourceKey ? (se = !0, le = "self") : k.value.has(de) ? (se = !0, le = "descendant") : h.value !== void 0 && h.value === de ? (se = !0, le = "currentParent") : Q + 1 + d > o.maxDepth && (se = !0, le = "maxDepth"), r.push({
|
|
2417
2417
|
key: de,
|
|
2418
2418
|
depth: Q + 1,
|
|
2419
|
-
label:
|
|
2419
|
+
label: o.resolveLabel(X.data, de),
|
|
2420
2420
|
hasChildren: !!(X.children && X.children.length > 0),
|
|
2421
2421
|
disallowed: se,
|
|
2422
2422
|
reason: le
|
|
2423
2423
|
}), X.children?.length && K(X.children, Q + 1);
|
|
2424
2424
|
}
|
|
2425
2425
|
};
|
|
2426
|
-
return K(
|
|
2427
|
-
}), q = x(() => A.value.filter((
|
|
2428
|
-
() =>
|
|
2426
|
+
return K(o.tree.children, 0), r;
|
|
2427
|
+
}), q = x(() => A.value.filter((r) => !r.disallowed)), z = x(
|
|
2428
|
+
() => b.value === void 0 ? null : A.value.find((r) => r.key === b.value) ?? null
|
|
2429
2429
|
), g = x(
|
|
2430
2430
|
() => !!z.value && z.value.hasChildren
|
|
2431
|
-
), M = (
|
|
2432
|
-
|
|
2433
|
-
},
|
|
2431
|
+
), M = (r) => {
|
|
2432
|
+
r.disallowed || (b.value = r.key);
|
|
2433
|
+
}, G = () => {
|
|
2434
2434
|
z.value && (n("confirm", z.value.key, $.value), i.value = !1);
|
|
2435
2435
|
}, V = () => {
|
|
2436
2436
|
i.value = !1;
|
|
2437
|
-
}, Y = (
|
|
2438
|
-
return (
|
|
2437
|
+
}, Y = (r) => `${r * 16}px`, F = (r) => r === "maxDepth" ? v("common.sortable.changeParent.errorMaxDepth") : "";
|
|
2438
|
+
return (r, d) => (S(), ne(sn, {
|
|
2439
2439
|
modelValue: i.value,
|
|
2440
|
-
"onUpdate:modelValue":
|
|
2440
|
+
"onUpdate:modelValue": d[1] || (d[1] = (K) => i.value = K),
|
|
2441
2441
|
"max-width": "540",
|
|
2442
2442
|
persistent: ""
|
|
2443
2443
|
}, {
|
|
@@ -2479,13 +2479,13 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2479
2479
|
(S(!0), N(xe, null, rt(A.value, (K) => (S(), ne(je, {
|
|
2480
2480
|
key: K.key === null ? "__root__" : String(K.key),
|
|
2481
2481
|
disabled: K.disallowed,
|
|
2482
|
-
active:
|
|
2482
|
+
active: b.value === K.key,
|
|
2483
2483
|
title: K.label,
|
|
2484
2484
|
subtitle: F(K.reason),
|
|
2485
2485
|
style: At({ paddingInlineStart: Y(K.depth) }),
|
|
2486
2486
|
"data-disallowed": K.disallowed ? "true" : "false",
|
|
2487
2487
|
"data-reason": K.reason ?? "",
|
|
2488
|
-
onClick: (
|
|
2488
|
+
onClick: (D) => M(K)
|
|
2489
2489
|
}, {
|
|
2490
2490
|
prepend: f(() => [
|
|
2491
2491
|
K.key === null ? (S(), ne(ce, {
|
|
@@ -2520,7 +2520,7 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2520
2520
|
})), 1),
|
|
2521
2521
|
c(Bo, {
|
|
2522
2522
|
modelValue: $.value,
|
|
2523
|
-
"onUpdate:modelValue":
|
|
2523
|
+
"onUpdate:modelValue": d[0] || (d[0] = (K) => $.value = K),
|
|
2524
2524
|
density: "compact",
|
|
2525
2525
|
"hide-details": ""
|
|
2526
2526
|
}, {
|
|
@@ -2556,7 +2556,7 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2556
2556
|
color: "primary",
|
|
2557
2557
|
variant: "elevated",
|
|
2558
2558
|
disabled: !z.value || z.value.disallowed,
|
|
2559
|
-
onClick:
|
|
2559
|
+
onClick: G
|
|
2560
2560
|
}, {
|
|
2561
2561
|
default: f(() => [
|
|
2562
2562
|
te(L(m(v)("common.sortable.changeParent.confirm")), 1)
|
|
@@ -2592,7 +2592,7 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2592
2592
|
class: "a-le-sr-only",
|
|
2593
2593
|
"aria-live": "polite",
|
|
2594
2594
|
role: "status"
|
|
2595
|
-
}, An = "a-nested-list-editor__group", si = "a-le-drag-handle", In = 24,
|
|
2595
|
+
}, An = "a-nested-list-editor__group", si = "a-le-drag-handle", In = 24, Dn = 22, Hi = /* @__PURE__ */ et({
|
|
2596
2596
|
__name: "ANestedSortableListEditor",
|
|
2597
2597
|
props: /* @__PURE__ */ Xe({
|
|
2598
2598
|
maxDepth: {},
|
|
@@ -2643,19 +2643,19 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2643
2643
|
modeModifiers: {}
|
|
2644
2644
|
}),
|
|
2645
2645
|
emits: /* @__PURE__ */ Xe(["add", "add-child", "edit", "deleted", "close", "item-saved", "item-expand", "reorder-start", "reorder-cancel", "reorder-applied", "reorder-apply-error", "reorder-end", "indent", "outdent"], ["update:modelValue", "update:mode"]),
|
|
2646
|
-
setup(e, { expose:
|
|
2647
|
-
const n = e, i =
|
|
2646
|
+
setup(e, { expose: p, emit: o }) {
|
|
2647
|
+
const n = e, i = o, v = gt(e, "modelValue"), b = gt(e, "mode"), { t: $ } = ot(), k = la(), { showWarningT: u } = Jn(), h = zt("rootEl"), { isNarrow: A } = fo(h), q = vo(), z = x(() => n.closeVariant === "icon" ? "icon" : n.closeVariant === "labeled" ? "labeled" : A.value ? "icon" : "labeled"), g = ie(/* @__PURE__ */ new Set()), M = ie(/* @__PURE__ */ new Set()), G = n.getKey ?? "id", V = typeof G == "function" ? "id" : G, Y = (t) => typeof G == "function" ? G(t) : t[G], F = (() => {
|
|
2648
2648
|
const t = n.position;
|
|
2649
2649
|
return t === void 0 || t === !1 ? "position" : typeof t == "object" ? t.field : t;
|
|
2650
2650
|
})();
|
|
2651
2651
|
((t) => {
|
|
2652
|
-
const
|
|
2653
|
-
for (const R of
|
|
2654
|
-
R.children && R.children.length > 0 && (g.value.add(Y(R.data)),
|
|
2652
|
+
const s = (l) => {
|
|
2653
|
+
for (const R of l)
|
|
2654
|
+
R.children && R.children.length > 0 && (g.value.add(Y(R.data)), s(R.children));
|
|
2655
2655
|
};
|
|
2656
|
-
|
|
2656
|
+
s(t.children);
|
|
2657
2657
|
})(v.value);
|
|
2658
|
-
const
|
|
2658
|
+
const d = n.editor ?? El({
|
|
2659
2659
|
get: () => v.value,
|
|
2660
2660
|
set: (t) => v.value = t,
|
|
2661
2661
|
factory: n.factory,
|
|
@@ -2667,73 +2667,73 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2667
2667
|
validate: n.validate
|
|
2668
2668
|
}), K = x(() => {
|
|
2669
2669
|
const t = [];
|
|
2670
|
-
let
|
|
2671
|
-
const
|
|
2672
|
-
for (let
|
|
2673
|
-
const Ke = ae[
|
|
2670
|
+
let s = 0;
|
|
2671
|
+
const l = n.maxDepth, R = (ae, ke, Me) => {
|
|
2672
|
+
for (let De = 0; De < ae.length; De++) {
|
|
2673
|
+
const Ke = ae[De], it = Y(Ke.data), pe = Ke.children !== void 0, yt = pe && (Ke.children?.length ?? 0) > 0, $t = Ke.children?.length ?? 0, xt = l - (ke + 1);
|
|
2674
2674
|
t.push({
|
|
2675
2675
|
key: it,
|
|
2676
|
-
index:
|
|
2676
|
+
index: s++,
|
|
2677
2677
|
raw: Ke.data,
|
|
2678
2678
|
position: Ke.data[F],
|
|
2679
2679
|
node: Ke,
|
|
2680
|
-
depth:
|
|
2680
|
+
depth: ke,
|
|
2681
2681
|
parent: Me?.data ?? null,
|
|
2682
2682
|
parentKey: Me ? Y(Me.data) : null,
|
|
2683
2683
|
childrenCount: $t,
|
|
2684
2684
|
hasChildren: yt,
|
|
2685
2685
|
childrenAllowed: pe,
|
|
2686
|
-
siblingIndex:
|
|
2686
|
+
siblingIndex: De,
|
|
2687
2687
|
siblingCount: ae.length,
|
|
2688
|
-
firstInParent:
|
|
2689
|
-
lastInParent:
|
|
2688
|
+
firstInParent: De === 0,
|
|
2689
|
+
lastInParent: De === ae.length - 1,
|
|
2690
2690
|
canAddChild: pe && xt > 0,
|
|
2691
|
-
canIndent:
|
|
2692
|
-
canOutdent:
|
|
2693
|
-
}), yt && R(Ke.children,
|
|
2691
|
+
canIndent: De > 0,
|
|
2692
|
+
canOutdent: ke > 0
|
|
2693
|
+
}), yt && R(Ke.children, ke + 1, Ke);
|
|
2694
2694
|
}
|
|
2695
2695
|
};
|
|
2696
2696
|
return R(v.value.children, 0, null), t;
|
|
2697
|
-
}),
|
|
2698
|
-
|
|
2697
|
+
}), D = tn(null), Q = ie(/* @__PURE__ */ new Set()), X = ie(/* @__PURE__ */ new Set()), de = ie(/* @__PURE__ */ new Set()), se = () => {
|
|
2698
|
+
d.commit(), Q.value = /* @__PURE__ */ new Set();
|
|
2699
2699
|
}, le = (t) => {
|
|
2700
|
-
const { node:
|
|
2701
|
-
if (!
|
|
2700
|
+
const { node: s } = d.findNode(t);
|
|
2701
|
+
if (!s) {
|
|
2702
2702
|
Q.value.add(t);
|
|
2703
2703
|
return;
|
|
2704
2704
|
}
|
|
2705
|
-
const
|
|
2706
|
-
Q.value.add(Y(R.data)), R.children && R.children.forEach(
|
|
2705
|
+
const l = (R) => {
|
|
2706
|
+
Q.value.add(Y(R.data)), R.children && R.children.forEach(l);
|
|
2707
2707
|
};
|
|
2708
|
-
|
|
2709
|
-
}, Se = /* @__PURE__ */ new Map(),
|
|
2710
|
-
const t = [],
|
|
2711
|
-
for (const
|
|
2712
|
-
|
|
2713
|
-
const R =
|
|
2714
|
-
if (pe && pe.raw ===
|
|
2708
|
+
l(s);
|
|
2709
|
+
}, Se = /* @__PURE__ */ new Map(), P = x(() => {
|
|
2710
|
+
const t = [], s = /* @__PURE__ */ new Set();
|
|
2711
|
+
for (const l of K.value) {
|
|
2712
|
+
s.add(l.key);
|
|
2713
|
+
const R = ye.value.has(l.key), ae = M.value.has(l.key), ke = g.value.has(l.key), Me = n.loadingKeys?.has(l.key) ?? !1, De = Q.value.has(l.key), Ke = n.readonly ? !1 : d.isUnsaved(l.key), it = n.readonly ? !1 : Ke || De, pe = Se.get(l.key);
|
|
2714
|
+
if (pe && pe.raw === l.raw && pe.index === l.index && pe.position === l.position && pe.depth === l.depth && pe.parentKey === l.parentKey && pe.childrenCount === l.childrenCount && pe.firstInParent === l.firstInParent && pe.lastInParent === l.lastInParent && pe.editing === R && pe.expanded === ae && pe.childrenExpanded === ke && pe.loading === Me && pe.dirty === Ke && pe.moved === De && pe.unsaved === it) {
|
|
2715
2715
|
t.push(pe);
|
|
2716
2716
|
continue;
|
|
2717
2717
|
}
|
|
2718
2718
|
const yt = {
|
|
2719
|
-
...
|
|
2719
|
+
...l,
|
|
2720
2720
|
editing: R,
|
|
2721
2721
|
expanded: ae,
|
|
2722
|
-
childrenExpanded:
|
|
2722
|
+
childrenExpanded: ke,
|
|
2723
2723
|
loading: Me,
|
|
2724
2724
|
dirty: Ke,
|
|
2725
|
-
moved:
|
|
2725
|
+
moved: De,
|
|
2726
2726
|
unsaved: it
|
|
2727
2727
|
};
|
|
2728
|
-
Se.set(
|
|
2728
|
+
Se.set(l.key, yt), t.push(yt);
|
|
2729
2729
|
}
|
|
2730
|
-
for (const
|
|
2731
|
-
|
|
2730
|
+
for (const l of Se.keys())
|
|
2731
|
+
s.has(l) || Se.delete(l);
|
|
2732
2732
|
return t;
|
|
2733
|
-
}),
|
|
2733
|
+
}), w = x(() => v.value.children.length === 0), I = x(() => K.value.length), E = zt("rowsContainer"), T = x(() => !n.readonly && !n.disabled && !n.loading), W = x(
|
|
2734
2734
|
() => T.value && !n.disableReorder && I.value > 1
|
|
2735
|
-
), Z = x(() => !!
|
|
2736
|
-
editingKeys:
|
|
2735
|
+
), Z = x(() => !!k.item), me = x(() => !!k["item-readonly"]), oe = x(() => !!n.onItemSave), {
|
|
2736
|
+
editingKeys: ye,
|
|
2737
2737
|
editingSnapshots: Ce,
|
|
2738
2738
|
clearEditing: we,
|
|
2739
2739
|
beginEdit: Oe,
|
|
@@ -2742,26 +2742,26 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2742
2742
|
closeEdit: Ve,
|
|
2743
2743
|
requestAutoOpen: $e
|
|
2744
2744
|
} = Wn({
|
|
2745
|
-
rowsContainer:
|
|
2745
|
+
rowsContainer: E,
|
|
2746
2746
|
rowSelector: ".a-le-row-wrapper",
|
|
2747
2747
|
isInlineEdit: Z,
|
|
2748
2748
|
// markDirty=false: restoring the pre-edit snapshot on cancel must not flag the
|
|
2749
2749
|
// node dirty (it would otherwise be resent by partial-multi saves).
|
|
2750
|
-
restoreSnapshot: (t,
|
|
2750
|
+
restoreSnapshot: (t, s) => d.updateItem(t, s, !1),
|
|
2751
2751
|
watchKeys: () => {
|
|
2752
|
-
const t = [],
|
|
2753
|
-
for (const R of
|
|
2754
|
-
t.push(Y(R.data)), R.children && R.children.length &&
|
|
2752
|
+
const t = [], s = (l) => {
|
|
2753
|
+
for (const R of l)
|
|
2754
|
+
t.push(Y(R.data)), R.children && R.children.length && s(R.children);
|
|
2755
2755
|
};
|
|
2756
|
-
return
|
|
2756
|
+
return s(v.value.children), t;
|
|
2757
2757
|
},
|
|
2758
2758
|
findEntry: (t) => {
|
|
2759
|
-
const { node:
|
|
2760
|
-
return
|
|
2759
|
+
const { node: s } = d.findNode(t);
|
|
2760
|
+
return s ? { data: s.data } : null;
|
|
2761
2761
|
},
|
|
2762
2762
|
afterAutoOpen: (t) => {
|
|
2763
|
-
const { parent:
|
|
2764
|
-
|
|
2763
|
+
const { parent: s } = d.findNode(t);
|
|
2764
|
+
s && g.value.add(Y(s.data));
|
|
2765
2765
|
}
|
|
2766
2766
|
}), {
|
|
2767
2767
|
applying: ze,
|
|
@@ -2773,8 +2773,8 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2773
2773
|
cancelReorderMode: tt,
|
|
2774
2774
|
applyReorder: ct
|
|
2775
2775
|
} = mo({
|
|
2776
|
-
mode:
|
|
2777
|
-
snapshot:
|
|
2776
|
+
mode: b,
|
|
2777
|
+
snapshot: D,
|
|
2778
2778
|
movedKeys: Q,
|
|
2779
2779
|
modelValue: v,
|
|
2780
2780
|
cloneModel: (t) => Re(t),
|
|
@@ -2786,7 +2786,7 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2786
2786
|
X.value = /* @__PURE__ */ new Set(), de.value = /* @__PURE__ */ new Set(), we();
|
|
2787
2787
|
for (const t of ge.value) g.value.add(t);
|
|
2788
2788
|
Ze(() => {
|
|
2789
|
-
|
|
2789
|
+
C.value && vt();
|
|
2790
2790
|
});
|
|
2791
2791
|
},
|
|
2792
2792
|
onExternalEnter: () => {
|
|
@@ -2796,9 +2796,9 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2796
2796
|
// deferred delete truly reverts (clear tombstone, row stays) and an immediate delete stays gone (row
|
|
2797
2797
|
// removed again — it is deleted on the backend and must not resurrect / be re-created by a save).
|
|
2798
2798
|
onCancel: () => {
|
|
2799
|
-
for (const t of X.value)
|
|
2799
|
+
for (const t of X.value) d.restoreDeleted(t);
|
|
2800
2800
|
for (const t of de.value)
|
|
2801
|
-
|
|
2801
|
+
d.deleteItem(t, { trackDeleted: !1 });
|
|
2802
2802
|
X.value = /* @__PURE__ */ new Set(), de.value = /* @__PURE__ */ new Set(), Qe();
|
|
2803
2803
|
},
|
|
2804
2804
|
onApplyEnd: () => {
|
|
@@ -2816,20 +2816,20 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2816
2816
|
() => pt.value + X.value.size
|
|
2817
2817
|
), lt = x(
|
|
2818
2818
|
() => dt.value || X.value.size > 0
|
|
2819
|
-
), ut = x(() => T.value && n.showAddButton && !Fe.value),
|
|
2819
|
+
), ut = x(() => T.value && n.showAddButton && !Fe.value), C = x(() => Fe.value && !q.value && !n.disableDrag), B = x(
|
|
2820
2820
|
() => n.addLabel ? $(n.addLabel) : $("common.sortable.add")
|
|
2821
|
-
),
|
|
2821
|
+
), J = x(() => n.emptyTitle ?? $("common.sortable.emptyTitle")), _ = x(
|
|
2822
2822
|
() => n.deleteConfirmTitle ?? $("common.sortable.deleteConfirmTitle")
|
|
2823
|
-
),
|
|
2823
|
+
), H = x(
|
|
2824
2824
|
() => n.deleteConfirmText ?? (n.deleteMode === "immediate" ? $("common.sortable.deleteConfirmText") : $("common.sortable.deleteConfirmTextDeferred"))
|
|
2825
2825
|
), ve = x(
|
|
2826
2826
|
() => !n.readonly && n.showReorderToggle && !Fe.value && I.value > 0
|
|
2827
|
-
),
|
|
2828
|
-
const t = [],
|
|
2829
|
-
for (const R of
|
|
2830
|
-
R.children && R.children.length > 0 && (t.push(Y(R.data)),
|
|
2827
|
+
), he = x(() => !!n.title && A.value), ge = x(() => {
|
|
2828
|
+
const t = [], s = (l) => {
|
|
2829
|
+
for (const R of l)
|
|
2830
|
+
R.children && R.children.length > 0 && (t.push(Y(R.data)), s(R.children));
|
|
2831
2831
|
};
|
|
2832
|
-
return
|
|
2832
|
+
return s(v.value.children), t;
|
|
2833
2833
|
}), a = x(
|
|
2834
2834
|
() => ge.value.length > 0 && ge.value.every((t) => g.value.has(t))
|
|
2835
2835
|
), j = x(
|
|
@@ -2839,8 +2839,8 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2839
2839
|
for (const t of ge.value) g.value.delete(t);
|
|
2840
2840
|
else
|
|
2841
2841
|
for (const t of ge.value) g.value.add(t);
|
|
2842
|
-
},
|
|
2843
|
-
() => !!(n.title ||
|
|
2842
|
+
}, be = x(
|
|
2843
|
+
() => !!(n.title || k.header || k["reorder-toggle"] || ve.value || j.value || Fe.value)
|
|
2844
2844
|
), He = ie([]), Ue = ie(0), Qe = () => {
|
|
2845
2845
|
for (const t of He.value)
|
|
2846
2846
|
try {
|
|
@@ -2848,54 +2848,54 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2848
2848
|
} catch {
|
|
2849
2849
|
}
|
|
2850
2850
|
He.value = [];
|
|
2851
|
-
}, Le = ie(null),
|
|
2852
|
-
const
|
|
2853
|
-
if (!
|
|
2854
|
-
const R =
|
|
2855
|
-
if (!R || !
|
|
2851
|
+
}, Le = ie(null), Dt = (t, s) => {
|
|
2852
|
+
const l = document.elementFromPoint(t, s);
|
|
2853
|
+
if (!l) return null;
|
|
2854
|
+
const R = l.closest(".a-le-row-wrapper");
|
|
2855
|
+
if (!R || !E.value || !E.value.contains(R)) return null;
|
|
2856
2856
|
const ae = cn(R.getAttribute("data-id"));
|
|
2857
2857
|
if (ae === null) return null;
|
|
2858
|
-
const
|
|
2859
|
-
return
|
|
2860
|
-
}, Be = (t,
|
|
2861
|
-
if (!Le.value || !
|
|
2862
|
-
const
|
|
2863
|
-
if (!
|
|
2858
|
+
const ke = P.value.find((Me) => Me.key === ae);
|
|
2859
|
+
return ke ? { el: R, viewItem: ke } : null;
|
|
2860
|
+
}, Be = (t, s) => {
|
|
2861
|
+
if (!Le.value || !E.value) return;
|
|
2862
|
+
const l = Dt(t, s);
|
|
2863
|
+
if (!l) {
|
|
2864
2864
|
Le.value.instruction = null;
|
|
2865
2865
|
return;
|
|
2866
2866
|
}
|
|
2867
|
-
const R =
|
|
2867
|
+
const R = E.value.getBoundingClientRect(), ke = (l.el.querySelector(":scope > .a-le-row") ?? l.el).getBoundingClientRect();
|
|
2868
2868
|
Le.value.instruction = Fl({
|
|
2869
|
-
pointer: { x: t, y:
|
|
2869
|
+
pointer: { x: t, y: s },
|
|
2870
2870
|
hoveredRow: {
|
|
2871
|
-
key:
|
|
2872
|
-
rect:
|
|
2873
|
-
depth:
|
|
2874
|
-
parentKey:
|
|
2875
|
-
siblingIndex:
|
|
2876
|
-
siblingCount:
|
|
2871
|
+
key: l.viewItem.key,
|
|
2872
|
+
rect: ke,
|
|
2873
|
+
depth: l.viewItem.depth,
|
|
2874
|
+
parentKey: l.viewItem.parentKey,
|
|
2875
|
+
siblingIndex: l.viewItem.siblingIndex,
|
|
2876
|
+
siblingCount: l.viewItem.siblingCount
|
|
2877
2877
|
},
|
|
2878
2878
|
sourceKey: Le.value.sourceKey,
|
|
2879
2879
|
sourceSubtreeDepth: Le.value.sourceSubtreeDepth,
|
|
2880
|
-
viewItems:
|
|
2880
|
+
viewItems: P.value,
|
|
2881
2881
|
maxDepth: n.maxDepth,
|
|
2882
2882
|
indentPx: In,
|
|
2883
2883
|
containerLeft: R.left,
|
|
2884
|
-
containerPaddingLeft:
|
|
2884
|
+
containerPaddingLeft: Dn
|
|
2885
2885
|
});
|
|
2886
2886
|
}, ft = (t) => {
|
|
2887
2887
|
Be(t.clientX, t.clientY);
|
|
2888
|
-
}, ya = (t,
|
|
2889
|
-
if (!
|
|
2888
|
+
}, ya = (t, s) => {
|
|
2889
|
+
if (!d.moveTo(s, t.parentKey, t.index)) {
|
|
2890
2890
|
u("common.sortable.error.maxDeepExceed"), Ue.value++, Ze(() => vt());
|
|
2891
2891
|
return;
|
|
2892
2892
|
}
|
|
2893
|
-
le(
|
|
2893
|
+
le(s), t.makeChild && t.parentKey !== null && g.value.add(t.parentKey);
|
|
2894
2894
|
}, vt = () => {
|
|
2895
|
-
if (Qe(), !
|
|
2896
|
-
const t = Array.from(
|
|
2897
|
-
for (const
|
|
2898
|
-
const
|
|
2895
|
+
if (Qe(), !C.value || !E.value) return;
|
|
2896
|
+
const t = Array.from(E.value.querySelectorAll("." + An));
|
|
2897
|
+
for (const s of t) {
|
|
2898
|
+
const l = go(s, [], {
|
|
2899
2899
|
group: { name: "a-nested", pull: !0, put: !0 },
|
|
2900
2900
|
handle: "." + si,
|
|
2901
2901
|
animation: 0,
|
|
@@ -2906,12 +2906,12 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2906
2906
|
forceFallback: !0,
|
|
2907
2907
|
fallbackTolerance: 3,
|
|
2908
2908
|
onStart: (R) => {
|
|
2909
|
-
const ae = R.item,
|
|
2910
|
-
if (
|
|
2911
|
-
const Me =
|
|
2909
|
+
const ae = R.item, ke = cn(ae.getAttribute("data-id"));
|
|
2910
|
+
if (ke === null) return;
|
|
2911
|
+
const Me = d.findNode(ke).node, De = Me ? d.calculateSubtreeDepth(Me) : 1;
|
|
2912
2912
|
Le.value = {
|
|
2913
|
-
sourceKey:
|
|
2914
|
-
sourceSubtreeDepth:
|
|
2913
|
+
sourceKey: ke,
|
|
2914
|
+
sourceSubtreeDepth: De,
|
|
2915
2915
|
instruction: null
|
|
2916
2916
|
}, document.addEventListener("pointermove", ft, { passive: !0 });
|
|
2917
2917
|
},
|
|
@@ -2921,8 +2921,8 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2921
2921
|
if ("clientX" in ae && "clientY" in ae)
|
|
2922
2922
|
Be(ae.clientX, ae.clientY);
|
|
2923
2923
|
else if ("touches" in ae) {
|
|
2924
|
-
const
|
|
2925
|
-
|
|
2924
|
+
const ke = ae;
|
|
2925
|
+
ke.touches.length > 0 && Be(ke.touches[0].clientX, ke.touches[0].clientY);
|
|
2926
2926
|
}
|
|
2927
2927
|
}
|
|
2928
2928
|
return !1;
|
|
@@ -2935,67 +2935,67 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
2935
2935
|
ae !== null && ae.type !== "blocked" && ya(ae, R.sourceKey);
|
|
2936
2936
|
}
|
|
2937
2937
|
});
|
|
2938
|
-
He.value.push(
|
|
2938
|
+
He.value.push(l);
|
|
2939
2939
|
}
|
|
2940
2940
|
}, cn = (t) => {
|
|
2941
2941
|
if (t === null || t === "") return null;
|
|
2942
|
-
const
|
|
2943
|
-
return String(
|
|
2942
|
+
const s = wo(t);
|
|
2943
|
+
return String(s) === t ? s : t;
|
|
2944
2944
|
};
|
|
2945
2945
|
Ee(
|
|
2946
|
-
() =>
|
|
2946
|
+
() => C.value,
|
|
2947
2947
|
() => {
|
|
2948
|
-
|
|
2948
|
+
C.value ? Ze(() => vt()) : Qe();
|
|
2949
2949
|
}
|
|
2950
2950
|
), Ee(
|
|
2951
2951
|
() => Ue.value,
|
|
2952
2952
|
() => {
|
|
2953
|
-
|
|
2953
|
+
C.value && Ze(() => vt());
|
|
2954
2954
|
}
|
|
2955
2955
|
), Ee(
|
|
2956
|
-
() =>
|
|
2956
|
+
() => P.value.map((t) => t.key).join("|"),
|
|
2957
2957
|
() => {
|
|
2958
|
-
|
|
2958
|
+
C.value && Ze(() => vt());
|
|
2959
2959
|
}
|
|
2960
2960
|
), an(() => {
|
|
2961
|
-
|
|
2961
|
+
C.value && vt();
|
|
2962
2962
|
}), on(() => {
|
|
2963
2963
|
Qe(), document.removeEventListener("pointermove", ft);
|
|
2964
2964
|
});
|
|
2965
2965
|
const nt = x(() => {
|
|
2966
2966
|
const t = Le.value;
|
|
2967
|
-
if (!t || t.instruction === null || !
|
|
2968
|
-
const
|
|
2969
|
-
if (
|
|
2970
|
-
const
|
|
2971
|
-
`.a-le-row-wrapper[data-id="${CSS.escape(String(
|
|
2967
|
+
if (!t || t.instruction === null || !E.value) return null;
|
|
2968
|
+
const s = t.instruction;
|
|
2969
|
+
if (s.type === "blocked") return null;
|
|
2970
|
+
const l = E.value.querySelector(
|
|
2971
|
+
`.a-le-row-wrapper[data-id="${CSS.escape(String(s.refKey))}"]`
|
|
2972
2972
|
);
|
|
2973
|
-
if (!
|
|
2974
|
-
const R =
|
|
2973
|
+
if (!l) return null;
|
|
2974
|
+
const R = l.querySelector(":scope > .a-le-row"), ae = E.value.getBoundingClientRect(), ke = (R ?? l).getBoundingClientRect(), Me = Dn + s.depth * In, De = s.refEdge === "top" ? ke.top - ae.top : ke.bottom - ae.top, Ke = { top: De, left: Me, right: 16 };
|
|
2975
2975
|
let it = null;
|
|
2976
|
-
if (
|
|
2977
|
-
const pe =
|
|
2978
|
-
`.a-le-row-wrapper[data-id="${CSS.escape(String(
|
|
2976
|
+
if (s.levelRowKey !== null) {
|
|
2977
|
+
const pe = E.value.querySelector(
|
|
2978
|
+
`.a-le-row-wrapper[data-id="${CSS.escape(String(s.levelRowKey))}"]`
|
|
2979
2979
|
);
|
|
2980
2980
|
if (pe) {
|
|
2981
2981
|
const $t = (pe.querySelector(":scope > .a-le-row") ?? pe).getBoundingClientRect(), xt = $t.top - ae.top + $t.height / 2;
|
|
2982
|
-
xt <
|
|
2982
|
+
xt < De && (it = {
|
|
2983
2983
|
top: xt,
|
|
2984
|
-
height:
|
|
2984
|
+
height: De - xt,
|
|
2985
2985
|
left: Me
|
|
2986
2986
|
});
|
|
2987
2987
|
}
|
|
2988
2988
|
}
|
|
2989
2989
|
return { line: Ke, connector: it };
|
|
2990
2990
|
}), kt = () => {
|
|
2991
|
-
ut.value && ($e(), n.factory &&
|
|
2991
|
+
ut.value && ($e(), n.factory && d.addItem(), i("add", void 0));
|
|
2992
2992
|
}, un = (t) => {
|
|
2993
|
-
T.value && ($e(), n.factory &&
|
|
2993
|
+
T.value && ($e(), n.factory && d.addAfter(t.key, void 0, t.childrenAllowed), i("add", { afterId: t.key, childrenAllowed: t.childrenAllowed }));
|
|
2994
2994
|
}, fn = (t) => {
|
|
2995
|
-
T.value && t.canAddChild && ($e(), g.value.add(t.key), i("add-child", t), n.factory &&
|
|
2996
|
-
},
|
|
2995
|
+
T.value && t.canAddChild && ($e(), g.value.add(t.key), i("add-child", t), n.factory && d.addChild(t.key, void 0, !0), i("add", { parentId: t.key, childrenAllowed: !0 }));
|
|
2996
|
+
}, Pt = (t) => {
|
|
2997
2997
|
if (!(!T.value || Fe.value)) {
|
|
2998
|
-
if (
|
|
2998
|
+
if (ye.value.has(t.key)) {
|
|
2999
2999
|
wt(t);
|
|
3000
3000
|
return;
|
|
3001
3001
|
}
|
|
@@ -3003,19 +3003,19 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3003
3003
|
}
|
|
3004
3004
|
}, Ut = (t) => {
|
|
3005
3005
|
if (n.disabled || n.loading) return;
|
|
3006
|
-
const
|
|
3007
|
-
|
|
3006
|
+
const s = t.key, l = g.value.has(s);
|
|
3007
|
+
l ? g.value.delete(s) : g.value.add(s), i("item-expand", t, !l);
|
|
3008
3008
|
}, vn = (t) => {
|
|
3009
3009
|
if (n.disabled || n.loading) return;
|
|
3010
|
-
const
|
|
3011
|
-
|
|
3010
|
+
const s = t.key, l = M.value.has(s);
|
|
3011
|
+
l ? M.value.delete(s) : M.value.add(s), i("item-expand", t, !l);
|
|
3012
3012
|
}, mn = (t) => n.disableRowClick || n.disabled || n.loading || Fe.value ? !1 : !!(t.editing || t.expanded || !n.readonly && n.showEditButton), ha = (t) => {
|
|
3013
3013
|
if (mn(t)) {
|
|
3014
3014
|
if (t.editing || t.expanded) {
|
|
3015
3015
|
wt(t);
|
|
3016
3016
|
return;
|
|
3017
3017
|
}
|
|
3018
|
-
n.readonly && me.value ? vn(t) :
|
|
3018
|
+
n.readonly && me.value ? vn(t) : Pt(t);
|
|
3019
3019
|
}
|
|
3020
3020
|
}, {
|
|
3021
3021
|
deleteDialog: jt,
|
|
@@ -3028,9 +3028,9 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3028
3028
|
onDeleteConfirm: (t) => n.onDeleteConfirm ? n.onDeleteConfirm(t) : !0,
|
|
3029
3029
|
onDelete: (t) => n.onDelete?.(t),
|
|
3030
3030
|
onDeleted: (t) => {
|
|
3031
|
-
|
|
3032
|
-
const
|
|
3033
|
-
Fe.value && (
|
|
3031
|
+
ye.value.delete(t.key), Ce.value.delete(t.key), M.value.delete(t.key), g.value.delete(t.key);
|
|
3032
|
+
const s = n.deleteMode === "deferred";
|
|
3033
|
+
Fe.value && (s ? X.value.add(t.key) : de.value.add(t.key)), d.deleteItem(t.key, { trackDeleted: s }), i("deleted", t);
|
|
3034
3034
|
},
|
|
3035
3035
|
disableDeleteConfirm: () => n.disableDeleteConfirm
|
|
3036
3036
|
}), yn = async (t) => {
|
|
@@ -3042,82 +3042,82 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3042
3042
|
}, wt = (t) => {
|
|
3043
3043
|
Ve(t), i("close", t);
|
|
3044
3044
|
}, qt = (t) => {
|
|
3045
|
-
|
|
3045
|
+
d.moveUp(t) && le(t);
|
|
3046
3046
|
}, Ht = (t) => {
|
|
3047
|
-
|
|
3047
|
+
d.moveDown(t) && le(t);
|
|
3048
3048
|
}, Gt = (t) => {
|
|
3049
|
-
|
|
3049
|
+
d.moveTop(t) && le(t);
|
|
3050
3050
|
}, Jt = (t) => {
|
|
3051
|
-
|
|
3051
|
+
d.moveBottom(t) && le(t);
|
|
3052
3052
|
}, Wt = (t) => {
|
|
3053
|
-
if (!
|
|
3053
|
+
if (!d.indent(t.key)) {
|
|
3054
3054
|
u("common.sortable.error.maxDeepExceed");
|
|
3055
3055
|
return;
|
|
3056
3056
|
}
|
|
3057
3057
|
le(t.key), i("indent", t);
|
|
3058
3058
|
}, Xt = (t) => {
|
|
3059
|
-
|
|
3060
|
-
}, Yt = (t) => na(t, { compactField: n.compactField }), pn = (t,
|
|
3061
|
-
let
|
|
3062
|
-
return
|
|
3059
|
+
d.outdent(t.key) && (le(t.key), i("outdent", t));
|
|
3060
|
+
}, Yt = (t) => na(t, { compactField: n.compactField }), pn = (t, s) => s === void 0 ? null : d.rowState(t, s, ye.value.has(s)), Ct = /* @__PURE__ */ new Map(), Ca = (t) => {
|
|
3061
|
+
let s = Ct.get(t);
|
|
3062
|
+
return s || (s = {
|
|
3063
3063
|
edit: () => {
|
|
3064
|
-
const
|
|
3065
|
-
|
|
3064
|
+
const l = Pe(t);
|
|
3065
|
+
l && Pt(l);
|
|
3066
3066
|
},
|
|
3067
3067
|
save: () => {
|
|
3068
|
-
const
|
|
3069
|
-
if (
|
|
3068
|
+
const l = Pe(t);
|
|
3069
|
+
if (l) return hn(l);
|
|
3070
3070
|
},
|
|
3071
3071
|
cancel: () => {
|
|
3072
|
-
const
|
|
3073
|
-
|
|
3072
|
+
const l = Pe(t);
|
|
3073
|
+
l && gn(l);
|
|
3074
3074
|
},
|
|
3075
3075
|
close: () => {
|
|
3076
|
-
const
|
|
3077
|
-
|
|
3076
|
+
const l = Pe(t);
|
|
3077
|
+
l && wt(l);
|
|
3078
3078
|
},
|
|
3079
3079
|
delete: async () => {
|
|
3080
|
-
const
|
|
3081
|
-
|
|
3080
|
+
const l = Pe(t);
|
|
3081
|
+
l && await yn(l);
|
|
3082
3082
|
},
|
|
3083
3083
|
addAfter: () => {
|
|
3084
|
-
const
|
|
3085
|
-
|
|
3084
|
+
const l = Pe(t);
|
|
3085
|
+
l && un(l);
|
|
3086
3086
|
},
|
|
3087
3087
|
addChild: () => {
|
|
3088
|
-
const
|
|
3089
|
-
|
|
3088
|
+
const l = Pe(t);
|
|
3089
|
+
l && fn(l);
|
|
3090
3090
|
},
|
|
3091
3091
|
toggleExpand: () => {
|
|
3092
|
-
const
|
|
3093
|
-
|
|
3092
|
+
const l = Pe(t);
|
|
3093
|
+
l && Ut(l);
|
|
3094
3094
|
},
|
|
3095
3095
|
toggleDetail: () => {
|
|
3096
|
-
const
|
|
3097
|
-
|
|
3096
|
+
const l = Pe(t);
|
|
3097
|
+
l && vn(l);
|
|
3098
3098
|
},
|
|
3099
3099
|
moveUp: () => qt(t),
|
|
3100
3100
|
moveDown: () => Ht(t),
|
|
3101
3101
|
moveTop: () => Gt(t),
|
|
3102
3102
|
moveBottom: () => Jt(t),
|
|
3103
3103
|
indent: () => {
|
|
3104
|
-
const
|
|
3105
|
-
|
|
3104
|
+
const l = Pe(t);
|
|
3105
|
+
l && Wt(l);
|
|
3106
3106
|
},
|
|
3107
3107
|
outdent: () => {
|
|
3108
|
-
const
|
|
3109
|
-
|
|
3108
|
+
const l = Pe(t);
|
|
3109
|
+
l && Xt(l);
|
|
3110
3110
|
},
|
|
3111
|
-
update: (
|
|
3112
|
-
}, Ct.set(t,
|
|
3111
|
+
update: (l) => d.updateItem(t, l)
|
|
3112
|
+
}, Ct.set(t, s)), s;
|
|
3113
3113
|
};
|
|
3114
3114
|
Ee(
|
|
3115
|
-
() =>
|
|
3115
|
+
() => P.value,
|
|
3116
3116
|
(t) => {
|
|
3117
3117
|
if (Ct.size === 0) return;
|
|
3118
|
-
const
|
|
3119
|
-
for (const
|
|
3120
|
-
|
|
3118
|
+
const s = new Set(t.map((l) => l.key));
|
|
3119
|
+
for (const l of Ct.keys())
|
|
3120
|
+
s.has(l) || Ct.delete(l);
|
|
3121
3121
|
}
|
|
3122
3122
|
);
|
|
3123
3123
|
const xa = (t) => ({
|
|
@@ -3159,16 +3159,16 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3159
3159
|
cancel: tt
|
|
3160
3160
|
}
|
|
3161
3161
|
})), bn = x(() => ({
|
|
3162
|
-
mode:
|
|
3162
|
+
mode: b.value,
|
|
3163
3163
|
disabled: !W.value,
|
|
3164
3164
|
hasPendingChanges: dt.value,
|
|
3165
3165
|
actions: {
|
|
3166
3166
|
enterReorderMode: Ye,
|
|
3167
3167
|
exitReorderMode: tt
|
|
3168
3168
|
}
|
|
3169
|
-
})), Aa = x(() => new Set(ge.value)),
|
|
3169
|
+
})), Aa = x(() => new Set(ge.value)), Pe = (t) => P.value.find((s) => s.key === t), Et = Xn({
|
|
3170
3170
|
viewItems: x(
|
|
3171
|
-
() =>
|
|
3171
|
+
() => P.value.map((t) => ({
|
|
3172
3172
|
key: t.key,
|
|
3173
3173
|
expanded: t.childrenExpanded,
|
|
3174
3174
|
canExpand: Aa.value.has(t.key),
|
|
@@ -3179,62 +3179,62 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3179
3179
|
variant: "nested",
|
|
3180
3180
|
isReorderMode: Fe,
|
|
3181
3181
|
disabled: x(() => !T.value),
|
|
3182
|
-
isEditing: (t) =>
|
|
3182
|
+
isEditing: (t) => ye.value.has(t),
|
|
3183
3183
|
onToggleEdit: (t) => {
|
|
3184
|
-
const
|
|
3185
|
-
|
|
3184
|
+
const s = Pe(t);
|
|
3185
|
+
s && Pt(s);
|
|
3186
3186
|
},
|
|
3187
3187
|
onCancelEdit: (t) => {
|
|
3188
|
-
const
|
|
3189
|
-
|
|
3188
|
+
const s = Pe(t);
|
|
3189
|
+
s && wt(s);
|
|
3190
3190
|
},
|
|
3191
3191
|
onMoveUp: (t) => qt(t),
|
|
3192
3192
|
onMoveDown: (t) => Ht(t),
|
|
3193
3193
|
onMoveTop: (t) => Gt(t),
|
|
3194
3194
|
onMoveBottom: (t) => Jt(t),
|
|
3195
3195
|
onIndent: (t) => {
|
|
3196
|
-
const
|
|
3197
|
-
|
|
3196
|
+
const s = Pe(t);
|
|
3197
|
+
s && Wt(s);
|
|
3198
3198
|
},
|
|
3199
3199
|
onOutdent: (t) => {
|
|
3200
|
-
const
|
|
3201
|
-
|
|
3200
|
+
const s = Pe(t);
|
|
3201
|
+
s && Xt(s);
|
|
3202
3202
|
},
|
|
3203
3203
|
onToggleChildren: (t) => {
|
|
3204
|
-
const
|
|
3205
|
-
|
|
3204
|
+
const s = Pe(t);
|
|
3205
|
+
s && Ut(s);
|
|
3206
3206
|
},
|
|
3207
3207
|
onCancelReorder: () => tt()
|
|
3208
3208
|
}), Qt = ie(!1), mt = tn(null), Zt = x(() => {
|
|
3209
3209
|
const t = mt.value;
|
|
3210
3210
|
if (!t) return null;
|
|
3211
|
-
const
|
|
3211
|
+
const s = d.findNode(t.key), l = s.parent?.children ?? v.value.children, R = l.findIndex((ae) => Y(ae.data) === t.key);
|
|
3212
3212
|
return {
|
|
3213
|
-
parentId:
|
|
3214
|
-
total:
|
|
3213
|
+
parentId: s.parent ? Y(s.parent.data) : null,
|
|
3214
|
+
total: l.length,
|
|
3215
3215
|
currentIndex: R
|
|
3216
3216
|
};
|
|
3217
3217
|
}), Ia = x(
|
|
3218
3218
|
() => mt.value ? Yt(mt.value.raw) : ""
|
|
3219
|
-
),
|
|
3219
|
+
), Da = (t) => {
|
|
3220
3220
|
n.showMoveToPosition && (mt.value = t, Qt.value = !0);
|
|
3221
|
-
},
|
|
3222
|
-
const
|
|
3223
|
-
mt.value = null, !(!
|
|
3221
|
+
}, Pa = (t) => {
|
|
3222
|
+
const s = Zt.value, l = mt.value;
|
|
3223
|
+
mt.value = null, !(!s || !l) && t !== s.currentIndex && d.moveTo(l.key, s.parentId, t) && le(l.key);
|
|
3224
3224
|
}, _t = ie(!1), Tt = tn(null), Ea = (t) => {
|
|
3225
3225
|
n.showChangeParent && (Tt.value = t, _t.value = !0);
|
|
3226
|
-
}, Ta = (t,
|
|
3227
|
-
const
|
|
3228
|
-
if (Tt.value = null, !
|
|
3226
|
+
}, Ta = (t, s) => {
|
|
3227
|
+
const l = Tt.value;
|
|
3228
|
+
if (Tt.value = null, !l) return;
|
|
3229
3229
|
let R = 0;
|
|
3230
|
-
t === null ? R = v.value.children.length : R =
|
|
3231
|
-
const ae =
|
|
3232
|
-
|
|
3230
|
+
t === null ? R = v.value.children.length : R = d.findNode(t).node?.children?.length ?? 0;
|
|
3231
|
+
const ae = s === "first" ? 0 : R;
|
|
3232
|
+
d.moveTo(l.key, t, ae) && (le(l.key), t !== null && g.value.add(t));
|
|
3233
3233
|
}, $a = x(() => ({
|
|
3234
3234
|
reorderMode: Fe.value,
|
|
3235
3235
|
readonly: n.readonly,
|
|
3236
3236
|
canInteract: T.value,
|
|
3237
|
-
dragEnabled:
|
|
3237
|
+
dragEnabled: C.value,
|
|
3238
3238
|
showExpandToggle: n.showExpandToggle,
|
|
3239
3239
|
showEditButton: n.showEditButton,
|
|
3240
3240
|
showDeleteButton: n.showDeleteButton,
|
|
@@ -3248,12 +3248,12 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3248
3248
|
keyboardNav: Et,
|
|
3249
3249
|
isRowClickable: mn,
|
|
3250
3250
|
resolveCompactText: Yt,
|
|
3251
|
-
resolveValidation: (t,
|
|
3251
|
+
resolveValidation: (t, s) => pn(t, s),
|
|
3252
3252
|
buildSlotProps: xa
|
|
3253
3253
|
})), Fa = {
|
|
3254
3254
|
onRowClick: ha,
|
|
3255
3255
|
onChevronClick: Ut,
|
|
3256
|
-
onEditClick:
|
|
3256
|
+
onEditClick: Pt,
|
|
3257
3257
|
onDeleteClick: yn,
|
|
3258
3258
|
onCloseClick: wt,
|
|
3259
3259
|
onSaveClick: hn,
|
|
@@ -3266,31 +3266,31 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3266
3266
|
moveBottom: (t) => Jt(t),
|
|
3267
3267
|
indent: Wt,
|
|
3268
3268
|
outdent: Xt,
|
|
3269
|
-
openMoveToPosition:
|
|
3269
|
+
openMoveToPosition: Da,
|
|
3270
3270
|
openChangeParent: Ea
|
|
3271
|
-
}, Ba = x(() =>
|
|
3272
|
-
|
|
3273
|
-
}, La = (t,
|
|
3274
|
-
|
|
3275
|
-
}, kn =
|
|
3276
|
-
|
|
3271
|
+
}, Ba = x(() => P.value.filter((t) => t.parentKey === null)), Ka = (t, s, l) => (d.addItem(s, { afterId: t ?? void 0, childrenAllowed: l }), Ze(() => d.commit()), v.value), Ra = (t, s, l) => (g.value.add(t), d.addItem(s, { parentId: t, asFirstChild: !0, childrenAllowed: l }), Ze(() => d.commit()), v.value), Va = (t) => {
|
|
3272
|
+
d.deleteItem(t), ye.value.delete(t), Ce.value.delete(t), M.value.delete(t), g.value.delete(t), Ze(() => d.commit());
|
|
3273
|
+
}, La = (t, s, l = null, R = null, ae = null) => {
|
|
3274
|
+
d.updateItem(t, s), Ze(() => d.commit());
|
|
3275
|
+
}, kn = d.unsavedCount, Ma = () => {
|
|
3276
|
+
d.commit(), Q.value = /* @__PURE__ */ new Set(), we();
|
|
3277
3277
|
};
|
|
3278
3278
|
Qn(
|
|
3279
3279
|
() => n.unsavedSectionLabel ? { label: n.unsavedSectionLabel, dirty: kn.value > 0 } : []
|
|
3280
3280
|
);
|
|
3281
|
-
const wn = () => aa(
|
|
3282
|
-
let
|
|
3283
|
-
for (;
|
|
3284
|
-
g.value.add(Y(
|
|
3285
|
-
const
|
|
3286
|
-
|
|
3281
|
+
const wn = () => aa(d, (t) => {
|
|
3282
|
+
let s = d.findNode(t).parent;
|
|
3283
|
+
for (; s; )
|
|
3284
|
+
g.value.add(Y(s.data)), s = d.findNode(Y(s.data)).parent;
|
|
3285
|
+
const l = d.viewItems.value.find((R) => R.key === t);
|
|
3286
|
+
l && Oe(l);
|
|
3287
3287
|
});
|
|
3288
3288
|
return Zn({
|
|
3289
|
-
hasErrors:
|
|
3289
|
+
hasErrors: d.hasErrors,
|
|
3290
3290
|
validationScope: n.validationScope,
|
|
3291
3291
|
reveal: wn
|
|
3292
|
-
}),
|
|
3293
|
-
...
|
|
3292
|
+
}), p({
|
|
3293
|
+
...d,
|
|
3294
3294
|
validateAll: wn,
|
|
3295
3295
|
// Legacy aliases (pre-v2 ASortableNested API).
|
|
3296
3296
|
addAfterId: Ka,
|
|
@@ -3298,7 +3298,7 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3298
3298
|
removeById: Va,
|
|
3299
3299
|
updateData: La,
|
|
3300
3300
|
resetDirtyBaseline: se,
|
|
3301
|
-
hasUnsavedChanges:
|
|
3301
|
+
hasUnsavedChanges: d.hasUnsaved,
|
|
3302
3302
|
unsavedCount: kn,
|
|
3303
3303
|
clearUnsavedState: Ma,
|
|
3304
3304
|
// Expand-aware flattened view (controller's own `viewItems` ignores collapse state).
|
|
@@ -3313,21 +3313,21 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3313
3313
|
},
|
|
3314
3314
|
expandDetail: (t) => M.value.add(t),
|
|
3315
3315
|
collapseDetail: (t) => M.value.delete(t)
|
|
3316
|
-
}), (t,
|
|
3316
|
+
}), (t, s) => (S(), N("div", {
|
|
3317
3317
|
ref_key: "rootEl",
|
|
3318
3318
|
ref: h,
|
|
3319
3319
|
class: Ne(["a-nested-list-editor", [
|
|
3320
|
-
`a-nested-list-editor--mode-${
|
|
3320
|
+
`a-nested-list-editor--mode-${b.value}`,
|
|
3321
3321
|
{
|
|
3322
3322
|
"a-nested-list-editor--readonly": e.readonly,
|
|
3323
3323
|
"a-nested-list-editor--disabled": e.disabled,
|
|
3324
3324
|
"a-nested-list-editor--touch": m(q),
|
|
3325
|
-
"a-nested-list-editor--drag-enabled":
|
|
3325
|
+
"a-nested-list-editor--drag-enabled": C.value
|
|
3326
3326
|
}
|
|
3327
3327
|
]])
|
|
3328
3328
|
}, [
|
|
3329
3329
|
O("div", _l, [
|
|
3330
|
-
|
|
3330
|
+
be.value ? (S(), N("div", ei, [
|
|
3331
3331
|
U(t.$slots, "header", fe({ title: e.title }, bn.value), () => [
|
|
3332
3332
|
e.title ? (S(), N("h3", ti, L(e.title), 1)) : ee("", !0),
|
|
3333
3333
|
O("div", ni, [
|
|
@@ -3364,7 +3364,7 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3364
3364
|
_: 1
|
|
3365
3365
|
}, 8, ["loading", "disabled", "onClick"])
|
|
3366
3366
|
]) : (S(), N(xe, { key: 1 }, [
|
|
3367
|
-
j.value &&
|
|
3367
|
+
j.value && he.value ? (S(), ne(re, {
|
|
3368
3368
|
key: 0,
|
|
3369
3369
|
variant: "tonal",
|
|
3370
3370
|
color: "primary",
|
|
@@ -3398,7 +3398,7 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3398
3398
|
_: 1
|
|
3399
3399
|
}, 8, ["prepend-icon"])) : ee("", !0),
|
|
3400
3400
|
ve.value ? U(t.$slots, "reorder-toggle", We(fe({ key: 2 }, bn.value)), () => [
|
|
3401
|
-
|
|
3401
|
+
he.value ? (S(), ne(re, {
|
|
3402
3402
|
key: 0,
|
|
3403
3403
|
variant: "tonal",
|
|
3404
3404
|
color: "primary",
|
|
@@ -3456,14 +3456,14 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3456
3456
|
]),
|
|
3457
3457
|
_: 1
|
|
3458
3458
|
})
|
|
3459
|
-
])) :
|
|
3459
|
+
])) : w.value ? (S(), N("div", li, [
|
|
3460
3460
|
U(t.$slots, "empty", {
|
|
3461
3461
|
readonly: e.readonly,
|
|
3462
3462
|
disabled: e.disabled,
|
|
3463
3463
|
actions: { add: kt }
|
|
3464
3464
|
}, () => [
|
|
3465
3465
|
c(_n, {
|
|
3466
|
-
title:
|
|
3466
|
+
title: J.value,
|
|
3467
3467
|
"add-label": B.value,
|
|
3468
3468
|
"can-add": ut.value,
|
|
3469
3469
|
onAdd: kt
|
|
@@ -3472,17 +3472,17 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3472
3472
|
])) : (S(), N("div", {
|
|
3473
3473
|
key: Ue.value,
|
|
3474
3474
|
ref_key: "rowsContainer",
|
|
3475
|
-
ref:
|
|
3475
|
+
ref: E,
|
|
3476
3476
|
class: Ne(["a-nested-list-editor__rows", { "a-nested-list-editor__rows--dragging": Le.value !== null }])
|
|
3477
3477
|
}, [
|
|
3478
3478
|
O("div", {
|
|
3479
3479
|
class: Ne([An, "a-nested-list-editor__group--root"]),
|
|
3480
3480
|
"data-parent-id": ""
|
|
3481
3481
|
}, [
|
|
3482
|
-
(S(!0), N(xe, null, rt(Ba.value, (
|
|
3483
|
-
key: String(
|
|
3484
|
-
vi:
|
|
3485
|
-
"view-items":
|
|
3482
|
+
(S(!0), N(xe, null, rt(Ba.value, (l) => (S(), ne(ma, {
|
|
3483
|
+
key: String(l.key),
|
|
3484
|
+
vi: l,
|
|
3485
|
+
"view-items": P.value,
|
|
3486
3486
|
"drag-state": Le.value,
|
|
3487
3487
|
context: $a.value,
|
|
3488
3488
|
callbacks: Fa
|
|
@@ -3531,12 +3531,12 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3531
3531
|
left: `${nt.value.line.left}px`,
|
|
3532
3532
|
right: `${nt.value.line.right}px`
|
|
3533
3533
|
})
|
|
3534
|
-
}, [...
|
|
3534
|
+
}, [...s[3] || (s[3] = [
|
|
3535
3535
|
O("span", { class: "a-nested-list-editor__drop-line-dot" }, null, -1)
|
|
3536
3536
|
])], 4)
|
|
3537
3537
|
], 64)) : ee("", !0)
|
|
3538
3538
|
], 2)),
|
|
3539
|
-
ut.value && !e.loading && !e.error && !
|
|
3539
|
+
ut.value && !e.loading && !e.error && !w.value ? U(t.$slots, "add-button", {
|
|
3540
3540
|
key: 5,
|
|
3541
3541
|
readonly: e.readonly,
|
|
3542
3542
|
disabled: e.disabled,
|
|
@@ -3558,28 +3558,28 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3558
3558
|
]),
|
|
3559
3559
|
c(ho, {
|
|
3560
3560
|
modelValue: Qt.value,
|
|
3561
|
-
"onUpdate:modelValue":
|
|
3561
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => Qt.value = l),
|
|
3562
3562
|
total: Zt.value?.total ?? 0,
|
|
3563
3563
|
"current-index": Zt.value?.currentIndex ?? 0,
|
|
3564
3564
|
"item-label": Ia.value,
|
|
3565
|
-
onConfirm:
|
|
3565
|
+
onConfirm: Pa
|
|
3566
3566
|
}, null, 8, ["modelValue", "total", "current-index", "item-label"]),
|
|
3567
3567
|
c(Zl, {
|
|
3568
3568
|
modelValue: _t.value,
|
|
3569
|
-
"onUpdate:modelValue":
|
|
3569
|
+
"onUpdate:modelValue": s[1] || (s[1] = (l) => _t.value = l),
|
|
3570
3570
|
tree: v.value,
|
|
3571
3571
|
"source-key": Tt.value?.key ?? null,
|
|
3572
3572
|
"key-field": m(V),
|
|
3573
3573
|
"max-depth": e.maxDepth,
|
|
3574
3574
|
"resolve-label": Yt,
|
|
3575
|
-
"calculate-subtree-depth": m(
|
|
3575
|
+
"calculate-subtree-depth": m(d).calculateSubtreeDepth,
|
|
3576
3576
|
onConfirm: Ta
|
|
3577
3577
|
}, null, 8, ["modelValue", "tree", "source-key", "key-field", "max-depth", "calculate-subtree-depth"]),
|
|
3578
3578
|
c(ta, {
|
|
3579
3579
|
modelValue: m(jt),
|
|
3580
|
-
"onUpdate:modelValue":
|
|
3580
|
+
"onUpdate:modelValue": s[2] || (s[2] = (l) => ia(jt) ? jt.value = l : null),
|
|
3581
3581
|
title: _.value,
|
|
3582
|
-
text:
|
|
3582
|
+
text: H.value,
|
|
3583
3583
|
"confirm-label": m($)("common.sortable.delete"),
|
|
3584
3584
|
"cancel-label": m($)("common.button.cancel"),
|
|
3585
3585
|
error: m(pa),
|
|
@@ -3606,15 +3606,15 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3606
3606
|
modelModifiers: {}
|
|
3607
3607
|
}),
|
|
3608
3608
|
emits: /* @__PURE__ */ Xe(["resolve"], ["update:modelValue"]),
|
|
3609
|
-
setup(e, { emit:
|
|
3610
|
-
const
|
|
3611
|
-
|
|
3612
|
-
},
|
|
3613
|
-
|
|
3609
|
+
setup(e, { emit: p }) {
|
|
3610
|
+
const o = p, n = gt(e, "modelValue"), { t: i } = ot(), v = () => {
|
|
3611
|
+
o("resolve", !1);
|
|
3612
|
+
}, b = () => {
|
|
3613
|
+
o("resolve", !0);
|
|
3614
3614
|
};
|
|
3615
|
-
return ($,
|
|
3615
|
+
return ($, k) => (S(), ne(sn, {
|
|
3616
3616
|
modelValue: n.value,
|
|
3617
|
-
"onUpdate:modelValue":
|
|
3617
|
+
"onUpdate:modelValue": k[0] || (k[0] = (u) => n.value = u),
|
|
3618
3618
|
"max-width": "480",
|
|
3619
3619
|
persistent: ""
|
|
3620
3620
|
}, {
|
|
@@ -3658,7 +3658,7 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3658
3658
|
c(re, {
|
|
3659
3659
|
color: "warning",
|
|
3660
3660
|
variant: "flat",
|
|
3661
|
-
onClick:
|
|
3661
|
+
onClick: b
|
|
3662
3662
|
}, {
|
|
3663
3663
|
default: f(() => [
|
|
3664
3664
|
te(L(e.discardLabel ?? m(i)("common.sortable.unsavedChanges.discard")), 1)
|
|
@@ -3675,35 +3675,35 @@ const Ot = (e, C) => e.find((l) => l.key === C) ?? null, va = (e, C, l) => {
|
|
|
3675
3675
|
_: 1
|
|
3676
3676
|
}, 8, ["modelValue"]));
|
|
3677
3677
|
}
|
|
3678
|
-
}), Gi = /* @__PURE__ */ oa(di, [["__scopeId", "data-v-8342a164"]]), ci = (e) => e == null ? !1 : typeof e == "boolean" ? e : e instanceof Set ? e.size > 0 : Array.isArray(e) ? e.length > 0 : !!e,
|
|
3678
|
+
}), Gi = /* @__PURE__ */ oa(di, [["__scopeId", "data-v-8342a164"]]), ci = (e) => e == null ? !1 : typeof e == "boolean" ? e : e instanceof Set ? e.size > 0 : Array.isArray(e) ? e.length > 0 : !!e, Pn = (e, p) => e === void 0 ? p : typeof e == "boolean" ? e : e.value;
|
|
3679
3679
|
function Ji(e) {
|
|
3680
|
-
const
|
|
3680
|
+
const p = Co();
|
|
3681
3681
|
if (e.ownSections) {
|
|
3682
3682
|
const u = e.ownSections, h = /* @__PURE__ */ Symbol("unsaved.section.own"), A = x(() => {
|
|
3683
3683
|
const q = u();
|
|
3684
3684
|
return Array.isArray(q) ? q : [q];
|
|
3685
3685
|
});
|
|
3686
|
-
|
|
3686
|
+
p.register(h, A);
|
|
3687
3687
|
}
|
|
3688
|
-
const
|
|
3689
|
-
() => e.sources.some((u) => ci(u.value)) ||
|
|
3688
|
+
const o = x(
|
|
3689
|
+
() => e.sources.some((u) => ci(u.value)) || p.dirtyLabels.value.length > 0
|
|
3690
3690
|
), n = ie(!1);
|
|
3691
3691
|
let i = null, v = !1;
|
|
3692
|
-
const
|
|
3692
|
+
const b = () => v ? (v = !1, Promise.resolve(!0)) : new Promise((u) => {
|
|
3693
3693
|
i = u, n.value = !0;
|
|
3694
3694
|
}), $ = (u) => {
|
|
3695
3695
|
n.value = !1, i && (i(u), i = null);
|
|
3696
|
-
},
|
|
3696
|
+
}, k = () => {
|
|
3697
3697
|
v = !0;
|
|
3698
3698
|
};
|
|
3699
|
-
if (
|
|
3699
|
+
if (Pn(e.guardRoute, !0) && sa())
|
|
3700
3700
|
try {
|
|
3701
|
-
Ko(async () =>
|
|
3701
|
+
Ko(async () => o.value ? await b() : !0);
|
|
3702
3702
|
} catch {
|
|
3703
3703
|
}
|
|
3704
|
-
if (
|
|
3704
|
+
if (Pn(e.guardWindowUnload, !0)) {
|
|
3705
3705
|
const u = (h) => {
|
|
3706
|
-
|
|
3706
|
+
o.value && (h.preventDefault(), h.returnValue = "");
|
|
3707
3707
|
};
|
|
3708
3708
|
typeof window < "u" && (window.addEventListener("beforeunload", u), on(() => {
|
|
3709
3709
|
window.removeEventListener("beforeunload", u);
|
|
@@ -3717,84 +3717,87 @@ function Ji(e) {
|
|
|
3717
3717
|
h = !1;
|
|
3718
3718
|
return;
|
|
3719
3719
|
}
|
|
3720
|
-
q === !0 && A === !1 &&
|
|
3720
|
+
q === !0 && A === !1 && o.value && (h = !0, u.value = !0, await b() && (h = !0, u.value = !1));
|
|
3721
3721
|
});
|
|
3722
3722
|
}
|
|
3723
3723
|
return {
|
|
3724
|
-
hasUnsavedChanges:
|
|
3725
|
-
dirtyLabels:
|
|
3724
|
+
hasUnsavedChanges: o,
|
|
3725
|
+
dirtyLabels: p.dirtyLabels,
|
|
3726
3726
|
promptOpen: n,
|
|
3727
3727
|
resolvePrompt: $,
|
|
3728
|
-
acknowledge:
|
|
3728
|
+
acknowledge: k
|
|
3729
3729
|
};
|
|
3730
3730
|
}
|
|
3731
|
-
function Wi(e,
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3731
|
+
function Wi(e, p) {
|
|
3732
|
+
return (...o) => (e.acknowledge(), p(...o));
|
|
3733
|
+
}
|
|
3734
|
+
function Xi(e, p = {}) {
|
|
3735
|
+
const o = p.keyField ?? "id", n = p.positionField ?? "position", i = p.positionMultiplier ?? 1, v = p.updatePosition === !0;
|
|
3736
|
+
v && o === n && console.warn(
|
|
3737
|
+
`[list-editor] key-field === position-field ("${o}") with update-position enabled. Reordering renumbers positions and thus changes row keys, breaking dirty/validity tracking. Point key-field at a stable identity field (e.g. "id").`
|
|
3735
3738
|
);
|
|
3736
|
-
const
|
|
3737
|
-
const
|
|
3739
|
+
const b = /* @__PURE__ */ new Set(), $ = (F) => {
|
|
3740
|
+
const r = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
|
|
3738
3741
|
let K = 0;
|
|
3739
3742
|
for (const Q of F) {
|
|
3740
3743
|
if (Q.key === void 0 || Q.key === null) {
|
|
3741
3744
|
K++;
|
|
3742
3745
|
continue;
|
|
3743
3746
|
}
|
|
3744
|
-
|
|
3747
|
+
r.has(Q.key) && d.add(String(Q.key)), r.add(Q.key);
|
|
3745
3748
|
}
|
|
3746
|
-
if (K === 0 &&
|
|
3747
|
-
const
|
|
3748
|
-
|
|
3749
|
-
`[list-editor] ${K} row(s) resolve to an undefined key (key-field "${
|
|
3750
|
-
),
|
|
3751
|
-
`[list-editor] duplicate row keys (key-field "${
|
|
3749
|
+
if (K === 0 && d.size === 0) return;
|
|
3750
|
+
const D = `${K}|${[...d].sort().join(",")}`;
|
|
3751
|
+
b.has(D) || (b.add(D), K > 0 && console.warn(
|
|
3752
|
+
`[list-editor] ${K} row(s) resolve to an undefined key (key-field "${o}"). Point key-field at a field every item has, or give new items unique temp ids (see nextListEditorTempId).`
|
|
3753
|
+
), d.size > 0 && console.warn(
|
|
3754
|
+
`[list-editor] duplicate row keys (key-field "${o}"): ${[...d].join(", ")}. Row keys must be unique — dirty tracking and validation rails target rows by key.`
|
|
3752
3755
|
));
|
|
3753
|
-
},
|
|
3754
|
-
const F = e.value.map((
|
|
3755
|
-
key:
|
|
3756
|
-
index:
|
|
3757
|
-
raw:
|
|
3758
|
-
position:
|
|
3756
|
+
}, k = x(() => {
|
|
3757
|
+
const F = e.value.map((r, d) => ({
|
|
3758
|
+
key: r[o],
|
|
3759
|
+
index: d,
|
|
3760
|
+
raw: r,
|
|
3761
|
+
position: r[n]
|
|
3759
3762
|
}));
|
|
3760
3763
|
return $(F), F;
|
|
3761
3764
|
}), u = (F) => xo(F, { positionField: n, positionMultiplier: i }), h = (F) => {
|
|
3762
|
-
const
|
|
3763
|
-
return e.value =
|
|
3764
|
-
}, A = (F) => F !== null && typeof F == "object", q = (F,
|
|
3765
|
-
const
|
|
3766
|
-
return q(F,
|
|
3767
|
-
}, g = (F,
|
|
3768
|
-
if (!
|
|
3769
|
-
if (
|
|
3770
|
-
const
|
|
3771
|
-
return
|
|
3765
|
+
const r = v ? u(F) : F;
|
|
3766
|
+
return e.value = r, r;
|
|
3767
|
+
}, A = (F) => F !== null && typeof F == "object", q = (F, r) => F.findIndex((d) => d[o] === r), z = (F, r) => {
|
|
3768
|
+
const d = A(r) ? r[o] : r;
|
|
3769
|
+
return q(F, d);
|
|
3770
|
+
}, g = (F, r) => {
|
|
3771
|
+
if (!r) return F.length;
|
|
3772
|
+
if (r.afterId !== void 0) {
|
|
3773
|
+
const d = q(F, r.afterId);
|
|
3774
|
+
return d === -1 ? F.length : d + 1;
|
|
3772
3775
|
}
|
|
3773
|
-
return
|
|
3776
|
+
return r.afterIndex !== void 0 ? r.afterIndex < 0 ? F.length : Math.min(r.afterIndex + 1, F.length) : r.index !== void 0 ? Math.max(0, Math.min(r.index, F.length)) : F.length;
|
|
3774
3777
|
};
|
|
3775
3778
|
return {
|
|
3776
|
-
viewItems:
|
|
3777
|
-
addItem: (F,
|
|
3778
|
-
const
|
|
3779
|
-
return
|
|
3779
|
+
viewItems: k,
|
|
3780
|
+
addItem: (F, r) => {
|
|
3781
|
+
const d = [...e.value], K = g(d, r);
|
|
3782
|
+
return d.splice(K, 0, F), h(d);
|
|
3780
3783
|
},
|
|
3781
3784
|
deleteItem: (F) => {
|
|
3782
|
-
const s = z(e.value, F);
|
|
3783
|
-
if (s === -1) return e.value;
|
|
3784
|
-
const r = [...e.value];
|
|
3785
|
-
return r.splice(s, 1), h(r);
|
|
3786
|
-
},
|
|
3787
|
-
updateItem: (F, s) => {
|
|
3788
3785
|
const r = z(e.value, F);
|
|
3789
3786
|
if (r === -1) return e.value;
|
|
3787
|
+
const d = [...e.value];
|
|
3788
|
+
return d.splice(r, 1), h(d);
|
|
3789
|
+
},
|
|
3790
|
+
updateItem: (F, r) => {
|
|
3791
|
+
const d = z(e.value, F);
|
|
3792
|
+
if (d === -1) return e.value;
|
|
3790
3793
|
const K = [...e.value];
|
|
3791
|
-
return K[
|
|
3794
|
+
return K[d] = r, h(K);
|
|
3792
3795
|
},
|
|
3793
|
-
moveItem: (F,
|
|
3794
|
-
const
|
|
3795
|
-
if (F ===
|
|
3796
|
-
const K = [...e.value], [
|
|
3797
|
-
return K.splice(
|
|
3796
|
+
moveItem: (F, r) => {
|
|
3797
|
+
const d = e.value.length;
|
|
3798
|
+
if (F === r || F < 0 || F >= d || r < 0 || r >= d) return e.value;
|
|
3799
|
+
const K = [...e.value], [D] = K.splice(F, 1);
|
|
3800
|
+
return K.splice(r, 0, D), h(K);
|
|
3798
3801
|
},
|
|
3799
3802
|
recalculatePositions: u
|
|
3800
3803
|
};
|
|
@@ -3803,11 +3806,11 @@ const ui = /* @__PURE__ */ Symbol(
|
|
|
3803
3806
|
"le.validation"
|
|
3804
3807
|
), fi = /* @__PURE__ */ Symbol("le.unsavedKeys");
|
|
3805
3808
|
function vi(e) {
|
|
3806
|
-
const
|
|
3807
|
-
if (!
|
|
3808
|
-
const
|
|
3809
|
+
const p = ht(ui, null);
|
|
3810
|
+
if (!p || !sa()) return;
|
|
3811
|
+
const o = ht(fi, null), n = x(() => {
|
|
3809
3812
|
if (e.invalid)
|
|
3810
|
-
return e.invalid() && ((e.dirty?.() ?? !1) || (
|
|
3813
|
+
return e.invalid() && ((e.dirty?.() ?? !1) || (o?.value.has(e.key()) ?? !1)) ? "invalid" : null;
|
|
3811
3814
|
const v = e.state;
|
|
3812
3815
|
return v === void 0 ? null : typeof v == "function" ? v() : v.value;
|
|
3813
3816
|
});
|
|
@@ -3815,92 +3818,93 @@ function vi(e) {
|
|
|
3815
3818
|
Ee(
|
|
3816
3819
|
e.key,
|
|
3817
3820
|
(v) => {
|
|
3818
|
-
i !== null && i !== v &&
|
|
3821
|
+
i !== null && i !== v && p.unregister(i), p.register(v, n), i = v;
|
|
3819
3822
|
},
|
|
3820
3823
|
{ immediate: !0 }
|
|
3821
3824
|
), on(() => {
|
|
3822
|
-
i !== null &&
|
|
3825
|
+
i !== null && p.unregister(i);
|
|
3823
3826
|
});
|
|
3824
3827
|
}
|
|
3825
|
-
function
|
|
3828
|
+
function Yi(e, p) {
|
|
3826
3829
|
vi({
|
|
3827
|
-
key:
|
|
3830
|
+
key: p,
|
|
3828
3831
|
invalid: () => e.value.$invalid,
|
|
3829
3832
|
dirty: () => e.value.$anyDirty
|
|
3830
3833
|
});
|
|
3831
3834
|
}
|
|
3832
|
-
function
|
|
3833
|
-
const e = ie(/* @__PURE__ */ new Map()),
|
|
3834
|
-
$.size === 0 ? e.value.delete(
|
|
3835
|
+
function Qi() {
|
|
3836
|
+
const e = ie(/* @__PURE__ */ new Map()), p = /* @__PURE__ */ new Set(), o = (b) => e.value.get(b) ?? p, n = (b, $) => {
|
|
3837
|
+
$.size === 0 ? e.value.delete(b) : e.value.set(b, $), e.value = new Map(e.value);
|
|
3835
3838
|
}, i = x(() => {
|
|
3836
|
-
const
|
|
3837
|
-
for (const [$,
|
|
3838
|
-
for (const u of
|
|
3839
|
-
|
|
3840
|
-
return
|
|
3839
|
+
const b = /* @__PURE__ */ new Set();
|
|
3840
|
+
for (const [$, k] of e.value.entries())
|
|
3841
|
+
for (const u of k)
|
|
3842
|
+
b.add(`${String($)}:${String(u)}`);
|
|
3843
|
+
return b;
|
|
3841
3844
|
}), v = x(() => i.value.size);
|
|
3842
|
-
return { getForParent:
|
|
3845
|
+
return { getForParent: o, setForParent: n, merged: i, count: v };
|
|
3843
3846
|
}
|
|
3844
3847
|
export {
|
|
3845
3848
|
Mi as ADatatableOrdering,
|
|
3846
3849
|
jo as ADatatablePagination,
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3850
|
+
es as AFilterBooleanSelect,
|
|
3851
|
+
ts as AFilterDatetimePicker,
|
|
3852
|
+
ns as AFilterInteger,
|
|
3853
|
+
as as AFilterRemoteAutocomplete,
|
|
3854
|
+
os as AFilterRemoteAutocompleteWithMinimal,
|
|
3855
|
+
ls as AFilterString,
|
|
3856
|
+
is as AFilterTimeInterval,
|
|
3857
|
+
ss as AFilterValueObjectOptionsSelect,
|
|
3858
|
+
rs as AFilterWrapper,
|
|
3856
3859
|
Li as AFilterWrapperSidebar,
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
+
ds as AFilterWrapperSubjectSelect,
|
|
3861
|
+
cs as AFormRemoteAutocomplete,
|
|
3862
|
+
us as AFormRemoteAutocompleteWithCached,
|
|
3860
3863
|
qi as AListEditor,
|
|
3861
3864
|
Hi as ANestedSortableListEditor,
|
|
3862
|
-
|
|
3865
|
+
fs as ASortableListEditor,
|
|
3863
3866
|
ji as ASubjectSelect,
|
|
3864
3867
|
Gi as AUnsavedConfirmDialog,
|
|
3865
3868
|
En as DatatablePaginationKey,
|
|
3866
3869
|
za as FilterConfigKey,
|
|
3867
3870
|
Na as FilterDataKey,
|
|
3868
|
-
|
|
3869
|
-
|
|
3871
|
+
vs as FilterInnerConfigKey,
|
|
3872
|
+
ms as FilterInnerDataKey,
|
|
3870
3873
|
ui as ListEditorValidationKey,
|
|
3871
|
-
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3874
|
+
ys as SharedReorderRegistryKey,
|
|
3875
|
+
hs as TimeIntervalSpecialOptions,
|
|
3876
|
+
gs as UserAdminConfigLayoutType,
|
|
3877
|
+
ps as UserAdminConfigLayoutTypeDefault,
|
|
3878
|
+
bs as UserAdminConfigType,
|
|
3879
|
+
ks as UserAdminConfigTypeDefault,
|
|
3877
3880
|
Jo as createDatatableColumnsConfig,
|
|
3878
|
-
|
|
3879
|
-
|
|
3881
|
+
ws as createFilter,
|
|
3882
|
+
Cs as createFilterStore,
|
|
3880
3883
|
en as generateListQuery,
|
|
3881
3884
|
co as nextListEditorTempId,
|
|
3882
3885
|
xo as renumberPositions,
|
|
3883
|
-
|
|
3884
|
-
|
|
3886
|
+
xs as sortByPosition,
|
|
3887
|
+
Ss as sortByPositionDeep,
|
|
3885
3888
|
zi as useApiFetchByIds,
|
|
3886
3889
|
Za as useApiFetchList,
|
|
3887
3890
|
Ni as useApiFetchListBatch,
|
|
3888
3891
|
Ha as useApiQueryBuilder,
|
|
3889
|
-
|
|
3892
|
+
As as useApiRequest,
|
|
3890
3893
|
lo as useFilterHelpers,
|
|
3894
|
+
Wi as useGuardedDelete,
|
|
3891
3895
|
Oi as useJobApi,
|
|
3892
|
-
|
|
3896
|
+
Xi as useListEditor,
|
|
3893
3897
|
ro as useListEditorController,
|
|
3894
3898
|
vi as useListEditorItemValidation,
|
|
3895
|
-
|
|
3896
|
-
|
|
3899
|
+
Yi as useListEditorVuelidateSentinel,
|
|
3900
|
+
Dl as useNestedListEditor,
|
|
3897
3901
|
El as useNestedListEditorController,
|
|
3898
|
-
|
|
3902
|
+
Qi as useNestedUnsavedKeys,
|
|
3899
3903
|
Gn as usePagination,
|
|
3900
3904
|
Ui as useSubjectSelect,
|
|
3901
3905
|
Ji as useUnsavedChangesGuard,
|
|
3902
3906
|
Qn as useUnsavedSection,
|
|
3903
|
-
|
|
3904
|
-
|
|
3907
|
+
Is as useUserAdminConfigApi,
|
|
3908
|
+
Ds as useUserAdminConfigFactory
|
|
3905
3909
|
};
|
|
3906
3910
|
//# sourceMappingURL=labs.js.map
|