@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.
Files changed (78) hide show
  1. package/animation/index.es.js +9 -8
  2. package/assetinfo/index.d.ts +5 -4
  3. package/assetinfo/index.es.js +113 -97
  4. package/backgroundimagecropper/index.es.js +14 -12
  5. package/button/index.es.js +58 -48
  6. package/buttonbulkaction/index.es.js +67 -59
  7. package/buttondownload/index.es.js +18 -18
  8. package/buttonradio/index.es.js +11 -11
  9. package/buttonscan/index.es.js +1 -1
  10. package/buttonsearch/index.es.js +14 -14
  11. package/buttonselectuser/index.es.js +29 -29
  12. package/checkbox/index.es.js +5 -5
  13. package/config/defaultProps.es.js +3 -4
  14. package/datatable/index.es.js +470 -465
  15. package/datepicker/index.es.js +17 -17
  16. package/daypicker/index.es.js +21 -21
  17. package/dialog/index.es.js +17 -15
  18. package/dialogbasictransferlog/index.es.js +89 -89
  19. package/dialogconfirm/index.es.js +33 -33
  20. package/dialogdamagelog/index.es.js +89 -89
  21. package/dialogform/index.es.js +16 -16
  22. package/dialogfulltransferlog/index.es.js +96 -96
  23. package/dialoglinkedasset/index.es.js +48 -48
  24. package/dialogprintqr/index.es.js +70 -70
  25. package/dialogreportdamage/index.es.js +57 -57
  26. package/dialogreportmissing/index.es.js +94 -86
  27. package/dialogselecttree/index.es.js +18 -16
  28. package/dialogselectuser/index.es.js +16 -16
  29. package/directives/index.d.ts +1 -0
  30. package/directives/index.es.js +1 -0
  31. package/directives/safeHtml.d.ts +16 -0
  32. package/directives/safeHtml.es.js +12 -0
  33. package/disposalreport/index.es.js +1 -1
  34. package/disposalreportbulkaction/index.es.js +40 -41
  35. package/disposalreportdialogselectasset/index.es.js +72 -72
  36. package/disposalreporttable/index.es.js +108 -108
  37. package/disposalreporttablefilter/index.es.js +16 -17
  38. package/dropdown/index.es.js +120 -117
  39. package/fieldwrapper/index.es.js +7 -7
  40. package/fileupload/index.es.js +35 -31
  41. package/hardwaresync/index.es.js +12 -12
  42. package/headercell/index.es.js +4 -4
  43. package/icon/index.es.js +26 -25
  44. package/imagecompressor/index.es.js +143 -143
  45. package/imageinputinfo/index.es.js +13 -13
  46. package/inlinemessage/index.es.js +12 -12
  47. package/inputbadge/index.es.js +42 -43
  48. package/inputnumber/index.es.js +7 -7
  49. package/inputpassword/index.es.js +9 -9
  50. package/inputrangenumber/index.es.js +16 -16
  51. package/inputsearch/index.es.js +18 -18
  52. package/inputtext/index.es.js +33 -33
  53. package/litedropdown/index.es.js +48 -40
  54. package/menuitem/index.es.js +27 -26
  55. package/multirow/index.es.js +16 -16
  56. package/multiselect/index.es.js +86 -83
  57. package/package.json +1 -1
  58. package/plugins/basei18n.d.ts +2 -2
  59. package/plugins/basei18n.es.js +48 -42
  60. package/stats.html +1 -1
  61. package/style.css +1 -1
  62. package/tabmenu/index.es.js +14 -9
  63. package/tagtype/index.es.js +33 -30
  64. package/textarea/index.es.js +3 -3
  65. package/toggledarkmode/store/index.d.ts +7 -0
  66. package/toggleswitch/index.es.js +3 -3
  67. package/treesearchinput/index.es.js +11 -11
  68. package/username/index.es.js +39 -39
  69. package/utils/baseToast.util.es.js +23 -22
  70. package/utils/index.es.js +1 -2
  71. package/utils/textFormatter.util.d.ts +32 -0
  72. package/utils/textFormatter.util.es.js +38 -10
  73. package/validatormessage/index.es.js +1 -1
  74. package/vendor/dompurify/dist/purify.es.es.js +553 -0
  75. package/wangsvue-fats.d.ts +2 -1
  76. package/wangsvue-fats.es.js +190 -186
  77. package/wangsvue-fats.esm.browser.js +17750 -17086
  78. package/wangsvue-fats.system.js +73 -72
@@ -1,4 +1,4 @@
1
- import { defineComponent as B, onMounted as D, reactive as M, shallowRef as f, computed as N, watch as y, createElementBlock as s, openBlock as i, Fragment as v, createVNode as o, unref as d, withCtx as m, createCommentVNode as _, createElementVNode as E, renderSlot as h, renderList as S, toDisplayString as F } from "vue";
1
+ import { defineComponent as B, onMounted as D, reactive as M, shallowRef as f, computed as N, watch as y, createElementBlock as s, openBlock as i, Fragment as _, createVNode as o, withCtx as u, unref as c, createCommentVNode as v, createElementVNode as E, renderSlot as h, renderList as S, toDisplayString as F } from "vue";
2
2
  import { u as P } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
3
3
  import { u as R } from "../plugins/basei18n.es.js";
4
4
  import { s as T } from "../vendor/primevue/inputtext/inputtext.esm.es.js";
@@ -35,7 +35,7 @@ const O = {
35
35
  n.fieldName ?? "date",
36
36
  (e) => {
37
37
  var t;
38
- return !(e != null && e.length) && n.mandatory ? u(((t = n.errorMessage) == null ? void 0 : t.empty) ?? "You must pick a date") : !0;
38
+ return !(e != null && e.length) && n.mandatory ? m(((t = n.errorMessage) == null ? void 0 : t.empty) ?? "You must pick a date") : !0;
39
39
  },
40
40
  {
41
41
  initialValue: n.initialValue ?? []
@@ -43,17 +43,17 @@ const O = {
43
43
  )
44
44
  );
45
45
  });
46
- const { t: u } = R(), a = M({ value: [] }), c = f(), p = f(), b = N(() => {
46
+ const { t: m } = R(), a = M({ value: [] }), d = f(), p = f(), b = N(() => {
47
47
  const e = a.value[0], t = a.value[1];
48
48
  return t && e !== t ? e + " - " + t : e == null ? void 0 : e.toString();
49
49
  }), x = Array.from({ length: 31 }, (e, t) => t + 1), V = (e) => {
50
50
  var l;
51
51
  const t = a.value[0], r = a.value[1];
52
- t != null && r != null && t === r ? (a.value[1] = e, (l = c.value) == null || l.hide()) : a.value = [e, e], a.value.sort((w, C) => w - C);
52
+ t != null && r != null && t === r ? (a.value[1] = e, (l = d.value) == null || l.hide()) : a.value = [e, e], a.value.sort((w, C) => w - C);
53
53
  }, g = (e) => {
54
54
  var r, l;
55
55
  const t = ((r = p.value) == null ? void 0 : r.$el) || null;
56
- t && c.value && t.focus(), (l = c.value) == null || l.toggle(e);
56
+ t && d.value && t.focus(), (l = d.value) == null || l.toggle(e);
57
57
  }, $ = (e) => {
58
58
  var t;
59
59
  if (e.key === "Enter" || e.key === " ") {
@@ -80,23 +80,23 @@ const O = {
80
80
  (e) => {
81
81
  a.value = e ?? [];
82
82
  }
83
- ), (e, t) => (i(), s(v, null, [
83
+ ), (e, t) => (i(), s(_, null, [
84
84
  o(A, {
85
- label: e.label ? d(u)(e.label) : void 0,
85
+ label: e.label,
86
86
  mandatory: e.mandatory
87
87
  }, {
88
- default: m(() => [
88
+ default: u(() => [
89
89
  o(K, {
90
90
  invalid: !!a.errorMessage,
91
91
  onClick: g,
92
92
  class: "grid grid-cols-[1fr,max-content] !items-center gap-1 px-3 py-1"
93
93
  }, {
94
- default: m(() => [
95
- o(d(T), {
94
+ default: u(() => [
95
+ o(c(T), {
96
96
  ref_key: "inputtext",
97
97
  ref: p,
98
98
  "model-value": b.value,
99
- placeholder: d(u)("Select date"),
99
+ placeholder: c(m)("Select date"),
100
100
  onKeydown: $,
101
101
  class: "!p-0",
102
102
  readonly: ""
@@ -116,9 +116,9 @@ const O = {
116
116
  ]),
117
117
  _: 1
118
118
  }, 8, ["label", "mandatory"]),
119
- o(d(j), {
119
+ o(c(j), {
120
120
  ref_key: "panel",
121
- ref: c,
121
+ ref: d,
122
122
  pt: {
123
123
  content: {
124
124
  class: "p-6"
@@ -126,12 +126,12 @@ const O = {
126
126
  },
127
127
  class: "border-none !mt-0 !shadow-panel"
128
128
  }, {
129
- default: m(() => [
129
+ default: u(() => [
130
130
  e.$slots.header ? (i(), s("div", O, [
131
131
  h(e.$slots, "header")
132
- ])) : _("", !0),
132
+ ])) : v("", !0),
133
133
  E("div", Y, [
134
- (i(!0), s(v, null, S(d(x), (r) => (i(), s("span", {
134
+ (i(!0), s(_, null, S(c(x), (r) => (i(), s("span", {
135
135
  key: r,
136
136
  "aria-selected": a.value.includes(r),
137
137
  "data-in-range": a.value[0] < r && r < a.value[1],
@@ -142,7 +142,7 @@ const O = {
142
142
  ]),
143
143
  e.$slots.footer ? (i(), s("div", z, [
144
144
  h(e.$slots, "footer")
145
- ])) : _("", !0)
145
+ ])) : v("", !0)
146
146
  ]),
147
147
  _: 3
148
148
  }, 512)
@@ -1,4 +1,4 @@
1
- import { defineComponent as S, onMounted as B, reactive as N, shallowRef as f, computed as D, watch as v, createElementBlock as u, openBlock as c, Fragment as _, createVNode as n, unref as o, withCtx as g, createCommentVNode as h, createElementVNode as k, renderSlot as b, renderList as F, normalizeClass as T, toDisplayString as E } from "vue";
1
+ import { defineComponent as S, onMounted as B, reactive as N, shallowRef as f, computed as D, watch as v, createElementBlock as i, openBlock as d, Fragment as _, createVNode as n, withCtx as g, unref as u, createCommentVNode as h, createElementVNode as k, renderSlot as b, renderList as F, normalizeClass as T, toDisplayString as E } from "vue";
2
2
  import { u as P } from "../vendor/vee-validate/dist/vee-validate.esm.es.js";
3
3
  import { u as R } from "../plugins/basei18n.es.js";
4
4
  import { s as j } from "../vendor/primevue/inputtext/inputtext.esm.es.js";
@@ -35,13 +35,13 @@ const Y = {
35
35
  s.fieldName ?? "day",
36
36
  (e) => {
37
37
  var t;
38
- return !(e != null && e.length) && s.mandatory ? i(((t = s.errorMessage) == null ? void 0 : t.empty) ?? "You must pick a day") : !0;
38
+ return !(e != null && e.length) && s.mandatory ? m(((t = s.errorMessage) == null ? void 0 : t.empty) ?? "You must pick a day") : !0;
39
39
  },
40
40
  { initialValue: s.initialValue ?? [] }
41
41
  )
42
42
  );
43
43
  });
44
- const m = [
44
+ const c = [
45
45
  "Monday",
46
46
  "Tuesday",
47
47
  "Wednesday",
@@ -49,17 +49,17 @@ const Y = {
49
49
  "Friday",
50
50
  "Saturday",
51
51
  "Sunday"
52
- ], { t: i } = R(), a = N({ value: [] }), d = f(), y = f(), $ = D(() => {
53
- const e = m[a.value[0]], t = m[a.value[1]];
52
+ ], { t: m } = R(), a = N({ value: [] }), o = f(), y = f(), $ = D(() => {
53
+ const e = c[a.value[0]], t = c[a.value[1]];
54
54
  return t && e !== t ? e + " - " + t : e;
55
- }), w = (e, t) => {
55
+ }), x = (e, t) => {
56
56
  var p;
57
57
  const r = a.value[0], l = a.value[1];
58
- r != null && l != null && r === l ? (a.value[1] = t, (p = d.value) == null || p.hide()) : a.value = [t, t], a.value.sort((C, M) => C - M);
59
- }, x = (e) => {
58
+ r != null && l != null && r === l ? (a.value[1] = t, (p = o.value) == null || p.hide()) : a.value = [t, t], a.value.sort((C, M) => C - M);
59
+ }, w = (e) => {
60
60
  var r, l;
61
61
  const t = ((r = y.value) == null ? void 0 : r.$el) || null;
62
- t && d.value && t.focus(), (l = d.value) == null || l.toggle(e);
62
+ t && o.value && t.focus(), (l = o.value) == null || l.toggle(e);
63
63
  };
64
64
  return v(
65
65
  () => s.initialValue,
@@ -75,23 +75,23 @@ const Y = {
75
75
  (e) => {
76
76
  a.value = e ?? [];
77
77
  }
78
- ), (e, t) => (c(), u(_, null, [
78
+ ), (e, t) => (d(), i(_, null, [
79
79
  n(I, {
80
- label: e.label ? o(i)(e.label) : void 0,
80
+ label: e.label,
81
81
  mandatory: e.mandatory
82
82
  }, {
83
83
  default: g(() => [
84
84
  n(O, {
85
85
  invalid: !!a.errorMessage,
86
- onClick: x,
86
+ onClick: w,
87
87
  class: "grid grid-cols-[1fr,max-content] !items-center gap-1 px-3 py-1"
88
88
  }, {
89
89
  default: g(() => [
90
- n(o(j), {
90
+ n(u(j), {
91
91
  ref_key: "inputtext",
92
92
  ref: y,
93
93
  "model-value": $.value,
94
- placeholder: o(i)("Select day"),
94
+ placeholder: u(m)("Select day"),
95
95
  class: "!p-0",
96
96
  readonly: ""
97
97
  }, null, 8, ["model-value", "placeholder"]),
@@ -110,9 +110,9 @@ const Y = {
110
110
  ]),
111
111
  _: 1
112
112
  }, 8, ["label", "mandatory"]),
113
- n(o(z), {
113
+ n(u(z), {
114
114
  ref_key: "panel",
115
- ref: d,
115
+ ref: o,
116
116
  pt: {
117
117
  content: {
118
118
  class: "p-6"
@@ -121,20 +121,20 @@ const Y = {
121
121
  class: "border-none !mt-0 !shadow-panel"
122
122
  }, {
123
123
  default: g(() => [
124
- e.$slots.header ? (c(), u("div", Y, [
124
+ e.$slots.header ? (d(), i("div", Y, [
125
125
  b(e.$slots, "header")
126
126
  ])) : h("", !0),
127
127
  k("div", q, [
128
- (c(), u(_, null, F(m, (r, l) => k("span", {
128
+ (d(), i(_, null, F(c, (r, l) => k("span", {
129
129
  key: r,
130
130
  "aria-selected": a.value.includes(l),
131
131
  class: T([{ "col-start-2": r === "Sunday" }, "text-xs text-general-800 dark:text-general-50 bg-white dark:bg-grayscale-900 hover:bg-primary-100 dark:hover:bg-general-900 rounded-[20px] [&[data-in-range='true']]:bg-primary-200 dark:[&[data-in-range='true']]:bg-primary-300 [&[data-in-range='true']]:text-general-800 dark:[&[data-in-range='true']]:text-general-50 [&[data-in-range='true']]:rounded-[0] [&[aria-selected='true']]:bg-primary-500 dark:[&[aria-selected='true']]:bg-primary-300 [&[aria-selected='true']]:text-white dark:[&[aria-selected='true']]:text-grayscale-900 text-center p-2 cursor-pointer"]),
132
132
  "data-in-range": a.value[0] < l && l < a.value[1],
133
- onClick: (p) => w(r, l),
133
+ onClick: (p) => x(r, l),
134
134
  "data-ts-section": "day"
135
- }, E(o(i)(r)), 11, A)), 64))
135
+ }, E(u(m)(r)), 11, A)), 64))
136
136
  ]),
137
- e.$slots.footer ? (c(), u("div", G, [
137
+ e.$slots.footer ? (d(), i("div", G, [
138
138
  b(e.$slots, "footer")
139
139
  ])) : h("", !0)
140
140
  ]),
@@ -1,6 +1,6 @@
1
- import { defineComponent as u, inject as m, createBlock as $, openBlock as y, unref as s, mergeProps as v, createSlots as B, withCtx as t, renderSlot as l } from "vue";
2
- import { s as g } from "../vendor/primevue/dialog/dialog.esm.es.js";
3
- const A = /* @__PURE__ */ u({
1
+ import { defineComponent as $, inject as y, createBlock as v, openBlock as B, unref as s, mergeProps as g, createSlots as C, withCtx as t, renderSlot as l } from "vue";
2
+ import { s as b } from "../vendor/primevue/dialog/dialog.esm.es.js";
3
+ const h = /* @__PURE__ */ $({
4
4
  __name: "Dialog",
5
5
  props: {
6
6
  header: { default: void 0 },
@@ -38,45 +38,47 @@ const A = /* @__PURE__ */ u({
38
38
  footerClass: {}
39
39
  },
40
40
  emits: ["update:visible", "hide", "afterHide", "show", "maximize", "unmaximize", "dragend"],
41
- setup(C) {
42
- const i = m("preset", {}).dialog, f = () => {
41
+ setup(u) {
42
+ const d = y("preset", {}).dialog, i = u, m = () => {
43
43
  setTimeout(() => {
44
44
  document.querySelectorAll('[data-pc-name="dialog"]').length && document.body.classList.add("p-overflow-hidden");
45
45
  }, 10);
46
46
  };
47
47
  return (e, o) => {
48
- var d, n, r, p;
49
- return y(), $(s(g), v(e.$props, {
48
+ var r, n, p, f;
49
+ return B(), v(s(b), g(e.$props, {
50
+ footer: e.$t(i.footer),
51
+ header: e.$t(i.header),
50
52
  pt: {
51
53
  root: {
52
54
  class: [
53
- ...(d = s(i)) == null ? void 0 : d.root({ state: {} }).class,
55
+ ...(r = s(d)) == null ? void 0 : r.root({ state: {} }).class,
54
56
  ...Array.isArray(e.$props.class) ? e.$props.class : [e.$props.class]
55
57
  ]
56
58
  },
57
59
  header: {
58
60
  class: [
59
- ...(n = s(i)) == null ? void 0 : n.header.class,
61
+ ...(n = s(d)) == null ? void 0 : n.header.class,
60
62
  ...Array.isArray(e.$props.headerClass) ? e.$props.headerClass : [e.$props.headerClass]
61
63
  ],
62
64
  "data-wv-section": "dialogheader"
63
65
  },
64
66
  content: {
65
67
  class: [
66
- ...(r = s(i)) == null ? void 0 : r.content({ state: {}, instance: {} }).class,
68
+ ...(p = s(d)) == null ? void 0 : p.content({ state: {}, instance: {} }).class,
67
69
  ...Array.isArray(e.$props.contentClass) ? e.$props.contentClass : [e.$props.contentClass]
68
70
  ]
69
71
  },
70
72
  footer: {
71
73
  class: [
72
- ...(p = s(i)) == null ? void 0 : p.footer.class,
74
+ ...(f = s(d)) == null ? void 0 : f.footer.class,
73
75
  ...Array.isArray(e.$props.footerClass) ? e.$props.footerClass : [e.$props.footerClass]
74
76
  ]
75
77
  },
76
78
  ...e.$props.pt
77
79
  },
78
80
  onAfterHide: o[0] || (o[0] = (a) => {
79
- e.$emit("afterHide"), f();
81
+ e.$emit("afterHide"), m();
80
82
  }),
81
83
  onDragend: o[1] || (o[1] = (a) => e.$emit("dragend", a)),
82
84
  onHide: o[2] || (o[2] = (a) => e.$emit("hide")),
@@ -84,7 +86,7 @@ const A = /* @__PURE__ */ u({
84
86
  onShow: o[4] || (o[4] = (a) => e.$emit("show")),
85
87
  onUnmaximize: o[5] || (o[5] = (a) => e.$emit("unmaximize", a)),
86
88
  "onUpdate:visible": o[6] || (o[6] = (a) => e.$emit("update:visible", a))
87
- }), B({
89
+ }), C({
88
90
  default: t(() => [
89
91
  l(e.$slots, "default")
90
92
  ]),
@@ -118,10 +120,10 @@ const A = /* @__PURE__ */ u({
118
120
  ]),
119
121
  key: "3"
120
122
  } : void 0
121
- ]), 1040, ["pt"]);
123
+ ]), 1040, ["footer", "header", "pt"]);
122
124
  };
123
125
  }
124
126
  });
125
127
  export {
126
- A as _
128
+ h as _
127
129
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as O, mergeModels as S, useModel as F, ref as v, inject as K, computed as p, watch as T, createBlock as x, openBlock as i, withCtx as b, createElementBlock as m, createCommentVNode as M, createElementVNode as a, createVNode as r, toDisplayString as L } from "vue";
1
+ import { defineComponent as O, mergeModels as S, useModel as F, ref as m, inject as K, computed as _, watch as L, createBlock as g, openBlock as i, withCtx as y, createElementBlock as p, createCommentVNode as M, createElementVNode as a, createVNode as r, toDisplayString as c } from "vue";
2
2
  import { TransferServices as q } from "@tagsamurai/fats-api-services";
3
3
  import { u as E } from "../utils/baseToast.util.es.js";
4
4
  import { _ as d } from "../badge/index.es.js";
@@ -9,22 +9,22 @@ import { _ as R } from "../tabmenu/index.es.js";
9
9
  import { _ as U } from "../timeline/index.es.js";
10
10
  import { _ as W } from "../assetinfo/index.es.js";
11
11
  import { _ as Z } from "../userwithicon/index.es.js";
12
- const z = { class: "w-full flex items-center justify-between pr-4" }, J = { class: "flex items-center gap-2" }, Q = {
12
+ const z = { class: "w-full flex items-center justify-between pr-4" }, J = { class: "flex gap-3 items-center" }, Q = { class: "text-sm font-bold" }, X = { class: "flex items-center gap-2" }, Y = {
13
13
  key: 0,
14
14
  class: "flex flex-col gap-3"
15
- }, X = { class: "flex justify-between items-center" }, Y = { class: "flex items-center gap-1" }, P = { class: "flex items-center gap-0.5" }, ee = { class: "flex items-center gap-0.5" }, te = { class: "flex items-center gap-2" }, ae = {
15
+ }, P = { class: "flex justify-between items-center" }, ee = { class: "flex items-center gap-1" }, te = { class: "flex items-center gap-0.5" }, ae = { class: "flex items-center gap-0.5" }, se = { class: "flex items-center gap-2" }, le = {
16
16
  key: 0,
17
17
  class: "flex flex-row items-center gap-1"
18
- }, se = {
18
+ }, ne = { class: "text-xs font-medium text-general-400 dark:text-general-200" }, re = {
19
19
  key: 1,
20
20
  class: "flex flex-col gap-1"
21
- }, le = { class: "flex flex-row items-center gap-1" }, ne = {
21
+ }, ie = { class: "flex flex-row items-center gap-1" }, oe = { class: "text-xs font-medium text-general-400 dark:text-general-200" }, ue = {
22
22
  key: 2,
23
23
  class: "flex flex-row items-center gap-1"
24
- }, re = { class: "text-xs font-medium text-general-400 dark:text-general-200" }, ie = {
24
+ }, ce = { class: "text-xs font-medium text-general-400 dark:text-general-200" }, de = {
25
25
  key: 1,
26
26
  class: "text-xs font-medium"
27
- }, be = /* @__PURE__ */ O({
27
+ }, $e = /* @__PURE__ */ O({
28
28
  __name: "DialogBasicTransferLog",
29
29
  props: /* @__PURE__ */ S({
30
30
  id: {}
@@ -33,32 +33,32 @@ const z = { class: "w-full flex items-center justify-between pr-4" }, J = { clas
33
33
  visibleModifiers: {}
34
34
  }),
35
35
  emits: ["update:visible"],
36
- setup(y) {
37
- const C = y, g = F(y, "visible"), B = E(), n = v(), k = v(), o = v(), w = v(0), u = K("requestIds") ?? v([]), _ = p(() => {
38
- var t;
39
- return (t = u.value) != null && t.length ? u.value.findIndex((e) => o.value === e) : -1;
40
- }), h = p(() => {
41
- var t, e;
42
- return (t = u.value) != null && t.length ? o.value === ((e = u.value) == null ? void 0 : e[0]) : !1;
43
- }), $ = p(() => {
44
- var t, e, s;
45
- return (t = u.value) != null && t.length ? o.value === ((s = u.value) == null ? void 0 : s[((e = u.value) == null ? void 0 : e.length) - 1]) : !1;
46
- }), D = p(
36
+ setup(h) {
37
+ const C = h, x = F(h, "visible"), B = E(), n = m(), k = m(), o = m(), $ = m(0), u = K("requestIds") ?? m([]), b = _(() => {
38
+ var e;
39
+ return (e = u.value) != null && e.length ? u.value.findIndex((t) => o.value === t) : -1;
40
+ }), w = _(() => {
41
+ var e, t;
42
+ return (e = u.value) != null && e.length ? o.value === ((t = u.value) == null ? void 0 : t[0]) : !1;
43
+ }), j = _(() => {
44
+ var e, t, s;
45
+ return (e = u.value) != null && e.length ? o.value === ((s = u.value) == null ? void 0 : s[((t = u.value) == null ? void 0 : t.length) - 1]) : !1;
46
+ }), D = _(
47
47
  () => {
48
- var t;
49
- return (t = k.value) == null ? void 0 : t.map((e) => ({
50
- _id: e.id,
51
- action: e.action,
52
- createdAt: e.updatedAt,
53
- title: e.action + " by",
54
- date: e.updatedAt,
55
- username: e.userFullName,
56
- body: e.action === "Handed over" ? void 0 : j(e.detail),
57
- detail: e.action === "Handed over" ? void 0 : j(e.detail)
48
+ var e;
49
+ return (e = k.value) == null ? void 0 : e.map((t) => ({
50
+ _id: t.id,
51
+ action: t.action,
52
+ createdAt: t.updatedAt,
53
+ title: t.action + " by",
54
+ date: t.updatedAt,
55
+ username: t.userFullName,
56
+ body: t.action === "Handed over" ? void 0 : N(t.detail),
57
+ detail: t.action === "Handed over" ? void 0 : N(t.detail)
58
58
  }));
59
59
  }
60
- ), G = (t) => {
61
- switch (t) {
60
+ ), G = (e) => {
61
+ switch (e) {
62
62
  case "Rejected":
63
63
  case "Reported Missing":
64
64
  return "danger";
@@ -71,64 +71,64 @@ const z = { class: "w-full flex items-center justify-between pr-4" }, J = { clas
71
71
  default:
72
72
  return "primary";
73
73
  }
74
- }, j = (t) => {
75
- if (!t || !Object.keys(t).length)
74
+ }, N = (e) => {
75
+ if (!e || !Object.keys(e).length)
76
76
  return;
77
- const e = {}, s = Object.keys(t);
78
- for (const c of s) {
79
- const f = c.replace(/([A-Z])/g, " $1"), l = f.charAt(0).toUpperCase() + f.slice(1);
80
- e[l === "Notes" ? "Note" : l] = t[c] ?? "-";
77
+ const t = {}, s = Object.keys(e);
78
+ for (const f of s) {
79
+ const v = f.replace(/([A-Z])/g, " $1"), l = v.charAt(0).toUpperCase() + v.slice(1);
80
+ t[l === "Notes" ? "Note" : l] = e[f] ?? "-";
81
81
  }
82
- return e;
82
+ return t;
83
83
  }, I = async () => {
84
- var t;
85
- if ((t = o.value) != null && t.length)
84
+ var e;
85
+ if ((e = o.value) != null && e.length)
86
86
  try {
87
- const { data: e } = await q.getTransactionLog(
87
+ const { data: t } = await q.getTransactionLog(
88
88
  o.value
89
89
  );
90
- e && (n.value = e.data.request, k.value = e.data.logs, w.value++);
91
- } catch (e) {
90
+ t && (n.value = t.data.request, k.value = t.data.logs, $.value++);
91
+ } catch (t) {
92
92
  B.add({
93
- error: e,
93
+ error: t,
94
94
  message: "Error, failed to load transfer transaction log"
95
95
  });
96
96
  }
97
- }, N = (t) => {
98
- if (_.value === -1 || t === "prev" && h.value || t === "next" && $.value)
97
+ }, T = (e) => {
98
+ if (b.value === -1 || e === "prev" && w.value || e === "next" && j.value)
99
99
  return;
100
- const e = t === "prev" ? _.value - 1 : _.value + 1;
101
- o.value = u.value[e];
100
+ const t = e === "prev" ? b.value - 1 : b.value + 1;
101
+ o.value = u.value[t];
102
102
  };
103
- return T(g, (t) => {
104
- t && (o.value = C.id);
105
- }), T(o, (t) => {
106
- t && I();
107
- }), (t, e) => (i(), x(H, {
108
- visible: g.value,
109
- "onUpdate:visible": e[2] || (e[2] = (s) => g.value = s),
103
+ return L(x, (e) => {
104
+ e && (o.value = C.id);
105
+ }), L(o, (e) => {
106
+ e && I();
107
+ }), (e, t) => (i(), g(H, {
108
+ visible: x.value,
109
+ "onUpdate:visible": t[2] || (t[2] = (s) => x.value = s),
110
110
  draggable: !1,
111
111
  class: "!w-[600px]",
112
112
  "footer-class": "flex items-end justify-end gap-1",
113
113
  header: "Transfer Log",
114
114
  modal: ""
115
115
  }, {
116
- header: b(() => [
116
+ header: y(() => [
117
117
  a("div", z, [
118
- e[3] || (e[3] = a("div", { class: "flex gap-3 items-center" }, [
119
- a("span", { class: "text-sm font-bold" }, "Transfer Log")
120
- ], -1)),
121
118
  a("div", J, [
119
+ a("span", Q, c(e.$t("Transfer Log")), 1)
120
+ ]),
121
+ a("div", X, [
122
122
  r(A, {
123
- disabled: h.value,
124
- onClick: e[0] || (e[0] = (s) => N("prev")),
123
+ disabled: w.value,
124
+ onClick: t[0] || (t[0] = (s) => T("prev")),
125
125
  class: "!p-0 !m-0 !h-auto !focus:ring-[0px] !dark:focus:ring-[0px] !ring-0",
126
126
  label: "<Prev",
127
127
  text: ""
128
128
  }, null, 8, ["disabled"]),
129
129
  r(A, {
130
- disabled: $.value,
131
- onClick: e[1] || (e[1] = (s) => N("next")),
130
+ disabled: j.value,
131
+ onClick: t[1] || (t[1] = (s) => T("next")),
132
132
  class: "!p-0 !m-0 !h-auto !focus:ring-[0px] !dark:focus:ring-[0px] !ring-0",
133
133
  label: "Next>",
134
134
  text: ""
@@ -136,21 +136,21 @@ const z = { class: "w-full flex items-center justify-between pr-4" }, J = { clas
136
136
  ])
137
137
  ])
138
138
  ]),
139
- default: b(() => {
140
- var s, c, f;
139
+ default: y(() => {
140
+ var s, f, v;
141
141
  return [
142
- n.value ? (i(), m("div", Q, [
143
- (i(), x(W, {
142
+ n.value ? (i(), p("div", Y, [
143
+ (i(), g(W, {
144
144
  id: n.value.asset,
145
145
  key: n.value.asset,
146
146
  fields: ["brand", "model", "group"],
147
147
  "use-nfc": !1,
148
148
  "use-tag-type": !1
149
149
  }, null, 8, ["id"])),
150
- a("div", X, [
151
- a("div", Y, [
152
- a("div", P, [
153
- e[4] || (e[4] = a("span", null, "Origin:", -1)),
150
+ a("div", P, [
151
+ a("div", ee, [
152
+ a("div", te, [
153
+ a("span", null, c(e.$t("Origin")) + ":", 1),
154
154
  r(d, {
155
155
  label: (s = n.value.originGroup) == null ? void 0 : s.name
156
156
  }, null, 8, ["label"])
@@ -158,19 +158,19 @@ const z = { class: "w-full flex items-center justify-between pr-4" }, J = { clas
158
158
  r(Z, {
159
159
  user: {
160
160
  ...n.value.manager,
161
- fullName: (c = n.value.manager) == null ? void 0 : c.fullName
161
+ fullName: (f = n.value.manager) == null ? void 0 : f.fullName
162
162
  }
163
163
  }, null, 8, ["user"])
164
164
  ]),
165
- a("div", ee, [
166
- e[5] || (e[5] = a("span", null, "Destination:", -1)),
165
+ a("div", ae, [
166
+ a("span", null, c(e.$t("Destination")) + ":", 1),
167
167
  r(d, {
168
- label: (f = n.value.destinationGroup) == null ? void 0 : f.name
168
+ label: (v = n.value.destinationGroup) == null ? void 0 : v.name
169
169
  }, null, 8, ["label"])
170
170
  ])
171
171
  ]),
172
- a("div", te, [
173
- e[6] || (e[6] = a("span", null, "Status:", -1)),
172
+ a("div", se, [
173
+ a("span", null, c(e.$t("Status")) + ":", 1),
174
174
  r(d, {
175
175
  label: n.value.status,
176
176
  severity: G(n.value.status),
@@ -182,19 +182,19 @@ const z = { class: "w-full flex items-center justify-between pr-4" }, J = { clas
182
182
  menu: [{ label: "Transfer Log" }],
183
183
  type: "tab"
184
184
  }),
185
- (i(), x(U, {
186
- key: w.value,
185
+ (i(), g(U, {
186
+ key: $.value,
187
187
  value: D.value
188
188
  }, {
189
- detail: b((l) => [
190
- l.key === "To" ? (i(), m("div", ae, [
191
- e[7] || (e[7] = a("span", { class: "text-xs font-medium text-general-400 dark:text-general-200" }, " Destination Group: ", -1)),
189
+ detail: y((l) => [
190
+ l.key === "To" ? (i(), p("div", le, [
191
+ a("span", ne, c(e.$t("Destination Group")) + ": ", 1),
192
192
  r(d, {
193
193
  label: l.value
194
194
  }, null, 8, ["label"])
195
- ])) : l.key === "From" ? (i(), m("div", se, [
196
- a("div", le, [
197
- e[8] || (e[8] = a("span", { class: "text-xs font-medium text-general-400 dark:text-general-200" }, " Destination Group: ", -1)),
195
+ ])) : l.key === "From" ? (i(), p("div", re, [
196
+ a("div", ie, [
197
+ a("span", oe, c(e.$t("Destination Group")) + ": ", 1),
198
198
  r(d, {
199
199
  label: l.value
200
200
  }, null, 8, ["label"])
@@ -203,12 +203,12 @@ const z = { class: "w-full flex items-center justify-between pr-4" }, J = { clas
203
203
  class: "!text-general-800 dark:!text-general-400 !text-xs -rotate-90",
204
204
  icon: "arrow-left"
205
205
  })
206
- ])) : (i(), m("div", ne, [
207
- a("span", re, L(l.key) + ": ", 1),
208
- l.key.includes("Group") ? (i(), x(d, {
206
+ ])) : (i(), p("div", ue, [
207
+ a("span", ce, c(e.$t(l.key)) + ": ", 1),
208
+ l.key.includes("Group") ? (i(), g(d, {
209
209
  key: 0,
210
210
  label: l.value
211
- }, null, 8, ["label"])) : (i(), m("span", ie, L(l.value), 1))
211
+ }, null, 8, ["label"])) : (i(), p("span", de, c(l.value), 1))
212
212
  ]))
213
213
  ]),
214
214
  _: 1
@@ -221,5 +221,5 @@ const z = { class: "w-full flex items-center justify-between pr-4" }, J = { clas
221
221
  }
222
222
  });
223
223
  export {
224
- be as _
224
+ $e as _
225
225
  };