@anzusystems/common-admin 1.47.0-beta.dev-1788935858 → 1.47.0-beta.dev-1789894877
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-CAnBocBD.mjs → AFormRemoteAutocomplete-DtEeZY57.mjs} +4615 -4498
- package/dist/AFormRemoteAutocomplete-DtEeZY57.mjs.map +1 -0
- package/dist/common-admin.css +1 -1
- package/dist/common-admin.d.ts +561 -485
- package/dist/common-admin.js +9880 -7816
- package/dist/common-admin.js.map +1 -1
- package/dist/{esm-5MBsZiLM.mjs → esm-DmynC16A.mjs} +2 -2
- package/dist/{esm-5MBsZiLM.mjs.map → esm-DmynC16A.mjs.map} +1 -1
- package/dist/labs.d.ts +672 -55
- package/dist/labs.js +1728 -1277
- package/dist/labs.js.map +1 -1
- package/dist/playground/cropper-landscape.png +0 -0
- package/dist/playground/cropper-portrait.png +0 -0
- package/dist/playground/cropper-small.png +0 -0
- package/dist/playground/cropper-wide.png +0 -0
- package/dist/{webfontloader-DwTbqvVe.mjs → webfontloader-DKErl27O.mjs} +2 -2
- package/dist/{webfontloader-DwTbqvVe.mjs.map → webfontloader-DKErl27O.mjs.map} +1 -1
- package/package.json +10 -7
- package/src/eslint/plugin.d.mts +20 -0
- package/src/eslint/plugin.mjs +160 -10
- package/dist/AFormRemoteAutocomplete-CAnBocBD.mjs.map +0 -1
package/dist/labs.js
CHANGED
|
@@ -1,55 +1,57 @@
|
|
|
1
|
-
import { $ as e,
|
|
2
|
-
import { Fragment as
|
|
3
|
-
import { useI18n as
|
|
4
|
-
import { VSpacer as
|
|
5
|
-
import { VAlert as
|
|
6
|
-
import { VIcon as
|
|
7
|
-
import { VProgressCircular as
|
|
8
|
-
import { VCard as
|
|
9
|
-
import { VTooltip as
|
|
10
|
-
import { useDebounceFn as
|
|
11
|
-
import { Intersect as
|
|
12
|
-
import { useDisplay as
|
|
13
|
-
import { VBtn as
|
|
14
|
-
import { VBtnToggle as
|
|
15
|
-
import { VList as
|
|
16
|
-
import { VMenu as
|
|
17
|
-
import { VToolbar as
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
1
|
+
import { $ as e, A as t, At as n, B as r, Bt as i, C as a, Ci as o, Ct as s, D as c, Di as l, Dt as u, E as d, Et as f, F as p, Fn as m, G as h, Gt as g, H as _, Ht as v, I as y, J as b, Jt as ee, K as x, Kt as te, L as ne, M as S, N as C, Nt as w, O as re, Ot as ie, P as ae, Q as oe, Qn as se, R as ce, S as le, Si as ue, St as de, T as fe, Ti as pe, Tt as me, U as he, Ut as ge, V as _e, Vt as T, W as E, Wt as ve, Xt as ye, Y as be, Yt as xe, Z as Se, Zt as Ce, _ as we, _t as Te, a as Ee, ai as De, at as Oe, b as ke, bi as Ae, bt as je, c as Me, cn as Ne, ct as Pe, d as Fe, di as Ie, dt as D, f as Le, fi as Re, ft as ze, g as Be, gt as Ve, h as He, hr as Ue, ht as We, i as Ge, ii as Ke, ir as O, it as qe, j as Je, k as Ye, l as Xe, lr as Ze, lt as Qe, m as $e, mt as et, n as tt, nt, o as rt, or as it, ot as at, p as ot, pi as st, pr as ct, pt as lt, q as ut, qt as dt, r as ft, rr as pt, rt as mt, s as ht, st as gt, t as _t, tt as vt, u as yt, ui as bt, ut as xt, v as St, vt as Ct, w as wt, wi as k, wt as Tt, x as Et, xn as Dt, xt as Ot, y as kt, yt as At, z as jt, zt as Mt } from "./AFormRemoteAutocomplete-DtEeZY57.mjs";
|
|
2
|
+
import { Fragment as A, computed as j, createBlock as M, createCommentVNode as N, createElementBlock as P, createElementVNode as F, createTextVNode as I, createVNode as L, defineComponent as R, guardReactiveProps as Nt, inject as Pt, isRef as Ft, mergeModels as It, mergeProps as z, nextTick as Lt, normalizeClass as Rt, normalizeProps as zt, normalizeStyle as Bt, onBeforeUnmount as Vt, onMounted as Ht, openBlock as B, provide as Ut, ref as V, renderList as Wt, renderSlot as H, resolveComponent as Gt, shallowRef as Kt, toDisplayString as U, toRaw as qt, unref as W, useModel as Jt, useSlots as Yt, useTemplateRef as Xt, vShow as Zt, watch as G, withCtx as K, withDirectives as Qt, withKeys as $t, withModifiers as q } from "vue";
|
|
3
|
+
import { useI18n as en } from "vue-i18n";
|
|
4
|
+
import { VCol as J, VRow as tn, VSpacer as nn } from "vuetify/components/VGrid";
|
|
5
|
+
import { VAlert as rn } from "vuetify/components/VAlert";
|
|
6
|
+
import { VIcon as Y } from "vuetify/components/VIcon";
|
|
7
|
+
import { VProgressCircular as an } from "vuetify/components/VProgressCircular";
|
|
8
|
+
import { VCard as on, VCardActions as sn, VCardText as cn, VCardTitle as ln } from "vuetify/components/VCard";
|
|
9
|
+
import { VTooltip as un } from "vuetify/components/VTooltip";
|
|
10
|
+
import { useDebounceFn as dn, useThrottleFn as fn } from "@vueuse/core";
|
|
11
|
+
import { Intersect as pn } from "vuetify/directives";
|
|
12
|
+
import { useDisplay as mn } from "vuetify";
|
|
13
|
+
import { VBtn as X } from "vuetify/components/VBtn";
|
|
14
|
+
import { VBtnToggle as hn } from "vuetify/components/VBtnToggle";
|
|
15
|
+
import { VList as Z, VListItem as Q, VListItemTitle as $ } from "vuetify/components/VList";
|
|
16
|
+
import { VMenu as gn } from "vuetify/components/VMenu";
|
|
17
|
+
import { VToolbar as _n } from "vuetify/components/VToolbar";
|
|
18
|
+
import { useRouter as vn } from "vue-router";
|
|
19
|
+
import { VDialog as yn } from "vuetify/components/VDialog";
|
|
20
|
+
import { VSelect as bn } from "vuetify/components/VSelect";
|
|
21
|
+
import { VDivider as xn } from "vuetify/components/VDivider";
|
|
22
|
+
import { VForm as Sn } from "vuetify/components/VForm";
|
|
23
|
+
import { VDataTableServer as Cn } from "vuetify/components/VDataTable";
|
|
24
|
+
import { VRadio as wn } from "vuetify/components/VRadio";
|
|
25
|
+
import { VRadioGroup as Tn } from "vuetify/components/VRadioGroup";
|
|
24
26
|
//#endregion
|
|
25
27
|
//#region src/labs/filters/AFilterWrapperSidebar.vue
|
|
26
|
-
var
|
|
28
|
+
var En = /* @__PURE__ */ R({
|
|
27
29
|
__name: "AFilterWrapperSidebar",
|
|
28
30
|
props: { formName: { default: "search" } },
|
|
29
31
|
emits: ["submit"],
|
|
30
32
|
setup(e, { expose: t, emit: n }) {
|
|
31
|
-
let
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
let { clearAll: c, clearAllFilterSelected: l } =
|
|
37
|
-
|
|
33
|
+
let r = n, i = Pt(At), a = Pt(je);
|
|
34
|
+
if (k(i) || k(a)) throw Error("Incorrect provide/inject config.");
|
|
35
|
+
Ut(Tt, V(0));
|
|
36
|
+
let o = V(/* @__PURE__ */ new Map());
|
|
37
|
+
Ut(s, o);
|
|
38
|
+
let { clearAll: c, clearAllFilterSelected: l } = We(), u = () => {
|
|
39
|
+
r("submit");
|
|
38
40
|
};
|
|
39
41
|
return t({ resetFilter: () => {
|
|
40
|
-
c(
|
|
41
|
-
} }), (t, n) => (
|
|
42
|
+
c(a, i), l(a, i, o);
|
|
43
|
+
} }), (t, n) => (B(), M(Sn, {
|
|
42
44
|
name: e.formName,
|
|
43
|
-
onSubmit:
|
|
44
|
-
onKeyup:
|
|
45
|
+
onSubmit: q(u, ["prevent"]),
|
|
46
|
+
onKeyup: $t(u, ["enter"])
|
|
45
47
|
}, {
|
|
46
|
-
default:
|
|
48
|
+
default: K(() => [H(t.$slots, "default")]),
|
|
47
49
|
_: 3
|
|
48
50
|
}, 8, ["name"]));
|
|
49
51
|
}
|
|
50
|
-
}),
|
|
52
|
+
}), Dn = { class: "d-flex align-center justify-center" }, On = { class: "text-body-small mr-1" }, kn = /* @__PURE__ */ R({
|
|
51
53
|
__name: "ADatatableOrdering",
|
|
52
|
-
props: /*@__PURE__*/
|
|
54
|
+
props: /*@__PURE__*/ It({
|
|
53
55
|
variant: { default: "id" },
|
|
54
56
|
customOptions: { default: void 0 },
|
|
55
57
|
paginationUpdateCustomCb: {
|
|
@@ -63,45 +65,45 @@ var xn = /* @__PURE__ */ z({
|
|
|
63
65
|
},
|
|
64
66
|
modelModifiers: {}
|
|
65
67
|
}),
|
|
66
|
-
emits: /*@__PURE__*/
|
|
68
|
+
emits: /*@__PURE__*/ It(["sortByChange"], ["update:modelValue"]),
|
|
67
69
|
setup(e, { emit: t }) {
|
|
68
|
-
let n = e, r = t, i =
|
|
69
|
-
if (
|
|
70
|
-
let { t: o } =
|
|
70
|
+
let n = e, r = t, i = Jt(e, "modelValue"), a = Pt(Ct);
|
|
71
|
+
if (k(a)) throw Error("Incorrect provide/inject config.");
|
|
72
|
+
let { t: o } = en(), s = [{
|
|
71
73
|
id: 1,
|
|
72
74
|
titleT: "common.system.datatable.ordering.mostRecent",
|
|
73
75
|
sortBy: {
|
|
74
76
|
key: "createdAt",
|
|
75
|
-
order:
|
|
77
|
+
order: Ze.Desc
|
|
76
78
|
}
|
|
77
79
|
}, {
|
|
78
80
|
id: 2,
|
|
79
81
|
titleT: "common.system.datatable.ordering.oldest",
|
|
80
82
|
sortBy: {
|
|
81
83
|
key: "createdAt",
|
|
82
|
-
order:
|
|
84
|
+
order: Ze.Asc
|
|
83
85
|
}
|
|
84
86
|
}], c = [{
|
|
85
87
|
id: 1,
|
|
86
88
|
titleT: "common.system.datatable.ordering.mostRecent",
|
|
87
89
|
sortBy: {
|
|
88
90
|
key: "id",
|
|
89
|
-
order:
|
|
91
|
+
order: Ze.Desc
|
|
90
92
|
}
|
|
91
93
|
}, {
|
|
92
94
|
id: 2,
|
|
93
95
|
titleT: "common.system.datatable.ordering.oldest",
|
|
94
96
|
sortBy: {
|
|
95
97
|
key: "id",
|
|
96
|
-
order:
|
|
98
|
+
order: Ze.Asc
|
|
97
99
|
}
|
|
98
100
|
}], l = [
|
|
99
101
|
{
|
|
100
102
|
id: 3,
|
|
101
103
|
titleT: "common.system.datatable.ordering.mostRelevant",
|
|
102
104
|
sortBy: {
|
|
103
|
-
key:
|
|
104
|
-
order:
|
|
105
|
+
key: it,
|
|
106
|
+
order: Ze.Desc
|
|
105
107
|
}
|
|
106
108
|
},
|
|
107
109
|
{
|
|
@@ -109,7 +111,7 @@ var xn = /* @__PURE__ */ z({
|
|
|
109
111
|
titleT: "common.system.datatable.ordering.mostRecent",
|
|
110
112
|
sortBy: {
|
|
111
113
|
key: "createdAt",
|
|
112
|
-
order:
|
|
114
|
+
order: Ze.Desc
|
|
113
115
|
}
|
|
114
116
|
},
|
|
115
117
|
{
|
|
@@ -117,13 +119,13 @@ var xn = /* @__PURE__ */ z({
|
|
|
117
119
|
titleT: "common.system.datatable.ordering.oldest",
|
|
118
120
|
sortBy: {
|
|
119
121
|
key: "createdAt",
|
|
120
|
-
order:
|
|
122
|
+
order: Ze.Asc
|
|
121
123
|
}
|
|
122
124
|
}
|
|
123
|
-
], u =
|
|
125
|
+
], u = j(() => {
|
|
124
126
|
let e = d.value.find((e) => e.id === i.value);
|
|
125
127
|
return e ? o(e.titleT) : "";
|
|
126
|
-
}), d =
|
|
128
|
+
}), d = j(() => n.customOptions ? n.customOptions : n.variant === "most-relevant" ? l : n.variant === "id" ? c : s), f = (e) => {
|
|
127
129
|
i.value = e.id;
|
|
128
130
|
}, p = (e) => {
|
|
129
131
|
if (!e.sortBy) {
|
|
@@ -135,42 +137,42 @@ var xn = /* @__PURE__ */ z({
|
|
|
135
137
|
}
|
|
136
138
|
a.value.sortBy = e.sortBy, r("sortByChange", e);
|
|
137
139
|
};
|
|
138
|
-
return
|
|
140
|
+
return G(i, (e, t) => {
|
|
139
141
|
if (e === t) return;
|
|
140
142
|
let r = d.value.find((t) => t.id === e);
|
|
141
|
-
if (!
|
|
142
|
-
if (
|
|
143
|
+
if (!k(r)) {
|
|
144
|
+
if (k(n.paginationUpdateCustomCb)) {
|
|
143
145
|
p(r);
|
|
144
146
|
return;
|
|
145
147
|
}
|
|
146
148
|
n.paginationUpdateCustomCb(r, a);
|
|
147
149
|
}
|
|
148
|
-
}),
|
|
150
|
+
}), G(a, (e, t) => {
|
|
149
151
|
if (e.sortBy?.key === t?.sortBy?.key && e.sortBy?.order === t?.sortBy?.order) return;
|
|
150
152
|
let n = d.value.find((t) => e.sortBy?.key === t.sortBy?.key && e.sortBy?.order === t.sortBy?.order);
|
|
151
|
-
|
|
152
|
-
}, { immediate: !0 }), (e, t) => (
|
|
153
|
+
k(n) || (i.value = n.id);
|
|
154
|
+
}, { immediate: !0 }), (e, t) => (B(), P("div", Dn, [F("div", On, U(W(o)("common.system.datatable.ordering.title")) + ":", 1), L(X, {
|
|
153
155
|
variant: "text",
|
|
154
156
|
rounded: "xl",
|
|
155
157
|
size: "small",
|
|
156
158
|
class: "text-medium-emphasis",
|
|
157
159
|
"append-icon": "mdi-chevron-down"
|
|
158
160
|
}, {
|
|
159
|
-
default:
|
|
161
|
+
default: K(() => [I(U(u.value) + " ", 1), L(gn, {
|
|
160
162
|
activator: "parent",
|
|
161
163
|
location: "bottom",
|
|
162
164
|
"close-on-content-click": ""
|
|
163
165
|
}, {
|
|
164
|
-
default:
|
|
166
|
+
default: K(() => [L(Z, {
|
|
165
167
|
density: "compact",
|
|
166
168
|
class: "pa-0"
|
|
167
169
|
}, {
|
|
168
|
-
default:
|
|
170
|
+
default: K(() => [(B(!0), P(A, null, Wt(d.value, (e) => (B(), M(Q, {
|
|
169
171
|
key: e.id,
|
|
170
172
|
onClick: (t) => f(e)
|
|
171
173
|
}, {
|
|
172
|
-
default:
|
|
173
|
-
default:
|
|
174
|
+
default: K(() => [L($, { class: Rt({ "font-weight-bold": e.id === i.value }) }, {
|
|
175
|
+
default: K(() => [I(U(W(o)(e.titleT)), 1)]),
|
|
174
176
|
_: 2
|
|
175
177
|
}, 1032, ["class"])]),
|
|
176
178
|
_: 2
|
|
@@ -182,10 +184,10 @@ var xn = /* @__PURE__ */ z({
|
|
|
182
184
|
_: 1
|
|
183
185
|
})]));
|
|
184
186
|
}
|
|
185
|
-
}),
|
|
187
|
+
}), An = { class: "anzu-data-footer" }, jn = {
|
|
186
188
|
key: 0,
|
|
187
189
|
class: "anzu-data-footer__page-limit"
|
|
188
|
-
},
|
|
190
|
+
}, Mn = { class: "anzu-data-footer__pagination" }, Nn = { class: "anzu-data-footer__icons-before" }, Pn = { class: "current-page" }, Fn = { class: "anzu-data-footer__icons-after" }, In = /* @__PURE__ */ R({
|
|
189
191
|
__name: "ADatatablePagination",
|
|
190
192
|
props: {
|
|
191
193
|
itemsPerPageOptions: { default: () => [
|
|
@@ -200,214 +202,280 @@ var xn = /* @__PURE__ */ z({
|
|
|
200
202
|
},
|
|
201
203
|
emits: ["change"],
|
|
202
204
|
setup(e, { emit: t }) {
|
|
203
|
-
let n = t, r =
|
|
204
|
-
if (
|
|
205
|
-
let { t: i } =
|
|
206
|
-
|
|
205
|
+
let n = t, r = Pt(Ct);
|
|
206
|
+
if (k(r)) throw Error("Incorrect provide/inject config.");
|
|
207
|
+
let { t: i } = en(), { setStoredPage: a } = u(), o = Pt(Te, void 0), s = Pt(At, void 0), c = j(() => o ?? f(s?.general.system, s?.general.subject)), l = j(() => Math.ceil(r.value.totalCount / r.value.rowsPerPage)), d = j(() => r.value.page * r.value.rowsPerPage - r.value.rowsPerPage + 1), p = j(() => r.value.page * r.value.rowsPerPage - r.value.rowsPerPage + r.value.currentViewCount), m = j(() => r.value.page === 1), h = j(() => !Ae(r.value.hasNextPage) || r.value.page >= l.value), g = j(() => Ae(r.value.hasNextPage) && r.value.page >= l.value || r.value.hasNextPage === !1), _ = j(() => Ae(r.value.hasNextPage) ? r.value.totalCount : r.value.hasNextPage ? p.value + 1 + "+" : p.value);
|
|
208
|
+
G(() => r.value.rowsPerPage, (e, t) => {
|
|
207
209
|
e !== t && (r.value.page = 1, n("change"));
|
|
208
|
-
}),
|
|
209
|
-
e !== t && (a(
|
|
210
|
+
}), G(() => r.value.page, (e, t) => {
|
|
211
|
+
e !== t && (a(c.value, e), n("change"));
|
|
210
212
|
});
|
|
211
|
-
let
|
|
213
|
+
let v = fn(() => {
|
|
212
214
|
r.value.page = 1;
|
|
213
|
-
}, 300, !1),
|
|
214
|
-
r.value.page =
|
|
215
|
-
}, 300, !1),
|
|
215
|
+
}, 300, !1), y = fn(() => {
|
|
216
|
+
r.value.page = l.value;
|
|
217
|
+
}, 300, !1), b = fn(() => {
|
|
216
218
|
r.value.page = r.value.page - 1;
|
|
217
|
-
}, 300, !1),
|
|
219
|
+
}, 300, !1), ee = fn(() => {
|
|
218
220
|
r.value.page = r.value.page + 1;
|
|
219
221
|
}, 300, !1);
|
|
220
|
-
return (t, n) => (
|
|
221
|
-
e.hideRecordsPerPage ?
|
|
222
|
-
modelValue:
|
|
223
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
222
|
+
return (t, n) => (B(), P("div", An, [
|
|
223
|
+
e.hideRecordsPerPage ? N("", !0) : (B(), P("div", jn, [I(U(W(i)("common.system.datatable.itemsPerPage")) + ": ", 1), L(hn, {
|
|
224
|
+
modelValue: W(r).rowsPerPage,
|
|
225
|
+
"onUpdate:modelValue": n[0] ||= (e) => W(r).rowsPerPage = e,
|
|
224
226
|
class: "ml-2",
|
|
225
227
|
density: "compact",
|
|
226
228
|
mandatory: "",
|
|
227
229
|
"data-cy": "table-size"
|
|
228
230
|
}, {
|
|
229
|
-
default:
|
|
231
|
+
default: K(() => [(B(!0), P(A, null, Wt(e.itemsPerPageOptions, (e) => (B(), M(X, {
|
|
230
232
|
key: e,
|
|
231
|
-
color: e ===
|
|
233
|
+
color: e === W(r).rowsPerPage ? "secondary" : "",
|
|
232
234
|
value: e,
|
|
233
235
|
density: "compact",
|
|
234
236
|
size: "small",
|
|
235
237
|
variant: "text"
|
|
236
238
|
}, {
|
|
237
|
-
default:
|
|
239
|
+
default: K(() => [I(U(e), 1)]),
|
|
238
240
|
_: 2
|
|
239
241
|
}, 1032, ["color", "value"]))), 128))]),
|
|
240
242
|
_: 1
|
|
241
243
|
}, 8, ["modelValue"])])),
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
disabled:
|
|
244
|
+
F("div", Mn, U(d.value) + " - " + U(p.value) + " " + U(W(i)("common.system.datatable.from")) + " " + U(_.value), 1),
|
|
245
|
+
F("div", Nn, [L(X, {
|
|
246
|
+
disabled: m.value,
|
|
245
247
|
icon: "mdi-page-first",
|
|
246
248
|
size: "small",
|
|
247
249
|
variant: "text",
|
|
248
|
-
onClick:
|
|
249
|
-
}, null, 8, ["disabled", "onClick"]),
|
|
250
|
-
disabled:
|
|
250
|
+
onClick: q(W(v), ["stop"])
|
|
251
|
+
}, null, 8, ["disabled", "onClick"]), L(X, {
|
|
252
|
+
disabled: m.value,
|
|
251
253
|
icon: "mdi-chevron-left",
|
|
252
254
|
size: "small",
|
|
253
255
|
variant: "text",
|
|
254
|
-
onClick:
|
|
256
|
+
onClick: q(W(b), ["stop"])
|
|
255
257
|
}, null, 8, ["disabled", "onClick"])]),
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
disabled:
|
|
258
|
+
F("div", Pn, [F("span", null, U(W(r).page), 1)]),
|
|
259
|
+
F("div", Fn, [L(X, {
|
|
260
|
+
disabled: g.value,
|
|
259
261
|
icon: "mdi-chevron-right",
|
|
260
262
|
size: "small",
|
|
261
263
|
variant: "text",
|
|
262
|
-
onClick:
|
|
263
|
-
}, null, 8, ["disabled", "onClick"]),
|
|
264
|
-
disabled:
|
|
264
|
+
onClick: q(W(ee), ["stop"])
|
|
265
|
+
}, null, 8, ["disabled", "onClick"]), L(X, {
|
|
266
|
+
disabled: h.value,
|
|
265
267
|
icon: "mdi-page-last",
|
|
266
268
|
size: "small",
|
|
267
269
|
variant: "text",
|
|
268
|
-
onClick:
|
|
270
|
+
onClick: q(W(y), ["stop"])
|
|
269
271
|
}, null, 8, ["disabled", "onClick"])])
|
|
270
272
|
]));
|
|
271
273
|
}
|
|
272
|
-
}),
|
|
273
|
-
let {
|
|
274
|
-
return r(l), i(1, l), a(n, !1), t ? c(n, e.join(",")) : s("in", n, e.join(",")), o();
|
|
275
|
-
}, Nn = (e) => {
|
|
276
|
-
let { client: t, system: n, entity: r, urlTemplate: i, urlParams: o, options: c = {}, isSearchApi: l = !1, field: d = "id", silentConsoleError: f = !1 } = e, m = /* @__PURE__ */ new Set();
|
|
274
|
+
}), Ln = (e) => {
|
|
275
|
+
let { client: t, system: n, entity: r, urlTemplate: i, urlParams: a, options: o = {}, cancelPrevious: s = !1 } = e, c = v({ cancelPrevious: s });
|
|
277
276
|
return {
|
|
278
|
-
|
|
279
|
-
let
|
|
280
|
-
m.add(g);
|
|
281
|
-
let { urlTemplate: _, urlParams: v } = h;
|
|
277
|
+
execute: async (e = {}) => {
|
|
278
|
+
let { urlTemplate: s, urlParams: l, signal: u } = e, d, f;
|
|
282
279
|
try {
|
|
283
|
-
let
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
280
|
+
let e = await c.run((e) => {
|
|
281
|
+
let n = st(s) ? s : i;
|
|
282
|
+
if (k(n)) throw new se(void 0, "Url template is undefined");
|
|
283
|
+
let r = st(l) ? l : a, c = k(r) ? n : Ce(n, r), u = t();
|
|
284
|
+
return d = c, u.get(c, {
|
|
285
|
+
...ve(o),
|
|
286
|
+
signal: e
|
|
287
|
+
});
|
|
288
|
+
}, u);
|
|
289
|
+
f = e.config;
|
|
290
|
+
let n = () => g(t, d, o, void 0, f);
|
|
291
|
+
if (!ye(e.status)) throw new m(e.status);
|
|
292
|
+
if (e.status === 204) return [];
|
|
293
|
+
if (!ge(e)) throw new m(e.status, void 0, "Expected a response body, url: " + n());
|
|
294
|
+
return Pe(e.data, e.status, n()).items;
|
|
293
295
|
} catch (e) {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
296
|
+
let i = {
|
|
297
|
+
system: n,
|
|
298
|
+
entity: r,
|
|
299
|
+
url: g(t, d, o, e, f)
|
|
300
|
+
};
|
|
301
|
+
throw ee(dt(e, i), i);
|
|
298
302
|
}
|
|
299
303
|
},
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
}
|
|
304
|
+
abort: c.abort,
|
|
305
|
+
loading: c.loading
|
|
303
306
|
};
|
|
304
|
-
},
|
|
305
|
-
|
|
307
|
+
}, Rn = class extends Error {
|
|
308
|
+
pageUrl;
|
|
309
|
+
failure;
|
|
310
|
+
dispatched;
|
|
311
|
+
constructor(e, t, n) {
|
|
312
|
+
super("Batch page failed"), this.pageUrl = e, this.failure = t, this.dispatched = n, this.name = "PageFailure";
|
|
313
|
+
}
|
|
314
|
+
}, zn = (e) => {
|
|
315
|
+
let { client: t, system: n, entity: r, urlTemplate: i, urlParams: a, options: o = {}, cancelPrevious: s = !1 } = e, c = v({ cancelPrevious: s });
|
|
306
316
|
return {
|
|
307
|
-
|
|
308
|
-
let h =
|
|
309
|
-
d.add(h);
|
|
310
|
-
let { urlTemplate: g, urlParams: _, sortBy: v = "id", sortDesc: y = !0, batchSize: b = 100, forceElastic: ee = !1 } = m;
|
|
317
|
+
execute: async (e, s, l = {}) => {
|
|
318
|
+
let { urlTemplate: u, urlParams: d, sortBy: f = "id", sortDesc: p = !0, batchSize: h = 100, forceElastic: _ = !1, signal: v } = l;
|
|
311
319
|
try {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
})
|
|
327
|
-
|
|
320
|
+
return await c.run(async (n) => {
|
|
321
|
+
let r = st(u) ? u : i;
|
|
322
|
+
if (k(r)) throw new se(void 0, "Url template is undefined");
|
|
323
|
+
if (h < 1) throw new se(void 0, "batchSize must be at least 1, got " + h);
|
|
324
|
+
let c = st(d) ? d : a, l = s.general.elastic || _ ? "/search" : "", v = (k(c) ? r : Ce(r, c)) + l, y = t(), { pagination: b } = Oe(f, p ? Ze.Desc : Ze.Asc, { rowsPerPage: h }), ee = async (t) => {
|
|
325
|
+
let r = v + at(t, e, s);
|
|
326
|
+
try {
|
|
327
|
+
return {
|
|
328
|
+
res: await y.get(r, {
|
|
329
|
+
...ve(o),
|
|
330
|
+
signal: n
|
|
331
|
+
}),
|
|
332
|
+
pageUrl: r
|
|
333
|
+
};
|
|
334
|
+
} catch (e) {
|
|
335
|
+
throw new Rn(r, e);
|
|
336
|
+
}
|
|
337
|
+
}, x = (e, n) => g(t, n, o, void 0, e.config), te = (e, t) => {
|
|
338
|
+
if (!ye(e.status)) throw new Rn(t, new m(e.status), e.config);
|
|
339
|
+
if (e.status === 204) return {
|
|
340
|
+
items: [],
|
|
341
|
+
mode: "unknown",
|
|
342
|
+
totalCount: 0,
|
|
343
|
+
hasNextPage: !1,
|
|
344
|
+
countIsBound: !1,
|
|
345
|
+
empty: !0
|
|
346
|
+
};
|
|
347
|
+
if (!ge(e)) throw new Rn(t, new m(e.status, void 0, "Expected a response body, url: " + x(e, t)), e.config);
|
|
348
|
+
let n;
|
|
349
|
+
try {
|
|
350
|
+
n = Pe(e.data, e.status, x(e, t));
|
|
351
|
+
} catch (n) {
|
|
352
|
+
throw new Rn(t, n, e.config);
|
|
353
|
+
}
|
|
354
|
+
return {
|
|
355
|
+
items: n.items,
|
|
356
|
+
mode: n.mode,
|
|
357
|
+
totalCount: n.pagination.totalCount ?? 0,
|
|
358
|
+
hasNextPage: n.pagination.hasNextPage === !0,
|
|
359
|
+
countIsBound: n.countIsBound,
|
|
360
|
+
empty: !1
|
|
361
|
+
};
|
|
362
|
+
}, ne = await ee(b), S = te(ne.res, ne.pageUrl), C = [...S.items];
|
|
363
|
+
if (S.empty) return C;
|
|
364
|
+
let w = S.items.length > 0 && S.items.length < b.value.rowsPerPage;
|
|
365
|
+
if (w && (b.value.rowsPerPage = S.items.length), S.mode === "infinite") {
|
|
366
|
+
let e = S.hasNextPage;
|
|
367
|
+
for (; e;) {
|
|
368
|
+
b.value.page++;
|
|
369
|
+
let t = await ee(b), n = te(t.res, t.pageUrl);
|
|
370
|
+
if (C.push(...n.items), n.empty) break;
|
|
371
|
+
e = n.hasNextPage;
|
|
372
|
+
}
|
|
373
|
+
return C;
|
|
328
374
|
}
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
let
|
|
334
|
-
|
|
335
|
-
page: n + 1
|
|
336
|
-
}, a = U(i);
|
|
337
|
-
r.push(t().get(u + Ae(a, e, f), {
|
|
338
|
-
...c,
|
|
339
|
-
signal: h.signal
|
|
340
|
-
}));
|
|
375
|
+
if (S.mode !== "counted" || C.length >= S.totalCount) return C;
|
|
376
|
+
if (w || S.countIsBound) {
|
|
377
|
+
for (;;) {
|
|
378
|
+
b.value.page++;
|
|
379
|
+
let e = await ee(b), t = te(e.res, e.pageUrl);
|
|
380
|
+
if (C.push(...t.items), t.items.length < b.value.rowsPerPage) break;
|
|
341
381
|
}
|
|
342
|
-
|
|
343
|
-
d.push(...e.data.data);
|
|
344
|
-
});
|
|
382
|
+
return C;
|
|
345
383
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
384
|
+
let re = Math.ceil(S.totalCount / b.value.rowsPerPage);
|
|
385
|
+
return re <= 1 || (await Promise.all(Array.from({ length: re - 1 }, (e, t) => ee(V({
|
|
386
|
+
...b.value,
|
|
387
|
+
page: t + 2
|
|
388
|
+
})).then((e) => te(e.res, e.pageUrl))))).forEach((e) => C.push(...e.items)), C;
|
|
389
|
+
}, v);
|
|
350
390
|
} catch (e) {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
391
|
+
let i = e instanceof Rn ? e : null, a = {
|
|
392
|
+
system: n,
|
|
393
|
+
entity: r,
|
|
394
|
+
url: g(t, i?.pageUrl, o, i?.failure ?? e, i?.dispatched)
|
|
395
|
+
};
|
|
396
|
+
throw ee(dt(i?.failure ?? e, a), a);
|
|
355
397
|
}
|
|
356
398
|
},
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
399
|
+
abort: c.abort,
|
|
400
|
+
loading: c.loading
|
|
360
401
|
};
|
|
361
|
-
},
|
|
362
|
-
function
|
|
402
|
+
}, Bn = "/adm/v1/job";
|
|
403
|
+
function Vn(e, t) {
|
|
363
404
|
return {
|
|
364
|
-
useFetchJobList: () =>
|
|
405
|
+
useFetchJobList: () => gt({
|
|
365
406
|
client: e,
|
|
366
407
|
system: t,
|
|
367
408
|
entity: "job",
|
|
368
|
-
urlTemplate:
|
|
409
|
+
urlTemplate: Bn
|
|
369
410
|
}),
|
|
370
|
-
fetchJob: (n) =>
|
|
411
|
+
fetchJob: (n) => {
|
|
412
|
+
let { execute: r } = T({
|
|
413
|
+
client: e,
|
|
414
|
+
method: "GET",
|
|
415
|
+
system: t,
|
|
416
|
+
entity: "job",
|
|
417
|
+
urlTemplate: Bn + "/:id"
|
|
418
|
+
});
|
|
419
|
+
return r({ urlParams: { id: n } });
|
|
420
|
+
},
|
|
371
421
|
createJob: (n) => {
|
|
372
|
-
let r =
|
|
373
|
-
|
|
422
|
+
let r = De(n._resourceName).slice(4).replace("-kind-", "-kind/"), { execute: i } = T({
|
|
423
|
+
client: e,
|
|
424
|
+
method: "POST",
|
|
425
|
+
system: t,
|
|
426
|
+
entity: "job",
|
|
427
|
+
urlTemplate: Bn + "/:type"
|
|
428
|
+
});
|
|
429
|
+
return i({
|
|
430
|
+
urlParams: { type: r },
|
|
431
|
+
body: n
|
|
432
|
+
});
|
|
374
433
|
},
|
|
375
|
-
deleteJob: (n) =>
|
|
434
|
+
deleteJob: (n) => {
|
|
435
|
+
let { execute: r } = i({
|
|
436
|
+
client: e,
|
|
437
|
+
method: "DELETE",
|
|
438
|
+
system: t,
|
|
439
|
+
entity: "job",
|
|
440
|
+
urlTemplate: Bn + "/:id"
|
|
441
|
+
});
|
|
442
|
+
return r({ urlParams: { id: n } });
|
|
443
|
+
}
|
|
376
444
|
};
|
|
377
445
|
}
|
|
378
446
|
//#endregion
|
|
379
447
|
//#region src/labs/filters/datatableColumns.ts
|
|
380
|
-
var
|
|
448
|
+
var Hn = {
|
|
381
449
|
key: "",
|
|
382
450
|
title: void 0,
|
|
383
451
|
sortable: !1,
|
|
384
452
|
fixed: !1
|
|
385
|
-
},
|
|
453
|
+
}, Un = {
|
|
386
454
|
storeColumnsLocalStorage: !0,
|
|
387
455
|
disableActions: !1,
|
|
388
456
|
customI18n: void 0,
|
|
389
457
|
showExpand: !1
|
|
390
458
|
};
|
|
391
|
-
function
|
|
392
|
-
let
|
|
393
|
-
...
|
|
394
|
-
...
|
|
395
|
-
}, s =
|
|
396
|
-
|
|
459
|
+
function Wn(e, t, n, r, i = {}) {
|
|
460
|
+
let a = {
|
|
461
|
+
...Un,
|
|
462
|
+
...i
|
|
463
|
+
}, s = a.customI18n ?? ct, { t: c } = s.global || s, l;
|
|
464
|
+
o(a.storeColumnsLocalStorage) ? l = a.storeColumnsLocalStorage : Re(a.storeColumnsLocalStorage) && !0 === a.storeColumnsLocalStorage && (l = "table_" + n + "_" + r);
|
|
397
465
|
let u = e.map((e) => {
|
|
398
466
|
let t = {
|
|
399
|
-
...
|
|
467
|
+
...Hn,
|
|
400
468
|
...e
|
|
401
469
|
};
|
|
402
|
-
return
|
|
403
|
-
}), d =
|
|
470
|
+
return k(t.title) && (t.title = k(t.title) && O.includes(t.key) ? c("common.model.tracking." + t.key) : k(t.title) && n && r ? c(n + "." + r + ".model." + t.key) : ""), t;
|
|
471
|
+
}), d = j(() => {
|
|
404
472
|
let e = [];
|
|
405
|
-
return
|
|
473
|
+
return a.showExpand && e.push({
|
|
406
474
|
key: "data-table-expand",
|
|
407
475
|
sortable: !1
|
|
408
|
-
}), u.forEach((
|
|
409
|
-
|
|
410
|
-
}),
|
|
476
|
+
}), u.forEach((n) => {
|
|
477
|
+
t.value.includes(n.key) || e.push(n);
|
|
478
|
+
}), a.disableActions || e.push({
|
|
411
479
|
key: "actions",
|
|
412
480
|
sortable: !1,
|
|
413
481
|
fixed: "end"
|
|
@@ -416,41 +484,549 @@ function zn(e, n, r, i, a = {}) {
|
|
|
416
484
|
if (!l || !localStorage) return;
|
|
417
485
|
let e = localStorage.getItem(l);
|
|
418
486
|
if (!e) return;
|
|
419
|
-
let
|
|
487
|
+
let n;
|
|
420
488
|
try {
|
|
421
|
-
|
|
489
|
+
n = JSON.parse(e);
|
|
422
490
|
} catch {
|
|
423
491
|
localStorage.removeItem(l);
|
|
424
492
|
return;
|
|
425
493
|
}
|
|
426
|
-
|
|
494
|
+
ue(n) && Ie(n.hidden) && (t.value = n.hidden);
|
|
427
495
|
}, p = (e) => {
|
|
428
496
|
l && localStorage && localStorage.setItem(l, JSON.stringify({ hidden: e }));
|
|
429
497
|
};
|
|
430
|
-
return
|
|
498
|
+
return Ht(() => {
|
|
431
499
|
f();
|
|
432
|
-
}),
|
|
500
|
+
}), G(t, (e) => {
|
|
433
501
|
p(e);
|
|
434
502
|
}), {
|
|
435
503
|
columnsAll: u,
|
|
436
504
|
columnsVisible: d,
|
|
437
|
-
columnsHidden:
|
|
505
|
+
columnsHidden: t
|
|
438
506
|
};
|
|
439
507
|
}
|
|
440
508
|
//#endregion
|
|
509
|
+
//#region src/labs/log/logApi.ts
|
|
510
|
+
var Gn = "log", Kn = ({ client: e, system: t, logPaths: n, type: r }) => gt({
|
|
511
|
+
client: e,
|
|
512
|
+
system: t,
|
|
513
|
+
entity: "log",
|
|
514
|
+
urlTemplate: n[r]
|
|
515
|
+
}), qn = ({ client: e, system: t, logPaths: n, type: r }) => T({
|
|
516
|
+
client: e,
|
|
517
|
+
method: "GET",
|
|
518
|
+
system: t,
|
|
519
|
+
entity: "log",
|
|
520
|
+
urlTemplate: n[r] + "/:id"
|
|
521
|
+
});
|
|
522
|
+
//#endregion
|
|
523
|
+
//#region src/labs/log/logActions.ts
|
|
524
|
+
function Jn(e) {
|
|
525
|
+
let { showErrorsDefault: t } = Dt(), { execute: n, abort: r } = Kn(e), i = V([]), a = e.loading ?? V(!1), o = V([]), s = 0, c = (e) => e === s;
|
|
526
|
+
return {
|
|
527
|
+
listItems: i,
|
|
528
|
+
listLoading: a,
|
|
529
|
+
datatableHiddenColumns: o,
|
|
530
|
+
fetchList: async (e, r, o) => {
|
|
531
|
+
let l = ++s;
|
|
532
|
+
a.value = !0;
|
|
533
|
+
let u = V({ ...e.value });
|
|
534
|
+
try {
|
|
535
|
+
let t = await n(u, r, o);
|
|
536
|
+
if (!c(l)) return;
|
|
537
|
+
i.value = t, e.value = {
|
|
538
|
+
...e.value,
|
|
539
|
+
hasNextPage: u.value.hasNextPage,
|
|
540
|
+
currentViewCount: u.value.currentViewCount,
|
|
541
|
+
totalCount: u.value.totalCount
|
|
542
|
+
};
|
|
543
|
+
} catch (e) {
|
|
544
|
+
if (!c(l)) return;
|
|
545
|
+
i.value = [], t(e);
|
|
546
|
+
} finally {
|
|
547
|
+
c(l) && (a.value = !1);
|
|
548
|
+
}
|
|
549
|
+
},
|
|
550
|
+
cancel: () => {
|
|
551
|
+
s++, r();
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
function Yn(e) {
|
|
556
|
+
let { showErrorsDefault: t } = Dt(), { execute: n, abort: r } = qn(e), i = V(null), a = e.loading ?? V(!1), o = 0, s = (e) => e === o;
|
|
557
|
+
return {
|
|
558
|
+
log: i,
|
|
559
|
+
detailLoading: a,
|
|
560
|
+
fetchData: async (e) => {
|
|
561
|
+
let r = ++o;
|
|
562
|
+
a.value = !0;
|
|
563
|
+
try {
|
|
564
|
+
let t = await n({ urlParams: { id: e } });
|
|
565
|
+
if (!s(r)) return;
|
|
566
|
+
i.value = t;
|
|
567
|
+
} catch (e) {
|
|
568
|
+
if (!s(r)) return;
|
|
569
|
+
i.value = null, t(e);
|
|
570
|
+
} finally {
|
|
571
|
+
s(r) && (a.value = !1);
|
|
572
|
+
}
|
|
573
|
+
},
|
|
574
|
+
cancel: () => {
|
|
575
|
+
o++, r();
|
|
576
|
+
}
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
//#endregion
|
|
580
|
+
//#region src/labs/log/logType.ts
|
|
581
|
+
var Xn = {
|
|
582
|
+
App: "app",
|
|
583
|
+
Audit: "audit"
|
|
584
|
+
}, Zn = Xn.App, Qn = (e) => Object.values(Xn).includes(e), $n = {
|
|
585
|
+
app: "/adm/v1/log/app",
|
|
586
|
+
audit: "/adm/v1/log/audit"
|
|
587
|
+
};
|
|
588
|
+
function er() {
|
|
589
|
+
let e = V(Object.values(Xn).map((e) => ({
|
|
590
|
+
value: e,
|
|
591
|
+
title: e
|
|
592
|
+
})));
|
|
593
|
+
return {
|
|
594
|
+
logTypeOptions: e,
|
|
595
|
+
getLogTypeOption: (t) => e.value.find((e) => e.value === t)
|
|
596
|
+
};
|
|
597
|
+
}
|
|
598
|
+
//#endregion
|
|
599
|
+
//#region src/labs/log/ALogDatatable.vue?vue&type=script&setup=true&lang.ts
|
|
600
|
+
var tr = { class: "d-flex align-center" }, nr = { class: "line-clamp-2" }, rr = { class: "d-flex justify-end" }, ir = /* @__PURE__ */ R({
|
|
601
|
+
__name: "ALogDatatable",
|
|
602
|
+
props: /*@__PURE__*/ It({
|
|
603
|
+
client: { type: Function },
|
|
604
|
+
system: {},
|
|
605
|
+
type: {},
|
|
606
|
+
logPaths: {},
|
|
607
|
+
detailRoute: { type: Function }
|
|
608
|
+
}, {
|
|
609
|
+
loading: {
|
|
610
|
+
type: Boolean,
|
|
611
|
+
default: !1
|
|
612
|
+
},
|
|
613
|
+
loadingModifiers: {}
|
|
614
|
+
}),
|
|
615
|
+
emits: /*@__PURE__*/ It(["rowClick"], ["update:loading"]),
|
|
616
|
+
setup(e, { expose: t, emit: n }) {
|
|
617
|
+
let r = e, i = n, a = Jt(e, "loading"), o = Pt(At), s = Pt(je);
|
|
618
|
+
if (k(o) || k(s)) throw Error("[ALogDatatable] Incorrect provide/inject config.");
|
|
619
|
+
let { fetchList: c, listItems: l, datatableHiddenColumns: u, cancel: d } = Jn({
|
|
620
|
+
client: r.client,
|
|
621
|
+
system: r.system,
|
|
622
|
+
logPaths: r.logPaths,
|
|
623
|
+
type: r.type,
|
|
624
|
+
loading: a
|
|
625
|
+
}), { resetFilter: f, submitFilter: p, loadStoredFilters: m } = Ve(s, o, {
|
|
626
|
+
storeFiltersLocalStorage: !1,
|
|
627
|
+
populateUrlParams: !1
|
|
628
|
+
}), { pagination: h } = Oe("id");
|
|
629
|
+
Ut(Ct, h);
|
|
630
|
+
let { columnsVisible: g, columnsAll: _, columnsHidden: v } = Wn([
|
|
631
|
+
{ key: "id" },
|
|
632
|
+
{ key: "datetime" },
|
|
633
|
+
{ key: "levelName" },
|
|
634
|
+
{ key: "message" },
|
|
635
|
+
{ key: "context.appVersion" },
|
|
636
|
+
{ key: "context.contextId" },
|
|
637
|
+
...r.type === Xn.Audit ? [{ key: "context.resourceName" }, { key: "context.resourceIds" }] : [{ key: "context.httpStatus" }],
|
|
638
|
+
{ key: "context.userId" },
|
|
639
|
+
{ key: "context.ip" }
|
|
640
|
+
], u, "common", "log", { storeColumnsLocalStorage: `table_common_log_${r.type}` }), y = dn(async () => {
|
|
641
|
+
await c(h, s, o);
|
|
642
|
+
}), b = (e, { item: t }) => {
|
|
643
|
+
t.id && i("rowClick", t);
|
|
644
|
+
};
|
|
645
|
+
return Ht(() => {
|
|
646
|
+
m(h, y);
|
|
647
|
+
}), Vt(() => {
|
|
648
|
+
y.cancel(), d();
|
|
649
|
+
}), t({
|
|
650
|
+
refresh: y,
|
|
651
|
+
resetFilter: () => f(h, y),
|
|
652
|
+
submitFilter: () => p(h, y)
|
|
653
|
+
}), (t, n) => (B(), P("div", null, [F("div", tr, [L(nn), L(Ue, {
|
|
654
|
+
"columns-hidden": W(v),
|
|
655
|
+
"onUpdate:columnsHidden": n[0] ||= (e) => Ft(v) ? v.value = e : null,
|
|
656
|
+
"columns-all": W(_)
|
|
657
|
+
}, null, 8, ["columns-hidden", "columns-all"])]), L(Cn, {
|
|
658
|
+
class: "a-datatable",
|
|
659
|
+
headers: W(g),
|
|
660
|
+
items: W(l),
|
|
661
|
+
"items-length": W(l).length,
|
|
662
|
+
"item-value": "id",
|
|
663
|
+
"onClick:row": b
|
|
664
|
+
}, {
|
|
665
|
+
"item.datetime": K(({ item: e }) => [L(Mt, { "date-time": e.datetime }, null, 8, ["date-time"])]),
|
|
666
|
+
"item.message": K(({ item: e }) => [F("div", nr, U(e.message), 1)]),
|
|
667
|
+
"item.context.resourceIds": K(({ item: e }) => [I(U(e.context.resourceIds.join(", ")), 1)]),
|
|
668
|
+
"item.context.contextId": K(({ item: e }) => [L(ie, { value: e.context.contextId }, null, 8, ["value"])]),
|
|
669
|
+
"item.context.userId": K(({ item: e }) => [W(Ae)(e.context.userId) ? N("", !0) : (B(), M(ie, {
|
|
670
|
+
key: 0,
|
|
671
|
+
value: e.context.userId
|
|
672
|
+
}, null, 8, ["value"]))]),
|
|
673
|
+
"item.actions": K(({ item: t }) => [F("div", rr, [L(X, {
|
|
674
|
+
to: e.detailRoute(t),
|
|
675
|
+
class: "ml-1",
|
|
676
|
+
icon: "mdi-information-outline",
|
|
677
|
+
size: "x-small",
|
|
678
|
+
variant: "text"
|
|
679
|
+
}, null, 8, ["to"])])]),
|
|
680
|
+
bottom: K(() => [L(In, { onChange: W(y) }, null, 8, ["onChange"])]),
|
|
681
|
+
_: 1
|
|
682
|
+
}, 8, [
|
|
683
|
+
"headers",
|
|
684
|
+
"items",
|
|
685
|
+
"items-length"
|
|
686
|
+
])]));
|
|
687
|
+
}
|
|
688
|
+
}), ar = /* @__PURE__ */ R({
|
|
689
|
+
__name: "ALogFilter",
|
|
690
|
+
props: {
|
|
691
|
+
type: {},
|
|
692
|
+
allowedTimeIntervals: {}
|
|
693
|
+
},
|
|
694
|
+
emits: [
|
|
695
|
+
"submit",
|
|
696
|
+
"reset",
|
|
697
|
+
"changeType"
|
|
698
|
+
],
|
|
699
|
+
setup(e, { emit: t }) {
|
|
700
|
+
let n = t, { t: r } = en(), { logLevelOptions: i } = w(), { logTypeOptions: a } = er();
|
|
701
|
+
return (t, o) => (B(), M(tt, {
|
|
702
|
+
"enable-top": "",
|
|
703
|
+
onSubmit: o[1] ||= (e) => n("submit"),
|
|
704
|
+
onReset: o[2] ||= (e) => n("reset")
|
|
705
|
+
}, {
|
|
706
|
+
top: K(() => [L(tn, { class: "align-start" }, {
|
|
707
|
+
default: K(() => [L(J, {
|
|
708
|
+
class: "pb-0",
|
|
709
|
+
cols: "12",
|
|
710
|
+
sm: "4"
|
|
711
|
+
}, {
|
|
712
|
+
default: K(() => [L(bn, {
|
|
713
|
+
"model-value": e.type,
|
|
714
|
+
items: W(a),
|
|
715
|
+
label: W(r)("common.log.filter.type"),
|
|
716
|
+
"item-title": "title",
|
|
717
|
+
"item-value": "value",
|
|
718
|
+
density: "compact",
|
|
719
|
+
variant: "outlined",
|
|
720
|
+
"hide-details": "",
|
|
721
|
+
"data-cy": "filter-log-type",
|
|
722
|
+
"onUpdate:modelValue": o[0] ||= (e) => n("changeType", e)
|
|
723
|
+
}, null, 8, [
|
|
724
|
+
"model-value",
|
|
725
|
+
"items",
|
|
726
|
+
"label"
|
|
727
|
+
])]),
|
|
728
|
+
_: 1
|
|
729
|
+
})]),
|
|
730
|
+
_: 1
|
|
731
|
+
}), L(xn, { class: "mb-4 mt-4" })]),
|
|
732
|
+
search: K(() => [
|
|
733
|
+
L(nt, {
|
|
734
|
+
name: "contextId",
|
|
735
|
+
class: "mr-2"
|
|
736
|
+
}),
|
|
737
|
+
L(nt, {
|
|
738
|
+
name: "message",
|
|
739
|
+
class: "mr-2"
|
|
740
|
+
}),
|
|
741
|
+
L(Se, {
|
|
742
|
+
"name-from": "datetimeFrom",
|
|
743
|
+
"name-until": "datetimeTo",
|
|
744
|
+
allowed: e.allowedTimeIntervals
|
|
745
|
+
}, null, 8, ["allowed"])
|
|
746
|
+
]),
|
|
747
|
+
"item.levelName": K(() => [L(oe, {
|
|
748
|
+
name: "levelName",
|
|
749
|
+
items: W(i)
|
|
750
|
+
}, null, 8, ["items"])]),
|
|
751
|
+
_: 1
|
|
752
|
+
}));
|
|
753
|
+
}
|
|
754
|
+
}), or = ["resourceName", "resourceIds"], sr = (e) => [
|
|
755
|
+
{
|
|
756
|
+
name: "levelName",
|
|
757
|
+
variant: "in",
|
|
758
|
+
default: []
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
name: "id",
|
|
762
|
+
default: null,
|
|
763
|
+
type: "string"
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
name: "contextId",
|
|
767
|
+
apiName: "context.contextId",
|
|
768
|
+
default: null,
|
|
769
|
+
type: "string",
|
|
770
|
+
render: { skip: !0 }
|
|
771
|
+
},
|
|
772
|
+
{
|
|
773
|
+
name: "message",
|
|
774
|
+
variant: "startsWith",
|
|
775
|
+
default: null,
|
|
776
|
+
type: "string",
|
|
777
|
+
render: { skip: !0 }
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
name: "appVersion",
|
|
781
|
+
variant: "startsWith",
|
|
782
|
+
apiName: "context.appVersion",
|
|
783
|
+
default: null,
|
|
784
|
+
type: "string"
|
|
785
|
+
},
|
|
786
|
+
{
|
|
787
|
+
name: "userId",
|
|
788
|
+
apiName: "context.userId",
|
|
789
|
+
default: null,
|
|
790
|
+
type: "integer"
|
|
791
|
+
},
|
|
792
|
+
{
|
|
793
|
+
name: "resourceName",
|
|
794
|
+
apiName: "context.resourceName",
|
|
795
|
+
default: null,
|
|
796
|
+
type: "string"
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
name: "resourceIds",
|
|
800
|
+
apiName: "context.resourceIds",
|
|
801
|
+
variant: "in",
|
|
802
|
+
default: [],
|
|
803
|
+
type: "string"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
name: "datetimeFrom",
|
|
807
|
+
apiName: "datetime",
|
|
808
|
+
type: "timeInterval",
|
|
809
|
+
related: "datetimeTo",
|
|
810
|
+
default: e?.from ?? null,
|
|
811
|
+
mandatory: st(e),
|
|
812
|
+
render: { skip: !0 }
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
name: "datetimeTo",
|
|
816
|
+
apiName: "datetime",
|
|
817
|
+
type: "timeInterval",
|
|
818
|
+
exclude: !0,
|
|
819
|
+
default: e?.to ?? null,
|
|
820
|
+
mandatory: st(e),
|
|
821
|
+
render: { skip: !0 }
|
|
822
|
+
}
|
|
823
|
+
], cr = /* @__PURE__ */ new Map();
|
|
824
|
+
function lr(e, t) {
|
|
825
|
+
let n = cr.get(e);
|
|
826
|
+
if (n) return n;
|
|
827
|
+
let r = sr(t), i = ze(r, lt(r), {
|
|
828
|
+
system: "common",
|
|
829
|
+
subject: "log"
|
|
830
|
+
});
|
|
831
|
+
return cr.set(e, i), i;
|
|
832
|
+
}
|
|
833
|
+
var ur = (e, t) => {
|
|
834
|
+
let n = t !== Xn.Audit;
|
|
835
|
+
or.forEach((t) => {
|
|
836
|
+
let r = e.filterConfig.fields[t];
|
|
837
|
+
r.exclude = n, r.render.skip = n, r.render.selected = !n;
|
|
838
|
+
});
|
|
839
|
+
}, dr = /* @__PURE__ */ R({
|
|
840
|
+
__name: "ALogListView",
|
|
841
|
+
props: {
|
|
842
|
+
client: { type: Function },
|
|
843
|
+
system: {},
|
|
844
|
+
type: {},
|
|
845
|
+
logPaths: {},
|
|
846
|
+
detailRoute: { type: Function },
|
|
847
|
+
typeRoute: { type: Function },
|
|
848
|
+
defaultTimeWindow: {},
|
|
849
|
+
allowedTimeIntervals: {}
|
|
850
|
+
},
|
|
851
|
+
setup(e) {
|
|
852
|
+
let t = e, n = vn(), r = lr(t.system, t.defaultTimeWindow);
|
|
853
|
+
ur(r, t.type), Ut(At, r.filterConfig), Ut(je, r.filterData);
|
|
854
|
+
let i = Xt("datatable"), a = V(!1), o = (e) => {
|
|
855
|
+
n.push(t.detailRoute(e));
|
|
856
|
+
}, s = (e) => {
|
|
857
|
+
e !== t.type && n.replace(t.typeRoute(e));
|
|
858
|
+
};
|
|
859
|
+
return (t, n) => (B(), M(pe, { loading: a.value }, {
|
|
860
|
+
default: K(() => [L(cn, null, {
|
|
861
|
+
default: K(() => [L(ar, {
|
|
862
|
+
type: e.type,
|
|
863
|
+
"allowed-time-intervals": e.allowedTimeIntervals,
|
|
864
|
+
onSubmit: n[0] ||= (e) => i.value?.submitFilter(),
|
|
865
|
+
onReset: n[1] ||= (e) => i.value?.resetFilter(),
|
|
866
|
+
onChangeType: s
|
|
867
|
+
}, null, 8, ["type", "allowed-time-intervals"]), L(ir, {
|
|
868
|
+
ref_key: "datatable",
|
|
869
|
+
ref: i,
|
|
870
|
+
loading: a.value,
|
|
871
|
+
"onUpdate:loading": n[2] ||= (e) => a.value = e,
|
|
872
|
+
client: e.client,
|
|
873
|
+
system: e.system,
|
|
874
|
+
type: e.type,
|
|
875
|
+
"log-paths": e.logPaths,
|
|
876
|
+
"detail-route": e.detailRoute,
|
|
877
|
+
onRowClick: o
|
|
878
|
+
}, null, 8, [
|
|
879
|
+
"loading",
|
|
880
|
+
"client",
|
|
881
|
+
"system",
|
|
882
|
+
"type",
|
|
883
|
+
"log-paths",
|
|
884
|
+
"detail-route"
|
|
885
|
+
])]),
|
|
886
|
+
_: 1
|
|
887
|
+
})]),
|
|
888
|
+
_: 1
|
|
889
|
+
}, 8, ["loading"]));
|
|
890
|
+
}
|
|
891
|
+
}), fr = (e) => {
|
|
892
|
+
try {
|
|
893
|
+
return JSON.stringify(JSON.parse(e), null, 2);
|
|
894
|
+
} catch {
|
|
895
|
+
return e;
|
|
896
|
+
}
|
|
897
|
+
}, pr = { class: "text-label-large" }, mr = { class: "text-label-large" }, hr = { class: "text-label-large" }, gr = { class: "text-label-large" }, _r = { class: "text-label-large" }, vr = { class: "text-label-large" }, yr = { class: "text-label-large" }, br = { class: "text-label-large" }, xr = { class: "text-label-large" }, Sr = { class: "text-label-large" }, Cr = { class: "text-label-large" }, wr = { class: "text-label-large" }, Tr = { class: "text-label-large" }, Er = /*#__PURE__*/ l(/* @__PURE__ */ R({
|
|
898
|
+
__name: "ALogDetail",
|
|
899
|
+
props: { log: {} },
|
|
900
|
+
setup(e) {
|
|
901
|
+
let { t } = en();
|
|
902
|
+
return (r, i) => (B(), M(tn, null, {
|
|
903
|
+
default: K(() => [L(J, null, {
|
|
904
|
+
default: K(() => [
|
|
905
|
+
L(tn, null, {
|
|
906
|
+
default: K(() => [
|
|
907
|
+
L(J, { cols: "3" }, {
|
|
908
|
+
default: K(() => [F("h4", pr, U(W(t)("common.log.model.id")), 1), I(" " + U(e.log.id), 1)]),
|
|
909
|
+
_: 1
|
|
910
|
+
}),
|
|
911
|
+
L(J, { cols: "3" }, {
|
|
912
|
+
default: K(() => [F("h4", mr, U(W(t)("common.log.model.levelName")), 1), L(n, { level: e.log.levelName }, null, 8, ["level"])]),
|
|
913
|
+
_: 1
|
|
914
|
+
}),
|
|
915
|
+
L(J, { cols: "2" }, {
|
|
916
|
+
default: K(() => [F("h4", hr, U(W(t)("common.log.model.context.userId")), 1), I(" " + U(e.log.context.userId), 1)]),
|
|
917
|
+
_: 1
|
|
918
|
+
}),
|
|
919
|
+
L(J, { cols: "2" }, {
|
|
920
|
+
default: K(() => [F("h4", gr, U(W(t)("common.log.model.context.appVersion")), 1), I(" " + U(e.log.context.appVersion), 1)]),
|
|
921
|
+
_: 1
|
|
922
|
+
}),
|
|
923
|
+
L(J, { cols: "2" }, {
|
|
924
|
+
default: K(() => [F("h4", _r, U(W(t)("common.log.model.context.requestOriginAppVersion")), 1), I(" " + U(e.log.context.requestOriginAppVersion), 1)]),
|
|
925
|
+
_: 1
|
|
926
|
+
})
|
|
927
|
+
]),
|
|
928
|
+
_: 1
|
|
929
|
+
}),
|
|
930
|
+
L(tn, null, {
|
|
931
|
+
default: K(() => [
|
|
932
|
+
L(J, { cols: "4" }, {
|
|
933
|
+
default: K(() => [F("h4", vr, U(W(t)("common.log.model.context.contextId")), 1), I(" " + U(e.log.context.contextId), 1)]),
|
|
934
|
+
_: 1
|
|
935
|
+
}),
|
|
936
|
+
L(J, { cols: "4" }, {
|
|
937
|
+
default: K(() => [F("h4", yr, U(W(t)("common.log.model.context.ip")), 1), I(" " + U(e.log.context.ip), 1)]),
|
|
938
|
+
_: 1
|
|
939
|
+
}),
|
|
940
|
+
L(J, { cols: "4" }, {
|
|
941
|
+
default: K(() => [F("h4", br, U(W(t)("common.log.model.datetime")), 1), I(" " + U(W(Ne)(e.log.datetime)), 1)]),
|
|
942
|
+
_: 1
|
|
943
|
+
})
|
|
944
|
+
]),
|
|
945
|
+
_: 1
|
|
946
|
+
}),
|
|
947
|
+
L(tn, null, {
|
|
948
|
+
default: K(() => [L(J, { cols: "12" }, {
|
|
949
|
+
default: K(() => [F("h4", xr, U(W(t)("common.log.model.message")), 1), F("pre", null, U(e.log.message), 1)]),
|
|
950
|
+
_: 1
|
|
951
|
+
})]),
|
|
952
|
+
_: 1
|
|
953
|
+
}),
|
|
954
|
+
L(tn, null, {
|
|
955
|
+
default: K(() => [L(J, { cols: "6" }, {
|
|
956
|
+
default: K(() => [F("h4", Sr, U(W(t)("common.log.model.context.path")), 1), I(" " + U(e.log.context.method) + " " + U(e.log.context.path), 1)]),
|
|
957
|
+
_: 1
|
|
958
|
+
}), L(J, { cols: "6" }, {
|
|
959
|
+
default: K(() => [F("h4", Cr, U(W(t)("common.log.model.context.httpStatus")), 1), I(" " + U(e.log.context.httpStatus), 1)]),
|
|
960
|
+
_: 1
|
|
961
|
+
})]),
|
|
962
|
+
_: 1
|
|
963
|
+
}),
|
|
964
|
+
L(tn, null, {
|
|
965
|
+
default: K(() => [L(J, { cols: "12" }, {
|
|
966
|
+
default: K(() => [F("h4", wr, U(W(t)("common.log.model.context.content")), 1), F("pre", null, U(W(fr)(e.log.context.content ?? "")), 1)]),
|
|
967
|
+
_: 1
|
|
968
|
+
})]),
|
|
969
|
+
_: 1
|
|
970
|
+
}),
|
|
971
|
+
L(tn, null, {
|
|
972
|
+
default: K(() => [L(J, { cols: "12" }, {
|
|
973
|
+
default: K(() => [F("h4", Tr, U(W(t)("common.log.model.context.response")), 1), F("pre", null, U(W(fr)(e.log.context.response)), 1)]),
|
|
974
|
+
_: 1
|
|
975
|
+
})]),
|
|
976
|
+
_: 1
|
|
977
|
+
})
|
|
978
|
+
]),
|
|
979
|
+
_: 1
|
|
980
|
+
})]),
|
|
981
|
+
_: 1
|
|
982
|
+
}));
|
|
983
|
+
}
|
|
984
|
+
}), [["__scopeId", "data-v-5f6c7eaf"]]), Dr = /* @__PURE__ */ R({
|
|
985
|
+
__name: "ALogDetailView",
|
|
986
|
+
props: {
|
|
987
|
+
client: { type: Function },
|
|
988
|
+
system: {},
|
|
989
|
+
type: {},
|
|
990
|
+
id: {},
|
|
991
|
+
logPaths: {}
|
|
992
|
+
},
|
|
993
|
+
setup(e) {
|
|
994
|
+
let t = e, { log: n, detailLoading: r, fetchData: i, cancel: a } = Yn({
|
|
995
|
+
client: t.client,
|
|
996
|
+
system: t.system,
|
|
997
|
+
logPaths: t.logPaths,
|
|
998
|
+
type: t.type
|
|
999
|
+
});
|
|
1000
|
+
return Ht(() => {
|
|
1001
|
+
i(t.id);
|
|
1002
|
+
}), Vt(() => {
|
|
1003
|
+
a();
|
|
1004
|
+
}), (e, t) => (B(), M(pe, { loading: W(r) }, {
|
|
1005
|
+
default: K(() => [L(cn, null, {
|
|
1006
|
+
default: K(() => [W(Ae)(W(n)) ? N("", !0) : (B(), M(Er, {
|
|
1007
|
+
key: 0,
|
|
1008
|
+
log: W(n)
|
|
1009
|
+
}, null, 8, ["log"]))]),
|
|
1010
|
+
_: 1
|
|
1011
|
+
})]),
|
|
1012
|
+
_: 1
|
|
1013
|
+
}, 8, ["loading"]));
|
|
1014
|
+
}
|
|
1015
|
+
});
|
|
1016
|
+
//#endregion
|
|
441
1017
|
//#region src/labs/subjectSelect/useSubjectSelect.ts
|
|
442
|
-
function
|
|
443
|
-
let u =
|
|
1018
|
+
function Or(e, t, n, r, i, a, o, s = null, c = void 0, l = !1) {
|
|
1019
|
+
let u = V(!1), d = V([]), f = V([]), p = V(!1), { pagination: m, setSortBy: h, incrementPage: g } = Oe(Ae(s) ? null : s.key, s?.order), { resetFilter: _, submitFilter: v } = Ve(a, o, {
|
|
444
1020
|
storeFiltersLocalStorage: !1,
|
|
445
1021
|
populateUrlParams: !1
|
|
446
|
-
}), { showErrorsDefault: y } =
|
|
1022
|
+
}), { showErrorsDefault: y } = Dt(), { columnsVisible: b, columnsAll: ee, columnsHidden: x } = Wn(e, t, n, r, {
|
|
447
1023
|
storeColumnsLocalStorage: !1,
|
|
448
1024
|
disableActions: !l
|
|
449
|
-
}),
|
|
450
|
-
|
|
1025
|
+
}), te = () => {
|
|
1026
|
+
C(), re();
|
|
451
1027
|
}, ne = (e) => {
|
|
452
|
-
h(e.sortBy),
|
|
453
|
-
},
|
|
1028
|
+
h(e.sortBy), re();
|
|
1029
|
+
}, S = async () => {
|
|
454
1030
|
p.value = !0, g();
|
|
455
1031
|
try {
|
|
456
1032
|
let e = await i(m, a, o, c);
|
|
@@ -460,9 +1036,9 @@ function Bn(e, t, n, r, i, a, o, s = null, c = void 0, l = !1) {
|
|
|
460
1036
|
} finally {
|
|
461
1037
|
p.value = !1;
|
|
462
1038
|
}
|
|
463
|
-
},
|
|
1039
|
+
}, C = () => {
|
|
464
1040
|
d.value = [], f.value = [];
|
|
465
|
-
},
|
|
1041
|
+
}, w = async () => {
|
|
466
1042
|
p.value = !0;
|
|
467
1043
|
try {
|
|
468
1044
|
d.value = await i(m, a, o, c);
|
|
@@ -471,15 +1047,15 @@ function Bn(e, t, n, r, i, a, o, s = null, c = void 0, l = !1) {
|
|
|
471
1047
|
} finally {
|
|
472
1048
|
p.value = !1;
|
|
473
1049
|
}
|
|
474
|
-
},
|
|
475
|
-
await
|
|
1050
|
+
}, re = dn(async () => {
|
|
1051
|
+
await w();
|
|
476
1052
|
});
|
|
477
1053
|
return {
|
|
478
1054
|
items: d,
|
|
479
1055
|
selected: f,
|
|
480
1056
|
pagination: m,
|
|
481
1057
|
columnsVisible: b,
|
|
482
|
-
columnsHidden:
|
|
1058
|
+
columnsHidden: x,
|
|
483
1059
|
columnsAll: ee,
|
|
484
1060
|
filterTouched: u,
|
|
485
1061
|
loading: p,
|
|
@@ -493,20 +1069,20 @@ function Bn(e, t, n, r, i, a, o, s = null, c = void 0, l = !1) {
|
|
|
493
1069
|
let i = r.querySelector("input");
|
|
494
1070
|
i && i.click();
|
|
495
1071
|
},
|
|
496
|
-
onFetchNextPage:
|
|
497
|
-
onOpen:
|
|
1072
|
+
onFetchNextPage: S,
|
|
1073
|
+
onOpen: te,
|
|
498
1074
|
sortByChange: ne,
|
|
499
|
-
getList:
|
|
500
|
-
resetFilter: () => _(m,
|
|
501
|
-
submitFilter: () => v(m,
|
|
1075
|
+
getList: re,
|
|
1076
|
+
resetFilter: () => _(m, re),
|
|
1077
|
+
submitFilter: () => v(m, re)
|
|
502
1078
|
};
|
|
503
1079
|
}
|
|
504
1080
|
//#endregion
|
|
505
1081
|
//#region src/labs/subjectSelect/ASubjectSelect.vue?vue&type=script&setup=true&lang.ts
|
|
506
|
-
var
|
|
1082
|
+
var kr = { class: "d-flex flex-column w-100 px-1 align-center" }, Ar = { class: "d-flex justify-space-between w-100 align-center" }, jr = { class: "d-flex align-center" }, Mr = { class: "d-flex align-center" }, Nr = { class: "subject-select__sidebar system-border-r" }, Pr = { class: "subject-select-filter" }, Fr = { class: "subject-select__content" }, Ir = {
|
|
507
1083
|
key: 0,
|
|
508
1084
|
class: "d-flex w-100 align-center justify-center pa-4"
|
|
509
|
-
},
|
|
1085
|
+
}, Lr = { class: "subject-select__actions system-border-t" }, Rr = { key: 0 }, zr = { key: 1 }, Br = /* @__PURE__ */ R({
|
|
510
1086
|
__name: "ASubjectSelect",
|
|
511
1087
|
props: {
|
|
512
1088
|
selectedItems: {},
|
|
@@ -537,170 +1113,170 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
537
1113
|
"onFetchNextPage"
|
|
538
1114
|
],
|
|
539
1115
|
setup(e, { expose: t, emit: n }) {
|
|
540
|
-
let r = e, i = n, a =
|
|
1116
|
+
let r = e, i = n, a = V(!1), o = j({
|
|
541
1117
|
get() {
|
|
542
|
-
return
|
|
1118
|
+
return k(r.modelValue) ? a.value : r.modelValue;
|
|
543
1119
|
},
|
|
544
1120
|
set(e) {
|
|
545
1121
|
a.value = e, i("update:modelValue", e);
|
|
546
1122
|
}
|
|
547
|
-
}), s =
|
|
1123
|
+
}), s = j({
|
|
548
1124
|
get: () => r.pagination,
|
|
549
1125
|
set: (e) => {
|
|
550
|
-
i("update:pagination", { ...
|
|
1126
|
+
i("update:pagination", { ...qt(e) });
|
|
551
1127
|
}
|
|
552
|
-
}), { mdAndDown: c } =
|
|
1128
|
+
}), { mdAndDown: c } = mn(), l = V(!c.value), u = () => {
|
|
553
1129
|
c.value && (l.value = !1);
|
|
554
1130
|
};
|
|
555
|
-
|
|
556
|
-
let { t: d } =
|
|
1131
|
+
Ut(me, u);
|
|
1132
|
+
let { t: d } = en(), f = j(() => r.selectedItems.length), p = j(() => f.value < r.minCount || f.value > r.maxCount), m = () => {
|
|
557
1133
|
i("onOpen"), l.value = !c.value, o.value = !0;
|
|
558
1134
|
}, h = () => {
|
|
559
1135
|
l.value = !l.value;
|
|
560
1136
|
}, g = () => {
|
|
561
1137
|
o.value = !1;
|
|
562
1138
|
}, _ = () => {
|
|
563
|
-
i("onConfirm", r.selectedItems.map((e) =>
|
|
1139
|
+
i("onConfirm", r.selectedItems.map((e) => qt(e))), g();
|
|
564
1140
|
}, v = () => {
|
|
565
1141
|
i("onFetchNextPage");
|
|
566
|
-
},
|
|
1142
|
+
}, y = () => {
|
|
567
1143
|
i("onPageChange");
|
|
568
|
-
},
|
|
569
|
-
e &&
|
|
1144
|
+
}, b = j(() => Math.ceil(s.value.totalCount / s.value.rowsPerPage)), ee = j(() => !(Ae(s.value.hasNextPage) && s.value.page >= b.value || s.value.hasNextPage === !1)), x = (e) => {
|
|
1145
|
+
e && ee.value && !r.loading && v();
|
|
570
1146
|
};
|
|
571
|
-
return
|
|
1147
|
+
return Ht(() => {
|
|
572
1148
|
r.autoOpen && m();
|
|
573
1149
|
}), t({
|
|
574
1150
|
open: m,
|
|
575
1151
|
closeSidebarOnMobile: u
|
|
576
1152
|
}), (t, n) => {
|
|
577
|
-
let r =
|
|
578
|
-
return
|
|
1153
|
+
let r = Gt("ABtnSecondary"), a = Gt("ABtnPrimary");
|
|
1154
|
+
return B(), P(A, null, [H(t.$slots, "activator", { props: { onClick: q(() => m(), ["stop"]) } }), L(yn, z(t.$attrs, {
|
|
579
1155
|
"model-value": o.value,
|
|
580
1156
|
fullscreen: "",
|
|
581
1157
|
class: "subject-select",
|
|
582
1158
|
"onUpdate:modelValue": n[1] ||= (e) => i("update:modelValue", e)
|
|
583
1159
|
}), {
|
|
584
|
-
default:
|
|
1160
|
+
default: K(() => [o.value ? (B(), M(on, {
|
|
585
1161
|
key: 0,
|
|
586
1162
|
class: "subject-select__card"
|
|
587
1163
|
}, {
|
|
588
|
-
default:
|
|
589
|
-
|
|
1164
|
+
default: K(() => [
|
|
1165
|
+
L(pt, {
|
|
590
1166
|
class: "subject-select__toolbar system-border-b",
|
|
591
1167
|
onOnCancel: g
|
|
592
1168
|
}, {
|
|
593
|
-
default:
|
|
1169
|
+
default: K(() => [H(t.$slots, "title", {}, () => [I(U(W(d)(e.dialogTitleT)), 1)])]),
|
|
594
1170
|
_: 3
|
|
595
1171
|
}),
|
|
596
|
-
|
|
1172
|
+
L(_n, {
|
|
597
1173
|
density: "compact",
|
|
598
1174
|
color: "transparent",
|
|
599
1175
|
height: 46,
|
|
600
1176
|
elevation: "0",
|
|
601
1177
|
class: "system-border-b subject-select__second-bar"
|
|
602
1178
|
}, {
|
|
603
|
-
default:
|
|
1179
|
+
default: K(() => [H(t.$slots, "second-bar", {}, () => [F("div", kr, [F("div", Ar, [F("div", jr, [L(X, {
|
|
604
1180
|
icon: "",
|
|
605
1181
|
width: 30,
|
|
606
1182
|
height: 30,
|
|
607
1183
|
onClick: h
|
|
608
1184
|
}, {
|
|
609
|
-
default:
|
|
1185
|
+
default: K(() => [L(Y, {
|
|
610
1186
|
icon: "mdi-tune",
|
|
611
1187
|
size: 16
|
|
612
|
-
}),
|
|
1188
|
+
}), L(un, {
|
|
613
1189
|
activator: "parent",
|
|
614
1190
|
location: "bottom"
|
|
615
1191
|
}, {
|
|
616
|
-
default:
|
|
1192
|
+
default: K(() => [I(U(W(d)("common.subjectSelect.filter.toggle")), 1)]),
|
|
617
1193
|
_: 1
|
|
618
1194
|
})]),
|
|
619
1195
|
_: 1
|
|
620
|
-
}),
|
|
1196
|
+
}), H(t.$slots, "second-bar-left")]), F("div", Mr, [H(t.$slots, "second-bar-right")])])])])]),
|
|
621
1197
|
_: 3
|
|
622
1198
|
}),
|
|
623
|
-
|
|
1199
|
+
F("div", { class: Rt(["subject-select__main", { "subject-select__main--sidebar-active": l.value }]) }, [F("div", Nr, [F("div", Pr, [H(t.$slots, "filter")])]), F("div", Fr, [H(t.$slots, "content"), e.paginationMode === "more" ? (B(), P("div", Ir, [Qt((B(), M(r, {
|
|
624
1200
|
loading: e.loading,
|
|
625
1201
|
size: "small",
|
|
626
1202
|
onClick: v
|
|
627
1203
|
}, {
|
|
628
|
-
default:
|
|
1204
|
+
default: K(() => [H(t.$slots, "button-confirm-title", {}, () => [I(U(W(d)("common.button.loadMore")), 1)])]),
|
|
629
1205
|
_: 3
|
|
630
|
-
}, 8, ["loading"])), [[
|
|
631
|
-
|
|
1206
|
+
}, 8, ["loading"])), [[Zt, ee.value || e.loading], [
|
|
1207
|
+
pn,
|
|
632
1208
|
x,
|
|
633
1209
|
void 0,
|
|
634
1210
|
{ quiet: !0 }
|
|
635
|
-
]])])) : (
|
|
1211
|
+
]])])) : (B(), M(In, {
|
|
636
1212
|
key: 1,
|
|
637
1213
|
modelValue: s.value,
|
|
638
1214
|
"onUpdate:modelValue": n[0] ||= (e) => s.value = e,
|
|
639
|
-
onChange:
|
|
1215
|
+
onChange: y
|
|
640
1216
|
}, null, 8, ["modelValue"]))])], 2),
|
|
641
|
-
|
|
642
|
-
e.minCount === e.maxCount ? (
|
|
1217
|
+
F("div", Lr, [
|
|
1218
|
+
e.minCount === e.maxCount ? (B(), P("div", Rr, U(W(d)("common.subjectSelect.texts.pickExactCount", {
|
|
643
1219
|
count: e.minCount,
|
|
644
1220
|
selected: f.value
|
|
645
|
-
})), 1)) : (
|
|
1221
|
+
})), 1)) : (B(), P("div", zr, U(W(d)("common.subjectSelect.texts.pickRangeCount", {
|
|
646
1222
|
minCount: e.minCount,
|
|
647
1223
|
maxCount: e.maxCount,
|
|
648
1224
|
selected: f.value
|
|
649
1225
|
})), 1)),
|
|
650
|
-
|
|
651
|
-
|
|
1226
|
+
L(nn),
|
|
1227
|
+
L(a, {
|
|
652
1228
|
disabled: p.value,
|
|
653
|
-
onClick:
|
|
1229
|
+
onClick: q(_, ["stop"])
|
|
654
1230
|
}, {
|
|
655
|
-
default:
|
|
1231
|
+
default: K(() => [H(t.$slots, "button-confirm-title", {}, () => [I(U(W(d)("common.button.confirm")), 1)])]),
|
|
656
1232
|
_: 3
|
|
657
1233
|
}, 8, ["disabled"])
|
|
658
1234
|
])
|
|
659
1235
|
]),
|
|
660
1236
|
_: 3
|
|
661
|
-
})) :
|
|
1237
|
+
})) : N("", !0)]),
|
|
662
1238
|
_: 3
|
|
663
1239
|
}, 16, ["model-value"])], 64);
|
|
664
1240
|
};
|
|
665
1241
|
}
|
|
666
|
-
}),
|
|
1242
|
+
}), Vr = {
|
|
667
1243
|
key: 0,
|
|
668
1244
|
class: "a-le-header"
|
|
669
|
-
},
|
|
1245
|
+
}, Hr = {
|
|
670
1246
|
key: 0,
|
|
671
1247
|
class: "a-le-title-heading"
|
|
672
|
-
},
|
|
1248
|
+
}, Ur = ["data-unsaved-count"], Wr = {
|
|
673
1249
|
key: 1,
|
|
674
1250
|
class: "a-le-state a-le-state--loading"
|
|
675
|
-
},
|
|
1251
|
+
}, Gr = {
|
|
676
1252
|
key: 2,
|
|
677
1253
|
class: "a-le-state a-le-state--error"
|
|
678
|
-
},
|
|
1254
|
+
}, Kr = {
|
|
679
1255
|
key: 3,
|
|
680
1256
|
class: "a-le-state a-le-state--empty"
|
|
681
|
-
},
|
|
1257
|
+
}, qr = [
|
|
682
1258
|
"data-id",
|
|
683
1259
|
"tabindex",
|
|
684
1260
|
"onKeydown"
|
|
685
|
-
],
|
|
1261
|
+
], Jr = ["onClick"], Yr = { class: "a-le-row-main" }, Xr = { class: "a-le-title" }, Zr = {
|
|
686
1262
|
key: 0,
|
|
687
1263
|
class: "a-le-status"
|
|
688
|
-
},
|
|
1264
|
+
}, Qr = {
|
|
689
1265
|
key: 0,
|
|
690
1266
|
class: "a-le-status-badge"
|
|
691
|
-
},
|
|
1267
|
+
}, $r = { class: "a-le-actions" }, ei = { class: "a-le-row-body" }, ti = { class: "a-le-form" }, ni = {
|
|
692
1268
|
key: 0,
|
|
693
1269
|
class: "a-le-row-footer"
|
|
694
|
-
},
|
|
1270
|
+
}, ri = {
|
|
695
1271
|
key: 1,
|
|
696
1272
|
class: "a-le-row-body"
|
|
697
|
-
},
|
|
1273
|
+
}, ii = { class: "a-le-form" }, ai = {
|
|
698
1274
|
class: "a-le-sr-only",
|
|
699
1275
|
"aria-live": "polite",
|
|
700
1276
|
role: "status"
|
|
701
|
-
},
|
|
1277
|
+
}, oi = /* @__PURE__ */ R({
|
|
702
1278
|
__name: "AListEditor",
|
|
703
|
-
props: /*@__PURE__*/
|
|
1279
|
+
props: /*@__PURE__*/ It({
|
|
704
1280
|
factory: {
|
|
705
1281
|
type: Function,
|
|
706
1282
|
default: void 0
|
|
@@ -810,31 +1386,31 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
810
1386
|
modelValue: { required: !0 },
|
|
811
1387
|
modelModifiers: {}
|
|
812
1388
|
}),
|
|
813
|
-
emits: /*@__PURE__*/
|
|
1389
|
+
emits: /*@__PURE__*/ It([
|
|
814
1390
|
"edit",
|
|
815
1391
|
"deleted",
|
|
816
1392
|
"close",
|
|
817
1393
|
"item-saved",
|
|
818
1394
|
"item-expand"
|
|
819
1395
|
], ["update:modelValue"]),
|
|
820
|
-
setup(e, { expose:
|
|
821
|
-
let
|
|
822
|
-
get: () =>
|
|
823
|
-
set: (e) =>
|
|
824
|
-
factory:
|
|
825
|
-
getKey:
|
|
826
|
-
position:
|
|
827
|
-
dirtyExclude: () =>
|
|
828
|
-
validate:
|
|
829
|
-
},
|
|
830
|
-
let e =
|
|
1396
|
+
setup(e, { expose: n, emit: i }) {
|
|
1397
|
+
let o = e, s = i, c = Jt(e, "modelValue"), { t: l } = en(), u = Yt(), f = mn(), p = Xt("rootEl"), m = j(() => f.platform.value.touch), h = {
|
|
1398
|
+
get: () => c.value,
|
|
1399
|
+
set: (e) => c.value = e,
|
|
1400
|
+
factory: o.factory,
|
|
1401
|
+
getKey: o.getKey,
|
|
1402
|
+
position: o.position,
|
|
1403
|
+
dirtyExclude: () => o.dirtyExclude ?? [],
|
|
1404
|
+
validate: o.validate
|
|
1405
|
+
}, g = o.editor ? null : t(o.stateKey, h), _ = o.editor ?? g?.handle ?? ae(h), v = o.getKey ?? "id", y = Ye(g?.childScope ?? null), b = (e) => typeof v == "function" ? v(e) : e[v], ee = j(() => typeof v == "function" ? "(fn)" : v), x = j(() => {
|
|
1406
|
+
let e = o.position;
|
|
831
1407
|
return e === void 0 || e === !1 ? "position" : typeof e == "object" ? e.field : e;
|
|
832
|
-
}),
|
|
833
|
-
key:
|
|
1408
|
+
}), te = j(() => c.value.map((e, t) => ({
|
|
1409
|
+
key: b(e),
|
|
834
1410
|
index: t,
|
|
835
1411
|
raw: e,
|
|
836
|
-
position: e[
|
|
837
|
-
}))),
|
|
1412
|
+
position: e[x.value]
|
|
1413
|
+
}))), ne = /* @__PURE__ */ new Set(), S = (e) => {
|
|
838
1414
|
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = 0;
|
|
839
1415
|
for (let i of e) {
|
|
840
1416
|
if (i.key === void 0 || i.key === null) {
|
|
@@ -845,245 +1421,245 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
845
1421
|
}
|
|
846
1422
|
if (r === 0 && n.size === 0) return;
|
|
847
1423
|
let i = `${r}|${[...n].sort().join(",")}`;
|
|
848
|
-
|
|
1424
|
+
ne.has(i) || (ne.add(i), r > 0 && console.warn(`[list-editor] ${r} row(s) resolve to an undefined key (key-field "${ee.value}"). Point get-key at a field every item has, or give new items unique temp ids (see nextListEditorTempId).`), n.size > 0 && console.warn(`[list-editor] duplicate row keys (key-field "${ee.value}"): ${[...n].join(", ")}. Row keys must be unique — dirty tracking and validation rails target rows by key.`));
|
|
849
1425
|
};
|
|
850
|
-
|
|
851
|
-
let
|
|
852
|
-
rowsContainer:
|
|
1426
|
+
G(te, (e) => S(e), { immediate: !0 }), G(() => te.value.map((e) => String(e.key)).join("|"), () => y.retainOwners(te.value.map((e) => e.key)), { flush: "post" });
|
|
1427
|
+
let C = V(/* @__PURE__ */ new Set()), w = Xt("rowsContainer"), re = j(() => !o.chips && !!u.item), ie = j(() => !o.chips && !!u["item-readonly"]), { editingKeys: oe, editingSnapshots: se, beginEdit: ce, cancelEdit: ue, commitEdit: de, closeEdit: pe, requestAutoOpen: me } = a({
|
|
1428
|
+
rowsContainer: w,
|
|
853
1429
|
rowSelector: ".a-le-row",
|
|
854
|
-
isInlineEdit:
|
|
855
|
-
restoreSnapshot: (e, t) =>
|
|
856
|
-
watchKeys: () =>
|
|
1430
|
+
isInlineEdit: re,
|
|
1431
|
+
restoreSnapshot: (e, t) => _.updateItem(e, t),
|
|
1432
|
+
watchKeys: () => c.value.map((e) => b(e)),
|
|
857
1433
|
findEntry: (e) => {
|
|
858
|
-
let t =
|
|
1434
|
+
let t = c.value.find((t) => b(t) === e);
|
|
859
1435
|
return t ? { data: t } : null;
|
|
860
1436
|
},
|
|
861
1437
|
afterAutoOpen: (e) => {
|
|
862
|
-
|
|
1438
|
+
C.value.delete(e);
|
|
863
1439
|
}
|
|
864
|
-
}),
|
|
1440
|
+
}), he = j(() => o.addLabel ?? l("common.sortable.add")), ge = j(() => o.emptyTitle ?? l("common.sortable.emptyTitle")), _e = j(() => o.deleteConfirmTitle ?? l("common.sortable.deleteConfirmTitle")), T = j(() => o.deleteConfirmText ?? (o.deleteMode === "immediate" ? l("common.sortable.deleteConfirmText") : l("common.sortable.deleteConfirmTextDeferred"))), E = j(() => !o.readonly && !o.disabled && !o.loading), ve = j(() => E.value && o.showAddButton), ye = _.unsavedCount, be = j(() => !o.readonly && !o.disableUnsaved && ye.value > 0), xe = j(() => !!(o.title || u.header) || be.value), Se = j(() => !!o.onItemSave), Ce = /* @__PURE__ */ new Map(), we = j(() => {
|
|
865
1441
|
let e = [], t = /* @__PURE__ */ new Set();
|
|
866
|
-
for (let n of
|
|
1442
|
+
for (let n of te.value) {
|
|
867
1443
|
t.add(n.key);
|
|
868
|
-
let
|
|
869
|
-
if (u && u.raw === n.raw && u.index === n.index && u.position === n.position && u.editing ===
|
|
1444
|
+
let r = oe.value.has(n.key), i = C.value.has(n.key), a = o.loadingKeys?.has(n.key) ?? !1, s = o.disableUnsaved || o.readonly ? !1 : _.isUnsaved(n.key), c = s, l = _.rowState(n.raw, n.key, r), u = Ce.get(n.key);
|
|
1445
|
+
if (u && u.raw === n.raw && u.index === n.index && u.position === n.position && u.editing === r && u.expanded === i && u.loading === a && u.dirty === c && u.unsaved === s && u.validationState === l) {
|
|
870
1446
|
e.push(u);
|
|
871
1447
|
continue;
|
|
872
1448
|
}
|
|
873
1449
|
let d = {
|
|
874
1450
|
...n,
|
|
875
|
-
editing:
|
|
876
|
-
expanded:
|
|
877
|
-
loading:
|
|
1451
|
+
editing: r,
|
|
1452
|
+
expanded: i,
|
|
1453
|
+
loading: a,
|
|
878
1454
|
dirty: c,
|
|
879
1455
|
unsaved: s,
|
|
880
1456
|
validationState: l
|
|
881
1457
|
};
|
|
882
|
-
|
|
1458
|
+
Ce.set(n.key, d), e.push(d);
|
|
883
1459
|
}
|
|
884
|
-
for (let e of
|
|
1460
|
+
for (let e of Ce.keys()) t.has(e) || Ce.delete(e);
|
|
885
1461
|
return e;
|
|
886
|
-
}),
|
|
887
|
-
viewItems:
|
|
1462
|
+
}), Te = j(() => we.value.length === 0), Ee = (e) => we.value.find((t) => t.key === e), De = r({
|
|
1463
|
+
viewItems: j(() => we.value.map((e) => ({ key: e.key }))),
|
|
888
1464
|
variant: "flat",
|
|
889
|
-
isReorderMode:
|
|
890
|
-
disabled:
|
|
1465
|
+
isReorderMode: V(!1),
|
|
1466
|
+
disabled: j(() => !E.value),
|
|
891
1467
|
isEditing: (e) => oe.value.has(e),
|
|
892
1468
|
onToggleEdit: (e) => {
|
|
893
|
-
let t =
|
|
894
|
-
t &&
|
|
1469
|
+
let t = Ee(e);
|
|
1470
|
+
t && je(t);
|
|
895
1471
|
},
|
|
896
1472
|
onCancelEdit: (e) => {
|
|
897
|
-
let t =
|
|
898
|
-
t &&
|
|
1473
|
+
let t = Ee(e);
|
|
1474
|
+
t && We(t);
|
|
899
1475
|
}
|
|
900
|
-
}),
|
|
901
|
-
|
|
902
|
-
},
|
|
903
|
-
|
|
904
|
-
},
|
|
905
|
-
if (
|
|
1476
|
+
}), Oe = (e) => d(e, { compactField: o.compactField }), ke = () => {
|
|
1477
|
+
ve.value && (me(), _.addItem(void 0, void 0));
|
|
1478
|
+
}, Ae = (e) => {
|
|
1479
|
+
E.value && (me(), _.addItem(void 0, { afterId: e.key }));
|
|
1480
|
+
}, je = (e) => {
|
|
1481
|
+
if (E.value) {
|
|
906
1482
|
if (oe.value.has(e.key)) {
|
|
907
|
-
|
|
1483
|
+
We(e);
|
|
908
1484
|
return;
|
|
909
1485
|
}
|
|
910
|
-
|
|
1486
|
+
re.value && (ce(e), C.value.delete(e.key)), s("edit", e);
|
|
911
1487
|
}
|
|
912
|
-
},
|
|
913
|
-
if (
|
|
914
|
-
let t = e.key, n =
|
|
915
|
-
if (n)
|
|
1488
|
+
}, Me = (e) => {
|
|
1489
|
+
if (o.disabled || o.loading) return;
|
|
1490
|
+
let t = e.key, n = C.value.has(t);
|
|
1491
|
+
if (n) C.value.delete(t);
|
|
916
1492
|
else {
|
|
917
|
-
for (let e of
|
|
918
|
-
|
|
1493
|
+
for (let e of C.value) C.value.delete(e);
|
|
1494
|
+
C.value.add(t);
|
|
919
1495
|
}
|
|
920
|
-
|
|
921
|
-
},
|
|
922
|
-
if (
|
|
1496
|
+
s("item-expand", e, !n);
|
|
1497
|
+
}, Ne = (e) => o.chips || o.disableRowClick || o.defaultExpanded || o.disabled || o.loading ? !1 : !!(e.editing || e.expanded || !o.readonly && o.showEditButton), Pe = (e) => {
|
|
1498
|
+
if (Ne(e)) {
|
|
923
1499
|
if (e.editing || e.expanded) {
|
|
924
|
-
|
|
1500
|
+
We(e);
|
|
925
1501
|
return;
|
|
926
1502
|
}
|
|
927
|
-
|
|
1503
|
+
o.readonly && ie.value ? Me(e) : je(e);
|
|
928
1504
|
}
|
|
929
|
-
}, { deleteDialog:
|
|
930
|
-
onDeleteConfirm: (e) => !
|
|
931
|
-
onDelete: (e) =>
|
|
1505
|
+
}, { deleteDialog: Fe, deleteInFlight: Ie, deleteError: D, onDeleteClick: Le, onDeleteDialogConfirm: Re, onDeleteDialogCancel: ze } = wt({
|
|
1506
|
+
onDeleteConfirm: (e) => !o.onDeleteConfirm || o.onDeleteConfirm(e),
|
|
1507
|
+
onDelete: (e) => o.onDelete?.(e),
|
|
932
1508
|
onDeleted: (e) => {
|
|
933
|
-
oe.value.delete(e.key), se.value.delete(e.key),
|
|
1509
|
+
oe.value.delete(e.key), se.value.delete(e.key), C.value.delete(e.key), _.deleteItem(e.key, { trackDeleted: o.deleteMode === "deferred" }), s("deleted", e);
|
|
934
1510
|
},
|
|
935
|
-
disableDeleteConfirm: () =>
|
|
936
|
-
}),
|
|
937
|
-
|
|
938
|
-
},
|
|
939
|
-
|
|
940
|
-
},
|
|
941
|
-
|
|
942
|
-
},
|
|
943
|
-
|
|
944
|
-
},
|
|
945
|
-
let t =
|
|
1511
|
+
disableDeleteConfirm: () => o.disableDeleteConfirm || o.chips
|
|
1512
|
+
}), Ve = async (e) => {
|
|
1513
|
+
E.value && await Le(e);
|
|
1514
|
+
}, He = async (e) => {
|
|
1515
|
+
o.onItemSave && await o.onItemSave(e.raw), de(e), s("item-saved", e);
|
|
1516
|
+
}, Ue = (e) => {
|
|
1517
|
+
ue(e);
|
|
1518
|
+
}, We = (e) => {
|
|
1519
|
+
pe(e), C.value.delete(e.key), s("close", e);
|
|
1520
|
+
}, Ge = /* @__PURE__ */ new Map(), Ke = (e) => {
|
|
1521
|
+
let t = Ge.get(e);
|
|
946
1522
|
return t || (t = {
|
|
947
1523
|
edit: () => {
|
|
948
|
-
let t =
|
|
949
|
-
t &&
|
|
1524
|
+
let t = Ee(e);
|
|
1525
|
+
t && je(t);
|
|
950
1526
|
},
|
|
951
1527
|
save: () => {
|
|
952
|
-
let t =
|
|
953
|
-
if (t) return
|
|
1528
|
+
let t = Ee(e);
|
|
1529
|
+
if (t) return He(t);
|
|
954
1530
|
},
|
|
955
1531
|
cancel: () => {
|
|
956
|
-
let t =
|
|
957
|
-
t &&
|
|
1532
|
+
let t = Ee(e);
|
|
1533
|
+
t && Ue(t);
|
|
958
1534
|
},
|
|
959
1535
|
close: () => {
|
|
960
|
-
let t =
|
|
961
|
-
t &&
|
|
1536
|
+
let t = Ee(e);
|
|
1537
|
+
t && We(t);
|
|
962
1538
|
},
|
|
963
1539
|
delete: async () => {
|
|
964
|
-
let t =
|
|
965
|
-
t && await
|
|
1540
|
+
let t = Ee(e);
|
|
1541
|
+
t && await Ve(t);
|
|
966
1542
|
},
|
|
967
1543
|
addAfter: () => {
|
|
968
|
-
let t =
|
|
969
|
-
t &&
|
|
1544
|
+
let t = Ee(e);
|
|
1545
|
+
t && Ae(t);
|
|
970
1546
|
},
|
|
971
1547
|
toggleExpand: () => {
|
|
972
|
-
let t =
|
|
973
|
-
t &&
|
|
1548
|
+
let t = Ee(e);
|
|
1549
|
+
t && Me(t);
|
|
974
1550
|
},
|
|
975
|
-
update: (t) =>
|
|
976
|
-
},
|
|
1551
|
+
update: (t) => _.updateItem(e, t)
|
|
1552
|
+
}, Ge.set(e, t)), t;
|
|
977
1553
|
};
|
|
978
|
-
|
|
979
|
-
if (
|
|
1554
|
+
G(() => we.value, (e) => {
|
|
1555
|
+
if (Ge.size === 0) return;
|
|
980
1556
|
let t = new Set(e.map((e) => e.key));
|
|
981
|
-
for (let e of
|
|
1557
|
+
for (let e of Ge.keys()) t.has(e) || Ge.delete(e);
|
|
982
1558
|
});
|
|
983
|
-
let
|
|
1559
|
+
let O = (e) => ({
|
|
984
1560
|
item: e,
|
|
985
1561
|
raw: e.raw,
|
|
986
1562
|
index: e.index,
|
|
987
1563
|
key: e.key,
|
|
988
|
-
readonly:
|
|
989
|
-
disabled:
|
|
1564
|
+
readonly: o.readonly,
|
|
1565
|
+
disabled: o.disabled,
|
|
990
1566
|
expanded: e.expanded,
|
|
991
|
-
editing: e.editing ||
|
|
1567
|
+
editing: e.editing || o.defaultExpanded,
|
|
992
1568
|
dirty: e.dirty,
|
|
993
1569
|
unsaved: e.unsaved,
|
|
994
|
-
touch:
|
|
995
|
-
stateKeyPrefix:
|
|
996
|
-
actions:
|
|
1570
|
+
touch: m.value,
|
|
1571
|
+
stateKeyPrefix: y.prefixFor(e.key),
|
|
1572
|
+
actions: Ke(e.key)
|
|
997
1573
|
});
|
|
998
|
-
|
|
999
|
-
label:
|
|
1000
|
-
dirty:
|
|
1574
|
+
fe(() => o.unsavedSectionLabel && !o.disableUnsaved ? {
|
|
1575
|
+
label: o.unsavedSectionLabel,
|
|
1576
|
+
dirty: _.hasUnsaved.value
|
|
1001
1577
|
} : []);
|
|
1002
|
-
let
|
|
1003
|
-
let t =
|
|
1578
|
+
let qe = () => le(_, (e) => {
|
|
1579
|
+
let t = te.value.find((t) => t.key === e);
|
|
1004
1580
|
t && ce(t);
|
|
1005
1581
|
});
|
|
1006
|
-
return
|
|
1007
|
-
hasErrors:
|
|
1008
|
-
validationScope:
|
|
1009
|
-
validateProvided:
|
|
1010
|
-
reveal:
|
|
1011
|
-
}),
|
|
1012
|
-
...
|
|
1013
|
-
validateAll:
|
|
1014
|
-
}), (t, n) => (
|
|
1582
|
+
return Et({
|
|
1583
|
+
hasErrors: _.hasErrors,
|
|
1584
|
+
validationScope: o.validationScope,
|
|
1585
|
+
validateProvided: o.validate !== void 0,
|
|
1586
|
+
reveal: qe
|
|
1587
|
+
}), n({
|
|
1588
|
+
..._,
|
|
1589
|
+
validateAll: qe
|
|
1590
|
+
}), (t, n) => (B(), P("div", {
|
|
1015
1591
|
ref_key: "rootEl",
|
|
1016
|
-
ref:
|
|
1017
|
-
class:
|
|
1592
|
+
ref: p,
|
|
1593
|
+
class: Rt(["a-list-editor", [`a-list-editor--two-rows-${e.twoRows}`, {
|
|
1018
1594
|
"a-list-editor--readonly": e.readonly,
|
|
1019
1595
|
"a-list-editor--disabled": e.disabled,
|
|
1020
|
-
"a-list-editor--touch":
|
|
1596
|
+
"a-list-editor--touch": m.value,
|
|
1021
1597
|
"a-list-editor--chips": e.chips
|
|
1022
1598
|
}]])
|
|
1023
1599
|
}, [
|
|
1024
|
-
|
|
1600
|
+
F("div", {
|
|
1025
1601
|
ref_key: "rowsContainer",
|
|
1026
|
-
ref:
|
|
1602
|
+
ref: w,
|
|
1027
1603
|
class: "a-le-card"
|
|
1028
1604
|
}, [
|
|
1029
|
-
|
|
1605
|
+
xe.value ? (B(), P("div", Vr, [H(t.$slots, "header", { title: e.title }, () => [e.title ? (B(), P("h3", Hr, U(e.title), 1)) : N("", !0)]), be.value ? (B(), P("span", {
|
|
1030
1606
|
key: 0,
|
|
1031
1607
|
class: "a-le-unsaved-count",
|
|
1032
|
-
"data-unsaved-count":
|
|
1033
|
-
},
|
|
1034
|
-
e.loading ? (
|
|
1608
|
+
"data-unsaved-count": W(ye)
|
|
1609
|
+
}, U(W(l)("common.sortable.pendingChanges", { count: W(ye) })), 9, Ur)) : N("", !0)])) : N("", !0),
|
|
1610
|
+
e.loading ? (B(), P("div", Wr, [L(an, {
|
|
1035
1611
|
indeterminate: "",
|
|
1036
1612
|
color: "primary",
|
|
1037
1613
|
size: "32"
|
|
1038
|
-
})])) : e.error ? (
|
|
1614
|
+
})])) : e.error ? (B(), P("div", Gr, [L(rn, {
|
|
1039
1615
|
type: "error",
|
|
1040
1616
|
variant: "tonal",
|
|
1041
1617
|
density: "compact",
|
|
1042
1618
|
border: "start"
|
|
1043
1619
|
}, {
|
|
1044
|
-
default:
|
|
1620
|
+
default: K(() => [I(U(e.error), 1)]),
|
|
1045
1621
|
_: 1
|
|
1046
|
-
})])) :
|
|
1622
|
+
})])) : Te.value ? (B(), P("div", Kr, [H(t.$slots, "empty", {
|
|
1047
1623
|
readonly: e.readonly,
|
|
1048
1624
|
disabled: e.disabled,
|
|
1049
|
-
actions: { add:
|
|
1050
|
-
}, () => [
|
|
1051
|
-
title:
|
|
1052
|
-
"add-label":
|
|
1053
|
-
"can-add":
|
|
1054
|
-
onAdd:
|
|
1625
|
+
actions: { add: ke }
|
|
1626
|
+
}, () => [L(Be, {
|
|
1627
|
+
title: ge.value,
|
|
1628
|
+
"add-label": he.value,
|
|
1629
|
+
"can-add": ve.value,
|
|
1630
|
+
onAdd: ke
|
|
1055
1631
|
}, null, 8, [
|
|
1056
1632
|
"title",
|
|
1057
1633
|
"add-label",
|
|
1058
1634
|
"can-add"
|
|
1059
|
-
])])])) : (
|
|
1635
|
+
])])])) : (B(!0), P(A, { key: 4 }, Wt(we.value, (r) => (B(), P("div", {
|
|
1060
1636
|
key: String(r.key),
|
|
1061
1637
|
class: "a-le-row-wrapper"
|
|
1062
1638
|
}, [
|
|
1063
|
-
|
|
1064
|
-
|
|
1639
|
+
H(t.$slots, "before-item", z({ ref_for: !0 }, O(r))),
|
|
1640
|
+
F("div", {
|
|
1065
1641
|
"data-id": String(r.key),
|
|
1066
1642
|
role: "listitem",
|
|
1067
|
-
tabindex:
|
|
1068
|
-
class:
|
|
1643
|
+
tabindex: W(De).rowTabindex(r.key),
|
|
1644
|
+
class: Rt(["a-le-row", {
|
|
1069
1645
|
"a-le-row--two-rows": e.twoRows === "always",
|
|
1070
1646
|
"a-le-row--editing": r.editing,
|
|
1071
1647
|
"a-le-row--expanded": r.expanded,
|
|
1072
1648
|
"a-le-row--unsaved": r.unsaved,
|
|
1073
|
-
"a-le-row--clickable":
|
|
1649
|
+
"a-le-row--clickable": Ne(r),
|
|
1074
1650
|
[`a-le-row--validation-${r.validationState}`]: r.validationState !== null
|
|
1075
1651
|
}]),
|
|
1076
|
-
onKeydown: (e) =>
|
|
1077
|
-
}, [
|
|
1652
|
+
onKeydown: (e) => W(De).handleKeydown(r.key, e)
|
|
1653
|
+
}, [F("div", {
|
|
1078
1654
|
class: "a-le-row-header",
|
|
1079
|
-
onClick: (e) =>
|
|
1655
|
+
onClick: (e) => Pe(r)
|
|
1080
1656
|
}, [
|
|
1081
|
-
|
|
1657
|
+
F("div", Yr, [H(t.$slots, "item-compact", z({ ref_for: !0 }, O(r)), () => [F("span", Xr, U(Oe(r.raw)), 1)]), r.unsaved ? (B(), M($e, {
|
|
1082
1658
|
key: 0,
|
|
1083
1659
|
"dot-only": e.chips
|
|
1084
|
-
}, null, 8, ["dot-only"])) :
|
|
1085
|
-
e.chips ?
|
|
1086
|
-
|
|
1660
|
+
}, null, 8, ["dot-only"])) : N("", !0)]),
|
|
1661
|
+
e.chips ? N("", !0) : (B(), P("div", Zr, [H(t.$slots, "item-status", z({ ref_for: !0 }, O(r)), () => [e.statusField && r.raw[e.statusField] != null && r.raw[e.statusField] !== "" ? (B(), P("span", Qr, U(r.raw[e.statusField]), 1)) : N("", !0)])])),
|
|
1662
|
+
F("div", $r, [H(t.$slots, "item-actions", z({ ref_for: !0 }, O(r)), () => [e.chips && e.showDeleteButton && E.value ? (B(), M(X, {
|
|
1087
1663
|
key: 0,
|
|
1088
1664
|
icon: "",
|
|
1089
1665
|
size: "x-small",
|
|
@@ -1091,15 +1667,15 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1091
1667
|
density: "compact",
|
|
1092
1668
|
active: !1,
|
|
1093
1669
|
class: "a-le-action a-le-action--chip-close",
|
|
1094
|
-
onClick:
|
|
1670
|
+
onClick: q((e) => Ve(r), ["stop"])
|
|
1095
1671
|
}, {
|
|
1096
|
-
default:
|
|
1672
|
+
default: K(() => [L(Y, {
|
|
1097
1673
|
icon: "mdi-close",
|
|
1098
1674
|
size: "14"
|
|
1099
1675
|
})]),
|
|
1100
1676
|
_: 1
|
|
1101
|
-
}, 8, ["onClick"])) : (
|
|
1102
|
-
e.showEditButton &&
|
|
1677
|
+
}, 8, ["onClick"])) : (B(), P(A, { key: 1 }, [
|
|
1678
|
+
e.showEditButton && E.value && !e.defaultExpanded ? (B(), M(X, {
|
|
1103
1679
|
key: 0,
|
|
1104
1680
|
icon: "",
|
|
1105
1681
|
size: "small",
|
|
@@ -1107,38 +1683,38 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1107
1683
|
color: "primary",
|
|
1108
1684
|
density: "comfortable",
|
|
1109
1685
|
class: "mx-1 a-le-action a-le-action--edit",
|
|
1110
|
-
onClick:
|
|
1686
|
+
onClick: q((e) => je(r), ["stop"])
|
|
1111
1687
|
}, {
|
|
1112
|
-
default:
|
|
1688
|
+
default: K(() => [L(Y, {
|
|
1113
1689
|
icon: "mdi-pencil-outline",
|
|
1114
1690
|
size: "18"
|
|
1115
|
-
}),
|
|
1691
|
+
}), L(un, {
|
|
1116
1692
|
activator: "parent",
|
|
1117
1693
|
location: "bottom",
|
|
1118
|
-
text:
|
|
1694
|
+
text: W(l)("common.sortable.edit")
|
|
1119
1695
|
}, null, 8, ["text"])]),
|
|
1120
1696
|
_: 1
|
|
1121
|
-
}, 8, ["onClick"])) :
|
|
1122
|
-
e.showDeleteButton &&
|
|
1697
|
+
}, 8, ["onClick"])) : N("", !0),
|
|
1698
|
+
e.showDeleteButton && E.value ? (B(), M(X, {
|
|
1123
1699
|
key: 1,
|
|
1124
1700
|
icon: "",
|
|
1125
1701
|
size: "small",
|
|
1126
1702
|
variant: "text",
|
|
1127
1703
|
density: "comfortable",
|
|
1128
1704
|
class: "mx-1 a-le-action a-le-action--delete",
|
|
1129
|
-
onClick:
|
|
1705
|
+
onClick: q((e) => Ve(r), ["stop"])
|
|
1130
1706
|
}, {
|
|
1131
|
-
default:
|
|
1707
|
+
default: K(() => [L(Y, {
|
|
1132
1708
|
icon: "mdi-trash-can-outline",
|
|
1133
1709
|
size: "18"
|
|
1134
|
-
}),
|
|
1710
|
+
}), L(un, {
|
|
1135
1711
|
activator: "parent",
|
|
1136
1712
|
location: "bottom",
|
|
1137
|
-
text:
|
|
1713
|
+
text: W(l)("common.sortable.delete")
|
|
1138
1714
|
}, null, 8, ["text"])]),
|
|
1139
1715
|
_: 1
|
|
1140
|
-
}, 8, ["onClick"])) :
|
|
1141
|
-
e.showAddAfterAction &&
|
|
1716
|
+
}, 8, ["onClick"])) : N("", !0),
|
|
1717
|
+
e.showAddAfterAction && E.value ? (B(), M(X, {
|
|
1142
1718
|
key: 2,
|
|
1143
1719
|
icon: "",
|
|
1144
1720
|
size: "small",
|
|
@@ -1147,22 +1723,22 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1147
1723
|
active: !1,
|
|
1148
1724
|
class: "mx-1 a-le-action a-le-action--menu"
|
|
1149
1725
|
}, {
|
|
1150
|
-
default:
|
|
1151
|
-
|
|
1726
|
+
default: K(() => [
|
|
1727
|
+
L(Y, {
|
|
1152
1728
|
icon: "mdi-dots-vertical",
|
|
1153
1729
|
size: "18"
|
|
1154
1730
|
}),
|
|
1155
|
-
|
|
1731
|
+
L(un, {
|
|
1156
1732
|
activator: "parent",
|
|
1157
1733
|
location: "bottom",
|
|
1158
|
-
text:
|
|
1734
|
+
text: W(l)("common.sortable.more")
|
|
1159
1735
|
}, null, 8, ["text"]),
|
|
1160
|
-
|
|
1161
|
-
default:
|
|
1162
|
-
default:
|
|
1163
|
-
prepend:
|
|
1164
|
-
default:
|
|
1165
|
-
default:
|
|
1736
|
+
L(gn, { activator: "parent" }, {
|
|
1737
|
+
default: K(() => [L(Z, { density: "compact" }, {
|
|
1738
|
+
default: K(() => [L(Q, { onClick: (e) => Ae(r) }, {
|
|
1739
|
+
prepend: K(() => [L(Y, { icon: "mdi-plus" })]),
|
|
1740
|
+
default: K(() => [L($, null, {
|
|
1741
|
+
default: K(() => [I(U(W(l)("common.sortable.addAfter")), 1)]),
|
|
1166
1742
|
_: 1
|
|
1167
1743
|
})]),
|
|
1168
1744
|
_: 1
|
|
@@ -1173,56 +1749,56 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1173
1749
|
}, 1024)
|
|
1174
1750
|
]),
|
|
1175
1751
|
_: 2
|
|
1176
|
-
}, 1024)) :
|
|
1752
|
+
}, 1024)) : N("", !0)
|
|
1177
1753
|
], 64))])])
|
|
1178
|
-
], 8,
|
|
1179
|
-
n[1] ||=
|
|
1180
|
-
|
|
1754
|
+
], 8, Jr), (r.editing || e.defaultExpanded) && t.$slots.item ? (B(), P(A, { key: 0 }, [F("div", ei, [F("div", ti, [H(t.$slots, "item", z({ ref_for: !0 }, O(r)))])]), H(t.$slots, "item-footer", z({ ref_for: !0 }, O(r)), () => [Se.value && !e.defaultExpanded ? (B(), P("div", ni, [
|
|
1755
|
+
n[1] ||= F("div", { class: "a-le-row-footer-spacer" }, null, -1),
|
|
1756
|
+
L(X, {
|
|
1181
1757
|
variant: "text",
|
|
1182
1758
|
disabled: r.loading,
|
|
1183
|
-
onClick:
|
|
1759
|
+
onClick: q((e) => Ue(r), ["stop"])
|
|
1184
1760
|
}, {
|
|
1185
|
-
default:
|
|
1761
|
+
default: K(() => [I(U(W(l)("common.button.cancel")), 1)]),
|
|
1186
1762
|
_: 1
|
|
1187
1763
|
}, 8, ["disabled", "onClick"]),
|
|
1188
|
-
|
|
1764
|
+
L(X, {
|
|
1189
1765
|
color: "primary",
|
|
1190
1766
|
variant: "flat",
|
|
1191
1767
|
"prepend-icon": "mdi-check",
|
|
1192
1768
|
disabled: r.loading,
|
|
1193
|
-
onClick:
|
|
1769
|
+
onClick: q((e) => He(r), ["stop"])
|
|
1194
1770
|
}, {
|
|
1195
|
-
default:
|
|
1771
|
+
default: K(() => [I(U(W(l)("common.button.save")), 1)]),
|
|
1196
1772
|
_: 1
|
|
1197
1773
|
}, 8, ["disabled", "onClick"])
|
|
1198
|
-
])) :
|
|
1199
|
-
|
|
1774
|
+
])) : N("", !0)])], 64)) : t.$slots["item-readonly"] && (e.readonly || r.expanded) ? (B(), P("div", ri, [F("div", ii, [H(t.$slots, "item-readonly", z({ ref_for: !0 }, O(r)))])])) : N("", !0)], 42, qr),
|
|
1775
|
+
H(t.$slots, "after-item", z({ ref_for: !0 }, O(r)))
|
|
1200
1776
|
]))), 128)),
|
|
1201
|
-
|
|
1777
|
+
ve.value && !e.loading && !e.error && !Te.value ? H(t.$slots, "add-button", {
|
|
1202
1778
|
readonly: e.readonly,
|
|
1203
1779
|
disabled: e.disabled,
|
|
1204
|
-
props: { onClick:
|
|
1205
|
-
actions: { add:
|
|
1206
|
-
}, () => [
|
|
1780
|
+
props: { onClick: ke },
|
|
1781
|
+
actions: { add: ke }
|
|
1782
|
+
}, () => [F("button", {
|
|
1207
1783
|
type: "button",
|
|
1208
1784
|
class: "a-le-row-add",
|
|
1209
|
-
onClick:
|
|
1210
|
-
}, [
|
|
1785
|
+
onClick: ke
|
|
1786
|
+
}, [L(Y, {
|
|
1211
1787
|
icon: "mdi-plus",
|
|
1212
1788
|
size: "18"
|
|
1213
|
-
}),
|
|
1789
|
+
}), F("span", null, U(he.value), 1)])], void 0, 5) : N("", !0)
|
|
1214
1790
|
], 512),
|
|
1215
|
-
|
|
1216
|
-
modelValue:
|
|
1217
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
1218
|
-
title:
|
|
1219
|
-
text:
|
|
1220
|
-
"confirm-label":
|
|
1221
|
-
"cancel-label":
|
|
1222
|
-
error:
|
|
1223
|
-
"in-flight":
|
|
1224
|
-
onConfirm:
|
|
1225
|
-
onCancel:
|
|
1791
|
+
L(St, {
|
|
1792
|
+
modelValue: W(Fe),
|
|
1793
|
+
"onUpdate:modelValue": n[0] ||= (e) => Ft(Fe) ? Fe.value = e : null,
|
|
1794
|
+
title: _e.value,
|
|
1795
|
+
text: T.value,
|
|
1796
|
+
"confirm-label": W(l)("common.sortable.delete"),
|
|
1797
|
+
"cancel-label": W(l)("common.button.cancel"),
|
|
1798
|
+
error: W(D),
|
|
1799
|
+
"in-flight": W(Ie),
|
|
1800
|
+
onConfirm: W(Re),
|
|
1801
|
+
onCancel: W(ze)
|
|
1226
1802
|
}, null, 8, [
|
|
1227
1803
|
"modelValue",
|
|
1228
1804
|
"title",
|
|
@@ -1234,36 +1810,36 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1234
1810
|
"onConfirm",
|
|
1235
1811
|
"onCancel"
|
|
1236
1812
|
]),
|
|
1237
|
-
|
|
1238
|
-
n:
|
|
1239
|
-
total:
|
|
1813
|
+
F("div", ai, U(W(De).grabbedKey.value === null ? "" : W(l)("common.sortable.keyboardGrab.status", {
|
|
1814
|
+
n: W(De).grabbedIndex.value + 1,
|
|
1815
|
+
total: W(De).totalCount.value
|
|
1240
1816
|
})), 1)
|
|
1241
1817
|
], 2));
|
|
1242
1818
|
}
|
|
1243
|
-
}),
|
|
1244
|
-
let r =
|
|
1819
|
+
}), si = (e, t) => e.find((e) => e.key === t) ?? null, ci = (e, t, n) => {
|
|
1820
|
+
let r = si(e, n);
|
|
1245
1821
|
for (; r && r.parentKey !== null;) {
|
|
1246
1822
|
if (r.parentKey === t) return !0;
|
|
1247
|
-
r =
|
|
1823
|
+
r = si(e, r.parentKey);
|
|
1248
1824
|
}
|
|
1249
1825
|
return !1;
|
|
1250
|
-
},
|
|
1251
|
-
let r =
|
|
1826
|
+
}, li = (e, t, n) => {
|
|
1827
|
+
let r = si(e, t);
|
|
1252
1828
|
for (; r && r.depth > n;) {
|
|
1253
1829
|
if (r.parentKey === null) return null;
|
|
1254
|
-
r =
|
|
1830
|
+
r = si(e, r.parentKey);
|
|
1255
1831
|
}
|
|
1256
1832
|
return r && r.depth === n ? r : null;
|
|
1257
|
-
},
|
|
1833
|
+
}, ui = (e, t, n) => n === t || ci(e, t, n), di = (e, t, n, r) => {
|
|
1258
1834
|
for (let i = t; i >= 0 && i < e.length; i += n) {
|
|
1259
1835
|
let t = e[i];
|
|
1260
|
-
if (!
|
|
1836
|
+
if (!ui(e, r, t.key)) return t;
|
|
1261
1837
|
}
|
|
1262
1838
|
return null;
|
|
1263
|
-
},
|
|
1839
|
+
}, fi = (e) => {
|
|
1264
1840
|
let { pointer: t, hoveredRow: n, sourceKey: r, sourceSubtreeDepth: i, viewItems: a, maxDepth: o, indentPx: s, containerLeft: c, containerPaddingLeft: l } = e;
|
|
1265
|
-
if (n.key === r ||
|
|
1266
|
-
let u = t.y - n.rect.top < n.rect.height / 2, d = u ? "top" : "bottom", f = a.findIndex((e) => e.key === n.key), p = u ?
|
|
1841
|
+
if (n.key === r || ci(a, r, n.key)) return null;
|
|
1842
|
+
let u = t.y - n.rect.top < n.rect.height / 2, d = u ? "top" : "bottom", f = a.findIndex((e) => e.key === n.key), p = u ? di(a, f - 1, -1, r) : di(a, f, -1, r), m = u ? di(a, f, 1, r) : di(a, f + 1, 1, r), h = t.x - c - l, g = Math.round(h / s), _ = p ? p.depth + 1 : 0, v = m ? m.depth : 0, y = Math.max(v, Math.min(g, _)), b;
|
|
1267
1843
|
if (!p) b = {
|
|
1268
1844
|
type: "insert",
|
|
1269
1845
|
refKey: n.key,
|
|
@@ -1295,7 +1871,7 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1295
1871
|
levelRowKey: p.key
|
|
1296
1872
|
};
|
|
1297
1873
|
else {
|
|
1298
|
-
let e =
|
|
1874
|
+
let e = li(a, p.key, y);
|
|
1299
1875
|
b = e ? {
|
|
1300
1876
|
type: "insert",
|
|
1301
1877
|
refKey: n.key,
|
|
@@ -1321,31 +1897,31 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1321
1897
|
desired: b,
|
|
1322
1898
|
reason: "maxDepth"
|
|
1323
1899
|
} : b;
|
|
1324
|
-
},
|
|
1900
|
+
}, pi = [
|
|
1325
1901
|
"data-id",
|
|
1326
1902
|
"aria-level",
|
|
1327
1903
|
"tabindex"
|
|
1328
|
-
],
|
|
1904
|
+
], mi = ["aria-label"], hi = {
|
|
1329
1905
|
key: 2,
|
|
1330
1906
|
class: "a-nested-list-editor__tree-toggle a-nested-list-editor__tree-toggle--spacer",
|
|
1331
1907
|
"aria-hidden": "true"
|
|
1332
|
-
},
|
|
1908
|
+
}, gi = { class: "a-le-row-main" }, _i = { class: "a-le-title" }, vi = {
|
|
1333
1909
|
key: 0,
|
|
1334
1910
|
class: "a-nested-list-editor__drag-count",
|
|
1335
1911
|
"aria-hidden": "true"
|
|
1336
|
-
},
|
|
1912
|
+
}, yi = {
|
|
1337
1913
|
key: 3,
|
|
1338
1914
|
class: "a-le-status"
|
|
1339
|
-
},
|
|
1915
|
+
}, bi = {
|
|
1340
1916
|
key: 0,
|
|
1341
1917
|
class: "a-le-status-badge"
|
|
1342
|
-
},
|
|
1918
|
+
}, xi = { class: "a-le-actions" }, Si = { class: "a-le-row-body" }, Ci = { class: "a-le-form" }, wi = {
|
|
1343
1919
|
key: 0,
|
|
1344
1920
|
class: "a-le-row-footer"
|
|
1345
|
-
},
|
|
1921
|
+
}, Ti = {
|
|
1346
1922
|
key: 1,
|
|
1347
1923
|
class: "a-le-row-body"
|
|
1348
|
-
},
|
|
1924
|
+
}, Ei = { class: "a-le-form" }, Di = ["data-parent-id"], Oi = "a-nested-list-editor__group", ki = "a-le-drag-handle", Ai = /* @__PURE__ */ R({
|
|
1349
1925
|
__name: "LeNestedRow",
|
|
1350
1926
|
props: {
|
|
1351
1927
|
vi: {},
|
|
@@ -1355,22 +1931,22 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1355
1931
|
callbacks: {}
|
|
1356
1932
|
},
|
|
1357
1933
|
setup(e) {
|
|
1358
|
-
let t = e, n =
|
|
1934
|
+
let t = e, n = Ai, { t: r } = en(), i = (e) => `--row-${String(e).replace(/\W/g, "_")}`, a = (e) => {
|
|
1359
1935
|
if (typeof t.context.resolveValidation == "function") return t.context.resolveValidation(e, t.vi.key, t.vi.index);
|
|
1360
1936
|
let n = e.validationState;
|
|
1361
1937
|
return n === "valid" || n === "invalid" || n === "warning" ? n : null;
|
|
1362
1938
|
}, o = () => t.context.buildSlotProps(t.vi), s = () => t.viewItems.filter((e) => e.parentKey === t.vi.key);
|
|
1363
|
-
return (t, c) => (
|
|
1364
|
-
class:
|
|
1939
|
+
return (t, c) => (B(), P("div", {
|
|
1940
|
+
class: Rt(["a-le-row-wrapper", { "a-le-row-wrapper--drop-disabled": e.dragState !== null && e.dragState.sourceKey === e.vi.key }]),
|
|
1365
1941
|
"data-id": String(e.vi.key),
|
|
1366
1942
|
role: "treeitem",
|
|
1367
1943
|
"aria-level": e.vi.depth + 1,
|
|
1368
1944
|
tabindex: e.context.keyboardNav ? e.context.keyboardNav.rowTabindex(e.vi.key) : void 0,
|
|
1369
1945
|
onKeydown: c[17] ||= (t) => e.context.keyboardNav ? e.context.keyboardNav.handleKeydown(e.vi.key, t) : void 0
|
|
1370
1946
|
}, [
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
class:
|
|
1947
|
+
H(t.$slots, "before-item", zt(Nt(o()))),
|
|
1948
|
+
F("div", {
|
|
1949
|
+
class: Rt([
|
|
1374
1950
|
"a-le-row",
|
|
1375
1951
|
e.vi.depth > 0 ? "a-le-row--child" : null,
|
|
1376
1952
|
{
|
|
@@ -1384,78 +1960,78 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1384
1960
|
[`a-le-row--validation-${a(e.vi.raw)}`]: a(e.vi.raw) !== null
|
|
1385
1961
|
}
|
|
1386
1962
|
]),
|
|
1387
|
-
style:
|
|
1963
|
+
style: Bt({
|
|
1388
1964
|
"--nested-depth": e.vi.depth,
|
|
1389
1965
|
"anchor-name": i(e.vi.key),
|
|
1390
1966
|
"--parent-anchor": e.vi.parentKey === null ? "none" : i(e.vi.parentKey)
|
|
1391
1967
|
})
|
|
1392
|
-
}, [
|
|
1968
|
+
}, [F("div", {
|
|
1393
1969
|
class: "a-le-row-header",
|
|
1394
1970
|
onClick: c[14] ||= (t) => e.callbacks.onRowClick(e.vi)
|
|
1395
1971
|
}, [
|
|
1396
|
-
e.context.dragEnabled ? (
|
|
1972
|
+
e.context.dragEnabled ? (B(), M(ot, {
|
|
1397
1973
|
key: 0,
|
|
1398
|
-
class:
|
|
1399
|
-
})) :
|
|
1400
|
-
e.context.showExpandToggle && e.vi.childrenAllowed ? (
|
|
1974
|
+
class: Rt(ki)
|
|
1975
|
+
})) : N("", !0),
|
|
1976
|
+
e.context.showExpandToggle && e.vi.childrenAllowed ? (B(), P("button", {
|
|
1401
1977
|
key: 1,
|
|
1402
1978
|
type: "button",
|
|
1403
|
-
class:
|
|
1979
|
+
class: Rt(["a-nested-list-editor__tree-toggle", {
|
|
1404
1980
|
"a-nested-list-editor__tree-toggle--empty": !e.vi.hasChildren,
|
|
1405
1981
|
"a-nested-list-editor__tree-toggle--open": e.vi.childrenExpanded
|
|
1406
1982
|
}]),
|
|
1407
|
-
"aria-label": e.vi.childrenExpanded ?
|
|
1408
|
-
onClick: c[0] ||=
|
|
1409
|
-
}, [...c[18] ||= [
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
e.vi.hasChildren ? (
|
|
1983
|
+
"aria-label": e.vi.childrenExpanded ? W(r)("common.sortable.close") : W(r)("common.sortable.edit"),
|
|
1984
|
+
onClick: c[0] ||= q((t) => e.vi.hasChildren && e.callbacks.onChevronClick(e.vi), ["stop"])
|
|
1985
|
+
}, [...c[18] ||= [F("span", { class: "a-nested-list-editor__tree-toggle-caret" }, null, -1)]], 10, mi)) : e.context.showExpandToggle ? (B(), P("span", hi)) : N("", !0),
|
|
1986
|
+
F("div", gi, [
|
|
1987
|
+
H(t.$slots, "item-compact", zt(Nt(o())), () => [F("span", _i, U(e.context.resolveCompactText(e.vi.raw, e.vi.key)), 1)]),
|
|
1988
|
+
e.vi.hasChildren ? (B(), P("span", vi, [L(Y, {
|
|
1413
1989
|
icon: "mdi-file-tree",
|
|
1414
1990
|
size: "14"
|
|
1415
|
-
}),
|
|
1416
|
-
e.vi.unsaved ? (
|
|
1991
|
+
}), I(" +" + U(e.vi.childrenCount), 1)])) : N("", !0),
|
|
1992
|
+
e.vi.unsaved ? (B(), M($e, { key: 1 })) : N("", !0)
|
|
1417
1993
|
]),
|
|
1418
|
-
e.context.reorderMode ?
|
|
1419
|
-
|
|
1420
|
-
|
|
1994
|
+
e.context.reorderMode ? N("", !0) : (B(), P("div", yi, [H(t.$slots, "item-status", zt(Nt(o())), () => [e.context.statusField && e.vi.raw[e.context.statusField] != null && e.vi.raw[e.context.statusField] !== "" ? (B(), P("span", bi, U(e.vi.raw[e.context.statusField]), 1)) : N("", !0)])])),
|
|
1995
|
+
F("div", xi, [H(t.$slots, "item-actions", zt(Nt(o())), () => [e.context.reorderMode ? (B(), P(A, { key: 0 }, [
|
|
1996
|
+
L(X, {
|
|
1421
1997
|
icon: "",
|
|
1422
1998
|
size: "small",
|
|
1423
1999
|
variant: "text",
|
|
1424
2000
|
density: "comfortable",
|
|
1425
2001
|
disabled: e.vi.firstInParent,
|
|
1426
2002
|
class: "mx-1 a-le-action a-le-action--up",
|
|
1427
|
-
onClick: c[1] ||=
|
|
2003
|
+
onClick: c[1] ||= q((t) => e.callbacks.moveUp(e.vi.key), ["stop"])
|
|
1428
2004
|
}, {
|
|
1429
|
-
default:
|
|
2005
|
+
default: K(() => [L(Y, {
|
|
1430
2006
|
icon: "mdi-arrow-up",
|
|
1431
2007
|
size: "18"
|
|
1432
|
-
}),
|
|
2008
|
+
}), L(un, {
|
|
1433
2009
|
activator: "parent",
|
|
1434
2010
|
location: "bottom",
|
|
1435
|
-
text:
|
|
2011
|
+
text: W(r)("common.sortable.moveUp")
|
|
1436
2012
|
}, null, 8, ["text"])]),
|
|
1437
2013
|
_: 1
|
|
1438
2014
|
}, 8, ["disabled"]),
|
|
1439
|
-
|
|
2015
|
+
L(X, {
|
|
1440
2016
|
icon: "",
|
|
1441
2017
|
size: "small",
|
|
1442
2018
|
variant: "text",
|
|
1443
2019
|
density: "comfortable",
|
|
1444
2020
|
disabled: e.vi.lastInParent,
|
|
1445
2021
|
class: "mx-1 a-le-action a-le-action--down",
|
|
1446
|
-
onClick: c[2] ||=
|
|
2022
|
+
onClick: c[2] ||= q((t) => e.callbacks.moveDown(e.vi.key), ["stop"])
|
|
1447
2023
|
}, {
|
|
1448
|
-
default:
|
|
2024
|
+
default: K(() => [L(Y, {
|
|
1449
2025
|
icon: "mdi-arrow-down",
|
|
1450
2026
|
size: "18"
|
|
1451
|
-
}),
|
|
2027
|
+
}), L(un, {
|
|
1452
2028
|
activator: "parent",
|
|
1453
2029
|
location: "bottom",
|
|
1454
|
-
text:
|
|
2030
|
+
text: W(r)("common.sortable.moveDown")
|
|
1455
2031
|
}, null, 8, ["text"])]),
|
|
1456
2032
|
_: 1
|
|
1457
2033
|
}, 8, ["disabled"]),
|
|
1458
|
-
|
|
2034
|
+
L(X, {
|
|
1459
2035
|
icon: "",
|
|
1460
2036
|
size: "small",
|
|
1461
2037
|
variant: "text",
|
|
@@ -1463,99 +2039,99 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1463
2039
|
active: !1,
|
|
1464
2040
|
class: "mx-1 a-le-action a-le-action--menu"
|
|
1465
2041
|
}, {
|
|
1466
|
-
default:
|
|
1467
|
-
|
|
2042
|
+
default: K(() => [
|
|
2043
|
+
L(Y, {
|
|
1468
2044
|
icon: "mdi-dots-vertical",
|
|
1469
2045
|
size: "18"
|
|
1470
2046
|
}),
|
|
1471
|
-
|
|
2047
|
+
L(un, {
|
|
1472
2048
|
activator: "parent",
|
|
1473
2049
|
location: "bottom",
|
|
1474
|
-
text:
|
|
2050
|
+
text: W(r)("common.sortable.more")
|
|
1475
2051
|
}, null, 8, ["text"]),
|
|
1476
|
-
|
|
1477
|
-
default:
|
|
1478
|
-
default:
|
|
1479
|
-
|
|
2052
|
+
L(gn, { activator: "parent" }, {
|
|
2053
|
+
default: K(() => [L(Z, { density: "compact" }, {
|
|
2054
|
+
default: K(() => [
|
|
2055
|
+
L(Q, {
|
|
1480
2056
|
disabled: e.vi.firstInParent,
|
|
1481
|
-
onClick: c[3] ||=
|
|
2057
|
+
onClick: c[3] ||= q((t) => e.callbacks.moveTop(e.vi.key), ["stop"])
|
|
1482
2058
|
}, {
|
|
1483
|
-
prepend:
|
|
1484
|
-
default:
|
|
1485
|
-
default:
|
|
2059
|
+
prepend: K(() => [L(Y, { icon: "mdi-arrow-collapse-up" })]),
|
|
2060
|
+
default: K(() => [L($, null, {
|
|
2061
|
+
default: K(() => [I(U(W(r)("common.sortable.moveToTop")), 1)]),
|
|
1486
2062
|
_: 1
|
|
1487
2063
|
})]),
|
|
1488
2064
|
_: 1
|
|
1489
2065
|
}, 8, ["disabled"]),
|
|
1490
|
-
|
|
2066
|
+
L(Q, {
|
|
1491
2067
|
disabled: e.vi.lastInParent,
|
|
1492
|
-
onClick: c[4] ||=
|
|
2068
|
+
onClick: c[4] ||= q((t) => e.callbacks.moveBottom(e.vi.key), ["stop"])
|
|
1493
2069
|
}, {
|
|
1494
|
-
prepend:
|
|
1495
|
-
default:
|
|
1496
|
-
default:
|
|
2070
|
+
prepend: K(() => [L(Y, { icon: "mdi-arrow-collapse-down" })]),
|
|
2071
|
+
default: K(() => [L($, null, {
|
|
2072
|
+
default: K(() => [I(U(W(r)("common.sortable.moveToBottom")), 1)]),
|
|
1497
2073
|
_: 1
|
|
1498
2074
|
})]),
|
|
1499
2075
|
_: 1
|
|
1500
2076
|
}, 8, ["disabled"]),
|
|
1501
|
-
e.context.showMoveToPosition && (!e.vi.firstInParent || !e.vi.lastInParent) ? (
|
|
2077
|
+
e.context.showMoveToPosition && (!e.vi.firstInParent || !e.vi.lastInParent) ? (B(), M(Q, {
|
|
1502
2078
|
key: 0,
|
|
1503
|
-
onClick: c[5] ||=
|
|
2079
|
+
onClick: c[5] ||= q((t) => e.callbacks.openMoveToPosition(e.vi), ["stop"])
|
|
1504
2080
|
}, {
|
|
1505
|
-
prepend:
|
|
1506
|
-
default:
|
|
1507
|
-
default:
|
|
2081
|
+
prepend: K(() => [L(Y, { icon: "mdi-target" })]),
|
|
2082
|
+
default: K(() => [L($, null, {
|
|
2083
|
+
default: K(() => [I(U(W(r)("common.sortable.moveToPosition.action")), 1)]),
|
|
1508
2084
|
_: 1
|
|
1509
2085
|
})]),
|
|
1510
2086
|
_: 1
|
|
1511
|
-
})) :
|
|
1512
|
-
e.context.showChangeParent ? (
|
|
2087
|
+
})) : N("", !0),
|
|
2088
|
+
e.context.showChangeParent ? (B(), M(Q, {
|
|
1513
2089
|
key: 1,
|
|
1514
|
-
onClick: c[6] ||=
|
|
2090
|
+
onClick: c[6] ||= q((t) => e.callbacks.openChangeParent(e.vi), ["stop"])
|
|
1515
2091
|
}, {
|
|
1516
|
-
prepend:
|
|
1517
|
-
default:
|
|
1518
|
-
default:
|
|
2092
|
+
prepend: K(() => [L(Y, { icon: "mdi-folder-move-outline" })]),
|
|
2093
|
+
default: K(() => [L($, null, {
|
|
2094
|
+
default: K(() => [I(U(W(r)("common.sortable.changeParent.action")), 1)]),
|
|
1519
2095
|
_: 1
|
|
1520
2096
|
})]),
|
|
1521
2097
|
_: 1
|
|
1522
|
-
})) :
|
|
1523
|
-
|
|
2098
|
+
})) : N("", !0),
|
|
2099
|
+
L(Q, {
|
|
1524
2100
|
disabled: !e.vi.canIndent,
|
|
1525
|
-
onClick: c[7] ||=
|
|
2101
|
+
onClick: c[7] ||= q((t) => e.callbacks.indent(e.vi), ["stop"])
|
|
1526
2102
|
}, {
|
|
1527
|
-
prepend:
|
|
1528
|
-
default:
|
|
1529
|
-
default:
|
|
2103
|
+
prepend: K(() => [L(Y, { icon: "mdi-format-indent-increase" })]),
|
|
2104
|
+
default: K(() => [L($, null, {
|
|
2105
|
+
default: K(() => [I(U(W(r)("common.sortable.indent")), 1)]),
|
|
1530
2106
|
_: 1
|
|
1531
2107
|
})]),
|
|
1532
2108
|
_: 1
|
|
1533
2109
|
}, 8, ["disabled"]),
|
|
1534
|
-
|
|
2110
|
+
L(Q, {
|
|
1535
2111
|
disabled: !e.vi.canOutdent,
|
|
1536
|
-
onClick: c[8] ||=
|
|
2112
|
+
onClick: c[8] ||= q((t) => e.callbacks.outdent(e.vi), ["stop"])
|
|
1537
2113
|
}, {
|
|
1538
|
-
prepend:
|
|
1539
|
-
default:
|
|
1540
|
-
default:
|
|
2114
|
+
prepend: K(() => [L(Y, { icon: "mdi-format-indent-decrease" })]),
|
|
2115
|
+
default: K(() => [L($, null, {
|
|
2116
|
+
default: K(() => [I(U(W(r)("common.sortable.outdent")), 1)]),
|
|
1541
2117
|
_: 1
|
|
1542
2118
|
})]),
|
|
1543
2119
|
_: 1
|
|
1544
2120
|
}, 8, ["disabled"]),
|
|
1545
|
-
e.context.showDeleteButton && e.context.canInteract ? (
|
|
2121
|
+
e.context.showDeleteButton && e.context.canInteract ? (B(), M(Q, {
|
|
1546
2122
|
key: 2,
|
|
1547
|
-
onClick: c[9] ||=
|
|
2123
|
+
onClick: c[9] ||= q((t) => e.callbacks.onDeleteClick(e.vi), ["stop"])
|
|
1548
2124
|
}, {
|
|
1549
|
-
prepend:
|
|
2125
|
+
prepend: K(() => [L(Y, {
|
|
1550
2126
|
icon: "mdi-trash-can-outline",
|
|
1551
2127
|
color: "error"
|
|
1552
2128
|
})]),
|
|
1553
|
-
default:
|
|
1554
|
-
default:
|
|
2129
|
+
default: K(() => [L($, { class: "text-error" }, {
|
|
2130
|
+
default: K(() => [I(U(W(r)("common.sortable.delete")), 1)]),
|
|
1555
2131
|
_: 1
|
|
1556
2132
|
})]),
|
|
1557
2133
|
_: 1
|
|
1558
|
-
})) :
|
|
2134
|
+
})) : N("", !0)
|
|
1559
2135
|
]),
|
|
1560
2136
|
_: 1
|
|
1561
2137
|
})]),
|
|
@@ -1564,8 +2140,8 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1564
2140
|
]),
|
|
1565
2141
|
_: 1
|
|
1566
2142
|
})
|
|
1567
|
-
], 64)) : (
|
|
1568
|
-
e.context.showEditButton && e.context.canInteract ? (
|
|
2143
|
+
], 64)) : (B(), P(A, { key: 1 }, [
|
|
2144
|
+
e.context.showEditButton && e.context.canInteract ? (B(), M(X, {
|
|
1569
2145
|
key: 0,
|
|
1570
2146
|
icon: "",
|
|
1571
2147
|
size: "small",
|
|
@@ -1573,38 +2149,38 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1573
2149
|
color: "primary",
|
|
1574
2150
|
density: "comfortable",
|
|
1575
2151
|
class: "mx-1 a-le-action a-le-action--edit",
|
|
1576
|
-
onClick: c[10] ||=
|
|
2152
|
+
onClick: c[10] ||= q((t) => e.callbacks.onEditClick(e.vi), ["stop"])
|
|
1577
2153
|
}, {
|
|
1578
|
-
default:
|
|
2154
|
+
default: K(() => [L(Y, {
|
|
1579
2155
|
icon: "mdi-pencil-outline",
|
|
1580
2156
|
size: "18"
|
|
1581
|
-
}),
|
|
2157
|
+
}), L(un, {
|
|
1582
2158
|
activator: "parent",
|
|
1583
2159
|
location: "bottom",
|
|
1584
|
-
text:
|
|
2160
|
+
text: W(r)("common.sortable.edit")
|
|
1585
2161
|
}, null, 8, ["text"])]),
|
|
1586
2162
|
_: 1
|
|
1587
|
-
})) :
|
|
1588
|
-
e.context.showDeleteButton && e.context.canInteract ? (
|
|
2163
|
+
})) : N("", !0),
|
|
2164
|
+
e.context.showDeleteButton && e.context.canInteract ? (B(), M(X, {
|
|
1589
2165
|
key: 1,
|
|
1590
2166
|
icon: "",
|
|
1591
2167
|
size: "small",
|
|
1592
2168
|
variant: "text",
|
|
1593
2169
|
density: "comfortable",
|
|
1594
2170
|
class: "mx-1 a-le-action a-le-action--delete",
|
|
1595
|
-
onClick: c[11] ||=
|
|
2171
|
+
onClick: c[11] ||= q((t) => e.callbacks.onDeleteClick(e.vi), ["stop"])
|
|
1596
2172
|
}, {
|
|
1597
|
-
default:
|
|
2173
|
+
default: K(() => [L(Y, {
|
|
1598
2174
|
icon: "mdi-trash-can-outline",
|
|
1599
2175
|
size: "18"
|
|
1600
|
-
}),
|
|
2176
|
+
}), L(un, {
|
|
1601
2177
|
activator: "parent",
|
|
1602
2178
|
location: "bottom",
|
|
1603
|
-
text:
|
|
2179
|
+
text: W(r)("common.sortable.delete")
|
|
1604
2180
|
}, null, 8, ["text"])]),
|
|
1605
2181
|
_: 1
|
|
1606
|
-
})) :
|
|
1607
|
-
e.context.canInteract && (e.context.showAddChildButton && e.vi.canAddChild || e.context.showAddAfterAction) ? (
|
|
2182
|
+
})) : N("", !0),
|
|
2183
|
+
e.context.canInteract && (e.context.showAddChildButton && e.vi.canAddChild || e.context.showAddAfterAction) ? (B(), M(X, {
|
|
1608
2184
|
key: 2,
|
|
1609
2185
|
icon: "",
|
|
1610
2186
|
size: "small",
|
|
@@ -1613,77 +2189,77 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1613
2189
|
active: !1,
|
|
1614
2190
|
class: "mx-1 a-le-action a-le-action--menu"
|
|
1615
2191
|
}, {
|
|
1616
|
-
default:
|
|
1617
|
-
|
|
2192
|
+
default: K(() => [
|
|
2193
|
+
L(Y, {
|
|
1618
2194
|
icon: "mdi-dots-vertical",
|
|
1619
2195
|
size: "18"
|
|
1620
2196
|
}),
|
|
1621
|
-
|
|
2197
|
+
L(un, {
|
|
1622
2198
|
activator: "parent",
|
|
1623
2199
|
location: "bottom",
|
|
1624
|
-
text:
|
|
2200
|
+
text: W(r)("common.sortable.more")
|
|
1625
2201
|
}, null, 8, ["text"]),
|
|
1626
|
-
|
|
1627
|
-
default:
|
|
1628
|
-
default:
|
|
2202
|
+
L(gn, { activator: "parent" }, {
|
|
2203
|
+
default: K(() => [L(Z, { density: "compact" }, {
|
|
2204
|
+
default: K(() => [e.context.showAddAfterAction ? (B(), M(Q, {
|
|
1629
2205
|
key: 0,
|
|
1630
|
-
onClick: c[12] ||=
|
|
2206
|
+
onClick: c[12] ||= q((t) => e.callbacks.onAddAfterClick(e.vi), ["stop"])
|
|
1631
2207
|
}, {
|
|
1632
|
-
prepend:
|
|
1633
|
-
default:
|
|
1634
|
-
default:
|
|
2208
|
+
prepend: K(() => [L(Y, { icon: "mdi-playlist-plus" })]),
|
|
2209
|
+
default: K(() => [L($, null, {
|
|
2210
|
+
default: K(() => [I(U(W(r)("common.sortable.addAfter")), 1)]),
|
|
1635
2211
|
_: 1
|
|
1636
2212
|
})]),
|
|
1637
2213
|
_: 1
|
|
1638
|
-
})) :
|
|
2214
|
+
})) : N("", !0), e.context.showAddChildButton && e.vi.canAddChild ? (B(), M(Q, {
|
|
1639
2215
|
key: 1,
|
|
1640
|
-
onClick: c[13] ||=
|
|
2216
|
+
onClick: c[13] ||= q((t) => e.callbacks.onAddChildClick(e.vi), ["stop"])
|
|
1641
2217
|
}, {
|
|
1642
|
-
prepend:
|
|
1643
|
-
default:
|
|
1644
|
-
default:
|
|
2218
|
+
prepend: K(() => [L(Y, { icon: "mdi-subdirectory-arrow-right" })]),
|
|
2219
|
+
default: K(() => [L($, null, {
|
|
2220
|
+
default: K(() => [I(U(W(r)("common.sortable.addChild")), 1)]),
|
|
1645
2221
|
_: 1
|
|
1646
2222
|
})]),
|
|
1647
2223
|
_: 1
|
|
1648
|
-
})) :
|
|
2224
|
+
})) : N("", !0)]),
|
|
1649
2225
|
_: 1
|
|
1650
2226
|
})]),
|
|
1651
2227
|
_: 1
|
|
1652
2228
|
})
|
|
1653
2229
|
]),
|
|
1654
2230
|
_: 1
|
|
1655
|
-
})) :
|
|
2231
|
+
})) : N("", !0)
|
|
1656
2232
|
], 64))])])
|
|
1657
|
-
]), e.vi.editing && !e.context.reorderMode && t.$slots.item ? (
|
|
1658
|
-
c[19] ||=
|
|
1659
|
-
|
|
2233
|
+
]), e.vi.editing && !e.context.reorderMode && t.$slots.item ? (B(), P(A, { key: 0 }, [F("div", Si, [F("div", Ci, [H(t.$slots, "item", zt(Nt(o())))])]), H(t.$slots, "item-footer", zt(Nt(o())), () => [e.context.showInlineSaveFooter ? (B(), P("div", wi, [
|
|
2234
|
+
c[19] ||= F("div", { class: "a-le-row-footer-spacer" }, null, -1),
|
|
2235
|
+
L(X, {
|
|
1660
2236
|
variant: "text",
|
|
1661
2237
|
disabled: e.vi.loading,
|
|
1662
|
-
onClick: c[15] ||=
|
|
2238
|
+
onClick: c[15] ||= q((t) => e.callbacks.onCancelClick(e.vi), ["stop"])
|
|
1663
2239
|
}, {
|
|
1664
|
-
default:
|
|
2240
|
+
default: K(() => [I(U(W(r)("common.button.cancel")), 1)]),
|
|
1665
2241
|
_: 1
|
|
1666
2242
|
}, 8, ["disabled"]),
|
|
1667
|
-
|
|
2243
|
+
L(X, {
|
|
1668
2244
|
color: "primary",
|
|
1669
2245
|
variant: "flat",
|
|
1670
2246
|
"prepend-icon": "mdi-check",
|
|
1671
2247
|
disabled: e.vi.loading,
|
|
1672
|
-
onClick: c[16] ||=
|
|
2248
|
+
onClick: c[16] ||= q((t) => e.callbacks.onSaveClick(e.vi), ["stop"])
|
|
1673
2249
|
}, {
|
|
1674
|
-
default:
|
|
2250
|
+
default: K(() => [I(U(W(r)("common.button.save")), 1)]),
|
|
1675
2251
|
_: 1
|
|
1676
2252
|
}, 8, ["disabled"])
|
|
1677
|
-
])) :
|
|
1678
|
-
|
|
1679
|
-
e.vi.hasChildren && e.vi.childrenExpanded ? (
|
|
2253
|
+
])) : N("", !0)])], 64)) : t.$slots["item-readonly"] && (e.context.readonly || e.vi.expanded) && !e.context.reorderMode ? (B(), P("div", Ti, [F("div", Ei, [H(t.$slots, "item-readonly", zt(Nt(o())))])])) : N("", !0)], 6),
|
|
2254
|
+
H(t.$slots, "after-item", zt(Nt(o()))),
|
|
2255
|
+
e.vi.hasChildren && e.vi.childrenExpanded ? (B(), P("div", {
|
|
1680
2256
|
key: 0,
|
|
1681
2257
|
class: "a-nested-list-editor__children",
|
|
1682
|
-
style:
|
|
1683
|
-
}, [
|
|
1684
|
-
class:
|
|
2258
|
+
style: Bt({ "--parent-depth": e.vi.depth })
|
|
2259
|
+
}, [F("div", {
|
|
2260
|
+
class: Rt([Oi]),
|
|
1685
2261
|
"data-parent-id": String(e.vi.key)
|
|
1686
|
-
}, [(
|
|
2262
|
+
}, [(B(!0), P(A, null, Wt(s(), (r) => (B(), M(W(n), {
|
|
1687
2263
|
key: String(r.key),
|
|
1688
2264
|
vi: r,
|
|
1689
2265
|
"view-items": e.viewItems,
|
|
@@ -1691,14 +2267,14 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1691
2267
|
context: e.context,
|
|
1692
2268
|
callbacks: e.callbacks
|
|
1693
2269
|
}, {
|
|
1694
|
-
item:
|
|
1695
|
-
"item-compact":
|
|
1696
|
-
"item-readonly":
|
|
1697
|
-
"item-status":
|
|
1698
|
-
"item-footer":
|
|
1699
|
-
"item-actions":
|
|
1700
|
-
"before-item":
|
|
1701
|
-
"after-item":
|
|
2270
|
+
item: K((e) => [H(t.$slots, "item", z({ ref_for: !0 }, e))]),
|
|
2271
|
+
"item-compact": K((e) => [H(t.$slots, "item-compact", z({ ref_for: !0 }, e))]),
|
|
2272
|
+
"item-readonly": K((e) => [H(t.$slots, "item-readonly", z({ ref_for: !0 }, e))]),
|
|
2273
|
+
"item-status": K((e) => [H(t.$slots, "item-status", z({ ref_for: !0 }, e))]),
|
|
2274
|
+
"item-footer": K((e) => [H(t.$slots, "item-footer", z({ ref_for: !0 }, e))]),
|
|
2275
|
+
"item-actions": K((e) => [H(t.$slots, "item-actions", z({ ref_for: !0 }, e))]),
|
|
2276
|
+
"before-item": K((e) => [H(t.$slots, "before-item", z({ ref_for: !0 }, e))]),
|
|
2277
|
+
"after-item": K((e) => [H(t.$slots, "after-item", z({ ref_for: !0 }, e))]),
|
|
1702
2278
|
_: 3
|
|
1703
2279
|
}, 8, [
|
|
1704
2280
|
"vi",
|
|
@@ -1706,12 +2282,12 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1706
2282
|
"drag-state",
|
|
1707
2283
|
"context",
|
|
1708
2284
|
"callbacks"
|
|
1709
|
-
]))), 128))], 10,
|
|
1710
|
-
], 42,
|
|
2285
|
+
]))), 128))], 10, Di)], 4)) : N("", !0)
|
|
2286
|
+
], 42, pi));
|
|
1711
2287
|
}
|
|
1712
|
-
}),
|
|
2288
|
+
}), ji = { class: "text-body-medium mb-2" }, Mi = /*#__PURE__*/ l(/* @__PURE__ */ R({
|
|
1713
2289
|
__name: "LeChangeParentDialog",
|
|
1714
|
-
props: /*@__PURE__*/
|
|
2290
|
+
props: /*@__PURE__*/ It({
|
|
1715
2291
|
tree: {},
|
|
1716
2292
|
sourceKey: {},
|
|
1717
2293
|
keyField: {},
|
|
@@ -1725,13 +2301,13 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1725
2301
|
},
|
|
1726
2302
|
modelModifiers: {}
|
|
1727
2303
|
}),
|
|
1728
|
-
emits: /*@__PURE__*/
|
|
2304
|
+
emits: /*@__PURE__*/ It(["confirm"], ["update:modelValue"]),
|
|
1729
2305
|
setup(e, { emit: t }) {
|
|
1730
|
-
let n = e, r = t, i =
|
|
1731
|
-
|
|
2306
|
+
let n = e, r = t, i = Jt(e, "modelValue"), { t: a } = en(), o = V(void 0), s = V("last");
|
|
2307
|
+
G(i, (e) => {
|
|
1732
2308
|
e && (o.value = void 0, s.value = "last");
|
|
1733
2309
|
});
|
|
1734
|
-
let c =
|
|
2310
|
+
let c = j(() => {
|
|
1735
2311
|
let e = /* @__PURE__ */ new Set();
|
|
1736
2312
|
if (n.sourceKey === null) return e;
|
|
1737
2313
|
let t = (r) => {
|
|
@@ -1747,7 +2323,7 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1747
2323
|
return !1;
|
|
1748
2324
|
};
|
|
1749
2325
|
return t(n.tree.children), e;
|
|
1750
|
-
}), l =
|
|
2326
|
+
}), l = j(() => {
|
|
1751
2327
|
if (n.sourceKey === null) return null;
|
|
1752
2328
|
let e = (t) => {
|
|
1753
2329
|
for (let r of t) {
|
|
@@ -1760,7 +2336,7 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1760
2336
|
return null;
|
|
1761
2337
|
};
|
|
1762
2338
|
return e(n.tree.children);
|
|
1763
|
-
}), u =
|
|
2339
|
+
}), u = j(() => {
|
|
1764
2340
|
if (n.sourceKey === null) return;
|
|
1765
2341
|
let e = (t, r) => {
|
|
1766
2342
|
for (let i of t) {
|
|
@@ -1772,7 +2348,7 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1772
2348
|
}
|
|
1773
2349
|
};
|
|
1774
2350
|
return e(n.tree.children, null);
|
|
1775
|
-
}), d =
|
|
2351
|
+
}), d = j(() => {
|
|
1776
2352
|
let e = [], t = l.value ? n.calculateSubtreeDepth(l.value) : 1;
|
|
1777
2353
|
e.push({
|
|
1778
2354
|
key: null,
|
|
@@ -1796,63 +2372,63 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1796
2372
|
}
|
|
1797
2373
|
};
|
|
1798
2374
|
return r(n.tree.children, 0), e;
|
|
1799
|
-
}), f =
|
|
2375
|
+
}), f = j(() => d.value.filter((e) => !e.disallowed)), p = j(() => o.value === void 0 ? null : d.value.find((e) => e.key === o.value) ?? null), m = j(() => !!p.value && p.value.hasChildren), h = (e) => {
|
|
1800
2376
|
e.disallowed || (o.value = e.key);
|
|
1801
2377
|
}, g = () => {
|
|
1802
2378
|
p.value && (r("confirm", p.value.key, s.value), i.value = !1);
|
|
1803
2379
|
}, _ = () => {
|
|
1804
2380
|
i.value = !1;
|
|
1805
2381
|
}, v = (e) => `${e * 16}px`, y = (e) => e === "maxDepth" ? a("common.sortable.changeParent.errorMaxDepth") : "";
|
|
1806
|
-
return (e, t) => (
|
|
2382
|
+
return (e, t) => (B(), M(yn, {
|
|
1807
2383
|
modelValue: i.value,
|
|
1808
2384
|
"onUpdate:modelValue": t[1] ||= (e) => i.value = e,
|
|
1809
2385
|
"max-width": "540",
|
|
1810
2386
|
persistent: ""
|
|
1811
2387
|
}, {
|
|
1812
|
-
default:
|
|
1813
|
-
default:
|
|
1814
|
-
|
|
1815
|
-
default:
|
|
2388
|
+
default: K(() => [L(on, null, {
|
|
2389
|
+
default: K(() => [
|
|
2390
|
+
L(ln, null, {
|
|
2391
|
+
default: K(() => [I(U(W(a)("common.sortable.changeParent.title")), 1)]),
|
|
1816
2392
|
_: 1
|
|
1817
2393
|
}),
|
|
1818
|
-
f.value.length === 0 ? (
|
|
2394
|
+
f.value.length === 0 ? (B(), M(cn, {
|
|
1819
2395
|
key: 0,
|
|
1820
2396
|
class: "text-body-medium"
|
|
1821
2397
|
}, {
|
|
1822
|
-
default:
|
|
2398
|
+
default: K(() => [L(rn, {
|
|
1823
2399
|
type: "info",
|
|
1824
2400
|
variant: "tonal",
|
|
1825
2401
|
density: "compact"
|
|
1826
2402
|
}, {
|
|
1827
|
-
default:
|
|
2403
|
+
default: K(() => [F("strong", null, U(W(a)("common.sortable.changeParent.noTargetsTitle")), 1), F("div", null, U(W(a)("common.sortable.changeParent.noTargetsText")), 1)]),
|
|
1828
2404
|
_: 1
|
|
1829
2405
|
})]),
|
|
1830
2406
|
_: 1
|
|
1831
|
-
})) : (
|
|
1832
|
-
default:
|
|
2407
|
+
})) : (B(), P(A, { key: 1 }, [L(cn, { class: "pb-1" }, {
|
|
2408
|
+
default: K(() => [L(Z, {
|
|
1833
2409
|
density: "compact",
|
|
1834
2410
|
class: "le-change-parent__list"
|
|
1835
2411
|
}, {
|
|
1836
|
-
default:
|
|
2412
|
+
default: K(() => [(B(!0), P(A, null, Wt(d.value, (e) => (B(), M(Q, {
|
|
1837
2413
|
key: e.key === null ? "__root__" : String(e.key),
|
|
1838
2414
|
disabled: e.disallowed,
|
|
1839
2415
|
active: o.value === e.key,
|
|
1840
2416
|
title: e.label,
|
|
1841
2417
|
subtitle: y(e.reason),
|
|
1842
|
-
style:
|
|
2418
|
+
style: Bt({ paddingInlineStart: v(e.depth) }),
|
|
1843
2419
|
"data-disallowed": e.disallowed ? "true" : "false",
|
|
1844
2420
|
"data-reason": e.reason ?? "",
|
|
1845
2421
|
onClick: (t) => h(e)
|
|
1846
2422
|
}, {
|
|
1847
|
-
prepend:
|
|
2423
|
+
prepend: K(() => [e.key === null ? (B(), M(Y, {
|
|
1848
2424
|
key: 0,
|
|
1849
2425
|
icon: "mdi-folder-home-outline",
|
|
1850
2426
|
size: "18"
|
|
1851
|
-
})) : e.hasChildren ? (
|
|
2427
|
+
})) : e.hasChildren ? (B(), M(Y, {
|
|
1852
2428
|
key: 1,
|
|
1853
2429
|
icon: "mdi-folder-outline",
|
|
1854
2430
|
size: "18"
|
|
1855
|
-
})) : (
|
|
2431
|
+
})) : (B(), M(Y, {
|
|
1856
2432
|
key: 2,
|
|
1857
2433
|
icon: "mdi-file-outline",
|
|
1858
2434
|
size: "18"
|
|
@@ -1871,44 +2447,44 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1871
2447
|
_: 1
|
|
1872
2448
|
})]),
|
|
1873
2449
|
_: 1
|
|
1874
|
-
}), m.value ? (
|
|
2450
|
+
}), m.value ? (B(), M(cn, {
|
|
1875
2451
|
key: 0,
|
|
1876
2452
|
class: "pt-0"
|
|
1877
2453
|
}, {
|
|
1878
|
-
default:
|
|
2454
|
+
default: K(() => [F("div", ji, U(W(a)("common.sortable.changeParent.placementHeading", { label: p.value?.label ?? "" })), 1), L(Tn, {
|
|
1879
2455
|
modelValue: s.value,
|
|
1880
2456
|
"onUpdate:modelValue": t[0] ||= (e) => s.value = e,
|
|
1881
2457
|
density: "compact",
|
|
1882
2458
|
"hide-details": ""
|
|
1883
2459
|
}, {
|
|
1884
|
-
default:
|
|
2460
|
+
default: K(() => [L(wn, {
|
|
1885
2461
|
value: "first",
|
|
1886
|
-
label:
|
|
1887
|
-
}, null, 8, ["label"]),
|
|
2462
|
+
label: W(a)("common.sortable.changeParent.placeFirst")
|
|
2463
|
+
}, null, 8, ["label"]), L(wn, {
|
|
1888
2464
|
value: "last",
|
|
1889
|
-
label:
|
|
2465
|
+
label: W(a)("common.sortable.changeParent.placeLast")
|
|
1890
2466
|
}, null, 8, ["label"])]),
|
|
1891
2467
|
_: 1
|
|
1892
2468
|
}, 8, ["modelValue"])]),
|
|
1893
2469
|
_: 1
|
|
1894
|
-
})) :
|
|
1895
|
-
|
|
1896
|
-
default:
|
|
1897
|
-
|
|
1898
|
-
|
|
2470
|
+
})) : N("", !0)], 64)),
|
|
2471
|
+
L(sn, null, {
|
|
2472
|
+
default: K(() => [
|
|
2473
|
+
L(nn),
|
|
2474
|
+
L(X, {
|
|
1899
2475
|
variant: "text",
|
|
1900
2476
|
onClick: _
|
|
1901
2477
|
}, {
|
|
1902
|
-
default:
|
|
2478
|
+
default: K(() => [I(U(W(a)("common.sortable.reorderCancel")), 1)]),
|
|
1903
2479
|
_: 1
|
|
1904
2480
|
}),
|
|
1905
|
-
|
|
2481
|
+
L(X, {
|
|
1906
2482
|
color: "primary",
|
|
1907
2483
|
variant: "elevated",
|
|
1908
2484
|
disabled: !p.value || p.value.disallowed,
|
|
1909
2485
|
onClick: g
|
|
1910
2486
|
}, {
|
|
1911
|
-
default:
|
|
2487
|
+
default: K(() => [I(U(W(a)("common.sortable.changeParent.confirm")), 1)]),
|
|
1912
2488
|
_: 1
|
|
1913
2489
|
}, 8, ["disabled"])
|
|
1914
2490
|
]),
|
|
@@ -1920,28 +2496,28 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
1920
2496
|
_: 1
|
|
1921
2497
|
}, 8, ["modelValue"]));
|
|
1922
2498
|
}
|
|
1923
|
-
}), [["__scopeId", "data-v-e065d108"]]),
|
|
2499
|
+
}), [["__scopeId", "data-v-e065d108"]]), Ni = { class: "a-le-card" }, Pi = {
|
|
1924
2500
|
key: 0,
|
|
1925
2501
|
class: "a-le-header"
|
|
1926
|
-
},
|
|
2502
|
+
}, Fi = {
|
|
1927
2503
|
key: 0,
|
|
1928
2504
|
class: "a-le-title-heading"
|
|
1929
|
-
},
|
|
2505
|
+
}, Ii = { class: "a-le-header-actions" }, Li = {
|
|
1930
2506
|
key: 1,
|
|
1931
2507
|
class: "a-le-state a-le-state--loading"
|
|
1932
|
-
},
|
|
2508
|
+
}, Ri = {
|
|
1933
2509
|
key: 2,
|
|
1934
2510
|
class: "a-le-state a-le-state--error"
|
|
1935
|
-
},
|
|
2511
|
+
}, zi = {
|
|
1936
2512
|
key: 3,
|
|
1937
2513
|
class: "a-le-state a-le-state--empty"
|
|
1938
|
-
},
|
|
2514
|
+
}, Bi = {
|
|
1939
2515
|
class: "a-le-sr-only",
|
|
1940
2516
|
"aria-live": "polite",
|
|
1941
2517
|
role: "status"
|
|
1942
|
-
},
|
|
2518
|
+
}, Vi = "a-nested-list-editor__group", Hi = 24, Ui = 22, Wi = /* @__PURE__ */ R({
|
|
1943
2519
|
__name: "ANestedSortableListEditor",
|
|
1944
|
-
props: /*@__PURE__*/
|
|
2520
|
+
props: /*@__PURE__*/ It({
|
|
1945
2521
|
maxDepth: {},
|
|
1946
2522
|
factory: {
|
|
1947
2523
|
type: Function,
|
|
@@ -2034,6 +2610,10 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
2034
2610
|
type: Boolean,
|
|
2035
2611
|
default: !1
|
|
2036
2612
|
},
|
|
2613
|
+
disableUnsaved: {
|
|
2614
|
+
type: Boolean,
|
|
2615
|
+
default: !1
|
|
2616
|
+
},
|
|
2037
2617
|
deleteConfirmTitle: { default: null },
|
|
2038
2618
|
deleteConfirmText: { default: null },
|
|
2039
2619
|
deleteMode: { default: "deferred" },
|
|
@@ -2074,7 +2654,7 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
2074
2654
|
mode: { default: "view" },
|
|
2075
2655
|
modeModifiers: {}
|
|
2076
2656
|
}),
|
|
2077
|
-
emits: /*@__PURE__*/
|
|
2657
|
+
emits: /*@__PURE__*/ It([
|
|
2078
2658
|
"add",
|
|
2079
2659
|
"add-child",
|
|
2080
2660
|
"edit",
|
|
@@ -2091,35 +2671,35 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
2091
2671
|
"outdent"
|
|
2092
2672
|
], ["update:modelValue", "update:mode"]),
|
|
2093
2673
|
setup(e, { expose: t, emit: n }) {
|
|
2094
|
-
let
|
|
2095
|
-
let e =
|
|
2674
|
+
let i = e, o = n, s = Jt(e, "modelValue"), c = Jt(e, "mode"), { t: l } = en(), u = Yt(), { showWarningT: f } = Dt(), p = Xt("rootEl"), { isNarrow: m } = _(p), h = _e(), g = j(() => i.closeVariant === "icon" ? "icon" : i.closeVariant === "labeled" ? "labeled" : m.value ? "icon" : "labeled"), v = V(/* @__PURE__ */ new Set()), y = V(/* @__PURE__ */ new Set()), b = i.getKey ?? "id", ee = typeof b == "function" ? "id" : b, x = (e) => typeof b == "function" ? b(e) : e[b], te = (() => {
|
|
2675
|
+
let e = i.position;
|
|
2096
2676
|
return e === void 0 || e === !1 ? "position" : typeof e == "object" ? e.field : e;
|
|
2097
2677
|
})();
|
|
2098
2678
|
((e) => {
|
|
2099
2679
|
let t = (e) => {
|
|
2100
|
-
for (let n of e) n.children && n.children.length > 0 && (
|
|
2680
|
+
for (let n of e) n.children && n.children.length > 0 && (v.value.add(x(n.data)), t(n.children));
|
|
2101
2681
|
};
|
|
2102
2682
|
t(e.children);
|
|
2103
|
-
})(
|
|
2104
|
-
let
|
|
2105
|
-
get: () =>
|
|
2106
|
-
set: (e) =>
|
|
2107
|
-
factory:
|
|
2108
|
-
getKey:
|
|
2109
|
-
position:
|
|
2110
|
-
parentField:
|
|
2111
|
-
maxDepth:
|
|
2112
|
-
dirtyExclude: () =>
|
|
2113
|
-
validate:
|
|
2114
|
-
},
|
|
2115
|
-
let e = [], t = 0, n =
|
|
2116
|
-
for (let s = 0; s <
|
|
2117
|
-
let c =
|
|
2683
|
+
})(s.value);
|
|
2684
|
+
let ne = {
|
|
2685
|
+
get: () => s.value,
|
|
2686
|
+
set: (e) => s.value = e,
|
|
2687
|
+
factory: i.factory,
|
|
2688
|
+
getKey: i.getKey,
|
|
2689
|
+
position: i.position,
|
|
2690
|
+
parentField: i.parentField,
|
|
2691
|
+
maxDepth: i.maxDepth,
|
|
2692
|
+
dirtyExclude: () => i.dirtyExclude ?? [],
|
|
2693
|
+
validate: i.validate
|
|
2694
|
+
}, C = i.editor ? null : Je(i.stateKey, ne), w = i.editor ?? C?.handle ?? S(ne), re = Ye(C?.childScope ?? null), ie = j(() => {
|
|
2695
|
+
let e = [], t = 0, n = i.maxDepth, r = (i, a, o) => {
|
|
2696
|
+
for (let s = 0; s < i.length; s++) {
|
|
2697
|
+
let c = i[s], l = x(c.data), u = c.children !== void 0, d = u && (c.children?.length ?? 0) > 0, f = c.children?.length ?? 0, p = n - (a + 1);
|
|
2118
2698
|
e.push({
|
|
2119
2699
|
key: l,
|
|
2120
2700
|
index: t++,
|
|
2121
2701
|
raw: c.data,
|
|
2122
|
-
position: c.data[
|
|
2702
|
+
position: c.data[te],
|
|
2123
2703
|
node: c,
|
|
2124
2704
|
depth: a,
|
|
2125
2705
|
parent: o?.data ?? null,
|
|
@@ -2128,42 +2708,42 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
2128
2708
|
hasChildren: d,
|
|
2129
2709
|
childrenAllowed: u,
|
|
2130
2710
|
siblingIndex: s,
|
|
2131
|
-
siblingCount:
|
|
2711
|
+
siblingCount: i.length,
|
|
2132
2712
|
firstInParent: s === 0,
|
|
2133
|
-
lastInParent: s ===
|
|
2713
|
+
lastInParent: s === i.length - 1,
|
|
2134
2714
|
canAddChild: u && p > 0,
|
|
2135
2715
|
canIndent: s > 0,
|
|
2136
2716
|
canOutdent: a > 0
|
|
2137
|
-
}), d &&
|
|
2717
|
+
}), d && r(c.children, a + 1, c);
|
|
2138
2718
|
}
|
|
2139
2719
|
};
|
|
2140
|
-
return
|
|
2720
|
+
return r(s.value.children, 0, null), e;
|
|
2141
2721
|
});
|
|
2142
|
-
|
|
2143
|
-
let
|
|
2144
|
-
|
|
2145
|
-
},
|
|
2146
|
-
let { node: t } =
|
|
2722
|
+
G(() => ie.value.map((e) => String(e.key)).join("|"), () => re.retainOwners(ie.value.map((e) => e.key)), { flush: "post" });
|
|
2723
|
+
let ae = Kt(null), oe = V(/* @__PURE__ */ new Set()), se = V(/* @__PURE__ */ new Set()), ce = V(/* @__PURE__ */ new Set()), ue = () => {
|
|
2724
|
+
w.commit(), oe.value = /* @__PURE__ */ new Set();
|
|
2725
|
+
}, de = (e) => {
|
|
2726
|
+
let { node: t } = w.findNode(e);
|
|
2147
2727
|
if (!t) {
|
|
2148
|
-
|
|
2728
|
+
oe.value.add(e);
|
|
2149
2729
|
return;
|
|
2150
2730
|
}
|
|
2151
2731
|
let n = (e) => {
|
|
2152
|
-
|
|
2732
|
+
oe.value.add(x(e.data)), e.children && e.children.forEach(n);
|
|
2153
2733
|
};
|
|
2154
2734
|
n(t);
|
|
2155
|
-
},
|
|
2735
|
+
}, pe = /* @__PURE__ */ new Map(), me = j(() => {
|
|
2156
2736
|
let e = [], t = /* @__PURE__ */ new Set();
|
|
2157
|
-
for (let n of
|
|
2737
|
+
for (let n of ie.value) {
|
|
2158
2738
|
t.add(n.key);
|
|
2159
|
-
let
|
|
2160
|
-
if (d && d.raw === n.raw && d.index === n.index && d.position === n.position && d.depth === n.depth && d.parentKey === n.parentKey && d.childrenCount === n.childrenCount && d.firstInParent === n.firstInParent && d.lastInParent === n.lastInParent && d.editing ===
|
|
2739
|
+
let r = Se.value.has(n.key), a = y.value.has(n.key), o = v.value.has(n.key), s = i.loadingKeys?.has(n.key) ?? !1, c = oe.value.has(n.key), l = !i.readonly && w.isUnsaved(n.key), u = i.disableUnsaved || i.readonly ? !1 : l || c, d = pe.get(n.key);
|
|
2740
|
+
if (d && d.raw === n.raw && d.index === n.index && d.position === n.position && d.depth === n.depth && d.parentKey === n.parentKey && d.childrenCount === n.childrenCount && d.firstInParent === n.firstInParent && d.lastInParent === n.lastInParent && d.editing === r && d.expanded === a && d.childrenExpanded === o && d.loading === s && d.dirty === l && d.moved === c && d.unsaved === u) {
|
|
2161
2741
|
e.push(d);
|
|
2162
2742
|
continue;
|
|
2163
2743
|
}
|
|
2164
2744
|
let f = {
|
|
2165
2745
|
...n,
|
|
2166
|
-
editing:
|
|
2746
|
+
editing: r,
|
|
2167
2747
|
expanded: a,
|
|
2168
2748
|
childrenExpanded: o,
|
|
2169
2749
|
loading: s,
|
|
@@ -2171,99 +2751,99 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
2171
2751
|
moved: c,
|
|
2172
2752
|
unsaved: u
|
|
2173
2753
|
};
|
|
2174
|
-
|
|
2754
|
+
pe.set(n.key, f), e.push(f);
|
|
2175
2755
|
}
|
|
2176
|
-
for (let e of
|
|
2756
|
+
for (let e of pe.keys()) t.has(e) || pe.delete(e);
|
|
2177
2757
|
return e;
|
|
2178
|
-
}),
|
|
2179
|
-
rowsContainer:
|
|
2758
|
+
}), he = j(() => s.value.children.length === 0), ge = j(() => ie.value.length), T = Xt("rowsContainer"), E = j(() => !i.readonly && !i.disabled && !i.loading), ve = j(() => E.value && !i.disableReorder && ge.value > 1), ye = j(() => !!u.item), be = j(() => !!u["item-readonly"]), xe = j(() => !!i.onItemSave), { editingKeys: Se, editingSnapshots: Ce, clearEditing: Te, beginEdit: Ee, cancelEdit: De, commitEdit: Oe, closeEdit: Ae, requestAutoOpen: je } = a({
|
|
2759
|
+
rowsContainer: T,
|
|
2180
2760
|
rowSelector: ".a-le-row-wrapper",
|
|
2181
|
-
isInlineEdit:
|
|
2182
|
-
restoreSnapshot: (e, t) =>
|
|
2761
|
+
isInlineEdit: ye,
|
|
2762
|
+
restoreSnapshot: (e, t) => w.updateItem(e, t, !1),
|
|
2183
2763
|
watchKeys: () => {
|
|
2184
2764
|
let e = [], t = (n) => {
|
|
2185
2765
|
for (let r of n) e.push(x(r.data)), r.children && r.children.length && t(r.children);
|
|
2186
2766
|
};
|
|
2187
|
-
return t(
|
|
2767
|
+
return t(s.value.children), e;
|
|
2188
2768
|
},
|
|
2189
2769
|
findEntry: (e) => {
|
|
2190
|
-
let { node: t } =
|
|
2770
|
+
let { node: t } = w.findNode(e);
|
|
2191
2771
|
return t ? { data: t.data } : null;
|
|
2192
2772
|
},
|
|
2193
2773
|
afterAutoOpen: (e) => {
|
|
2194
|
-
let { parent: t } =
|
|
2195
|
-
t &&
|
|
2774
|
+
let { parent: t } = w.findNode(e);
|
|
2775
|
+
t && v.value.add(x(t.data));
|
|
2196
2776
|
}
|
|
2197
|
-
}), { applying:
|
|
2198
|
-
mode:
|
|
2199
|
-
snapshot:
|
|
2200
|
-
movedKeys:
|
|
2201
|
-
modelValue:
|
|
2202
|
-
cloneModel: (e) =>
|
|
2777
|
+
}), { applying: Me, applyError: Ne, hasPendingChanges: Pe, movedCount: Ie, reorderMode: D, enterReorderMode: Re, cancelReorderMode: ze, applyReorder: Ve } = ke({
|
|
2778
|
+
mode: c,
|
|
2779
|
+
snapshot: ae,
|
|
2780
|
+
movedKeys: oe,
|
|
2781
|
+
modelValue: s,
|
|
2782
|
+
cloneModel: (e) => bt(e),
|
|
2203
2783
|
applyModel: (e) => {
|
|
2204
|
-
|
|
2784
|
+
s.value = e;
|
|
2205
2785
|
},
|
|
2206
|
-
canEnterReorder:
|
|
2786
|
+
canEnterReorder: ve,
|
|
2207
2787
|
onEnter: () => {
|
|
2208
|
-
|
|
2209
|
-
for (let e of
|
|
2210
|
-
|
|
2211
|
-
|
|
2788
|
+
se.value = /* @__PURE__ */ new Set(), ce.value = /* @__PURE__ */ new Set(), Te();
|
|
2789
|
+
for (let e of tt.value) v.value.add(e);
|
|
2790
|
+
Lt(() => {
|
|
2791
|
+
O.value && mt();
|
|
2212
2792
|
});
|
|
2213
2793
|
},
|
|
2214
2794
|
onExternalEnter: () => {
|
|
2215
|
-
|
|
2795
|
+
se.value = /* @__PURE__ */ new Set(), ce.value = /* @__PURE__ */ new Set(), Te();
|
|
2216
2796
|
},
|
|
2217
2797
|
onCancel: () => {
|
|
2218
|
-
for (let e of
|
|
2219
|
-
for (let e of
|
|
2220
|
-
|
|
2798
|
+
for (let e of se.value) w.restoreDeleted(e);
|
|
2799
|
+
for (let e of ce.value) w.deleteItem(e, { trackDeleted: !1 });
|
|
2800
|
+
se.value = /* @__PURE__ */ new Set(), ce.value = /* @__PURE__ */ new Set(), ct();
|
|
2221
2801
|
},
|
|
2222
2802
|
onApplyEnd: () => {
|
|
2223
|
-
|
|
2803
|
+
se.value = /* @__PURE__ */ new Set(), ce.value = /* @__PURE__ */ new Set(), ct();
|
|
2224
2804
|
},
|
|
2225
|
-
onReorderApply: (e) =>
|
|
2805
|
+
onReorderApply: (e) => i.onReorderApply?.(e),
|
|
2226
2806
|
emit: {
|
|
2227
|
-
reorderStart: () =>
|
|
2228
|
-
reorderCancel: () =>
|
|
2229
|
-
reorderApplied: (e) =>
|
|
2230
|
-
reorderApplyError: (e) =>
|
|
2231
|
-
reorderEnd: () =>
|
|
2807
|
+
reorderStart: () => o("reorder-start"),
|
|
2808
|
+
reorderCancel: () => o("reorder-cancel"),
|
|
2809
|
+
reorderApplied: (e) => o("reorder-applied", e),
|
|
2810
|
+
reorderApplyError: (e) => o("reorder-apply-error", e),
|
|
2811
|
+
reorderEnd: () => o("reorder-end")
|
|
2232
2812
|
}
|
|
2233
|
-
}),
|
|
2813
|
+
}), Ue = j(() => Ie.value + se.value.size), We = j(() => Pe.value || se.value.size > 0), Ge = j(() => E.value && i.showAddButton && !D.value), O = j(() => D.value && !h.value && !i.disableDrag), qe = j(() => i.addLabel ?? l("common.sortable.add")), Xe = j(() => i.emptyTitle ?? l("common.sortable.emptyTitle")), Ze = j(() => i.deleteConfirmTitle ?? l("common.sortable.deleteConfirmTitle")), Qe = j(() => i.deleteConfirmText ?? (i.deleteMode === "immediate" ? l("common.sortable.deleteConfirmText") : l("common.sortable.deleteConfirmTextDeferred"))), $e = j(() => !i.readonly && i.showReorderToggle && !D.value && ge.value > 0), et = j(() => !!i.title && m.value), tt = j(() => {
|
|
2234
2814
|
let e = [], t = (n) => {
|
|
2235
2815
|
for (let r of n) r.children && r.children.length > 0 && (e.push(x(r.data)), t(r.children));
|
|
2236
2816
|
};
|
|
2237
|
-
return t(
|
|
2238
|
-
}),
|
|
2239
|
-
if (
|
|
2240
|
-
else for (let e of
|
|
2241
|
-
},
|
|
2242
|
-
for (let e of
|
|
2817
|
+
return t(s.value.children), e;
|
|
2818
|
+
}), nt = j(() => tt.value.length > 0 && tt.value.every((e) => v.value.has(e))), rt = j(() => !D.value && tt.value.length > 0), it = () => {
|
|
2819
|
+
if (nt.value) for (let e of tt.value) v.value.delete(e);
|
|
2820
|
+
else for (let e of tt.value) v.value.add(e);
|
|
2821
|
+
}, at = j(() => !!(i.title || u.header || u["reorder-toggle"] || $e.value || rt.value || D.value)), ot = V([]), st = V(0), ct = () => {
|
|
2822
|
+
for (let e of ot.value) try {
|
|
2243
2823
|
e.stop();
|
|
2244
2824
|
} catch {}
|
|
2245
|
-
|
|
2246
|
-
},
|
|
2825
|
+
ot.value = [];
|
|
2826
|
+
}, lt = V(null), ut = (e, t) => {
|
|
2247
2827
|
let n = document.elementFromPoint(e, t);
|
|
2248
2828
|
if (!n) return null;
|
|
2249
2829
|
let r = n.closest(".a-le-row-wrapper");
|
|
2250
|
-
if (!r || !
|
|
2251
|
-
let i =
|
|
2830
|
+
if (!r || !T.value || !T.value.contains(r)) return null;
|
|
2831
|
+
let i = ht(r.getAttribute("data-id"));
|
|
2252
2832
|
if (i === null) return null;
|
|
2253
|
-
let a =
|
|
2833
|
+
let a = me.value.find((e) => e.key === i);
|
|
2254
2834
|
return a ? {
|
|
2255
2835
|
el: r,
|
|
2256
2836
|
viewItem: a
|
|
2257
2837
|
} : null;
|
|
2258
|
-
},
|
|
2259
|
-
if (!
|
|
2260
|
-
let n =
|
|
2838
|
+
}, dt = (e, t) => {
|
|
2839
|
+
if (!lt.value || !T.value) return;
|
|
2840
|
+
let n = ut(e, t);
|
|
2261
2841
|
if (!n) {
|
|
2262
|
-
|
|
2842
|
+
lt.value.instruction = null;
|
|
2263
2843
|
return;
|
|
2264
2844
|
}
|
|
2265
|
-
let
|
|
2266
|
-
|
|
2845
|
+
let r = T.value.getBoundingClientRect(), a = (n.el.querySelector(":scope > .a-le-row") ?? n.el).getBoundingClientRect();
|
|
2846
|
+
lt.value.instruction = fi({
|
|
2267
2847
|
pointer: {
|
|
2268
2848
|
x: e,
|
|
2269
2849
|
y: t
|
|
@@ -2276,27 +2856,27 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
2276
2856
|
siblingIndex: n.viewItem.siblingIndex,
|
|
2277
2857
|
siblingCount: n.viewItem.siblingCount
|
|
2278
2858
|
},
|
|
2279
|
-
sourceKey:
|
|
2280
|
-
sourceSubtreeDepth:
|
|
2281
|
-
viewItems:
|
|
2282
|
-
maxDepth:
|
|
2283
|
-
indentPx:
|
|
2284
|
-
containerLeft:
|
|
2285
|
-
containerPaddingLeft:
|
|
2859
|
+
sourceKey: lt.value.sourceKey,
|
|
2860
|
+
sourceSubtreeDepth: lt.value.sourceSubtreeDepth,
|
|
2861
|
+
viewItems: me.value,
|
|
2862
|
+
maxDepth: i.maxDepth,
|
|
2863
|
+
indentPx: Hi,
|
|
2864
|
+
containerLeft: r.left,
|
|
2865
|
+
containerPaddingLeft: Ui
|
|
2286
2866
|
});
|
|
2287
|
-
},
|
|
2288
|
-
|
|
2289
|
-
},
|
|
2290
|
-
if (!
|
|
2291
|
-
|
|
2867
|
+
}, ft = (e) => {
|
|
2868
|
+
dt(e.clientX, e.clientY);
|
|
2869
|
+
}, pt = (e, t) => {
|
|
2870
|
+
if (!w.moveTo(t, e.parentKey, e.index)) {
|
|
2871
|
+
f("common.sortable.error.maxDeepExceed"), st.value++, Lt(() => mt());
|
|
2292
2872
|
return;
|
|
2293
2873
|
}
|
|
2294
|
-
|
|
2295
|
-
},
|
|
2296
|
-
if (
|
|
2297
|
-
let e = Array.from(
|
|
2874
|
+
de(t), e.makeChild && e.parentKey !== null && v.value.add(e.parentKey);
|
|
2875
|
+
}, mt = () => {
|
|
2876
|
+
if (ct(), !O.value || !T.value) return;
|
|
2877
|
+
let e = Array.from(T.value.querySelectorAll("." + Vi));
|
|
2298
2878
|
for (let t of e) {
|
|
2299
|
-
let e =
|
|
2879
|
+
let e = jt(t, [], {
|
|
2300
2880
|
group: {
|
|
2301
2881
|
name: "a-nested",
|
|
2302
2882
|
pull: !0,
|
|
@@ -2304,73 +2884,73 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
2304
2884
|
},
|
|
2305
2885
|
handle: ".a-le-drag-handle",
|
|
2306
2886
|
animation: 0,
|
|
2307
|
-
ghostClass:
|
|
2308
|
-
chosenClass:
|
|
2309
|
-
dragClass:
|
|
2887
|
+
ghostClass: Le,
|
|
2888
|
+
chosenClass: yt,
|
|
2889
|
+
dragClass: Fe,
|
|
2310
2890
|
fallbackOnBody: !0,
|
|
2311
2891
|
forceFallback: !0,
|
|
2312
2892
|
fallbackTolerance: 3,
|
|
2313
2893
|
onStart: (e) => {
|
|
2314
|
-
let t = e.item, n =
|
|
2894
|
+
let t = e.item, n = ht(t.getAttribute("data-id"));
|
|
2315
2895
|
if (n === null) return;
|
|
2316
|
-
let r =
|
|
2317
|
-
|
|
2896
|
+
let r = w.findNode(n).node, i = r ? w.calculateSubtreeDepth(r) : 1;
|
|
2897
|
+
lt.value = {
|
|
2318
2898
|
sourceKey: n,
|
|
2319
2899
|
sourceSubtreeDepth: i,
|
|
2320
2900
|
instruction: null
|
|
2321
|
-
}, document.addEventListener("pointermove",
|
|
2901
|
+
}, document.addEventListener("pointermove", ft, { passive: !0 });
|
|
2322
2902
|
},
|
|
2323
2903
|
onMove: (e) => {
|
|
2324
2904
|
let t = e.originalEvent;
|
|
2325
2905
|
if (t) {
|
|
2326
|
-
if ("clientX" in t && "clientY" in t)
|
|
2906
|
+
if ("clientX" in t && "clientY" in t) dt(t.clientX, t.clientY);
|
|
2327
2907
|
else if ("touches" in t) {
|
|
2328
2908
|
let e = t;
|
|
2329
|
-
e.touches.length > 0 &&
|
|
2909
|
+
e.touches.length > 0 && dt(e.touches[0].clientX, e.touches[0].clientY);
|
|
2330
2910
|
}
|
|
2331
2911
|
}
|
|
2332
2912
|
return !1;
|
|
2333
2913
|
},
|
|
2334
2914
|
onEnd: () => {
|
|
2335
|
-
document.removeEventListener("pointermove",
|
|
2336
|
-
let e =
|
|
2337
|
-
if (
|
|
2915
|
+
document.removeEventListener("pointermove", ft);
|
|
2916
|
+
let e = lt.value;
|
|
2917
|
+
if (lt.value = null, !e) return;
|
|
2338
2918
|
let t = e.instruction;
|
|
2339
|
-
t !== null && t.type !== "blocked" &&
|
|
2919
|
+
t !== null && t.type !== "blocked" && pt(t, e.sourceKey);
|
|
2340
2920
|
}
|
|
2341
2921
|
});
|
|
2342
|
-
|
|
2922
|
+
ot.value.push(e);
|
|
2343
2923
|
}
|
|
2344
|
-
},
|
|
2924
|
+
}, ht = (e) => {
|
|
2345
2925
|
if (e === null || e === "") return null;
|
|
2346
|
-
let t =
|
|
2926
|
+
let t = Ke(e);
|
|
2347
2927
|
return String(t) === e ? t : e;
|
|
2348
2928
|
};
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
}),
|
|
2352
|
-
|
|
2353
|
-
}),
|
|
2354
|
-
|
|
2355
|
-
}),
|
|
2356
|
-
|
|
2357
|
-
}),
|
|
2358
|
-
|
|
2929
|
+
G(() => O.value, () => {
|
|
2930
|
+
O.value ? Lt(() => mt()) : ct();
|
|
2931
|
+
}), G(() => st.value, () => {
|
|
2932
|
+
O.value && Lt(() => mt());
|
|
2933
|
+
}), G(() => me.value.map((e) => e.key).join("|"), () => {
|
|
2934
|
+
O.value && Lt(() => mt());
|
|
2935
|
+
}), Ht(() => {
|
|
2936
|
+
O.value && mt();
|
|
2937
|
+
}), Vt(() => {
|
|
2938
|
+
ct(), document.removeEventListener("pointermove", ft);
|
|
2359
2939
|
});
|
|
2360
|
-
let
|
|
2361
|
-
let e =
|
|
2362
|
-
if (!e || e.instruction === null || !
|
|
2940
|
+
let gt = j(() => {
|
|
2941
|
+
let e = lt.value;
|
|
2942
|
+
if (!e || e.instruction === null || !T.value) return null;
|
|
2363
2943
|
let t = e.instruction;
|
|
2364
2944
|
if (t.type === "blocked") return null;
|
|
2365
|
-
let n =
|
|
2945
|
+
let n = T.value.querySelector(`.a-le-row-wrapper[data-id="${CSS.escape(String(t.refKey))}"]`);
|
|
2366
2946
|
if (!n) return null;
|
|
2367
|
-
let r = n.querySelector(":scope > .a-le-row"), i =
|
|
2947
|
+
let r = n.querySelector(":scope > .a-le-row"), i = T.value.getBoundingClientRect(), a = (r ?? n).getBoundingClientRect(), o = Ui + t.depth * Hi, s = t.refEdge === "top" ? a.top - i.top : a.bottom - i.top, c = {
|
|
2368
2948
|
top: s,
|
|
2369
2949
|
left: o,
|
|
2370
2950
|
right: 16
|
|
2371
2951
|
}, l = null;
|
|
2372
2952
|
if (t.levelRowKey !== null) {
|
|
2373
|
-
let e =
|
|
2953
|
+
let e = T.value.querySelector(`.a-le-row-wrapper[data-id="${CSS.escape(String(t.levelRowKey))}"]`);
|
|
2374
2954
|
if (e) {
|
|
2375
2955
|
let t = (e.querySelector(":scope > .a-le-row") ?? e).getBoundingClientRect(), n = t.top - i.top + t.height / 2;
|
|
2376
2956
|
n < s && (l = {
|
|
@@ -2384,135 +2964,135 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
2384
2964
|
line: c,
|
|
2385
2965
|
connector: l
|
|
2386
2966
|
};
|
|
2387
|
-
}),
|
|
2388
|
-
|
|
2389
|
-
},
|
|
2390
|
-
|
|
2967
|
+
}), _t = () => {
|
|
2968
|
+
Ge.value && (je(), i.factory && w.addItem(), o("add", void 0));
|
|
2969
|
+
}, vt = (e) => {
|
|
2970
|
+
E.value && (je(), i.factory && w.addAfter(e.key, void 0, e.childrenAllowed), o("add", {
|
|
2391
2971
|
afterId: e.key,
|
|
2392
2972
|
childrenAllowed: e.childrenAllowed
|
|
2393
2973
|
}));
|
|
2394
|
-
},
|
|
2395
|
-
|
|
2974
|
+
}, xt = (e) => {
|
|
2975
|
+
E.value && e.canAddChild && (je(), v.value.add(e.key), o("add-child", e), i.factory && w.addChild(e.key, void 0, !0), o("add", {
|
|
2396
2976
|
parentId: e.key,
|
|
2397
2977
|
childrenAllowed: !0
|
|
2398
2978
|
}));
|
|
2399
|
-
},
|
|
2400
|
-
if (
|
|
2401
|
-
if (
|
|
2402
|
-
|
|
2979
|
+
}, Ct = (e) => {
|
|
2980
|
+
if (E.value && !D.value) {
|
|
2981
|
+
if (Se.value.has(e.key)) {
|
|
2982
|
+
Qt(e);
|
|
2403
2983
|
return;
|
|
2404
2984
|
}
|
|
2405
|
-
|
|
2985
|
+
ye.value && Ee(e), o("edit", e);
|
|
2406
2986
|
}
|
|
2407
|
-
},
|
|
2408
|
-
if (
|
|
2409
|
-
let t = e.key, n =
|
|
2410
|
-
n ?
|
|
2411
|
-
},
|
|
2412
|
-
if (
|
|
2987
|
+
}, k = (e) => {
|
|
2988
|
+
if (i.disabled || i.loading) return;
|
|
2989
|
+
let t = e.key, n = v.value.has(t);
|
|
2990
|
+
n ? v.value.delete(t) : v.value.add(t), o("item-expand", e, !n);
|
|
2991
|
+
}, Tt = (e) => {
|
|
2992
|
+
if (i.disabled || i.loading) return;
|
|
2413
2993
|
let t = e.key, n = y.value.has(t);
|
|
2414
|
-
n ? y.value.delete(t) : y.value.add(t),
|
|
2415
|
-
}, Ot = (e) =>
|
|
2994
|
+
n ? y.value.delete(t) : y.value.add(t), o("item-expand", e, !n);
|
|
2995
|
+
}, Ot = (e) => i.disableRowClick || i.disabled || i.loading || D.value ? !1 : !!(e.editing || e.expanded || !i.readonly && i.showEditButton), kt = (e) => {
|
|
2416
2996
|
if (Ot(e)) {
|
|
2417
2997
|
if (e.editing || e.expanded) {
|
|
2418
|
-
|
|
2998
|
+
Qt(e);
|
|
2419
2999
|
return;
|
|
2420
3000
|
}
|
|
2421
|
-
|
|
3001
|
+
i.readonly && be.value ? Tt(e) : Ct(e);
|
|
2422
3002
|
}
|
|
2423
|
-
}, { deleteDialog:
|
|
2424
|
-
onDeleteConfirm: (e) => !
|
|
2425
|
-
onDelete: (e) =>
|
|
3003
|
+
}, { deleteDialog: At, deleteInFlight: Mt, deleteError: R, onDeleteClick: Pt, onDeleteDialogConfirm: It, onDeleteDialogCancel: Ut } = wt({
|
|
3004
|
+
onDeleteConfirm: (e) => !i.onDeleteConfirm || i.onDeleteConfirm(e),
|
|
3005
|
+
onDelete: (e) => i.onDelete?.(e),
|
|
2426
3006
|
onDeleted: (e) => {
|
|
2427
|
-
|
|
2428
|
-
let t =
|
|
2429
|
-
|
|
3007
|
+
Se.value.delete(e.key), Ce.value.delete(e.key), y.value.delete(e.key), v.value.delete(e.key);
|
|
3008
|
+
let t = i.deleteMode === "deferred";
|
|
3009
|
+
D.value && (t ? se.value.add(e.key) : ce.value.add(e.key)), w.deleteItem(e.key, { trackDeleted: t }), o("deleted", e);
|
|
2430
3010
|
},
|
|
2431
|
-
disableDeleteConfirm: () =>
|
|
2432
|
-
}),
|
|
2433
|
-
|
|
2434
|
-
},
|
|
2435
|
-
|
|
2436
|
-
},
|
|
2437
|
-
|
|
2438
|
-
}, Xt = (e) => {
|
|
2439
|
-
Ne(e), i("close", e);
|
|
2440
|
-
}, Y = (e) => {
|
|
2441
|
-
S.moveUp(e) && me(e);
|
|
3011
|
+
disableDeleteConfirm: () => i.disableDeleteConfirm
|
|
3012
|
+
}), Gt = async (e) => {
|
|
3013
|
+
E.value && await Pt(e);
|
|
3014
|
+
}, qt = async (e) => {
|
|
3015
|
+
i.onItemSave && await i.onItemSave(e.raw), Oe(e), o("item-saved", e);
|
|
3016
|
+
}, Zt = (e) => {
|
|
3017
|
+
De(e);
|
|
2442
3018
|
}, Qt = (e) => {
|
|
2443
|
-
|
|
3019
|
+
Ae(e), o("close", e);
|
|
3020
|
+
}, $t = (e) => {
|
|
3021
|
+
w.moveUp(e) && de(e);
|
|
3022
|
+
}, q = (e) => {
|
|
3023
|
+
w.moveDown(e) && de(e);
|
|
3024
|
+
}, J = (e) => {
|
|
3025
|
+
w.moveTop(e) && de(e);
|
|
2444
3026
|
}, tn = (e) => {
|
|
2445
|
-
|
|
3027
|
+
w.moveBottom(e) && de(e);
|
|
2446
3028
|
}, nn = (e) => {
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
if (!S.indent(e.key)) {
|
|
2450
|
-
u("common.sortable.error.maxDeepExceed");
|
|
3029
|
+
if (!w.indent(e.key)) {
|
|
3030
|
+
f("common.sortable.error.maxDeepExceed");
|
|
2451
3031
|
return;
|
|
2452
3032
|
}
|
|
2453
|
-
|
|
2454
|
-
},
|
|
2455
|
-
|
|
2456
|
-
}, sn = (e) =>
|
|
3033
|
+
de(e.key), o("indent", e);
|
|
3034
|
+
}, on = (e) => {
|
|
3035
|
+
w.outdent(e.key) && (de(e.key), o("outdent", e));
|
|
3036
|
+
}, sn = (e) => d(e, { compactField: i.compactField }), cn = (e, t) => t === void 0 ? null : w.rowState(e, t, Se.value.has(t)), ln = /* @__PURE__ */ new Map(), dn = (e) => {
|
|
2457
3037
|
let t = ln.get(e);
|
|
2458
3038
|
return t || (t = {
|
|
2459
3039
|
edit: () => {
|
|
2460
|
-
let t =
|
|
2461
|
-
t &&
|
|
3040
|
+
let t = Z(e);
|
|
3041
|
+
t && Ct(t);
|
|
2462
3042
|
},
|
|
2463
3043
|
save: () => {
|
|
2464
|
-
let t =
|
|
2465
|
-
if (t) return
|
|
3044
|
+
let t = Z(e);
|
|
3045
|
+
if (t) return qt(t);
|
|
2466
3046
|
},
|
|
2467
3047
|
cancel: () => {
|
|
2468
|
-
let t =
|
|
2469
|
-
t &&
|
|
3048
|
+
let t = Z(e);
|
|
3049
|
+
t && Zt(t);
|
|
2470
3050
|
},
|
|
2471
3051
|
close: () => {
|
|
2472
|
-
let t =
|
|
2473
|
-
t &&
|
|
3052
|
+
let t = Z(e);
|
|
3053
|
+
t && Qt(t);
|
|
2474
3054
|
},
|
|
2475
3055
|
delete: async () => {
|
|
2476
|
-
let t =
|
|
2477
|
-
t && await
|
|
3056
|
+
let t = Z(e);
|
|
3057
|
+
t && await Gt(t);
|
|
2478
3058
|
},
|
|
2479
3059
|
addAfter: () => {
|
|
2480
|
-
let t =
|
|
2481
|
-
t &&
|
|
3060
|
+
let t = Z(e);
|
|
3061
|
+
t && vt(t);
|
|
2482
3062
|
},
|
|
2483
3063
|
addChild: () => {
|
|
2484
|
-
let t =
|
|
2485
|
-
t &&
|
|
3064
|
+
let t = Z(e);
|
|
3065
|
+
t && xt(t);
|
|
2486
3066
|
},
|
|
2487
3067
|
toggleExpand: () => {
|
|
2488
|
-
let t =
|
|
2489
|
-
t &&
|
|
3068
|
+
let t = Z(e);
|
|
3069
|
+
t && k(t);
|
|
2490
3070
|
},
|
|
2491
3071
|
toggleDetail: () => {
|
|
2492
|
-
let t =
|
|
2493
|
-
t &&
|
|
3072
|
+
let t = Z(e);
|
|
3073
|
+
t && Tt(t);
|
|
2494
3074
|
},
|
|
2495
|
-
moveUp: () =>
|
|
2496
|
-
moveDown: () =>
|
|
2497
|
-
moveTop: () =>
|
|
2498
|
-
moveBottom: () =>
|
|
3075
|
+
moveUp: () => $t(e),
|
|
3076
|
+
moveDown: () => q(e),
|
|
3077
|
+
moveTop: () => J(e),
|
|
3078
|
+
moveBottom: () => tn(e),
|
|
2499
3079
|
indent: () => {
|
|
2500
|
-
let t =
|
|
2501
|
-
t &&
|
|
3080
|
+
let t = Z(e);
|
|
3081
|
+
t && nn(t);
|
|
2502
3082
|
},
|
|
2503
3083
|
outdent: () => {
|
|
2504
|
-
let t =
|
|
2505
|
-
t &&
|
|
3084
|
+
let t = Z(e);
|
|
3085
|
+
t && on(t);
|
|
2506
3086
|
},
|
|
2507
|
-
update: (t) =>
|
|
3087
|
+
update: (t) => w.updateItem(e, t)
|
|
2508
3088
|
}, ln.set(e, t)), t;
|
|
2509
3089
|
};
|
|
2510
|
-
|
|
3090
|
+
G(() => me.value, (e) => {
|
|
2511
3091
|
if (ln.size === 0) return;
|
|
2512
3092
|
let t = new Set(e.map((e) => e.key));
|
|
2513
3093
|
for (let e of ln.keys()) t.has(e) || ln.delete(e);
|
|
2514
3094
|
});
|
|
2515
|
-
let
|
|
3095
|
+
let fn = (e) => ({
|
|
2516
3096
|
item: {
|
|
2517
3097
|
...e,
|
|
2518
3098
|
validationState: cn(e.raw, e.key)
|
|
@@ -2528,382 +3108,382 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
2528
3108
|
childrenAllowed: e.childrenAllowed,
|
|
2529
3109
|
firstInParent: e.firstInParent,
|
|
2530
3110
|
lastInParent: e.lastInParent,
|
|
2531
|
-
readonly:
|
|
2532
|
-
disabled:
|
|
3111
|
+
readonly: i.readonly,
|
|
3112
|
+
disabled: i.disabled,
|
|
2533
3113
|
expanded: e.expanded,
|
|
2534
3114
|
childrenExpanded: e.childrenExpanded,
|
|
2535
3115
|
editing: e.editing,
|
|
2536
3116
|
dirty: e.dirty,
|
|
2537
3117
|
unsaved: e.unsaved,
|
|
2538
3118
|
moved: e.moved,
|
|
2539
|
-
reorderMode:
|
|
3119
|
+
reorderMode: D.value,
|
|
2540
3120
|
canMoveUp: !e.firstInParent,
|
|
2541
3121
|
canMoveDown: !e.lastInParent,
|
|
2542
3122
|
canIndent: e.canIndent,
|
|
2543
3123
|
canOutdent: e.canOutdent,
|
|
2544
3124
|
canAddChild: e.canAddChild,
|
|
2545
|
-
touch:
|
|
2546
|
-
stateKeyPrefix:
|
|
2547
|
-
actions:
|
|
2548
|
-
}),
|
|
2549
|
-
applying:
|
|
2550
|
-
hasPendingChanges:
|
|
2551
|
-
movedCount:
|
|
2552
|
-
error:
|
|
3125
|
+
touch: h.value,
|
|
3126
|
+
stateKeyPrefix: re.prefixFor(e.key),
|
|
3127
|
+
actions: dn(e.key)
|
|
3128
|
+
}), pn = j(() => ({
|
|
3129
|
+
applying: Me.value,
|
|
3130
|
+
hasPendingChanges: We.value,
|
|
3131
|
+
movedCount: Ue.value,
|
|
3132
|
+
error: Ne.value,
|
|
2553
3133
|
actions: {
|
|
2554
|
-
apply:
|
|
2555
|
-
cancel:
|
|
3134
|
+
apply: Ve,
|
|
3135
|
+
cancel: ze
|
|
2556
3136
|
}
|
|
2557
|
-
})),
|
|
2558
|
-
mode:
|
|
2559
|
-
disabled: !
|
|
2560
|
-
hasPendingChanges:
|
|
3137
|
+
})), mn = j(() => ({
|
|
3138
|
+
mode: c.value,
|
|
3139
|
+
disabled: !ve.value,
|
|
3140
|
+
hasPendingChanges: Pe.value,
|
|
2561
3141
|
actions: {
|
|
2562
|
-
enterReorderMode:
|
|
2563
|
-
exitReorderMode:
|
|
3142
|
+
enterReorderMode: Re,
|
|
3143
|
+
exitReorderMode: ze
|
|
2564
3144
|
}
|
|
2565
|
-
})),
|
|
2566
|
-
viewItems:
|
|
3145
|
+
})), hn = j(() => new Set(tt.value)), Z = (e) => me.value.find((t) => t.key === e), Q = r({
|
|
3146
|
+
viewItems: j(() => me.value.map((e) => ({
|
|
2567
3147
|
key: e.key,
|
|
2568
3148
|
expanded: e.childrenExpanded,
|
|
2569
|
-
canExpand:
|
|
3149
|
+
canExpand: hn.value.has(e.key),
|
|
2570
3150
|
canIndent: !0,
|
|
2571
3151
|
canOutdent: !0
|
|
2572
3152
|
}))),
|
|
2573
3153
|
variant: "nested",
|
|
2574
|
-
isReorderMode:
|
|
2575
|
-
disabled:
|
|
2576
|
-
isEditing: (e) =>
|
|
3154
|
+
isReorderMode: D,
|
|
3155
|
+
disabled: j(() => !E.value),
|
|
3156
|
+
isEditing: (e) => Se.value.has(e),
|
|
2577
3157
|
onToggleEdit: (e) => {
|
|
2578
|
-
let t =
|
|
2579
|
-
t &&
|
|
3158
|
+
let t = Z(e);
|
|
3159
|
+
t && Ct(t);
|
|
2580
3160
|
},
|
|
2581
3161
|
onCancelEdit: (e) => {
|
|
2582
|
-
let t =
|
|
2583
|
-
t &&
|
|
3162
|
+
let t = Z(e);
|
|
3163
|
+
t && Qt(t);
|
|
2584
3164
|
},
|
|
2585
|
-
onMoveUp: (e) =>
|
|
2586
|
-
onMoveDown: (e) =>
|
|
2587
|
-
onMoveTop: (e) =>
|
|
2588
|
-
onMoveBottom: (e) =>
|
|
3165
|
+
onMoveUp: (e) => $t(e),
|
|
3166
|
+
onMoveDown: (e) => q(e),
|
|
3167
|
+
onMoveTop: (e) => J(e),
|
|
3168
|
+
onMoveBottom: (e) => tn(e),
|
|
2589
3169
|
onIndent: (e) => {
|
|
2590
|
-
let t =
|
|
2591
|
-
t &&
|
|
3170
|
+
let t = Z(e);
|
|
3171
|
+
t && nn(t);
|
|
2592
3172
|
},
|
|
2593
3173
|
onOutdent: (e) => {
|
|
2594
|
-
let t =
|
|
2595
|
-
t &&
|
|
3174
|
+
let t = Z(e);
|
|
3175
|
+
t && on(t);
|
|
2596
3176
|
},
|
|
2597
3177
|
onToggleChildren: (e) => {
|
|
2598
|
-
let t =
|
|
2599
|
-
t &&
|
|
3178
|
+
let t = Z(e);
|
|
3179
|
+
t && k(t);
|
|
2600
3180
|
},
|
|
2601
|
-
onCancelReorder: () =>
|
|
2602
|
-
}),
|
|
3181
|
+
onCancelReorder: () => ze()
|
|
3182
|
+
}), $ = V(!1), gn = Kt(null), _n = j(() => {
|
|
2603
3183
|
let e = gn.value;
|
|
2604
3184
|
if (!e) return null;
|
|
2605
|
-
let t =
|
|
3185
|
+
let t = w.findNode(e.key), n = t.parent?.children ?? s.value.children, r = n.findIndex((t) => x(t.data) === e.key);
|
|
2606
3186
|
return {
|
|
2607
3187
|
parentId: t.parent ? x(t.parent.data) : null,
|
|
2608
3188
|
total: n.length,
|
|
2609
3189
|
currentIndex: r
|
|
2610
3190
|
};
|
|
2611
|
-
}), vn =
|
|
2612
|
-
|
|
3191
|
+
}), vn = j(() => gn.value ? sn(gn.value.raw) : ""), yn = (e) => {
|
|
3192
|
+
i.showMoveToPosition && (gn.value = e, $.value = !0);
|
|
2613
3193
|
}, bn = (e) => {
|
|
2614
3194
|
let t = _n.value, n = gn.value;
|
|
2615
|
-
gn.value = null, t && n && e !== t.currentIndex &&
|
|
2616
|
-
}, xn =
|
|
2617
|
-
|
|
3195
|
+
gn.value = null, t && n && e !== t.currentIndex && w.moveTo(n.key, t.parentId, e) && de(n.key);
|
|
3196
|
+
}, xn = V(!1), Sn = Kt(null), Cn = (e) => {
|
|
3197
|
+
i.showChangeParent && (Sn.value = e, xn.value = !0);
|
|
2618
3198
|
}, wn = (e, t) => {
|
|
2619
3199
|
let n = Sn.value;
|
|
2620
3200
|
if (Sn.value = null, !n) return;
|
|
2621
3201
|
let r = 0;
|
|
2622
|
-
r = e === null ?
|
|
3202
|
+
r = e === null ? s.value.children.length : w.findNode(e).node?.children?.length ?? 0;
|
|
2623
3203
|
let i = t === "first" ? 0 : r;
|
|
2624
|
-
|
|
2625
|
-
}, Tn =
|
|
2626
|
-
reorderMode:
|
|
2627
|
-
readonly:
|
|
2628
|
-
canInteract:
|
|
2629
|
-
dragEnabled:
|
|
2630
|
-
showExpandToggle:
|
|
2631
|
-
showEditButton:
|
|
2632
|
-
showDeleteButton:
|
|
2633
|
-
showAddChildButton:
|
|
2634
|
-
showAddAfterAction:
|
|
2635
|
-
showMoveToPosition:
|
|
2636
|
-
showChangeParent:
|
|
2637
|
-
showInlineSaveFooter:
|
|
2638
|
-
statusField:
|
|
3204
|
+
w.moveTo(n.key, e, i) && (de(n.key), e !== null && v.value.add(e));
|
|
3205
|
+
}, Tn = j(() => ({
|
|
3206
|
+
reorderMode: D.value,
|
|
3207
|
+
readonly: i.readonly,
|
|
3208
|
+
canInteract: E.value,
|
|
3209
|
+
dragEnabled: O.value,
|
|
3210
|
+
showExpandToggle: i.showExpandToggle,
|
|
3211
|
+
showEditButton: i.showEditButton,
|
|
3212
|
+
showDeleteButton: i.showDeleteButton,
|
|
3213
|
+
showAddChildButton: i.showAddChildButton,
|
|
3214
|
+
showAddAfterAction: i.showAddAfterAction,
|
|
3215
|
+
showMoveToPosition: i.showMoveToPosition,
|
|
3216
|
+
showChangeParent: i.showChangeParent,
|
|
3217
|
+
showInlineSaveFooter: xe.value,
|
|
3218
|
+
statusField: i.statusField,
|
|
2639
3219
|
effectiveCloseVariant: g.value,
|
|
2640
|
-
keyboardNav:
|
|
3220
|
+
keyboardNav: Q,
|
|
2641
3221
|
isRowClickable: Ot,
|
|
2642
3222
|
resolveCompactText: sn,
|
|
2643
3223
|
resolveValidation: (e, t) => cn(e, t),
|
|
2644
|
-
buildSlotProps:
|
|
3224
|
+
buildSlotProps: fn
|
|
2645
3225
|
})), En = {
|
|
2646
3226
|
onRowClick: kt,
|
|
2647
|
-
onChevronClick:
|
|
2648
|
-
onEditClick:
|
|
2649
|
-
onDeleteClick:
|
|
2650
|
-
onCloseClick:
|
|
2651
|
-
onSaveClick:
|
|
2652
|
-
onCancelClick:
|
|
2653
|
-
onAddAfterClick:
|
|
2654
|
-
onAddChildClick:
|
|
2655
|
-
moveUp: (e) =>
|
|
2656
|
-
moveDown: (e) =>
|
|
2657
|
-
moveTop: (e) =>
|
|
2658
|
-
moveBottom: (e) =>
|
|
2659
|
-
indent:
|
|
2660
|
-
outdent:
|
|
3227
|
+
onChevronClick: k,
|
|
3228
|
+
onEditClick: Ct,
|
|
3229
|
+
onDeleteClick: Gt,
|
|
3230
|
+
onCloseClick: Qt,
|
|
3231
|
+
onSaveClick: qt,
|
|
3232
|
+
onCancelClick: Zt,
|
|
3233
|
+
onAddAfterClick: vt,
|
|
3234
|
+
onAddChildClick: xt,
|
|
3235
|
+
moveUp: (e) => $t(e),
|
|
3236
|
+
moveDown: (e) => q(e),
|
|
3237
|
+
moveTop: (e) => J(e),
|
|
3238
|
+
moveBottom: (e) => tn(e),
|
|
3239
|
+
indent: nn,
|
|
3240
|
+
outdent: on,
|
|
2661
3241
|
openMoveToPosition: yn,
|
|
2662
3242
|
openChangeParent: Cn
|
|
2663
|
-
}, Dn =
|
|
3243
|
+
}, Dn = j(() => me.value.filter((e) => e.parentKey === null)), On = (e, t, n) => (w.addItem(t, {
|
|
2664
3244
|
afterId: e ?? void 0,
|
|
2665
3245
|
childrenAllowed: n
|
|
2666
|
-
}),
|
|
3246
|
+
}), Lt(() => w.commit()), s.value), kn = (e, t, n) => (v.value.add(e), w.addItem(t, {
|
|
2667
3247
|
parentId: e,
|
|
2668
3248
|
asFirstChild: !0,
|
|
2669
3249
|
childrenAllowed: n
|
|
2670
|
-
}),
|
|
2671
|
-
|
|
3250
|
+
}), Lt(() => w.commit()), s.value), An = (e) => {
|
|
3251
|
+
w.deleteItem(e), Se.value.delete(e), Ce.value.delete(e), y.value.delete(e), v.value.delete(e), Lt(() => w.commit());
|
|
2672
3252
|
}, jn = (e, t, n = null, r = null, i = null) => {
|
|
2673
|
-
|
|
2674
|
-
}, Mn =
|
|
2675
|
-
|
|
3253
|
+
w.updateItem(e, t), Lt(() => w.commit());
|
|
3254
|
+
}, Mn = w.unsavedCount, Nn = () => {
|
|
3255
|
+
w.commit(), oe.value = /* @__PURE__ */ new Set(), Te();
|
|
2676
3256
|
};
|
|
2677
|
-
|
|
2678
|
-
label:
|
|
2679
|
-
dirty:
|
|
3257
|
+
fe(() => i.unsavedSectionLabel && !i.disableUnsaved ? {
|
|
3258
|
+
label: i.unsavedSectionLabel,
|
|
3259
|
+
dirty: w.hasUnsaved.value
|
|
2680
3260
|
} : []);
|
|
2681
|
-
let Pn = () =>
|
|
2682
|
-
let t =
|
|
2683
|
-
for (; t;)
|
|
2684
|
-
let n =
|
|
2685
|
-
n &&
|
|
3261
|
+
let Pn = () => le(w, (e) => {
|
|
3262
|
+
let t = w.findNode(e).parent;
|
|
3263
|
+
for (; t;) v.value.add(x(t.data)), t = w.findNode(x(t.data)).parent;
|
|
3264
|
+
let n = w.viewItems.value.find((t) => t.key === e);
|
|
3265
|
+
n && Ee(n);
|
|
2686
3266
|
});
|
|
2687
|
-
return
|
|
2688
|
-
hasErrors:
|
|
2689
|
-
validationScope:
|
|
2690
|
-
validateProvided:
|
|
3267
|
+
return Et({
|
|
3268
|
+
hasErrors: w.hasErrors,
|
|
3269
|
+
validationScope: i.validationScope,
|
|
3270
|
+
validateProvided: i.validate !== void 0,
|
|
2691
3271
|
reveal: Pn
|
|
2692
3272
|
}), t({
|
|
2693
|
-
...
|
|
3273
|
+
...w,
|
|
2694
3274
|
validateAll: Pn,
|
|
2695
3275
|
addAfterId: On,
|
|
2696
3276
|
addChildToId: kn,
|
|
2697
3277
|
removeById: An,
|
|
2698
3278
|
updateData: jn,
|
|
2699
|
-
resetDirtyBaseline:
|
|
2700
|
-
hasUnsavedChanges:
|
|
3279
|
+
resetDirtyBaseline: ue,
|
|
3280
|
+
hasUnsavedChanges: w.hasUnsaved,
|
|
2701
3281
|
unsavedCount: Mn,
|
|
2702
3282
|
clearUnsavedState: Nn,
|
|
2703
|
-
viewItems:
|
|
2704
|
-
enterReorderMode:
|
|
2705
|
-
cancelReorderMode:
|
|
2706
|
-
applyReorder:
|
|
2707
|
-
expand: (e) =>
|
|
2708
|
-
collapse: (e) =>
|
|
3283
|
+
viewItems: ie,
|
|
3284
|
+
enterReorderMode: Re,
|
|
3285
|
+
cancelReorderMode: ze,
|
|
3286
|
+
applyReorder: Ve,
|
|
3287
|
+
expand: (e) => v.value.add(e),
|
|
3288
|
+
collapse: (e) => v.value.delete(e),
|
|
2709
3289
|
toggleExpand: (e) => {
|
|
2710
|
-
|
|
3290
|
+
v.value.has(e) ? v.value.delete(e) : v.value.add(e);
|
|
2711
3291
|
},
|
|
2712
3292
|
expandDetail: (e) => y.value.add(e),
|
|
2713
3293
|
collapseDetail: (e) => y.value.delete(e)
|
|
2714
|
-
}), (t, n) => (
|
|
3294
|
+
}), (t, n) => (B(), P("div", {
|
|
2715
3295
|
ref_key: "rootEl",
|
|
2716
|
-
ref:
|
|
2717
|
-
class:
|
|
3296
|
+
ref: p,
|
|
3297
|
+
class: Rt(["a-nested-list-editor", [`a-nested-list-editor--mode-${c.value}`, {
|
|
2718
3298
|
"a-nested-list-editor--readonly": e.readonly,
|
|
2719
3299
|
"a-nested-list-editor--disabled": e.disabled,
|
|
2720
|
-
"a-nested-list-editor--touch":
|
|
2721
|
-
"a-nested-list-editor--drag-enabled":
|
|
3300
|
+
"a-nested-list-editor--touch": W(h),
|
|
3301
|
+
"a-nested-list-editor--drag-enabled": O.value
|
|
2722
3302
|
}]])
|
|
2723
3303
|
}, [
|
|
2724
|
-
|
|
2725
|
-
|
|
2726
|
-
|
|
2727
|
-
class:
|
|
2728
|
-
"has-pending-changes":
|
|
2729
|
-
"pending-count":
|
|
2730
|
-
error:
|
|
3304
|
+
F("div", Ni, [
|
|
3305
|
+
at.value ? (B(), P("div", Pi, [H(t.$slots, "header", z({ title: e.title }, mn.value), () => [e.title ? (B(), P("h3", Fi, U(e.title), 1)) : N("", !0), F("div", Ii, [W(D) ? H(t.$slots, "reorder-toolbar", zt(Nt(pn.value)), () => [
|
|
3306
|
+
L(He, {
|
|
3307
|
+
class: Rt({ "a-le-toolbar-status--pending": We.value }),
|
|
3308
|
+
"has-pending-changes": We.value,
|
|
3309
|
+
"pending-count": Ue.value,
|
|
3310
|
+
error: W(Ne)
|
|
2731
3311
|
}, null, 8, [
|
|
2732
3312
|
"class",
|
|
2733
3313
|
"has-pending-changes",
|
|
2734
3314
|
"pending-count",
|
|
2735
3315
|
"error"
|
|
2736
3316
|
]),
|
|
2737
|
-
|
|
3317
|
+
L(X, {
|
|
2738
3318
|
variant: "text",
|
|
2739
3319
|
size: "small",
|
|
2740
|
-
disabled:
|
|
2741
|
-
onClick:
|
|
3320
|
+
disabled: W(Me),
|
|
3321
|
+
onClick: W(ze)
|
|
2742
3322
|
}, {
|
|
2743
|
-
default:
|
|
3323
|
+
default: K(() => [I(U(W(l)("common.sortable.reorderCancel")), 1)]),
|
|
2744
3324
|
_: 1
|
|
2745
3325
|
}, 8, ["disabled", "onClick"]),
|
|
2746
|
-
|
|
3326
|
+
L(X, {
|
|
2747
3327
|
color: "primary",
|
|
2748
3328
|
variant: "flat",
|
|
2749
3329
|
size: "small",
|
|
2750
3330
|
"prepend-icon": "mdi-check",
|
|
2751
|
-
loading:
|
|
2752
|
-
disabled:
|
|
2753
|
-
onClick:
|
|
3331
|
+
loading: W(Me),
|
|
3332
|
+
disabled: W(Me) || !We.value,
|
|
3333
|
+
onClick: W(Ve)
|
|
2754
3334
|
}, {
|
|
2755
|
-
default:
|
|
3335
|
+
default: K(() => [I(U(W(l)("common.sortable.reorderApply")), 1)]),
|
|
2756
3336
|
_: 1
|
|
2757
3337
|
}, 8, [
|
|
2758
3338
|
"loading",
|
|
2759
3339
|
"disabled",
|
|
2760
3340
|
"onClick"
|
|
2761
3341
|
])
|
|
2762
|
-
], void 0, 0) : (
|
|
3342
|
+
], void 0, 0) : (B(), P(A, { key: 1 }, [rt.value && et.value ? (B(), M(X, {
|
|
2763
3343
|
key: 0,
|
|
2764
3344
|
variant: "tonal",
|
|
2765
3345
|
color: "primary",
|
|
2766
3346
|
icon: "",
|
|
2767
3347
|
size: "x-small",
|
|
2768
|
-
onClick:
|
|
3348
|
+
onClick: it
|
|
2769
3349
|
}, {
|
|
2770
|
-
default:
|
|
2771
|
-
icon:
|
|
3350
|
+
default: K(() => [L(Y, {
|
|
3351
|
+
icon: nt.value ? "mdi-unfold-less-horizontal" : "mdi-unfold-more-horizontal",
|
|
2772
3352
|
size: "18"
|
|
2773
|
-
}, null, 8, ["icon"]),
|
|
3353
|
+
}, null, 8, ["icon"]), L(un, {
|
|
2774
3354
|
activator: "parent",
|
|
2775
3355
|
location: "bottom",
|
|
2776
|
-
text:
|
|
3356
|
+
text: nt.value ? W(l)("common.sortable.collapseAll") : W(l)("common.sortable.expandAll")
|
|
2777
3357
|
}, null, 8, ["text"])]),
|
|
2778
3358
|
_: 1
|
|
2779
|
-
})) :
|
|
3359
|
+
})) : rt.value ? (B(), M(X, {
|
|
2780
3360
|
key: 1,
|
|
2781
3361
|
variant: "tonal",
|
|
2782
3362
|
color: "primary",
|
|
2783
3363
|
size: "small",
|
|
2784
|
-
"prepend-icon":
|
|
2785
|
-
onClick:
|
|
3364
|
+
"prepend-icon": nt.value ? "mdi-unfold-less-horizontal" : "mdi-unfold-more-horizontal",
|
|
3365
|
+
onClick: it
|
|
2786
3366
|
}, {
|
|
2787
|
-
default:
|
|
3367
|
+
default: K(() => [I(U(nt.value ? W(l)("common.sortable.collapseAll") : W(l)("common.sortable.expandAll")), 1)]),
|
|
2788
3368
|
_: 1
|
|
2789
|
-
}, 8, ["prepend-icon"])) :
|
|
3369
|
+
}, 8, ["prepend-icon"])) : N("", !0), $e.value ? H(t.$slots, "reorder-toggle", zt(Nt(mn.value)), () => [et.value ? (B(), M(X, {
|
|
2790
3370
|
key: 0,
|
|
2791
3371
|
variant: "tonal",
|
|
2792
3372
|
color: "primary",
|
|
2793
3373
|
icon: "",
|
|
2794
3374
|
size: "x-small",
|
|
2795
|
-
disabled: !
|
|
2796
|
-
onClick:
|
|
3375
|
+
disabled: !ve.value,
|
|
3376
|
+
onClick: W(Re)
|
|
2797
3377
|
}, {
|
|
2798
|
-
default:
|
|
3378
|
+
default: K(() => [L(Y, {
|
|
2799
3379
|
icon: "mdi-sort",
|
|
2800
3380
|
size: "18"
|
|
2801
|
-
}),
|
|
3381
|
+
}), L(un, {
|
|
2802
3382
|
activator: "parent",
|
|
2803
3383
|
location: "bottom",
|
|
2804
|
-
text:
|
|
3384
|
+
text: W(l)("common.sortable.reorder")
|
|
2805
3385
|
}, null, 8, ["text"])]),
|
|
2806
3386
|
_: 1
|
|
2807
|
-
}, 8, ["disabled", "onClick"])) : (
|
|
3387
|
+
}, 8, ["disabled", "onClick"])) : (B(), M(X, {
|
|
2808
3388
|
key: 1,
|
|
2809
3389
|
variant: "tonal",
|
|
2810
3390
|
color: "primary",
|
|
2811
3391
|
"prepend-icon": "mdi-sort",
|
|
2812
3392
|
size: "small",
|
|
2813
|
-
disabled: !
|
|
2814
|
-
onClick:
|
|
3393
|
+
disabled: !ve.value,
|
|
3394
|
+
onClick: W(Re)
|
|
2815
3395
|
}, {
|
|
2816
|
-
default:
|
|
3396
|
+
default: K(() => [I(U(W(l)("common.sortable.reorder")), 1)]),
|
|
2817
3397
|
_: 1
|
|
2818
|
-
}, 8, ["disabled", "onClick"]))], void 0, 2) :
|
|
2819
|
-
e.loading ? (
|
|
3398
|
+
}, 8, ["disabled", "onClick"]))], void 0, 2) : N("", !0)], 64))])])])) : N("", !0),
|
|
3399
|
+
e.loading ? (B(), P("div", Li, [L(an, {
|
|
2820
3400
|
indeterminate: "",
|
|
2821
3401
|
color: "primary",
|
|
2822
3402
|
size: "32"
|
|
2823
|
-
})])) : e.error ? (
|
|
3403
|
+
})])) : e.error ? (B(), P("div", Ri, [L(rn, {
|
|
2824
3404
|
type: "error",
|
|
2825
3405
|
variant: "tonal",
|
|
2826
3406
|
density: "compact",
|
|
2827
3407
|
border: "start"
|
|
2828
3408
|
}, {
|
|
2829
|
-
default:
|
|
3409
|
+
default: K(() => [I(U(e.error), 1)]),
|
|
2830
3410
|
_: 1
|
|
2831
|
-
})])) :
|
|
3411
|
+
})])) : he.value ? (B(), P("div", zi, [H(t.$slots, "empty", {
|
|
2832
3412
|
readonly: e.readonly,
|
|
2833
3413
|
disabled: e.disabled,
|
|
2834
|
-
actions: { add:
|
|
2835
|
-
}, () => [
|
|
2836
|
-
title:
|
|
2837
|
-
"add-label":
|
|
2838
|
-
"can-add":
|
|
2839
|
-
onAdd:
|
|
3414
|
+
actions: { add: _t }
|
|
3415
|
+
}, () => [L(Be, {
|
|
3416
|
+
title: Xe.value,
|
|
3417
|
+
"add-label": qe.value,
|
|
3418
|
+
"can-add": Ge.value,
|
|
3419
|
+
onAdd: _t
|
|
2840
3420
|
}, null, 8, [
|
|
2841
3421
|
"title",
|
|
2842
3422
|
"add-label",
|
|
2843
3423
|
"can-add"
|
|
2844
|
-
])])])) : (
|
|
2845
|
-
key:
|
|
3424
|
+
])])])) : (B(), P("div", {
|
|
3425
|
+
key: st.value,
|
|
2846
3426
|
ref_key: "rowsContainer",
|
|
2847
|
-
ref:
|
|
2848
|
-
class:
|
|
2849
|
-
}, [
|
|
2850
|
-
class:
|
|
3427
|
+
ref: T,
|
|
3428
|
+
class: Rt(["a-nested-list-editor__rows", { "a-nested-list-editor__rows--dragging": lt.value !== null }])
|
|
3429
|
+
}, [F("div", {
|
|
3430
|
+
class: Rt([Vi, "a-nested-list-editor__group--root"]),
|
|
2851
3431
|
"data-parent-id": ""
|
|
2852
|
-
}, [(
|
|
3432
|
+
}, [(B(!0), P(A, null, Wt(Dn.value, (e) => (B(), M(Ai, {
|
|
2853
3433
|
key: String(e.key),
|
|
2854
3434
|
vi: e,
|
|
2855
|
-
"view-items":
|
|
2856
|
-
"drag-state":
|
|
3435
|
+
"view-items": me.value,
|
|
3436
|
+
"drag-state": lt.value,
|
|
2857
3437
|
context: Tn.value,
|
|
2858
3438
|
callbacks: En
|
|
2859
3439
|
}, {
|
|
2860
|
-
item:
|
|
2861
|
-
"item-compact":
|
|
2862
|
-
"item-readonly":
|
|
2863
|
-
"item-status":
|
|
2864
|
-
"item-footer":
|
|
2865
|
-
"item-actions":
|
|
2866
|
-
"before-item":
|
|
2867
|
-
"after-item":
|
|
3440
|
+
item: K((e) => [H(t.$slots, "item", z({ ref_for: !0 }, e))]),
|
|
3441
|
+
"item-compact": K((e) => [H(t.$slots, "item-compact", z({ ref_for: !0 }, e))]),
|
|
3442
|
+
"item-readonly": K((e) => [H(t.$slots, "item-readonly", z({ ref_for: !0 }, e))]),
|
|
3443
|
+
"item-status": K((e) => [H(t.$slots, "item-status", z({ ref_for: !0 }, e))]),
|
|
3444
|
+
"item-footer": K((e) => [H(t.$slots, "item-footer", z({ ref_for: !0 }, e))]),
|
|
3445
|
+
"item-actions": K((e) => [H(t.$slots, "item-actions", z({ ref_for: !0 }, e))]),
|
|
3446
|
+
"before-item": K((e) => [H(t.$slots, "before-item", z({ ref_for: !0 }, e))]),
|
|
3447
|
+
"after-item": K((e) => [H(t.$slots, "after-item", z({ ref_for: !0 }, e))]),
|
|
2868
3448
|
_: 3
|
|
2869
3449
|
}, 8, [
|
|
2870
3450
|
"vi",
|
|
2871
3451
|
"view-items",
|
|
2872
3452
|
"drag-state",
|
|
2873
3453
|
"context"
|
|
2874
|
-
]))), 128))], 2),
|
|
3454
|
+
]))), 128))], 2), gt.value === null ? N("", !0) : (B(), P(A, { key: 0 }, [gt.value.connector === null ? N("", !0) : (B(), P("div", {
|
|
2875
3455
|
key: 0,
|
|
2876
3456
|
class: "a-nested-list-editor__drop-connector",
|
|
2877
|
-
style:
|
|
2878
|
-
left: `${
|
|
2879
|
-
top: `${
|
|
2880
|
-
height: `${
|
|
3457
|
+
style: Bt({
|
|
3458
|
+
left: `${gt.value.connector.left}px`,
|
|
3459
|
+
top: `${gt.value.connector.top}px`,
|
|
3460
|
+
height: `${gt.value.connector.height}px`
|
|
2881
3461
|
})
|
|
2882
|
-
}, null, 4)),
|
|
3462
|
+
}, null, 4)), F("div", {
|
|
2883
3463
|
class: "a-nested-list-editor__drop-line",
|
|
2884
|
-
style:
|
|
2885
|
-
top: `${
|
|
2886
|
-
left: `${
|
|
2887
|
-
right: `${
|
|
3464
|
+
style: Bt({
|
|
3465
|
+
top: `${gt.value.line.top}px`,
|
|
3466
|
+
left: `${gt.value.line.left}px`,
|
|
3467
|
+
right: `${gt.value.line.right}px`
|
|
2888
3468
|
})
|
|
2889
|
-
}, [...n[3] ||= [
|
|
2890
|
-
|
|
3469
|
+
}, [...n[3] ||= [F("span", { class: "a-nested-list-editor__drop-line-dot" }, null, -1)]], 4)], 64))], 2)),
|
|
3470
|
+
Ge.value && !e.loading && !e.error && !he.value ? H(t.$slots, "add-button", {
|
|
2891
3471
|
readonly: e.readonly,
|
|
2892
3472
|
disabled: e.disabled,
|
|
2893
|
-
props: { onClick:
|
|
2894
|
-
actions: { add:
|
|
2895
|
-
}, () => [
|
|
3473
|
+
props: { onClick: _t },
|
|
3474
|
+
actions: { add: _t }
|
|
3475
|
+
}, () => [F("button", {
|
|
2896
3476
|
type: "button",
|
|
2897
3477
|
class: "a-le-row-add",
|
|
2898
|
-
onClick:
|
|
2899
|
-
}, [
|
|
3478
|
+
onClick: _t
|
|
3479
|
+
}, [L(Y, {
|
|
2900
3480
|
icon: "mdi-plus",
|
|
2901
3481
|
size: "18"
|
|
2902
|
-
}),
|
|
3482
|
+
}), F("span", null, U(qe.value), 1)])], void 0, 5) : N("", !0)
|
|
2903
3483
|
]),
|
|
2904
|
-
|
|
2905
|
-
modelValue:
|
|
2906
|
-
"onUpdate:modelValue": n[0] ||= (e) =>
|
|
3484
|
+
L(we, {
|
|
3485
|
+
modelValue: $.value,
|
|
3486
|
+
"onUpdate:modelValue": n[0] ||= (e) => $.value = e,
|
|
2907
3487
|
total: _n.value?.total ?? 0,
|
|
2908
3488
|
"current-index": _n.value?.currentIndex ?? 0,
|
|
2909
3489
|
"item-label": vn.value,
|
|
@@ -2914,15 +3494,15 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
2914
3494
|
"current-index",
|
|
2915
3495
|
"item-label"
|
|
2916
3496
|
]),
|
|
2917
|
-
|
|
3497
|
+
L(Mi, {
|
|
2918
3498
|
modelValue: xn.value,
|
|
2919
3499
|
"onUpdate:modelValue": n[1] ||= (e) => xn.value = e,
|
|
2920
|
-
tree:
|
|
3500
|
+
tree: s.value,
|
|
2921
3501
|
"source-key": Sn.value?.key ?? null,
|
|
2922
|
-
"key-field":
|
|
3502
|
+
"key-field": W(ee),
|
|
2923
3503
|
"max-depth": e.maxDepth,
|
|
2924
3504
|
"resolve-label": sn,
|
|
2925
|
-
"calculate-subtree-depth":
|
|
3505
|
+
"calculate-subtree-depth": W(w).calculateSubtreeDepth,
|
|
2926
3506
|
onConfirm: wn
|
|
2927
3507
|
}, null, 8, [
|
|
2928
3508
|
"modelValue",
|
|
@@ -2932,17 +3512,17 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
2932
3512
|
"max-depth",
|
|
2933
3513
|
"calculate-subtree-depth"
|
|
2934
3514
|
]),
|
|
2935
|
-
|
|
2936
|
-
modelValue:
|
|
2937
|
-
"onUpdate:modelValue": n[2] ||= (e) =>
|
|
2938
|
-
title:
|
|
2939
|
-
text:
|
|
2940
|
-
"confirm-label":
|
|
2941
|
-
"cancel-label":
|
|
2942
|
-
error:
|
|
2943
|
-
"in-flight":
|
|
2944
|
-
onConfirm:
|
|
2945
|
-
onCancel:
|
|
3515
|
+
L(St, {
|
|
3516
|
+
modelValue: W(At),
|
|
3517
|
+
"onUpdate:modelValue": n[2] ||= (e) => Ft(At) ? At.value = e : null,
|
|
3518
|
+
title: Ze.value,
|
|
3519
|
+
text: Qe.value,
|
|
3520
|
+
"confirm-label": W(l)("common.sortable.delete"),
|
|
3521
|
+
"cancel-label": W(l)("common.button.cancel"),
|
|
3522
|
+
error: W(R),
|
|
3523
|
+
"in-flight": W(Mt),
|
|
3524
|
+
onConfirm: W(It),
|
|
3525
|
+
onCancel: W(Ut)
|
|
2946
3526
|
}, null, 8, [
|
|
2947
3527
|
"modelValue",
|
|
2948
3528
|
"title",
|
|
@@ -2954,145 +3534,16 @@ var Vn = { class: "d-flex flex-column w-100 px-1 align-center" }, Hn = { class:
|
|
|
2954
3534
|
"onConfirm",
|
|
2955
3535
|
"onCancel"
|
|
2956
3536
|
]),
|
|
2957
|
-
|
|
2958
|
-
n:
|
|
2959
|
-
total:
|
|
3537
|
+
F("div", Bi, U(W(Q).grabbedKey.value === null ? "" : W(l)("common.sortable.keyboardGrab.status", {
|
|
3538
|
+
n: W(Q).grabbedIndex.value + 1,
|
|
3539
|
+
total: W(Q).totalCount.value
|
|
2960
3540
|
})), 1)
|
|
2961
3541
|
], 2));
|
|
2962
3542
|
}
|
|
2963
|
-
})
|
|
2964
|
-
__name: "AUnsavedConfirmDialog",
|
|
2965
|
-
props: /*@__PURE__*/ Pt({
|
|
2966
|
-
title: { default: void 0 },
|
|
2967
|
-
body: { default: void 0 },
|
|
2968
|
-
stayLabel: { default: void 0 },
|
|
2969
|
-
discardLabel: { default: void 0 },
|
|
2970
|
-
dirtyLabels: { default: () => [] }
|
|
2971
|
-
}, {
|
|
2972
|
-
modelValue: {
|
|
2973
|
-
type: Boolean,
|
|
2974
|
-
required: !0
|
|
2975
|
-
},
|
|
2976
|
-
modelModifiers: {}
|
|
2977
|
-
}),
|
|
2978
|
-
emits: /*@__PURE__*/ Pt(["resolve"], ["update:modelValue"]),
|
|
2979
|
-
setup(e, { emit: t }) {
|
|
2980
|
-
let n = t, r = Gt(e, "modelValue"), { t: i } = Zt(), a = () => {
|
|
2981
|
-
n("resolve", !1);
|
|
2982
|
-
}, o = () => {
|
|
2983
|
-
n("resolve", !0);
|
|
2984
|
-
};
|
|
2985
|
-
return (t, n) => (H(), N(_n, {
|
|
2986
|
-
modelValue: r.value,
|
|
2987
|
-
"onUpdate:modelValue": n[0] ||= (e) => r.value = e,
|
|
2988
|
-
"max-width": "480",
|
|
2989
|
-
persistent: ""
|
|
2990
|
-
}, {
|
|
2991
|
-
default: J(() => [R(tn, null, {
|
|
2992
|
-
default: J(() => [
|
|
2993
|
-
R(an, null, {
|
|
2994
|
-
default: J(() => [L(G(e.title ?? K(i)("common.sortable.unsavedChanges.title")), 1)]),
|
|
2995
|
-
_: 1
|
|
2996
|
-
}),
|
|
2997
|
-
R(rn, null, {
|
|
2998
|
-
default: J(() => [e.body ? (H(), F(j, { key: 0 }, [L(G(e.body), 1)], 64)) : e.dirtyLabels.length ? (H(), F(j, { key: 1 }, [
|
|
2999
|
-
L(G(K(i)("common.sortable.unsavedChanges.sectionsIntro")) + " ", 1),
|
|
3000
|
-
I("ul", ri, [(H(!0), F(j, null, Vt(e.dirtyLabels, (e, t) => (H(), F("li", { key: t }, G(e), 1))), 128))]),
|
|
3001
|
-
L(" " + G(K(i)("common.sortable.unsavedChanges.leaveQuestion")), 1)
|
|
3002
|
-
], 64)) : (H(), F(j, { key: 2 }, [L(G(K(i)("common.sortable.unsavedChanges.body")), 1)], 64))]),
|
|
3003
|
-
_: 1
|
|
3004
|
-
}),
|
|
3005
|
-
R(nn, null, {
|
|
3006
|
-
default: J(() => [
|
|
3007
|
-
R(Qt),
|
|
3008
|
-
R(Z, {
|
|
3009
|
-
variant: "text",
|
|
3010
|
-
onClick: a
|
|
3011
|
-
}, {
|
|
3012
|
-
default: J(() => [L(G(e.stayLabel ?? K(i)("common.sortable.unsavedChanges.stay")), 1)]),
|
|
3013
|
-
_: 1
|
|
3014
|
-
}),
|
|
3015
|
-
R(Z, {
|
|
3016
|
-
color: "warning",
|
|
3017
|
-
variant: "flat",
|
|
3018
|
-
onClick: o
|
|
3019
|
-
}, {
|
|
3020
|
-
default: J(() => [L(G(e.discardLabel ?? K(i)("common.sortable.unsavedChanges.discard")), 1)]),
|
|
3021
|
-
_: 1
|
|
3022
|
-
})
|
|
3023
|
-
]),
|
|
3024
|
-
_: 1
|
|
3025
|
-
})
|
|
3026
|
-
]),
|
|
3027
|
-
_: 1
|
|
3028
|
-
})]),
|
|
3029
|
-
_: 1
|
|
3030
|
-
}, 8, ["modelValue"]));
|
|
3031
|
-
}
|
|
3032
|
-
}), [["__scopeId", "data-v-8342a164"]]), ai = 8e3, oi = (e) => e == null ? !1 : typeof e == "boolean" ? e : e instanceof Set ? e.size > 0 : Array.isArray(e) ? e.length > 0 : !!e, si = (e, t) => e === void 0 ? t : typeof e == "boolean" ? e : e.value;
|
|
3033
|
-
function ci(e) {
|
|
3034
|
-
let t = gt();
|
|
3035
|
-
if (e.ownSections) {
|
|
3036
|
-
let n = e.ownSections, r = Symbol("unsaved.section.own"), i = M(() => {
|
|
3037
|
-
let e = n();
|
|
3038
|
-
return Array.isArray(e) ? e : [e];
|
|
3039
|
-
});
|
|
3040
|
-
t.register(r, i);
|
|
3041
|
-
}
|
|
3042
|
-
let n = M(() => e.sources.some((e) => oi(e.value)) || t.dirtyLabels.value.length > 0), r = U(!1), i = null, a = !1, o = null, s = () => {
|
|
3043
|
-
o !== null && (clearTimeout(o), o = null);
|
|
3044
|
-
}, c = () => a ? (a = !1, s(), Promise.resolve(!0)) : new Promise((e) => {
|
|
3045
|
-
i = e, r.value = !0;
|
|
3046
|
-
}), l = (e) => {
|
|
3047
|
-
r.value = !1, i &&= (i(e), null);
|
|
3048
|
-
}, u = () => {
|
|
3049
|
-
a = !0, s(), o = setTimeout(() => {
|
|
3050
|
-
a = !1, o = null;
|
|
3051
|
-
}, ai);
|
|
3052
|
-
}, d = () => {
|
|
3053
|
-
a = !1, s();
|
|
3054
|
-
};
|
|
3055
|
-
if (si(e.guardRoute, !0) && At()) try {
|
|
3056
|
-
hn(async () => !n.value || await c());
|
|
3057
|
-
} catch {}
|
|
3058
|
-
let f = [s], p = !1;
|
|
3059
|
-
if (si(e.guardWindowUnload, !0)) {
|
|
3060
|
-
let e = (e) => {
|
|
3061
|
-
n.value && (e.preventDefault(), e.returnValue = "");
|
|
3062
|
-
};
|
|
3063
|
-
typeof window < "u" && (window.addEventListener("beforeunload", e), f.push(() => window.removeEventListener("beforeunload", e)));
|
|
3064
|
-
}
|
|
3065
|
-
if (e.guardDialogModel) {
|
|
3066
|
-
let t = e.guardDialogModel, r = !1, i = q(t, async (e, i) => {
|
|
3067
|
-
if (r) {
|
|
3068
|
-
r = !1;
|
|
3069
|
-
return;
|
|
3070
|
-
}
|
|
3071
|
-
if (i === !0 && e === !1 && n.value) {
|
|
3072
|
-
r = !0, t.value = !0;
|
|
3073
|
-
let e = await c();
|
|
3074
|
-
if (p) return;
|
|
3075
|
-
e && (r = !0, t.value = !1);
|
|
3076
|
-
}
|
|
3077
|
-
});
|
|
3078
|
-
f.push(i);
|
|
3079
|
-
}
|
|
3080
|
-
let m = () => {
|
|
3081
|
-
p || (p = !0, l(!1), f.forEach((e) => e()));
|
|
3082
|
-
};
|
|
3083
|
-
return At() && Rt(m), {
|
|
3084
|
-
hasUnsavedChanges: n,
|
|
3085
|
-
dirtyLabels: t.dirtyLabels,
|
|
3086
|
-
promptOpen: r,
|
|
3087
|
-
resolvePrompt: l,
|
|
3088
|
-
acknowledge: u,
|
|
3089
|
-
unacknowledge: d,
|
|
3090
|
-
stop: m
|
|
3091
|
-
};
|
|
3092
|
-
}
|
|
3543
|
+
});
|
|
3093
3544
|
//#endregion
|
|
3094
3545
|
//#region src/labs/unsavedGuard/useGuardedDelete.ts
|
|
3095
|
-
function
|
|
3546
|
+
function Gi(e, t) {
|
|
3096
3547
|
return (...n) => {
|
|
3097
3548
|
e.acknowledge();
|
|
3098
3549
|
let r;
|
|
@@ -3108,79 +3559,79 @@ function li(e, t) {
|
|
|
3108
3559
|
}
|
|
3109
3560
|
//#endregion
|
|
3110
3561
|
//#region src/labs/listEditor/composables/useListEditor.ts
|
|
3111
|
-
function
|
|
3112
|
-
let
|
|
3113
|
-
|
|
3114
|
-
let
|
|
3115
|
-
let t = /* @__PURE__ */ new Set(),
|
|
3116
|
-
for (let
|
|
3117
|
-
if (
|
|
3562
|
+
function Ki(e, t = {}) {
|
|
3563
|
+
let n = t.keyField ?? "id", r = t.positionField ?? "position", i = t.positionMultiplier ?? 1, a = t.updatePosition === !0;
|
|
3564
|
+
a && n === r && console.warn(`[list-editor] key-field === position-field ("${n}") 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").`);
|
|
3565
|
+
let o = /* @__PURE__ */ new Set(), s = (e) => {
|
|
3566
|
+
let t = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = 0;
|
|
3567
|
+
for (let n of e) {
|
|
3568
|
+
if (n.key === void 0 || n.key === null) {
|
|
3118
3569
|
i++;
|
|
3119
3570
|
continue;
|
|
3120
3571
|
}
|
|
3121
|
-
t.has(
|
|
3572
|
+
t.has(n.key) && r.add(String(n.key)), t.add(n.key);
|
|
3122
3573
|
}
|
|
3123
|
-
if (i === 0 &&
|
|
3124
|
-
let a = `${i}|${[...
|
|
3125
|
-
|
|
3126
|
-
},
|
|
3574
|
+
if (i === 0 && r.size === 0) return;
|
|
3575
|
+
let a = `${i}|${[...r].sort().join(",")}`;
|
|
3576
|
+
o.has(a) || (o.add(a), i > 0 && console.warn(`[list-editor] ${i} row(s) resolve to an undefined key (key-field "${n}"). Point key-field at a field every item has, or give new items unique temp ids (see nextListEditorTempId).`), r.size > 0 && console.warn(`[list-editor] duplicate row keys (key-field "${n}"): ${[...r].join(", ")}. Row keys must be unique — dirty tracking and validation rails target rows by key.`));
|
|
3577
|
+
}, c = j(() => {
|
|
3127
3578
|
let t = e.value.map((e, t) => ({
|
|
3128
|
-
key: e[
|
|
3579
|
+
key: e[n],
|
|
3129
3580
|
index: t,
|
|
3130
3581
|
raw: e,
|
|
3131
|
-
position: e[
|
|
3582
|
+
position: e[r]
|
|
3132
3583
|
}));
|
|
3133
|
-
return
|
|
3134
|
-
}),
|
|
3135
|
-
positionField:
|
|
3136
|
-
positionMultiplier:
|
|
3137
|
-
}),
|
|
3138
|
-
let n =
|
|
3584
|
+
return s(t), t;
|
|
3585
|
+
}), l = (e) => y(e, {
|
|
3586
|
+
positionField: r,
|
|
3587
|
+
positionMultiplier: i
|
|
3588
|
+
}), u = (t) => {
|
|
3589
|
+
let n = a ? l(t) : t;
|
|
3139
3590
|
return e.value = n, n;
|
|
3140
|
-
},
|
|
3141
|
-
let
|
|
3142
|
-
return
|
|
3143
|
-
},
|
|
3591
|
+
}, d = (e) => typeof e == "object" && !!e, f = (e, t) => e.findIndex((e) => e[n] === t), p = (e, t) => {
|
|
3592
|
+
let r = d(t) ? t[n] : t;
|
|
3593
|
+
return f(e, r);
|
|
3594
|
+
}, m = (e, t) => {
|
|
3144
3595
|
if (!t) return e.length;
|
|
3145
3596
|
if (t.afterId !== void 0) {
|
|
3146
|
-
let n =
|
|
3597
|
+
let n = f(e, t.afterId);
|
|
3147
3598
|
return n === -1 ? e.length : n + 1;
|
|
3148
3599
|
}
|
|
3149
3600
|
return t.afterIndex === void 0 ? t.index === void 0 ? e.length : Math.max(0, Math.min(t.index, e.length)) : t.afterIndex < 0 ? e.length : Math.min(t.afterIndex + 1, e.length);
|
|
3150
3601
|
};
|
|
3151
3602
|
return {
|
|
3152
|
-
viewItems:
|
|
3603
|
+
viewItems: c,
|
|
3153
3604
|
addItem: (t, n) => {
|
|
3154
|
-
let r = [...e.value], i =
|
|
3155
|
-
return r.splice(i, 0, t),
|
|
3605
|
+
let r = [...e.value], i = m(r, n);
|
|
3606
|
+
return r.splice(i, 0, t), u(r);
|
|
3156
3607
|
},
|
|
3157
3608
|
deleteItem: (t) => {
|
|
3158
|
-
let n =
|
|
3609
|
+
let n = p(e.value, t);
|
|
3159
3610
|
if (n === -1) return e.value;
|
|
3160
3611
|
let r = [...e.value];
|
|
3161
|
-
return r.splice(n, 1),
|
|
3612
|
+
return r.splice(n, 1), u(r);
|
|
3162
3613
|
},
|
|
3163
3614
|
updateItem: (t, n) => {
|
|
3164
|
-
let r =
|
|
3615
|
+
let r = p(e.value, t);
|
|
3165
3616
|
if (r === -1) return e.value;
|
|
3166
3617
|
let i = [...e.value];
|
|
3167
|
-
return i[r] = n,
|
|
3618
|
+
return i[r] = n, u(i);
|
|
3168
3619
|
},
|
|
3169
3620
|
moveItem: (t, n) => {
|
|
3170
3621
|
let r = e.value.length;
|
|
3171
3622
|
if (t === n || t < 0 || t >= r || n < 0 || n >= r) return e.value;
|
|
3172
3623
|
let i = [...e.value], [a] = i.splice(t, 1);
|
|
3173
|
-
return i.splice(n, 0, a),
|
|
3624
|
+
return i.splice(n, 0, a), u(i);
|
|
3174
3625
|
},
|
|
3175
|
-
recalculatePositions:
|
|
3626
|
+
recalculatePositions: l
|
|
3176
3627
|
};
|
|
3177
3628
|
}
|
|
3178
3629
|
//#endregion
|
|
3179
3630
|
//#region src/labs/listEditor/composables/useNestedUnsavedKeys.ts
|
|
3180
|
-
function
|
|
3181
|
-
let e =
|
|
3631
|
+
function qi() {
|
|
3632
|
+
let e = V(/* @__PURE__ */ new Map()), t = /* @__PURE__ */ new Set(), n = (n) => e.value.get(n) ?? t, r = (t, n) => {
|
|
3182
3633
|
n.size === 0 ? e.value.delete(t) : e.value.set(t, n), e.value = new Map(e.value);
|
|
3183
|
-
}, i =
|
|
3634
|
+
}, i = j(() => {
|
|
3184
3635
|
let t = /* @__PURE__ */ new Set();
|
|
3185
3636
|
for (let [n, r] of e.value.entries()) for (let e of r) t.add(`${String(n)}:${String(e)}`);
|
|
3186
3637
|
return t;
|
|
@@ -3189,10 +3640,10 @@ function di() {
|
|
|
3189
3640
|
getForParent: n,
|
|
3190
3641
|
setForParent: r,
|
|
3191
3642
|
merged: i,
|
|
3192
|
-
count:
|
|
3643
|
+
count: j(() => i.value.size)
|
|
3193
3644
|
};
|
|
3194
3645
|
}
|
|
3195
3646
|
//#endregion
|
|
3196
|
-
export {
|
|
3647
|
+
export { kn as ADatatableOrdering, In as ADatatablePagination, mt as AFilterBooleanSelect, be as AFilterDatetimePicker, b as AFilterInteger, vt as AFilterRemoteAutocomplete, e as AFilterRemoteAutocompleteWithMinimal, nt as AFilterString, Se as AFilterTimeInterval, oe as AFilterValueObjectOptionsSelect, tt as AFilterWrapper, En as AFilterWrapperSidebar, Ee as AFilterWrapperSubjectSelect, _t as AFormRemoteAutocomplete, Ge as AFormRemoteAutocompleteWithCached, oi as AListEditor, Dr as ALogDetailView, dr as ALogListView, Wi as ANestedSortableListEditor, Xe as ASortableListEditor, Br as ASubjectSelect, ht as AUnsavedConfirmDialog, $n as DEFAULT_LOG_PATHS, Ct as DatatablePaginationKey, At as FilterConfigKey, je as FilterDataKey, Ot as FilterInnerConfigKey, de as FilterInnerDataKey, ft as FiltersSelected, Gn as LOG_ENTITY, c as ListEditorStateScopeKey, Xn as LogType, Zn as LogTypeDefault, kt as SharedReorderRegistryKey, xt as TimeIntervalSpecialOptions, E as UserAdminConfigLayoutType, h as UserAdminConfigLayoutTypeDefault, x as UserAdminConfigType, ut as UserAdminConfigTypeDefault, ur as applyLogTypeVisibility, D as buildFilterHash, Wn as createDatatableColumnsConfig, ze as createFilter, lt as createFilterStore, re as createListEditorStateScope, te as defaultApiErrorLogger, fr as formatJson, at as generateListQuery, Qn as isLogType, et as isRouterSafeHash, p as nextListEditorTempId, Ye as provideListEditorStateScope, y as renumberPositions, xe as setApiErrorLogger, ne as sortByPosition, ce as sortByPositionDeep, i as useApiCommand, qe as useApiFetchByIds, Ln as useApiFetchItems, gt as useApiFetchList, zn as useApiFetchListBatch, Qe as useApiQueryBuilder, T as useApiRequest, qn as useFetchLog, Kn as useFetchLogList, Ve as useFilterHelpers, Gi as useGuardedDelete, Vn as useJobApi, Ki as useListEditor, ae as useListEditorController, t as useListEditorStateEntry, Yn as useLogDetailActions, lr as useLogFilter, Jn as useLogListActions, er as useLogType, C as useNestedListEditor, S as useNestedListEditorController, Je as useNestedListEditorStateEntry, qi as useNestedUnsavedKeys, Oe as usePagination, Or as useSubjectSelect, rt as useUnsavedChangesGuard, fe as useUnsavedSection, he as useUserAdminConfigApi, Me as useUserAdminConfigFactory };
|
|
3197
3648
|
|
|
3198
3649
|
//# sourceMappingURL=labs.js.map
|