@fewangsit/wangsvue-fats 1.0.1-alpha.47 → 1.0.1-alpha.49

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.
@@ -1,22 +1,23 @@
1
- import { defineComponent as ge, mergeModels as ee, useModel as xe, ref as m, computed as te, watch as be, createBlock as p, openBlock as r, withCtx as g, createElementVNode as t, createVNode as n, createCommentVNode as x, toDisplayString as u, createElementBlock as se, unref as _e, Fragment as ye, normalizeClass as b } from "vue";
2
- import { t as he } from "../vendor/single-spa/lib/es2015/esm/single-spa.min.es.js";
3
- import { DamageServices as we } from "@tagsamurai/fats-api-services";
4
- import { u as De } from "../assetinfo/index.es.js";
5
- import { a as Ie } from "../utils/role.util.es.js";
6
- import { u as ke } from "../utils/toast.util.es.js";
7
- import { _ as v } from "../badge/index.es.js";
8
- import { _ as qe } from "../dialog/index.es.js";
9
- import { _ as ae } from "../image/index.es.js";
10
- import { _ as Re } from "../tabmenu/index.es.js";
11
- import { _ as Ce } from "../tagtype/index.es.js";
12
- import { _ as Le } from "../timeline/index.es.js";
13
- const Ne = { class: "w-full flex items-center justify-between" }, Se = { class: "flex items-center gap-2" }, $e = ["disabled"], Be = ["disabled"], Me = { class: "flex items-start gap-[18px]" }, Pe = { class: "flex flex-col w-full" }, Te = { class: "w-full flex items-center justify-between" }, Ve = { class: "text-body-medium !font-bold" }, Ae = { class: "flex items-center gap-[6px] text-general-400" }, je = { class: "flex gap-3 w-full mt-[6px]" }, Ee = { class: "flex flex-col gap-1 items-start self-stretch" }, ze = { class: "flex gap-2" }, Fe = ["data-wv-section"], Ge = {
1
+ import { defineComponent as xe, mergeModels as ee, useModel as be, ref as c, computed as te, watch as _e, createBlock as p, openBlock as n, withCtx as v, createElementVNode as t, createVNode as i, createCommentVNode as x, toDisplayString as u, createElementBlock as se, unref as ae, Fragment as ye, createTextVNode as he, normalizeClass as b } from "vue";
2
+ import { t as we } from "../vendor/single-spa/lib/es2015/esm/single-spa.min.es.js";
3
+ import { DamageServices as De } from "@tagsamurai/fats-api-services";
4
+ import { u as Ie } from "../assetinfo/index.es.js";
5
+ import { a as ke } from "../utils/role.util.es.js";
6
+ import { f as qe } from "../utils/date.util.es.js";
7
+ import { u as Re } from "../utils/toast.util.es.js";
8
+ import { _ as f } from "../badge/index.es.js";
9
+ import { _ as Ne } from "../dialog/index.es.js";
10
+ import { _ as oe } from "../image/index.es.js";
11
+ import { _ as Ce } from "../tabmenu/index.es.js";
12
+ import { _ as Le } from "../tagtype/index.es.js";
13
+ import { _ as Se } from "../timeline/index.es.js";
14
+ const $e = { class: "w-full flex items-center justify-between" }, Be = { class: "flex items-center gap-2" }, Te = ["disabled"], Me = ["disabled"], Pe = { class: "flex items-start gap-[18px]" }, Ve = { class: "flex flex-col w-full" }, Ae = { class: "w-full flex items-center justify-between" }, je = { class: "text-body-medium !font-bold" }, Ee = { class: "flex items-center gap-[6px] text-general-400" }, ze = { class: "flex gap-3 w-full mt-[6px]" }, Fe = { class: "flex flex-col gap-1 items-start self-stretch" }, Ge = { class: "flex gap-2" }, Ue = ["data-wv-section"], Ke = {
14
15
  class: "text-body-medium text-general-400",
15
16
  "data-wv-section": "key"
16
- }, Ue = {
17
+ }, We = {
17
18
  key: 1,
18
19
  class: "text-body-medium"
19
- }, at = /* @__PURE__ */ ge({
20
+ }, rt = /* @__PURE__ */ xe({
20
21
  __name: "DialogDamageLog",
21
22
  props: /* @__PURE__ */ ee({
22
23
  id: {},
@@ -26,12 +27,12 @@ const Ne = { class: "w-full flex items-center justify-between" }, Se = { class:
26
27
  modelModifiers: {}
27
28
  }),
28
29
  emits: /* @__PURE__ */ ee(["prev", "next"], ["update:modelValue"]),
29
- setup(_, { emit: oe }) {
30
- const y = _, h = oe, w = xe(_, "modelValue"), le = ke(), { setLoading: D } = De(), a = m(), l = m(0), I = m(0), i = te(() => y.listId), re = [
30
+ setup(_, { emit: le }) {
31
+ const y = _, h = le, w = be(_, "modelValue"), re = Re(), { setLoading: D } = Ie(), a = c(), l = c(0), I = c(0), d = te(() => y.listId), ne = [
31
32
  {
32
33
  label: "Damage Log"
33
34
  }
34
- ], f = m([]), ne = te(() => {
35
+ ], g = c([]), ie = te(() => {
35
36
  var s, e;
36
37
  switch ((e = (s = a.value) == null ? void 0 : s.request) == null ? void 0 : e.status) {
37
38
  case "Damaged":
@@ -41,23 +42,23 @@ const Ne = { class: "w-full flex items-center justify-between" }, Se = { class:
41
42
  default:
42
43
  return "dark";
43
44
  }
44
- }), ie = async (s) => (me(s), await k(l.value)), k = async (s) => {
45
+ }), ue = async (s) => (pe(s), await k(l.value)), k = async (s) => {
45
46
  var e;
46
47
  try {
47
48
  D(!0);
48
- const { data: o } = await we.getDamageReportDetail(
49
- i.value[s]
49
+ const { data: o } = await De.getDamageReportDetail(
50
+ d.value[s]
50
51
  );
51
- a.value = o.data, f.value = ce((e = a.value) == null ? void 0 : e.logs), I.value++;
52
+ a.value = o.data, g.value = ce((e = a.value) == null ? void 0 : e.logs), I.value++;
52
53
  } catch (o) {
53
- le.add({
54
+ re.add({
54
55
  error: o,
55
56
  message: "Error, failed to fetch damage detail."
56
57
  });
57
58
  } finally {
58
59
  D(!1);
59
60
  }
60
- }, ue = (s) => {
61
+ }, de = (s) => {
61
62
  switch (s) {
62
63
  case "Reported Damaged":
63
64
  return "Reported damaged by";
@@ -74,7 +75,7 @@ const Ne = { class: "w-full flex items-center justify-between" }, Se = { class:
74
75
  default:
75
76
  return "";
76
77
  }
77
- }, de = (s, e) => {
78
+ }, me = (s, e) => {
78
79
  switch (s) {
79
80
  case "Reported Damaged":
80
81
  return {
@@ -89,86 +90,86 @@ const Ne = { class: "w-full flex items-center justify-between" }, Se = { class:
89
90
  }
90
91
  }, ce = (s) => s.map((e) => ({
91
92
  _id: e._id,
92
- action: ue(e.action),
93
+ action: de(e.action),
93
94
  date: e.createdAt,
94
95
  username: e.userFullName,
95
96
  danger: !1,
96
- detail: de(e.action, e.detail),
97
+ detail: me(e.action, e.detail),
97
98
  createdAt: e.createdAt
98
- })), me = (s) => {
99
+ })), pe = (s) => {
99
100
  var o;
100
- const e = (o = y.listId) == null ? void 0 : o.findIndex((d) => d === s);
101
+ const e = (o = y.listId) == null ? void 0 : o.findIndex((m) => m === s);
101
102
  l.value = e;
102
- }, pe = () => {
103
- l.value++, h("next", l.value);
104
103
  }, ve = () => {
105
- l.value--, h("prev", l.value);
104
+ l.value++, h("next", l.value);
106
105
  }, fe = () => {
106
+ l.value--, h("prev", l.value);
107
+ }, ge = () => {
107
108
  var s, e;
108
- he(`/assets/detail/${(e = (s = a.value) == null ? void 0 : s.request) == null ? void 0 : e.asset}`);
109
+ we(`/assets/detail/${(e = (s = a.value) == null ? void 0 : s.request) == null ? void 0 : e.asset}`);
109
110
  };
110
- return be(
111
+ return _e(
111
112
  () => l.value,
112
113
  (s) => {
113
114
  k(s);
114
115
  }
115
- ), (s, e) => (r(), p(qe, {
116
+ ), (s, e) => (n(), p(Ne, {
116
117
  visible: w.value,
117
118
  "onUpdate:visible": e[0] || (e[0] = (o) => w.value = o),
118
- onShow: e[1] || (e[1] = (o) => ie(s.id)),
119
+ onShow: e[1] || (e[1] = (o) => ue(s.id)),
119
120
  class: "w-[600px]",
120
121
  modal: ""
121
122
  }, {
122
- header: g(() => [
123
- t("div", Ne, [
123
+ header: v(() => [
124
+ t("div", $e, [
124
125
  e[2] || (e[2] = t("h1", { class: "!text-base font-bold" }, "Damage Log", -1)),
125
- t("div", Se, [
126
+ t("div", Be, [
126
127
  t("button", {
127
128
  class: b([l.value === 0 ? "text-general-100" : "text-primary", "text-xs font-medium"]),
128
129
  disabled: l.value === 0,
129
- onClick: ve,
130
+ onClick: fe,
130
131
  "data-wv-section": "prev-button"
131
- }, " <Prev ", 10, $e),
132
+ }, " <Prev ", 10, Te),
132
133
  t("button", {
133
134
  class: b([
134
- l.value === i.value.length - 1 || i.value.length === 1 ? "text-general-100" : "text-primary",
135
+ l.value === d.value.length - 1 || d.value.length === 1 ? "text-general-100" : "text-primary",
135
136
  "text-xs font-medium"
136
137
  ]),
137
- disabled: l.value === i.value.length - 1 || i.value.length === 1,
138
- onClick: pe,
138
+ disabled: l.value === d.value.length - 1 || d.value.length === 1,
139
+ onClick: ve,
139
140
  "data-wv-section": "next-button"
140
- }, " Next> ", 10, Be)
141
+ }, " Next> ", 10, Me)
141
142
  ])
142
143
  ])
143
144
  ]),
144
- default: g(() => {
145
- var o, d, q, R, C, L, N, S, $, B, M, P, T, V, A, j, E, z, F, G, U, K, W, H, J, O, Q, X, Y;
145
+ default: v(() => {
146
+ var o, m, q, R, N, C, L, S, $, B, T, M, P, V, A, j, E, z, F, G, U, K, W, H, J, O, Q, X, Y;
146
147
  return [
147
- t("div", Me, [
148
- n(ae, {
149
- src: (d = (o = a.value) == null ? void 0 : o.request) == null ? void 0 : d.assetImageBig,
148
+ t("div", Pe, [
149
+ i(oe, {
150
+ src: (m = (o = a.value) == null ? void 0 : o.request) == null ? void 0 : m.assetImageBig,
150
151
  size: "big"
151
152
  }, null, 8, ["src"]),
152
- t("div", Pe, [
153
- t("div", Te, [
154
- t("p", Ve, u((C = (R = (q = a.value) == null ? void 0 : q.request) == null ? void 0 : R.assetName) == null ? void 0 : C.nameWithSequence), 1),
153
+ t("div", Ve, [
154
+ t("div", Ae, [
155
+ t("p", je, u((N = (R = (q = a.value) == null ? void 0 : q.request) == null ? void 0 : R.assetName) == null ? void 0 : N.nameWithSequence), 1),
155
156
  t("button", {
156
- onClick: fe,
157
+ onClick: ge,
157
158
  class: "!text-xs font-medium !text-primary-500",
158
159
  "data-wv-section": "detail-button"
159
160
  }, " Asset Detail > ")
160
161
  ]),
161
- t("div", Ae, [
162
- t("p", null, u(((N = (L = a.value) == null ? void 0 : L.request) == null ? void 0 : N.assetId) ?? "-") + " " + u((M = (B = ($ = (S = a.value) == null ? void 0 : S.request) == null ? void 0 : $.assetName) == null ? void 0 : B.aliasCode) != null && M.length ? `(${(V = (T = (P = a.value) == null ? void 0 : P.request) == null ? void 0 : T.assetName) == null ? void 0 : V.aliasCode})` : ""), 1),
163
- _e(Ie)() === "Enterprise" ? (r(), se(ye, { key: 0 }, [
162
+ t("div", Ee, [
163
+ t("p", null, u(((L = (C = a.value) == null ? void 0 : C.request) == null ? void 0 : L.assetId) ?? "-") + " " + u((T = (B = ($ = (S = a.value) == null ? void 0 : S.request) == null ? void 0 : $.assetName) == null ? void 0 : B.aliasCode) != null && T.length ? `(${(V = (P = (M = a.value) == null ? void 0 : M.request) == null ? void 0 : P.assetName) == null ? void 0 : V.aliasCode})` : ""), 1),
164
+ ae(ke)() === "Enterprise" ? (n(), se(ye, { key: 0 }, [
164
165
  e[3] || (e[3] = t("div", { class: "w-[6px] h-[6px] bg-general-100 rounded" }, null, -1)),
165
- (j = (A = a.value) == null ? void 0 : A.request) != null && j.tagType ? (r(), p(Ce, {
166
+ (j = (A = a.value) == null ? void 0 : A.request) != null && j.tagType ? (n(), p(Le, {
166
167
  key: 0,
167
168
  type: (z = (E = a.value) == null ? void 0 : E.request) == null ? void 0 : z.tagType
168
169
  }, null, 8, ["type"])) : x("", !0)
169
170
  ], 64)) : x("", !0)
170
171
  ]),
171
- t("div", je, [
172
+ t("div", ze, [
172
173
  e[4] || (e[4] = t("div", { class: "flex flex-col justify-between items-start self-stretch" }, [
173
174
  t("p", null, "Brand"),
174
175
  t("p", null, "Model/Type"),
@@ -179,18 +180,18 @@ const Ne = { class: "w-full flex items-center justify-between" }, Se = { class:
179
180
  t("p", null, ":"),
180
181
  t("p", null, ":")
181
182
  ], -1)),
182
- t("div", Ee, [
183
- n(v, {
183
+ t("div", Fe, [
184
+ i(f, {
184
185
  label: (U = (G = (F = a.value) == null ? void 0 : F.request) == null ? void 0 : G.assetBrand) == null ? void 0 : U.name,
185
186
  format: "nowrap",
186
187
  severity: "dark"
187
188
  }, null, 8, ["label"]),
188
- n(v, {
189
+ i(f, {
189
190
  label: (H = (W = (K = a.value) == null ? void 0 : K.request) == null ? void 0 : W.assetModel) == null ? void 0 : H.name,
190
191
  format: "nowrap",
191
192
  severity: "dark"
192
193
  }, null, 8, ["label"]),
193
- n(v, {
194
+ i(f, {
194
195
  label: (Q = (O = (J = a.value) == null ? void 0 : J.request) == null ? void 0 : O.assetGroup) == null ? void 0 : Q.name,
195
196
  format: "nowrap",
196
197
  severity: "primary"
@@ -199,38 +200,41 @@ const Ne = { class: "w-full flex items-center justify-between" }, Se = { class:
199
200
  ])
200
201
  ])
201
202
  ]),
202
- t("div", ze, [
203
+ t("div", Ge, [
203
204
  e[6] || (e[6] = t("p", { class: "text-xs font-medium tracking-tight" }, "Status:", -1)),
204
- n(v, {
205
+ i(f, {
205
206
  label: (Y = (X = a.value) == null ? void 0 : X.request) == null ? void 0 : Y.status,
206
- severity: ne.value,
207
+ severity: ie.value,
207
208
  format: "nowrap"
208
209
  }, null, 8, ["label", "severity"])
209
210
  ]),
210
- n(Re, {
211
+ i(Ce, {
211
212
  "active-index": 0,
212
- menu: re,
213
+ menu: ne,
213
214
  type: "tab"
214
215
  }),
215
- f.value.length ? (r(), p(Le, {
216
+ g.value.length ? (n(), p(Se, {
216
217
  key: I.value,
217
- value: f.value
218
+ value: g.value
218
219
  }, {
219
- detail: g(({ key: c, value: Z }) => [
220
+ detail: v(({ key: r, value: Z }) => [
220
221
  t("div", {
221
222
  class: b([
222
223
  "flex gap-1 items-baseline",
223
- { "flex-col": c === "Damaged Photo" }
224
+ { "flex-col": r === "Damaged Photo" }
224
225
  ]),
225
- "data-wv-section": c
226
+ "data-wv-section": r
226
227
  }, [
227
- t("span", Ge, u(c) + ": ", 1),
228
- c === "Damaged Photo" ? (r(), p(ae, {
228
+ t("span", Ke, u(r) + ": ", 1),
229
+ r === "Damaged Photo" ? (n(), p(oe, {
229
230
  key: 0,
230
231
  src: Z,
231
232
  width: 36
232
- }, null, 8, ["src"])) : (r(), se("span", Ue, u(Z), 1))
233
- ], 10, Fe)
233
+ }, null, 8, ["src"])) : (n(), se("span", We, u(Z), 1))
234
+ ], 10, Ue)
235
+ ]),
236
+ date: v(({ date: r }) => [
237
+ he(u(ae(qe)(new Date(r), { showTime: !0 })), 1)
234
238
  ]),
235
239
  _: 1
236
240
  }, 8, ["value"])) : x("", !0)
@@ -241,5 +245,5 @@ const Ne = { class: "w-full flex items-center justify-between" }, Se = { class:
241
245
  }
242
246
  });
243
247
  export {
244
- at as _
248
+ rt as _
245
249
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fewangsit/wangsvue-fats",
3
- "version": "1.0.1-alpha.47",
3
+ "version": "1.0.1-alpha.49",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",