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

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,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
  {
@@ -71,12 +70,12 @@ const Y = {
71
70
  header: "Photo",
72
71
  style: "min-width: 72px",
73
72
  fixed: !0,
74
- sortable: !0,
73
+ sortable: !1,
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.44",
4
4
  "author": "Wangsit FE Developer",
5
5
  "description": "Fixed Asset Tagsamurai VueJS Component Library",
6
6
  "type": "module",