@fewangsit/wangsvue-fats 1.0.1-alpha.42 → 1.0.1-alpha.43

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.
@@ -50,8 +50,8 @@ const I = (i, s) => {
50
50
  _: 3
51
51
  }, 8, ["mouse-move", "touch-move", "touch-resize", "wheel-resize"]));
52
52
  }
53
- }), b = /* @__PURE__ */ I(R, [["__scopeId", "data-v-5cd98b2d"]]);
53
+ }), S = /* @__PURE__ */ I(R, [["__scopeId", "data-v-9031c32d"]]);
54
54
  export {
55
- b as B,
55
+ S as B,
56
56
  I as _
57
57
  };
@@ -246,17 +246,18 @@ export type ColumnPreset =
246
246
  | ColumnCheckboxPreset;
247
247
 
248
248
  export interface CombinedHeaders {
249
- parent: TableParentHeaders[];
249
+ parent: TableParentHeader[];
250
250
  child: TreeTableColumns[];
251
251
  }
252
252
 
253
- export interface TableParentHeaders
253
+ export interface TableParentHeader
254
254
  extends Pick<
255
255
  TableColumn,
256
256
  'header' | 'info' | 'infoSeverity' | 'headerClass'
257
257
  > {
258
258
  /**
259
- * Field is used as the header's key
259
+ * Field is used as the header's key, parent headers with
260
+ * the same field will be grouped into one cell
260
261
  */
261
262
  field: string;
262
263
  /**
@@ -274,9 +275,12 @@ export interface TableParentHeaders
274
275
  export interface TableColumn {
275
276
  header?: string;
276
277
  /**
277
- * The parent header (the header placed above this column)
278
+ * The headers placed above certain child headers. If there are
279
+ * multiple child headers with the same parent header, the parent
280
+ * will have its colspan extended. The parent header will be shown
281
+ * when at least one of its child headers is visible.
278
282
  */
279
- parentHeader?: string;
283
+ parentHeader?: TableParentHeader;
280
284
  field: string;
281
285
  fieldType?: 'string' | 'number' | 'boolean' | 'array';
282
286
  info?: string;
@@ -530,13 +534,6 @@ export interface BaseDataTableProps {
530
534
  * @optional
531
535
  */
532
536
  tableTitle?: string;
533
- /**
534
- * The headers placed above certain child headers. If there are
535
- * multiple child headers with the same parent header, the parent
536
- * will have its colspan extended. The parent header will be shown
537
- * when at least one of its child headers is visible.
538
- */
539
- parentHeaders?: TableParentHeaders[];
540
537
  /**
541
538
  * An array of table columns to display.
542
539
  */
@@ -4,9 +4,9 @@ import { e as m } from "../event-bus/index.es.js";
4
4
  import { u as St } from "../plugins/WangsVue.es.js";
5
5
  import { u as Nt } from "../utils/baseToast.util.es.js";
6
6
  import { f as At } from "../utils/date.util.es.js";
7
- import { n as Ht, e as Ft } from "../utils/exportToExcel.util.es.js";
7
+ import { n as Ft, e as Ht } from "../utils/exportToExcel.util.es.js";
8
8
  import { m as Bt } from "../utils/mergePropsWithDefaults.util.es.js";
9
- import { s as ce, g as F } from "../utils/object.util.es.js";
9
+ import { s as ce, g as H } from "../utils/object.util.es.js";
10
10
  import { u as $t } from "../assetinfo/index.es.js";
11
11
  import { s as xt } from "../vendor/primevue/paginator/paginator.esm.es.js";
12
12
  import { O as Oa } from "../vendor/primevue/utils/utils.esm.es.js";
@@ -37,7 +37,6 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
37
37
  childTableProps: {},
38
38
  tableName: { default: "datatable" },
39
39
  tableTitle: { default: void 0 },
40
- parentHeaders: {},
41
40
  columns: {},
42
41
  useOption: { type: Boolean, default: !0 },
43
42
  data: {},
@@ -90,20 +89,13 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
90
89
  if (a.parentHeader) {
91
90
  e.child.push(a);
92
91
  const n = e.parent.find(
93
- (s) => s.field === a.parentHeader
92
+ (s) => s.field === a.parentHeader.field
94
93
  );
95
- if (n)
96
- n.colspan && n.colspan++;
97
- else {
98
- const s = t.parentHeaders.find(
99
- (v) => v.field === a.parentHeader
100
- );
101
- s && e.parent.push({
102
- ...s,
103
- colspan: 1,
104
- rowspan: 1
105
- });
106
- }
94
+ n ? n.colspan && n.colspan++ : e.parent.push({
95
+ ...a.parentHeader,
96
+ colspan: 1,
97
+ rowspan: 1
98
+ });
107
99
  } else
108
100
  e.parent.push(a);
109
101
  return e;
@@ -229,9 +221,9 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
229
221
  ...e,
230
222
  currentTarget: e.currentTarget ?? e.target
231
223
  };
232
- Fe(), await Ma(() => {
224
+ He(), await Ma(() => {
233
225
  var d;
234
- s != null && s.classList.contains("option-button-active") ? Fe() : ((d = Qe.value) == null || d.toggle(v), Fe(), s == null || s.classList.add("option-button-active"));
226
+ s != null && s.classList.contains("option-button-active") ? He() : ((d = Qe.value) == null || d.toggle(v), He(), s == null || s.classList.add("option-button-active"));
235
227
  });
236
228
  }, Xe = async (e, a, n) => {
237
229
  var v, d, b, f;
@@ -239,7 +231,7 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
239
231
  const s = () => ce(
240
232
  a,
241
233
  n.field,
242
- !F(a, n.field)
234
+ !H(a, n.field)
243
235
  );
244
236
  if (n.preset.type === "checkbox" ? (d = (v = n.preset).onCheck) == null || d.call(v, e, a, s) : n.preset.type === "toggle" && ((f = (b = n.preset).onToggle) == null || f.call(b, e, a, s)), "confirmDialogProps" in n.preset) {
245
237
  const { showWhen: w } = xe(
@@ -252,14 +244,14 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
252
244
  e
253
245
  ) : ge.value[a[t.dataKey] + n.field] = !w || w === "active" && e || w === "inactive" && !e;
254
246
  }
255
- }, He = (e) => e.draggable !== !1 && !e.childRow && !e.childRowHeader && t.reorderable && !D.value, at = (e, a, n) => {
247
+ }, Fe = (e) => e.draggable !== !1 && !e.childRow && !e.childRowHeader && t.reorderable && !D.value, at = (e, a, n) => {
256
248
  if (a.childRow || a.childRowHeader) return;
257
249
  $.value = {};
258
250
  const { dataTransfer: s } = e;
259
251
  be.value = a, q.value = { item: a, fromIndex: n }, s && (s.dropEffect = "move", s.effectAllowed = "move", s.setData("id", a._id), s.setData("index", n.toString()));
260
252
  }, tt = (e, a) => {
261
253
  var n, s;
262
- if (e.preventDefault(), He(a)) {
254
+ if (e.preventDefault(), Fe(a)) {
263
255
  const v = e.target, d = v.tagName === "TR" ? v : v.closest("tr");
264
256
  if (d == null || d.classList.add("bg-primary-50"), (n = d == null ? void 0 : d.nextElementSibling) == null || n.classList.remove("bg-primary-50"), (s = d == null ? void 0 : d.previousElementSibling) == null || s.classList.remove("bg-primary-50"), !d || !be.value) return;
265
257
  const b = M.value.findIndex(
@@ -282,7 +274,7 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
282
274
  q.value && z("rowReorder", q.value), be.value = void 0, Te.value = !1, q.value = void 0;
283
275
  }, ot = () => {
284
276
  g.value = [...M.value];
285
- }, Fe = () => {
277
+ }, He = () => {
286
278
  const e = document.querySelectorAll(".option-button-active");
287
279
  e == null || e.forEach((a) => {
288
280
  a.classList.remove("option-button-active");
@@ -303,7 +295,7 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
303
295
  try {
304
296
  e = n.length ? e.filter((s) => n.every(
305
297
  ([v, { value: d, matchMode: b }]) => {
306
- const f = F(s, v);
298
+ const f = H(s, v);
307
299
  switch (b) {
308
300
  case "IN":
309
301
  return Array.isArray(d) ? d.includes(f) : !1;
@@ -423,7 +415,7 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
423
415
  try {
424
416
  if (m.off("data-table:download", me), e === t.tableName) {
425
417
  ze(!0, Le.downloadingMessage);
426
- const { data: k } = t.fetchFunction ? await aa() : { data: t.data }, l = Ht(k, d, Le);
418
+ const { data: k } = t.fetchFunction ? await aa() : { data: t.data }, l = Ft(k, d, Le);
427
419
  if (a != null && a.length) {
428
420
  m.emit("button-download:multi-tables", {
429
421
  table: {
@@ -435,7 +427,7 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
435
427
  });
436
428
  return;
437
429
  }
438
- await Ft({
430
+ await Ht({
439
431
  tables: [
440
432
  { headers: b, data: l, tableName: e, tableTitle: t.tableTitle }
441
433
  ],
@@ -640,7 +632,7 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
640
632
  L("tr", p(
641
633
  {
642
634
  id: l._id,
643
- draggable: He(l),
635
+ draggable: Fe(l),
644
636
  ref_for: !0
645
637
  },
646
638
  (se = r(u)) == null ? void 0 : se.bodyrow({
@@ -648,7 +640,7 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
648
640
  highlighted: l[e.highlightKey ?? ""],
649
641
  selected: Ae(l[e.dataKey]),
650
642
  disabled: Y(l[e.dataKey]),
651
- draggable: He(l),
643
+ draggable: Fe(l),
652
644
  dragging: Te.value
653
645
  },
654
646
  props: t
@@ -782,7 +774,7 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
782
774
  ], 16)
783
775
  ], 10, rl)) : (i(), c(_, { key: 7 }, [
784
776
  (i(!0), c(_, null, Q(l.childRow ? qe.value : x.value, (o) => {
785
- var V, de, wa, ka, Ca, Ra, Da, _a, Ta, Pa, Ka, Ea, Sa, Na, Aa, we, Ha, Fa;
777
+ var V, de, wa, ka, Ca, Ra, Da, _a, Ta, Pa, Ka, Ea, Sa, Na, Aa, we, Fa, Ha;
786
778
  return i(), c("td", p({
787
779
  key: o.field,
788
780
  class: [
@@ -801,7 +793,7 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
801
793
  key: 0,
802
794
  disabled: Y(l[e.dataKey]) || (typeof ((Da = o.preset) == null ? void 0 : Da.disabled) == "function" ? (_a = o.preset) == null ? void 0 : _a.disabled(l) : (Ta = o.preset) == null ? void 0 : Ta.disabled),
803
795
  "input-id": l[e.dataKey],
804
- "model-value": r(F)(l, o.field),
796
+ "model-value": r(H)(l, o.field),
805
797
  onClick: a[9] || (a[9] = N(() => {
806
798
  }, ["stop"])),
807
799
  "onUpdate:modelValue": (C) => {
@@ -812,7 +804,7 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
812
804
  key: 1,
813
805
  disabled: Y(l[e.dataKey]) || (typeof ((Ka = o.preset) == null ? void 0 : Ka.disabled) == "function" ? (Ea = o.preset) == null ? void 0 : Ea.disabled(l) : (Sa = o.preset) == null ? void 0 : Sa.disabled),
814
806
  "input-id": l[e.dataKey],
815
- "model-value": r(F)(l, o.field),
807
+ "model-value": r(H)(l, o.field),
816
808
  onClick: a[10] || (a[10] = N(() => {
817
809
  }, ["stop"])),
818
810
  "onUpdate:modelValue": (C) => {
@@ -826,33 +818,33 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
826
818
  list: [l],
827
819
  visible: !!ge.value[l[e.dataKey] + o.field],
828
820
  onClose: () => {
829
- var E, H, Ba;
821
+ var E, F, Ba;
830
822
  const C = () => r(ce)(
831
823
  l,
832
824
  o.field,
833
- !r(F)(l, o.field)
825
+ !r(H)(l, o.field)
834
826
  );
835
827
  ((E = xe(
836
828
  o.preset,
837
829
  l[o.field],
838
830
  l
839
- )) == null ? void 0 : E.actionable) == !1 && "onConfirm" in o.preset ? (Ba = (H = o.preset).onConfirm) == null || Ba.call(
840
- H,
831
+ )) == null ? void 0 : E.actionable) == !1 && "onConfirm" in o.preset ? (Ba = (F = o.preset).onConfirm) == null || Ba.call(
832
+ F,
841
833
  l[o.field],
842
834
  l,
843
835
  C
844
836
  ) : C();
845
837
  },
846
838
  onConfirm: (C) => {
847
- var E, H;
848
- return (H = (E = o.preset) == null ? void 0 : E.onConfirm) == null ? void 0 : H.call(
839
+ var E, F;
840
+ return (F = (E = o.preset) == null ? void 0 : E.onConfirm) == null ? void 0 : F.call(
849
841
  E,
850
842
  l[o.field],
851
843
  l,
852
844
  () => r(ce)(
853
845
  l,
854
846
  o.field,
855
- !r(F)(l, o.field)
847
+ !r(H)(l, o.field)
856
848
  )
857
849
  );
858
850
  },
@@ -868,7 +860,7 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
868
860
  ), null, 16, ["list", "visible", "onClose", "onConfirm", "onUpdate:visible"])) : h("", !0)
869
861
  ], 64)) : ((Aa = o.preset) == null ? void 0 : Aa.type) === "multirow" ? (i(), S(zt, {
870
862
  key: 1,
871
- attributes: ((Ha = (we = o.preset) == null ? void 0 : we.fieldAttributes) == null ? void 0 : Ha.call(we, l)) ?? []
863
+ attributes: ((Fa = (we = o.preset) == null ? void 0 : we.fieldAttributes) == null ? void 0 : Fa.call(we, l)) ?? []
872
864
  }, null, 8, ["attributes"])) : o.editable ? (i(), c("span", p({
873
865
  key: 2,
874
866
  ref_for: !0
@@ -885,7 +877,7 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
885
877
  onKeypress: (C) => {
886
878
  o.numberInputOnly && yt(C);
887
879
  }
888
- }), I(r(F)(l, o.field) || "-"), 17, dl)) : o.bodyComponent || o.bodyClass || o.bodyTemplate || o.dateFormatOptions ? (i(), c(_, { key: 3 }, [
880
+ }), I(r(H)(l, o.field) || "-"), 17, dl)) : o.bodyComponent || o.bodyClass || o.bodyTemplate || o.dateFormatOptions ? (i(), c(_, { key: 3 }, [
889
881
  o.bodyComponent ? (i(), S(Tt(o.bodyComponent(l, y).component), p({
890
882
  key: 0,
891
883
  modelValue: o.bodyComponent(l, y).model,
@@ -896,23 +888,23 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
896
888
  o.bodyComponent(l, y).events ? o.bodyComponent(l, y).events : {}
897
889
  ), {
898
890
  onChange: (C) => {
899
- var E, H;
900
- return (H = (E = o.bodyComponent(l, y)).onChange) == null ? void 0 : H.call(E, l);
891
+ var E, F;
892
+ return (F = (E = o.bodyComponent(l, y)).onChange) == null ? void 0 : F.call(E, l);
901
893
  },
902
894
  onClick: (C) => {
903
895
  o.bodyComponent(l, y).stop !== !1 && C.stopPropagation();
904
896
  },
905
897
  "onUpdate:modelValue": (C) => {
906
- var E, H;
907
- return (H = (E = o.bodyComponent(l, y)).onChange) == null ? void 0 : H.call(E, l);
898
+ var E, F;
899
+ return (F = (E = o.bodyComponent(l, y)).onChange) == null ? void 0 : F.call(E, l);
908
900
  }
909
901
  }), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "onChange", "onClick"])) : (i(), c("span", il, [
910
902
  o.bodyTemplate ? (i(), c(_, { key: 0 }, [
911
- Re(I(((Fa = o.bodyTemplate) == null ? void 0 : Fa.call(o, l, y)) || "-"), 1)
903
+ Re(I(((Ha = o.bodyTemplate) == null ? void 0 : Ha.call(o, l, y)) || "-"), 1)
912
904
  ], 64)) : o.dateFormatOptions ? (i(), c(_, { key: 1 }, [
913
905
  Re(I(r(At)(
914
906
  new Date(
915
- r(F)(
907
+ r(H)(
916
908
  l,
917
909
  o.field
918
910
  )
@@ -920,11 +912,11 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
920
912
  o.dateFormatOptions
921
913
  )), 1)
922
914
  ], 64)) : (i(), c(_, { key: 2 }, [
923
- Re(I(r(F)(l, o.field) || "-"), 1)
915
+ Re(I(r(H)(l, o.field) || "-"), 1)
924
916
  ], 64))
925
917
  ]))
926
918
  ], 64)) : (i(), c(_, { key: 4 }, [
927
- Re(I(r(F)(l, o.field) ?? "-"), 1)
919
+ Re(I(r(H)(l, o.field) ?? "-"), 1)
928
920
  ], 64))
929
921
  ], 16, sl);
930
922
  }), 128)),
@@ -1024,7 +1016,7 @@ const Wt = (W, B) => W.every((t) => B.includes(t)), qt = ["id"], Gt = ["rowspan"
1024
1016
  ], 16);
1025
1017
  };
1026
1018
  }
1027
- }), Ol = /* @__PURE__ */ Vt(pl, [["__scopeId", "data-v-a2aa5e4c"]]);
1019
+ }), Ol = /* @__PURE__ */ Vt(pl, [["__scopeId", "data-v-d33ae895"]]);
1028
1020
  export {
1029
1021
  Ol as D
1030
1022
  };
@@ -231,8 +231,8 @@ const H = /* @__PURE__ */ nA(vA), j = "data:image/png;base64,iVBORw0KGgoAAAANSUh
231
231
  t[4] || (t[4] = e("span", null, "Preview", -1)),
232
232
  a(eA, {
233
233
  icon: "info",
234
- info: `This preview is only for showing the side of the
235
- label that printed or not. It does not show the
234
+ info: `This preview is only for showing the side of the\r
235
+ label that printed or not. It does not show the\r
236
236
  exact amount you entered.`,
237
237
  severity: "primary"
238
238
  })
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as E, onMounted as I, shallowRef as i, ref as M, createElementBlock as N, openBlock as F, Fragment as L, createElementVNode as d, createVNode as a, mergeProps as P, unref as l, withCtx as U, toDisplayString as _ } from "vue";
2
2
  import { AssetServices as V, DisposalServices as q } from "@tagsamurai/fats-api-services";
3
3
  import { u as z } from "../assetinfo/index.es.js";
4
- import { u as H } from "../plugins/basei18n.es.js";
5
- import { u as O } from "../utils/toast.util.es.js";
4
+ import { u as O } from "../plugins/basei18n.es.js";
5
+ import { u as W } from "../utils/toast.util.es.js";
6
6
  import { _ as g } from "../badge/index.es.js";
7
7
  import { _ as w } from "../button/index.es.js";
8
- import { _ as W } from "../buttonfilter/index.es.js";
9
- import { _ as j } from "../buttonsearch/index.es.js";
8
+ import { _ as j } from "../buttonfilter/index.es.js";
9
+ import { _ as H } from "../buttonsearch/index.es.js";
10
10
  import { D as K } from "../datatable/index.es.js";
11
11
  import { _ as R } from "../dialogconfirm/index.es.js";
12
12
  import { _ as G } from "../image/index.es.js";
@@ -23,7 +23,6 @@ const Y = {
23
23
  childTableProps: {},
24
24
  tableName: {},
25
25
  tableTitle: {},
26
- parentHeaders: {},
27
26
  useOption: { type: Boolean },
28
27
  data: {},
29
28
  disableKey: {},
@@ -63,7 +62,7 @@ const Y = {
63
62
  I(() => {
64
63
  S();
65
64
  });
66
- const p = O(), { t: s } = H(), { setLoading: m } = z(), c = i(!1), f = i(!1), D = i(0), y = i([]), b = i(), r = i([]), n = M(
65
+ const p = W(), { t: s } = O(), { setLoading: m } = z(), c = i(!1), f = i(!1), D = i(0), y = i([]), b = i(), r = i([]), n = M(
67
66
  /* @__PURE__ */ new Map()
68
67
  ), C = [
69
68
  {
@@ -73,10 +72,10 @@ const Y = {
73
72
  fixed: !0,
74
73
  sortable: !0,
75
74
  excluded: !0,
76
- bodyComponent: (t) => ({
75
+ bodyComponent: (o) => ({
77
76
  component: G,
78
77
  props: {
79
- src: t.assetImageBig,
78
+ src: o.assetImageBig,
80
79
  description: "asset-report-photo",
81
80
  size: "small"
82
81
  }
@@ -87,9 +86,9 @@ const Y = {
87
86
  field: "name.nameWithSequence",
88
87
  sortable: !0,
89
88
  fixed: !0,
90
- bodyTemplate: (t) => {
89
+ bodyTemplate: (o) => {
91
90
  var e;
92
- return ((e = t.name) == null ? void 0 : e.nameWithSequence) ?? "-";
91
+ return ((e = o.name) == null ? void 0 : e.nameWithSequence) ?? "-";
93
92
  }
94
93
  },
95
94
  {
@@ -97,12 +96,12 @@ const Y = {
97
96
  field: "brand.name",
98
97
  sortable: !0,
99
98
  fixed: !1,
100
- bodyComponent: (t) => {
99
+ bodyComponent: (o) => {
101
100
  var e;
102
101
  return {
103
102
  component: g,
104
103
  props: {
105
- label: (e = t.brand) == null ? void 0 : e.name,
104
+ label: (e = o.brand) == null ? void 0 : e.name,
106
105
  severity: "dark",
107
106
  format: "nowrap"
108
107
  }
@@ -114,12 +113,12 @@ const Y = {
114
113
  field: "model.name",
115
114
  sortable: !0,
116
115
  fixed: !1,
117
- bodyComponent: (t) => {
116
+ bodyComponent: (o) => {
118
117
  var e;
119
118
  return {
120
119
  component: g,
121
120
  props: {
122
- label: (e = t.model) == null ? void 0 : e.name,
121
+ label: (e = o.model) == null ? void 0 : e.name,
123
122
  severity: "dark",
124
123
  format: "nowrap"
125
124
  }
@@ -131,12 +130,12 @@ const Y = {
131
130
  field: "group.name",
132
131
  sortable: !0,
133
132
  fixed: !1,
134
- bodyComponent: (t) => {
133
+ bodyComponent: (o) => {
135
134
  var e;
136
135
  return {
137
136
  component: g,
138
137
  props: {
139
- label: (e = t.group) == null ? void 0 : e.name,
138
+ label: (e = o.group) == null ? void 0 : e.name,
140
139
  format: "nowrap"
141
140
  }
142
141
  };
@@ -146,21 +145,21 @@ const Y = {
146
145
  header: "Note",
147
146
  field: "note",
148
147
  fixed: !0,
149
- bodyComponent: (t) => ({
148
+ bodyComponent: (o) => ({
150
149
  component: Q,
151
150
  props: {
152
- modelValue: n.value.get(t._id ?? "assetId").notes,
151
+ modelValue: n.value.get(o._id ?? "assetId").notes,
153
152
  placeholder: s("Enter note"),
154
153
  rows: 1,
155
154
  maxlength: 30
156
155
  },
157
156
  events: {
158
157
  "update:modelValue": (e) => {
159
- const o = n.value.get(t._id ?? "assetId");
160
- n.value.set(t._id ?? "assetId", {
161
- ...o,
158
+ const t = n.value.get(o._id ?? "assetId");
159
+ n.value.set(o._id ?? "assetId", {
160
+ ...t,
162
161
  notes: e
163
- }), t.note = e;
162
+ }), o.note = e;
164
163
  }
165
164
  }
166
165
  })
@@ -168,16 +167,16 @@ const Y = {
168
167
  ], S = async () => {
169
168
  try {
170
169
  m(!0);
171
- const t = sessionStorage.getItem("assetsDisposalReport") ?? "[]", { data: e } = await V.getAllAssets({ _id: t });
172
- e.data.data.forEach((o) => {
173
- n.value.set(o._id ?? "", {
170
+ const o = sessionStorage.getItem("assetsDisposalReport") ?? "[]", { data: e } = await V.getAllAssets({ _id: o });
171
+ e.data.data.forEach((t) => {
172
+ n.value.set(t._id ?? "", {
174
173
  notes: null,
175
- reason: ["Damaged", "Missing"].includes(o.status) ? o.status : u.reason
174
+ reason: ["Damaged", "Missing"].includes(t.status) ? t.status : u.reason
176
175
  });
177
176
  }), r.value = e.data.data, D.value = e.data.totalRecords;
178
- } catch (t) {
179
- console.error(t), p.add({
180
- error: t,
177
+ } catch (o) {
178
+ console.error(o), p.add({
179
+ error: o,
181
180
  message: "Error, failed to get assets. "
182
181
  });
183
182
  } finally {
@@ -192,39 +191,39 @@ const Y = {
192
191
  c.value = !0;
193
192
  }
194
193
  }
195
- ], h = (t) => {
194
+ ], h = (o) => {
196
195
  r.value = r.value.filter(
197
- (e) => !t.some((o) => e._id === o._id)
198
- ), T(t);
199
- }, T = (t) => {
200
- t.forEach((e) => {
196
+ (e) => !o.some((t) => e._id === t._id)
197
+ ), T(o);
198
+ }, T = (o) => {
199
+ o.forEach((e) => {
201
200
  n.value.delete(e._id ?? "");
202
201
  }), r.value.length || v(), p.add({
203
202
  message: s("Success, asset has been removed from the list."),
204
203
  severity: "success"
205
204
  });
206
- }, $ = (t, e) => {
207
- t.forEach((o) => {
208
- n.value.set(o._id ?? "", {
205
+ }, $ = (o, e) => {
206
+ o.forEach((t) => {
207
+ n.value.set(t._id ?? "", {
209
208
  notes: e ?? null,
210
- reason: ["Damaged", "Missing"].includes(o.status) ? o.status : u.reason
209
+ reason: ["Damaged", "Missing"].includes(t.status) ? t.status : u.reason
211
210
  });
212
211
  });
213
212
  }, v = () => {
214
- const t = window.location.pathname, e = t.slice(0, t.lastIndexOf("/"));
213
+ const o = window.location.pathname, e = o.slice(0, o.lastIndexOf("/"));
215
214
  u.router.replace(e), sessionStorage.removeItem("assetsDisposalReport");
216
215
  }, A = async () => {
217
- const t = [];
218
- n.value.forEach((e, o) => {
216
+ const o = [];
217
+ n.value.forEach((e, t) => {
219
218
  const k = {
220
- asset: o,
219
+ asset: t,
221
220
  notes: e.notes,
222
221
  reason: e.reason
223
222
  };
224
- t.push(k);
223
+ o.push(k);
225
224
  });
226
225
  try {
227
- m(!0), await q.postReportDisposal({ data: t }), p.add({
226
+ m(!0), await q.postReportDisposal({ data: o }), p.add({
228
227
  message: s("Success, disposal report has been submitted.")
229
228
  }), v();
230
229
  } catch (e) {
@@ -236,35 +235,35 @@ const Y = {
236
235
  m(!1);
237
236
  }
238
237
  };
239
- return (t, e) => (F(), N(L, null, [
238
+ return (o, e) => (F(), N(L, null, [
240
239
  d("div", Y, [
241
240
  d("div", Z, [
242
241
  a(J, {
243
242
  "assets-to-report": r.value,
244
- "onUpdate:assetsToReport": e[0] || (e[0] = (o) => r.value = o),
243
+ "onUpdate:assetsToReport": e[0] || (e[0] = (t) => r.value = t),
245
244
  "selected-data": y.value,
246
- "onUpdate:selectedData": e[1] || (e[1] = (o) => y.value = o),
245
+ "onUpdate:selectedData": e[1] || (e[1] = (t) => y.value = t),
247
246
  onNoted: $,
248
- onRemoved: e[2] || (e[2] = (o) => h(o)),
247
+ onRemoved: e[2] || (e[2] = (t) => h(t)),
249
248
  "table-name": "disposal-report-page-table"
250
249
  }, null, 8, ["assets-to-report", "selected-data"]),
251
- a(j, {
250
+ a(H, {
252
251
  class: "ml-auto",
253
252
  "table-name": "disposal-report-page-table"
254
253
  }),
255
- a(W, { "table-name": "disposal-report-page-table" })
254
+ a(j, { "table-name": "disposal-report-page-table" })
256
255
  ]),
257
256
  a(X, {
258
257
  assets: r.value,
259
258
  "table-name": "disposal-report-page-table"
260
259
  }, null, 8, ["assets"]),
261
- a(K, P(t.$props, {
260
+ a(K, P(o.$props, {
262
261
  columns: C,
263
262
  data: r.value,
264
263
  lazy: !1,
265
264
  options: B,
266
265
  rows: 10,
267
- onToggleOption: e[3] || (e[3] = (o) => b.value = o),
266
+ onToggleOption: e[3] || (e[3] = (t) => b.value = t),
268
267
  "data-key": "_id",
269
268
  "rounded-header": "",
270
269
  "selection-type": "checkbox",
@@ -275,18 +274,18 @@ const Y = {
275
274
  ]),
276
275
  a(R, {
277
276
  visible: c.value,
278
- "onUpdate:visible": e[4] || (e[4] = (o) => c.value = o),
277
+ "onUpdate:visible": e[4] || (e[4] = (t) => c.value = t),
279
278
  body: l(s)("Are you sure you want to remove it?"),
280
279
  "confirm-label": l(s)("Remove"),
281
280
  header: l(s)("Remove from List"),
282
281
  lists: [b.value],
283
- onConfirm: e[5] || (e[5] = (o) => h([b.value])),
282
+ onConfirm: e[5] || (e[5] = (t) => h([b.value])),
284
283
  "list-label": "name.nameWithSequence",
285
284
  severity: "danger"
286
285
  }, null, 8, ["visible", "body", "confirm-label", "header", "lists"]),
287
286
  a(R, {
288
287
  visible: f.value,
289
- "onUpdate:visible": e[6] || (e[6] = (o) => f.value = o),
288
+ "onUpdate:visible": e[6] || (e[6] = (t) => f.value = t),
290
289
  "confirm-label": l(s)("Continue"),
291
290
  header: l(s)("Cancel Report"),
292
291
  onConfirm: v,
@@ -301,7 +300,7 @@ const Y = {
301
300
  d("div", ee, [
302
301
  a(w, {
303
302
  label: l(s)("Cancel"),
304
- onClick: e[7] || (e[7] = (o) => f.value = !0),
303
+ onClick: e[7] || (e[7] = (t) => f.value = !0),
305
304
  severity: "dark",
306
305
  text: ""
307
306
  }, null, 8, ["label"]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-fats",
3
- "version": "1.0.1-alpha.42",
3
+ "version": "1.0.1-alpha.43",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",