@anzusystems/common-admin 1.47.0-beta.dev-1782072279 → 1.47.0-beta.dev-1782072299
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-CfOzQkN3.mjs → AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-CDFIJFqU.mjs} +3070 -3023
- package/dist/AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-CDFIJFqU.mjs.map +1 -0
- package/dist/common-admin.js +4 -4
- package/dist/{index-BvpuJJFr.mjs → index-DAvA4B-V.mjs} +2214 -2201
- package/dist/index-DAvA4B-V.mjs.map +1 -0
- package/dist/labs.d.ts +3 -1
- package/dist/labs.js +1434 -1416
- package/dist/labs.js.map +1 -1
- package/dist/{webfontloader-DqfwVp99.mjs → webfontloader-BGN_Aqmn.mjs} +2 -2
- package/dist/{webfontloader-DqfwVp99.mjs.map → webfontloader-BGN_Aqmn.mjs.map} +1 -1
- package/package.json +10 -10
- package/dist/AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-CfOzQkN3.mjs.map +0 -1
- package/dist/index-BvpuJJFr.mjs.map +0 -1
package/dist/labs.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { aG as Ka, aH as Ba, d as
|
|
2
|
-
import { aE as Gi, cm as Ji, cn as Wi, aA as Xi, aB as Yi, aD as Qi, aF as Zi, aC as _i, aS as
|
|
3
|
-
import { defineComponent as
|
|
1
|
+
import { aG as Ka, aH as Ba, d as Ie, bT as Ra, bU as La, bV as An, j as Ze, k as Va, a1 as Ma, h as kt, i as Bt, aj as In, ak as Pn, al as En, am as Dn, ag as Rt, a_ as $n, aa as Tn, ab as Fn, ac as Kn, ad as Bn, an as Rn, ao as Ln, ae as Vn, af as Mn, bW as zn, bX as Nn, be as On, bY as za, as as Un, bZ as Qt, ap as Na, aq as Oa, aV as Ua, b2 as ja, ar as qa, E as Ha, a8 as Ga, a2 as Ja, b_ as Wa, q as Xa, p as Ya, x as Qa, a7 as Za, aI as _a, m as jn, b$ as eo, l as to, c0 as no, c1 as qn, c2 as Hn, c3 as Gn, c4 as Jn, c5 as Wn, c6 as Xn, c7 as Yn, c8 as Qn, c9 as Zn, g as Be, ca as ao, cb as oo, _ as _n, cc as lo, cd as io, ce as so, cf as ro, cg as co, aU as uo, ch as fo, ci as vo, cj as mo, z as yo, ck as ho, cl as go } from "./AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-CDFIJFqU.mjs";
|
|
2
|
+
import { aE as Gi, cm as Ji, cn as Wi, aA as Xi, aB as Yi, aD as Qi, aF as Zi, aC as _i, aS as es, aJ as ts, bb as ns, aO as as, aX as os, ay as ls, az as is, co as ss, cp as rs, cq as ds, cr as cs, cs as us, ct as fs, ai as vs, ah as ms, cu as ys, cv as hs, cw as gs, cx as ps } from "./AFormRemoteAutocomplete.vue_vue_type_script_setup_true_lang-CDFIJFqU.mjs";
|
|
3
|
+
import { defineComponent as _e, inject as mt, provide as _t, ref as de, openBlock as x, createBlock as te, withModifiers as fe, withCtx as u, renderSlot as O, useModel as yt, computed as S, watch as $e, createElementBlock as N, createElementVNode as U, toDisplayString as V, unref as y, createVNode as r, createTextVNode as Q, Fragment as xe, renderList as st, normalizeClass as Ue, mergeModels as We, createCommentVNode as _, onMounted as en, toRaw as pn, resolveComponent as bn, mergeProps as ve, withDirectives as po, vShow as bo, useSlots as ea, useTemplateRef as Lt, isRef as ta, toValue as ko, reactive as wo, normalizeStyle as wt, normalizeProps as Je, guardReactiveProps as at, shallowRef as Zt, nextTick as Qe, onBeforeUnmount as tn, getCurrentInstance as na } from "vue";
|
|
4
4
|
import { VForm as Co } from "vuetify/components/VForm";
|
|
5
|
-
import { useI18n as
|
|
6
|
-
import { VBtn as
|
|
7
|
-
import { VList as Ct, VListItem as
|
|
5
|
+
import { useI18n as lt } from "vue-i18n";
|
|
6
|
+
import { VBtn as se } from "vuetify/components/VBtn";
|
|
7
|
+
import { VList as Ct, VListItem as je, VListItemTitle as He } from "vuetify/components/VList";
|
|
8
8
|
import { VMenu as Vt } from "vuetify/components/VMenu";
|
|
9
|
-
import { useThrottleFn as
|
|
10
|
-
import { VBtnToggle as
|
|
9
|
+
import { useThrottleFn as Dt, useDebounceFn as xo } from "@vueuse/core";
|
|
10
|
+
import { VBtnToggle as So } from "vuetify/components/VBtnToggle";
|
|
11
11
|
import aa from "axios";
|
|
12
12
|
import { useDisplay as oa } from "vuetify";
|
|
13
13
|
import { VCard as nn, VCardTitle as la, VCardText as Kt, VCardActions as ia } from "vuetify/components/VCard";
|
|
14
14
|
import { VDialog as an } from "vuetify/components/VDialog";
|
|
15
15
|
import { VSpacer as on } from "vuetify/components/VGrid";
|
|
16
|
-
import { VIcon as
|
|
17
|
-
import { VToolbar as
|
|
18
|
-
import { VTooltip as
|
|
16
|
+
import { VIcon as re } from "vuetify/components/VIcon";
|
|
17
|
+
import { VToolbar as Ao } from "vuetify/components/VToolbar";
|
|
18
|
+
import { VTooltip as qe } from "vuetify/components/VTooltip";
|
|
19
19
|
import { Intersect as Io } from "vuetify/directives";
|
|
20
20
|
import { VAlert as ln } from "vuetify/components/VAlert";
|
|
21
|
-
import { VProgressCircular as
|
|
21
|
+
import { VProgressCircular as sa } from "vuetify/components/VProgressCircular";
|
|
22
22
|
import { VRadio as kn } from "vuetify/components/VRadio";
|
|
23
23
|
import { VRadioGroup as Po } from "vuetify/components/VRadioGroup";
|
|
24
|
-
import { onBeforeRouteLeave as
|
|
25
|
-
const $i = /* @__PURE__ */
|
|
24
|
+
import { onBeforeRouteLeave as Eo } from "vue-router";
|
|
25
|
+
const $i = /* @__PURE__ */ _e({
|
|
26
26
|
__name: "AFilterWrapperSidebar",
|
|
27
27
|
props: {
|
|
28
28
|
formName: { default: "search" }
|
|
@@ -30,15 +30,15 @@ const $i = /* @__PURE__ */ nt({
|
|
|
30
30
|
emits: ["submit"],
|
|
31
31
|
setup(e, { emit: k }) {
|
|
32
32
|
const l = k, n = mt(Ka), i = mt(Ba);
|
|
33
|
-
if (
|
|
33
|
+
if (Ie(n) || Ie(i))
|
|
34
34
|
throw new Error("Incorrect provide/inject config.");
|
|
35
|
-
_t(Ra,
|
|
36
|
-
const
|
|
35
|
+
_t(Ra, de(0)), _t(La, de(/* @__PURE__ */ new Map()));
|
|
36
|
+
const m = () => {
|
|
37
37
|
l("submit");
|
|
38
38
|
};
|
|
39
|
-
return (w,
|
|
39
|
+
return (w, E) => (x(), te(Co, {
|
|
40
40
|
name: e.formName,
|
|
41
|
-
onSubmit:
|
|
41
|
+
onSubmit: fe(m, ["prevent"])
|
|
42
42
|
}, {
|
|
43
43
|
default: u(() => [
|
|
44
44
|
O(w.$slots, "default")
|
|
@@ -46,9 +46,9 @@ const $i = /* @__PURE__ */ nt({
|
|
|
46
46
|
_: 3
|
|
47
47
|
}, 8, ["name"]));
|
|
48
48
|
}
|
|
49
|
-
}),
|
|
49
|
+
}), Do = { class: "d-flex align-center justify-center" }, $o = { class: "text-body-small mr-1" }, Ti = /* @__PURE__ */ _e({
|
|
50
50
|
__name: "ADatatableOrdering",
|
|
51
|
-
props: /* @__PURE__ */
|
|
51
|
+
props: /* @__PURE__ */ We({
|
|
52
52
|
variant: { default: "id" },
|
|
53
53
|
customOptions: { default: void 0 },
|
|
54
54
|
paginationUpdateCustomCb: { type: Function, default: void 0 }
|
|
@@ -59,82 +59,82 @@ const $i = /* @__PURE__ */ nt({
|
|
|
59
59
|
},
|
|
60
60
|
modelModifiers: {}
|
|
61
61
|
}),
|
|
62
|
-
emits: /* @__PURE__ */
|
|
62
|
+
emits: /* @__PURE__ */ We(["sortByChange"], ["update:modelValue"]),
|
|
63
63
|
setup(e, { emit: k }) {
|
|
64
|
-
const l = e, n = k, i = yt(e, "modelValue"),
|
|
65
|
-
if (
|
|
64
|
+
const l = e, n = k, i = yt(e, "modelValue"), m = mt(An);
|
|
65
|
+
if (Ie(m))
|
|
66
66
|
throw new Error("Incorrect provide/inject config.");
|
|
67
|
-
const { t: w } =
|
|
67
|
+
const { t: w } = lt(), E = [
|
|
68
68
|
{
|
|
69
69
|
id: 1,
|
|
70
70
|
titleT: "common.system.datatable.ordering.mostRecent",
|
|
71
|
-
sortBy: { key: "createdAt", order:
|
|
71
|
+
sortBy: { key: "createdAt", order: Ze.Desc }
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
id: 2,
|
|
75
75
|
titleT: "common.system.datatable.ordering.oldest",
|
|
76
|
-
sortBy: { key: "createdAt", order:
|
|
76
|
+
sortBy: { key: "createdAt", order: Ze.Asc }
|
|
77
77
|
}
|
|
78
|
-
],
|
|
78
|
+
], b = [
|
|
79
79
|
{
|
|
80
80
|
id: 1,
|
|
81
81
|
titleT: "common.system.datatable.ordering.mostRecent",
|
|
82
|
-
sortBy: { key: "id", order:
|
|
82
|
+
sortBy: { key: "id", order: Ze.Desc }
|
|
83
83
|
},
|
|
84
84
|
{
|
|
85
85
|
id: 2,
|
|
86
86
|
titleT: "common.system.datatable.ordering.oldest",
|
|
87
|
-
sortBy: { key: "id", order:
|
|
87
|
+
sortBy: { key: "id", order: Ze.Asc }
|
|
88
88
|
}
|
|
89
89
|
], c = [
|
|
90
90
|
{
|
|
91
91
|
id: 3,
|
|
92
92
|
titleT: "common.system.datatable.ordering.mostRelevant",
|
|
93
|
-
sortBy: { key: Va, order:
|
|
93
|
+
sortBy: { key: Va, order: Ze.Desc }
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
id: 1,
|
|
97
97
|
titleT: "common.system.datatable.ordering.mostRecent",
|
|
98
|
-
sortBy: { key: "createdAt", order:
|
|
98
|
+
sortBy: { key: "createdAt", order: Ze.Desc }
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
id: 2,
|
|
102
102
|
titleT: "common.system.datatable.ordering.oldest",
|
|
103
|
-
sortBy: { key: "createdAt", order:
|
|
103
|
+
sortBy: { key: "createdAt", order: Ze.Asc }
|
|
104
104
|
}
|
|
105
|
-
], h =
|
|
106
|
-
const
|
|
107
|
-
return
|
|
108
|
-
}),
|
|
109
|
-
i.value =
|
|
110
|
-
}, M = (
|
|
111
|
-
|
|
112
|
-
...
|
|
105
|
+
], h = S(() => {
|
|
106
|
+
const g = I.value.find((z) => z.id === i.value);
|
|
107
|
+
return g ? w(g.titleT) : "";
|
|
108
|
+
}), I = S(() => l.customOptions ? l.customOptions : l.variant === "most-relevant" ? c : l.variant === "id" ? b : E), j = (g) => {
|
|
109
|
+
i.value = g.id;
|
|
110
|
+
}, M = (g) => {
|
|
111
|
+
g.sortBy || (m.value = {
|
|
112
|
+
...m.value,
|
|
113
113
|
sortBy: null
|
|
114
|
-
}, n("sortByChange",
|
|
114
|
+
}, n("sortByChange", g)), m.value.sortBy = g.sortBy, n("sortByChange", g);
|
|
115
115
|
};
|
|
116
|
-
return
|
|
117
|
-
if (
|
|
118
|
-
const q =
|
|
119
|
-
if (!
|
|
120
|
-
if (
|
|
116
|
+
return $e(i, (g, z) => {
|
|
117
|
+
if (g === z) return;
|
|
118
|
+
const q = I.value.find((B) => B.id === g);
|
|
119
|
+
if (!Ie(q)) {
|
|
120
|
+
if (Ie(l.paginationUpdateCustomCb)) {
|
|
121
121
|
M(q);
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
l.paginationUpdateCustomCb(q,
|
|
124
|
+
l.paginationUpdateCustomCb(q, m);
|
|
125
125
|
}
|
|
126
|
-
}),
|
|
127
|
-
|
|
128
|
-
(
|
|
129
|
-
if (
|
|
126
|
+
}), $e(
|
|
127
|
+
m,
|
|
128
|
+
(g, z) => {
|
|
129
|
+
if (g.sortBy?.key === z?.sortBy?.key && g.sortBy?.order === z?.sortBy?.order)
|
|
130
130
|
return;
|
|
131
|
-
const q =
|
|
132
|
-
|
|
131
|
+
const q = I.value.find((B) => g.sortBy?.key === B.sortBy?.key && g.sortBy?.order === B.sortBy?.order);
|
|
132
|
+
Ie(q) || (i.value = q.id);
|
|
133
133
|
},
|
|
134
134
|
{ immediate: !0 }
|
|
135
|
-
), (
|
|
136
|
-
U("div", $o,
|
|
137
|
-
|
|
135
|
+
), (g, z) => (x(), N("div", Do, [
|
|
136
|
+
U("div", $o, V(y(w)("common.system.datatable.ordering.title")) + ": ", 1),
|
|
137
|
+
r(se, {
|
|
138
138
|
variant: "text",
|
|
139
139
|
rounded: "xl",
|
|
140
140
|
size: "small",
|
|
@@ -142,28 +142,28 @@ const $i = /* @__PURE__ */ nt({
|
|
|
142
142
|
"append-icon": "mdi-chevron-down"
|
|
143
143
|
}, {
|
|
144
144
|
default: u(() => [
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
Q(V(h.value) + " ", 1),
|
|
146
|
+
r(Vt, {
|
|
147
147
|
activator: "parent",
|
|
148
148
|
location: "bottom",
|
|
149
149
|
"close-on-content-click": ""
|
|
150
150
|
}, {
|
|
151
151
|
default: u(() => [
|
|
152
|
-
|
|
152
|
+
r(Ct, {
|
|
153
153
|
density: "compact",
|
|
154
154
|
class: "pa-0"
|
|
155
155
|
}, {
|
|
156
156
|
default: u(() => [
|
|
157
|
-
(x(!0), N(
|
|
157
|
+
(x(!0), N(xe, null, st(I.value, (q) => (x(), te(je, {
|
|
158
158
|
key: q.id,
|
|
159
|
-
onClick: (
|
|
159
|
+
onClick: (B) => j(q)
|
|
160
160
|
}, {
|
|
161
161
|
default: u(() => [
|
|
162
|
-
|
|
163
|
-
class:
|
|
162
|
+
r(He, {
|
|
163
|
+
class: Ue({ "font-weight-bold": q.id === i.value })
|
|
164
164
|
}, {
|
|
165
165
|
default: u(() => [
|
|
166
|
-
|
|
166
|
+
Q(V(y(w)(q.titleT)), 1)
|
|
167
167
|
]),
|
|
168
168
|
_: 2
|
|
169
169
|
}, 1032, ["class"])
|
|
@@ -184,7 +184,7 @@ const $i = /* @__PURE__ */ nt({
|
|
|
184
184
|
}), To = { class: "anzu-data-footer" }, Fo = {
|
|
185
185
|
key: 0,
|
|
186
186
|
class: "anzu-data-footer__page-limit"
|
|
187
|
-
}, Ko = { class: "anzu-data-footer__pagination" }, Bo = { class: "anzu-data-footer__icons-before" }, Ro = { class: "current-page" }, Lo = { class: "anzu-data-footer__icons-after" }, Vo = /* @__PURE__ */
|
|
187
|
+
}, Ko = { class: "anzu-data-footer__pagination" }, Bo = { class: "anzu-data-footer__icons-before" }, Ro = { class: "current-page" }, Lo = { class: "anzu-data-footer__icons-after" }, Vo = /* @__PURE__ */ _e({
|
|
188
188
|
__name: "ADatatablePagination",
|
|
189
189
|
props: {
|
|
190
190
|
itemsPerPageOptions: { default: () => [10, 25, 50] },
|
|
@@ -192,52 +192,52 @@ const $i = /* @__PURE__ */ nt({
|
|
|
192
192
|
},
|
|
193
193
|
emits: ["change"],
|
|
194
194
|
setup(e, { emit: k }) {
|
|
195
|
-
const l = k, n = mt(
|
|
196
|
-
if (
|
|
195
|
+
const l = k, n = mt(An);
|
|
196
|
+
if (Ie(n))
|
|
197
197
|
throw new Error("Incorrect provide/inject config.");
|
|
198
|
-
const { t: i } =
|
|
199
|
-
|
|
198
|
+
const { t: i } = lt(), { setStoredPage: m } = Ma(), w = S(() => Math.ceil(n.value.totalCount / n.value.rowsPerPage)), E = S(() => n.value.page * n.value.rowsPerPage - n.value.rowsPerPage + 1), b = S(() => n.value.page * n.value.rowsPerPage - n.value.rowsPerPage + n.value.currentViewCount), c = S(() => n.value.page === 1), h = S(() => !kt(n.value.hasNextPage) || n.value.page === w.value), I = S(() => kt(n.value.hasNextPage) && n.value.page === w.value || n.value.hasNextPage === !1), j = S(() => kt(n.value.hasNextPage) ? n.value.totalCount : n.value.hasNextPage ? b.value + 1 + "+" : b.value);
|
|
199
|
+
$e(
|
|
200
200
|
() => n.value.rowsPerPage,
|
|
201
|
-
(
|
|
202
|
-
|
|
201
|
+
(B, X) => {
|
|
202
|
+
B !== X && (n.value.page = 1, l("change"));
|
|
203
203
|
}
|
|
204
|
-
),
|
|
204
|
+
), $e(
|
|
205
205
|
() => n.value.page,
|
|
206
|
-
(
|
|
207
|
-
|
|
206
|
+
(B, X) => {
|
|
207
|
+
B !== X && (m(B), l("change"));
|
|
208
208
|
}
|
|
209
209
|
);
|
|
210
|
-
const M =
|
|
210
|
+
const M = Dt(() => {
|
|
211
211
|
n.value.page = 1;
|
|
212
|
-
}, 300),
|
|
212
|
+
}, 300), g = Dt(() => {
|
|
213
213
|
n.value.page = w.value;
|
|
214
|
-
}, 300), z =
|
|
214
|
+
}, 300), z = Dt(() => {
|
|
215
215
|
n.value.page = n.value.page - 1;
|
|
216
|
-
}, 300), q =
|
|
216
|
+
}, 300), q = Dt(() => {
|
|
217
217
|
n.value.page = n.value.page + 1;
|
|
218
218
|
}, 300);
|
|
219
|
-
return (
|
|
220
|
-
e.hideRecordsPerPage ?
|
|
221
|
-
|
|
222
|
-
|
|
219
|
+
return (B, X) => (x(), N("div", To, [
|
|
220
|
+
e.hideRecordsPerPage ? _("", !0) : (x(), N("div", Fo, [
|
|
221
|
+
Q(V(y(i)("common.system.datatable.itemsPerPage")) + ": ", 1),
|
|
222
|
+
r(So, {
|
|
223
223
|
modelValue: y(n).rowsPerPage,
|
|
224
|
-
"onUpdate:modelValue":
|
|
224
|
+
"onUpdate:modelValue": X[0] || (X[0] = (D) => y(n).rowsPerPage = D),
|
|
225
225
|
class: "ml-2",
|
|
226
226
|
density: "compact",
|
|
227
227
|
mandatory: "",
|
|
228
228
|
"data-cy": "table-size"
|
|
229
229
|
}, {
|
|
230
230
|
default: u(() => [
|
|
231
|
-
(x(!0), N(
|
|
232
|
-
key:
|
|
233
|
-
color:
|
|
234
|
-
value:
|
|
231
|
+
(x(!0), N(xe, null, st(e.itemsPerPageOptions, (D) => (x(), te(se, {
|
|
232
|
+
key: D,
|
|
233
|
+
color: D === y(n).rowsPerPage ? "secondary" : "",
|
|
234
|
+
value: D,
|
|
235
235
|
density: "compact",
|
|
236
236
|
size: "small",
|
|
237
237
|
variant: "text"
|
|
238
238
|
}, {
|
|
239
239
|
default: u(() => [
|
|
240
|
-
|
|
240
|
+
Q(V(D), 1)
|
|
241
241
|
]),
|
|
242
242
|
_: 2
|
|
243
243
|
}, 1032, ["color", "value"]))), 128))
|
|
@@ -245,82 +245,82 @@ const $i = /* @__PURE__ */ nt({
|
|
|
245
245
|
_: 1
|
|
246
246
|
}, 8, ["modelValue"])
|
|
247
247
|
])),
|
|
248
|
-
U("div", Ko,
|
|
248
|
+
U("div", Ko, V(E.value) + " - " + V(b.value) + " " + V(y(i)("common.system.datatable.from")) + " " + V(j.value), 1),
|
|
249
249
|
U("div", Bo, [
|
|
250
|
-
|
|
250
|
+
r(se, {
|
|
251
251
|
disabled: c.value,
|
|
252
252
|
icon: "mdi-page-first",
|
|
253
253
|
size: "small",
|
|
254
254
|
variant: "text",
|
|
255
|
-
onClick:
|
|
255
|
+
onClick: fe(y(M), ["stop"])
|
|
256
256
|
}, null, 8, ["disabled", "onClick"]),
|
|
257
|
-
|
|
257
|
+
r(se, {
|
|
258
258
|
disabled: c.value,
|
|
259
259
|
icon: "mdi-chevron-left",
|
|
260
260
|
size: "small",
|
|
261
261
|
variant: "text",
|
|
262
|
-
onClick:
|
|
262
|
+
onClick: fe(y(z), ["stop"])
|
|
263
263
|
}, null, 8, ["disabled", "onClick"])
|
|
264
264
|
]),
|
|
265
265
|
U("div", Ro, [
|
|
266
|
-
U("span", null,
|
|
266
|
+
U("span", null, V(y(n).page), 1)
|
|
267
267
|
]),
|
|
268
268
|
U("div", Lo, [
|
|
269
|
-
|
|
270
|
-
disabled:
|
|
269
|
+
r(se, {
|
|
270
|
+
disabled: I.value,
|
|
271
271
|
icon: "mdi-chevron-right",
|
|
272
272
|
size: "small",
|
|
273
273
|
variant: "text",
|
|
274
|
-
onClick:
|
|
274
|
+
onClick: fe(y(q), ["stop"])
|
|
275
275
|
}, null, 8, ["disabled", "onClick"]),
|
|
276
|
-
|
|
276
|
+
r(se, {
|
|
277
277
|
disabled: h.value,
|
|
278
278
|
icon: "mdi-page-last",
|
|
279
279
|
size: "small",
|
|
280
280
|
variant: "text",
|
|
281
|
-
onClick:
|
|
281
|
+
onClick: fe(y(g), ["stop"])
|
|
282
282
|
}, null, 8, ["disabled", "onClick"])
|
|
283
283
|
])
|
|
284
284
|
]));
|
|
285
285
|
}
|
|
286
286
|
}), Mo = (e, k, l = "id") => {
|
|
287
|
-
const { querySetLimit: n, querySetOffset: i, querySetOrder:
|
|
288
|
-
return n(c), i(1, c),
|
|
287
|
+
const { querySetLimit: n, querySetOffset: i, querySetOrder: m, queryBuild: w, queryAddFilter: E, queryAdd: b } = za(), c = e.length;
|
|
288
|
+
return n(c), i(1, c), m(l, !1), k ? b(l, e.join(",")) : E("in", l, e.join(",")), w();
|
|
289
289
|
}, Fi = (e) => {
|
|
290
290
|
const {
|
|
291
291
|
client: k,
|
|
292
292
|
system: l,
|
|
293
293
|
entity: n,
|
|
294
294
|
urlTemplate: i,
|
|
295
|
-
urlParams:
|
|
295
|
+
urlParams: m,
|
|
296
296
|
options: w = {},
|
|
297
|
-
isSearchApi:
|
|
298
|
-
field:
|
|
297
|
+
isSearchApi: E = !1,
|
|
298
|
+
field: b = "id",
|
|
299
299
|
silentConsoleError: c = !1
|
|
300
300
|
} = e;
|
|
301
301
|
let h = null;
|
|
302
302
|
return {
|
|
303
|
-
executeFetch: async (M,
|
|
303
|
+
executeFetch: async (M, g = {}) => {
|
|
304
304
|
h = new AbortController();
|
|
305
|
-
const { urlTemplate: z, urlParams: q } =
|
|
305
|
+
const { urlTemplate: z, urlParams: q } = g;
|
|
306
306
|
try {
|
|
307
|
-
const
|
|
308
|
-
if (
|
|
309
|
-
const
|
|
307
|
+
const B = Bt(q) ? q : m, X = Bt(z) ? z : i;
|
|
308
|
+
if (Ie(X)) throw new Error("Url template is undefined");
|
|
309
|
+
const D = (Ie(B) ? X : In(X, B)) + Mo(M, E, b), s = await k().get(D, {
|
|
310
310
|
...w,
|
|
311
311
|
signal: h.signal
|
|
312
312
|
});
|
|
313
|
-
if (!Pn(
|
|
314
|
-
throw new
|
|
315
|
-
if (
|
|
316
|
-
return
|
|
317
|
-
if (
|
|
313
|
+
if (!Pn(s.status))
|
|
314
|
+
throw new En(s.status);
|
|
315
|
+
if (s.data?.data)
|
|
316
|
+
return s.data.data;
|
|
317
|
+
if (s.status === Dn)
|
|
318
318
|
return [];
|
|
319
319
|
throw new Rt();
|
|
320
|
-
} catch (
|
|
321
|
-
if (
|
|
320
|
+
} catch (B) {
|
|
321
|
+
if (B instanceof DOMException && B.name === "AbortError")
|
|
322
322
|
return [];
|
|
323
|
-
throw $n(
|
|
323
|
+
throw $n(B) ? B : Tn(B) ? new Fn(B, B.config?.url) : Kn(B) ? new Bn(B, l, n, B) : Rn(B) ? new Ln(B, l, n, B) : Vn(B) ? new Mn(B, B) : zn(B) ? new Nn(B) : aa.isAxiosError(B) ? (c || console.error("Axios error: " + i, ...B.cause ? [B.cause] : []), new On(B)) : (c || console.error("AnzuFatalError: ", B), new Rt(B));
|
|
324
324
|
} finally {
|
|
325
325
|
h = null;
|
|
326
326
|
}
|
|
@@ -335,82 +335,82 @@ const $i = /* @__PURE__ */ nt({
|
|
|
335
335
|
system: l,
|
|
336
336
|
entity: n,
|
|
337
337
|
urlTemplate: i,
|
|
338
|
-
urlParams:
|
|
338
|
+
urlParams: m,
|
|
339
339
|
options: w = {},
|
|
340
|
-
silentConsoleError:
|
|
340
|
+
silentConsoleError: E = !1
|
|
341
341
|
} = e;
|
|
342
|
-
let
|
|
342
|
+
let b = null;
|
|
343
343
|
return {
|
|
344
|
-
executeFetch: async (
|
|
345
|
-
|
|
344
|
+
executeFetch: async (I, j, M = {}) => {
|
|
345
|
+
b = new AbortController();
|
|
346
346
|
const {
|
|
347
|
-
urlTemplate:
|
|
347
|
+
urlTemplate: g,
|
|
348
348
|
urlParams: z,
|
|
349
349
|
sortBy: q = "id",
|
|
350
|
-
sortDesc:
|
|
351
|
-
batchSize:
|
|
352
|
-
forceElastic:
|
|
350
|
+
sortDesc: B = !0,
|
|
351
|
+
batchSize: X = 100,
|
|
352
|
+
forceElastic: D = !1
|
|
353
353
|
} = M;
|
|
354
354
|
try {
|
|
355
|
-
const
|
|
356
|
-
if (
|
|
357
|
-
const { pagination: P } = Un(q,
|
|
358
|
-
rowsPerPage:
|
|
359
|
-
}),
|
|
360
|
-
|
|
355
|
+
const s = j.general.elastic || D ? "/search" : "", f = Bt(z) ? z : m, T = Bt(g) ? g : i;
|
|
356
|
+
if (Ie(T)) throw new Error("Url template is undefined");
|
|
357
|
+
const { pagination: P } = Un(q, B ? Ze.Desc : Ze.Asc, {
|
|
358
|
+
rowsPerPage: X
|
|
359
|
+
}), Y = (Ie(f) ? T : In(T, f)) + s, ce = [], ne = await k().get(
|
|
360
|
+
Y + Qt(P, I, j),
|
|
361
361
|
{
|
|
362
362
|
...w,
|
|
363
|
-
signal:
|
|
363
|
+
signal: b.signal
|
|
364
364
|
}
|
|
365
365
|
);
|
|
366
|
-
if (!Pn(
|
|
367
|
-
throw new
|
|
368
|
-
if (
|
|
369
|
-
const le =
|
|
370
|
-
if (
|
|
366
|
+
if (!Pn(ne.status))
|
|
367
|
+
throw new En(ne.status);
|
|
368
|
+
if (ne.data) {
|
|
369
|
+
const le = ne.data;
|
|
370
|
+
if (ce.push(...le.data), Na(le))
|
|
371
371
|
for (P.value.hasNextPage = le.hasNextPage; P.value.hasNextPage; ) {
|
|
372
372
|
P.value.page++;
|
|
373
|
-
const
|
|
374
|
-
|
|
373
|
+
const Re = (await k().get(
|
|
374
|
+
Y + Qt(P, I, j),
|
|
375
375
|
{
|
|
376
376
|
...w,
|
|
377
|
-
signal:
|
|
377
|
+
signal: b.signal
|
|
378
378
|
}
|
|
379
379
|
)).data;
|
|
380
|
-
|
|
380
|
+
ce.push(...Re.data), P.value.hasNextPage = Re.hasNextPage;
|
|
381
381
|
}
|
|
382
382
|
else if (Oa(le)) {
|
|
383
383
|
if (P.value.totalCount = le.totalCount, P.value.totalCount <= P.value.rowsPerPage)
|
|
384
|
-
return
|
|
385
|
-
const
|
|
386
|
-
for (let
|
|
387
|
-
const C = { ...P.value, page:
|
|
388
|
-
|
|
389
|
-
k().get(
|
|
384
|
+
return ce;
|
|
385
|
+
const ie = [], Re = Math.ceil(P.value.totalCount / P.value.rowsPerPage);
|
|
386
|
+
for (let v = 1; v < Re; v++) {
|
|
387
|
+
const C = { ...P.value, page: v + 1 }, F = de(C);
|
|
388
|
+
ie.push(
|
|
389
|
+
k().get(Y + Qt(F, I, j), {
|
|
390
390
|
...w,
|
|
391
|
-
signal:
|
|
391
|
+
signal: b.signal
|
|
392
392
|
})
|
|
393
393
|
);
|
|
394
394
|
}
|
|
395
|
-
(await Promise.all(
|
|
396
|
-
|
|
395
|
+
(await Promise.all(ie)).forEach((v) => {
|
|
396
|
+
ce.push(...v.data.data);
|
|
397
397
|
});
|
|
398
398
|
}
|
|
399
|
-
return
|
|
399
|
+
return ce;
|
|
400
400
|
}
|
|
401
|
-
if (
|
|
401
|
+
if (ne.status === Dn)
|
|
402
402
|
return [];
|
|
403
403
|
throw new Rt();
|
|
404
|
-
} catch (
|
|
405
|
-
if (
|
|
404
|
+
} catch (s) {
|
|
405
|
+
if (s instanceof DOMException && s.name === "AbortError")
|
|
406
406
|
return [];
|
|
407
|
-
throw $n(
|
|
407
|
+
throw $n(s) ? s : Tn(s) ? new Fn(s, s.config?.url) : Kn(s) ? new Bn(s, l, n, s) : Rn(s) ? new Ln(s, l, n, s) : Vn(s) ? new Mn(s, s) : zn(s) ? new Nn(s) : aa.isAxiosError(s) ? (E || console.error("Axios error: " + i, ...s.cause ? [s.cause] : []), new On(s)) : (E || console.error("AnzuFatalError: ", s), new Rt(s));
|
|
408
408
|
} finally {
|
|
409
|
-
|
|
409
|
+
b = null;
|
|
410
410
|
}
|
|
411
411
|
},
|
|
412
412
|
abortFetch: () => {
|
|
413
|
-
|
|
413
|
+
b && b.abort();
|
|
414
414
|
}
|
|
415
415
|
};
|
|
416
416
|
}, $t = "/adm/v1/job", Tt = "job";
|
|
@@ -419,8 +419,8 @@ function Bi(e, k) {
|
|
|
419
419
|
useFetchJobList: () => Ga({ client: e, system: k, entity: Tt, urlTemplate: $t }),
|
|
420
420
|
fetchJob: (w) => Ha(e, $t + "/:id", { id: w }, k, Tt),
|
|
421
421
|
createJob: (w) => {
|
|
422
|
-
const
|
|
423
|
-
return qa(e, w, $t + "/:type", { type:
|
|
422
|
+
const E = ja(w._resourceName).slice(4).replace("-kind-", "-kind/");
|
|
423
|
+
return qa(e, w, $t + "/:type", { type: E }, k, Tt);
|
|
424
424
|
},
|
|
425
425
|
deleteJob: (w) => Ua(e, $t + "/:id", { id: w }, k, Tt)
|
|
426
426
|
};
|
|
@@ -437,29 +437,29 @@ const zo = {
|
|
|
437
437
|
showExpand: !1
|
|
438
438
|
};
|
|
439
439
|
function Oo(e, k, l, n, i = {}) {
|
|
440
|
-
const
|
|
441
|
-
let
|
|
442
|
-
Qa(
|
|
440
|
+
const m = { ...No, ...i }, w = m.customI18n ?? Ja, { t: E } = w.global || w;
|
|
441
|
+
let b;
|
|
442
|
+
Qa(m.storeColumnsLocalStorage) ? b = m.storeColumnsLocalStorage : Za(m.storeColumnsLocalStorage) && m.storeColumnsLocalStorage === !0 && (b = "table_" + l + "_" + n);
|
|
443
443
|
const c = e.map((M) => {
|
|
444
|
-
const
|
|
445
|
-
return
|
|
446
|
-
}), h =
|
|
444
|
+
const g = { ...zo, ...M };
|
|
445
|
+
return Ie(g.title) && (Ie(g.title) && Wa.includes(g.key) ? g.title = E("common.model.tracking." + g.key) : Ie(g.title) && l && n ? g.title = E(l + "." + n + ".model." + g.key) : g.title = ""), g;
|
|
446
|
+
}), h = S(() => {
|
|
447
447
|
const M = [];
|
|
448
|
-
return
|
|
449
|
-
k.value.includes(
|
|
450
|
-
}),
|
|
451
|
-
}),
|
|
452
|
-
if (!
|
|
453
|
-
const M = localStorage.getItem(
|
|
448
|
+
return m.showExpand && M.push({ key: "data-table-expand", sortable: !1 }), c.forEach((g) => {
|
|
449
|
+
k.value.includes(g.key) || M.push(g);
|
|
450
|
+
}), m.disableActions || M.push({ key: "actions", sortable: !1, fixed: "end" }), M;
|
|
451
|
+
}), I = () => {
|
|
452
|
+
if (!b || !localStorage) return;
|
|
453
|
+
const M = localStorage.getItem(b);
|
|
454
454
|
if (!M) return;
|
|
455
|
-
const
|
|
456
|
-
Xa(
|
|
455
|
+
const g = JSON.parse(M);
|
|
456
|
+
Xa(g) && Ya(g.hidden) && (k.value = g.hidden);
|
|
457
457
|
}, j = (M) => {
|
|
458
|
-
!
|
|
458
|
+
!b || !localStorage || localStorage.setItem(b, JSON.stringify({ hidden: M }));
|
|
459
459
|
};
|
|
460
460
|
return en(() => {
|
|
461
|
-
|
|
462
|
-
}),
|
|
461
|
+
I();
|
|
462
|
+
}), $e(k, (M) => {
|
|
463
463
|
j(M);
|
|
464
464
|
}), {
|
|
465
465
|
columnsAll: c,
|
|
@@ -467,84 +467,84 @@ function Oo(e, k, l, n, i = {}) {
|
|
|
467
467
|
columnsHidden: k
|
|
468
468
|
};
|
|
469
469
|
}
|
|
470
|
-
function Ri(e, k, l, n, i,
|
|
471
|
-
const h =
|
|
472
|
-
kt(
|
|
473
|
-
|
|
474
|
-
), { resetFilter:
|
|
470
|
+
function Ri(e, k, l, n, i, m, w, E = null, b = void 0, c = !1) {
|
|
471
|
+
const h = de(!1), I = de([]), j = de([]), M = de(!1), { pagination: g, setSortBy: z, incrementPage: q } = Un(
|
|
472
|
+
kt(E) ? null : E.key,
|
|
473
|
+
E?.order
|
|
474
|
+
), { resetFilter: B, submitFilter: X } = _a(m, w, {
|
|
475
475
|
storeFiltersLocalStorage: !1,
|
|
476
476
|
populateUrlParams: !1
|
|
477
|
-
}), { showErrorsDefault:
|
|
477
|
+
}), { showErrorsDefault: D } = jn(), { columnsVisible: s, columnsAll: f, columnsHidden: T } = Oo(
|
|
478
478
|
e,
|
|
479
479
|
k,
|
|
480
480
|
l,
|
|
481
481
|
n,
|
|
482
482
|
{ storeColumnsLocalStorage: !1, disableActions: !c }
|
|
483
483
|
), P = () => {
|
|
484
|
-
|
|
485
|
-
},
|
|
486
|
-
z($.sortBy),
|
|
487
|
-
},
|
|
484
|
+
ne(), ie();
|
|
485
|
+
}, Y = ($) => {
|
|
486
|
+
z($.sortBy), ie();
|
|
487
|
+
}, ce = async () => {
|
|
488
488
|
M.value = !0, q();
|
|
489
489
|
try {
|
|
490
|
-
const $ = await i(
|
|
491
|
-
|
|
490
|
+
const $ = await i(g, m, w, b);
|
|
491
|
+
I.value.push(...$);
|
|
492
492
|
} catch ($) {
|
|
493
|
-
|
|
493
|
+
D($);
|
|
494
494
|
} finally {
|
|
495
495
|
M.value = !1;
|
|
496
496
|
}
|
|
497
|
-
},
|
|
498
|
-
|
|
497
|
+
}, ne = () => {
|
|
498
|
+
I.value = [], j.value = [];
|
|
499
499
|
}, le = async () => {
|
|
500
500
|
M.value = !0;
|
|
501
501
|
try {
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
502
|
+
I.value = await i(
|
|
503
|
+
g,
|
|
504
|
+
m,
|
|
505
505
|
w,
|
|
506
|
-
|
|
506
|
+
b
|
|
507
507
|
);
|
|
508
508
|
} catch ($) {
|
|
509
|
-
|
|
509
|
+
D($);
|
|
510
510
|
} finally {
|
|
511
511
|
M.value = !1;
|
|
512
512
|
}
|
|
513
|
-
},
|
|
513
|
+
}, ie = xo(async () => {
|
|
514
514
|
await le();
|
|
515
515
|
});
|
|
516
516
|
return {
|
|
517
|
-
items:
|
|
517
|
+
items: I,
|
|
518
518
|
selected: j,
|
|
519
|
-
pagination:
|
|
520
|
-
columnsVisible:
|
|
519
|
+
pagination: g,
|
|
520
|
+
columnsVisible: s,
|
|
521
521
|
columnsHidden: T,
|
|
522
522
|
columnsAll: f,
|
|
523
523
|
filterTouched: h,
|
|
524
524
|
loading: M,
|
|
525
525
|
onRowClick: ($) => {
|
|
526
|
-
const
|
|
527
|
-
if (!
|
|
526
|
+
const v = $.target;
|
|
527
|
+
if (!v || v.tagName === "INPUT" && v.type === "checkbox")
|
|
528
528
|
return;
|
|
529
|
-
const C =
|
|
529
|
+
const C = v.closest(".v-data-table__tr");
|
|
530
530
|
if (!C || !C.classList.contains("v-data-table__tr")) return;
|
|
531
531
|
const F = C.firstElementChild;
|
|
532
532
|
if (!F || !F.classList.contains("v-data-table__td")) return;
|
|
533
|
-
const
|
|
534
|
-
|
|
533
|
+
const K = F.querySelector("input");
|
|
534
|
+
K && K.click();
|
|
535
535
|
},
|
|
536
|
-
onFetchNextPage:
|
|
536
|
+
onFetchNextPage: ce,
|
|
537
537
|
onOpen: P,
|
|
538
|
-
sortByChange:
|
|
539
|
-
getList:
|
|
540
|
-
resetFilter: () =>
|
|
541
|
-
submitFilter: () =>
|
|
538
|
+
sortByChange: Y,
|
|
539
|
+
getList: ie,
|
|
540
|
+
resetFilter: () => B(g, ie),
|
|
541
|
+
submitFilter: () => X(g, ie)
|
|
542
542
|
};
|
|
543
543
|
}
|
|
544
544
|
const Uo = { class: "d-flex flex-column w-100 px-1 align-center" }, jo = { class: "d-flex justify-space-between w-100 align-center" }, qo = { class: "d-flex align-center" }, Ho = { class: "d-flex align-center" }, Go = { class: "subject-select__sidebar system-border-r" }, Jo = { class: "subject-select-filter" }, Wo = { class: "subject-select__content" }, Xo = {
|
|
545
545
|
key: 0,
|
|
546
546
|
class: "d-flex w-100 align-center justify-center pa-4"
|
|
547
|
-
}, Yo = { class: "subject-select__actions system-border-t" }, Qo = { key: 0 }, Zo = { key: 1 }, Li = /* @__PURE__ */
|
|
547
|
+
}, Yo = { class: "subject-select__actions system-border-t" }, Qo = { key: 0 }, Zo = { key: 1 }, Li = /* @__PURE__ */ _e({
|
|
548
548
|
__name: "ASubjectSelect",
|
|
549
549
|
props: {
|
|
550
550
|
selectedItems: {},
|
|
@@ -559,75 +559,75 @@ const Uo = { class: "d-flex flex-column w-100 px-1 align-center" }, jo = { class
|
|
|
559
559
|
},
|
|
560
560
|
emits: ["update:modelValue", "update:pagination", "onOpen", "onPageChange", "onConfirm", "onFetchNextPage"],
|
|
561
561
|
setup(e, { expose: k, emit: l }) {
|
|
562
|
-
const n = e, i = l,
|
|
562
|
+
const n = e, i = l, m = de(!1), w = S({
|
|
563
563
|
get() {
|
|
564
|
-
return
|
|
564
|
+
return Ie(n.modelValue) ? m.value : n.modelValue;
|
|
565
565
|
},
|
|
566
566
|
set(P) {
|
|
567
|
-
|
|
567
|
+
m.value = P, i("update:modelValue", P);
|
|
568
568
|
}
|
|
569
|
-
}),
|
|
569
|
+
}), E = S({
|
|
570
570
|
get: () => n.pagination,
|
|
571
571
|
set: (P) => {
|
|
572
572
|
i("update:pagination", { ...pn(P) });
|
|
573
573
|
}
|
|
574
|
-
}), { mdAndDown:
|
|
575
|
-
|
|
574
|
+
}), { mdAndDown: b } = oa(), c = de(!b.value), h = () => {
|
|
575
|
+
b.value && (c.value = !1);
|
|
576
576
|
};
|
|
577
577
|
_t(eo, h);
|
|
578
|
-
const { t:
|
|
579
|
-
i("onOpen"), c.value = !
|
|
578
|
+
const { t: I } = lt(), j = S(() => n.selectedItems.length), M = S(() => j.value < n.minCount || j.value > n.maxCount), g = () => {
|
|
579
|
+
i("onOpen"), c.value = !b.value, w.value = !0;
|
|
580
580
|
}, z = () => {
|
|
581
581
|
c.value = !c.value;
|
|
582
582
|
}, q = () => {
|
|
583
583
|
w.value = !1;
|
|
584
|
-
},
|
|
584
|
+
}, B = () => {
|
|
585
585
|
i(
|
|
586
586
|
"onConfirm",
|
|
587
587
|
n.selectedItems.map((P) => pn(P))
|
|
588
588
|
), q();
|
|
589
|
-
},
|
|
589
|
+
}, X = () => {
|
|
590
590
|
i("onFetchNextPage");
|
|
591
|
-
},
|
|
591
|
+
}, D = () => {
|
|
592
592
|
i("onPageChange");
|
|
593
|
-
},
|
|
594
|
-
P && f.value && !n.loading &&
|
|
593
|
+
}, s = S(() => Math.ceil(E.value.totalCount / E.value.rowsPerPage)), f = S(() => !(kt(E.value.hasNextPage) && E.value.page === s.value || E.value.hasNextPage === !1)), T = (P) => {
|
|
594
|
+
P && f.value && !n.loading && X();
|
|
595
595
|
};
|
|
596
596
|
return en(() => {
|
|
597
|
-
n.autoOpen &&
|
|
597
|
+
n.autoOpen && g();
|
|
598
598
|
}), k({
|
|
599
|
-
open:
|
|
599
|
+
open: g,
|
|
600
600
|
closeSidebarOnMobile: h
|
|
601
|
-
}), (P,
|
|
602
|
-
const
|
|
603
|
-
return x(), N(
|
|
601
|
+
}), (P, Y) => {
|
|
602
|
+
const ce = bn("ABtnSecondary"), ne = bn("ABtnPrimary");
|
|
603
|
+
return x(), N(xe, null, [
|
|
604
604
|
O(P.$slots, "activator", {
|
|
605
|
-
props: { onClick:
|
|
605
|
+
props: { onClick: fe(() => g(), ["stop"]) }
|
|
606
606
|
}),
|
|
607
|
-
|
|
607
|
+
r(an, ve(P.$attrs, {
|
|
608
608
|
"model-value": w.value,
|
|
609
609
|
fullscreen: "",
|
|
610
610
|
class: "subject-select",
|
|
611
|
-
"onUpdate:modelValue":
|
|
611
|
+
"onUpdate:modelValue": Y[1] || (Y[1] = (le) => i("update:modelValue", le))
|
|
612
612
|
}), {
|
|
613
613
|
default: u(() => [
|
|
614
|
-
w.value ? (x(),
|
|
614
|
+
w.value ? (x(), te(nn, {
|
|
615
615
|
key: 0,
|
|
616
616
|
class: "subject-select__card"
|
|
617
617
|
}, {
|
|
618
618
|
default: u(() => [
|
|
619
|
-
|
|
619
|
+
r(to, {
|
|
620
620
|
class: "subject-select__toolbar system-border-b",
|
|
621
621
|
onOnCancel: q
|
|
622
622
|
}, {
|
|
623
623
|
default: u(() => [
|
|
624
624
|
O(P.$slots, "title", {}, () => [
|
|
625
|
-
|
|
625
|
+
Q(V(y(I)(e.dialogTitleT)), 1)
|
|
626
626
|
])
|
|
627
627
|
]),
|
|
628
628
|
_: 3
|
|
629
629
|
}),
|
|
630
|
-
|
|
630
|
+
r(Ao, {
|
|
631
631
|
density: "compact",
|
|
632
632
|
color: "transparent",
|
|
633
633
|
height: 46,
|
|
@@ -639,23 +639,23 @@ const Uo = { class: "d-flex flex-column w-100 px-1 align-center" }, jo = { class
|
|
|
639
639
|
U("div", Uo, [
|
|
640
640
|
U("div", jo, [
|
|
641
641
|
U("div", qo, [
|
|
642
|
-
|
|
642
|
+
r(se, {
|
|
643
643
|
icon: "",
|
|
644
644
|
width: 30,
|
|
645
645
|
height: 30,
|
|
646
646
|
onClick: z
|
|
647
647
|
}, {
|
|
648
648
|
default: u(() => [
|
|
649
|
-
|
|
649
|
+
r(re, {
|
|
650
650
|
icon: "mdi-tune",
|
|
651
651
|
size: 16
|
|
652
652
|
}),
|
|
653
|
-
|
|
653
|
+
r(qe, {
|
|
654
654
|
activator: "parent",
|
|
655
655
|
location: "bottom"
|
|
656
656
|
}, {
|
|
657
657
|
default: u(() => [
|
|
658
|
-
|
|
658
|
+
Q(V(y(I)("common.subjectSelect.filter.toggle")), 1)
|
|
659
659
|
]),
|
|
660
660
|
_: 1
|
|
661
661
|
})
|
|
@@ -674,7 +674,7 @@ const Uo = { class: "d-flex flex-column w-100 px-1 align-center" }, jo = { class
|
|
|
674
674
|
_: 3
|
|
675
675
|
}),
|
|
676
676
|
U("div", {
|
|
677
|
-
class:
|
|
677
|
+
class: Ue(["subject-select__main", { "subject-select__main--sidebar-active": c.value }])
|
|
678
678
|
}, [
|
|
679
679
|
U("div", Go, [
|
|
680
680
|
U("div", Jo, [
|
|
@@ -684,14 +684,14 @@ const Uo = { class: "d-flex flex-column w-100 px-1 align-center" }, jo = { class
|
|
|
684
684
|
U("div", Wo, [
|
|
685
685
|
O(P.$slots, "content"),
|
|
686
686
|
e.paginationMode === "more" ? (x(), N("div", Xo, [
|
|
687
|
-
po((x(),
|
|
687
|
+
po((x(), te(ce, {
|
|
688
688
|
loading: e.loading,
|
|
689
689
|
size: "small",
|
|
690
|
-
onClick:
|
|
690
|
+
onClick: X
|
|
691
691
|
}, {
|
|
692
692
|
default: u(() => [
|
|
693
693
|
O(P.$slots, "button-confirm-title", {}, () => [
|
|
694
|
-
|
|
694
|
+
Q(V(y(I)("common.button.loadMore")), 1)
|
|
695
695
|
])
|
|
696
696
|
]),
|
|
697
697
|
_: 3
|
|
@@ -704,31 +704,31 @@ const Uo = { class: "d-flex flex-column w-100 px-1 align-center" }, jo = { class
|
|
|
704
704
|
{ quiet: !0 }
|
|
705
705
|
]
|
|
706
706
|
])
|
|
707
|
-
])) : (x(),
|
|
707
|
+
])) : (x(), te(Vo, {
|
|
708
708
|
key: 1,
|
|
709
|
-
modelValue:
|
|
710
|
-
"onUpdate:modelValue":
|
|
711
|
-
onChange:
|
|
709
|
+
modelValue: E.value,
|
|
710
|
+
"onUpdate:modelValue": Y[0] || (Y[0] = (le) => E.value = le),
|
|
711
|
+
onChange: D
|
|
712
712
|
}, null, 8, ["modelValue"]))
|
|
713
713
|
])
|
|
714
714
|
], 2),
|
|
715
715
|
U("div", Yo, [
|
|
716
|
-
e.minCount === e.maxCount ? (x(), N("div", Qo,
|
|
716
|
+
e.minCount === e.maxCount ? (x(), N("div", Qo, V(y(I)("common.subjectSelect.texts.pickExactCount", {
|
|
717
717
|
count: e.minCount,
|
|
718
718
|
selected: j.value
|
|
719
|
-
})), 1)) : (x(), N("div", Zo,
|
|
719
|
+
})), 1)) : (x(), N("div", Zo, V(y(I)("common.subjectSelect.texts.pickRangeCount", {
|
|
720
720
|
minCount: e.minCount,
|
|
721
721
|
maxCount: e.maxCount,
|
|
722
722
|
selected: j.value
|
|
723
723
|
})), 1)),
|
|
724
|
-
|
|
725
|
-
|
|
724
|
+
r(on),
|
|
725
|
+
r(ne, {
|
|
726
726
|
disabled: M.value,
|
|
727
|
-
onClick:
|
|
727
|
+
onClick: fe(B, ["stop"])
|
|
728
728
|
}, {
|
|
729
729
|
default: u(() => [
|
|
730
730
|
O(P.$slots, "button-confirm-title", {}, () => [
|
|
731
|
-
|
|
731
|
+
Q(V(y(I)("common.button.confirm")), 1)
|
|
732
732
|
])
|
|
733
733
|
]),
|
|
734
734
|
_: 3
|
|
@@ -736,7 +736,7 @@ const Uo = { class: "d-flex flex-column w-100 px-1 align-center" }, jo = { class
|
|
|
736
736
|
])
|
|
737
737
|
]),
|
|
738
738
|
_: 3
|
|
739
|
-
})) :
|
|
739
|
+
})) : _("", !0)
|
|
740
740
|
]),
|
|
741
741
|
_: 3
|
|
742
742
|
}, 16, ["model-value"])
|
|
@@ -758,7 +758,7 @@ const Uo = { class: "d-flex flex-column w-100 px-1 align-center" }, jo = { class
|
|
|
758
758
|
}, al = {
|
|
759
759
|
key: 3,
|
|
760
760
|
class: "a-le-state a-le-state--empty"
|
|
761
|
-
}, ol = ["data-id", "tabindex", "onKeydown"], ll = ["onClick"], il = { class: "a-le-row-main" },
|
|
761
|
+
}, ol = ["data-id", "tabindex", "onKeydown"], ll = ["onClick"], il = { class: "a-le-row-main" }, sl = { class: "a-le-title" }, rl = {
|
|
762
762
|
key: 0,
|
|
763
763
|
class: "a-le-status"
|
|
764
764
|
}, dl = {
|
|
@@ -774,9 +774,9 @@ const Uo = { class: "d-flex flex-column w-100 px-1 align-center" }, jo = { class
|
|
|
774
774
|
class: "a-le-sr-only",
|
|
775
775
|
"aria-live": "polite",
|
|
776
776
|
role: "status"
|
|
777
|
-
}, Vi = /* @__PURE__ */
|
|
777
|
+
}, Vi = /* @__PURE__ */ _e({
|
|
778
778
|
__name: "AListEditor",
|
|
779
|
-
props: /* @__PURE__ */
|
|
779
|
+
props: /* @__PURE__ */ We({
|
|
780
780
|
factory: { type: Function, default: void 0 },
|
|
781
781
|
getKey: { type: [String, Function], default: void 0 },
|
|
782
782
|
position: { type: [String, Boolean, Object], default: void 0 },
|
|
@@ -814,207 +814,207 @@ const Uo = { class: "d-flex flex-column w-100 px-1 align-center" }, jo = { class
|
|
|
814
814
|
modelValue: { required: !0 },
|
|
815
815
|
modelModifiers: {}
|
|
816
816
|
}),
|
|
817
|
-
emits: /* @__PURE__ */
|
|
817
|
+
emits: /* @__PURE__ */ We(["edit", "deleted", "close", "item-saved", "item-expand"], ["update:modelValue"]),
|
|
818
818
|
setup(e, { expose: k, emit: l }) {
|
|
819
|
-
const n = e, i = l,
|
|
820
|
-
get: () =>
|
|
821
|
-
set: (a) =>
|
|
819
|
+
const n = e, i = l, m = yt(e, "modelValue"), { t: w } = lt(), E = ea(), b = oa(), c = Lt("rootEl"), h = S(() => b.platform.value.touch), I = n.editor ?? no({
|
|
820
|
+
get: () => m.value,
|
|
821
|
+
set: (a) => m.value = a,
|
|
822
822
|
factory: n.factory,
|
|
823
823
|
getKey: n.getKey,
|
|
824
824
|
position: n.position,
|
|
825
825
|
dirtyExclude: () => n.dirtyExclude ?? [],
|
|
826
826
|
validate: n.validate
|
|
827
|
-
}), j = n.getKey ?? "id", M = (a) => typeof j == "function" ? j(a) : a[j],
|
|
827
|
+
}), j = n.getKey ?? "id", M = (a) => typeof j == "function" ? j(a) : a[j], g = S(
|
|
828
828
|
() => typeof j == "function" ? "(fn)" : j
|
|
829
|
-
), z =
|
|
829
|
+
), z = S(() => {
|
|
830
830
|
const a = n.position;
|
|
831
831
|
return a === void 0 || a === !1 ? "position" : typeof a == "object" ? a.field : a;
|
|
832
|
-
}), q =
|
|
833
|
-
() =>
|
|
832
|
+
}), q = S(
|
|
833
|
+
() => m.value.map((a, H) => ({
|
|
834
834
|
key: M(a),
|
|
835
|
-
index:
|
|
835
|
+
index: H,
|
|
836
836
|
raw: a,
|
|
837
837
|
position: a[z.value]
|
|
838
838
|
}))
|
|
839
|
-
),
|
|
840
|
-
const
|
|
841
|
-
let
|
|
842
|
-
for (const
|
|
843
|
-
if (
|
|
844
|
-
|
|
839
|
+
), B = /* @__PURE__ */ new Set(), X = (a) => {
|
|
840
|
+
const H = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set();
|
|
841
|
+
let he = 0;
|
|
842
|
+
for (const ze of a) {
|
|
843
|
+
if (ze.key === void 0 || ze.key === null) {
|
|
844
|
+
he++;
|
|
845
845
|
continue;
|
|
846
846
|
}
|
|
847
|
-
|
|
847
|
+
H.has(ze.key) && p.add(String(ze.key)), H.add(ze.key);
|
|
848
848
|
}
|
|
849
|
-
if (
|
|
850
|
-
const
|
|
851
|
-
|
|
852
|
-
`[list-editor] ${
|
|
853
|
-
),
|
|
854
|
-
`[list-editor] duplicate row keys (key-field "${
|
|
849
|
+
if (he === 0 && p.size === 0) return;
|
|
850
|
+
const Ye = `${he}|${[...p].sort().join(",")}`;
|
|
851
|
+
B.has(Ye) || (B.add(Ye), he > 0 && console.warn(
|
|
852
|
+
`[list-editor] ${he} 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).`
|
|
853
|
+
), p.size > 0 && console.warn(
|
|
854
|
+
`[list-editor] duplicate row keys (key-field "${g.value}"): ${[...p].join(", ")}. Row keys must be unique — dirty tracking and validation rails target rows by key.`
|
|
855
855
|
));
|
|
856
856
|
};
|
|
857
|
-
|
|
858
|
-
const
|
|
857
|
+
$e(q, (a) => X(a), { immediate: !0 });
|
|
858
|
+
const D = de(/* @__PURE__ */ new Set()), s = Lt("rowsContainer"), f = S(() => !n.chips && !!E.item), T = S(() => !n.chips && !!E["item-readonly"]), {
|
|
859
859
|
editingKeys: P,
|
|
860
|
-
editingSnapshots:
|
|
861
|
-
beginEdit:
|
|
862
|
-
cancelEdit:
|
|
860
|
+
editingSnapshots: Y,
|
|
861
|
+
beginEdit: ce,
|
|
862
|
+
cancelEdit: ne,
|
|
863
863
|
commitEdit: le,
|
|
864
|
-
closeEdit:
|
|
865
|
-
requestAutoOpen:
|
|
864
|
+
closeEdit: ie,
|
|
865
|
+
requestAutoOpen: Re
|
|
866
866
|
} = qn({
|
|
867
|
-
rowsContainer:
|
|
867
|
+
rowsContainer: s,
|
|
868
868
|
rowSelector: ".a-le-row",
|
|
869
869
|
isInlineEdit: f,
|
|
870
|
-
restoreSnapshot: (a,
|
|
871
|
-
watchKeys: () =>
|
|
870
|
+
restoreSnapshot: (a, H) => I.updateItem(a, H),
|
|
871
|
+
watchKeys: () => m.value.map((a) => M(a)),
|
|
872
872
|
findEntry: (a) => {
|
|
873
|
-
const
|
|
874
|
-
return
|
|
873
|
+
const H = m.value.find((p) => M(p) === a);
|
|
874
|
+
return H ? { data: H } : null;
|
|
875
875
|
},
|
|
876
876
|
afterAutoOpen: (a) => {
|
|
877
|
-
|
|
877
|
+
D.value.delete(a);
|
|
878
878
|
}
|
|
879
|
-
}), $ =
|
|
879
|
+
}), $ = S(
|
|
880
880
|
() => n.addLabel ? w(n.addLabel) : w("common.sortable.add")
|
|
881
|
-
),
|
|
881
|
+
), v = S(() => n.emptyTitle ?? w("common.sortable.emptyTitle")), C = S(
|
|
882
882
|
() => n.deleteConfirmTitle ?? w("common.sortable.deleteConfirmTitle")
|
|
883
|
-
), F =
|
|
883
|
+
), F = S(
|
|
884
884
|
() => n.deleteConfirmText ?? w("common.sortable.deleteConfirmText")
|
|
885
|
-
),
|
|
886
|
-
const a = [],
|
|
887
|
-
for (const
|
|
888
|
-
|
|
889
|
-
const
|
|
890
|
-
if (Fe && Fe.raw ===
|
|
885
|
+
), K = S(() => !n.readonly && !n.disabled && !n.loading), J = S(() => K.value && n.showAddButton), ee = S(() => !!(n.title || E.header)), ue = S(() => !!n.onItemSave), ae = /* @__PURE__ */ new Map(), me = S(() => {
|
|
886
|
+
const a = [], H = /* @__PURE__ */ new Set();
|
|
887
|
+
for (const p of q.value) {
|
|
888
|
+
H.add(p.key);
|
|
889
|
+
const he = P.value.has(p.key), Ye = D.value.has(p.key), ze = n.loadingKeys?.has(p.key) ?? !1, Te = n.disableUnsaved || n.readonly ? !1 : I.isUnsaved(p.key), xt = Te, ct = I.rowState(p.raw, p.key), Fe = ae.get(p.key);
|
|
890
|
+
if (Fe && Fe.raw === p.raw && Fe.index === p.index && Fe.position === p.position && Fe.editing === he && Fe.expanded === Ye && Fe.loading === ze && Fe.dirty === xt && Fe.unsaved === Te && Fe.validationState === ct) {
|
|
891
891
|
a.push(Fe);
|
|
892
892
|
continue;
|
|
893
893
|
}
|
|
894
|
-
const
|
|
895
|
-
...
|
|
896
|
-
editing:
|
|
897
|
-
expanded:
|
|
898
|
-
loading:
|
|
894
|
+
const St = {
|
|
895
|
+
...p,
|
|
896
|
+
editing: he,
|
|
897
|
+
expanded: Ye,
|
|
898
|
+
loading: ze,
|
|
899
899
|
dirty: xt,
|
|
900
900
|
unsaved: Te,
|
|
901
901
|
validationState: ct
|
|
902
902
|
};
|
|
903
|
-
|
|
903
|
+
ae.set(p.key, St), a.push(St);
|
|
904
904
|
}
|
|
905
|
-
for (const
|
|
906
|
-
|
|
905
|
+
for (const p of ae.keys())
|
|
906
|
+
H.has(p) || ae.delete(p);
|
|
907
907
|
return a;
|
|
908
|
-
}),
|
|
909
|
-
viewItems:
|
|
908
|
+
}), Se = S(() => me.value.length === 0), we = (a) => me.value.find((H) => H.key === a), Le = Hn({
|
|
909
|
+
viewItems: S(() => me.value.map((a) => ({ key: a.key }))),
|
|
910
910
|
variant: "flat",
|
|
911
|
-
isReorderMode:
|
|
912
|
-
disabled:
|
|
911
|
+
isReorderMode: de(!1),
|
|
912
|
+
disabled: S(() => !K.value),
|
|
913
913
|
isEditing: (a) => P.value.has(a),
|
|
914
914
|
onToggleEdit: (a) => {
|
|
915
|
-
const
|
|
916
|
-
|
|
915
|
+
const H = we(a);
|
|
916
|
+
H && Oe(H);
|
|
917
917
|
},
|
|
918
918
|
onCancelEdit: (a) => {
|
|
919
|
-
const
|
|
920
|
-
|
|
919
|
+
const H = we(a);
|
|
920
|
+
H && pe(H);
|
|
921
921
|
}
|
|
922
|
-
}),
|
|
923
|
-
|
|
924
|
-
},
|
|
925
|
-
|
|
926
|
-
},
|
|
927
|
-
if (
|
|
922
|
+
}), Ge = (a) => Zn(a, { compactField: n.compactField }), Pe = () => {
|
|
923
|
+
J.value && (Re(), I.addItem(void 0, void 0));
|
|
924
|
+
}, Ae = (a) => {
|
|
925
|
+
K.value && (Re(), I.addItem(void 0, { afterId: a.key }));
|
|
926
|
+
}, Oe = (a) => {
|
|
927
|
+
if (K.value) {
|
|
928
928
|
if (P.value.has(a.key)) {
|
|
929
|
-
|
|
929
|
+
pe(a);
|
|
930
930
|
return;
|
|
931
931
|
}
|
|
932
|
-
f.value && (
|
|
932
|
+
f.value && (ce(a), D.value.delete(a.key)), i("edit", a);
|
|
933
933
|
}
|
|
934
|
-
},
|
|
934
|
+
}, Ve = (a) => {
|
|
935
935
|
if (n.disabled || n.loading) return;
|
|
936
|
-
const
|
|
937
|
-
if (
|
|
938
|
-
|
|
936
|
+
const H = a.key, p = D.value.has(H);
|
|
937
|
+
if (p)
|
|
938
|
+
D.value.delete(H);
|
|
939
939
|
else {
|
|
940
|
-
for (const
|
|
941
|
-
|
|
940
|
+
for (const he of D.value) D.value.delete(he);
|
|
941
|
+
D.value.add(H);
|
|
942
942
|
}
|
|
943
|
-
i("item-expand", a, !
|
|
944
|
-
},
|
|
945
|
-
if (
|
|
943
|
+
i("item-expand", a, !p);
|
|
944
|
+
}, et = (a) => n.chips || n.disableRowClick || n.defaultExpanded || n.disabled || n.loading ? !1 : !!(a.editing || a.expanded || !n.readonly && n.showEditButton), Me = (a) => {
|
|
945
|
+
if (et(a)) {
|
|
946
946
|
if (a.editing || a.expanded) {
|
|
947
|
-
|
|
947
|
+
pe(a);
|
|
948
948
|
return;
|
|
949
949
|
}
|
|
950
|
-
n.readonly && T.value ?
|
|
950
|
+
n.readonly && T.value ? Ve(a) : Oe(a);
|
|
951
951
|
}
|
|
952
952
|
}, {
|
|
953
|
-
deleteDialog:
|
|
954
|
-
deleteInFlight:
|
|
955
|
-
deleteError:
|
|
956
|
-
onDeleteClick:
|
|
957
|
-
onDeleteDialogConfirm:
|
|
958
|
-
onDeleteDialogCancel:
|
|
953
|
+
deleteDialog: Xe,
|
|
954
|
+
deleteInFlight: tt,
|
|
955
|
+
deleteError: rt,
|
|
956
|
+
onDeleteClick: dt,
|
|
957
|
+
onDeleteDialogConfirm: A,
|
|
958
|
+
onDeleteDialogCancel: L
|
|
959
959
|
} = Gn({
|
|
960
960
|
onDeleteConfirm: (a) => n.onDeleteConfirm ? n.onDeleteConfirm(a) : !0,
|
|
961
961
|
onDelete: (a) => n.onDelete?.(a),
|
|
962
962
|
onDeleted: (a) => {
|
|
963
|
-
P.value.delete(a.key),
|
|
963
|
+
P.value.delete(a.key), Y.value.delete(a.key), D.value.delete(a.key), I.deleteItem(a.key), i("deleted", a);
|
|
964
964
|
},
|
|
965
965
|
disableDeleteConfirm: () => n.disableDeleteConfirm || n.chips
|
|
966
|
-
}),
|
|
967
|
-
|
|
968
|
-
},
|
|
966
|
+
}), G = async (a) => {
|
|
967
|
+
K.value && await dt(a);
|
|
968
|
+
}, W = async (a) => {
|
|
969
969
|
n.onItemSave && await n.onItemSave(a.raw), le(a), i("item-saved", a);
|
|
970
|
-
},
|
|
971
|
-
|
|
972
|
-
},
|
|
973
|
-
|
|
974
|
-
},
|
|
975
|
-
let
|
|
976
|
-
return
|
|
970
|
+
}, Z = (a) => {
|
|
971
|
+
ne(a);
|
|
972
|
+
}, pe = (a) => {
|
|
973
|
+
ie(a), D.value.delete(a.key), i("close", a);
|
|
974
|
+
}, Ce = /* @__PURE__ */ new Map(), ye = (a) => {
|
|
975
|
+
let H = Ce.get(a);
|
|
976
|
+
return H || (H = {
|
|
977
977
|
edit: () => {
|
|
978
|
-
const
|
|
979
|
-
|
|
978
|
+
const p = we(a);
|
|
979
|
+
p && Oe(p);
|
|
980
980
|
},
|
|
981
981
|
save: () => {
|
|
982
|
-
const
|
|
983
|
-
if (
|
|
982
|
+
const p = we(a);
|
|
983
|
+
if (p) return W(p);
|
|
984
984
|
},
|
|
985
985
|
cancel: () => {
|
|
986
|
-
const
|
|
987
|
-
|
|
986
|
+
const p = we(a);
|
|
987
|
+
p && Z(p);
|
|
988
988
|
},
|
|
989
989
|
close: () => {
|
|
990
|
-
const
|
|
991
|
-
|
|
990
|
+
const p = we(a);
|
|
991
|
+
p && pe(p);
|
|
992
992
|
},
|
|
993
993
|
delete: async () => {
|
|
994
|
-
const
|
|
995
|
-
|
|
994
|
+
const p = we(a);
|
|
995
|
+
p && await G(p);
|
|
996
996
|
},
|
|
997
997
|
addAfter: () => {
|
|
998
|
-
const
|
|
999
|
-
|
|
998
|
+
const p = we(a);
|
|
999
|
+
p && Ae(p);
|
|
1000
1000
|
},
|
|
1001
1001
|
toggleExpand: () => {
|
|
1002
|
-
const
|
|
1003
|
-
|
|
1002
|
+
const p = we(a);
|
|
1003
|
+
p && Ve(p);
|
|
1004
1004
|
},
|
|
1005
|
-
update: (
|
|
1006
|
-
},
|
|
1005
|
+
update: (p) => I.updateItem(a, p)
|
|
1006
|
+
}, Ce.set(a, H)), H;
|
|
1007
1007
|
};
|
|
1008
|
-
|
|
1009
|
-
() =>
|
|
1008
|
+
$e(
|
|
1009
|
+
() => me.value,
|
|
1010
1010
|
(a) => {
|
|
1011
|
-
if (
|
|
1012
|
-
const
|
|
1013
|
-
for (const
|
|
1014
|
-
|
|
1011
|
+
if (Ce.size === 0) return;
|
|
1012
|
+
const H = new Set(a.map((p) => p.key));
|
|
1013
|
+
for (const p of Ce.keys())
|
|
1014
|
+
H.has(p) || Ce.delete(p);
|
|
1015
1015
|
}
|
|
1016
1016
|
);
|
|
1017
|
-
const
|
|
1017
|
+
const be = (a) => ({
|
|
1018
1018
|
item: a,
|
|
1019
1019
|
raw: a.raw,
|
|
1020
1020
|
index: a.index,
|
|
@@ -1026,23 +1026,23 @@ const Uo = { class: "d-flex flex-column w-100 px-1 align-center" }, jo = { class
|
|
|
1026
1026
|
dirty: a.dirty,
|
|
1027
1027
|
unsaved: a.unsaved,
|
|
1028
1028
|
touch: h.value,
|
|
1029
|
-
actions:
|
|
1029
|
+
actions: ye(a.key)
|
|
1030
1030
|
});
|
|
1031
1031
|
return Jn(
|
|
1032
|
-
() => n.unsavedSectionLabel && !n.disableUnsaved ? { label: n.unsavedSectionLabel, dirty:
|
|
1032
|
+
() => n.unsavedSectionLabel && !n.disableUnsaved ? { label: n.unsavedSectionLabel, dirty: I.hasUnsaved.value } : []
|
|
1033
1033
|
), k({
|
|
1034
|
-
...
|
|
1034
|
+
...I,
|
|
1035
1035
|
// Opens invalid rows so a blocked save surfaces WHICH rows are wrong instead of a
|
|
1036
1036
|
// collapsed red rail. The body is gated on `editing` not `expanded`, so drive
|
|
1037
1037
|
// `beginEdit` not `expandedKeys` (QA 85050 B4-17). Shared via the helper.
|
|
1038
|
-
validateAll: () => Wn(
|
|
1039
|
-
const
|
|
1040
|
-
|
|
1038
|
+
validateAll: () => Wn(I, (a) => {
|
|
1039
|
+
const H = q.value.find((p) => p.key === a);
|
|
1040
|
+
H && ce(H);
|
|
1041
1041
|
})
|
|
1042
|
-
}), (a,
|
|
1042
|
+
}), (a, H) => (x(), N("div", {
|
|
1043
1043
|
ref_key: "rootEl",
|
|
1044
1044
|
ref: c,
|
|
1045
|
-
class:
|
|
1045
|
+
class: Ue(["a-list-editor", [
|
|
1046
1046
|
`a-list-editor--two-rows-${e.twoRows}`,
|
|
1047
1047
|
{
|
|
1048
1048
|
"a-list-editor--readonly": e.readonly,
|
|
@@ -1054,82 +1054,82 @@ const Uo = { class: "d-flex flex-column w-100 px-1 align-center" }, jo = { class
|
|
|
1054
1054
|
}, [
|
|
1055
1055
|
U("div", {
|
|
1056
1056
|
ref_key: "rowsContainer",
|
|
1057
|
-
ref:
|
|
1057
|
+
ref: s,
|
|
1058
1058
|
class: "a-le-card"
|
|
1059
1059
|
}, [
|
|
1060
|
-
|
|
1060
|
+
ee.value ? (x(), N("div", _o, [
|
|
1061
1061
|
O(a.$slots, "header", { title: e.title }, () => [
|
|
1062
|
-
e.title ? (x(), N("h3", el,
|
|
1062
|
+
e.title ? (x(), N("h3", el, V(e.title), 1)) : _("", !0)
|
|
1063
1063
|
])
|
|
1064
|
-
])) :
|
|
1064
|
+
])) : _("", !0),
|
|
1065
1065
|
e.loading ? (x(), N("div", tl, [
|
|
1066
|
-
|
|
1066
|
+
r(sa, {
|
|
1067
1067
|
indeterminate: "",
|
|
1068
1068
|
color: "primary",
|
|
1069
1069
|
size: "32"
|
|
1070
1070
|
})
|
|
1071
1071
|
])) : e.error ? (x(), N("div", nl, [
|
|
1072
|
-
|
|
1072
|
+
r(ln, {
|
|
1073
1073
|
type: "error",
|
|
1074
1074
|
variant: "tonal",
|
|
1075
1075
|
density: "compact",
|
|
1076
1076
|
border: "start"
|
|
1077
1077
|
}, {
|
|
1078
1078
|
default: u(() => [
|
|
1079
|
-
|
|
1079
|
+
Q(V(e.error), 1)
|
|
1080
1080
|
]),
|
|
1081
1081
|
_: 1
|
|
1082
1082
|
})
|
|
1083
|
-
])) :
|
|
1083
|
+
])) : Se.value ? (x(), N("div", al, [
|
|
1084
1084
|
O(a.$slots, "empty", {
|
|
1085
1085
|
readonly: e.readonly,
|
|
1086
1086
|
disabled: e.disabled,
|
|
1087
|
-
actions: { add:
|
|
1087
|
+
actions: { add: Pe }
|
|
1088
1088
|
}, () => [
|
|
1089
|
-
|
|
1090
|
-
title:
|
|
1089
|
+
r(Xn, {
|
|
1090
|
+
title: v.value,
|
|
1091
1091
|
"add-label": $.value,
|
|
1092
|
-
"can-add":
|
|
1093
|
-
onAdd:
|
|
1092
|
+
"can-add": J.value,
|
|
1093
|
+
onAdd: Pe
|
|
1094
1094
|
}, null, 8, ["title", "add-label", "can-add"])
|
|
1095
1095
|
])
|
|
1096
|
-
])) : (x(!0), N(
|
|
1097
|
-
key: String(
|
|
1098
|
-
"data-id": String(
|
|
1096
|
+
])) : (x(!0), N(xe, { key: 4 }, st(me.value, (p) => (x(), N("div", {
|
|
1097
|
+
key: String(p.key),
|
|
1098
|
+
"data-id": String(p.key),
|
|
1099
1099
|
role: "listitem",
|
|
1100
|
-
tabindex: y(
|
|
1101
|
-
class:
|
|
1100
|
+
tabindex: y(Le).rowTabindex(p.key),
|
|
1101
|
+
class: Ue(["a-le-row", {
|
|
1102
1102
|
"a-le-row--two-rows": e.twoRows === "always",
|
|
1103
|
-
"a-le-row--editing":
|
|
1104
|
-
"a-le-row--expanded":
|
|
1105
|
-
"a-le-row--unsaved":
|
|
1106
|
-
"a-le-row--clickable":
|
|
1107
|
-
[`a-le-row--validation-${
|
|
1103
|
+
"a-le-row--editing": p.editing,
|
|
1104
|
+
"a-le-row--expanded": p.expanded,
|
|
1105
|
+
"a-le-row--unsaved": p.unsaved,
|
|
1106
|
+
"a-le-row--clickable": et(p),
|
|
1107
|
+
[`a-le-row--validation-${p.validationState}`]: p.validationState !== null
|
|
1108
1108
|
}]),
|
|
1109
|
-
onKeydown: (
|
|
1109
|
+
onKeydown: (he) => y(Le).handleKeydown(p.key, he)
|
|
1110
1110
|
}, [
|
|
1111
|
-
O(a.$slots, "before-item",
|
|
1111
|
+
O(a.$slots, "before-item", ve({ ref_for: !0 }, be(p))),
|
|
1112
1112
|
U("div", {
|
|
1113
1113
|
class: "a-le-row-header",
|
|
1114
|
-
onClick: (
|
|
1114
|
+
onClick: (he) => Me(p)
|
|
1115
1115
|
}, [
|
|
1116
1116
|
U("div", il, [
|
|
1117
|
-
O(a.$slots, "item-compact",
|
|
1118
|
-
U("span",
|
|
1117
|
+
O(a.$slots, "item-compact", ve({ ref_for: !0 }, be(p)), () => [
|
|
1118
|
+
U("span", sl, V(Ge(p.raw)), 1)
|
|
1119
1119
|
]),
|
|
1120
|
-
|
|
1120
|
+
p.unsaved ? (x(), te(Yn, {
|
|
1121
1121
|
key: 0,
|
|
1122
1122
|
"dot-only": e.chips
|
|
1123
|
-
}, null, 8, ["dot-only"])) :
|
|
1123
|
+
}, null, 8, ["dot-only"])) : _("", !0)
|
|
1124
1124
|
]),
|
|
1125
|
-
e.chips ?
|
|
1126
|
-
O(a.$slots, "item-status",
|
|
1127
|
-
e.statusField &&
|
|
1125
|
+
e.chips ? _("", !0) : (x(), N("div", rl, [
|
|
1126
|
+
O(a.$slots, "item-status", ve({ ref_for: !0 }, be(p)), () => [
|
|
1127
|
+
e.statusField && p.raw[e.statusField] != null && p.raw[e.statusField] !== "" ? (x(), N("span", dl, V(p.raw[e.statusField]), 1)) : _("", !0)
|
|
1128
1128
|
])
|
|
1129
1129
|
])),
|
|
1130
1130
|
U("div", cl, [
|
|
1131
|
-
O(a.$slots, "item-actions",
|
|
1132
|
-
e.chips && e.showDeleteButton &&
|
|
1131
|
+
O(a.$slots, "item-actions", ve({ ref_for: !0 }, be(p)), () => [
|
|
1132
|
+
e.chips && e.showDeleteButton && K.value ? (x(), te(se, {
|
|
1133
1133
|
key: 0,
|
|
1134
1134
|
icon: "",
|
|
1135
1135
|
size: "x-small",
|
|
@@ -1137,17 +1137,17 @@ const Uo = { class: "d-flex flex-column w-100 px-1 align-center" }, jo = { class
|
|
|
1137
1137
|
density: "compact",
|
|
1138
1138
|
active: !1,
|
|
1139
1139
|
class: "a-le-action a-le-action--chip-close",
|
|
1140
|
-
onClick:
|
|
1140
|
+
onClick: fe((he) => G(p), ["stop"])
|
|
1141
1141
|
}, {
|
|
1142
1142
|
default: u(() => [
|
|
1143
|
-
|
|
1143
|
+
r(re, {
|
|
1144
1144
|
icon: "mdi-close",
|
|
1145
1145
|
size: "14"
|
|
1146
1146
|
})
|
|
1147
1147
|
]),
|
|
1148
1148
|
_: 1
|
|
1149
|
-
}, 8, ["onClick"])) : (x(), N(
|
|
1150
|
-
e.showEditButton &&
|
|
1149
|
+
}, 8, ["onClick"])) : (x(), N(xe, { key: 1 }, [
|
|
1150
|
+
e.showEditButton && K.value && !e.defaultExpanded ? (x(), te(se, {
|
|
1151
1151
|
key: 0,
|
|
1152
1152
|
icon: "",
|
|
1153
1153
|
size: "small",
|
|
@@ -1155,44 +1155,44 @@ const Uo = { class: "d-flex flex-column w-100 px-1 align-center" }, jo = { class
|
|
|
1155
1155
|
color: "primary",
|
|
1156
1156
|
density: "comfortable",
|
|
1157
1157
|
class: "mx-1 a-le-action a-le-action--edit",
|
|
1158
|
-
onClick:
|
|
1158
|
+
onClick: fe((he) => Oe(p), ["stop"])
|
|
1159
1159
|
}, {
|
|
1160
1160
|
default: u(() => [
|
|
1161
|
-
|
|
1161
|
+
r(re, {
|
|
1162
1162
|
icon: "mdi-pencil-outline",
|
|
1163
1163
|
size: "18"
|
|
1164
1164
|
}),
|
|
1165
|
-
|
|
1165
|
+
r(qe, {
|
|
1166
1166
|
activator: "parent",
|
|
1167
1167
|
location: "bottom",
|
|
1168
1168
|
text: y(w)("common.sortable.edit")
|
|
1169
1169
|
}, null, 8, ["text"])
|
|
1170
1170
|
]),
|
|
1171
1171
|
_: 1
|
|
1172
|
-
}, 8, ["onClick"])) :
|
|
1173
|
-
e.showDeleteButton &&
|
|
1172
|
+
}, 8, ["onClick"])) : _("", !0),
|
|
1173
|
+
e.showDeleteButton && K.value ? (x(), te(se, {
|
|
1174
1174
|
key: 1,
|
|
1175
1175
|
icon: "",
|
|
1176
1176
|
size: "small",
|
|
1177
1177
|
variant: "text",
|
|
1178
1178
|
density: "comfortable",
|
|
1179
1179
|
class: "mx-1 a-le-action a-le-action--delete",
|
|
1180
|
-
onClick:
|
|
1180
|
+
onClick: fe((he) => G(p), ["stop"])
|
|
1181
1181
|
}, {
|
|
1182
1182
|
default: u(() => [
|
|
1183
|
-
|
|
1183
|
+
r(re, {
|
|
1184
1184
|
icon: "mdi-trash-can-outline",
|
|
1185
1185
|
size: "18"
|
|
1186
1186
|
}),
|
|
1187
|
-
|
|
1187
|
+
r(qe, {
|
|
1188
1188
|
activator: "parent",
|
|
1189
1189
|
location: "bottom",
|
|
1190
1190
|
text: y(w)("common.sortable.delete")
|
|
1191
1191
|
}, null, 8, ["text"])
|
|
1192
1192
|
]),
|
|
1193
1193
|
_: 1
|
|
1194
|
-
}, 8, ["onClick"])) :
|
|
1195
|
-
e.showAddAfterAction &&
|
|
1194
|
+
}, 8, ["onClick"])) : _("", !0),
|
|
1195
|
+
e.showAddAfterAction && K.value ? (x(), te(se, {
|
|
1196
1196
|
key: 2,
|
|
1197
1197
|
icon: "",
|
|
1198
1198
|
size: "small",
|
|
@@ -1202,29 +1202,29 @@ const Uo = { class: "d-flex flex-column w-100 px-1 align-center" }, jo = { class
|
|
|
1202
1202
|
class: "mx-1 a-le-action a-le-action--menu"
|
|
1203
1203
|
}, {
|
|
1204
1204
|
default: u(() => [
|
|
1205
|
-
|
|
1205
|
+
r(re, {
|
|
1206
1206
|
icon: "mdi-dots-vertical",
|
|
1207
1207
|
size: "18"
|
|
1208
1208
|
}),
|
|
1209
|
-
|
|
1209
|
+
r(qe, {
|
|
1210
1210
|
activator: "parent",
|
|
1211
1211
|
location: "bottom",
|
|
1212
1212
|
text: y(w)("common.sortable.more")
|
|
1213
1213
|
}, null, 8, ["text"]),
|
|
1214
|
-
|
|
1214
|
+
r(Vt, { activator: "parent" }, {
|
|
1215
1215
|
default: u(() => [
|
|
1216
|
-
|
|
1216
|
+
r(Ct, { density: "compact" }, {
|
|
1217
1217
|
default: u(() => [
|
|
1218
|
-
|
|
1219
|
-
onClick: (
|
|
1218
|
+
r(je, {
|
|
1219
|
+
onClick: (he) => Ae(p)
|
|
1220
1220
|
}, {
|
|
1221
1221
|
prepend: u(() => [
|
|
1222
|
-
|
|
1222
|
+
r(re, { icon: "mdi-plus" })
|
|
1223
1223
|
]),
|
|
1224
1224
|
default: u(() => [
|
|
1225
|
-
|
|
1225
|
+
r(He, null, {
|
|
1226
1226
|
default: u(() => [
|
|
1227
|
-
|
|
1227
|
+
Q(V(y(w)("common.sortable.addAfter")), 1)
|
|
1228
1228
|
]),
|
|
1229
1229
|
_: 1
|
|
1230
1230
|
})
|
|
@@ -1239,232 +1239,232 @@ const Uo = { class: "d-flex flex-column w-100 px-1 align-center" }, jo = { class
|
|
|
1239
1239
|
}, 1024)
|
|
1240
1240
|
]),
|
|
1241
1241
|
_: 2
|
|
1242
|
-
}, 1024)) :
|
|
1242
|
+
}, 1024)) : _("", !0)
|
|
1243
1243
|
], 64))
|
|
1244
1244
|
])
|
|
1245
1245
|
])
|
|
1246
1246
|
], 8, ll),
|
|
1247
|
-
(
|
|
1247
|
+
(p.editing || e.defaultExpanded) && a.$slots.item ? (x(), N(xe, { key: 0 }, [
|
|
1248
1248
|
U("div", ul, [
|
|
1249
1249
|
U("div", fl, [
|
|
1250
|
-
O(a.$slots, "item",
|
|
1250
|
+
O(a.$slots, "item", ve({ ref_for: !0 }, be(p)))
|
|
1251
1251
|
])
|
|
1252
1252
|
]),
|
|
1253
|
-
O(a.$slots, "item-footer",
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1253
|
+
O(a.$slots, "item-footer", ve({ ref_for: !0 }, be(p)), () => [
|
|
1254
|
+
ue.value && !e.defaultExpanded ? (x(), N("div", vl, [
|
|
1255
|
+
H[1] || (H[1] = U("div", { class: "a-le-row-footer-spacer" }, null, -1)),
|
|
1256
|
+
r(se, {
|
|
1257
1257
|
variant: "text",
|
|
1258
|
-
disabled:
|
|
1259
|
-
onClick:
|
|
1258
|
+
disabled: p.loading,
|
|
1259
|
+
onClick: fe((he) => Z(p), ["stop"])
|
|
1260
1260
|
}, {
|
|
1261
1261
|
default: u(() => [
|
|
1262
|
-
|
|
1262
|
+
Q(V(y(w)("common.button.cancel")), 1)
|
|
1263
1263
|
]),
|
|
1264
1264
|
_: 1
|
|
1265
1265
|
}, 8, ["disabled", "onClick"]),
|
|
1266
|
-
|
|
1266
|
+
r(se, {
|
|
1267
1267
|
color: "primary",
|
|
1268
1268
|
variant: "flat",
|
|
1269
1269
|
"prepend-icon": "mdi-check",
|
|
1270
|
-
disabled:
|
|
1271
|
-
onClick:
|
|
1270
|
+
disabled: p.loading,
|
|
1271
|
+
onClick: fe((he) => W(p), ["stop"])
|
|
1272
1272
|
}, {
|
|
1273
1273
|
default: u(() => [
|
|
1274
|
-
|
|
1274
|
+
Q(V(y(w)("common.button.save")), 1)
|
|
1275
1275
|
]),
|
|
1276
1276
|
_: 1
|
|
1277
1277
|
}, 8, ["disabled", "onClick"])
|
|
1278
|
-
])) :
|
|
1278
|
+
])) : _("", !0)
|
|
1279
1279
|
])
|
|
1280
|
-
], 64)) : a.$slots["item-readonly"] && (e.readonly ||
|
|
1280
|
+
], 64)) : a.$slots["item-readonly"] && (e.readonly || p.expanded) ? (x(), N("div", ml, [
|
|
1281
1281
|
U("div", yl, [
|
|
1282
|
-
O(a.$slots, "item-readonly",
|
|
1282
|
+
O(a.$slots, "item-readonly", ve({ ref_for: !0 }, be(p)))
|
|
1283
1283
|
])
|
|
1284
|
-
])) :
|
|
1285
|
-
O(a.$slots, "after-item",
|
|
1284
|
+
])) : _("", !0),
|
|
1285
|
+
O(a.$slots, "after-item", ve({ ref_for: !0 }, be(p)))
|
|
1286
1286
|
], 42, ol))), 128)),
|
|
1287
|
-
|
|
1287
|
+
J.value && !e.loading && !e.error && !Se.value ? O(a.$slots, "add-button", {
|
|
1288
1288
|
key: 5,
|
|
1289
1289
|
readonly: e.readonly,
|
|
1290
1290
|
disabled: e.disabled,
|
|
1291
|
-
props: { onClick:
|
|
1292
|
-
actions: { add:
|
|
1291
|
+
props: { onClick: Pe },
|
|
1292
|
+
actions: { add: Pe }
|
|
1293
1293
|
}, () => [
|
|
1294
1294
|
U("button", {
|
|
1295
1295
|
type: "button",
|
|
1296
1296
|
class: "a-le-row-add",
|
|
1297
|
-
onClick:
|
|
1297
|
+
onClick: Pe
|
|
1298
1298
|
}, [
|
|
1299
|
-
|
|
1299
|
+
r(re, {
|
|
1300
1300
|
icon: "mdi-plus",
|
|
1301
1301
|
size: "18"
|
|
1302
1302
|
}),
|
|
1303
|
-
U("span", null,
|
|
1303
|
+
U("span", null, V($.value), 1)
|
|
1304
1304
|
])
|
|
1305
|
-
]) :
|
|
1305
|
+
]) : _("", !0)
|
|
1306
1306
|
], 512),
|
|
1307
|
-
|
|
1308
|
-
modelValue: y(
|
|
1309
|
-
"onUpdate:modelValue":
|
|
1307
|
+
r(Qn, {
|
|
1308
|
+
modelValue: y(Xe),
|
|
1309
|
+
"onUpdate:modelValue": H[0] || (H[0] = (p) => ta(Xe) ? Xe.value = p : null),
|
|
1310
1310
|
title: C.value,
|
|
1311
1311
|
text: F.value,
|
|
1312
1312
|
"confirm-label": y(w)("common.sortable.delete"),
|
|
1313
1313
|
"cancel-label": y(w)("common.button.cancel"),
|
|
1314
|
-
error: y(
|
|
1315
|
-
"in-flight": y(
|
|
1316
|
-
onConfirm: y(
|
|
1317
|
-
onCancel: y(
|
|
1314
|
+
error: y(rt),
|
|
1315
|
+
"in-flight": y(tt),
|
|
1316
|
+
onConfirm: y(A),
|
|
1317
|
+
onCancel: y(L)
|
|
1318
1318
|
}, null, 8, ["modelValue", "title", "text", "confirm-label", "cancel-label", "error", "in-flight", "onConfirm", "onCancel"]),
|
|
1319
|
-
U("div", hl,
|
|
1320
|
-
n: y(
|
|
1321
|
-
total: y(
|
|
1319
|
+
U("div", hl, V(y(Le).grabbedKey.value !== null ? y(w)("common.sortable.keyboardGrab.status", {
|
|
1320
|
+
n: y(Le).grabbedIndex.value + 1,
|
|
1321
|
+
total: y(Le).totalCount.value
|
|
1322
1322
|
}) : ""), 1)
|
|
1323
1323
|
], 2));
|
|
1324
1324
|
}
|
|
1325
1325
|
}), gl = "id", pl = "position", bl = "parent";
|
|
1326
1326
|
function kl(e, k) {
|
|
1327
|
-
const l = k.keyField ?? gl, n = k.getKey, i = k.positionField ?? pl,
|
|
1327
|
+
const l = k.keyField ?? gl, n = k.getKey, i = k.positionField ?? pl, m = k.parentField ?? bl, w = k.positionMultiplier ?? 1, E = k.maxDepth, b = ($) => n ? n($) : $[l], c = ($) => {
|
|
1328
1328
|
if (!$.children || $.children.length === 0) return 1;
|
|
1329
|
-
let
|
|
1329
|
+
let v = 0;
|
|
1330
1330
|
for (const C of $.children) {
|
|
1331
1331
|
const F = c(C);
|
|
1332
|
-
F >
|
|
1332
|
+
F > v && (v = F);
|
|
1333
1333
|
}
|
|
1334
|
-
return
|
|
1335
|
-
}, h = ($,
|
|
1336
|
-
for (const F of
|
|
1337
|
-
if (
|
|
1334
|
+
return v + 1;
|
|
1335
|
+
}, h = ($, v = e.value.children, C = null) => {
|
|
1336
|
+
for (const F of v) {
|
|
1337
|
+
if (b(F.data) === $) return { node: F, parent: C };
|
|
1338
1338
|
if (F.children && F.children.length > 0) {
|
|
1339
|
-
const
|
|
1340
|
-
if (
|
|
1339
|
+
const K = h($, F.children, F);
|
|
1340
|
+
if (K.node) return K;
|
|
1341
1341
|
}
|
|
1342
1342
|
}
|
|
1343
1343
|
return { node: null, parent: null };
|
|
1344
|
-
},
|
|
1345
|
-
let
|
|
1344
|
+
}, I = ($) => {
|
|
1345
|
+
let v = 1 * w;
|
|
1346
1346
|
for (const C of $)
|
|
1347
|
-
C.data[i] !==
|
|
1347
|
+
C.data[i] !== v && (C.data[i] = v, C.meta.dirty = !0), v += w;
|
|
1348
1348
|
}, j = ($) => {
|
|
1349
|
-
const
|
|
1350
|
-
|
|
1351
|
-
for (const F of C) F.children && F.children.length &&
|
|
1349
|
+
const v = (C) => {
|
|
1350
|
+
I(C);
|
|
1351
|
+
for (const F of C) F.children && F.children.length && v(F.children);
|
|
1352
1352
|
};
|
|
1353
|
-
|
|
1353
|
+
v($.children);
|
|
1354
1354
|
}, M = ($) => {
|
|
1355
|
-
const
|
|
1356
|
-
return j(
|
|
1357
|
-
},
|
|
1358
|
-
const
|
|
1355
|
+
const v = Be($);
|
|
1356
|
+
return j(v), v;
|
|
1357
|
+
}, g = ($) => {
|
|
1358
|
+
const v = [], C = k.expandedKeys?.value;
|
|
1359
1359
|
let F = 0;
|
|
1360
|
-
const
|
|
1361
|
-
for (let
|
|
1362
|
-
const
|
|
1363
|
-
|
|
1364
|
-
key:
|
|
1360
|
+
const K = (J, ee, ue) => {
|
|
1361
|
+
for (let ae = 0; ae < J.length; ae++) {
|
|
1362
|
+
const me = J[ae], Se = b(me.data), we = !Ie(me.children), Le = we && (me.children?.length ?? 0) > 0, Ge = me.children?.length ?? 0, Pe = C ? C.has(Se) : !0, Ae = E - (ee + 1), Oe = we && Ae > 0, Ve = ee > 0, et = ae > 0;
|
|
1363
|
+
v.push({
|
|
1364
|
+
key: Se,
|
|
1365
1365
|
index: F++,
|
|
1366
|
-
raw:
|
|
1367
|
-
position:
|
|
1368
|
-
node:
|
|
1369
|
-
depth:
|
|
1370
|
-
parent:
|
|
1371
|
-
parentKey:
|
|
1372
|
-
childrenCount:
|
|
1373
|
-
hasChildren:
|
|
1374
|
-
childrenAllowed:
|
|
1375
|
-
siblingIndex:
|
|
1376
|
-
siblingCount:
|
|
1377
|
-
firstInParent:
|
|
1378
|
-
lastInParent:
|
|
1379
|
-
canAddChild:
|
|
1380
|
-
canIndent:
|
|
1381
|
-
canOutdent:
|
|
1382
|
-
}),
|
|
1366
|
+
raw: me.data,
|
|
1367
|
+
position: me.data[i],
|
|
1368
|
+
node: me,
|
|
1369
|
+
depth: ee,
|
|
1370
|
+
parent: ue?.data ?? null,
|
|
1371
|
+
parentKey: ue ? b(ue.data) : null,
|
|
1372
|
+
childrenCount: Ge,
|
|
1373
|
+
hasChildren: Le,
|
|
1374
|
+
childrenAllowed: we,
|
|
1375
|
+
siblingIndex: ae,
|
|
1376
|
+
siblingCount: J.length,
|
|
1377
|
+
firstInParent: ae === 0,
|
|
1378
|
+
lastInParent: ae === J.length - 1,
|
|
1379
|
+
canAddChild: Oe,
|
|
1380
|
+
canIndent: et,
|
|
1381
|
+
canOutdent: Ve
|
|
1382
|
+
}), Le && Pe && K(me.children, ee + 1, me);
|
|
1383
1383
|
}
|
|
1384
1384
|
};
|
|
1385
|
-
return
|
|
1386
|
-
}, z =
|
|
1387
|
-
$.splice(
|
|
1388
|
-
},
|
|
1389
|
-
if (!
|
|
1390
|
-
if (
|
|
1391
|
-
const C = $.findIndex((F) =>
|
|
1385
|
+
return K($.children, 0, null), v;
|
|
1386
|
+
}, z = S(() => g(e.value)), q = ($, v, C) => {
|
|
1387
|
+
$.splice(v + 1, 0, C);
|
|
1388
|
+
}, B = ($, v) => {
|
|
1389
|
+
if (!v) return $.length;
|
|
1390
|
+
if (v.afterId !== void 0) {
|
|
1391
|
+
const C = $.findIndex((F) => b(F.data) === v.afterId);
|
|
1392
1392
|
return C === -1 ? $.length : C + 1;
|
|
1393
1393
|
}
|
|
1394
|
-
return
|
|
1395
|
-
},
|
|
1396
|
-
const C = Be(e.value), F =
|
|
1394
|
+
return v.afterIndex !== void 0 ? v.afterIndex < 0 ? $.length : Math.min(v.afterIndex + 1, $.length) : v.index !== void 0 ? Math.max(0, Math.min(v.index, $.length)) : $.length;
|
|
1395
|
+
}, X = ($, v) => {
|
|
1396
|
+
const C = Be(e.value), F = v?.childrenAllowed ?? !0, K = {
|
|
1397
1397
|
data: Be($),
|
|
1398
1398
|
children: F ? [] : void 0,
|
|
1399
1399
|
meta: { dirty: !1 }
|
|
1400
1400
|
};
|
|
1401
|
-
let
|
|
1402
|
-
if (
|
|
1403
|
-
const { node:
|
|
1404
|
-
|
|
1401
|
+
let J = C.children, ee = null;
|
|
1402
|
+
if (v?.parentId !== void 0 && v.parentId !== null) {
|
|
1403
|
+
const { node: ae } = h(v.parentId, C.children);
|
|
1404
|
+
ae && ae.children && (J = ae.children, ee = ae);
|
|
1405
1405
|
}
|
|
1406
|
-
if (
|
|
1407
|
-
const { node:
|
|
1408
|
-
if (
|
|
1409
|
-
const
|
|
1410
|
-
if (
|
|
1411
|
-
return q(
|
|
1406
|
+
if (v?.afterId !== void 0) {
|
|
1407
|
+
const { node: ae, parent: me } = h(v.afterId, C.children);
|
|
1408
|
+
if (ae) {
|
|
1409
|
+
const Se = me ? me.children : C.children, we = Se.indexOf(ae);
|
|
1410
|
+
if (we !== -1)
|
|
1411
|
+
return q(Se, we, K), K.data[m] = me ? b(me.data) : null, I(Se), e.value = C, C;
|
|
1412
1412
|
}
|
|
1413
1413
|
}
|
|
1414
|
-
const
|
|
1415
|
-
return
|
|
1416
|
-
},
|
|
1417
|
-
const
|
|
1418
|
-
if (!C) return
|
|
1419
|
-
const
|
|
1420
|
-
return
|
|
1421
|
-
},
|
|
1422
|
-
const F = Be(e.value), { node:
|
|
1423
|
-
return
|
|
1424
|
-
}, f = ($,
|
|
1425
|
-
const { node: F, parent:
|
|
1414
|
+
const ue = v?.asFirstChild ? 0 : B(J, v);
|
|
1415
|
+
return J.splice(ue, 0, K), K.data[m] = ee ? b(ee.data) : null, I(J), e.value = C, C;
|
|
1416
|
+
}, D = ($) => {
|
|
1417
|
+
const v = Be(e.value), { node: C, parent: F } = h($, v.children);
|
|
1418
|
+
if (!C) return v;
|
|
1419
|
+
const K = F ? F.children : v.children, J = K.indexOf(C);
|
|
1420
|
+
return J === -1 || (K.splice(J, 1), I(K), e.value = v), v;
|
|
1421
|
+
}, s = ($, v, C = !0) => {
|
|
1422
|
+
const F = Be(e.value), { node: K } = h($, F.children);
|
|
1423
|
+
return K && (K.data = Be(v), C && (K.meta.dirty = !0), e.value = F), F;
|
|
1424
|
+
}, f = ($, v, C) => {
|
|
1425
|
+
const { node: F, parent: K } = h(v, $.children);
|
|
1426
1426
|
if (!F) return null;
|
|
1427
|
-
const
|
|
1428
|
-
if (
|
|
1429
|
-
const
|
|
1430
|
-
if (
|
|
1431
|
-
const [
|
|
1432
|
-
return
|
|
1427
|
+
const J = K ? K.children : $.children, ee = J.indexOf(F);
|
|
1428
|
+
if (ee === -1) return null;
|
|
1429
|
+
const ue = C(J, ee);
|
|
1430
|
+
if (ue === null || ue === ee) return null;
|
|
1431
|
+
const [ae] = J.splice(ee, 1);
|
|
1432
|
+
return J.splice(ue, 0, ae), I(J), $;
|
|
1433
1433
|
}, T = ($) => {
|
|
1434
|
-
const
|
|
1434
|
+
const v = Be(e.value), C = f(v, $, (F, K) => K > 0 ? K - 1 : null);
|
|
1435
1435
|
return C && (e.value = C), C;
|
|
1436
1436
|
}, P = ($) => {
|
|
1437
|
-
const
|
|
1437
|
+
const v = Be(e.value), C = f(v, $, (F, K) => K < F.length - 1 ? K + 1 : null);
|
|
1438
1438
|
return C && (e.value = C), C;
|
|
1439
|
-
},
|
|
1440
|
-
const
|
|
1439
|
+
}, Y = ($) => {
|
|
1440
|
+
const v = Be(e.value), C = f(v, $, (F, K) => K > 0 ? 0 : null);
|
|
1441
1441
|
return C && (e.value = C), C;
|
|
1442
|
-
},
|
|
1443
|
-
const
|
|
1442
|
+
}, ce = ($) => {
|
|
1443
|
+
const v = Be(e.value), C = f(v, $, (F, K) => K < F.length - 1 ? F.length - 1 : null);
|
|
1444
1444
|
return C && (e.value = C), C;
|
|
1445
|
-
},
|
|
1446
|
-
const
|
|
1445
|
+
}, ne = ($) => {
|
|
1446
|
+
const v = Be(e.value), { node: C, parent: F } = h($, v.children);
|
|
1447
1447
|
if (!C) return null;
|
|
1448
|
-
const
|
|
1449
|
-
if (
|
|
1450
|
-
const
|
|
1451
|
-
if (
|
|
1452
|
-
const
|
|
1453
|
-
return
|
|
1448
|
+
const K = F ? F.children : v.children, J = K.indexOf(C);
|
|
1449
|
+
if (J <= 0) return null;
|
|
1450
|
+
const ee = K[J - 1];
|
|
1451
|
+
if (Ie(ee.children)) return null;
|
|
1452
|
+
const ue = c(C);
|
|
1453
|
+
return ie(v, b(ee.data)) + 1 + ue > E ? null : (K.splice(J, 1), ee.children.push(C), C.data[m] = b(ee.data), C.meta.dirty = !0, I(K), I(ee.children), e.value = v, v);
|
|
1454
1454
|
}, le = ($) => {
|
|
1455
|
-
const
|
|
1455
|
+
const v = Be(e.value), { node: C, parent: F } = h($, v.children);
|
|
1456
1456
|
if (!C || !F) return null;
|
|
1457
|
-
const { parent:
|
|
1458
|
-
if (
|
|
1459
|
-
const
|
|
1460
|
-
return
|
|
1461
|
-
},
|
|
1462
|
-
const C = (F,
|
|
1463
|
-
for (const
|
|
1464
|
-
if (
|
|
1465
|
-
if (
|
|
1466
|
-
const
|
|
1467
|
-
if (
|
|
1457
|
+
const { parent: K } = h(b(F.data), v.children), J = K ? K.children : v.children, ee = J.indexOf(F);
|
|
1458
|
+
if (ee === -1) return null;
|
|
1459
|
+
const ue = F.children, ae = ue.indexOf(C);
|
|
1460
|
+
return ae === -1 ? null : (ue.splice(ae, 1), J.splice(ee + 1, 0, C), C.data[m] = K ? b(K.data) : null, C.meta.dirty = !0, I(ue), I(J), e.value = v, v);
|
|
1461
|
+
}, ie = ($, v) => {
|
|
1462
|
+
const C = (F, K) => {
|
|
1463
|
+
for (const J of F) {
|
|
1464
|
+
if (b(J.data) === v) return K;
|
|
1465
|
+
if (J.children && J.children.length) {
|
|
1466
|
+
const ee = C(J.children, K + 1);
|
|
1467
|
+
if (ee !== null) return ee;
|
|
1468
1468
|
}
|
|
1469
1469
|
}
|
|
1470
1470
|
return null;
|
|
@@ -1474,42 +1474,42 @@ function kl(e, k) {
|
|
|
1474
1474
|
return {
|
|
1475
1475
|
viewItems: z,
|
|
1476
1476
|
findNode: h,
|
|
1477
|
-
addItem:
|
|
1478
|
-
deleteItem:
|
|
1479
|
-
updateItem:
|
|
1477
|
+
addItem: X,
|
|
1478
|
+
deleteItem: D,
|
|
1479
|
+
updateItem: s,
|
|
1480
1480
|
moveUp: T,
|
|
1481
1481
|
moveDown: P,
|
|
1482
|
-
moveTop:
|
|
1483
|
-
moveBottom:
|
|
1484
|
-
indent:
|
|
1482
|
+
moveTop: Y,
|
|
1483
|
+
moveBottom: ce,
|
|
1484
|
+
indent: ne,
|
|
1485
1485
|
outdent: le,
|
|
1486
|
-
moveTo: ($,
|
|
1487
|
-
const F = Be(e.value), { node:
|
|
1488
|
-
if (!
|
|
1489
|
-
if (
|
|
1490
|
-
const
|
|
1491
|
-
if (!
|
|
1492
|
-
for (const
|
|
1493
|
-
if (
|
|
1486
|
+
moveTo: ($, v, C) => {
|
|
1487
|
+
const F = Be(e.value), { node: K, parent: J } = h($, F.children);
|
|
1488
|
+
if (!K) return null;
|
|
1489
|
+
if (v !== null) {
|
|
1490
|
+
const Ae = (Oe) => {
|
|
1491
|
+
if (!Oe.children) return !1;
|
|
1492
|
+
for (const Ve of Oe.children)
|
|
1493
|
+
if (b(Ve.data) === v || Ae(Ve)) return !0;
|
|
1494
1494
|
return !1;
|
|
1495
1495
|
};
|
|
1496
|
-
if (
|
|
1496
|
+
if (b(K.data) === v || Ae(K)) return null;
|
|
1497
1497
|
}
|
|
1498
|
-
let
|
|
1499
|
-
if (
|
|
1500
|
-
|
|
1498
|
+
let ee, ue = null, ae = 0;
|
|
1499
|
+
if (v === null)
|
|
1500
|
+
ee = F.children, ae = 0;
|
|
1501
1501
|
else {
|
|
1502
|
-
const { node:
|
|
1503
|
-
if (!
|
|
1504
|
-
|
|
1502
|
+
const { node: Ae } = h(v, F.children);
|
|
1503
|
+
if (!Ae || Ie(Ae.children)) return null;
|
|
1504
|
+
ee = Ae.children, ue = Ae, ae = ie(F, v) + 1;
|
|
1505
1505
|
}
|
|
1506
|
-
const
|
|
1507
|
-
if (
|
|
1508
|
-
const
|
|
1509
|
-
if (
|
|
1510
|
-
const
|
|
1511
|
-
let
|
|
1512
|
-
return
|
|
1506
|
+
const me = c(K);
|
|
1507
|
+
if (ae + me > E) return null;
|
|
1508
|
+
const Se = J ? J.children : F.children, we = Se.indexOf(K);
|
|
1509
|
+
if (we === -1) return null;
|
|
1510
|
+
const Le = Se === ee, [Ge] = Se.splice(we, 1);
|
|
1511
|
+
let Pe = C;
|
|
1512
|
+
return Le && we < C && (Pe = C - 1), Pe = Math.max(0, Math.min(Pe, ee.length)), ee.splice(Pe, 0, Ge), Ge.data[m] = ue ? b(ue.data) : null, Ge.meta.dirty = !0, Le || I(Se), I(ee), e.value = F, F;
|
|
1513
1513
|
},
|
|
1514
1514
|
recalculatePositions: M,
|
|
1515
1515
|
calculateSubtreeDepth: c
|
|
@@ -1521,7 +1521,7 @@ const wl = (e) => {
|
|
|
1521
1521
|
k.push(i.data), i.children && i.children.length && l(i.children);
|
|
1522
1522
|
};
|
|
1523
1523
|
return l(e.children), k;
|
|
1524
|
-
},
|
|
1524
|
+
}, ot = (e, k) => {
|
|
1525
1525
|
const l = (n) => {
|
|
1526
1526
|
for (const i of n)
|
|
1527
1527
|
k(i), i.children && i.children.length && l(i.children);
|
|
@@ -1529,160 +1529,178 @@ const wl = (e) => {
|
|
|
1529
1529
|
l(e.children);
|
|
1530
1530
|
};
|
|
1531
1531
|
function Cl(e) {
|
|
1532
|
-
const k = typeof e.getKey == "function" ? null : e.getKey ?? "id", l = (
|
|
1532
|
+
const k = typeof e.getKey == "function" ? null : e.getKey ?? "id", l = (A) => typeof e.getKey == "function" ? e.getKey(A) : A[k], n = k ?? "id", i = e.position ?? "position", m = i !== !1, w = typeof i == "object" ? i.field : i === !1 ? "position" : i, E = typeof i == "object" && i.multiplier ? i.multiplier : 1, b = e.parentField ?? "parent", c = S({
|
|
1533
1533
|
get: () => e.get(),
|
|
1534
|
-
set: (
|
|
1534
|
+
set: (A) => e.set(A)
|
|
1535
1535
|
}), h = kl(c, {
|
|
1536
1536
|
keyField: n,
|
|
1537
1537
|
// Pass the controller's keyOf so tree ops resolve keys identically to
|
|
1538
1538
|
// invalidKeys/dirty tracking — supports a function get-key, not just a field.
|
|
1539
1539
|
getKey: l,
|
|
1540
1540
|
positionField: w,
|
|
1541
|
-
parentField:
|
|
1542
|
-
positionMultiplier:
|
|
1541
|
+
parentField: b,
|
|
1542
|
+
positionMultiplier: E,
|
|
1543
1543
|
maxDepth: e.maxDepth
|
|
1544
|
-
}),
|
|
1545
|
-
const
|
|
1546
|
-
|
|
1547
|
-
for (const
|
|
1548
|
-
return JSON.stringify(
|
|
1549
|
-
}, z =
|
|
1550
|
-
const
|
|
1551
|
-
for (const
|
|
1552
|
-
const
|
|
1553
|
-
|
|
1544
|
+
}), I = S(() => wl(e.get())), j = h.viewItems, M = S(() => ko(e.dirtyExclude) ?? []), g = (A) => {
|
|
1545
|
+
const L = { ...A };
|
|
1546
|
+
m && delete L[w], delete L[b];
|
|
1547
|
+
for (const G of M.value) delete L[G];
|
|
1548
|
+
return JSON.stringify(L);
|
|
1549
|
+
}, z = de(/* @__PURE__ */ new Map()), q = de(/* @__PURE__ */ new Map()), B = de(null), X = (A) => Be(A), D = (A) => {
|
|
1550
|
+
const L = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(), W = (Z, pe) => {
|
|
1551
|
+
for (const Ce of Z) {
|
|
1552
|
+
const ye = l(Ce.data);
|
|
1553
|
+
L.set(ye, g(Ce.data)), G.set(ye, pe), Ce.children && Ce.children.length && W(Ce.children, ye);
|
|
1554
1554
|
}
|
|
1555
1555
|
};
|
|
1556
|
-
|
|
1556
|
+
W(A.children, null), z.value = L, q.value = G, B.value = X(A);
|
|
1557
1557
|
};
|
|
1558
|
-
|
|
1558
|
+
D(e.get()), $e(
|
|
1559
1559
|
M,
|
|
1560
1560
|
() => {
|
|
1561
|
-
if (!
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1561
|
+
if (!B.value) return;
|
|
1562
|
+
const A = /* @__PURE__ */ new Map();
|
|
1563
|
+
ot(B.value, (L) => A.set(l(L.data), g(L.data))), z.value = A;
|
|
1564
1564
|
},
|
|
1565
1565
|
{ flush: "sync" }
|
|
1566
1566
|
);
|
|
1567
|
-
const
|
|
1567
|
+
const s = de(!1), f = wo(/* @__PURE__ */ new Map()), T = (A, L, G) => {
|
|
1568
1568
|
if (e.isDirty) {
|
|
1569
|
-
const
|
|
1570
|
-
return e.isDirty(
|
|
1569
|
+
const Z = ne(L);
|
|
1570
|
+
return e.isDirty(A.data, Z);
|
|
1571
1571
|
}
|
|
1572
|
-
const
|
|
1573
|
-
return !!(
|
|
1574
|
-
}, P = (
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1572
|
+
const W = z.value.get(L);
|
|
1573
|
+
return !!(W === void 0 || W !== g(A.data) || q.value.has(L) && (q.value.get(L) ?? null ?? null) !== (G ?? null));
|
|
1574
|
+
}, P = de(/* @__PURE__ */ new Map()), Y = de(/* @__PURE__ */ new Set());
|
|
1575
|
+
$e(
|
|
1576
|
+
() => e.get(),
|
|
1577
|
+
(A) => {
|
|
1578
|
+
const L = /* @__PURE__ */ new Set();
|
|
1579
|
+
ot(A, (W) => {
|
|
1580
|
+
const Z = l(W.data);
|
|
1581
|
+
if (L.add(Z), !z.value.has(Z) && !P.value.has(Z) && P.value.set(Z, g(W.data)), !Y.value.has(Z)) {
|
|
1582
|
+
const pe = z.value.get(Z) ?? P.value.get(Z);
|
|
1583
|
+
pe !== void 0 && pe !== g(W.data) && Y.value.add(Z);
|
|
1584
|
+
}
|
|
1585
|
+
});
|
|
1586
|
+
const G = [];
|
|
1587
|
+
for (const W of P.value.keys()) L.has(W) || G.push(W);
|
|
1588
|
+
for (const W of G) P.value.delete(W);
|
|
1589
|
+
},
|
|
1590
|
+
{ immediate: !0, deep: !0 }
|
|
1591
|
+
);
|
|
1592
|
+
const ce = (A) => Y.value.has(A), ne = (A) => {
|
|
1593
|
+
if (!B.value) return;
|
|
1594
|
+
let L;
|
|
1595
|
+
return ot(B.value, (G) => {
|
|
1596
|
+
L === void 0 && l(G.data) === A && (L = G.data);
|
|
1597
|
+
}), L;
|
|
1598
|
+
}, le = S(() => {
|
|
1599
|
+
const A = /* @__PURE__ */ new Set(), L = (G, W) => {
|
|
1600
|
+
for (const Z of G) {
|
|
1601
|
+
const pe = l(Z.data);
|
|
1602
|
+
T(Z, pe, W) && A.add(pe), Z.children && Z.children.length && L(Z.children, pe);
|
|
1585
1603
|
}
|
|
1586
1604
|
};
|
|
1587
|
-
return
|
|
1588
|
-
}),
|
|
1589
|
-
const
|
|
1590
|
-
if (
|
|
1605
|
+
return L(e.get().children, null), A;
|
|
1606
|
+
}), ie = (A) => le.value.has(A), Re = S(() => le.value.size > 0), $ = (A, L) => {
|
|
1607
|
+
const G = f.get(L);
|
|
1608
|
+
if (G) return { invalid: !G(), warning: !1 };
|
|
1591
1609
|
if (!e.validate) return { invalid: !1, warning: !1 };
|
|
1592
|
-
const
|
|
1593
|
-
return typeof
|
|
1594
|
-
},
|
|
1595
|
-
const
|
|
1596
|
-
return
|
|
1597
|
-
const
|
|
1598
|
-
|
|
1599
|
-
}),
|
|
1600
|
-
}),
|
|
1601
|
-
const { invalid:
|
|
1602
|
-
return
|
|
1603
|
-
},
|
|
1604
|
-
const
|
|
1605
|
-
for (const
|
|
1606
|
-
const
|
|
1607
|
-
|
|
1610
|
+
const W = e.validate(A);
|
|
1611
|
+
return typeof W == "boolean" ? { invalid: !W, warning: !1 } : { invalid: !W.valid, warning: W.valid && W.state === "warning" };
|
|
1612
|
+
}, v = S(() => {
|
|
1613
|
+
const A = /* @__PURE__ */ new Set();
|
|
1614
|
+
return ot(e.get(), (L) => {
|
|
1615
|
+
const G = l(L.data);
|
|
1616
|
+
$(L.data, G).invalid && A.add(G);
|
|
1617
|
+
}), A;
|
|
1618
|
+
}), C = S(() => v.value.size > 0), F = (A, L) => {
|
|
1619
|
+
const { invalid: G, warning: W } = $(A, L);
|
|
1620
|
+
return G ? ce(L) || s.value ? "invalid" : null : W ? "warning" : null;
|
|
1621
|
+
}, K = () => (s.value = !0, v.value.size === 0), J = () => {
|
|
1622
|
+
const A = [], L = (G, W) => {
|
|
1623
|
+
for (const Z of G) {
|
|
1624
|
+
const pe = { ...Z.data };
|
|
1625
|
+
pe[b] = W, A.push(pe), Z.children && Z.children.length && L(Z.children, l(Z.data));
|
|
1608
1626
|
}
|
|
1609
1627
|
};
|
|
1610
|
-
return
|
|
1628
|
+
return L(e.get().children, null), A;
|
|
1611
1629
|
};
|
|
1612
1630
|
return {
|
|
1613
|
-
items:
|
|
1631
|
+
items: I,
|
|
1614
1632
|
viewItems: j,
|
|
1615
|
-
hasUnsaved:
|
|
1616
|
-
hasErrors:
|
|
1617
|
-
invalidKeys:
|
|
1618
|
-
isUnsaved:
|
|
1619
|
-
rowState:
|
|
1620
|
-
validateAll:
|
|
1621
|
-
getPayload: () => e.payload ? e.payload(
|
|
1633
|
+
hasUnsaved: Re,
|
|
1634
|
+
hasErrors: C,
|
|
1635
|
+
invalidKeys: v,
|
|
1636
|
+
isUnsaved: ie,
|
|
1637
|
+
rowState: F,
|
|
1638
|
+
validateAll: K,
|
|
1639
|
+
getPayload: () => e.payload ? e.payload(J()) : J(),
|
|
1622
1640
|
getChanges: () => {
|
|
1623
|
-
const
|
|
1624
|
-
for (const
|
|
1625
|
-
|
|
1626
|
-
const
|
|
1627
|
-
if (
|
|
1628
|
-
const
|
|
1629
|
-
(
|
|
1641
|
+
const A = [], L = [], G = [], W = [], Z = J(), pe = /* @__PURE__ */ new Map();
|
|
1642
|
+
for (const ye of Z) pe.set(l(ye), ye);
|
|
1643
|
+
ot(e.get(), (ye) => {
|
|
1644
|
+
const be = l(ye.data), a = pe.get(be) ?? ye.data, H = z.value.get(be);
|
|
1645
|
+
if (H === void 0 ? A.push(a) : H !== g(ye.data) && L.push(a), H !== void 0 && ye.meta.dirty && H === g(ye.data) && G.push(a), q.value.has(be)) {
|
|
1646
|
+
const p = q.value.get(be) ?? null, he = a[b];
|
|
1647
|
+
(p ?? null) !== (he ?? null) && W.push(a);
|
|
1630
1648
|
}
|
|
1631
1649
|
});
|
|
1632
|
-
const
|
|
1633
|
-
if (
|
|
1634
|
-
const
|
|
1635
|
-
|
|
1636
|
-
|
|
1650
|
+
const Ce = [];
|
|
1651
|
+
if (B.value) {
|
|
1652
|
+
const ye = /* @__PURE__ */ new Set();
|
|
1653
|
+
ot(e.get(), (be) => ye.add(l(be.data))), ot(B.value, (be) => {
|
|
1654
|
+
ye.has(l(be.data)) || Ce.push(be.data);
|
|
1637
1655
|
});
|
|
1638
1656
|
}
|
|
1639
|
-
return { added:
|
|
1657
|
+
return { added: A, updated: L, moved: G, deleted: Ce, reparented: W };
|
|
1640
1658
|
},
|
|
1641
|
-
commit: (
|
|
1642
|
-
const
|
|
1643
|
-
|
|
1644
|
-
const
|
|
1645
|
-
|
|
1646
|
-
}), e.set(
|
|
1659
|
+
commit: (A) => {
|
|
1660
|
+
const L = A ?? e.get(), G = e.normalizeSaved ? e.normalizeSaved(L) : L, W = X(G);
|
|
1661
|
+
ot(W, (Z) => {
|
|
1662
|
+
const pe = ne(l(Z.data)), Ce = e.commitKey ? e.commitKey(Z.data, pe) : l(Z.data);
|
|
1663
|
+
Ce == null && k && (Z.data[n] = ao()), Z.meta.dirty = !1;
|
|
1664
|
+
}), e.set(W), D(W), P.value = /* @__PURE__ */ new Map(), Y.value = /* @__PURE__ */ new Set(), s.value = !1;
|
|
1647
1665
|
},
|
|
1648
|
-
reset: (
|
|
1649
|
-
const
|
|
1650
|
-
e.set(
|
|
1666
|
+
reset: (A) => {
|
|
1667
|
+
const L = A ?? (B.value ? X(B.value) : e.get());
|
|
1668
|
+
e.set(L), P.value = /* @__PURE__ */ new Map(), Y.value = /* @__PURE__ */ new Set(), s.value = !1;
|
|
1651
1669
|
},
|
|
1652
|
-
addItem: (
|
|
1653
|
-
const
|
|
1654
|
-
|
|
1670
|
+
addItem: (A, L) => {
|
|
1671
|
+
const G = A ?? e.factory?.();
|
|
1672
|
+
G !== void 0 && h.addItem(G, L);
|
|
1655
1673
|
},
|
|
1656
|
-
addAfter: (
|
|
1657
|
-
const
|
|
1658
|
-
|
|
1674
|
+
addAfter: (A, L, G = !0) => {
|
|
1675
|
+
const W = L ?? e.factory?.();
|
|
1676
|
+
W !== void 0 && h.addItem(W, { afterId: A, childrenAllowed: G });
|
|
1659
1677
|
},
|
|
1660
|
-
addChild: (
|
|
1661
|
-
const
|
|
1662
|
-
|
|
1678
|
+
addChild: (A, L, G = !0) => {
|
|
1679
|
+
const W = L ?? e.factory?.();
|
|
1680
|
+
W !== void 0 && h.addItem(W, { parentId: A, childrenAllowed: G });
|
|
1663
1681
|
},
|
|
1664
|
-
updateItem: (
|
|
1665
|
-
h.updateItem(
|
|
1682
|
+
updateItem: (A, L, G = !0) => {
|
|
1683
|
+
h.updateItem(A, L, G);
|
|
1666
1684
|
},
|
|
1667
|
-
deleteItem: (
|
|
1668
|
-
h.deleteItem(
|
|
1685
|
+
deleteItem: (A) => {
|
|
1686
|
+
h.deleteItem(A);
|
|
1669
1687
|
},
|
|
1670
|
-
moveUp: (
|
|
1671
|
-
moveDown: (
|
|
1672
|
-
moveTop: (
|
|
1673
|
-
moveBottom: (
|
|
1674
|
-
indent: (
|
|
1675
|
-
outdent: (
|
|
1676
|
-
moveTo: (
|
|
1688
|
+
moveUp: (A) => h.moveUp(A) !== null,
|
|
1689
|
+
moveDown: (A) => h.moveDown(A) !== null,
|
|
1690
|
+
moveTop: (A) => h.moveTop(A) !== null,
|
|
1691
|
+
moveBottom: (A) => h.moveBottom(A) !== null,
|
|
1692
|
+
indent: (A) => h.indent(A) !== null,
|
|
1693
|
+
outdent: (A) => h.outdent(A) !== null,
|
|
1694
|
+
moveTo: (A, L, G) => h.moveTo(A, L, G) !== null,
|
|
1677
1695
|
recalculatePositions: () => {
|
|
1678
1696
|
e.set(h.recalculatePositions(e.get()));
|
|
1679
1697
|
},
|
|
1680
|
-
registerValidity: (
|
|
1698
|
+
registerValidity: (A, L) => (f.set(A, L), () => f.delete(A)),
|
|
1681
1699
|
findNode: h.findNode,
|
|
1682
1700
|
calculateSubtreeDepth: h.calculateSubtreeDepth
|
|
1683
1701
|
};
|
|
1684
1702
|
}
|
|
1685
|
-
const Mt = (e, k) => e.find((l) => l.key === k) ?? null,
|
|
1703
|
+
const Mt = (e, k) => e.find((l) => l.key === k) ?? null, ra = (e, k, l) => {
|
|
1686
1704
|
let n = Mt(e, l);
|
|
1687
1705
|
for (; n && n.parentKey !== null; ) {
|
|
1688
1706
|
if (n.parentKey === k) return !0;
|
|
@@ -1696,26 +1714,26 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
1696
1714
|
n = Mt(e, n.parentKey);
|
|
1697
1715
|
}
|
|
1698
1716
|
return n && n.depth === l ? n : null;
|
|
1699
|
-
},
|
|
1717
|
+
}, Sl = (e, k, l) => l === k || ra(e, k, l), Ft = (e, k, l, n) => {
|
|
1700
1718
|
for (let i = k; i >= 0 && i < e.length; i += l) {
|
|
1701
|
-
const
|
|
1702
|
-
if (!
|
|
1719
|
+
const m = e[i];
|
|
1720
|
+
if (!Sl(e, n, m.key)) return m;
|
|
1703
1721
|
}
|
|
1704
1722
|
return null;
|
|
1705
|
-
},
|
|
1723
|
+
}, Al = (e) => {
|
|
1706
1724
|
const {
|
|
1707
1725
|
pointer: k,
|
|
1708
1726
|
hoveredRow: l,
|
|
1709
1727
|
sourceKey: n,
|
|
1710
1728
|
sourceSubtreeDepth: i,
|
|
1711
|
-
viewItems:
|
|
1729
|
+
viewItems: m,
|
|
1712
1730
|
maxDepth: w,
|
|
1713
|
-
indentPx:
|
|
1714
|
-
containerLeft:
|
|
1731
|
+
indentPx: E,
|
|
1732
|
+
containerLeft: b,
|
|
1715
1733
|
containerPaddingLeft: c
|
|
1716
1734
|
} = e;
|
|
1717
|
-
if (l.key === n ||
|
|
1718
|
-
const h = k.y - l.rect.top,
|
|
1735
|
+
if (l.key === n || ra(m, n, l.key)) return null;
|
|
1736
|
+
const h = k.y - l.rect.top, I = l.rect.height, j = h < I / 2, M = j ? "top" : "bottom", g = m.findIndex((P) => P.key === l.key), z = j ? Ft(m, g - 1, -1, n) : Ft(m, g, -1, n), q = j ? Ft(m, g, 1, n) : Ft(m, g + 1, 1, n), B = k.x - b - c, X = Math.round(B / E), D = z ? z.depth + 1 : 0, s = q ? q.depth : 0, f = Math.max(s, Math.min(X, D));
|
|
1719
1737
|
let T;
|
|
1720
1738
|
if (!z)
|
|
1721
1739
|
T = {
|
|
@@ -1751,7 +1769,7 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
1751
1769
|
levelRowKey: z.key
|
|
1752
1770
|
};
|
|
1753
1771
|
else {
|
|
1754
|
-
const P = xl(
|
|
1772
|
+
const P = xl(m, z.key, f);
|
|
1755
1773
|
P ? T = {
|
|
1756
1774
|
type: "insert",
|
|
1757
1775
|
refKey: l.key,
|
|
@@ -1773,11 +1791,11 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
1773
1791
|
};
|
|
1774
1792
|
}
|
|
1775
1793
|
return T.depth + i - 1 >= w ? { type: "blocked", desired: T, reason: "maxDepth" } : T;
|
|
1776
|
-
}, Il = ["data-id", "aria-level", "tabindex"], Pl = ["aria-label"],
|
|
1794
|
+
}, Il = ["data-id", "aria-level", "tabindex"], Pl = ["aria-label"], El = {
|
|
1777
1795
|
key: 2,
|
|
1778
1796
|
class: "a-nested-list-editor__tree-toggle a-nested-list-editor__tree-toggle--spacer",
|
|
1779
1797
|
"aria-hidden": "true"
|
|
1780
|
-
},
|
|
1798
|
+
}, Dl = { class: "a-le-row-main" }, $l = { class: "a-le-title" }, Tl = {
|
|
1781
1799
|
key: 0,
|
|
1782
1800
|
class: "a-nested-list-editor__drag-count",
|
|
1783
1801
|
"aria-hidden": "true"
|
|
@@ -1793,7 +1811,7 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
1793
1811
|
}, Ml = {
|
|
1794
1812
|
key: 1,
|
|
1795
1813
|
class: "a-le-row-body"
|
|
1796
|
-
}, zl = { class: "a-le-form" }, Nl = ["data-parent-id"], Ol = "a-nested-list-editor__group", Ul = "a-le-drag-handle", da = /* @__PURE__ */
|
|
1814
|
+
}, zl = { class: "a-le-form" }, Nl = ["data-parent-id"], Ol = "a-nested-list-editor__group", Ul = "a-le-drag-handle", da = /* @__PURE__ */ _e({
|
|
1797
1815
|
__name: "LeNestedRow",
|
|
1798
1816
|
props: {
|
|
1799
1817
|
vi: {},
|
|
@@ -1803,14 +1821,14 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
1803
1821
|
callbacks: {}
|
|
1804
1822
|
},
|
|
1805
1823
|
setup(e) {
|
|
1806
|
-
const k = e, l = da, { t: n } =
|
|
1824
|
+
const k = e, l = da, { t: n } = lt(), i = (b) => `--row-${String(b).replace(/\W/g, "_")}`, m = (b) => {
|
|
1807
1825
|
if (typeof k.context.resolveValidation == "function")
|
|
1808
|
-
return k.context.resolveValidation(
|
|
1809
|
-
const c =
|
|
1826
|
+
return k.context.resolveValidation(b, k.vi.key, k.vi.index);
|
|
1827
|
+
const c = b.validationState;
|
|
1810
1828
|
return c === "valid" || c === "invalid" || c === "warning" ? c : null;
|
|
1811
|
-
}, w = () => k.context.buildSlotProps(k.vi),
|
|
1812
|
-
return (
|
|
1813
|
-
class:
|
|
1829
|
+
}, w = () => k.context.buildSlotProps(k.vi), E = () => k.viewItems.filter((b) => b.parentKey === k.vi.key);
|
|
1830
|
+
return (b, c) => (x(), N("div", {
|
|
1831
|
+
class: Ue([
|
|
1814
1832
|
"a-le-row-wrapper",
|
|
1815
1833
|
{
|
|
1816
1834
|
"a-le-row-wrapper--drop-disabled": e.dragState !== null && e.dragState.sourceKey === e.vi.key
|
|
@@ -1823,7 +1841,7 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
1823
1841
|
onKeydown: c[17] || (c[17] = (h) => e.context.keyboardNav ? e.context.keyboardNav.handleKeydown(e.vi.key, h) : void 0)
|
|
1824
1842
|
}, [
|
|
1825
1843
|
U("div", {
|
|
1826
|
-
class:
|
|
1844
|
+
class: Ue([
|
|
1827
1845
|
"a-le-row",
|
|
1828
1846
|
e.vi.depth > 0 ? "a-le-row--child" : null,
|
|
1829
1847
|
{
|
|
@@ -1834,7 +1852,7 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
1834
1852
|
"a-le-row--grabbed": e.context.keyboardNav && e.context.keyboardNav.isGrabbed(e.vi.key),
|
|
1835
1853
|
"a-le-row--clickable": e.context.isRowClickable(e.vi),
|
|
1836
1854
|
"a-le-row--drop-source": e.dragState !== null && e.dragState.sourceKey === e.vi.key,
|
|
1837
|
-
[`a-le-row--validation-${
|
|
1855
|
+
[`a-le-row--validation-${m(e.vi.raw)}`]: m(e.vi.raw) !== null
|
|
1838
1856
|
}
|
|
1839
1857
|
]),
|
|
1840
1858
|
style: wt({
|
|
@@ -1843,19 +1861,19 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
1843
1861
|
"--parent-anchor": e.vi.parentKey !== null ? i(e.vi.parentKey) : "none"
|
|
1844
1862
|
})
|
|
1845
1863
|
}, [
|
|
1846
|
-
O(
|
|
1864
|
+
O(b.$slots, "before-item", Je(at(w()))),
|
|
1847
1865
|
U("div", {
|
|
1848
1866
|
class: "a-le-row-header",
|
|
1849
1867
|
onClick: c[14] || (c[14] = (h) => e.callbacks.onRowClick(e.vi))
|
|
1850
1868
|
}, [
|
|
1851
|
-
e.context.dragEnabled ? (x(),
|
|
1869
|
+
e.context.dragEnabled ? (x(), te(oo, {
|
|
1852
1870
|
key: 0,
|
|
1853
|
-
class:
|
|
1854
|
-
})) :
|
|
1871
|
+
class: Ue(Ul)
|
|
1872
|
+
})) : _("", !0),
|
|
1855
1873
|
e.context.showExpandToggle && e.vi.childrenAllowed ? (x(), N("button", {
|
|
1856
1874
|
key: 1,
|
|
1857
1875
|
type: "button",
|
|
1858
|
-
class:
|
|
1876
|
+
class: Ue([
|
|
1859
1877
|
"a-nested-list-editor__tree-toggle",
|
|
1860
1878
|
{
|
|
1861
1879
|
"a-nested-list-editor__tree-toggle--empty": !e.vi.hasChildren,
|
|
@@ -1863,46 +1881,46 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
1863
1881
|
}
|
|
1864
1882
|
]),
|
|
1865
1883
|
"aria-label": e.vi.childrenExpanded ? y(n)("common.sortable.close") : y(n)("common.sortable.edit"),
|
|
1866
|
-
onClick: c[0] || (c[0] =
|
|
1884
|
+
onClick: c[0] || (c[0] = fe((h) => e.vi.hasChildren && e.callbacks.onChevronClick(e.vi), ["stop"]))
|
|
1867
1885
|
}, [...c[18] || (c[18] = [
|
|
1868
1886
|
U("span", { class: "a-nested-list-editor__tree-toggle-caret" }, null, -1)
|
|
1869
|
-
])], 10, Pl)) : e.context.showExpandToggle ? (x(), N("span",
|
|
1870
|
-
U("div",
|
|
1871
|
-
O(
|
|
1872
|
-
U("span", $l,
|
|
1887
|
+
])], 10, Pl)) : e.context.showExpandToggle ? (x(), N("span", El)) : _("", !0),
|
|
1888
|
+
U("div", Dl, [
|
|
1889
|
+
O(b.$slots, "item-compact", Je(at(w())), () => [
|
|
1890
|
+
U("span", $l, V(e.context.resolveCompactText(e.vi.raw, e.vi.key)), 1)
|
|
1873
1891
|
]),
|
|
1874
1892
|
e.vi.hasChildren ? (x(), N("span", Tl, [
|
|
1875
|
-
|
|
1893
|
+
r(re, {
|
|
1876
1894
|
icon: "mdi-file-tree",
|
|
1877
1895
|
size: "14"
|
|
1878
1896
|
}),
|
|
1879
|
-
|
|
1880
|
-
])) :
|
|
1881
|
-
e.vi.unsaved ? (x(),
|
|
1897
|
+
Q(" +" + V(e.vi.childrenCount), 1)
|
|
1898
|
+
])) : _("", !0),
|
|
1899
|
+
e.vi.unsaved ? (x(), te(Yn, { key: 1 })) : _("", !0)
|
|
1882
1900
|
]),
|
|
1883
|
-
e.context.reorderMode ?
|
|
1884
|
-
O(
|
|
1885
|
-
e.context.statusField && e.vi.raw[e.context.statusField] != null && e.vi.raw[e.context.statusField] !== "" ? (x(), N("span", Kl,
|
|
1901
|
+
e.context.reorderMode ? _("", !0) : (x(), N("div", Fl, [
|
|
1902
|
+
O(b.$slots, "item-status", Je(at(w())), () => [
|
|
1903
|
+
e.context.statusField && e.vi.raw[e.context.statusField] != null && e.vi.raw[e.context.statusField] !== "" ? (x(), N("span", Kl, V(e.vi.raw[e.context.statusField]), 1)) : _("", !0)
|
|
1886
1904
|
])
|
|
1887
1905
|
])),
|
|
1888
1906
|
U("div", Bl, [
|
|
1889
|
-
O(
|
|
1890
|
-
e.context.reorderMode ? (x(), N(
|
|
1891
|
-
|
|
1907
|
+
O(b.$slots, "item-actions", Je(at(w())), () => [
|
|
1908
|
+
e.context.reorderMode ? (x(), N(xe, { key: 0 }, [
|
|
1909
|
+
r(se, {
|
|
1892
1910
|
icon: "",
|
|
1893
1911
|
size: "small",
|
|
1894
1912
|
variant: "text",
|
|
1895
1913
|
density: "comfortable",
|
|
1896
1914
|
disabled: e.vi.firstInParent,
|
|
1897
1915
|
class: "mx-1 a-le-action a-le-action--up",
|
|
1898
|
-
onClick: c[1] || (c[1] =
|
|
1916
|
+
onClick: c[1] || (c[1] = fe((h) => e.callbacks.moveUp(e.vi.key), ["stop"]))
|
|
1899
1917
|
}, {
|
|
1900
1918
|
default: u(() => [
|
|
1901
|
-
|
|
1919
|
+
r(re, {
|
|
1902
1920
|
icon: "mdi-arrow-up",
|
|
1903
1921
|
size: "18"
|
|
1904
1922
|
}),
|
|
1905
|
-
|
|
1923
|
+
r(qe, {
|
|
1906
1924
|
activator: "parent",
|
|
1907
1925
|
location: "bottom",
|
|
1908
1926
|
text: y(n)("common.sortable.moveUp")
|
|
@@ -1910,21 +1928,21 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
1910
1928
|
]),
|
|
1911
1929
|
_: 1
|
|
1912
1930
|
}, 8, ["disabled"]),
|
|
1913
|
-
|
|
1931
|
+
r(se, {
|
|
1914
1932
|
icon: "",
|
|
1915
1933
|
size: "small",
|
|
1916
1934
|
variant: "text",
|
|
1917
1935
|
density: "comfortable",
|
|
1918
1936
|
disabled: e.vi.lastInParent,
|
|
1919
1937
|
class: "mx-1 a-le-action a-le-action--down",
|
|
1920
|
-
onClick: c[2] || (c[2] =
|
|
1938
|
+
onClick: c[2] || (c[2] = fe((h) => e.callbacks.moveDown(e.vi.key), ["stop"]))
|
|
1921
1939
|
}, {
|
|
1922
1940
|
default: u(() => [
|
|
1923
|
-
|
|
1941
|
+
r(re, {
|
|
1924
1942
|
icon: "mdi-arrow-down",
|
|
1925
1943
|
size: "18"
|
|
1926
1944
|
}),
|
|
1927
|
-
|
|
1945
|
+
r(qe, {
|
|
1928
1946
|
activator: "parent",
|
|
1929
1947
|
location: "bottom",
|
|
1930
1948
|
text: y(n)("common.sortable.moveDown")
|
|
@@ -1932,7 +1950,7 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
1932
1950
|
]),
|
|
1933
1951
|
_: 1
|
|
1934
1952
|
}, 8, ["disabled"]),
|
|
1935
|
-
|
|
1953
|
+
r(se, {
|
|
1936
1954
|
icon: "",
|
|
1937
1955
|
size: "small",
|
|
1938
1956
|
variant: "text",
|
|
@@ -1941,141 +1959,141 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
1941
1959
|
class: "mx-1 a-le-action a-le-action--menu"
|
|
1942
1960
|
}, {
|
|
1943
1961
|
default: u(() => [
|
|
1944
|
-
|
|
1962
|
+
r(re, {
|
|
1945
1963
|
icon: "mdi-dots-vertical",
|
|
1946
1964
|
size: "18"
|
|
1947
1965
|
}),
|
|
1948
|
-
|
|
1966
|
+
r(qe, {
|
|
1949
1967
|
activator: "parent",
|
|
1950
1968
|
location: "bottom",
|
|
1951
1969
|
text: y(n)("common.sortable.more")
|
|
1952
1970
|
}, null, 8, ["text"]),
|
|
1953
|
-
|
|
1971
|
+
r(Vt, { activator: "parent" }, {
|
|
1954
1972
|
default: u(() => [
|
|
1955
|
-
|
|
1973
|
+
r(Ct, { density: "compact" }, {
|
|
1956
1974
|
default: u(() => [
|
|
1957
|
-
|
|
1975
|
+
r(je, {
|
|
1958
1976
|
disabled: e.vi.firstInParent,
|
|
1959
|
-
onClick: c[3] || (c[3] =
|
|
1977
|
+
onClick: c[3] || (c[3] = fe((h) => e.callbacks.moveTop(e.vi.key), ["stop"]))
|
|
1960
1978
|
}, {
|
|
1961
1979
|
prepend: u(() => [
|
|
1962
|
-
|
|
1980
|
+
r(re, { icon: "mdi-arrow-collapse-up" })
|
|
1963
1981
|
]),
|
|
1964
1982
|
default: u(() => [
|
|
1965
|
-
|
|
1983
|
+
r(He, null, {
|
|
1966
1984
|
default: u(() => [
|
|
1967
|
-
|
|
1985
|
+
Q(V(y(n)("common.sortable.moveToTop")), 1)
|
|
1968
1986
|
]),
|
|
1969
1987
|
_: 1
|
|
1970
1988
|
})
|
|
1971
1989
|
]),
|
|
1972
1990
|
_: 1
|
|
1973
1991
|
}, 8, ["disabled"]),
|
|
1974
|
-
|
|
1992
|
+
r(je, {
|
|
1975
1993
|
disabled: e.vi.lastInParent,
|
|
1976
|
-
onClick: c[4] || (c[4] =
|
|
1994
|
+
onClick: c[4] || (c[4] = fe((h) => e.callbacks.moveBottom(e.vi.key), ["stop"]))
|
|
1977
1995
|
}, {
|
|
1978
1996
|
prepend: u(() => [
|
|
1979
|
-
|
|
1997
|
+
r(re, { icon: "mdi-arrow-collapse-down" })
|
|
1980
1998
|
]),
|
|
1981
1999
|
default: u(() => [
|
|
1982
|
-
|
|
2000
|
+
r(He, null, {
|
|
1983
2001
|
default: u(() => [
|
|
1984
|
-
|
|
2002
|
+
Q(V(y(n)("common.sortable.moveToBottom")), 1)
|
|
1985
2003
|
]),
|
|
1986
2004
|
_: 1
|
|
1987
2005
|
})
|
|
1988
2006
|
]),
|
|
1989
2007
|
_: 1
|
|
1990
2008
|
}, 8, ["disabled"]),
|
|
1991
|
-
e.context.showMoveToPosition && (!e.vi.firstInParent || !e.vi.lastInParent) ? (x(),
|
|
2009
|
+
e.context.showMoveToPosition && (!e.vi.firstInParent || !e.vi.lastInParent) ? (x(), te(je, {
|
|
1992
2010
|
key: 0,
|
|
1993
|
-
onClick: c[5] || (c[5] =
|
|
2011
|
+
onClick: c[5] || (c[5] = fe((h) => e.callbacks.openMoveToPosition(e.vi), ["stop"]))
|
|
1994
2012
|
}, {
|
|
1995
2013
|
prepend: u(() => [
|
|
1996
|
-
|
|
2014
|
+
r(re, { icon: "mdi-target" })
|
|
1997
2015
|
]),
|
|
1998
2016
|
default: u(() => [
|
|
1999
|
-
|
|
2017
|
+
r(He, null, {
|
|
2000
2018
|
default: u(() => [
|
|
2001
|
-
|
|
2019
|
+
Q(V(y(n)("common.sortable.moveToPosition.action")), 1)
|
|
2002
2020
|
]),
|
|
2003
2021
|
_: 1
|
|
2004
2022
|
})
|
|
2005
2023
|
]),
|
|
2006
2024
|
_: 1
|
|
2007
|
-
})) :
|
|
2008
|
-
e.context.showChangeParent ? (x(),
|
|
2025
|
+
})) : _("", !0),
|
|
2026
|
+
e.context.showChangeParent ? (x(), te(je, {
|
|
2009
2027
|
key: 1,
|
|
2010
|
-
onClick: c[6] || (c[6] =
|
|
2028
|
+
onClick: c[6] || (c[6] = fe((h) => e.callbacks.openChangeParent(e.vi), ["stop"]))
|
|
2011
2029
|
}, {
|
|
2012
2030
|
prepend: u(() => [
|
|
2013
|
-
|
|
2031
|
+
r(re, { icon: "mdi-folder-move-outline" })
|
|
2014
2032
|
]),
|
|
2015
2033
|
default: u(() => [
|
|
2016
|
-
|
|
2034
|
+
r(He, null, {
|
|
2017
2035
|
default: u(() => [
|
|
2018
|
-
|
|
2036
|
+
Q(V(y(n)("common.sortable.changeParent.action")), 1)
|
|
2019
2037
|
]),
|
|
2020
2038
|
_: 1
|
|
2021
2039
|
})
|
|
2022
2040
|
]),
|
|
2023
2041
|
_: 1
|
|
2024
|
-
})) :
|
|
2025
|
-
|
|
2042
|
+
})) : _("", !0),
|
|
2043
|
+
r(je, {
|
|
2026
2044
|
disabled: !e.vi.canIndent,
|
|
2027
|
-
onClick: c[7] || (c[7] =
|
|
2045
|
+
onClick: c[7] || (c[7] = fe((h) => e.callbacks.indent(e.vi), ["stop"]))
|
|
2028
2046
|
}, {
|
|
2029
2047
|
prepend: u(() => [
|
|
2030
|
-
|
|
2048
|
+
r(re, { icon: "mdi-format-indent-increase" })
|
|
2031
2049
|
]),
|
|
2032
2050
|
default: u(() => [
|
|
2033
|
-
|
|
2051
|
+
r(He, null, {
|
|
2034
2052
|
default: u(() => [
|
|
2035
|
-
|
|
2053
|
+
Q(V(y(n)("common.sortable.indent")), 1)
|
|
2036
2054
|
]),
|
|
2037
2055
|
_: 1
|
|
2038
2056
|
})
|
|
2039
2057
|
]),
|
|
2040
2058
|
_: 1
|
|
2041
2059
|
}, 8, ["disabled"]),
|
|
2042
|
-
|
|
2060
|
+
r(je, {
|
|
2043
2061
|
disabled: !e.vi.canOutdent,
|
|
2044
|
-
onClick: c[8] || (c[8] =
|
|
2062
|
+
onClick: c[8] || (c[8] = fe((h) => e.callbacks.outdent(e.vi), ["stop"]))
|
|
2045
2063
|
}, {
|
|
2046
2064
|
prepend: u(() => [
|
|
2047
|
-
|
|
2065
|
+
r(re, { icon: "mdi-format-indent-decrease" })
|
|
2048
2066
|
]),
|
|
2049
2067
|
default: u(() => [
|
|
2050
|
-
|
|
2068
|
+
r(He, null, {
|
|
2051
2069
|
default: u(() => [
|
|
2052
|
-
|
|
2070
|
+
Q(V(y(n)("common.sortable.outdent")), 1)
|
|
2053
2071
|
]),
|
|
2054
2072
|
_: 1
|
|
2055
2073
|
})
|
|
2056
2074
|
]),
|
|
2057
2075
|
_: 1
|
|
2058
2076
|
}, 8, ["disabled"]),
|
|
2059
|
-
e.context.showDeleteButton && e.context.canInteract ? (x(),
|
|
2077
|
+
e.context.showDeleteButton && e.context.canInteract ? (x(), te(je, {
|
|
2060
2078
|
key: 2,
|
|
2061
|
-
onClick: c[9] || (c[9] =
|
|
2079
|
+
onClick: c[9] || (c[9] = fe((h) => e.callbacks.onDeleteClick(e.vi), ["stop"]))
|
|
2062
2080
|
}, {
|
|
2063
2081
|
prepend: u(() => [
|
|
2064
|
-
|
|
2082
|
+
r(re, {
|
|
2065
2083
|
icon: "mdi-trash-can-outline",
|
|
2066
2084
|
color: "error"
|
|
2067
2085
|
})
|
|
2068
2086
|
]),
|
|
2069
2087
|
default: u(() => [
|
|
2070
|
-
|
|
2088
|
+
r(He, { class: "text-error" }, {
|
|
2071
2089
|
default: u(() => [
|
|
2072
|
-
|
|
2090
|
+
Q(V(y(n)("common.sortable.delete")), 1)
|
|
2073
2091
|
]),
|
|
2074
2092
|
_: 1
|
|
2075
2093
|
})
|
|
2076
2094
|
]),
|
|
2077
2095
|
_: 1
|
|
2078
|
-
})) :
|
|
2096
|
+
})) : _("", !0)
|
|
2079
2097
|
]),
|
|
2080
2098
|
_: 1
|
|
2081
2099
|
})
|
|
@@ -2085,8 +2103,8 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2085
2103
|
]),
|
|
2086
2104
|
_: 1
|
|
2087
2105
|
})
|
|
2088
|
-
], 64)) : (x(), N(
|
|
2089
|
-
e.context.showEditButton && e.context.canInteract ? (x(),
|
|
2106
|
+
], 64)) : (x(), N(xe, { key: 1 }, [
|
|
2107
|
+
e.context.showEditButton && e.context.canInteract ? (x(), te(se, {
|
|
2090
2108
|
key: 0,
|
|
2091
2109
|
icon: "",
|
|
2092
2110
|
size: "small",
|
|
@@ -2094,44 +2112,44 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2094
2112
|
color: "primary",
|
|
2095
2113
|
density: "comfortable",
|
|
2096
2114
|
class: "mx-1 a-le-action a-le-action--edit",
|
|
2097
|
-
onClick: c[10] || (c[10] =
|
|
2115
|
+
onClick: c[10] || (c[10] = fe((h) => e.callbacks.onEditClick(e.vi), ["stop"]))
|
|
2098
2116
|
}, {
|
|
2099
2117
|
default: u(() => [
|
|
2100
|
-
|
|
2118
|
+
r(re, {
|
|
2101
2119
|
icon: "mdi-pencil-outline",
|
|
2102
2120
|
size: "18"
|
|
2103
2121
|
}),
|
|
2104
|
-
|
|
2122
|
+
r(qe, {
|
|
2105
2123
|
activator: "parent",
|
|
2106
2124
|
location: "bottom",
|
|
2107
2125
|
text: y(n)("common.sortable.edit")
|
|
2108
2126
|
}, null, 8, ["text"])
|
|
2109
2127
|
]),
|
|
2110
2128
|
_: 1
|
|
2111
|
-
})) :
|
|
2112
|
-
e.context.showDeleteButton && e.context.canInteract ? (x(),
|
|
2129
|
+
})) : _("", !0),
|
|
2130
|
+
e.context.showDeleteButton && e.context.canInteract ? (x(), te(se, {
|
|
2113
2131
|
key: 1,
|
|
2114
2132
|
icon: "",
|
|
2115
2133
|
size: "small",
|
|
2116
2134
|
variant: "text",
|
|
2117
2135
|
density: "comfortable",
|
|
2118
2136
|
class: "mx-1 a-le-action a-le-action--delete",
|
|
2119
|
-
onClick: c[11] || (c[11] =
|
|
2137
|
+
onClick: c[11] || (c[11] = fe((h) => e.callbacks.onDeleteClick(e.vi), ["stop"]))
|
|
2120
2138
|
}, {
|
|
2121
2139
|
default: u(() => [
|
|
2122
|
-
|
|
2140
|
+
r(re, {
|
|
2123
2141
|
icon: "mdi-trash-can-outline",
|
|
2124
2142
|
size: "18"
|
|
2125
2143
|
}),
|
|
2126
|
-
|
|
2144
|
+
r(qe, {
|
|
2127
2145
|
activator: "parent",
|
|
2128
2146
|
location: "bottom",
|
|
2129
2147
|
text: y(n)("common.sortable.delete")
|
|
2130
2148
|
}, null, 8, ["text"])
|
|
2131
2149
|
]),
|
|
2132
2150
|
_: 1
|
|
2133
|
-
})) :
|
|
2134
|
-
e.context.canInteract && (e.context.showAddChildButton && e.vi.canAddChild || e.context.showAddAfterAction) ? (x(),
|
|
2151
|
+
})) : _("", !0),
|
|
2152
|
+
e.context.canInteract && (e.context.showAddChildButton && e.vi.canAddChild || e.context.showAddAfterAction) ? (x(), te(se, {
|
|
2135
2153
|
key: 2,
|
|
2136
2154
|
icon: "",
|
|
2137
2155
|
size: "small",
|
|
@@ -2141,53 +2159,53 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2141
2159
|
class: "mx-1 a-le-action a-le-action--menu"
|
|
2142
2160
|
}, {
|
|
2143
2161
|
default: u(() => [
|
|
2144
|
-
|
|
2162
|
+
r(re, {
|
|
2145
2163
|
icon: "mdi-dots-vertical",
|
|
2146
2164
|
size: "18"
|
|
2147
2165
|
}),
|
|
2148
|
-
|
|
2166
|
+
r(qe, {
|
|
2149
2167
|
activator: "parent",
|
|
2150
2168
|
location: "bottom",
|
|
2151
2169
|
text: y(n)("common.sortable.more")
|
|
2152
2170
|
}, null, 8, ["text"]),
|
|
2153
|
-
|
|
2171
|
+
r(Vt, { activator: "parent" }, {
|
|
2154
2172
|
default: u(() => [
|
|
2155
|
-
|
|
2173
|
+
r(Ct, { density: "compact" }, {
|
|
2156
2174
|
default: u(() => [
|
|
2157
|
-
e.context.showAddAfterAction ? (x(),
|
|
2175
|
+
e.context.showAddAfterAction ? (x(), te(je, {
|
|
2158
2176
|
key: 0,
|
|
2159
|
-
onClick: c[12] || (c[12] =
|
|
2177
|
+
onClick: c[12] || (c[12] = fe((h) => e.callbacks.onAddAfterClick(e.vi), ["stop"]))
|
|
2160
2178
|
}, {
|
|
2161
2179
|
prepend: u(() => [
|
|
2162
|
-
|
|
2180
|
+
r(re, { icon: "mdi-playlist-plus" })
|
|
2163
2181
|
]),
|
|
2164
2182
|
default: u(() => [
|
|
2165
|
-
|
|
2183
|
+
r(He, null, {
|
|
2166
2184
|
default: u(() => [
|
|
2167
|
-
|
|
2185
|
+
Q(V(y(n)("common.sortable.addAfter")), 1)
|
|
2168
2186
|
]),
|
|
2169
2187
|
_: 1
|
|
2170
2188
|
})
|
|
2171
2189
|
]),
|
|
2172
2190
|
_: 1
|
|
2173
|
-
})) :
|
|
2174
|
-
e.context.showAddChildButton && e.vi.canAddChild ? (x(),
|
|
2191
|
+
})) : _("", !0),
|
|
2192
|
+
e.context.showAddChildButton && e.vi.canAddChild ? (x(), te(je, {
|
|
2175
2193
|
key: 1,
|
|
2176
|
-
onClick: c[13] || (c[13] =
|
|
2194
|
+
onClick: c[13] || (c[13] = fe((h) => e.callbacks.onAddChildClick(e.vi), ["stop"]))
|
|
2177
2195
|
}, {
|
|
2178
2196
|
prepend: u(() => [
|
|
2179
|
-
|
|
2197
|
+
r(re, { icon: "mdi-subdirectory-arrow-right" })
|
|
2180
2198
|
]),
|
|
2181
2199
|
default: u(() => [
|
|
2182
|
-
|
|
2200
|
+
r(He, null, {
|
|
2183
2201
|
default: u(() => [
|
|
2184
|
-
|
|
2202
|
+
Q(V(y(n)("common.sortable.addChild")), 1)
|
|
2185
2203
|
]),
|
|
2186
2204
|
_: 1
|
|
2187
2205
|
})
|
|
2188
2206
|
]),
|
|
2189
2207
|
_: 1
|
|
2190
|
-
})) :
|
|
2208
|
+
})) : _("", !0)
|
|
2191
2209
|
]),
|
|
2192
2210
|
_: 1
|
|
2193
2211
|
})
|
|
@@ -2196,50 +2214,50 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2196
2214
|
})
|
|
2197
2215
|
]),
|
|
2198
2216
|
_: 1
|
|
2199
|
-
})) :
|
|
2217
|
+
})) : _("", !0)
|
|
2200
2218
|
], 64))
|
|
2201
2219
|
])
|
|
2202
2220
|
])
|
|
2203
2221
|
]),
|
|
2204
|
-
e.vi.editing && !e.context.reorderMode &&
|
|
2222
|
+
e.vi.editing && !e.context.reorderMode && b.$slots.item ? (x(), N(xe, { key: 0 }, [
|
|
2205
2223
|
U("div", Rl, [
|
|
2206
2224
|
U("div", Ll, [
|
|
2207
|
-
O(
|
|
2225
|
+
O(b.$slots, "item", Je(at(w())))
|
|
2208
2226
|
])
|
|
2209
2227
|
]),
|
|
2210
|
-
O(
|
|
2228
|
+
O(b.$slots, "item-footer", Je(at(w())), () => [
|
|
2211
2229
|
e.context.showInlineSaveFooter ? (x(), N("div", Vl, [
|
|
2212
2230
|
c[19] || (c[19] = U("div", { class: "a-le-row-footer-spacer" }, null, -1)),
|
|
2213
|
-
|
|
2231
|
+
r(se, {
|
|
2214
2232
|
variant: "text",
|
|
2215
2233
|
disabled: e.vi.loading,
|
|
2216
|
-
onClick: c[15] || (c[15] =
|
|
2234
|
+
onClick: c[15] || (c[15] = fe((h) => e.callbacks.onCancelClick(e.vi), ["stop"]))
|
|
2217
2235
|
}, {
|
|
2218
2236
|
default: u(() => [
|
|
2219
|
-
|
|
2237
|
+
Q(V(y(n)("common.button.cancel")), 1)
|
|
2220
2238
|
]),
|
|
2221
2239
|
_: 1
|
|
2222
2240
|
}, 8, ["disabled"]),
|
|
2223
|
-
|
|
2241
|
+
r(se, {
|
|
2224
2242
|
color: "primary",
|
|
2225
2243
|
variant: "flat",
|
|
2226
2244
|
"prepend-icon": "mdi-check",
|
|
2227
2245
|
disabled: e.vi.loading,
|
|
2228
|
-
onClick: c[16] || (c[16] =
|
|
2246
|
+
onClick: c[16] || (c[16] = fe((h) => e.callbacks.onSaveClick(e.vi), ["stop"]))
|
|
2229
2247
|
}, {
|
|
2230
2248
|
default: u(() => [
|
|
2231
|
-
|
|
2249
|
+
Q(V(y(n)("common.button.save")), 1)
|
|
2232
2250
|
]),
|
|
2233
2251
|
_: 1
|
|
2234
2252
|
}, 8, ["disabled"])
|
|
2235
|
-
])) :
|
|
2253
|
+
])) : _("", !0)
|
|
2236
2254
|
])
|
|
2237
|
-
], 64)) :
|
|
2255
|
+
], 64)) : b.$slots["item-readonly"] && (e.context.readonly || e.vi.expanded) && !e.context.reorderMode ? (x(), N("div", Ml, [
|
|
2238
2256
|
U("div", zl, [
|
|
2239
|
-
O(
|
|
2257
|
+
O(b.$slots, "item-readonly", Je(at(w())))
|
|
2240
2258
|
])
|
|
2241
|
-
])) :
|
|
2242
|
-
O(
|
|
2259
|
+
])) : _("", !0),
|
|
2260
|
+
O(b.$slots, "after-item", Je(at(w())))
|
|
2243
2261
|
], 6),
|
|
2244
2262
|
e.vi.hasChildren && e.vi.childrenExpanded ? (x(), N("div", {
|
|
2245
2263
|
key: 0,
|
|
@@ -2247,10 +2265,10 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2247
2265
|
style: wt({ "--parent-depth": e.vi.depth })
|
|
2248
2266
|
}, [
|
|
2249
2267
|
U("div", {
|
|
2250
|
-
class:
|
|
2268
|
+
class: Ue([Ol]),
|
|
2251
2269
|
"data-parent-id": String(e.vi.key)
|
|
2252
2270
|
}, [
|
|
2253
|
-
(x(!0), N(
|
|
2271
|
+
(x(!0), N(xe, null, st(E(), (h) => (x(), te(y(l), {
|
|
2254
2272
|
key: String(h.key),
|
|
2255
2273
|
vi: h,
|
|
2256
2274
|
"view-items": e.viewItems,
|
|
@@ -2258,39 +2276,39 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2258
2276
|
context: e.context,
|
|
2259
2277
|
callbacks: e.callbacks
|
|
2260
2278
|
}, {
|
|
2261
|
-
item: u((
|
|
2262
|
-
O(
|
|
2279
|
+
item: u((I) => [
|
|
2280
|
+
O(b.$slots, "item", ve({ ref_for: !0 }, I))
|
|
2263
2281
|
]),
|
|
2264
|
-
"item-compact": u((
|
|
2265
|
-
O(
|
|
2282
|
+
"item-compact": u((I) => [
|
|
2283
|
+
O(b.$slots, "item-compact", ve({ ref_for: !0 }, I))
|
|
2266
2284
|
]),
|
|
2267
|
-
"item-readonly": u((
|
|
2268
|
-
O(
|
|
2285
|
+
"item-readonly": u((I) => [
|
|
2286
|
+
O(b.$slots, "item-readonly", ve({ ref_for: !0 }, I))
|
|
2269
2287
|
]),
|
|
2270
|
-
"item-status": u((
|
|
2271
|
-
O(
|
|
2288
|
+
"item-status": u((I) => [
|
|
2289
|
+
O(b.$slots, "item-status", ve({ ref_for: !0 }, I))
|
|
2272
2290
|
]),
|
|
2273
|
-
"item-footer": u((
|
|
2274
|
-
O(
|
|
2291
|
+
"item-footer": u((I) => [
|
|
2292
|
+
O(b.$slots, "item-footer", ve({ ref_for: !0 }, I))
|
|
2275
2293
|
]),
|
|
2276
|
-
"item-actions": u((
|
|
2277
|
-
O(
|
|
2294
|
+
"item-actions": u((I) => [
|
|
2295
|
+
O(b.$slots, "item-actions", ve({ ref_for: !0 }, I))
|
|
2278
2296
|
]),
|
|
2279
|
-
"before-item": u((
|
|
2280
|
-
O(
|
|
2297
|
+
"before-item": u((I) => [
|
|
2298
|
+
O(b.$slots, "before-item", ve({ ref_for: !0 }, I))
|
|
2281
2299
|
]),
|
|
2282
|
-
"after-item": u((
|
|
2283
|
-
O(
|
|
2300
|
+
"after-item": u((I) => [
|
|
2301
|
+
O(b.$slots, "after-item", ve({ ref_for: !0 }, I))
|
|
2284
2302
|
]),
|
|
2285
2303
|
_: 3
|
|
2286
2304
|
}, 8, ["vi", "view-items", "drag-state", "context", "callbacks"]))), 128))
|
|
2287
2305
|
], 10, Nl)
|
|
2288
|
-
], 4)) :
|
|
2306
|
+
], 4)) : _("", !0)
|
|
2289
2307
|
], 42, Il));
|
|
2290
2308
|
}
|
|
2291
|
-
}), jl = { class: "text-body-medium mb-2" }, ql = /* @__PURE__ */
|
|
2309
|
+
}), jl = { class: "text-body-medium mb-2" }, ql = /* @__PURE__ */ _e({
|
|
2292
2310
|
__name: "LeChangeParentDialog",
|
|
2293
|
-
props: /* @__PURE__ */
|
|
2311
|
+
props: /* @__PURE__ */ We({
|
|
2294
2312
|
tree: {},
|
|
2295
2313
|
sourceKey: {},
|
|
2296
2314
|
keyField: {},
|
|
@@ -2301,152 +2319,152 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2301
2319
|
modelValue: { type: Boolean, required: !0 },
|
|
2302
2320
|
modelModifiers: {}
|
|
2303
2321
|
}),
|
|
2304
|
-
emits: /* @__PURE__ */
|
|
2322
|
+
emits: /* @__PURE__ */ We(["confirm"], ["update:modelValue"]),
|
|
2305
2323
|
setup(e, { emit: k }) {
|
|
2306
|
-
const l = e, n = k, i = yt(e, "modelValue"), { t:
|
|
2307
|
-
|
|
2308
|
-
|
|
2324
|
+
const l = e, n = k, i = yt(e, "modelValue"), { t: m } = lt(), w = de(void 0), E = de("last");
|
|
2325
|
+
$e(i, (s) => {
|
|
2326
|
+
s && (w.value = void 0, E.value = "last");
|
|
2309
2327
|
});
|
|
2310
|
-
const
|
|
2311
|
-
const
|
|
2312
|
-
if (l.sourceKey === null) return
|
|
2328
|
+
const b = S(() => {
|
|
2329
|
+
const s = /* @__PURE__ */ new Set();
|
|
2330
|
+
if (l.sourceKey === null) return s;
|
|
2313
2331
|
const f = (T) => {
|
|
2314
2332
|
for (const P of T) {
|
|
2315
2333
|
if (P.data[l.keyField] === l.sourceKey) {
|
|
2316
|
-
const
|
|
2317
|
-
for (const le of
|
|
2318
|
-
|
|
2334
|
+
const ce = (ne) => {
|
|
2335
|
+
for (const le of ne)
|
|
2336
|
+
s.add(le.data[l.keyField]), le.children?.length && ce(le.children);
|
|
2319
2337
|
};
|
|
2320
|
-
return P.children?.length &&
|
|
2338
|
+
return P.children?.length && ce(P.children), !0;
|
|
2321
2339
|
}
|
|
2322
2340
|
if (P.children?.length && f(P.children)) return !0;
|
|
2323
2341
|
}
|
|
2324
2342
|
return !1;
|
|
2325
2343
|
};
|
|
2326
|
-
return f(l.tree.children),
|
|
2327
|
-
}), c =
|
|
2344
|
+
return f(l.tree.children), s;
|
|
2345
|
+
}), c = S(() => {
|
|
2328
2346
|
if (l.sourceKey === null) return null;
|
|
2329
|
-
const
|
|
2347
|
+
const s = (f) => {
|
|
2330
2348
|
for (const T of f) {
|
|
2331
2349
|
if (T.data[l.keyField] === l.sourceKey) return T;
|
|
2332
2350
|
if (T.children?.length) {
|
|
2333
|
-
const P =
|
|
2351
|
+
const P = s(T.children);
|
|
2334
2352
|
if (P) return P;
|
|
2335
2353
|
}
|
|
2336
2354
|
}
|
|
2337
2355
|
return null;
|
|
2338
2356
|
};
|
|
2339
|
-
return
|
|
2340
|
-
}), h =
|
|
2357
|
+
return s(l.tree.children);
|
|
2358
|
+
}), h = S(() => {
|
|
2341
2359
|
if (l.sourceKey === null) return;
|
|
2342
|
-
const
|
|
2360
|
+
const s = (f, T) => {
|
|
2343
2361
|
for (const P of f) {
|
|
2344
2362
|
if (P.data[l.keyField] === l.sourceKey) return T;
|
|
2345
2363
|
if (P.children?.length) {
|
|
2346
|
-
const
|
|
2347
|
-
if (
|
|
2364
|
+
const Y = s(P.children, P.data[l.keyField]);
|
|
2365
|
+
if (Y !== void 0) return Y;
|
|
2348
2366
|
}
|
|
2349
2367
|
}
|
|
2350
2368
|
};
|
|
2351
|
-
return
|
|
2352
|
-
}),
|
|
2353
|
-
const
|
|
2354
|
-
|
|
2369
|
+
return s(l.tree.children, null);
|
|
2370
|
+
}), I = S(() => {
|
|
2371
|
+
const s = [], f = c.value ? l.calculateSubtreeDepth(c.value) : 1;
|
|
2372
|
+
s.push({
|
|
2355
2373
|
key: null,
|
|
2356
2374
|
depth: 0,
|
|
2357
|
-
label:
|
|
2375
|
+
label: m("common.sortable.changeParent.rootLabel"),
|
|
2358
2376
|
hasChildren: l.tree.children.length > 0,
|
|
2359
2377
|
disallowed: h.value === null,
|
|
2360
2378
|
reason: h.value === null ? "currentParent" : null
|
|
2361
2379
|
});
|
|
2362
|
-
const T = (P,
|
|
2363
|
-
for (const
|
|
2364
|
-
const
|
|
2365
|
-
let le = !1,
|
|
2366
|
-
|
|
2367
|
-
key:
|
|
2368
|
-
depth:
|
|
2369
|
-
label: l.resolveLabel(
|
|
2370
|
-
hasChildren: !!(
|
|
2380
|
+
const T = (P, Y) => {
|
|
2381
|
+
for (const ce of P) {
|
|
2382
|
+
const ne = ce.data[l.keyField];
|
|
2383
|
+
let le = !1, ie = null;
|
|
2384
|
+
ne === l.sourceKey ? (le = !0, ie = "self") : b.value.has(ne) ? (le = !0, ie = "descendant") : h.value !== void 0 && h.value === ne ? (le = !0, ie = "currentParent") : Y + 1 + f > l.maxDepth && (le = !0, ie = "maxDepth"), s.push({
|
|
2385
|
+
key: ne,
|
|
2386
|
+
depth: Y + 1,
|
|
2387
|
+
label: l.resolveLabel(ce.data, ne),
|
|
2388
|
+
hasChildren: !!(ce.children && ce.children.length > 0),
|
|
2371
2389
|
disallowed: le,
|
|
2372
|
-
reason:
|
|
2373
|
-
}),
|
|
2390
|
+
reason: ie
|
|
2391
|
+
}), ce.children?.length && T(ce.children, Y + 1);
|
|
2374
2392
|
}
|
|
2375
2393
|
};
|
|
2376
|
-
return T(l.tree.children, 0),
|
|
2377
|
-
}), j =
|
|
2378
|
-
() => w.value === void 0 ? null :
|
|
2379
|
-
),
|
|
2394
|
+
return T(l.tree.children, 0), s;
|
|
2395
|
+
}), j = S(() => I.value.filter((s) => !s.disallowed)), M = S(
|
|
2396
|
+
() => w.value === void 0 ? null : I.value.find((s) => s.key === w.value) ?? null
|
|
2397
|
+
), g = S(
|
|
2380
2398
|
() => !!M.value && M.value.hasChildren
|
|
2381
|
-
), z = (
|
|
2382
|
-
|
|
2399
|
+
), z = (s) => {
|
|
2400
|
+
s.disallowed || (w.value = s.key);
|
|
2383
2401
|
}, q = () => {
|
|
2384
|
-
M.value && (n("confirm", M.value.key,
|
|
2385
|
-
},
|
|
2402
|
+
M.value && (n("confirm", M.value.key, E.value), i.value = !1);
|
|
2403
|
+
}, B = () => {
|
|
2386
2404
|
i.value = !1;
|
|
2387
|
-
},
|
|
2388
|
-
return (
|
|
2405
|
+
}, X = (s) => `${s * 16}px`, D = (s) => s === "maxDepth" ? m("common.sortable.changeParent.errorMaxDepth") : "";
|
|
2406
|
+
return (s, f) => (x(), te(an, {
|
|
2389
2407
|
modelValue: i.value,
|
|
2390
2408
|
"onUpdate:modelValue": f[1] || (f[1] = (T) => i.value = T),
|
|
2391
2409
|
"max-width": "540",
|
|
2392
2410
|
persistent: ""
|
|
2393
2411
|
}, {
|
|
2394
2412
|
default: u(() => [
|
|
2395
|
-
|
|
2413
|
+
r(nn, null, {
|
|
2396
2414
|
default: u(() => [
|
|
2397
|
-
|
|
2415
|
+
r(la, null, {
|
|
2398
2416
|
default: u(() => [
|
|
2399
|
-
|
|
2417
|
+
Q(V(y(m)("common.sortable.changeParent.title")), 1)
|
|
2400
2418
|
]),
|
|
2401
2419
|
_: 1
|
|
2402
2420
|
}),
|
|
2403
|
-
j.value.length === 0 ? (x(),
|
|
2421
|
+
j.value.length === 0 ? (x(), te(Kt, {
|
|
2404
2422
|
key: 0,
|
|
2405
2423
|
class: "text-body-medium"
|
|
2406
2424
|
}, {
|
|
2407
2425
|
default: u(() => [
|
|
2408
|
-
|
|
2426
|
+
r(ln, {
|
|
2409
2427
|
type: "info",
|
|
2410
2428
|
variant: "tonal",
|
|
2411
2429
|
density: "compact"
|
|
2412
2430
|
}, {
|
|
2413
2431
|
default: u(() => [
|
|
2414
|
-
U("strong", null,
|
|
2415
|
-
U("div", null,
|
|
2432
|
+
U("strong", null, V(y(m)("common.sortable.changeParent.noTargetsTitle")), 1),
|
|
2433
|
+
U("div", null, V(y(m)("common.sortable.changeParent.noTargetsText")), 1)
|
|
2416
2434
|
]),
|
|
2417
2435
|
_: 1
|
|
2418
2436
|
})
|
|
2419
2437
|
]),
|
|
2420
2438
|
_: 1
|
|
2421
|
-
})) : (x(), N(
|
|
2422
|
-
|
|
2439
|
+
})) : (x(), N(xe, { key: 1 }, [
|
|
2440
|
+
r(Kt, { class: "pb-1" }, {
|
|
2423
2441
|
default: u(() => [
|
|
2424
|
-
|
|
2442
|
+
r(Ct, {
|
|
2425
2443
|
density: "compact",
|
|
2426
2444
|
class: "le-change-parent__list"
|
|
2427
2445
|
}, {
|
|
2428
2446
|
default: u(() => [
|
|
2429
|
-
(x(!0), N(
|
|
2447
|
+
(x(!0), N(xe, null, st(I.value, (T) => (x(), te(je, {
|
|
2430
2448
|
key: T.key === null ? "__root__" : String(T.key),
|
|
2431
2449
|
disabled: T.disallowed,
|
|
2432
2450
|
active: w.value === T.key,
|
|
2433
2451
|
title: T.label,
|
|
2434
|
-
subtitle:
|
|
2435
|
-
style: wt({ paddingInlineStart:
|
|
2452
|
+
subtitle: D(T.reason),
|
|
2453
|
+
style: wt({ paddingInlineStart: X(T.depth) }),
|
|
2436
2454
|
"data-disallowed": T.disallowed ? "true" : "false",
|
|
2437
2455
|
"data-reason": T.reason ?? "",
|
|
2438
2456
|
onClick: (P) => z(T)
|
|
2439
2457
|
}, {
|
|
2440
2458
|
prepend: u(() => [
|
|
2441
|
-
T.key === null ? (x(),
|
|
2459
|
+
T.key === null ? (x(), te(re, {
|
|
2442
2460
|
key: 0,
|
|
2443
2461
|
icon: "mdi-folder-home-outline",
|
|
2444
2462
|
size: "18"
|
|
2445
|
-
})) : T.hasChildren ? (x(),
|
|
2463
|
+
})) : T.hasChildren ? (x(), te(re, {
|
|
2446
2464
|
key: 1,
|
|
2447
2465
|
icon: "mdi-folder-outline",
|
|
2448
2466
|
size: "18"
|
|
2449
|
-
})) : (x(),
|
|
2467
|
+
})) : (x(), te(re, {
|
|
2450
2468
|
key: 2,
|
|
2451
2469
|
icon: "mdi-file-outline",
|
|
2452
2470
|
size: "18"
|
|
@@ -2460,56 +2478,56 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2460
2478
|
]),
|
|
2461
2479
|
_: 1
|
|
2462
2480
|
}),
|
|
2463
|
-
|
|
2481
|
+
g.value ? (x(), te(Kt, {
|
|
2464
2482
|
key: 0,
|
|
2465
2483
|
class: "pt-0"
|
|
2466
2484
|
}, {
|
|
2467
2485
|
default: u(() => [
|
|
2468
|
-
U("div", jl,
|
|
2486
|
+
U("div", jl, V(y(m)("common.sortable.changeParent.placementHeading", {
|
|
2469
2487
|
label: M.value?.label ?? ""
|
|
2470
2488
|
})), 1),
|
|
2471
|
-
|
|
2472
|
-
modelValue:
|
|
2473
|
-
"onUpdate:modelValue": f[0] || (f[0] = (T) =>
|
|
2489
|
+
r(Po, {
|
|
2490
|
+
modelValue: E.value,
|
|
2491
|
+
"onUpdate:modelValue": f[0] || (f[0] = (T) => E.value = T),
|
|
2474
2492
|
density: "compact",
|
|
2475
2493
|
"hide-details": ""
|
|
2476
2494
|
}, {
|
|
2477
2495
|
default: u(() => [
|
|
2478
|
-
|
|
2496
|
+
r(kn, {
|
|
2479
2497
|
value: "first",
|
|
2480
|
-
label: y(
|
|
2498
|
+
label: y(m)("common.sortable.changeParent.placeFirst")
|
|
2481
2499
|
}, null, 8, ["label"]),
|
|
2482
|
-
|
|
2500
|
+
r(kn, {
|
|
2483
2501
|
value: "last",
|
|
2484
|
-
label: y(
|
|
2502
|
+
label: y(m)("common.sortable.changeParent.placeLast")
|
|
2485
2503
|
}, null, 8, ["label"])
|
|
2486
2504
|
]),
|
|
2487
2505
|
_: 1
|
|
2488
2506
|
}, 8, ["modelValue"])
|
|
2489
2507
|
]),
|
|
2490
2508
|
_: 1
|
|
2491
|
-
})) :
|
|
2509
|
+
})) : _("", !0)
|
|
2492
2510
|
], 64)),
|
|
2493
|
-
|
|
2511
|
+
r(ia, null, {
|
|
2494
2512
|
default: u(() => [
|
|
2495
|
-
|
|
2496
|
-
|
|
2513
|
+
r(on),
|
|
2514
|
+
r(se, {
|
|
2497
2515
|
variant: "text",
|
|
2498
|
-
onClick:
|
|
2516
|
+
onClick: B
|
|
2499
2517
|
}, {
|
|
2500
2518
|
default: u(() => [
|
|
2501
|
-
|
|
2519
|
+
Q(V(y(m)("common.sortable.reorderCancel")), 1)
|
|
2502
2520
|
]),
|
|
2503
2521
|
_: 1
|
|
2504
2522
|
}),
|
|
2505
|
-
|
|
2523
|
+
r(se, {
|
|
2506
2524
|
color: "primary",
|
|
2507
2525
|
variant: "elevated",
|
|
2508
2526
|
disabled: !M.value || M.value.disallowed,
|
|
2509
2527
|
onClick: q
|
|
2510
2528
|
}, {
|
|
2511
2529
|
default: u(() => [
|
|
2512
|
-
|
|
2530
|
+
Q(V(y(m)("common.sortable.changeParent.confirm")), 1)
|
|
2513
2531
|
]),
|
|
2514
2532
|
_: 1
|
|
2515
2533
|
}, 8, ["disabled"])
|
|
@@ -2542,9 +2560,9 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2542
2560
|
class: "a-le-sr-only",
|
|
2543
2561
|
"aria-live": "polite",
|
|
2544
2562
|
role: "status"
|
|
2545
|
-
}, wn = "a-nested-list-editor__group", ei = "a-le-drag-handle", Cn = 24, xn = 22, Mi = /* @__PURE__ */
|
|
2563
|
+
}, wn = "a-nested-list-editor__group", ei = "a-le-drag-handle", Cn = 24, xn = 22, Mi = /* @__PURE__ */ _e({
|
|
2546
2564
|
__name: "ANestedSortableListEditor",
|
|
2547
|
-
props: /* @__PURE__ */
|
|
2565
|
+
props: /* @__PURE__ */ We({
|
|
2548
2566
|
maxDepth: {},
|
|
2549
2567
|
factory: { type: Function, default: void 0 },
|
|
2550
2568
|
getKey: { type: [String, Function], default: void 0 },
|
|
@@ -2590,22 +2608,22 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2590
2608
|
mode: { default: "view" },
|
|
2591
2609
|
modeModifiers: {}
|
|
2592
2610
|
}),
|
|
2593
|
-
emits: /* @__PURE__ */
|
|
2611
|
+
emits: /* @__PURE__ */ We(["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"]),
|
|
2594
2612
|
setup(e, { expose: k, emit: l }) {
|
|
2595
|
-
const n = e, i = l,
|
|
2613
|
+
const n = e, i = l, m = yt(e, "modelValue"), w = yt(e, "mode"), { t: E } = lt(), b = ea(), { showWarningT: c } = jn(), h = Lt("rootEl"), { isNarrow: I } = lo(h), j = io(), M = S(() => n.closeVariant === "icon" ? "icon" : n.closeVariant === "labeled" ? "labeled" : I.value ? "icon" : "labeled"), g = de(/* @__PURE__ */ new Set()), z = de(/* @__PURE__ */ new Set()), q = n.getKey ?? "id", B = typeof q == "function" ? "id" : q, X = (t) => typeof q == "function" ? q(t) : t[q], D = (() => {
|
|
2596
2614
|
const t = n.position;
|
|
2597
2615
|
return t === void 0 || t === !1 ? "position" : typeof t == "object" ? t.field : t;
|
|
2598
2616
|
})();
|
|
2599
2617
|
((t) => {
|
|
2600
2618
|
const d = (o) => {
|
|
2601
2619
|
for (const R of o)
|
|
2602
|
-
R.children && R.children.length > 0 && (
|
|
2620
|
+
R.children && R.children.length > 0 && (g.value.add(X(R.data)), d(R.children));
|
|
2603
2621
|
};
|
|
2604
2622
|
d(t.children);
|
|
2605
|
-
})(
|
|
2623
|
+
})(m.value);
|
|
2606
2624
|
const f = n.editor ?? Cl({
|
|
2607
|
-
get: () =>
|
|
2608
|
-
set: (t) =>
|
|
2625
|
+
get: () => m.value,
|
|
2626
|
+
set: (t) => m.value = t,
|
|
2609
2627
|
factory: n.factory,
|
|
2610
2628
|
getKey: n.getKey,
|
|
2611
2629
|
position: n.position,
|
|
@@ -2613,95 +2631,95 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2613
2631
|
maxDepth: n.maxDepth,
|
|
2614
2632
|
dirtyExclude: () => n.dirtyExclude ?? [],
|
|
2615
2633
|
validate: n.validate
|
|
2616
|
-
}), T =
|
|
2634
|
+
}), T = S(() => {
|
|
2617
2635
|
const t = [];
|
|
2618
2636
|
let d = 0;
|
|
2619
|
-
const o = n.maxDepth, R = (
|
|
2620
|
-
for (let
|
|
2621
|
-
const Ke =
|
|
2637
|
+
const o = n.maxDepth, R = (oe, ke, Ne) => {
|
|
2638
|
+
for (let Ee = 0; Ee < oe.length; Ee++) {
|
|
2639
|
+
const Ke = oe[Ee], it = X(Ke.data), ge = Ke.children !== void 0, vt = ge && (Ke.children?.length ?? 0) > 0, Et = Ke.children?.length ?? 0, bt = o - (ke + 1);
|
|
2622
2640
|
t.push({
|
|
2623
|
-
key:
|
|
2641
|
+
key: it,
|
|
2624
2642
|
index: d++,
|
|
2625
2643
|
raw: Ke.data,
|
|
2626
|
-
position: Ke.data[
|
|
2644
|
+
position: Ke.data[D],
|
|
2627
2645
|
node: Ke,
|
|
2628
|
-
depth:
|
|
2629
|
-
parent:
|
|
2630
|
-
parentKey:
|
|
2631
|
-
childrenCount:
|
|
2646
|
+
depth: ke,
|
|
2647
|
+
parent: Ne?.data ?? null,
|
|
2648
|
+
parentKey: Ne ? X(Ne.data) : null,
|
|
2649
|
+
childrenCount: Et,
|
|
2632
2650
|
hasChildren: vt,
|
|
2633
|
-
childrenAllowed:
|
|
2634
|
-
siblingIndex:
|
|
2635
|
-
siblingCount:
|
|
2636
|
-
firstInParent:
|
|
2637
|
-
lastInParent:
|
|
2638
|
-
canAddChild:
|
|
2639
|
-
canIndent:
|
|
2640
|
-
canOutdent:
|
|
2641
|
-
}), vt && R(Ke.children,
|
|
2651
|
+
childrenAllowed: ge,
|
|
2652
|
+
siblingIndex: Ee,
|
|
2653
|
+
siblingCount: oe.length,
|
|
2654
|
+
firstInParent: Ee === 0,
|
|
2655
|
+
lastInParent: Ee === oe.length - 1,
|
|
2656
|
+
canAddChild: ge && bt > 0,
|
|
2657
|
+
canIndent: Ee > 0,
|
|
2658
|
+
canOutdent: ke > 0
|
|
2659
|
+
}), vt && R(Ke.children, ke + 1, Ke);
|
|
2642
2660
|
}
|
|
2643
2661
|
};
|
|
2644
|
-
return R(
|
|
2645
|
-
}), P = Zt(null),
|
|
2646
|
-
f.commit(),
|
|
2647
|
-
},
|
|
2662
|
+
return R(m.value.children, 0, null), t;
|
|
2663
|
+
}), P = Zt(null), Y = de(/* @__PURE__ */ new Set()), ce = () => {
|
|
2664
|
+
f.commit(), Y.value = /* @__PURE__ */ new Set();
|
|
2665
|
+
}, ne = (t) => {
|
|
2648
2666
|
const { node: d } = f.findNode(t);
|
|
2649
2667
|
if (!d) {
|
|
2650
|
-
|
|
2668
|
+
Y.value.add(t);
|
|
2651
2669
|
return;
|
|
2652
2670
|
}
|
|
2653
2671
|
const o = (R) => {
|
|
2654
|
-
|
|
2672
|
+
Y.value.add(X(R.data)), R.children && R.children.forEach(o);
|
|
2655
2673
|
};
|
|
2656
2674
|
o(d);
|
|
2657
|
-
}, le = /* @__PURE__ */ new Map(),
|
|
2675
|
+
}, le = /* @__PURE__ */ new Map(), ie = S(() => {
|
|
2658
2676
|
const t = [], d = /* @__PURE__ */ new Set();
|
|
2659
2677
|
for (const o of T.value) {
|
|
2660
2678
|
d.add(o.key);
|
|
2661
|
-
const R =
|
|
2662
|
-
if (
|
|
2663
|
-
t.push(
|
|
2679
|
+
const R = ue.value.has(o.key), oe = z.value.has(o.key), ke = g.value.has(o.key), Ne = n.loadingKeys?.has(o.key) ?? !1, Ee = Y.value.has(o.key), Ke = n.readonly ? !1 : f.isUnsaved(o.key), it = n.readonly ? !1 : Ke || Ee, ge = le.get(o.key);
|
|
2680
|
+
if (ge && ge.raw === o.raw && ge.index === o.index && ge.position === o.position && ge.depth === o.depth && ge.parentKey === o.parentKey && ge.childrenCount === o.childrenCount && ge.firstInParent === o.firstInParent && ge.lastInParent === o.lastInParent && ge.editing === R && ge.expanded === oe && ge.childrenExpanded === ke && ge.loading === Ne && ge.dirty === Ke && ge.moved === Ee && ge.unsaved === it) {
|
|
2681
|
+
t.push(ge);
|
|
2664
2682
|
continue;
|
|
2665
2683
|
}
|
|
2666
2684
|
const vt = {
|
|
2667
2685
|
...o,
|
|
2668
2686
|
editing: R,
|
|
2669
|
-
expanded:
|
|
2670
|
-
childrenExpanded:
|
|
2671
|
-
loading:
|
|
2687
|
+
expanded: oe,
|
|
2688
|
+
childrenExpanded: ke,
|
|
2689
|
+
loading: Ne,
|
|
2672
2690
|
dirty: Ke,
|
|
2673
|
-
moved:
|
|
2674
|
-
unsaved:
|
|
2691
|
+
moved: Ee,
|
|
2692
|
+
unsaved: it
|
|
2675
2693
|
};
|
|
2676
2694
|
le.set(o.key, vt), t.push(vt);
|
|
2677
2695
|
}
|
|
2678
2696
|
for (const o of le.keys())
|
|
2679
2697
|
d.has(o) || le.delete(o);
|
|
2680
2698
|
return t;
|
|
2681
|
-
}),
|
|
2699
|
+
}), Re = S(() => m.value.children.length === 0), $ = S(() => T.value.length), v = Lt("rowsContainer"), C = S(() => !n.readonly && !n.disabled && !n.loading), F = S(
|
|
2682
2700
|
() => C.value && !n.disableReorder && $.value > 1
|
|
2683
|
-
),
|
|
2684
|
-
editingKeys:
|
|
2685
|
-
editingSnapshots:
|
|
2686
|
-
clearEditing:
|
|
2687
|
-
beginEdit:
|
|
2688
|
-
cancelEdit:
|
|
2689
|
-
commitEdit:
|
|
2690
|
-
closeEdit:
|
|
2691
|
-
requestAutoOpen:
|
|
2701
|
+
), K = S(() => !!b.item), J = S(() => !!b["item-readonly"]), ee = S(() => !!n.onItemSave), {
|
|
2702
|
+
editingKeys: ue,
|
|
2703
|
+
editingSnapshots: ae,
|
|
2704
|
+
clearEditing: me,
|
|
2705
|
+
beginEdit: Se,
|
|
2706
|
+
cancelEdit: we,
|
|
2707
|
+
commitEdit: Le,
|
|
2708
|
+
closeEdit: Ge,
|
|
2709
|
+
requestAutoOpen: Pe
|
|
2692
2710
|
} = qn({
|
|
2693
|
-
rowsContainer:
|
|
2711
|
+
rowsContainer: v,
|
|
2694
2712
|
rowSelector: ".a-le-row-wrapper",
|
|
2695
|
-
isInlineEdit:
|
|
2713
|
+
isInlineEdit: K,
|
|
2696
2714
|
// markDirty=false: restoring the pre-edit snapshot on cancel must not flag the
|
|
2697
2715
|
// node dirty (it would otherwise be resent by partial-multi saves).
|
|
2698
2716
|
restoreSnapshot: (t, d) => f.updateItem(t, d, !1),
|
|
2699
2717
|
watchKeys: () => {
|
|
2700
2718
|
const t = [], d = (o) => {
|
|
2701
2719
|
for (const R of o)
|
|
2702
|
-
t.push(
|
|
2720
|
+
t.push(X(R.data)), R.children && R.children.length && d(R.children);
|
|
2703
2721
|
};
|
|
2704
|
-
return d(
|
|
2722
|
+
return d(m.value.children), t;
|
|
2705
2723
|
},
|
|
2706
2724
|
findEntry: (t) => {
|
|
2707
2725
|
const { node: d } = f.findNode(t);
|
|
@@ -2709,42 +2727,42 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2709
2727
|
},
|
|
2710
2728
|
afterAutoOpen: (t) => {
|
|
2711
2729
|
const { parent: d } = f.findNode(t);
|
|
2712
|
-
d &&
|
|
2730
|
+
d && g.value.add(X(d.data));
|
|
2713
2731
|
}
|
|
2714
2732
|
}), {
|
|
2715
|
-
applying:
|
|
2716
|
-
applyError:
|
|
2717
|
-
hasPendingChanges:
|
|
2718
|
-
movedCount:
|
|
2719
|
-
reorderMode:
|
|
2720
|
-
enterReorderMode:
|
|
2721
|
-
cancelReorderMode:
|
|
2722
|
-
applyReorder:
|
|
2723
|
-
} =
|
|
2733
|
+
applying: Ae,
|
|
2734
|
+
applyError: Oe,
|
|
2735
|
+
hasPendingChanges: Ve,
|
|
2736
|
+
movedCount: et,
|
|
2737
|
+
reorderMode: Me,
|
|
2738
|
+
enterReorderMode: Xe,
|
|
2739
|
+
cancelReorderMode: tt,
|
|
2740
|
+
applyReorder: rt
|
|
2741
|
+
} = so({
|
|
2724
2742
|
mode: w,
|
|
2725
2743
|
snapshot: P,
|
|
2726
|
-
movedKeys:
|
|
2727
|
-
modelValue:
|
|
2744
|
+
movedKeys: Y,
|
|
2745
|
+
modelValue: m,
|
|
2728
2746
|
cloneModel: (t) => Be(t),
|
|
2729
2747
|
applyModel: (t) => {
|
|
2730
|
-
|
|
2748
|
+
m.value = t;
|
|
2731
2749
|
},
|
|
2732
2750
|
canEnterReorder: F,
|
|
2733
2751
|
onEnter: () => {
|
|
2734
|
-
|
|
2735
|
-
for (const t of
|
|
2736
|
-
|
|
2737
|
-
|
|
2752
|
+
me();
|
|
2753
|
+
for (const t of ye.value) g.value.add(t);
|
|
2754
|
+
Qe(() => {
|
|
2755
|
+
A.value && ut();
|
|
2738
2756
|
});
|
|
2739
2757
|
},
|
|
2740
2758
|
onExternalEnter: () => {
|
|
2741
|
-
|
|
2759
|
+
me();
|
|
2742
2760
|
},
|
|
2743
2761
|
onCancel: () => {
|
|
2744
|
-
|
|
2762
|
+
ze();
|
|
2745
2763
|
},
|
|
2746
2764
|
onApplyEnd: () => {
|
|
2747
|
-
|
|
2765
|
+
ze();
|
|
2748
2766
|
},
|
|
2749
2767
|
onReorderApply: (t) => n.onReorderApply?.(t),
|
|
2750
2768
|
emit: {
|
|
@@ -2754,60 +2772,60 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2754
2772
|
reorderApplyError: (t) => i("reorder-apply-error", t),
|
|
2755
2773
|
reorderEnd: () => i("reorder-end")
|
|
2756
2774
|
}
|
|
2757
|
-
}),
|
|
2758
|
-
() => n.addLabel ?
|
|
2759
|
-
),
|
|
2760
|
-
() => n.deleteConfirmTitle ??
|
|
2761
|
-
),
|
|
2762
|
-
() => n.deleteConfirmText ??
|
|
2763
|
-
),
|
|
2764
|
-
() => !n.readonly && n.showReorderToggle && !
|
|
2765
|
-
),
|
|
2775
|
+
}), dt = S(() => C.value && n.showAddButton && !Me.value), A = S(() => Me.value && !j.value && !n.disableDrag), L = S(
|
|
2776
|
+
() => n.addLabel ? E(n.addLabel) : E("common.sortable.add")
|
|
2777
|
+
), G = S(() => n.emptyTitle ?? E("common.sortable.emptyTitle")), W = S(
|
|
2778
|
+
() => n.deleteConfirmTitle ?? E("common.sortable.deleteConfirmTitle")
|
|
2779
|
+
), Z = S(
|
|
2780
|
+
() => n.deleteConfirmText ?? E("common.sortable.deleteConfirmText")
|
|
2781
|
+
), pe = S(
|
|
2782
|
+
() => !n.readonly && n.showReorderToggle && !Me.value && $.value > 0
|
|
2783
|
+
), Ce = S(() => !!n.title && I.value), ye = S(() => {
|
|
2766
2784
|
const t = [], d = (o) => {
|
|
2767
2785
|
for (const R of o)
|
|
2768
|
-
R.children && R.children.length > 0 && (t.push(
|
|
2786
|
+
R.children && R.children.length > 0 && (t.push(X(R.data)), d(R.children));
|
|
2769
2787
|
};
|
|
2770
|
-
return d(
|
|
2771
|
-
}),
|
|
2772
|
-
() =>
|
|
2773
|
-
), a =
|
|
2774
|
-
() => !
|
|
2775
|
-
),
|
|
2776
|
-
if (
|
|
2777
|
-
for (const t of
|
|
2788
|
+
return d(m.value.children), t;
|
|
2789
|
+
}), be = S(
|
|
2790
|
+
() => ye.value.length > 0 && ye.value.every((t) => g.value.has(t))
|
|
2791
|
+
), a = S(
|
|
2792
|
+
() => !Me.value && ye.value.length > 0
|
|
2793
|
+
), H = () => {
|
|
2794
|
+
if (be.value)
|
|
2795
|
+
for (const t of ye.value) g.value.delete(t);
|
|
2778
2796
|
else
|
|
2779
|
-
for (const t of
|
|
2780
|
-
},
|
|
2781
|
-
() => !!(n.title ||
|
|
2782
|
-
),
|
|
2783
|
-
for (const t of
|
|
2797
|
+
for (const t of ye.value) g.value.add(t);
|
|
2798
|
+
}, p = S(
|
|
2799
|
+
() => !!(n.title || b.header || b["reorder-toggle"] || pe.value || a.value || Me.value)
|
|
2800
|
+
), he = de([]), Ye = de(0), ze = () => {
|
|
2801
|
+
for (const t of he.value)
|
|
2784
2802
|
try {
|
|
2785
2803
|
t.stop();
|
|
2786
2804
|
} catch {
|
|
2787
2805
|
}
|
|
2788
|
-
|
|
2789
|
-
}, Te =
|
|
2806
|
+
he.value = [];
|
|
2807
|
+
}, Te = de(null), xt = (t, d) => {
|
|
2790
2808
|
const o = document.elementFromPoint(t, d);
|
|
2791
2809
|
if (!o) return null;
|
|
2792
2810
|
const R = o.closest(".a-le-row-wrapper");
|
|
2793
|
-
if (!R || !
|
|
2794
|
-
const
|
|
2795
|
-
if (
|
|
2796
|
-
const
|
|
2797
|
-
return
|
|
2811
|
+
if (!R || !v.value || !v.value.contains(R)) return null;
|
|
2812
|
+
const oe = sn(R.getAttribute("data-id"));
|
|
2813
|
+
if (oe === null) return null;
|
|
2814
|
+
const ke = ie.value.find((Ne) => Ne.key === oe);
|
|
2815
|
+
return ke ? { el: R, viewItem: ke } : null;
|
|
2798
2816
|
}, ct = (t, d) => {
|
|
2799
|
-
if (!Te.value || !
|
|
2817
|
+
if (!Te.value || !v.value) return;
|
|
2800
2818
|
const o = xt(t, d);
|
|
2801
2819
|
if (!o) {
|
|
2802
2820
|
Te.value.instruction = null;
|
|
2803
2821
|
return;
|
|
2804
2822
|
}
|
|
2805
|
-
const R =
|
|
2806
|
-
Te.value.instruction =
|
|
2823
|
+
const R = v.value.getBoundingClientRect(), ke = (o.el.querySelector(":scope > .a-le-row") ?? o.el).getBoundingClientRect();
|
|
2824
|
+
Te.value.instruction = Al({
|
|
2807
2825
|
pointer: { x: t, y: d },
|
|
2808
2826
|
hoveredRow: {
|
|
2809
2827
|
key: o.viewItem.key,
|
|
2810
|
-
rect:
|
|
2828
|
+
rect: ke,
|
|
2811
2829
|
depth: o.viewItem.depth,
|
|
2812
2830
|
parentKey: o.viewItem.parentKey,
|
|
2813
2831
|
siblingIndex: o.viewItem.siblingIndex,
|
|
@@ -2815,7 +2833,7 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2815
2833
|
},
|
|
2816
2834
|
sourceKey: Te.value.sourceKey,
|
|
2817
2835
|
sourceSubtreeDepth: Te.value.sourceSubtreeDepth,
|
|
2818
|
-
viewItems:
|
|
2836
|
+
viewItems: ie.value,
|
|
2819
2837
|
maxDepth: n.maxDepth,
|
|
2820
2838
|
indentPx: Cn,
|
|
2821
2839
|
containerLeft: R.left,
|
|
@@ -2823,15 +2841,15 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2823
2841
|
});
|
|
2824
2842
|
}, Fe = (t) => {
|
|
2825
2843
|
ct(t.clientX, t.clientY);
|
|
2826
|
-
},
|
|
2844
|
+
}, St = (t, d) => {
|
|
2827
2845
|
if (!f.moveTo(d, t.parentKey, t.index)) {
|
|
2828
|
-
c("common.sortable.error.maxDeepExceed"),
|
|
2846
|
+
c("common.sortable.error.maxDeepExceed"), Ye.value++, Qe(() => ut());
|
|
2829
2847
|
return;
|
|
2830
2848
|
}
|
|
2831
|
-
|
|
2849
|
+
ne(d), t.makeChild && t.parentKey !== null && g.value.add(t.parentKey);
|
|
2832
2850
|
}, ut = () => {
|
|
2833
|
-
if (
|
|
2834
|
-
const t = Array.from(
|
|
2851
|
+
if (ze(), !A.value || !v.value) return;
|
|
2852
|
+
const t = Array.from(v.value.querySelectorAll("." + wn));
|
|
2835
2853
|
for (const d of t) {
|
|
2836
2854
|
const o = uo(d, [], {
|
|
2837
2855
|
group: { name: "a-nested", pull: !0, put: !0 },
|
|
@@ -2844,23 +2862,23 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2844
2862
|
forceFallback: !0,
|
|
2845
2863
|
fallbackTolerance: 3,
|
|
2846
2864
|
onStart: (R) => {
|
|
2847
|
-
const
|
|
2848
|
-
if (
|
|
2849
|
-
const
|
|
2865
|
+
const oe = R.item, ke = sn(oe.getAttribute("data-id"));
|
|
2866
|
+
if (ke === null) return;
|
|
2867
|
+
const Ne = f.findNode(ke).node, Ee = Ne ? f.calculateSubtreeDepth(Ne) : 1;
|
|
2850
2868
|
Te.value = {
|
|
2851
|
-
sourceKey:
|
|
2852
|
-
sourceSubtreeDepth:
|
|
2869
|
+
sourceKey: ke,
|
|
2870
|
+
sourceSubtreeDepth: Ee,
|
|
2853
2871
|
instruction: null
|
|
2854
2872
|
}, document.addEventListener("pointermove", Fe, { passive: !0 });
|
|
2855
2873
|
},
|
|
2856
2874
|
onMove: (R) => {
|
|
2857
|
-
const
|
|
2858
|
-
if (
|
|
2859
|
-
if ("clientX" in
|
|
2860
|
-
ct(
|
|
2861
|
-
else if ("touches" in
|
|
2862
|
-
const
|
|
2863
|
-
|
|
2875
|
+
const oe = R.originalEvent;
|
|
2876
|
+
if (oe) {
|
|
2877
|
+
if ("clientX" in oe && "clientY" in oe)
|
|
2878
|
+
ct(oe.clientX, oe.clientY);
|
|
2879
|
+
else if ("touches" in oe) {
|
|
2880
|
+
const ke = oe;
|
|
2881
|
+
ke.touches.length > 0 && ct(ke.touches[0].clientX, ke.touches[0].clientY);
|
|
2864
2882
|
}
|
|
2865
2883
|
}
|
|
2866
2884
|
return !1;
|
|
@@ -2869,91 +2887,91 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2869
2887
|
document.removeEventListener("pointermove", Fe);
|
|
2870
2888
|
const R = Te.value;
|
|
2871
2889
|
if (Te.value = null, !R) return;
|
|
2872
|
-
const
|
|
2873
|
-
|
|
2890
|
+
const oe = R.instruction;
|
|
2891
|
+
oe !== null && oe.type !== "blocked" && St(oe, R.sourceKey);
|
|
2874
2892
|
}
|
|
2875
2893
|
});
|
|
2876
|
-
|
|
2894
|
+
he.value.push(o);
|
|
2877
2895
|
}
|
|
2878
|
-
},
|
|
2896
|
+
}, sn = (t) => {
|
|
2879
2897
|
if (t === null || t === "") return null;
|
|
2880
2898
|
const d = yo(t);
|
|
2881
2899
|
return String(d) === t ? d : t;
|
|
2882
2900
|
};
|
|
2883
|
-
|
|
2884
|
-
() =>
|
|
2901
|
+
$e(
|
|
2902
|
+
() => A.value,
|
|
2885
2903
|
() => {
|
|
2886
|
-
|
|
2904
|
+
A.value ? Qe(() => ut()) : ze();
|
|
2887
2905
|
}
|
|
2888
|
-
),
|
|
2889
|
-
() =>
|
|
2906
|
+
), $e(
|
|
2907
|
+
() => Ye.value,
|
|
2890
2908
|
() => {
|
|
2891
|
-
|
|
2909
|
+
A.value && Qe(() => ut());
|
|
2892
2910
|
}
|
|
2893
|
-
),
|
|
2894
|
-
() =>
|
|
2911
|
+
), $e(
|
|
2912
|
+
() => ie.value.map((t) => t.key).join("|"),
|
|
2895
2913
|
() => {
|
|
2896
|
-
|
|
2914
|
+
A.value && Qe(() => ut());
|
|
2897
2915
|
}
|
|
2898
2916
|
), en(() => {
|
|
2899
|
-
|
|
2917
|
+
A.value && ut();
|
|
2900
2918
|
}), tn(() => {
|
|
2901
|
-
|
|
2919
|
+
ze(), document.removeEventListener("pointermove", Fe);
|
|
2902
2920
|
});
|
|
2903
|
-
const
|
|
2921
|
+
const nt = S(() => {
|
|
2904
2922
|
const t = Te.value;
|
|
2905
|
-
if (!t || t.instruction === null || !
|
|
2923
|
+
if (!t || t.instruction === null || !v.value) return null;
|
|
2906
2924
|
const d = t.instruction;
|
|
2907
2925
|
if (d.type === "blocked") return null;
|
|
2908
|
-
const o =
|
|
2926
|
+
const o = v.value.querySelector(
|
|
2909
2927
|
`.a-le-row-wrapper[data-id="${CSS.escape(String(d.refKey))}"]`
|
|
2910
2928
|
);
|
|
2911
2929
|
if (!o) return null;
|
|
2912
|
-
const R = o.querySelector(":scope > .a-le-row"),
|
|
2913
|
-
let
|
|
2930
|
+
const R = o.querySelector(":scope > .a-le-row"), oe = v.value.getBoundingClientRect(), ke = (R ?? o).getBoundingClientRect(), Ne = xn + d.depth * Cn, Ee = d.refEdge === "top" ? ke.top - oe.top : ke.bottom - oe.top, Ke = { top: Ee, left: Ne, right: 16 };
|
|
2931
|
+
let it = null;
|
|
2914
2932
|
if (d.levelRowKey !== null) {
|
|
2915
|
-
const
|
|
2933
|
+
const ge = v.value.querySelector(
|
|
2916
2934
|
`.a-le-row-wrapper[data-id="${CSS.escape(String(d.levelRowKey))}"]`
|
|
2917
2935
|
);
|
|
2918
|
-
if (
|
|
2919
|
-
const
|
|
2920
|
-
bt <
|
|
2936
|
+
if (ge) {
|
|
2937
|
+
const Et = (ge.querySelector(":scope > .a-le-row") ?? ge).getBoundingClientRect(), bt = Et.top - oe.top + Et.height / 2;
|
|
2938
|
+
bt < Ee && (it = {
|
|
2921
2939
|
top: bt,
|
|
2922
|
-
height:
|
|
2923
|
-
left:
|
|
2940
|
+
height: Ee - bt,
|
|
2941
|
+
left: Ne
|
|
2924
2942
|
});
|
|
2925
2943
|
}
|
|
2926
2944
|
}
|
|
2927
|
-
return { line: Ke, connector:
|
|
2945
|
+
return { line: Ke, connector: it };
|
|
2928
2946
|
}), ht = () => {
|
|
2929
|
-
|
|
2930
|
-
},
|
|
2931
|
-
C.value && (
|
|
2947
|
+
dt.value && (Pe(), n.factory && f.addItem(), i("add", void 0));
|
|
2948
|
+
}, rn = (t) => {
|
|
2949
|
+
C.value && (Pe(), n.factory && f.addAfter(t.key, void 0, t.childrenAllowed), i("add", { afterId: t.key, childrenAllowed: t.childrenAllowed }));
|
|
2932
2950
|
}, dn = (t) => {
|
|
2933
|
-
C.value && t.canAddChild && (
|
|
2934
|
-
},
|
|
2935
|
-
if (!(!C.value ||
|
|
2936
|
-
if (
|
|
2951
|
+
C.value && t.canAddChild && (Pe(), g.value.add(t.key), i("add-child", t), n.factory && f.addChild(t.key, void 0, !0), i("add", { parentId: t.key, childrenAllowed: !0 }));
|
|
2952
|
+
}, At = (t) => {
|
|
2953
|
+
if (!(!C.value || Me.value)) {
|
|
2954
|
+
if (ue.value.has(t.key)) {
|
|
2937
2955
|
gt(t);
|
|
2938
2956
|
return;
|
|
2939
2957
|
}
|
|
2940
|
-
|
|
2958
|
+
K.value && Se(t), i("edit", t);
|
|
2941
2959
|
}
|
|
2942
2960
|
}, zt = (t) => {
|
|
2943
2961
|
if (n.disabled || n.loading) return;
|
|
2944
|
-
const d = t.key, o =
|
|
2945
|
-
o ?
|
|
2962
|
+
const d = t.key, o = g.value.has(d);
|
|
2963
|
+
o ? g.value.delete(d) : g.value.add(d), i("item-expand", t, !o);
|
|
2946
2964
|
}, cn = (t) => {
|
|
2947
2965
|
if (n.disabled || n.loading) return;
|
|
2948
2966
|
const d = t.key, o = z.value.has(d);
|
|
2949
2967
|
o ? z.value.delete(d) : z.value.add(d), i("item-expand", t, !o);
|
|
2950
|
-
}, un = (t) => n.disableRowClick || n.disabled || n.loading ||
|
|
2968
|
+
}, un = (t) => n.disableRowClick || n.disabled || n.loading || Me.value ? !1 : !!(t.editing || t.expanded || !n.readonly && n.showEditButton), ca = (t) => {
|
|
2951
2969
|
if (un(t)) {
|
|
2952
2970
|
if (t.editing || t.expanded) {
|
|
2953
2971
|
gt(t);
|
|
2954
2972
|
return;
|
|
2955
2973
|
}
|
|
2956
|
-
n.readonly &&
|
|
2974
|
+
n.readonly && J.value ? cn(t) : At(t);
|
|
2957
2975
|
}
|
|
2958
2976
|
}, {
|
|
2959
2977
|
deleteDialog: Nt,
|
|
@@ -2966,70 +2984,70 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
2966
2984
|
onDeleteConfirm: (t) => n.onDeleteConfirm ? n.onDeleteConfirm(t) : !0,
|
|
2967
2985
|
onDelete: (t) => n.onDelete?.(t),
|
|
2968
2986
|
onDeleted: (t) => {
|
|
2969
|
-
|
|
2987
|
+
ue.value.delete(t.key), ae.value.delete(t.key), z.value.delete(t.key), g.value.delete(t.key), i("deleted", t);
|
|
2970
2988
|
},
|
|
2971
2989
|
disableDeleteConfirm: () => n.disableDeleteConfirm
|
|
2972
2990
|
}), fn = async (t) => {
|
|
2973
2991
|
C.value && await va(t);
|
|
2974
2992
|
}, vn = async (t) => {
|
|
2975
|
-
n.onItemSave && await n.onItemSave(t.raw),
|
|
2993
|
+
n.onItemSave && await n.onItemSave(t.raw), Le(t), i("item-saved", t);
|
|
2976
2994
|
}, mn = (t) => {
|
|
2977
|
-
|
|
2995
|
+
we(t);
|
|
2978
2996
|
}, gt = (t) => {
|
|
2979
|
-
|
|
2997
|
+
Ge(t), i("close", t);
|
|
2980
2998
|
}, Ot = (t) => {
|
|
2981
|
-
f.moveUp(t) &&
|
|
2999
|
+
f.moveUp(t) && ne(t);
|
|
2982
3000
|
}, Ut = (t) => {
|
|
2983
|
-
f.moveDown(t) &&
|
|
3001
|
+
f.moveDown(t) && ne(t);
|
|
2984
3002
|
}, jt = (t) => {
|
|
2985
|
-
f.moveTop(t) &&
|
|
3003
|
+
f.moveTop(t) && ne(t);
|
|
2986
3004
|
}, qt = (t) => {
|
|
2987
|
-
f.moveBottom(t) &&
|
|
3005
|
+
f.moveBottom(t) && ne(t);
|
|
2988
3006
|
}, Ht = (t) => {
|
|
2989
3007
|
if (!f.indent(t.key)) {
|
|
2990
3008
|
c("common.sortable.error.maxDeepExceed");
|
|
2991
3009
|
return;
|
|
2992
3010
|
}
|
|
2993
|
-
|
|
3011
|
+
ne(t.key), i("indent", t);
|
|
2994
3012
|
}, Gt = (t) => {
|
|
2995
|
-
f.outdent(t.key) && (
|
|
3013
|
+
f.outdent(t.key) && (ne(t.key), i("outdent", t));
|
|
2996
3014
|
}, Jt = (t) => Zn(t, { compactField: n.compactField }), yn = (t, d) => d === void 0 ? null : f.rowState(t, d), pt = /* @__PURE__ */ new Map(), ha = (t) => {
|
|
2997
3015
|
let d = pt.get(t);
|
|
2998
3016
|
return d || (d = {
|
|
2999
3017
|
edit: () => {
|
|
3000
|
-
const o =
|
|
3001
|
-
o &&
|
|
3018
|
+
const o = De(t);
|
|
3019
|
+
o && At(o);
|
|
3002
3020
|
},
|
|
3003
3021
|
save: () => {
|
|
3004
|
-
const o =
|
|
3022
|
+
const o = De(t);
|
|
3005
3023
|
if (o) return vn(o);
|
|
3006
3024
|
},
|
|
3007
3025
|
cancel: () => {
|
|
3008
|
-
const o =
|
|
3026
|
+
const o = De(t);
|
|
3009
3027
|
o && mn(o);
|
|
3010
3028
|
},
|
|
3011
3029
|
close: () => {
|
|
3012
|
-
const o =
|
|
3030
|
+
const o = De(t);
|
|
3013
3031
|
o && gt(o);
|
|
3014
3032
|
},
|
|
3015
3033
|
delete: async () => {
|
|
3016
|
-
const o =
|
|
3034
|
+
const o = De(t);
|
|
3017
3035
|
o && await fn(o);
|
|
3018
3036
|
},
|
|
3019
3037
|
addAfter: () => {
|
|
3020
|
-
const o =
|
|
3021
|
-
o &&
|
|
3038
|
+
const o = De(t);
|
|
3039
|
+
o && rn(o);
|
|
3022
3040
|
},
|
|
3023
3041
|
addChild: () => {
|
|
3024
|
-
const o =
|
|
3042
|
+
const o = De(t);
|
|
3025
3043
|
o && dn(o);
|
|
3026
3044
|
},
|
|
3027
3045
|
toggleExpand: () => {
|
|
3028
|
-
const o =
|
|
3046
|
+
const o = De(t);
|
|
3029
3047
|
o && zt(o);
|
|
3030
3048
|
},
|
|
3031
3049
|
toggleDetail: () => {
|
|
3032
|
-
const o =
|
|
3050
|
+
const o = De(t);
|
|
3033
3051
|
o && cn(o);
|
|
3034
3052
|
},
|
|
3035
3053
|
moveUp: () => Ot(t),
|
|
@@ -3037,18 +3055,18 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
3037
3055
|
moveTop: () => jt(t),
|
|
3038
3056
|
moveBottom: () => qt(t),
|
|
3039
3057
|
indent: () => {
|
|
3040
|
-
const o =
|
|
3058
|
+
const o = De(t);
|
|
3041
3059
|
o && Ht(o);
|
|
3042
3060
|
},
|
|
3043
3061
|
outdent: () => {
|
|
3044
|
-
const o =
|
|
3062
|
+
const o = De(t);
|
|
3045
3063
|
o && Gt(o);
|
|
3046
3064
|
},
|
|
3047
3065
|
update: (o) => f.updateItem(t, o)
|
|
3048
3066
|
}, pt.set(t, d)), d;
|
|
3049
3067
|
};
|
|
3050
|
-
|
|
3051
|
-
() =>
|
|
3068
|
+
$e(
|
|
3069
|
+
() => ie.value,
|
|
3052
3070
|
(t) => {
|
|
3053
3071
|
if (pt.size === 0) return;
|
|
3054
3072
|
const d = new Set(t.map((o) => o.key));
|
|
@@ -3077,7 +3095,7 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
3077
3095
|
dirty: t.dirty,
|
|
3078
3096
|
unsaved: t.unsaved,
|
|
3079
3097
|
moved: t.moved,
|
|
3080
|
-
reorderMode:
|
|
3098
|
+
reorderMode: Me.value,
|
|
3081
3099
|
canMoveUp: !t.firstInParent,
|
|
3082
3100
|
canMoveDown: !t.lastInParent,
|
|
3083
3101
|
canIndent: t.canIndent,
|
|
@@ -3085,26 +3103,26 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
3085
3103
|
canAddChild: t.canAddChild,
|
|
3086
3104
|
touch: j.value,
|
|
3087
3105
|
actions: ha(t.key)
|
|
3088
|
-
}), pa =
|
|
3089
|
-
applying:
|
|
3090
|
-
hasPendingChanges:
|
|
3091
|
-
movedCount:
|
|
3092
|
-
error:
|
|
3106
|
+
}), pa = S(() => ({
|
|
3107
|
+
applying: Ae.value,
|
|
3108
|
+
hasPendingChanges: Ve.value,
|
|
3109
|
+
movedCount: et.value,
|
|
3110
|
+
error: Oe.value,
|
|
3093
3111
|
actions: {
|
|
3094
|
-
apply:
|
|
3095
|
-
cancel:
|
|
3112
|
+
apply: rt,
|
|
3113
|
+
cancel: tt
|
|
3096
3114
|
}
|
|
3097
|
-
})), hn =
|
|
3115
|
+
})), hn = S(() => ({
|
|
3098
3116
|
mode: w.value,
|
|
3099
3117
|
disabled: !F.value,
|
|
3100
|
-
hasPendingChanges:
|
|
3118
|
+
hasPendingChanges: Ve.value,
|
|
3101
3119
|
actions: {
|
|
3102
|
-
enterReorderMode:
|
|
3103
|
-
exitReorderMode:
|
|
3120
|
+
enterReorderMode: Xe,
|
|
3121
|
+
exitReorderMode: tt
|
|
3104
3122
|
}
|
|
3105
|
-
})), ba =
|
|
3106
|
-
viewItems:
|
|
3107
|
-
() =>
|
|
3123
|
+
})), ba = S(() => new Set(ye.value)), De = (t) => ie.value.find((d) => d.key === t), It = Hn({
|
|
3124
|
+
viewItems: S(
|
|
3125
|
+
() => ie.value.map((t) => ({
|
|
3108
3126
|
key: t.key,
|
|
3109
3127
|
expanded: t.childrenExpanded,
|
|
3110
3128
|
canExpand: ba.value.has(t.key),
|
|
@@ -3113,15 +3131,15 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
3113
3131
|
}))
|
|
3114
3132
|
),
|
|
3115
3133
|
variant: "nested",
|
|
3116
|
-
isReorderMode:
|
|
3117
|
-
disabled:
|
|
3118
|
-
isEditing: (t) =>
|
|
3134
|
+
isReorderMode: Me,
|
|
3135
|
+
disabled: S(() => !C.value),
|
|
3136
|
+
isEditing: (t) => ue.value.has(t),
|
|
3119
3137
|
onToggleEdit: (t) => {
|
|
3120
|
-
const d =
|
|
3121
|
-
d &&
|
|
3138
|
+
const d = De(t);
|
|
3139
|
+
d && At(d);
|
|
3122
3140
|
},
|
|
3123
3141
|
onCancelEdit: (t) => {
|
|
3124
|
-
const d =
|
|
3142
|
+
const d = De(t);
|
|
3125
3143
|
d && gt(d);
|
|
3126
3144
|
},
|
|
3127
3145
|
onMoveUp: (t) => Ot(t),
|
|
@@ -3129,48 +3147,48 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
3129
3147
|
onMoveTop: (t) => jt(t),
|
|
3130
3148
|
onMoveBottom: (t) => qt(t),
|
|
3131
3149
|
onIndent: (t) => {
|
|
3132
|
-
const d =
|
|
3150
|
+
const d = De(t);
|
|
3133
3151
|
d && Ht(d);
|
|
3134
3152
|
},
|
|
3135
3153
|
onOutdent: (t) => {
|
|
3136
|
-
const d =
|
|
3154
|
+
const d = De(t);
|
|
3137
3155
|
d && Gt(d);
|
|
3138
3156
|
},
|
|
3139
3157
|
onToggleChildren: (t) => {
|
|
3140
|
-
const d =
|
|
3158
|
+
const d = De(t);
|
|
3141
3159
|
d && zt(d);
|
|
3142
3160
|
},
|
|
3143
|
-
onCancelReorder: () =>
|
|
3144
|
-
}), Wt =
|
|
3161
|
+
onCancelReorder: () => tt()
|
|
3162
|
+
}), Wt = de(!1), ft = Zt(null), Xt = S(() => {
|
|
3145
3163
|
const t = ft.value;
|
|
3146
3164
|
if (!t) return null;
|
|
3147
|
-
const d = f.findNode(t.key), o = d.parent?.children ??
|
|
3165
|
+
const d = f.findNode(t.key), o = d.parent?.children ?? m.value.children, R = o.findIndex((oe) => X(oe.data) === t.key);
|
|
3148
3166
|
return {
|
|
3149
|
-
parentId: d.parent ?
|
|
3167
|
+
parentId: d.parent ? X(d.parent.data) : null,
|
|
3150
3168
|
total: o.length,
|
|
3151
3169
|
currentIndex: R
|
|
3152
3170
|
};
|
|
3153
|
-
}), ka =
|
|
3171
|
+
}), ka = S(
|
|
3154
3172
|
() => ft.value ? Jt(ft.value.raw) : ""
|
|
3155
3173
|
), wa = (t) => {
|
|
3156
3174
|
n.showMoveToPosition && (ft.value = t, Wt.value = !0);
|
|
3157
3175
|
}, Ca = (t) => {
|
|
3158
3176
|
const d = Xt.value, o = ft.value;
|
|
3159
|
-
ft.value = null, !(!d || !o) && t !== d.currentIndex && f.moveTo(o.key, d.parentId, t) &&
|
|
3160
|
-
}, Yt =
|
|
3177
|
+
ft.value = null, !(!d || !o) && t !== d.currentIndex && f.moveTo(o.key, d.parentId, t) && ne(o.key);
|
|
3178
|
+
}, Yt = de(!1), Pt = Zt(null), xa = (t) => {
|
|
3161
3179
|
n.showChangeParent && (Pt.value = t, Yt.value = !0);
|
|
3162
|
-
},
|
|
3180
|
+
}, Sa = (t, d) => {
|
|
3163
3181
|
const o = Pt.value;
|
|
3164
3182
|
if (Pt.value = null, !o) return;
|
|
3165
3183
|
let R = 0;
|
|
3166
|
-
t === null ? R =
|
|
3167
|
-
const
|
|
3168
|
-
f.moveTo(o.key, t,
|
|
3169
|
-
},
|
|
3170
|
-
reorderMode:
|
|
3184
|
+
t === null ? R = m.value.children.length : R = f.findNode(t).node?.children?.length ?? 0;
|
|
3185
|
+
const oe = d === "first" ? 0 : R;
|
|
3186
|
+
f.moveTo(o.key, t, oe) && (ne(o.key), t !== null && g.value.add(t));
|
|
3187
|
+
}, Aa = S(() => ({
|
|
3188
|
+
reorderMode: Me.value,
|
|
3171
3189
|
readonly: n.readonly,
|
|
3172
3190
|
canInteract: C.value,
|
|
3173
|
-
dragEnabled:
|
|
3191
|
+
dragEnabled: A.value,
|
|
3174
3192
|
showExpandToggle: n.showExpandToggle,
|
|
3175
3193
|
showEditButton: n.showEditButton,
|
|
3176
3194
|
showDeleteButton: n.showDeleteButton,
|
|
@@ -3178,7 +3196,7 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
3178
3196
|
showAddAfterAction: n.showAddAfterAction,
|
|
3179
3197
|
showMoveToPosition: n.showMoveToPosition,
|
|
3180
3198
|
showChangeParent: n.showChangeParent,
|
|
3181
|
-
showInlineSaveFooter:
|
|
3199
|
+
showInlineSaveFooter: ee.value,
|
|
3182
3200
|
statusField: n.statusField,
|
|
3183
3201
|
effectiveCloseVariant: M.value,
|
|
3184
3202
|
keyboardNav: It,
|
|
@@ -3189,12 +3207,12 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
3189
3207
|
})), Ia = {
|
|
3190
3208
|
onRowClick: ca,
|
|
3191
3209
|
onChevronClick: zt,
|
|
3192
|
-
onEditClick:
|
|
3210
|
+
onEditClick: At,
|
|
3193
3211
|
onDeleteClick: fn,
|
|
3194
3212
|
onCloseClick: gt,
|
|
3195
3213
|
onSaveClick: vn,
|
|
3196
3214
|
onCancelClick: mn,
|
|
3197
|
-
onAddAfterClick:
|
|
3215
|
+
onAddAfterClick: rn,
|
|
3198
3216
|
onAddChildClick: dn,
|
|
3199
3217
|
moveUp: (t) => Ot(t),
|
|
3200
3218
|
moveDown: (t) => Ut(t),
|
|
@@ -3204,14 +3222,14 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
3204
3222
|
outdent: Gt,
|
|
3205
3223
|
openMoveToPosition: wa,
|
|
3206
3224
|
openChangeParent: xa
|
|
3207
|
-
}, Pa =
|
|
3208
|
-
f.deleteItem(t),
|
|
3209
|
-
}, Ta = (t, d, o = null, R = null,
|
|
3210
|
-
f.updateItem(t, d),
|
|
3211
|
-
}, gn =
|
|
3212
|
-
() =>
|
|
3225
|
+
}, Pa = S(() => ie.value.filter((t) => t.parentKey === null)), Ea = (t, d, o) => (f.addItem(d, { afterId: t ?? void 0, childrenAllowed: o }), Qe(() => f.commit()), m.value), Da = (t, d, o) => (g.value.add(t), f.addItem(d, { parentId: t, asFirstChild: !0, childrenAllowed: o }), Qe(() => f.commit()), m.value), $a = (t) => {
|
|
3226
|
+
f.deleteItem(t), ue.value.delete(t), ae.value.delete(t), z.value.delete(t), g.value.delete(t), Qe(() => f.commit());
|
|
3227
|
+
}, Ta = (t, d, o = null, R = null, oe = null) => {
|
|
3228
|
+
f.updateItem(t, d), Qe(() => f.commit());
|
|
3229
|
+
}, gn = S(
|
|
3230
|
+
() => ie.value.filter((t) => t.unsaved).length
|
|
3213
3231
|
), Fa = () => {
|
|
3214
|
-
f.commit(),
|
|
3232
|
+
f.commit(), Y.value = /* @__PURE__ */ new Set(), me();
|
|
3215
3233
|
};
|
|
3216
3234
|
return Jn(
|
|
3217
3235
|
() => n.unsavedSectionLabel ? { label: n.unsavedSectionLabel, dirty: gn.value > 0 } : []
|
|
@@ -3223,255 +3241,255 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
3223
3241
|
validateAll: () => Wn(f, (t) => {
|
|
3224
3242
|
let d = f.findNode(t).parent;
|
|
3225
3243
|
for (; d; )
|
|
3226
|
-
|
|
3244
|
+
g.value.add(X(d.data)), d = f.findNode(X(d.data)).parent;
|
|
3227
3245
|
const o = f.viewItems.value.find((R) => R.key === t);
|
|
3228
|
-
o &&
|
|
3246
|
+
o && Se(o);
|
|
3229
3247
|
}),
|
|
3230
3248
|
// Legacy aliases (pre-v2 ASortableNested API).
|
|
3231
|
-
addAfterId:
|
|
3232
|
-
addChildToId:
|
|
3249
|
+
addAfterId: Ea,
|
|
3250
|
+
addChildToId: Da,
|
|
3233
3251
|
removeById: $a,
|
|
3234
3252
|
updateData: Ta,
|
|
3235
|
-
resetDirtyBaseline:
|
|
3253
|
+
resetDirtyBaseline: ce,
|
|
3236
3254
|
hasUnsavedChanges: f.hasUnsaved,
|
|
3237
3255
|
unsavedCount: gn,
|
|
3238
3256
|
clearUnsavedState: Fa,
|
|
3239
3257
|
// Expand-aware flattened view (controller's own `viewItems` ignores collapse state).
|
|
3240
3258
|
viewItems: T,
|
|
3241
|
-
enterReorderMode:
|
|
3242
|
-
cancelReorderMode:
|
|
3243
|
-
applyReorder:
|
|
3244
|
-
expand: (t) =>
|
|
3245
|
-
collapse: (t) =>
|
|
3259
|
+
enterReorderMode: Xe,
|
|
3260
|
+
cancelReorderMode: tt,
|
|
3261
|
+
applyReorder: rt,
|
|
3262
|
+
expand: (t) => g.value.add(t),
|
|
3263
|
+
collapse: (t) => g.value.delete(t),
|
|
3246
3264
|
toggleExpand: (t) => {
|
|
3247
|
-
|
|
3265
|
+
g.value.has(t) ? g.value.delete(t) : g.value.add(t);
|
|
3248
3266
|
},
|
|
3249
3267
|
expandDetail: (t) => z.value.add(t),
|
|
3250
3268
|
collapseDetail: (t) => z.value.delete(t)
|
|
3251
3269
|
}), (t, d) => (x(), N("div", {
|
|
3252
3270
|
ref_key: "rootEl",
|
|
3253
3271
|
ref: h,
|
|
3254
|
-
class:
|
|
3272
|
+
class: Ue(["a-nested-list-editor", [
|
|
3255
3273
|
`a-nested-list-editor--mode-${w.value}`,
|
|
3256
3274
|
{
|
|
3257
3275
|
"a-nested-list-editor--readonly": e.readonly,
|
|
3258
3276
|
"a-nested-list-editor--disabled": e.disabled,
|
|
3259
3277
|
"a-nested-list-editor--touch": y(j),
|
|
3260
|
-
"a-nested-list-editor--drag-enabled":
|
|
3278
|
+
"a-nested-list-editor--drag-enabled": A.value
|
|
3261
3279
|
}
|
|
3262
3280
|
]])
|
|
3263
3281
|
}, [
|
|
3264
3282
|
U("div", Gl, [
|
|
3265
|
-
|
|
3266
|
-
O(t.$slots, "header",
|
|
3267
|
-
e.title ? (x(), N("h3", Wl,
|
|
3283
|
+
p.value ? (x(), N("div", Jl, [
|
|
3284
|
+
O(t.$slots, "header", ve({ title: e.title }, hn.value), () => [
|
|
3285
|
+
e.title ? (x(), N("h3", Wl, V(e.title), 1)) : _("", !0),
|
|
3268
3286
|
U("div", Xl, [
|
|
3269
|
-
y(
|
|
3270
|
-
|
|
3271
|
-
class:
|
|
3272
|
-
"has-pending-changes": y(
|
|
3273
|
-
"pending-count": y(
|
|
3274
|
-
error: y(
|
|
3287
|
+
y(Me) ? O(t.$slots, "reorder-toolbar", Je(ve({ key: 0 }, pa.value)), () => [
|
|
3288
|
+
r(ro, {
|
|
3289
|
+
class: Ue({ "a-le-toolbar-status--pending": y(Ve) }),
|
|
3290
|
+
"has-pending-changes": y(Ve),
|
|
3291
|
+
"pending-count": y(et),
|
|
3292
|
+
error: y(Oe)
|
|
3275
3293
|
}, null, 8, ["class", "has-pending-changes", "pending-count", "error"]),
|
|
3276
|
-
|
|
3294
|
+
r(se, {
|
|
3277
3295
|
variant: "text",
|
|
3278
3296
|
size: "small",
|
|
3279
|
-
disabled: y(
|
|
3280
|
-
onClick: y(
|
|
3297
|
+
disabled: y(Ae),
|
|
3298
|
+
onClick: y(tt)
|
|
3281
3299
|
}, {
|
|
3282
3300
|
default: u(() => [
|
|
3283
|
-
|
|
3301
|
+
Q(V(y(E)("common.sortable.reorderCancel")), 1)
|
|
3284
3302
|
]),
|
|
3285
3303
|
_: 1
|
|
3286
3304
|
}, 8, ["disabled", "onClick"]),
|
|
3287
|
-
|
|
3305
|
+
r(se, {
|
|
3288
3306
|
color: "primary",
|
|
3289
3307
|
variant: "flat",
|
|
3290
3308
|
size: "small",
|
|
3291
3309
|
"prepend-icon": "mdi-check",
|
|
3292
|
-
loading: y(
|
|
3293
|
-
disabled: y(
|
|
3294
|
-
onClick: y(
|
|
3310
|
+
loading: y(Ae),
|
|
3311
|
+
disabled: y(Ae) || !y(Ve),
|
|
3312
|
+
onClick: y(rt)
|
|
3295
3313
|
}, {
|
|
3296
3314
|
default: u(() => [
|
|
3297
|
-
|
|
3315
|
+
Q(V(y(E)("common.sortable.reorderApply")), 1)
|
|
3298
3316
|
]),
|
|
3299
3317
|
_: 1
|
|
3300
3318
|
}, 8, ["loading", "disabled", "onClick"])
|
|
3301
|
-
]) : (x(), N(
|
|
3302
|
-
a.value &&
|
|
3319
|
+
]) : (x(), N(xe, { key: 1 }, [
|
|
3320
|
+
a.value && Ce.value ? (x(), te(se, {
|
|
3303
3321
|
key: 0,
|
|
3304
3322
|
variant: "tonal",
|
|
3305
3323
|
color: "primary",
|
|
3306
3324
|
icon: "",
|
|
3307
3325
|
size: "x-small",
|
|
3308
|
-
onClick:
|
|
3326
|
+
onClick: H
|
|
3309
3327
|
}, {
|
|
3310
3328
|
default: u(() => [
|
|
3311
|
-
|
|
3312
|
-
icon:
|
|
3329
|
+
r(re, {
|
|
3330
|
+
icon: be.value ? "mdi-unfold-less-horizontal" : "mdi-unfold-more-horizontal",
|
|
3313
3331
|
size: "18"
|
|
3314
3332
|
}, null, 8, ["icon"]),
|
|
3315
|
-
|
|
3333
|
+
r(qe, {
|
|
3316
3334
|
activator: "parent",
|
|
3317
3335
|
location: "bottom",
|
|
3318
|
-
text:
|
|
3336
|
+
text: be.value ? y(E)("common.sortable.collapseAll") : y(E)("common.sortable.expandAll")
|
|
3319
3337
|
}, null, 8, ["text"])
|
|
3320
3338
|
]),
|
|
3321
3339
|
_: 1
|
|
3322
|
-
})) : a.value ? (x(),
|
|
3340
|
+
})) : a.value ? (x(), te(se, {
|
|
3323
3341
|
key: 1,
|
|
3324
3342
|
variant: "tonal",
|
|
3325
3343
|
color: "primary",
|
|
3326
3344
|
size: "small",
|
|
3327
|
-
"prepend-icon":
|
|
3328
|
-
onClick:
|
|
3345
|
+
"prepend-icon": be.value ? "mdi-unfold-less-horizontal" : "mdi-unfold-more-horizontal",
|
|
3346
|
+
onClick: H
|
|
3329
3347
|
}, {
|
|
3330
3348
|
default: u(() => [
|
|
3331
|
-
|
|
3349
|
+
Q(V(be.value ? y(E)("common.sortable.collapseAll") : y(E)("common.sortable.expandAll")), 1)
|
|
3332
3350
|
]),
|
|
3333
3351
|
_: 1
|
|
3334
|
-
}, 8, ["prepend-icon"])) :
|
|
3335
|
-
|
|
3336
|
-
|
|
3352
|
+
}, 8, ["prepend-icon"])) : _("", !0),
|
|
3353
|
+
pe.value ? O(t.$slots, "reorder-toggle", Je(ve({ key: 2 }, hn.value)), () => [
|
|
3354
|
+
Ce.value ? (x(), te(se, {
|
|
3337
3355
|
key: 0,
|
|
3338
3356
|
variant: "tonal",
|
|
3339
3357
|
color: "primary",
|
|
3340
3358
|
icon: "",
|
|
3341
3359
|
size: "x-small",
|
|
3342
3360
|
disabled: !F.value,
|
|
3343
|
-
onClick: y(
|
|
3361
|
+
onClick: y(Xe)
|
|
3344
3362
|
}, {
|
|
3345
3363
|
default: u(() => [
|
|
3346
|
-
|
|
3364
|
+
r(re, {
|
|
3347
3365
|
icon: "mdi-sort",
|
|
3348
3366
|
size: "18"
|
|
3349
3367
|
}),
|
|
3350
|
-
|
|
3368
|
+
r(qe, {
|
|
3351
3369
|
activator: "parent",
|
|
3352
3370
|
location: "bottom",
|
|
3353
|
-
text: y(
|
|
3371
|
+
text: y(E)("common.sortable.reorder")
|
|
3354
3372
|
}, null, 8, ["text"])
|
|
3355
3373
|
]),
|
|
3356
3374
|
_: 1
|
|
3357
|
-
}, 8, ["disabled", "onClick"])) : (x(),
|
|
3375
|
+
}, 8, ["disabled", "onClick"])) : (x(), te(se, {
|
|
3358
3376
|
key: 1,
|
|
3359
3377
|
variant: "tonal",
|
|
3360
3378
|
color: "primary",
|
|
3361
3379
|
"prepend-icon": "mdi-sort",
|
|
3362
3380
|
size: "small",
|
|
3363
3381
|
disabled: !F.value,
|
|
3364
|
-
onClick: y(
|
|
3382
|
+
onClick: y(Xe)
|
|
3365
3383
|
}, {
|
|
3366
3384
|
default: u(() => [
|
|
3367
|
-
|
|
3385
|
+
Q(V(y(E)("common.sortable.reorder")), 1)
|
|
3368
3386
|
]),
|
|
3369
3387
|
_: 1
|
|
3370
3388
|
}, 8, ["disabled", "onClick"]))
|
|
3371
|
-
]) :
|
|
3389
|
+
]) : _("", !0)
|
|
3372
3390
|
], 64))
|
|
3373
3391
|
])
|
|
3374
3392
|
])
|
|
3375
|
-
])) :
|
|
3393
|
+
])) : _("", !0),
|
|
3376
3394
|
e.loading ? (x(), N("div", Yl, [
|
|
3377
|
-
|
|
3395
|
+
r(sa, {
|
|
3378
3396
|
indeterminate: "",
|
|
3379
3397
|
color: "primary",
|
|
3380
3398
|
size: "32"
|
|
3381
3399
|
})
|
|
3382
3400
|
])) : e.error ? (x(), N("div", Ql, [
|
|
3383
|
-
|
|
3401
|
+
r(ln, {
|
|
3384
3402
|
type: "error",
|
|
3385
3403
|
variant: "tonal",
|
|
3386
3404
|
density: "compact",
|
|
3387
3405
|
border: "start"
|
|
3388
3406
|
}, {
|
|
3389
3407
|
default: u(() => [
|
|
3390
|
-
|
|
3408
|
+
Q(V(e.error), 1)
|
|
3391
3409
|
]),
|
|
3392
3410
|
_: 1
|
|
3393
3411
|
})
|
|
3394
|
-
])) :
|
|
3412
|
+
])) : Re.value ? (x(), N("div", Zl, [
|
|
3395
3413
|
O(t.$slots, "empty", {
|
|
3396
3414
|
readonly: e.readonly,
|
|
3397
3415
|
disabled: e.disabled,
|
|
3398
3416
|
actions: { add: ht }
|
|
3399
3417
|
}, () => [
|
|
3400
|
-
|
|
3401
|
-
title:
|
|
3402
|
-
"add-label":
|
|
3403
|
-
"can-add":
|
|
3418
|
+
r(Xn, {
|
|
3419
|
+
title: G.value,
|
|
3420
|
+
"add-label": L.value,
|
|
3421
|
+
"can-add": dt.value,
|
|
3404
3422
|
onAdd: ht
|
|
3405
3423
|
}, null, 8, ["title", "add-label", "can-add"])
|
|
3406
3424
|
])
|
|
3407
3425
|
])) : (x(), N("div", {
|
|
3408
|
-
key:
|
|
3426
|
+
key: Ye.value,
|
|
3409
3427
|
ref_key: "rowsContainer",
|
|
3410
|
-
ref:
|
|
3411
|
-
class:
|
|
3428
|
+
ref: v,
|
|
3429
|
+
class: Ue(["a-nested-list-editor__rows", { "a-nested-list-editor__rows--dragging": Te.value !== null }])
|
|
3412
3430
|
}, [
|
|
3413
3431
|
U("div", {
|
|
3414
|
-
class:
|
|
3432
|
+
class: Ue([wn, "a-nested-list-editor__group--root"]),
|
|
3415
3433
|
"data-parent-id": ""
|
|
3416
3434
|
}, [
|
|
3417
|
-
(x(!0), N(
|
|
3435
|
+
(x(!0), N(xe, null, st(Pa.value, (o) => (x(), te(da, {
|
|
3418
3436
|
key: String(o.key),
|
|
3419
3437
|
vi: o,
|
|
3420
|
-
"view-items":
|
|
3438
|
+
"view-items": ie.value,
|
|
3421
3439
|
"drag-state": Te.value,
|
|
3422
|
-
context:
|
|
3440
|
+
context: Aa.value,
|
|
3423
3441
|
callbacks: Ia
|
|
3424
3442
|
}, {
|
|
3425
3443
|
item: u((R) => [
|
|
3426
|
-
O(t.$slots, "item",
|
|
3444
|
+
O(t.$slots, "item", ve({ ref_for: !0 }, R))
|
|
3427
3445
|
]),
|
|
3428
3446
|
"item-compact": u((R) => [
|
|
3429
|
-
O(t.$slots, "item-compact",
|
|
3447
|
+
O(t.$slots, "item-compact", ve({ ref_for: !0 }, R))
|
|
3430
3448
|
]),
|
|
3431
3449
|
"item-readonly": u((R) => [
|
|
3432
|
-
O(t.$slots, "item-readonly",
|
|
3450
|
+
O(t.$slots, "item-readonly", ve({ ref_for: !0 }, R))
|
|
3433
3451
|
]),
|
|
3434
3452
|
"item-status": u((R) => [
|
|
3435
|
-
O(t.$slots, "item-status",
|
|
3453
|
+
O(t.$slots, "item-status", ve({ ref_for: !0 }, R))
|
|
3436
3454
|
]),
|
|
3437
3455
|
"item-footer": u((R) => [
|
|
3438
|
-
O(t.$slots, "item-footer",
|
|
3456
|
+
O(t.$slots, "item-footer", ve({ ref_for: !0 }, R))
|
|
3439
3457
|
]),
|
|
3440
3458
|
"item-actions": u((R) => [
|
|
3441
|
-
O(t.$slots, "item-actions",
|
|
3459
|
+
O(t.$slots, "item-actions", ve({ ref_for: !0 }, R))
|
|
3442
3460
|
]),
|
|
3443
3461
|
"before-item": u((R) => [
|
|
3444
|
-
O(t.$slots, "before-item",
|
|
3462
|
+
O(t.$slots, "before-item", ve({ ref_for: !0 }, R))
|
|
3445
3463
|
]),
|
|
3446
3464
|
"after-item": u((R) => [
|
|
3447
|
-
O(t.$slots, "after-item",
|
|
3465
|
+
O(t.$slots, "after-item", ve({ ref_for: !0 }, R))
|
|
3448
3466
|
]),
|
|
3449
3467
|
_: 3
|
|
3450
3468
|
}, 8, ["vi", "view-items", "drag-state", "context"]))), 128))
|
|
3451
3469
|
], 2),
|
|
3452
|
-
|
|
3453
|
-
|
|
3470
|
+
nt.value !== null ? (x(), N(xe, { key: 0 }, [
|
|
3471
|
+
nt.value.connector !== null ? (x(), N("div", {
|
|
3454
3472
|
key: 0,
|
|
3455
3473
|
class: "a-nested-list-editor__drop-connector",
|
|
3456
3474
|
style: wt({
|
|
3457
|
-
left: `${
|
|
3458
|
-
top: `${
|
|
3459
|
-
height: `${
|
|
3475
|
+
left: `${nt.value.connector.left}px`,
|
|
3476
|
+
top: `${nt.value.connector.top}px`,
|
|
3477
|
+
height: `${nt.value.connector.height}px`
|
|
3460
3478
|
})
|
|
3461
|
-
}, null, 4)) :
|
|
3479
|
+
}, null, 4)) : _("", !0),
|
|
3462
3480
|
U("div", {
|
|
3463
3481
|
class: "a-nested-list-editor__drop-line",
|
|
3464
3482
|
style: wt({
|
|
3465
|
-
top: `${
|
|
3466
|
-
left: `${
|
|
3467
|
-
right: `${
|
|
3483
|
+
top: `${nt.value.line.top}px`,
|
|
3484
|
+
left: `${nt.value.line.left}px`,
|
|
3485
|
+
right: `${nt.value.line.right}px`
|
|
3468
3486
|
})
|
|
3469
3487
|
}, [...d[3] || (d[3] = [
|
|
3470
3488
|
U("span", { class: "a-nested-list-editor__drop-line-dot" }, null, -1)
|
|
3471
3489
|
])], 4)
|
|
3472
|
-
], 64)) :
|
|
3490
|
+
], 64)) : _("", !0)
|
|
3473
3491
|
], 2)),
|
|
3474
|
-
|
|
3492
|
+
dt.value && !e.loading && !e.error && !Re.value ? O(t.$slots, "add-button", {
|
|
3475
3493
|
key: 5,
|
|
3476
3494
|
readonly: e.readonly,
|
|
3477
3495
|
disabled: e.disabled,
|
|
@@ -3483,15 +3501,15 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
3483
3501
|
class: "a-le-row-add",
|
|
3484
3502
|
onClick: ht
|
|
3485
3503
|
}, [
|
|
3486
|
-
|
|
3504
|
+
r(re, {
|
|
3487
3505
|
icon: "mdi-plus",
|
|
3488
3506
|
size: "18"
|
|
3489
3507
|
}),
|
|
3490
|
-
U("span", null, L
|
|
3508
|
+
U("span", null, V(L.value), 1)
|
|
3491
3509
|
])
|
|
3492
|
-
]) :
|
|
3510
|
+
]) : _("", !0)
|
|
3493
3511
|
]),
|
|
3494
|
-
|
|
3512
|
+
r(co, {
|
|
3495
3513
|
modelValue: Wt.value,
|
|
3496
3514
|
"onUpdate:modelValue": d[0] || (d[0] = (o) => Wt.value = o),
|
|
3497
3515
|
total: Xt.value?.total ?? 0,
|
|
@@ -3499,38 +3517,38 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
3499
3517
|
"item-label": ka.value,
|
|
3500
3518
|
onConfirm: Ca
|
|
3501
3519
|
}, null, 8, ["modelValue", "total", "current-index", "item-label"]),
|
|
3502
|
-
|
|
3520
|
+
r(Hl, {
|
|
3503
3521
|
modelValue: Yt.value,
|
|
3504
3522
|
"onUpdate:modelValue": d[1] || (d[1] = (o) => Yt.value = o),
|
|
3505
|
-
tree:
|
|
3523
|
+
tree: m.value,
|
|
3506
3524
|
"source-key": Pt.value?.key ?? null,
|
|
3507
|
-
"key-field": y(
|
|
3525
|
+
"key-field": y(B),
|
|
3508
3526
|
"max-depth": e.maxDepth,
|
|
3509
3527
|
"resolve-label": Jt,
|
|
3510
3528
|
"calculate-subtree-depth": y(f).calculateSubtreeDepth,
|
|
3511
|
-
onConfirm:
|
|
3529
|
+
onConfirm: Sa
|
|
3512
3530
|
}, null, 8, ["modelValue", "tree", "source-key", "key-field", "max-depth", "calculate-subtree-depth"]),
|
|
3513
|
-
|
|
3531
|
+
r(Qn, {
|
|
3514
3532
|
modelValue: y(Nt),
|
|
3515
3533
|
"onUpdate:modelValue": d[2] || (d[2] = (o) => ta(Nt) ? Nt.value = o : null),
|
|
3516
|
-
title:
|
|
3517
|
-
text:
|
|
3518
|
-
"confirm-label": y(
|
|
3519
|
-
"cancel-label": y(
|
|
3534
|
+
title: W.value,
|
|
3535
|
+
text: Z.value,
|
|
3536
|
+
"confirm-label": y(E)("common.sortable.delete"),
|
|
3537
|
+
"cancel-label": y(E)("common.button.cancel"),
|
|
3520
3538
|
error: y(fa),
|
|
3521
3539
|
"in-flight": y(ua),
|
|
3522
3540
|
onConfirm: y(ma),
|
|
3523
3541
|
onCancel: y(ya)
|
|
3524
3542
|
}, null, 8, ["modelValue", "title", "text", "confirm-label", "cancel-label", "error", "in-flight", "onConfirm", "onCancel"]),
|
|
3525
|
-
U("div", _l,
|
|
3543
|
+
U("div", _l, V(y(It).grabbedKey.value !== null ? y(E)("common.sortable.keyboardGrab.status", {
|
|
3526
3544
|
n: y(It).grabbedIndex.value + 1,
|
|
3527
3545
|
total: y(It).totalCount.value
|
|
3528
3546
|
}) : ""), 1)
|
|
3529
3547
|
], 2));
|
|
3530
3548
|
}
|
|
3531
|
-
}), ti = { class: "a-unsaved-sections" }, ni = /* @__PURE__ */
|
|
3549
|
+
}), ti = { class: "a-unsaved-sections" }, ni = /* @__PURE__ */ _e({
|
|
3532
3550
|
__name: "AUnsavedConfirmDialog",
|
|
3533
|
-
props: /* @__PURE__ */
|
|
3551
|
+
props: /* @__PURE__ */ We({
|
|
3534
3552
|
title: { default: void 0 },
|
|
3535
3553
|
body: { default: void 0 },
|
|
3536
3554
|
stayLabel: { default: void 0 },
|
|
@@ -3540,63 +3558,63 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
3540
3558
|
modelValue: { type: Boolean, required: !0 },
|
|
3541
3559
|
modelModifiers: {}
|
|
3542
3560
|
}),
|
|
3543
|
-
emits: /* @__PURE__ */
|
|
3561
|
+
emits: /* @__PURE__ */ We(["resolve"], ["update:modelValue"]),
|
|
3544
3562
|
setup(e, { emit: k }) {
|
|
3545
|
-
const l = k, n = yt(e, "modelValue"), { t: i } =
|
|
3563
|
+
const l = k, n = yt(e, "modelValue"), { t: i } = lt(), m = () => {
|
|
3546
3564
|
l("resolve", !1);
|
|
3547
3565
|
}, w = () => {
|
|
3548
3566
|
l("resolve", !0);
|
|
3549
3567
|
};
|
|
3550
|
-
return (
|
|
3568
|
+
return (E, b) => (x(), te(an, {
|
|
3551
3569
|
modelValue: n.value,
|
|
3552
|
-
"onUpdate:modelValue":
|
|
3570
|
+
"onUpdate:modelValue": b[0] || (b[0] = (c) => n.value = c),
|
|
3553
3571
|
"max-width": "480",
|
|
3554
3572
|
persistent: ""
|
|
3555
3573
|
}, {
|
|
3556
3574
|
default: u(() => [
|
|
3557
|
-
|
|
3575
|
+
r(nn, null, {
|
|
3558
3576
|
default: u(() => [
|
|
3559
|
-
|
|
3577
|
+
r(la, null, {
|
|
3560
3578
|
default: u(() => [
|
|
3561
|
-
|
|
3579
|
+
Q(V(e.title ?? y(i)("common.sortable.unsavedChanges.title")), 1)
|
|
3562
3580
|
]),
|
|
3563
3581
|
_: 1
|
|
3564
3582
|
}),
|
|
3565
|
-
|
|
3583
|
+
r(Kt, null, {
|
|
3566
3584
|
default: u(() => [
|
|
3567
|
-
e.body ? (x(), N(
|
|
3568
|
-
|
|
3569
|
-
], 64)) : e.dirtyLabels.length ? (x(), N(
|
|
3570
|
-
|
|
3585
|
+
e.body ? (x(), N(xe, { key: 0 }, [
|
|
3586
|
+
Q(V(e.body), 1)
|
|
3587
|
+
], 64)) : e.dirtyLabels.length ? (x(), N(xe, { key: 1 }, [
|
|
3588
|
+
Q(V(y(i)("common.sortable.unsavedChanges.sectionsIntro")) + " ", 1),
|
|
3571
3589
|
U("ul", ti, [
|
|
3572
|
-
(x(!0), N(
|
|
3590
|
+
(x(!0), N(xe, null, st(e.dirtyLabels, (c, h) => (x(), N("li", { key: h }, V(c), 1))), 128))
|
|
3573
3591
|
]),
|
|
3574
|
-
|
|
3575
|
-
], 64)) : (x(), N(
|
|
3576
|
-
|
|
3592
|
+
Q(" " + V(y(i)("common.sortable.unsavedChanges.leaveQuestion")), 1)
|
|
3593
|
+
], 64)) : (x(), N(xe, { key: 2 }, [
|
|
3594
|
+
Q(V(y(i)("common.sortable.unsavedChanges.body")), 1)
|
|
3577
3595
|
], 64))
|
|
3578
3596
|
]),
|
|
3579
3597
|
_: 1
|
|
3580
3598
|
}),
|
|
3581
|
-
|
|
3599
|
+
r(ia, null, {
|
|
3582
3600
|
default: u(() => [
|
|
3583
|
-
|
|
3584
|
-
|
|
3601
|
+
r(on),
|
|
3602
|
+
r(se, {
|
|
3585
3603
|
variant: "text",
|
|
3586
|
-
onClick:
|
|
3604
|
+
onClick: m
|
|
3587
3605
|
}, {
|
|
3588
3606
|
default: u(() => [
|
|
3589
|
-
|
|
3607
|
+
Q(V(e.stayLabel ?? y(i)("common.sortable.unsavedChanges.stay")), 1)
|
|
3590
3608
|
]),
|
|
3591
3609
|
_: 1
|
|
3592
3610
|
}),
|
|
3593
|
-
|
|
3611
|
+
r(se, {
|
|
3594
3612
|
color: "warning",
|
|
3595
3613
|
variant: "flat",
|
|
3596
3614
|
onClick: w
|
|
3597
3615
|
}, {
|
|
3598
3616
|
default: u(() => [
|
|
3599
|
-
|
|
3617
|
+
Q(V(e.discardLabel ?? y(i)("common.sortable.unsavedChanges.discard")), 1)
|
|
3600
3618
|
]),
|
|
3601
3619
|
_: 1
|
|
3602
3620
|
})
|
|
@@ -3610,33 +3628,33 @@ const Mt = (e, k) => e.find((l) => l.key === k) ?? null, sa = (e, k, l) => {
|
|
|
3610
3628
|
_: 1
|
|
3611
3629
|
}, 8, ["modelValue"]));
|
|
3612
3630
|
}
|
|
3613
|
-
}), zi = /* @__PURE__ */ _n(ni, [["__scopeId", "data-v-8342a164"]]), ai = (e) => e == null ? !1 : typeof e == "boolean" ? e : e instanceof Set ? e.size > 0 : Array.isArray(e) ? e.length > 0 : !!e,
|
|
3631
|
+
}), zi = /* @__PURE__ */ _n(ni, [["__scopeId", "data-v-8342a164"]]), ai = (e) => e == null ? !1 : typeof e == "boolean" ? e : e instanceof Set ? e.size > 0 : Array.isArray(e) ? e.length > 0 : !!e, Sn = (e, k) => e === void 0 ? k : typeof e == "boolean" ? e : e.value;
|
|
3614
3632
|
function Ni(e) {
|
|
3615
3633
|
const k = ho();
|
|
3616
3634
|
if (e.ownSections) {
|
|
3617
|
-
const c = e.ownSections, h = /* @__PURE__ */ Symbol("unsaved.section.own"),
|
|
3635
|
+
const c = e.ownSections, h = /* @__PURE__ */ Symbol("unsaved.section.own"), I = S(() => {
|
|
3618
3636
|
const j = c();
|
|
3619
3637
|
return Array.isArray(j) ? j : [j];
|
|
3620
3638
|
});
|
|
3621
|
-
k.register(h,
|
|
3639
|
+
k.register(h, I);
|
|
3622
3640
|
}
|
|
3623
|
-
const l =
|
|
3641
|
+
const l = S(
|
|
3624
3642
|
() => e.sources.some((c) => ai(c.value)) || k.dirtyLabels.value.length > 0
|
|
3625
|
-
), n =
|
|
3626
|
-
let i = null,
|
|
3627
|
-
const w = () =>
|
|
3643
|
+
), n = de(!1);
|
|
3644
|
+
let i = null, m = !1;
|
|
3645
|
+
const w = () => m ? (m = !1, Promise.resolve(!0)) : new Promise((c) => {
|
|
3628
3646
|
i = c, n.value = !0;
|
|
3629
|
-
}),
|
|
3647
|
+
}), E = (c) => {
|
|
3630
3648
|
n.value = !1, i && (i(c), i = null);
|
|
3631
|
-
},
|
|
3632
|
-
|
|
3649
|
+
}, b = () => {
|
|
3650
|
+
m = !0;
|
|
3633
3651
|
};
|
|
3634
|
-
if (
|
|
3652
|
+
if (Sn(e.guardRoute, !0) && na())
|
|
3635
3653
|
try {
|
|
3636
|
-
|
|
3654
|
+
Eo(async () => l.value ? await w() : !0);
|
|
3637
3655
|
} catch {
|
|
3638
3656
|
}
|
|
3639
|
-
if (
|
|
3657
|
+
if (Sn(e.guardWindowUnload, !0)) {
|
|
3640
3658
|
const c = (h) => {
|
|
3641
3659
|
l.value && (h.preventDefault(), h.returnValue = "");
|
|
3642
3660
|
};
|
|
@@ -3647,36 +3665,36 @@ function Ni(e) {
|
|
|
3647
3665
|
if (e.guardDialogModel) {
|
|
3648
3666
|
const c = e.guardDialogModel;
|
|
3649
3667
|
let h = !1;
|
|
3650
|
-
|
|
3668
|
+
$e(c, async (I, j) => {
|
|
3651
3669
|
if (h) {
|
|
3652
3670
|
h = !1;
|
|
3653
3671
|
return;
|
|
3654
3672
|
}
|
|
3655
|
-
j === !0 &&
|
|
3673
|
+
j === !0 && I === !1 && l.value && (h = !0, c.value = !0, await w() && (h = !0, c.value = !1));
|
|
3656
3674
|
});
|
|
3657
3675
|
}
|
|
3658
3676
|
return {
|
|
3659
3677
|
hasUnsavedChanges: l,
|
|
3660
3678
|
dirtyLabels: k.dirtyLabels,
|
|
3661
3679
|
promptOpen: n,
|
|
3662
|
-
resolvePrompt:
|
|
3663
|
-
acknowledge:
|
|
3680
|
+
resolvePrompt: E,
|
|
3681
|
+
acknowledge: b
|
|
3664
3682
|
};
|
|
3665
3683
|
}
|
|
3666
3684
|
function Oi(e, k = {}) {
|
|
3667
|
-
const l = k.keyField ?? "id", n = k.positionField ?? "position", i = k.positionMultiplier ?? 1,
|
|
3668
|
-
|
|
3685
|
+
const l = k.keyField ?? "id", n = k.positionField ?? "position", i = k.positionMultiplier ?? 1, m = k.updatePosition === !0;
|
|
3686
|
+
m && l === n && console.warn(
|
|
3669
3687
|
`[list-editor] key-field === position-field ("${l}") 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").`
|
|
3670
3688
|
);
|
|
3671
|
-
const w = /* @__PURE__ */ new Set(),
|
|
3672
|
-
const
|
|
3689
|
+
const w = /* @__PURE__ */ new Set(), E = (D) => {
|
|
3690
|
+
const s = /* @__PURE__ */ new Set(), f = /* @__PURE__ */ new Set();
|
|
3673
3691
|
let T = 0;
|
|
3674
|
-
for (const
|
|
3675
|
-
if (
|
|
3692
|
+
for (const Y of D) {
|
|
3693
|
+
if (Y.key === void 0 || Y.key === null) {
|
|
3676
3694
|
T++;
|
|
3677
3695
|
continue;
|
|
3678
3696
|
}
|
|
3679
|
-
|
|
3697
|
+
s.has(Y.key) && f.add(String(Y.key)), s.add(Y.key);
|
|
3680
3698
|
}
|
|
3681
3699
|
if (T === 0 && f.size === 0) return;
|
|
3682
3700
|
const P = `${T}|${[...f].sort().join(",")}`;
|
|
@@ -3685,51 +3703,51 @@ function Oi(e, k = {}) {
|
|
|
3685
3703
|
), f.size > 0 && console.warn(
|
|
3686
3704
|
`[list-editor] duplicate row keys (key-field "${l}"): ${[...f].join(", ")}. Row keys must be unique — dirty tracking and validation rails target rows by key.`
|
|
3687
3705
|
));
|
|
3688
|
-
},
|
|
3689
|
-
const
|
|
3690
|
-
key:
|
|
3706
|
+
}, b = S(() => {
|
|
3707
|
+
const D = e.value.map((s, f) => ({
|
|
3708
|
+
key: s[l],
|
|
3691
3709
|
index: f,
|
|
3692
|
-
raw:
|
|
3693
|
-
position:
|
|
3710
|
+
raw: s,
|
|
3711
|
+
position: s[n]
|
|
3694
3712
|
}));
|
|
3695
|
-
return D
|
|
3696
|
-
}), c = (
|
|
3697
|
-
const
|
|
3698
|
-
return e.value =
|
|
3699
|
-
},
|
|
3700
|
-
const f =
|
|
3701
|
-
return j(
|
|
3702
|
-
},
|
|
3703
|
-
if (!
|
|
3704
|
-
if (
|
|
3705
|
-
const f = j(
|
|
3706
|
-
return f === -1 ?
|
|
3713
|
+
return E(D), D;
|
|
3714
|
+
}), c = (D) => go(D, { positionField: n, positionMultiplier: i }), h = (D) => {
|
|
3715
|
+
const s = m ? c(D) : D;
|
|
3716
|
+
return e.value = s, s;
|
|
3717
|
+
}, I = (D) => D !== null && typeof D == "object", j = (D, s) => D.findIndex((f) => f[l] === s), M = (D, s) => {
|
|
3718
|
+
const f = I(s) ? s[l] : s;
|
|
3719
|
+
return j(D, f);
|
|
3720
|
+
}, g = (D, s) => {
|
|
3721
|
+
if (!s) return D.length;
|
|
3722
|
+
if (s.afterId !== void 0) {
|
|
3723
|
+
const f = j(D, s.afterId);
|
|
3724
|
+
return f === -1 ? D.length : f + 1;
|
|
3707
3725
|
}
|
|
3708
|
-
return
|
|
3726
|
+
return s.afterIndex !== void 0 ? s.afterIndex < 0 ? D.length : Math.min(s.afterIndex + 1, D.length) : s.index !== void 0 ? Math.max(0, Math.min(s.index, D.length)) : D.length;
|
|
3709
3727
|
};
|
|
3710
3728
|
return {
|
|
3711
|
-
viewItems:
|
|
3712
|
-
addItem: (
|
|
3713
|
-
const f = [...e.value], T =
|
|
3714
|
-
return f.splice(T, 0,
|
|
3729
|
+
viewItems: b,
|
|
3730
|
+
addItem: (D, s) => {
|
|
3731
|
+
const f = [...e.value], T = g(f, s);
|
|
3732
|
+
return f.splice(T, 0, D), h(f);
|
|
3715
3733
|
},
|
|
3716
|
-
deleteItem: (
|
|
3717
|
-
const
|
|
3718
|
-
if (
|
|
3734
|
+
deleteItem: (D) => {
|
|
3735
|
+
const s = M(e.value, D);
|
|
3736
|
+
if (s === -1) return e.value;
|
|
3719
3737
|
const f = [...e.value];
|
|
3720
|
-
return f.splice(
|
|
3738
|
+
return f.splice(s, 1), h(f);
|
|
3721
3739
|
},
|
|
3722
|
-
updateItem: (
|
|
3723
|
-
const f = M(e.value,
|
|
3740
|
+
updateItem: (D, s) => {
|
|
3741
|
+
const f = M(e.value, D);
|
|
3724
3742
|
if (f === -1) return e.value;
|
|
3725
3743
|
const T = [...e.value];
|
|
3726
|
-
return T[f] =
|
|
3744
|
+
return T[f] = s, h(T);
|
|
3727
3745
|
},
|
|
3728
|
-
moveItem: (
|
|
3746
|
+
moveItem: (D, s) => {
|
|
3729
3747
|
const f = e.value.length;
|
|
3730
|
-
if (
|
|
3731
|
-
const T = [...e.value], [P] = T.splice(
|
|
3732
|
-
return T.splice(
|
|
3748
|
+
if (D === s || D < 0 || D >= f || s < 0 || s >= f) return e.value;
|
|
3749
|
+
const T = [...e.value], [P] = T.splice(D, 1);
|
|
3750
|
+
return T.splice(s, 0, P), h(T);
|
|
3733
3751
|
},
|
|
3734
3752
|
recalculatePositions: c
|
|
3735
3753
|
};
|
|
@@ -3740,17 +3758,17 @@ const oi = /* @__PURE__ */ Symbol(
|
|
|
3740
3758
|
function ii(e) {
|
|
3741
3759
|
const k = mt(oi, null);
|
|
3742
3760
|
if (!k || !na()) return;
|
|
3743
|
-
const l = mt(li, null), n =
|
|
3761
|
+
const l = mt(li, null), n = S(() => {
|
|
3744
3762
|
if (e.invalid)
|
|
3745
3763
|
return e.invalid() && ((e.dirty?.() ?? !1) || (l?.value.has(e.key()) ?? !1)) ? "invalid" : null;
|
|
3746
|
-
const
|
|
3747
|
-
return
|
|
3764
|
+
const m = e.state;
|
|
3765
|
+
return m === void 0 ? null : typeof m == "function" ? m() : m.value;
|
|
3748
3766
|
});
|
|
3749
3767
|
let i = null;
|
|
3750
|
-
|
|
3768
|
+
$e(
|
|
3751
3769
|
e.key,
|
|
3752
|
-
(
|
|
3753
|
-
i !== null && i !==
|
|
3770
|
+
(m) => {
|
|
3771
|
+
i !== null && i !== m && k.unregister(i), k.register(m, n), i = m;
|
|
3754
3772
|
},
|
|
3755
3773
|
{ immediate: !0 }
|
|
3756
3774
|
), tn(() => {
|
|
@@ -3765,16 +3783,16 @@ function Ui(e, k) {
|
|
|
3765
3783
|
});
|
|
3766
3784
|
}
|
|
3767
3785
|
function ji() {
|
|
3768
|
-
const e =
|
|
3769
|
-
|
|
3770
|
-
}, i =
|
|
3786
|
+
const e = de(/* @__PURE__ */ new Map()), k = /* @__PURE__ */ new Set(), l = (w) => e.value.get(w) ?? k, n = (w, E) => {
|
|
3787
|
+
E.size === 0 ? e.value.delete(w) : e.value.set(w, E), e.value = new Map(e.value);
|
|
3788
|
+
}, i = S(() => {
|
|
3771
3789
|
const w = /* @__PURE__ */ new Set();
|
|
3772
|
-
for (const [
|
|
3773
|
-
for (const c of
|
|
3774
|
-
w.add(`${String(
|
|
3790
|
+
for (const [E, b] of e.value.entries())
|
|
3791
|
+
for (const c of b)
|
|
3792
|
+
w.add(`${String(E)}:${String(c)}`);
|
|
3775
3793
|
return w;
|
|
3776
|
-
}),
|
|
3777
|
-
return { getForParent: l, setForParent: n, merged: i, count:
|
|
3794
|
+
}), m = S(() => i.value.size);
|
|
3795
|
+
return { getForParent: l, setForParent: n, merged: i, count: m };
|
|
3778
3796
|
}
|
|
3779
3797
|
export {
|
|
3780
3798
|
Ti as ADatatableOrdering,
|
|
@@ -3787,40 +3805,40 @@ export {
|
|
|
3787
3805
|
Qi as AFilterString,
|
|
3788
3806
|
Zi as AFilterTimeInterval,
|
|
3789
3807
|
_i as AFilterValueObjectOptionsSelect,
|
|
3790
|
-
|
|
3808
|
+
es as AFilterWrapper,
|
|
3791
3809
|
$i as AFilterWrapperSidebar,
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3810
|
+
ts as AFilterWrapperSubjectSelect,
|
|
3811
|
+
ns as AFormRemoteAutocomplete,
|
|
3812
|
+
as as AFormRemoteAutocompleteWithCached,
|
|
3795
3813
|
Vi as AListEditor,
|
|
3796
3814
|
Mi as ANestedSortableListEditor,
|
|
3797
|
-
|
|
3815
|
+
os as ASortableListEditor,
|
|
3798
3816
|
Li as ASubjectSelect,
|
|
3799
3817
|
zi as AUnsavedConfirmDialog,
|
|
3800
|
-
|
|
3818
|
+
An as DatatablePaginationKey,
|
|
3801
3819
|
Ka as FilterConfigKey,
|
|
3802
3820
|
Ba as FilterDataKey,
|
|
3803
|
-
|
|
3804
|
-
|
|
3821
|
+
ls as FilterInnerConfigKey,
|
|
3822
|
+
is as FilterInnerDataKey,
|
|
3805
3823
|
oi as ListEditorValidationKey,
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3824
|
+
ss as SharedReorderRegistryKey,
|
|
3825
|
+
rs as TimeIntervalSpecialOptions,
|
|
3826
|
+
ds as UserAdminConfigLayoutType,
|
|
3827
|
+
cs as UserAdminConfigLayoutTypeDefault,
|
|
3828
|
+
us as UserAdminConfigType,
|
|
3829
|
+
fs as UserAdminConfigTypeDefault,
|
|
3812
3830
|
Oo as createDatatableColumnsConfig,
|
|
3813
|
-
|
|
3814
|
-
|
|
3831
|
+
vs as createFilter,
|
|
3832
|
+
ms as createFilterStore,
|
|
3815
3833
|
Qt as generateListQuery,
|
|
3816
3834
|
ao as nextListEditorTempId,
|
|
3817
3835
|
go as renumberPositions,
|
|
3818
|
-
|
|
3836
|
+
ys as sortByPosition,
|
|
3819
3837
|
Fi as useApiFetchByIds,
|
|
3820
3838
|
Ga as useApiFetchList,
|
|
3821
3839
|
Ki as useApiFetchListBatch,
|
|
3822
3840
|
za as useApiQueryBuilder,
|
|
3823
|
-
|
|
3841
|
+
hs as useApiRequest,
|
|
3824
3842
|
_a as useFilterHelpers,
|
|
3825
3843
|
Bi as useJobApi,
|
|
3826
3844
|
Oi as useListEditor,
|
|
@@ -3834,7 +3852,7 @@ export {
|
|
|
3834
3852
|
Ri as useSubjectSelect,
|
|
3835
3853
|
Ni as useUnsavedChangesGuard,
|
|
3836
3854
|
Jn as useUnsavedSection,
|
|
3837
|
-
|
|
3838
|
-
|
|
3855
|
+
gs as useUserAdminConfigApi,
|
|
3856
|
+
ps as useUserAdminConfigFactory
|
|
3839
3857
|
};
|
|
3840
3858
|
//# sourceMappingURL=labs.js.map
|