@fewangsit/wangsvue-fats 1.0.1-alpha.62 → 1.0.1-alpha.63
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.
- package/basetree/index.d.ts +6 -2
- package/basetree/index.es.js +1 -1
- package/buttonscan/index.es.js +207 -204
- package/buttonselecttree/index.d.ts +5 -5
- package/buttonselecttree/index.es.js +9 -9
- package/datatable/index.d.ts +1 -1
- package/dialogselecttree/index.d.ts +5 -5
- package/filtercontainer/index.d.ts +2 -2
- package/hardwaresync/index.es.js +54 -53
- package/icon/index.d.ts +1 -0
- package/package.json +1 -1
- package/stats.html +1 -1
- package/timeline/index.d.ts +6 -1
- package/timeline/index.es.js +31 -26
- package/tree/index.d.ts +4 -4
- package/tree/index.es.js +2 -2
- package/treenode/index.es.js +22 -22
- package/vendor/@wangs-ui/core/components/{p-CKYwZoTo.es.js → p-C0QfdhKo.es.js} +1 -1
- package/vendor/@wangs-ui/core/components/{p-DPHEi31J.es.js → p-CRgC2JIi.es.js} +19 -14
- package/vendor/@wangs-ui/core/components/{p-CsoK-EWG.es.js → p-b33NVvKu.es.js} +12 -12
- package/vendor/@wangs-ui/core/components/wangs-button.es.js +5 -5
- package/vendor/@wangs-ui/core/components/wangs-icon.es.js +1 -1
- package/vendor/@wangs-ui/core/components/wangs-input-otp.es.js +1 -1
- package/vendor/@wangs-ui/core/components/wangs-tab-menu.es.js +1 -1
- package/wangsvue-fats.esm.browser.js +2286 -2272
- package/wangsvue-fats.system.js +45 -45
package/basetree/index.d.ts
CHANGED
|
@@ -36,6 +36,10 @@ export interface TreeNode {
|
|
|
36
36
|
* Mandatory unique key of the node.
|
|
37
37
|
*/
|
|
38
38
|
key: string | number;
|
|
39
|
+
/**
|
|
40
|
+
* The API response might give id instead of key, in which case it needs to be assigned to the key
|
|
41
|
+
*/
|
|
42
|
+
_id?: string | number;
|
|
39
43
|
/**
|
|
40
44
|
* Label of the node.
|
|
41
45
|
*/
|
|
@@ -300,9 +304,9 @@ export interface TreeContext {
|
|
|
300
304
|
* Defines valid properties in Tree component.
|
|
301
305
|
*/
|
|
302
306
|
export interface BaseTreeProps {
|
|
303
|
-
disableKeys?: number[];
|
|
307
|
+
disableKeys?: string[] | number[];
|
|
304
308
|
disableNodeAll?: boolean;
|
|
305
|
-
exactDisableKeys?: number[];
|
|
309
|
+
exactDisableKeys?: string[] | number[];
|
|
306
310
|
level?: number;
|
|
307
311
|
/**
|
|
308
312
|
* List of labels that has no menu option
|
package/basetree/index.es.js
CHANGED
|
@@ -135,7 +135,7 @@ const Y = ["id"], Z = ["aria-label", "aria-labelledby"], te = /* @__PURE__ */ V(
|
|
|
135
135
|
class: [...(k = (K = l.pt ?? u(c)) == null ? void 0 : K.node) == null ? void 0 : k.class],
|
|
136
136
|
"disable-keys": e.disableKeys,
|
|
137
137
|
"disable-node-all": l.disableNodeAll,
|
|
138
|
-
disabled: (M = e.disableKeys) == null ? void 0 : M.includes(
|
|
138
|
+
disabled: (M = e.disableKeys) == null ? void 0 : M.includes(r.key),
|
|
139
139
|
"exact-disable-keys": e.exactDisableKeys,
|
|
140
140
|
"expanded-keys": d.value,
|
|
141
141
|
index: T,
|
package/buttonscan/index.es.js
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
import { AxiosError as
|
|
2
|
-
import { ref as
|
|
3
|
-
import { ChangelogServices as
|
|
1
|
+
import { AxiosError as Re } from "axios";
|
|
2
|
+
import { ref as ce, defineComponent as _e, onBeforeUnmount as De, shallowRef as m, computed as E, createElementBlock as D, openBlock as d, Fragment as F, createVNode as b, createBlock as U, createCommentVNode as V, mergeProps as Ne, withCtx as ke, createElementVNode as O, normalizeClass as se, createTextVNode as ne, toDisplayString as A, Teleport as he } from "vue";
|
|
3
|
+
import { ChangelogServices as Ce } from "@tagsamurai/fats-api-services";
|
|
4
4
|
import { u as Ie } from "../utils/baseToast.util.es.js";
|
|
5
|
-
import { _ as
|
|
5
|
+
import { _ as oe } from "../button/index.es.js";
|
|
6
6
|
import { _ as Ee } from "../dialogconfirm/index.es.js";
|
|
7
|
-
import { _ as
|
|
8
|
-
import { _ as
|
|
7
|
+
import { _ as Oe } from "../hardwaresync/index.es.js";
|
|
8
|
+
import { _ as J } from "../icon/index.es.js";
|
|
9
9
|
import { _ as z } from "../toast/index.es.js";
|
|
10
|
-
import { v as
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
13
|
-
return
|
|
14
|
-
if (
|
|
15
|
-
|
|
10
|
+
import { v as G } from "../vendor/uuid/dist/esm-browser/v4.es.js";
|
|
11
|
+
const Te = (t) => {
|
|
12
|
+
if (t instanceof Re)
|
|
13
|
+
return t.response ? "DEVICE_NOT_CONNECTED" : "DRIVER_NOT_FOUND";
|
|
14
|
+
if (t instanceof Error && ["NOT_SUPPORTED_SYSTEM", "HARDWARE_NOT_SYNCHRONIZED"].includes(
|
|
15
|
+
t.message
|
|
16
16
|
))
|
|
17
|
-
return
|
|
18
|
-
},
|
|
19
|
-
`,
|
|
20
|
-
function
|
|
21
|
-
let
|
|
17
|
+
return t.message;
|
|
18
|
+
}, ie = `(function(){"use strict";let n=null,t=null,a,c,r="";self.onmessage=s=>{const e=s.data;switch(c=e.companyCode,e.command){case"sync":l(e);break;case"connect":g(e);break;case"scan":S(e);break;case"stopscan":p(e);break}};const d=s=>{let e="established";n&&n.readyState===WebSocket.OPEN?(e="reused",s.onopen(n,e),m(s.timeout)):n=new WebSocket("wss://dev-api.tagsamurai.com/rfid-reader-go/"),n.onopen=()=>{r=Math.random().toString(36).substring(2,15)+Math.random().toString(36).substring(2,15),e="established",n&&s.onopen(n,e),m(s.timeout)},n.onmessage=o=>{s.onmessage(o),m(s.timeout)},n.onerror=o=>{console.error("🚀 ~ Scanner Worker: openConnection ~ error:",o),s.onerror(o),n==null||n.close(),n=null,t&&clearTimeout(t)}},u=()=>{p({userId:a}),a=void 0,n&&n.close(),n=null,t&&clearTimeout(t),console.info("Socket connection has been closed!")},m=(s=0)=>{s&&(t&&clearTimeout(t),t=setTimeout(u,s))},l=({userId:s})=>{a=s,d({onopen:e=>{e.send(JSON.stringify({data:{command:"connect",userId:s,sessionId:r,companyCode:c,source:"app"},event:"reader"}))},onmessage:e=>{postMessage({status:"synced",...JSON.parse(e.data)})},onerror:e=>{postMessage({status:"sync_error",error:e})}})},g=({userId:s})=>{a=s,d({onopen:(e,o)=>{o==="established"?e.send(JSON.stringify({data:{command:"connect",userId:s,source:"app",sessionId:r,companyCode:c},event:"reader"})):postMessage({status:"connection_reused"})},onmessage:e=>{postMessage({status:"connection_established",...JSON.parse(e.data)})},onerror:e=>{postMessage({status:"error_connecting",error:e})}})},S=({scanCommand:s,userId:e,serialNumber:o,jenisDevice:f})=>{a=e,d({onopen:i=>{i.send(JSON.stringify({data:{command:s,userId:e,sessionId:r,companyCode:c,source:"app",serialNumber:o,jenisDevice:f},event:"reader"})),postMessage({status:"scan_started"})},onmessage:i=>{postMessage({status:"scanned",...JSON.parse(i.data)})},onerror:i=>{postMessage({status:"scan_error",error:i})}})},p=({userId:s})=>{n&&n.readyState===WebSocket.OPEN&&(n.send(JSON.stringify({data:{command:"stopscan",userId:s,source:"app",sessionId:r,companyCode:c},event:"reader"})),postMessage({status:"scan_stopped"}),console.info("Scan Process Stopped!"))}})();
|
|
19
|
+
`, ae = typeof self < "u" && self.Blob && new Blob([ie], { type: "text/javascript;charset=utf-8" });
|
|
20
|
+
function xe(t) {
|
|
21
|
+
let u;
|
|
22
22
|
try {
|
|
23
|
-
if (
|
|
24
|
-
const
|
|
25
|
-
name:
|
|
23
|
+
if (u = ae && (self.URL || self.webkitURL).createObjectURL(ae), !u) throw "";
|
|
24
|
+
const p = new Worker(u, {
|
|
25
|
+
name: t == null ? void 0 : t.name
|
|
26
26
|
});
|
|
27
|
-
return
|
|
28
|
-
(self.URL || self.webkitURL).revokeObjectURL(
|
|
29
|
-
}),
|
|
27
|
+
return p.addEventListener("error", () => {
|
|
28
|
+
(self.URL || self.webkitURL).revokeObjectURL(u);
|
|
29
|
+
}), p;
|
|
30
30
|
} catch {
|
|
31
31
|
return new Worker(
|
|
32
|
-
"data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
32
|
+
"data:text/javascript;charset=utf-8," + encodeURIComponent(ie),
|
|
33
33
|
{
|
|
34
|
-
name:
|
|
34
|
+
name: t == null ? void 0 : t.name
|
|
35
35
|
}
|
|
36
36
|
);
|
|
37
37
|
} finally {
|
|
38
|
-
|
|
38
|
+
u && (self.URL || self.webkitURL).revokeObjectURL(u);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
window.devices = s,
|
|
44
|
-
},
|
|
45
|
-
window.device = s,
|
|
46
|
-
},
|
|
47
|
-
|
|
41
|
+
const le = () => window.devices ?? [], Be = () => window.device ?? { RFID: null, QR: null }, te = ce(le()), re = ce(Be()), Le = () => {
|
|
42
|
+
const t = (s) => {
|
|
43
|
+
window.devices = s, p();
|
|
44
|
+
}, u = (s) => {
|
|
45
|
+
window.device = s, re.value = s;
|
|
46
|
+
}, p = () => {
|
|
47
|
+
te.value = le();
|
|
48
48
|
};
|
|
49
49
|
return {
|
|
50
|
-
devices:
|
|
51
|
-
device:
|
|
52
|
-
saveDevices:
|
|
53
|
-
setDevice:
|
|
54
|
-
loadDevices:
|
|
50
|
+
devices: te,
|
|
51
|
+
device: re,
|
|
52
|
+
saveDevices: t,
|
|
53
|
+
setDevice: u,
|
|
54
|
+
loadDevices: p
|
|
55
55
|
};
|
|
56
|
-
},
|
|
56
|
+
}, Me = { class: "flex gap-2 items-center" }, We = { class: "flex gap-0.5 items-center leading-4" }, Fe = { class: "flex gap-5 items-center" }, Ue = {
|
|
57
57
|
key: 1,
|
|
58
58
|
class: "text-xs font-medium leading-[16.39px] tracking-[0.02em]"
|
|
59
|
-
},
|
|
59
|
+
}, qe = /* @__PURE__ */ _e({
|
|
60
60
|
__name: "ButtonScan",
|
|
61
61
|
props: {
|
|
62
62
|
label: {},
|
|
@@ -91,218 +91,221 @@ const ie = () => window.devices ?? [], xe = () => window.device ?? { RFID: null,
|
|
|
91
91
|
plain: { type: Boolean }
|
|
92
92
|
},
|
|
93
93
|
emits: ["update:modelValue", "connect", "connected", "scan", "stop", "error", "beforeStartScan"],
|
|
94
|
-
setup(
|
|
95
|
-
const s =
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
setup(t, { expose: u, emit: p }) {
|
|
95
|
+
const s = t, c = p;
|
|
96
|
+
De(() => {
|
|
97
|
+
ee();
|
|
98
98
|
});
|
|
99
|
-
const
|
|
100
|
-
() =>
|
|
101
|
-
),
|
|
102
|
-
() =>
|
|
99
|
+
const i = Ie(), { devices: ue, device: y, saveDevices: de, setDevice: H } = Le(), w = m(!1), T = m(!1), N = m(!1), k = m(!1), R = m(!1), P = m(!1), g = m(), q = m(0), a = m(s.type ?? "RFID"), Q = [], x = E(
|
|
100
|
+
() => a.value === "RFID" ? "RFID_Scanning" : "QR_Scanning"
|
|
101
|
+
), S = E(
|
|
102
|
+
() => a.value === "RFID" ? "RFID_Connecting" : "QR_Connecting"
|
|
103
103
|
);
|
|
104
|
-
E(() => `The scanner could not identify the ${
|
|
105
|
-
const
|
|
106
|
-
window.scannerWorker ?? (window.scannerWorker = new
|
|
107
|
-
},
|
|
108
|
-
const { serialNumber: e = "" } =
|
|
104
|
+
E(() => `The scanner could not identify the ${a.value} code. It may be damaged or improperly positioned. Please check the code and try again.`);
|
|
105
|
+
const ve = () => {
|
|
106
|
+
window.scannerWorker ?? (window.scannerWorker = new xe());
|
|
107
|
+
}, B = () => {
|
|
108
|
+
const { serialNumber: e = "" } = y.value[a.value] ?? {};
|
|
109
109
|
return e;
|
|
110
|
-
},
|
|
110
|
+
}, Y = async () => {
|
|
111
111
|
try {
|
|
112
|
-
|
|
112
|
+
ve(), await me(), w.value = !0;
|
|
113
113
|
} catch (e) {
|
|
114
114
|
console.error(e), w.value = !1;
|
|
115
115
|
}
|
|
116
|
-
},
|
|
117
|
-
var e;
|
|
116
|
+
}, me = async () => {
|
|
117
|
+
var e, o;
|
|
118
118
|
try {
|
|
119
|
-
if (!
|
|
119
|
+
if (!Se())
|
|
120
120
|
throw new Error("NOT_SUPPORTED_SYSTEM");
|
|
121
|
-
if (
|
|
121
|
+
if (c("connect"), !ue.value.length || !y.value[a.value])
|
|
122
122
|
throw new Error("HARDWARE_NOT_SYNCHRONIZED");
|
|
123
|
-
|
|
123
|
+
i.add({
|
|
124
124
|
customMessage: !0,
|
|
125
|
-
message:
|
|
125
|
+
message: a.value === "QR" ? "Connecting QR Scanner..." : "Connecting RFID Scanner...",
|
|
126
126
|
severity: "info",
|
|
127
127
|
life: 0,
|
|
128
|
-
group:
|
|
129
|
-
}),
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
group: S.value
|
|
129
|
+
}), N.value = !0;
|
|
130
|
+
const n = () => {
|
|
131
|
+
c("connected", y.value[a.value]), setTimeout(() => {
|
|
132
|
+
$();
|
|
133
133
|
}, 0);
|
|
134
134
|
};
|
|
135
|
-
window.scannerWorker.onmessage = ({ data:
|
|
136
|
-
var
|
|
137
|
-
if (
|
|
135
|
+
window.scannerWorker.onmessage = ({ data: r }) => {
|
|
136
|
+
var I;
|
|
137
|
+
if (r.status === "connection_established")
|
|
138
138
|
try {
|
|
139
|
-
const { error:
|
|
139
|
+
const { error: f } = (r == null ? void 0 : r.data) ?? {}, l = ((I = r == null ? void 0 : r.data) == null ? void 0 : I.deviceList) ?? [], _ = y.value[s.type], v = l.some(
|
|
140
140
|
(W) => W.serialNumber === (_ == null ? void 0 : _.serialNumber)
|
|
141
141
|
);
|
|
142
|
-
if (
|
|
143
|
-
|
|
142
|
+
if (l.length && v)
|
|
143
|
+
n();
|
|
144
144
|
else {
|
|
145
|
-
if (
|
|
145
|
+
if (f === "Driver not connected to server")
|
|
146
146
|
throw new Error("DRIVER_NOT_FOUND");
|
|
147
|
-
if (!
|
|
147
|
+
if (!l.length)
|
|
148
148
|
throw new Error("DEVICE_NOT_CONNECTED");
|
|
149
149
|
}
|
|
150
|
-
|
|
151
|
-
} catch (
|
|
152
|
-
|
|
150
|
+
i.removeGroup(S.value);
|
|
151
|
+
} catch (f) {
|
|
152
|
+
Z(f);
|
|
153
153
|
}
|
|
154
|
-
else
|
|
154
|
+
else r.status === "connection_reused" ? n() : r.status === "error_connecting" && (i.removeGroup(S.value), i.add({
|
|
155
155
|
customMessage: !0,
|
|
156
156
|
message: "Scanner connection failed",
|
|
157
157
|
severity: "error"
|
|
158
158
|
}));
|
|
159
159
|
}, window.scannerWorker.postMessage({
|
|
160
160
|
command: "connect",
|
|
161
|
-
userId: (e = JSON.parse(localStorage.getItem("user") ?? "{}")) == null ? void 0 : e._id
|
|
161
|
+
userId: (e = JSON.parse(localStorage.getItem("user") ?? "{}")) == null ? void 0 : e._id,
|
|
162
|
+
companyCode: (o = JSON.parse(localStorage.getItem("user") ?? "{}")) == null ? void 0 : o.companyCode
|
|
162
163
|
});
|
|
163
|
-
} catch (
|
|
164
|
-
|
|
164
|
+
} catch (n) {
|
|
165
|
+
Z(n);
|
|
165
166
|
}
|
|
166
|
-
},
|
|
167
|
-
var
|
|
168
|
-
|
|
169
|
-
const n =
|
|
167
|
+
}, $ = (e = !1, o = !1) => {
|
|
168
|
+
var r, I;
|
|
169
|
+
P.value = !1, i.removeGroup(S.value), localStorage.devmode || (window.addEventListener("blur", M), window.addEventListener("beforeunload", M));
|
|
170
|
+
const n = y.value[a.value];
|
|
170
171
|
if (n) {
|
|
171
|
-
let
|
|
172
|
-
s.bulk ?
|
|
172
|
+
let f = "";
|
|
173
|
+
s.bulk ? f = `bulkscan-${a.value.toLowerCase()}` : f = `scan-${a.value.toLowerCase()}`, window.scannerWorker.onmessage = async ({ data: l }) => {
|
|
173
174
|
var _;
|
|
174
|
-
if (
|
|
175
|
-
|
|
176
|
-
|
|
175
|
+
if (l.status === "scan_started")
|
|
176
|
+
o || (q.value++, setTimeout(() => {
|
|
177
|
+
i.add({
|
|
177
178
|
customMessage: !0,
|
|
178
179
|
message: "scanning",
|
|
179
180
|
severity: "info",
|
|
180
181
|
life: 0,
|
|
181
|
-
group:
|
|
182
|
+
group: x.value
|
|
182
183
|
});
|
|
183
184
|
}, 0));
|
|
184
|
-
else if (
|
|
185
|
-
const { code:
|
|
186
|
-
if (W) return
|
|
187
|
-
if (
|
|
188
|
-
if (["scan-rfid", "scan-qr"].includes(
|
|
189
|
-
|
|
190
|
-
const
|
|
185
|
+
else if (l.status === "scanned") {
|
|
186
|
+
const { code: v, error: W, deviceList: we } = (l == null ? void 0 : l.data) ?? {};
|
|
187
|
+
if (W) return pe(W, we);
|
|
188
|
+
if (v) {
|
|
189
|
+
if (["scan-rfid", "scan-qr"].includes(f)) {
|
|
190
|
+
R.value = !!s.scanValidation;
|
|
191
|
+
const j = await ((_ = s.scanValidation) == null ? void 0 : _.call(
|
|
191
192
|
s,
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
a.value,
|
|
194
|
+
v,
|
|
195
|
+
B()
|
|
195
196
|
)) ?? !0;
|
|
196
|
-
if (
|
|
197
|
-
s.autoSwitch ? (
|
|
197
|
+
if (R.value = !1, j)
|
|
198
|
+
s.autoSwitch ? (X(), ge()) : h(!0);
|
|
198
199
|
else {
|
|
199
|
-
|
|
200
|
+
P.value || $(!1, !0);
|
|
200
201
|
return;
|
|
201
202
|
}
|
|
202
203
|
}
|
|
203
|
-
if (!
|
|
204
|
+
if (!Q.includes(v)) {
|
|
204
205
|
try {
|
|
205
|
-
|
|
206
|
-
tag:
|
|
207
|
-
serialNumber:
|
|
206
|
+
Ce.postScanLog({
|
|
207
|
+
tag: v,
|
|
208
|
+
serialNumber: B()
|
|
208
209
|
});
|
|
209
|
-
} catch (
|
|
210
|
-
console.error(
|
|
210
|
+
} catch (j) {
|
|
211
|
+
console.error(j);
|
|
211
212
|
}
|
|
212
|
-
|
|
213
|
+
c("update:modelValue", v), c("scan", v, B()), s.bulk && Q.push(v);
|
|
213
214
|
}
|
|
214
215
|
}
|
|
215
|
-
} else
|
|
216
|
-
}, window.scannerWorker.onerror =
|
|
216
|
+
} else l.status === "scan_stopped" ? h(!0) : l.status === "scan_error" && K(l.error);
|
|
217
|
+
}, window.scannerWorker.onerror = K, window.scannerWorker.postMessage({
|
|
217
218
|
command: "scan",
|
|
218
|
-
scanCommand:
|
|
219
|
-
userId: (
|
|
219
|
+
scanCommand: f,
|
|
220
|
+
userId: (r = JSON.parse(localStorage.getItem("user") ?? "{}")) == null ? void 0 : r._id,
|
|
221
|
+
companyCode: (I = JSON.parse(localStorage.getItem("user") ?? "{}")) == null ? void 0 : I.companyCode,
|
|
220
222
|
source: "app",
|
|
221
223
|
jenisDevice: n.jenisDevice,
|
|
222
224
|
serialNumber: n.serialNumber,
|
|
223
225
|
newConnection: e
|
|
224
226
|
});
|
|
225
227
|
}
|
|
226
|
-
},
|
|
227
|
-
|
|
228
|
-
},
|
|
228
|
+
}, Z = (e) => {
|
|
229
|
+
H({ RFID: void 0, QR: void 0 }), k.value = !0, g.value = e instanceof Error ? e.message : Te(e), N.value = !1, c("error", e), i.removeGroup(S.value);
|
|
230
|
+
}, pe = (e, o = []) => {
|
|
229
231
|
let n = "";
|
|
230
|
-
|
|
232
|
+
g.value = void 0, C(!0), e === "Time out" ? n = "The scanning process has timed out. Please try again." : e === "Driver not connected to server" ? g.value = "DRIVER_NOT_FOUND" : e === "Device disconnected" && (g.value = "DEVICE_DISCONNECTED", de(o), H({ RFID: void 0, QR: void 0 })), c("error", e), k.value = !!g.value, n && i.add({
|
|
231
233
|
customMessage: !0,
|
|
232
234
|
message: n,
|
|
233
235
|
error: e,
|
|
234
236
|
life: 6e3,
|
|
235
|
-
group:
|
|
237
|
+
group: x.value
|
|
236
238
|
});
|
|
237
|
-
},
|
|
238
|
-
|
|
239
|
+
}, K = (e) => {
|
|
240
|
+
C(!0), c("error", e), i.add({
|
|
239
241
|
customMessage: !0,
|
|
240
242
|
message: "An unexpected error occurred during scanning. Please try again, and if the issue persists, contact your administrator for assistance.",
|
|
241
243
|
error: e,
|
|
242
244
|
life: 6e3,
|
|
243
|
-
group:
|
|
245
|
+
group: x.value
|
|
244
246
|
});
|
|
245
|
-
},
|
|
246
|
-
window.Cypress ?
|
|
247
|
-
},
|
|
248
|
-
|
|
247
|
+
}, L = () => {
|
|
248
|
+
window.Cypress ? fe() : Y();
|
|
249
|
+
}, fe = () => {
|
|
250
|
+
i.add({
|
|
249
251
|
customMessage: !0,
|
|
250
252
|
message: "Connecting device...",
|
|
251
253
|
severity: "info",
|
|
252
254
|
life: 3e3,
|
|
253
|
-
group:
|
|
255
|
+
group: S.value
|
|
254
256
|
}), setTimeout(async () => {
|
|
255
257
|
var e;
|
|
256
|
-
if (
|
|
258
|
+
if (c("connect"), c("connected", {
|
|
257
259
|
jenisDevice: "Handheld",
|
|
258
|
-
serialNumber:
|
|
260
|
+
serialNumber: G(),
|
|
259
261
|
API: "v2",
|
|
260
262
|
rfidScan: !0,
|
|
261
263
|
qrScan: !0,
|
|
262
264
|
name: "Device Test"
|
|
263
265
|
}), s.bulk)
|
|
264
|
-
|
|
266
|
+
c("scan", G(), "serialNumber");
|
|
265
267
|
else {
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
+
const o = G();
|
|
269
|
+
R.value = !!s.scanValidation;
|
|
268
270
|
const n = await ((e = s.scanValidation) == null ? void 0 : e.call(
|
|
269
271
|
s,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
272
|
+
a.value,
|
|
273
|
+
o,
|
|
274
|
+
B()
|
|
273
275
|
)) ?? !0;
|
|
274
|
-
|
|
276
|
+
R.value = !1, n && (c("scan", o, "serialNumber"), h());
|
|
275
277
|
}
|
|
276
278
|
}, 100);
|
|
277
|
-
},
|
|
278
|
-
|
|
279
|
+
}, X = () => {
|
|
280
|
+
i.removeGroup("RFID_Scanning"), i.removeGroup("QR_Scanning");
|
|
279
281
|
}, h = (e = !1) => {
|
|
280
|
-
|
|
281
|
-
},
|
|
282
|
-
var
|
|
282
|
+
X(), N.value = !1, ee(), e && c("stop"), Q.splice(0);
|
|
283
|
+
}, C = (e = !1) => {
|
|
284
|
+
var o, n;
|
|
283
285
|
window.scannerWorker.onmessage = null, window.scannerWorker.postMessage({
|
|
284
286
|
command: "stopscan",
|
|
285
|
-
userId: (
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
s.bulk || (S.value[o.value] ? (o.value = o.value === "QR" ? "RFID" : "QR", Q()) : (h(), N.value = !0, f.value = "HARDWARE_NOT_SYNCHRONIZED", k.value = !1));
|
|
289
|
-
}, L = (e) => {
|
|
290
|
-
O.value = !0, I(!0), e.preventDefault();
|
|
291
|
-
}, X = () => {
|
|
292
|
-
window.removeEventListener("blur", L), window.removeEventListener("beforeunload", L);
|
|
287
|
+
userId: (o = JSON.parse(localStorage.getItem("user") ?? "{}")) == null ? void 0 : o._id,
|
|
288
|
+
companyCode: (n = JSON.parse(localStorage.getItem("user") ?? "{}")) == null ? void 0 : n.companyCode
|
|
289
|
+
}), h(e), P.value = !0, w.value = !1;
|
|
293
290
|
}, ge = () => {
|
|
291
|
+
s.bulk || (y.value[a.value] ? (a.value = a.value === "QR" ? "RFID" : "QR", $()) : (h(), k.value = !0, g.value = "HARDWARE_NOT_SYNCHRONIZED", N.value = !1));
|
|
292
|
+
}, M = (e) => {
|
|
293
|
+
T.value = !0, C(!0), e.preventDefault();
|
|
294
|
+
}, ee = () => {
|
|
295
|
+
window.removeEventListener("blur", M), window.removeEventListener("beforeunload", M);
|
|
296
|
+
}, Se = () => {
|
|
294
297
|
const { userAgent: e } = navigator;
|
|
295
298
|
return e.includes("Windows");
|
|
296
299
|
}, be = E(() => {
|
|
297
300
|
if (!s.labelOnly)
|
|
298
|
-
return s.icon ? s.icon : s.autoSwitch ? "qr-scan" :
|
|
299
|
-
}),
|
|
300
|
-
return
|
|
301
|
-
onBeforeStartScan:
|
|
302
|
-
startScan:
|
|
303
|
-
stopScan:
|
|
304
|
-
}), (e,
|
|
305
|
-
b(
|
|
301
|
+
return s.icon ? s.icon : s.autoSwitch ? "qr-scan" : a.value === "QR" ? "qr" : "rfid";
|
|
302
|
+
}), ye = E(() => s.label ? s.label : s.autoSwitch ? "SCAN TAG" : a.value === "QR" ? "Scan QR" : "Scan RFID");
|
|
303
|
+
return u({
|
|
304
|
+
onBeforeStartScan: L,
|
|
305
|
+
startScan: Y,
|
|
306
|
+
stopScan: C
|
|
307
|
+
}), (e, o) => (d(), D(F, null, [
|
|
308
|
+
b(oe, Ne(e.$attrs, {
|
|
306
309
|
class: [
|
|
307
310
|
{
|
|
308
311
|
"[&_i]:w-2 [&_i]:h-2": e.type === "QR",
|
|
@@ -313,105 +316,105 @@ const ie = () => window.devices ?? [], xe = () => window.device ?? { RFID: null,
|
|
|
313
316
|
],
|
|
314
317
|
disabled: s.disabled,
|
|
315
318
|
icon: be.value,
|
|
316
|
-
label:
|
|
319
|
+
label: ye.value,
|
|
317
320
|
outlined: s.outlined,
|
|
318
321
|
severity: s.severity,
|
|
319
322
|
size: s.size,
|
|
320
|
-
onClick:
|
|
323
|
+
onClick: L
|
|
321
324
|
}), null, 16, ["class", "disabled", "icon", "label", "outlined", "severity", "size"]),
|
|
322
|
-
b(
|
|
323
|
-
visible:
|
|
324
|
-
"onUpdate:visible":
|
|
325
|
+
b(Oe, {
|
|
326
|
+
visible: k.value,
|
|
327
|
+
"onUpdate:visible": o[0] || (o[0] = (n) => k.value = n),
|
|
325
328
|
bulk: e.bulk,
|
|
326
|
-
"error-code":
|
|
327
|
-
"search-by":
|
|
328
|
-
onScan:
|
|
329
|
+
"error-code": g.value,
|
|
330
|
+
"search-by": a.value,
|
|
331
|
+
onScan: L
|
|
329
332
|
}, null, 8, ["visible", "bulk", "error-code", "search-by"]),
|
|
330
|
-
w.value ? (
|
|
333
|
+
w.value ? (d(), U(z, {
|
|
331
334
|
key: 0,
|
|
332
335
|
"base-z-index": 9983,
|
|
333
|
-
group:
|
|
336
|
+
group: S.value,
|
|
334
337
|
icon: "info"
|
|
335
|
-
}, null, 8, ["group"])) :
|
|
336
|
-
w.value ? (
|
|
338
|
+
}, null, 8, ["group"])) : V("", !0),
|
|
339
|
+
w.value ? (d(), U(z, {
|
|
337
340
|
key: 1,
|
|
338
341
|
"base-z-index": 9997,
|
|
339
342
|
class: "!absolute !bottom-[80px] !h-max",
|
|
340
343
|
group: "scan-error-validation"
|
|
341
|
-
})) :
|
|
342
|
-
w.value ? (
|
|
343
|
-
key:
|
|
344
|
+
})) : V("", !0),
|
|
345
|
+
w.value ? (d(), U(z, {
|
|
346
|
+
key: q.value,
|
|
344
347
|
"base-z-index": 9984,
|
|
345
|
-
group:
|
|
348
|
+
group: x.value,
|
|
346
349
|
class: "[&_[data-pc-section=buttoncontainer]]"
|
|
347
350
|
}, {
|
|
348
351
|
message: ke(({ message: n }) => [
|
|
349
|
-
|
|
350
|
-
class:
|
|
352
|
+
O("div", {
|
|
353
|
+
class: se(
|
|
351
354
|
n.detail == "scanning" ? "w-full -mr-8 z-10 flex gap-2 justify-between items-center text-general-800 text-xs font-normal" : "w-full"
|
|
352
355
|
)
|
|
353
356
|
}, [
|
|
354
|
-
n.detail === "scanning" ? (
|
|
355
|
-
|
|
356
|
-
b(
|
|
357
|
+
n.detail === "scanning" ? (d(), D(F, { key: 0 }, [
|
|
358
|
+
O("section", Me, [
|
|
359
|
+
b(J, {
|
|
357
360
|
class: "animate-spin text-base",
|
|
358
361
|
icon: "loader-4"
|
|
359
362
|
}),
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
b(
|
|
363
|
+
O("span", We, [
|
|
364
|
+
a.value === "RFID" ? (d(), D(F, { key: 0 }, [
|
|
365
|
+
b(J, {
|
|
363
366
|
class: "text-base !w-4 !h-4",
|
|
364
367
|
icon: "rfid"
|
|
365
368
|
}),
|
|
366
|
-
|
|
367
|
-
], 64)) : (
|
|
368
|
-
b(
|
|
369
|
+
ne(" " + A(R.value ? "Validating RFID..." : "RFID Scanning..."), 1)
|
|
370
|
+
], 64)) : (d(), D(F, { key: 1 }, [
|
|
371
|
+
b(J, {
|
|
369
372
|
class: "text-sm",
|
|
370
373
|
icon: "qr"
|
|
371
374
|
}),
|
|
372
|
-
|
|
375
|
+
ne(" " + A(R.value ? "Validating QR..." : "QR Scanning..."), 1)
|
|
373
376
|
], 64))
|
|
374
377
|
])
|
|
375
378
|
]),
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
b(
|
|
379
|
-
onClick:
|
|
379
|
+
O("section", Fe, [
|
|
380
|
+
o[4] || (o[4] = O("span", null, "do not leave this page", -1)),
|
|
381
|
+
b(oe, {
|
|
382
|
+
onClick: o[1] || (o[1] = (r) => C(!0)),
|
|
380
383
|
label: "Stop Scan",
|
|
381
384
|
severity: "danger"
|
|
382
385
|
})
|
|
383
386
|
])
|
|
384
|
-
], 64)) : (
|
|
387
|
+
], 64)) : (d(), D("span", Ue, A(n.detail), 1))
|
|
385
388
|
], 2)
|
|
386
389
|
]),
|
|
387
390
|
_: 1
|
|
388
|
-
}, 8, ["group"])) :
|
|
391
|
+
}, 8, ["group"])) : V("", !0),
|
|
389
392
|
b(Ee, {
|
|
390
|
-
visible:
|
|
391
|
-
"onUpdate:visible":
|
|
392
|
-
header: `${
|
|
393
|
-
onConfirm:
|
|
393
|
+
visible: T.value,
|
|
394
|
+
"onUpdate:visible": o[2] || (o[2] = (n) => T.value = n),
|
|
395
|
+
header: `${a.value} SCAN STOPPED`,
|
|
396
|
+
onConfirm: o[3] || (o[3] = (n) => (T.value = !1, L())),
|
|
394
397
|
"confirm-label": "Continue",
|
|
395
398
|
message: "The scan process was interrupted because you want to leave this window.",
|
|
396
399
|
severity: "danger"
|
|
397
400
|
}, null, 8, ["visible", "header"]),
|
|
398
|
-
(
|
|
399
|
-
|
|
401
|
+
(d(), U(he, { to: "body" }, [
|
|
402
|
+
N.value ? (d(), D("div", {
|
|
400
403
|
key: 0,
|
|
401
|
-
class:
|
|
404
|
+
class: se([
|
|
402
405
|
e.$preset.dialog.mask({ props: { modal: !0 } }).class,
|
|
403
406
|
"w-screen h-screen fixed top-0 left-0",
|
|
404
407
|
"!z-[9982]"
|
|
405
408
|
]),
|
|
406
409
|
"data-ts-section": "toast-mask"
|
|
407
|
-
}, null, 2)) :
|
|
410
|
+
}, null, 2)) : V("", !0)
|
|
408
411
|
]))
|
|
409
412
|
], 64));
|
|
410
413
|
}
|
|
411
414
|
});
|
|
412
415
|
export {
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
416
|
+
xe as W,
|
|
417
|
+
qe as _,
|
|
418
|
+
Te as g,
|
|
419
|
+
Le as u
|
|
417
420
|
};
|