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