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