@fewangsit/wangsvue-fats 1.0.1-alpha.68 → 1.0.1-alpha.69
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/animation/index.es.js +9 -8
- package/assetinfo/index.d.ts +5 -4
- package/assetinfo/index.es.js +113 -97
- package/backgroundimagecropper/index.es.js +14 -12
- package/button/index.es.js +58 -48
- package/buttonbulkaction/index.es.js +67 -59
- package/buttondownload/index.es.js +18 -18
- package/buttonradio/index.es.js +11 -11
- package/buttonscan/index.es.js +1 -1
- package/buttonsearch/index.es.js +14 -14
- package/buttonselectuser/index.es.js +29 -29
- package/checkbox/index.es.js +5 -5
- package/config/defaultProps.es.js +3 -4
- package/datatable/index.es.js +470 -465
- package/datepicker/index.es.js +17 -17
- package/daypicker/index.es.js +21 -21
- package/dialog/index.es.js +17 -15
- package/dialogbasictransferlog/index.es.js +89 -89
- package/dialogconfirm/index.es.js +33 -33
- package/dialogdamagelog/index.es.js +89 -89
- package/dialogform/index.es.js +16 -16
- package/dialogfulltransferlog/index.es.js +96 -96
- package/dialoglinkedasset/index.es.js +48 -48
- package/dialogprintqr/index.es.js +70 -70
- package/dialogreportdamage/index.es.js +57 -57
- package/dialogreportmissing/index.es.js +94 -86
- package/dialogselecttree/index.es.js +18 -16
- package/dialogselectuser/index.es.js +16 -16
- package/directives/index.d.ts +1 -0
- package/directives/index.es.js +1 -0
- package/directives/safeHtml.d.ts +16 -0
- package/directives/safeHtml.es.js +12 -0
- package/disposalreport/index.es.js +1 -1
- package/disposalreportbulkaction/index.es.js +40 -41
- package/disposalreportdialogselectasset/index.es.js +72 -72
- package/disposalreporttable/index.es.js +108 -108
- package/disposalreporttablefilter/index.es.js +16 -17
- package/dropdown/index.es.js +120 -117
- package/fieldwrapper/index.es.js +7 -7
- package/fileupload/index.es.js +35 -31
- package/hardwaresync/index.es.js +12 -12
- package/headercell/index.es.js +4 -4
- package/icon/index.es.js +26 -25
- package/imagecompressor/index.es.js +143 -143
- package/imageinputinfo/index.es.js +13 -13
- package/inlinemessage/index.es.js +12 -12
- package/inputbadge/index.es.js +42 -43
- package/inputnumber/index.es.js +7 -7
- package/inputpassword/index.es.js +9 -9
- package/inputrangenumber/index.es.js +16 -16
- package/inputsearch/index.es.js +18 -18
- package/inputtext/index.es.js +33 -33
- package/litedropdown/index.es.js +48 -40
- package/menuitem/index.es.js +27 -26
- package/multirow/index.es.js +16 -16
- package/multiselect/index.es.js +86 -83
- package/package.json +1 -1
- package/plugins/basei18n.d.ts +2 -2
- package/plugins/basei18n.es.js +48 -42
- package/stats.html +1 -1
- package/style.css +1 -1
- package/tabmenu/index.es.js +14 -9
- package/tagtype/index.es.js +33 -30
- package/textarea/index.es.js +3 -3
- package/toggledarkmode/store/index.d.ts +7 -0
- package/toggleswitch/index.es.js +3 -3
- package/treesearchinput/index.es.js +11 -11
- package/username/index.es.js +39 -39
- package/utils/baseToast.util.es.js +23 -22
- package/utils/index.es.js +1 -2
- package/utils/textFormatter.util.d.ts +32 -0
- package/utils/textFormatter.util.es.js +38 -10
- package/validatormessage/index.es.js +1 -1
- package/vendor/dompurify/dist/purify.es.es.js +553 -0
- package/wangsvue-fats.d.ts +2 -1
- package/wangsvue-fats.es.js +190 -186
- package/wangsvue-fats.esm.browser.js +17750 -17086
- package/wangsvue-fats.system.js +73 -72
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as G, mergeModels as M, useModel as O, onMounted as S, inject as K, ref as
|
|
1
|
+
import { defineComponent as G, mergeModels as M, useModel as O, onMounted as S, inject as K, ref as v, computed as _, watch as C, createBlock as x, openBlock as o, withCtx as y, createElementBlock as p, createCommentVNode as q, createElementVNode as a, createVNode as i, toDisplayString as c } from "vue";
|
|
2
2
|
import { TransferServices as E } from "@tagsamurai/fats-api-services";
|
|
3
3
|
import { u as H } from "../utils/baseToast.util.es.js";
|
|
4
|
-
import { _ as
|
|
4
|
+
import { _ as m } from "../badge/index.es.js";
|
|
5
5
|
import { _ as L } from "../button/index.es.js";
|
|
6
6
|
import { _ as V } from "../buttoncopy/index.es.js";
|
|
7
7
|
import { _ as R } from "../dialog/index.es.js";
|
|
@@ -10,22 +10,22 @@ import { _ as W } from "../tabmenu/index.es.js";
|
|
|
10
10
|
import { _ as Z } from "../timeline/index.es.js";
|
|
11
11
|
import { _ as z } from "../assetinfo/index.es.js";
|
|
12
12
|
import { _ as J } from "../userwithicon/index.es.js";
|
|
13
|
-
const Q = { class: "w-full flex items-center justify-between pr-4" }, X = { class: "flex gap-3 items-center" }, Y = { class: "flex gap-1 items-center" },
|
|
13
|
+
const Q = { class: "w-full flex items-center justify-between pr-4" }, X = { class: "flex gap-3 items-center" }, Y = { class: "text-sm font-bold" }, P = { class: "flex gap-1 items-center" }, ee = { class: "text-xs font-medium" }, te = { class: "flex items-center gap-2" }, ae = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "flex flex-col gap-3"
|
|
16
|
-
},
|
|
16
|
+
}, se = { class: "flex justify-between items-center" }, ne = { class: "flex items-center gap-1" }, le = { class: "flex items-center gap-0.5" }, ie = { class: "flex items-center gap-0.5" }, re = { class: "flex items-center gap-2" }, oe = {
|
|
17
17
|
key: 0,
|
|
18
18
|
class: "flex flex-row items-center gap-1"
|
|
19
|
-
},
|
|
19
|
+
}, ce = { class: "text-xs font-medium text-general-400 dark:text-general-200" }, ue = {
|
|
20
20
|
key: 1,
|
|
21
21
|
class: "flex flex-col gap-1"
|
|
22
|
-
},
|
|
22
|
+
}, de = { class: "flex flex-row items-center gap-1" }, fe = { class: "text-xs font-medium text-general-400 dark:text-general-200" }, me = {
|
|
23
23
|
key: 2,
|
|
24
24
|
class: "flex flex-row items-center gap-1"
|
|
25
|
-
},
|
|
25
|
+
}, ve = { class: "text-xs font-medium text-general-400 dark:text-general-200" }, pe = {
|
|
26
26
|
key: 1,
|
|
27
27
|
class: "text-xs font-medium"
|
|
28
|
-
},
|
|
28
|
+
}, Ce = /* @__PURE__ */ G({
|
|
29
29
|
__name: "DialogFullTransferLog",
|
|
30
30
|
props: /* @__PURE__ */ M({
|
|
31
31
|
id: {}
|
|
@@ -34,36 +34,36 @@ const Q = { class: "w-full flex items-center justify-between pr-4" }, X = { clas
|
|
|
34
34
|
visibleModifiers: {}
|
|
35
35
|
}),
|
|
36
36
|
emits: ["update:visible"],
|
|
37
|
-
setup(
|
|
38
|
-
const A =
|
|
37
|
+
setup(h) {
|
|
38
|
+
const A = h, g = O(h, "visible"), I = H();
|
|
39
39
|
S(() => {
|
|
40
40
|
window.Cypress && (r.value = ["66406b090d664c625212ac1a", "66406b090d664c625212ac22"]);
|
|
41
41
|
});
|
|
42
|
-
const s =
|
|
43
|
-
var
|
|
44
|
-
return (
|
|
45
|
-
}),
|
|
46
|
-
var
|
|
47
|
-
return (
|
|
48
|
-
}), j =
|
|
49
|
-
var
|
|
50
|
-
return (
|
|
51
|
-
}), D =
|
|
42
|
+
const s = v(), k = v(), u = v(), $ = v(0), r = K("requestIds") ?? v([]), b = _(() => {
|
|
43
|
+
var e;
|
|
44
|
+
return (e = r.value) != null && e.length ? r.value.findIndex((t) => u.value === t) : -1;
|
|
45
|
+
}), w = _(() => {
|
|
46
|
+
var e, t;
|
|
47
|
+
return (e = r.value) != null && e.length ? u.value === ((t = r.value) == null ? void 0 : t[0]) : !1;
|
|
48
|
+
}), j = _(() => {
|
|
49
|
+
var e, t, n;
|
|
50
|
+
return (e = r.value) != null && e.length ? u.value === ((n = r.value) == null ? void 0 : n[((t = r.value) == null ? void 0 : t.length) - 1]) : !1;
|
|
51
|
+
}), D = _(
|
|
52
52
|
() => {
|
|
53
|
-
var
|
|
54
|
-
return (
|
|
55
|
-
_id:
|
|
56
|
-
action:
|
|
57
|
-
createdAt:
|
|
58
|
-
title:
|
|
59
|
-
date:
|
|
60
|
-
username:
|
|
61
|
-
body:
|
|
62
|
-
detail:
|
|
53
|
+
var e;
|
|
54
|
+
return (e = k.value) == null ? void 0 : e.map((t) => ({
|
|
55
|
+
_id: t._id,
|
|
56
|
+
action: t.action,
|
|
57
|
+
createdAt: t.updatedAt,
|
|
58
|
+
title: t.action + " by",
|
|
59
|
+
date: t.updatedAt,
|
|
60
|
+
username: t.userFullName,
|
|
61
|
+
body: t.action === "Handed over" ? void 0 : N(t.detail),
|
|
62
|
+
detail: t.action === "Handed over" ? void 0 : N(t.detail)
|
|
63
63
|
}));
|
|
64
64
|
}
|
|
65
|
-
), B = (
|
|
66
|
-
switch (
|
|
65
|
+
), B = (e) => {
|
|
66
|
+
switch (e) {
|
|
67
67
|
case "Rejected":
|
|
68
68
|
case "Reported Missing":
|
|
69
69
|
return "danger";
|
|
@@ -76,72 +76,72 @@ const Q = { class: "w-full flex items-center justify-between pr-4" }, X = { clas
|
|
|
76
76
|
default:
|
|
77
77
|
return "primary";
|
|
78
78
|
}
|
|
79
|
-
}, N = (
|
|
80
|
-
if (!
|
|
79
|
+
}, N = (e) => {
|
|
80
|
+
if (!e || !Object.keys(e).length)
|
|
81
81
|
return;
|
|
82
|
-
const
|
|
83
|
-
for (const d of
|
|
84
|
-
const
|
|
85
|
-
|
|
82
|
+
const t = {}, n = Object.keys(e);
|
|
83
|
+
for (const d of n) {
|
|
84
|
+
const f = d.replace(/([A-Z])/g, " $1"), l = f.charAt(0).toUpperCase() + f.slice(1);
|
|
85
|
+
t[l === "Notes" ? "Note" : l] = e[d] ?? "-";
|
|
86
86
|
}
|
|
87
|
-
return
|
|
87
|
+
return t;
|
|
88
88
|
}, F = async () => {
|
|
89
|
-
var
|
|
90
|
-
if ((
|
|
89
|
+
var e;
|
|
90
|
+
if ((e = u.value) != null && e.length)
|
|
91
91
|
try {
|
|
92
|
-
const { data:
|
|
92
|
+
const { data: t } = await E.getTransactionLog(
|
|
93
93
|
u.value
|
|
94
94
|
);
|
|
95
|
-
|
|
96
|
-
} catch (
|
|
95
|
+
t && (s.value = t.data.request, k.value = t.data.logs, $.value++);
|
|
96
|
+
} catch (t) {
|
|
97
97
|
I.add({
|
|
98
|
-
error:
|
|
98
|
+
error: t,
|
|
99
99
|
message: "Error, failed to load transfer transaction log"
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
|
-
}, T = (
|
|
103
|
-
if (
|
|
102
|
+
}, T = (e) => {
|
|
103
|
+
if (b.value === -1 || e === "prev" && w.value || e === "next" && j.value)
|
|
104
104
|
return;
|
|
105
|
-
const
|
|
106
|
-
u.value = r.value[
|
|
105
|
+
const t = e === "prev" ? b.value - 1 : b.value + 1;
|
|
106
|
+
u.value = r.value[t];
|
|
107
107
|
};
|
|
108
|
-
return C(g, (
|
|
109
|
-
|
|
110
|
-
}), C(u, (
|
|
111
|
-
|
|
112
|
-
}), (
|
|
108
|
+
return C(g, (e) => {
|
|
109
|
+
e && (u.value = A.id);
|
|
110
|
+
}), C(u, (e) => {
|
|
111
|
+
e && F();
|
|
112
|
+
}), (e, t) => (o(), x(R, {
|
|
113
113
|
visible: g.value,
|
|
114
|
-
"onUpdate:visible":
|
|
114
|
+
"onUpdate:visible": t[2] || (t[2] = (n) => g.value = n),
|
|
115
115
|
draggable: !1,
|
|
116
116
|
class: "!w-[600px]",
|
|
117
117
|
"footer-class": "flex items-end justify-end gap-1",
|
|
118
118
|
header: "Transfer Log",
|
|
119
119
|
modal: ""
|
|
120
120
|
}, {
|
|
121
|
-
header:
|
|
122
|
-
var
|
|
121
|
+
header: y(() => {
|
|
122
|
+
var n, d;
|
|
123
123
|
return [
|
|
124
124
|
a("div", Q, [
|
|
125
125
|
a("div", X, [
|
|
126
|
-
|
|
127
|
-
a("div",
|
|
128
|
-
a("span",
|
|
126
|
+
a("span", Y, c(e.$t("Transfer Log")), 1),
|
|
127
|
+
a("div", P, [
|
|
128
|
+
a("span", ee, c(((n = s.value) == null ? void 0 : n.transactionId) ?? "-"), 1),
|
|
129
129
|
i(V, {
|
|
130
130
|
text: ((d = s.value) == null ? void 0 : d.transactionId) ?? ""
|
|
131
131
|
}, null, 8, ["text"])
|
|
132
132
|
])
|
|
133
133
|
]),
|
|
134
|
-
a("div",
|
|
134
|
+
a("div", te, [
|
|
135
135
|
i(L, {
|
|
136
|
-
disabled:
|
|
137
|
-
onClick:
|
|
136
|
+
disabled: w.value,
|
|
137
|
+
onClick: t[0] || (t[0] = (f) => T("prev")),
|
|
138
138
|
class: "!p-0 !m-0 !h-auto !focus:ring-[0px] !dark:focus:ring-[0px] !ring-0",
|
|
139
139
|
label: "<Prev",
|
|
140
140
|
text: ""
|
|
141
141
|
}, null, 8, ["disabled"]),
|
|
142
142
|
i(L, {
|
|
143
143
|
disabled: j.value,
|
|
144
|
-
onClick:
|
|
144
|
+
onClick: t[1] || (t[1] = (f) => T("next")),
|
|
145
145
|
class: "!p-0 !m-0 !h-auto !focus:ring-[0px] !dark:focus:ring-[0px] !ring-0",
|
|
146
146
|
label: "Next>",
|
|
147
147
|
text: ""
|
|
@@ -150,21 +150,21 @@ const Q = { class: "w-full flex items-center justify-between pr-4" }, X = { clas
|
|
|
150
150
|
])
|
|
151
151
|
];
|
|
152
152
|
}),
|
|
153
|
-
default:
|
|
154
|
-
var
|
|
153
|
+
default: y(() => {
|
|
154
|
+
var n, d, f;
|
|
155
155
|
return [
|
|
156
|
-
s.value ? (o(),
|
|
156
|
+
s.value ? (o(), p("div", ae, [
|
|
157
157
|
(o(), x(z, {
|
|
158
158
|
id: s.value.asset,
|
|
159
159
|
key: s.value.asset,
|
|
160
160
|
fields: ["brand", "model"]
|
|
161
161
|
}, null, 8, ["id"])),
|
|
162
|
-
a("div",
|
|
163
|
-
a("div",
|
|
162
|
+
a("div", se, [
|
|
163
|
+
a("div", ne, [
|
|
164
164
|
a("div", le, [
|
|
165
|
-
|
|
166
|
-
i(
|
|
167
|
-
label: (
|
|
165
|
+
a("span", null, c(e.$t("Origin")) + ":", 1),
|
|
166
|
+
i(m, {
|
|
167
|
+
label: (n = s.value.originGroup) == null ? void 0 : n.name
|
|
168
168
|
}, null, 8, ["label"])
|
|
169
169
|
]),
|
|
170
170
|
i(J, {
|
|
@@ -174,16 +174,16 @@ const Q = { class: "w-full flex items-center justify-between pr-4" }, X = { clas
|
|
|
174
174
|
}
|
|
175
175
|
}, null, 8, ["user"])
|
|
176
176
|
]),
|
|
177
|
-
a("div",
|
|
178
|
-
|
|
179
|
-
i(
|
|
180
|
-
label: (
|
|
177
|
+
a("div", ie, [
|
|
178
|
+
a("span", null, c(e.$t("Destination")) + ":", 1),
|
|
179
|
+
i(m, {
|
|
180
|
+
label: (f = s.value.destinationGroup) == null ? void 0 : f.name
|
|
181
181
|
}, null, 8, ["label"])
|
|
182
182
|
])
|
|
183
183
|
]),
|
|
184
|
-
a("div",
|
|
185
|
-
|
|
186
|
-
i(
|
|
184
|
+
a("div", re, [
|
|
185
|
+
a("span", null, c(e.$t("Status")) + ":", 1),
|
|
186
|
+
i(m, {
|
|
187
187
|
label: s.value.status,
|
|
188
188
|
severity: B(s.value.status),
|
|
189
189
|
format: "nowrap"
|
|
@@ -195,32 +195,32 @@ const Q = { class: "w-full flex items-center justify-between pr-4" }, X = { clas
|
|
|
195
195
|
type: "tab"
|
|
196
196
|
}),
|
|
197
197
|
(o(), x(Z, {
|
|
198
|
-
key:
|
|
198
|
+
key: $.value,
|
|
199
199
|
value: D.value
|
|
200
200
|
}, {
|
|
201
|
-
detail:
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
i(
|
|
205
|
-
label:
|
|
201
|
+
detail: y((l) => [
|
|
202
|
+
l.key === "To" ? (o(), p("div", oe, [
|
|
203
|
+
a("span", ce, c(e.$t("Destination Group")) + ": ", 1),
|
|
204
|
+
i(m, {
|
|
205
|
+
label: l.value
|
|
206
206
|
}, null, 8, ["label"])
|
|
207
|
-
])) :
|
|
208
|
-
a("div",
|
|
209
|
-
|
|
210
|
-
i(
|
|
211
|
-
label:
|
|
207
|
+
])) : l.key === "From" ? (o(), p("div", ue, [
|
|
208
|
+
a("div", de, [
|
|
209
|
+
a("span", fe, c(e.$t("Destination Group")) + ": ", 1),
|
|
210
|
+
i(m, {
|
|
211
|
+
label: l.value
|
|
212
212
|
}, null, 8, ["label"])
|
|
213
213
|
]),
|
|
214
214
|
i(U, {
|
|
215
215
|
class: "!text-general-800 dark:!text-general-400 !text-xs -rotate-90",
|
|
216
216
|
icon: "arrow-left"
|
|
217
217
|
})
|
|
218
|
-
])) : (o(),
|
|
219
|
-
a("span",
|
|
220
|
-
|
|
218
|
+
])) : (o(), p("div", me, [
|
|
219
|
+
a("span", ve, c(e.$t(l.key)) + ": ", 1),
|
|
220
|
+
l.key.includes("Group") ? (o(), x(m, {
|
|
221
221
|
key: 0,
|
|
222
|
-
label:
|
|
223
|
-
}, null, 8, ["label"])) : (o(),
|
|
222
|
+
label: l.value
|
|
223
|
+
}, null, 8, ["label"])) : (o(), p("span", pe, c(l.value), 1))
|
|
224
224
|
]))
|
|
225
225
|
]),
|
|
226
226
|
_: 1
|
|
@@ -233,5 +233,5 @@ const Q = { class: "w-full flex items-center justify-between pr-4" }, X = { clas
|
|
|
233
233
|
}
|
|
234
234
|
});
|
|
235
235
|
export {
|
|
236
|
-
|
|
236
|
+
Ce as _
|
|
237
237
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as W, computed as _, ref as b, watch as T, createBlock as L, openBlock as o, mergeProps as j, createSlots as G, withCtx as
|
|
1
|
+
import { defineComponent as W, computed as _, ref as b, watch as T, createBlock as L, openBlock as o, mergeProps as j, createSlots as G, withCtx as $, createElementVNode as d, createVNode as C, createElementBlock as i, createCommentVNode as S, Fragment as p, renderList as x, toDisplayString as m } from "vue";
|
|
2
2
|
import { AssetServices as J } from "@tagsamurai/fats-api-services";
|
|
3
3
|
import "../utils/role.util.es.js";
|
|
4
4
|
import { u as O } from "../utils/toast.util.es.js";
|
|
@@ -6,17 +6,17 @@ import { _ as P } from "../button/index.es.js";
|
|
|
6
6
|
import { _ as R } from "../dialogconfirm/index.es.js";
|
|
7
7
|
import { _ as U } from "../icon/index.es.js";
|
|
8
8
|
import { _ as z } from "../toast/index.es.js";
|
|
9
|
-
const D = { class: "flex flex-col gap-3 justify-between" }, H = { class: "flex flex-col max-h-20 overflow-y-auto" }, K = {
|
|
9
|
+
const D = { class: "flex flex-col gap-3 justify-between" }, H = { class: "flex flex-col max-h-20 overflow-y-auto" }, K = { class: "text-general-800 dark:text-general-100 font-medium" }, M = {
|
|
10
10
|
class: "text-general-800 dark:text-general-100 font-medium",
|
|
11
11
|
"data-ts-section": "assetparent"
|
|
12
|
-
},
|
|
12
|
+
}, Q = {
|
|
13
13
|
class: "flex flex-col max-h-20",
|
|
14
14
|
"data-ts-section": "linked-asset-family"
|
|
15
|
-
},
|
|
15
|
+
}, X = {
|
|
16
16
|
key: 3,
|
|
17
17
|
class: "text-general-800 dark:text-general-100 font-medium",
|
|
18
18
|
"data-ts-section": "confirmbody"
|
|
19
|
-
},
|
|
19
|
+
}, ie = /* @__PURE__ */ W({
|
|
20
20
|
__name: "DialogLinkedAsset",
|
|
21
21
|
props: {
|
|
22
22
|
header: {},
|
|
@@ -43,50 +43,50 @@ const D = { class: "flex flex-col gap-3 justify-between" }, H = { class: "flex f
|
|
|
43
43
|
emits: ["confirm", "update:visible"],
|
|
44
44
|
setup(E) {
|
|
45
45
|
var B;
|
|
46
|
-
const w = O(),
|
|
46
|
+
const w = O(), e = E, I = _(() => e.confirmLabel ? e.confirmLabel : e.severity === "danger" ? "Remove" : "Submit"), N = _(() => e.confirmBody ? e.confirmBody : e.severity === "success" ? "All related data will be transacted. Are you sure want to submit?" : "All related data will be removed from the list. Are you want to remove it?"), F = _(() => !!e.headerIcon || e.severity === "danger"), y = b(!1), v = b([]), g = b(!!((B = e.list) != null && B.length));
|
|
47
47
|
T(
|
|
48
|
-
() =>
|
|
48
|
+
() => e.list,
|
|
49
49
|
() => {
|
|
50
50
|
g.value = !0;
|
|
51
51
|
}
|
|
52
52
|
);
|
|
53
53
|
const q = async () => {
|
|
54
|
-
var
|
|
54
|
+
var t;
|
|
55
55
|
try {
|
|
56
56
|
if (!g.value) return;
|
|
57
57
|
y.value = !0;
|
|
58
|
-
const
|
|
59
|
-
const h = (k) => k.map((A) => ({ _id: A._id, name: A.name })), { _id:
|
|
58
|
+
const s = [], n = (r) => r.family.length > 1, c = ({ parent: r, children: a, family: f }, l) => {
|
|
59
|
+
const h = (k) => k.map((A) => ({ _id: A._id, name: A.name })), { _id: u, name: V } = r ?? l;
|
|
60
60
|
return {
|
|
61
|
-
parent: { _id:
|
|
61
|
+
parent: { _id: u, name: V },
|
|
62
62
|
// If parent null | undefined, it means the current asset is parent
|
|
63
|
-
children: a.length ? h(a) : h(
|
|
63
|
+
children: a.length ? h(a) : h(f.filter((k) => k._id !== u))
|
|
64
64
|
// Parent will always exist if children is empty
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
|
-
if ((
|
|
67
|
+
if ((t = e.list) != null && t.length) {
|
|
68
68
|
const { data: r } = await J.getLinkedAssetFamily(
|
|
69
|
-
JSON.stringify(
|
|
69
|
+
JSON.stringify(e.list.map((a) => a._id))
|
|
70
70
|
);
|
|
71
71
|
r.data && r.data.forEach((a) => {
|
|
72
|
-
const
|
|
72
|
+
const f = a.family.find(
|
|
73
73
|
(l) => l._id === a._id
|
|
74
74
|
);
|
|
75
|
-
if (
|
|
76
|
-
const l =
|
|
75
|
+
if (n(a) && f) {
|
|
76
|
+
const l = c(
|
|
77
77
|
a,
|
|
78
|
-
|
|
78
|
+
f
|
|
79
79
|
);
|
|
80
|
-
|
|
81
|
-
(
|
|
82
|
-
) ||
|
|
80
|
+
s.some(
|
|
81
|
+
(u) => u.parent._id === l.parent._id
|
|
82
|
+
) || s.push(l);
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
v.value =
|
|
87
|
-
} catch (
|
|
86
|
+
v.value = s;
|
|
87
|
+
} catch (s) {
|
|
88
88
|
w.removeGroup("linkedasset"), w.add({
|
|
89
|
-
error:
|
|
89
|
+
error: s,
|
|
90
90
|
message: "Error, failed to fetch linked assets.",
|
|
91
91
|
group: "linkedasset"
|
|
92
92
|
});
|
|
@@ -94,55 +94,55 @@ const D = { class: "flex flex-col gap-3 justify-between" }, H = { class: "flex f
|
|
|
94
94
|
y.value = !1, g.value = !1;
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
|
-
return (
|
|
97
|
+
return (t, s) => (o(), L(R, j(t.$props, {
|
|
98
98
|
"confirm-label": I.value,
|
|
99
99
|
list: void 0,
|
|
100
100
|
"show-icon": F.value,
|
|
101
|
-
onConfirm:
|
|
101
|
+
onConfirm: s[1] || (s[1] = (n) => t.$emit("confirm", v.value)),
|
|
102
102
|
onShow: q,
|
|
103
|
-
"onUpdate:visible":
|
|
103
|
+
"onUpdate:visible": s[2] || (s[2] = (n) => t.$emit("update:visible", n)),
|
|
104
104
|
"data-ts-name": "dialoglinkedasset"
|
|
105
105
|
}), G({
|
|
106
|
-
body:
|
|
106
|
+
body: $(() => [
|
|
107
107
|
d("div", D, [
|
|
108
|
-
|
|
108
|
+
t.type === "confirmation" ? (o(), i(p, { key: 0 }, [
|
|
109
109
|
d("ul", H, [
|
|
110
|
-
(o(!0), i(
|
|
111
|
-
key:
|
|
110
|
+
(o(!0), i(p, null, x(t.list, (n) => (o(), i("li", {
|
|
111
|
+
key: n._id,
|
|
112
112
|
class: "text-general-800 dark:text-general-100 font-medium",
|
|
113
113
|
"data-ts-section": "assetlistitem"
|
|
114
|
-
},
|
|
114
|
+
}, m(n.name.nameWithSequence), 1))), 128))
|
|
115
115
|
]),
|
|
116
|
-
|
|
117
|
-
], 64)) :
|
|
116
|
+
d("p", K, m(t.$t("The following assets have other assets linked to them:")), 1)
|
|
117
|
+
], 64)) : S("", !0),
|
|
118
118
|
y.value ? (o(), L(U, {
|
|
119
119
|
key: 1,
|
|
120
120
|
class: "animate-spin h-6 w-6 self-center cursor-default !text-general-200 dark:!text-general-500 py-4",
|
|
121
121
|
icon: "loader-4"
|
|
122
|
-
})) : (o(!0), i(
|
|
123
|
-
key:
|
|
122
|
+
})) : (o(!0), i(p, { key: 2 }, x(v.value, (n) => (o(), i("div", {
|
|
123
|
+
key: n.parent._id,
|
|
124
124
|
class: "flex flex-col gap-0.5"
|
|
125
125
|
}, [
|
|
126
|
-
d("span",
|
|
127
|
-
d("ul",
|
|
128
|
-
(o(!0), i(
|
|
129
|
-
key:
|
|
126
|
+
d("span", M, m(n.parent.name.nameWithSequence) + ": ", 1),
|
|
127
|
+
d("ul", Q, [
|
|
128
|
+
(o(!0), i(p, null, x(n.children, (c) => (o(), i("li", {
|
|
129
|
+
key: c._id,
|
|
130
130
|
class: "text-general-800 dark:text-general-100 font-medium",
|
|
131
131
|
"data-ts-section": "assetchild"
|
|
132
|
-
},
|
|
132
|
+
}, m(c.name.nameWithSequence), 1))), 128))
|
|
133
133
|
])
|
|
134
134
|
]))), 128)),
|
|
135
|
-
|
|
135
|
+
t.type === "confirmation" ? (o(), i("p", X, m(t.$t(N.value)), 1)) : S("", !0)
|
|
136
136
|
]),
|
|
137
|
-
|
|
137
|
+
C(z, { group: "linkedasset" })
|
|
138
138
|
]),
|
|
139
139
|
_: 2
|
|
140
140
|
}, [
|
|
141
|
-
|
|
141
|
+
e.type === "detail" ? {
|
|
142
142
|
name: "footer",
|
|
143
|
-
fn:
|
|
144
|
-
|
|
145
|
-
onClick:
|
|
143
|
+
fn: $(() => [
|
|
144
|
+
C(P, {
|
|
145
|
+
onClick: s[0] || (s[0] = (n) => t.$emit("update:visible", !1)),
|
|
146
146
|
"data-ts-section": "closebutton",
|
|
147
147
|
label: "Close",
|
|
148
148
|
outlined: ""
|
|
@@ -154,5 +154,5 @@ const D = { class: "flex flex-col gap-3 justify-between" }, H = { class: "flex f
|
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
156
|
export {
|
|
157
|
-
|
|
157
|
+
ie as _
|
|
158
158
|
};
|