@fewangsit/wangsvue-fats 1.0.1-alpha.21 → 1.0.1-alpha.23

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
  };
@@ -153,7 +153,7 @@ export interface ButtonScanProps extends Omit<ButtonProps, 'type'> {
153
153
  /**
154
154
  * Defines the size of the button.
155
155
  *
156
- * @default to large
156
+ * @default to undefined / normal
157
157
  */
158
158
  size?: 'small' | 'large';
159
159
  }
@@ -1,11 +1,11 @@
1
1
  import { AxiosError as ye } from "axios";
2
- import { ref as re, defineComponent as _e, onBeforeUnmount as Re, shallowRef as v, computed as E, createElementBlock as D, openBlock as u, Fragment as F, createVNode as b, createBlock as M, createCommentVNode as U, mergeProps as De, withCtx as ke, createElementVNode as C, normalizeClass as ee, createTextVNode as se, toDisplayString as A, Teleport as Ne } from "vue";
2
+ import { ref as re, defineComponent as Re, onBeforeUnmount as _e, shallowRef as v, computed as E, createElementBlock as D, openBlock as u, Fragment as F, createVNode as b, createBlock as M, createCommentVNode as U, mergeProps as De, withCtx as ke, createElementVNode as C, normalizeClass as ee, createTextVNode as se, toDisplayString as j, Teleport as Ne } from "vue";
3
3
  import { ChangelogServices as he } from "@tagsamurai/fats-api-services";
4
4
  import { u as Ie } from "../utils/baseToast.util.es.js";
5
5
  import { _ as ne } from "../button/index.es.js";
6
6
  import { _ as Ee } from "../dialogconfirm/index.es.js";
7
7
  import { _ as Ce } from "../hardwaresync/index.es.js";
8
- import { _ as $ } from "../icon/index.es.js";
8
+ import { _ as A } from "../icon/index.es.js";
9
9
  import { _ as z } from "../toast/index.es.js";
10
10
  import { v as J } from "../vendor/uuid/dist/esm-browser/v4.es.js";
11
11
  const Oe = (a) => {
@@ -56,7 +56,7 @@ const ie = () => window.devices ?? [], xe = () => window.device ?? { RFID: null,
56
56
  }, Le = { class: "flex gap-2 items-center" }, We = { class: "flex gap-0.5 items-center leading-4" }, Fe = { class: "flex gap-5 items-center" }, Me = {
57
57
  key: 1,
58
58
  class: "text-xs font-medium leading-[16.39px] tracking-[0.02em]"
59
- }, He = /* @__PURE__ */ _e({
59
+ }, He = /* @__PURE__ */ Re({
60
60
  __name: "ButtonScan",
61
61
  props: {
62
62
  label: {},
@@ -93,7 +93,7 @@ const ie = () => window.devices ?? [], xe = () => window.device ?? { RFID: null,
93
93
  emits: ["update:modelValue", "connect", "connected", "scan", "stop", "error", "beforeStartScan"],
94
94
  setup(a, { expose: l, emit: m }) {
95
95
  const s = a, r = m;
96
- Re(() => {
96
+ _e(() => {
97
97
  X();
98
98
  });
99
99
  const c = Ie(), { devices: le, device: S, saveDevices: ue, setDevice: G } = Be(), w = v(!1), O = v(!1), k = v(!1), N = v(!1), y = v(!1), V = v(!1), f = v(), H = v(0), o = v(s.type ?? "RFID"), P = [], T = E(
@@ -133,11 +133,11 @@ const ie = () => window.devices ?? [], xe = () => window.device ?? { RFID: null,
133
133
  }, 0);
134
134
  };
135
135
  window.scannerWorker.onmessage = ({ data: n }) => {
136
- var _;
136
+ var R;
137
137
  if (n.status === "connection_established")
138
138
  try {
139
- const { error: p } = (n == null ? void 0 : n.data) ?? {}, i = ((_ = n == null ? void 0 : n.data) == null ? void 0 : _.deviceList) ?? [], R = S.value[s.type], d = i.some(
140
- (W) => W.serialNumber === (R == null ? void 0 : R.serialNumber)
139
+ const { error: p } = (n == null ? void 0 : n.data) ?? {}, i = ((R = n == null ? void 0 : n.data) == null ? void 0 : R.deviceList) ?? [], _ = S.value[s.type], d = i.some(
140
+ (W) => W.serialNumber === (_ == null ? void 0 : _.serialNumber)
141
141
  );
142
142
  if (i.length && d)
143
143
  t();
@@ -164,13 +164,13 @@ const ie = () => window.devices ?? [], xe = () => window.device ?? { RFID: null,
164
164
  Y(t);
165
165
  }
166
166
  }, Q = (e = !1, t = !1) => {
167
- var _;
167
+ var R;
168
168
  V.value = !1, c.removeGroup(g.value), localStorage.devmode || (window.addEventListener("blur", L), window.addEventListener("beforeunload", L));
169
169
  const n = S.value[o.value];
170
170
  if (n) {
171
171
  let p = "";
172
172
  s.bulk ? p = `bulkscan-${o.value.toLowerCase()}` : p = `scan-${o.value.toLowerCase()}`, window.scannerWorker.onmessage = async ({ data: i }) => {
173
- var R;
173
+ var _;
174
174
  if (i.status === "scan_started")
175
175
  t || (H.value++, setTimeout(() => {
176
176
  c.add({
@@ -187,13 +187,13 @@ const ie = () => window.devices ?? [], xe = () => window.device ?? { RFID: null,
187
187
  if (d) {
188
188
  if (["scan-rfid", "scan-qr"].includes(p)) {
189
189
  y.value = !!s.scanValidation;
190
- const j = await ((R = s.scanValidation) == null ? void 0 : R.call(
190
+ const $ = await ((_ = s.scanValidation) == null ? void 0 : _.call(
191
191
  s,
192
192
  o.value,
193
193
  d,
194
194
  x()
195
195
  )) ?? !0;
196
- if (y.value = !1, j)
196
+ if (y.value = !1, $)
197
197
  s.autoSwitch ? (K(), fe()) : h(!0);
198
198
  else {
199
199
  V.value || Q(!1, !0);
@@ -206,8 +206,8 @@ const ie = () => window.devices ?? [], xe = () => window.device ?? { RFID: null,
206
206
  tag: d,
207
207
  serialNumber: x()
208
208
  });
209
- } catch (j) {
210
- console.error(j);
209
+ } catch ($) {
210
+ console.error($);
211
211
  }
212
212
  r("update:modelValue", d), r("scan", d, x()), s.bulk && P.push(d);
213
213
  }
@@ -216,7 +216,7 @@ const ie = () => window.devices ?? [], xe = () => window.device ?? { RFID: null,
216
216
  }, window.scannerWorker.onerror = Z, window.scannerWorker.postMessage({
217
217
  command: "scan",
218
218
  scanCommand: p,
219
- userId: (_ = JSON.parse(localStorage.getItem("user") ?? "{}")) == null ? void 0 : _._id,
219
+ userId: (R = JSON.parse(localStorage.getItem("user") ?? "{}")) == null ? void 0 : R._id,
220
220
  source: "app",
221
221
  jenisDevice: n.jenisDevice,
222
222
  serialNumber: n.serialNumber,
@@ -308,7 +308,8 @@ const ie = () => window.devices ?? [], xe = () => window.device ?? { RFID: null,
308
308
  "[&_i]:w-2 [&_i]:h-2": e.type === "QR",
309
309
  "[&_i]:w-[11px] [&_i]:h-[7px]": e.type === "RFID"
310
310
  },
311
- "!px-1.5"
311
+ "!px-1.5",
312
+ s.class || e.$attrs.class
312
313
  ],
313
314
  disabled: s.disabled,
314
315
  icon: be.value,
@@ -352,35 +353,35 @@ const ie = () => window.devices ?? [], xe = () => window.device ?? { RFID: null,
352
353
  }, [
353
354
  n.detail === "scanning" ? (u(), D(F, { key: 0 }, [
354
355
  C("section", Le, [
355
- b($, {
356
+ b(A, {
356
357
  class: "animate-spin text-base",
357
358
  icon: "loader-4"
358
359
  }),
359
360
  C("span", We, [
360
361
  o.value === "RFID" ? (u(), D(F, { key: 0 }, [
361
- b($, {
362
+ b(A, {
362
363
  class: "text-base !w-4 !h-4",
363
364
  icon: "rfid"
364
365
  }),
365
- se(" " + A(y.value ? "Validating RFID..." : "RFID Scanning..."), 1)
366
+ se(" " + j(y.value ? "Validating RFID..." : "RFID Scanning..."), 1)
366
367
  ], 64)) : (u(), D(F, { key: 1 }, [
367
- b($, {
368
+ b(A, {
368
369
  class: "text-sm",
369
370
  icon: "qr"
370
371
  }),
371
- se(" " + A(y.value ? "Validating QR..." : "QR Scanning..."), 1)
372
+ se(" " + j(y.value ? "Validating QR..." : "QR Scanning..."), 1)
372
373
  ], 64))
373
374
  ])
374
375
  ]),
375
376
  C("section", Fe, [
376
377
  t[4] || (t[4] = C("span", null, "do not leave this page", -1)),
377
378
  b(ne, {
378
- onClick: t[1] || (t[1] = (_) => I(!0)),
379
+ onClick: t[1] || (t[1] = (R) => I(!0)),
379
380
  label: "Stop Scan",
380
381
  severity: "danger"
381
382
  })
382
383
  ])
383
- ], 64)) : (u(), D("span", Me, A(n.detail), 1))
384
+ ], 64)) : (u(), D("span", Me, j(n.detail), 1))
384
385
  ], 2)
385
386
  ]),
386
387
  _: 1
@@ -733,6 +733,13 @@ export type TreeTableEmits = BaseDataTableEmits & {
733
733
 
734
734
  export type DataTableEmits = TreeTableEmits;
735
735
 
736
+ export type DataTableSlots = {
737
+ /**
738
+ * Slot for rendering sub content below a table row.
739
+ */
740
+ 'row-subcontent': (props: { item: Data }) => any;
741
+ };
742
+
736
743
  /**
737
744
  * **WangsVue - DataTable**
738
745
  *
@@ -746,7 +753,7 @@ export type DataTableEmits = TreeTableEmits;
746
753
  */
747
754
  declare class DataTable extends ClassComponent<
748
755
  DataTableProps,
749
- Record<string, unknown>,
756
+ DataTableSlots,
750
757
  DataTableEmits
751
758
  > {}
752
759